zsmj 2 years ago
parent
commit
aa3d0eb035
  1. 13
      src/case/button/node/treenode.js
  2. 10
      src/case/button/treeitem/treeitem.js

13
src/case/button/node/treenode.js

@ -1,5 +1,6 @@
import { NodeButton } from "../../../base/single/button/button.node"; import { Label, NodeButton } from "@/base";
import { shortcut, extend } from "../../../core"; import { shortcut, extend, VerticalAdaptLayout } from "@/core";
import { TreeNodeSwitcher } from "@/case";
@shortcut() @shortcut()
export class BasicTreeNode extends NodeButton { export class BasicTreeNode extends NodeButton {
@ -27,7 +28,7 @@ export class BasicTreeNode extends NodeButton {
const o = this.options; const o = this.options;
const checkbox = { const checkbox = {
type: "bi.tree_node_switcher", type: TreeNodeSwitcher.xtype,
ref: _ref => { ref: _ref => {
this.switcher = _ref; this.switcher = _ref;
}, },
@ -39,7 +40,7 @@ export class BasicTreeNode extends NodeButton {
layer: o.layer, layer: o.layer,
...o.switcherIcon, ...o.switcherIcon,
stopPropagation: o.selectable, stopPropagation: o.selectable,
mounted () { mounted() {
this.setEnable(true); this.setEnable(true);
}, },
listeners: [ listeners: [
@ -55,7 +56,7 @@ export class BasicTreeNode extends NodeButton {
}; };
return { return {
type: "bi.vertical_adapt", type: VerticalAdaptLayout.xtype,
columnSize: [o.iconWrapperWidth || o.height, "fill"], columnSize: [o.iconWrapperWidth || o.height, "fill"],
items: [ items: [
{ {
@ -63,7 +64,7 @@ export class BasicTreeNode extends NodeButton {
lgap: o.layer * BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT / 2, // 偏移公式为每一层的偏移量为节点高度的一半 lgap: o.layer * BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT / 2, // 偏移公式为每一层的偏移量为节点高度的一半
}, { }, {
el: { el: {
type: "bi.label", type: Label.xtype,
ref: _ref => { ref: _ref => {
this.text = _ref; this.text = _ref;
}, },

10
src/case/button/treeitem/treeitem.js

@ -1,5 +1,5 @@
import { NodeButton } from "../../../base/single/button/button.node"; import { shortcut, extend, VerticalAdaptLayout, Layout } from "@/core";
import { shortcut, extend } from "../../../core"; import { NodeButton, Label } from "@/base";
@shortcut() @shortcut()
export class BasicTreeItem extends NodeButton { export class BasicTreeItem extends NodeButton {
@ -23,12 +23,12 @@ export class BasicTreeItem extends NodeButton {
const o = this.options; const o = this.options;
return { return {
type: "bi.vertical_adapt", type: VerticalAdaptLayout.xtype,
columnSize: ["", "fill"], columnSize: ["", "fill"],
items: [ items: [
{ {
el: { el: {
type: "bi.layout", type: Layout.xtype,
height: o.height, height: o.height,
width: o.height, width: o.height,
cls: this.getLineCls(), cls: this.getLineCls(),
@ -37,7 +37,7 @@ export class BasicTreeItem extends NodeButton {
}, },
{ {
el: { el: {
type: "bi.label", type: Label.xtype,
ref: _ref => { ref: _ref => {
this.text = _ref; this.text = _ref;
}, },

Loading…
Cancel
Save