Explorar el Código

feat: ai评卷设置修改

zhangjie hace 2 meses
padre
commit
9ddcd23d08

+ 13 - 0
src/assets/styles/element-ui-costom.scss

@@ -649,6 +649,19 @@
   border-color: mix($--color-white, $--color-success, 80%);
   background-color: mix($--color-white, $--color-success, 90%);
 }
+// el-notification
+.el-notification {
+  .el-notification__content {
+    max-height: 140px;
+    overflow: hidden;
+    p {
+      width: 260px;
+      word-wrap: break-word;
+      text-align: left;
+      line-height: 1.4;
+    }
+  }
+}
 // el-date-editor
 .el-date-editor {
   border-radius: 8px;

+ 5 - 3
src/modules/mark/api.js

@@ -129,11 +129,13 @@ export const markProgressMarkerExport = (datas) => {
 };
 // 终止或开启智能评卷
 export const markProgressQuestionAiStatusUpdate = (datas) => {
-  return $postParam("/api/admin/mark/class/update", datas);
+  return $postParam("/api/admin/mark/question/subjective/ai/enable", datas);
 };
 // 重置AI智能评卷任务
-export const markProgressQuestionAiReset = (datas) => {
-  return $postParam("/api/admin/mark/class/reset", datas);
+export const markProgressQuestionAiReset = (questionId) => {
+  return $postParam("/api/admin/mark/question/subjective/ai/reset", {
+    questionId,
+  });
 };
 
 // mark-detail-progress-detail

+ 13 - 27
src/modules/mark/components/markDetail/MarkDetailProgress.vue

@@ -211,14 +211,14 @@
           <template slot-scope="scope">
             <template v-if="scope.row.aiMark">
               <el-button
+                v-if="checkPrivilege('link', 'EnableAiMark', 'MarkManage')"
                 class="btn-primary"
                 type="text"
                 @click="handleAiStatusUpdate(scope.row)"
-                >{{
-                  scope.row.aiStatus === "ENABLE" ? "终止" : "开启"
-                }}智能评卷</el-button
+                >{{ scope.row.enableAi ? "终止" : "开启" }}智能评卷</el-button
               >
               <el-button
+                v-if="checkPrivilege('link', 'ResetAiMarkTask', 'MarkManage')"
                 class="btn-primary"
                 type="text"
                 @click="handleAiReset(scope.row)"
@@ -300,7 +300,7 @@ export default {
       this.openClassMark = res.classMark;
     },
     async handleAiStatusUpdate(row) {
-      const actionName = row.aiStatus === "ENABLE" ? "终止" : "开启";
+      const actionName = row.enableAi ? "终止" : "开启";
       const confirm = await this.$confirm(
         `确定要${actionName}AI智能评卷任务?`,
         "提示",
@@ -310,18 +310,12 @@ export default {
       ).catch(() => {});
       if (confirm !== "confirm") return;
 
-      try {
-        await markProgressQuestionAiStatusUpdate({
-          examId: this.baseInfo.examId,
-          paperNumber: this.baseInfo.paperNumber,
-          questionId: row.questionId,
-          aiStatus: row.aiStatus === "ENABLE" ? "DISABLE" : "ENABLE",
-        });
-        this.$message.success("操作成功");
-        this.initData();
-      } catch (e) {
-        this.$message.error(e || "操作失败");
-      }
+      await markProgressQuestionAiStatusUpdate({
+        questionId: row.questionId,
+        enableAi: !row.enableAi,
+      });
+      this.$message.success("操作成功");
+      this.initData();
     },
     async handleAiReset(row) {
       const confirm = await this.$confirm(
@@ -333,17 +327,9 @@ export default {
       ).catch(() => {});
       if (confirm !== "confirm") return;
 
-      try {
-        await markProgressQuestionAiReset({
-          examId: this.baseInfo.examId,
-          paperNumber: this.baseInfo.paperNumber,
-          questionId: row.questionId,
-        });
-        this.$message.success("重置成功");
-        this.initData();
-      } catch (e) {
-        this.$message.error(e || "重置失败");
-      }
+      await markProgressQuestionAiReset(row.questionId);
+      this.$message.success("重置成功");
+      this.initData();
     },
     async getList() {
       const datas = {

+ 3 - 3
src/modules/mark/components/markParam/MarkParamGroup.vue

@@ -71,7 +71,7 @@
         <el-table-column label="AI评卷" width="80" align="center">
           <template slot-scope="scope">
             <i
-              v-if="scope.row.aiMarkSet"
+              v-if="scope.row.aiQuestionPramSet && scope.row.questionType !== 4"
               class="el-icon-success color-success"
             ></i>
           </template>
@@ -280,7 +280,7 @@ export default {
     },
     objectSpanMethod({ rowIndex, columnIndex }) {
       // 第四列为评卷员
-      if (columnIndex === 3 || columnIndex === 8) {
+      if (columnIndex === 3 || columnIndex === 9) {
         const pos = this.fillQuestionRanges.findIndex((item) =>
           item.includes(rowIndex)
         );
@@ -492,7 +492,7 @@ export default {
     },
     aiSetModified() {
       this.updateSubjectiveTaskItem({
-        aiMarkSet: true,
+        aiQuestionPramSet: true,
         id: this.curRow.id,
       });
     },

+ 3 - 8
src/modules/mark/components/markParam/ModifyMarkAiLevelAnswer.vue

@@ -54,12 +54,7 @@ export default {
   data() {
     return {
       visible: false,
-      form: {
-        aiQuestionId: null,
-        minScore: 0,
-        maxScore: 0,
-        answer: "",
-      },
+      form: this.getInitForm(),
       rules: {
         minScore: [
           { required: true, message: "请输入最小分", trigger: "change" },
@@ -89,8 +84,8 @@ export default {
     getInitForm() {
       return {
         aiQuestionId: null,
-        minScore: 0,
-        maxScore: 0,
+        minScore: undefined,
+        maxScore: undefined,
         answer: "",
       };
     },

+ 3 - 6
src/modules/mark/components/markParam/ModifyMarkAiPointAnswer.vue

@@ -14,7 +14,7 @@
         <el-form-item label="分值:" prop="score">
           <el-input-number
             v-model="form.score"
-            :min="0"
+            :min="0.1"
             :max="100"
             :precision="1"
             :step="0.1"
@@ -46,10 +46,7 @@ export default {
   data() {
     return {
       visible: false,
-      form: {
-        score: 0,
-        answer: "",
-      },
+      form: this.getInitForm(),
       rules: {
         score: [{ required: true, message: "请输入分值", trigger: "blur" }],
         answer: [
@@ -62,7 +59,7 @@ export default {
     getInitForm() {
       return {
         aiQuestionId: null,
-        score: 0,
+        score: undefined,
         answer: "",
       };
     },

+ 6 - 2
src/modules/mark/components/markParam/ModifyMarkAiSet.vue

@@ -70,7 +70,7 @@
               </el-table-column>
             </template>
             <el-table-column
-              prop="content"
+              prop="answer"
               label="标答内容"
               show-overflow-tooltip
             ></el-table-column>
@@ -211,7 +211,11 @@ export default {
       }
     },
     toDeleteAnswer(index) {
-      this.form.answers.splice(index, 1);
+      if (this.form.mode === "POINT") {
+        this.form.pointList.splice(index, 1);
+      } else if (this.form.mode === "LEVEL") {
+        this.form.levelList.splice(index, 1);
+      }
     },
     answerModified(answer) {
       if (this.curAnswer) {

+ 1 - 1
src/modules/mark/components/markParam/ModifyMarkParams.vue

@@ -186,7 +186,7 @@ export default {
       this.setOpenClassMark(!!subjectRes.classMark);
       this.setAiMark({
         enableAIMark: true,
-        // enableAIMark: !!subjectRes.enableAIMark,
+        // enableAIMark: subjectRes.aiMarkSet,
         aiMarkType: subjectRes.aiMarkType,
       });