Browse Source

Merge pull request #1129 in VISUAL/fineui from ~WINDY/fineui:master to master

* commit 'c2e1193e87a334571d37aea760348875f6ff8da2':
  更新
  revert
  BI-51100 单测
  少改了
  抽一下公共方法
es6
guy 5 years ago
parent
commit
21fbee9bff
  1. 28
      dist/2.0/fineui.ie.js
  2. 28
      dist/2.0/fineui.js
  3. 28
      dist/bundle.ie.js
  4. 28
      dist/bundle.js
  5. 28
      dist/fineui.ie.js
  6. 28
      dist/fineui.js
  7. 28
      dist/fineui_without_jquery_polyfill.js
  8. 28
      dist/widget.js
  9. 120
      src/widget/dynamicdate/__test__/dynamicdate.combo.test.js
  10. 2
      src/widget/dynamicdatetime/dynamicdatetime.timeselect.js
  11. 13
      src/widget/multilayerselecttree/multilayerselecttree.trigger.js
  12. 13
      src/widget/multilayersingletree/multilayersingletree.trigger.js

28
dist/2.0/fineui.ie.js vendored

@ -66206,7 +66206,7 @@ BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup);BI.DynamicDat
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getLastChangedValue(), BI.DynamicDateTimeSelect.MINUTE);
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.MINUTE);
this.setValue(value);
}
}],
@ -69129,9 +69129,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
this._initData();
}
var content = {
type: "bi.htape",
@ -69238,6 +69236,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -69319,7 +69324,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) {
this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items));
this._initData(items);
},
setValue: function (v) {
@ -70305,9 +70310,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
this._initData();
}
var content = {
type: "bi.htape",
@ -70414,6 +70417,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -70496,7 +70506,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) {
this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items));
this._initData();
},
setValue: function (v) {

28
dist/2.0/fineui.js vendored

@ -66610,7 +66610,7 @@ BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup);BI.DynamicDat
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getLastChangedValue(), BI.DynamicDateTimeSelect.MINUTE);
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.MINUTE);
this.setValue(value);
}
}],
@ -69533,9 +69533,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
this._initData();
}
var content = {
type: "bi.htape",
@ -69642,6 +69640,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -69723,7 +69728,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) {
this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items));
this._initData(items);
},
setValue: function (v) {
@ -70709,9 +70714,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
this._initData();
}
var content = {
type: "bi.htape",
@ -70818,6 +70821,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -70900,7 +70910,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) {
this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items));
this._initData();
},
setValue: function (v) {

28
dist/bundle.ie.js vendored

@ -66206,7 +66206,7 @@ BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup);BI.DynamicDat
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getLastChangedValue(), BI.DynamicDateTimeSelect.MINUTE);
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.MINUTE);
this.setValue(value);
}
}],
@ -69129,9 +69129,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
this._initData();
}
var content = {
type: "bi.htape",
@ -69238,6 +69236,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -69319,7 +69324,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) {
this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items));
this._initData(items);
},
setValue: function (v) {
@ -70305,9 +70310,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
this._initData();
}
var content = {
type: "bi.htape",
@ -70414,6 +70417,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -70496,7 +70506,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) {
this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items));
this._initData();
},
setValue: function (v) {

28
dist/bundle.js vendored

@ -66610,7 +66610,7 @@ BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup);BI.DynamicDat
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getLastChangedValue(), BI.DynamicDateTimeSelect.MINUTE);
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.MINUTE);
this.setValue(value);
}
}],
@ -69533,9 +69533,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
this._initData();
}
var content = {
type: "bi.htape",
@ -69642,6 +69640,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -69723,7 +69728,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) {
this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items));
this._initData(items);
},
setValue: function (v) {
@ -70709,9 +70714,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
this._initData();
}
var content = {
type: "bi.htape",
@ -70818,6 +70821,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -70900,7 +70910,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) {
this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items));
this._initData();
},
setValue: function (v) {

28
dist/fineui.ie.js vendored

@ -66451,7 +66451,7 @@ BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup);BI.DynamicDat
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getLastChangedValue(), BI.DynamicDateTimeSelect.MINUTE);
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.MINUTE);
this.setValue(value);
}
}],
@ -69374,9 +69374,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
this._initData();
}
var content = {
type: "bi.htape",
@ -69483,6 +69481,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -69564,7 +69569,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) {
this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items));
this._initData(items);
},
setValue: function (v) {
@ -70550,9 +70555,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
this._initData();
}
var content = {
type: "bi.htape",
@ -70659,6 +70662,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -70741,7 +70751,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) {
this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items));
this._initData();
},
setValue: function (v) {

28
dist/fineui.js vendored

@ -66855,7 +66855,7 @@ BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup);BI.DynamicDat
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getLastChangedValue(), BI.DynamicDateTimeSelect.MINUTE);
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.MINUTE);
this.setValue(value);
}
}],
@ -69778,9 +69778,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
this._initData();
}
var content = {
type: "bi.htape",
@ -69887,6 +69885,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -69968,7 +69973,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) {
this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items));
this._initData(items);
},
setValue: function (v) {
@ -70954,9 +70959,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
this._initData();
}
var content = {
type: "bi.htape",
@ -71063,6 +71066,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -71145,7 +71155,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) {
this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items));
this._initData();
},
setValue: function (v) {

28
dist/fineui_without_jquery_polyfill.js vendored

@ -49154,7 +49154,7 @@ BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup);BI.DynamicDat
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getLastChangedValue(), BI.DynamicDateTimeSelect.MINUTE);
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.MINUTE);
this.setValue(value);
}
}],
@ -52077,9 +52077,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
this._initData();
}
var content = {
type: "bi.htape",
@ -52186,6 +52184,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -52267,7 +52272,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) {
this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items));
this._initData(items);
},
setValue: function (v) {
@ -53253,9 +53258,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
this._initData();
}
var content = {
type: "bi.htape",
@ -53362,6 +53365,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -53444,7 +53454,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) {
this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items));
this._initData();
},
setValue: function (v) {

28
dist/widget.js vendored

@ -4264,7 +4264,7 @@ BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup);BI.DynamicDat
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getLastChangedValue(), BI.DynamicDateTimeSelect.MINUTE);
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.MINUTE);
this.setValue(value);
}
}],
@ -7187,9 +7187,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
this._initData();
}
var content = {
type: "bi.htape",
@ -7296,6 +7294,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -7377,7 +7382,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) {
this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items));
this._initData(items);
},
setValue: function (v) {
@ -8363,9 +8368,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
this._initData();
}
var content = {
type: "bi.htape",
@ -8472,6 +8475,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -8554,7 +8564,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) {
this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items));
this._initData();
},
setValue: function (v) {

120
src/widget/dynamicdate/__test__/dynamicdate.combo.test.js

@ -82,6 +82,126 @@ describe("DateCombo", function () {
});
/**
* test_author_windy
*/
it("下拉后直接点击外部的触发的confirm", function (done) {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_combo",
width: 220,
height: 30,
});
// 点击日期,是否收起下拉
BI.nextTick(function () {
dateCombo.element.find(".bi-date-trigger .bi-basic-button").click();
BI.nextTick(function () {
var input = dateCombo.element.find(".bi-date-trigger .bi-input");
BI.Test.triggerKeyDown(input, null, BI.KeyCode.ENTER, function () {
BI.delay(function () {
expect(dateCombo.element.find(".bi-date-trigger + .bi-popup-view").css("display")).to.equal("none");
dateCombo.destroy();
done();
}, 300);
});
})
});
});
/**
* test_author_windy
*/
it("点击清空", function (done) {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_combo",
width: 220,
height: 30,
value: {
type: 1,
value: {
year: 2018,
month: 2,
day: 23
}
}
});
dateCombo.element.find(".bi-date-trigger .bi-basic-button").click();
BI.nextTick(function () {
dateCombo.element.find(".bi-dynamic-date-popup .bi-text:contains(清除)").parent().click();
expect(BI.isNull(dateCombo.getValue())).to.equal(true);
dateCombo.destroy();
done();
})
});
/**
* test_author_windy
*/
it("点击今天", function (done) {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_combo",
width: 220,
height: 30,
value: {
type: 1,
value: {
year: 2018,
month: 2,
day: 23
}
}
});
dateCombo.element.find(".bi-date-trigger .bi-basic-button").click();
BI.nextTick(function () {
dateCombo.element.find(".bi-dynamic-date-popup .bi-text:contains(今天)").parent().click();
var date = BI.getDate();
expect(dateCombo.getValue()).to.deep.equal({
type: 1,
value: {
year: date.getFullYear(),
month: date.getMonth() + 1,
day: date.getDate()
}
});
dateCombo.destroy();
done();
})
});
/**
* test_author_windy
*/
it("点击确定", function (done) {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_combo",
width: 220,
height: 30,
value: {
type: 1,
value: {
year: 2018,
month: 2,
day: 23
}
}
});
dateCombo.element.find(".bi-date-trigger .bi-basic-button").click();
BI.nextTick(function () {
dateCombo.element.find(".bi-dynamic-date-popup .bi-text:contains(确定)").parent().click();
expect(dateCombo.getValue()).to.deep.equal({
type: 1,
value: {
year: 2018,
month: 2,
day: 23
}
});
dateCombo.destroy();
done();
})
});
/**
* test_author_windy

2
src/widget/dynamicdatetime/dynamicdatetime.timeselect.js

@ -72,7 +72,7 @@ BI.DynamicDateTimeSelect = BI.inherit(BI.Widget, {
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getLastChangedValue(), BI.DynamicDateTimeSelect.MINUTE);
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.MINUTE);
this.setValue(value);
}
}],

13
src/widget/multilayerselecttree/multilayerselecttree.trigger.js

@ -19,9 +19,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
this._initData();
}
var content = {
type: "bi.htape",
@ -128,6 +126,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -209,7 +214,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) {
this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items));
this._initData(items);
},
setValue: function (v) {

13
src/widget/multilayersingletree/multilayersingletree.trigger.js

@ -19,9 +19,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
this._initData();
}
var content = {
type: "bi.htape",
@ -128,6 +126,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
@ -210,7 +215,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
populate: function (items) {
this.options.items = items;
this.nodes = BI.Tree.treeFormat(BI.deepClone(items));
this._initData();
},
setValue: function (v) {

Loading…
Cancel
Save