From 5527e5eca1903feb305853ed552f35ea4e548bf7 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 18 Jan 2018 11:06:10 +0800 Subject: [PATCH] update --- .../combo/demo.text_value_down_list_combo.js | 13 +++++++---- dist/bundle.js | 22 ++++++++++++++----- dist/case.js | 22 ++++++++++++++----- dist/demo.js | 13 +++++++---- dist/fineui.js | 22 ++++++++++++++----- .../combo.textvaluedownlist.js | 17 +++++++++++--- .../trigger.textvaluedownlist.js | 5 +++-- 7 files changed, 86 insertions(+), 28 deletions(-) diff --git a/demo/js/case/combo/demo.text_value_down_list_combo.js b/demo/js/case/combo/demo.text_value_down_list_combo.js index c89329e8c..51a8c1a4c 100644 --- a/demo/js/case/combo/demo.text_value_down_list_combo.js +++ b/demo/js/case/combo/demo.text_value_down_list_combo.js @@ -16,6 +16,8 @@ Demo.TextValueDownListCombo = BI.inherit(BI.Widget, { ref: function (_ref) { self.refs = _ref; }, + text: "默认值", + value: 11, items: [ [{ el: { @@ -35,13 +37,16 @@ Demo.TextValueDownListCombo = BI.inherit(BI.Widget, { value: 3 }] ] + }, { + type: "bi.button", + width: 90, + height: 25, + handler: function () { + self.refs.setValue(2); + } }], vgap: 20 }; - }, - - mounted: function () { - this.refs.setValue(2); } }); diff --git a/dist/bundle.js b/dist/bundle.js index af62bcde3..333b8fc35 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -68348,10 +68348,16 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { this._createValueMap(); + var value; + if(BI.isNotNull(o.value)){ + value = this._digest(o.value); + } this.trigger = BI.createWidget({ type: "bi.down_list_select_text_trigger", height: o.height, - items: o.items + items: o.items, + text: o.text, + value: value }); this.combo = BI.createWidget({ @@ -68361,6 +68367,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { adjustLength: 2, height: o.height, el: this.trigger, + value: BI.isNull(value) ? [] : [value], items: BI.deepClone(o.items) }); @@ -68389,10 +68396,14 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }); }, + _digest: function (v) { + return this.valueMap[v]; + }, + setValue: function (v) { - v = this.valueMap[v]; + v = this._digest(v); this.combo.setValue([v]); - this.trigger.setValue(v.childValue || v.value); + this.trigger.setValue(v); }, getValue: function () { @@ -68432,7 +68443,8 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, { element: this, height: o.height, items: this._formatItemArray(o.items), - text: o.text + text: o.text, + value: BI.isNull(o.value) ? "" : o.value.childValue || o.value.value }); }, @@ -68453,7 +68465,7 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, { }, setValue: function (vals) { - this.trigger.setValue(vals); + this.trigger.setValue(vals.childValue || vals.value); }, populate: function (items) { diff --git a/dist/case.js b/dist/case.js index 8d5f138a0..efcee388e 100644 --- a/dist/case.js +++ b/dist/case.js @@ -6058,10 +6058,16 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { this._createValueMap(); + var value; + if(BI.isNotNull(o.value)){ + value = this._digest(o.value); + } this.trigger = BI.createWidget({ type: "bi.down_list_select_text_trigger", height: o.height, - items: o.items + items: o.items, + text: o.text, + value: value }); this.combo = BI.createWidget({ @@ -6071,6 +6077,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { adjustLength: 2, height: o.height, el: this.trigger, + value: BI.isNull(value) ? [] : [value], items: BI.deepClone(o.items) }); @@ -6099,10 +6106,14 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }); }, + _digest: function (v) { + return this.valueMap[v]; + }, + setValue: function (v) { - v = this.valueMap[v]; + v = this._digest(v); this.combo.setValue([v]); - this.trigger.setValue(v.childValue || v.value); + this.trigger.setValue(v); }, getValue: function () { @@ -6142,7 +6153,8 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, { element: this, height: o.height, items: this._formatItemArray(o.items), - text: o.text + text: o.text, + value: BI.isNull(o.value) ? "" : o.value.childValue || o.value.value }); }, @@ -6163,7 +6175,7 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, { }, setValue: function (vals) { - this.trigger.setValue(vals); + this.trigger.setValue(vals.childValue || vals.value); }, populate: function (items) { diff --git a/dist/demo.js b/dist/demo.js index 551376d34..b92088b3d 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -1960,6 +1960,8 @@ Demo.TextValueDownListCombo = BI.inherit(BI.Widget, { ref: function (_ref) { self.refs = _ref; }, + text: "默认值", + value: 11, items: [ [{ el: { @@ -1979,13 +1981,16 @@ Demo.TextValueDownListCombo = BI.inherit(BI.Widget, { value: 3 }] ] + }, { + type: "bi.button", + width: 90, + height: 25, + handler: function () { + self.refs.setValue(2); + } }], vgap: 20 }; - }, - - mounted: function () { - this.refs.setValue(2); } }); diff --git a/dist/fineui.js b/dist/fineui.js index 5bec5a6e6..380423b5d 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -70042,10 +70042,16 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { this._createValueMap(); + var value; + if(BI.isNotNull(o.value)){ + value = this._digest(o.value); + } this.trigger = BI.createWidget({ type: "bi.down_list_select_text_trigger", height: o.height, - items: o.items + items: o.items, + text: o.text, + value: value }); this.combo = BI.createWidget({ @@ -70055,6 +70061,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { adjustLength: 2, height: o.height, el: this.trigger, + value: BI.isNull(value) ? [] : [value], items: BI.deepClone(o.items) }); @@ -70083,10 +70090,14 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }); }, + _digest: function (v) { + return this.valueMap[v]; + }, + setValue: function (v) { - v = this.valueMap[v]; + v = this._digest(v); this.combo.setValue([v]); - this.trigger.setValue(v.childValue || v.value); + this.trigger.setValue(v); }, getValue: function () { @@ -70126,7 +70137,8 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, { element: this, height: o.height, items: this._formatItemArray(o.items), - text: o.text + text: o.text, + value: BI.isNull(o.value) ? "" : o.value.childValue || o.value.value }); }, @@ -70147,7 +70159,7 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, { }, setValue: function (vals) { - this.trigger.setValue(vals); + this.trigger.setValue(vals.childValue || vals.value); }, populate: function (items) { diff --git a/src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js b/src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js index cc9391734..ebde1e8f2 100644 --- a/src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js +++ b/src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js @@ -16,10 +16,16 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { this._createValueMap(); + var value; + if(BI.isNotNull(o.value)){ + value = this._digest(o.value); + } this.trigger = BI.createWidget({ type: "bi.down_list_select_text_trigger", height: o.height, - items: o.items + items: o.items, + text: o.text, + value: value }); this.combo = BI.createWidget({ @@ -29,6 +35,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { adjustLength: 2, height: o.height, el: this.trigger, + value: BI.isNull(value) ? [] : [value], items: BI.deepClone(o.items) }); @@ -57,10 +64,14 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }); }, + _digest: function (v) { + return this.valueMap[v]; + }, + setValue: function (v) { - v = this.valueMap[v]; + v = this._digest(v); this.combo.setValue([v]); - this.trigger.setValue(v.childValue || v.value); + this.trigger.setValue(v); }, getValue: function () { diff --git a/src/case/combo/textvaluedownlistcombo/trigger.textvaluedownlist.js b/src/case/combo/textvaluedownlistcombo/trigger.textvaluedownlist.js index a498db359..b335ce5c1 100644 --- a/src/case/combo/textvaluedownlistcombo/trigger.textvaluedownlist.js +++ b/src/case/combo/textvaluedownlistcombo/trigger.textvaluedownlist.js @@ -23,7 +23,8 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, { element: this, height: o.height, items: this._formatItemArray(o.items), - text: o.text + text: o.text, + value: BI.isNull(o.value) ? "" : o.value.childValue || o.value.value }); }, @@ -44,7 +45,7 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, { }, setValue: function (vals) { - this.trigger.setValue(vals); + this.trigger.setValue(vals.childValue || vals.value); }, populate: function (items) {