@web-utils/component 3.0.4 → 3.0.6
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/address-input/index.mjs +22 -24
- package/awesome-button/index.mjs +29 -30
- package/card/index.mjs +40 -42
- package/carousel/index.mjs +25 -27
- package/chat/index.mjs +57 -67
- package/chunks/FormTemp.7f91629d.mjs +165 -0
- package/chunks/confirmable-mixin.817b542f.mjs +116 -0
- package/chunks/{dataformat.e655611c.mjs → dataformat.f995e2f9.mjs} +3 -3
- package/chunks/{event.10295951.mjs → event.b5d855dd.mjs} +1 -1
- package/chunks/{form-input-mixin.78a567bc.mjs → form-input-mixin.4632ad36.mjs} +1 -1
- package/chunks/{form-item-mixin.57cb2019.mjs → form-item-mixin.ad148e7b.mjs} +13 -13
- package/color-picker/index.mjs +128 -0
- package/confirm-button/index.mjs +1 -1
- package/confirmable/index.mjs +1 -1
- package/data-box/index.mjs +32 -34
- package/data-card/index.mjs +33 -35
- package/data-cardtext/index.mjs +27 -29
- package/data-display/index.mjs +33 -35
- package/data-icons/index.mjs +28 -30
- package/data-imgtext/index.mjs +27 -30
- package/data-operatext/index.mjs +39 -41
- package/data-panel/index.mjs +36 -38
- package/data-pay/index.mjs +20 -23
- package/data-price/index.mjs +32 -34
- package/data-progress/index.mjs +27 -30
- package/data-rotate/index.mjs +17 -19
- package/data-table-picker/index.mjs +22 -23
- package/data-tabs/index.mjs +31 -33
- package/dialog-form/index.mjs +22 -27
- package/dynamic-table/index.mjs +36 -40
- package/editable-progress/index.mjs +14 -16
- package/editable-tree/index.mjs +139 -143
- package/egd-collapse-item/index.mjs +2 -1
- package/element-dialog/index.mjs +24 -25
- package/flow-designer/index.mjs +1095 -1111
- package/form-block/index.mjs +22 -24
- package/form-cascader/index.mjs +20 -20
- package/form-checkbox-group/index.mjs +24 -25
- package/form-date-picker/index.mjs +18 -19
- package/form-holder/index.mjs +14 -15
- package/form-input/index.mjs +23 -23
- package/form-input-email/index.mjs +17 -17
- package/form-input-id-card/index.mjs +24 -24
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.mjs +26 -26
- package/form-input-tag/index.mjs +1 -1
- package/form-input-time/index.mjs +17 -17
- package/form-item/index.mjs +54 -56
- package/form-item-group/index.mjs +31 -33
- package/form-radio-group/index.mjs +51 -52
- package/form-select/index.mjs +31 -32
- package/form-switch/index.mjs +22 -22
- package/form-textarea/index.mjs +20 -20
- package/fy-array/index.mjs +61 -65
- package/fy-cascader/index.mjs +19 -20
- package/fy-checkbox/index.mjs +32 -37
- package/fy-code/index.mjs +13 -10
- package/fy-curd/index.mjs +638 -660
- package/fy-date/index.mjs +20 -21
- package/fy-draggable/index.mjs +19 -20
- package/fy-dynamic/index.mjs +26 -27
- package/fy-form/index.mjs +111 -122
- package/fy-form-design/index.mjs +1238 -1270
- package/fy-input/index.mjs +15 -17
- package/fy-input-color/index.mjs +25 -27
- package/fy-input-icon/index.mjs +20 -21
- package/fy-input-map/index.mjs +22 -24
- package/fy-input-number/index.mjs +22 -23
- package/fy-input-table/index.mjs +15 -17
- package/fy-input-tree/index.mjs +28 -32
- package/fy-progress/index.mjs +23 -24
- package/fy-radio/index.mjs +18 -23
- package/fy-rate/index.mjs +12 -13
- package/fy-select/index.mjs +40 -44
- package/fy-slider/index.mjs +17 -18
- package/fy-switch/index.mjs +20 -21
- package/fy-tabs/index.mjs +19 -21
- package/fy-time/index.mjs +14 -20
- package/fy-title/index.mjs +1 -1
- package/fy-tree/index.mjs +17 -21
- package/fy-upload/index.mjs +74 -76
- package/guide-steps/index.mjs +22 -24
- package/image-cropper/index.mjs +50 -51
- package/image-preview/index.mjs +24 -26
- package/index.mjs +480 -477
- package/input-number/index.mjs +13 -14
- package/input-number-range/index.mjs +23 -24
- package/login/index.mjs +35 -40
- package/nav-bar/index.mjs +13 -14
- package/notice/index.mjs +18 -19
- package/package.json +8 -9
- package/page-index/index.mjs +33 -34
- package/page-index-top/index.mjs +22 -24
- package/pageable-table/index.mjs +92 -96
- package/pageable-view/index.mjs +33 -34
- package/search/index.mjs +21 -23
- package/static-pageable-table/index.mjs +18 -20
- package/swiper/index.mjs +22 -23
- package/table-view/index.mjs +49 -53
- package/tag-render/index.mjs +19 -21
- package/text-ellipsis/index.mjs +11 -12
- package/tinymce-editor/index.mjs +50 -51
- package/toolbar-button/index.mjs +18 -19
- package/vue-cron/index.mjs +104 -112
- package/web-types.json +85 -1
- package/x-input-tag/index.mjs +47 -50
- package/chunks/FormTemp.d079292b.mjs +0 -139
- package/chunks/confirmable-mixin.26e1d0e0.mjs +0 -197
- package/chunks/detail.d6f8e347.mjs +0 -29
package/editable-tree/index.mjs
CHANGED
|
@@ -1,45 +1,41 @@
|
|
|
1
|
-
var b = Object.defineProperty,
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var b = Object.defineProperty, _ = Object.defineProperties;
|
|
2
|
+
var k = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var x = Object.getOwnPropertySymbols;
|
|
4
|
+
var B = Object.prototype.hasOwnProperty, T = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var w = (e, i, t) => i in e ? b(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, c = (e, i) => {
|
|
6
6
|
for (var t in i || (i = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
|
|
7
|
+
B.call(i, t) && w(e, t, i[t]);
|
|
8
|
+
if (x)
|
|
9
|
+
for (var t of x(i))
|
|
10
|
+
T.call(i, t) && w(e, t, i[t]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
var r = (e, i, t) => new Promise((s,
|
|
14
|
-
var
|
|
12
|
+
}, h = (e, i) => _(e, k(i));
|
|
13
|
+
var r = (e, i, t) => new Promise((s, o) => {
|
|
14
|
+
var n = (d) => {
|
|
15
15
|
try {
|
|
16
|
-
l(t.next(
|
|
17
|
-
} catch (
|
|
18
|
-
|
|
16
|
+
l(t.next(d));
|
|
17
|
+
} catch (f) {
|
|
18
|
+
o(f);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, a = (d) => {
|
|
21
21
|
try {
|
|
22
|
-
l(t.throw(
|
|
23
|
-
} catch (
|
|
24
|
-
|
|
22
|
+
l(t.throw(d));
|
|
23
|
+
} catch (f) {
|
|
24
|
+
o(f);
|
|
25
25
|
}
|
|
26
|
-
}, l = (
|
|
26
|
+
}, l = (d) => d.done ? s(d.value) : Promise.resolve(d.value).then(n, a);
|
|
27
27
|
l((t = t.apply(e, i)).next());
|
|
28
28
|
});
|
|
29
|
-
import { hasOwn as
|
|
30
|
-
import { addResizeListener as
|
|
31
|
-
import { cloneDeep as
|
|
32
|
-
import { a as
|
|
33
|
-
import
|
|
34
|
-
|
|
35
|
-
import I from "element-ui/lib/popconfirm";
|
|
36
|
-
import O from "element-ui/lib/tree";
|
|
37
|
-
import { n as F } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
|
|
38
|
-
var j = function() {
|
|
29
|
+
import { hasOwn as m, isVerticalScrollbarVisible as M, scrollbarWidth as K, computePosition as P, isPlainObject as u, isFunction as N, isUndefined as p, isNotEmpty as E, fastClone as D, delay as L, findTreeChildren as R } from "@web-utils/core";
|
|
30
|
+
import { addResizeListener as C, removeResizeListener as v } from "@web-utils/integrations/resize";
|
|
31
|
+
import { cloneDeep as g } from "@web-utils/integrations/lodash";
|
|
32
|
+
import { a as z, b as S, c as y } from "../chunks/index.57f871af.mjs";
|
|
33
|
+
import { n as V } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
|
|
34
|
+
var A = function() {
|
|
39
35
|
var e = this, i = e.$createElement, t = e._self._c || i;
|
|
40
36
|
return t("div", {
|
|
41
37
|
staticClass: "editable-tree"
|
|
42
|
-
}, [!e.readonly && e.addRootNodeButtonStyle === "top-right" ? t(
|
|
38
|
+
}, [!e.readonly && e.addRootNodeButtonStyle === "top-right" ? t("ElButton", {
|
|
43
39
|
staticStyle: {
|
|
44
40
|
position: "absolute",
|
|
45
41
|
top: "4px",
|
|
@@ -67,7 +63,7 @@ var j = function() {
|
|
|
67
63
|
staticStyle: {
|
|
68
64
|
"padding-left": "24px"
|
|
69
65
|
}
|
|
70
|
-
}, [t(
|
|
66
|
+
}, [t("ElButton", {
|
|
71
67
|
attrs: {
|
|
72
68
|
disabled: e.loading,
|
|
73
69
|
size: "mini",
|
|
@@ -78,7 +74,7 @@ var j = function() {
|
|
|
78
74
|
}
|
|
79
75
|
}, [t("i", {
|
|
80
76
|
staticClass: "el-icon-lx-add"
|
|
81
|
-
}), e._v(" " + e._s(e.addRootNodeLabel ? e.addRootNodeLabel : `添加${e.label}`) + " ")])], 1) : e._e(), t(
|
|
77
|
+
}), e._v(" " + e._s(e.addRootNodeLabel ? e.addRootNodeLabel : `添加${e.label}`) + " ")])], 1) : e._e(), t("ElTree", e._g(e._b({
|
|
82
78
|
key: e.treeKey,
|
|
83
79
|
ref: "tree",
|
|
84
80
|
staticClass: "flex-item",
|
|
@@ -101,17 +97,17 @@ var j = function() {
|
|
|
101
97
|
scopedSlots: e._u([{
|
|
102
98
|
key: "default",
|
|
103
99
|
fn: function(s) {
|
|
104
|
-
var
|
|
100
|
+
var o = s.node, n = s.data;
|
|
105
101
|
return [e._t("default", function() {
|
|
106
|
-
return [
|
|
102
|
+
return [n.edit ? [t("span", {
|
|
107
103
|
staticClass: "custom-tree-node flex-row flex-item oh",
|
|
108
104
|
attrs: {
|
|
109
|
-
"data-id":
|
|
105
|
+
"data-id": n.id
|
|
110
106
|
}
|
|
111
107
|
}, [e.icon ? t("i", {
|
|
112
108
|
staticClass: "node-icon shrink-0",
|
|
113
|
-
class:
|
|
114
|
-
}) : e._e(), t(
|
|
109
|
+
class: n.loading ? "el-icon-loading" : "el-icon-edit-outline"
|
|
110
|
+
}) : e._e(), t("ElInput", {
|
|
115
111
|
ref: "labelTxt",
|
|
116
112
|
staticClass: "node-input flex-item",
|
|
117
113
|
attrs: {
|
|
@@ -119,32 +115,32 @@ var j = function() {
|
|
|
119
115
|
placeholder: e.defaultOptions.inputPlaceholder
|
|
120
116
|
},
|
|
121
117
|
on: {
|
|
122
|
-
blur: function(
|
|
123
|
-
return e.inputBlur(
|
|
118
|
+
blur: function(a) {
|
|
119
|
+
return e.inputBlur(a, o, n);
|
|
124
120
|
}
|
|
125
121
|
},
|
|
126
122
|
nativeOn: {
|
|
127
|
-
keyup: function(
|
|
123
|
+
keyup: function(a) {
|
|
128
124
|
return function(l) {
|
|
129
|
-
return e.inputKeyup(l,
|
|
125
|
+
return e.inputKeyup(l, o, n);
|
|
130
126
|
}.apply(null, arguments);
|
|
131
127
|
},
|
|
132
|
-
click: function(
|
|
133
|
-
|
|
128
|
+
click: function(a) {
|
|
129
|
+
a.stopPropagation();
|
|
134
130
|
}
|
|
135
131
|
},
|
|
136
132
|
model: {
|
|
137
133
|
value: e.text,
|
|
138
|
-
callback: function(
|
|
139
|
-
e.text =
|
|
134
|
+
callback: function(a) {
|
|
135
|
+
e.text = a;
|
|
140
136
|
},
|
|
141
137
|
expression: "text"
|
|
142
138
|
}
|
|
143
|
-
}), e.confirmButton ? [t(
|
|
139
|
+
}), e.confirmButton ? [t("ElButton", {
|
|
144
140
|
directives: [{
|
|
145
141
|
name: "show",
|
|
146
142
|
rawName: "v-show",
|
|
147
|
-
value: !
|
|
143
|
+
value: !n.loading,
|
|
148
144
|
expression: "!data.loading"
|
|
149
145
|
}],
|
|
150
146
|
staticClass: "shrink-0",
|
|
@@ -153,15 +149,15 @@ var j = function() {
|
|
|
153
149
|
type: "text"
|
|
154
150
|
},
|
|
155
151
|
on: {
|
|
156
|
-
click: function(
|
|
157
|
-
return
|
|
152
|
+
click: function(a) {
|
|
153
|
+
return a.stopPropagation(), e.onConfirm(o, n);
|
|
158
154
|
}
|
|
159
155
|
}
|
|
160
|
-
}, [e._v("确定")]), t(
|
|
156
|
+
}, [e._v("确定")]), t("ElButton", {
|
|
161
157
|
directives: [{
|
|
162
158
|
name: "show",
|
|
163
159
|
rawName: "v-show",
|
|
164
|
-
value: !
|
|
160
|
+
value: !n.loading,
|
|
165
161
|
expression: "!data.loading"
|
|
166
162
|
}],
|
|
167
163
|
staticClass: "shrink-0",
|
|
@@ -170,20 +166,20 @@ var j = function() {
|
|
|
170
166
|
type: "text"
|
|
171
167
|
},
|
|
172
168
|
on: {
|
|
173
|
-
click: function(
|
|
174
|
-
return
|
|
169
|
+
click: function(a) {
|
|
170
|
+
return a.stopPropagation(), e.onCancel(o, n);
|
|
175
171
|
}
|
|
176
172
|
}
|
|
177
173
|
}, [e._v("取消")])] : e._e()], 2)] : [t("span", {
|
|
178
174
|
staticClass: "custom-tree-node",
|
|
179
175
|
attrs: {
|
|
180
|
-
"data-id":
|
|
176
|
+
"data-id": n.id
|
|
181
177
|
}
|
|
182
178
|
}, [t("span", {
|
|
183
179
|
staticClass: "node-label flex-row flex-item oh ellipsis-1"
|
|
184
180
|
}, [e.icon ? t("i", {
|
|
185
181
|
staticClass: "node-icon",
|
|
186
|
-
class:
|
|
182
|
+
class: n.loading ? "el-icon-loading" : e.icon(n, o)
|
|
187
183
|
}) : e._e(), t("span", {
|
|
188
184
|
staticClass: "flex-item-relative",
|
|
189
185
|
staticStyle: {
|
|
@@ -192,63 +188,63 @@ var j = function() {
|
|
|
192
188
|
}, [t("span", {
|
|
193
189
|
staticClass: "ellipsis-1 absolute-box et-tree-label",
|
|
194
190
|
attrs: {
|
|
195
|
-
title:
|
|
191
|
+
title: o.label
|
|
196
192
|
}
|
|
197
193
|
}, [e._t("label", function() {
|
|
198
|
-
return [e._v(e._s(
|
|
194
|
+
return [e._v(e._s(o.label))];
|
|
199
195
|
}, {
|
|
200
|
-
data:
|
|
201
|
-
node:
|
|
196
|
+
data: n,
|
|
197
|
+
node: o
|
|
202
198
|
})], 2)]), e._t("label-suffix", null, {
|
|
203
|
-
node:
|
|
204
|
-
data:
|
|
199
|
+
node: o,
|
|
200
|
+
data: n
|
|
205
201
|
})], 2), !e.contextMenu && !e.readonly ? t("span", {
|
|
206
202
|
directives: [{
|
|
207
203
|
name: "show",
|
|
208
204
|
rawName: "v-show",
|
|
209
|
-
value: !
|
|
205
|
+
value: !n.loading && !e.loading,
|
|
210
206
|
expression: "!data.loading && !loading"
|
|
211
207
|
}],
|
|
212
208
|
staticClass: "handle-actions"
|
|
213
|
-
}, [t(
|
|
209
|
+
}, [t("ElButton", {
|
|
214
210
|
attrs: {
|
|
215
211
|
size: "mini",
|
|
216
212
|
type: "text"
|
|
217
213
|
},
|
|
218
214
|
on: {
|
|
219
|
-
click: function(
|
|
220
|
-
return
|
|
215
|
+
click: function(a) {
|
|
216
|
+
return a.stopPropagation(), e.appendChildNode(o, n);
|
|
221
217
|
}
|
|
222
218
|
}
|
|
223
|
-
}, [e._v("添加")]), t(
|
|
219
|
+
}, [e._v("添加")]), t("ElButton", {
|
|
224
220
|
attrs: {
|
|
225
221
|
size: "mini",
|
|
226
222
|
type: "text"
|
|
227
223
|
},
|
|
228
224
|
on: {
|
|
229
|
-
click: function(
|
|
230
|
-
return
|
|
225
|
+
click: function(a) {
|
|
226
|
+
return a.stopPropagation(), e.editNode(o, n);
|
|
231
227
|
}
|
|
232
228
|
}
|
|
233
|
-
}, [e._v("修改")]), t(
|
|
229
|
+
}, [e._v("修改")]), t("ElPopconfirm", {
|
|
234
230
|
staticClass: "pop-confirm",
|
|
235
231
|
attrs: {
|
|
236
232
|
"icon-color": "red",
|
|
237
233
|
title: "你确定要删除吗?"
|
|
238
234
|
},
|
|
239
235
|
on: {
|
|
240
|
-
confirm: function(
|
|
241
|
-
return e.removeNode(
|
|
236
|
+
confirm: function(a) {
|
|
237
|
+
return e.removeNode(o, n);
|
|
242
238
|
}
|
|
243
239
|
},
|
|
244
240
|
scopedSlots: e._u([{
|
|
245
241
|
key: "reference",
|
|
246
242
|
fn: function() {
|
|
247
|
-
return [t(
|
|
243
|
+
return [t("ElButton", {
|
|
248
244
|
directives: [{
|
|
249
245
|
name: "show",
|
|
250
246
|
rawName: "v-show",
|
|
251
|
-
value:
|
|
247
|
+
value: o.isLeaf,
|
|
252
248
|
expression: "node.isLeaf"
|
|
253
249
|
}],
|
|
254
250
|
staticStyle: {
|
|
@@ -259,8 +255,8 @@ var j = function() {
|
|
|
259
255
|
type: "text"
|
|
260
256
|
},
|
|
261
257
|
on: {
|
|
262
|
-
click: function(
|
|
263
|
-
|
|
258
|
+
click: function(a) {
|
|
259
|
+
a.stopPropagation();
|
|
264
260
|
}
|
|
265
261
|
}
|
|
266
262
|
}, [e._v("删除")])];
|
|
@@ -271,14 +267,14 @@ var j = function() {
|
|
|
271
267
|
directives: [{
|
|
272
268
|
name: "show",
|
|
273
269
|
rawName: "v-show",
|
|
274
|
-
value: !
|
|
270
|
+
value: !n.loading && !e.loading,
|
|
275
271
|
expression: "!data.loading && !loading"
|
|
276
272
|
}],
|
|
277
273
|
staticClass: "handle-actions",
|
|
278
274
|
staticStyle: {
|
|
279
275
|
display: "inline-block"
|
|
280
276
|
}
|
|
281
|
-
}, [t(
|
|
277
|
+
}, [t("ElButton", {
|
|
282
278
|
staticStyle: {
|
|
283
279
|
padding: "6px 10px 0"
|
|
284
280
|
},
|
|
@@ -287,14 +283,14 @@ var j = function() {
|
|
|
287
283
|
type: "text"
|
|
288
284
|
},
|
|
289
285
|
on: {
|
|
290
|
-
click: function(
|
|
291
|
-
return
|
|
286
|
+
click: function(a) {
|
|
287
|
+
return a.stopPropagation(), e.showContextMenu(a, n, o);
|
|
292
288
|
}
|
|
293
289
|
}
|
|
294
290
|
}, [e._v(". . .")])], 1) : e._e()])]];
|
|
295
291
|
}, {
|
|
296
|
-
node:
|
|
297
|
-
data:
|
|
292
|
+
node: o,
|
|
293
|
+
data: n
|
|
298
294
|
})];
|
|
299
295
|
}
|
|
300
296
|
}], null, !0)
|
|
@@ -382,8 +378,8 @@ var j = function() {
|
|
|
382
378
|
curNode: e.curNode,
|
|
383
379
|
curData: e.curData
|
|
384
380
|
})], 2)]) : e._e()], 1)], 1);
|
|
385
|
-
},
|
|
386
|
-
const
|
|
381
|
+
}, I = [];
|
|
382
|
+
const O = {
|
|
387
383
|
name: "EditableTree",
|
|
388
384
|
props: {
|
|
389
385
|
label: {
|
|
@@ -442,7 +438,7 @@ const q = {
|
|
|
442
438
|
default: () => ({
|
|
443
439
|
children: "children",
|
|
444
440
|
label: "name",
|
|
445
|
-
isLeaf: (e) =>
|
|
441
|
+
isLeaf: (e) => m(e, "hasChildren") ? !e.hasChildren : m(e, "hasChild") ? !e.hasChild : m(e, "children") && e.children ? e.children.length === 0 : !0
|
|
446
442
|
})
|
|
447
443
|
},
|
|
448
444
|
menuLabel: {
|
|
@@ -516,14 +512,14 @@ const q = {
|
|
|
516
512
|
this.tryFetch();
|
|
517
513
|
},
|
|
518
514
|
mounted() {
|
|
519
|
-
|
|
515
|
+
C(this.$refs.tree.$el, this.resize), C(this.$refs.treeWrapper, this.resize);
|
|
520
516
|
},
|
|
521
517
|
beforeDestroy() {
|
|
522
518
|
v(this.$refs.tree.$el, this.resize), v(this.$refs.treeWrapper, this.resize);
|
|
523
519
|
},
|
|
524
520
|
methods: {
|
|
525
|
-
filterTreeProperties:
|
|
526
|
-
filterTreeEvents:
|
|
521
|
+
filterTreeProperties: z,
|
|
522
|
+
filterTreeEvents: S,
|
|
527
523
|
addExpandKey(e) {
|
|
528
524
|
this.reserveExpandKey && this.expandedKeys.push(e[this.nodeKey]);
|
|
529
525
|
},
|
|
@@ -531,11 +527,11 @@ const q = {
|
|
|
531
527
|
this.reserveExpandKey && (this.expandedKeys = this.expandedKeys.filter((i) => i !== e[this.nodeKey]));
|
|
532
528
|
},
|
|
533
529
|
resize() {
|
|
534
|
-
|
|
530
|
+
M(this.$refs.treeWrapper) ? this.right = 4 + K : this.right = 4;
|
|
535
531
|
},
|
|
536
532
|
showContextMenu(e, i, t) {
|
|
537
533
|
return r(this, null, function* () {
|
|
538
|
-
i.contextmenu === !1 || i.id === -1 || i.id === 0 || i.edit === !0 || this.contextMenu && (this.curNode = t, this.curData = i, this.showMenu = !0, this.$refs.tree.setCurrentKey(i.id), yield this.$nextTick(), this.position =
|
|
534
|
+
i.contextmenu === !1 || i.id === -1 || i.id === 0 || i.edit === !0 || this.contextMenu && (this.curNode = t, this.curData = i, this.showMenu = !0, this.$refs.tree.setCurrentKey(i.id), yield this.$nextTick(), this.position = P(e, this.$refs.contextMenu), window.addEventListener("click", this.hideContextMenu));
|
|
539
535
|
});
|
|
540
536
|
},
|
|
541
537
|
hideContextMenu() {
|
|
@@ -546,12 +542,12 @@ const q = {
|
|
|
546
542
|
var e, i;
|
|
547
543
|
if (this.lazy === !1 && this.fetchApi) {
|
|
548
544
|
const t = yield this.fetchApi((i = (e = this.rootNode) == null ? void 0 : e.id) != null ? i : -1, {});
|
|
549
|
-
if (
|
|
550
|
-
const s =
|
|
545
|
+
if (u(t.data) && (t.data = [t.data]), t.data = t.data || [], this.empty = t.data.length === 0, u(this.customRootNode)) {
|
|
546
|
+
const s = g(this.customRootNode);
|
|
551
547
|
s[this.treeProps.children || "children"] = t.data, this.treeData = [s];
|
|
552
|
-
} else if (
|
|
548
|
+
} else if (N(this.customRootNode)) {
|
|
553
549
|
const s = this.customRootNode(t.data);
|
|
554
|
-
s[this.treeProps.children || "children"] = t.data, this.treeData =
|
|
550
|
+
s[this.treeProps.children || "children"] = t.data, this.treeData = u(s) ? [s] : s;
|
|
555
551
|
} else
|
|
556
552
|
this.treeData = t.data;
|
|
557
553
|
}
|
|
@@ -559,23 +555,23 @@ const q = {
|
|
|
559
555
|
},
|
|
560
556
|
loadNode(e, i) {
|
|
561
557
|
return r(this, null, function* () {
|
|
562
|
-
var t, s,
|
|
558
|
+
var t, s, o, n;
|
|
563
559
|
if (e.level === 0) {
|
|
564
|
-
const
|
|
565
|
-
if (this.empty =
|
|
566
|
-
const l =
|
|
567
|
-
l[this.treeProps.children || "children"] =
|
|
568
|
-
} else if (
|
|
569
|
-
const l = this.customRootNode(
|
|
570
|
-
l[this.treeProps.children || "children"] =
|
|
560
|
+
const a = yield this.fetchApi((s = (t = this.rootNode) == null ? void 0 : t.id) != null ? s : -1, e);
|
|
561
|
+
if (this.empty = a.data.length === 0, u(this.customRootNode)) {
|
|
562
|
+
const l = g(this.customRootNode);
|
|
563
|
+
l[this.treeProps.children || "children"] = a.data, i([l]);
|
|
564
|
+
} else if (N(this.customRootNode)) {
|
|
565
|
+
const l = this.customRootNode(a.data);
|
|
566
|
+
l[this.treeProps.children || "children"] = a.data, this.treeData = u(l) ? [l] : l;
|
|
571
567
|
} else
|
|
572
|
-
i(
|
|
573
|
-
yield this.$nextTick(), this.$emit("root-node-loaded",
|
|
568
|
+
i(a.data);
|
|
569
|
+
yield this.$nextTick(), this.$emit("root-node-loaded", a.data), this.defaultExpandedKeys ? this.expandedKeys = [(o = a == null ? void 0 : a.data[0]) == null ? void 0 : o.id, ...this.defaultExpandedKeys] : this.expandFirstNode && (this.expandedKeys = [(n = a == null ? void 0 : a.data[0]) == null ? void 0 : n.id]);
|
|
574
570
|
} else {
|
|
575
571
|
if (e.leaf || e.data.isTempNode)
|
|
576
572
|
return i([]);
|
|
577
|
-
const
|
|
578
|
-
i(
|
|
573
|
+
const a = yield this.fetchApi(e.data.id, e);
|
|
574
|
+
i(a.data), yield this.$nextTick(), this.$emit("node-loaded", a.data);
|
|
579
575
|
}
|
|
580
576
|
});
|
|
581
577
|
},
|
|
@@ -589,35 +585,35 @@ const q = {
|
|
|
589
585
|
this.newChild && this.newChild.id === -1 && (console.log(this.newChild), this.$refs.tree.remove(this.newChild), this.$emit("remove-new-node"));
|
|
590
586
|
},
|
|
591
587
|
cancelEdit() {
|
|
592
|
-
this.editData && (
|
|
588
|
+
this.editData && (p(this.editData.edit) ? this.$set(this.editData, "edit", !0) : this.editData.edit = !1);
|
|
593
589
|
},
|
|
594
590
|
editNode(e, i) {
|
|
595
591
|
return r(this, null, function* () {
|
|
596
|
-
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData = i, this.text = i[this.treeProps.label],
|
|
592
|
+
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData = i, this.text = i[this.treeProps.label], p(i.edit) ? this.$set(i, "edit", !0) : i.edit = !0, yield this.$nextTick(), this.$refs.labelTxt.focus()) : yield this.$prompt(`请输入新的${this.label}名:`, h(c({}, this.defaultOptions), {
|
|
597
593
|
inputValue: i[this.treeProps.label],
|
|
598
|
-
beforeClose: (t, s,
|
|
594
|
+
beforeClose: (t, s, o) => r(this, null, function* () {
|
|
599
595
|
if (t === "confirm") {
|
|
600
596
|
try {
|
|
601
|
-
s.confirmButtonLoading = !0, s.confirmButtonText = "处理中...", this.text = s.inputValue, yield this.onConfirm(this.curNode, this.curData),
|
|
602
|
-
} catch (
|
|
597
|
+
s.confirmButtonLoading = !0, s.confirmButtonText = "处理中...", this.text = s.inputValue, yield this.onConfirm(this.curNode, this.curData), o();
|
|
598
|
+
} catch (n) {
|
|
603
599
|
s.confirmButtonText = "确定";
|
|
604
600
|
}
|
|
605
601
|
s.confirmButtonLoading = !1;
|
|
606
602
|
} else
|
|
607
|
-
|
|
603
|
+
o();
|
|
608
604
|
})
|
|
609
605
|
})).catch((t) => t);
|
|
610
606
|
});
|
|
611
607
|
},
|
|
612
608
|
appendRootNode() {
|
|
613
609
|
return r(this, null, function* () {
|
|
614
|
-
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), yield this.scrollIntoView(!0)) : yield this.$prompt(`请输入${this.label}名:`,
|
|
610
|
+
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), yield this.scrollIntoView(!0)) : yield this.$prompt(`请输入${this.label}名:`, h(c({}, this.defaultOptions), {
|
|
615
611
|
beforeClose: (e, i, t) => r(this, null, function* () {
|
|
616
612
|
if (e === "confirm") {
|
|
617
613
|
try {
|
|
618
614
|
this.createNewChild(-1), i.confirmButtonLoading = !0, i.confirmButtonText = "处理中...";
|
|
619
615
|
const s = yield this.saveApi(this.newNodeBuilder(i.inputValue, { id: -1 }));
|
|
620
|
-
this.newChild[this.treeProps.label] = i.inputValue, this.newChild.edit = !1,
|
|
616
|
+
this.newChild[this.treeProps.label] = i.inputValue, this.newChild.edit = !1, y(this.newChild, s.data), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), yield this.locateView(), t();
|
|
621
617
|
} catch (s) {
|
|
622
618
|
i.confirmButtonText = "确定";
|
|
623
619
|
}
|
|
@@ -632,19 +628,19 @@ const q = {
|
|
|
632
628
|
this.text = "";
|
|
633
629
|
const i = e.expanded;
|
|
634
630
|
e.expand(() => r(this, null, function* () {
|
|
635
|
-
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(e.data.id), this.$refs.tree.append(this.newChild, e), yield this.scrollIntoView(i)) : yield this.$prompt(`请输入${this.label}名:`,
|
|
636
|
-
beforeClose: (t, s,
|
|
631
|
+
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(e.data.id), this.$refs.tree.append(this.newChild, e), yield this.scrollIntoView(i)) : yield this.$prompt(`请输入${this.label}名:`, h(c({}, this.defaultOptions), {
|
|
632
|
+
beforeClose: (t, s, o) => r(this, null, function* () {
|
|
637
633
|
if (t === "confirm") {
|
|
638
634
|
try {
|
|
639
635
|
this.createNewChild(e.data.id), s.confirmButtonLoading = !0, s.confirmButtonText = "处理中...";
|
|
640
|
-
const
|
|
641
|
-
this.newChild[this.treeProps.label] = s.inputValue, this.newChild.edit = !1,
|
|
642
|
-
} catch (
|
|
636
|
+
const n = yield this.saveApi(this.newNodeBuilder(s.inputValue, e.data));
|
|
637
|
+
this.newChild[this.treeProps.label] = s.inputValue, this.newChild.edit = !1, y(this.newChild, n.data), this.$refs.tree.append(this.newChild, e), yield this.locateView(), o();
|
|
638
|
+
} catch (n) {
|
|
643
639
|
s.confirmButtonText = "确定";
|
|
644
640
|
}
|
|
645
641
|
s.confirmButtonLoading = !1;
|
|
646
642
|
} else
|
|
647
|
-
|
|
643
|
+
o();
|
|
648
644
|
})
|
|
649
645
|
})).catch((t) => t);
|
|
650
646
|
}));
|
|
@@ -719,9 +715,9 @@ const q = {
|
|
|
719
715
|
if (i === "confirm") {
|
|
720
716
|
try {
|
|
721
717
|
t.confirmButtonLoading = !0, t.confirmButtonText = "删除...";
|
|
722
|
-
const
|
|
723
|
-
|
|
724
|
-
} catch (
|
|
718
|
+
const o = e.parent, n = yield this.deleteApi(e.data.id);
|
|
719
|
+
n.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(e), this.$emit("node-deleted", o, e.data), s()) : this.$message.error(n.message);
|
|
720
|
+
} catch (o) {
|
|
725
721
|
}
|
|
726
722
|
t.confirmButtonText = "确定", t.confirmButtonLoading = !1;
|
|
727
723
|
} else
|
|
@@ -746,17 +742,17 @@ const q = {
|
|
|
746
742
|
},
|
|
747
743
|
onConfirm(e, i) {
|
|
748
744
|
return r(this, null, function* () {
|
|
749
|
-
if (i[this.treeProps.label] === this.text || !
|
|
745
|
+
if (i[this.treeProps.label] === this.text || !E(this.text)) {
|
|
750
746
|
this.clear();
|
|
751
747
|
return;
|
|
752
748
|
}
|
|
753
|
-
|
|
749
|
+
p(i.loading) ? this.$set(i, "loading", !0) : i.loading = !0;
|
|
754
750
|
try {
|
|
755
751
|
if (this.loading = !0, i.id === -1) {
|
|
756
|
-
const t = yield this.saveApi(this.newNodeBuilder(this.text, e.parent.data || { id: -1 })), s =
|
|
757
|
-
|
|
752
|
+
const t = yield this.saveApi(this.newNodeBuilder(this.text, e.parent.data || { id: -1 })), s = D(i);
|
|
753
|
+
y(i, h(c({}, t.data), { isTempNode: !1 })), this.$emit("node-added", i, s, e), this.registerNode(e);
|
|
758
754
|
} else
|
|
759
|
-
yield this.updateApi(
|
|
755
|
+
yield this.updateApi(h(c({}, i), { [this.treeProps.label]: this.text }));
|
|
760
756
|
i[this.treeProps.label] = this.text, i.edit = !1, this.$emit("node-updated", i, e), this.text = "";
|
|
761
757
|
} catch (t) {
|
|
762
758
|
}
|
|
@@ -767,7 +763,7 @@ const q = {
|
|
|
767
763
|
i.id === -1 ? this.$refs.tree.remove(e) : i.edit = !1, this.text = "";
|
|
768
764
|
},
|
|
769
765
|
nodeClick(e, i, t) {
|
|
770
|
-
this.hideContextMenu(), (
|
|
766
|
+
this.hideContextMenu(), (p(e.loading) || !e.loading) && (this.curNode = i, this.curData = e, this.$emit("on-node-click", e, i, t));
|
|
771
767
|
},
|
|
772
768
|
getCurrentNode() {
|
|
773
769
|
return this.$refs.tree.getCurrentNode();
|
|
@@ -782,7 +778,7 @@ const q = {
|
|
|
782
778
|
scrollIntoView(e) {
|
|
783
779
|
return r(this, null, function* () {
|
|
784
780
|
var i, t;
|
|
785
|
-
yield this.$nextTick(), e || (yield
|
|
781
|
+
yield this.$nextTick(), e || (yield L(300)), (t = (i = this.$refs) == null ? void 0 : i.labelTxt) == null || t.focus();
|
|
786
782
|
});
|
|
787
783
|
},
|
|
788
784
|
inputKeyup(e, i, t) {
|
|
@@ -810,7 +806,7 @@ const q = {
|
|
|
810
806
|
return this.$refs.tree.root;
|
|
811
807
|
},
|
|
812
808
|
findTreeNode(e) {
|
|
813
|
-
return
|
|
809
|
+
return R(
|
|
814
810
|
this.$refs.tree.root.childNodes,
|
|
815
811
|
(i) => i.data === e || i.data.id === e,
|
|
816
812
|
"childNodes"
|
|
@@ -825,24 +821,24 @@ const q = {
|
|
|
825
821
|
});
|
|
826
822
|
}
|
|
827
823
|
}
|
|
828
|
-
},
|
|
829
|
-
var
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
824
|
+
}, $ = {};
|
|
825
|
+
var F = /* @__PURE__ */ V(
|
|
826
|
+
O,
|
|
827
|
+
A,
|
|
828
|
+
I,
|
|
833
829
|
!1,
|
|
834
|
-
|
|
830
|
+
j,
|
|
835
831
|
null,
|
|
836
832
|
null,
|
|
837
833
|
null
|
|
838
834
|
);
|
|
839
|
-
function
|
|
840
|
-
for (let i in
|
|
841
|
-
this[i] =
|
|
835
|
+
function j(e) {
|
|
836
|
+
for (let i in $)
|
|
837
|
+
this[i] = $[i];
|
|
842
838
|
}
|
|
843
|
-
const
|
|
844
|
-
return
|
|
839
|
+
const Q = /* @__PURE__ */ function() {
|
|
840
|
+
return F.exports;
|
|
845
841
|
}();
|
|
846
842
|
export {
|
|
847
|
-
|
|
843
|
+
Q as default
|
|
848
844
|
};
|
|
@@ -50,7 +50,7 @@ var r = function() {
|
|
|
50
50
|
return [e._v(" " + e._s(e.title) + " ")];
|
|
51
51
|
}, {
|
|
52
52
|
title: e.title
|
|
53
|
-
})], 2)]), t(
|
|
53
|
+
})], 2)]), t("ElCollapseTransition", [t("div", {
|
|
54
54
|
directives: [{
|
|
55
55
|
name: "show",
|
|
56
56
|
rawName: "v-show",
|
|
@@ -70,6 +70,7 @@ var r = function() {
|
|
|
70
70
|
}, d = [];
|
|
71
71
|
const p = {
|
|
72
72
|
name: "EgdCollapseItem",
|
|
73
|
+
components: { ElCollapseTransition: c },
|
|
73
74
|
componentName: "EgdCollapseItem",
|
|
74
75
|
mixins: [a],
|
|
75
76
|
inject: ["collapse"],
|