zhangjie před 9 měsíci
rodič
revize
3ea33d1f49

+ 9 - 3
src/modules/exam/views/ExamTaskManage.vue

@@ -386,9 +386,15 @@ export default {
       }).catch(() => {});
       if (action !== "confirm") return;
 
-      await deleteExamTask(this.multipleSelection.join());
-      this.$message.success("操作成功!");
-      this.deletePageLastItem();
+      const res = await deleteExamTask(this.multipleSelection.join()).catch(
+        () => {}
+      );
+      if (res) {
+        this.$message.success("操作成功!");
+        this.deletePageLastItem();
+      } else {
+        this.getList();
+      }
     },
     async toDelete(row) {
       const result = await this.$confirm(`确定要删除命题任务吗?`, "提示", {

+ 8 - 12
src/modules/mark/components/markParam/MarkParamStructure.vue

@@ -438,20 +438,16 @@ export default {
         });
     },
     async toDeleteSub(row) {
-      if (row.objective) {
-        const confirm = await this.$confirm(`确定要删除小题吗?`, "提示", {
-          type: "warning",
-        }).catch(() => {});
-        if (confirm !== "confirm") return;
-      } else {
-        if (
-          this.groupQuestions.includes(`${row.mainNumber}-${row.subNumber}`)
-        ) {
-          this.$message.error("当前小题已有分组,不可删除!");
-          return;
-        }
+      if (!row.objective && this.checkSubQuestionHasGroup(row)) {
+        this.$message.error("当前小题已有分组,不可删除!");
+        return;
       }
 
+      const confirm = await this.$confirm(`确定要删除小题吗?`, "提示", {
+        type: "warning",
+      }).catch(() => {});
+      if (confirm !== "confirm") return;
+
       const subPos = this.tableData.findIndex((item) => item.key === row.key);
       this.tableData.splice(subPos, 1);