@yqg/permission 1.3.13 → 1.3.14-beta.1
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/{apply-modal-OokdyEmj.js → apply-modal-CbdSpFHD.js} +4 -4
- package/dist/{category-selector-C-yZxEgO.js → category-selector-CeFM3lr8.js} +502 -474
- package/dist/{index-BkbJOH6j.js → index-D-ZB-Fhd.js} +3 -3
- package/dist/{index-CSnwgcu-.js → index-D_ujkA5Y.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{permission-item-CZ7LWwNL.js → permission-item-DaZXxED4.js} +4 -4
- package/dist/{yqg-permission-D0O9c9lI.js → yqg-permission-C8hIbxln.js} +2 -2
- package/dist/yqg-permission.umd.js +42 -42
- package/package.json +2 -2
- package/src/App.vue +2 -2
- package/src/components/category-selector.vue +1 -1
- package/src/hooks/useAttributesCache.ts +64 -6
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { a as ht, p as pt, d as Ie, r as
|
|
2
|
-
import { a as X, _ as
|
|
3
|
-
import { u as Ot, a as Ht, b as Mt, c as Rt, d as jt, t as lt, B as Bt, e as $t, f as Wt, g as Ut } from "./index-
|
|
4
|
-
import { K as ve, T as zt, c as Xt, a as Ye, u as Yt, g as qt, b as Gt, d as Qt, F as Jt, e as Zt, f as ea, r as ta, h as aa, i as la } from "./apply-modal-
|
|
1
|
+
import { a as ht, p as pt, d as Ie, r as pe, c as y, w as we, q as gt, s as j, E as ae, e as U, b as Qe, y as re, a0 as mt, G as yt, K as et, R as je, L as oe, M as Be, P as $e, N as Ce, S as de, u as H, F as bt, Y as Ct, j as St, z as wt } from "./index-D_ujkA5Y.js";
|
|
2
|
+
import { a as X, _ as b, W as xt, X as Vt, ae as it, aX as tt, Y as Ne, P as he, N as It, Q as ut, V as Nt, aN as We, a0 as kt, ar as Tt, as as Lt, aY as _t, c as at, b as Et, ai as Ue, ak as ze, am as Dt, $ as Pt, aj as At, aV as Kt, aP as Se, aS as Ft } from "./yqg-permission-C8hIbxln.js";
|
|
3
|
+
import { u as Ot, a as Ht, b as Mt, c as Rt, d as jt, t as lt, B as Bt, e as $t, f as Wt, g as Ut } from "./index-D-ZB-Fhd.js";
|
|
4
|
+
import { K as ve, T as zt, c as Xt, a as Ye, u as Yt, g as qt, b as Gt, d as Qt, F as Jt, e as Zt, f as ea, r as ta, h as aa, i as la } from "./apply-modal-CbdSpFHD.js";
|
|
5
5
|
function na(e) {
|
|
6
6
|
return Array.isArray(e) ? e : e !== void 0 ? [e] : [];
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function ra(e) {
|
|
9
9
|
const {
|
|
10
|
-
label:
|
|
11
|
-
value:
|
|
10
|
+
label: i,
|
|
11
|
+
value: c,
|
|
12
12
|
children: a
|
|
13
|
-
} = e || {}, t =
|
|
13
|
+
} = e || {}, t = c || "value";
|
|
14
14
|
return {
|
|
15
|
-
_title:
|
|
15
|
+
_title: i ? [i] : ["title", "label"],
|
|
16
16
|
value: t,
|
|
17
17
|
key: t,
|
|
18
18
|
children: a || "children"
|
|
@@ -21,16 +21,16 @@ function oa(e) {
|
|
|
21
21
|
function qe(e) {
|
|
22
22
|
return e.disabled || e.disableCheckbox || e.checkable === !1;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
const
|
|
24
|
+
function oa(e, i) {
|
|
25
|
+
const c = [];
|
|
26
26
|
function a(t) {
|
|
27
|
-
t.forEach((
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
27
|
+
t.forEach((l) => {
|
|
28
|
+
c.push(l[i.value]);
|
|
29
|
+
const n = l[i.children];
|
|
30
|
+
n && a(n);
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
return a(e),
|
|
33
|
+
return a(e), c;
|
|
34
34
|
}
|
|
35
35
|
function nt(e) {
|
|
36
36
|
return e == null;
|
|
@@ -42,7 +42,7 @@ function sa(e) {
|
|
|
42
42
|
function ca() {
|
|
43
43
|
return ht(dt, {});
|
|
44
44
|
}
|
|
45
|
-
const
|
|
45
|
+
const ia = {
|
|
46
46
|
width: 0,
|
|
47
47
|
height: 0,
|
|
48
48
|
display: "flex",
|
|
@@ -51,51 +51,51 @@ const ua = {
|
|
|
51
51
|
border: 0,
|
|
52
52
|
padding: 0,
|
|
53
53
|
margin: 0
|
|
54
|
-
},
|
|
54
|
+
}, ua = Ie({
|
|
55
55
|
compatConfig: {
|
|
56
56
|
MODE: 3
|
|
57
57
|
},
|
|
58
58
|
name: "OptionList",
|
|
59
59
|
inheritAttrs: !1,
|
|
60
|
-
setup(e,
|
|
60
|
+
setup(e, i) {
|
|
61
61
|
let {
|
|
62
|
-
slots:
|
|
62
|
+
slots: c,
|
|
63
63
|
expose: a
|
|
64
|
-
} =
|
|
65
|
-
const t = Ot(),
|
|
64
|
+
} = i;
|
|
65
|
+
const t = Ot(), l = Ht(), n = ca(), r = pe(), u = Mt(() => n.treeData, [() => t.open, () => n.treeData], (p) => p[0]), s = y(() => {
|
|
66
66
|
const {
|
|
67
|
-
checkable:
|
|
67
|
+
checkable: p,
|
|
68
68
|
halfCheckedKeys: w,
|
|
69
69
|
checkedKeys: E
|
|
70
|
-
} =
|
|
71
|
-
return
|
|
70
|
+
} = l;
|
|
71
|
+
return p ? {
|
|
72
72
|
checked: E,
|
|
73
73
|
halfChecked: w
|
|
74
74
|
} : null;
|
|
75
75
|
});
|
|
76
|
-
|
|
76
|
+
we(() => t.open, () => {
|
|
77
77
|
gt(() => {
|
|
78
|
-
var
|
|
79
|
-
t.open && !t.multiple &&
|
|
80
|
-
key:
|
|
78
|
+
var p;
|
|
79
|
+
t.open && !t.multiple && l.checkedKeys.length && ((p = r.value) === null || p === void 0 || p.scrollTo({
|
|
80
|
+
key: l.checkedKeys[0]
|
|
81
81
|
}));
|
|
82
82
|
});
|
|
83
83
|
}, {
|
|
84
84
|
immediate: !0,
|
|
85
85
|
flush: "post"
|
|
86
86
|
});
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
t.searchValue && (
|
|
87
|
+
const o = y(() => String(t.searchValue).toLowerCase()), f = (p) => o.value ? String(p[l.treeNodeFilterProp]).toLowerCase().includes(o.value) : !1, v = j(l.treeDefaultExpandedKeys), h = j(null);
|
|
88
|
+
we(() => t.searchValue, () => {
|
|
89
|
+
t.searchValue && (h.value = oa(ae(n.treeData), ae(n.fieldNames)));
|
|
90
90
|
}, {
|
|
91
91
|
immediate: !0
|
|
92
92
|
});
|
|
93
|
-
const x =
|
|
93
|
+
const x = y(() => l.treeExpandedKeys ? l.treeExpandedKeys.slice() : t.searchValue ? h.value : v.value), S = (p) => {
|
|
94
94
|
var w;
|
|
95
|
-
|
|
96
|
-
}, V = (
|
|
97
|
-
|
|
98
|
-
},
|
|
95
|
+
v.value = p, h.value = p, (w = l.onTreeExpand) === null || w === void 0 || w.call(l, p);
|
|
96
|
+
}, V = (p) => {
|
|
97
|
+
p.preventDefault();
|
|
98
|
+
}, k = (p, w) => {
|
|
99
99
|
let {
|
|
100
100
|
node: E
|
|
101
101
|
} = w;
|
|
@@ -103,30 +103,30 @@ const ua = {
|
|
|
103
103
|
const {
|
|
104
104
|
checkable: z,
|
|
105
105
|
checkedKeys: Y
|
|
106
|
-
} =
|
|
107
|
-
z && qe(E) || ((A =
|
|
106
|
+
} = l;
|
|
107
|
+
z && qe(E) || ((A = n.onSelect) === null || A === void 0 || A.call(n, E.key, {
|
|
108
108
|
selected: !Y.includes(E.key)
|
|
109
109
|
}), t.multiple || (L = t.toggleOpen) === null || L === void 0 || L.call(t, !1));
|
|
110
|
-
}, K =
|
|
111
|
-
K.value =
|
|
110
|
+
}, K = pe(null), F = y(() => l.keyEntities[K.value]), O = (p) => {
|
|
111
|
+
K.value = p;
|
|
112
112
|
};
|
|
113
113
|
return a({
|
|
114
114
|
scrollTo: function() {
|
|
115
|
-
for (var
|
|
115
|
+
for (var p, w, E = arguments.length, A = new Array(E), L = 0; L < E; L++)
|
|
116
116
|
A[L] = arguments[L];
|
|
117
|
-
return (w = (
|
|
117
|
+
return (w = (p = r.value) === null || p === void 0 ? void 0 : p.scrollTo) === null || w === void 0 ? void 0 : w.call(p, ...A);
|
|
118
118
|
},
|
|
119
|
-
onKeydown: (
|
|
119
|
+
onKeydown: (p) => {
|
|
120
120
|
var w;
|
|
121
121
|
const {
|
|
122
122
|
which: E
|
|
123
|
-
} =
|
|
123
|
+
} = p;
|
|
124
124
|
switch (E) {
|
|
125
125
|
case ve.UP:
|
|
126
126
|
case ve.DOWN:
|
|
127
127
|
case ve.LEFT:
|
|
128
128
|
case ve.RIGHT:
|
|
129
|
-
(w =
|
|
129
|
+
(w = r.value) === null || w === void 0 || w.onKeydown(p);
|
|
130
130
|
break;
|
|
131
131
|
case ve.ENTER: {
|
|
132
132
|
if (F.value) {
|
|
@@ -134,11 +134,11 @@ const ua = {
|
|
|
134
134
|
selectable: A,
|
|
135
135
|
value: L
|
|
136
136
|
} = F.value.node || {};
|
|
137
|
-
A !== !1 &&
|
|
137
|
+
A !== !1 && k(null, {
|
|
138
138
|
node: {
|
|
139
139
|
key: K.value
|
|
140
140
|
},
|
|
141
|
-
selected: !
|
|
141
|
+
selected: !l.checkedKeys.includes(L)
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
break;
|
|
@@ -150,341 +150,341 @@ const ua = {
|
|
|
150
150
|
onKeyup: () => {
|
|
151
151
|
}
|
|
152
152
|
}), () => {
|
|
153
|
-
var
|
|
153
|
+
var p;
|
|
154
154
|
const {
|
|
155
155
|
prefixCls: w,
|
|
156
156
|
multiple: E,
|
|
157
157
|
searchValue: A,
|
|
158
158
|
open: L,
|
|
159
|
-
notFoundContent: z = (
|
|
159
|
+
notFoundContent: z = (p = c.notFoundContent) === null || p === void 0 ? void 0 : p.call(c)
|
|
160
160
|
} = t, {
|
|
161
161
|
listHeight: Y,
|
|
162
162
|
listItemHeight: B,
|
|
163
163
|
virtual: le,
|
|
164
164
|
dropdownMatchSelectWidth: q,
|
|
165
165
|
treeExpandAction: se
|
|
166
|
-
} =
|
|
166
|
+
} = n, {
|
|
167
167
|
checkable: ce,
|
|
168
|
-
treeDefaultExpandAll:
|
|
168
|
+
treeDefaultExpandAll: ie,
|
|
169
169
|
treeIcon: ne,
|
|
170
170
|
showTreeIcon: G,
|
|
171
|
-
switcherIcon:
|
|
172
|
-
treeLine:
|
|
173
|
-
loadData:
|
|
174
|
-
treeLoadedKeys:
|
|
171
|
+
switcherIcon: me,
|
|
172
|
+
treeLine: ye,
|
|
173
|
+
loadData: be,
|
|
174
|
+
treeLoadedKeys: ue,
|
|
175
175
|
treeMotion: C,
|
|
176
176
|
onTreeLoad: D,
|
|
177
177
|
checkedKeys: M
|
|
178
|
-
} =
|
|
179
|
-
if (
|
|
178
|
+
} = l;
|
|
179
|
+
if (u.value.length === 0)
|
|
180
180
|
return U("div", {
|
|
181
181
|
role: "listbox",
|
|
182
182
|
class: `${w}-empty`,
|
|
183
183
|
onMousedown: V
|
|
184
184
|
}, [z]);
|
|
185
185
|
const Q = {
|
|
186
|
-
fieldNames:
|
|
186
|
+
fieldNames: n.fieldNames
|
|
187
187
|
};
|
|
188
|
-
return
|
|
188
|
+
return ue && (Q.loadedKeys = ue), x.value && (Q.expandedKeys = x.value), U("div", {
|
|
189
189
|
onMousedown: V
|
|
190
190
|
}, [F.value && L && U("span", {
|
|
191
|
-
style:
|
|
191
|
+
style: ia,
|
|
192
192
|
"aria-live": "assertive"
|
|
193
193
|
}, [F.value.node.value]), U(zt, X(X({
|
|
194
|
-
ref:
|
|
194
|
+
ref: r,
|
|
195
195
|
focusable: !1,
|
|
196
196
|
prefixCls: `${w}-tree`,
|
|
197
|
-
treeData:
|
|
197
|
+
treeData: u.value,
|
|
198
198
|
height: Y,
|
|
199
199
|
itemHeight: B,
|
|
200
200
|
virtual: le !== !1 && q !== !1,
|
|
201
201
|
multiple: E,
|
|
202
202
|
icon: ne,
|
|
203
203
|
showIcon: G,
|
|
204
|
-
switcherIcon:
|
|
205
|
-
showLine:
|
|
206
|
-
loadData: A ? null :
|
|
204
|
+
switcherIcon: me,
|
|
205
|
+
showLine: ye,
|
|
206
|
+
loadData: A ? null : be,
|
|
207
207
|
motion: C,
|
|
208
208
|
activeKey: K.value,
|
|
209
209
|
checkable: ce,
|
|
210
210
|
checkStrictly: !0,
|
|
211
|
-
checkedKeys:
|
|
211
|
+
checkedKeys: s.value,
|
|
212
212
|
selectedKeys: ce ? [] : M,
|
|
213
|
-
defaultExpandAll:
|
|
213
|
+
defaultExpandAll: ie
|
|
214
214
|
}, Q), {}, {
|
|
215
215
|
onActiveChange: O,
|
|
216
|
-
onSelect:
|
|
217
|
-
onCheck:
|
|
216
|
+
onSelect: k,
|
|
217
|
+
onCheck: k,
|
|
218
218
|
onExpand: S,
|
|
219
219
|
onLoad: D,
|
|
220
|
-
filterTreeNode:
|
|
220
|
+
filterTreeNode: f,
|
|
221
221
|
expandAction: se
|
|
222
|
-
}),
|
|
223
|
-
checkable:
|
|
222
|
+
}), b(b({}, c), {
|
|
223
|
+
checkable: l.customSlots.treeCheckable
|
|
224
224
|
}))]);
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
227
|
}), da = "SHOW_ALL", vt = "SHOW_PARENT", Je = "SHOW_CHILD";
|
|
228
|
-
function
|
|
228
|
+
function rt(e, i, c, a) {
|
|
229
229
|
const t = new Set(e);
|
|
230
|
-
return
|
|
231
|
-
const
|
|
232
|
-
return !(
|
|
230
|
+
return i === Je ? e.filter((l) => {
|
|
231
|
+
const n = c[l];
|
|
232
|
+
return !(n && n.children && n.children.some((r) => {
|
|
233
233
|
let {
|
|
234
|
-
node:
|
|
235
|
-
} =
|
|
236
|
-
return t.has(
|
|
237
|
-
}) &&
|
|
234
|
+
node: u
|
|
235
|
+
} = r;
|
|
236
|
+
return t.has(u[a.value]);
|
|
237
|
+
}) && n.children.every((r) => {
|
|
238
238
|
let {
|
|
239
|
-
node:
|
|
240
|
-
} =
|
|
241
|
-
return qe(
|
|
239
|
+
node: u
|
|
240
|
+
} = r;
|
|
241
|
+
return qe(u) || t.has(u[a.value]);
|
|
242
242
|
}));
|
|
243
|
-
}) :
|
|
244
|
-
const
|
|
245
|
-
return !(
|
|
243
|
+
}) : i === vt ? e.filter((l) => {
|
|
244
|
+
const n = c[l], r = n ? n.parent : null;
|
|
245
|
+
return !(r && !qe(r.node) && t.has(r.key));
|
|
246
246
|
}) : e;
|
|
247
247
|
}
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
var va = function(e,
|
|
253
|
-
var
|
|
254
|
-
for (var a in e) Object.prototype.hasOwnProperty.call(e, a) &&
|
|
248
|
+
const ge = () => null;
|
|
249
|
+
ge.inheritAttrs = !1;
|
|
250
|
+
ge.displayName = "ATreeSelectNode";
|
|
251
|
+
ge.isTreeSelectNode = !0;
|
|
252
|
+
var va = function(e, i) {
|
|
253
|
+
var c = {};
|
|
254
|
+
for (var a in e) Object.prototype.hasOwnProperty.call(e, a) && i.indexOf(a) < 0 && (c[a] = e[a]);
|
|
255
255
|
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var t = 0, a = Object.getOwnPropertySymbols(e); t < a.length; t++)
|
|
256
|
-
|
|
257
|
-
return
|
|
256
|
+
i.indexOf(a[t]) < 0 && Object.prototype.propertyIsEnumerable.call(e, a[t]) && (c[a[t]] = e[a[t]]);
|
|
257
|
+
return c;
|
|
258
258
|
};
|
|
259
259
|
function fa(e) {
|
|
260
260
|
return e && e.type && e.type.isTreeSelectNode;
|
|
261
261
|
}
|
|
262
262
|
function ha(e) {
|
|
263
|
-
function
|
|
264
|
-
let
|
|
265
|
-
return xt(
|
|
266
|
-
var t,
|
|
263
|
+
function i() {
|
|
264
|
+
let c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
265
|
+
return xt(c).map((a) => {
|
|
266
|
+
var t, l, n;
|
|
267
267
|
if (!fa(a))
|
|
268
268
|
return null;
|
|
269
|
-
const
|
|
269
|
+
const r = a.children || {}, u = a.key, s = {};
|
|
270
270
|
for (const [E, A] of Object.entries(a.props))
|
|
271
|
-
|
|
271
|
+
s[Vt(E)] = A;
|
|
272
272
|
const {
|
|
273
|
-
isLeaf:
|
|
274
|
-
checkable:
|
|
275
|
-
selectable:
|
|
276
|
-
disabled:
|
|
273
|
+
isLeaf: o,
|
|
274
|
+
checkable: f,
|
|
275
|
+
selectable: v,
|
|
276
|
+
disabled: h,
|
|
277
277
|
disableCheckbox: x
|
|
278
|
-
} =
|
|
279
|
-
isLeaf:
|
|
280
|
-
checkable:
|
|
281
|
-
selectable:
|
|
282
|
-
disabled:
|
|
278
|
+
} = s, S = {
|
|
279
|
+
isLeaf: o || o === "" || void 0,
|
|
280
|
+
checkable: f || f === "" || void 0,
|
|
281
|
+
selectable: v || v === "" || void 0,
|
|
282
|
+
disabled: h || h === "" || void 0,
|
|
283
283
|
disableCheckbox: x || x === "" || void 0
|
|
284
|
-
}, V =
|
|
285
|
-
title:
|
|
286
|
-
switcherIcon: K = (
|
|
287
|
-
} =
|
|
288
|
-
title:
|
|
284
|
+
}, V = b(b({}, s), S), {
|
|
285
|
+
title: k = (t = r.title) === null || t === void 0 ? void 0 : t.call(r, V),
|
|
286
|
+
switcherIcon: K = (l = r.switcherIcon) === null || l === void 0 ? void 0 : l.call(r, V)
|
|
287
|
+
} = s, F = va(s, ["title", "switcherIcon"]), O = (n = r.default) === null || n === void 0 ? void 0 : n.call(r), p = b(b(b({}, F), {
|
|
288
|
+
title: k,
|
|
289
289
|
switcherIcon: K,
|
|
290
|
-
key:
|
|
291
|
-
isLeaf:
|
|
292
|
-
}), S), w =
|
|
293
|
-
return w.length && (
|
|
290
|
+
key: u,
|
|
291
|
+
isLeaf: o
|
|
292
|
+
}), S), w = i(O);
|
|
293
|
+
return w.length && (p.children = w), p;
|
|
294
294
|
});
|
|
295
295
|
}
|
|
296
|
-
return
|
|
296
|
+
return i(e);
|
|
297
297
|
}
|
|
298
298
|
function Ge(e) {
|
|
299
299
|
if (!e)
|
|
300
300
|
return e;
|
|
301
|
-
const
|
|
302
|
-
return "props" in
|
|
301
|
+
const i = b({}, e);
|
|
302
|
+
return "props" in i || Object.defineProperty(i, "props", {
|
|
303
303
|
get() {
|
|
304
|
-
return
|
|
304
|
+
return i;
|
|
305
305
|
}
|
|
306
|
-
}),
|
|
306
|
+
}), i;
|
|
307
307
|
}
|
|
308
|
-
function pa(e,
|
|
309
|
-
let
|
|
310
|
-
function
|
|
311
|
-
function
|
|
312
|
-
let
|
|
313
|
-
return
|
|
314
|
-
const S = `${
|
|
308
|
+
function pa(e, i, c, a, t, l) {
|
|
309
|
+
let n = null, r = null;
|
|
310
|
+
function u() {
|
|
311
|
+
function s(o) {
|
|
312
|
+
let f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "0", v = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
|
|
313
|
+
return o.map((h, x) => {
|
|
314
|
+
const S = `${f}-${x}`, V = h[l.value], k = c.includes(V), K = s(h[l.children] || [], S, k), F = U(ge, h, {
|
|
315
315
|
default: () => [K.map((O) => O.node)]
|
|
316
316
|
});
|
|
317
|
-
if (
|
|
317
|
+
if (i === V && (n = F), k) {
|
|
318
318
|
const O = {
|
|
319
319
|
pos: S,
|
|
320
320
|
node: F,
|
|
321
321
|
children: K
|
|
322
322
|
};
|
|
323
|
-
return
|
|
323
|
+
return v || r.push(O), O;
|
|
324
324
|
}
|
|
325
325
|
return null;
|
|
326
|
-
}).filter((
|
|
326
|
+
}).filter((h) => h);
|
|
327
327
|
}
|
|
328
|
-
|
|
328
|
+
r || (r = [], s(a), r.sort((o, f) => {
|
|
329
329
|
let {
|
|
330
330
|
node: {
|
|
331
331
|
props: {
|
|
332
|
-
value:
|
|
332
|
+
value: v
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
|
-
} =
|
|
335
|
+
} = o, {
|
|
336
336
|
node: {
|
|
337
337
|
props: {
|
|
338
|
-
value:
|
|
338
|
+
value: h
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
-
} =
|
|
342
|
-
const x =
|
|
341
|
+
} = f;
|
|
342
|
+
const x = c.indexOf(v), S = c.indexOf(h);
|
|
343
343
|
return x - S;
|
|
344
344
|
}));
|
|
345
345
|
}
|
|
346
346
|
Object.defineProperty(e, "triggerNode", {
|
|
347
347
|
get() {
|
|
348
|
-
return
|
|
348
|
+
return u(), n;
|
|
349
349
|
}
|
|
350
350
|
}), Object.defineProperty(e, "allCheckedNodes", {
|
|
351
351
|
get() {
|
|
352
|
-
return
|
|
352
|
+
return u(), t ? r : r.map((s) => {
|
|
353
353
|
let {
|
|
354
|
-
node:
|
|
355
|
-
} =
|
|
356
|
-
return
|
|
354
|
+
node: o
|
|
355
|
+
} = s;
|
|
356
|
+
return o;
|
|
357
357
|
});
|
|
358
358
|
}
|
|
359
359
|
});
|
|
360
360
|
}
|
|
361
|
-
function ga(e,
|
|
361
|
+
function ga(e, i) {
|
|
362
362
|
let {
|
|
363
|
-
id:
|
|
363
|
+
id: c,
|
|
364
364
|
pId: a,
|
|
365
365
|
rootPId: t
|
|
366
|
-
} =
|
|
367
|
-
const
|
|
368
|
-
return e.map((
|
|
369
|
-
const
|
|
370
|
-
return
|
|
371
|
-
}).forEach((
|
|
372
|
-
const
|
|
373
|
-
|
|
374
|
-
}),
|
|
366
|
+
} = i;
|
|
367
|
+
const l = {}, n = [];
|
|
368
|
+
return e.map((u) => {
|
|
369
|
+
const s = b({}, u), o = s[c];
|
|
370
|
+
return l[o] = s, s.key = s.key || o, s;
|
|
371
|
+
}).forEach((u) => {
|
|
372
|
+
const s = u[a], o = l[s];
|
|
373
|
+
o && (o.children = o.children || [], o.children.push(u)), (s === t || !o && t === null) && n.push(u);
|
|
374
|
+
}), n;
|
|
375
375
|
}
|
|
376
|
-
function ma(e,
|
|
376
|
+
function ma(e, i, c) {
|
|
377
377
|
const a = j();
|
|
378
|
-
return
|
|
379
|
-
const t =
|
|
380
|
-
e.value ? a.value =
|
|
378
|
+
return we([c, e, i], () => {
|
|
379
|
+
const t = c.value;
|
|
380
|
+
e.value ? a.value = c.value ? ga(ae(e.value), b({
|
|
381
381
|
id: "id",
|
|
382
382
|
pId: "pId",
|
|
383
383
|
rootPId: null
|
|
384
|
-
}, t !== !0 ? t : {})) : ae(e.value).slice() : a.value = ha(ae(
|
|
384
|
+
}, t !== !0 ? t : {})) : ae(e.value).slice() : a.value = ha(ae(i.value));
|
|
385
385
|
}, {
|
|
386
386
|
immediate: !0,
|
|
387
387
|
deep: !0
|
|
388
388
|
}), a;
|
|
389
389
|
}
|
|
390
390
|
const ya = (e) => {
|
|
391
|
-
const
|
|
391
|
+
const i = j({
|
|
392
392
|
valueLabels: /* @__PURE__ */ new Map()
|
|
393
|
-
}),
|
|
394
|
-
return
|
|
395
|
-
|
|
393
|
+
}), c = j();
|
|
394
|
+
return we(e, () => {
|
|
395
|
+
c.value = ae(e.value);
|
|
396
396
|
}, {
|
|
397
397
|
immediate: !0
|
|
398
|
-
}), [
|
|
398
|
+
}), [y(() => {
|
|
399
399
|
const {
|
|
400
400
|
valueLabels: t
|
|
401
|
-
} =
|
|
402
|
-
var
|
|
401
|
+
} = i.value, l = /* @__PURE__ */ new Map(), n = c.value.map((r) => {
|
|
402
|
+
var u;
|
|
403
403
|
const {
|
|
404
|
-
value:
|
|
405
|
-
} =
|
|
406
|
-
return
|
|
407
|
-
label:
|
|
404
|
+
value: s
|
|
405
|
+
} = r, o = (u = r.label) !== null && u !== void 0 ? u : t.get(s);
|
|
406
|
+
return l.set(s, o), b(b({}, r), {
|
|
407
|
+
label: o
|
|
408
408
|
});
|
|
409
409
|
});
|
|
410
|
-
return
|
|
410
|
+
return i.value.valueLabels = l, n;
|
|
411
411
|
})];
|
|
412
|
-
}, ba = (e,
|
|
413
|
-
const
|
|
412
|
+
}, ba = (e, i) => {
|
|
413
|
+
const c = j(/* @__PURE__ */ new Map()), a = j({});
|
|
414
414
|
return Qe(() => {
|
|
415
|
-
const t =
|
|
415
|
+
const t = i.value, l = Xt(e.value, {
|
|
416
416
|
fieldNames: t,
|
|
417
|
-
initWrapper: (
|
|
417
|
+
initWrapper: (n) => b(b({}, n), {
|
|
418
418
|
valueEntities: /* @__PURE__ */ new Map()
|
|
419
419
|
}),
|
|
420
|
-
processEntity: (
|
|
421
|
-
const
|
|
422
|
-
|
|
420
|
+
processEntity: (n, r) => {
|
|
421
|
+
const u = n.node[t.value];
|
|
422
|
+
r.valueEntities.set(u, n);
|
|
423
423
|
}
|
|
424
424
|
});
|
|
425
|
-
|
|
425
|
+
c.value = l.valueEntities, a.value = l.keyEntities;
|
|
426
426
|
}), {
|
|
427
|
-
valueEntities:
|
|
427
|
+
valueEntities: c,
|
|
428
428
|
keyEntities: a
|
|
429
429
|
};
|
|
430
|
-
}, Ca = (e,
|
|
431
|
-
const
|
|
430
|
+
}, Ca = (e, i, c, a, t, l) => {
|
|
431
|
+
const n = j([]), r = j([]);
|
|
432
432
|
return Qe(() => {
|
|
433
|
-
let
|
|
433
|
+
let u = e.value.map((f) => {
|
|
434
434
|
let {
|
|
435
|
-
value:
|
|
436
|
-
} =
|
|
437
|
-
return
|
|
438
|
-
}),
|
|
435
|
+
value: v
|
|
436
|
+
} = f;
|
|
437
|
+
return v;
|
|
438
|
+
}), s = i.value.map((f) => {
|
|
439
439
|
let {
|
|
440
|
-
value:
|
|
441
|
-
} =
|
|
442
|
-
return
|
|
440
|
+
value: v
|
|
441
|
+
} = f;
|
|
442
|
+
return v;
|
|
443
443
|
});
|
|
444
|
-
const
|
|
445
|
-
|
|
446
|
-
checkedKeys:
|
|
447
|
-
halfCheckedKeys:
|
|
448
|
-
} = Ye(
|
|
449
|
-
}), [
|
|
450
|
-
}, Sa = (e,
|
|
444
|
+
const o = u.filter((f) => !a.value[f]);
|
|
445
|
+
c.value && ({
|
|
446
|
+
checkedKeys: u,
|
|
447
|
+
halfCheckedKeys: s
|
|
448
|
+
} = Ye(u, !0, a.value, t.value, l.value)), n.value = Array.from(/* @__PURE__ */ new Set([...o, ...u])), r.value = s;
|
|
449
|
+
}), [n, r];
|
|
450
|
+
}, Sa = (e, i, c) => {
|
|
451
451
|
let {
|
|
452
452
|
treeNodeFilterProp: a,
|
|
453
453
|
filterTreeNode: t,
|
|
454
|
-
fieldNames:
|
|
455
|
-
} =
|
|
456
|
-
return
|
|
454
|
+
fieldNames: l
|
|
455
|
+
} = c;
|
|
456
|
+
return y(() => {
|
|
457
457
|
const {
|
|
458
|
-
children:
|
|
459
|
-
} =
|
|
460
|
-
if (!
|
|
458
|
+
children: n
|
|
459
|
+
} = l.value, r = i.value, u = a == null ? void 0 : a.value;
|
|
460
|
+
if (!r || t.value === !1)
|
|
461
461
|
return e.value;
|
|
462
|
-
let
|
|
462
|
+
let s;
|
|
463
463
|
if (typeof t.value == "function")
|
|
464
|
-
|
|
464
|
+
s = t.value;
|
|
465
465
|
else {
|
|
466
|
-
const
|
|
467
|
-
|
|
468
|
-
const x =
|
|
469
|
-
return String(x).toUpperCase().includes(
|
|
466
|
+
const f = r.toUpperCase();
|
|
467
|
+
s = (v, h) => {
|
|
468
|
+
const x = h[u];
|
|
469
|
+
return String(x).toUpperCase().includes(f);
|
|
470
470
|
};
|
|
471
471
|
}
|
|
472
|
-
function
|
|
473
|
-
let
|
|
474
|
-
const
|
|
475
|
-
for (let x = 0, S =
|
|
476
|
-
const V =
|
|
477
|
-
(K || F.length) &&
|
|
478
|
-
[
|
|
472
|
+
function o(f) {
|
|
473
|
+
let v = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
474
|
+
const h = [];
|
|
475
|
+
for (let x = 0, S = f.length; x < S; x++) {
|
|
476
|
+
const V = f[x], k = V[n], K = v || s(r, Ge(V)), F = o(k || [], K);
|
|
477
|
+
(K || F.length) && h.push(b(b({}, V), {
|
|
478
|
+
[n]: F
|
|
479
479
|
}));
|
|
480
480
|
}
|
|
481
|
-
return
|
|
481
|
+
return h;
|
|
482
482
|
}
|
|
483
|
-
return
|
|
483
|
+
return o(e.value);
|
|
484
484
|
});
|
|
485
485
|
};
|
|
486
486
|
function ft() {
|
|
487
|
-
return
|
|
487
|
+
return b(b({}, Ne($t(), ["mode"])), {
|
|
488
488
|
prefixCls: String,
|
|
489
489
|
id: String,
|
|
490
490
|
value: {
|
|
@@ -584,13 +584,13 @@ function ft() {
|
|
|
584
584
|
type: [Boolean, Object],
|
|
585
585
|
default: void 0
|
|
586
586
|
},
|
|
587
|
-
treeIcon:
|
|
587
|
+
treeIcon: he.any,
|
|
588
588
|
showTreeIcon: {
|
|
589
589
|
type: Boolean,
|
|
590
590
|
default: void 0
|
|
591
591
|
},
|
|
592
|
-
switcherIcon:
|
|
593
|
-
treeMotion:
|
|
592
|
+
switcherIcon: he.any,
|
|
593
|
+
treeMotion: he.any,
|
|
594
594
|
children: Array,
|
|
595
595
|
treeExpandAction: String,
|
|
596
596
|
showArrow: {
|
|
@@ -613,11 +613,11 @@ function ft() {
|
|
|
613
613
|
type: Boolean,
|
|
614
614
|
default: void 0
|
|
615
615
|
},
|
|
616
|
-
placeholder:
|
|
616
|
+
placeholder: he.any,
|
|
617
617
|
maxTagPlaceholder: {
|
|
618
618
|
type: Function
|
|
619
619
|
},
|
|
620
|
-
dropdownPopupAlign:
|
|
620
|
+
dropdownPopupAlign: he.any,
|
|
621
621
|
customSlots: Object
|
|
622
622
|
});
|
|
623
623
|
}
|
|
@@ -630,7 +630,7 @@ const xa = Ie({
|
|
|
630
630
|
},
|
|
631
631
|
name: "TreeSelect",
|
|
632
632
|
inheritAttrs: !1,
|
|
633
|
-
props:
|
|
633
|
+
props: it(ft(), {
|
|
634
634
|
treeNodeFilterProp: "value",
|
|
635
635
|
autoClearSearchValue: !0,
|
|
636
636
|
showCheckedStrategy: Je,
|
|
@@ -638,105 +638,105 @@ const xa = Ie({
|
|
|
638
638
|
listItemHeight: 20,
|
|
639
639
|
prefixCls: "vc-tree-select"
|
|
640
640
|
}),
|
|
641
|
-
setup(e,
|
|
641
|
+
setup(e, i) {
|
|
642
642
|
let {
|
|
643
|
-
attrs:
|
|
643
|
+
attrs: c,
|
|
644
644
|
expose: a,
|
|
645
645
|
slots: t
|
|
646
|
-
} =
|
|
647
|
-
const
|
|
648
|
-
value:
|
|
649
|
-
postState: (
|
|
650
|
-
}),
|
|
651
|
-
var
|
|
652
|
-
|
|
653
|
-
}, x = ma(
|
|
646
|
+
} = i;
|
|
647
|
+
const l = Rt(re(e, "id")), n = y(() => e.treeCheckable && !e.treeCheckStrictly), r = y(() => e.treeCheckable || e.treeCheckStrictly), u = y(() => e.treeCheckStrictly || e.labelInValue), s = y(() => r.value || e.multiple), o = y(() => ra(e.fieldNames)), [f, v] = tt("", {
|
|
648
|
+
value: y(() => e.searchValue !== void 0 ? e.searchValue : e.inputValue),
|
|
649
|
+
postState: (d) => d || ""
|
|
650
|
+
}), h = (d) => {
|
|
651
|
+
var g;
|
|
652
|
+
v(d), (g = e.onSearch) === null || g === void 0 || g.call(e, d);
|
|
653
|
+
}, x = ma(re(e, "treeData"), re(e, "children"), re(e, "treeDataSimpleMode")), {
|
|
654
654
|
keyEntities: S,
|
|
655
655
|
valueEntities: V
|
|
656
|
-
} = ba(x,
|
|
657
|
-
const
|
|
658
|
-
return
|
|
659
|
-
V.value.has(
|
|
656
|
+
} = ba(x, o), k = (d) => {
|
|
657
|
+
const g = [], m = [];
|
|
658
|
+
return d.forEach((N) => {
|
|
659
|
+
V.value.has(N) ? m.push(N) : g.push(N);
|
|
660
660
|
}), {
|
|
661
|
-
missingRawValues:
|
|
662
|
-
existRawValues:
|
|
661
|
+
missingRawValues: g,
|
|
662
|
+
existRawValues: m
|
|
663
663
|
};
|
|
664
|
-
}, K = Sa(x,
|
|
665
|
-
fieldNames:
|
|
666
|
-
treeNodeFilterProp:
|
|
667
|
-
filterTreeNode:
|
|
668
|
-
}), F = (
|
|
669
|
-
if (
|
|
664
|
+
}, K = Sa(x, f, {
|
|
665
|
+
fieldNames: o,
|
|
666
|
+
treeNodeFilterProp: re(e, "treeNodeFilterProp"),
|
|
667
|
+
filterTreeNode: re(e, "filterTreeNode")
|
|
668
|
+
}), F = (d) => {
|
|
669
|
+
if (d) {
|
|
670
670
|
if (e.treeNodeLabelProp)
|
|
671
|
-
return
|
|
671
|
+
return d[e.treeNodeLabelProp];
|
|
672
672
|
const {
|
|
673
|
-
_title:
|
|
674
|
-
} =
|
|
675
|
-
for (let
|
|
676
|
-
const
|
|
677
|
-
if (
|
|
678
|
-
return
|
|
673
|
+
_title: g
|
|
674
|
+
} = o.value;
|
|
675
|
+
for (let m = 0; m < g.length; m += 1) {
|
|
676
|
+
const N = d[g[m]];
|
|
677
|
+
if (N !== void 0)
|
|
678
|
+
return N;
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
|
-
}, O = (
|
|
682
|
-
value:
|
|
683
|
-
} :
|
|
681
|
+
}, O = (d) => na(d).map((m) => wa(m) ? {
|
|
682
|
+
value: m
|
|
683
|
+
} : m), p = (d) => O(d).map((m) => {
|
|
684
684
|
let {
|
|
685
|
-
label:
|
|
686
|
-
} =
|
|
685
|
+
label: N
|
|
686
|
+
} = m;
|
|
687
687
|
const {
|
|
688
688
|
value: P,
|
|
689
689
|
halfChecked: _
|
|
690
|
-
} =
|
|
690
|
+
} = m;
|
|
691
691
|
let I;
|
|
692
692
|
const T = V.value.get(P);
|
|
693
|
-
return T && (
|
|
694
|
-
label:
|
|
693
|
+
return T && (N = N ?? F(T.node), I = T.node.disabled), {
|
|
694
|
+
label: N,
|
|
695
695
|
value: P,
|
|
696
696
|
halfChecked: _,
|
|
697
697
|
disabled: I
|
|
698
698
|
};
|
|
699
699
|
}), [w, E] = tt(e.defaultValue, {
|
|
700
|
-
value:
|
|
701
|
-
}), A =
|
|
700
|
+
value: re(e, "value")
|
|
701
|
+
}), A = y(() => O(w.value)), L = j([]), z = j([]);
|
|
702
702
|
Qe(() => {
|
|
703
|
-
const
|
|
704
|
-
A.value.forEach((
|
|
705
|
-
|
|
706
|
-
}), L.value =
|
|
703
|
+
const d = [], g = [];
|
|
704
|
+
A.value.forEach((m) => {
|
|
705
|
+
m.halfChecked ? g.push(m) : d.push(m);
|
|
706
|
+
}), L.value = d, z.value = g;
|
|
707
707
|
});
|
|
708
|
-
const Y =
|
|
708
|
+
const Y = y(() => L.value.map((d) => d.value)), {
|
|
709
709
|
maxLevel: B,
|
|
710
710
|
levelEntities: le
|
|
711
|
-
} = Yt(S), [q, se] = Ca(L, z,
|
|
712
|
-
const
|
|
711
|
+
} = Yt(S), [q, se] = Ca(L, z, n, S, B, le), ce = y(() => {
|
|
712
|
+
const m = rt(q.value, e.showCheckedStrategy, S.value, o.value).map((_) => {
|
|
713
713
|
var I, T, R;
|
|
714
|
-
return (R = (T = (I = S.value[_]) === null || I === void 0 ? void 0 : I.node) === null || T === void 0 ? void 0 : T[
|
|
714
|
+
return (R = (T = (I = S.value[_]) === null || I === void 0 ? void 0 : I.node) === null || T === void 0 ? void 0 : T[o.value.value]) !== null && R !== void 0 ? R : _;
|
|
715
715
|
}).map((_) => {
|
|
716
716
|
const I = L.value.find((T) => T.value === _);
|
|
717
717
|
return {
|
|
718
718
|
value: _,
|
|
719
719
|
label: I == null ? void 0 : I.label
|
|
720
720
|
};
|
|
721
|
-
}),
|
|
722
|
-
return !
|
|
721
|
+
}), N = p(m), P = N[0];
|
|
722
|
+
return !s.value && P && nt(P.value) && nt(P.label) ? [] : N.map((_) => {
|
|
723
723
|
var I;
|
|
724
|
-
return
|
|
724
|
+
return b(b({}, _), {
|
|
725
725
|
label: (I = _.label) !== null && I !== void 0 ? I : _.value
|
|
726
726
|
});
|
|
727
727
|
});
|
|
728
|
-
}), [
|
|
729
|
-
const
|
|
730
|
-
if (E(
|
|
731
|
-
let P =
|
|
732
|
-
|
|
733
|
-
const
|
|
734
|
-
return
|
|
728
|
+
}), [ie] = ya(ce), ne = (d, g, m) => {
|
|
729
|
+
const N = p(d);
|
|
730
|
+
if (E(N), e.autoClearSearchValue && v(""), e.onChange) {
|
|
731
|
+
let P = d;
|
|
732
|
+
n.value && (P = rt(d, e.showCheckedStrategy, S.value, o.value).map((te) => {
|
|
733
|
+
const Ve = V.value.get(te);
|
|
734
|
+
return Ve ? Ve.node[o.value.value] : te;
|
|
735
735
|
}));
|
|
736
736
|
const {
|
|
737
737
|
triggerValue: _,
|
|
738
738
|
selected: I
|
|
739
|
-
} =
|
|
739
|
+
} = g || {
|
|
740
740
|
triggerValue: void 0,
|
|
741
741
|
selected: void 0
|
|
742
742
|
};
|
|
@@ -745,79 +745,79 @@ const xa = Ie({
|
|
|
745
745
|
const W = z.value.filter((te) => !P.includes(te.value));
|
|
746
746
|
T = [...T, ...W];
|
|
747
747
|
}
|
|
748
|
-
const R =
|
|
748
|
+
const R = p(T), Z = {
|
|
749
749
|
// [Legacy] Always return as array contains label & value
|
|
750
750
|
preValue: L.value,
|
|
751
751
|
triggerValue: _
|
|
752
752
|
};
|
|
753
753
|
let ee = !0;
|
|
754
|
-
(e.treeCheckStrictly ||
|
|
755
|
-
const $ =
|
|
756
|
-
e.onChange(
|
|
754
|
+
(e.treeCheckStrictly || m === "selection" && !I) && (ee = !1), pa(Z, _, d, x.value, ee, o.value), r.value ? Z.checked = I : Z.selected = I;
|
|
755
|
+
const $ = u.value ? R : R.map((W) => W.value);
|
|
756
|
+
e.onChange(s.value ? $ : $[0], u.value ? null : R.map((W) => W.label), Z);
|
|
757
757
|
}
|
|
758
|
-
}, G = (
|
|
758
|
+
}, G = (d, g) => {
|
|
759
759
|
let {
|
|
760
|
-
selected:
|
|
761
|
-
source:
|
|
762
|
-
} =
|
|
760
|
+
selected: m,
|
|
761
|
+
source: N
|
|
762
|
+
} = g;
|
|
763
763
|
var P, _, I;
|
|
764
|
-
const T = ae(S.value), R = ae(V.value), Z = T[
|
|
765
|
-
if (!
|
|
764
|
+
const T = ae(S.value), R = ae(V.value), Z = T[d], ee = Z == null ? void 0 : Z.node, $ = (P = ee == null ? void 0 : ee[o.value.value]) !== null && P !== void 0 ? P : d;
|
|
765
|
+
if (!s.value)
|
|
766
766
|
ne([$], {
|
|
767
767
|
selected: !0,
|
|
768
768
|
triggerValue: $
|
|
769
769
|
}, "option");
|
|
770
770
|
else {
|
|
771
|
-
let W =
|
|
772
|
-
if (
|
|
771
|
+
let W = m ? [...Y.value, $] : q.value.filter((te) => te !== $);
|
|
772
|
+
if (n.value) {
|
|
773
773
|
const {
|
|
774
774
|
missingRawValues: te,
|
|
775
|
-
existRawValues:
|
|
776
|
-
} =
|
|
775
|
+
existRawValues: Ve
|
|
776
|
+
} = k(W), Ze = Ve.map((Re) => R.get(Re).key);
|
|
777
777
|
let Me;
|
|
778
|
-
|
|
778
|
+
m ? {
|
|
779
779
|
checkedKeys: Me
|
|
780
780
|
} = Ye(Ze, !0, T, B.value, le.value) : {
|
|
781
781
|
checkedKeys: Me
|
|
782
782
|
} = Ye(Ze, {
|
|
783
783
|
halfCheckedKeys: se.value
|
|
784
|
-
}, T, B.value, le.value), W = [...te, ...Me.map((Re) => T[Re].node[
|
|
784
|
+
}, T, B.value, le.value), W = [...te, ...Me.map((Re) => T[Re].node[o.value.value])];
|
|
785
785
|
}
|
|
786
786
|
ne(W, {
|
|
787
|
-
selected:
|
|
787
|
+
selected: m,
|
|
788
788
|
triggerValue: $
|
|
789
|
-
},
|
|
789
|
+
}, N || "option");
|
|
790
790
|
}
|
|
791
|
-
|
|
792
|
-
},
|
|
791
|
+
m || !s.value ? (_ = e.onSelect) === null || _ === void 0 || _.call(e, $, Ge(ee)) : (I = e.onDeselect) === null || I === void 0 || I.call(e, $, Ge(ee));
|
|
792
|
+
}, me = (d) => {
|
|
793
793
|
if (e.onDropdownVisibleChange) {
|
|
794
|
-
const
|
|
795
|
-
Object.defineProperty(
|
|
794
|
+
const g = {};
|
|
795
|
+
Object.defineProperty(g, "documentClickClose", {
|
|
796
796
|
get() {
|
|
797
797
|
return !1;
|
|
798
798
|
}
|
|
799
|
-
}), e.onDropdownVisibleChange(
|
|
799
|
+
}), e.onDropdownVisibleChange(d, g);
|
|
800
800
|
}
|
|
801
|
-
},
|
|
802
|
-
const
|
|
803
|
-
if (
|
|
804
|
-
ne(
|
|
801
|
+
}, ye = (d, g) => {
|
|
802
|
+
const m = d.map((N) => N.value);
|
|
803
|
+
if (g.type === "clear") {
|
|
804
|
+
ne(m, {}, "selection");
|
|
805
805
|
return;
|
|
806
806
|
}
|
|
807
|
-
|
|
807
|
+
g.values.length && G(g.values[0].value, {
|
|
808
808
|
selected: !1,
|
|
809
809
|
source: "selection"
|
|
810
810
|
});
|
|
811
811
|
}, {
|
|
812
|
-
treeNodeFilterProp:
|
|
812
|
+
treeNodeFilterProp: be,
|
|
813
813
|
// Data
|
|
814
|
-
loadData:
|
|
814
|
+
loadData: ue,
|
|
815
815
|
treeLoadedKeys: C,
|
|
816
816
|
onTreeLoad: D,
|
|
817
817
|
// Expanded
|
|
818
818
|
treeDefaultExpandAll: M,
|
|
819
819
|
treeExpandedKeys: Q,
|
|
820
|
-
treeDefaultExpandedKeys:
|
|
820
|
+
treeDefaultExpandedKeys: ke,
|
|
821
821
|
onTreeExpand: Te,
|
|
822
822
|
// Options
|
|
823
823
|
virtual: Le,
|
|
@@ -825,7 +825,7 @@ const xa = Ie({
|
|
|
825
825
|
listItemHeight: Ee,
|
|
826
826
|
// Tree
|
|
827
827
|
treeLine: De,
|
|
828
|
-
treeIcon:
|
|
828
|
+
treeIcon: xe,
|
|
829
829
|
showTreeIcon: Pe,
|
|
830
830
|
switcherIcon: Ae,
|
|
831
831
|
treeMotion: Ke,
|
|
@@ -834,22 +834,22 @@ const xa = Ie({
|
|
|
834
834
|
treeExpandAction: He
|
|
835
835
|
} = mt(e);
|
|
836
836
|
jt(lt({
|
|
837
|
-
checkable:
|
|
838
|
-
loadData:
|
|
837
|
+
checkable: r,
|
|
838
|
+
loadData: ue,
|
|
839
839
|
treeLoadedKeys: C,
|
|
840
840
|
onTreeLoad: D,
|
|
841
841
|
checkedKeys: q,
|
|
842
842
|
halfCheckedKeys: se,
|
|
843
843
|
treeDefaultExpandAll: M,
|
|
844
844
|
treeExpandedKeys: Q,
|
|
845
|
-
treeDefaultExpandedKeys:
|
|
845
|
+
treeDefaultExpandedKeys: ke,
|
|
846
846
|
onTreeExpand: Te,
|
|
847
|
-
treeIcon:
|
|
847
|
+
treeIcon: xe,
|
|
848
848
|
treeMotion: Ke,
|
|
849
849
|
showTreeIcon: Pe,
|
|
850
850
|
switcherIcon: Ae,
|
|
851
851
|
treeLine: De,
|
|
852
|
-
treeNodeFilterProp:
|
|
852
|
+
treeNodeFilterProp: be,
|
|
853
853
|
keyEntities: S,
|
|
854
854
|
customSlots: Fe
|
|
855
855
|
})), sa(lt({
|
|
@@ -857,28 +857,28 @@ const xa = Ie({
|
|
|
857
857
|
listHeight: _e,
|
|
858
858
|
listItemHeight: Ee,
|
|
859
859
|
treeData: K,
|
|
860
|
-
fieldNames:
|
|
860
|
+
fieldNames: o,
|
|
861
861
|
onSelect: G,
|
|
862
862
|
dropdownMatchSelectWidth: Oe,
|
|
863
863
|
treeExpandAction: He
|
|
864
864
|
}));
|
|
865
|
-
const J =
|
|
865
|
+
const J = pe();
|
|
866
866
|
return a({
|
|
867
867
|
focus() {
|
|
868
|
-
var
|
|
869
|
-
(
|
|
868
|
+
var d;
|
|
869
|
+
(d = J.value) === null || d === void 0 || d.focus();
|
|
870
870
|
},
|
|
871
871
|
blur() {
|
|
872
|
-
var
|
|
873
|
-
(
|
|
872
|
+
var d;
|
|
873
|
+
(d = J.value) === null || d === void 0 || d.blur();
|
|
874
874
|
},
|
|
875
|
-
scrollTo(
|
|
876
|
-
var
|
|
877
|
-
(
|
|
875
|
+
scrollTo(d) {
|
|
876
|
+
var g;
|
|
877
|
+
(g = J.value) === null || g === void 0 || g.scrollTo(d);
|
|
878
878
|
}
|
|
879
879
|
}), () => {
|
|
880
|
-
var
|
|
881
|
-
const
|
|
880
|
+
var d;
|
|
881
|
+
const g = Ne(e, [
|
|
882
882
|
"id",
|
|
883
883
|
"prefixCls",
|
|
884
884
|
"customSlots",
|
|
@@ -931,39 +931,39 @@ const xa = Ie({
|
|
|
931
931
|
]);
|
|
932
932
|
return U(Bt, X(X(X({
|
|
933
933
|
ref: J
|
|
934
|
-
},
|
|
935
|
-
id:
|
|
934
|
+
}, c), g), {}, {
|
|
935
|
+
id: l,
|
|
936
936
|
prefixCls: e.prefixCls,
|
|
937
|
-
mode:
|
|
938
|
-
displayValues:
|
|
939
|
-
onDisplayValuesChange:
|
|
940
|
-
searchValue:
|
|
941
|
-
onSearch:
|
|
942
|
-
OptionList:
|
|
937
|
+
mode: s.value ? "multiple" : void 0,
|
|
938
|
+
displayValues: ie.value,
|
|
939
|
+
onDisplayValuesChange: ye,
|
|
940
|
+
searchValue: f.value,
|
|
941
|
+
onSearch: h,
|
|
942
|
+
OptionList: ua,
|
|
943
943
|
emptyOptions: !x.value.length,
|
|
944
|
-
onDropdownVisibleChange:
|
|
944
|
+
onDropdownVisibleChange: me,
|
|
945
945
|
tagRender: e.tagRender || t.tagRender,
|
|
946
|
-
dropdownMatchSelectWidth: (
|
|
946
|
+
dropdownMatchSelectWidth: (d = e.dropdownMatchSelectWidth) !== null && d !== void 0 ? d : !0
|
|
947
947
|
}), t);
|
|
948
948
|
};
|
|
949
949
|
}
|
|
950
950
|
}), Va = (e) => {
|
|
951
951
|
const {
|
|
952
|
-
componentCls:
|
|
953
|
-
treePrefixCls:
|
|
952
|
+
componentCls: i,
|
|
953
|
+
treePrefixCls: c,
|
|
954
954
|
colorBgElevated: a
|
|
955
|
-
} = e, t = `.${
|
|
955
|
+
} = e, t = `.${c}`;
|
|
956
956
|
return [
|
|
957
957
|
// ======================================================
|
|
958
958
|
// == Dropdown ==
|
|
959
959
|
// ======================================================
|
|
960
960
|
{
|
|
961
|
-
[`${
|
|
961
|
+
[`${i}-dropdown`]: [
|
|
962
962
|
{
|
|
963
963
|
padding: `${e.paddingXS}px ${e.paddingXS / 2}px`
|
|
964
964
|
},
|
|
965
965
|
// ====================== Tree ======================
|
|
966
|
-
qt(
|
|
966
|
+
qt(c, ut(e, {
|
|
967
967
|
colorBgContainer: a
|
|
968
968
|
})),
|
|
969
969
|
{
|
|
@@ -980,7 +980,7 @@ const xa = Ie({
|
|
|
980
980
|
}
|
|
981
981
|
},
|
|
982
982
|
// ==================== Checkbox ====================
|
|
983
|
-
Gt(`${
|
|
983
|
+
Gt(`${c}-checkbox`, e),
|
|
984
984
|
// ====================== RTL =======================
|
|
985
985
|
{
|
|
986
986
|
"&-rtl": {
|
|
@@ -996,18 +996,18 @@ const xa = Ie({
|
|
|
996
996
|
}
|
|
997
997
|
];
|
|
998
998
|
};
|
|
999
|
-
function Ia(e,
|
|
1000
|
-
return It("TreeSelect", (
|
|
1001
|
-
const a =
|
|
1002
|
-
treePrefixCls:
|
|
999
|
+
function Ia(e, i) {
|
|
1000
|
+
return It("TreeSelect", (c) => {
|
|
1001
|
+
const a = ut(c, {
|
|
1002
|
+
treePrefixCls: i.value
|
|
1003
1003
|
});
|
|
1004
1004
|
return [Va(a)];
|
|
1005
1005
|
})(e);
|
|
1006
1006
|
}
|
|
1007
|
-
const
|
|
1008
|
-
function
|
|
1009
|
-
return
|
|
1010
|
-
suffixIcon:
|
|
1007
|
+
const ot = (e, i, c) => c !== void 0 ? c : `${e}-${i}`;
|
|
1008
|
+
function Na() {
|
|
1009
|
+
return b(b({}, Ne(ft(), ["showTreeIcon", "treeMotion", "inputIcon", "getInputElement", "treeLine", "customSlots"])), {
|
|
1010
|
+
suffixIcon: he.any,
|
|
1011
1011
|
size: ze(),
|
|
1012
1012
|
bordered: At(),
|
|
1013
1013
|
treeLine: Pt([Boolean, Object]),
|
|
@@ -1028,7 +1028,7 @@ const Xe = Ie({
|
|
|
1028
1028
|
},
|
|
1029
1029
|
name: "ATreeSelect",
|
|
1030
1030
|
inheritAttrs: !1,
|
|
1031
|
-
props:
|
|
1031
|
+
props: it(Na(), {
|
|
1032
1032
|
choiceTransitionName: "",
|
|
1033
1033
|
listHeight: 256,
|
|
1034
1034
|
treeIcon: !1,
|
|
@@ -1036,33 +1036,33 @@ const Xe = Ie({
|
|
|
1036
1036
|
bordered: !0
|
|
1037
1037
|
}),
|
|
1038
1038
|
slots: Object,
|
|
1039
|
-
setup(e,
|
|
1039
|
+
setup(e, i) {
|
|
1040
1040
|
let {
|
|
1041
|
-
attrs:
|
|
1041
|
+
attrs: c,
|
|
1042
1042
|
slots: a,
|
|
1043
1043
|
expose: t,
|
|
1044
|
-
emit:
|
|
1045
|
-
} =
|
|
1046
|
-
|
|
1047
|
-
const
|
|
1048
|
-
prefixCls:
|
|
1049
|
-
renderEmpty:
|
|
1050
|
-
direction:
|
|
1051
|
-
virtual:
|
|
1052
|
-
dropdownMatchSelectWidth:
|
|
1044
|
+
emit: l
|
|
1045
|
+
} = i;
|
|
1046
|
+
Nt(!(e.treeData === void 0 && a.default)), We(e.multiple !== !1 || !e.treeCheckable, "TreeSelect", "`multiple` will always be `true` when `treeCheckable` is true"), We(e.replaceFields === void 0, "TreeSelect", "`replaceFields` is deprecated, please use fieldNames instead"), We(!e.dropdownClassName, "TreeSelect", "`dropdownClassName` is deprecated. Please use `popupClassName` instead.");
|
|
1047
|
+
const n = Qt(), r = Jt.useInject(), u = y(() => Zt(r.status, e.status)), {
|
|
1048
|
+
prefixCls: s,
|
|
1049
|
+
renderEmpty: o,
|
|
1050
|
+
direction: f,
|
|
1051
|
+
virtual: v,
|
|
1052
|
+
dropdownMatchSelectWidth: h,
|
|
1053
1053
|
size: x,
|
|
1054
1054
|
getPopupContainer: S,
|
|
1055
1055
|
getPrefixCls: V,
|
|
1056
|
-
disabled:
|
|
1057
|
-
} =
|
|
1056
|
+
disabled: k
|
|
1057
|
+
} = kt("select", e), {
|
|
1058
1058
|
compactSize: K,
|
|
1059
1059
|
compactItemClassnames: F
|
|
1060
|
-
} = Tt(
|
|
1060
|
+
} = Tt(s, f), O = y(() => K.value || x.value), p = Lt(), w = y(() => {
|
|
1061
1061
|
var C;
|
|
1062
|
-
return (C =
|
|
1063
|
-
}), E =
|
|
1064
|
-
[`${B.value}-dropdown-rtl`]:
|
|
1065
|
-
}, q.value)),
|
|
1062
|
+
return (C = k.value) !== null && C !== void 0 ? C : p.value;
|
|
1063
|
+
}), E = y(() => V()), A = y(() => e.placement !== void 0 ? e.placement : f.value === "rtl" ? "bottomRight" : "bottomLeft"), L = y(() => ot(E.value, _t(A.value), e.transitionName)), z = y(() => ot(E.value, "", e.choiceTransitionName)), Y = y(() => V("select-tree", e.prefixCls)), B = y(() => V("tree-select", e.prefixCls)), [le, q] = Wt(s), [se] = Ia(B, Y), ce = y(() => at(e.popupClassName || e.dropdownClassName, `${B.value}-dropdown`, {
|
|
1064
|
+
[`${B.value}-dropdown-rtl`]: f.value === "rtl"
|
|
1065
|
+
}, q.value)), ie = y(() => !!(e.treeCheckable || e.multiple)), ne = y(() => e.showArrow !== void 0 ? e.showArrow : e.loading || !ie.value), G = pe();
|
|
1066
1066
|
t({
|
|
1067
1067
|
focus() {
|
|
1068
1068
|
var C, D;
|
|
@@ -1073,133 +1073,160 @@ const Xe = Ie({
|
|
|
1073
1073
|
(D = (C = G.value).blur) === null || D === void 0 || D.call(C);
|
|
1074
1074
|
}
|
|
1075
1075
|
});
|
|
1076
|
-
const
|
|
1076
|
+
const me = function() {
|
|
1077
1077
|
for (var C = arguments.length, D = new Array(C), M = 0; M < C; M++)
|
|
1078
1078
|
D[M] = arguments[M];
|
|
1079
|
-
|
|
1080
|
-
}, me = (C) => {
|
|
1081
|
-
n("update:treeExpandedKeys", C), n("treeExpand", C);
|
|
1079
|
+
l("update:value", D[0]), l("change", ...D), n.onFieldChange();
|
|
1082
1080
|
}, ye = (C) => {
|
|
1083
|
-
|
|
1084
|
-
},
|
|
1085
|
-
|
|
1081
|
+
l("update:treeExpandedKeys", C), l("treeExpand", C);
|
|
1082
|
+
}, be = (C) => {
|
|
1083
|
+
l("update:searchValue", C), l("search", C);
|
|
1084
|
+
}, ue = (C) => {
|
|
1085
|
+
l("blur", C), n.onFieldBlur();
|
|
1086
1086
|
};
|
|
1087
1087
|
return () => {
|
|
1088
1088
|
var C, D, M;
|
|
1089
1089
|
const {
|
|
1090
1090
|
notFoundContent: Q = (C = a.notFoundContent) === null || C === void 0 ? void 0 : C.call(a),
|
|
1091
|
-
prefixCls:
|
|
1091
|
+
prefixCls: ke,
|
|
1092
1092
|
bordered: Te,
|
|
1093
1093
|
listHeight: Le,
|
|
1094
1094
|
listItemHeight: _e,
|
|
1095
1095
|
multiple: Ee,
|
|
1096
1096
|
treeIcon: De,
|
|
1097
|
-
treeLine:
|
|
1097
|
+
treeLine: xe,
|
|
1098
1098
|
showArrow: Pe,
|
|
1099
1099
|
switcherIcon: Ae = (D = a.switcherIcon) === null || D === void 0 ? void 0 : D.call(a),
|
|
1100
1100
|
fieldNames: Ke = e.replaceFields,
|
|
1101
|
-
id: Fe =
|
|
1101
|
+
id: Fe = n.id.value,
|
|
1102
1102
|
placeholder: Oe = (M = a.placeholder) === null || M === void 0 ? void 0 : M.call(a)
|
|
1103
1103
|
} = e, {
|
|
1104
1104
|
isFormItemInput: He,
|
|
1105
1105
|
hasFeedback: J,
|
|
1106
|
-
feedbackIcon:
|
|
1107
|
-
} =
|
|
1108
|
-
suffixIcon:
|
|
1109
|
-
removeIcon:
|
|
1110
|
-
clearIcon:
|
|
1111
|
-
} = Ut(
|
|
1112
|
-
multiple:
|
|
1106
|
+
feedbackIcon: d
|
|
1107
|
+
} = r, {
|
|
1108
|
+
suffixIcon: g,
|
|
1109
|
+
removeIcon: m,
|
|
1110
|
+
clearIcon: N
|
|
1111
|
+
} = Ut(b(b({}, e), {
|
|
1112
|
+
multiple: ie.value,
|
|
1113
1113
|
showArrow: ne.value,
|
|
1114
1114
|
hasFeedback: J,
|
|
1115
|
-
feedbackIcon:
|
|
1116
|
-
prefixCls:
|
|
1115
|
+
feedbackIcon: d,
|
|
1116
|
+
prefixCls: s.value
|
|
1117
1117
|
}), a);
|
|
1118
1118
|
let P;
|
|
1119
|
-
Q !== void 0 ? P = Q : P =
|
|
1120
|
-
const _ =
|
|
1121
|
-
[`${
|
|
1122
|
-
[`${
|
|
1123
|
-
[`${
|
|
1124
|
-
[`${
|
|
1125
|
-
[`${
|
|
1126
|
-
}, ea(
|
|
1127
|
-
return e.treeData === void 0 && a.default && (T.children = Et(a.default())), le(se(U(xa, X(X(X(X({},
|
|
1119
|
+
Q !== void 0 ? P = Q : P = o("Select");
|
|
1120
|
+
const _ = Ne(e, ["suffixIcon", "itemIcon", "removeIcon", "clearIcon", "switcherIcon", "bordered", "status", "onUpdate:value", "onUpdate:treeExpandedKeys", "onUpdate:searchValue"]), I = at(!ke && B.value, {
|
|
1121
|
+
[`${s.value}-lg`]: O.value === "large",
|
|
1122
|
+
[`${s.value}-sm`]: O.value === "small",
|
|
1123
|
+
[`${s.value}-rtl`]: f.value === "rtl",
|
|
1124
|
+
[`${s.value}-borderless`]: !Te,
|
|
1125
|
+
[`${s.value}-in-form-item`]: He
|
|
1126
|
+
}, ea(s.value, u.value, J), F.value, c.class, q.value), T = {};
|
|
1127
|
+
return e.treeData === void 0 && a.default && (T.children = Et(a.default())), le(se(U(xa, X(X(X(X({}, c), _), {}, {
|
|
1128
1128
|
disabled: w.value,
|
|
1129
|
-
virtual:
|
|
1130
|
-
dropdownMatchSelectWidth:
|
|
1129
|
+
virtual: v.value,
|
|
1130
|
+
dropdownMatchSelectWidth: h.value,
|
|
1131
1131
|
id: Fe,
|
|
1132
1132
|
fieldNames: Ke,
|
|
1133
1133
|
ref: G,
|
|
1134
|
-
prefixCls:
|
|
1134
|
+
prefixCls: s.value,
|
|
1135
1135
|
class: I,
|
|
1136
1136
|
listHeight: Le,
|
|
1137
1137
|
listItemHeight: _e,
|
|
1138
|
-
treeLine: !!
|
|
1139
|
-
inputIcon:
|
|
1138
|
+
treeLine: !!xe,
|
|
1139
|
+
inputIcon: g,
|
|
1140
1140
|
multiple: Ee,
|
|
1141
|
-
removeIcon:
|
|
1142
|
-
clearIcon:
|
|
1143
|
-
switcherIcon: (R) => ta(Y.value, Ae, R, a.leafIcon,
|
|
1141
|
+
removeIcon: m,
|
|
1142
|
+
clearIcon: N,
|
|
1143
|
+
switcherIcon: (R) => ta(Y.value, Ae, R, a.leafIcon, xe),
|
|
1144
1144
|
showTreeIcon: De,
|
|
1145
1145
|
notFoundContent: P,
|
|
1146
1146
|
getPopupContainer: S == null ? void 0 : S.value,
|
|
1147
1147
|
treeMotion: null,
|
|
1148
1148
|
dropdownClassName: ce.value,
|
|
1149
1149
|
choiceTransitionName: z.value,
|
|
1150
|
-
onChange:
|
|
1151
|
-
onBlur:
|
|
1152
|
-
onSearch:
|
|
1153
|
-
onTreeExpand:
|
|
1150
|
+
onChange: me,
|
|
1151
|
+
onBlur: ue,
|
|
1152
|
+
onSearch: be,
|
|
1153
|
+
onTreeExpand: ye
|
|
1154
1154
|
}, T), {}, {
|
|
1155
1155
|
transitionName: L.value,
|
|
1156
|
-
customSlots:
|
|
1156
|
+
customSlots: b(b({}, a), {
|
|
1157
1157
|
treeCheckable: () => U("span", {
|
|
1158
|
-
class: `${
|
|
1158
|
+
class: `${s.value}-tree-checkbox-inner`
|
|
1159
1159
|
}, null)
|
|
1160
1160
|
}),
|
|
1161
1161
|
maxTagPlaceholder: e.maxTagPlaceholder || a.maxTagPlaceholder,
|
|
1162
1162
|
placement: A.value,
|
|
1163
1163
|
showArrow: J || Pe,
|
|
1164
1164
|
placeholder: Oe
|
|
1165
|
-
}),
|
|
1165
|
+
}), b(b({}, a), {
|
|
1166
1166
|
treeCheckable: () => U("span", {
|
|
1167
|
-
class: `${
|
|
1167
|
+
class: `${s.value}-tree-checkbox-inner`
|
|
1168
1168
|
}, null)
|
|
1169
1169
|
}))));
|
|
1170
1170
|
};
|
|
1171
1171
|
}
|
|
1172
|
-
}), st =
|
|
1173
|
-
TreeNode:
|
|
1172
|
+
}), st = ge, ct = b(Xe, {
|
|
1173
|
+
TreeNode: ge,
|
|
1174
1174
|
SHOW_ALL: da,
|
|
1175
1175
|
SHOW_PARENT: vt,
|
|
1176
1176
|
SHOW_CHILD: Je,
|
|
1177
1177
|
install: (e) => (e.component(Xe.name, Xe), e.component(st.displayName, st), e)
|
|
1178
|
-
}),
|
|
1179
|
-
function
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
if (!
|
|
1183
|
-
const n = await Kt.getCategoryValues(
|
|
1184
|
-
|
|
1178
|
+
}), fe = yt({});
|
|
1179
|
+
function ka(e) {
|
|
1180
|
+
we(() => e.categoryList, (t) => {
|
|
1181
|
+
t.forEach(async (l) => {
|
|
1182
|
+
if (!fe[l.id]) {
|
|
1183
|
+
const n = await Kt.getCategoryValues(l.id), { flatAttributeValue: r, treeAttributeValue: u, showWay: s } = n.body;
|
|
1184
|
+
fe[l.id] = s === "TREE" ? u : r;
|
|
1185
1185
|
}
|
|
1186
1186
|
});
|
|
1187
1187
|
}, { immediate: !0, deep: !0 });
|
|
1188
|
-
const
|
|
1189
|
-
for (let n = 0; n <
|
|
1190
|
-
const
|
|
1191
|
-
if (
|
|
1192
|
-
return
|
|
1193
|
-
if (
|
|
1194
|
-
|
|
1188
|
+
const i = (t, l) => {
|
|
1189
|
+
for (let n = 0; n < l.length; n++) {
|
|
1190
|
+
const r = l[n];
|
|
1191
|
+
if (r.id === t)
|
|
1192
|
+
return r.attributeName;
|
|
1193
|
+
if (r.children && r.children.length) {
|
|
1194
|
+
const u = i(t, r.children);
|
|
1195
|
+
if (u)
|
|
1196
|
+
return u;
|
|
1197
|
+
}
|
|
1195
1198
|
}
|
|
1196
1199
|
return "";
|
|
1200
|
+
}, c = (t, l) => {
|
|
1201
|
+
const n = [], r = /* @__PURE__ */ new Set(), u = (o) => {
|
|
1202
|
+
if (r.has(o.id) || (r.add(o.id), n.push(o)), o.children && o.children.length)
|
|
1203
|
+
for (let f = 0; f < o.children.length; f++)
|
|
1204
|
+
u(o.children[f]);
|
|
1205
|
+
}, s = (o, f) => {
|
|
1206
|
+
for (let v = 0; v < f.length; v++) {
|
|
1207
|
+
const h = f[v];
|
|
1208
|
+
if (h.id === o)
|
|
1209
|
+
return u(h), !0;
|
|
1210
|
+
if (h.children && h.children.length && s(o, h.children))
|
|
1211
|
+
return !0;
|
|
1212
|
+
}
|
|
1213
|
+
return !1;
|
|
1214
|
+
};
|
|
1215
|
+
for (let o = 0; o < t.length; o++)
|
|
1216
|
+
s(t[o], l);
|
|
1217
|
+
return n;
|
|
1197
1218
|
};
|
|
1198
1219
|
return {
|
|
1199
|
-
categoryValuesMap:
|
|
1200
|
-
getDeleteAttributesNames: (
|
|
1201
|
-
var
|
|
1202
|
-
|
|
1220
|
+
categoryValuesMap: fe,
|
|
1221
|
+
getDeleteAttributesNames: (t) => {
|
|
1222
|
+
var o, f;
|
|
1223
|
+
const l = c(t.attributeValueIds_view || [], fe[t.id] || []), n = /* @__PURE__ */ new Set();
|
|
1224
|
+
for (let v = 0; v < l.length; v++)
|
|
1225
|
+
n.add(l[v].id);
|
|
1226
|
+
const r = c(t.defaultValueIds || [], fe[t.id] || []), u = /* @__PURE__ */ new Map();
|
|
1227
|
+
for (let v = 0; v < r.length; v++)
|
|
1228
|
+
u.set(r[v].id, r[v].attributeName);
|
|
1229
|
+
return (f = (o = t.defaultValueIds) == null ? void 0 : o.filter((v) => !n.has(v))) == null ? void 0 : f.map((v) => u.get(v) || i(v, fe[t.id] || [])).filter(Boolean).join("、");
|
|
1203
1230
|
}
|
|
1204
1231
|
};
|
|
1205
1232
|
}
|
|
@@ -1220,43 +1247,43 @@ const Ta = { class: "crane-required" }, La = { class: "crane-category-tips" }, _
|
|
|
1220
1247
|
default: () => []
|
|
1221
1248
|
}
|
|
1222
1249
|
},
|
|
1223
|
-
setup(e, { expose:
|
|
1224
|
-
const
|
|
1225
|
-
categoryValuesMap:
|
|
1226
|
-
getDeleteAttributesNames:
|
|
1227
|
-
} =
|
|
1250
|
+
setup(e, { expose: i }) {
|
|
1251
|
+
const c = ct.SHOW_PARENT, a = e, t = pe(), l = pe(""), {
|
|
1252
|
+
categoryValuesMap: n,
|
|
1253
|
+
getDeleteAttributesNames: r
|
|
1254
|
+
} = ka(a), u = y(() => ({
|
|
1228
1255
|
categoryList: a.categoryList
|
|
1229
|
-
})),
|
|
1230
|
-
return
|
|
1231
|
-
validate: () => new Promise((
|
|
1256
|
+
})), s = y(() => Object.values(n).some((f) => f.length > 0));
|
|
1257
|
+
return i({
|
|
1258
|
+
validate: () => new Promise((f, v) => {
|
|
1232
1259
|
if (!t.value) {
|
|
1233
|
-
|
|
1260
|
+
f(!0);
|
|
1234
1261
|
return;
|
|
1235
1262
|
}
|
|
1236
1263
|
t.value.validate().then(() => {
|
|
1237
|
-
|
|
1264
|
+
f(!0);
|
|
1238
1265
|
}).catch(() => {
|
|
1239
|
-
|
|
1266
|
+
v(!1);
|
|
1240
1267
|
});
|
|
1241
1268
|
})
|
|
1242
|
-
}), (
|
|
1269
|
+
}), (f, v) => s.value ? (oe(), et(H(la), {
|
|
1243
1270
|
key: 0,
|
|
1244
1271
|
class: "crane-category-wraper",
|
|
1245
|
-
model:
|
|
1272
|
+
model: u.value,
|
|
1246
1273
|
ref_key: "formRef",
|
|
1247
1274
|
ref: t
|
|
1248
1275
|
}, {
|
|
1249
1276
|
default: Be(() => [
|
|
1250
|
-
$e("div", Ta, de(H(
|
|
1251
|
-
$e("div", La, de(H(
|
|
1252
|
-
|
|
1253
|
-
(
|
|
1277
|
+
$e("div", Ta, de(H(Se)("category")), 1),
|
|
1278
|
+
$e("div", La, de(H(Se)("categotySelectTips")), 1),
|
|
1279
|
+
v[1] || (v[1] = $e("div", { class: "crane-category-line" }, null, -1)),
|
|
1280
|
+
(oe(!0), Ce(bt, null, Ct(u.value.categoryList, (h, x) => {
|
|
1254
1281
|
var S;
|
|
1255
|
-
return St((
|
|
1256
|
-
key:
|
|
1257
|
-
label:
|
|
1282
|
+
return St((oe(), et(H(aa), {
|
|
1283
|
+
key: h.id,
|
|
1284
|
+
label: h.categoryName,
|
|
1258
1285
|
name: ["categoryList", x, "attributeValueIds_view"],
|
|
1259
|
-
rules: [{ required: !0, message: H(
|
|
1286
|
+
rules: [{ required: !0, message: H(Se)("pleaseChoose"), trigger: ["change", "blur"] }]
|
|
1260
1287
|
}, {
|
|
1261
1288
|
default: Be(() => {
|
|
1262
1289
|
var V;
|
|
@@ -1264,30 +1291,31 @@ const Ta = { class: "crane-required" }, La = { class: "crane-category-tips" }, _
|
|
|
1264
1291
|
U(H(ct), {
|
|
1265
1292
|
treeCheckable: "",
|
|
1266
1293
|
treeDefaultExpandAll: "",
|
|
1267
|
-
"tree-data": H(
|
|
1294
|
+
"tree-data": H(n)[h.id],
|
|
1268
1295
|
showSearch: "",
|
|
1269
1296
|
allowClear: "",
|
|
1270
|
-
value:
|
|
1271
|
-
"onUpdate:value": (
|
|
1297
|
+
value: h.attributeValueIds_view,
|
|
1298
|
+
"onUpdate:value": (k) => h.attributeValueIds_view = k,
|
|
1272
1299
|
treeNodeFilterProp: "attributeName",
|
|
1273
|
-
searchValue:
|
|
1274
|
-
"onUpdate:searchValue":
|
|
1300
|
+
searchValue: l.value,
|
|
1301
|
+
"onUpdate:searchValue": v[0] || (v[0] = (k) => l.value = k),
|
|
1275
1302
|
fieldNames: { label: "attributeName", value: "id" },
|
|
1276
1303
|
treeNodeLabelProp: "attributeName",
|
|
1277
|
-
"show-checked-strategy": H(
|
|
1304
|
+
"show-checked-strategy": H(c),
|
|
1305
|
+
virtual: !0
|
|
1278
1306
|
}, {
|
|
1279
|
-
title: Be(({ attributeName:
|
|
1280
|
-
|
|
1307
|
+
title: Be(({ attributeName: k }) => [
|
|
1308
|
+
l.value.toLowerCase() && k.includes(l.value.toLowerCase()) ? (oe(), Ce("span", _a, de(k), 1)) : (oe(), Ce("span", Ea, de(k), 1))
|
|
1281
1309
|
]),
|
|
1282
1310
|
_: 2
|
|
1283
1311
|
}, 1032, ["tree-data", "value", "onUpdate:value", "searchValue", "show-checked-strategy"]),
|
|
1284
|
-
(V =
|
|
1285
|
-
H(
|
|
1312
|
+
(V = h.attributeValueIds_view) != null && V.includes(-1) ? (oe(), Ce("span", Da, de(H(Se)("categoryChangeTips", { category: h.categoryName })), 1)) : je("", !0),
|
|
1313
|
+
H(r)(h) ? (oe(), Ce("span", Pa, de(H(Se)("deleteCategoryTips", { categorys: H(r)(h) })), 1)) : je("", !0)
|
|
1286
1314
|
];
|
|
1287
1315
|
}),
|
|
1288
1316
|
_: 2
|
|
1289
1317
|
}, 1032, ["label", "name", "rules"])), [
|
|
1290
|
-
[wt, (S = H(
|
|
1318
|
+
[wt, (S = H(n)[h.id]) == null ? void 0 : S.length]
|
|
1291
1319
|
]);
|
|
1292
1320
|
}), 128))
|
|
1293
1321
|
]),
|
|
@@ -1295,7 +1323,7 @@ const Ta = { class: "crane-required" }, La = { class: "crane-category-tips" }, _
|
|
|
1295
1323
|
__: [1]
|
|
1296
1324
|
}, 8, ["model"])) : je("", !0);
|
|
1297
1325
|
}
|
|
1298
|
-
}), Ma = /* @__PURE__ */ Ft(Aa, [["__scopeId", "data-v-
|
|
1326
|
+
}), Ma = /* @__PURE__ */ Ft(Aa, [["__scopeId", "data-v-b0210ff6"]]);
|
|
1299
1327
|
export {
|
|
1300
1328
|
Ma as default
|
|
1301
1329
|
};
|