Переглянути джерело

feat: 评卷参数接口调整

zhangjie 3 місяців тому
батько
коміт
5152c4f90e

+ 10 - 0
src/assets/styles/pages.scss

@@ -942,6 +942,16 @@
       margin-right: 20px;
     }
   }
+  .step-title.el-button {
+    outline: none;
+    border: none;
+    color: inherit;
+
+    &:not(.is-disabled):hover,
+    &:not(.is-disabled).is-active {
+      color: $--color-success;
+    }
+  }
   .mark-body {
     margin-bottom: 20px;
   }

+ 1 - 1
src/modules/mark/api.js

@@ -51,7 +51,7 @@ export const markSubjectiveUpdateMarkArea = (datas) => {
 
 // class
 export const markClassStatusUpdate = (datas) => {
-  return $postParam("/api/admin/mark/class/open_mark_class", datas);
+  return $postParam("/api/admin/mark/class/update", datas);
 };
 export const markClassList = (datas) => {
   return $postParam("/api/admin/mark/class/list", datas);

+ 22 - 18
src/modules/mark/components/markParam/MarkParamClass.vue

@@ -3,22 +3,26 @@
     <div class="part-box part-box-pad box-justify">
       <el-form inline>
         <el-form-item label="是否开启分班阅卷:">
-          <el-radio-group v-model="markClassIsOpen" @change="markClassChange">
+          <el-radio-group v-model="classMarkIsOpen" @change="markClassChange">
             <el-radio-button :label="true">开启</el-radio-button>
             <el-radio-button :label="false">关闭</el-radio-button>
           </el-radio-group>
-
-          <el-breadcrumb v-if="markClassIsOpen" class="el-space" separator="|">
+        </el-form-item>
+        <el-form-item v-if="classMarkIsOpen">
+          <el-breadcrumb class="el-space" separator="|">
             <el-breadcrumb-item
               >班级数:{{ stat.classCount }}个</el-breadcrumb-item
             >
             <el-breadcrumb-item
-              >未分配评卷员班级数:{{
+              >未分配评卷员班级数:<span class="color-danger">{{
                 stat.unsignClassCount
-              }}个</el-breadcrumb-item
+              }}</span
+              >个</el-breadcrumb-item
             >
             <el-breadcrumb-item
-              >设置完成进度:{{ stat.completeRate }}%</el-breadcrumb-item
+              >设置完成进度:<span class="color-primary"
+                >{{ stat.completeRate }}%</span
+              ></el-breadcrumb-item
             >
           </el-breadcrumb>
         </el-form-item>
@@ -28,7 +32,7 @@
         <el-button type="primary" @click="toNext(1)">下一步</el-button>
       </div>
     </div>
-    <div v-if="markClassIsOpen" class="part-box part-box-pad">
+    <div v-if="classMarkIsOpen" class="part-box part-box-pad">
       <el-table :data="dataList" border>
         <el-table-column type="index" width="50"> </el-table-column>
 
@@ -55,7 +59,7 @@
           </template>
         </el-table-column>
       </el-table>
-      <div class="tips-info tips-error">
+      <div class="tips-info tips-error mt-2">
         <template v-if="subjectiveTaskList.length <= 1">
           <p v-if="unsignData.length">
             未分配班级:{{ unsignData.map((item) => item.className).join() }}
@@ -109,14 +113,14 @@ export default {
       selectedClassIds: [],
       loading: false,
       unsignData: [],
-      markClassIsOpen: false,
+      classMarkIsOpen: false,
     };
   },
   computed: {
     ...mapState("markParam", [
       "basicInfo",
       "subjectiveTaskList",
-      "openMarkClass",
+      "openClassMark",
     ]),
     stat() {
       return {
@@ -135,7 +139,7 @@ export default {
   methods: {
     ...mapMutations("markParam", ["setOpenClassMark"]),
     async initData() {
-      this.markClassIsOpen = this.openClassMark;
+      this.classMarkIsOpen = this.openClassMark;
 
       const params = {
         examId: this.basicInfo.examId,
@@ -159,25 +163,25 @@ export default {
       this.cacheDataMd5 = MD5(JSON.stringify(this.dataList));
     },
     async markClassChange() {
-      const name = this.markClassIsOpen ? "开启" : "关闭";
+      const name = this.classMarkIsOpen ? "开启" : "关闭";
       const confirm = await this.$confirm(`确定要${name}分班阅卷吗?`, "提示", {
         type: "warning",
       }).catch(() => {});
       if (confirm !== "confirm") {
-        this.markClassIsOpen = !this.markClassIsOpen;
+        this.classMarkIsOpen = !this.classMarkIsOpen;
         return;
       }
 
       const res = await markClassStatusUpdate({
         examId: this.basicInfo.examId,
         paperNumber: this.basicInfo.paperNumber,
-        openMarkClass: this.markClassIsOpen,
+        classMark: this.classMarkIsOpen,
       }).catch(() => {
-        this.markClassIsOpen = !this.markClassIsOpen;
+        this.classMarkIsOpen = !this.classMarkIsOpen;
       });
       if (!res) return;
-      this.setOpenClassMark(this.markClassIsOpen);
-      if (this.markClassIsOpen) {
+      this.setOpenClassMark(this.classMarkIsOpen);
+      if (this.classMarkIsOpen) {
         this.initData();
       } else {
         this.resetData();
@@ -255,7 +259,7 @@ export default {
     },
     async toPrev(step = 1) {
       if (
-        !this.markClassIsOpen ||
+        !this.classMarkIsOpen ||
         this.cacheDataMd5 === MD5(JSON.stringify(this.dataList))
       ) {
         this.$emit("prev", step);

+ 31 - 25
src/modules/mark/components/markParam/MarkParamGroup.vue

@@ -49,7 +49,7 @@
         </el-table-column>
         <el-table-column label="评卷方式" width="100">
           <template slot-scope="scope">
-            {{ scope.row.doubleEnable ? "双评" : "单评" }}
+            {{ scope.row.doubleRate > 0 ? "双评" : "单评" }}
           </template>
         </el-table-column>
         <el-table-column label="仲裁阈值" width="100">
@@ -217,7 +217,7 @@ export default {
 
       const qRangeDict = {};
       this.fillQuestionRanges = this.subjectiveTaskList.map((item, index) => {
-        if (item.questionType !== 3) return;
+        if (item.questionType !== 4) return;
 
         if (qRangeDict[item.mainNumber]) {
           qRangeDict[item.mainNumber].push(index);
@@ -229,7 +229,7 @@ export default {
     },
     objectSpanMethod({ rowIndex, columnIndex }) {
       // 第四列为评卷员
-      if (columnIndex === 3) {
+      if (columnIndex === 3 || columnIndex === 8) {
         const pos = this.fillQuestionRanges.findIndex((item) =>
           item.includes(rowIndex)
         );
@@ -248,10 +248,9 @@ export default {
         }
       }
     },
-    toSetMarker(row) {
-      this.curRow = row;
-
-      if (this.openMergeMarker && row.questionType === 3) {
+    getCurrentQuestions(row) {
+      let curRowQuestions = [];
+      if (this.openMergeMarker && row.questionType === 4) {
         // 填空题按大题批量处理
         const pos = this.subjectiveTaskList.findIndex(
           (item) => item.id === row.id
@@ -261,7 +260,7 @@ export default {
           item.includes(pos)
         );
         if (!range) return;
-        this.curRowQuestions = range.map((index) => {
+        curRowQuestions = range.map((index) => {
           const item = this.subjectiveTaskList[index];
           return {
             id: item.id,
@@ -271,7 +270,7 @@ export default {
         });
       } else {
         // 非填空题按单题处理
-        this.curRowQuestions = [
+        curRowQuestions = [
           {
             id: row.id,
             mainNumber: row.mainNumber,
@@ -279,7 +278,11 @@ export default {
           },
         ];
       }
-
+      return curRowQuestions;
+    },
+    toSetMarker(row) {
+      this.curRow = row;
+      this.curRowQuestions = this.getCurrentQuestions(row);
       this.$refs.ModifyMarkMarker.open();
     },
     async markMarkerModified(row) {
@@ -299,22 +302,22 @@ export default {
     },
     toSetArea(row) {
       this.curRow = row;
+      this.curRowQuestions = this.getCurrentQuestions(row);
       this.$refs.ModifyMarkArea.open();
     },
     async areaModified(row) {
-      const pos = this.subjectiveTaskList.findIndex(
-        (item) => item.id === row.id
-      );
-      if (pos === -1) return;
-      const datas = {
-        questionId: row.id,
-        pictureConfigs: row.pictureConfigs,
-      };
-      await markSubjectiveUpdateMarkArea(datas);
-      this.updateSubjectiveTaskItem({
-        id: row.id,
+      await markSubjectiveUpdateMarkArea({
+        examId: this.basicInfo.examId,
+        paperNumber: this.basicInfo.paperNumber,
+        questionIds: this.curRowQuestions.map((item) => item.id),
         pictureConfigs: row.pictureConfigs,
       });
+      this.curRowQuestions.forEach((item) => {
+        this.updateSubjectiveTaskItem({
+          id: item.id,
+          pictureConfigs: row.pictureConfigs,
+        });
+      });
     },
     async toDeleteMarker(row, marker) {
       const confirm = await this.$confirm(`确定要删除当前评卷员吗?`, "提示", {
@@ -341,14 +344,17 @@ export default {
       );
       if (pos === -1) return;
       const datas = {
-        id: row.id,
+        questionId: row.id,
         doubleEnable: row.doubleEnable,
         doubleRate: row.doubleRate,
         arbitrateThreshold: row.arbitrateThreshold,
         scorePolicy: row.scorePolicy,
       };
       await markSubjectiveUpdateMarkType(datas);
-      this.updateSubjectiveTaskItem(datas);
+      this.updateSubjectiveTaskItem({
+        ...datas,
+        id: row.id,
+      });
     },
     autoParsePictureConfigList(questions) {
       if (!questions.length) return [];
@@ -427,10 +433,10 @@ export default {
       const errorList = [];
       this.subjectiveTaskList.forEach((item) => {
         const errors = [];
-        if (item.markers.length) {
+        if (!item.markers?.length) {
           errors.push("评卷员未设置");
         }
-        if (!item.pictureConfigs.length) {
+        if (!item.pictureConfigs?.length) {
           errors.push("评卷区未设置");
         }
         if (errors.length) {

+ 2 - 2
src/modules/mark/components/markParam/ModifyMarkArea.vue

@@ -82,7 +82,7 @@ export default {
         npaper.areas = [];
         return npaper;
       });
-      this.group.pictureConfigs.forEach((config) => {
+      (this.group.pictureConfigs || []).forEach((config) => {
         const index = config.i - 1;
         this.papers[index].areas.push({ ...config });
       });
@@ -95,7 +95,7 @@ export default {
       }
     },
     scrollToFirstArea() {
-      if (!this.group.pictureConfigs.length) return;
+      if (!this.group.pictureConfigs?.length) return;
       let paperIndexs = this.group.pictureConfigs.map((item) => item.i - 1);
       paperIndexs.sort((a, b) => a - b);
       const firstPaperIndex = paperIndexs[0];

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

@@ -117,7 +117,7 @@ import { deepCopy } from "../../../../plugins/utils";
 import { organizationList } from "../../../base/api";
 
 export default {
-  name: "modify-mark-group",
+  name: "modify-mark-marker",
   props: {
     instance: {
       type: Object,

+ 11 - 4
src/modules/mark/components/markParam/ModifyMarkParams.vue

@@ -28,12 +28,18 @@
         >
           <el-button
             slot="title"
-            :class="['step-title', { 'is-active': curStepIndex === ind }]"
+            :class="[
+              'step-title',
+              {
+                'is-active': curStepIndex === ind,
+              },
+            ]"
             type="text"
             :disabled="item.disabled"
             @click="changeStep(ind)"
-            >{{ item.name }}</el-button
           >
+            {{ item.name }}
+          </el-button>
         </el-step>
       </el-steps>
     </div>
@@ -51,7 +57,7 @@
 </template>
 
 <script>
-import { mapState, mapMutations } from "vuex";
+import { mapMutations } from "vuex";
 import MarkParamStructure from "./MarkParamStructure.vue";
 import MarkParamGroup from "./MarkParamGroup.vue";
 import MarkParamClass from "./MarkParamClass.vue";
@@ -112,7 +118,6 @@ export default {
     };
   },
   computed: {
-    ...mapState("markParam", ["openMarkClass"]),
     currentComponent() {
       return `mark-param-${this.curStep.val}`;
     },
@@ -196,6 +201,8 @@ export default {
     },
     changeStep(ind) {
       if (ind === this.curStepIndex) return;
+      if (this.curStep.disabled) return;
+
       const step = ind - this.curStepIndex;
       const absStep = Math.abs(step);
       if (step > 0) {

+ 4 - 3
src/modules/mark/components/markParam/ModifyMarkType.vue

@@ -23,7 +23,7 @@
           @change="doubleEnableChange"
         >
           <el-radio :label="false">单评</el-radio>
-          <el-radio v-if="openDoubleMarking" :label="true">双评</el-radio>
+          <el-radio v-if="openDoubleMark" :label="true">双评</el-radio>
         </el-radio-group>
       </el-form-item>
       <template v-if="modalForm.doubleEnable">
@@ -126,11 +126,12 @@ export default {
     };
   },
   computed: {
-    ...mapState("markParam", ["openDoubleMarking"]),
+    ...mapState("markParam", ["openDoubleMark"]),
   },
   methods: {
     visibleChange() {
       this.modalForm = this.$objAssign(initModalForm, this.instance);
+      this.modalForm.doubleEnable = this.modalForm.doubleRate > 0;
       this.modalForm.doubleRate = this.modalForm.doubleRate || undefined;
       this.modalForm.arbitrateThreshold =
         this.modalForm.arbitrateThreshold || undefined;
@@ -143,7 +144,7 @@ export default {
     },
     doubleEnableChange() {
       this.modalForm.arbitrateThreshold = undefined;
-      this.modalForm.doubleRate = undefined;
+      this.modalForm.doubleRate = 0;
     },
     // confirm
     async confirm() {

+ 1 - 1
vue.config.js

@@ -11,7 +11,7 @@ let config = {
   devServer: {
     port: process.env.VUE_APP_DEV_PORT || 8056,
     proxy: {
-      "/(api|fss)/": {
+      "/(api|fss|pdf-temp)/": {
         target: process.env.VUE_APP_DEV_PROXY,
         changeOrigin: true,
       },