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

转卡新增时先输入题卡名称

zhangjie 1 жил өмнө
parent
commit
dab7001d4a

+ 1 - 1
src/modules/card/views/CardEdit.vue

@@ -103,7 +103,7 @@ export default {
           cardConfig.cardTitle = this.prepareTcPCard.title;
           this.cardName = this.prepareTcPCard.title;
         } else {
-          this.cardName = "";
+          this.cardName = this.prepareTcPCard.cardName;
         }
         this.cardContent = {
           pages: [],

+ 14 - 1
src/modules/exam/components/ApplyContent.vue

@@ -1026,11 +1026,23 @@ export default {
       //     return card;
       //   });
     },
-    toCreateCard(attachment) {
+    async toCreateCard(attachment) {
       if (!this.examTask.cardRuleId) {
         this.$message.error("题卡规则缺失!");
         return;
       }
+      const res = await this.$prompt("确定要提交当前题卡吗?", "提示", {
+        type: "warning",
+        showInput: true,
+        inputPlaceholder: "请输入题卡名称",
+        inputValidator: (val) => {
+          if (!val) return "请输入题卡名称!";
+          if (val.length > 50) return "题卡名称不得超过50个字符!";
+          return true;
+        },
+      }).catch(() => {});
+      if (!res || res.action !== "confirm") return;
+
       this.curAttachment = { ...attachment };
       // 这里只允许新建标准专卡
       this.$ls.set("prepareTcPCard", {
@@ -1038,6 +1050,7 @@ export default {
         courseName: this.examTask.courseName,
         schoolName: this.$ls.get("schoolName"),
         makeMethod: "SELF",
+        cardName: res.value,
         cardRuleId: this.examTask.cardRuleId,
         type: "CUSTOM",
         createMethod: "STANDARD",

+ 13 - 1
src/modules/exam/components/ModifyTaskPaper.vue

@@ -506,11 +506,22 @@ export default {
         this.paperAttachments[aind].createId = card.createId;
       }
     },
-    toCreateCard(attachment) {
+    async toCreateCard(attachment) {
       if (!this.curTaskApply.cardRuleId) {
         this.$message.error("题卡规则缺失!");
         return;
       }
+      const res = await this.$prompt("请输入题卡名称?", "提示", {
+        type: "warning",
+        showInput: true,
+        inputPlaceholder: "请输入题卡名称",
+        inputValidator: (val) => {
+          if (!val) return "请输入题卡名称!";
+          if (val.length > 50) return "题卡名称不得超过50个字符!";
+          return true;
+        },
+      }).catch(() => {});
+      if (!res || res.action !== "confirm") return;
       this.curAttachment = { ...attachment };
       // 这里只允许新建标准专卡
       this.$ls.set("prepareTcPCard", {
@@ -518,6 +529,7 @@ export default {
         courseName: this.curTaskApply.courseName,
         schoolName: this.$ls.get("schoolName"),
         makeMethod: "SELF",
+        cardName: res.value,
         cardRuleId: this.curTaskApply.cardRuleId,
         type: "CUSTOM",
         createMethod: "STANDARD",

+ 13 - 1
src/modules/exam/components/createExamAndPrintTask/InfoExamTask.vue

@@ -549,17 +549,29 @@ export default {
       //     return card;
       //   });
     },
-    toCreateCard(attachment) {
+    async toCreateCard(attachment) {
       if (!this.examTask.cardRuleId) {
         this.$message.error("题卡规则缺失!");
         return;
       }
+      const res = await this.$prompt("请输入题卡名称?", "提示", {
+        type: "warning",
+        showInput: true,
+        inputPlaceholder: "请输入题卡名称",
+        inputValidator: (val) => {
+          if (!val) return "请输入题卡名称!";
+          if (val.length > 50) return "题卡名称不得超过50个字符!";
+          return true;
+        },
+      }).catch(() => {});
+      if (!res || res.action !== "confirm") return;
       this.curAttachment = { ...attachment };
       this.$ls.set("prepareTcPCard", {
         courseCode: this.examTask.courseCode,
         courseName: this.examTask.courseName,
         schoolName: this.$ls.get("schoolName"),
         makeMethod: "SELF",
+        cardName: res.value,
         cardRuleId: this.examTask.cardRuleId,
         type: "CUSTOM",
         createMethod: "STANDARD",