xiatian 3 сар өмнө
parent
commit
785a4e6cd3

+ 122 - 92
src/modules/questions/views/EditPaper.vue

@@ -1266,31 +1266,36 @@ export default {
         }
       }
       if (count == 0) {
-        this.$alert("您确定删除吗?", "提示", {
-          confirmButtonText: "确定",
-          callback: (action) => {
-            if (action == "confirm") {
-              this.loading = true;
-              this.$httpWithMsg
-                .delete(
-                  QUESTION_API +
-                    "/paperDetail/" +
-                    this.paperId +
-                    "/" +
-                    paperDetailsId
-                )
-                .then(() => {
-                  this.initPaper();
-                  this.loading = true;
-                  this.$notify({
-                    message: "删除成功",
-                    type: "success",
-                  });
-                })
-                .finally(() => (this.loading = false));
-            }
-          },
-        });
+        this.$alert(
+          "您确定删除吗?</br><span style='color:red'>保存后请注意检查试卷总分</span>",
+          "提示",
+          {
+            dangerouslyUseHTMLString: true,
+            confirmButtonText: "确定",
+            callback: (action) => {
+              if (action == "confirm") {
+                this.loading = true;
+                this.$httpWithMsg
+                  .delete(
+                    QUESTION_API +
+                      "/paperDetail/" +
+                      this.paperId +
+                      "/" +
+                      paperDetailsId
+                  )
+                  .then(() => {
+                    this.initPaper();
+                    this.loading = true;
+                    this.$notify({
+                      message: "删除成功",
+                      type: "success",
+                    });
+                  })
+                  .finally(() => (this.loading = false));
+              }
+            },
+          }
+        );
       } else {
         this.$alert("大题下还有小题,不可删除!", "提示", {
           confirmButtonText: "确定",
@@ -1633,9 +1638,10 @@ export default {
       }
       if (this.paper.paperType == "GENERATE") {
         this.$confirm(
-          "试题内容修改,会影响所有关联试卷,是否确定进行?",
+          "试题内容修改,会影响所有关联试卷,是否确定进行?</br><span style='color:red'>保存后请注意检查试卷总分</span>",
           "提示",
           {
+            dangerouslyUseHTMLString: true,
             confirmButtonText: "确定",
             cancelButtonText: "取消",
             type: "warning",
@@ -1783,56 +1789,66 @@ export default {
       }
     },
     deleteQues01(paperDetailUnitId) {
-      this.$alert("您确定删除吗?", "提示", {
-        confirmButtonText: "确定",
-        callback: (action) => {
-          if (action == "confirm") {
-            this.loading = true;
-            this.$httpWithMsg
-              .delete(QUESTION_API + "/paperDetailUnit/" + paperDetailUnitId)
-              .then(() => {
-                this.initPaper();
-                this.getreduplicateQuestions();
-                this.reduplicateGroup = [];
-                this.loading = true;
-                this.$notify({
-                  message: "删除成功",
-                  type: "success",
-                });
-              })
-              .finally(() => (this.loading = false));
-          }
-        },
-      });
+      this.$alert(
+        "您确定删除吗?</br><span style='color:red'>保存后请注意检查试卷总分</span>",
+        "提示",
+        {
+          dangerouslyUseHTMLString: true,
+          confirmButtonText: "确定",
+          callback: (action) => {
+            if (action == "confirm") {
+              this.loading = true;
+              this.$httpWithMsg
+                .delete(QUESTION_API + "/paperDetailUnit/" + paperDetailUnitId)
+                .then(() => {
+                  this.initPaper();
+                  this.getreduplicateQuestions();
+                  this.reduplicateGroup = [];
+                  this.loading = true;
+                  this.$notify({
+                    message: "删除成功",
+                    type: "success",
+                  });
+                })
+                .finally(() => (this.loading = false));
+            }
+          },
+        }
+      );
     },
     deleteQues02(questionId, paperDetailUnitId) {
-      this.$alert("您确定删除吗?", "提示", {
-        confirmButtonText: "确定",
-        callback: (action) => {
-          if (action == "confirm") {
-            this.loading = true;
-            this.$httpWithMsg
-              .delete(
-                QUESTION_API +
-                  "/paper/deleteQuestion/" +
-                  paperDetailUnitId +
-                  "/" +
-                  questionId
-              )
-              .then(() => {
-                this.initPaper();
-                this.getreduplicateQuestions();
-                this.reduplicateGroup = [];
-                this.loading = true;
-                this.$notify({
-                  message: "保存成功",
-                  type: "success",
-                });
-              })
-              .finally(() => (this.loading = false));
-          }
-        },
-      });
+      this.$alert(
+        "您确定删除吗?</br><span style='color:red'>保存后请注意检查试卷总分</span>",
+        "提示",
+        {
+          dangerouslyUseHTMLString: true,
+          confirmButtonText: "确定",
+          callback: (action) => {
+            if (action == "confirm") {
+              this.loading = true;
+              this.$httpWithMsg
+                .delete(
+                  QUESTION_API +
+                    "/paper/deleteQuestion/" +
+                    paperDetailUnitId +
+                    "/" +
+                    questionId
+                )
+                .then(() => {
+                  this.initPaper();
+                  this.getreduplicateQuestions();
+                  this.reduplicateGroup = [];
+                  this.loading = true;
+                  this.$notify({
+                    message: "保存成功",
+                    type: "success",
+                  });
+                })
+                .finally(() => (this.loading = false));
+            }
+          },
+        }
+      );
     },
     //获取重复试题
     getreduplicateQuestions() {
@@ -1896,24 +1912,38 @@ export default {
     },
     //保存试卷
     savePaper() {
-      this.loading = true;
-      this.$http
-        .put(QUESTION_API + "/paper", this.paper)
-        .then(() => {
-          this.$notify({
-            message: "保存成功",
-            type: "success",
-          });
-          this.loading = false;
-          this.initPaper();
-        })
-        .catch((error) => {
-          this.loading = false;
-          this.$notify({
-            type: "error",
-            message: error.response.data.desc,
-          });
-        });
+      this.$confirm(
+        "<span style='color:red'>当前试卷总分为" +
+          this.paper.totalScore +
+          ",是否保存?</span>",
+        "提示",
+        {
+          dangerouslyUseHTMLString: true,
+          confirmButtonText: "是",
+          cancelButtonText: "否",
+          type: "warning",
+        }
+      ).then(() => {
+        this.loading = true;
+        this.$http
+          .put(QUESTION_API + "/paper", this.paper)
+          .then(() => {
+            this.$notify({
+              message: "保存成功",
+              type: "success",
+            });
+            this.loading = false;
+            this.initPaper();
+          })
+          .catch((error) => {
+            this.loading = false;
+            this.$notify({
+              type: "error",
+              message: error.response.data.desc,
+            });
+          })
+          .finally(() => (this.loading = false));
+      });
     },
     //删除试卷
     deletePaper(id) {

+ 10 - 5
src/modules/questions/views/SelectQuestion.vue

@@ -314,11 +314,16 @@ export default {
           message: "请选择要添加的试题",
         });
       } else {
-        this.$confirm("是否添加这些试题?", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
-        }).then(() => {
+        this.$confirm(
+          "是否添加这些试题?</br><span style='color:red'>保存后请注意检查试卷总分</span>",
+          "提示",
+          {
+            dangerouslyUseHTMLString: true,
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          }
+        ).then(() => {
           this.$httpWithMsg
             .post(
               QUESTION_API +