Browse Source

Pull request #1662: 无JIRA任务 多文件上传相关

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit '64680353384a406996be4d15958ba420806efbfa':
  无JIRA任务 多文件上传相关
es6
windy 4 years ago
parent
commit
90547a0da4
  1. 1
      changelog.md
  2. 4
      src/base/single/editor/editor.multifile.js
  3. 11
      src/base/single/input/file.js

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志 # 更新日志
2.0(2020-12) 2.0(2020-12)
- 文件上传控件新增API(setMaxFileLength)以动态设置最大上传文件数量
- 复选下拉树显示查看已选效果改成和复选下拉列表一致 - 复选下拉树显示查看已选效果改成和复选下拉列表一致
- Pane系列提供small和big两种大小的加载动画 - Pane系列提供small和big两种大小的加载动画
- 同步树列表系列支持不显示节点连接线和展开收起图标 - 同步树列表系列支持不显示节点连接线和展开收起图标

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

@ -71,6 +71,10 @@ BI.MultifileEditor = BI.inherit(BI.Widget, {
this.file.reset(); this.file.reset();
}, },
setMaxFileLength: function (v) {
this.file.setMaxFileLength(v);
},
select: function () { select: function () {
this.file.select(); this.file.select();
}, },

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

@ -545,12 +545,12 @@
}, },
_events: function (wrap) { _events: function (wrap) {
var self = this; var self = this, o = this.options;
event.add(wrap.dom.input, "change", function () { event.add(wrap.dom.input, "change", function () {
event.del(wrap.dom.input, "change", arguments.callee); event.del(wrap.dom.input, "change", arguments.callee);
var input = wrap.dom.input.cloneNode(true); var input = wrap.dom.input.cloneNode(true);
var files = F(wrap.dom.input); var files = F(wrap.dom.input);
if (wrap.maxLength !== -1 && wrap.maxLength < files.length) { if (o.maxLength !== -1 && o.maxLength < files.length) {
self.fireEvent(BI.File.EVENT_ERROR, { self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 2 errorType: 2
}); });
@ -654,6 +654,13 @@
}); });
}, },
setMaxFileLength: function(v) {
this.options.maxLength = v;
if (this.wrap) {
this.wrap.maxLength = v;
}
},
select: function () { select: function () {
this.wrap && BI.Widget._renderEngine.createElement(this.wrap.dom.input).click(); this.wrap && BI.Widget._renderEngine.createElement(this.wrap.dom.input).click();
}, },

Loading…
Cancel
Save