|
|
@ -39965,7 +39965,8 @@ BI.Loader = BI.inherit(BI.Widget, { |
|
|
|
behaviors: {}, |
|
|
|
behaviors: {}, |
|
|
|
layouts: [{ |
|
|
|
layouts: [{ |
|
|
|
type: "bi.vertical" |
|
|
|
type: "bi.vertical" |
|
|
|
}] |
|
|
|
}], |
|
|
|
|
|
|
|
value: o.value |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { |
|
|
|
this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { |
|
|
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); |
|
|
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); |
|
|
@ -50948,6 +50949,7 @@ BI.PlusGroupNode = BI.inherit(BI.NodeButton, { |
|
|
|
hgap: o.hgap, |
|
|
|
hgap: o.hgap, |
|
|
|
text: o.text, |
|
|
|
text: o.text, |
|
|
|
value: o.value, |
|
|
|
value: o.value, |
|
|
|
|
|
|
|
keyword: o.keyword, |
|
|
|
py: o.py |
|
|
|
py: o.py |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) { |
|
|
|
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) { |
|
|
@ -54553,6 +54555,8 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.check(); |
|
|
|
|
|
|
|
|
|
|
|
BI.createWidget({ |
|
|
|
BI.createWidget({ |
|
|
|
type: "bi.vertical", |
|
|
|
type: "bi.vertical", |
|
|
|
element: this, |
|
|
|
element: this, |
|
|
@ -54790,6 +54794,10 @@ BI.SearchTextValueComboPopup = BI.inherit(BI.Pane, { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mounted: function() { |
|
|
|
|
|
|
|
this.check(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
populate: function (find, match, keyword) { |
|
|
|
populate: function (find, match, keyword) { |
|
|
|
var items = BI.concat(find, match); |
|
|
|
var items = BI.concat(find, match); |
|
|
|
BI.SearchTextValueComboPopup.superclass.populate.apply(this, items); |
|
|
|
BI.SearchTextValueComboPopup.superclass.populate.apply(this, items); |
|
|
@ -56539,7 +56547,8 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
watermark: "", |
|
|
|
watermark: "", |
|
|
|
errorText: "", |
|
|
|
errorText: "", |
|
|
|
height: 24 |
|
|
|
height: 24, |
|
|
|
|
|
|
|
text: BI.i18nText("BI-Basic_Unrestricted") |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -56566,8 +56575,8 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { |
|
|
|
type: "bi.text_button", |
|
|
|
type: "bi.text_button", |
|
|
|
cls: "state-editor-infinite-text", |
|
|
|
cls: "state-editor-infinite-text", |
|
|
|
textAlign: "left", |
|
|
|
textAlign: "left", |
|
|
|
|
|
|
|
text: o.text, |
|
|
|
height: o.height, |
|
|
|
height: o.height, |
|
|
|
text: BI.i18nText("BI-Basic_Unrestricted"), |
|
|
|
|
|
|
|
hgap: 4, |
|
|
|
hgap: 4, |
|
|
|
handler: function () { |
|
|
|
handler: function () { |
|
|
|
self._showInput(); |
|
|
|
self._showInput(); |
|
|
@ -56736,6 +56745,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setState: function (v) { |
|
|
|
setState: function (v) { |
|
|
|
|
|
|
|
var o = this.options; |
|
|
|
BI.SimpleStateEditor.superclass.setValue.apply(this, arguments); |
|
|
|
BI.SimpleStateEditor.superclass.setValue.apply(this, arguments); |
|
|
|
if (BI.isNumber(v)) { |
|
|
|
if (BI.isNumber(v)) { |
|
|
|
if (v === BI.Selection.All) { |
|
|
|
if (v === BI.Selection.All) { |
|
|
@ -56745,7 +56755,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { |
|
|
|
this.text.setText(BI.i18nText("BI-Already_Selected")); |
|
|
|
this.text.setText(BI.i18nText("BI-Already_Selected")); |
|
|
|
this.text.element.removeClass("state-editor-infinite-text"); |
|
|
|
this.text.element.removeClass("state-editor-infinite-text"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.text.setText(BI.i18nText("BI-Basic_Unrestricted")); |
|
|
|
this.text.setText(o.text); |
|
|
|
this.text.element.addClass("state-editor-infinite-text"); |
|
|
|
this.text.element.addClass("state-editor-infinite-text"); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
@ -56755,7 +56765,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { |
|
|
|
this.text.setTitle(v); |
|
|
|
this.text.setTitle(v); |
|
|
|
this.text.element.removeClass("state-editor-infinite-text"); |
|
|
|
this.text.element.removeClass("state-editor-infinite-text"); |
|
|
|
} else if (BI.isEmpty(v)) { |
|
|
|
} else if (BI.isEmpty(v)) { |
|
|
|
this.text.setText(BI.i18nText("BI-Basic_Unrestricted")); |
|
|
|
this.text.setText(o.text); |
|
|
|
this.text.element.addClass("state-editor-infinite-text"); |
|
|
|
this.text.element.addClass("state-editor-infinite-text"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.text.setText(BI.i18nText("BI-Already_Selected")); |
|
|
|
this.text.setText(BI.i18nText("BI-Already_Selected")); |
|
|
@ -56952,6 +56962,8 @@ BI.ListPane = BI.inherit(BI.Pane, { |
|
|
|
calback.apply(self, arguments); |
|
|
|
calback.apply(self, arguments); |
|
|
|
op.times === 1 && BI.nextTick(function () { |
|
|
|
op.times === 1 && BI.nextTick(function () { |
|
|
|
self.loaded(); |
|
|
|
self.loaded(); |
|
|
|
|
|
|
|
// callback可能在loading之前执行, check保证显示正确
|
|
|
|
|
|
|
|
self.check(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -66508,73 +66520,157 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { |
|
|
|
|
|
|
|
|
|
|
|
_defaultConfig: function () { |
|
|
|
_defaultConfig: function () { |
|
|
|
return BI.extend(BI.MultiLayerSelectTreeCombo.superclass._defaultConfig.apply(this, arguments), { |
|
|
|
return BI.extend(BI.MultiLayerSelectTreeCombo.superclass._defaultConfig.apply(this, arguments), { |
|
|
|
baseCls: "bi-multilayer_select_tree-combo", |
|
|
|
baseCls: "bi-multilayer-select-tree-combo", |
|
|
|
isDefaultInit: false, |
|
|
|
isDefaultInit: false, |
|
|
|
height: 24, |
|
|
|
height: 24, |
|
|
|
text: "", |
|
|
|
text: "", |
|
|
|
|
|
|
|
itemsCreator: BI.emptyFn, |
|
|
|
items: [], |
|
|
|
items: [], |
|
|
|
value: "", |
|
|
|
value: "", |
|
|
|
attributes: { |
|
|
|
attributes: { |
|
|
|
tabIndex: 0 |
|
|
|
tabIndex: 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
allowEdit: false |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_init: function () { |
|
|
|
render: function () { |
|
|
|
BI.MultiLayerSelectTreeCombo.superclass._init.apply(this, arguments); |
|
|
|
|
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
|
|
|
|
|
|
|
|
this.trigger = BI.createWidget({ |
|
|
|
var combo = (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig(); |
|
|
|
type: "bi.single_tree_trigger", |
|
|
|
|
|
|
|
text: o.text, |
|
|
|
|
|
|
|
height: o.height, |
|
|
|
|
|
|
|
items: o.items, |
|
|
|
|
|
|
|
value: o.value |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.popup = BI.createWidget({ |
|
|
|
return (!o.allowEdit && o.itemsCreator === BI.emptyFn) ? combo : { |
|
|
|
type: "bi.multilayer_select_tree_popup", |
|
|
|
type: "bi.absolute", |
|
|
|
isDefaultInit: o.isDefaultInit, |
|
|
|
items: [{ |
|
|
|
items: o.items, |
|
|
|
el: combo, |
|
|
|
value: o.value |
|
|
|
left: 0, |
|
|
|
}); |
|
|
|
right: 0, |
|
|
|
|
|
|
|
top: 0, |
|
|
|
|
|
|
|
bottom: 0 |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.trigger_icon_button", |
|
|
|
|
|
|
|
cls: "trigger-icon-button", |
|
|
|
|
|
|
|
ref: function (_ref) { |
|
|
|
|
|
|
|
self.triggerBtn = _ref; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
width: o.height, |
|
|
|
|
|
|
|
height: o.height, |
|
|
|
|
|
|
|
handler: function () { |
|
|
|
|
|
|
|
if (self.combo.isViewVisible()) { |
|
|
|
|
|
|
|
self.combo.hideView(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
self.combo.showView(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
right: 0, |
|
|
|
|
|
|
|
bottom: 0, |
|
|
|
|
|
|
|
top: 0 |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
this.combo = BI.createWidget({ |
|
|
|
_getBaseConfig: function () { |
|
|
|
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
|
|
|
return { |
|
|
|
type: "bi.combo", |
|
|
|
type: "bi.combo", |
|
|
|
container: o.container, |
|
|
|
container: o.container, |
|
|
|
element: this, |
|
|
|
|
|
|
|
adjustLength: 2, |
|
|
|
adjustLength: 2, |
|
|
|
el: this.trigger, |
|
|
|
ref: function (_ref) { |
|
|
|
|
|
|
|
self.combo = _ref; |
|
|
|
|
|
|
|
}, |
|
|
|
popup: { |
|
|
|
popup: { |
|
|
|
el: this.popup |
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.multilayer_select_tree_popup", |
|
|
|
|
|
|
|
isDefaultInit: o.isDefaultInit, |
|
|
|
|
|
|
|
itemsCreator: o.itemsCreator, |
|
|
|
|
|
|
|
items: o.items, |
|
|
|
|
|
|
|
ref: function (_ref) { |
|
|
|
|
|
|
|
self.trigger && self.trigger.getSearcher().setAdapter(_ref); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
listeners: [{ |
|
|
|
|
|
|
|
eventName: BI.MultiLayerSelectTreePopup.EVENT_CHANGE, |
|
|
|
|
|
|
|
action: function () { |
|
|
|
|
|
|
|
self.setValue(this.getValue()); |
|
|
|
|
|
|
|
self.combo.hideView(); |
|
|
|
|
|
|
|
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
value: o.value, |
|
|
|
|
|
|
|
minHeight: 400 |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
this.combo.on(BI.Controller.EVENT_CHANGE, function () { |
|
|
|
_getSyncConfig: function () { |
|
|
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); |
|
|
|
var o = this.options; |
|
|
|
}); |
|
|
|
var baseConfig = this._getBaseConfig(); |
|
|
|
|
|
|
|
baseConfig.el = { |
|
|
|
|
|
|
|
type: "bi.single_tree_trigger", |
|
|
|
|
|
|
|
text: o.text, |
|
|
|
|
|
|
|
height: o.height, |
|
|
|
|
|
|
|
items: o.items, |
|
|
|
|
|
|
|
value: o.value |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
return baseConfig; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
this.popup.on(BI.MultiLayerSelectTreePopup.EVENT_CHANGE, function () { |
|
|
|
_getAsyncConfig: function () { |
|
|
|
self.setValue(self.popup.getValue()); |
|
|
|
var self = this, o = this.options; |
|
|
|
self.combo.hideView(); |
|
|
|
var config = this._getBaseConfig(); |
|
|
|
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE); |
|
|
|
return BI.extend(config, { |
|
|
|
|
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.multilayer_select_tree_trigger", |
|
|
|
|
|
|
|
allowEdit: o.allowEdit, |
|
|
|
|
|
|
|
cls: "multilayer-select-tree-trigger", |
|
|
|
|
|
|
|
ref: function (_ref) { |
|
|
|
|
|
|
|
self.trigger = _ref; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
items: o.items, |
|
|
|
|
|
|
|
itemsCreator: o.itemsCreator, |
|
|
|
|
|
|
|
height: o.height - 2, |
|
|
|
|
|
|
|
text: o.text, |
|
|
|
|
|
|
|
value: o.value, |
|
|
|
|
|
|
|
tipType: o.tipType, |
|
|
|
|
|
|
|
warningTitle: o.warningTitle, |
|
|
|
|
|
|
|
title: o.title, |
|
|
|
|
|
|
|
listeners: [{ |
|
|
|
|
|
|
|
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE, |
|
|
|
|
|
|
|
action: function () { |
|
|
|
|
|
|
|
self.setValue(this.getValue()); |
|
|
|
|
|
|
|
self.combo.hideView(); |
|
|
|
|
|
|
|
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
hideChecker: function (e) { |
|
|
|
|
|
|
|
return self.triggerBtn.element.find(e.target).length === 0; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
listeners: [{ |
|
|
|
|
|
|
|
eventName: BI.Combo.EVENT_AFTER_HIDEVIEW, |
|
|
|
|
|
|
|
action: function () { |
|
|
|
|
|
|
|
self.trigger.stopEditing(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}] |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
setValue: function (v) { |
|
|
|
v = BI.isArray(v) ? v : [v]; |
|
|
|
v = BI.isArray(v) ? v : [v]; |
|
|
|
this.trigger.setValue(v); |
|
|
|
this.combo.setValue(v); |
|
|
|
this.popup.setValue(v); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
getValue: function () { |
|
|
|
return this.popup.getValue(); |
|
|
|
return this.combo.getValue(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
populate: function (items) { |
|
|
|
this.combo.populate(items); |
|
|
|
this.combo.populate(items); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/** |
|
|
|
BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/** |
|
|
|
* guy |
|
|
|
* guy |
|
|
@ -66589,6 +66685,7 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, { |
|
|
|
isDefaultInit: false, |
|
|
|
isDefaultInit: false, |
|
|
|
items: [], |
|
|
|
items: [], |
|
|
|
itemsCreator: BI.emptyFn, |
|
|
|
itemsCreator: BI.emptyFn, |
|
|
|
|
|
|
|
keywordGetter: BI.emptyFn, |
|
|
|
value: "", |
|
|
|
value: "", |
|
|
|
scrollable: true |
|
|
|
scrollable: true |
|
|
|
}); |
|
|
|
}); |
|
|
@ -66601,13 +66698,15 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_formatItems: function (nodes, layer, pNode) { |
|
|
|
_formatItems: function (nodes, layer, pNode) { |
|
|
|
var self = this; |
|
|
|
var self = this, o = this.options; |
|
|
|
|
|
|
|
var keyword = o.keywordGetter(); |
|
|
|
BI.each(nodes, function (i, node) { |
|
|
|
BI.each(nodes, function (i, node) { |
|
|
|
var extend = {}; |
|
|
|
var extend = {}; |
|
|
|
node.layer = layer; |
|
|
|
node.layer = layer; |
|
|
|
if (!BI.isKey(node.id)) { |
|
|
|
if (!BI.isKey(node.id)) { |
|
|
|
node.id = BI.UUID(); |
|
|
|
node.id = BI.UUID(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
node.keyword = keyword; |
|
|
|
extend.pNode = pNode; |
|
|
|
extend.pNode = pNode; |
|
|
|
if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { |
|
|
|
if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { |
|
|
|
extend.type = "bi.multilayer_select_tree_mid_plus_group_node"; |
|
|
|
extend.type = "bi.multilayer_select_tree_mid_plus_group_node"; |
|
|
@ -66646,6 +66745,7 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, { |
|
|
|
// 构造树结构,
|
|
|
|
// 构造树结构,
|
|
|
|
initTree: function (nodes) { |
|
|
|
initTree: function (nodes) { |
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
|
|
|
|
var hasNext = false; |
|
|
|
this.empty(); |
|
|
|
this.empty(); |
|
|
|
this._assertId(nodes); |
|
|
|
this._assertId(nodes); |
|
|
|
this.tree = BI.createWidget({ |
|
|
|
this.tree = BI.createWidget({ |
|
|
@ -66661,15 +66761,28 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
items: this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0), |
|
|
|
items: this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0), |
|
|
|
itemsCreator: o.itemsCreator, |
|
|
|
itemsCreator: function (op, callback) { |
|
|
|
|
|
|
|
o.itemsCreator(op, function (ob) { |
|
|
|
|
|
|
|
hasNext = ob.hasNext; |
|
|
|
|
|
|
|
callback(self._formatItems(BI.Tree.transformToTreeFormat(ob.items), op.node ? op.node.layer + 1 : 0, op.node)); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
value: o.value, |
|
|
|
value: o.value, |
|
|
|
|
|
|
|
|
|
|
|
el: { |
|
|
|
el: { |
|
|
|
type: "bi.button_tree", |
|
|
|
type: "bi.loader", |
|
|
|
chooseType: BI.Selection.Single, |
|
|
|
isDefaultInit: true, |
|
|
|
layouts: [{ |
|
|
|
chooseType: o.chooseType, |
|
|
|
type: "bi.vertical" |
|
|
|
el: { |
|
|
|
}] |
|
|
|
type: "bi.button_tree", |
|
|
|
|
|
|
|
behaviors: o.behaviors, |
|
|
|
|
|
|
|
layouts: [{ |
|
|
|
|
|
|
|
type: "bi.vertical" |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
hasNext: function () { |
|
|
|
|
|
|
|
return hasNext; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.tree.on(BI.Controller.EVENT_CHANGE, function (type) { |
|
|
|
this.tree.on(BI.Controller.EVENT_CHANGE, function (type) { |
|
|
@ -66688,7 +66801,7 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
populate: function (nodes) { |
|
|
|
populate: function (nodes) { |
|
|
|
this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0)); |
|
|
|
BI.isNull(nodes) ? this.tree.populate() : this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0)); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
setValue: function (v) { |
|
|
@ -66742,8 +66855,20 @@ BI.MultiLayerSelectTreePopup = BI.inherit(BI.Pane, { |
|
|
|
type: "bi.multilayer_select_level_tree", |
|
|
|
type: "bi.multilayer_select_level_tree", |
|
|
|
isDefaultInit: o.isDefaultInit, |
|
|
|
isDefaultInit: o.isDefaultInit, |
|
|
|
items: o.items, |
|
|
|
items: o.items, |
|
|
|
|
|
|
|
itemsCreator: function (op, callback) { |
|
|
|
|
|
|
|
(op.times === 1 && !op.node) && BI.nextTick(function () { |
|
|
|
|
|
|
|
self.loading(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
o.itemsCreator(op, function (ob) { |
|
|
|
|
|
|
|
self._populate(ob.items); |
|
|
|
|
|
|
|
callback(ob); |
|
|
|
|
|
|
|
(op.times === 1 && !op.node) && BI.nextTick(function () { |
|
|
|
|
|
|
|
self.loaded(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
keywordGetter: o.keywordGetter, |
|
|
|
value: o.value, |
|
|
|
value: o.value, |
|
|
|
itemsCreator: o.itemsCreator, |
|
|
|
|
|
|
|
scrollable: null |
|
|
|
scrollable: null |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -66767,6 +66892,10 @@ BI.MultiLayerSelectTreePopup = BI.inherit(BI.Pane, { |
|
|
|
this.check(); |
|
|
|
this.check(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_populate: function() { |
|
|
|
|
|
|
|
BI.MultiLayerSelectTreePopup.superclass.populate.apply(this, arguments); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
getValue: function () { |
|
|
|
return this.tree.getValue(); |
|
|
|
return this.tree.getValue(); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -66777,13 +66906,135 @@ BI.MultiLayerSelectTreePopup = BI.inherit(BI.Pane, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
populate: function (items) { |
|
|
|
BI.MultiLayerSelectTreePopup.superclass.populate.apply(this, arguments); |
|
|
|
this._populate(items); |
|
|
|
this.tree.populate(items); |
|
|
|
this.tree.populate(items); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
BI.MultiLayerSelectTreePopup.EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
BI.MultiLayerSelectTreePopup.EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
BI.shortcut("bi.multilayer_select_tree_popup", BI.MultiLayerSelectTreePopup);/** |
|
|
|
BI.shortcut("bi.multilayer_select_tree_popup", BI.MultiLayerSelectTreePopup);/** |
|
|
|
|
|
|
|
* Created by Windy on 2018/2/2. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
props: { |
|
|
|
|
|
|
|
extraCls: "bi-multi-layer-select-tree-trigger bi-border bi-focus-shadow", |
|
|
|
|
|
|
|
height: 24, |
|
|
|
|
|
|
|
valueFormatter: function (v) { |
|
|
|
|
|
|
|
return v; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
itemsCreator: BI.emptyFn |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
|
|
|
var content = { |
|
|
|
|
|
|
|
type: "bi.htape", |
|
|
|
|
|
|
|
items: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.searcher", |
|
|
|
|
|
|
|
ref: function () { |
|
|
|
|
|
|
|
self.searcher = this; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
isAutoSearch: false, |
|
|
|
|
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.state_editor", |
|
|
|
|
|
|
|
ref: function () { |
|
|
|
|
|
|
|
self.editor = this; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
text: this._digest(o.value), |
|
|
|
|
|
|
|
value: o.value, |
|
|
|
|
|
|
|
height: o.height, |
|
|
|
|
|
|
|
tipText: "" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
popup: { |
|
|
|
|
|
|
|
type: "bi.multilayer_select_tree_popup", |
|
|
|
|
|
|
|
itemsCreator: function (op, callback) { |
|
|
|
|
|
|
|
op.keyword = self.editor.getValue(); |
|
|
|
|
|
|
|
o.itemsCreator(op, callback); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
keywordGetter: function () { |
|
|
|
|
|
|
|
return self.editor.getValue(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
cls: "bi-card" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
onSearch: function (obj, callback) { |
|
|
|
|
|
|
|
var keyword = obj.keyword; |
|
|
|
|
|
|
|
if(o.itemsCreator === BI.emptyFn) { |
|
|
|
|
|
|
|
var finding = BI.Func.getSearchResult(o.items, keyword); |
|
|
|
|
|
|
|
var matched = finding.match, find = finding.find; |
|
|
|
|
|
|
|
callback(find.concat(matched)); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
callback(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
listeners: [{ |
|
|
|
|
|
|
|
eventName: BI.Searcher.EVENT_CHANGE, |
|
|
|
|
|
|
|
action: function () { |
|
|
|
|
|
|
|
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.layout", |
|
|
|
|
|
|
|
width: 24 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
width: 24 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return o.allowEdit ? content : { |
|
|
|
|
|
|
|
type: "bi.absolute", |
|
|
|
|
|
|
|
items: [{ |
|
|
|
|
|
|
|
el: content, |
|
|
|
|
|
|
|
left: 0, |
|
|
|
|
|
|
|
right: 0, |
|
|
|
|
|
|
|
top: 0, |
|
|
|
|
|
|
|
bottom: 0 |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.layout" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
left: 0, |
|
|
|
|
|
|
|
right: 24, |
|
|
|
|
|
|
|
top: 0, |
|
|
|
|
|
|
|
bottom: 0 |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_digest: function (v) { |
|
|
|
|
|
|
|
return this.options.valueFormatter(v); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stopEditing: function () { |
|
|
|
|
|
|
|
this.searcher.stopSearch(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getSearcher: function () { |
|
|
|
|
|
|
|
return this.searcher; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
|
|
|
|
this.options.items = items; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
|
|
|
|
this.editor.setState(this._digest(v[0])); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
|
|
|
|
return this.searcher.getValue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING"; |
|
|
|
|
|
|
|
BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP"; |
|
|
|
|
|
|
|
BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START"; |
|
|
|
|
|
|
|
BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
|
|
|
|
BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/** |
|
|
|
* 加号表示的组节点 |
|
|
|
* 加号表示的组节点 |
|
|
|
* |
|
|
|
* |
|
|
|
* Created by GUY on 2016/1/27. |
|
|
|
* Created by GUY on 2016/1/27. |
|
|
@ -67207,60 +67458,141 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { |
|
|
|
value: "", |
|
|
|
value: "", |
|
|
|
attributes: { |
|
|
|
attributes: { |
|
|
|
tabIndex: 0 |
|
|
|
tabIndex: 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
allowEdit: false |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_init: function () { |
|
|
|
render: function () { |
|
|
|
BI.MultiLayerSingleTreeCombo.superclass._init.apply(this, arguments); |
|
|
|
|
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
|
|
|
|
|
|
|
|
this.trigger = BI.createWidget({ |
|
|
|
var combo = (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig(); |
|
|
|
type: "bi.single_tree_trigger", |
|
|
|
|
|
|
|
text: o.text, |
|
|
|
|
|
|
|
height: o.height, |
|
|
|
|
|
|
|
items: o.items, |
|
|
|
|
|
|
|
value: o.value |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.popup = BI.createWidget({ |
|
|
|
return (!o.allowEdit && o.itemsCreator === BI.emptyFn) ? combo : { |
|
|
|
type: "bi.multilayer_single_tree_popup", |
|
|
|
type: "bi.absolute", |
|
|
|
isDefaultInit: o.isDefaultInit, |
|
|
|
items: [{ |
|
|
|
itemsCreator: o.itemsCreator, |
|
|
|
el: combo, |
|
|
|
items: o.items, |
|
|
|
left: 0, |
|
|
|
value: o.value |
|
|
|
right: 0, |
|
|
|
}); |
|
|
|
top: 0, |
|
|
|
|
|
|
|
bottom: 0 |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.trigger_icon_button", |
|
|
|
|
|
|
|
cls: "trigger-icon-button", |
|
|
|
|
|
|
|
ref: function (_ref) { |
|
|
|
|
|
|
|
self.triggerBtn = _ref; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
width: o.height, |
|
|
|
|
|
|
|
height: o.height, |
|
|
|
|
|
|
|
handler: function () { |
|
|
|
|
|
|
|
if (self.combo.isViewVisible()) { |
|
|
|
|
|
|
|
self.combo.hideView(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
self.combo.showView(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
right: 0, |
|
|
|
|
|
|
|
bottom: 0, |
|
|
|
|
|
|
|
top: 0 |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
this.combo = BI.createWidget({ |
|
|
|
_getBaseConfig: function () { |
|
|
|
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
|
|
|
return { |
|
|
|
type: "bi.combo", |
|
|
|
type: "bi.combo", |
|
|
|
container: o.container, |
|
|
|
container: o.container, |
|
|
|
element: this, |
|
|
|
|
|
|
|
adjustLength: 2, |
|
|
|
adjustLength: 2, |
|
|
|
el: this.trigger, |
|
|
|
ref: function (_ref) { |
|
|
|
|
|
|
|
self.combo = _ref; |
|
|
|
|
|
|
|
}, |
|
|
|
popup: { |
|
|
|
popup: { |
|
|
|
el: this.popup |
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.multilayer_single_tree_popup", |
|
|
|
|
|
|
|
isDefaultInit: o.isDefaultInit, |
|
|
|
|
|
|
|
itemsCreator: o.itemsCreator, |
|
|
|
|
|
|
|
items: o.items, |
|
|
|
|
|
|
|
ref: function (_ref) { |
|
|
|
|
|
|
|
self.trigger && self.trigger.getSearcher().setAdapter(_ref); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
listeners: [{ |
|
|
|
|
|
|
|
eventName: BI.MultiLayerSingleTreePopup.EVENT_CHANGE, |
|
|
|
|
|
|
|
action: function () { |
|
|
|
|
|
|
|
self.setValue(this.getValue()); |
|
|
|
|
|
|
|
self.combo.hideView(); |
|
|
|
|
|
|
|
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
value: o.value, |
|
|
|
|
|
|
|
minHeight: 400 |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
this.combo.on(BI.Controller.EVENT_CHANGE, function () { |
|
|
|
_getSyncConfig: function () { |
|
|
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); |
|
|
|
var o = this.options; |
|
|
|
}); |
|
|
|
var baseConfig = this._getBaseConfig(); |
|
|
|
|
|
|
|
baseConfig.el = { |
|
|
|
|
|
|
|
type: "bi.single_tree_trigger", |
|
|
|
|
|
|
|
text: o.text, |
|
|
|
|
|
|
|
height: o.height, |
|
|
|
|
|
|
|
items: o.items, |
|
|
|
|
|
|
|
value: o.value |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
return baseConfig; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
this.popup.on(BI.MultiLayerSingleTreePopup.EVENT_CHANGE, function () { |
|
|
|
_getAsyncConfig: function () { |
|
|
|
self.setValue(self.popup.getValue()); |
|
|
|
var self = this, o = this.options; |
|
|
|
self.combo.hideView(); |
|
|
|
var config = this._getBaseConfig(); |
|
|
|
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE); |
|
|
|
return BI.extend(config, { |
|
|
|
|
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.multilayer_single_tree_trigger", |
|
|
|
|
|
|
|
allowEdit: o.allowEdit, |
|
|
|
|
|
|
|
cls: "multilayer-single-tree-trigger", |
|
|
|
|
|
|
|
ref: function (_ref) { |
|
|
|
|
|
|
|
self.trigger = _ref; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
items: o.items, |
|
|
|
|
|
|
|
itemsCreator: o.itemsCreator, |
|
|
|
|
|
|
|
height: o.height - 2, |
|
|
|
|
|
|
|
text: o.text, |
|
|
|
|
|
|
|
value: o.value, |
|
|
|
|
|
|
|
tipType: o.tipType, |
|
|
|
|
|
|
|
warningTitle: o.warningTitle, |
|
|
|
|
|
|
|
title: o.title, |
|
|
|
|
|
|
|
listeners: [{ |
|
|
|
|
|
|
|
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE, |
|
|
|
|
|
|
|
action: function () { |
|
|
|
|
|
|
|
self.setValue(this.getValue()); |
|
|
|
|
|
|
|
self.combo.hideView(); |
|
|
|
|
|
|
|
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
hideChecker: function (e) { |
|
|
|
|
|
|
|
return self.triggerBtn.element.find(e.target).length === 0; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
listeners: [{ |
|
|
|
|
|
|
|
eventName: BI.Combo.EVENT_AFTER_HIDEVIEW, |
|
|
|
|
|
|
|
action: function () { |
|
|
|
|
|
|
|
self.trigger.stopEditing(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}] |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
setValue: function (v) { |
|
|
|
v = BI.isArray(v) ? v : [v]; |
|
|
|
v = BI.isArray(v) ? v : [v]; |
|
|
|
this.trigger.setValue(v); |
|
|
|
this.combo.setValue(v); |
|
|
|
this.popup.setValue(v); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
getValue: function () { |
|
|
|
return this.popup.getValue(); |
|
|
|
return this.combo.getValue(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
populate: function (items) { |
|
|
@ -67282,6 +67614,7 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, { |
|
|
|
isDefaultInit: false, |
|
|
|
isDefaultInit: false, |
|
|
|
items: [], |
|
|
|
items: [], |
|
|
|
itemsCreator: BI.emptyFn, |
|
|
|
itemsCreator: BI.emptyFn, |
|
|
|
|
|
|
|
keywordGetter: BI.emptyFn, |
|
|
|
chooseType: BI.Selection.Single, |
|
|
|
chooseType: BI.Selection.Single, |
|
|
|
scrollable: true |
|
|
|
scrollable: true |
|
|
|
}); |
|
|
|
}); |
|
|
@ -67294,13 +67627,15 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_formatItems: function (nodes, layer, pNode) { |
|
|
|
_formatItems: function (nodes, layer, pNode) { |
|
|
|
var self = this; |
|
|
|
var self = this, o = this.options; |
|
|
|
|
|
|
|
var keyword = o.keywordGetter(); |
|
|
|
BI.each(nodes, function (i, node) { |
|
|
|
BI.each(nodes, function (i, node) { |
|
|
|
var extend = {}; |
|
|
|
var extend = {}; |
|
|
|
node.layer = layer; |
|
|
|
node.layer = layer; |
|
|
|
if (!BI.isKey(node.id)) { |
|
|
|
if (!BI.isKey(node.id)) { |
|
|
|
node.id = BI.UUID(); |
|
|
|
node.id = BI.UUID(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
node.keyword = keyword; |
|
|
|
extend.pNode = pNode; |
|
|
|
extend.pNode = pNode; |
|
|
|
if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { |
|
|
|
if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { |
|
|
|
extend.type = "bi.multilayer_single_tree_mid_plus_group_node"; |
|
|
|
extend.type = "bi.multilayer_single_tree_mid_plus_group_node"; |
|
|
@ -67319,7 +67654,7 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
extend.type = "bi.multilayer_single_tree_mid_tree_leaf_item"; |
|
|
|
extend.type = "bi.multilayer_single_tree_mid_tree_leaf_item"; |
|
|
|
if (i === 0 && !pNode) { |
|
|
|
if (i === 0 && !pNode) { |
|
|
|
extend.type = "bi.multilayer_single_tree_first_tree_leaf_item" |
|
|
|
extend.type = "bi.multilayer_single_tree_first_tree_leaf_item"; |
|
|
|
} |
|
|
|
} |
|
|
|
if (i === nodes.length - 1) { |
|
|
|
if (i === nodes.length - 1) { |
|
|
|
extend.type = "bi.multilayer_single_tree_last_tree_leaf_item"; |
|
|
|
extend.type = "bi.multilayer_single_tree_last_tree_leaf_item"; |
|
|
@ -67339,6 +67674,7 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, { |
|
|
|
// 构造树结构,
|
|
|
|
// 构造树结构,
|
|
|
|
initTree: function (nodes) { |
|
|
|
initTree: function (nodes) { |
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
|
|
|
|
var hasNext = false; |
|
|
|
this.empty(); |
|
|
|
this.empty(); |
|
|
|
this._assertId(nodes); |
|
|
|
this._assertId(nodes); |
|
|
|
this.tree = BI.createWidget({ |
|
|
|
this.tree = BI.createWidget({ |
|
|
@ -67355,17 +67691,26 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, { |
|
|
|
items: this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0), |
|
|
|
items: this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0), |
|
|
|
value: o.value, |
|
|
|
value: o.value, |
|
|
|
itemsCreator: function (op, callback) { |
|
|
|
itemsCreator: function (op, callback) { |
|
|
|
o.itemsCreator(op, function (items) { |
|
|
|
o.itemsCreator(op, function (ob) { |
|
|
|
callback(BI.Tree.transformToTreeFormat(items), 0); |
|
|
|
hasNext = ob.hasNext; |
|
|
|
|
|
|
|
callback(self._formatItems(BI.Tree.transformToTreeFormat(ob.items), op.node ? op.node.layer + 1 : 0, op.node)); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
el: { |
|
|
|
el: { |
|
|
|
type: "bi.button_tree", |
|
|
|
type: "bi.loader", |
|
|
|
|
|
|
|
isDefaultInit: true, |
|
|
|
chooseType: o.chooseType, |
|
|
|
chooseType: o.chooseType, |
|
|
|
layouts: [{ |
|
|
|
el: { |
|
|
|
type: "bi.vertical" |
|
|
|
type: "bi.button_tree", |
|
|
|
}] |
|
|
|
behaviors: o.behaviors, |
|
|
|
|
|
|
|
layouts: [{ |
|
|
|
|
|
|
|
type: "bi.vertical" |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
hasNext: function () { |
|
|
|
|
|
|
|
return hasNext; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.tree.on(BI.Controller.EVENT_CHANGE, function (type, v) { |
|
|
|
this.tree.on(BI.Controller.EVENT_CHANGE, function (type, v) { |
|
|
@ -67384,7 +67729,7 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
populate: function (nodes) { |
|
|
|
populate: function (nodes) { |
|
|
|
this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0)); |
|
|
|
BI.isNull(nodes) ? this.tree.populate() : this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0)); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
setValue: function (v) { |
|
|
@ -67441,7 +67786,19 @@ BI.MultiLayerSingleTreePopup = BI.inherit(BI.Pane, { |
|
|
|
type: "bi.multilayer_single_level_tree", |
|
|
|
type: "bi.multilayer_single_level_tree", |
|
|
|
isDefaultInit: o.isDefaultInit, |
|
|
|
isDefaultInit: o.isDefaultInit, |
|
|
|
items: o.items, |
|
|
|
items: o.items, |
|
|
|
itemsCreator: o.itemsCreator, |
|
|
|
itemsCreator: function (op, callback) { |
|
|
|
|
|
|
|
(op.times === 1 && !op.node) && BI.nextTick(function () { |
|
|
|
|
|
|
|
self.loading(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
o.itemsCreator(op, function (ob) { |
|
|
|
|
|
|
|
self._populate(ob.items); |
|
|
|
|
|
|
|
callback(ob); |
|
|
|
|
|
|
|
(op.times === 1 && !op.node) && BI.nextTick(function () { |
|
|
|
|
|
|
|
self.loaded(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
keywordGetter: o.keywordGetter, |
|
|
|
value: o.value, |
|
|
|
value: o.value, |
|
|
|
scrollable: null |
|
|
|
scrollable: null |
|
|
|
}); |
|
|
|
}); |
|
|
@ -67466,6 +67823,10 @@ BI.MultiLayerSingleTreePopup = BI.inherit(BI.Pane, { |
|
|
|
this.check(); |
|
|
|
this.check(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_populate: function() { |
|
|
|
|
|
|
|
BI.MultiLayerSingleTreePopup.superclass.populate.apply(this, arguments); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
getValue: function () { |
|
|
|
return this.tree.getValue(); |
|
|
|
return this.tree.getValue(); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -67476,13 +67837,135 @@ BI.MultiLayerSingleTreePopup = BI.inherit(BI.Pane, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
populate: function (items) { |
|
|
|
BI.MultiLayerSingleTreePopup.superclass.populate.apply(this, arguments); |
|
|
|
this._populate(items); |
|
|
|
this.tree.populate(items); |
|
|
|
this.tree.populate(items); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
BI.MultiLayerSingleTreePopup.EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
BI.MultiLayerSingleTreePopup.EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
BI.shortcut("bi.multilayer_single_tree_popup", BI.MultiLayerSingleTreePopup);/** |
|
|
|
BI.shortcut("bi.multilayer_single_tree_popup", BI.MultiLayerSingleTreePopup);/** |
|
|
|
|
|
|
|
* Created by Windy on 2018/2/2. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
props: { |
|
|
|
|
|
|
|
extraCls: "bi-multi-layer-single-tree-trigger bi-border bi-focus-shadow", |
|
|
|
|
|
|
|
height: 24, |
|
|
|
|
|
|
|
valueFormatter: function (v) { |
|
|
|
|
|
|
|
return v; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
itemsCreator: BI.emptyFn |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
|
|
|
var content = { |
|
|
|
|
|
|
|
type: "bi.htape", |
|
|
|
|
|
|
|
items: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.searcher", |
|
|
|
|
|
|
|
ref: function () { |
|
|
|
|
|
|
|
self.searcher = this; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
isAutoSearch: false, |
|
|
|
|
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.state_editor", |
|
|
|
|
|
|
|
ref: function () { |
|
|
|
|
|
|
|
self.editor = this; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
text: this._digest(o.value), |
|
|
|
|
|
|
|
value: o.value, |
|
|
|
|
|
|
|
height: o.height, |
|
|
|
|
|
|
|
tipText: "" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
popup: { |
|
|
|
|
|
|
|
type: "bi.multilayer_single_tree_popup", |
|
|
|
|
|
|
|
itemsCreator: function (op, callback) { |
|
|
|
|
|
|
|
op.keyword = self.editor.getValue(); |
|
|
|
|
|
|
|
o.itemsCreator(op, callback); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
keywordGetter: function () { |
|
|
|
|
|
|
|
return self.editor.getValue(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
cls: "bi-card" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
onSearch: function (obj, callback) { |
|
|
|
|
|
|
|
var keyword = obj.keyword; |
|
|
|
|
|
|
|
if(o.itemsCreator === BI.emptyFn) { |
|
|
|
|
|
|
|
var finding = BI.Func.getSearchResult(o.items, keyword); |
|
|
|
|
|
|
|
var matched = finding.match, find = finding.find; |
|
|
|
|
|
|
|
callback(find.concat(matched)); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
callback(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
listeners: [{ |
|
|
|
|
|
|
|
eventName: BI.Searcher.EVENT_CHANGE, |
|
|
|
|
|
|
|
action: function () { |
|
|
|
|
|
|
|
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.layout", |
|
|
|
|
|
|
|
width: 24 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
width: 24 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return o.allowEdit ? content : { |
|
|
|
|
|
|
|
type: "bi.absolute", |
|
|
|
|
|
|
|
items: [{ |
|
|
|
|
|
|
|
el: content, |
|
|
|
|
|
|
|
left: 0, |
|
|
|
|
|
|
|
right: 0, |
|
|
|
|
|
|
|
top: 0, |
|
|
|
|
|
|
|
bottom: 0 |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.layout" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
left: 0, |
|
|
|
|
|
|
|
right: 24, |
|
|
|
|
|
|
|
top: 0, |
|
|
|
|
|
|
|
bottom: 0 |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_digest: function (v) { |
|
|
|
|
|
|
|
return this.options.valueFormatter(v); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stopEditing: function () { |
|
|
|
|
|
|
|
this.searcher.stopSearch(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getSearcher: function () { |
|
|
|
|
|
|
|
return this.searcher; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
|
|
|
|
this.options.items = items; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
|
|
|
|
this.editor.setState(this._digest(v[0])); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
|
|
|
|
return this.searcher.getValue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING"; |
|
|
|
|
|
|
|
BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP"; |
|
|
|
|
|
|
|
BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START"; |
|
|
|
|
|
|
|
BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
|
|
|
|
BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/** |
|
|
|
* 加号表示的组节点 |
|
|
|
* 加号表示的组节点 |
|
|
|
* |
|
|
|
* |
|
|
|
* Created by GUY on 2016/1/27. |
|
|
|
* Created by GUY on 2016/1/27. |
|
|
@ -73082,6 +73565,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
searcher: { |
|
|
|
searcher: { |
|
|
|
type: "bi.multi_tree_searcher", |
|
|
|
type: "bi.multi_tree_searcher", |
|
|
|
|
|
|
|
text: o.text, |
|
|
|
itemsCreator: o.itemsCreator, |
|
|
|
itemsCreator: o.itemsCreator, |
|
|
|
popup: { |
|
|
|
popup: { |
|
|
|
type: "bi.multi_tree_search_insert_pane", |
|
|
|
type: "bi.multi_tree_search_insert_pane", |
|
|
@ -73361,6 +73845,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { |
|
|
|
this.trigger = BI.createWidget({ |
|
|
|
this.trigger = BI.createWidget({ |
|
|
|
type: "bi.multi_select_trigger", |
|
|
|
type: "bi.multi_select_trigger", |
|
|
|
allowEdit: o.allowEdit, |
|
|
|
allowEdit: o.allowEdit, |
|
|
|
|
|
|
|
text: o.text, |
|
|
|
height: o.height, |
|
|
|
height: o.height, |
|
|
|
valueFormatter: o.valueFormatter, |
|
|
|
valueFormatter: o.valueFormatter, |
|
|
|
// adapter: this.popup,
|
|
|
|
// adapter: this.popup,
|
|
|
@ -74161,6 +74646,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, { |
|
|
|
height: o.height, |
|
|
|
height: o.height, |
|
|
|
el: { |
|
|
|
el: { |
|
|
|
type: "bi.simple_state_editor", |
|
|
|
type: "bi.simple_state_editor", |
|
|
|
|
|
|
|
text: o.text, |
|
|
|
height: o.height |
|
|
|
height: o.height |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|