diff --git a/dist/2.0/fineui.ie.js b/dist/2.0/fineui.ie.js index f85f093356..f2c7d0c9bd 100644 --- a/dist/2.0/fineui.ie.js +++ b/dist/2.0/fineui.ie.js @@ -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) { diff --git a/dist/2.0/fineui.js b/dist/2.0/fineui.js index 5c832fa5c5..88bf428cb2 100644 --- a/dist/2.0/fineui.js +++ b/dist/2.0/fineui.js @@ -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) { diff --git a/dist/bundle.ie.js b/dist/bundle.ie.js index f85f093356..f2c7d0c9bd 100644 --- a/dist/bundle.ie.js +++ b/dist/bundle.ie.js @@ -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) { diff --git a/dist/bundle.js b/dist/bundle.js index 5c832fa5c5..88bf428cb2 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -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) { diff --git a/dist/fineui.ie.js b/dist/fineui.ie.js index 4fd2feb949..4fb5de0f1f 100644 --- a/dist/fineui.ie.js +++ b/dist/fineui.ie.js @@ -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) { diff --git a/dist/fineui.js b/dist/fineui.js index 5b902a9c78..23dd71f5ed 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -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) { diff --git a/dist/fineui_without_jquery_polyfill.js b/dist/fineui_without_jquery_polyfill.js index 549d0671bc..a56d0b0914 100644 --- a/dist/fineui_without_jquery_polyfill.js +++ b/dist/fineui_without_jquery_polyfill.js @@ -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) { diff --git a/dist/widget.js b/dist/widget.js index 180f82c97e..225f143e39 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -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) { diff --git a/src/widget/dynamicdate/__test__/dynamicdate.combo.test.js b/src/widget/dynamicdate/__test__/dynamicdate.combo.test.js index eb6ff40627..ff854c4ddf 100644 --- a/src/widget/dynamicdate/__test__/dynamicdate.combo.test.js +++ b/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 diff --git a/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js b/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js index dde68f6d97..adf6dfb4bf 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js +++ b/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); } }], diff --git a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js index f9312e384c..894957496d 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js +++ b/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) { diff --git a/src/widget/multilayersingletree/multilayersingletree.trigger.js b/src/widget/multilayersingletree/multilayersingletree.trigger.js index 819986c595..66c350231b 100644 --- a/src/widget/multilayersingletree/multilayersingletree.trigger.js +++ b/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) {