Bladeren bron

课堂观察与智能表单

SanHQin 1 maand geleden
bovenliggende
commit
8c945d6015

+ 3 - 0
src/components/pages/classroomObservation/components/analysisTemplateDialog.vue

@@ -627,6 +627,7 @@ export default {
 							this.dialogTagList2 = tagList.dialogTagList
 						}
             this.tagBox = 2;
+            this.$forceUpdate();
           } else {
             this.$message.error("获取模板详细为空");
           }
@@ -1175,6 +1176,7 @@ export default {
   background-color: #fff;
   box-sizing: border-box;
   padding: 12px;
+  display: block !important;
 }
 
 .ad_h_top {
@@ -1252,6 +1254,7 @@ export default {
   overflow: auto;
   padding: 12px;
   box-sizing: border-box;
+  display: block !important;
 }
 
 .bb_preview:hover {

+ 115 - 35
src/components/pages/classroomObservation/dialog/batchCreationClassDialog.vue

@@ -64,6 +64,11 @@
                   >批量导出doc</span
                 >
               </span>
+              <span>
+                <span @click="regenerateTheReport" style="color:#409EFF"
+                  >批量重新生成报告</span
+                >
+              </span>
               <span>
                 <span @click="delSelectBtn" style="color: red;">删除</span>
                 <!-- <img
@@ -252,11 +257,11 @@ export default {
         i => !i.isOtherData && i.jsonData.name != "词频词汇分析"
       );
 
-      _analysisList.forEach(i=>{
-        if(i.jsonData.spectrogramData){
-          delete i.jsonData.spectrogramData
+      _analysisList.forEach(i => {
+        if (i.jsonData.spectrogramData) {
+          delete i.jsonData.spectrogramData;
         }
-      })
+      });
       let promiseList = [];
 
       fileDataList.forEach(i => {
@@ -778,6 +783,25 @@ export default {
           .catch(() => {
             console.log("不暂停");
           });
+      } else if (type === "regenerateTheReport" && id) {
+        this.$confirm("您确定要重新生成任报告吗?。", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            this.dataList.find(i => i.id === id).status = "0";
+            this.dataList
+              .find(i => i.id === id)
+              .jsonData.steps.find(i => i.type == "generateReport").status =
+              "0";
+            if (!this.dataList.some(i => i.status == "1")) {
+              this.startTask(id);
+            }
+          })
+          .catch(() => {
+            console.log("不暂停");
+          });
       }
     },
     async startTask(id) {
@@ -1237,7 +1261,20 @@ export default {
                   this.dataList.find(i => i.id === _startData.id).jsonData
                 )
               );
+              if (
+                this.dataList
+                  .find(i => i.id === _startData.id)
+                  .jsonData.steps.find(i => i.type === "createClass").status ===
+                "1"
+              ) {
+                this.dataList.find(i => i.id === _startData.id).status = "2";
+                if (this.dataList.find(i => i.status == "0")) {
+                  let id = this.dataList.find(i => i.status == "0").id;
+                  this.startTask(id);
+                }
+              }
             });
+
             if (!this.nowDoTaskId.includes(_startData.id)) break;
           } else if (_step.type === "createClass") {
             //创建课堂
@@ -1311,6 +1348,13 @@ export default {
         this.nowDoTaskId = this.nowDoTaskId.filter(i => i !== id);
       }
 
+      if (
+        stopTask.jsonData.steps.find(i => i.type == "createClass").status == 1
+      ) {
+        this.dataList.find(i => i.id === id).status = "2";
+        this.nowDoTaskId = this.nowDoTaskId.filter(i => i !== id);
+      }
+
       console.log(stopTask);
 
       let _waitTask = this.dataList.find(i => i.status === "0");
@@ -1369,42 +1413,50 @@ export default {
 
       let fileList = [];
 
-      for(let i=0;i<_copyExportData.length;i++){
+      for (let i = 0; i < _copyExportData.length; i++) {
         // _copyExportData[i].jsonData.baseMessage.courseName =
         // _copyExportData[i].jsonData.baseMessage.courseName + "_" + i;
         fileList.push(await this.getDocFnPromise(_copyExportData[i]));
       }
 
       if (fileList.length == 1) {
-          saveAs(fileList[0], `${fileList[0].name}`);
-          this.$message.success("导出报告成功");
-
-        } else if (fileList.length > 1) {
-          const zip = new JSZip();
-
-          fileList.forEach((i, index) => {
-            let fileName = i.name;
-
-            if (fileList.map(i => i.name).filter((fi,findex)=>findex!==index).includes(fileName))fileName = fileName.replace(/\.[^/.]+$/, "") + `(${index}).` + fileName.replace(/^.*\./, "");
-            // let fileName = i.name;
-            // let fileNames = fileList.map(file => file.name);
-            // let count = 1;
-            // while (fileNames.includes(fileName)) {
-            //   let nameWithoutExtension = fileName.replace(/\.[^/.]+$/, "");
-            //   let extension = fileName.replace(nameWithoutExtension, "");
-            //   fileName = `${nameWithoutExtension}(${count})${extension}`;
-            //   count++;
-            // }
-            zip.file(fileName, i, { binary: true });
-          });
-          zip.generateAsync({ type: "blob" }).then(content => {
-            // 生成二进制流
-            saveAs(content, `课堂观察报告.zip`); // 利用file-saver保存文件  自定义文件名
-          });
+        saveAs(fileList[0], `${fileList[0].name}`);
+        this.$message.success("导出报告成功");
+      } else if (fileList.length > 1) {
+        const zip = new JSZip();
 
-          this.$message.success("导出报告成功");
-        }
-        _notify.close();
+        fileList.forEach((i, index) => {
+          let fileName = i.name;
+
+          if (
+            fileList
+              .map(i => i.name)
+              .filter((fi, findex) => findex !== index)
+              .includes(fileName)
+          )
+            fileName =
+              fileName.replace(/\.[^/.]+$/, "") +
+              `(${index}).` +
+              fileName.replace(/^.*\./, "");
+          // let fileName = i.name;
+          // let fileNames = fileList.map(file => file.name);
+          // let count = 1;
+          // while (fileNames.includes(fileName)) {
+          //   let nameWithoutExtension = fileName.replace(/\.[^/.]+$/, "");
+          //   let extension = fileName.replace(nameWithoutExtension, "");
+          //   fileName = `${nameWithoutExtension}(${count})${extension}`;
+          //   count++;
+          // }
+          zip.file(fileName, i, { binary: true });
+        });
+        zip.generateAsync({ type: "blob" }).then(content => {
+          // 生成二进制流
+          saveAs(content, `课堂观察报告.zip`); // 利用file-saver保存文件  自定义文件名
+        });
+
+        this.$message.success("导出报告成功");
+      }
+      _notify.close();
 
       // _exportList.forEach((i, index) => {
       //   i.jsonData.baseMessage.courseName =
@@ -1434,8 +1486,36 @@ export default {
       //   .catch(err => {
       //     console.log("err", err);
       //   });
-    }
-  },
+    },
+    async regenerateTheReport(){
+      let _generateList = this.dataList.filter(
+        i =>
+          this.selectList.includes(i.id) &&
+          (this.selectStatus === "99" ||
+            this.statusList
+              .find(i2 => i2.value === this.selectStatus)
+              .allow.includes(i.status)) &&
+          i.status == "2"
+      );
+
+      if(_generateList.length<=0)return this.$message.info("请先选择已经完成的任务列表");
+
+      this.$confirm("确认要重新生成课堂观察报告吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        _generateList.forEach(i=>{
+          this.dataList.find(i2=>i2.id==i.id).status = "0";
+          this.dataList.find(i2 => i2.id === i.id).jsonData.steps.find(i2 => i2.type == "generateReport").status ="0";
+        })
+
+        if (!this.dataList.some(i => i.status == "1")) {
+          this.startTask(_generateList[0].id);
+        }
+      })
+      }
+    },
   mounted() {
     this.getTaskList();
     this.getDialogTagDataList();

+ 6 - 5
src/components/pages/classroomObservation/newComponents/batchClassCard.vue

@@ -151,12 +151,12 @@
             v-if="['2'].includes(cardData.status)"
             >查看报告</el-button
           >
-          <!-- <el-button
+          <el-button
             size="small"
             @click="regenerate"
-            v-if="['2', '3'].includes(cardData.status)"
-            >重新生成</el-button
-          > -->
+            v-if="['2'].includes(cardData.status)"
+            >重新生成报告</el-button
+          >
           <el-button
             size="small"
             type="primary"
@@ -320,7 +320,8 @@ export default {
     },
     //重新生成
     regenerate() {
-      this.$message.info("重新生成");
+      // this.$message.info("重新生成");
+      this.$emit("taskBtn", { type: "regenerateTheReport", id: this.cardData.id });
     },
     changeRemarks(newValue) {
       if (this.data.remarks != newValue) {

+ 19 - 1
src/components/pages/test/check/index.vue

@@ -2410,7 +2410,7 @@ export default {
       // console.log('6666',val);
 
       console.log('loopSco',val);
-      
+
       let userWork =[]
       let _fileid = ''
 for (let index = 0; index < val.array.length; index++) {
@@ -2846,6 +2846,24 @@ for (let index = 0; index < val.array.length; index++) {
       );
     },
     editTest(row){
+      this.$router.push(
+        "/doTest?cid=" +
+          row.courseid +
+          "&userid=" +
+          this.userid +
+          "&userid2=" +
+          row.userid +
+          "&tid=" +
+          row.id +
+          "&oid=" +
+          this.oid +
+          "&org=" +
+          this.org +
+          "&type=3" +
+          "&role=" +
+          this.role +
+          "&back=1"
+      );
       // doTest?cid=721eadc1-087c-11f0-b508-005056924926&tid=66db0a89-0a11-11f0-9261-005056924926&userid=6c56ec0e-2c74-11ef-bee5-005056b86db5&oid=414f2361-ad04-11ed-b13d-005056b86db5&org=0fec3a8a-ad04-11ed-b13d-005056b86db5&type=3&role=0
       console.log("编辑",row)
     },

+ 10 - 5
src/components/pages/testStudent/view/preview.vue

@@ -15,7 +15,7 @@
       org +
       '&role=' +
       role,
-  }" v-if="type == 3">个人中心</el-breadcrumb-item>
+  }" v-if="type == 3 && back!=1">个人中心</el-breadcrumb-item>
               <el-breadcrumb-item :to="{
     path:
       '/testStudent?userid=' +
@@ -30,7 +30,7 @@
       isN +
       '&tcid=' +
       tcid ,
-  }" v-else>表单中心</el-breadcrumb-item>
+  }" v-else v-show="back!=1">表单中心</el-breadcrumb-item>
               <el-breadcrumb-item>
                 <span style="color: rgb(15, 126, 255)">{{ title }}</span>
               </el-breadcrumb-item>
@@ -87,7 +87,8 @@ export default {
       isReset: false,
       isloading: false,
       courseid: '',
-      gcourseid: this.$route.query.courseid
+      gcourseid: this.$route.query.courseid,
+      back:this.$route.query.back
     }
   },
 	computed:{
@@ -106,7 +107,9 @@ export default {
           type: "warning",
         })
         .then(() => {
-          if (this.type == 3) {
+          if(this.back==1){
+            this.$router.back()
+          }else if (this.type == 3) {
             this.goTo(
               "/testPerson?userid=" +
               this.userid +
@@ -541,7 +544,9 @@ export default {
         .post(this.$store.state.api + ((this.tid) ? "addTestWorks2" : "addTestWorks"), params)
         .then((res) => {
           this.$message.success('提交成功')
-          if (this.type == 3) {
+          if(this.back==1){
+            this.$router.back()
+          }else if (this.type == 3) {
             this.goTo(
               "/testPerson?userid=" +
               this.userid +