|
@@ -22,11 +22,13 @@
|
|
|
:on-error="handleError"
|
|
|
:on-success="handleSuccess"
|
|
|
:on-remove="handleRemove"
|
|
|
+ :disabled="!!load"
|
|
|
ref="UploadComp"
|
|
|
>
|
|
|
<div style="padding: 40px 0">
|
|
|
<Icon class="upload-icon" type="md-cloud-upload" size="40"></Icon>
|
|
|
- <p>将文件拖到此处,或<em>点击上传</em></p>
|
|
|
+ <p v-if="load">正在导入……</p>
|
|
|
+ <p v-else>将文件拖到此处,或<em>点击上传</em></p>
|
|
|
</div>
|
|
|
</Upload>
|
|
|
<p
|
|
@@ -103,7 +105,8 @@ export default {
|
|
|
res: {
|
|
|
success: true,
|
|
|
msg: ""
|
|
|
- }
|
|
|
+ },
|
|
|
+ load: null
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -133,15 +136,25 @@ export default {
|
|
|
success: true,
|
|
|
msg: ""
|
|
|
};
|
|
|
+
|
|
|
+ this.load = this.$Message.loading({
|
|
|
+ content: "Loading...",
|
|
|
+ duration: 0
|
|
|
+ });
|
|
|
},
|
|
|
handleError(error, response) {
|
|
|
+ this.load();
|
|
|
+ this.load = null;
|
|
|
this.res = {
|
|
|
success: false,
|
|
|
msg: response.message
|
|
|
};
|
|
|
},
|
|
|
handleSuccess(response) {
|
|
|
+ this.load();
|
|
|
+ this.load = null;
|
|
|
this.$emit("upload-success", response);
|
|
|
+ this.cancel();
|
|
|
},
|
|
|
handleFormatError() {
|
|
|
this.res = {
|