zsmj
2 years ago
11 changed files with 193 additions and 542 deletions
@ -1,105 +0,0 @@
|
||||
import { BasicButton } from "../../../base/single/button/button.basic"; |
||||
import { shortcut, extend, createWidget } from "../../../core"; |
||||
|
||||
@shortcut() |
||||
export class FirstTreeLeafItem extends BasicButton { |
||||
static xtype = "bi.first_tree_leaf_item"; |
||||
|
||||
_defaultConfig() { |
||||
return extend(super._defaultConfig(...arguments), { |
||||
extraCls: "bi-first-tree-leaf-item bi-list-item-active", |
||||
logic: { |
||||
dynamic: false, |
||||
}, |
||||
id: "", |
||||
pId: "", |
||||
layer: 0, |
||||
height: 24, |
||||
}); |
||||
} |
||||
|
||||
_init() { |
||||
super._init(...arguments); |
||||
const o = this.options; |
||||
this.text = createWidget({ |
||||
type: "bi.label", |
||||
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 = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left); |
||||
const items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, ((o.layer === 0) ? "" : { |
||||
width: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT / 2, |
||||
el: { |
||||
type: "bi.layout", |
||||
cls: (o.pNode && o.pNode.isLastNode) ? "" : this._getBaseLineCls(), |
||||
width: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT / 2, |
||||
height: o.height, |
||||
}, |
||||
}), { |
||||
width: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, |
||||
el: { |
||||
type: "bi.layout", |
||||
cls: this._getFirstLineCls(), |
||||
width: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, |
||||
height: o.height, |
||||
}, |
||||
}, { |
||||
el: this.text, |
||||
}); |
||||
createWidget(extend({ |
||||
element: this, |
||||
}, BI.LogicFactory.createLogic(type, extend(o.logic, { |
||||
items, |
||||
})))); |
||||
} |
||||
|
||||
_getBaseLineCls() { |
||||
switch (BI.STYLE_CONSTANTS.LINK_LINE_TYPE) { |
||||
case "solid": |
||||
return "base-solid-line-conn-background"; |
||||
default: |
||||
return "base-line-conn-background"; |
||||
} |
||||
} |
||||
|
||||
_getFirstLineCls() { |
||||
switch (BI.STYLE_CONSTANTS.LINK_LINE_TYPE) { |
||||
case "solid": |
||||
return "first-solid-line-conn-background"; |
||||
default: |
||||
return "first-line-conn-background"; |
||||
} |
||||
} |
||||
|
||||
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; |
||||
} |
||||
} |
||||
|
@ -1,105 +0,0 @@
|
||||
import { BasicButton } from "../../../base/single/button/button.basic"; |
||||
import { shortcut, extend, createWidget } from "../../../core"; |
||||
|
||||
@shortcut() |
||||
export class LastTreeLeafItem extends BasicButton { |
||||
static xtype = "bi.last_tree_leaf_item"; |
||||
|
||||
_defaultConfig() { |
||||
return extend(super._defaultConfig(...arguments), { |
||||
extraCls: "bi-last-tree-leaf-item bi-list-item-active", |
||||
logic: { |
||||
dynamic: false, |
||||
}, |
||||
id: "", |
||||
pId: "", |
||||
layer: 0, |
||||
height: 24, |
||||
}); |
||||
} |
||||
|
||||
_init() { |
||||
super._init(...arguments); |
||||
const o = this.options; |
||||
this.text = createWidget({ |
||||
type: "bi.label", |
||||
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 = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left); |
||||
const items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, ((o.layer === 0) ? "" : { |
||||
width: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT / 2, |
||||
el: { |
||||
type: "bi.layout", |
||||
cls: (o.pNode && o.pNode.isLastNode) ? "" : this._getBaseLineCls(), |
||||
width: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT / 2, |
||||
height: o.height, |
||||
}, |
||||
}), { |
||||
width: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, |
||||
el: { |
||||
type: "bi.layout", |
||||
cls: this._getLastLineCls(), |
||||
width: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, |
||||
height: o.height, |
||||
}, |
||||
}, { |
||||
el: this.text, |
||||
}); |
||||
createWidget(extend({ |
||||
element: this, |
||||
}, BI.LogicFactory.createLogic(type, extend(o.logic, { |
||||
items, |
||||
})))); |
||||
} |
||||
|
||||
_getBaseLineCls() { |
||||
switch (BI.STYLE_CONSTANTS.LINK_LINE_TYPE) { |
||||
case "solid": |
||||
return "base-solid-line-conn-background"; |
||||
default: |
||||
return "base-line-conn-background"; |
||||
} |
||||
} |
||||
|
||||
_getLastLineCls() { |
||||
switch (BI.STYLE_CONSTANTS.LINK_LINE_TYPE) { |
||||
case "solid": |
||||
return "last-solid-line-conn-background"; |
||||
default: |
||||
return "last-line-conn-background"; |
||||
} |
||||
} |
||||
|
||||
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; |
||||
} |
||||
} |
||||
|
@ -1,105 +0,0 @@
|
||||
import { BasicButton } from "../../../base/single/button/button.basic"; |
||||
import { shortcut, extend, createWidget } from "../../../core"; |
||||
|
||||
@shortcut() |
||||
export class MidTreeLeafItem extends BasicButton { |
||||
static xtype = "bi.mid_tree_leaf_item"; |
||||
|
||||
_defaultConfig() { |
||||
return extend(super._defaultConfig(...arguments), { |
||||
extraCls: "bi-mid-tree-leaf-item bi-list-item-active", |
||||
logic: { |
||||
dynamic: false, |
||||
}, |
||||
id: "", |
||||
pId: "", |
||||
layer: 0, |
||||
height: 24, |
||||
}); |
||||
} |
||||
|
||||
_init() { |
||||
super._init(...arguments); |
||||
const o = this.options; |
||||
this.text = createWidget({ |
||||
type: "bi.label", |
||||
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 = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left); |
||||
const items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, ((o.layer === 0) ? "" : { |
||||
width: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT / 2, |
||||
el: { |
||||
type: "bi.layout", |
||||
cls: (o.pNode && o.pNode.isLastNode) ? "" : this._getBaseLineCls(), |
||||
width: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT / 2, |
||||
height: o.height, |
||||
}, |
||||
}), { |
||||
width: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, |
||||
el: { |
||||
type: "bi.layout", |
||||
cls: this._getMidLineCls(), |
||||
width: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, |
||||
height: o.height, |
||||
}, |
||||
}, { |
||||
el: this.text, |
||||
}); |
||||
createWidget(extend({ |
||||
element: this, |
||||
}, BI.LogicFactory.createLogic(type, extend(o.logic, { |
||||
items, |
||||
})))); |
||||
} |
||||
|
||||
_getBaseLineCls() { |
||||
switch (BI.STYLE_CONSTANTS.LINK_LINE_TYPE) { |
||||
case "solid": |
||||
return "base-solid-line-conn-background"; |
||||
default: |
||||
return "base-line-conn-background"; |
||||
} |
||||
} |
||||
|
||||
_getMidLineCls() { |
||||
switch (BI.STYLE_CONSTANTS.LINK_LINE_TYPE) { |
||||
case "solid": |
||||
return "mid-solid-line-conn-background"; |
||||
default: |
||||
return "mid-line-conn-background"; |
||||
} |
||||
} |
||||
|
||||
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; |
||||
} |
||||
} |
||||
|
@ -1,78 +0,0 @@
|
||||
import { BasicButton } from "../../../base/single/button/button.basic"; |
||||
import { shortcut, extend } from "../../../core"; |
||||
|
||||
@shortcut() |
||||
export class RootTreeLeafItem extends BasicButton { |
||||
static xtype = "bi.root_tree_leaf_item"; |
||||
|
||||
props = { |
||||
baseCls: "bi-root-tree-leaf-item bi-list-item-active", |
||||
logic: { |
||||
dynamic: false, |
||||
}, |
||||
id: "", |
||||
pId: "", |
||||
layer: 0, |
||||
height: 24, |
||||
} |
||||
|
||||
render() { |
||||
const o = this.options; |
||||
const text = { |
||||
type: "bi.label", |
||||
ref: _ref => { |
||||
this.text = _ref; |
||||
}, |
||||
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 = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left); |
||||
const items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, { |
||||
width: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, |
||||
el: { |
||||
type: "bi.layout", |
||||
width: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, |
||||
height: o.height, |
||||
}, |
||||
}, { |
||||
el: text, |
||||
}); |
||||
|
||||
return BI.LogicFactory.createLogic(type, extend(o.logic, { |
||||
items, |
||||
})); |
||||
} |
||||
|
||||
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; |
||||
} |
||||
} |
||||
|
@ -1,76 +0,0 @@
|
||||
import { BasicButton } from "../../../base/single/button/button.basic"; |
||||
import { shortcut, extend, createWidget } from "../../../core"; |
||||
|
||||
/** |
||||
* 树叶子节点 |
||||
* Created by GUY on 2015/9/6. |
||||
* @class BI.TreeTextLeafItem |
||||
* @extends BI.BasicButton |
||||
*/ |
||||
@shortcut() |
||||
export class TreeTextLeafItem extends BasicButton { |
||||
static xtype = "bi.tree_text_leaf_item"; |
||||
|
||||
_defaultConfig() { |
||||
return extend(super._defaultConfig.apply(this, arguments), { |
||||
extraCls: "bi-tree-text-leaf-item bi-list-item-active", |
||||
id: "", |
||||
pId: "", |
||||
height: 24, |
||||
hgap: 0, |
||||
lgap: 0, |
||||
rgap: 0, |
||||
}); |
||||
} |
||||
|
||||
_init() { |
||||
super._init(...arguments); |
||||
const o = this.options; |
||||
this.text = createWidget({ |
||||
type: "bi.label", |
||||
textAlign: "left", |
||||
whiteSpace: "nowrap", |
||||
textHeight: o.height, |
||||
height: o.height, |
||||
hgap: o.hgap, |
||||
lgap: o.lgap, |
||||
rgap: o.hgap, |
||||
text: o.text, |
||||
value: o.value, |
||||
py: o.py, |
||||
keyword: o.keyword, |
||||
}); |
||||
createWidget({ |
||||
type: "bi.htape", |
||||
element: this, |
||||
items: [{ |
||||
el: this.text, |
||||
}], |
||||
}); |
||||
} |
||||
|
||||
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; |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue