From 0cdd8a7692a9d3f23bedfa0f5ac91c53d078a1a1 Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 23 Sep 2019 10:36:17 +0800 Subject: [PATCH 01/16] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E4=B8=A4?= =?UTF-8?q?=E4=B8=AA=E7=B1=BB=E7=9A=84=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/base/pane.ts | 12 ++++++++++++ typescript/case/loading/loading_pane.ts | 5 +++++ typescript/index.ts | 4 ++++ 3 files changed, 21 insertions(+) create mode 100644 typescript/base/pane.ts create mode 100644 typescript/case/loading/loading_pane.ts diff --git a/typescript/base/pane.ts b/typescript/base/pane.ts new file mode 100644 index 000000000..1d8acd8bf --- /dev/null +++ b/typescript/base/pane.ts @@ -0,0 +1,12 @@ +import { _Widget } from "../core/widget"; + +export interface _Pane extends _Widget { + _assertTip: (..._args: any[]) => void; + loading: (..._args: any[]) => void; + loaded: (..._args: any[]) => void; + check: (..._args: any[]) => void; +} + +export interface _PaneStatic { + EVENT_LOADED: "EVENT_LOADED"; +} \ No newline at end of file diff --git a/typescript/case/loading/loading_pane.ts b/typescript/case/loading/loading_pane.ts new file mode 100644 index 000000000..35c0d3aa5 --- /dev/null +++ b/typescript/case/loading/loading_pane.ts @@ -0,0 +1,5 @@ +import { _Pane } from "../../base/pane"; + +export interface _LoadingPane extends _Pane { + __loaded: (...args: any[]) => void; +} diff --git a/typescript/index.ts b/typescript/index.ts index 8cb79dc3b..802a8f651 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -11,6 +11,8 @@ import { _ShowAction } from "./core/action/action.show"; import { _Behavior, _BehaviorFactory } from "./core/behavior/behavior"; import { _HighlightBehavior } from "./core/behavior/behavior.highlight"; import { _RedMarkBehavior } from "./core/behavior/behavior.redmark"; +import { _Pane, _PaneStatic } from "./base/pane"; +import { _LoadingPane } from "./case/loading/loading_pane"; type ClassConstructor = T & { @@ -32,4 +34,6 @@ export interface _BI extends _func, _i18n, _base { BehaviorFactory: ClassConstructor<_BehaviorFactory>; HighlightBehavior: ClassConstructor<_HighlightBehavior>; RedMarkBehavior: ClassConstructor<_RedMarkBehavior>; + Pane: ClassConstructor<_Pane> & _PaneStatic; + LoadingPane: ClassConstructor<_LoadingPane>; } From 50c0ac8ae052a6b20761c5be84938d3d6fb24b92 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 23 Sep 2019 12:27:46 +0800 Subject: [PATCH 02/16] =?UTF-8?q?BI-51490=20fix:=20=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=B2=98=E8=B4=B4=E5=80=BC=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=92=8C=E4=B8=8B=E6=8B=89=E6=A1=86=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../multiselectlist/multiselectlist.insert.js | 20 ++++++++----------- .../multiselectlist.insert.nobar.js | 20 ++++++++----------- src/widget/multiselectlist/multiselectlist.js | 20 ++++++++----------- 3 files changed, 24 insertions(+), 36 deletions(-) diff --git a/src/widget/multiselectlist/multiselectlist.insert.js b/src/widget/multiselectlist/multiselectlist.insert.js index 6cc5959d9..9d8aff81d 100644 --- a/src/widget/multiselectlist/multiselectlist.insert.js +++ b/src/widget/multiselectlist/multiselectlist.insert.js @@ -210,16 +210,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -320,8 +318,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } diff --git a/src/widget/multiselectlist/multiselectlist.insert.nobar.js b/src/widget/multiselectlist/multiselectlist.insert.nobar.js index a273d942d..5254fbf93 100644 --- a/src/widget/multiselectlist/multiselectlist.insert.nobar.js +++ b/src/widget/multiselectlist/multiselectlist.insert.nobar.js @@ -218,16 +218,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -330,8 +328,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } diff --git a/src/widget/multiselectlist/multiselectlist.js b/src/widget/multiselectlist/multiselectlist.js index 3b52b9e56..f6b368a2e 100644 --- a/src/widget/multiselectlist/multiselectlist.js +++ b/src/widget/multiselectlist/multiselectlist.js @@ -192,16 +192,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -332,8 +330,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } From 7565c0b7850270eabc087b1bb550ffb7ad5ac0f8 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 23 Sep 2019 14:03:48 +0800 Subject: [PATCH 03/16] =?UTF-8?q?REPORT-22196=20fix:=20=E5=90=8C=E5=A4=96?= =?UTF-8?q?=E9=83=A8setValue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multilayerselecttree/multilayerselecttree.combo.js | 2 +- src/widget/multilayersingletree/multilayersingletree.combo.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widget/multilayerselecttree/multilayerselecttree.combo.js b/src/widget/multilayerselecttree/multilayerselecttree.combo.js index 6d598af6f..ecde58b50 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.combo.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.combo.js @@ -141,7 +141,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM, action: function () { var value = self.trigger.getSearcher().getKeyword(); - self.combo.setValue(value); + self.combo.setValue([value]); self.combo.hideView(); } }] diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/src/widget/multilayersingletree/multilayersingletree.combo.js index 2ab97b10b..37d32ea70 100644 --- a/src/widget/multilayersingletree/multilayersingletree.combo.js +++ b/src/widget/multilayersingletree/multilayersingletree.combo.js @@ -144,7 +144,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM, action: function () { var value = self.trigger.getSearcher().getKeyword(); - self.combo.setValue(value); + self.combo.setValue([value]); self.combo.hideView(); } }] From d13d2a007ffdfb1704ebf8be8d6c2411d5308ab2 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 23 Sep 2019 14:04:05 +0800 Subject: [PATCH 04/16] build --- dist/2.0/fineui.ie.js | 64 +++++++++++--------------- dist/2.0/fineui.js | 64 +++++++++++--------------- dist/bundle.ie.js | 64 +++++++++++--------------- dist/bundle.js | 64 +++++++++++--------------- dist/fineui.ie.js | 64 +++++++++++--------------- dist/fineui.js | 64 +++++++++++--------------- dist/fineui_without_jquery_polyfill.js | 64 +++++++++++--------------- dist/widget.js | 64 +++++++++++--------------- 8 files changed, 208 insertions(+), 304 deletions(-) diff --git a/dist/2.0/fineui.ie.js b/dist/2.0/fineui.ie.js index eaa4f3268..d63397bfe 100644 --- a/dist/2.0/fineui.ie.js +++ b/dist/2.0/fineui.ie.js @@ -68565,7 +68565,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM, action: function () { var value = self.trigger.getSearcher().getKeyword(); - self.combo.setValue(value); + self.combo.setValue([value]); self.combo.hideView(); } }] @@ -69747,7 +69747,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM, action: function () { var value = self.trigger.getSearcher().getKeyword(); - self.combo.setValue(value); + self.combo.setValue([value]); self.combo.hideView(); } }] @@ -74606,16 +74606,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -74716,8 +74714,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } @@ -74949,16 +74945,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -75061,8 +75055,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } @@ -75268,16 +75260,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -75408,8 +75398,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } diff --git a/dist/2.0/fineui.js b/dist/2.0/fineui.js index 4db80c53c..36d9f7cb0 100644 --- a/dist/2.0/fineui.js +++ b/dist/2.0/fineui.js @@ -68969,7 +68969,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM, action: function () { var value = self.trigger.getSearcher().getKeyword(); - self.combo.setValue(value); + self.combo.setValue([value]); self.combo.hideView(); } }] @@ -70151,7 +70151,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM, action: function () { var value = self.trigger.getSearcher().getKeyword(); - self.combo.setValue(value); + self.combo.setValue([value]); self.combo.hideView(); } }] @@ -75010,16 +75010,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -75120,8 +75118,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } @@ -75353,16 +75349,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -75465,8 +75459,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } @@ -75672,16 +75664,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -75812,8 +75802,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } diff --git a/dist/bundle.ie.js b/dist/bundle.ie.js index eaa4f3268..d63397bfe 100644 --- a/dist/bundle.ie.js +++ b/dist/bundle.ie.js @@ -68565,7 +68565,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM, action: function () { var value = self.trigger.getSearcher().getKeyword(); - self.combo.setValue(value); + self.combo.setValue([value]); self.combo.hideView(); } }] @@ -69747,7 +69747,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM, action: function () { var value = self.trigger.getSearcher().getKeyword(); - self.combo.setValue(value); + self.combo.setValue([value]); self.combo.hideView(); } }] @@ -74606,16 +74606,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -74716,8 +74714,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } @@ -74949,16 +74945,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -75061,8 +75055,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } @@ -75268,16 +75260,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -75408,8 +75398,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } diff --git a/dist/bundle.js b/dist/bundle.js index 4db80c53c..36d9f7cb0 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -68969,7 +68969,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM, action: function () { var value = self.trigger.getSearcher().getKeyword(); - self.combo.setValue(value); + self.combo.setValue([value]); self.combo.hideView(); } }] @@ -70151,7 +70151,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM, action: function () { var value = self.trigger.getSearcher().getKeyword(); - self.combo.setValue(value); + self.combo.setValue([value]); self.combo.hideView(); } }] @@ -75010,16 +75010,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -75120,8 +75118,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } @@ -75353,16 +75349,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -75465,8 +75459,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } @@ -75672,16 +75664,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -75812,8 +75802,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } diff --git a/dist/fineui.ie.js b/dist/fineui.ie.js index caaf40227..7589e8150 100644 --- a/dist/fineui.ie.js +++ b/dist/fineui.ie.js @@ -68810,7 +68810,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM, action: function () { var value = self.trigger.getSearcher().getKeyword(); - self.combo.setValue(value); + self.combo.setValue([value]); self.combo.hideView(); } }] @@ -69992,7 +69992,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM, action: function () { var value = self.trigger.getSearcher().getKeyword(); - self.combo.setValue(value); + self.combo.setValue([value]); self.combo.hideView(); } }] @@ -74851,16 +74851,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -74961,8 +74959,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } @@ -75194,16 +75190,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -75306,8 +75300,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } @@ -75513,16 +75505,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -75653,8 +75643,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } diff --git a/dist/fineui.js b/dist/fineui.js index 9c8cc6f61..3b6a0d43d 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -69214,7 +69214,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM, action: function () { var value = self.trigger.getSearcher().getKeyword(); - self.combo.setValue(value); + self.combo.setValue([value]); self.combo.hideView(); } }] @@ -70396,7 +70396,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM, action: function () { var value = self.trigger.getSearcher().getKeyword(); - self.combo.setValue(value); + self.combo.setValue([value]); self.combo.hideView(); } }] @@ -75255,16 +75255,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -75365,8 +75363,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } @@ -75598,16 +75594,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -75710,8 +75704,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } @@ -75917,16 +75909,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -76057,8 +76047,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } diff --git a/dist/fineui_without_jquery_polyfill.js b/dist/fineui_without_jquery_polyfill.js index 3f13aba09..d8b75c5b9 100644 --- a/dist/fineui_without_jquery_polyfill.js +++ b/dist/fineui_without_jquery_polyfill.js @@ -51513,7 +51513,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM, action: function () { var value = self.trigger.getSearcher().getKeyword(); - self.combo.setValue(value); + self.combo.setValue([value]); self.combo.hideView(); } }] @@ -52695,7 +52695,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM, action: function () { var value = self.trigger.getSearcher().getKeyword(); - self.combo.setValue(value); + self.combo.setValue([value]); self.combo.hideView(); } }] @@ -57554,16 +57554,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -57664,8 +57662,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } @@ -57897,16 +57893,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -58009,8 +58003,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } @@ -58216,16 +58208,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -58356,8 +58346,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } diff --git a/dist/widget.js b/dist/widget.js index de03903f6..d8c7e94a0 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -6594,7 +6594,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM, action: function () { var value = self.trigger.getSearcher().getKeyword(); - self.combo.setValue(value); + self.combo.setValue([value]); self.combo.hideView(); } }] @@ -7776,7 +7776,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM, action: function () { var value = self.trigger.getSearcher().getKeyword(); - self.combo.setValue(value); + self.combo.setValue([value]); self.combo.hideView(); } }] @@ -12635,16 +12635,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -12745,8 +12743,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } @@ -12978,16 +12974,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -13090,8 +13084,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } @@ -13297,16 +13289,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { _joinKeywords: function (keywords, callback) { var self = this, o = this.options; this._assertValue(this.storeValue); - if (!this._allData) { - o.itemsCreator({ - type: BI.MultiSelectList.REQ_GET_ALL_DATA - }, function (ob) { - self._allData = BI.map(ob.items, "value"); - digest(self._allData); - }); - } else { - digest(this._allData); - } + // 和复选下拉框同步,allData做缓存是会爆炸的 + o.itemsCreator({ + type: BI.MultiSelectList.REQ_GET_ALL_DATA, + keywords: keywords + }, function (ob) { + var values = BI.map(ob.items, "value"); + digest(values); + }); function digest (items) { var selectedMap = self._makeMap(items); @@ -13437,8 +13427,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { }, populate: function () { - this._count = null; - this._allData = null; this.adapter.populate.apply(this.adapter, arguments); this.trigger.populate.apply(this.trigger, arguments); } From 72bd789103d580830c24a3e797ff3faab8146e3b Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 23 Sep 2019 17:17:46 +0800 Subject: [PATCH 05/16] =?UTF-8?q?REPORT-22202=20fix:=20=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E5=8A=A0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/2.0/fineui.ie.js | 7 +++++-- dist/2.0/fineui.js | 7 +++++-- dist/bundle.ie.js | 7 +++++-- dist/bundle.js | 7 +++++-- dist/fineui.ie.js | 7 +++++-- dist/fineui.js | 7 +++++-- dist/fineui_without_jquery_polyfill.js | 7 +++++-- dist/widget.js | 7 +++++-- .../treevaluechooser/combo.listtreevaluechooser.js | 2 ++ src/widget/multitree/multi.tree.list.combo.js | 5 +++-- 10 files changed, 45 insertions(+), 18 deletions(-) diff --git a/dist/2.0/fineui.ie.js b/dist/2.0/fineui.ie.js index d63397bfe..dd06896e3 100644 --- a/dist/2.0/fineui.ie.js +++ b/dist/2.0/fineui.ie.js @@ -76368,7 +76368,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, height: 24, - allowEdit: true + allowEdit: true, + allowInsertValue: true }); }, @@ -76397,7 +76398,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { type: "bi.multi_list_tree_searcher", itemsCreator: o.itemsCreator, popup: { - type: "bi.multi_tree_search_insert_pane", + type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane", el: { type: "bi.list_part_tree" }, @@ -88141,6 +88142,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser, text: o.text, value: o.value, watermark: o.watermark, + allowInsertValue: o.allowInsertValue, + allowEdit: o.allowEdit, itemsCreator: BI.bind(this._itemsCreator, this), valueFormatter: BI.bind(this._valueFormatter, this), width: o.width, diff --git a/dist/2.0/fineui.js b/dist/2.0/fineui.js index 36d9f7cb0..eb84fe518 100644 --- a/dist/2.0/fineui.js +++ b/dist/2.0/fineui.js @@ -76772,7 +76772,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, height: 24, - allowEdit: true + allowEdit: true, + allowInsertValue: true }); }, @@ -76801,7 +76802,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { type: "bi.multi_list_tree_searcher", itemsCreator: o.itemsCreator, popup: { - type: "bi.multi_tree_search_insert_pane", + type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane", el: { type: "bi.list_part_tree" }, @@ -88545,6 +88546,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser, text: o.text, value: o.value, watermark: o.watermark, + allowInsertValue: o.allowInsertValue, + allowEdit: o.allowEdit, itemsCreator: BI.bind(this._itemsCreator, this), valueFormatter: BI.bind(this._valueFormatter, this), width: o.width, diff --git a/dist/bundle.ie.js b/dist/bundle.ie.js index d63397bfe..dd06896e3 100644 --- a/dist/bundle.ie.js +++ b/dist/bundle.ie.js @@ -76368,7 +76368,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, height: 24, - allowEdit: true + allowEdit: true, + allowInsertValue: true }); }, @@ -76397,7 +76398,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { type: "bi.multi_list_tree_searcher", itemsCreator: o.itemsCreator, popup: { - type: "bi.multi_tree_search_insert_pane", + type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane", el: { type: "bi.list_part_tree" }, @@ -88141,6 +88142,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser, text: o.text, value: o.value, watermark: o.watermark, + allowInsertValue: o.allowInsertValue, + allowEdit: o.allowEdit, itemsCreator: BI.bind(this._itemsCreator, this), valueFormatter: BI.bind(this._valueFormatter, this), width: o.width, diff --git a/dist/bundle.js b/dist/bundle.js index 36d9f7cb0..eb84fe518 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -76772,7 +76772,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, height: 24, - allowEdit: true + allowEdit: true, + allowInsertValue: true }); }, @@ -76801,7 +76802,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { type: "bi.multi_list_tree_searcher", itemsCreator: o.itemsCreator, popup: { - type: "bi.multi_tree_search_insert_pane", + type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane", el: { type: "bi.list_part_tree" }, @@ -88545,6 +88546,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser, text: o.text, value: o.value, watermark: o.watermark, + allowInsertValue: o.allowInsertValue, + allowEdit: o.allowEdit, itemsCreator: BI.bind(this._itemsCreator, this), valueFormatter: BI.bind(this._valueFormatter, this), width: o.width, diff --git a/dist/fineui.ie.js b/dist/fineui.ie.js index 7589e8150..07ece55d8 100644 --- a/dist/fineui.ie.js +++ b/dist/fineui.ie.js @@ -76613,7 +76613,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, height: 24, - allowEdit: true + allowEdit: true, + allowInsertValue: true }); }, @@ -76642,7 +76643,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { type: "bi.multi_list_tree_searcher", itemsCreator: o.itemsCreator, popup: { - type: "bi.multi_tree_search_insert_pane", + type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane", el: { type: "bi.list_part_tree" }, @@ -88386,6 +88387,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser, text: o.text, value: o.value, watermark: o.watermark, + allowInsertValue: o.allowInsertValue, + allowEdit: o.allowEdit, itemsCreator: BI.bind(this._itemsCreator, this), valueFormatter: BI.bind(this._valueFormatter, this), width: o.width, diff --git a/dist/fineui.js b/dist/fineui.js index 3b6a0d43d..8dddd3ba0 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -77017,7 +77017,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, height: 24, - allowEdit: true + allowEdit: true, + allowInsertValue: true }); }, @@ -77046,7 +77047,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { type: "bi.multi_list_tree_searcher", itemsCreator: o.itemsCreator, popup: { - type: "bi.multi_tree_search_insert_pane", + type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane", el: { type: "bi.list_part_tree" }, @@ -88790,6 +88791,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser, text: o.text, value: o.value, watermark: o.watermark, + allowInsertValue: o.allowInsertValue, + allowEdit: o.allowEdit, itemsCreator: BI.bind(this._itemsCreator, this), valueFormatter: BI.bind(this._valueFormatter, this), width: o.width, diff --git a/dist/fineui_without_jquery_polyfill.js b/dist/fineui_without_jquery_polyfill.js index d8b75c5b9..b7fa7c60e 100644 --- a/dist/fineui_without_jquery_polyfill.js +++ b/dist/fineui_without_jquery_polyfill.js @@ -59316,7 +59316,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, height: 24, - allowEdit: true + allowEdit: true, + allowInsertValue: true }); }, @@ -59345,7 +59346,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { type: "bi.multi_list_tree_searcher", itemsCreator: o.itemsCreator, popup: { - type: "bi.multi_tree_search_insert_pane", + type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane", el: { type: "bi.list_part_tree" }, @@ -71089,6 +71090,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser, text: o.text, value: o.value, watermark: o.watermark, + allowInsertValue: o.allowInsertValue, + allowEdit: o.allowEdit, itemsCreator: BI.bind(this._itemsCreator, this), valueFormatter: BI.bind(this._valueFormatter, this), width: o.width, diff --git a/dist/widget.js b/dist/widget.js index d8c7e94a0..8df7a196a 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -14397,7 +14397,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, height: 24, - allowEdit: true + allowEdit: true, + allowInsertValue: true }); }, @@ -14426,7 +14427,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { type: "bi.multi_list_tree_searcher", itemsCreator: o.itemsCreator, popup: { - type: "bi.multi_tree_search_insert_pane", + type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane", el: { type: "bi.list_part_tree" }, @@ -26170,6 +26171,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser, text: o.text, value: o.value, watermark: o.watermark, + allowInsertValue: o.allowInsertValue, + allowEdit: o.allowEdit, itemsCreator: BI.bind(this._itemsCreator, this), valueFormatter: BI.bind(this._valueFormatter, this), width: o.width, diff --git a/src/component/treevaluechooser/combo.listtreevaluechooser.js b/src/component/treevaluechooser/combo.listtreevaluechooser.js index 383b3184b..af58a9394 100644 --- a/src/component/treevaluechooser/combo.listtreevaluechooser.js +++ b/src/component/treevaluechooser/combo.listtreevaluechooser.js @@ -29,6 +29,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser, text: o.text, value: o.value, watermark: o.watermark, + allowInsertValue: o.allowInsertValue, + allowEdit: o.allowEdit, itemsCreator: BI.bind(this._itemsCreator, this), valueFormatter: BI.bind(this._valueFormatter, this), width: o.width, diff --git a/src/widget/multitree/multi.tree.list.combo.js b/src/widget/multitree/multi.tree.list.combo.js index 5e965041c..99be2562d 100644 --- a/src/widget/multitree/multi.tree.list.combo.js +++ b/src/widget/multitree/multi.tree.list.combo.js @@ -21,7 +21,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, height: 24, - allowEdit: true + allowEdit: true, + allowInsertValue: true }); }, @@ -50,7 +51,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { type: "bi.multi_list_tree_searcher", itemsCreator: o.itemsCreator, popup: { - type: "bi.multi_tree_search_insert_pane", + type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane", el: { type: "bi.list_part_tree" }, From 04fbb3c090dcb5f603e2c13d4411129801c5fc59 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Tue, 24 Sep 2019 15:52:34 +0800 Subject: [PATCH 06/16] =?UTF-8?q?BI-52072=20&&=20BI-52369=20&&=20BI-52345?= =?UTF-8?q?=20test:=20widget=E5=8D=95=E6=B5=8B=E7=BB=BF=E5=8C=96=20&&=20da?= =?UTF-8?q?tepane=E4=BA=8B=E4=BB=B6=20&&=20button=E7=9A=84bubble?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 4 + src/base/single/button/button.basic.js | 2 + src/case/colorchooser/colorchooser.js | 4 +- src/case/colorchooser/colorchooser.trigger.js | 2 +- .../colorchooser/colorchooser.trigger.long.js | 2 +- .../combo.valuechooser.insert.test.js | 193 ++++++++++++++++++ .../__test__/combo.valuechooser.test.js | 163 +++++++++++++++ .../__test__/pane.valuechooser.test.js | 111 ++++++++++ src/widget/datepane/datepane.js | 1 + 9 files changed, 478 insertions(+), 4 deletions(-) create mode 100644 src/component/valuechooser/__test__/combo.valuechooser.insert.test.js create mode 100644 src/component/valuechooser/__test__/combo.valuechooser.test.js create mode 100644 src/component/valuechooser/__test__/pane.valuechooser.test.js diff --git a/changelog.md b/changelog.md index 0d84d3b1b..fc74c1c3c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,8 @@ # 更新日志 +2.0(2019-09) +- button的bubble创建的popup在收起的时候会destroy +- 修复了dynamic_date_pane在切换静态时间和动态时间的时候不会发事件的问题 + 2.0(2019-08) - 修复valueChooser系列不支持value属性的问题 - 更新了若干icon-font的样式 diff --git a/src/base/single/button/button.basic.js b/src/base/single/button/button.basic.js index ae6ee758f..d19d20412 100644 --- a/src/base/single/button/button.basic.js +++ b/src/base/single/button/button.basic.js @@ -229,6 +229,8 @@ BI.BasicButton = BI.inherit(BI.Single, { el: { type: "bi.bubble_combo", trigger: "", + // bubble的提示不需要一直存在在界面上 + destroyWhenHide: true, ref: function () { self.combo = this; }, diff --git a/src/case/colorchooser/colorchooser.js b/src/case/colorchooser/colorchooser.js index a753e076e..9414ab78d 100644 --- a/src/case/colorchooser/colorchooser.js +++ b/src/case/colorchooser/colorchooser.js @@ -30,8 +30,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, { ref: function (_ref) { self.trigger = _ref; }, - width: o.width, - height: o.height + width: o.width - 2, + height: o.height - 2 }, o.el), popup: { el: BI.extend({ diff --git a/src/case/colorchooser/colorchooser.trigger.js b/src/case/colorchooser/colorchooser.trigger.js index 9cd3d2f09..07101ae3a 100644 --- a/src/case/colorchooser/colorchooser.trigger.js +++ b/src/case/colorchooser/colorchooser.trigger.js @@ -11,7 +11,7 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, { var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border", - height: 24 + height: 22 }); }, diff --git a/src/case/colorchooser/colorchooser.trigger.long.js b/src/case/colorchooser/colorchooser.trigger.long.js index 946fe67bf..0c947bd1d 100644 --- a/src/case/colorchooser/colorchooser.trigger.long.js +++ b/src/case/colorchooser/colorchooser.trigger.long.js @@ -11,7 +11,7 @@ BI.LongColorChooserTrigger = BI.inherit(BI.Trigger, { var conf = BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border", - height: 24 + height: 22 }); }, diff --git a/src/component/valuechooser/__test__/combo.valuechooser.insert.test.js b/src/component/valuechooser/__test__/combo.valuechooser.insert.test.js new file mode 100644 index 000000000..e3fbc10d4 --- /dev/null +++ b/src/component/valuechooser/__test__/combo.valuechooser.insert.test.js @@ -0,0 +1,193 @@ +/** + * @author windy + * @version 2.0 + * Created by windy on 2019/9/23 + */ +describe("value_chooser_insert_combo", function () { + + var items = BI.map(BI.makeArray(1000, null), function(idx, v) { + return { + text: idx, + value: idx, + title: idx + }; + }); + + var itemSelectorGetter = function (array) { + return BI.map(array, function (idx, num) { + return ".bi-multi-select-popup-view .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")"; + }); + }; + + var searchItemSelectorGetter = function (array) { + return BI.map(array, function (idx, num) { + return ".bi-multi-select-search-pane .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")"; + }); + }; + + /** + * test_author_windy + **/ + it("setValue", function () { + var widget = BI.Test.createWidget({ + type: "bi.value_chooser_insert_combo", + width: 220, + itemsCreator: function (op, callback) { + callback(items); + } + }); + widget.setValue({ + type: 1, + value: [1, 2] + }); + expect(widget.getValue()).to.deep.equal({ + type: 1, + value: [1, 2] + }); + widget.destroy(); + }); + + /** + * test_author_windy + **/ + it("getValue", function () { + var widget = BI.Test.createWidget({ + type: "bi.value_chooser_insert_combo", + width: 220, + itemsCreator: function (op, callback) { + callback(items); + }, + value: { + type: 2, + value: [1, 2, 3] + } + }); + expect(widget.getValue()).to.deep.equal({ + type: 2, + value: [1, 2, 3] + }); + widget.destroy(); + }); + + /** + * test_author_windy + **/ + it("点选选值", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.value_chooser_insert_combo", + width: 220, + itemsCreator: function (op, callback) { + callback(items); + } + }); + widget.element.find(".bi-multi-select-trigger").click(); + // 为什么要delay 300呢,因为按钮有debounce + BI.delay(function () { + // 点选1、2、3 + BI.each(itemSelectorGetter([1,2,3]), function (idx, selector) { + widget.element.find(selector).click(); + }); + // 点全选 + widget.element.find(".bi-multi-select-popup-view .bi-label:contains(全选)").click(); + // 取消勾选1、2、3 + BI.delay(function () { + BI.each(itemSelectorGetter([1,2,3]), function (idx, selector) { + widget.element.find(selector).click(); + }); + expect(widget.getValue()).to.deep.equal({ + type: 2, + value: [0, 1, 2] + }); + widget.destroy(); + done(); + }, 300); + }, 300); + }); + + /** + * test_author_windy + **/ + it("搜索选值", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.value_chooser_insert_combo", + width: 220, + itemsCreator: function (op, callback) { + callback(items); + } + }); + BI.nextTick(function () { + widget.element.find(".bi-multi-select-trigger .tip-text-style").click(); + // 这边为啥要加呢,因为input的setValue中有nextTick + BI.nextTick(function () { + BI.Test.triggerKeyDown(widget.element.find(".bi-multi-select-trigger .bi-input"), "2", 50, function () { + BI.nextTick(function () { + BI.each(searchItemSelectorGetter([1,2]), function (idx, selector) { + widget.element.find(selector).click(); + }); + expect(widget.getValue()).to.deep.equal({ + type: 1, + value: [2, 12] + }); + widget.destroy(); + done(); + }); + }); + }); + }); + }); + + /** + * test_author_windy + **/ + it("新增值", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.value_chooser_insert_combo", + width: 220, + itemsCreator: function (op, callback) { + callback(items); + } + }); + BI.nextTick(function () { + widget.element.find(".bi-multi-select-trigger .tip-text-style").click(); + // 这边为啥要加呢,因为input的setValue中有nextTick + BI.nextTick(function () { + BI.Test.triggerKeyDown(widget.element.find(".bi-multi-select-trigger .bi-input"), "z", 50, function () { + BI.nextTick(function () { + widget.element.find(".bi-text-button:contains(+点击新增\"z\")").click(); + expect(widget.getValue()).to.deep.equal({ + type: 1, + value: ["z"] + }); + widget.destroy(); + done(); + }); + }); + }); + }); + }); + + /** + * test_author_windy + **/ + it("查看已选", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.value_chooser_insert_combo", + width: 220, + itemsCreator: function (op, callback) { + callback(items); + }, + value: { + type: 1, + value: [1, 2] + } + }); + BI.nextTick(function () { + widget.element.find(".bi-multi-select-check-selected-button").click(); + BI.delay(function () { + expect(widget.element.find(".display-list-item").length).to.equal(2); + widget.destroy(); + done(); + }, 300); + }); + }); +}); \ No newline at end of file diff --git a/src/component/valuechooser/__test__/combo.valuechooser.test.js b/src/component/valuechooser/__test__/combo.valuechooser.test.js new file mode 100644 index 000000000..bf21ed0e6 --- /dev/null +++ b/src/component/valuechooser/__test__/combo.valuechooser.test.js @@ -0,0 +1,163 @@ +/** + * @author windy + * @version 2.0 + * Created by windy on 2019/9/23 + */ +describe("value_chooser_combo", function () { + + var items = BI.map(BI.makeArray(1000, null), function(idx, v) { + return { + text: idx, + value: idx, + title: idx + }; + }); + + var itemSelectorGetter = function (array) { + return BI.map(array, function (idx, num) { + return ".bi-multi-select-popup-view .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")"; + }); + }; + + var searchItemSelectorGetter = function (array) { + return BI.map(array, function (idx, num) { + return ".bi-multi-select-search-pane .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")"; + }); + }; + + /** + * test_author_windy + **/ + it("setValue", function () { + var widget = BI.Test.createWidget({ + type: "bi.value_chooser_combo", + width: 220, + itemsCreator: function (op, callback) { + callback(items); + } + }); + widget.setValue({ + type: 1, + value: [1, 2] + }); + expect(widget.getValue()).to.deep.equal({ + type: 1, + value: [1, 2] + }); + widget.destroy(); + }); + + /** + * test_author_windy + **/ + it("getValue", function () { + var widget = BI.Test.createWidget({ + type: "bi.value_chooser_combo", + width: 220, + itemsCreator: function (op, callback) { + callback(items); + }, + value: { + type: 2, + value: [1, 2, 3] + } + }); + expect(widget.getValue()).to.deep.equal({ + type: 2, + value: [1, 2, 3] + }); + widget.destroy(); + }); + + /** + * test_author_windy + **/ + it("点选选值", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.value_chooser_combo", + width: 220, + itemsCreator: function (op, callback) { + callback(items); + } + }); + widget.element.find(".bi-multi-select-trigger").click(); + // 为什么要delay 300呢,因为按钮有debounce + BI.delay(function () { + // 点选1、2、3 + BI.each(itemSelectorGetter([1,2,3]), function (idx, selector) { + widget.element.find(selector).click(); + }); + // 点全选 + widget.element.find(".bi-multi-select-popup-view .bi-label:contains(全选)").click(); + // 取消勾选1、2、3 + BI.delay(function () { + BI.each(itemSelectorGetter([1,2,3]), function (idx, selector) { + widget.element.find(selector).click(); + }); + expect(widget.getValue()).to.deep.equal({ + type: 2, + value: [0, 1, 2] + }); + widget.destroy(); + done(); + }, 300); + }, 300); + }); + + /** + * test_author_windy + **/ + it("搜索选值", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.value_chooser_combo", + width: 220, + itemsCreator: function (op, callback) { + callback(items); + } + }); + BI.nextTick(function () { + widget.element.find(".bi-multi-select-trigger .tip-text-style").click(); + // 这边为啥要加呢,因为input的setValue中有nextTick + BI.nextTick(function () { + BI.Test.triggerKeyDown(widget.element.find(".bi-multi-select-trigger .bi-input"), "2", 50, function () { + BI.nextTick(function () { + BI.each(searchItemSelectorGetter([1,2]), function (idx, selector) { + widget.element.find(selector).click(); + }); + expect(widget.getValue()).to.deep.equal({ + type: 1, + value: [2, 12] + }); + widget.destroy(); + done(); + }); + }); + }); + }); + }); + + /** + * test_author_windy + **/ + it("查看已选", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.value_chooser_combo", + width: 220, + itemsCreator: function (op, callback) { + callback(items); + }, + value: { + type: 1, + value: [1, 2] + } + }); + BI.nextTick(function () { + widget.element.find(".bi-multi-select-check-selected-button").click(); + BI.delay(function () { + expect(widget.element.find(".display-list-item").length).to.equal(2); + widget.destroy(); + done(); + }, 300); + }); + }); +}); \ No newline at end of file diff --git a/src/component/valuechooser/__test__/pane.valuechooser.test.js b/src/component/valuechooser/__test__/pane.valuechooser.test.js new file mode 100644 index 000000000..76e939071 --- /dev/null +++ b/src/component/valuechooser/__test__/pane.valuechooser.test.js @@ -0,0 +1,111 @@ +/** + * @author windy + * @version 2.0 + * Created by windy on 2019/9/23 + */ + +describe("value_chooser_pane", function () { + + var items = BI.map(BI.makeArray(1000, null), function(idx, v) { + return { + text: idx, + value: idx, + title: idx + }; + }); + + var itemSelectorGetter = function (array) { + return BI.map(array, function (idx, num) { + return ".popup-multi-select-list .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")"; + }); + }; + + var searchItemSelectorGetter = function (array) { + return BI.map(array, function (idx, num) { + return ".bi-multi-select-search-pane .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")"; + }); + }; + + /** + * test_author_windy + **/ + it("setValue", function () { + var widget = BI.Test.createWidget({ + type: "bi.value_chooser_pane", + width: 220, + itemsCreator: function (op, callback) { + callback(items); + } + }); + widget.setValue({ + type: 1, + value: [1, 2] + }); + expect(widget.getValue()).to.deep.equal({ + type: 1, + value: [1, 2] + }); + widget.destroy(); + }); + + /** + * test_author_windy + **/ + it("点选选值", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.value_chooser_pane", + width: 220, + items: items + }); + BI.nextTick(function () { + // 点选1、2、3 + BI.each(itemSelectorGetter([1,2,3]), function (idx, selector) { + widget.element.find(selector).click(); + }); + // 点全选 + widget.element.find(".popup-multi-select-list .bi-label:contains(全选)").click(); + // 取消勾选1、2、3 + BI.delay(function () { + BI.each(itemSelectorGetter([1,2,3]), function (idx, selector) { + widget.element.find(selector).click(); + }); + expect(widget.getValue()).to.deep.equal({ + type: 2, + value: [0, 1, 2] + }); + widget.destroy(); + done(); + }, 300); + }); + }); + + /** + * test_author_windy + **/ + it("搜索选值", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.value_chooser_pane", + width: 220, + itemsCreator: function (op, callback) { + callback(items); + } + }); + widget.element.find(".bi-water-mark").click(); + // 这边为啥要加呢,因为input的setValue中有nextTick + BI.nextTick(function () { + BI.Test.triggerKeyDown(widget.element.find(".bi-input"), "2", 50, function () { + BI.nextTick(function () { + BI.each(searchItemSelectorGetter([1,2]), function (idx, selector) { + widget.element.find(selector).click(); + }); + expect(widget.getValue()).to.deep.equal({ + type: 1, + value: [2, 12] + }); + widget.destroy(); + done(); + }); + }); + }); + }); +}); \ No newline at end of file diff --git a/src/widget/datepane/datepane.js b/src/widget/datepane/datepane.js index 359aa7d6d..8c60da784 100644 --- a/src/widget/datepane/datepane.js +++ b/src/widget/datepane/datepane.js @@ -44,6 +44,7 @@ BI.DynamicDatePane = BI.inherit(BI.Widget, { default: break; } + self.fireEvent("EVENT_CHANGE"); } }], ref: function () { From 7459d14da70ad4fe25acdae68ba231be8ae910e7 Mon Sep 17 00:00:00 2001 From: Fay Date: Tue, 24 Sep 2019 16:06:33 +0800 Subject: [PATCH 07/16] =?UTF-8?q?BI-52376=20resize=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/list/listview.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/base/list/listview.js b/src/base/list/listview.js index ae8c5b48c..30d635018 100644 --- a/src/base/list/listview.js +++ b/src/base/list/listview.js @@ -45,8 +45,16 @@ BI.ListView = BI.inherit(BI.Widget, { o.scrollTop = self.element.scrollTop(); self._calculateBlocksToRender(); }); + var lastWidth = this.element.width(), + lastHeight = this.element.height(); BI.ResizeDetector.addResizeListener(this, function () { - self._calculateBlocksToRender(); + var width = self.element.width(), + height = self.element.height(); + if (width !== lastWidth || height !== lastHeight) { + self._calculateBlocksToRender(); + lastWidth = width; + lastHeight = height; + } }); }, From 19463fb2b08eed7932a27500134a463fb7273071 Mon Sep 17 00:00:00 2001 From: Fay Date: Tue, 24 Sep 2019 16:11:11 +0800 Subject: [PATCH 08/16] =?UTF-8?q?=E4=BA=A4=E6=8D=A2=E4=B8=8B=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/list/listview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/list/listview.js b/src/base/list/listview.js index 30d635018..e85bfb885 100644 --- a/src/base/list/listview.js +++ b/src/base/list/listview.js @@ -51,9 +51,9 @@ BI.ListView = BI.inherit(BI.Widget, { var width = self.element.width(), height = self.element.height(); if (width !== lastWidth || height !== lastHeight) { - self._calculateBlocksToRender(); lastWidth = width; lastHeight = height; + self._calculateBlocksToRender(); } }); }, From 23696b6dd0e28c0ada111a9b2b71739475a72460 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Tue, 24 Sep 2019 17:19:49 +0800 Subject: [PATCH 09/16] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20fix:=20?= =?UTF-8?q?expanded[0]=E6=98=AFnode=E5=AF=B9=E8=B1=A1,=20=E6=AF=94?= =?UTF-8?q?=E8=BE=83=E5=8F=96value?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 1 + src/component/treevaluechooser/abstract.treevaluechooser.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index fc74c1c3c..035217856 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2019-09) +- 修复tree_value_chooser选中节点的唯一子节点后搜索该子节点,无法取消选中的问题 - button的bubble创建的popup在收起的时候会destroy - 修复了dynamic_date_pane在切换静态时间和动态时间的时候不会发事件的问题 diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.js b/src/component/treevaluechooser/abstract.treevaluechooser.js index dbdedfcad..98c232b96 100644 --- a/src/component/treevaluechooser/abstract.treevaluechooser.js +++ b/src/component/treevaluechooser/abstract.treevaluechooser.js @@ -220,7 +220,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { path.push(split); childrenCount.push(expanded.length); // 如果只有一个值且取消的就是这个值 - if (i === parents.length - 1 && expanded.length === 1 && expanded[0] === notSelectedValue) { + if (i === parents.length - 1 && expanded.length === 1 && expanded[0].value === notSelectedValue) { for (var j = childrenCount.length - 1; j >= 0; j--) { if (childrenCount[j] === 1) { self._deleteNode(selectedValues, path[j]); From 44beeca589248d131a4e13d4c15b6deac5c4ae0f Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Tue, 24 Sep 2019 17:26:37 +0800 Subject: [PATCH 10/16] update --- src/case/colorchooser/colorchooser.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/case/colorchooser/colorchooser.js b/src/case/colorchooser/colorchooser.js index 9414ab78d..b4ab6c9ec 100644 --- a/src/case/colorchooser/colorchooser.js +++ b/src/case/colorchooser/colorchooser.js @@ -10,7 +10,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-color-chooser", - value: "" + value: "", + height: 24 }); }, From b535fc4461b6030c63b176d47298501e6239c2b2 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 25 Sep 2019 11:00:50 +0800 Subject: [PATCH 11/16] =?UTF-8?q?CHART-10611=20fix:=20=E6=8B=96=E6=8B=BD?= =?UTF-8?q?=E4=B8=8Etitle=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/single.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/base/single/single.js b/src/base/single/single.js index bdfdd4b03..d50b381d5 100644 --- a/src/base/single/single.js +++ b/src/base/single/single.js @@ -111,7 +111,11 @@ BI.Single = BI.inherit(BI.Widget, { clearTimeout(self.hideTimeout); self.hideTimeout = null; } - self._showToolTip(self._e || e, opt); + // CHART-10611 在拖拽的情况下, 鼠标拖拽着元素离开了拖拽元素的容器,但是子元素在dom结构上仍然属于容器 + // 这样会认为鼠标仍然在容器中, 500ms内放开的话,会在容器之外显示鼠标停留处显示容器的title + if (self.element.__isMouseInBounds__(self._e || e)) { + self._showToolTip(self._e || e, opt); + } } }, 500); From 63acc5c4ae6418d816dab13a578aed209c3941a2 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 25 Sep 2019 12:13:05 +0800 Subject: [PATCH 12/16] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=88=97=E8=A1=A8=E5=A4=8D=E5=88=B6=E7=B2=98?= =?UTF-8?q?=E8=B4=B4=E7=9A=84=E6=97=B6=E5=80=99=E8=A6=81=E5=8F=91=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multiselectlist/multiselectlist.insert.js | 1 + src/widget/multiselectlist/multiselectlist.insert.nobar.js | 1 + src/widget/multiselectlist/multiselectlist.js | 1 + 3 files changed, 3 insertions(+) diff --git a/src/widget/multiselectlist/multiselectlist.insert.js b/src/widget/multiselectlist/multiselectlist.insert.js index 9d8aff81d..ea51fbf92 100644 --- a/src/widget/multiselectlist/multiselectlist.insert.js +++ b/src/widget/multiselectlist/multiselectlist.insert.js @@ -137,6 +137,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { self.adapter.setValue(self.storeValue); assertShowValue(); } + self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE); }); } } diff --git a/src/widget/multiselectlist/multiselectlist.insert.nobar.js b/src/widget/multiselectlist/multiselectlist.insert.nobar.js index 5254fbf93..fbeed11a5 100644 --- a/src/widget/multiselectlist/multiselectlist.insert.nobar.js +++ b/src/widget/multiselectlist/multiselectlist.insert.nobar.js @@ -142,6 +142,7 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { self.adapter.setValue(self.storeValue); assertShowValue(); } + self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE); }); } } diff --git a/src/widget/multiselectlist/multiselectlist.js b/src/widget/multiselectlist/multiselectlist.js index f6b368a2e..aa64218da 100644 --- a/src/widget/multiselectlist/multiselectlist.js +++ b/src/widget/multiselectlist/multiselectlist.js @@ -120,6 +120,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { self.adapter.setValue(self.storeValue); assertShowValue(); } + self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE); }); } } From 998bd223a14e640dfc7ecefc4f44b16c29c2aeab Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 25 Sep 2019 12:14:50 +0800 Subject: [PATCH 13/16] update --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 035217856..272f1c211 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2019-09) +- 文本列表通过复制粘贴的形式选中值的时候发送事件 - 修复tree_value_chooser选中节点的唯一子节点后搜索该子节点,无法取消选中的问题 - button的bubble创建的popup在收起的时候会destroy - 修复了dynamic_date_pane在切换静态时间和动态时间的时候不会发事件的问题 From fa61b8871d61e71bb0b09b27c0e3518874f83c02 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 25 Sep 2019 12:16:28 +0800 Subject: [PATCH 14/16] =?UTF-8?q?update:=20=E4=BA=8B=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E6=94=B9=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multiselectlist/multiselectlist.insert.nobar.js | 2 +- src/widget/multiselectlist/multiselectlist.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widget/multiselectlist/multiselectlist.insert.nobar.js b/src/widget/multiselectlist/multiselectlist.insert.nobar.js index fbeed11a5..136aa51c5 100644 --- a/src/widget/multiselectlist/multiselectlist.insert.nobar.js +++ b/src/widget/multiselectlist/multiselectlist.insert.nobar.js @@ -142,7 +142,7 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { self.adapter.setValue(self.storeValue); assertShowValue(); } - self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE); + self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE); }); } } diff --git a/src/widget/multiselectlist/multiselectlist.js b/src/widget/multiselectlist/multiselectlist.js index aa64218da..d364b6336 100644 --- a/src/widget/multiselectlist/multiselectlist.js +++ b/src/widget/multiselectlist/multiselectlist.js @@ -120,7 +120,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { self.adapter.setValue(self.storeValue); assertShowValue(); } - self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE); + self.fireEvent(BI.MultiSelectList.EVENT_CHANGE); }); } } From 19c8e5dde61b007ea7974ce9d005ba0088a03165 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 25 Sep 2019 13:53:20 +0800 Subject: [PATCH 15/16] =?UTF-8?q?BI-52452=20refactor:=20=E5=8A=A0=E5=9C=86?= =?UTF-8?q?=E8=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 1 + src/base/layer/layer.popover.js | 3 ++- src/css/base/view/popover.css | 3 +++ src/less/base/view/popover.less | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 272f1c211..ac301c032 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2019-09) +- [视觉]popover弹出框增加圆角 - 文本列表通过复制粘贴的形式选中值的时候发送事件 - 修复tree_value_chooser选中节点的唯一子节点后搜索该子节点,无法取消选中的问题 - button的bubble创建的popup在收起的时候会destroy diff --git a/src/base/layer/layer.popover.js b/src/base/layer/layer.popover.js index 35c895ffd..9a17cba61 100644 --- a/src/base/layer/layer.popover.js +++ b/src/base/layer/layer.popover.js @@ -15,7 +15,7 @@ BI.Popover = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-popover bi-card", + baseCls: "bi-popover bi-card bi-border-radius", // width: 600, // height: 500, size: "normal", // small, normal, big @@ -63,6 +63,7 @@ BI.Popover = BI.inherit(BI.Widget, { cls: "bi-font-bold", height: this._constant.HEADER_HEIGHT, text: o.header, + title: o.header, textAlign: "left" }, left: 20, diff --git a/src/css/base/view/popover.css b/src/css/base/view/popover.css index e69de29bb..3882aa373 100644 --- a/src/css/base/view/popover.css +++ b/src/css/base/view/popover.css @@ -0,0 +1,3 @@ +.bi-popover { + border: 1px solid transparent; +} diff --git a/src/less/base/view/popover.less b/src/less/base/view/popover.less index 4396636cf..4600d797c 100644 --- a/src/less/base/view/popover.less +++ b/src/less/base/view/popover.less @@ -1,4 +1,5 @@ @import "../../index"; .bi-popover { + border: 1px solid transparent; } \ No newline at end of file From b3a1f142b36c8400eb81c07ef94ebda1c153032d Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 25 Sep 2019 18:11:17 +0800 Subject: [PATCH 16/16] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=98=BB=E6=AD=A2?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E4=BA=8B=E4=BB=B6=E5=86=92=E6=B3=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/combo/bubblecombo/popup.bubble.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/case/combo/bubblecombo/popup.bubble.js b/src/case/combo/bubblecombo/popup.bubble.js index c722d9d56..177aab304 100644 --- a/src/case/combo/bubblecombo/popup.bubble.js +++ b/src/case/combo/bubblecombo/popup.bubble.js @@ -110,9 +110,11 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, { buttons: [{ level: "ignore", value: false, + stopPropagation: true, text: BI.i18nText("BI-Basic_Cancel") }, { value: true, + stopPropagation: true, text: BI.i18nText("BI-Basic_Sure") }] };