Browse Source

Merge pull request #230 in FUI/fineui from ~GUY/fineui:master to master

* commit '827cb126002564d077260abd71803dcea32e1635':
  downlistcombo的getValue处理
  multiselectcombo和multiselecttree支持value
  combo支持value完成
  update
  downlistcombo 支持传value
  text_value_combo接受value值
es6
guy 7 years ago
parent
commit
4a1be53e43
  1. 14
      demo/js/case/combo/demo.editor_icon_check_combo.js
  2. 15
      demo/js/case/combo/demo.text_value_combo.js
  3. 13
      demo/js/case/combo/demo.text_value_down_list_combo.js
  4. 1
      demo/js/case/combo/demo.text_vlaue_check_combo.js
  5. 322
      demo/js/widget/downlist/demo.downlist.js
  6. 6
      demo/js/widget/multiselect/demo.multi_select_combo.js
  7. 5
      demo/js/widget/multitree/demo.multi_tree_combo.js
  8. 8
      dist/base.js
  9. 241
      dist/bundle.js
  10. 62
      dist/bundle.min.js
  11. 63
      dist/case.js
  12. 378
      dist/demo.js
  13. 241
      dist/fineui.js
  14. 48
      dist/fineui.min.js
  15. 170
      dist/widget.js
  16. 3
      src/base/layer/layer.popup.js
  17. 5
      src/base/tree/treeview.js
  18. 6
      src/case/combo/editoriconcheckcombo/combo.editoriconcheck.js
  19. 7
      src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js
  20. 6
      src/case/combo/textvaluecheckcombo/combo.textvaluechecksmall.js
  21. 3
      src/case/combo/textvaluecheckcombo/popup.textvaluecheck.js
  22. 8
      src/case/combo/textvaluecombo/combo.textvalue.js
  23. 17
      src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js
  24. 5
      src/case/combo/textvaluedownlistcombo/trigger.textvaluedownlist.js
  25. 3
      src/case/editor/editor.state.js
  26. 3
      src/case/editor/editor.state.simple.js
  27. 3
      src/case/list/list.select.js
  28. 2
      src/case/trigger/trigger.icon.text.js
  29. 6
      src/component/allvaluechooser/combo.allvaluechooser.js
  30. 3
      src/widget/downlist/combo.downlist.js
  31. 3
      src/widget/downlist/group.downlist.js
  32. 22
      src/widget/downlist/item.downlistgroup.js
  33. 53
      src/widget/downlist/popup.downlist.js
  34. 2
      src/widget/multiselect/check/multiselect.check.pane.js
  35. 4
      src/widget/multiselect/multiselect..insert.combo.js
  36. 9
      src/widget/multiselect/multiselect.combo.js
  37. 6
      src/widget/multiselect/multiselect.loader.js
  38. 6
      src/widget/multiselect/multiselect.popup.view.js
  39. 6
      src/widget/multiselect/multiselect.trigger.js
  40. 3
      src/widget/multiselect/search/multiselect.search.loader.js
  41. 3
      src/widget/multiselect/search/multiselect.search.pane.js
  42. 5
      src/widget/multiselect/trigger/button.checkselected.js
  43. 3
      src/widget/multiselect/trigger/editor.multiselect.js
  44. 6
      src/widget/multiselect/trigger/searcher.multiselect.js
  45. 6
      src/widget/multiselect/trigger/switcher.checkselected.js
  46. 3
      src/widget/multitree/check/multi.tree.check.pane.js
  47. 9
      src/widget/multitree/multi.tree.combo.js
  48. 3
      src/widget/multitree/multi.tree.popup.js
  49. 3
      src/widget/multitree/multi.tree.search.pane.js
  50. 6
      src/widget/multitree/trigger/searcher.multi.tree.js

14
demo/js/case/combo/demo.editor_icon_check_combo.js

@ -6,14 +6,18 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
baseCls: ""
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.editor_icon_check_combo",
ref: function () {
self.combo = this;
},
watermark: "默认值",
width: 200,
height: 30,
value: 2,
items: [{
// text: "MVC-1",
value: "1"
@ -24,6 +28,14 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
// text: "MVC-3",
value: "3"
}]
}, {
type: "bi.button",
width: 90,
height: 25,
text: "setValue为空",
handler: function () {
self.combo.setValue()
}
}],
vgap: 20
};

15
demo/js/case/combo/demo.text_value_combo.js

@ -6,12 +6,16 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
baseCls: ""
},
render: function () {
var combo;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.text_value_combo",
value: "默认值",
ref: function () {
combo = this;
},
text: "默认值",
value: 2,
width: 300,
items: [{
text: "MVC-1",
@ -26,6 +30,13 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
iconCls: "pull-right-font",
value: 3
}]
}, {
type: "bi.button",
width: 90,
height: 25,
handler: function () {
combo.setValue("");
}
}],
vgap: 20
};

13
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);
}
});

1
demo/js/case/combo/demo.text_vlaue_check_combo.js

