Эх сурвалжийг харах

fix:题卡复制编辑bug

zhangjie 2 жил өмнө
parent
commit
19676d75f5

+ 7 - 4
src/modules/exam/components/ApplyContent.vue

@@ -84,7 +84,9 @@
                 class="btn-primary"
                 type="text"
                 :disabled="
-                  !attachment.cardId || attachment.createMethod === 'UPLOAD'
+                  !attachment.cardId ||
+                    (attachment.cardType === 'GENERIC' &&
+                      attachment.createMethod !== 'STANDARD')
                 "
                 @click="toCopyCard(attachment)"
                 >复制</el-button
@@ -93,7 +95,7 @@
                 class="btn-primary"
                 type="text"
                 :disabled="
-                  !attachment.cardId || attachment.createMethod === 'UPLOAD'
+                  !attachment.cardId || attachment.cardType === 'GENERIC'
                 "
                 @click="toEditCard(attachment)"
                 >编辑</el-button
@@ -907,8 +909,8 @@ export default {
         courseName: this.curTaskApply.courseName,
         makeMethod: this.curTaskApply.makeMethod,
         cardRuleId: this.curTaskApply.cardRuleId,
-        type: "CUSTOM",
-        createMethod: "STANDARD"
+        type: attachment.cardType,
+        createMethod: attachment.createMethod
       });
       this.$refs.ModifyCard.open();
     },
@@ -941,6 +943,7 @@ export default {
         return;
       }
       this.curAttachment = { ...attachment };
+      // 这里只允许新建标准专卡
       this.$ls.set("prepareTcPCard", {
         courseCode: this.examTask.courseCode,
         courseName: this.examTask.courseName,

+ 7 - 4
src/modules/exam/components/ModifyTaskPaper.vue

@@ -142,7 +142,9 @@
                   class="btn-primary"
                   type="text"
                   :disabled="
-                    !attachment.cardId || attachment.createMethod === 'UPLOAD'
+                    !attachment.cardId ||
+                      (attachment.cardType === 'GENERIC' &&
+                        attachment.createMethod !== 'STANDARD')
                   "
                   @click="toCopyCard(attachment)"
                   >复制</el-button
@@ -151,7 +153,7 @@
                   class="btn-primary"
                   type="text"
                   :disabled="
-                    !attachment.cardId || attachment.createMethod === 'UPLOAD'
+                    !attachment.cardId || attachment.cardType === 'GENERIC'
                   "
                   @click="toEditCard(attachment)"
                   >编辑</el-button
@@ -448,8 +450,8 @@ export default {
         makeMethod: this.curTaskApply.makeMethod,
         cardRuleId: this.curTaskApply.cardRuleId,
         paperType: this.paperAttachments.map(item => item.name).join(","),
-        type: "CUSTOM",
-        createMethod: "STANDARD"
+        type: attachment.cardType,
+        createMethod: attachment.createMethod
       });
       this.$refs.ModifyCard.open();
     },
@@ -474,6 +476,7 @@ export default {
         return;
       }
       this.curAttachment = { ...attachment };
+      // 这里只允许新建标准专卡
       this.$ls.set("prepareTcPCard", {
         courseCode: this.curTaskApply.courseCode,
         courseName: this.curTaskApply.courseName,

+ 7 - 4
src/modules/exam/components/createExamAndPrintTask/InfoExamTask.vue

@@ -154,7 +154,9 @@
                 class="btn-primary"
                 type="text"
                 :disabled="
-                  !attachment.cardId || attachment.createMethod === 'UPLOAD'
+                  !attachment.cardId ||
+                    (attachment.cardType === 'GENERIC' &&
+                      attachment.createMethod !== 'STANDARD')
                 "
                 @click="toCopyCard(attachment)"
                 >复制</el-button
@@ -163,7 +165,7 @@
                 class="btn-primary"
                 type="text"
                 :disabled="
-                  !attachment.cardId || attachment.createMethod === 'UPLOAD'
+                  !attachment.cardId || attachment.cardType === 'GENERIC'
                 "
                 @click="toEditCard(attachment)"
                 >编辑</el-button
@@ -506,13 +508,14 @@ export default {
         schoolName: this.$ls.get("schoolName"),
         makeMethod: "SELF",
         cardRuleId: this.examTask.cardRuleId,
-        type: "CUSTOM",
-        createMethod: "STANDARD"
+        type: attachment.cardType,
+        createMethod: attachment.createMethod
       });
       this.$refs.ModifyCard.open();
     },
     toEditCard(attachment) {
       this.curAttachment = { ...attachment };
+      // 这里只允许新建标准专卡
       this.$ls.set("prepareTcPCard", {
         id: attachment.cardId,
         courseCode: this.examTask.courseCode,

+ 1 - 11
src/views/Home.vue

@@ -14,10 +14,7 @@
           >
             <!-- <i
               :class="[
-                'icon',
-                MENU_ICONS[menu.url]
-                  ? `icon-${MENU_ICONS[menu.url]}`
-                  : 'icon-workspace'
+                'icon',`icon-${menu.url}`
               ]"
             ></i> -->
             <span>{{ menu.name }}</span>
@@ -129,12 +126,6 @@ import ResetPwd from "../modules/base/components/ResetPwd";
 import { SYS_ADMIN_NAME } from "@/constants/enumerate";
 import staticMenu from "../constants/staticMenu";
 
-const MENU_ICONS = {
-  base: "base",
-  exam: "exam",
-  customer: "customer",
-  stmms: "book"
-};
 const HOME_PAGE_ROUTE = "HomePage";
 
 export default {
@@ -145,7 +136,6 @@ export default {
     const IS_SUPER_ADMIN = user.loginName === SYS_ADMIN_NAME;
 
     return {
-      MENU_ICONS,
       privileges: [],
       menus: [],
       curMenu: { url: "", children: [] },