Browse Source

BI-92633 fix: 上传文件会停顿1s

es6
Zhenfei.Li 3 years ago
parent
commit
ebea78994c
  1. 5
      src/base/single/input/file.js

5
src/base/single/input/file.js

@ -520,7 +520,8 @@
setTimeout(function () { setTimeout(function () {
self_.clean(); // remove files from list self_.clean(); // remove files from list
self_.hide(); // hide progress bars and enable input file self_.hide(); // hide progress bars and enable input file
// enable again the submit button/element
}, 100);
if (200 > xhr.status || xhr.status > 399) { if (200 > xhr.status || xhr.status > 399) {
BI.Msg.toast(BI.i18nText("BI-Upload_File_Error"), { level: "error" }); BI.Msg.toast(BI.i18nText("BI-Upload_File_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR); self.fireEvent(BI.File.EVENT_ERROR);
@ -534,8 +535,6 @@
} }
}); });
!error && self.fireEvent(BI.File.EVENT_UPLOADED); !error && self.fireEvent(BI.File.EVENT_UPLOADED);
// enable again the submit button/element
}, 1000);
}; };
_wrap.url = o.url; _wrap.url = o.url;
_wrap.fileType = o.accept; // 文件类型限制 _wrap.fileType = o.accept; // 文件类型限制

Loading…
Cancel
Save