@ -12,6 +12,7 @@ Demo.TextValueCheckCombo = BI.inherit(BI.Widget, {
items: [{
type: "bi.text_value_check_combo",
text: "默认值",
value: 1,
width: 300,
items: [{
text: "MVC-1",

322
demo/js/widget/downlist/demo.downlist.js

@ -1,3 +1,144 @@
BICst.CONF = {};
BICst.CONF.GROUP = {};
BICst.CONF.GROUP.NUMBER = {};
BICst.CONF.GROUP.NUMBER = {};
BICst.CONF.GROUP.NUMBER.GROUP_BY_VALUE = 1;
BICst.CONF.GROUP.NUMBER.CUSTOM_NUMBER_GROUP = 2;
BICst.CONF.GROUP.NUMBER.SUM = 3;
BICst.CONF.GROUP.NUMBER.AVG = 4;
BICst.CONF.GROUP.NUMBER.MEDIAN = 5;
BICst.CONF.GROUP.NUMBER.MAX = 6;
BICst.CONF.GROUP.NUMBER.MIN = 7;
BICst.CONF.GROUP.NUMBER.STANDARD_DEVIATION = 8;
BICst.CONF.GROUP.NUMBER.VARIANCE = 9;
BICst.CONF.GROUP.NUMBER.COUNT = 10;
BICst.CONF.GROUP.NUMBER.RECORD_COUNT = 11;
BICst.CONF.GROUP.NUMBER.NONE = 12;
BICst.CONF.GROUP.NUMBER.PERIOD = 13;
BICst.CONF.GROUP.NUMBER.RING = 14;
BICst.CONF.GROUP.NUMBER.PERIOD_RATE = 15;
BICst.CONF.GROUP.NUMBER.RING_RATE = 16;
BICst.CONF.GROUP.NUMBER.YEAR = 17;
BICst.CONF.GROUP.NUMBER.QUARTER = 18;
BICst.CONF.GROUP.NUMBER.MONTH = 19;
BICst.CONF.GROUP.NUMBER.WEEK = 20;
BICst.CONF.GROUP.NUMBER.WEEKDAY = 21;
BICst.CONF.GROUP.NUMBER.RENAME = 22;
BICst.CONF.GROUP.NUMBER.DELETE = 23;
// 数值字段汇总设置
var items = [[{
text: BI.i18nText("BI-Basic_Qiu_Sum"),
value: BICst.CONF.GROUP.NUMBER.SUM,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Avg"),
value: BICst.CONF.GROUP.NUMBER.AVG,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Median"),
value: BICst.CONF.GROUP.NUMBER.MEDIAN,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Max"),
value: BICst.CONF.GROUP.NUMBER.MAX,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Min"),
value: BICst.CONF.GROUP.NUMBER.MIN,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Standard_Deviation"),
value: BICst.CONF.GROUP.NUMBER.STANDARD_DEVIATION,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Variance"),
value: BICst.CONF.GROUP.NUMBER.VARIANCE,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_No_Repeat_Count"),
value: BICst.CONF.GROUP.NUMBER.COUNT,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Record_Count"),
value: BICst.CONF.GROUP.NUMBER.RECORD_COUNT,
cls: "dot-ha-font"
}], [{
text: BI.i18nText("BI-Basic_None"),
value: BICst.CONF.GROUP.NUMBER.NONE,
cls: "dot-ha-font"
}, {
el: {
text: BI.i18nText("BI-Basic_Qiu_Same_Period"),
value: BICst.CONF.GROUP.NUMBER.PERIOD,
cls: "dot-ha-font"
},
children: [{
text: BI.i18nText("BI-Basic_Multi_Date_Year"),
value: BICst.CONF.GROUP.NUMBER.YEAR,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Quarter"),
value: BICst.CONF.GROUP.NUMBER.QUARTER,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Month"),
value: BICst.CONF.GROUP.NUMBER.MONTH,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Week"),
value: BICst.CONF.GROUP.NUMBER.WEEK,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Week_XingQi"),
value: BICst.CONF.GROUP.NUMBER.WEEKDAY,
cls: "dot-ha-font"
}]
}, {
text: BI.i18nText("BI-Basic_Qiu_Same_Ring"),
value: BICst.CONF.GROUP.NUMBER.RING,
cls: "dot-ha-font"
}, {
el: {
text: BI.i18nText("BI-Basic_Qiu_Same_Period_Rate"),
value: BICst.CONF.GROUP.NUMBER.PERIOD_RATE,
cls: "dot-ha-font"
},
children: [{
text: BI.i18nText("BI-Basic_Multi_Date_Year"),
value: BICst.CONF.GROUP.NUMBER.YEAR,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Quarter"),
value: BICst.CONF.GROUP.NUMBER.QUARTER,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Month"),
value: BICst.CONF.GROUP.NUMBER.MONTH,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Week"),
value: BICst.CONF.GROUP.NUMBER.WEEK,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Week_XingQi"),
value: BICst.CONF.GROUP.NUMBER.WEEKDAY,
cls: "dot-ha-font"
}]
}, {
text: BI.i18nText("BI-Basic_Qiu_Same_Ring_Rate"),
value: BICst.CONF.GROUP.NUMBER.RING_RATE,
cls: "dot-ha-font"
}], [{
text: BI.i18nText("BI-Basic_Rename"),
value: BICst.CONF.GROUP.NUMBER.RENAME,
cls: "widget-combo-rename-edit-font"
}], [{
text: BI.i18nText("BI-Basic_Remove"),
value: BICst.CONF.GROUP.NUMBER.DELETE,
cls: "delete-h-font"
}]];
Demo.Downlist = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-downlist"
@ -26,99 +167,98 @@ Demo.Downlist = BI.inherit(BI.Widget, {
self.downlist = _ref;
},
cls: "layout-bg3",
//value: [{"childValue":22,"value":11},{"value":18},{"value":20}],
height: 30,
width: 100,
items: [
[{
el: {
text: "column 1111",
iconCls1: "check-mark-e-font",
value: 11
},
children: [{
text: "column 1.1",
value: 21,
cls: "dot-e-font",
selected: true
}, {
text: "column 1.222222222222222222222222222222222222",
cls: "dot-e-font",
value: 22
}]
}],
[{
el: {
type: "bi.icon_text_icon_item",
text: "column 2",
iconCls1: "chart-type-e-font",
cls: "dot-e-font",
value: 12
},
disabled: true,
children: [{
type: "bi.icon_text_item",
cls: "dot-e-font",
height: 25,
text: "column 2.1",
value: 11
}, {
text: "column 2.2",
value: 12,
cls: "dot-e-font"
}]
}],
[{
text: "column 8",
value: 18,
cls: "dot-e-font",
selected: true
},
{
text: "column 9",
cls: "dot-e-font",
value: 19
}
],
[{
text: "column 10",
value: 20,
cls: "dot-e-font",
selected: true
},
{
text: "column 11",
cls: "dot-e-font",
value: 21
},
{
text: "column 12",
cls: "dot-e-font",
value: 22
},
{
text: "column 13",
cls: "dot-e-font",
value: 23
},
{
text: "column 14",
cls: "dot-e-font",
value: 24
},
{
text: "column 15",
cls: "dot-e-font",
value: 23
}
]
]
items: items
// items: [
// [{
// el: {
// text: "column 1111",
// iconCls1: "check-mark-e-font",
// value: 11
// },
// children: [{
// text: "column 1.1",
// value: 21,
// cls: "dot-e-font"
// }, {
// text: "column 1.222222222222222222222222222222222222",
// cls: "dot-e-font",
// value: 22
// }]
// }],
// [{
// el: {
// type: "bi.icon_text_icon_item",
// text: "column 2",
// iconCls1: "chart-type-e-font",
// cls: "dot-e-font",
// value: 12
// },
// disabled: true,
// children: [{
// type: "bi.icon_text_item",
// cls: "dot-e-font",
// height: 25,
// text: "column 2.1",
// value: 11
// }, {
// text: "column 2.2",
// value: 12,
// cls: "dot-e-font"
// }]
// }],
// [{
// text: "column 8",
// value: 18,
// cls: "dot-e-font"
// },
// {
//
// text: "column 9",
// cls: "dot-e-font",
// value: 19
// }
// ],
// [{
// text: "column 10",
// value: 20,
// cls: "dot-e-font"
// },
// {
//
// text: "column 11",
// cls: "dot-e-font",
// value: 21
// },
// {
//
// text: "column 12",
// cls: "dot-e-font",
// value: 22
// },
// {
//
// text: "column 13",
// cls: "dot-e-font",
// value: 23
// },
// {
//
// text: "column 14",
// cls: "dot-e-font",
// value: 24
// },
// {
//
// text: "column 15",
// cls: "dot-e-font",
// value: 23
// }
// ]
//
// ]
}, {
type: "bi.label",
text: "显示选择值",

6
demo/js/widget/multiselect/demo.multi_select_combo.js

@ -11,7 +11,11 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
var widget = BI.createWidget({
type: "bi.multi_select_combo",
itemsCreator: BI.bind(this._itemsCreator, this),
width: 200
width: 200,
value: {
type: 1,
value: ["柳州市城贸金属材料有限责任公司", "柳州市建福房屋租赁有限公司", "柳州市迅昌数码办公设备有限责任公司"]
}
});
widget.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () {

5
demo/js/widget/multitree/demo.multi_tree_combo.js

@ -35,7 +35,10 @@ Demo.MultiTreeCombo = BI.inherit(BI.Widget, {
items: items
});
},
width: 300
width: 300,
value: {
"根目录": {}
}
}, {
type: "bi.button",
text: "getValue",

8
dist/base.js vendored

@ -1535,6 +1535,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
_init: function () {
BI.TreeView.superclass._init.apply(this, arguments);
var o = this.options;
this._stop = false;
this._createTree();
@ -1550,7 +1551,9 @@ BI.TreeView = BI.inherit(BI.Pane, {
element: this,
items: [this.tip]
});
if(BI.isNotNull(o.value)){
this.setSelectedValue(o.value);
}
},
_createTree: function () {
@ -15438,7 +15441,8 @@ BI.PopupView = BI.inherit(BI.Widget, {
type: "bi.center",
cls: "list-view-tab",
height: 25,
items: o.tabs
items: o.tabs,
value: o.value
});
},

241
dist/bundle.js vendored

@ -27408,6 +27408,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
_init: function () {
BI.TreeView.superclass._init.apply(this, arguments);
var o = this.options;
this._stop = false;
this._createTree();
@ -27423,7 +27424,9 @@ BI.TreeView = BI.inherit(BI.Pane, {
element: this,
items: [this.tip]
});
if(BI.isNotNull(o.value)){
this.setSelectedValue(o.value);
}
},
_createTree: function () {
@ -41311,7 +41314,8 @@ BI.PopupView = BI.inherit(BI.Widget, {
type: "bi.center",
cls: "list-view-tab",
height: 25,
items: o.tabs
items: o.tabs,
value: o.value
});
},
@ -67447,7 +67451,8 @@ BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText
errorText: o.errorText,
value: o.value
});
this.trigger.on(BI.EditorTrigger.EVENT_CHANGE, function () {
self.popup.setValue(this.getValue());
@ -67456,7 +67461,8 @@ BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
this.popup = BI.createWidget({
type: "bi.text_value_check_combo_popup",
chooseType: o.chooseType,
items: o.items
items: o.items,
value: o.value
});
this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
@ -67964,12 +67970,15 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height
height: o.height,
text: o.text,
value: o.value
});
this.popup = BI.createWidget({
type: "bi.text_value_check_combo_popup",
chooseType: o.chooseType,
items: o.items
items: o.items,
value: o.value
});
this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
@ -68039,12 +68048,14 @@ BI.SmallTextValueCheckCombo = BI.inherit(BI.Widget, {
type: "bi.small_select_text_trigger",
items: o.items,
height: o.height,
text: o.text
text: o.text,
value: o.value
});
this.popup = BI.createWidget({
type: "bi.text_value_check_combo_popup",
chooseType: o.chooseType,
items: o.items
items: o.items,
value: o.value
});
this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
@ -68097,7 +68108,8 @@ BI.shortcut("bi.small_text_value_check_combo", BI.SmallTextValueCheckCombo);BI.T
chooseType: o.chooseType,
layouts: [{
type: "bi.vertical"
}]
}],
value: o.value
});
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {
@ -68151,6 +68163,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
baseClass: "bi-text-value-combo",
height: 30,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: "",
value: "",
el: {}
});
@ -68163,11 +68176,13 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
type: "bi.select_text_trigger",
items: o.items,
height: o.height,
text: o.value
text: o.text,
value: o.value
});
this.popup = BI.createWidget({
type: "bi.text_value_combo_popup",
chooseType: o.chooseType,
value: o.value,
items: o.items
});
this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE, function () {
@ -68188,9 +68203,6 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
maxHeight: 300
}
});
if (BI.isKey(o.value)) {
this.setValue(o.value);
}
},
setValue: function (v) {
@ -68348,10 +68360,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 +68379,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 +68408,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 +68455,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 +68477,7 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, {
},
setValue: function (vals) {
this.trigger.setValue(vals);
this.trigger.setValue(vals.childValue || vals.value);
},
populate: function (items) {
@ -69541,6 +69565,9 @@ BI.StateEditor = BI.inherit(BI.Widget, {
items: [this.editor]
});
this._showHint();
if(BI.isNotNull(o.text)){
this.setState(o.text);
}
},
doRedMark: function () {
@ -69815,6 +69842,9 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
items: [this.editor]
});
this._showHint();
if(BI.isNotNull(o.text)){
this.setState(o.text);
}
},
doRedMark: function () {
@ -70441,6 +70471,9 @@ BI.SelectList = BI.inherit(BI.Widget, {
this.toolbar.setVisible(false);
this.toolbar.setEnable(false);
}
if(BI.isNotNull(o.value)){
this.setValue(o.value);
}
},
_checkAllSelected: function () {
@ -76049,7 +76082,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
},
disableSelected: true
},
width: o.triggerWidth || o.height
width: BI.isEmptyString(o.iconCls)? 0 : (o.triggerWidth || o.height)
},
{
el: this.text
@ -79855,7 +79888,8 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
this.popupview = BI.createWidget({
type: "bi.down_list_popup",
items: o.items,
chooseType: o.chooseType
chooseType: o.chooseType,
value: o.value
});
this.popupview.on(BI.DownListPopup.EVENT_CHANGE, function (value) {
@ -79949,7 +79983,8 @@ BI.DownListGroup = BI.inherit(BI.Widget, {
type: "bi.vertical",
hgap: 0,
vgap: 0
}]
}],
value: o.value
});
this.downlistgroup.on(BI.Controller.EVENT_CHANGE, function (type) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -80076,7 +80111,8 @@ BI.shortcut("bi.down_list_item", BI.DownListItem);BI.DownListGroupItem = BI.inhe
type: "bi.icon_button",
cls: o.iconCls1,
width: 25,
forceNotSelected: true
forceNotSelected: true,
selected: this._digest(o.value)
});
this.icon2 = BI.createWidget({
@ -80118,6 +80154,14 @@ BI.shortcut("bi.down_list_item", BI.DownListItem);BI.DownListGroupItem = BI.inhe
});
},
_digest: function (v) {
var self = this, o = this.options;
v = BI.isArray(v) ? v : [v];
return BI.any(v, function (idx, value) {
return BI.contains(o.childValues, value);
});
},
hover: function () {
BI.DownListGroupItem.superclass.hover.apply(this, arguments);
this.icon1.element.addClass("hover");
@ -80147,16 +80191,7 @@ BI.shortcut("bi.down_list_item", BI.DownListItem);BI.DownListGroupItem = BI.inhe
},
setValue: function (v) {
var self = this, o = this.options;
v = BI.isArray(v) ? v : [v];
BI.find(v, function (idx, value) {
if (BI.contains(o.childValues, value)) {
self.icon1.setSelected(true);
return true;
}
self.icon1.setSelected(false);
});
this.icon1.setSelected(this._digest(v));
}
});
BI.DownListGroupItem.EVENT_CHANGE = "EVENT_CHANGE";
@ -80201,6 +80236,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
hgap: this.constants.hgap,
vgap: this.constants.vgap
}],
value: this._digest(o.value),
chooseType: o.chooseType
});
@ -80338,6 +80374,42 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
return fatherValue + "_" + childValue;
},
_digest: function (valueItem) {
var self = this;
var valueArray = [];
BI.each(valueItem, function (i, item) {
var value;
if (BI.isNotNull(item.childValue)) {
value = self._createChildValue(item.value, item.childValue);
} else {
value = item.value;
}
valueArray.push(value);
}
);
return valueArray;
},
_checkValues: function (values) {
var self = this;
var value = [];
BI.each(this.options.items, function (idx, itemGroup) {
BI.each(itemGroup, function (id, item) {
if(BI.isNotNull(item.children)){
var childValues = BI.pluck(item.children, "value");
if(BI.contains(childValues, values[idx])){
value.push(values[idx]);
}
}else{
if(item.value === values[idx]){
value.push(values[idx]);
}
}
})
});
return value;
},
populate: function (items) {
BI.DownListPopup.superclass.populate.apply(this, arguments);
var self = this;
@ -80354,24 +80426,12 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
},
setValue: function (valueItem) {
var self = this;
var valueArray = [];
BI.each(valueItem, function (i, item) {
var value;
if (BI.isNotNull(item.childValue)) {
value = self._createChildValue(item.value, item.childValue);
} else {
value = item.value;
}
valueArray.push(value);
}
);
this.popup.setValue(valueArray);
this.popup.setValue(this._digest(valueItem));
},
getValue: function () {
var self = this, result = [];
var values = this.popup.getValue();
var values = this._checkValues(this.popup.getValue());
BI.each(values, function (i, value) {
var valueItem = {};
if (BI.isNotNull(self.childValueMap[value])) {
@ -85494,7 +85554,7 @@ BI.MultiSelectCheckPane = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
this.storeValue = {};
this.storeValue = opts.value || {};
this.display = BI.createWidget({
type: "bi.display_selected_list",
items: opts.items,
@ -85708,7 +85768,8 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: o.value
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
@ -85817,6 +85878,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
@ -86039,7 +86101,10 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().setState(self.storeValue);
self.trigger.getCounter().setButtonChecked(self.storeValue);
};
this.storeValue = {};
this.storeValue = o.value || {};
this._assertValue(this.storeValue);
// 标记正在请求数据
this.requesting = false;
@ -86064,7 +86129,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: this.storeValue
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
@ -86169,6 +86235,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
@ -86419,6 +86486,9 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = opts.value || {};
this._assertValue(this.storeValue);
this.button_group = BI.createWidget({
type: "bi.select_list",
element: this,
@ -86485,7 +86555,8 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
},
hasNext: function () {
return hasNext;
}
},
value: this.storeValue
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -86584,7 +86655,8 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
type: "bi.multi_select_loader",
itemsCreator: opts.itemsCreator,
valueFormatter: opts.valueFormatter,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value
});
this.popupView = BI.createWidget({
@ -86595,7 +86667,8 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
maxHeight: opts.maxHeight,
element: this,
buttons: [BI.i18nText("BI-Basic_Clears"), BI.i18nText("BI-Basic_Sure")],
el: this.loader
el: this.loader,
value: opts.value
});
this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () {
@ -86690,7 +86763,8 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
popup: {},
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_START, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_START);
@ -86712,7 +86786,8 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
itemsCreator: o.itemsCreator,
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK);
@ -86822,13 +86897,14 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = BI.deepClone(opts.value);
this.button_group = BI.createWidget({
type: "bi.select_list",
element: this,
logic: {
dynamic: false
},
value: opts.value,
el: {
tipText: BI.i18nText("BI-No_Select"),
el: {
@ -86997,7 +87073,8 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, {
callback(res);
self.setKeyword(o.keywordGetter());
}]);
}
},
value: o.value
});
this.loader.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -87074,7 +87151,7 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
_init: function () {
BI.MultiSelectCheckSelectedButton.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
this.numberCounter = BI.createWidget({
type: "bi.text_button",
element: this,
@ -87098,6 +87175,9 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
self.numberCounter.setText(self.numberCounter.getTag());
});
this.setVisible(false);
if(BI.isNotNull(o.value)){
this.setValue(o.value);
}
},
setValue: function (ob) {
@ -87156,7 +87236,8 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true
allowBlank: true,
value: o.value
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
@ -87259,7 +87340,8 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
op.keyword = self.editor.getValue();
this.setKeyword(op.keyword);
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -87284,6 +87366,9 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
var keywords = this.getKeywords();
self.fireEvent(BI.MultiSelectSearcher.EVENT_SEARCHING, keywords);
});
if(BI.isNotNull(o.value)){
this.setState(o.value);
}
},
adjustView: function () {
@ -87403,7 +87488,8 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
this.button = BI.createWidget(o.el, {
type: "bi.multi_select_check_selected_button",
itemsCreator: o.itemsCreator
itemsCreator: o.itemsCreator,
value: o.value
});
this.button.on(BI.Events.VIEW, function () {
self.fireEvent(BI.Events.VIEW, arguments);
@ -87419,7 +87505,8 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
itemsCreator: o.itemsCreator,
onClickContinueSelect: function () {
self.switcher.hideView();
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
masker: o.masker
@ -88425,7 +88512,8 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
itemsCreator: function (op, callback) {
op.type = BI.TreeView.REQ_TYPE_GET_SELECTED_DATA;
opts.itemsCreator(op, callback);
}
},
value: (opts.value || {}).value
});
this.display.on(BI.Events.AFTERINIT, function () {
@ -88508,6 +88596,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
var isInit = false;
var want2showCounter = false;
this.storeValue = {value: o.value || {}};
this.trigger = BI.createWidget({
type: "bi.multi_select_trigger",
height: o.height,
@ -88527,7 +88617,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
type: "bi.multi_tree_check_pane",
itemsCreator: o.itemsCreator
}
}
},
value: {value: o.value || {}}
});
@ -88583,12 +88674,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
});
}
},
value: {value: o.value || {}},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
});
this.storeValue = {value: {}};
var change = false;
var clear = false; // 标识当前是否点击了清空
@ -88765,7 +88856,8 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, {
height: 400,
cls: "popup-view-tree",
itemsCreator: opts.itemsCreator,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value || {}
});
this.popupView = BI.createWidget({
@ -88861,7 +88953,8 @@ BI.MultiTreeSearchPane = BI.inherit(BI.Pane, {
itemsCreator: function (op, callback) {
op.keyword = opts.keywordGetter();
opts.itemsCreator(op, callback);
}
},
value: opts.value
});
this.partTree.on(BI.Controller.EVENT_CHANGE, function () {
@ -89025,7 +89118,8 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) {
op.keyword = self.editor.getValue();
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -89046,6 +89140,9 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
this.searcher.on(BI.Searcher.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiTreeSearcher.EVENT_CHANGE, arguments);
});
if (BI.isNotNull(o.value)) {
this.setState(o.value);
}
},
adjustView: function () {
@ -97644,7 +97741,11 @@ BI.AllValueChooserCombo = BI.inherit(BI.AbstractAllValueChooser, {
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height
height: o.height,
value: {
type: BI.Selection.Multi,
value: o.value || []
}
});
this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () {

62
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

63
dist/case.js vendored

@ -5157,7 +5157,8 @@ BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText
errorText: o.errorText,
value: o.value
});
this.trigger.on(BI.EditorTrigger.EVENT_CHANGE, function () {
self.popup.setValue(this.getValue());
@ -5166,7 +5167,8 @@ BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
this.popup = BI.createWidget({
type: "bi.text_value_check_combo_popup",
chooseType: o.chooseType,
items: o.items
items: o.items,
value: o.value
});
this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
@ -5674,12 +5676,15 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height
height: o.height,
text: o.text,
value: o.value
});
this.popup = BI.createWidget({
type: "bi.text_value_check_combo_popup",
chooseType: o.chooseType,
items: o.items
items: o.items,
value: o.value
});
this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
@ -5749,12 +5754,14 @@ BI.SmallTextValueCheckCombo = BI.inherit(BI.Widget, {
type: "bi.small_select_text_trigger",
items: o.items,
height: o.height,
text: o.text
text: o.text,
value: o.value
});
this.popup = BI.createWidget({
type: "bi.text_value_check_combo_popup",
chooseType: o.chooseType,
items: o.items
items: o.items,
value: o.value
});
this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
@ -5807,7 +5814,8 @@ BI.shortcut("bi.small_text_value_check_combo", BI.SmallTextValueCheckCombo);BI.T
chooseType: o.chooseType,
layouts: [{
type: "bi.vertical"
}]
}],
value: o.value
});
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {
@ -5861,6 +5869,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
baseClass: "bi-text-value-combo",
height: 30,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: "",
value: "",
el: {}
});
@ -5873,11 +5882,13 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
type: "bi.select_text_trigger",
items: o.items,
height: o.height,
text: o.value
text: o.text,
value: o.value
});
this.popup = BI.createWidget({
type: "bi.text_value_combo_popup",
chooseType: o.chooseType,
value: o.value,
items: o.items
});
this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE, function () {
@ -5898,9 +5909,6 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
maxHeight: 300
}
});
if (BI.isKey(o.value)) {
this.setValue(o.value);
}
},
setValue: function (v) {
@ -6058,10 +6066,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 +6085,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 +6114,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 +6161,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 +6183,7 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, {
},
setValue: function (vals) {
this.trigger.setValue(vals);
this.trigger.setValue(vals.childValue || vals.value);
},
populate: function (items) {
@ -7251,6 +7271,9 @@ BI.StateEditor = BI.inherit(BI.Widget, {
items: [this.editor]
});
this._showHint();
if(BI.isNotNull(o.text)){
this.setState(o.text);
}
},
doRedMark: function () {
@ -7525,6 +7548,9 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
items: [this.editor]
});
this._showHint();
if(BI.isNotNull(o.text)){
this.setState(o.text);
}
},
doRedMark: function () {
@ -8151,6 +8177,9 @@ BI.SelectList = BI.inherit(BI.Widget, {
this.toolbar.setVisible(false);
this.toolbar.setEnable(false);
}
if(BI.isNotNull(o.value)){
this.setValue(o.value);
}
},
_checkAllSelected: function () {
@ -13759,7 +13788,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
},
disableSelected: true
},
width: o.triggerWidth || o.height
width: BI.isEmptyString(o.iconCls)? 0 : (o.triggerWidth || o.height)
},
{
el: this.text

378
dist/demo.js vendored

@ -1756,14 +1756,18 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
baseCls: ""
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.editor_icon_check_combo",
ref: function () {
self.combo = this;
},
watermark: "默认值",
width: 200,
height: 30,
value: 2,
items: [{
// text: "MVC-1",
value: "1"
@ -1774,6 +1778,14 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
// text: "MVC-3",
value: "3"
}]
}, {
type: "bi.button",
width: 90,
height: 25,
text: "setValue为空",
handler: function () {
self.combo.setValue()
}
}],
vgap: 20
};
@ -1905,12 +1917,16 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
baseCls: ""
},
render: function () {
var combo;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.text_value_combo",
value: "默认值",
ref: function () {
combo = this;
},
text: "默认值",
value: 2,
width: 300,
items: [{
text: "MVC-1",
@ -1925,6 +1941,13 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
iconCls: "pull-right-font",
value: 3
}]
}, {
type: "bi.button",
width: 90,
height: 25,
handler: function () {
combo.setValue("");
}
}],
vgap: 20
};
@ -1949,6 +1972,8 @@ Demo.TextValueDownListCombo = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.refs = _ref;
},
text: "默认值",
value: 11,
items: [
[{
el: {
@ -1968,13 +1993,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);
}
});
@ -1992,6 +2020,7 @@ Demo.TextValueCheckCombo = BI.inherit(BI.Widget, {
items: [{
type: "bi.text_value_check_combo",
text: "默认值",
value: 1,
width: 300,
items: [{
text: "MVC-1",
@ -12297,7 +12326,148 @@ Demo.CustomDateTime = BI.inherit(BI.Widget, {
};
}
});
BI.shortcut("demo.date_time", Demo.CustomDateTime);Demo.Downlist = BI.inherit(BI.Widget, {
BI.shortcut("demo.date_time", Demo.CustomDateTime);BICst.CONF = {};
BICst.CONF.GROUP = {};
BICst.CONF.GROUP.NUMBER = {};
BICst.CONF.GROUP.NUMBER = {};
BICst.CONF.GROUP.NUMBER.GROUP_BY_VALUE = 1;
BICst.CONF.GROUP.NUMBER.CUSTOM_NUMBER_GROUP = 2;
BICst.CONF.GROUP.NUMBER.SUM = 3;
BICst.CONF.GROUP.NUMBER.AVG = 4;
BICst.CONF.GROUP.NUMBER.MEDIAN = 5;
BICst.CONF.GROUP.NUMBER.MAX = 6;
BICst.CONF.GROUP.NUMBER.MIN = 7;
BICst.CONF.GROUP.NUMBER.STANDARD_DEVIATION = 8;
BICst.CONF.GROUP.NUMBER.VARIANCE = 9;
BICst.CONF.GROUP.NUMBER.COUNT = 10;
BICst.CONF.GROUP.NUMBER.RECORD_COUNT = 11;
BICst.CONF.GROUP.NUMBER.NONE = 12;
BICst.CONF.GROUP.NUMBER.PERIOD = 13;
BICst.CONF.GROUP.NUMBER.RING = 14;
BICst.CONF.GROUP.NUMBER.PERIOD_RATE = 15;
BICst.CONF.GROUP.NUMBER.RING_RATE = 16;
BICst.CONF.GROUP.NUMBER.YEAR = 17;
BICst.CONF.GROUP.NUMBER.QUARTER = 18;
BICst.CONF.GROUP.NUMBER.MONTH = 19;
BICst.CONF.GROUP.NUMBER.WEEK = 20;
BICst.CONF.GROUP.NUMBER.WEEKDAY = 21;
BICst.CONF.GROUP.NUMBER.RENAME = 22;
BICst.CONF.GROUP.NUMBER.DELETE = 23;
// 数值字段汇总设置
var items = [[{
text: BI.i18nText("BI-Basic_Qiu_Sum"),
value: BICst.CONF.GROUP.NUMBER.SUM,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Avg"),
value: BICst.CONF.GROUP.NUMBER.AVG,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Median"),
value: BICst.CONF.GROUP.NUMBER.MEDIAN,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Max"),
value: BICst.CONF.GROUP.NUMBER.MAX,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Min"),
value: BICst.CONF.GROUP.NUMBER.MIN,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Standard_Deviation"),
value: BICst.CONF.GROUP.NUMBER.STANDARD_DEVIATION,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Qiu_Variance"),
value: BICst.CONF.GROUP.NUMBER.VARIANCE,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_No_Repeat_Count"),
value: BICst.CONF.GROUP.NUMBER.COUNT,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Record_Count"),
value: BICst.CONF.GROUP.NUMBER.RECORD_COUNT,
cls: "dot-ha-font"
}], [{
text: BI.i18nText("BI-Basic_None"),
value: BICst.CONF.GROUP.NUMBER.NONE,
cls: "dot-ha-font"
}, {
el: {
text: BI.i18nText("BI-Basic_Qiu_Same_Period"),
value: BICst.CONF.GROUP.NUMBER.PERIOD,
cls: "dot-ha-font"
},
children: [{
text: BI.i18nText("BI-Basic_Multi_Date_Year"),
value: BICst.CONF.GROUP.NUMBER.YEAR,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Quarter"),
value: BICst.CONF.GROUP.NUMBER.QUARTER,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Month"),
value: BICst.CONF.GROUP.NUMBER.MONTH,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Week"),
value: BICst.CONF.GROUP.NUMBER.WEEK,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Week_XingQi"),
value: BICst.CONF.GROUP.NUMBER.WEEKDAY,
cls: "dot-ha-font"
}]
}, {
text: BI.i18nText("BI-Basic_Qiu_Same_Ring"),
value: BICst.CONF.GROUP.NUMBER.RING,
cls: "dot-ha-font"
}, {
el: {
text: BI.i18nText("BI-Basic_Qiu_Same_Period_Rate"),
value: BICst.CONF.GROUP.NUMBER.PERIOD_RATE,
cls: "dot-ha-font"
},
children: [{
text: BI.i18nText("BI-Basic_Multi_Date_Year"),
value: BICst.CONF.GROUP.NUMBER.YEAR,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Quarter"),
value: BICst.CONF.GROUP.NUMBER.QUARTER,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Month"),
value: BICst.CONF.GROUP.NUMBER.MONTH,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Multi_Date_Week"),
value: BICst.CONF.GROUP.NUMBER.WEEK,
cls: "dot-ha-font"
}, {
text: BI.i18nText("BI-Basic_Week_XingQi"),
value: BICst.CONF.GROUP.NUMBER.WEEKDAY,
cls: "dot-ha-font"
}]
}, {
text: BI.i18nText("BI-Basic_Qiu_Same_Ring_Rate"),
value: BICst.CONF.GROUP.NUMBER.RING_RATE,
cls: "dot-ha-font"
}], [{
text: BI.i18nText("BI-Basic_Rename"),
value: BICst.CONF.GROUP.NUMBER.RENAME,
cls: "widget-combo-rename-edit-font"
}], [{
text: BI.i18nText("BI-Basic_Remove"),
value: BICst.CONF.GROUP.NUMBER.DELETE,
cls: "delete-h-font"
}]];
Demo.Downlist = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-downlist"
},
@ -12325,99 +12495,98 @@ BI.shortcut("demo.date_time", Demo.CustomDateTime);Demo.Downlist = BI.inherit(BI
self.downlist = _ref;
},
cls: "layout-bg3",
//value: [{"childValue":22,"value":11},{"value":18},{"value":20}],
height: 30,
width: 100,
items: [
[{
el: {
text: "column 1111",
iconCls1: "check-mark-e-font",
value: 11
},
children: [{
text: "column 1.1",
value: 21,
cls: "dot-e-font",
selected: true
}, {
text: "column 1.222222222222222222222222222222222222",
cls: "dot-e-font",
value: 22
}]
}],
[{
el: {
type: "bi.icon_text_icon_item",
text: "column 2",
iconCls1: "chart-type-e-font",
cls: "dot-e-font",
value: 12
},
disabled: true,
children: [{
type: "bi.icon_text_item",
cls: "dot-e-font",
height: 25,
text: "column 2.1",
value: 11
}, {
text: "column 2.2",
value: 12,
cls: "dot-e-font"
}]
}],
[{
text: "column 8",
value: 18,
cls: "dot-e-font",
selected: true
},
{
text: "column 9",
cls: "dot-e-font",
value: 19
}
],
[{
text: "column 10",
value: 20,
cls: "dot-e-font",
selected: true
},
{
text: "column 11",
cls: "dot-e-font",
value: 21
},
{
text: "column 12",
cls: "dot-e-font",
value: 22
},
{
text: "column 13",
cls: "dot-e-font",
value: 23
},
{
text: "column 14",
cls: "dot-e-font",
value: 24
},
{
text: "column 15",
cls: "dot-e-font",
value: 23
}
]
]
items: items
// items: [
// [{
// el: {
// text: "column 1111",
// iconCls1: "check-mark-e-font",
// value: 11
// },
// children: [{
// text: "column 1.1",
// value: 21,
// cls: "dot-e-font"
// }, {
// text: "column 1.222222222222222222222222222222222222",
// cls: "dot-e-font",
// value: 22
// }]
// }],
// [{
// el: {
// type: "bi.icon_text_icon_item",
// text: "column 2",
// iconCls1: "chart-type-e-font",
// cls: "dot-e-font",
// value: 12
// },
// disabled: true,
// children: [{
// type: "bi.icon_text_item",
// cls: "dot-e-font",
// height: 25,
// text: "column 2.1",
// value: 11
// }, {
// text: "column 2.2",
// value: 12,
// cls: "dot-e-font"
// }]
// }],
// [{
// text: "column 8",
// value: 18,
// cls: "dot-e-font"
// },
// {
//
// text: "column 9",
// cls: "dot-e-font",
// value: 19
// }
// ],
// [{
// text: "column 10",
// value: 20,
// cls: "dot-e-font"
// },
// {
//
// text: "column 11",
// cls: "dot-e-font",
// value: 21
// },
// {
//
// text: "column 12",
// cls: "dot-e-font",
// value: 22
// },
// {
//
// text: "column 13",
// cls: "dot-e-font",
// value: 23
// },
// {
//
// text: "column 14",
// cls: "dot-e-font",
// value: 24
// },
// {
//
// text: "column 15",
// cls: "dot-e-font",
// value: 23
// }
// ]
//
// ]
}, {
type: "bi.label",
text: "显示选择值",
@ -12594,7 +12763,11 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
var widget = BI.createWidget({
type: "bi.multi_select_combo",
itemsCreator: BI.bind(this._itemsCreator, this),
width: 200
width: 200,
value: {
type: 1,
value: ["柳州市城贸金属材料有限责任公司", "柳州市建福房屋租赁有限公司", "柳州市迅昌数码办公设备有限责任公司"]
}
});
widget.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () {
@ -12700,7 +12873,10 @@ Demo.MultiTreeCombo = BI.inherit(BI.Widget, {
items: items
});
},
width: 300
width: 300,
value: {
"根目录": {}
}
}, {
type: "bi.button",
text: "getValue",

241
dist/fineui.js vendored

@ -29102,6 +29102,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
_init: function () {
BI.TreeView.superclass._init.apply(this, arguments);
var o = this.options;
this._stop = false;
this._createTree();
@ -29117,7 +29118,9 @@ BI.TreeView = BI.inherit(BI.Pane, {
element: this,
items: [this.tip]
});
if(BI.isNotNull(o.value)){
this.setSelectedValue(o.value);
}
},
_createTree: function () {
@ -43005,7 +43008,8 @@ BI.PopupView = BI.inherit(BI.Widget, {
type: "bi.center",
cls: "list-view-tab",
height: 25,
items: o.tabs
items: o.tabs,
value: o.value
});
},
@ -69141,7 +69145,8 @@ BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText
errorText: o.errorText,
value: o.value
});
this.trigger.on(BI.EditorTrigger.EVENT_CHANGE, function () {
self.popup.setValue(this.getValue());
@ -69150,7 +69155,8 @@ BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
this.popup = BI.createWidget({
type: "bi.text_value_check_combo_popup",
chooseType: o.chooseType,
items: o.items
items: o.items,
value: o.value
});
this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
@ -69658,12 +69664,15 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height
height: o.height,
text: o.text,
value: o.value
});
this.popup = BI.createWidget({
type: "bi.text_value_check_combo_popup",
chooseType: o.chooseType,
items: o.items
items: o.items,
value: o.value
});
this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
@ -69733,12 +69742,14 @@ BI.SmallTextValueCheckCombo = BI.inherit(BI.Widget, {
type: "bi.small_select_text_trigger",
items: o.items,
height: o.height,
text: o.text
text: o.text,
value: o.value
});
this.popup = BI.createWidget({
type: "bi.text_value_check_combo_popup",
chooseType: o.chooseType,
items: o.items
items: o.items,
value: o.value
});
this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
@ -69791,7 +69802,8 @@ BI.shortcut("bi.small_text_value_check_combo", BI.SmallTextValueCheckCombo);BI.T
chooseType: o.chooseType,
layouts: [{
type: "bi.vertical"
}]
}],
value: o.value
});
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {
@ -69845,6 +69857,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
baseClass: "bi-text-value-combo",
height: 30,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: "",
value: "",
el: {}
});
@ -69857,11 +69870,13 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
type: "bi.select_text_trigger",
items: o.items,
height: o.height,
text: o.value
text: o.text,
value: o.value
});
this.popup = BI.createWidget({
type: "bi.text_value_combo_popup",
chooseType: o.chooseType,
value: o.value,
items: o.items
});
this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE, function () {
@ -69882,9 +69897,6 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
maxHeight: 300
}
});
if (BI.isKey(o.value)) {
this.setValue(o.value);
}
},
setValue: function (v) {
@ -70042,10 +70054,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 +70073,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 +70102,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 +70149,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 +70171,7 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, {
},
setValue: function (vals) {
this.trigger.setValue(vals);
this.trigger.setValue(vals.childValue || vals.value);
},
populate: function (items) {
@ -71235,6 +71259,9 @@ BI.StateEditor = BI.inherit(BI.Widget, {
items: [this.editor]
});
this._showHint();
if(BI.isNotNull(o.text)){
this.setState(o.text);
}
},
doRedMark: function () {
@ -71509,6 +71536,9 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
items: [this.editor]
});
this._showHint();
if(BI.isNotNull(o.text)){
this.setState(o.text);
}
},
doRedMark: function () {
@ -72135,6 +72165,9 @@ BI.SelectList = BI.inherit(BI.Widget, {
this.toolbar.setVisible(false);
this.toolbar.setEnable(false);
}
if(BI.isNotNull(o.value)){
this.setValue(o.value);
}
},
_checkAllSelected: function () {
@ -77743,7 +77776,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
},
disableSelected: true
},
width: o.triggerWidth || o.height
width: BI.isEmptyString(o.iconCls)? 0 : (o.triggerWidth || o.height)
},
{
el: this.text
@ -81549,7 +81582,8 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
this.popupview = BI.createWidget({
type: "bi.down_list_popup",
items: o.items,
chooseType: o.chooseType
chooseType: o.chooseType,
value: o.value
});
this.popupview.on(BI.DownListPopup.EVENT_CHANGE, function (value) {
@ -81643,7 +81677,8 @@ BI.DownListGroup = BI.inherit(BI.Widget, {
type: "bi.vertical",
hgap: 0,
vgap: 0
}]
}],
value: o.value
});
this.downlistgroup.on(BI.Controller.EVENT_CHANGE, function (type) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -81770,7 +81805,8 @@ BI.shortcut("bi.down_list_item", BI.DownListItem);BI.DownListGroupItem = BI.inhe
type: "bi.icon_button",
cls: o.iconCls1,
width: 25,
forceNotSelected: true
forceNotSelected: true,
selected: this._digest(o.value)
});
this.icon2 = BI.createWidget({
@ -81812,6 +81848,14 @@ BI.shortcut("bi.down_list_item", BI.DownListItem);BI.DownListGroupItem = BI.inhe
});
},
_digest: function (v) {
var self = this, o = this.options;
v = BI.isArray(v) ? v : [v];
return BI.any(v, function (idx, value) {
return BI.contains(o.childValues, value);
});
},
hover: function () {
BI.DownListGroupItem.superclass.hover.apply(this, arguments);
this.icon1.element.addClass("hover");
@ -81841,16 +81885,7 @@ BI.shortcut("bi.down_list_item", BI.DownListItem);BI.DownListGroupItem = BI.inhe
},
setValue: function (v) {
var self = this, o = this.options;
v = BI.isArray(v) ? v : [v];
BI.find(v, function (idx, value) {
if (BI.contains(o.childValues, value)) {
self.icon1.setSelected(true);
return true;
}
self.icon1.setSelected(false);
});
this.icon1.setSelected(this._digest(v));
}
});
BI.DownListGroupItem.EVENT_CHANGE = "EVENT_CHANGE";
@ -81895,6 +81930,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
hgap: this.constants.hgap,
vgap: this.constants.vgap
}],
value: this._digest(o.value),
chooseType: o.chooseType
});
@ -82032,6 +82068,42 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
return fatherValue + "_" + childValue;
},
_digest: function (valueItem) {
var self = this;
var valueArray = [];
BI.each(valueItem, function (i, item) {
var value;
if (BI.isNotNull(item.childValue)) {
value = self._createChildValue(item.value, item.childValue);
} else {
value = item.value;
}
valueArray.push(value);
}
);
return valueArray;
},
_checkValues: function (values) {
var self = this;
var value = [];
BI.each(this.options.items, function (idx, itemGroup) {
BI.each(itemGroup, function (id, item) {
if(BI.isNotNull(item.children)){
var childValues = BI.pluck(item.children, "value");
if(BI.contains(childValues, values[idx])){
value.push(values[idx]);
}
}else{
if(item.value === values[idx]){
value.push(values[idx]);
}
}
})
});
return value;
},
populate: function (items) {
BI.DownListPopup.superclass.populate.apply(this, arguments);
var self = this;
@ -82048,24 +82120,12 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
},
setValue: function (valueItem) {
var self = this;
var valueArray = [];
BI.each(valueItem, function (i, item) {
var value;
if (BI.isNotNull(item.childValue)) {
value = self._createChildValue(item.value, item.childValue);
} else {
value = item.value;
}
valueArray.push(value);
}
);
this.popup.setValue(valueArray);
this.popup.setValue(this._digest(valueItem));
},
getValue: function () {
var self = this, result = [];
var values = this.popup.getValue();
var values = this._checkValues(this.popup.getValue());
BI.each(values, function (i, value) {
var valueItem = {};
if (BI.isNotNull(self.childValueMap[value])) {
@ -87188,7 +87248,7 @@ BI.MultiSelectCheckPane = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
this.storeValue = {};
this.storeValue = opts.value || {};
this.display = BI.createWidget({
type: "bi.display_selected_list",
items: opts.items,
@ -87402,7 +87462,8 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: o.value
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
@ -87511,6 +87572,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
@ -87733,7 +87795,10 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().setState(self.storeValue);
self.trigger.getCounter().setButtonChecked(self.storeValue);
};
this.storeValue = {};
this.storeValue = o.value || {};
this._assertValue(this.storeValue);
// 标记正在请求数据
this.requesting = false;
@ -87758,7 +87823,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: this.storeValue
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
@ -87863,6 +87929,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
@ -88113,6 +88180,9 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = opts.value || {};
this._assertValue(this.storeValue);
this.button_group = BI.createWidget({
type: "bi.select_list",
element: this,
@ -88179,7 +88249,8 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
},
hasNext: function () {
return hasNext;
}
},
value: this.storeValue
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -88278,7 +88349,8 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
type: "bi.multi_select_loader",
itemsCreator: opts.itemsCreator,
valueFormatter: opts.valueFormatter,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value
});
this.popupView = BI.createWidget({
@ -88289,7 +88361,8 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
maxHeight: opts.maxHeight,
element: this,
buttons: [BI.i18nText("BI-Basic_Clears"), BI.i18nText("BI-Basic_Sure")],
el: this.loader
el: this.loader,
value: opts.value
});
this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () {
@ -88384,7 +88457,8 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
popup: {},
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_START, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_START);
@ -88406,7 +88480,8 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
itemsCreator: o.itemsCreator,
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK);
@ -88516,13 +88591,14 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = BI.deepClone(opts.value);
this.button_group = BI.createWidget({
type: "bi.select_list",
element: this,
logic: {
dynamic: false
},
value: opts.value,
el: {
tipText: BI.i18nText("BI-No_Select"),
el: {
@ -88691,7 +88767,8 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, {
callback(res);
self.setKeyword(o.keywordGetter());
}]);
}
},
value: o.value
});
this.loader.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -88768,7 +88845,7 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
_init: function () {
BI.MultiSelectCheckSelectedButton.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
this.numberCounter = BI.createWidget({
type: "bi.text_button",
element: this,
@ -88792,6 +88869,9 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
self.numberCounter.setText(self.numberCounter.getTag());
});
this.setVisible(false);
if(BI.isNotNull(o.value)){
this.setValue(o.value);
}
},
setValue: function (ob) {
@ -88850,7 +88930,8 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true
allowBlank: true,
value: o.value
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
@ -88953,7 +89034,8 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
op.keyword = self.editor.getValue();
this.setKeyword(op.keyword);
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -88978,6 +89060,9 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
var keywords = this.getKeywords();
self.fireEvent(BI.MultiSelectSearcher.EVENT_SEARCHING, keywords);
});
if(BI.isNotNull(o.value)){
this.setState(o.value);
}
},
adjustView: function () {
@ -89097,7 +89182,8 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
this.button = BI.createWidget(o.el, {
type: "bi.multi_select_check_selected_button",
itemsCreator: o.itemsCreator
itemsCreator: o.itemsCreator,
value: o.value
});
this.button.on(BI.Events.VIEW, function () {
self.fireEvent(BI.Events.VIEW, arguments);
@ -89113,7 +89199,8 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
itemsCreator: o.itemsCreator,
onClickContinueSelect: function () {
self.switcher.hideView();
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
masker: o.masker
@ -90119,7 +90206,8 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
itemsCreator: function (op, callback) {
op.type = BI.TreeView.REQ_TYPE_GET_SELECTED_DATA;
opts.itemsCreator(op, callback);
}
},
value: (opts.value || {}).value
});
this.display.on(BI.Events.AFTERINIT, function () {
@ -90202,6 +90290,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
var isInit = false;
var want2showCounter = false;
this.storeValue = {value: o.value || {}};
this.trigger = BI.createWidget({
type: "bi.multi_select_trigger",
height: o.height,
@ -90221,7 +90311,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
type: "bi.multi_tree_check_pane",
itemsCreator: o.itemsCreator
}
}
},
value: {value: o.value || {}}
});
@ -90277,12 +90368,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
});
}
},
value: {value: o.value || {}},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
});
this.storeValue = {value: {}};
var change = false;
var clear = false; // 标识当前是否点击了清空
@ -90459,7 +90550,8 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, {
height: 400,
cls: "popup-view-tree",
itemsCreator: opts.itemsCreator,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value || {}
});
this.popupView = BI.createWidget({
@ -90555,7 +90647,8 @@ BI.MultiTreeSearchPane = BI.inherit(BI.Pane, {
itemsCreator: function (op, callback) {
op.keyword = opts.keywordGetter();
opts.itemsCreator(op, callback);
}
},
value: opts.value
});
this.partTree.on(BI.Controller.EVENT_CHANGE, function () {
@ -90719,7 +90812,8 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) {
op.keyword = self.editor.getValue();
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -90740,6 +90834,9 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
this.searcher.on(BI.Searcher.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiTreeSearcher.EVENT_CHANGE, arguments);
});
if (BI.isNotNull(o.value)) {
this.setState(o.value);
}
},
adjustView: function () {
@ -99338,7 +99435,11 @@ BI.AllValueChooserCombo = BI.inherit(BI.AbstractAllValueChooser, {
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height
height: o.height,
value: {
type: BI.Selection.Multi,
value: o.value || []
}
});
this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () {

48
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

170
dist/widget.js vendored

@ -3474,7 +3474,8 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
this.popupview = BI.createWidget({
type: "bi.down_list_popup",
items: o.items,
chooseType: o.chooseType
chooseType: o.chooseType,
value: o.value
});
this.popupview.on(BI.DownListPopup.EVENT_CHANGE, function (value) {
@ -3568,7 +3569,8 @@ BI.DownListGroup = BI.inherit(BI.Widget, {
type: "bi.vertical",
hgap: 0,
vgap: 0
}]
}],
value: o.value
});
this.downlistgroup.on(BI.Controller.EVENT_CHANGE, function (type) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -3695,7 +3697,8 @@ BI.shortcut("bi.down_list_item", BI.DownListItem);BI.DownListGroupItem = BI.inhe
type: "bi.icon_button",
cls: o.iconCls1,
width: 25,
forceNotSelected: true
forceNotSelected: true,
selected: this._digest(o.value)
});
this.icon2 = BI.createWidget({
@ -3737,6 +3740,14 @@ BI.shortcut("bi.down_list_item", BI.DownListItem);BI.DownListGroupItem = BI.inhe
});
},
_digest: function (v) {
var self = this, o = this.options;
v = BI.isArray(v) ? v : [v];
return BI.any(v, function (idx, value) {
return BI.contains(o.childValues, value);
});
},
hover: function () {
BI.DownListGroupItem.superclass.hover.apply(this, arguments);
this.icon1.element.addClass("hover");
@ -3766,16 +3777,7 @@ BI.shortcut("bi.down_list_item", BI.DownListItem);BI.DownListGroupItem = BI.inhe
},
setValue: function (v) {
var self = this, o = this.options;
v = BI.isArray(v) ? v : [v];
BI.find(v, function (idx, value) {
if (BI.contains(o.childValues, value)) {
self.icon1.setSelected(true);
return true;
}
self.icon1.setSelected(false);
});
this.icon1.setSelected(this._digest(v));
}
});
BI.DownListGroupItem.EVENT_CHANGE = "EVENT_CHANGE";
@ -3820,6 +3822,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
hgap: this.constants.hgap,
vgap: this.constants.vgap
}],
value: this._digest(o.value),
chooseType: o.chooseType
});
@ -3957,6 +3960,42 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
return fatherValue + "_" + childValue;
},
_digest: function (valueItem) {
var self = this;
var valueArray = [];
BI.each(valueItem, function (i, item) {
var value;
if (BI.isNotNull(item.childValue)) {
value = self._createChildValue(item.value, item.childValue);
} else {
value = item.value;
}
valueArray.push(value);
}
);
return valueArray;
},
_checkValues: function (values) {
var self = this;
var value = [];
BI.each(this.options.items, function (idx, itemGroup) {
BI.each(itemGroup, function (id, item) {
if(BI.isNotNull(item.children)){
var childValues = BI.pluck(item.children, "value");
if(BI.contains(childValues, values[idx])){
value.push(values[idx]);
}
}else{
if(item.value === values[idx]){
value.push(values[idx]);
}
}
})
});
return value;
},
populate: function (items) {
BI.DownListPopup.superclass.populate.apply(this, arguments);
var self = this;
@ -3973,24 +4012,12 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
},
setValue: function (valueItem) {
var self = this;
var valueArray = [];
BI.each(valueItem, function (i, item) {
var value;
if (BI.isNotNull(item.childValue)) {
value = self._createChildValue(item.value, item.childValue);
} else {
value = item.value;
}
valueArray.push(value);
}
);
this.popup.setValue(valueArray);
this.popup.setValue(this._digest(valueItem));
},
getValue: function () {
var self = this, result = [];
var values = this.popup.getValue();
var values = this._checkValues(this.popup.getValue());
BI.each(values, function (i, value) {
var valueItem = {};
if (BI.isNotNull(self.childValueMap[value])) {
@ -9113,7 +9140,7 @@ BI.MultiSelectCheckPane = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
this.storeValue = {};
this.storeValue = opts.value || {};
this.display = BI.createWidget({
type: "bi.display_selected_list",
items: opts.items,
@ -9327,7 +9354,8 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: o.value
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
@ -9436,6 +9464,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
@ -9658,7 +9687,10 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().setState(self.storeValue);
self.trigger.getCounter().setButtonChecked(self.storeValue);
};
this.storeValue = {};
this.storeValue = o.value || {};
this._assertValue(this.storeValue);
// 标记正在请求数据
this.requesting = false;
@ -9683,7 +9715,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: this.storeValue
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
@ -9788,6 +9821,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
@ -10038,6 +10072,9 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = opts.value || {};
this._assertValue(this.storeValue);
this.button_group = BI.createWidget({
type: "bi.select_list",
element: this,
@ -10104,7 +10141,8 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
},
hasNext: function () {
return hasNext;
}
},
value: this.storeValue
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -10203,7 +10241,8 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
type: "bi.multi_select_loader",
itemsCreator: opts.itemsCreator,
valueFormatter: opts.valueFormatter,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value
});
this.popupView = BI.createWidget({
@ -10214,7 +10253,8 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
maxHeight: opts.maxHeight,
element: this,
buttons: [BI.i18nText("BI-Basic_Clears"), BI.i18nText("BI-Basic_Sure")],
el: this.loader
el: this.loader,
value: opts.value
});
this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () {
@ -10309,7 +10349,8 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
popup: {},
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_START, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_START);
@ -10331,7 +10372,8 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
itemsCreator: o.itemsCreator,
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK);
@ -10441,13 +10483,14 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = BI.deepClone(opts.value);
this.button_group = BI.createWidget({
type: "bi.select_list",
element: this,
logic: {
dynamic: false
},
value: opts.value,
el: {
tipText: BI.i18nText("BI-No_Select"),
el: {
@ -10616,7 +10659,8 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, {
callback(res);
self.setKeyword(o.keywordGetter());
}]);
}
},
value: o.value
});
this.loader.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -10693,7 +10737,7 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
_init: function () {
BI.MultiSelectCheckSelectedButton.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
this.numberCounter = BI.createWidget({
type: "bi.text_button",
element: this,
@ -10717,6 +10761,9 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
self.numberCounter.setText(self.numberCounter.getTag());
});
this.setVisible(false);
if(BI.isNotNull(o.value)){
this.setValue(o.value);
}
},
setValue: function (ob) {
@ -10775,7 +10822,8 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true
allowBlank: true,
value: o.value
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
@ -10878,7 +10926,8 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
op.keyword = self.editor.getValue();
this.setKeyword(op.keyword);
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -10903,6 +10952,9 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
var keywords = this.getKeywords();
self.fireEvent(BI.MultiSelectSearcher.EVENT_SEARCHING, keywords);
});
if(BI.isNotNull(o.value)){
this.setState(o.value);
}
},
adjustView: function () {
@ -11022,7 +11074,8 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
this.button = BI.createWidget(o.el, {
type: "bi.multi_select_check_selected_button",
itemsCreator: o.itemsCreator
itemsCreator: o.itemsCreator,
value: o.value
});
this.button.on(BI.Events.VIEW, function () {
self.fireEvent(BI.Events.VIEW, arguments);
@ -11038,7 +11091,8 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
itemsCreator: o.itemsCreator,
onClickContinueSelect: function () {
self.switcher.hideView();
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
masker: o.masker
@ -12044,7 +12098,8 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
itemsCreator: function (op, callback) {
op.type = BI.TreeView.REQ_TYPE_GET_SELECTED_DATA;
opts.itemsCreator(op, callback);
}
},
value: (opts.value || {}).value
});
this.display.on(BI.Events.AFTERINIT, function () {
@ -12127,6 +12182,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
var isInit = false;
var want2showCounter = false;
this.storeValue = {value: o.value || {}};
this.trigger = BI.createWidget({
type: "bi.multi_select_trigger",
height: o.height,
@ -12146,7 +12203,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
type: "bi.multi_tree_check_pane",
itemsCreator: o.itemsCreator
}
}
},
value: {value: o.value || {}}
});
@ -12202,12 +12260,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
});
}
},
value: {value: o.value || {}},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
});
this.storeValue = {value: {}};
var change = false;
var clear = false; // 标识当前是否点击了清空
@ -12384,7 +12442,8 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, {
height: 400,
cls: "popup-view-tree",
itemsCreator: opts.itemsCreator,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value || {}
});
this.popupView = BI.createWidget({
@ -12480,7 +12539,8 @@ BI.MultiTreeSearchPane = BI.inherit(BI.Pane, {
itemsCreator: function (op, callback) {
op.keyword = opts.keywordGetter();
opts.itemsCreator(op, callback);
}
},
value: opts.value
});
this.partTree.on(BI.Controller.EVENT_CHANGE, function () {
@ -12644,7 +12704,8 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) {
op.keyword = self.editor.getValue();
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -12665,6 +12726,9 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
this.searcher.on(BI.Searcher.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiTreeSearcher.EVENT_CHANGE, arguments);
});
if (BI.isNotNull(o.value)) {
this.setState(o.value);
}
},
adjustView: function () {
@ -21263,7 +21327,11 @@ BI.AllValueChooserCombo = BI.inherit(BI.AbstractAllValueChooser, {
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height
height: o.height,
value: {
type: BI.Selection.Multi,
value: o.value || []
}
});
this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () {

3
src/base/layer/layer.popup.js

@ -115,7 +115,8 @@ BI.PopupView = BI.inherit(BI.Widget, {
type: "bi.center",
cls: "list-view-tab",
height: 25,
items: o.tabs
items: o.tabs,
value: o.value
});
},

5
src/base/tree/treeview.js

@ -14,6 +14,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
_init: function () {
BI.TreeView.superclass._init.apply(this, arguments);
var o = this.options;
this._stop = false;
this._createTree();
@ -29,7 +30,9 @@ BI.TreeView = BI.inherit(BI.Pane, {
element: this,
items: [this.tip]
});
if(BI.isNotNull(o.value)){
this.setSelectedValue(o.value);
}
},
_createTree: function () {

6
src/case/combo/editoriconcheckcombo/combo.editoriconcheck.js

@ -27,7 +27,8 @@ BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText
errorText: o.errorText,
value: o.value
});
this.trigger.on(BI.EditorTrigger.EVENT_CHANGE, function () {
self.popup.setValue(this.getValue());
@ -36,7 +37,8 @@ BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
this.popup = BI.createWidget({
type: "bi.text_value_check_combo_popup",
chooseType: o.chooseType,
items: o.items
items: o.items,
value: o.value
});
this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());

7
src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js

@ -20,12 +20,15 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
items: o.items,
height: o.height
height: o.height,
text: o.text,
value: o.value
});
this.popup = BI.createWidget({
type: "bi.text_value_check_combo_popup",
chooseType: o.chooseType,
items: o.items
items: o.items,
value: o.value
});
this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());

