@web-utils/component 2.0.12 → 2.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/3a79781b.js +75 -0
- package/dist/chunks/{44b78389.js → 41a066be.js} +8 -8
- package/dist/chunks/{e1939731.js → 5a78e0db.js} +5 -6
- package/dist/chunks/5d4282fb.js +30 -0
- package/dist/chunks/{822300f3.js → 61ad06b2.js} +3 -3
- package/dist/chunks/76680a03.js +24 -0
- package/dist/chunks/8c0142e0.js +81 -0
- package/dist/chunks/97652d86.js +26 -0
- package/dist/chunks/b4acd3a6.js +126 -0
- package/dist/chunks/f71045fc.js +184 -0
- package/dist/components/address-input/index.js +43 -56
- package/dist/components/address-input/style.css +1 -15
- package/dist/components/aside-menu/index.js +30 -36
- package/dist/components/aside-menu/style.css +1 -9
- package/dist/components/awesome-button/index.js +32 -35
- package/dist/components/base.css +1 -66
- package/dist/components/capsule-tab/index.js +27 -33
- package/dist/components/capsule-tab/style.css +1 -32
- package/dist/components/chunk-file-uploader/index.js +54 -88
- package/dist/components/chunk-file-uploader/style.css +1 -4
- package/dist/components/chunk-file-uploader-button/index.js +25 -31
- package/dist/components/chunk-file-uploader-button/style.css +1 -17
- package/dist/components/chunk-file-uploader-drop/index.js +28 -42
- package/dist/components/chunk-file-uploader-drop/style.css +1 -12
- package/dist/components/chunk-file-uploader-file/index.js +134 -212
- package/dist/components/chunk-file-uploader-file/style.css +1 -125
- package/dist/components/chunk-file-uploader-files/index.js +28 -34
- package/dist/components/chunk-file-uploader-files/style.css +1 -9
- package/dist/components/chunk-file-uploader-list/index.js +29 -35
- package/dist/components/chunk-file-uploader-list/style.css +1 -9
- package/dist/components/chunk-file-uploader-un-support/index.js +30 -38
- package/dist/components/chunk-file-uploader-un-support/style.css +1 -6
- package/dist/components/code-mirror-editor/index.js +153 -181
- package/dist/components/code-mirror-editor/style.css +1 -17
- package/dist/components/color-picker/index.js +49 -68
- package/dist/components/confirm-button/index.js +19 -21
- package/dist/components/confirmable/index.js +18 -19
- package/dist/components/context-menu/index.js +108 -130
- package/dist/components/context-menu/style.css +1 -88
- package/dist/components/custom-scrollbar/index.js +49 -67
- package/dist/components/data-table-picker/index.js +62 -81
- package/dist/components/dynamic-table/index.js +89 -113
- package/dist/components/dynamic-table/style.css +1 -30
- package/dist/components/e-charts/index.js +120 -201
- package/dist/components/e-charts/style.css +1 -10
- package/dist/components/editable-progress/index.js +60 -93
- package/dist/components/editable-progress/style.css +1 -37
- package/dist/components/editable-tree/index.js +423 -638
- package/dist/components/editable-tree/style.css +1 -82
- package/dist/components/egd-collapse/index.js +33 -46
- package/dist/components/egd-collapse-item/index.js +60 -76
- package/dist/components/element-dialog/index.js +95 -147
- package/dist/components/element-dialog/style.css +1 -102
- package/dist/components/empty-view/index.js +28 -34
- package/dist/components/empty-view/style.css +1 -17
- package/dist/components/error-view/index.js +26 -32
- package/dist/components/error-view/style.css +1 -17
- package/dist/components/flex-column/index.js +25 -40
- package/dist/components/flex-item/index.js +29 -57
- package/dist/components/flex-row/index.js +25 -40
- package/dist/components/flex-scroller/index.js +26 -32
- package/dist/components/flex-scroller/style.css +1 -20
- package/dist/components/form-button/index.js +34 -38
- package/dist/components/form-cascader/index.js +71 -81
- package/dist/components/form-checkbox-group/index.js +88 -113
- package/dist/components/form-checkbox-group/style.css +1 -51
- package/dist/components/form-date-picker/index.js +70 -132
- package/dist/components/form-holder/index.js +32 -39
- package/dist/components/form-input/index.js +56 -62
- package/dist/components/form-input-email/index.js +48 -60
- package/dist/components/form-input-id-card/index.js +53 -59
- package/dist/components/form-input-number/index.js +61 -68
- package/dist/components/form-input-number/style.css +1 -12
- package/dist/components/form-input-phone-number/index.js +49 -55
- package/dist/components/form-input-time/index.js +53 -59
- package/dist/components/form-item/index.js +80 -123
- package/dist/components/form-item/style.css +1 -11
- package/dist/components/form-item-config-provider/index.js +25 -26
- package/dist/components/form-item-group/index.js +85 -111
- package/dist/components/form-item-group/style.css +1 -30
- package/dist/components/form-radio-group/index.js +85 -104
- package/dist/components/form-radio-group/style.css +1 -53
- package/dist/components/form-select/index.js +76 -91
- package/dist/components/form-switch/index.js +51 -57
- package/dist/components/form-textarea/index.js +51 -57
- package/dist/components/form-view/index.js +165 -232
- package/dist/components/form-view/style.css +1 -158
- package/dist/components/guide-steps/index.js +44 -58
- package/dist/components/guide-steps/style.css +1 -34
- package/dist/components/icon-card/index.js +29 -35
- package/dist/components/icon-card/style.css +1 -56
- package/dist/components/iframe-window/index.js +29 -35
- package/dist/components/iframe-window/style.css +1 -20
- package/dist/components/image-viewer/index.js +48 -66
- package/dist/components/image-viewer/style.css +1 -21
- package/dist/components/input-number/index.js +127 -193
- package/dist/components/input-number/style.css +1 -15
- package/dist/components/input-number-range/index.js +45 -57
- package/dist/components/input-number-range/style.css +1 -12
- package/dist/components/j-s-x-component/index.js +4 -4
- package/dist/components/keep-view-alive/index.js +73 -120
- package/dist/components/loading-view/index.js +26 -32
- package/dist/components/loading-view/style.css +1 -17
- package/dist/components/nav-bar/index.js +27 -37
- package/dist/components/nav-bar/style.css +1 -17
- package/dist/components/not-implement/index.js +23 -31
- package/dist/components/not-implement/style.css +1 -15
- package/dist/components/page/index.js +22 -28
- package/dist/components/page/style.css +1 -12
- package/dist/components/page-header/index.js +30 -36
- package/dist/components/page-header/style.css +1 -14
- package/dist/components/page-index/index.js +62 -83
- package/dist/components/page-index/style.css +1 -23
- package/dist/components/page-index-top/index.js +53 -68
- package/dist/components/page-skeleton/index.js +31 -37
- package/dist/components/page-skeleton/style.css +1 -23
- package/dist/components/page-skeleton-new/index.js +42 -48
- package/dist/components/page-skeleton-new/style.css +1 -42
- package/dist/components/pageable-table/index.js +186 -253
- package/dist/components/pageable-table/style.css +1 -72
- package/dist/components/pageable-view/index.js +129 -199
- package/dist/components/pageable-view/style.css +1 -69
- package/dist/components/photo-swipe/index.js +110 -151
- package/dist/components/photo-swipe/style.css +1 -20
- package/dist/components/resize-observer/index.js +34 -68
- package/dist/components/resize-observer/style.css +1 -31
- package/dist/components/search-popover/index.js +153 -211
- package/dist/components/search-popover/style.css +1 -93
- package/dist/components/sign-panel/index.js +92 -142
- package/dist/components/sign-panel/style.css +1 -97
- package/dist/components/split-pane/index.js +101 -162
- package/dist/components/split-pane/style.css +1 -100
- package/dist/components/stateful/index.js +31 -34
- package/dist/components/stateful/style.css +1 -33
- package/dist/components/static-pageable-table/index.js +37 -44
- package/dist/components/static-pageable-table/style.css +1 -9
- package/dist/components/swiper/index.js +85 -150
- package/dist/components/swiper/style.css +1 -43
- package/dist/components/tab/index.js +54 -72
- package/dist/components/tab/style.css +1 -122
- package/dist/components/tab-item/index.js +30 -35
- package/dist/components/table-column/index.js +30 -32
- package/dist/components/table-view/index.js +156 -227
- package/dist/components/table-view/style.css +1 -95
- package/dist/components/tag-render/index.js +44 -58
- package/dist/components/tag-render/style.css +1 -33
- package/dist/components/tinymce-editor/index.js +79 -95
- package/dist/components/tinymce-editor/style.css +1 -43
- package/dist/components/tinymce-wrapper/index.js +92 -121
- package/dist/components/tinymce-wrapper/style.css +1 -36
- package/dist/components/toolbar/index.js +63 -84
- package/dist/components/toolbar/style.css +1 -39
- package/dist/components/toolbar-button/index.js +41 -48
- package/dist/components/toolbar-button/style.css +1 -21
- package/dist/components/trigger/index.js +29 -36
- package/dist/components/vue-tags-input/index.js +188 -308
- package/dist/components/vue-tags-input/style.css +1 -682
- package/dist/components/watermark/index.js +25 -37
- package/dist/components/watermark/style.css +1 -11
- package/dist/components/x-dialog/index.js +67 -93
- package/dist/components/x-dialog/style.css +1 -15
- package/dist/index.css +193 -1105
- package/dist/index.es.js +4790 -7243
- package/package.json +1 -2
- package/web-types.json +1 -1
- package/dist/chunks/3d28cc08.js +0 -57
- package/dist/chunks/5d33812d.js +0 -147
- package/dist/chunks/9d848bf6.js +0 -99
- package/dist/chunks/a0bb327b.js +0 -96
- package/dist/chunks/a8891d2c.js +0 -30
- package/dist/chunks/c69d5628.js +0 -248
- package/dist/chunks/de9fe802.js +0 -24
|
@@ -1,365 +1,355 @@
|
|
|
1
|
-
import { hasOwn, addResizeListener, removeResizeListener, isVerticalScrollbarVisible, scrollbarWidth, computePosition, isPlainObject, cloneDeep, isFunction, isUndefined, isNotEmpty, fastClone, delay, findTreeChildren } from "@web-utils/core";
|
|
2
|
-
import { a as
|
|
3
|
-
import { n as
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var _c = _vm._self._c || _h;
|
|
8
|
-
return _c("div", {
|
|
1
|
+
import { hasOwn as d, addResizeListener as h, removeResizeListener as u, isVerticalScrollbarVisible as x, scrollbarWidth as w, computePosition as N, isPlainObject as r, cloneDeep as p, isFunction as f, isUndefined as l, isNotEmpty as C, fastClone as v, delay as g, findTreeChildren as $ } from "@web-utils/core";
|
|
2
|
+
import { a as b, b as _, c } from "../../chunks/f71045fc.js";
|
|
3
|
+
import { n as k } from "../../chunks/5d4282fb.js";
|
|
4
|
+
var B = function() {
|
|
5
|
+
var e = this, t = e.$createElement, i = e._self._c || t;
|
|
6
|
+
return i("div", {
|
|
9
7
|
staticClass: "editable-tree"
|
|
10
|
-
}, [!
|
|
8
|
+
}, [!e.readonly && e.addRootNodeButtonStyle === "top-right" ? i("ElButton", {
|
|
11
9
|
staticStyle: {
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
position: "absolute",
|
|
11
|
+
top: "4px",
|
|
14
12
|
"z-index": "1"
|
|
15
13
|
},
|
|
16
14
|
style: {
|
|
17
|
-
right: `${
|
|
15
|
+
right: `${e.right}px`
|
|
18
16
|
},
|
|
19
17
|
attrs: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
type: "primary",
|
|
19
|
+
size: "mini",
|
|
20
|
+
icon: "el-icon-plus",
|
|
21
|
+
circle: "",
|
|
22
|
+
plain: ""
|
|
25
23
|
},
|
|
26
24
|
on: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return _vm.$emit("add-root-node");
|
|
25
|
+
click: function(a) {
|
|
26
|
+
return a.stopPropagation(), e.$emit("add-root-node");
|
|
30
27
|
}
|
|
31
28
|
}
|
|
32
|
-
}) :
|
|
29
|
+
}) : e._e(), i("div", {
|
|
33
30
|
ref: "treeWrapper",
|
|
34
31
|
staticClass: "et-tree-wrapper"
|
|
35
|
-
}, [!
|
|
32
|
+
}, [!e.readonly && e.addRootNodeButtonStyle === "top" ? i("div", {
|
|
36
33
|
staticStyle: {
|
|
37
34
|
"padding-left": "24px"
|
|
38
35
|
}
|
|
39
|
-
}, [
|
|
36
|
+
}, [i("ElButton", {
|
|
40
37
|
attrs: {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
disabled: e.loading,
|
|
39
|
+
size: "mini",
|
|
40
|
+
type: "text"
|
|
44
41
|
},
|
|
45
42
|
on: {
|
|
46
|
-
|
|
43
|
+
click: e.appendRootNode
|
|
47
44
|
}
|
|
48
|
-
}, [
|
|
45
|
+
}, [i("i", {
|
|
49
46
|
staticClass: "el-icon-lx-add"
|
|
50
|
-
}),
|
|
51
|
-
key:
|
|
47
|
+
}), e._v(" " + e._s(e.addRootNodeLabel ? e.addRootNodeLabel : `添加${e.label}`) + " ")])], 1) : e._e(), i("ElTree", e._g(e._b({
|
|
48
|
+
key: e.treeKey,
|
|
52
49
|
ref: "tree",
|
|
53
50
|
staticClass: "flex-item",
|
|
54
51
|
attrs: {
|
|
55
|
-
"default-expanded-keys":
|
|
56
|
-
"expand-on-click-node":
|
|
52
|
+
"default-expanded-keys": e.expandedKeys,
|
|
53
|
+
"expand-on-click-node": !1,
|
|
57
54
|
"highlight-current": "",
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"node-key":
|
|
55
|
+
load: e.loadNode,
|
|
56
|
+
data: e.innerTreeData,
|
|
57
|
+
props: e.treeProps,
|
|
58
|
+
lazy: e.lazy,
|
|
59
|
+
"node-key": e.nodeKey
|
|
63
60
|
},
|
|
64
61
|
on: {
|
|
65
|
-
"node-click":
|
|
66
|
-
"node-contextmenu":
|
|
67
|
-
"node-expand":
|
|
68
|
-
"node-collapse":
|
|
62
|
+
"node-click": e.nodeClick,
|
|
63
|
+
"node-contextmenu": e.showContextMenu,
|
|
64
|
+
"node-expand": e.addExpandKey,
|
|
65
|
+
"node-collapse": e.removeExpandKey
|
|
69
66
|
},
|
|
70
|
-
scopedSlots:
|
|
67
|
+
scopedSlots: e._u([{
|
|
71
68
|
key: "default",
|
|
72
|
-
fn: function(
|
|
73
|
-
var
|
|
74
|
-
return [
|
|
75
|
-
return [
|
|
69
|
+
fn: function(a) {
|
|
70
|
+
var o = a.node, s = a.data;
|
|
71
|
+
return [e._t("default", function() {
|
|
72
|
+
return [s.edit ? [i("span", {
|
|
73
|
+
staticClass: "custom-tree-node flex-row flex-item oh",
|
|
74
|
+
attrs: {
|
|
75
|
+
"data-id": s.id
|
|
76
|
+
}
|
|
77
|
+
}, [e.icon ? i("i", {
|
|
78
|
+
staticClass: "node-icon shrink-0",
|
|
79
|
+
class: s.loading ? "el-icon-loading" : "el-icon-edit-outline"
|
|
80
|
+
}) : e._e(), i("ElInput", {
|
|
81
|
+
ref: "labelTxt",
|
|
82
|
+
staticClass: "node-input flex-item",
|
|
83
|
+
attrs: {
|
|
84
|
+
size: "mini",
|
|
85
|
+
placeholder: e.defaultOptions.inputPlaceholder
|
|
86
|
+
},
|
|
87
|
+
on: {
|
|
88
|
+
blur: function(n) {
|
|
89
|
+
return e.inputBlur(n, o, s);
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
nativeOn: {
|
|
93
|
+
keyup: function(n) {
|
|
94
|
+
return function(y) {
|
|
95
|
+
return e.inputKeyup(y, o, s);
|
|
96
|
+
}.apply(null, arguments);
|
|
97
|
+
},
|
|
98
|
+
click: function(n) {
|
|
99
|
+
n.stopPropagation();
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
model: {
|
|
103
|
+
value: e.text,
|
|
104
|
+
callback: function(n) {
|
|
105
|
+
e.text = n;
|
|
106
|
+
},
|
|
107
|
+
expression: "text"
|
|
108
|
+
}
|
|
109
|
+
}), e.confirmButton ? [i("ElButton", {
|
|
110
|
+
directives: [{
|
|
111
|
+
name: "show",
|
|
112
|
+
rawName: "v-show",
|
|
113
|
+
value: !s.loading,
|
|
114
|
+
expression: "!data.loading"
|
|
115
|
+
}],
|
|
116
|
+
staticClass: "shrink-0",
|
|
117
|
+
attrs: {
|
|
118
|
+
size: "mini",
|
|
119
|
+
type: "text"
|
|
120
|
+
},
|
|
121
|
+
on: {
|
|
122
|
+
click: function(n) {
|
|
123
|
+
return n.stopPropagation(), e.onConfirm(o, s);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}, [e._v("确定")]), i("ElButton", {
|
|
127
|
+
directives: [{
|
|
128
|
+
name: "show",
|
|
129
|
+
rawName: "v-show",
|
|
130
|
+
value: !s.loading,
|
|
131
|
+
expression: "!data.loading"
|
|
132
|
+
}],
|
|
133
|
+
staticClass: "shrink-0",
|
|
134
|
+
attrs: {
|
|
135
|
+
size: "mini",
|
|
136
|
+
type: "text"
|
|
137
|
+
},
|
|
138
|
+
on: {
|
|
139
|
+
click: function(n) {
|
|
140
|
+
return n.stopPropagation(), e.onCancel(o, s);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}, [e._v("取消")])] : e._e()], 2)] : [i("span", {
|
|
76
144
|
staticClass: "custom-tree-node",
|
|
77
145
|
attrs: {
|
|
78
|
-
"data-id":
|
|
146
|
+
"data-id": s.id
|
|
79
147
|
}
|
|
80
|
-
}, [
|
|
148
|
+
}, [i("span", {
|
|
81
149
|
staticClass: "node-label flex-row flex-item oh ellipsis-1"
|
|
82
|
-
}, [
|
|
150
|
+
}, [e.icon ? i("i", {
|
|
83
151
|
staticClass: "node-icon",
|
|
84
|
-
class:
|
|
85
|
-
}) :
|
|
152
|
+
class: s.loading ? "el-icon-loading" : e.icon(s, o)
|
|
153
|
+
}) : e._e(), i("span", {
|
|
86
154
|
staticClass: "flex-item-relative",
|
|
87
155
|
staticStyle: {
|
|
88
|
-
|
|
156
|
+
height: "21px"
|
|
89
157
|
}
|
|
90
|
-
}, [
|
|
158
|
+
}, [i("span", {
|
|
91
159
|
staticClass: "ellipsis-1 absolute-box et-tree-label",
|
|
92
160
|
attrs: {
|
|
93
|
-
|
|
161
|
+
title: o.label
|
|
94
162
|
}
|
|
95
|
-
}, [
|
|
96
|
-
return [
|
|
163
|
+
}, [e._t("label", function() {
|
|
164
|
+
return [e._v(e._s(o.label))];
|
|
97
165
|
}, {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
})], 2)]),
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
})], 2), !
|
|
166
|
+
data: s,
|
|
167
|
+
node: o
|
|
168
|
+
})], 2)]), e._t("label-suffix", null, {
|
|
169
|
+
node: o,
|
|
170
|
+
data: s
|
|
171
|
+
})], 2), !e.contextMenu && !e.readonly ? i("span", {
|
|
104
172
|
directives: [{
|
|
105
173
|
name: "show",
|
|
106
174
|
rawName: "v-show",
|
|
107
|
-
value: !
|
|
175
|
+
value: !s.loading && !e.loading,
|
|
108
176
|
expression: "!data.loading && !loading"
|
|
109
177
|
}],
|
|
110
178
|
staticClass: "handle-actions"
|
|
111
|
-
}, [
|
|
179
|
+
}, [i("ElButton", {
|
|
112
180
|
attrs: {
|
|
113
|
-
|
|
114
|
-
|
|
181
|
+
size: "mini",
|
|
182
|
+
type: "text"
|
|
115
183
|
},
|
|
116
184
|
on: {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return _vm.appendChildNode(node, data);
|
|
185
|
+
click: function(n) {
|
|
186
|
+
return n.stopPropagation(), e.appendChildNode(o, s);
|
|
120
187
|
}
|
|
121
188
|
}
|
|
122
|
-
}, [
|
|
189
|
+
}, [e._v("添加")]), i("ElButton", {
|
|
123
190
|
attrs: {
|
|
124
|
-
|
|
125
|
-
|
|
191
|
+
size: "mini",
|
|
192
|
+
type: "text"
|
|
126
193
|
},
|
|
127
194
|
on: {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
return _vm.editNode(node, data);
|
|
195
|
+
click: function(n) {
|
|
196
|
+
return n.stopPropagation(), e.editNode(o, s);
|
|
131
197
|
}
|
|
132
198
|
}
|
|
133
|
-
}, [
|
|
199
|
+
}, [e._v("修改")]), i("ElPopconfirm", {
|
|
134
200
|
staticClass: "pop-confirm",
|
|
135
201
|
attrs: {
|
|
136
202
|
"icon-color": "red",
|
|
137
|
-
|
|
203
|
+
title: "你确定要删除吗?"
|
|
138
204
|
},
|
|
139
205
|
on: {
|
|
140
|
-
|
|
141
|
-
return
|
|
206
|
+
confirm: function(n) {
|
|
207
|
+
return e.removeNode(o, s);
|
|
142
208
|
}
|
|
143
209
|
},
|
|
144
|
-
scopedSlots:
|
|
210
|
+
scopedSlots: e._u([{
|
|
145
211
|
key: "reference",
|
|
146
212
|
fn: function() {
|
|
147
|
-
return [
|
|
213
|
+
return [i("ElButton", {
|
|
148
214
|
directives: [{
|
|
149
215
|
name: "show",
|
|
150
216
|
rawName: "v-show",
|
|
151
|
-
value:
|
|
217
|
+
value: o.isLeaf,
|
|
152
218
|
expression: "node.isLeaf"
|
|
153
219
|
}],
|
|
154
220
|
staticStyle: {
|
|
155
221
|
"margin-left": "4px"
|
|
156
222
|
},
|
|
157
223
|
attrs: {
|
|
158
|
-
|
|
159
|
-
|
|
224
|
+
size: "mini",
|
|
225
|
+
type: "text"
|
|
160
226
|
},
|
|
161
227
|
on: {
|
|
162
|
-
|
|
163
|
-
|
|
228
|
+
click: function(n) {
|
|
229
|
+
n.stopPropagation();
|
|
164
230
|
}
|
|
165
231
|
}
|
|
166
|
-
}, [
|
|
232
|
+
}, [e._v("删除")])];
|
|
167
233
|
},
|
|
168
|
-
proxy:
|
|
169
|
-
}], null,
|
|
170
|
-
})], 1) :
|
|
234
|
+
proxy: !0
|
|
235
|
+
}], null, !0)
|
|
236
|
+
})], 1) : e._e(), e.contextMenuIcon && e.contextMenu && !e.readonly ? i("span", {
|
|
171
237
|
directives: [{
|
|
172
238
|
name: "show",
|
|
173
239
|
rawName: "v-show",
|
|
174
|
-
value: !
|
|
240
|
+
value: !s.loading && !e.loading,
|
|
175
241
|
expression: "!data.loading && !loading"
|
|
176
242
|
}],
|
|
177
243
|
staticClass: "handle-actions",
|
|
178
244
|
staticStyle: {
|
|
179
|
-
|
|
245
|
+
display: "inline-block"
|
|
180
246
|
}
|
|
181
|
-
}, [
|
|
247
|
+
}, [i("ElButton", {
|
|
182
248
|
staticStyle: {
|
|
183
|
-
|
|
249
|
+
padding: "6px 10px 0"
|
|
184
250
|
},
|
|
185
251
|
attrs: {
|
|
186
|
-
|
|
187
|
-
|
|
252
|
+
size: "mini",
|
|
253
|
+
type: "text"
|
|
188
254
|
},
|
|
189
255
|
on: {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
return _vm.showContextMenu($event, data, node);
|
|
256
|
+
click: function(n) {
|
|
257
|
+
return n.stopPropagation(), e.showContextMenu(n, s, o);
|
|
193
258
|
}
|
|
194
259
|
}
|
|
195
|
-
}, [
|
|
196
|
-
staticClass: "custom-tree-node flex-row flex-item oh",
|
|
197
|
-
attrs: {
|
|
198
|
-
"data-id": data.id
|
|
199
|
-
}
|
|
200
|
-
}, [_vm.icon ? _c("i", {
|
|
201
|
-
staticClass: "node-icon shrink-0",
|
|
202
|
-
class: data.loading ? "el-icon-loading" : "el-icon-edit-outline"
|
|
203
|
-
}) : _vm._e(), _c("ElInput", {
|
|
204
|
-
ref: "labelTxt",
|
|
205
|
-
staticClass: "node-input flex-item",
|
|
206
|
-
attrs: {
|
|
207
|
-
"size": "mini",
|
|
208
|
-
"placeholder": _vm.defaultOptions.inputPlaceholder
|
|
209
|
-
},
|
|
210
|
-
on: {
|
|
211
|
-
"blur": function(event) {
|
|
212
|
-
return _vm.inputBlur(event, node, data);
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
nativeOn: {
|
|
216
|
-
"keyup": function($event) {
|
|
217
|
-
return function(event) {
|
|
218
|
-
return _vm.inputKeyup(event, node, data);
|
|
219
|
-
}.apply(null, arguments);
|
|
220
|
-
},
|
|
221
|
-
"click": function($event) {
|
|
222
|
-
$event.stopPropagation();
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
model: {
|
|
226
|
-
value: _vm.text,
|
|
227
|
-
callback: function($$v) {
|
|
228
|
-
_vm.text = $$v;
|
|
229
|
-
},
|
|
230
|
-
expression: "text"
|
|
231
|
-
}
|
|
232
|
-
}), _vm.confirmButton ? [_c("ElButton", {
|
|
233
|
-
directives: [{
|
|
234
|
-
name: "show",
|
|
235
|
-
rawName: "v-show",
|
|
236
|
-
value: !data.loading,
|
|
237
|
-
expression: "!data.loading"
|
|
238
|
-
}],
|
|
239
|
-
staticClass: "shrink-0",
|
|
240
|
-
attrs: {
|
|
241
|
-
"size": "mini",
|
|
242
|
-
"type": "text"
|
|
243
|
-
},
|
|
244
|
-
on: {
|
|
245
|
-
"click": function($event) {
|
|
246
|
-
$event.stopPropagation();
|
|
247
|
-
return _vm.onConfirm(node, data);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}, [_vm._v("确定")]), _c("ElButton", {
|
|
251
|
-
directives: [{
|
|
252
|
-
name: "show",
|
|
253
|
-
rawName: "v-show",
|
|
254
|
-
value: !data.loading,
|
|
255
|
-
expression: "!data.loading"
|
|
256
|
-
}],
|
|
257
|
-
staticClass: "shrink-0",
|
|
258
|
-
attrs: {
|
|
259
|
-
"size": "mini",
|
|
260
|
-
"type": "text"
|
|
261
|
-
},
|
|
262
|
-
on: {
|
|
263
|
-
"click": function($event) {
|
|
264
|
-
$event.stopPropagation();
|
|
265
|
-
return _vm.onCancel(node, data);
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
}, [_vm._v("取消")])] : _vm._e()], 2)]];
|
|
260
|
+
}, [e._v(". . .")])], 1) : e._e()])]];
|
|
269
261
|
}, {
|
|
270
|
-
|
|
271
|
-
|
|
262
|
+
node: o,
|
|
263
|
+
data: s
|
|
272
264
|
})];
|
|
273
265
|
}
|
|
274
|
-
}], null,
|
|
275
|
-
}, "ElTree",
|
|
266
|
+
}], null, !0)
|
|
267
|
+
}, "ElTree", e.filterTreeProperties(e.$attrs), !1), e.filterTreeEvents(e.$listeners))), e.contextMenu && !e.readonly ? i("div", {
|
|
276
268
|
directives: [{
|
|
277
269
|
name: "show",
|
|
278
270
|
rawName: "v-show",
|
|
279
|
-
value:
|
|
271
|
+
value: e.showMenu,
|
|
280
272
|
expression: "showMenu"
|
|
281
273
|
}],
|
|
282
274
|
ref: "contextMenu",
|
|
283
275
|
staticClass: "menu",
|
|
284
|
-
style:
|
|
285
|
-
}, [
|
|
276
|
+
style: e.position
|
|
277
|
+
}, [i("ul", {
|
|
286
278
|
staticClass: "menu-list"
|
|
287
|
-
}, [
|
|
288
|
-
return [
|
|
279
|
+
}, [e._t("context-menu", function() {
|
|
280
|
+
return [i("li", {
|
|
289
281
|
directives: [{
|
|
290
282
|
name: "show",
|
|
291
283
|
rawName: "v-show",
|
|
292
|
-
value:
|
|
284
|
+
value: e.curData.id > -1,
|
|
293
285
|
expression: "curData.id > -1"
|
|
294
286
|
}],
|
|
295
287
|
staticClass: "menu-item",
|
|
296
288
|
on: {
|
|
297
|
-
|
|
298
|
-
return
|
|
289
|
+
click: function(a) {
|
|
290
|
+
return e.appendPeerNode(e.curNode, e.curData);
|
|
299
291
|
}
|
|
300
292
|
}
|
|
301
|
-
}, [
|
|
293
|
+
}, [i("i", {
|
|
302
294
|
staticClass: "menu-item-icon el-icon-lx-add",
|
|
303
295
|
staticStyle: {
|
|
304
|
-
|
|
296
|
+
color: "#228b22"
|
|
305
297
|
}
|
|
306
|
-
}),
|
|
298
|
+
}), e._v(e._s(e.menuLabel.appendPeer) + " ")]), i("li", {
|
|
307
299
|
staticClass: "menu-item",
|
|
308
300
|
on: {
|
|
309
|
-
|
|
310
|
-
return
|
|
301
|
+
click: function(a) {
|
|
302
|
+
return e.appendChildNode(e.curNode, e.curData);
|
|
311
303
|
}
|
|
312
304
|
}
|
|
313
|
-
}, [
|
|
305
|
+
}, [i("i", {
|
|
314
306
|
staticClass: "menu-item-icon el-icon-lx-add",
|
|
315
307
|
staticStyle: {
|
|
316
|
-
|
|
308
|
+
color: "#228b22"
|
|
317
309
|
}
|
|
318
|
-
}),
|
|
310
|
+
}), e._v(e._s(e.menuLabel.appendChild) + " ")]), i("li", {
|
|
319
311
|
directives: [{
|
|
320
312
|
name: "show",
|
|
321
313
|
rawName: "v-show",
|
|
322
|
-
value:
|
|
314
|
+
value: e.curData.id > -1,
|
|
323
315
|
expression: "curData.id > -1"
|
|
324
316
|
}],
|
|
325
317
|
staticClass: "menu-item",
|
|
326
318
|
on: {
|
|
327
|
-
|
|
328
|
-
return
|
|
319
|
+
click: function(a) {
|
|
320
|
+
return e.editNode(e.curNode, e.curData);
|
|
329
321
|
}
|
|
330
322
|
}
|
|
331
|
-
}, [
|
|
323
|
+
}, [i("i", {
|
|
332
324
|
staticClass: "menu-item-icon el-icon-edit-outline",
|
|
333
325
|
staticStyle: {
|
|
334
|
-
|
|
326
|
+
color: "#ffa500"
|
|
335
327
|
}
|
|
336
|
-
}),
|
|
328
|
+
}), e._v(e._s(e.menuLabel.editNode) + " ")]), i("li", {
|
|
337
329
|
directives: [{
|
|
338
330
|
name: "show",
|
|
339
331
|
rawName: "v-show",
|
|
340
|
-
value:
|
|
332
|
+
value: e.curNode.isLeaf,
|
|
341
333
|
expression: "curNode.isLeaf"
|
|
342
334
|
}],
|
|
343
335
|
staticClass: "menu-item",
|
|
344
336
|
on: {
|
|
345
|
-
|
|
346
|
-
return
|
|
337
|
+
click: function(a) {
|
|
338
|
+
return e.removeNodeModal(e.curNode, e.curData);
|
|
347
339
|
}
|
|
348
340
|
}
|
|
349
|
-
}, [
|
|
341
|
+
}, [i("i", {
|
|
350
342
|
staticClass: "menu-item-icon el-icon-delete",
|
|
351
343
|
staticStyle: {
|
|
352
|
-
|
|
344
|
+
color: "#f00"
|
|
353
345
|
}
|
|
354
|
-
}),
|
|
346
|
+
}), e._v(e._s(e.menuLabel.removeNode) + " ")])];
|
|
355
347
|
}, {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
})], 2)]) :
|
|
359
|
-
};
|
|
360
|
-
|
|
361
|
-
const EditableTree_vue_vue_type_style_index_0_lang = "";
|
|
362
|
-
const __vue2_script = {
|
|
348
|
+
curNode: e.curNode,
|
|
349
|
+
curData: e.curData
|
|
350
|
+
})], 2)]) : e._e()], 1)], 1);
|
|
351
|
+
}, T = [];
|
|
352
|
+
const M = {
|
|
363
353
|
name: "EditableTree",
|
|
364
354
|
props: {
|
|
365
355
|
label: {
|
|
@@ -375,21 +365,19 @@ const __vue2_script = {
|
|
|
375
365
|
},
|
|
376
366
|
newNodeBuilder: {
|
|
377
367
|
type: Function,
|
|
378
|
-
default: (
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
};
|
|
383
|
-
}
|
|
368
|
+
default: (e, t) => ({
|
|
369
|
+
name: e,
|
|
370
|
+
parentId: t.id
|
|
371
|
+
})
|
|
384
372
|
},
|
|
385
373
|
contextMenu: Boolean,
|
|
386
374
|
lazy: {
|
|
387
375
|
type: Boolean,
|
|
388
|
-
default:
|
|
376
|
+
default: !0
|
|
389
377
|
},
|
|
390
378
|
expandFirstNode: {
|
|
391
379
|
type: Boolean,
|
|
392
|
-
default:
|
|
380
|
+
default: !0
|
|
393
381
|
},
|
|
394
382
|
readonly: Boolean,
|
|
395
383
|
saveApi: {
|
|
@@ -417,23 +405,11 @@ const __vue2_script = {
|
|
|
417
405
|
contextMenuInline: Boolean,
|
|
418
406
|
treeProps: {
|
|
419
407
|
type: Object,
|
|
420
|
-
default: () => {
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
if (hasOwn(data, "hasChildren")) {
|
|
426
|
-
return !data.hasChildren;
|
|
427
|
-
} else if (hasOwn(data, "hasChild")) {
|
|
428
|
-
return !data.hasChild;
|
|
429
|
-
} else if (hasOwn(data, "children") && data.children) {
|
|
430
|
-
return data.children.length === 0;
|
|
431
|
-
} else {
|
|
432
|
-
return true;
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
};
|
|
436
|
-
}
|
|
408
|
+
default: () => ({
|
|
409
|
+
children: "children",
|
|
410
|
+
label: "name",
|
|
411
|
+
isLeaf: (e) => d(e, "hasChildren") ? !e.hasChildren : d(e, "hasChild") ? !e.hasChild : d(e, "children") && e.children ? e.children.length === 0 : !0
|
|
412
|
+
})
|
|
437
413
|
},
|
|
438
414
|
menuLabel: {
|
|
439
415
|
type: Object,
|
|
@@ -446,13 +422,11 @@ const __vue2_script = {
|
|
|
446
422
|
},
|
|
447
423
|
icon: {
|
|
448
424
|
type: [Function, Boolean],
|
|
449
|
-
default: () =>
|
|
450
|
-
return "el-icon-collection-tag";
|
|
451
|
-
}
|
|
425
|
+
default: () => "el-icon-collection-tag"
|
|
452
426
|
},
|
|
453
427
|
confirmButton: {
|
|
454
428
|
type: Boolean,
|
|
455
|
-
default:
|
|
429
|
+
default: !0
|
|
456
430
|
},
|
|
457
431
|
addRootNodeButtonStyle: {
|
|
458
432
|
type: String,
|
|
@@ -466,9 +440,9 @@ const __vue2_script = {
|
|
|
466
440
|
},
|
|
467
441
|
data() {
|
|
468
442
|
return {
|
|
469
|
-
loading:
|
|
470
|
-
showMenu:
|
|
471
|
-
empty:
|
|
443
|
+
loading: !1,
|
|
444
|
+
showMenu: !1,
|
|
445
|
+
empty: !0,
|
|
472
446
|
expandedKeys: this.lazy ? [] : this.defaultExpandedKeys,
|
|
473
447
|
treeData: [],
|
|
474
448
|
curNode: {},
|
|
@@ -484,23 +458,23 @@ const __vue2_script = {
|
|
|
484
458
|
return {
|
|
485
459
|
confirmButtonText: "确定",
|
|
486
460
|
cancelButtonText: "取消",
|
|
487
|
-
closeOnClickModal:
|
|
488
|
-
modal:
|
|
461
|
+
closeOnClickModal: !1,
|
|
462
|
+
modal: !0,
|
|
489
463
|
inputErrorMessage: `${this.label}名不能为空!`,
|
|
490
464
|
inputPlaceholder: `请输入${this.label}名...`,
|
|
491
|
-
inputValidator: (
|
|
465
|
+
inputValidator: (e) => e != null && e.trim().length > 0
|
|
492
466
|
};
|
|
493
467
|
},
|
|
494
468
|
innerTreeData() {
|
|
495
|
-
var
|
|
496
|
-
return (
|
|
469
|
+
var e;
|
|
470
|
+
return (e = this.$attrs.data) != null && e.length ? this.$attrs.data : this.treeData;
|
|
497
471
|
}
|
|
498
472
|
},
|
|
499
473
|
watch: {
|
|
500
474
|
defaultExpandedKeys: {
|
|
501
|
-
immediate:
|
|
502
|
-
handler(
|
|
503
|
-
this.expandedKeys = [...
|
|
475
|
+
immediate: !0,
|
|
476
|
+
handler(e) {
|
|
477
|
+
this.expandedKeys = [...e];
|
|
504
478
|
}
|
|
505
479
|
}
|
|
506
480
|
},
|
|
@@ -508,497 +482,308 @@ const __vue2_script = {
|
|
|
508
482
|
this.tryFetch();
|
|
509
483
|
},
|
|
510
484
|
mounted() {
|
|
511
|
-
|
|
512
|
-
addResizeListener(this.$refs.treeWrapper, this.resize);
|
|
485
|
+
h(this.$refs.tree.$el, this.resize), h(this.$refs.treeWrapper, this.resize);
|
|
513
486
|
},
|
|
514
487
|
beforeDestroy() {
|
|
515
|
-
|
|
516
|
-
removeResizeListener(this.$refs.treeWrapper, this.resize);
|
|
488
|
+
u(this.$refs.tree.$el, this.resize), u(this.$refs.treeWrapper, this.resize);
|
|
517
489
|
},
|
|
518
490
|
methods: {
|
|
519
|
-
filterTreeProperties,
|
|
520
|
-
filterTreeEvents,
|
|
521
|
-
addExpandKey(
|
|
522
|
-
|
|
523
|
-
this.expandedKeys.push(data[this.nodeKey]);
|
|
524
|
-
}
|
|
491
|
+
filterTreeProperties: b,
|
|
492
|
+
filterTreeEvents: _,
|
|
493
|
+
addExpandKey(e) {
|
|
494
|
+
this.reserveExpandKey && this.expandedKeys.push(e[this.nodeKey]);
|
|
525
495
|
},
|
|
526
|
-
removeExpandKey(
|
|
527
|
-
|
|
528
|
-
this.expandedKeys = this.expandedKeys.filter((key) => key !== data[this.nodeKey]);
|
|
529
|
-
}
|
|
496
|
+
removeExpandKey(e) {
|
|
497
|
+
this.reserveExpandKey && (this.expandedKeys = this.expandedKeys.filter((t) => t !== e[this.nodeKey]));
|
|
530
498
|
},
|
|
531
499
|
resize() {
|
|
532
|
-
|
|
533
|
-
this.right = 4 + scrollbarWidth;
|
|
534
|
-
} else {
|
|
535
|
-
this.right = 4;
|
|
536
|
-
}
|
|
500
|
+
x(this.$refs.treeWrapper) ? this.right = 4 + w : this.right = 4;
|
|
537
501
|
},
|
|
538
|
-
async showContextMenu(
|
|
539
|
-
|
|
540
|
-
return;
|
|
541
|
-
}
|
|
542
|
-
if (this.contextMenu) {
|
|
543
|
-
this.curNode = node;
|
|
544
|
-
this.curData = data;
|
|
545
|
-
this.showMenu = true;
|
|
546
|
-
this.$refs.tree.setCurrentKey(data.id);
|
|
547
|
-
await this.$nextTick();
|
|
548
|
-
this.position = computePosition(event, this.$refs.contextMenu);
|
|
549
|
-
window.addEventListener("click", this.hideContextMenu);
|
|
550
|
-
}
|
|
502
|
+
async showContextMenu(e, t, i) {
|
|
503
|
+
t.contextmenu === !1 || t.id === -1 || t.id === 0 || t.edit === !0 || this.contextMenu && (this.curNode = i, this.curData = t, this.showMenu = !0, this.$refs.tree.setCurrentKey(t.id), await this.$nextTick(), this.position = N(e, this.$refs.contextMenu), window.addEventListener("click", this.hideContextMenu));
|
|
551
504
|
},
|
|
552
505
|
hideContextMenu() {
|
|
553
|
-
this.showMenu =
|
|
554
|
-
window.removeEventListener("click", this.hideContextMenu);
|
|
506
|
+
this.showMenu = !1, window.removeEventListener("click", this.hideContextMenu);
|
|
555
507
|
},
|
|
556
508
|
async tryFetch() {
|
|
557
|
-
var
|
|
558
|
-
if (this.lazy ===
|
|
559
|
-
const
|
|
560
|
-
if (
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
this.
|
|
583
|
-
if (isPlainObject(this.customRootNode)) {
|
|
584
|
-
const data = cloneDeep(this.customRootNode);
|
|
585
|
-
data[this.treeProps.children || "children"] = res.data;
|
|
586
|
-
resolve([data]);
|
|
587
|
-
} else if (isFunction(this.customRootNode)) {
|
|
588
|
-
const data = this.customRootNode(res.data);
|
|
589
|
-
data[this.treeProps.children || "children"] = res.data;
|
|
590
|
-
this.treeData = isPlainObject(data) ? [data] : data;
|
|
591
|
-
} else {
|
|
592
|
-
resolve(res.data);
|
|
593
|
-
}
|
|
594
|
-
await this.$nextTick();
|
|
595
|
-
this.$emit("root-node-loaded", res.data);
|
|
596
|
-
if (this.defaultExpandedKeys) {
|
|
597
|
-
this.expandedKeys = [(_b = res == null ? void 0 : res.data[0]) == null ? void 0 : _b.id, ...this.defaultExpandedKeys];
|
|
598
|
-
} else {
|
|
599
|
-
if (this.expandFirstNode) {
|
|
600
|
-
this.expandedKeys = [(_c = res == null ? void 0 : res.data[0]) == null ? void 0 : _c.id];
|
|
601
|
-
}
|
|
602
|
-
}
|
|
509
|
+
var e;
|
|
510
|
+
if (this.lazy === !1 && this.fetchApi) {
|
|
511
|
+
const t = await this.fetchApi(((e = this.rootNode) == null ? void 0 : e.id) ?? -1, {});
|
|
512
|
+
if (r(t.data) && (t.data = [t.data]), t.data = t.data || [], this.empty = t.data.length === 0, r(this.customRootNode)) {
|
|
513
|
+
const i = p(this.customRootNode);
|
|
514
|
+
i[this.treeProps.children || "children"] = t.data, this.treeData = [i];
|
|
515
|
+
} else if (f(this.customRootNode)) {
|
|
516
|
+
const i = this.customRootNode(t.data);
|
|
517
|
+
i[this.treeProps.children || "children"] = t.data, this.treeData = r(i) ? [i] : i;
|
|
518
|
+
} else
|
|
519
|
+
this.treeData = t.data;
|
|
520
|
+
}
|
|
521
|
+
},
|
|
522
|
+
async loadNode(e, t) {
|
|
523
|
+
var i, a, o;
|
|
524
|
+
if (e.level === 0) {
|
|
525
|
+
const s = await this.fetchApi(((i = this.rootNode) == null ? void 0 : i.id) ?? -1, e);
|
|
526
|
+
if (this.empty = s.data.length === 0, r(this.customRootNode)) {
|
|
527
|
+
const n = p(this.customRootNode);
|
|
528
|
+
n[this.treeProps.children || "children"] = s.data, t([n]);
|
|
529
|
+
} else if (f(this.customRootNode)) {
|
|
530
|
+
const n = this.customRootNode(s.data);
|
|
531
|
+
n[this.treeProps.children || "children"] = s.data, this.treeData = r(n) ? [n] : n;
|
|
532
|
+
} else
|
|
533
|
+
t(s.data);
|
|
534
|
+
await this.$nextTick(), this.$emit("root-node-loaded", s.data), this.defaultExpandedKeys ? this.expandedKeys = [(a = s == null ? void 0 : s.data[0]) == null ? void 0 : a.id, ...this.defaultExpandedKeys] : this.expandFirstNode && (this.expandedKeys = [(o = s == null ? void 0 : s.data[0]) == null ? void 0 : o.id]);
|
|
603
535
|
} else {
|
|
604
|
-
if (
|
|
605
|
-
return
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
resolve(res.data);
|
|
609
|
-
await this.$nextTick();
|
|
610
|
-
this.$emit("node-loaded", res.data);
|
|
536
|
+
if (e.leaf || e.data.isTempNode)
|
|
537
|
+
return t([]);
|
|
538
|
+
const s = await this.fetchApi(e.data.id, e);
|
|
539
|
+
t(s.data), await this.$nextTick(), this.$emit("node-loaded", s.data);
|
|
611
540
|
}
|
|
612
541
|
},
|
|
613
542
|
clear() {
|
|
614
|
-
this.cancelEdit();
|
|
615
|
-
this.removeNewNode();
|
|
543
|
+
this.cancelEdit(), this.removeNewNode();
|
|
616
544
|
},
|
|
617
545
|
clearChecked() {
|
|
618
546
|
this.$refs.tree.setCheckedKeys([]);
|
|
619
547
|
},
|
|
620
548
|
removeNewNode() {
|
|
621
|
-
|
|
622
|
-
console.log(this.newChild);
|
|
623
|
-
this.$refs.tree.remove(this.newChild);
|
|
624
|
-
this.$emit("remove-new-node");
|
|
625
|
-
}
|
|
549
|
+
this.newChild && this.newChild.id === -1 && (console.log(this.newChild), this.$refs.tree.remove(this.newChild), this.$emit("remove-new-node"));
|
|
626
550
|
},
|
|
627
551
|
cancelEdit() {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
552
|
+
this.editData && (l(this.editData.edit) ? this.$set(this.editData, "edit", !0) : this.editData.edit = !1);
|
|
553
|
+
},
|
|
554
|
+
async editNode(e, t) {
|
|
555
|
+
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData = t, this.text = t[this.treeProps.label], l(t.edit) ? this.$set(t, "edit", !0) : t.edit = !0, await this.$nextTick(), this.$refs.labelTxt.focus()) : await this.$prompt(`请输入新的${this.label}名:`, {
|
|
556
|
+
...this.defaultOptions,
|
|
557
|
+
inputValue: t[this.treeProps.label],
|
|
558
|
+
beforeClose: async (i, a, o) => {
|
|
559
|
+
if (i === "confirm") {
|
|
560
|
+
try {
|
|
561
|
+
a.confirmButtonLoading = !0, a.confirmButtonText = "处理中...", this.text = a.inputValue, await this.onConfirm(this.curNode, this.curData), o();
|
|
562
|
+
} catch {
|
|
563
|
+
a.confirmButtonText = "确定";
|
|
564
|
+
}
|
|
565
|
+
a.confirmButtonLoading = !1;
|
|
566
|
+
} else
|
|
567
|
+
o();
|
|
633
568
|
}
|
|
634
|
-
}
|
|
569
|
+
}).catch((i) => i);
|
|
635
570
|
},
|
|
636
|
-
async
|
|
637
|
-
|
|
638
|
-
this.
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
this.$refs.labelTxt.focus();
|
|
648
|
-
} else {
|
|
649
|
-
await this.$prompt(`请输入新的${this.label}名:`, {
|
|
650
|
-
...this.defaultOptions,
|
|
651
|
-
inputValue: data[this.treeProps.label],
|
|
652
|
-
beforeClose: async (action, instance, done) => {
|
|
653
|
-
if (action === "confirm") {
|
|
654
|
-
try {
|
|
655
|
-
instance.confirmButtonLoading = true;
|
|
656
|
-
instance.confirmButtonText = "处理中...";
|
|
657
|
-
this.text = instance.inputValue;
|
|
658
|
-
await this.onConfirm(this.curNode, this.curData);
|
|
659
|
-
done();
|
|
660
|
-
} catch (e) {
|
|
661
|
-
instance.confirmButtonText = "确定";
|
|
662
|
-
}
|
|
663
|
-
instance.confirmButtonLoading = false;
|
|
664
|
-
} else {
|
|
665
|
-
done();
|
|
571
|
+
async appendRootNode() {
|
|
572
|
+
this.text = "", !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(void 0), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), await this.scrollIntoView(!0)) : await this.$prompt(`请输入${this.label}名:`, {
|
|
573
|
+
...this.defaultOptions,
|
|
574
|
+
beforeClose: async (e, t, i) => {
|
|
575
|
+
if (e === "confirm") {
|
|
576
|
+
try {
|
|
577
|
+
this.createNewChild(-1), t.confirmButtonLoading = !0, t.confirmButtonText = "处理中...";
|
|
578
|
+
const a = await this.saveApi(this.newNodeBuilder(t.inputValue, { id: -1 }));
|
|
579
|
+
this.newChild[this.treeProps.label] = t.inputValue, this.newChild.edit = !1, c(this.newChild, a.data), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), await this.locateView(), i();
|
|
580
|
+
} catch {
|
|
581
|
+
t.confirmButtonText = "确定";
|
|
666
582
|
}
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
583
|
+
t.confirmButtonLoading = !1;
|
|
584
|
+
} else
|
|
585
|
+
i();
|
|
586
|
+
}
|
|
587
|
+
}).catch((e) => e);
|
|
670
588
|
},
|
|
671
|
-
|
|
589
|
+
appendChildNode(e) {
|
|
672
590
|
this.text = "";
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
this.createNewChild(
|
|
676
|
-
this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, true);
|
|
677
|
-
await this.scrollIntoView(true);
|
|
678
|
-
} else {
|
|
679
|
-
await this.$prompt(`请输入${this.label}名:`, {
|
|
591
|
+
const t = e.expanded;
|
|
592
|
+
e.expand(async () => {
|
|
593
|
+
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(e.data.id), this.$refs.tree.append(this.newChild, e), await this.scrollIntoView(t)) : await this.$prompt(`请输入${this.label}名:`, {
|
|
680
594
|
...this.defaultOptions,
|
|
681
|
-
beforeClose: async (
|
|
682
|
-
if (
|
|
595
|
+
beforeClose: async (i, a, o) => {
|
|
596
|
+
if (i === "confirm") {
|
|
683
597
|
try {
|
|
684
|
-
this.createNewChild(
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
this.newChild.edit = false;
|
|
690
|
-
assignReactiveProperties(this.newChild, res.data);
|
|
691
|
-
this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, true);
|
|
692
|
-
await this.locateView();
|
|
693
|
-
done();
|
|
694
|
-
} catch (e) {
|
|
695
|
-
instance.confirmButtonText = "确定";
|
|
598
|
+
this.createNewChild(e.data.id), a.confirmButtonLoading = !0, a.confirmButtonText = "处理中...";
|
|
599
|
+
const s = await this.saveApi(this.newNodeBuilder(a.inputValue, e.data));
|
|
600
|
+
this.newChild[this.treeProps.label] = a.inputValue, this.newChild.edit = !1, c(this.newChild, s.data), this.$refs.tree.append(this.newChild, e), await this.locateView(), o();
|
|
601
|
+
} catch {
|
|
602
|
+
a.confirmButtonText = "确定";
|
|
696
603
|
}
|
|
697
|
-
|
|
698
|
-
} else
|
|
699
|
-
|
|
700
|
-
}
|
|
604
|
+
a.confirmButtonLoading = !1;
|
|
605
|
+
} else
|
|
606
|
+
o();
|
|
701
607
|
}
|
|
702
|
-
}).catch((
|
|
703
|
-
}
|
|
704
|
-
},
|
|
705
|
-
appendChildNode(node) {
|
|
706
|
-
this.text = "";
|
|
707
|
-
const expanded = node.expanded;
|
|
708
|
-
node.expand(async () => {
|
|
709
|
-
if (!this.contextMenu || this.contextMenuIcon || this.contextMenuInline) {
|
|
710
|
-
this.clear();
|
|
711
|
-
this.createNewChild(node.data.id);
|
|
712
|
-
this.$refs.tree.append(this.newChild, node);
|
|
713
|
-
await this.scrollIntoView(expanded);
|
|
714
|
-
} else {
|
|
715
|
-
await this.$prompt(`请输入${this.label}名:`, {
|
|
716
|
-
...this.defaultOptions,
|
|
717
|
-
beforeClose: async (action, instance, done) => {
|
|
718
|
-
if (action === "confirm") {
|
|
719
|
-
try {
|
|
720
|
-
this.createNewChild(node.data.id);
|
|
721
|
-
instance.confirmButtonLoading = true;
|
|
722
|
-
instance.confirmButtonText = "处理中...";
|
|
723
|
-
const res = await this.saveApi(this.newNodeBuilder(instance.inputValue, node.data));
|
|
724
|
-
this.newChild[this.treeProps.label] = instance.inputValue;
|
|
725
|
-
this.newChild.edit = false;
|
|
726
|
-
assignReactiveProperties(this.newChild, res.data);
|
|
727
|
-
this.$refs.tree.append(this.newChild, node);
|
|
728
|
-
await this.locateView();
|
|
729
|
-
done();
|
|
730
|
-
} catch (e) {
|
|
731
|
-
instance.confirmButtonText = "确定";
|
|
732
|
-
}
|
|
733
|
-
instance.confirmButtonLoading = false;
|
|
734
|
-
} else {
|
|
735
|
-
done();
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
}).catch((_) => _);
|
|
739
|
-
}
|
|
608
|
+
}).catch((i) => i);
|
|
740
609
|
});
|
|
741
610
|
},
|
|
742
|
-
appendChildNodeWithData(
|
|
611
|
+
appendChildNodeWithData(e, t, i) {
|
|
743
612
|
this.text = "";
|
|
744
|
-
const
|
|
745
|
-
|
|
746
|
-
this.clear()
|
|
747
|
-
this.newChild = {
|
|
613
|
+
const a = e.expanded;
|
|
614
|
+
e.expand(async () => {
|
|
615
|
+
this.clear(), this.newChild = {
|
|
748
616
|
id: -1,
|
|
749
|
-
parentId,
|
|
750
|
-
[this.treeProps.label]:
|
|
751
|
-
edit:
|
|
752
|
-
isTempNode:
|
|
753
|
-
hasChildren:
|
|
754
|
-
};
|
|
755
|
-
this.$refs.tree.append(this.newChild, node);
|
|
756
|
-
await this.scrollIntoView(expanded);
|
|
617
|
+
parentId: t,
|
|
618
|
+
[this.treeProps.label]: i,
|
|
619
|
+
edit: !1,
|
|
620
|
+
isTempNode: !0,
|
|
621
|
+
hasChildren: !1
|
|
622
|
+
}, this.$refs.tree.append(this.newChild, e), await this.scrollIntoView(a);
|
|
757
623
|
});
|
|
758
624
|
},
|
|
759
|
-
appendPeerNode(
|
|
760
|
-
|
|
761
|
-
this.appendChildNode(node.parent);
|
|
762
|
-
} else {
|
|
763
|
-
this.appendRootNode();
|
|
764
|
-
}
|
|
625
|
+
appendPeerNode(e) {
|
|
626
|
+
e.parent && e.parent.level !== 0 ? this.appendChildNode(e.parent) : this.appendRootNode();
|
|
765
627
|
},
|
|
766
|
-
async addRootNode(
|
|
767
|
-
this.$refs.tree.remove(data);
|
|
768
|
-
await this.$nextTick();
|
|
769
|
-
this.$refs.tree.root.insertChild({ data }, void 0, true);
|
|
770
|
-
},
|
|
771
|
-
async addChildNode(data) {
|
|
772
|
-
if (this.curNode && this.curNode.level !== 0) {
|
|
773
|
-
this.curNode.expand(async () => {
|
|
774
|
-
this.$refs.tree.remove(data);
|
|
775
|
-
await this.$nextTick();
|
|
776
|
-
this.$refs.tree.append(data, this.curNode);
|
|
777
|
-
});
|
|
778
|
-
} else {
|
|
779
|
-
await this.addRootNode(data);
|
|
780
|
-
}
|
|
628
|
+
async addRootNode(e) {
|
|
629
|
+
this.$refs.tree.remove(e), await this.$nextTick(), this.$refs.tree.root.insertChild({ data: e }, void 0, !0);
|
|
781
630
|
},
|
|
782
|
-
async
|
|
783
|
-
|
|
784
|
-
this.
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
}
|
|
631
|
+
async addChildNode(e) {
|
|
632
|
+
this.curNode && this.curNode.level !== 0 ? this.curNode.expand(async () => {
|
|
633
|
+
this.$refs.tree.remove(e), await this.$nextTick(), this.$refs.tree.append(e, this.curNode);
|
|
634
|
+
}) : await this.addRootNode(e);
|
|
635
|
+
},
|
|
636
|
+
async addPeerNode(e) {
|
|
637
|
+
this.curNode && this.curNode.parent && this.curNode.parent.level !== 0 ? this.curNode.parent.expand(async () => {
|
|
638
|
+
this.$refs.tree.remove(e), await this.$nextTick(), this.$refs.tree.append(e, this.curNode.parent);
|
|
639
|
+
}) : await this.addRootNode(e);
|
|
792
640
|
},
|
|
793
|
-
updateNode(
|
|
794
|
-
const
|
|
795
|
-
|
|
641
|
+
updateNode(e) {
|
|
642
|
+
const t = this.$refs.tree.getNode(e);
|
|
643
|
+
t && (t.data = e);
|
|
796
644
|
},
|
|
797
|
-
setCurrentKey(
|
|
798
|
-
this.$refs.tree && this.$refs.tree.setCurrentKey(
|
|
645
|
+
setCurrentKey(e) {
|
|
646
|
+
this.$refs.tree && this.$refs.tree.setCurrentKey(e);
|
|
799
647
|
},
|
|
800
|
-
createNewChild(
|
|
648
|
+
createNewChild(e) {
|
|
801
649
|
this.newChild = {
|
|
802
650
|
id: -1,
|
|
803
|
-
parentId,
|
|
651
|
+
parentId: e,
|
|
804
652
|
[this.treeProps.label]: "",
|
|
805
|
-
edit:
|
|
806
|
-
isTempNode:
|
|
807
|
-
hasChildren:
|
|
808
|
-
};
|
|
809
|
-
this.$emit("create-new-node", this.newChild);
|
|
653
|
+
edit: !0,
|
|
654
|
+
isTempNode: !0,
|
|
655
|
+
hasChildren: !1
|
|
656
|
+
}, this.$emit("create-new-node", this.newChild);
|
|
810
657
|
},
|
|
811
|
-
async removeNodeModal(
|
|
658
|
+
async removeNodeModal(e) {
|
|
812
659
|
await this.$confirm(
|
|
813
|
-
`你确定要删除${this.label}[<span class="break-word" style="color: orange">${
|
|
660
|
+
`你确定要删除${this.label}[<span class="break-word" style="color: orange">${e.data[this.treeProps.label]}</span>]吗?`,
|
|
814
661
|
"系统提示",
|
|
815
662
|
{
|
|
816
663
|
type: "warning",
|
|
817
|
-
modal:
|
|
818
|
-
dangerouslyUseHTMLString:
|
|
664
|
+
modal: !0,
|
|
665
|
+
dangerouslyUseHTMLString: !0,
|
|
819
666
|
iconClass: "el-icon-question",
|
|
820
|
-
closeOnClickModal:
|
|
667
|
+
closeOnClickModal: !1,
|
|
821
668
|
confirmButtonClass: "el-button--danger",
|
|
822
669
|
cancelButtonClass: "el-button--primary is-plain",
|
|
823
|
-
beforeClose: async (
|
|
824
|
-
if (
|
|
670
|
+
beforeClose: async (t, i, a) => {
|
|
671
|
+
if (t === "confirm") {
|
|
825
672
|
try {
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
if (res.code === 0) {
|
|
831
|
-
this.$message.success("删除成功!");
|
|
832
|
-
this.$refs.tree.remove(node);
|
|
833
|
-
this.$emit("node-deleted", parentNode, node.data);
|
|
834
|
-
done();
|
|
835
|
-
} else {
|
|
836
|
-
this.$message.error(res.message);
|
|
837
|
-
}
|
|
838
|
-
} catch (_) {
|
|
673
|
+
i.confirmButtonLoading = !0, i.confirmButtonText = "删除...";
|
|
674
|
+
const o = e.parent, s = await this.deleteApi(e.data.id);
|
|
675
|
+
s.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(e), this.$emit("node-deleted", o, e.data), a()) : this.$message.error(s.message);
|
|
676
|
+
} catch {
|
|
839
677
|
}
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
done();
|
|
844
|
-
}
|
|
678
|
+
i.confirmButtonText = "确定", i.confirmButtonLoading = !1;
|
|
679
|
+
} else
|
|
680
|
+
a();
|
|
845
681
|
}
|
|
846
682
|
}
|
|
847
|
-
).catch((
|
|
683
|
+
).catch((t) => t);
|
|
848
684
|
},
|
|
849
|
-
async removeNode(
|
|
685
|
+
async removeNode(e) {
|
|
850
686
|
try {
|
|
851
|
-
const
|
|
687
|
+
const t = e.parent;
|
|
852
688
|
if (this.deleteApi) {
|
|
853
|
-
const
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
} else {
|
|
859
|
-
this.$message.error(res.message);
|
|
860
|
-
}
|
|
861
|
-
} else {
|
|
862
|
-
this.$refs.tree.remove(node);
|
|
863
|
-
}
|
|
864
|
-
} catch (e) {
|
|
689
|
+
const i = await this.deleteApi(e.data.id);
|
|
690
|
+
i.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(e), this.$emit("node-deleted", t, e.data)) : this.$message.error(i.message);
|
|
691
|
+
} else
|
|
692
|
+
this.$refs.tree.remove(e);
|
|
693
|
+
} catch {
|
|
865
694
|
}
|
|
866
695
|
},
|
|
867
|
-
async onConfirm(
|
|
868
|
-
if (
|
|
696
|
+
async onConfirm(e, t) {
|
|
697
|
+
if (t[this.treeProps.label] === this.text || !C(this.text)) {
|
|
869
698
|
this.clear();
|
|
870
699
|
return;
|
|
871
700
|
}
|
|
872
|
-
|
|
873
|
-
this.$set(data, "loading", true);
|
|
874
|
-
} else {
|
|
875
|
-
data.loading = true;
|
|
876
|
-
}
|
|
701
|
+
l(t.loading) ? this.$set(t, "loading", !0) : t.loading = !0;
|
|
877
702
|
try {
|
|
878
|
-
this.loading =
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
} else {
|
|
886
|
-
await this.updateApi({ ...data, [this.treeProps.label]: this.text });
|
|
887
|
-
}
|
|
888
|
-
data[this.treeProps.label] = this.text;
|
|
889
|
-
data.edit = false;
|
|
890
|
-
this.$emit("node-updated", data, node);
|
|
891
|
-
this.text = "";
|
|
892
|
-
} catch (e) {
|
|
703
|
+
if (this.loading = !0, t.id === -1) {
|
|
704
|
+
const i = await this.saveApi(this.newNodeBuilder(this.text, e.parent.data || { id: -1 })), a = v(t);
|
|
705
|
+
c(t, { ...i.data, isTempNode: !1 }), this.$emit("node-added", t, a, e), this.registerNode(e);
|
|
706
|
+
} else
|
|
707
|
+
await this.updateApi({ ...t, [this.treeProps.label]: this.text });
|
|
708
|
+
t[this.treeProps.label] = this.text, t.edit = !1, this.$emit("node-updated", t, e), this.text = "";
|
|
709
|
+
} catch {
|
|
893
710
|
}
|
|
894
|
-
|
|
895
|
-
this.loading = false;
|
|
711
|
+
t.loading = !1, this.loading = !1;
|
|
896
712
|
},
|
|
897
|
-
onCancel(
|
|
898
|
-
|
|
899
|
-
this.$refs.tree.remove(node);
|
|
900
|
-
} else {
|
|
901
|
-
data.edit = false;
|
|
902
|
-
}
|
|
903
|
-
this.text = "";
|
|
713
|
+
onCancel(e, t) {
|
|
714
|
+
t.id === -1 ? this.$refs.tree.remove(e) : t.edit = !1, this.text = "";
|
|
904
715
|
},
|
|
905
|
-
nodeClick(
|
|
906
|
-
this.hideContextMenu();
|
|
907
|
-
if (isUndefined(data.loading) || !data.loading) {
|
|
908
|
-
this.curNode = node;
|
|
909
|
-
this.curData = data;
|
|
910
|
-
this.$emit("on-node-click", data, node, tree);
|
|
911
|
-
}
|
|
716
|
+
nodeClick(e, t, i) {
|
|
717
|
+
this.hideContextMenu(), (l(e.loading) || !e.loading) && (this.curNode = t, this.curData = e, this.$emit("on-node-click", e, t, i));
|
|
912
718
|
},
|
|
913
719
|
getCurrentNode() {
|
|
914
720
|
return this.$refs.tree.getCurrentNode();
|
|
915
721
|
},
|
|
916
722
|
async locateView() {
|
|
917
723
|
await this.$nextTick();
|
|
918
|
-
const
|
|
919
|
-
|
|
920
|
-
el.scrollIntoView();
|
|
921
|
-
}
|
|
724
|
+
const e = this.$el.querySelector(`[data-id="${this.newChild.id}"]`);
|
|
725
|
+
e && e.scrollIntoView();
|
|
922
726
|
},
|
|
923
|
-
async scrollIntoView(
|
|
924
|
-
var
|
|
925
|
-
await this.$nextTick();
|
|
926
|
-
if (!expanded) {
|
|
927
|
-
await delay(300);
|
|
928
|
-
}
|
|
929
|
-
(_b = (_a = this.$refs) == null ? void 0 : _a.labelTxt) == null ? void 0 : _b.focus();
|
|
727
|
+
async scrollIntoView(e) {
|
|
728
|
+
var t, i;
|
|
729
|
+
await this.$nextTick(), e || await g(300), (i = (t = this.$refs) == null ? void 0 : t.labelTxt) == null || i.focus();
|
|
930
730
|
},
|
|
931
|
-
inputKeyup(
|
|
932
|
-
|
|
933
|
-
this.onConfirm(node, data);
|
|
934
|
-
}
|
|
935
|
-
if (event.keyCode === 27) {
|
|
936
|
-
this.clear();
|
|
937
|
-
}
|
|
731
|
+
inputKeyup(e, t, i) {
|
|
732
|
+
e.keyCode === 13 && this.onConfirm(t, i), e.keyCode === 27 && this.clear();
|
|
938
733
|
},
|
|
939
|
-
inputBlur(
|
|
940
|
-
|
|
941
|
-
return;
|
|
942
|
-
}
|
|
943
|
-
this.onConfirm(node, data);
|
|
734
|
+
inputBlur(e, t, i) {
|
|
735
|
+
this.confirmButton || this.onConfirm(t, i);
|
|
944
736
|
},
|
|
945
737
|
getCheckedKeys() {
|
|
946
738
|
return this.$refs.tree.getCheckedKeys();
|
|
947
739
|
},
|
|
948
|
-
setCheckedKeys(
|
|
949
|
-
this.$refs.tree.setCheckedKeys(
|
|
740
|
+
setCheckedKeys(e) {
|
|
741
|
+
this.$refs.tree.setCheckedKeys(e);
|
|
950
742
|
},
|
|
951
743
|
getCheckedNodes() {
|
|
952
744
|
return this.$refs.tree.getCheckedNodes();
|
|
953
745
|
},
|
|
954
|
-
setCheckedNodes(
|
|
955
|
-
this.$refs.tree.setCheckedNodes(
|
|
746
|
+
setCheckedNodes(e) {
|
|
747
|
+
this.$refs.tree.setCheckedNodes(e);
|
|
956
748
|
},
|
|
957
|
-
getNode(
|
|
958
|
-
return this.$refs.tree.getNode(
|
|
749
|
+
getNode(e) {
|
|
750
|
+
return this.$refs.tree.getNode(e);
|
|
959
751
|
},
|
|
960
752
|
getRootNode() {
|
|
961
753
|
return this.$refs.tree.root;
|
|
962
754
|
},
|
|
963
|
-
findTreeNode(
|
|
964
|
-
return
|
|
755
|
+
findTreeNode(e) {
|
|
756
|
+
return $(
|
|
965
757
|
this.$refs.tree.root.childNodes,
|
|
966
|
-
(
|
|
758
|
+
(t) => t.data === e || t.data.id === e,
|
|
967
759
|
"childNodes"
|
|
968
760
|
);
|
|
969
761
|
},
|
|
970
|
-
registerNode(
|
|
971
|
-
|
|
972
|
-
delete node.store.nodesMap[-1];
|
|
762
|
+
registerNode(e) {
|
|
763
|
+
e.store.registerNode(e), delete e.store.nodesMap[-1];
|
|
973
764
|
},
|
|
974
765
|
async reloadTree() {
|
|
975
|
-
|
|
976
|
-
this.treeKey = Date.now();
|
|
977
|
-
} else {
|
|
978
|
-
await this.tryFetch();
|
|
979
|
-
}
|
|
766
|
+
this.lazy ? this.treeKey = Date.now() : await this.tryFetch();
|
|
980
767
|
}
|
|
981
768
|
}
|
|
982
|
-
};
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
__vue2_injectStyles,
|
|
769
|
+
}, m = {};
|
|
770
|
+
var K = /* @__PURE__ */ k(
|
|
771
|
+
M,
|
|
772
|
+
B,
|
|
773
|
+
T,
|
|
774
|
+
!1,
|
|
775
|
+
P,
|
|
990
776
|
null,
|
|
991
777
|
null,
|
|
992
778
|
null
|
|
993
779
|
);
|
|
994
|
-
function
|
|
995
|
-
for (let
|
|
996
|
-
this[
|
|
997
|
-
}
|
|
780
|
+
function P(e) {
|
|
781
|
+
for (let t in m)
|
|
782
|
+
this[t] = m[t];
|
|
998
783
|
}
|
|
999
|
-
const
|
|
1000
|
-
return
|
|
784
|
+
const R = /* @__PURE__ */ function() {
|
|
785
|
+
return K.exports;
|
|
1001
786
|
}();
|
|
1002
787
|
export {
|
|
1003
|
-
|
|
788
|
+
R as default
|
|
1004
789
|
};
|