Browse Source

feat: 评卷参数设置ai评卷开关

zhangjie 2 tháng trước cách đây
mục cha
commit
4b8350faad

+ 9 - 0
src/modules/mark/api.js

@@ -113,6 +113,15 @@ export const markProgressMarkerExport = (datas) => {
     responseType: "blob",
   });
 };
+// 终止或开启智能评卷
+export const markProgressQuestionAiStatusUpdate = (datas) => {
+  return $postParam("/api/admin/mark/class/update", datas);
+};
+// 重置AI智能评卷任务
+export const markProgressQuestionAiReset = (datas) => {
+  return $postParam("/api/admin/mark/class/reset", datas);
+};
+
 // mark-detail-progress-detail
 export const markProgressClassQuestionListPage = (datas) => {
   return $postParam("/api/admin/mark/question/subjective/class/detail", datas);

+ 66 - 5
src/modules/mark/components/markDetail/MarkDetailProgress.vue

@@ -136,11 +136,17 @@
         <h3>题目评卷进度</h3>
       </div>
       <el-table ref="TableList" :data="questionList">
-        <el-table-column
-          prop="questionNumber"
-          label="评阅题目"
-          width="120"
-        ></el-table-column>
+        <el-table-column prop="questionNumber" label="评阅题目" width="120">
+          <template slot-scope="scope">
+            <span>{{ scope.row.questionNumber }}</span>
+            <el-tag
+              v-if="scope.row.aiMark"
+              class="tag-spin tag-wrap"
+              size="medium"
+              >AI智能评卷</el-tag
+            >
+          </template>
+        </el-table-column>
         <el-table-column
           class-name="action-column"
           label="评卷员"
@@ -195,6 +201,32 @@
             >
           </template>
         </el-table-column>
+        <el-table-column
+          class-name="action-column"
+          label="操作"
+          width="200"
+          align="center"
+          fixed="right"
+        >
+          <template slot-scope="scope">
+            <template v-if="scope.row.aiMark">
+              <el-button
+                class="btn-primary"
+                type="text"
+                @click="handleAiStatusUpdate(scope.row)"
+                >{{
+                  scope.row.aiStatus === "ENABLE" ? "终止" : "开启"
+                }}智能评卷</el-button
+              >
+              <el-button
+                class="btn-primary"
+                type="text"
+                @click="handleAiReset(scope.row)"
+                >重置AI智能评卷任务</el-button
+              >
+            </template>
+          </template>
+        </el-table-column>
       </el-table>
     </div>
     <class-mark-progress-dialog
@@ -209,6 +241,8 @@ import {
   markProgressSummary,
   markProgressClassListPage,
   markProgressMarkerExport,
+  markProgressQuestionAiStatusUpdate,
+  markProgressQuestionAiReset,
 } from "../../api";
 import { downloadByApi } from "@/plugins/download";
 import ClassMarkProgressDialog from "./ClassMarkProgressDialog.vue";
@@ -265,6 +299,33 @@ export default {
       this.questionList = res.groupInfo || [];
       this.openClassMark = res.classMark;
     },
+    async handleAiStatusUpdate(row) {
+      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 || "操作失败");
+      }
+    },
+    async handleAiReset(row) {
+      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 || "重置失败");
+      }
+    },
     async getList() {
       const datas = {
         examId: this.baseInfo.examId,