zhangjie 5 rokov pred
rodič
commit
f423ca6847

+ 71 - 0
src/assets/styles/element-ui-costom.scss

@@ -133,6 +133,17 @@
     background: $--color-white;
     border: 1px solid $--color-border;
   }
+  &.el-button--default-act {
+    color: $--color-text-regular !important;
+    background: $--color-background !important;
+    border: 1px solid $--color-border !important;
+    &:hover,
+    &:focus {
+      color: $--color-text-regular !important;
+      background: $--color-white !important;
+      border: 1px solid $--color-border !important;
+    }
+  }
 }
 .el-button--primary {
   color: $--color-white;
@@ -329,3 +340,63 @@
     }
   }
 }
+// el-message-box
+.el-message-box {
+  width: 350px;
+  background-color: #f6f6f6;
+  border-radius: 10px;
+  &__title {
+    display: none;
+  }
+  .el-message-box__close.el-icon-close {
+    height: 18px;
+    width: 18px;
+    &::before {
+      display: block;
+      width: 100%;
+      height: 100%;
+      content: "";
+      background-image: url(../images/icon-close.png);
+      background-repeat: no-repeat;
+      background-size: 100% 100%;
+    }
+  }
+  &__content {
+    text-align: center;
+
+    .el-message-box__status {
+      position: relative;
+      top: 0;
+      height: 50px;
+      width: 50px;
+      transform: none;
+      margin-bottom: 10px;
+
+      &.el-icon-warning {
+        border-radius: 50%;
+        &::before {
+          content: "";
+          position: absolute;
+          top: 0;
+          left: 0;
+          width: 100%;
+          height: 100%;
+          background-image: url(../images/icon-doubt.png);
+          background-repeat: no-repeat;
+          background-size: 100% 100%;
+        }
+      }
+    }
+    .el-message-box__message {
+      padding: 0;
+    }
+  }
+  &__btns {
+    text-align: center;
+    padding: 20px;
+
+    > .el-button {
+      width: 85px;
+    }
+  }
+}

+ 5 - 0
src/assets/styles/icons.scss

@@ -208,4 +208,9 @@
     width: 18px;
     height: 10px;
   }
+  &-doubt {
+    background-image: url(../images/icon-doubt.png);
+    width: 50px;
+    height: 50px;
+  }
 }

+ 7 - 4
src/modules/analyze/views/ScoreAnalyze.vue

@@ -169,14 +169,17 @@ export default {
     },
     toDelete(row) {
       this.$confirm("确定要删除当前学校吗?", "删除警告", {
-        callback: async action => {
-          if (action !== "confirm") return;
+        cancelButtonClass: "el-button--primary",
+        confirmButtonClass: "el-button--default-act",
+        type: "warning"
+      })
+        .then(async () => {
           await deleteCourse(row.id);
           this.$message.success("删除成功!");
           // 解决最后一项删除后的问题
           this.deletePageLastItem();
-        }
-      });
+        })
+        .catch(() => {});
     }
   }
 };

+ 2 - 2
src/modules/card/components/PagePropEdit.vue

@@ -147,8 +147,8 @@ export default {
     },
     modifyPageSize(pageSize) {
       this.$confirm("此操作将会重置当前页面所有元素信息, 是否继续?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
+        cancelButtonClass: "el-button--primary",
+        confirmButtonClass: "el-button--default-act",
         type: "warning"
       })
         .then(() => {

+ 2 - 2
src/modules/card/components/RightClickMenu.vue

@@ -103,8 +103,8 @@ export default {
     toDelete() {
       this.visible = false;
       this.$confirm("确定要删除当前元素吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
+        cancelButtonClass: "el-button--primary",
+        confirmButtonClass: "el-button--default-act",
         type: "warning"
       })
         .then(() => {

+ 20 - 14
src/modules/exam-center/views/CardManage.vue

@@ -207,28 +207,34 @@ export default {
         "一旦准备印刷,题卡将不可再编辑,确定要提交印刷吗?",
         "警告",
         {
-          callback: async action => {
-            if (action !== "confirm") return;
-            await changeCardStatus({
-              cardId: row.id,
-              cardStatus: 1
-            });
-            this.getList();
-            this.$message.success("提交成功!");
-          }
+          cancelButtonClass: "el-button--primary",
+          confirmButtonClass: "el-button--default-act",
+          type: "warning"
         }
-      );
+      )
+        .then(async () => {
+          await changeCardStatus({
+            cardId: row.id,
+            cardStatus: 1
+          });
+          this.getList();
+          this.$message.success("提交成功!");
+        })
+        .catch(() => {});
     },
     toDelete(row) {
       this.$confirm("确定要删除当前题卡吗?", "删除警告", {
-        callback: async action => {
-          if (action !== "confirm") return;
+        cancelButtonClass: "el-button--primary",
+        confirmButtonClass: "el-button--default-act",
+        type: "warning"
+      })
+        .then(async () => {
           await deleteCard(row.id);
           this.$message.success("删除成功!");
           // 解决最后一项删除后的问题
           this.deletePageLastItem();
-        }
-      });
+        })
+        .catch(() => {});
     }
   }
 };

