|
|
|
@ -1,9 +1,14 @@
|
|
|
|
|
import { IconTreeLeafItem } from "./item.icon.treeleaf"; |
|
|
|
|
import { Layout, HorizontalAdaptLayout, shortcut, extend, createWidget, Controller, makeArray, count, Events } from "@/core"; |
|
|
|
|
import { BasicButton } from "@/base"; |
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
shortcut, |
|
|
|
|
extend, |
|
|
|
|
} from "@/core"; |
|
|
|
|
import { BasicTreeItem } from "./treeitem"; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @deprecated |
|
|
|
|
*/ |
|
|
|
|
@shortcut() |
|
|
|
|
export class MultiLayerIconTreeLeafItem extends BasicButton { |
|
|
|
|
export class MultiLayerIconTreeLeafItem extends BasicTreeItem { |
|
|
|
|
static xtype = "bi.multilayer_icon_tree_leaf_item"; |
|
|
|
|
|
|
|
|
|
_defaultConfig() { |
|
|
|
@ -14,89 +19,8 @@ export class MultiLayerIconTreeLeafItem extends BasicButton {
|
|
|
|
|
iconCls: "", |
|
|
|
|
iconHeight: 16, |
|
|
|
|
iconWidth: 16, |
|
|
|
|
showLine: false, |
|
|
|
|
indentWidth: 0 |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_init() { |
|
|
|
|
super._init(...arguments); |
|
|
|
|
const o = this.options; |
|
|
|
|
this.item = createWidget({ |
|
|
|
|
type: IconTreeLeafItem.xtype, |
|
|
|
|
cls: "bi-list-item-none", |
|
|
|
|
iconCls: o.iconCls, |
|
|
|
|
id: o.id, |
|
|
|
|
pId: o.pId, |
|
|
|
|
isFront: true, |
|
|
|
|
height: o.height, |
|
|
|
|
hgap: o.hgap, |
|
|
|
|
text: o.text, |
|
|
|
|
value: o.value, |
|
|
|
|
py: o.py, |
|
|
|
|
keyword: o.keyword, |
|
|
|
|
iconWidth: o.iconWidth, |
|
|
|
|
iconHeight: o.iconHeight, |
|
|
|
|
}); |
|
|
|
|
this.item.on(Controller.EVENT_CHANGE, (...args) => { |
|
|
|
|
const [type] = args; |
|
|
|
|
if (type === Events.CLICK) { |
|
|
|
|
// 本身实现click功能
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.fireEvent(Controller.EVENT_CHANGE, ...args); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const items = []; |
|
|
|
|
count(0, o.layer, () => { |
|
|
|
|
items.push({ |
|
|
|
|
type: Layout.xtype, |
|
|
|
|
width: 15, |
|
|
|
|
height: o.height, |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
items.push(this.item); |
|
|
|
|
createWidget({ |
|
|
|
|
type: HorizontalAdaptLayout.xtype, |
|
|
|
|
element: this, |
|
|
|
|
columnSize: makeArray(o.layer, 15), |
|
|
|
|
items, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
doRedMark() { |
|
|
|
|
this.item.doRedMark(...arguments); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unRedMark() { |
|
|
|
|
this.item.unRedMark(...arguments); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
doHighLight() { |
|
|
|
|
this.item.doHighLight(...arguments); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unHighLight() { |
|
|
|
|
this.item.unHighLight(...arguments); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getId() { |
|
|
|
|
return this.options.id; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getPId() { |
|
|
|
|
return this.options.pId; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
doClick() { |
|
|
|
|
super.doClick(...arguments); |
|
|
|
|
this.item.setSelected(this.isSelected()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
setSelected(v) { |
|
|
|
|
super.setSelected(...arguments); |
|
|
|
|
this.item.setSelected(v); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getValue() { |
|
|
|
|
return this.options.value; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|