@web-utils/component 2.0.2 → 2.0.3
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/{7af3ceb1.js → 3a79781b.js} +3 -3
- package/dist/chunks/{df803484.js → 41a066be.js} +0 -0
- package/dist/chunks/{163eed3b.js → 5a78e0db.js} +0 -0
- package/dist/chunks/{6499de3a.js → 5d4282fb.js} +0 -0
- package/dist/chunks/{a73fe8ee.js → 61ad06b2.js} +0 -0
- package/dist/chunks/{86bcadec.js → 76680a03.js} +2 -2
- package/dist/chunks/{8bbde9bf.js → 8c0142e0.js} +0 -0
- package/dist/chunks/{90bd3d52.js → 97652d86.js} +5 -5
- package/dist/chunks/{92404ceb.js → b4acd3a6.js} +3 -3
- package/dist/chunks/{2bd4e340.js → f71045fc.js} +0 -0
- package/dist/components/address-input/index.js +2 -2
- package/dist/components/aside-menu/index.js +1 -1
- package/dist/components/awesome-button/index.js +1 -1
- package/dist/components/capsule-tab/index.js +1 -1
- package/dist/components/chunk-file-uploader/index.js +2 -2
- package/dist/components/chunk-file-uploader-button/index.js +2 -2
- package/dist/components/chunk-file-uploader-drop/index.js +2 -2
- package/dist/components/chunk-file-uploader-file/index.js +3 -3
- package/dist/components/chunk-file-uploader-files/index.js +2 -2
- package/dist/components/chunk-file-uploader-list/index.js +2 -2
- package/dist/components/chunk-file-uploader-un-support/index.js +2 -2
- package/dist/components/code-mirror-editor/index.js +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/confirm-button/index.js +3 -3
- package/dist/components/confirmable/index.js +2 -2
- package/dist/components/context-menu/index.js +1 -1
- package/dist/components/custom-scrollbar/index.js +2 -3
- package/dist/components/data-table-picker/index.js +5 -5
- package/dist/components/dynamic-table/index.js +6 -6
- package/dist/components/e-charts/index.js +1 -1
- package/dist/components/editable-progress/index.js +1 -1
- package/dist/components/editable-tree/index.js +192 -192
- package/dist/components/egd-collapse/index.js +1 -1
- package/dist/components/egd-collapse-item/index.js +1 -1
- package/dist/components/element-dialog/index.js +4 -4
- package/dist/components/empty-view/index.js +2 -2
- package/dist/components/error-view/index.js +2 -2
- package/dist/components/flex-column/index.js +2 -2
- package/dist/components/flex-item/index.js +2 -2
- package/dist/components/flex-row/index.js +2 -2
- package/dist/components/flex-scroller/index.js +1 -1
- package/dist/components/form-button/index.js +2 -2
- package/dist/components/form-cascader/index.js +4 -4
- package/dist/components/form-checkbox-group/index.js +13 -13
- package/dist/components/form-date-picker/index.js +9 -9
- package/dist/components/form-holder/index.js +3 -3
- package/dist/components/form-input/index.js +3 -3
- package/dist/components/form-input-email/index.js +4 -4
- package/dist/components/form-input-id-card/index.js +4 -4
- package/dist/components/form-input-number/index.js +4 -4
- package/dist/components/form-input-phone-number/index.js +4 -4
- package/dist/components/form-input-time/index.js +6 -6
- package/dist/components/form-item/index.js +4 -5
- package/dist/components/form-item-config-provider/index.js +1 -1
- package/dist/components/form-item-group/index.js +2 -2
- package/dist/components/form-radio-group/index.js +13 -13
- package/dist/components/form-select/index.js +14 -14
- package/dist/components/form-switch/index.js +3 -3
- package/dist/components/form-textarea/index.js +3 -3
- package/dist/components/form-view/index.js +7 -7
- package/dist/components/guide-steps/index.js +1 -1
- package/dist/components/icon-card/index.js +1 -1
- package/dist/components/iframe-window/index.js +3 -3
- package/dist/components/input-number/index.js +2 -2
- package/dist/components/input-number-range/index.js +2 -2
- package/dist/components/keep-view-alive/index.js +1 -1
- package/dist/components/loading-view/index.js +2 -2
- package/dist/components/nav-bar/index.js +2 -2
- package/dist/components/not-implement/index.js +2 -2
- package/dist/components/page/index.js +1 -1
- package/dist/components/page-header/index.js +2 -2
- package/dist/components/page-index/index.js +4 -4
- package/dist/components/page-index-top/index.js +3 -3
- package/dist/components/page-skeleton/index.js +1 -1
- package/dist/components/page-skeleton-new/index.js +4 -4
- package/dist/components/pageable-table/index.js +8 -8
- package/dist/components/pageable-view/index.js +5 -5
- package/dist/components/photo-swipe/index.js +5 -5
- package/dist/components/resize-observer/index.js +2 -2
- package/dist/components/search-popover/index.js +6 -6
- package/dist/components/sign-panel/index.js +11 -11
- package/dist/components/split-pane/index.js +1 -1
- package/dist/components/stateful/index.js +1 -1
- package/dist/components/static-pageable-table/index.js +2 -2
- package/dist/components/swiper/index.js +1 -1
- package/dist/components/tab/index.js +2 -2
- package/dist/components/tab-item/index.js +2 -2
- package/dist/components/table-column/index.js +1 -1
- package/dist/components/table-view/index.js +12 -12
- package/dist/components/tag-render/index.js +3 -3
- package/dist/components/tinymce-editor/index.js +3 -3
- package/dist/components/tinymce-wrapper/index.js +393 -393
- package/dist/components/toolbar/index.js +40 -40
- package/dist/components/toolbar-button/index.js +1 -1
- package/dist/components/trigger/index.js +1 -1
- package/dist/components/vue-tags-input/index.js +3 -3
- package/dist/components/watermark/index.js +2 -2
- package/dist/components/x-dialog/index.js +6 -6
- package/dist/index.css +0 -63
- package/dist/index.es.js +606 -608
- package/package.json +22 -22
- package/web-types.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { hasOwn as
|
|
2
|
-
import { a as b, b as _, c
|
|
3
|
-
import { n as k } from "../../chunks/
|
|
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
4
|
var B = function() {
|
|
5
|
-
var e = this,
|
|
6
|
-
return
|
|
5
|
+
var e = this, t = e.$createElement, i = e._self._c || t;
|
|
6
|
+
return i("div", {
|
|
7
7
|
staticClass: "editable-tree"
|
|
8
|
-
}, [!e.readonly && e.addRootNodeButtonStyle === "top-right" ?
|
|
8
|
+
}, [!e.readonly && e.addRootNodeButtonStyle === "top-right" ? i("ElButton", {
|
|
9
9
|
staticStyle: {
|
|
10
10
|
position: "absolute",
|
|
11
11
|
top: "4px",
|
|
@@ -22,18 +22,18 @@ var B = function() {
|
|
|
22
22
|
plain: ""
|
|
23
23
|
},
|
|
24
24
|
on: {
|
|
25
|
-
click: function(
|
|
26
|
-
return
|
|
25
|
+
click: function(a) {
|
|
26
|
+
return a.stopPropagation(), e.$emit("add-root-node");
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
}) : e._e(),
|
|
29
|
+
}) : e._e(), i("div", {
|
|
30
30
|
ref: "treeWrapper",
|
|
31
31
|
staticClass: "et-tree-wrapper"
|
|
32
|
-
}, [!e.readonly && e.addRootNodeButtonStyle === "top" ?
|
|
32
|
+
}, [!e.readonly && e.addRootNodeButtonStyle === "top" ? i("div", {
|
|
33
33
|
staticStyle: {
|
|
34
34
|
"padding-left": "24px"
|
|
35
35
|
}
|
|
36
|
-
}, [
|
|
36
|
+
}, [i("ElButton", {
|
|
37
37
|
attrs: {
|
|
38
38
|
disabled: e.loading,
|
|
39
39
|
size: "mini",
|
|
@@ -42,9 +42,9 @@ var B = function() {
|
|
|
42
42
|
on: {
|
|
43
43
|
click: e.appendRootNode
|
|
44
44
|
}
|
|
45
|
-
}, [
|
|
45
|
+
}, [i("i", {
|
|
46
46
|
staticClass: "el-icon-lx-add"
|
|
47
|
-
}), e._v(" " + e._s(e.addRootNodeLabel ? e.addRootNodeLabel :
|
|
47
|
+
}), e._v(" " + e._s(e.addRootNodeLabel ? e.addRootNodeLabel : `添加${e.label}`) + " ")])], 1) : e._e(), i("ElTree", e._g(e._b({
|
|
48
48
|
key: e.treeKey,
|
|
49
49
|
ref: "tree",
|
|
50
50
|
staticClass: "flex-item",
|
|
@@ -66,18 +66,18 @@ var B = function() {
|
|
|
66
66
|
},
|
|
67
67
|
scopedSlots: e._u([{
|
|
68
68
|
key: "default",
|
|
69
|
-
fn: function(
|
|
70
|
-
var o =
|
|
69
|
+
fn: function(a) {
|
|
70
|
+
var o = a.node, s = a.data;
|
|
71
71
|
return [e._t("default", function() {
|
|
72
|
-
return [
|
|
72
|
+
return [s.edit ? [i("span", {
|
|
73
73
|
staticClass: "custom-tree-node flex-row flex-item oh",
|
|
74
74
|
attrs: {
|
|
75
|
-
"data-id":
|
|
75
|
+
"data-id": s.id
|
|
76
76
|
}
|
|
77
|
-
}, [e.icon ?
|
|
77
|
+
}, [e.icon ? i("i", {
|
|
78
78
|
staticClass: "node-icon shrink-0",
|
|
79
|
-
class:
|
|
80
|
-
}) : e._e(),
|
|
79
|
+
class: s.loading ? "el-icon-loading" : "el-icon-edit-outline"
|
|
80
|
+
}) : e._e(), i("ElInput", {
|
|
81
81
|
ref: "labelTxt",
|
|
82
82
|
staticClass: "node-input flex-item",
|
|
83
83
|
attrs: {
|
|
@@ -85,32 +85,32 @@ var B = function() {
|
|
|
85
85
|
placeholder: e.defaultOptions.inputPlaceholder
|
|
86
86
|
},
|
|
87
87
|
on: {
|
|
88
|
-
blur: function(
|
|
89
|
-
return e.inputBlur(
|
|
88
|
+
blur: function(n) {
|
|
89
|
+
return e.inputBlur(n, o, s);
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
92
|
nativeOn: {
|
|
93
|
-
keyup: function(
|
|
94
|
-
return function(
|
|
95
|
-
return e.inputKeyup(
|
|
93
|
+
keyup: function(n) {
|
|
94
|
+
return function(y) {
|
|
95
|
+
return e.inputKeyup(y, o, s);
|
|
96
96
|
}.apply(null, arguments);
|
|
97
97
|
},
|
|
98
|
-
click: function(
|
|
99
|
-
|
|
98
|
+
click: function(n) {
|
|
99
|
+
n.stopPropagation();
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
model: {
|
|
103
103
|
value: e.text,
|
|
104
|
-
callback: function(
|
|
105
|
-
e.text =
|
|
104
|
+
callback: function(n) {
|
|
105
|
+
e.text = n;
|
|
106
106
|
},
|
|
107
107
|
expression: "text"
|
|
108
108
|
}
|
|
109
|
-
}), e.confirmButton ? [
|
|
109
|
+
}), e.confirmButton ? [i("ElButton", {
|
|
110
110
|
directives: [{
|
|
111
111
|
name: "show",
|
|
112
112
|
rawName: "v-show",
|
|
113
|
-
value: !
|
|
113
|
+
value: !s.loading,
|
|
114
114
|
expression: "!data.loading"
|
|
115
115
|
}],
|
|
116
116
|
staticClass: "shrink-0",
|
|
@@ -119,15 +119,15 @@ var B = function() {
|
|
|
119
119
|
type: "text"
|
|
120
120
|
},
|
|
121
121
|
on: {
|
|
122
|
-
click: function(
|
|
123
|
-
return
|
|
122
|
+
click: function(n) {
|
|
123
|
+
return n.stopPropagation(), e.onConfirm(o, s);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
}, [e._v("
|
|
126
|
+
}, [e._v("确定")]), i("ElButton", {
|
|
127
127
|
directives: [{
|
|
128
128
|
name: "show",
|
|
129
129
|
rawName: "v-show",
|
|
130
|
-
value: !
|
|
130
|
+
value: !s.loading,
|
|
131
131
|
expression: "!data.loading"
|
|
132
132
|
}],
|
|
133
133
|
staticClass: "shrink-0",
|
|
@@ -136,26 +136,26 @@ var B = function() {
|
|
|
136
136
|
type: "text"
|
|
137
137
|
},
|
|
138
138
|
on: {
|
|
139
|
-
click: function(
|
|
140
|
-
return
|
|
139
|
+
click: function(n) {
|
|
140
|
+
return n.stopPropagation(), e.onCancel(o, s);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
}, [e._v("
|
|
143
|
+
}, [e._v("取消")])] : e._e()], 2)] : [i("span", {
|
|
144
144
|
staticClass: "custom-tree-node",
|
|
145
145
|
attrs: {
|
|
146
|
-
"data-id":
|
|
146
|
+
"data-id": s.id
|
|
147
147
|
}
|
|
148
|
-
}, [
|
|
148
|
+
}, [i("span", {
|
|
149
149
|
staticClass: "node-label flex-row flex-item oh ellipsis-1"
|
|
150
|
-
}, [e.icon ?
|
|
150
|
+
}, [e.icon ? i("i", {
|
|
151
151
|
staticClass: "node-icon",
|
|
152
|
-
class:
|
|
153
|
-
}) : e._e(),
|
|
152
|
+
class: s.loading ? "el-icon-loading" : e.icon(s, o)
|
|
153
|
+
}) : e._e(), i("span", {
|
|
154
154
|
staticClass: "flex-item-relative",
|
|
155
155
|
staticStyle: {
|
|
156
156
|
height: "21px"
|
|
157
157
|
}
|
|
158
|
-
}, [
|
|
158
|
+
}, [i("span", {
|
|
159
159
|
staticClass: "ellipsis-1 absolute-box et-tree-label",
|
|
160
160
|
attrs: {
|
|
161
161
|
title: o.label
|
|
@@ -163,54 +163,54 @@ var B = function() {
|
|
|
163
163
|
}, [e._t("label", function() {
|
|
164
164
|
return [e._v(e._s(o.label))];
|
|
165
165
|
}, {
|
|
166
|
-
data:
|
|
166
|
+
data: s,
|
|
167
167
|
node: o
|
|
168
168
|
})], 2)]), e._t("label-suffix", null, {
|
|
169
169
|
node: o,
|
|
170
|
-
data:
|
|
171
|
-
})], 2), !e.contextMenu && !e.readonly ?
|
|
170
|
+
data: s
|
|
171
|
+
})], 2), !e.contextMenu && !e.readonly ? i("span", {
|
|
172
172
|
directives: [{
|
|
173
173
|
name: "show",
|
|
174
174
|
rawName: "v-show",
|
|
175
|
-
value: !
|
|
175
|
+
value: !s.loading && !e.loading,
|
|
176
176
|
expression: "!data.loading && !loading"
|
|
177
177
|
}],
|
|
178
178
|
staticClass: "handle-actions"
|
|
179
|
-
}, [
|
|
179
|
+
}, [i("ElButton", {
|
|
180
180
|
attrs: {
|
|
181
181
|
size: "mini",
|
|
182
182
|
type: "text"
|
|
183
183
|
},
|
|
184
184
|
on: {
|
|
185
|
-
click: function(
|
|
186
|
-
return
|
|
185
|
+
click: function(n) {
|
|
186
|
+
return n.stopPropagation(), e.appendChildNode(o, s);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
}, [e._v("
|
|
189
|
+
}, [e._v("添加")]), i("ElButton", {
|
|
190
190
|
attrs: {
|
|
191
191
|
size: "mini",
|
|
192
192
|
type: "text"
|
|
193
193
|
},
|
|
194
194
|
on: {
|
|
195
|
-
click: function(
|
|
196
|
-
return
|
|
195
|
+
click: function(n) {
|
|
196
|
+
return n.stopPropagation(), e.editNode(o, s);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
}, [e._v("
|
|
199
|
+
}, [e._v("修改")]), i("ElPopconfirm", {
|
|
200
200
|
staticClass: "pop-confirm",
|
|
201
201
|
attrs: {
|
|
202
202
|
"icon-color": "red",
|
|
203
|
-
title: "
|
|
203
|
+
title: "你确定要删除吗?"
|
|
204
204
|
},
|
|
205
205
|
on: {
|
|
206
|
-
confirm: function(
|
|
207
|
-
return e.removeNode(o,
|
|
206
|
+
confirm: function(n) {
|
|
207
|
+
return e.removeNode(o, s);
|
|
208
208
|
}
|
|
209
209
|
},
|
|
210
210
|
scopedSlots: e._u([{
|
|
211
211
|
key: "reference",
|
|
212
212
|
fn: function() {
|
|
213
|
-
return [
|
|
213
|
+
return [i("ElButton", {
|
|
214
214
|
directives: [{
|
|
215
215
|
name: "show",
|
|
216
216
|
rawName: "v-show",
|
|
@@ -225,26 +225,26 @@ var B = function() {
|
|
|
225
225
|
type: "text"
|
|
226
226
|
},
|
|
227
227
|
on: {
|
|
228
|
-
click: function(
|
|
229
|
-
|
|
228
|
+
click: function(n) {
|
|
229
|
+
n.stopPropagation();
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
}, [e._v("
|
|
232
|
+
}, [e._v("删除")])];
|
|
233
233
|
},
|
|
234
234
|
proxy: !0
|
|
235
235
|
}], null, !0)
|
|
236
|
-
})], 1) : e._e(), e.contextMenuIcon && e.contextMenu && !e.readonly ?
|
|
236
|
+
})], 1) : e._e(), e.contextMenuIcon && e.contextMenu && !e.readonly ? i("span", {
|
|
237
237
|
directives: [{
|
|
238
238
|
name: "show",
|
|
239
239
|
rawName: "v-show",
|
|
240
|
-
value: !
|
|
240
|
+
value: !s.loading && !e.loading,
|
|
241
241
|
expression: "!data.loading && !loading"
|
|
242
242
|
}],
|
|
243
243
|
staticClass: "handle-actions",
|
|
244
244
|
staticStyle: {
|
|
245
245
|
display: "inline-block"
|
|
246
246
|
}
|
|
247
|
-
}, [
|
|
247
|
+
}, [i("ElButton", {
|
|
248
248
|
staticStyle: {
|
|
249
249
|
padding: "6px 10px 0"
|
|
250
250
|
},
|
|
@@ -253,18 +253,18 @@ var B = function() {
|
|
|
253
253
|
type: "text"
|
|
254
254
|
},
|
|
255
255
|
on: {
|
|
256
|
-
click: function(
|
|
257
|
-
return
|
|
256
|
+
click: function(n) {
|
|
257
|
+
return n.stopPropagation(), e.showContextMenu(n, s, o);
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
}, [e._v(". . .")])], 1) : e._e()])]];
|
|
261
261
|
}, {
|
|
262
262
|
node: o,
|
|
263
|
-
data:
|
|
263
|
+
data: s
|
|
264
264
|
})];
|
|
265
265
|
}
|
|
266
266
|
}], null, !0)
|
|
267
|
-
}, "ElTree", e.filterTreeProperties(e.$attrs), !1), e.filterTreeEvents(e.$listeners))), e.contextMenu && !e.readonly ?
|
|
267
|
+
}, "ElTree", e.filterTreeProperties(e.$attrs), !1), e.filterTreeEvents(e.$listeners))), e.contextMenu && !e.readonly ? i("div", {
|
|
268
268
|
directives: [{
|
|
269
269
|
name: "show",
|
|
270
270
|
rawName: "v-show",
|
|
@@ -274,10 +274,10 @@ var B = function() {
|
|
|
274
274
|
ref: "contextMenu",
|
|
275
275
|
staticClass: "menu",
|
|
276
276
|
style: e.position
|
|
277
|
-
}, [
|
|
277
|
+
}, [i("ul", {
|
|
278
278
|
staticClass: "menu-list"
|
|
279
279
|
}, [e._t("context-menu", function() {
|
|
280
|
-
return [
|
|
280
|
+
return [i("li", {
|
|
281
281
|
directives: [{
|
|
282
282
|
name: "show",
|
|
283
283
|
rawName: "v-show",
|
|
@@ -286,28 +286,28 @@ var B = function() {
|
|
|
286
286
|
}],
|
|
287
287
|
staticClass: "menu-item",
|
|
288
288
|
on: {
|
|
289
|
-
click: function(
|
|
289
|
+
click: function(a) {
|
|
290
290
|
return e.appendPeerNode(e.curNode, e.curData);
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
}, [
|
|
293
|
+
}, [i("i", {
|
|
294
294
|
staticClass: "menu-item-icon el-icon-lx-add",
|
|
295
295
|
staticStyle: {
|
|
296
296
|
color: "#228b22"
|
|
297
297
|
}
|
|
298
|
-
}), e._v(e._s(e.menuLabel.appendPeer) + " ")]),
|
|
298
|
+
}), e._v(e._s(e.menuLabel.appendPeer) + " ")]), i("li", {
|
|
299
299
|
staticClass: "menu-item",
|
|
300
300
|
on: {
|
|
301
|
-
click: function(
|
|
301
|
+
click: function(a) {
|
|
302
302
|
return e.appendChildNode(e.curNode, e.curData);
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
|
-
}, [
|
|
305
|
+
}, [i("i", {
|
|
306
306
|
staticClass: "menu-item-icon el-icon-lx-add",
|
|
307
307
|
staticStyle: {
|
|
308
308
|
color: "#228b22"
|
|
309
309
|
}
|
|
310
|
-
}), e._v(e._s(e.menuLabel.appendChild) + " ")]),
|
|
310
|
+
}), e._v(e._s(e.menuLabel.appendChild) + " ")]), i("li", {
|
|
311
311
|
directives: [{
|
|
312
312
|
name: "show",
|
|
313
313
|
rawName: "v-show",
|
|
@@ -316,16 +316,16 @@ var B = function() {
|
|
|
316
316
|
}],
|
|
317
317
|
staticClass: "menu-item",
|
|
318
318
|
on: {
|
|
319
|
-
click: function(
|
|
319
|
+
click: function(a) {
|
|
320
320
|
return e.editNode(e.curNode, e.curData);
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
}, [
|
|
323
|
+
}, [i("i", {
|
|
324
324
|
staticClass: "menu-item-icon el-icon-edit-outline",
|
|
325
325
|
staticStyle: {
|
|
326
326
|
color: "#ffa500"
|
|
327
327
|
}
|
|
328
|
-
}), e._v(e._s(e.menuLabel.editNode) + " ")]),
|
|
328
|
+
}), e._v(e._s(e.menuLabel.editNode) + " ")]), i("li", {
|
|
329
329
|
directives: [{
|
|
330
330
|
name: "show",
|
|
331
331
|
rawName: "v-show",
|
|
@@ -334,11 +334,11 @@ var B = function() {
|
|
|
334
334
|
}],
|
|
335
335
|
staticClass: "menu-item",
|
|
336
336
|
on: {
|
|
337
|
-
click: function(
|
|
337
|
+
click: function(a) {
|
|
338
338
|
return e.removeNodeModal(e.curNode, e.curData);
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
-
}, [
|
|
341
|
+
}, [i("i", {
|
|
342
342
|
staticClass: "menu-item-icon el-icon-delete",
|
|
343
343
|
staticStyle: {
|
|
344
344
|
color: "#f00"
|
|
@@ -354,7 +354,7 @@ const M = {
|
|
|
354
354
|
props: {
|
|
355
355
|
label: {
|
|
356
356
|
type: String,
|
|
357
|
-
default: "
|
|
357
|
+
default: "书签"
|
|
358
358
|
},
|
|
359
359
|
addRootNodeLabel: {
|
|
360
360
|
type: String
|
|
@@ -365,9 +365,9 @@ const M = {
|
|
|
365
365
|
},
|
|
366
366
|
newNodeBuilder: {
|
|
367
367
|
type: Function,
|
|
368
|
-
default: (e,
|
|
368
|
+
default: (e, t) => ({
|
|
369
369
|
name: e,
|
|
370
|
-
parentId:
|
|
370
|
+
parentId: t.id
|
|
371
371
|
})
|
|
372
372
|
},
|
|
373
373
|
contextMenu: Boolean,
|
|
@@ -408,16 +408,16 @@ const M = {
|
|
|
408
408
|
default: () => ({
|
|
409
409
|
children: "children",
|
|
410
410
|
label: "name",
|
|
411
|
-
isLeaf: (e) =>
|
|
411
|
+
isLeaf: (e) => d(e, "hasChildren") ? !e.hasChildren : d(e, "hasChild") ? !e.hasChild : d(e, "children") && e.children ? e.children.length === 0 : !0
|
|
412
412
|
})
|
|
413
413
|
},
|
|
414
414
|
menuLabel: {
|
|
415
415
|
type: Object,
|
|
416
416
|
default: () => ({
|
|
417
|
-
appendPeer: "
|
|
418
|
-
appendChild: "
|
|
419
|
-
removeNode: "
|
|
420
|
-
editNode: "
|
|
417
|
+
appendPeer: "添加同级节点",
|
|
418
|
+
appendChild: "添加",
|
|
419
|
+
removeNode: "删除",
|
|
420
|
+
editNode: "修改"
|
|
421
421
|
})
|
|
422
422
|
},
|
|
423
423
|
icon: {
|
|
@@ -456,12 +456,12 @@ const M = {
|
|
|
456
456
|
computed: {
|
|
457
457
|
defaultOptions() {
|
|
458
458
|
return {
|
|
459
|
-
confirmButtonText: "
|
|
460
|
-
cancelButtonText: "
|
|
459
|
+
confirmButtonText: "确定",
|
|
460
|
+
cancelButtonText: "取消",
|
|
461
461
|
closeOnClickModal: !1,
|
|
462
462
|
modal: !0,
|
|
463
|
-
inputErrorMessage: `${this.label}
|
|
464
|
-
inputPlaceholder:
|
|
463
|
+
inputErrorMessage: `${this.label}名不能为空!`,
|
|
464
|
+
inputPlaceholder: `请输入${this.label}名...`,
|
|
465
465
|
inputValidator: (e) => e != null && e.trim().length > 0
|
|
466
466
|
};
|
|
467
467
|
},
|
|
@@ -482,10 +482,10 @@ const M = {
|
|
|
482
482
|
this.tryFetch();
|
|
483
483
|
},
|
|
484
484
|
mounted() {
|
|
485
|
-
|
|
485
|
+
h(this.$refs.tree.$el, this.resize), h(this.$refs.treeWrapper, this.resize);
|
|
486
486
|
},
|
|
487
487
|
beforeDestroy() {
|
|
488
|
-
|
|
488
|
+
u(this.$refs.tree.$el, this.resize), u(this.$refs.treeWrapper, this.resize);
|
|
489
489
|
},
|
|
490
490
|
methods: {
|
|
491
491
|
filterTreeProperties: b,
|
|
@@ -494,49 +494,49 @@ const M = {
|
|
|
494
494
|
this.reserveExpandKey && this.expandedKeys.push(e[this.nodeKey]);
|
|
495
495
|
},
|
|
496
496
|
removeExpandKey(e) {
|
|
497
|
-
this.reserveExpandKey && (this.expandedKeys = this.expandedKeys.filter((
|
|
497
|
+
this.reserveExpandKey && (this.expandedKeys = this.expandedKeys.filter((t) => t !== e[this.nodeKey]));
|
|
498
498
|
},
|
|
499
499
|
resize() {
|
|
500
500
|
x(this.$refs.treeWrapper) ? this.right = 4 + w : this.right = 4;
|
|
501
501
|
},
|
|
502
|
-
async showContextMenu(e,
|
|
503
|
-
|
|
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));
|
|
504
504
|
},
|
|
505
505
|
hideContextMenu() {
|
|
506
506
|
this.showMenu = !1, window.removeEventListener("click", this.hideContextMenu);
|
|
507
507
|
},
|
|
508
508
|
async tryFetch() {
|
|
509
|
-
var e
|
|
509
|
+
var e;
|
|
510
510
|
if (this.lazy === !1 && this.fetchApi) {
|
|
511
|
-
const t = await this.fetchApi((
|
|
512
|
-
if (
|
|
513
|
-
const
|
|
514
|
-
|
|
515
|
-
} else if (
|
|
516
|
-
const
|
|
517
|
-
|
|
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
518
|
} else
|
|
519
519
|
this.treeData = t.data;
|
|
520
520
|
}
|
|
521
521
|
},
|
|
522
|
-
async loadNode(e,
|
|
523
|
-
var
|
|
522
|
+
async loadNode(e, t) {
|
|
523
|
+
var i, a, o;
|
|
524
524
|
if (e.level === 0) {
|
|
525
|
-
const
|
|
526
|
-
if (this.empty =
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
} else if (
|
|
530
|
-
const
|
|
531
|
-
|
|
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
532
|
} else
|
|
533
|
-
|
|
534
|
-
await this.$nextTick(), this.$emit("root-node-loaded",
|
|
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]);
|
|
535
535
|
} else {
|
|
536
536
|
if (e.leaf || e.data.isTempNode)
|
|
537
|
-
return
|
|
538
|
-
const
|
|
539
|
-
|
|
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);
|
|
540
540
|
}
|
|
541
541
|
},
|
|
542
542
|
clear() {
|
|
@@ -549,77 +549,77 @@ const M = {
|
|
|
549
549
|
this.newChild && this.newChild.id === -1 && (console.log(this.newChild), this.$refs.tree.remove(this.newChild), this.$emit("remove-new-node"));
|
|
550
550
|
},
|
|
551
551
|
cancelEdit() {
|
|
552
|
-
this.editData && (
|
|
552
|
+
this.editData && (l(this.editData.edit) ? this.$set(this.editData, "edit", !0) : this.editData.edit = !1);
|
|
553
553
|
},
|
|
554
|
-
async editNode(e,
|
|
555
|
-
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData =
|
|
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
556
|
...this.defaultOptions,
|
|
557
|
-
inputValue:
|
|
558
|
-
beforeClose: async (
|
|
559
|
-
if (
|
|
557
|
+
inputValue: t[this.treeProps.label],
|
|
558
|
+
beforeClose: async (i, a, o) => {
|
|
559
|
+
if (i === "confirm") {
|
|
560
560
|
try {
|
|
561
|
-
|
|
561
|
+
a.confirmButtonLoading = !0, a.confirmButtonText = "处理中...", this.text = a.inputValue, await this.onConfirm(this.curNode, this.curData), o();
|
|
562
562
|
} catch {
|
|
563
|
-
|
|
563
|
+
a.confirmButtonText = "确定";
|
|
564
564
|
}
|
|
565
|
-
|
|
565
|
+
a.confirmButtonLoading = !1;
|
|
566
566
|
} else
|
|
567
567
|
o();
|
|
568
568
|
}
|
|
569
|
-
}).catch((
|
|
569
|
+
}).catch((i) => i);
|
|
570
570
|
},
|
|
571
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(
|
|
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
573
|
...this.defaultOptions,
|
|
574
|
-
beforeClose: async (e,
|
|
574
|
+
beforeClose: async (e, t, i) => {
|
|
575
575
|
if (e === "confirm") {
|
|
576
576
|
try {
|
|
577
|
-
this.createNewChild(-1),
|
|
578
|
-
const
|
|
579
|
-
this.newChild[this.treeProps.label] =
|
|
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
580
|
} catch {
|
|
581
|
-
|
|
581
|
+
t.confirmButtonText = "确定";
|
|
582
582
|
}
|
|
583
|
-
|
|
583
|
+
t.confirmButtonLoading = !1;
|
|
584
584
|
} else
|
|
585
|
-
|
|
585
|
+
i();
|
|
586
586
|
}
|
|
587
587
|
}).catch((e) => e);
|
|
588
588
|
},
|
|
589
589
|
appendChildNode(e) {
|
|
590
590
|
this.text = "";
|
|
591
|
-
const
|
|
591
|
+
const t = e.expanded;
|
|
592
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(
|
|
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}名:`, {
|
|
594
594
|
...this.defaultOptions,
|
|
595
|
-
beforeClose: async (
|
|
596
|
-
if (
|
|
595
|
+
beforeClose: async (i, a, o) => {
|
|
596
|
+
if (i === "confirm") {
|
|
597
597
|
try {
|
|
598
|
-
this.createNewChild(e.data.id),
|
|
599
|
-
const
|
|
600
|
-
this.newChild[this.treeProps.label] =
|
|
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
601
|
} catch {
|
|
602
|
-
|
|
602
|
+
a.confirmButtonText = "确定";
|
|
603
603
|
}
|
|
604
|
-
|
|
604
|
+
a.confirmButtonLoading = !1;
|
|
605
605
|
} else
|
|
606
606
|
o();
|
|
607
607
|
}
|
|
608
|
-
}).catch((
|
|
608
|
+
}).catch((i) => i);
|
|
609
609
|
});
|
|
610
610
|
},
|
|
611
|
-
appendChildNodeWithData(e,
|
|
611
|
+
appendChildNodeWithData(e, t, i) {
|
|
612
612
|
this.text = "";
|
|
613
|
-
const
|
|
613
|
+
const a = e.expanded;
|
|
614
614
|
e.expand(async () => {
|
|
615
615
|
this.clear(), this.newChild = {
|
|
616
616
|
id: -1,
|
|
617
|
-
parentId:
|
|
618
|
-
[this.treeProps.label]:
|
|
617
|
+
parentId: t,
|
|
618
|
+
[this.treeProps.label]: i,
|
|
619
619
|
edit: !1,
|
|
620
620
|
isTempNode: !0,
|
|
621
621
|
hasChildren: !1
|
|
622
|
-
}, this.$refs.tree.append(this.newChild, e), await this.scrollIntoView(
|
|
622
|
+
}, this.$refs.tree.append(this.newChild, e), await this.scrollIntoView(a);
|
|
623
623
|
});
|
|
624
624
|
},
|
|
625
625
|
appendPeerNode(e) {
|
|
@@ -639,8 +639,8 @@ const M = {
|
|
|
639
639
|
}) : await this.addRootNode(e);
|
|
640
640
|
},
|
|
641
641
|
updateNode(e) {
|
|
642
|
-
const
|
|
643
|
-
|
|
642
|
+
const t = this.$refs.tree.getNode(e);
|
|
643
|
+
t && (t.data = e);
|
|
644
644
|
},
|
|
645
645
|
setCurrentKey(e) {
|
|
646
646
|
this.$refs.tree && this.$refs.tree.setCurrentKey(e);
|
|
@@ -657,8 +657,8 @@ const M = {
|
|
|
657
657
|
},
|
|
658
658
|
async removeNodeModal(e) {
|
|
659
659
|
await this.$confirm(
|
|
660
|
-
|
|
661
|
-
"
|
|
660
|
+
`你确定要删除${this.label}[<span class="break-word" style="color: orange">${e.data[this.treeProps.label]}</span>]吗?`,
|
|
661
|
+
"系统提示",
|
|
662
662
|
{
|
|
663
663
|
type: "warning",
|
|
664
664
|
modal: !0,
|
|
@@ -667,54 +667,54 @@ const M = {
|
|
|
667
667
|
closeOnClickModal: !1,
|
|
668
668
|
confirmButtonClass: "el-button--danger",
|
|
669
669
|
cancelButtonClass: "el-button--primary is-plain",
|
|
670
|
-
beforeClose: async (
|
|
671
|
-
if (
|
|
670
|
+
beforeClose: async (t, i, a) => {
|
|
671
|
+
if (t === "confirm") {
|
|
672
672
|
try {
|
|
673
|
-
|
|
674
|
-
const o = e.parent,
|
|
675
|
-
|
|
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
676
|
} catch {
|
|
677
677
|
}
|
|
678
|
-
|
|
678
|
+
i.confirmButtonText = "确定", i.confirmButtonLoading = !1;
|
|
679
679
|
} else
|
|
680
|
-
|
|
680
|
+
a();
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
|
-
).catch((
|
|
683
|
+
).catch((t) => t);
|
|
684
684
|
},
|
|
685
685
|
async removeNode(e) {
|
|
686
686
|
try {
|
|
687
|
-
const
|
|
687
|
+
const t = e.parent;
|
|
688
688
|
if (this.deleteApi) {
|
|
689
|
-
const
|
|
690
|
-
|
|
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
691
|
} else
|
|
692
692
|
this.$refs.tree.remove(e);
|
|
693
693
|
} catch {
|
|
694
694
|
}
|
|
695
695
|
},
|
|
696
|
-
async onConfirm(e,
|
|
697
|
-
if (
|
|
696
|
+
async onConfirm(e, t) {
|
|
697
|
+
if (t[this.treeProps.label] === this.text || !C(this.text)) {
|
|
698
698
|
this.clear();
|
|
699
699
|
return;
|
|
700
700
|
}
|
|
701
|
-
|
|
701
|
+
l(t.loading) ? this.$set(t, "loading", !0) : t.loading = !0;
|
|
702
702
|
try {
|
|
703
|
-
if (this.loading = !0,
|
|
704
|
-
const
|
|
705
|
-
|
|
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
706
|
} else
|
|
707
|
-
await this.updateApi({ ...
|
|
708
|
-
|
|
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
709
|
} catch {
|
|
710
710
|
}
|
|
711
|
-
|
|
711
|
+
t.loading = !1, this.loading = !1;
|
|
712
712
|
},
|
|
713
|
-
onCancel(e,
|
|
714
|
-
|
|
713
|
+
onCancel(e, t) {
|
|
714
|
+
t.id === -1 ? this.$refs.tree.remove(e) : t.edit = !1, this.text = "";
|
|
715
715
|
},
|
|
716
|
-
nodeClick(e,
|
|
717
|
-
this.hideContextMenu(), (
|
|
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));
|
|
718
718
|
},
|
|
719
719
|
getCurrentNode() {
|
|
720
720
|
return this.$refs.tree.getCurrentNode();
|
|
@@ -725,14 +725,14 @@ const M = {
|
|
|
725
725
|
e && e.scrollIntoView();
|
|
726
726
|
},
|
|
727
727
|
async scrollIntoView(e) {
|
|
728
|
-
var
|
|
729
|
-
await this.$nextTick(), e || await g(300), (
|
|
728
|
+
var t, i;
|
|
729
|
+
await this.$nextTick(), e || await g(300), (i = (t = this.$refs) == null ? void 0 : t.labelTxt) == null || i.focus();
|
|
730
730
|
},
|
|
731
|
-
inputKeyup(e,
|
|
732
|
-
e.keyCode === 13 && this.onConfirm(
|
|
731
|
+
inputKeyup(e, t, i) {
|
|
732
|
+
e.keyCode === 13 && this.onConfirm(t, i), e.keyCode === 27 && this.clear();
|
|
733
733
|
},
|
|
734
|
-
inputBlur(e,
|
|
735
|
-
this.confirmButton || this.onConfirm(
|
|
734
|
+
inputBlur(e, t, i) {
|
|
735
|
+
this.confirmButton || this.onConfirm(t, i);
|
|
736
736
|
},
|
|
737
737
|
getCheckedKeys() {
|
|
738
738
|
return this.$refs.tree.getCheckedKeys();
|
|
@@ -755,7 +755,7 @@ const M = {
|
|
|
755
755
|
findTreeNode(e) {
|
|
756
756
|
return $(
|
|
757
757
|
this.$refs.tree.root.childNodes,
|
|
758
|
-
(
|
|
758
|
+
(t) => t.data === e || t.data.id === e,
|
|
759
759
|
"childNodes"
|
|
760
760
|
);
|
|
761
761
|
},
|
|
@@ -766,7 +766,7 @@ const M = {
|
|
|
766
766
|
this.lazy ? this.treeKey = Date.now() : await this.tryFetch();
|
|
767
767
|
}
|
|
768
768
|
}
|
|
769
|
-
},
|
|
769
|
+
}, m = {};
|
|
770
770
|
var K = /* @__PURE__ */ k(
|
|
771
771
|
M,
|
|
772
772
|
B,
|
|
@@ -778,8 +778,8 @@ var K = /* @__PURE__ */ k(
|
|
|
778
778
|
null
|
|
779
779
|
);
|
|
780
780
|
function P(e) {
|
|
781
|
-
for (let
|
|
782
|
-
this[
|
|
781
|
+
for (let t in m)
|
|
782
|
+
this[t] = m[t];
|
|
783
783
|
}
|
|
784
784
|
const R = /* @__PURE__ */ function() {
|
|
785
785
|
return K.exports;
|