lsc 1 år sedan
förälder
incheckning
2d4d6010d8

+ 1 - 1
dist/index.html

@@ -25,7 +25,7 @@
       height: 100%;
       width: 100%;
       background: #e6eaf0;
-    }</style><link href=./static/css/app.4bbebff235ee2844206d70ad501fd103.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.571c38d63f24b1ae9e16.js></script><script type=text/javascript src=./static/js/vendor.bd1670b339dc7e372852.js></script><script type=text/javascript src=./static/js/app.f8f9d62cb0366f184490.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.d27710b54fde679b5a9dcee1a4a30527.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.571c38d63f24b1ae9e16.js></script><script type=text/javascript src=./static/js/vendor.e51d5125d19cac079824.js></script><script type=text/javascript src=./static/js/app.ec3d1d4bcaf07cff2996.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/css/app.d27710b54fde679b5a9dcee1a4a30527.css


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/css/app.d27710b54fde679b5a9dcee1a4a30527.css.map


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/js/app.ec3d1d4bcaf07cff2996.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/js/app.ec3d1d4bcaf07cff2996.js.map


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/js/manifest.571c38d63f24b1ae9e16.js.map


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/js/vendor.e51d5125d19cac079824.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/static/js/vendor.e51d5125d19cac079824.js.map


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 390 - 68
package-lock.json


+ 1 - 1
src/components/pages/studentManage/grade/index.vue

@@ -74,7 +74,7 @@
               </el-table-column>
               <el-table-column prop="pnum" label="班级数" min-width="40%" align="center">
               </el-table-column>
-              <el-table-column label="操作" min-width="20%">
+              <el-table-column label="操作" width="250px">
                 <template slot-scope="scope">
                   <el-button type="primary" size="small" @click="getStudent(scope.row.id)">查看班级</el-button>
                   <el-button type="primary" size="small" @click="openUpdate(scope.row.id, scope.row.name)">修改</el-button>

+ 97 - 4
src/components/pages/test/check/index.vue

@@ -73,6 +73,7 @@
                 <span class="serach_icon" @click="searchCourse"></span>
               </div>
               <div class="btnA" v-if="stype == 1 && !pdfLoading" @click="exportPDF">导出PDF</div>
+              <!-- <div class="btnA" v-if="stype == 2 || stype == 3">导出人员数据</div> -->
             </div>
           </div>
           <div class="title_content" v-if="stype == 1">
@@ -167,7 +168,7 @@
               </el-table-column>
               <el-table-column prop="time" label="提交时间" width="170px" align="left">
               </el-table-column>
-              <el-table-column v-for="(item, index) in chapters" :key="index" :label="item.json.title" min-width="150"
+              <el-table-column v-for="(item, index) in chapters" :key="index" :label="item.json.title" :min-width="item.type == 5 ? 200 : 150"
                 align="left" :filters="item.type == 1 ? item.nameFilters : null"
                 :filter-method="item.type == 1 ? (value, row) => { return filterName(value, row, index) } : null"
                 :filter-placement="item.type == 1 ? filterPlacement : null">
@@ -198,9 +199,10 @@
                   </div>
                 </template>
               </el-table-column>
-              <el-table-column label="操作" width="200px" fixed="right">
+              <el-table-column label="操作" width="300px" fixed="right">
                 <template slot-scope="scope">
                   <el-button @click="getTest(scope.row)" type="primary" size="small">查看</el-button>
+                  <!-- <el-button @click="setWordHtml(scope.row)" type="primary" size="small">导出答题信息</el-button> -->
                   <el-button @click="deleteTest(scope.row.id)" type="primary" size="small">删除</el-button>
                 </template>
               </el-table-column>
@@ -215,7 +217,7 @@
                 </el-table-column>
                 <el-table-column prop="time" label="提交时间" min-width="15" align="center">
                 </el-table-column>
-                <el-table-column prop="time" label="是否批改" min-width="15" align="center">
+                <el-table-column label="是否批改" min-width="15" align="center">
                   <template slot-scope="scope">
                     <div>{{ scope.row.type == 3 ? '是' : '否' }}</div>
                   </template>
