b0894a3d by 杨威

属性导入和楼盘表上传功能loading

1 parent bb9ff632
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
12 action="/api/tx/excelGeo/import" 12 action="/api/tx/excelGeo/import"
13 :data="sxdrData" 13 :data="sxdrData"
14 :on-success="uploadSuccess" 14 :on-success="uploadSuccess"
15 :before-upload="uploadProgress"
15 :show-file-list="false" 16 :show-file-list="false"
16 multiple 17 multiple
17 > 18 >
...@@ -92,17 +93,21 @@ ...@@ -92,17 +93,21 @@
92 elemIF.style.display = "none"; 93 elemIF.style.display = "none";
93 document.body.appendChild(elemIF) 94 document.body.appendChild(elemIF)
94 }, 95 },
96 uploadProgress(){
97 vm.loadingShow('正在导入中')
98 },
95 uploadSuccess(res, file, fileList) { 99 uploadSuccess(res, file, fileList) {
96 this.errorData = []; 100 this.errorData = [];
101 vm.loadingHide();
97 if (res.success) { 102 if (res.success) {
98 this.$message.success("上传成功") 103 this.$message.success("导入成功")
99 this.loading(); 104 this.loading();
100 this.close() 105 this.close()
101 } else { 106 } else {
102 if (res.result == null) { 107 if (res.result == null) {
103 this.$message.error(res.message) 108 this.$message.error(res.message)
104 } else { 109 } else {
105 this.$message.error("上传失败") 110 this.$message.error("导入失败")
106 this.errorData = res.result; 111 this.errorData = res.result;
107 } 112 }
108 } 113 }
......
...@@ -330,6 +330,7 @@ ...@@ -330,6 +330,7 @@
330 :on-preview="handlePreview" 330 :on-preview="handlePreview"
331 :on-remove="handleRemove" 331 :on-remove="handleRemove"
332 :before-remove="beforeRemove" 332 :before-remove="beforeRemove"
333 :before-upload="uploadProgress"
333 :on-success="uploadSuccess" 334 :on-success="uploadSuccess"
334 :on-error="uploadError" 335 :on-error="uploadError"
335 :show-file-list="false" 336 :show-file-list="false"
...@@ -564,7 +565,11 @@ export default { ...@@ -564,7 +565,11 @@ export default {
564 Message.error("上传文件失败") 565 Message.error("上传文件失败")
565 console.log("上传文件失败", err) 566 console.log("上传文件失败", err)
566 }, 567 },
568 uploadProgress(){
569 vm.loadingShow('正在上传中')
570 },
567 uploadSuccess(res, file, fileList) { 571 uploadSuccess(res, file, fileList) {
572 vm.loadingHide();
568 Message.success("上传成功") 573 Message.success("上传成功")
569 this.uploadVisible = false; 574 this.uploadVisible = false;
570 }, 575 },
......