Browse Source

Pull request #3049: KERNEL-12683 feat: 文件上传支持自定义校验 , bi.file reset方法清空前一次上传的files

Merge in VISUAL/fineui from ~DAILER/fineui:master to master

* commit '1bd7c58af00cd72a770ab5e36fe8c2aa12e9c086':
  KERNEL-11911 feat: label组件默认使用text作为tooltip,仅对label生效,不影响html_label
  KERNEL-12609 fix: From FDL 显示日志信息场景,label默认带有tooltip逻辑导致卡顿
  Revert "KERNEL-12609 fix: From FDL 显示日志信息场景,label默认带有tooltip逻辑导致卡顿"
  KERNEL-12683 feat: 文件上传支持自定义校验 , bi.file reset方法清空前一次上传的files
  无JIRA 去掉sameroute报错
es6
Dailer-刘荣歆 2 years ago
parent
commit
69fb9ed436
  1. 3
      src/base/single/editor/editor.multifile.js
  2. 3
      src/base/single/input/file.js
  3. 17
      src/base/single/label/abstract.label.js
  4. 17
      src/base/single/label/label.js
  5. 8
      src/base/single/tip/tip.tooltip.js
  6. 2
      src/router/router.js

3
src/base/single/editor/editor.multifile.js

@ -43,12 +43,14 @@ BI.MultifileEditor = BI.inherit(BI.Widget, {
}); });
this.file.on(BI.File.EVENT_ERROR, function () { this.file.on(BI.File.EVENT_ERROR, function () {
self.fireEvent(BI.MultifileEditor.EVENT_ERROR, arguments); self.fireEvent(BI.MultifileEditor.EVENT_ERROR, arguments);
self._reset();
}); });
this.file.on(BI.File.EVENT_PROGRESS, function () { this.file.on(BI.File.EVENT_PROGRESS, function () {
self.fireEvent(BI.MultifileEditor.EVENT_PROGRESS, arguments); self.fireEvent(BI.MultifileEditor.EVENT_PROGRESS, arguments);
}); });
this.file.on(BI.File.EVENT_UPLOADED, function () { this.file.on(BI.File.EVENT_UPLOADED, function () {
self.fireEvent(BI.MultifileEditor.EVENT_UPLOADED, arguments); self.fireEvent(BI.MultifileEditor.EVENT_UPLOADED, arguments);
self._reset();
}); });
BI.createWidget({ BI.createWidget({
@ -93,7 +95,6 @@ BI.MultifileEditor = BI.inherit(BI.Widget, {
}, },
upload: function () { upload: function () {
this._reset();
this.file.upload(); this.file.upload();
}, },

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

@ -114,7 +114,7 @@
handler.onerror(); handler.onerror();
} }
return; return;
} }
for (var xhr = new XMLHttpRequest, for (var xhr = new XMLHttpRequest,
upload = xhr.upload || { upload = xhr.upload || {
@ -705,6 +705,7 @@
reset: function () { reset: function () {
if (this.wrap) { if (this.wrap) {
this.wrap.files = [];
this.wrap.attach_array = []; this.wrap.attach_array = [];
this.wrap.attach_names = []; this.wrap.attach_names = [];
this.wrap.attachNum = 0; this.wrap.attachNum = 0;

17
src/base/single/label/abstract.label.js

@ -24,23 +24,6 @@
}); });
}, },
getTitle: function () {
var title = this.options.title;
var text = this.options.text;
if (BI.isFunction(title)) {
return title();
}
if (BI.isNotNull(title)) {
return title;
}
if (BI.isFunction(text)) {
return text();
}
return text;
},
_createJson: function () { _createJson: function () {
var o = this.options; var o = this.options;

17
src/base/single/label/label.js

@ -10,6 +10,23 @@ BI.Label = BI.inherit(BI.AbstractLabel, {
keyword: "", keyword: "",
}, },
getTitle: function () {
var title = this.options.title;
var text = this.options.text;
if (BI.isFunction(title)) {
return title();
}
if (BI.isNotNull(title)) {
return title;
}
if (BI.isFunction(text)) {
return text();
}
return text;
},
doRedMark: function () { doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments); this.text.doRedMark.apply(this.text, arguments);
}, },

8
src/base/single/tip/tip.tooltip.js

@ -25,12 +25,10 @@ BI.Tooltip = BI.inherit(BI.Tip, {
render: function () { render: function () {
var o = this.options; var o = this.options;
this.element.addClass("tooltip-" + o.level); this.element.addClass("tooltip-" + o.level);
function fn(e) { function fn(e) {
o.stopPropagation && e.stopPropagation(); o.stopPropagation && e.stopPropagation();
o.stopEvent && e.stopEvent(); o.stopEvent && e.stopEvent();
} }
this.element.bind({ this.element.bind({
click: fn, click: fn,
mousedown: fn, mousedown: fn,
@ -50,21 +48,23 @@ BI.Tooltip = BI.inherit(BI.Tip, {
innerVgap: this._const.vgap, innerVgap: this._const.vgap,
items: BI.map(texts, function (i, text) { items: BI.map(texts, function (i, text) {
return { return {
type: "bi.text", type: "bi.label",
textAlign: o.textAlign, textAlign: o.textAlign,
whiteSpace: "normal", whiteSpace: "normal",
text: text, text: text,
textHeight: 18, textHeight: 18,
title: null,
}; };
}), }),
}); });
} else { } else {
this.text = BI.createWidget({ this.text = BI.createWidget({
type: "bi.text", type: "bi.label",
element: this, element: this,
textAlign: o.textAlign, textAlign: o.textAlign,
whiteSpace: "normal", whiteSpace: "normal",
text: o.text, text: o.text,
title: null,
textHeight: 18, textHeight: 18,
hgap: this._const.hgap, hgap: this._const.hgap,
vgap: this._const.vgap, vgap: this._const.vgap,

2
src/router/router.js

@ -2326,7 +2326,7 @@
route.matched[lastRouteIndex] === current.matched[lastCurrentIndex] route.matched[lastRouteIndex] === current.matched[lastCurrentIndex]
) { ) {
this.ensureURL(); this.ensureURL();
return abort(createNavigationDuplicatedError(current, route)) return;
} }
var ref = resolveQueue( var ref = resolveQueue(

Loading…
Cancel
Save