From 47bf3bcbf0e8b95d8c093097a79b04e6fc837bf6 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 26 Aug 2019 16:18:55 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=8F=90=E4=BE=9B=E9=85=8D=E5=AF=B9?= =?UTF-8?q?=E7=9A=84bi.value=5Fchooser=5Finsert=5Fcombo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/2.0/fineui.ie.js | 94 ++++++++++++++++++ dist/2.0/fineui.js | 94 ++++++++++++++++++ dist/bundle.ie.js | 94 ++++++++++++++++++ dist/bundle.js | 94 ++++++++++++++++++ dist/fineui.ie.js | 94 ++++++++++++++++++ dist/fineui.js | 94 ++++++++++++++++++ dist/fineui_without_jquery_polyfill.js | 94 ++++++++++++++++++ dist/widget.js | 94 ++++++++++++++++++ .../valuechooser/combo.valuechooser.insert.js | 95 +++++++++++++++++++ 9 files changed, 847 insertions(+) create mode 100644 src/component/valuechooser/combo.valuechooser.insert.js diff --git a/dist/2.0/fineui.ie.js b/dist/2.0/fineui.ie.js index 07e9b96b5..731bb3e1f 100644 --- a/dist/2.0/fineui.ie.js +++ b/dist/2.0/fineui.ie.js @@ -88891,6 +88891,100 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { } } });/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + * + * Created by GUY on 2015/10/29. + * @class BI.ValueChooserInsertCombo + * @extends BI.Widget + */ +BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { + + _defaultConfig: function () { + return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-insert-combo", + width: 200, + height: 24, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: "bi.multi_select_insert_combo", + element: this, + text: o.text, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: BI.bind(this._valueFormatter, this), + width: o.width, + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM); + } + }] + }); + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + }; + }, + + populate: function (items) { + // 直接用combo的populate不会作用到AbstractValueChooser上 + this.items = items; + this.combo.populate.apply(this, arguments); + } +}); + +BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo);/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 * diff --git a/dist/2.0/fineui.js b/dist/2.0/fineui.js index d5ca7830e..bf605db17 100644 --- a/dist/2.0/fineui.js +++ b/dist/2.0/fineui.js @@ -89295,6 +89295,100 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { } } });/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + * + * Created by GUY on 2015/10/29. + * @class BI.ValueChooserInsertCombo + * @extends BI.Widget + */ +BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { + + _defaultConfig: function () { + return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-insert-combo", + width: 200, + height: 24, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: "bi.multi_select_insert_combo", + element: this, + text: o.text, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: BI.bind(this._valueFormatter, this), + width: o.width, + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM); + } + }] + }); + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + }; + }, + + populate: function (items) { + // 直接用combo的populate不会作用到AbstractValueChooser上 + this.items = items; + this.combo.populate.apply(this, arguments); + } +}); + +BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo);/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 * diff --git a/dist/bundle.ie.js b/dist/bundle.ie.js index 07e9b96b5..731bb3e1f 100644 --- a/dist/bundle.ie.js +++ b/dist/bundle.ie.js @@ -88891,6 +88891,100 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { } } });/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + * + * Created by GUY on 2015/10/29. + * @class BI.ValueChooserInsertCombo + * @extends BI.Widget + */ +BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { + + _defaultConfig: function () { + return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-insert-combo", + width: 200, + height: 24, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: "bi.multi_select_insert_combo", + element: this, + text: o.text, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: BI.bind(this._valueFormatter, this), + width: o.width, + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM); + } + }] + }); + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + }; + }, + + populate: function (items) { + // 直接用combo的populate不会作用到AbstractValueChooser上 + this.items = items; + this.combo.populate.apply(this, arguments); + } +}); + +BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo);/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 * diff --git a/dist/bundle.js b/dist/bundle.js index d5ca7830e..bf605db17 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -89295,6 +89295,100 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { } } });/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + * + * Created by GUY on 2015/10/29. + * @class BI.ValueChooserInsertCombo + * @extends BI.Widget + */ +BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { + + _defaultConfig: function () { + return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-insert-combo", + width: 200, + height: 24, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: "bi.multi_select_insert_combo", + element: this, + text: o.text, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: BI.bind(this._valueFormatter, this), + width: o.width, + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM); + } + }] + }); + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + }; + }, + + populate: function (items) { + // 直接用combo的populate不会作用到AbstractValueChooser上 + this.items = items; + this.combo.populate.apply(this, arguments); + } +}); + +BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo);/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 * diff --git a/dist/fineui.ie.js b/dist/fineui.ie.js index 883a770ce..2e574bb84 100644 --- a/dist/fineui.ie.js +++ b/dist/fineui.ie.js @@ -89136,6 +89136,100 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { } } });/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + * + * Created by GUY on 2015/10/29. + * @class BI.ValueChooserInsertCombo + * @extends BI.Widget + */ +BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { + + _defaultConfig: function () { + return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-insert-combo", + width: 200, + height: 24, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: "bi.multi_select_insert_combo", + element: this, + text: o.text, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: BI.bind(this._valueFormatter, this), + width: o.width, + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM); + } + }] + }); + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + }; + }, + + populate: function (items) { + // 直接用combo的populate不会作用到AbstractValueChooser上 + this.items = items; + this.combo.populate.apply(this, arguments); + } +}); + +BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo);/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 * diff --git a/dist/fineui.js b/dist/fineui.js index 8b660952d..745e61434 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -89540,6 +89540,100 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { } } });/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + * + * Created by GUY on 2015/10/29. + * @class BI.ValueChooserInsertCombo + * @extends BI.Widget + */ +BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { + + _defaultConfig: function () { + return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-insert-combo", + width: 200, + height: 24, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: "bi.multi_select_insert_combo", + element: this, + text: o.text, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: BI.bind(this._valueFormatter, this), + width: o.width, + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM); + } + }] + }); + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + }; + }, + + populate: function (items) { + // 直接用combo的populate不会作用到AbstractValueChooser上 + this.items = items; + this.combo.populate.apply(this, arguments); + } +}); + +BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo);/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 * diff --git a/dist/fineui_without_jquery_polyfill.js b/dist/fineui_without_jquery_polyfill.js index 7cbd1d7ea..5ed1b201f 100644 --- a/dist/fineui_without_jquery_polyfill.js +++ b/dist/fineui_without_jquery_polyfill.js @@ -71840,6 +71840,100 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { } } });/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + * + * Created by GUY on 2015/10/29. + * @class BI.ValueChooserInsertCombo + * @extends BI.Widget + */ +BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { + + _defaultConfig: function () { + return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-insert-combo", + width: 200, + height: 24, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: "bi.multi_select_insert_combo", + element: this, + text: o.text, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: BI.bind(this._valueFormatter, this), + width: o.width, + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM); + } + }] + }); + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + }; + }, + + populate: function (items) { + // 直接用combo的populate不会作用到AbstractValueChooser上 + this.items = items; + this.combo.populate.apply(this, arguments); + } +}); + +BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo);/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 * diff --git a/dist/widget.js b/dist/widget.js index df4cae545..8c9ca0a48 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -26951,6 +26951,100 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { } } });/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + * + * Created by GUY on 2015/10/29. + * @class BI.ValueChooserInsertCombo + * @extends BI.Widget + */ +BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { + + _defaultConfig: function () { + return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-insert-combo", + width: 200, + height: 24, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: "bi.multi_select_insert_combo", + element: this, + text: o.text, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: BI.bind(this._valueFormatter, this), + width: o.width, + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM); + } + }] + }); + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + }; + }, + + populate: function (items) { + // 直接用combo的populate不会作用到AbstractValueChooser上 + this.items = items; + this.combo.populate.apply(this, arguments); + } +}); + +BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo);/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 * diff --git a/src/component/valuechooser/combo.valuechooser.insert.js b/src/component/valuechooser/combo.valuechooser.insert.js new file mode 100644 index 000000000..ae3fc55e7 --- /dev/null +++ b/src/component/valuechooser/combo.valuechooser.insert.js @@ -0,0 +1,95 @@ +/** + * 简单的复选下拉框控件, 适用于数据量少的情况 + * 封装了字段处理逻辑 + * + * Created by GUY on 2015/10/29. + * @class BI.ValueChooserInsertCombo + * @extends BI.Widget + */ +BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { + + _defaultConfig: function () { + return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-value-chooser-insert-combo", + width: 200, + height: 24, + items: null, + itemsCreator: BI.emptyFn, + cache: true + }); + }, + + _init: function () { + BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNotNull(o.items)) { + this.items = o.items; + } + this.combo = BI.createWidget({ + type: "bi.multi_select_insert_combo", + element: this, + text: o.text, + itemsCreator: BI.bind(this._itemsCreator, this), + valueFormatter: BI.bind(this._valueFormatter, this), + width: o.width, + height: o.height, + listeners: [{ + eventName: BI.MultiSelectCombo.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_BLUR, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_STOP, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_SEARCHING, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING); + } + }, { + eventName: BI.MultiSelectCombo.EVENT_CONFIRM, + action: function () { + self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM); + } + }] + }); + }, + + setValue: function (v) { + this.combo.setValue(v); + }, + + getValue: function () { + var val = this.combo.getValue() || {}; + return { + type: val.type, + value: val.value + }; + }, + + populate: function (items) { + // 直接用combo的populate不会作用到AbstractValueChooser上 + this.items = items; + this.combo.populate.apply(this, arguments); + } +}); + +BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR"; +BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS"; +BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP"; +BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; +BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; +BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo); \ No newline at end of file From ce7ea87dcaf100ee7bfe8330ff29c97f0b216b26 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 26 Aug 2019 16:19:39 +0800 Subject: [PATCH 2/3] update --- dist/2.0/fineui.ie.js | 4 ---- dist/2.0/fineui.js | 4 ---- dist/bundle.ie.js | 4 ---- dist/bundle.js | 4 ---- dist/fineui.ie.js | 4 ---- dist/fineui.js | 4 ---- dist/fineui_without_jquery_polyfill.js | 4 ---- dist/widget.js | 4 ---- src/component/valuechooser/combo.valuechooser.insert.js | 4 ---- 9 files changed, 36 deletions(-) diff --git a/dist/2.0/fineui.ie.js b/dist/2.0/fineui.ie.js index 731bb3e1f..e4c74e7e1 100644 --- a/dist/2.0/fineui.ie.js +++ b/dist/2.0/fineui.ie.js @@ -88893,10 +88893,6 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { });/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 - * - * Created by GUY on 2015/10/29. - * @class BI.ValueChooserInsertCombo - * @extends BI.Widget */ BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { diff --git a/dist/2.0/fineui.js b/dist/2.0/fineui.js index bf605db17..34fdf779c 100644 --- a/dist/2.0/fineui.js +++ b/dist/2.0/fineui.js @@ -89297,10 +89297,6 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { });/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 - * - * Created by GUY on 2015/10/29. - * @class BI.ValueChooserInsertCombo - * @extends BI.Widget */ BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { diff --git a/dist/bundle.ie.js b/dist/bundle.ie.js index 731bb3e1f..e4c74e7e1 100644 --- a/dist/bundle.ie.js +++ b/dist/bundle.ie.js @@ -88893,10 +88893,6 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { });/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 - * - * Created by GUY on 2015/10/29. - * @class BI.ValueChooserInsertCombo - * @extends BI.Widget */ BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { diff --git a/dist/bundle.js b/dist/bundle.js index bf605db17..34fdf779c 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -89297,10 +89297,6 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { });/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 - * - * Created by GUY on 2015/10/29. - * @class BI.ValueChooserInsertCombo - * @extends BI.Widget */ BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { diff --git a/dist/fineui.ie.js b/dist/fineui.ie.js index 2e574bb84..3b7580eff 100644 --- a/dist/fineui.ie.js +++ b/dist/fineui.ie.js @@ -89138,10 +89138,6 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { });/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 - * - * Created by GUY on 2015/10/29. - * @class BI.ValueChooserInsertCombo - * @extends BI.Widget */ BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { diff --git a/dist/fineui.js b/dist/fineui.js index 745e61434..1275f0999 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -89542,10 +89542,6 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { });/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 - * - * Created by GUY on 2015/10/29. - * @class BI.ValueChooserInsertCombo - * @extends BI.Widget */ BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { diff --git a/dist/fineui_without_jquery_polyfill.js b/dist/fineui_without_jquery_polyfill.js index 5ed1b201f..49fbad460 100644 --- a/dist/fineui_without_jquery_polyfill.js +++ b/dist/fineui_without_jquery_polyfill.js @@ -71842,10 +71842,6 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { });/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 - * - * Created by GUY on 2015/10/29. - * @class BI.ValueChooserInsertCombo - * @extends BI.Widget */ BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { diff --git a/dist/widget.js b/dist/widget.js index 8c9ca0a48..48b9b4863 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -26953,10 +26953,6 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, { });/** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 - * - * Created by GUY on 2015/10/29. - * @class BI.ValueChooserInsertCombo - * @extends BI.Widget */ BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { diff --git a/src/component/valuechooser/combo.valuechooser.insert.js b/src/component/valuechooser/combo.valuechooser.insert.js index ae3fc55e7..0c155ea1a 100644 --- a/src/component/valuechooser/combo.valuechooser.insert.js +++ b/src/component/valuechooser/combo.valuechooser.insert.js @@ -1,10 +1,6 @@ /** * 简单的复选下拉框控件, 适用于数据量少的情况 * 封装了字段处理逻辑 - * - * Created by GUY on 2015/10/29. - * @class BI.ValueChooserInsertCombo - * @extends BI.Widget */ BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, { From 33170f55c17a1104e1f63e0e32aad57fd525793a Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 26 Aug 2019 17:29:08 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20number=5F?= =?UTF-8?q?editor=E5=AD=98=E5=80=BC=E9=80=BB=E8=BE=91=E6=94=B9=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/numbereditor/number.editor.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/widget/numbereditor/number.editor.js b/src/widget/numbereditor/number.editor.js index c2d922374..8ef971d40 100644 --- a/src/widget/numbereditor/number.editor.js +++ b/src/widget/numbereditor/number.editor.js @@ -31,11 +31,10 @@ BI.NumberEditor = BI.inherit(BI.Widget, { errorText: o.errorText }); this.editor.on(BI.TextEditor.EVENT_CHANGE, function () { - o.value = BI.parseFloat(this.getValue()); self.fireEvent(BI.NumberEditor.EVENT_CHANGE); }); this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () { - this.setValue(BI.parseFloat(this.getValue())); + o.value = BI.parseFloat(this.getValue()); self.fireEvent(BI.NumberEditor.EVENT_CONFIRM); }); this.topBtn = BI.createWidget({