From 58fa90b16327caf344a40faa3c55c8ec70e09adc Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 19 Jan 2018 15:12:16 +0800 Subject: [PATCH 1/3] =?UTF-8?q?date=5Ftime=5Fcombo=E5=92=8Cbubble?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/widget/datetime/demo.datetime.js | 10 ++++++++- dist/bundle.js | 27 +++++++++++++---------- dist/core.js | 8 +++++++ dist/demo.js | 10 ++++++++- dist/fineui.js | 27 +++++++++++++---------- dist/widget.js | 19 ++++++---------- src/core/controller/controller.bubbles.js | 8 +++++++ src/widget/datetime/datetime.combo.js | 8 ++++--- src/widget/datetime/datetime.popup.js | 10 +-------- src/widget/datetime/datetime.trigger.js | 1 + 10 files changed, 78 insertions(+), 50 deletions(-) diff --git a/demo/js/widget/datetime/demo.datetime.js b/demo/js/widget/datetime/demo.datetime.js index 051529dbee..496b136d56 100644 --- a/demo/js/widget/datetime/demo.datetime.js +++ b/demo/js/widget/datetime/demo.datetime.js @@ -22,7 +22,15 @@ Demo.CustomDateTime = BI.inherit(BI.Widget, { eventName: BI.DateTimeCombo.EVENT_CANCEL, action: function () { } - }] + }], + value: { + year: 2017, + month: 2, + day: 23, + hour: 12, + minute: 11, + second: 1 + } }, top: 200, left: 200 diff --git a/dist/bundle.js b/dist/bundle.js index c32ca4a064..20b664abee 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -18188,8 +18188,16 @@ BI.BubblesController = BI.inherit(BI.Controller, { _init: function () { BI.BubblesController.superclass._init.apply(this, arguments); + var self = this; this.bubblesManager = {}; this.storeBubbles = {}; + BI.Resizers.add("bubbleController" + BI.uniqueId(), function () { + BI.each(self.bubblesManager, function (name) { + self.remove(name); + }); + self.bubblesManager = {}; + self.storeBubbles = {}; + }); }, _createBubble: function (direct, text, height) { @@ -79180,7 +79188,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { BI.DateTimeCombo.superclass._init.apply(this, arguments); var self = this, opts = this.options; var date = Date.getDate(); - this.storeValue = { + this.storeValue = BI.isNotNull(opts.value) ? opts.value : { year: date.getFullYear(), month: date.getMonth(), day: date.getDate(), @@ -79191,13 +79199,15 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.date_time_trigger", min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE + max: this.constants.DATE_MAX_VALUE, + value: opts.value }); this.popup = BI.createWidget({ type: "bi.date_time_popup", min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE + max: this.constants.DATE_MAX_VALUE, + value: opts.value }); self.setValue(this.storeValue); @@ -79396,15 +79406,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, { }] }); - var date = Date.getDate(); - this.dateCombo.setValue({ - year: date.getFullYear(), - month: date.getMonth(), - day: date.getDate() - }); - this.hour.setValue(date.getHours()); - this.minute.setValue(date.getMinutes()); - this.second.setValue(date.getSeconds()); + this.setValue(opts.value); this.dateButton = BI.createWidget({ type: "bi.grid", @@ -79608,6 +79610,7 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, { el: this.text }] }); + this.setValue(o.value); }, _printTime: function (v) { diff --git a/dist/core.js b/dist/core.js index 19de83edff..d6c3ddac2f 100644 --- a/dist/core.js +++ b/dist/core.js @@ -18188,8 +18188,16 @@ BI.BubblesController = BI.inherit(BI.Controller, { _init: function () { BI.BubblesController.superclass._init.apply(this, arguments); + var self = this; this.bubblesManager = {}; this.storeBubbles = {}; + BI.Resizers.add("bubbleController" + BI.uniqueId(), function () { + BI.each(self.bubblesManager, function (name) { + self.remove(name); + }); + self.bubblesManager = {}; + self.storeBubbles = {}; + }); }, _createBubble: function (direct, text, height) { diff --git a/dist/demo.js b/dist/demo.js index 03758c78ec..90aa9fe4c1 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -12337,7 +12337,15 @@ Demo.CustomDateTime = BI.inherit(BI.Widget, { eventName: BI.DateTimeCombo.EVENT_CANCEL, action: function () { } - }] + }], + value: { + year: 2017, + month: 2, + day: 23, + hour: 12, + minute: 11, + second: 1 + } }, top: 200, left: 200 diff --git a/dist/fineui.js b/dist/fineui.js index f4fbe7b21c..6b106471da 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -18361,8 +18361,16 @@ BI.BubblesController = BI.inherit(BI.Controller, { _init: function () { BI.BubblesController.superclass._init.apply(this, arguments); + var self = this; this.bubblesManager = {}; this.storeBubbles = {}; + BI.Resizers.add("bubbleController" + BI.uniqueId(), function () { + BI.each(self.bubblesManager, function (name) { + self.remove(name); + }); + self.bubblesManager = {}; + self.storeBubbles = {}; + }); }, _createBubble: function (direct, text, height) { @@ -80874,7 +80882,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { BI.DateTimeCombo.superclass._init.apply(this, arguments); var self = this, opts = this.options; var date = Date.getDate(); - this.storeValue = { + this.storeValue = BI.isNotNull(opts.value) ? opts.value : { year: date.getFullYear(), month: date.getMonth(), day: date.getDate(), @@ -80885,13 +80893,15 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.date_time_trigger", min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE + max: this.constants.DATE_MAX_VALUE, + value: opts.value }); this.popup = BI.createWidget({ type: "bi.date_time_popup", min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE + max: this.constants.DATE_MAX_VALUE, + value: opts.value }); self.setValue(this.storeValue); @@ -81090,15 +81100,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, { }] }); - var date = Date.getDate(); - this.dateCombo.setValue({ - year: date.getFullYear(), - month: date.getMonth(), - day: date.getDate() - }); - this.hour.setValue(date.getHours()); - this.minute.setValue(date.getMinutes()); - this.second.setValue(date.getSeconds()); + this.setValue(opts.value); this.dateButton = BI.createWidget({ type: "bi.grid", @@ -81302,6 +81304,7 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, { el: this.text }] }); + this.setValue(o.value); }, _printTime: function (v) { diff --git a/dist/widget.js b/dist/widget.js index a613995853..e487d14793 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -2758,7 +2758,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { BI.DateTimeCombo.superclass._init.apply(this, arguments); var self = this, opts = this.options; var date = Date.getDate(); - this.storeValue = { + this.storeValue = BI.isNotNull(opts.value) ? opts.value : { year: date.getFullYear(), month: date.getMonth(), day: date.getDate(), @@ -2769,13 +2769,15 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.date_time_trigger", min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE + max: this.constants.DATE_MAX_VALUE, + value: opts.value }); this.popup = BI.createWidget({ type: "bi.date_time_popup", min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE + max: this.constants.DATE_MAX_VALUE, + value: opts.value }); self.setValue(this.storeValue); @@ -2974,15 +2976,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, { }] }); - var date = Date.getDate(); - this.dateCombo.setValue({ - year: date.getFullYear(), - month: date.getMonth(), - day: date.getDate() - }); - this.hour.setValue(date.getHours()); - this.minute.setValue(date.getMinutes()); - this.second.setValue(date.getSeconds()); + this.setValue(opts.value); this.dateButton = BI.createWidget({ type: "bi.grid", @@ -3186,6 +3180,7 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, { el: this.text }] }); + this.setValue(o.value); }, _printTime: function (v) { diff --git a/src/core/controller/controller.bubbles.js b/src/core/controller/controller.bubbles.js index 63cf3607cd..ce7fbb29eb 100644 --- a/src/core/controller/controller.bubbles.js +++ b/src/core/controller/controller.bubbles.js @@ -16,8 +16,16 @@ BI.BubblesController = BI.inherit(BI.Controller, { _init: function () { BI.BubblesController.superclass._init.apply(this, arguments); + var self = this; this.bubblesManager = {}; this.storeBubbles = {}; + BI.Resizers.add("bubbleController" + BI.uniqueId(), function () { + BI.each(self.bubblesManager, function (name) { + self.remove(name); + }); + self.bubblesManager = {}; + self.storeBubbles = {}; + }); }, _createBubble: function (direct, text, height) { diff --git a/src/widget/datetime/datetime.combo.js b/src/widget/datetime/datetime.combo.js index b2d272255d..a344137895 100644 --- a/src/widget/datetime/datetime.combo.js +++ b/src/widget/datetime/datetime.combo.js @@ -21,7 +21,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { BI.DateTimeCombo.superclass._init.apply(this, arguments); var self = this, opts = this.options; var date = Date.getDate(); - this.storeValue = { + this.storeValue = BI.isNotNull(opts.value) ? opts.value : { year: date.getFullYear(), month: date.getMonth(), day: date.getDate(), @@ -32,13 +32,15 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.date_time_trigger", min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE + max: this.constants.DATE_MAX_VALUE, + value: opts.value }); this.popup = BI.createWidget({ type: "bi.date_time_popup", min: this.constants.DATE_MIN_VALUE, - max: this.constants.DATE_MAX_VALUE + max: this.constants.DATE_MAX_VALUE, + value: opts.value }); self.setValue(this.storeValue); diff --git a/src/widget/datetime/datetime.popup.js b/src/widget/datetime/datetime.popup.js index 11678623ae..7137e5d949 100644 --- a/src/widget/datetime/datetime.popup.js +++ b/src/widget/datetime/datetime.popup.js @@ -106,15 +106,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, { }] }); - var date = Date.getDate(); - this.dateCombo.setValue({ - year: date.getFullYear(), - month: date.getMonth(), - day: date.getDate() - }); - this.hour.setValue(date.getHours()); - this.minute.setValue(date.getMinutes()); - this.second.setValue(date.getSeconds()); + this.setValue(opts.value); this.dateButton = BI.createWidget({ type: "bi.grid", diff --git a/src/widget/datetime/datetime.trigger.js b/src/widget/datetime/datetime.trigger.js index c6561c0cae..b23bc9a1f8 100644 --- a/src/widget/datetime/datetime.trigger.js +++ b/src/widget/datetime/datetime.trigger.js @@ -36,6 +36,7 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, { el: this.text }] }); + this.setValue(o.value); }, _printTime: function (v) { From 1c55efe237c140ec50ecd6a9d9ee3c6499d83955 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 19 Jan 2018 15:57:38 +0800 Subject: [PATCH 2/3] =?UTF-8?q?text=5Fvalue=5Fcheck=5Fcombo=E7=9A=84trigge?= =?UTF-8?q?r=E8=87=AA=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js b/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js index be1434eaa2..9d373eda39 100644 --- a/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js +++ b/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js @@ -17,7 +17,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { _init: function () { BI.TextValueCheckCombo.superclass._init.apply(this, arguments); var self = this, o = this.options; - this.trigger = BI.createWidget({ + this.trigger = BI.createWidget(o.el, { type: "bi.select_text_trigger", items: o.items, height: o.height, From e18b99502acf0b04e1a80846d3abd90fd9687f7e Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 19 Jan 2018 15:58:00 +0800 Subject: [PATCH 3/3] update --- dist/bundle.js | 2 +- dist/case.js | 2 +- dist/fineui.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/bundle.js b/dist/bundle.js index 20b664abee..0869a1cdce 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -67981,7 +67981,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { _init: function () { BI.TextValueCheckCombo.superclass._init.apply(this, arguments); var self = this, o = this.options; - this.trigger = BI.createWidget({ + this.trigger = BI.createWidget(o.el, { type: "bi.select_text_trigger", items: o.items, height: o.height, diff --git a/dist/case.js b/dist/case.js index 5b09100de1..e959347bba 100644 --- a/dist/case.js +++ b/dist/case.js @@ -5679,7 +5679,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { _init: function () { BI.TextValueCheckCombo.superclass._init.apply(this, arguments); var self = this, o = this.options; - this.trigger = BI.createWidget({ + this.trigger = BI.createWidget(o.el, { type: "bi.select_text_trigger", items: o.items, height: o.height, diff --git a/dist/fineui.js b/dist/fineui.js index 6b106471da..36e2ea014a 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -69675,7 +69675,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { _init: function () { BI.TextValueCheckCombo.superclass._init.apply(this, arguments); var self = this, o = this.options; - this.trigger = BI.createWidget({ + this.trigger = BI.createWidget(o.el, { type: "bi.select_text_trigger", items: o.items, height: o.height,