From fe265a404747c068458f700d141887652b5f8e08 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 14 Sep 2020 14:57:08 +0800 Subject: [PATCH] update --- .../valuechooser/abstract.valuechooser.js | 17 ++++++++++++++++- .../valuechooser/combo.valuechooser.insert.js | 15 --------------- .../valuechooser/combo.valuechooser.js | 15 --------------- 3 files changed, 16 insertions(+), 31 deletions(-) diff --git a/src/component/valuechooser/abstract.valuechooser.js b/src/component/valuechooser/abstract.valuechooser.js index ac4b08ae5..bd1ab309c 100644 --- a/src/component/valuechooser/abstract.valuechooser.js +++ b/src/component/valuechooser/abstract.valuechooser.js @@ -88,5 +88,20 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { hasNext: self._hasNextByTimes(resultItems, options.times) }); } - } + }, + + _assertValue: function (v) { + v = v || {}; + var value = v; + if (v.type === BI.Selection.Multi && BI.isNotNull(this.items)) { + var isAllSelect = BI.difference(BI.map(this.items, "value"), v.value).length === 0; + if (isAllSelect) { + value = { + type: BI.Selection.All, + value: [], + }; + } + } + return value; + }, }); \ No newline at end of file diff --git a/src/component/valuechooser/combo.valuechooser.insert.js b/src/component/valuechooser/combo.valuechooser.insert.js index 700794459..cc64d15b6 100644 --- a/src/component/valuechooser/combo.valuechooser.insert.js +++ b/src/component/valuechooser/combo.valuechooser.insert.js @@ -65,21 +65,6 @@ BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { }); }, - _assertValue: function (v) { - v = v || {}; - var value = v; - if (v.type === BI.Selection.Multi && BI.isNotNull(this.items)) { - var isAllSelect = BI.difference(BI.map(this.items, "value"), v.value).length === 0; - if (isAllSelect) { - value = { - type: BI.Selection.All, - value: [], - }; - } - } - return value; - }, - setValue: function (v) { this.combo.setValue(this._assertValue(v)); }, diff --git a/src/component/valuechooser/combo.valuechooser.js b/src/component/valuechooser/combo.valuechooser.js index e39515b98..9f1a05f8d 100644 --- a/src/component/valuechooser/combo.valuechooser.js +++ b/src/component/valuechooser/combo.valuechooser.js @@ -69,21 +69,6 @@ BI.ValueChooserCombo = BI.inherit(BI.AbstractValueChooser, { }); }, - _assertValue: function (v) { - v = v || {}; - var value = v; - if (v.type === BI.Selection.Multi && BI.isNotNull(this.items)) { - var isAllSelect = BI.difference(BI.map(this.items, "value"), v.value).length === 0; - if (isAllSelect) { - value = { - type: BI.Selection.All, - value: [], - }; - } - } - return value; - }, - setValue: function (v) { this.combo.setValue(this._assertValue(v)); },