From d3803b497388d7ddf4461c694af1605749734c3e Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 14 Aug 2019 10:21:15 +0800 Subject: [PATCH] =?UTF-8?q?BI-49874=20feat:=20=E9=83=A8=E4=BB=B6=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E5=90=8C=E6=AD=A5=E4=B8=80=E4=B8=8B=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/button/item.singleselect.radio.js | 4 +- .../combo.listtreevaluechooser.js | 43 ++++++++++++++++--- .../combo.treevaluechooser.insert.js | 43 ++++++++++++++++--- .../combo.treevaluechooser.js | 43 ++++++++++++++++--- .../valuechooser/combo.valuechooser.js | 43 ++++++++++++++++--- 5 files changed, 154 insertions(+), 22 deletions(-) diff --git a/src/case/button/item.singleselect.radio.js b/src/case/button/item.singleselect.radio.js index 272fe2939e..44841018c6 100644 --- a/src/case/button/item.singleselect.radio.js +++ b/src/case/button/item.singleselect.radio.js @@ -57,7 +57,7 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, { BI.SingleSelectRadioItem.superclass.doClick.apply(this, arguments); this.radio.setSelected(this.isSelected()); if (this.isValid()) { - this.fireEvent(BI.SingleSelectItem.EVENT_CHANGE, this.isSelected(), this); + this.fireEvent(BI.SingleSelectRadioItem.EVENT_CHANGE, this.isSelected(), this); } }, @@ -68,5 +68,5 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, { } }); -BI.SingleSelectItem.EVENT_CHANGE = "EVENT_CHANGE"; +BI.SingleSelectRadioItem.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.single_select_radio_item", BI.SingleSelectRadioItem); \ No newline at end of file diff --git a/src/component/treevaluechooser/combo.listtreevaluechooser.js b/src/component/treevaluechooser/combo.listtreevaluechooser.js index 64e509cba3..746dd4fa30 100644 --- a/src/component/treevaluechooser/combo.listtreevaluechooser.js +++ b/src/component/treevaluechooser/combo.listtreevaluechooser.js @@ -29,11 +29,38 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser, itemsCreator: BI.bind(this._itemsCreator, this), valueFormatter: BI.bind(this._valueFormatter, this), width: o.width, - height: o.height - }); - - this.combo.on(BI.MultiTreeListCombo.EVENT_CONFIRM, function () { - self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM); + height: o.height, + listeners: [{ + eventName: BI.MultiTreeListCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiTreeListCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiTreeListCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiTreeListCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiTreeListCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiTreeListCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM); + } + }] }); }, @@ -50,5 +77,11 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser, this.combo.populate.apply(this.combo, arguments); } }); + +BI.ListTreeValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ListTreeValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ListTreeValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ListTreeValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ListTreeValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.shortcut("bi.list_tree_value_chooser_insert_combo", BI.ListTreeValueChooserInsertCombo); \ No newline at end of file diff --git a/src/component/treevaluechooser/combo.treevaluechooser.insert.js b/src/component/treevaluechooser/combo.treevaluechooser.insert.js index 42b80e4cab..0048ee30e7 100644 --- a/src/component/treevaluechooser/combo.treevaluechooser.insert.js +++ b/src/component/treevaluechooser/combo.treevaluechooser.insert.js @@ -29,11 +29,38 @@ BI.TreeValueChooserInsertCombo = BI.inherit(BI.AbstractTreeValueChooser, { itemsCreator: BI.bind(this._itemsCreator, this), valueFormatter: BI.bind(this._valueFormatter, this), width: o.width, - height: o.height - }); - - this.combo.on(BI.MultiTreeInsertCombo.EVENT_CONFIRM, function () { - self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CONFIRM); + height: o.height, + listeners: [{ + eventName: BI.MultiTreeInsertCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.TreeValueChooserCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiTreeInsertCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.TreeValueChooserCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiTreeInsertCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiTreeInsertCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiTreeInsertCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CONFIRM); + } + }] }); }, @@ -50,5 +77,11 @@ BI.TreeValueChooserInsertCombo = BI.inherit(BI.AbstractTreeValueChooser, { this.combo.populate.apply(this.combo, arguments); } }); + +BI.TreeValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.TreeValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.TreeValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.TreeValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.TreeValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; BI.TreeValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.shortcut("bi.tree_value_chooser_insert_combo", BI.TreeValueChooserInsertCombo); \ No newline at end of file diff --git a/src/component/treevaluechooser/combo.treevaluechooser.js b/src/component/treevaluechooser/combo.treevaluechooser.js index b4ca4c6a70..d57b882973 100644 --- a/src/component/treevaluechooser/combo.treevaluechooser.js +++ b/src/component/treevaluechooser/combo.treevaluechooser.js @@ -29,11 +29,38 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, { itemsCreator: BI.bind(this._itemsCreator, this), valueFormatter: BI.bind(this._valueFormatter, this), width: o.width, - height: o.height - }); - - this.combo.on(BI.MultiTreeCombo.EVENT_CONFIRM, function () { - self.fireEvent(BI.TreeValueChooserCombo.EVENT_CONFIRM); + height: o.height, + listeners: [{ + eventName: BI.MultiTreeCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.TreeValueChooserCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiTreeCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.TreeValueChooserCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiTreeCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.TreeValueChooserCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiTreeCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.TreeValueChooserCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiTreeCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.TreeValueChooserCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiTreeCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.TreeValueChooserCombo.EVENT_CONFIRM); + } + }] }); }, @@ -50,5 +77,11 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, { this.combo.populate.apply(this.combo, arguments); } }); + BI.TreeValueChooserCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.TreeValueChooserCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.TreeValueChooserCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.TreeValueChooserCombo.EVENT_STOP = "EVENT_STOP"; +BI.TreeValueChooserCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.TreeValueChooserCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; BI.shortcut("bi.tree_value_chooser_combo", BI.TreeValueChooserCombo); \ No newline at end of file diff --git a/src/component/valuechooser/combo.valuechooser.js b/src/component/valuechooser/combo.valuechooser.js index 391ebf76cb..d8c3454daf 100644 --- a/src/component/valuechooser/combo.valuechooser.js +++ b/src/component/valuechooser/combo.valuechooser.js @@ -32,11 +32,38 @@ BI.ValueChooserCombo = BI.inherit(BI.AbstractValueChooser, { itemsCreator: BI.bind(this._itemsCreator, this), valueFormatter: BI.bind(this._valueFormatter, this), width: o.width, - height: o.height - }); - - this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () { - self.fireEvent(BI.ValueChooserCombo.EVENT_CONFIRM); + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserCombo.EVENT_CONFIRM); + } + }] }); }, @@ -58,5 +85,11 @@ BI.ValueChooserCombo = BI.inherit(BI.AbstractValueChooser, { this.combo.populate.apply(this, arguments); } }); + +BI.ValueChooserCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; BI.ValueChooserCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.shortcut("bi.value_chooser_combo", BI.ValueChooserCombo); \ No newline at end of file