Browse Source

BI-48098 fix: 【512回归】数据准备,因文件格式上传失败时改下提示页面

es6
dailer 6 years ago
parent
commit
6f992ce86f
  1. 17
      src/base/single/input/file.js

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

@ -270,9 +270,13 @@
handler.attach_array.push(attachO); handler.attach_array.push(attachO);
} }
} catch (e) { } catch (e) {
if (isFunction(handler.onerror)) {handler.onerror(rpe, event || _global.event);} if (isFunction(handler.onerror)) {
handler.onerror(rpe, event || _global.event);
}
}
if (isFunction(handler.onload)) {
handler.onload(rpe, {responseText: responseText});
} }
if (isFunction(handler.onload)) {handler.onload(rpe, {responseText: responseText});}
}, },
target = ["AjaxUpload", (new Date).getTime(), String(Math.random()).substring(2)].join("_"); target = ["AjaxUpload", (new Date).getTime(), String(Math.random()).substring(2)].join("_");
try { // IE < 8 does not accept enctype attribute ... try { // IE < 8 does not accept enctype attribute ...
@ -483,7 +487,14 @@
self.fireEvent(BI.File.EVENT_ERROR); self.fireEvent(BI.File.EVENT_ERROR);
return; return;
} }
self.fireEvent(BI.File.EVENT_UPLOADED); var error = BI.some(_wrap.attach_array, function (index, attach) {
if (attach.errorCode) {
BI.Msg.toast(attach.errorMsg, {level: "error"});
self.fireEvent(BI.File.EVENT_ERROR, attach);
return true;
}
});
!error && self.fireEvent(BI.File.EVENT_UPLOADED);
// enable again the submit button/element // enable again the submit button/element
}, 1000); }, 1000);
}; };

Loading…
Cancel
Save