11wqe1 há 8 meses atrás
pai
commit
b25d184a4a

+ 1 - 1
src/components/components/answerData2.vue

@@ -200,7 +200,7 @@ export default {
             count++;
           }
         }
-        console.log(this.person);
+        // console.log(this.person);
         this.count = count;
         if (!this.chartObj) {
           this.setChart(this.ooption);

+ 1 - 1
src/components/components/askStatic.vue

@@ -183,7 +183,7 @@ export default {
         for (var i = 0; i < this.checkJson.length; i++) {
           // debuggerA
           let el = this.checkJson[i];
-          console.log(el);
+          // console.log(el);
         }
         this.checkJson2 = this.checkJson;
       },

+ 2 - 2
src/components/components/askStatic2.vue

@@ -223,7 +223,7 @@ export default {
         for (var i = 0; i < this.checkJson.length; i++) {
           // debuggerA
           let el = this.checkJson[i];
-          console.log(el);
+          // console.log(el);
         }
         this.checkJson2 = this.checkJson;
       },
@@ -234,7 +234,7 @@ export default {
     this.askJSONC = this.askJSON ? this.askJSON : {};
     for (var i = 0; i < this.checkJson.length; i++) {
       let el = this.checkJson[i];
-      console.log(el);
+      // console.log(el);
     }
     this.checkJson2 = this.checkJson;
   },

+ 65 - 10
src/components/easy2/commpont/markDialog.vue

@@ -4,7 +4,7 @@
       style="overflow: auto;overflow-x: hidden;width: 315px;box-sizing: content-box;border-right: 1px rgba(231, 231, 231, 1) solid;"
     >
       <div class="left">
-        <div v-loading="ScLoading">
+        <div v-if="markScoreworksStudent.length - 1 == toolIndex" v-loading="ScLoading">
           <div class="scoreTit">
             <div>任务得分</div>
             <div>
@@ -270,7 +270,10 @@
             ></iframe>
           </div>
           <div v-if="currentUid.type == 12" style="height: 100%;">
-            txt
+            <div>
+                <div style="cursor: pointer;" @click="downloadFile(currentUid.content)">下载txt</div>
+                <!-- <div>{{ currentUid.content }}</div> -->
+            </div>
           </div>
           <div v-if="currentUid.type == 15">
             <div
@@ -365,7 +368,7 @@
 import { v4 as uuidv4 } from "uuid";
 
 export default {
-  props: ["uid", "stage", "toolIndex", "task", "scoTit", "markScoreVisible"],
+  props: ["uid", "stage", "toolIndex", "task", "scoTit", "markScoreVisible","markScoreworksStudent"],
   data() {
     return {
       textarea: "",
@@ -412,7 +415,7 @@ export default {
           fullscreenToggle: true //全屏按钮
         }
       },
-      xianObj: ["DOCX", "PPT", "PPTX", "MD", "TXT", "PDF"],
+      xianObj: ["DOCX", "MD", "TXT", "PDF"],
     };
   },
   watch: {
@@ -441,7 +444,7 @@ export default {
       if (this.currentUid.type == 4 || this.currentUid.type == 12) {
         let a = this.currentUid.content.slice(this.currentUid.content.lastIndexOf(".") + 1)
         
-        if (this.xianObj.indexOf(a) == -1) {
+        if (this.xianObj.indexOf(a.toUpperCase()) != -1) {
           return 1
         }else{
           return 0
@@ -620,11 +623,11 @@ export default {
     // ai评分
     async AIsubmit(work) {
       // return console.log("con", this.scoTit, this.cuScoCon);
+      this.ScLoading = true;
       let _fileid = ''
       if(work.type == 4 || work.type == 12){
         _fileid = await this.createFileid(work.content);
       }
-      this.ScLoading = true;
       let tit = this.scoTit;
       tit.forEach((e, index) => {
         if (!e.isai) {
@@ -660,7 +663,7 @@ export default {
 
 
       # Format example
-      [{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'},{'评语':'评语(150个字左右)'}]
+      [{'评价维度':'评价等级0-5(数字)'},{'评价维度':'评价等级0-5(数字)'},{'评价维度':'评价等级0-5(数字)'},{'评价维度':'评价等级0-5(数字)'},{'评语':'评语(150个字左右)'}]
       `;
       // console.log(msg);
       this.aiGet2(msg, _fileid);
@@ -687,7 +690,7 @@ export default {
         .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", params)
         .then(response => {
           let data = response.data.FunctionResponse;
-          // console.log("data", data);
+          console.log("data", data);
           if (data.message) {
             let dArray = {};
             try {
@@ -732,6 +735,7 @@ export default {
               let value = item[key];
               processedData[key] = value;
             });
+
             // console.log(JSON.parse(JSON.stringify(processedData)));
 
             for (const key in processedData) {
@@ -740,6 +744,7 @@ export default {
               }
             }
             delete processedData["评语"];
+console.log('processedData',processedData);
 
             let params = {
               cid: _this.cid,
@@ -757,12 +762,12 @@ export default {
                   type: "success"
                 });
 
-                this.ScLoading = false;
+                _this.ScLoading = false;
                 _this.selectSWorksData();
               })
               .catch(err => {
+                _this.ScLoading = false;
                 _this.$message.error("评价失败");
-                this.ScLoading = false;
 
                 console.error(err);
               });
@@ -771,6 +776,8 @@ export default {
         })
         .catch(error => {
           _this.$message.error("评价失败");
+          _this.ScLoading = true;
+
           console.log(error);
         });
     },
@@ -950,7 +957,51 @@ export default {
 
         });
     },
+    downloadFile(url) {
+      var credentials = {
+        accessKeyId: "AKIATLPEDU37QV5CHLMH",
+        secretAccessKey: "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",
+      }; //秘钥形式的登录上传
+      window.AWS.config.update(credentials);
+      window.AWS.config.region = "cn-northwest-1"; //设置区域
+      let url2 = url;
+      let _url2 = "";
+      if (
+        url2.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
+      ) {
+        _url2 = url2.split(
+          "https://view.officeapps.live.com/op/view.aspx?src="
+        )[1];
+      } else {
+        _url2 = url2;
+      }
+      const loading2 = this.$loading.service({
+        background: "rgba(255, 255, 255, 0.7)",
+        target: document.body,
+        text: "文件加载中...",
+      });
+      var s3 = new window.AWS.S3({ params: { Bucket: "ccrb" } });
+      let name = decodeURIComponent(_url2.split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1])
+      var params = {
+        Bucket: "ccrb",
+        Key: name
+      };
+      s3.getObject(params, function (err, data) {
+        loading2.close();
+        if (err) console.log(err, err.stack); // an error occurred
+        else {
+          let url = window.URL.createObjectURL(new Blob([data.Body]));
+          let a = document.createElement("a");
+          a.name = name;
+          a.href = url;
+          a.download = name;
+          a.click();
+          console.log(data); 
+        }          // sxuccessful response
 
+      });
+
+    },
     // 处理任务的分展示
     appraise(val) {
       if (val.rate) {
@@ -961,6 +1012,10 @@ export default {
         this.scoTitList.forEach((e, index) => {
           e.cog = null;
           for (const key in data) {
+            if (e.value.endsWith('。')) {
+              e.value = e.value.slice(0, -1); // 如果字符串以句号结尾,则去除最后一个字符
+            }
+            
             if (e.value == key) {
               e.cog = data[key] * 1;
             }

+ 3 - 0
src/components/easy2/commpont/markScore.vue

@@ -185,6 +185,9 @@ export default {
               this.scoTitList.forEach((e, index) => {
                 e.cog = null;
                 for (const key in data) {
+                  if (e.value.endsWith('。')) {
+                    e.value = e.value.slice(0, -1); // 如果字符串以句号结尾,则去除最后一个字符
+                  }
                   if (e.value == key) {
                     e.cog = data[key] * 1;
                   }

+ 34 - 31
src/components/easy2/studyStudent.vue

@@ -2482,7 +2482,7 @@
                           展开
                         </div>
                       </div>
-                      <div v-if="courseDetail.userid == userid && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && courseDetail.state == 5">
+                      <div v-if="courseDetail.userid == userid && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && courseDetail.state == 5 && worksStudent.length-1 == toolIndex ">
                         <div class="ScoreBtn" v-if="!loopLoading[toolIndex].loading" @click="loopEva(worksStudent[toolIndex],chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,courseType,taskCount,toolIndex,tool.toolDetail,worksStudent)" >
                           <img src="../../assets/icon/newIcons/rootImg.png" alt="">
                           AI评分
@@ -2850,7 +2850,7 @@
                             
                               <div
                                 class="answerScore"
-                                @click="markScoreDig2(w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
+                               @click="markScoreDig2(worksStudent,w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
                                 slot="reference"
                                 :class="{
                                   rightW:
@@ -2941,7 +2941,7 @@
                             
                               <div
                                 class="answerScore"
-                                @click="markScoreDig2(w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
+                               @click="markScoreDig2(worksStudent,w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
                                 slot="reference"
                                 :class="{
                                   rightW:
@@ -3036,7 +3036,7 @@
                             
                               <div
                                 class="answerScore"
-                                @click="markScoreDig2(w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
+                               @click="markScoreDig2(worksStudent,w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
                                 slot="reference"
                                 :class="{
                                   rightW:
@@ -3131,7 +3131,7 @@
                             
                               <div
                                 class="answerScore"
-                                @click="markScoreDig2(w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
+                               @click="markScoreDig2(worksStudent,w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
                                 slot="reference"
                                 :class="{
                                   rightW:
@@ -3663,7 +3663,7 @@
                               
                                 <div
                                   class="answerScore"
-                                 @click="markScoreDig2(w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
+                                @click="markScoreDig2(worksStudent,w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
                                   slot="reference"
                                   :class="{
                                     rightW:
@@ -3774,7 +3774,7 @@
                         展开
                       </div>
                     </div>
-                    <div v-if="courseDetail.userid == userid && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && courseDetail.state == 5">
+                    <div v-if="courseDetail.userid == userid && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && courseDetail.state == 5 && worksStudent.length-1 == toolIndex">
                         <div class="ScoreBtn" v-if="!loopLoading[toolIndex].loading" @click="loopEva(worksStudent[toolIndex],chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,courseType,taskCount,toolIndex,tool.toolDetail,worksStudent)" >
                           <img src="../../assets/icon/newIcons/rootImg.png" alt="">
                           AI评分
@@ -3878,7 +3878,7 @@
                             
                               <div
                                 class="answerScore"
-                                @click="markScoreDig2(w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
+                               @click="markScoreDig2(worksStudent,w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
                                 slot="reference"
                                 :class="{
                                   rightW:
@@ -3972,7 +3972,7 @@
                             
                               <div
                                 class="answerScore"
-                                @click="markScoreDig2(w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
+                               @click="markScoreDig2(worksStudent,w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
                                 slot="reference"
                                 :class="{
                                   rightW:
@@ -4067,7 +4067,7 @@
                             
                               <div
                                 class="answerScore"
-                                @click="markScoreDig2(w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
+                               @click="markScoreDig2(worksStudent,w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
                                 slot="reference"
                                 :class="{
                                   rightW:
@@ -5270,7 +5270,7 @@
                             
                               <div
                                 class="answerScore"
-                                @click="markScoreDig2(w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
+                               @click="markScoreDig2(worksStudent,w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
                                 slot="reference"
                                 :class="{
                                   rightW:
@@ -5603,7 +5603,7 @@
                             
                               <div
                                 class="answerScore"
-                                @click="markScoreDig2(w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
+                               @click="markScoreDig2(worksStudent,w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
                                 slot="reference"
                                 :class="{
                                   rightW:
@@ -6219,7 +6219,7 @@
                             
                               <div
                                 class="answerScore"
-                                @click="markScoreDig2(w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
+                               @click="markScoreDig2(worksStudent,w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
                                 slot="reference"
                                 :class="{
                                   rightW:
@@ -6993,7 +6993,7 @@
                           展开
                         </div>
                       </div>
-                      <div v-if="courseDetail.userid == userid && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && courseDetail.state == 5">
+                      <div v-if="courseDetail.userid == userid && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && courseDetail.state == 5 && worksStudent.length-1 == toolIndex">
                         <div class="ScoreBtn" v-if="!loopLoading[toolIndex].loading" @click="loopEva(worksStudent[toolIndex],chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,courseType,taskCount,toolIndex,tool.toolDetail,worksStudent)" >
                           <img src="../../assets/icon/newIcons/rootImg.png" alt="">
                           AI评分
@@ -7092,7 +7092,7 @@
                             
                               <div
                                 class="answerScore"
-                                 @click="markScoreDig2(w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
+                                @click="markScoreDig2(worksStudent,w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
                                 slot="reference"
                                 :class="{
                                   rightW:
@@ -7287,7 +7287,7 @@
                           展开
                         </div>
                       </div>
-                      <div v-if="courseDetail.userid == userid && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && courseDetail.state == 5">
+                      <div v-if="courseDetail.userid == userid && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && courseDetail.state == 5 && worksStudent.length-1 == toolIndex">
                         <div class="ScoreBtn" v-if="!loopLoading[toolIndex].loading" @click="loopEva(worksStudent[toolIndex],chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,courseType,taskCount,toolIndex,tool.toolDetail,worksStudent)" >
                           <img src="../../assets/icon/newIcons/rootImg.png" alt="">
                           AI评分
@@ -7402,7 +7402,7 @@
                             
                               <div
                                 class="answerScore"
-                                 @click="markScoreDig2(w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
+                                 @click="markScoreDig2(worksStudent,w.userid,toolIndex,chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,AIloading[toolIndex][wIndex].loading)"
                                 slot="reference"
                                 :class="{
                                   rightW:
@@ -12781,6 +12781,7 @@
         :stage="courseType" 
         :task="taskCount" 
         :scoTit="markScoreTit" 
+        :markScoreworksStudent="markScoreworksStudent"
         :markScoreVisible="markScoreVisible"
       ></markDialog>
     </el-dialog>
@@ -13280,7 +13281,7 @@ export default {
       markScoreTit:{},
       markfullscreen:false,
       xianObj: ["DOCX","PPT","DOC","PPTX", "MD", "TXT", "PDF"],
-
+      markScoreworksStudent:[]
     };
   },
   methods: {
@@ -13348,7 +13349,7 @@ export default {
       });
     },
     async loopEva(con,tit,stage,task,toolIndex,toolDetail,worksStudent){
-        // console.log(con,tit,stage,task,toolIndex,toolDetail);
+        console.log(con,tit,stage,task,toolIndex,toolDetail);
        
         tit.forEach((e,index)=>{
           if(!e.isai){
@@ -13388,15 +13389,15 @@ export default {
 
        for (let i = 0; i < con.length; i++) {
         let _fileid = ''
-        console.log('con[i].works',con[i])
+        // console.log('con[i].works',con[i])
         let wok = con[i].works
         if(con[i].type == 1 || con[i].type == 12){
           let a = wok.slice(wok.lastIndexOf(".") + 1)
-          if (this.xianObj.indexOf(a) == -1) {
+          if (this.xianObj.indexOf(a.toUpperCase()) != -1) {
             _fileid = await this.createFileid(con[i].works);
           }
         }
-        if(_fileid == 1 || con[i].type == 0){
+        if(_fileid == 1 || con[i].type == 0 || con[i].type == 3){
           this.AIloading[toolIndex][i].loading=false;
           continue;
         }  
@@ -13409,7 +13410,7 @@ export default {
         #Context
         ##要求
         根据<评价细则>和<作业内容>的相关性评价作业,判断该作业属于六级中的哪个等级,结合“评价维度”和等级写评语。如果作业内容与评价细则无关,则直接评为0星。
-        
+
         ##评分资料
         评价细则:${laws}
         作业内容:${_fileid ? "上传的文件内容" : JSON.parse(con[i].works).text } 
@@ -13420,7 +13421,7 @@ export default {
 
 
         # Format example
-       [{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'},{'评语':'评语(150个字左右)'}]
+       [{'评价维度':'评价等级0-5(数字)'},{'评价维度':'评价等级0-5(数字)'},{'评价维度':'评价等级0-5(数字)'},{'评价维度':'评价等级0-5(数字)'},{'评语':'评语(150个字左右)'}]
         `
        
         let mk = `markSco${toolIndex}${i}`
@@ -15333,17 +15334,19 @@ export default {
           ].toolChoose[toolIndex].wordJson;
       }
     },
-    markScoreDig2(uid,tidx,titlist,val = 0){
+    //点击评分显示评分框, AI循环评分val等于1时正在评分,不让重复点击
+    markScoreDig2(worksStudent,uid,tidx,titlist,val = 0){
       if(val) return
       // console.log('222')
-      this.markScoreTit=titlist
+      this.markScoreTit=titlist;
       // console.log('val',data)
-      this.markScoreUid=uid
-      this.markScoretoolIndex=tidx
-
-      this.markfullscreen = false
-      this.markScoreVisible = true
+      this.markScoreUid=uid;
+      this.markScoretoolIndex=tidx;
+      this.markScoreworksStudent = worksStudent;
+      this.markfullscreen = false;
+      this.markScoreVisible = true;
     },
+    // 点击markScore显示评分框
     markScoreDig(data){
 
       this.markScoreTit=data.tit