+ 2 - 2
src/modules/exam-center/views/DoneTaskDetail.vue

@@ -101,8 +101,8 @@ export default {
     },
     toRevoke() {
       this.$confirm("确定要撤回当前任务吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
+        cancelButtonClass: "el-button--primary",
+        confirmButtonClass: "el-button--default-act",
         type: "warning"
       }).then(async () => {
         await revokeDoneTask(this.task);

+ 2 - 2
src/modules/exam-center/views/ExamManage.vue

@@ -157,8 +157,8 @@ export default {
     },
     toDelete(row) {
       this.$confirm("确定要删除当前考试吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
+        cancelButtonClass: "el-button--primary",
+        confirmButtonClass: "el-button--default-act",
         type: "warning"
       }).then(async () => {
         await deleteExam(row.id);

+ 2 - 2
src/modules/exam-center/views/WaitTaskDetail.vue

@@ -236,8 +236,8 @@ export default {
         "任务确定提交后,则不可更改试卷及答题卡内容,确定提交该任务?",
         "提示",
         {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
+          cancelButtonClass: "el-button--primary",
+          confirmButtonClass: "el-button--default-act",
           type: "warning"
         }
       ).then(async () => {

+ 7 - 4
src/modules/example/views/DataManage.vue

@@ -169,14 +169,17 @@ export default {
     },
     toDelete(row) {
       this.$confirm("确定要删除当前学校吗?", "删除警告", {
-        callback: async action => {
-          if (action !== "confirm") return;
+        cancelButtonClass: "el-button--primary",
+        confirmButtonClass: "el-button--default-act",
+        type: "warning"
+      })
+        .then(async () => {
           await deleteCourse(row.id);
           this.$message.success("删除成功!");
           // 解决最后一项删除后的问题
           this.deletePageLastItem();
-        }
-      });
+        })
+        .catch(() => {});
     }
   }
 };

+ 7 - 4
src/modules/score-paper/views/ClassPaper.vue

@@ -169,14 +169,17 @@ export default {
     },
     toDelete(row) {
       this.$confirm("确定要删除当前学校吗?", "删除警告", {
-        callback: async action => {
-          if (action !== "confirm") return;
+        cancelButtonClass: "el-button--primary",
+        confirmButtonClass: "el-button--default-act",
+        type: "warning"
+      })
+        .then(async () => {
           await deleteCourse(row.id);
           this.$message.success("删除成功!");
           // 解决最后一项删除后的问题
           this.deletePageLastItem();
-        }
-      });
+        })
+        .catch(() => {});
     }
   }
 };

+ 25 - 2
src/views/404.vue

@@ -1,6 +1,15 @@
 <template>
-  <div class="not-found">
-    page not exist!
+  <div class="not-found login-home">
+    <div class="login-box not-found-content">
+      <h1>404</h1>
+      <p>非常抱歉,您访问的页面不存在!</p>
+      <el-button
+        type="primary"
+        icon="icon icon-arrow-right"
+        @click="$router.replace({ name: 'Home' })"
+        >返回首页</el-button
+      >
+    </div>
   </div>
 </template>
 
@@ -13,3 +22,17 @@ export default {
   methods: {}
 };
 </script>
+
+<style lang="scss" scoped>
+.not-found-content {
+  color: #fff;
+  h1 {
+    font-size: 150px;
+    line-height: 1;
+  }
+  p {
+    font-size: 16px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 12 - 4
src/views/Home.vue

@@ -234,10 +234,18 @@ export default {
         name: elem.router
       });
     },
-    async toLogout() {
-      await logout(this.$ls.get("user", { id: "" }).id);
-      this.$ls.clear();
-      this.$router.push({ name: "Login" });
+    toLogout() {
+      this.$confirm("确定要退出登录吗?", "提示", {
+        cancelButtonClass: "el-button--primary",
+        confirmButtonClass: "el-button--default-act",
+        type: "warning"
+      })
+        .then(async () => {
+          await logout(this.$ls.get("user", { id: "" }).id);
+          this.$ls.clear();
+          this.$router.push({ name: "Login" });
+        })
+        .catch(() => {});
     }
   }
 };