6
src/case/combo/textvaluecheckcombo/combo.textvaluechecksmall.js

@ -20,12 +20,14 @@ BI.SmallTextValueCheckCombo = BI.inherit(BI.Widget, {
type: "bi.small_select_text_trigger",
items: o.items,
height: o.height,
text: o.text
text: o.text,
value: o.value
});
this.popup = BI.createWidget({
type: "bi.text_value_check_combo_popup",
chooseType: o.chooseType,
items: o.items
items: o.items,
value: o.value
});
this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());

3
src/case/combo/textvaluecheckcombo/popup.textvaluecheck.js

@ -15,7 +15,8 @@ BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, {
chooseType: o.chooseType,
layouts: [{
type: "bi.vertical"
}]
}],
value: o.value
});
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {

8
src/case/combo/textvaluecombo/combo.textvalue.js

@ -10,6 +10,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
baseClass: "bi-text-value-combo",
height: 30,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: "",
value: "",
el: {}
});
@ -22,11 +23,13 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
type: "bi.select_text_trigger",
items: o.items,
height: o.height,
text: o.value
text: o.text,
value: o.value
});
this.popup = BI.createWidget({
type: "bi.text_value_combo_popup",
chooseType: o.chooseType,
value: o.value,
items: o.items
});
this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE, function () {
@ -47,9 +50,6 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
maxHeight: 300
}
});
if (BI.isKey(o.value)) {
this.setValue(o.value);
}
},
setValue: function (v) {

17
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 () {

5
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) {

3
src/case/editor/editor.state.js

@ -129,6 +129,9 @@ BI.StateEditor = BI.inherit(BI.Widget, {
items: [this.editor]
});
this._showHint();
if(BI.isNotNull(o.text)){
this.setState(o.text);
}
},
doRedMark: function () {

3
src/case/editor/editor.state.simple.js

@ -130,6 +130,9 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
items: [this.editor]
});
this._showHint();
if(BI.isNotNull(o.text)){
this.setState(o.text);
}
},
doRedMark: function () {

3
src/case/list/list.select.js

@ -80,6 +80,9 @@ BI.SelectList = BI.inherit(BI.Widget, {
this.toolbar.setVisible(false);
this.toolbar.setEnable(false);
}
if(BI.isNotNull(o.value)){
this.setValue(o.value);
}
},
_checkAllSelected: function () {

2
src/case/trigger/trigger.icon.text.js

@ -52,7 +52,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
},
disableSelected: true
},
width: o.triggerWidth || o.height
width: BI.isEmptyString(o.iconCls)? 0 : (o.triggerWidth || o.height)
},
{
el: this.text

6
src/component/allvaluechooser/combo.allvaluechooser.js

@ -31,7 +31,11 @@ BI.AllValueChooserCombo = BI.inherit(BI.AbstractAllValueChooser, {
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height
height: o.height,
value: {
type: BI.Selection.Multi,
value: o.value || []
}
});
this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () {

3
src/widget/downlist/combo.downlist.js

@ -22,7 +22,8 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
this.popupview = BI.createWidget({
type: "bi.down_list_popup",
items: o.items,
chooseType: o.chooseType
chooseType: o.chooseType,
value: o.value
});
this.popupview.on(BI.DownListPopup.EVENT_CHANGE, function (value) {

3
src/widget/downlist/group.downlist.js

@ -28,7 +28,8 @@ BI.DownListGroup = BI.inherit(BI.Widget, {
type: "bi.vertical",
hgap: 0,
vgap: 0
}]
}],
value: o.value
});
this.downlistgroup.on(BI.Controller.EVENT_CHANGE, function (type) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);

