From 60ad3b4bf71873dd051aa586470c703f40dc5c6e Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 2 Jun 2017 11:58:15 +0800 Subject: [PATCH] add --- bi/case.js | 2 +- bi/widget.js | 20 +++++++++++-------- docs/case.js | 2 +- docs/widget.js | 20 +++++++++++-------- .../table/table.dynamicsummarylayertree.js | 2 +- src/widget/multiselecttree/multiselecttree.js | 12 +++++------ .../multiselecttree/multiselecttree.popup.js | 2 +- .../multitree/multi.tree.search.pane.js | 6 +++++- 8 files changed, 39 insertions(+), 27 deletions(-) diff --git a/bi/case.js b/bi/case.js index 255c3bf16..7090b6ee8 100644 --- a/bi/case.js +++ b/bi/case.js @@ -10395,7 +10395,7 @@ BI.DynamicSummaryLayerTreeTable = BI.inherit(BI.Widget, { _recomputeColumnSize: function () { var o = this.options; o.regionColumnSize = this.table.getRegionColumnSize(); - var columnSize = this.table.getColumnSize(); + var columnSize = this.table.getColumnSize().slice(); if (o.freezeCols.length > 1) { for (var i = 0; i < o.freezeCols.length - 1; i++) { columnSize.splice(1, 0, 0); diff --git a/bi/widget.js b/bi/widget.js index 2bc53e8ab..b45324fa8 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -11360,14 +11360,14 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, { action: function () { self._showSearcherPane(); self.storeValue = {value: self.adapter.getValue()}; - self.searcherPane.setValue(self.storeValue); + self.searcherPane.setSelectedValue(self.storeValue.value); } }, { eventName: BI.Searcher.EVENT_STOP, action: function () { self._showAdapter(); // self.storeValue = {value: self.searcherPane.getValue()}; - self.adapter.setValue(self.storeValue); + self.adapter.setSelectedValue(self.storeValue.value); BI.nextTick(function () { self.adapter.populate(); }); @@ -11430,17 +11430,17 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, { }, setSelectedValue: function (v) { + this.storeValue.value = v || {}; this.adapter.setSelectedValue(v); + this.trigger.setValue({ + value: v || {} + }); }, setValue: function (v) { - this.storeValue.value = v || {}; this.adapter.setValue({ value: v || {} }); - this.trigger.setValue({ - value: v || {} - }); }, stopSearch: function () { @@ -11497,7 +11497,7 @@ BI.MultiSelectTreePopup = BI.inherit(BI.Widget, { setValue: function (v) { v || (v = {}); - this.popup.setValue(v.value); + this.popup.setValue(v); }, setSelectedValue: function (v) { @@ -12029,8 +12029,12 @@ BI.MultiTreeSearchPane = BI.inherit(BI.Pane, { }, setValue: function (v) { + this.setSelectedValue(v.value); + }, + + setSelectedValue: function (v) { v || (v = {}); - this.partTree.setSelectedValue(v.value); + this.partTree.setSelectedValue(v); }, getValue: function () { diff --git a/docs/case.js b/docs/case.js index 255c3bf16..7090b6ee8 100644 --- a/docs/case.js +++ b/docs/case.js @@ -10395,7 +10395,7 @@ BI.DynamicSummaryLayerTreeTable = BI.inherit(BI.Widget, { _recomputeColumnSize: function () { var o = this.options; o.regionColumnSize = this.table.getRegionColumnSize(); - var columnSize = this.table.getColumnSize(); + var columnSize = this.table.getColumnSize().slice(); if (o.freezeCols.length > 1) { for (var i = 0; i < o.freezeCols.length - 1; i++) { columnSize.splice(1, 0, 0); diff --git a/docs/widget.js b/docs/widget.js index 2bc53e8ab..b45324fa8 100644 --- a/docs/widget.js +++ b/docs/widget.js @@ -11360,14 +11360,14 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, { action: function () { self._showSearcherPane(); self.storeValue = {value: self.adapter.getValue()}; - self.searcherPane.setValue(self.storeValue); + self.searcherPane.setSelectedValue(self.storeValue.value); } }, { eventName: BI.Searcher.EVENT_STOP, action: function () { self._showAdapter(); // self.storeValue = {value: self.searcherPane.getValue()}; - self.adapter.setValue(self.storeValue); + self.adapter.setSelectedValue(self.storeValue.value); BI.nextTick(function () { self.adapter.populate(); }); @@ -11430,17 +11430,17 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, { }, setSelectedValue: function (v) { + this.storeValue.value = v || {}; this.adapter.setSelectedValue(v); + this.trigger.setValue({ + value: v || {} + }); }, setValue: function (v) { - this.storeValue.value = v || {}; this.adapter.setValue({ value: v || {} }); - this.trigger.setValue({ - value: v || {} - }); }, stopSearch: function () { @@ -11497,7 +11497,7 @@ BI.MultiSelectTreePopup = BI.inherit(BI.Widget, { setValue: function (v) { v || (v = {}); - this.popup.setValue(v.value); + this.popup.setValue(v); }, setSelectedValue: function (v) { @@ -12029,8 +12029,12 @@ BI.MultiTreeSearchPane = BI.inherit(BI.Pane, { }, setValue: function (v) { + this.setSelectedValue(v.value); + }, + + setSelectedValue: function (v) { v || (v = {}); - this.partTree.setSelectedValue(v.value); + this.partTree.setSelectedValue(v); }, getValue: function () { diff --git a/src/case/table/table.dynamicsummarylayertree.js b/src/case/table/table.dynamicsummarylayertree.js index da02b8c14..7377c8956 100644 --- a/src/case/table/table.dynamicsummarylayertree.js +++ b/src/case/table/table.dynamicsummarylayertree.js @@ -160,7 +160,7 @@ BI.DynamicSummaryLayerTreeTable = BI.inherit(BI.Widget, { _recomputeColumnSize: function () { var o = this.options; o.regionColumnSize = this.table.getRegionColumnSize(); - var columnSize = this.table.getColumnSize(); + var columnSize = this.table.getColumnSize().slice(); if (o.freezeCols.length > 1) { for (var i = 0; i < o.freezeCols.length - 1; i++) { columnSize.splice(1, 0, 0); diff --git a/src/widget/multiselecttree/multiselecttree.js b/src/widget/multiselecttree/multiselecttree.js index 0b5c91bb1..8fda506f1 100644 --- a/src/widget/multiselecttree/multiselecttree.js +++ b/src/widget/multiselecttree/multiselecttree.js @@ -57,14 +57,14 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, { action: function () { self._showSearcherPane(); self.storeValue = {value: self.adapter.getValue()}; - self.searcherPane.setValue(self.storeValue); + self.searcherPane.setSelectedValue(self.storeValue.value); } }, { eventName: BI.Searcher.EVENT_STOP, action: function () { self._showAdapter(); // self.storeValue = {value: self.searcherPane.getValue()}; - self.adapter.setValue(self.storeValue); + self.adapter.setSelectedValue(self.storeValue.value); BI.nextTick(function () { self.adapter.populate(); }); @@ -127,17 +127,17 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, { }, setSelectedValue: function (v) { + this.storeValue.value = v || {}; this.adapter.setSelectedValue(v); + this.trigger.setValue({ + value: v || {} + }); }, setValue: function (v) { - this.storeValue.value = v || {}; this.adapter.setValue({ value: v || {} }); - this.trigger.setValue({ - value: v || {} - }); }, stopSearch: function () { diff --git a/src/widget/multiselecttree/multiselecttree.popup.js b/src/widget/multiselecttree/multiselecttree.popup.js index 72a235077..b6e3e55a2 100644 --- a/src/widget/multiselecttree/multiselecttree.popup.js +++ b/src/widget/multiselecttree/multiselecttree.popup.js @@ -34,7 +34,7 @@ BI.MultiSelectTreePopup = BI.inherit(BI.Widget, { setValue: function (v) { v || (v = {}); - this.popup.setValue(v.value); + this.popup.setValue(v); }, setSelectedValue: function (v) { diff --git a/src/widget/multitree/multi.tree.search.pane.js b/src/widget/multitree/multi.tree.search.pane.js index 07e663a87..b02dcb94a 100644 --- a/src/widget/multitree/multi.tree.search.pane.js +++ b/src/widget/multitree/multi.tree.search.pane.js @@ -44,8 +44,12 @@ BI.MultiTreeSearchPane = BI.inherit(BI.Pane, { }, setValue: function (v) { + this.setSelectedValue(v.value); + }, + + setSelectedValue: function (v) { v || (v = {}); - this.partTree.setSelectedValue(v.value); + this.partTree.setSelectedValue(v); }, getValue: function () {