11wqe1 7 months ago
parent
commit
79dbee7e03
2 changed files with 57 additions and 57 deletions
  1. 40 54
      src/components/easy2/commpont/markScore.vue
  2. 17 3
      src/components/easy2/studyStudent.vue

+ 40 - 54
src/components/easy2/commpont/markScore.vue

@@ -20,21 +20,6 @@
             <el-rate v-model="e.cog"></el-rate>
           </div>
         </div>
-
-        <!-- <div
-          v-if="scoTitList.length > 2"
-          style="color:#4188FC;cursor: pointer;width: 30%;"
-          @click="allList"
-        >
-          <div>
-            <span style="margin-right:5px;">{{
-              !showAll ? "全部" : "折叠"
-            }}</span>
-            <i
-              :class="!showAll ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
-            ></i>
-          </div>
-        </div> -->
       </div>
       <div style="width:100%;display:flex;justify-content: flex-end;">
         <el-button size="mini" @click="reset">重置</el-button>
@@ -76,6 +61,10 @@ export default {
       total: 0
     };
   },
+
+  beforeDestroy() {
+    this.getData();
+  },
   computed: {
     totalScore() {
       let a = 0;
@@ -89,20 +78,13 @@ export default {
         val2: this.wIndex,
         val3: data
       });
-
+    
       return data;
     }
   },
-  watch: {
-    refreshKey(newV, old) {
-      this.getData();
-    }
-  },
+
   mounted() {
     this.scoTitList = JSON.parse(JSON.stringify(this.scoTit));
-    // console.log("scoCon", this.scoCon);
-    // console.log("scoTit", this.scoTit);
-
     this.getData();
   },
 
@@ -125,9 +107,6 @@ export default {
               }
             });
 
-            // console.log("this.task", this.task);
-            // console.log("data2", data2);
-
             let data = JSON.parse(data2.rate);
 
             this.scoTitList.forEach((e, index) => {
@@ -138,6 +117,8 @@ export default {
                 }
               }
             });
+
+            console.log("this.scoTitList", this.scoTitList);
           }
         })
         .catch(err => {
@@ -146,35 +127,40 @@ export default {
     },
     // 重置
     reset() {
-      let data = this.scoTitList.map(e => {
-        return e.value + ":" + e.cog;
+      console.log("this.scoTitList", this.scoTitList);
+      this.scoTitList.forEach(e => {
+        e.cog = 0;
       });
-      // console.log("data", data);
-      const processedData = {};
+      // let data = this.scoTitList.map(e => {
+      //   return e.value + ":" + e.cog;
+      // });
+      // // console.log("data", data);
+      // const processedData = {};
 
-      data.forEach(item => {
-        const [key, value] = item.split(":");
-        processedData[key] = 0;
-      });
-      processedData.content = "";
-      // return console.log(processedData);
-      let params = {
-        cid: this.id,
-        s: this.stage,
-        t: this.task,
-        rate: JSON.stringify(processedData),
-        uid: this.stUid
-      };
-      // return console.log(params);
-      this.ajax
-        .get(this.$store.state.api + "updateWorksEva", params)
-        .then(res => {
-          this.getData();
-        })
-        .catch(err => {
-          this.$message.error("重置失败");
-          console.error(err);
-        });
+      // data.forEach(item => {
+      //   const [key, value] = item.split(":");
+      //   processedData[key] = 0;
+      // });
+      // processedData.content = "";
+      // this.scoTitList = processedData
+      // // return console.log(processedData);
+      // let params = {
+      //   cid: this.id,
+      //   s: this.stage,
+      //   t: this.task,
+      //   rate: JSON.stringify(processedData),
+      //   uid: this.stUid
+      // };
+      // // return console.log(params);
+      // this.ajax
+      //   .get(this.$store.state.api + "updateWorksEva", params)
+      //   .then(res => {
+      //     this.getData();
+      //   })
+      //   .catch(err => {
+      //     this.$message.error("重置失败");
+      //     console.error(err);
+      //   });
     },
     // 老师提交评分
     submit() {

+ 17 - 3
src/components/easy2/studyStudent.vue

@@ -6634,10 +6634,12 @@
                               width="300"
                               :disabled="AIloading[toolIndex][wIndex].loading"
                               trigger="click"
+                              @show="handleShow(toolIndex,wIndex)"
+                              @hide="handleHide(toolIndex,wIndex)"
                               >
                             <markScore 
                               :loading="AIloading[toolIndex][wIndex].loading" 
-                              ref="markSco" 
+                              :ref="`markSco${toolIndex}${wIndex}`"
                               @updateLoading=updateLoading
                               @updateDocSco=updateDocSco
                               :wIndex="wIndex"
@@ -6649,7 +6651,8 @@
                               :toolDetail="tool.toolDetail"
                               :stage="courseType"
                               :task="taskCount"  
-                              :scoTit="chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList">
+                              :scoTit="chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList"
+                              >
                             </markScore>
                               <div
                                 class="answerScore"
@@ -12511,7 +12514,9 @@ export default {
         # Format example
         [{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'}]
         `
-        await this.$refs.markSco[0].aiupdetaSco(msg,con[i].userid,stage,task)
+        let mk = `markSco${toolIndex}${i}`
+        // this.$refs[mk][0].getData()
+        await this.$refs[mk][0].aiupdetaSco(msg,con[i].userid,stage,task)
         // this.refreshKey++
         this.AIloading[toolIndex][i].loading=false
       }
@@ -12527,6 +12532,15 @@ export default {
     updateLoading(payload){
       this.AIloading[payload.val][payload.val2].loading=payload.val3
     },
+    handleShow(toolIndex,val) {
+      let mk = `markSco${toolIndex}${val}`
+      // console.log(mk);
+      this.$refs[mk][0].getData()
+    },
+    handleHide(toolIndex,val) {
+      let mk = `markSco${toolIndex}${val}`
+      this.$refs[mk][0].getData()
+    },
     updateDocSco(payload){
       // console.log(this.AIloading[payload.val][payload.val2].sco , payload.val3);
       this.AIloading[payload.val][payload.val2].sco=payload.val3