fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

103 lines
2.4 KiB

import { CenterAdaptLayout, shortcut, extend, createWidget, LogicFactory, Direction } from "@/core";
import { Icon, Label, BasicButton } from "@/base";
/**
* @deprecated
*/
@shortcut()
export class IconTreeLeafItem extends BasicButton {
static xtype = "bi.icon_tree_leaf_item";
_defaultConfig() {
return extend(super._defaultConfig(...arguments), {
extraCls: "bi-icon-tree-leaf-item bi-list-item-active",
logic: {
dynamic: false,
},
height: 24,
iconWidth: 16,
iconHeight: 16,
iconCls: "",
});
}
_init() {
super._init(...arguments);
const o = this.options;
const icon = createWidget({
type: CenterAdaptLayout.xtype,
width: 24,
cls: o.iconCls,
items: [
{
type: Icon.xtype,
width: o.iconWidth,
height: o.iconHeight,
}
],
});
this.text = createWidget({
type: Label.xtype,
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword,
});
const type = LogicFactory.createLogicTypeByDirection(Direction.Left);
const items = LogicFactory.createLogicItemsByDirection(
Direction.Left,
{
width: 16,
el: icon,
},
{
el: this.text,
}
);
createWidget(
extend(
{
element: this,
},
LogicFactory.createLogic(
type,
extend(o.logic, {
items,
hgap: 5,
})
)
)
);
}
doRedMark() {
this.text.doRedMark(...arguments);
}
unRedMark() {
this.text.unRedMark(...arguments);
}
doHighLight() {
this.text.doHighLight(...arguments);
}
unHighLight() {
this.text.unHighLight(...arguments);
}
getId() {
return this.options.id;
}
getPId() {
return this.options.pId;
}
}