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.

101 lines
2.4 KiB

import { CenterAdaptLayout, shortcut, extend, createWidget } from "@/core";
import { Icon, Label, BasicButton } from "@/base";
@shortcut()
export class IconTreeLeafItem extends BasicButton {
static xtype = "bi.icon_tree_leaf_item";
_defaultConfig() {
return extend(super._defaultConfig(...arguments), {
8 years ago
extraCls: "bi-icon-tree-leaf-item bi-list-item-active",
logic: {
dynamic: false,
8 years ago
},
6 years ago
height: 24,
8 years ago
iconWidth: 16,
iconHeight: 16,
iconCls: "",
7 years ago
});
}
8 years ago
_init() {
super._init(...arguments);
const o = this.options;
8 years ago
const icon = createWidget({
type: CenterAdaptLayout.xtype,
width: 24,
8 years ago
cls: o.iconCls,
items: [
{
type: Icon.xtype,
width: o.iconWidth,
height: o.iconHeight,
},
],
8 years ago
});
this.text = createWidget({
type: Label.xtype,
8 years ago
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,
8 years ago
});
const type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
const items = BI.LogicFactory.createLogicItemsByDirection(
BI.Direction.Left,
{
width: 16,
el: icon,
},
{
el: this.text,
}
);
createWidget(
extend(
{
element: this,
},
BI.LogicFactory.createLogic(
type,
extend(o.logic, {
items,
hgap: 5,
})
)
)
);
}
8 years ago
doRedMark() {
this.text.doRedMark(...arguments);
}
8 years ago
unRedMark() {
this.text.unRedMark(...arguments);
}
8 years ago
doHighLight() {
this.text.doHighLight(...arguments);
}
8 years ago
unHighLight() {
this.text.unHighLight(...arguments);
}
8 years ago
getId() {
8 years ago
return this.options.id;
}
8 years ago
getPId() {
8 years ago
return this.options.pId;
}
}