22
src/widget/downlist/item.downlistgroup.js

@ -28,7 +28,8 @@ BI.DownListGroupItem = BI.inherit(BI.BasicButton, {
type: "bi.icon_button",
cls: o.iconCls1,
width: 25,
forceNotSelected: true
forceNotSelected: true,
selected: this._digest(o.value)
});
this.icon2 = BI.createWidget({
@ -70,6 +71,14 @@ BI.DownListGroupItem = BI.inherit(BI.BasicButton, {
});
},
_digest: function (v) {
var self = this, o = this.options;
v = BI.isArray(v) ? v : [v];
return BI.any(v, function (idx, value) {
return BI.contains(o.childValues, value);
});
},
hover: function () {
BI.DownListGroupItem.superclass.hover.apply(this, arguments);
this.icon1.element.addClass("hover");
@ -99,16 +108,7 @@ BI.DownListGroupItem = BI.inherit(BI.BasicButton, {
},
setValue: function (v) {
var self = this, o = this.options;
v = BI.isArray(v) ? v : [v];
BI.find(v, function (idx, value) {
if (BI.contains(o.childValues, value)) {
self.icon1.setSelected(true);
return true;
}
self.icon1.setSelected(false);
});
this.icon1.setSelected(this._digest(v));
}
});
BI.DownListGroupItem.EVENT_CHANGE = "EVENT_CHANGE";

53
src/widget/downlist/popup.downlist.js

@ -39,6 +39,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
hgap: this.constants.hgap,
vgap: this.constants.vgap
}],
value: this._digest(o.value),
chooseType: o.chooseType
});
@ -176,6 +177,42 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
return fatherValue + "_" + childValue;
},
_digest: function (valueItem) {
var self = this;
var valueArray = [];
BI.each(valueItem, function (i, item) {
var value;
if (BI.isNotNull(item.childValue)) {
value = self._createChildValue(item.value, item.childValue);
} else {
value = item.value;
}
valueArray.push(value);
}
);
return valueArray;
},
_checkValues: function (values) {
var self = this;
var value = [];
BI.each(this.options.items, function (idx, itemGroup) {
BI.each(itemGroup, function (id, item) {
if(BI.isNotNull(item.children)){
var childValues = BI.pluck(item.children, "value");
if(BI.contains(childValues, values[idx])){
value.push(values[idx]);
}
}else{
if(item.value === values[idx]){
value.push(values[idx]);
}
}
})
});
return value;
},
populate: function (items) {
BI.DownListPopup.superclass.populate.apply(this, arguments);
var self = this;
@ -192,24 +229,12 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
},
setValue: function (valueItem) {
var self = this;
var valueArray = [];
BI.each(valueItem, function (i, item) {
var value;
if (BI.isNotNull(item.childValue)) {
value = self._createChildValue(item.value, item.childValue);
} else {
value = item.value;
}
valueArray.push(value);
}
);
this.popup.setValue(valueArray);
this.popup.setValue(this._digest(valueItem));
},
getValue: function () {
var self = this, result = [];
var values = this.popup.getValue();
var values = this._checkValues(this.popup.getValue());
BI.each(values, function (i, value) {
var valueItem = {};
if (BI.isNotNull(self.childValueMap[value])) {

2
src/widget/multiselect/check/multiselect.check.pane.js

@ -26,7 +26,7 @@ BI.MultiSelectCheckPane = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
this.storeValue = {};
this.storeValue = opts.value || {};
this.display = BI.createWidget({
type: "bi.display_selected_list",
items: opts.items,

4
src/widget/multiselect/multiselect..insert.combo.js

@ -48,7 +48,8 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: o.value
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
@ -157,6 +158,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}

9
src/widget/multiselect/multiselect.combo.js

@ -23,7 +23,10 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().setState(self.storeValue);
self.trigger.getCounter().setButtonChecked(self.storeValue);
};
this.storeValue = {};
this.storeValue = o.value || {};
this._assertValue(this.storeValue);
// 标记正在请求数据
this.requesting = false;
@ -48,7 +51,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: this.storeValue
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
@ -153,6 +157,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}

6
src/widget/multiselect/multiselect.loader.js

@ -27,6 +27,9 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = opts.value || {};
this._assertValue(this.storeValue);
this.button_group = BI.createWidget({
type: "bi.select_list",
element: this,
@ -93,7 +96,8 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
},
hasNext: function () {
return hasNext;
}
},
value: this.storeValue
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);

6
src/widget/multiselect/multiselect.popup.view.js

@ -25,7 +25,8 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
type: "bi.multi_select_loader",
itemsCreator: opts.itemsCreator,
valueFormatter: opts.valueFormatter,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value
});
this.popupView = BI.createWidget({
@ -36,7 +37,8 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
maxHeight: opts.maxHeight,
element: this,
buttons: [BI.i18nText("BI-Basic_Clears"), BI.i18nText("BI-Basic_Sure")],
el: this.loader
el: this.loader,
value: opts.value
});
this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () {

6
src/widget/multiselect/multiselect.trigger.js

@ -41,7 +41,8 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
popup: {},
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_START, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_START);
@ -63,7 +64,8 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
itemsCreator: o.itemsCreator,
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK);

