zhangjie %!s(int64=3) %!d(string=hai) anos
pai
achega
41d1f51f1a

+ 4 - 0
src/components/UploadButton.vue

@@ -4,6 +4,7 @@
     :headers="headers"
     :max-size="maxSize"
     :format="format"
+    :accept="accept"
     :data="uploadDataDict"
     :before-upload="handleBeforeUpload"
     :on-error="handleError"
@@ -41,6 +42,9 @@ export default {
     btnContent: {
       type: String
     },
+    accept: {
+      type: String
+    },
     format: {
       type: Array,
       default() {

+ 5 - 0
src/modules/base/components/ModifyStudentSimple.vue

@@ -65,6 +65,8 @@
         :upload-url="uploadUrl"
         :upload-data="uploadData"
         :format="['xls', 'xlsx']"
+        accept=".xls,.xlsx"
+        @upload-error="uplaodError"
         @upload-success="uploadSuccess"
       >
       </upload-button>
@@ -225,6 +227,9 @@ export default {
       this.$refs.SelectClassStudent.clearSelection();
     },
     // import
+    uplaodError(errorData) {
+      this.$notify.error({ title: "错误提示", message: errorData.message });
+    },
     uploadSuccess(data) {
       this.$message.success(data.data || "学生导入成功!");
       this.$emit("modified");

+ 5 - 3
src/modules/base/views/CourseManage.vue

@@ -77,6 +77,8 @@
           btn-type="success"
           :upload-url="uploadUrl"
           :format="['xls', 'xlsx']"
+          accept=".xls,.xlsx"
+          @upload-error="uplaodError"
           @upload-success="uploadSuccess"
         >
         </upload-button>
@@ -289,9 +291,9 @@ export default {
         .catch(() => {});
     },
     // import
-    // uplaodError(errorData) {
-    //   this.$notify.error({ title: "错误提示", message: errorData.message });
-    // },
+    uplaodError(errorData) {
+      this.$notify.error({ title: "错误提示", message: errorData.message });
+    },
     uploadSuccess() {
       this.$message.success("文件上传成功,后台正在导入!");
       this.getList();

+ 5 - 0
src/modules/base/views/StudentManage.vue

@@ -71,6 +71,8 @@
           btn-type="success"
           :upload-url="uploadUrl"
           :format="['xls', 'xlsx']"
+          accept=".xls,.xlsx"
+          @upload-error="uplaodError"
           @upload-success="uploadSuccess"
         >
         </upload-button>
@@ -238,6 +240,9 @@ export default {
         .catch(() => {});
     },
     // import
+    uplaodError(errorData) {
+      this.$notify.error({ title: "错误提示", message: errorData.message });
+    },
     uploadSuccess() {
       this.$message.success("文件上传成功,后台正在导入!");
       this.getList();

+ 5 - 0
src/modules/base/views/UserManage.vue

@@ -83,6 +83,8 @@
           btn-type="success"
           :upload-url="uploadUrl"
           :format="['xls', 'xlsx']"
+          accept=".xls,.xlsx"
+          @upload-error="uplaodError"
           @upload-success="uploadSuccess"
         >
         </upload-button>
@@ -304,6 +306,9 @@ export default {
     //   this.$message.info("您的密码已经变更,请重新登录系统!");
     // },
     // import
+    uplaodError(errorData) {
+      this.$notify.error({ title: "错误提示", message: errorData.message });
+    },
     uploadSuccess() {
       this.getList();
     }

+ 5 - 0
src/modules/exam/views/StatisticsManage.vue

@@ -103,6 +103,8 @@
           btn-type="success"
           :upload-url="uploadUrl"
           :format="['xls', 'xlsx']"
+          accept=".xls,.xlsx"
+          @upload-error="uplaodError"
           @upload-success="uploadSuccess"
         >
         </upload-button>
@@ -260,6 +262,9 @@ export default {
       this.toPage(1);
     },
     // import
+    uplaodError(errorData) {
+      this.$notify.error({ title: "错误提示", message: errorData.message });
+    },
     uploadSuccess() {
       this.$message.success("文件上传成功,后台正在导入!");
       this.getList();