@@ -258,6 +260,7 @@ import wordcloud from 'vue-wordcloud';
 import checkPie from '../data/checkPie.vue';
 
 import { downloadPDF } from '../../../tools/pdf'
+
 export default {
   components: {
     shareBox,
@@ -476,7 +479,8 @@ export default {
                 userid: this.works[i].userid,
                 name: this.works[i].username,
                 time: this.works[i].time,
-                array: _json
+                array: _json,
+                courseJson: JSON.parse(this.works[i].courseJson),
               })
             }
           }
@@ -778,6 +782,95 @@ export default {
 
         }, 2000);
       })
+    },
+    score(json) {
+      let score = 0
+      json.forEach(el => {
+        if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
+          el.array.forEach(item => {
+            if (item.ttype == 2 && item.array.length > 0) {
+              item.array.forEach(item2 => {
+                if (item2.ttype == 1 && item2.json) {
+                  score += item2.json.score ? parseFloat(item2.json.score) : 0
+                }
+              })
+            } else if (item.ttype == 1 && item.json) {
+              score += item.json.score ? parseFloat(item.json.score) : 0
+            }
+          })
+        } else if (el.ttype == 1 && el.json) {
+          score += el.json.score ? parseFloat(el.json.score) : 0
+        }
+      })
+      return score > 0 ? score + '分' : ''
+    },
+    score2(json) {
+      let score = 0
+      // let type = 1
+      json.forEach(el => {
+        if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
+          el.array.forEach(item => {
+            if (item.ttype == 2 && item.array.length > 0) {
+              item.array.forEach(item2 => {
+                if (item2.ttype == 1 && item2.json) {
+                  score += item2.json.score2 ? parseFloat(item2.json.score2) : 0
+                }
+              })
+            } else if (item.ttype == 1 && item.json) {
+              score += item.json.score2 ? parseFloat(item.json.score2) : 0
+            }
+          })
+        } else if (el.ttype == 1 && el.json) {
+          score += el.json.score2 ? parseFloat(el.json.score2) : 0
+        }
+      })
+      return score + '分'
+    },
+    setWordHtml(data) {
+      let _data = data
+      
+      let _title = `<div style="font-size:40px;font-weight:bold;text-align:center;">${this.testJson.title}</div>`;
+      let score = this.score(data.courseJson)
+      let isScore = this.score2(data.courseJson)
+      let scoreContent = score ? `<b>(得分/总分)${isScore}/${score}</b>` : ''
+      let _content = `<div style="font-size:25px;text-align:center;margin-top: 20px;"><b style="margin-right:40px">(答题人)${_data.name}</b>${scoreContent}(填写范围)${this.testJson.juriP ? this.testJson.juriP : '所有人'}(提交时间)${_data.time}</div>`
+      let _detail = this.testJson.brief ? `<div style="font-size:25px;text-align:center;margin-top: 20px;">${this.testJson.brief}</div>` : '' 
+
+      let _html = _title + _content + _detail;
+      this.exportToWord(_data.name, _html);
+    },
+    async exportToWord(a, html) {
+      // 将html文件中需要用到的数据挂载到store上
+      const content = `<!DOCTYPE html>
+      <html lang="en">
+      <head>
+          <meta charset="UTF-8">
+          <meta http-equiv="X-UA-Compatible" content="IE=edge">
+          <meta name="viewport" content="width=device-width, initial-scale=1.0">
+          <title>${a}</title>
+          <style>
+          </style>
+      </head>
+      <body>
+      ${html}
+      </body>
+      </html>`;
+      // debugger
+      // 生成报告
+      const link = document.createElement("a");
+      let dname = a + ".doc";
+      // link.download = "报告.html"; // 文件名
+      link.download = dname; // 文件名
+      link.style.display = "none";
+      // 创建文件流
+      // 创建bolb实例时,内容一定要放在[]中
+      const blob = new Blob([content], {
+        type: "text/plain;charset='utf-8'",
+      });
+      link.href = window.URL.createObjectURL(blob);
+      document.body.appendChild(link);
+      link.click();
+      document.body.removeChild(link);
     }
   },
   beforeDestroy() {

Vissa filer visades inte eftersom för många filer har ändrats