3
src/widget/multiselect/search/multiselect.search.loader.js

@ -20,13 +20,14 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = BI.deepClone(opts.value);
this.button_group = BI.createWidget({
type: "bi.select_list",
element: this,
logic: {
dynamic: false
},
value: opts.value,
el: {
tipText: BI.i18nText("BI-No_Select"),
el: {

3
src/widget/multiselect/search/multiselect.search.pane.js

@ -43,7 +43,8 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, {
callback(res);
self.setKeyword(o.keywordGetter());
}]);
}
},
value: o.value
});
this.loader.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);

5
src/widget/multiselect/trigger/button.checkselected.js

@ -19,7 +19,7 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
_init: function () {
BI.MultiSelectCheckSelectedButton.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
this.numberCounter = BI.createWidget({
type: "bi.text_button",
element: this,
@ -43,6 +43,9 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
self.numberCounter.setText(self.numberCounter.getTag());
});
this.setVisible(false);
if(BI.isNotNull(o.value)){
this.setValue(o.value);
}
},
setValue: function (ob) {

3
src/widget/multiselect/trigger/editor.multiselect.js

@ -25,7 +25,8 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true
allowBlank: true,
value: o.value
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {

6
src/widget/multiselect/trigger/searcher.multiselect.js

@ -47,7 +47,8 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
op.keyword = self.editor.getValue();
this.setKeyword(op.keyword);
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -72,6 +73,9 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
var keywords = this.getKeywords();
self.fireEvent(BI.MultiSelectSearcher.EVENT_SEARCHING, keywords);
});
if(BI.isNotNull(o.value)){
this.setState(o.value);
}
},
adjustView: function () {

6
src/widget/multiselect/trigger/switcher.checkselected.js

@ -24,7 +24,8 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
this.button = BI.createWidget(o.el, {
type: "bi.multi_select_check_selected_button",
itemsCreator: o.itemsCreator
itemsCreator: o.itemsCreator,
value: o.value
});
this.button.on(BI.Events.VIEW, function () {
self.fireEvent(BI.Events.VIEW, arguments);
@ -40,7 +41,8 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
itemsCreator: o.itemsCreator,
onClickContinueSelect: function () {
self.switcher.hideView();
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
masker: o.masker

3
src/widget/multitree/check/multi.tree.check.pane.js

@ -62,7 +62,8 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
itemsCreator: function (op, callback) {
op.type = BI.TreeView.REQ_TYPE_GET_SELECTED_DATA;
opts.itemsCreator(op, callback);
}
},
value: (opts.value || {}).value
});
this.display.on(BI.Events.AFTERINIT, function () {

9
src/widget/multitree/multi.tree.combo.js

@ -31,6 +31,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
var isInit = false;
var want2showCounter = false;
this.storeValue = {value: o.value || {}};
this.trigger = BI.createWidget({
type: "bi.multi_select_trigger",
height: o.height,
@ -50,7 +52,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
type: "bi.multi_tree_check_pane",
itemsCreator: o.itemsCreator
}
}
},
value: {value: o.value || {}}
});
@ -106,12 +109,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
});
}
},
value: {value: o.value || {}},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
});
this.storeValue = {value: {}};
var change = false;
var clear = false; // 标识当前是否点击了清空

3
src/widget/multitree/multi.tree.popup.js

@ -27,7 +27,8 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, {
height: 400,
cls: "popup-view-tree",
itemsCreator: opts.itemsCreator,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value || {}
});
this.popupView = BI.createWidget({

3
src/widget/multitree/multi.tree.search.pane.js

@ -27,7 +27,8 @@ BI.MultiTreeSearchPane = BI.inherit(BI.Pane, {
itemsCreator: function (op, callback) {
op.keyword = opts.keywordGetter();
opts.itemsCreator(op, callback);
}
},
value: opts.value
});
this.partTree.on(BI.Controller.EVENT_CHANGE, function () {

6
src/widget/multitree/trigger/searcher.multi.tree.js

@ -49,7 +49,8 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) {
op.keyword = self.editor.getValue();
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -70,6 +71,9 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
this.searcher.on(BI.Searcher.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiTreeSearcher.EVENT_CHANGE, arguments);
});
if (BI.isNotNull(o.value)) {
this.setState(o.value);
}
},
adjustView: function () {

Loading…
Cancel
Save