zhangjie пре 2 година
родитељ
комит
b38a2311e3

+ 15 - 0
src/modules/paper/api.js

@@ -149,6 +149,21 @@ export const paperQuestionMoveApi = ({ detailId, unitid, vector }) => {
 export const paperQuestionDeleteApi = (unitid) => {
   return $httpWithMsg.delete(`${QUESTION_API}/paperDetailUnit/${unitid}`, {});
 };
+export const paperQuestionChangeApi = (
+  paperDetailUnitId,
+  selectedQuestionIds
+) => {
+  return $httpWithMsg.post(
+    `${QUESTION_API}/change/question`,
+    {},
+    {
+      params: {
+        paperDetailUnitId,
+        selectedQuestionIds,
+      },
+    }
+  );
+};
 
 // audit-paper
 export const auditPaperWaitPageListApi = (datas) => {

+ 3 - 3
src/modules/paper/components/QuestionGroupStruct.vue

@@ -310,7 +310,7 @@ export default {
           classifyName: data.classifyName,
           isClassify: true,
           questionCount: data.questionCount,
-          selectCount: this.gerSourceData(data.classifyId),
+          selectCount: _this.gerSourceData(data.classifyId),
           difficultDistributeInfo: [],
         };
         if (
@@ -354,7 +354,7 @@ export default {
           );
         }
         return data.map((item) => {
-          return { ...item, selectCount: this.gerSourceData(preInfo) };
+          return { ...item, selectCount: _this.gerSourceData(preInfo) };
         });
       }
 
@@ -366,7 +366,7 @@ export default {
           propertyId: data.propertyId,
           propertyName: data.propertyName,
           questionCount: data.questionCount,
-          selectCount: this.gerSourceData(propId),
+          selectCount: _this.gerSourceData(propId),
           difficultDistributeInfo: null,
         };
         if (

+ 17 - 0
src/modules/paper/views/EditPaper.vue

@@ -336,6 +336,13 @@
                     "
                     >进入查重
                   </el-button>
+                  <el-button
+                    size="small"
+                    type="primary"
+                    plain
+                    @click="toChangeQues(paperDetailUnit)"
+                    >换题
+                  </el-button>
                   <el-button
                     size="small"
                     type="primary"
@@ -561,6 +568,7 @@ import {
   paperQuestionDeleteApi,
   paperQuestionSaveApi,
   paperDetailAddQuestionApi,
+  // paperQuestionChangeApi,
 } from "../api";
 import { QUESTION_API } from "@/constants/constants";
 
@@ -610,6 +618,7 @@ export default {
       curDetail: {},
       curQuestion: {},
       paperQuestionIds: [],
+      changeSelectQuestionMap: {},
       // upload answer
       uploadAnswerUrl: "",
       answerTemplateUrl: "",
@@ -884,6 +893,14 @@ export default {
         },
       });
     },
+    // 更换试题
+    toChangeQues(row) {
+      // let question = row.question;
+      // if (!this.changeSelectQuestionMap[question.sourceDetailId])
+      //   this.changeSelectQuestionMap[question.sourceDetailId] = [];
+
+      console.log(row);
+    },
     // 编辑小题
     toEditQues(row) {
       let question = row.question;