From 99e5e2f1ca6b241d5d9f095a73717b9925c412e3 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 13 Nov 2020 09:34:50 +0800 Subject: [PATCH] =?UTF-8?q?DEC-15889=20fix:=20=E5=A4=9A=E5=B1=82=E7=BA=A7?= =?UTF-8?q?=E5=8D=95=E9=80=89=E6=A0=91=E9=80=89=E4=B8=AD=E6=95=88=E6=9E=9C?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/searcher.js | 23 +++++++++---------- src/case/tree/treeexpander/tree.expander.js | 1 + .../tree/treeexpander/tree.expander.popup.js | 4 +++- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/base/combination/searcher.js b/src/base/combination/searcher.js index 3a8891acf..34494ac3d 100644 --- a/src/base/combination/searcher.js +++ b/src/base/combination/searcher.js @@ -101,18 +101,17 @@ BI.Searcher = BI.inherit(BI.Widget, { if (type === BI.Events.CLICK) { if (o.isAutoSync) { var values = o.adapter && o.adapter.getValue(); - if (!obj.isSelected()) { - o.adapter && o.adapter.setValue(BI.deepWithout(values, obj.getValue())); - } else { - switch (o.chooseType) { - case BI.ButtonGroup.CHOOSE_TYPE_SINGLE: - o.adapter && o.adapter.setValue([obj.getValue()]); - break; - case BI.ButtonGroup.CHOOSE_TYPE_MULTI: - values.push(obj.getValue()); - o.adapter && o.adapter.setValue(values); - break; - } + switch (o.chooseType) { + case BI.ButtonGroup.CHOOSE_TYPE_SINGLE: + o.adapter && o.adapter.setValue([obj.getValue()]); + break; + case BI.ButtonGroup.CHOOSE_TYPE_MULTI: + if (!obj.isSelected()) { + o.adapter && o.adapter.setValue(BI.deepWithout(values, obj.getValue())); + } + values.push(obj.getValue()); + o.adapter && o.adapter.setValue(values); + break; } } self.fireEvent(BI.Searcher.EVENT_CHANGE, value, obj); diff --git a/src/case/tree/treeexpander/tree.expander.js b/src/case/tree/treeexpander/tree.expander.js index dd151b2dc..50d2bef61 100644 --- a/src/case/tree/treeexpander/tree.expander.js +++ b/src/case/tree/treeexpander/tree.expander.js @@ -35,6 +35,7 @@ isFirstNode: o.isFirstNode || o.el.isFirstNode, el: o.popup, }, + value: o.value, listeners: [ { eventName: BI.Controller.EVENT_CHANGE, diff --git a/src/case/tree/treeexpander/tree.expander.popup.js b/src/case/tree/treeexpander/tree.expander.popup.js index a51d6711f..a101b728c 100644 --- a/src/case/tree/treeexpander/tree.expander.popup.js +++ b/src/case/tree/treeexpander/tree.expander.popup.js @@ -12,7 +12,9 @@ var self = this; var o = this.options; - this.popupView = BI.createWidget(o.el, this); + this.popupView = BI.createWidget(BI.extend(o.el, { + value: o.value + }), this); this.popupView.on(BI.Controller.EVENT_CHANGE, function () { self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);