Commit c0a82e69 by chenwq

重构导入状态重置逻辑,优化文件输入处理

1 parent a0b067cc
......@@ -144,11 +144,7 @@ export default {
if (!file || !this.validateFile(file)) {
return;
}
this.failUrl = "";
this.progress = 0;
this.importCompleted = false;
this.succNum = 0;
this.failNum = 0;
this.resetImportStatus();
this.form.file = file;
this.form.fileName = file.name;
this.validateField("fileName");
......@@ -156,6 +152,8 @@ export default {
removeFile() {
this.form.file = null;
this.form.fileName = "";
this.resetFileInput();
this.resetImportStatus();
this.validateField("fileName");
},
validateFile(file) {
......@@ -262,6 +260,13 @@ export default {
resetFileInput() {
this.fileInputKey = Date.now();
},
resetImportStatus() {
this.failUrl = "";
this.progress = 0;
this.importCompleted = false;
this.succNum = 0;
this.failNum = 0;
},
validateField(field) {
this.$nextTick(() => {
this.$refs.importFormRef?.$refs?.[this.importChildRef]?.validateField(field);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!