11wqe1 5 달 전
부모
커밋
4432b402b5
1개의 변경된 파일97개의 추가작업 그리고 9개의 파일을 삭제
  1. 97 9
      src/components/easy2/commpont/markDialog.vue

+ 97 - 9
src/components/easy2/commpont/markDialog.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="markDialog" v-loading="vLoading">
     <div
-      style="overflow: auto;overflow-x: hidden;width: 315px;box-sizing: content-box;border-right: 1px rgba(231, 231, 231, 1) solid;"
+      style="width: 315px;box-sizing: content-box;border-right: 1px rgba(231, 231, 231, 1) solid;"
     >
       <div class="left">
         <div v-loading="ScLoading">
@@ -38,7 +38,19 @@
                       {{ e.detail }}
                     </div>
                   </el-tooltip>
-                  <el-rate :disabled="tType == 2" disabled-void-color @change="submit" v-model="e.cog"></el-rate>
+
+                  <div
+                    class="starB"
+                    @contextmenu.prevent="handleRightClick(index, $event)"
+                  >
+                    <div class="hangBlock">右键评为0分</div>
+                    <el-rate
+                      :disabled="tType == 2"
+                      disabled-void-color
+                      @change="submit"
+                      v-model="e.cog"
+                    ></el-rate>
+                  </div>
                 </div>
               </div>
               <div
@@ -63,7 +75,19 @@
                       {{ e.detail }}
                     </div>
                   </el-tooltip>
-                  <el-rate :disabled="tType == 2" disabled-void-color @change="submit" v-model="e.cog"></el-rate>
+
+                  <div
+                    class="starB"
+                    @contextmenu.prevent="handleRightClick(index, $event)"
+                  >
+                    <div class="hangBlock">右键评为0分</div>
+                    <el-rate
+                      :disabled="tType == 2"
+                      disabled-void-color
+                      @change="submit"
+                      v-model="e.cog"
+                    ></el-rate>
+                  </div>
                 </div>
               </div>
             </div>
@@ -86,7 +110,7 @@
           <div class="AreaCss">
             <el-input
               type="textarea"
-              :placeholder="tType == 1 ?'您可在此输入评语':'暂无评语'"
+              :placeholder="tType == 1 ? '您可在此输入评语' : '暂无评语'"
               v-model="textarea"
               @blur="submit"
               :disabled="tType == 2"
@@ -98,7 +122,8 @@
                   currentUid.type == 10 ||
                   currentUid.type == 13 ||
                   isMarkCom == 1) &&
-                  !isMarkSco && tType == 1
+                  !isMarkSco &&
+                  tType == 1
               "
               class="anewC"
               @click="anewEva"
@@ -598,6 +623,7 @@ export default {
       console.log(index);
       console.log('scoTitList',this.scoTitList);
     },
+    // 重新生成
     async anewEva() {
       this.ScLoading = true;
 
@@ -760,7 +786,8 @@ export default {
             console.log("dArray", dArray);
             this.textarea = dArray[0].comment;
           }
-          this.submit()
+          // 上传评语
+          this.submit();
           this.$message.success("重新生成完成");
 
           this.ScLoading = false;
@@ -806,7 +833,47 @@ export default {
         }
       });
     },
+    // 评分点击右键
+    handleRightClick(val, event) {
+      // 阻止默认的右键菜单弹出
+      event.preventDefault();
+
+      this.scoTitList[val].cog = 0;
+
+      let data = this.scoTitList.map(e => {
+        return e.detail + ":" + e.cog;
+      });
+
+      const processedData = {};
+
+      data.forEach(item => {
+        const [key, value] = item.split(":");
+        processedData[key] = Number(value) ? Number(value) : 0;
+      });
+
+      processedData.content = this.textarea;
+      // console.log(processedData);
+      let params = {
+        cid: this.cid,
+        s: this.stage,
+        t: this.task,
+        tool: this.toolIndex ? this.toolIndex : "",
+        rate: JSON.stringify(processedData),
+        uid: this.DgUid
+      };
+      // return console.log(params);
+      this.ajax
+        .get(this.$store.state.api + "updateWorksEvaTwo", params)
+        .then(res => {
+          this.ScLoading = false;
+        })
+        .catch(err => {
+          this.$message.error("评价失败");
+          console.error(err);
+        });
 
+      // 在这里执行右键点击后的操作,使用传递的参数
+    },
     // 老师提交评分
     submit() {
       let data = this.scoTitList.map(e => {
@@ -1040,7 +1107,7 @@ export default {
 
     // ai打分
     aiGet2(messages, _fileid, work) {
-      if (!this.markScoreVisible) return console.log('弹框关闭了');
+      if (!this.markScoreVisible) return console.log("弹框关闭了");
 
       let _this = this;
 
@@ -1056,7 +1123,7 @@ export default {
         userId: this.cUserid,
         file_ids: _fileid ? [_fileid] : [],
         isImage: work.type == 1 ? true : "",
-        model: _fileid ? "gpt-4o-2024-08-06"  : "gpt-4o-2024-08-06"
+        model: _fileid ? "gpt-4o-2024-08-06" : "gpt-4o-2024-08-06"
       };
       this.ajax
         .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", params)
@@ -1932,9 +1999,30 @@ export default {
   background-color: #fff;
   bottom: 3px;
   right: 22px;
-  color: #3681FC;
+  color: #3681fc;
   cursor: pointer;
   font-size: 14px;
   transform: translate(0px, 2px);
 }
+
+.starB {
+  position: relative;
+}
+
+.starB:hover .hangBlock {
+  display: block;
+}
+
+.hangBlock {
+  display: none;
+  position: absolute;
+  right: 0%;
+  top: 50%;
+  padding: 5px 10px;
+  box-sizing: border-box;
+  transform: translate(100%, -50%);
+  box-shadow: -1px 5px 6px 1px #ccc;
+  background-color: #fff;
+  border-radius: 6px;
+}
 </style>