@yqg/permission 1.3.0-alpha.1 → 1.3.0-alpha.10
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-CpmDDWWV.js → apply-modal-Ct9rKeUf.js} +3180 -3163
- package/dist/{category-selector-BQ0-kg3o.js → category-selector-BnUMBDty.js} +156 -156
- package/dist/{index-D_0ZQip-.js → index-CAVNFmBo.js} +3 -3
- package/dist/{index-wLkVeDMW.js → index-XvlOgi6s.js} +10 -12
- package/dist/index.js +2 -2
- package/dist/permission-item-2JurQrn-.js +1250 -0
- package/dist/{yqg-permission-BjVCs5lN.js → yqg-permission-BrOMv4sA.js} +43 -47
- package/dist/yqg-permission.umd.js +58 -58
- package/package.json +1 -1
- package/src/App.vue +11 -22
- package/src/components/apply-modal.vue +34 -14
- package/src/components/category-selector.vue +2 -2
- package/src/components/permission-item.vue +6 -40
- package/src/components/success-modal.vue +3 -3
- package/src/components/yqg-permission.vue +9 -14
- package/src/hooks/useAttributesCache.ts +4 -4
- package/src/hooks/useDefaultTime.ts +20 -0
- package/src/hooks/useFormat.ts +2 -2
- package/src/i18n/zh-CH.ts +2 -2
- package/src/utils/index.ts +2 -2
- package/src/yqg-permission/index.ts +0 -1
- package/tsconfig.app.json +3 -2
- package/vite.config.ts.timestamp-1742445090907-a3605e27049cc.mjs +292 -0
- package/dist/permission-item-Df_aagL1.js +0 -1266
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as ht, p as pt, d as Ve, r as fe, c as y, w as be, q as mt, s as M, E as ae, e as U, b as Ge, y as oe, $ as gt, G as yt, K as
|
|
2
|
-
import { a as X, _ as b, W as xt, X as Vt, ae as
|
|
3
|
-
import { u as Ot, a as Ht, b as Rt, c as Mt, d as Bt, t as lt, B as $t, e as jt, f as Wt, g as Ut } from "./index-
|
|
4
|
-
import { K as de, T as zt, c as Xt, a as Xe, u as Yt, g as qt, b as Gt, d as
|
|
1
|
+
import { a as ht, p as pt, d as Ve, r as fe, c as y, w as be, q as mt, s as M, E as ae, e as U, b as Ge, y as oe, $ as gt, G as yt, K as ie, L as Ze, M as Me, N as Be, R as ye, u as W, P as we, F as bt, Y as Ct, f as St, U as et, z as wt } from "./index-XvlOgi6s.js";
|
|
2
|
+
import { a as X, _ as b, W as xt, X as Vt, ae as ut, aX as tt, Y as Ie, P as ve, N as It, R as it, V as kt, aN as $e, $ as Nt, ar as Tt, as as Lt, aY as Et, c as at, b as _t, ak as je, aj as Pt, a0 as Dt, ai as At, am as We, aU as Kt, aP as xe, aS as Ft } from "./yqg-permission-BrOMv4sA.js";
|
|
3
|
+
import { u as Ot, a as Ht, b as Rt, c as Mt, d as Bt, t as lt, B as $t, e as jt, f as Wt, g as Ut } from "./index-CAVNFmBo.js";
|
|
4
|
+
import { K as de, T as zt, c as Xt, a as Xe, u as Yt, g as qt, b as Gt, d as Jt, F as Qt, e as Zt, f as ea, r as ta, h as aa, i as la } from "./apply-modal-Ct9rKeUf.js";
|
|
5
5
|
function na(e) {
|
|
6
6
|
return Array.isArray(e) ? e : e !== void 0 ? [e] : [];
|
|
7
7
|
}
|
|
@@ -42,7 +42,7 @@ function sa(e) {
|
|
|
42
42
|
function ca() {
|
|
43
43
|
return ht(dt, {});
|
|
44
44
|
}
|
|
45
|
-
const
|
|
45
|
+
const ua = {
|
|
46
46
|
width: 0,
|
|
47
47
|
height: 0,
|
|
48
48
|
display: "flex",
|
|
@@ -51,7 +51,7 @@ const ia = {
|
|
|
51
51
|
border: 0,
|
|
52
52
|
padding: 0,
|
|
53
53
|
margin: 0
|
|
54
|
-
},
|
|
54
|
+
}, ia = Ve({
|
|
55
55
|
compatConfig: {
|
|
56
56
|
MODE: 3
|
|
57
57
|
},
|
|
@@ -84,15 +84,15 @@ const ia = {
|
|
|
84
84
|
immediate: !0,
|
|
85
85
|
flush: "post"
|
|
86
86
|
});
|
|
87
|
-
const
|
|
87
|
+
const u = y(() => String(a.searchValue).toLowerCase()), f = (v) => u.value ? String(v[n.treeNodeFilterProp]).toLowerCase().includes(u.value) : !1, p = M(n.treeDefaultExpandedKeys), w = M(null);
|
|
88
88
|
be(() => a.searchValue, () => {
|
|
89
89
|
a.searchValue && (w.value = ra(ae(o.treeData), ae(o.fieldNames)));
|
|
90
90
|
}, {
|
|
91
91
|
immediate: !0
|
|
92
92
|
});
|
|
93
|
-
const x = y(() => n.treeExpandedKeys ? n.treeExpandedKeys.slice() : a.searchValue ? w.value :
|
|
93
|
+
const x = y(() => n.treeExpandedKeys ? n.treeExpandedKeys.slice() : a.searchValue ? w.value : p.value), S = (v) => {
|
|
94
94
|
var V;
|
|
95
|
-
|
|
95
|
+
p.value = v, w.value = v, (V = n.onTreeExpand) === null || V === void 0 || V.call(n, v);
|
|
96
96
|
}, g = (v) => {
|
|
97
97
|
v.preventDefault();
|
|
98
98
|
}, F = (v, V) => {
|
|
@@ -171,7 +171,7 @@ const ia = {
|
|
|
171
171
|
switcherIcon: pe,
|
|
172
172
|
treeLine: me,
|
|
173
173
|
loadData: ge,
|
|
174
|
-
treeLoadedKeys:
|
|
174
|
+
treeLoadedKeys: ue,
|
|
175
175
|
treeMotion: C,
|
|
176
176
|
onTreeLoad: _,
|
|
177
177
|
checkedKeys: H
|
|
@@ -182,13 +182,13 @@ const ia = {
|
|
|
182
182
|
class: `${V}-empty`,
|
|
183
183
|
onMousedown: g
|
|
184
184
|
}, [z]);
|
|
185
|
-
const
|
|
185
|
+
const J = {
|
|
186
186
|
fieldNames: o.fieldNames
|
|
187
187
|
};
|
|
188
|
-
return
|
|
188
|
+
return ue && (J.loadedKeys = ue), x.value && (J.expandedKeys = x.value), U("div", {
|
|
189
189
|
onMousedown: g
|
|
190
190
|
}, [K.value && T && U("span", {
|
|
191
|
-
style:
|
|
191
|
+
style: ua,
|
|
192
192
|
"aria-live": "assertive"
|
|
193
193
|
}, [K.value.node.value]), U(zt, X(X({
|
|
194
194
|
ref: r,
|
|
@@ -211,7 +211,7 @@ const ia = {
|
|
|
211
211
|
checkedKeys: c.value,
|
|
212
212
|
selectedKeys: se ? [] : H,
|
|
213
213
|
defaultExpandAll: ce
|
|
214
|
-
},
|
|
214
|
+
}, J), {}, {
|
|
215
215
|
onActiveChange: O,
|
|
216
216
|
onSelect: F,
|
|
217
217
|
onCheck: F,
|
|
@@ -224,10 +224,10 @@ const ia = {
|
|
|
224
224
|
}))]);
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
|
-
}), da = "SHOW_ALL", vt = "SHOW_PARENT",
|
|
227
|
+
}), da = "SHOW_ALL", vt = "SHOW_PARENT", Je = "SHOW_CHILD";
|
|
228
228
|
function ot(e, s, l, t) {
|
|
229
229
|
const a = new Set(e);
|
|
230
|
-
return s ===
|
|
230
|
+
return s === Je ? e.filter((n) => {
|
|
231
231
|
const o = l[n];
|
|
232
232
|
return !(o && o.children && o.children.some((r) => {
|
|
233
233
|
let {
|
|
@@ -270,15 +270,15 @@ function ha(e) {
|
|
|
270
270
|
for (const [E, D] of Object.entries(t.props))
|
|
271
271
|
c[Vt(E)] = D;
|
|
272
272
|
const {
|
|
273
|
-
isLeaf:
|
|
273
|
+
isLeaf: u,
|
|
274
274
|
checkable: f,
|
|
275
|
-
selectable:
|
|
275
|
+
selectable: p,
|
|
276
276
|
disabled: w,
|
|
277
277
|
disableCheckbox: x
|
|
278
278
|
} = c, S = {
|
|
279
|
-
isLeaf:
|
|
279
|
+
isLeaf: u || u === "" || void 0,
|
|
280
280
|
checkable: f || f === "" || void 0,
|
|
281
|
-
selectable:
|
|
281
|
+
selectable: p || p === "" || void 0,
|
|
282
282
|
disabled: w || w === "" || void 0,
|
|
283
283
|
disableCheckbox: x || x === "" || void 0
|
|
284
284
|
}, g = b(b({}, c), S), {
|
|
@@ -288,7 +288,7 @@ function ha(e) {
|
|
|
288
288
|
title: F,
|
|
289
289
|
switcherIcon: A,
|
|
290
290
|
key: d,
|
|
291
|
-
isLeaf:
|
|
291
|
+
isLeaf: u
|
|
292
292
|
}), S), V = s(O);
|
|
293
293
|
return V.length && (v.children = V), v;
|
|
294
294
|
});
|
|
@@ -308,9 +308,9 @@ function qe(e) {
|
|
|
308
308
|
function pa(e, s, l, t, a, n) {
|
|
309
309
|
let o = null, r = null;
|
|
310
310
|
function d() {
|
|
311
|
-
function c(
|
|
312
|
-
let f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "0",
|
|
313
|
-
return
|
|
311
|
+
function c(u) {
|
|
312
|
+
let f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "0", p = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
|
|
313
|
+
return u.map((w, x) => {
|
|
314
314
|
const S = `${f}-${x}`, g = w[n.value], F = l.includes(g), A = c(w[n.children] || [], S, F), K = U(he, w, {
|
|
315
315
|
default: () => [A.map((O) => O.node)]
|
|
316
316
|
});
|
|
@@ -320,26 +320,26 @@ function pa(e, s, l, t, a, n) {
|
|
|
320
320
|
node: K,
|
|
321
321
|
children: A
|
|
322
322
|
};
|
|
323
|
-
return
|
|
323
|
+
return p || r.push(O), O;
|
|
324
324
|
}
|
|
325
325
|
return null;
|
|
326
326
|
}).filter((w) => w);
|
|
327
327
|
}
|
|
328
|
-
r || (r = [], c(t), r.sort((
|
|
328
|
+
r || (r = [], c(t), r.sort((u, f) => {
|
|
329
329
|
let {
|
|
330
330
|
node: {
|
|
331
331
|
props: {
|
|
332
|
-
value:
|
|
332
|
+
value: p
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
|
-
} =
|
|
335
|
+
} = u, {
|
|
336
336
|
node: {
|
|
337
337
|
props: {
|
|
338
338
|
value: w
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
} = f;
|
|
342
|
-
const x = l.indexOf(
|
|
342
|
+
const x = l.indexOf(p), S = l.indexOf(w);
|
|
343
343
|
return x - S;
|
|
344
344
|
}));
|
|
345
345
|
}
|
|
@@ -351,9 +351,9 @@ function pa(e, s, l, t, a, n) {
|
|
|
351
351
|
get() {
|
|
352
352
|
return d(), a ? r : r.map((c) => {
|
|
353
353
|
let {
|
|
354
|
-
node:
|
|
354
|
+
node: u
|
|
355
355
|
} = c;
|
|
356
|
-
return
|
|
356
|
+
return u;
|
|
357
357
|
});
|
|
358
358
|
}
|
|
359
359
|
});
|
|
@@ -366,11 +366,11 @@ function ma(e, s) {
|
|
|
366
366
|
} = s;
|
|
367
367
|
const n = {}, o = [];
|
|
368
368
|
return e.map((d) => {
|
|
369
|
-
const c = b({}, d),
|
|
370
|
-
return n[
|
|
369
|
+
const c = b({}, d), u = c[l];
|
|
370
|
+
return n[u] = c, c.key = c.key || u, c;
|
|
371
371
|
}).forEach((d) => {
|
|
372
|
-
const c = d[t],
|
|
373
|
-
|
|
372
|
+
const c = d[t], u = n[c];
|
|
373
|
+
u && (u.children = u.children || [], u.children.push(d)), (c === a || !u && a === null) && o.push(d);
|
|
374
374
|
}), o;
|
|
375
375
|
}
|
|
376
376
|
function ga(e, s, l) {
|
|
@@ -402,9 +402,9 @@ const ya = (e) => {
|
|
|
402
402
|
var d;
|
|
403
403
|
const {
|
|
404
404
|
value: c
|
|
405
|
-
} = r,
|
|
406
|
-
return n.set(c,
|
|
407
|
-
label:
|
|
405
|
+
} = r, u = (d = r.label) !== null && d !== void 0 ? d : a.get(c);
|
|
406
|
+
return n.set(c, u), b(b({}, r), {
|
|
407
|
+
label: u
|
|
408
408
|
});
|
|
409
409
|
});
|
|
410
410
|
return s.value.valueLabels = n, o;
|
|
@@ -432,20 +432,20 @@ const ya = (e) => {
|
|
|
432
432
|
return Ge(() => {
|
|
433
433
|
let d = e.value.map((f) => {
|
|
434
434
|
let {
|
|
435
|
-
value:
|
|
435
|
+
value: p
|
|
436
436
|
} = f;
|
|
437
|
-
return
|
|
437
|
+
return p;
|
|
438
438
|
}), c = s.value.map((f) => {
|
|
439
439
|
let {
|
|
440
|
-
value:
|
|
440
|
+
value: p
|
|
441
441
|
} = f;
|
|
442
|
-
return
|
|
442
|
+
return p;
|
|
443
443
|
});
|
|
444
|
-
const
|
|
444
|
+
const u = d.filter((f) => !t.value[f]);
|
|
445
445
|
l.value && ({
|
|
446
446
|
checkedKeys: d,
|
|
447
447
|
halfCheckedKeys: c
|
|
448
|
-
} = Xe(d, !0, t.value, a.value, n.value)), o.value = Array.from(/* @__PURE__ */ new Set([...
|
|
448
|
+
} = Xe(d, !0, t.value, a.value, n.value)), o.value = Array.from(/* @__PURE__ */ new Set([...u, ...d])), r.value = c;
|
|
449
449
|
}), [o, r];
|
|
450
450
|
}, Sa = (e, s, l) => {
|
|
451
451
|
let {
|
|
@@ -464,23 +464,23 @@ const ya = (e) => {
|
|
|
464
464
|
c = a.value;
|
|
465
465
|
else {
|
|
466
466
|
const f = r.toUpperCase();
|
|
467
|
-
c = (
|
|
467
|
+
c = (p, w) => {
|
|
468
468
|
const x = w[d];
|
|
469
469
|
return String(x).toUpperCase().includes(f);
|
|
470
470
|
};
|
|
471
471
|
}
|
|
472
|
-
function
|
|
473
|
-
let
|
|
472
|
+
function u(f) {
|
|
473
|
+
let p = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
474
474
|
const w = [];
|
|
475
475
|
for (let x = 0, S = f.length; x < S; x++) {
|
|
476
|
-
const g = f[x], F = g[o], A =
|
|
476
|
+
const g = f[x], F = g[o], A = p || c(r, qe(g)), K = u(F || [], A);
|
|
477
477
|
(A || K.length) && w.push(b(b({}, g), {
|
|
478
478
|
[o]: K
|
|
479
479
|
}));
|
|
480
480
|
}
|
|
481
481
|
return w;
|
|
482
482
|
}
|
|
483
|
-
return
|
|
483
|
+
return u(e.value);
|
|
484
484
|
});
|
|
485
485
|
};
|
|
486
486
|
function ft() {
|
|
@@ -630,10 +630,10 @@ const xa = Ve({
|
|
|
630
630
|
},
|
|
631
631
|
name: "TreeSelect",
|
|
632
632
|
inheritAttrs: !1,
|
|
633
|
-
props:
|
|
633
|
+
props: ut(ft(), {
|
|
634
634
|
treeNodeFilterProp: "value",
|
|
635
635
|
autoClearSearchValue: !0,
|
|
636
|
-
showCheckedStrategy:
|
|
636
|
+
showCheckedStrategy: Je,
|
|
637
637
|
listHeight: 200,
|
|
638
638
|
listItemHeight: 20,
|
|
639
639
|
prefixCls: "vc-tree-select"
|
|
@@ -644,50 +644,50 @@ const xa = Ve({
|
|
|
644
644
|
expose: t,
|
|
645
645
|
slots: a
|
|
646
646
|
} = s;
|
|
647
|
-
const n = Mt(oe(e, "id")), o = y(() => e.treeCheckable && !e.treeCheckStrictly), r = y(() => e.treeCheckable || e.treeCheckStrictly), d = y(() => e.treeCheckStrictly || e.labelInValue), c = y(() => r.value || e.multiple),
|
|
647
|
+
const n = Mt(oe(e, "id")), o = y(() => e.treeCheckable && !e.treeCheckStrictly), r = y(() => e.treeCheckable || e.treeCheckStrictly), d = y(() => e.treeCheckStrictly || e.labelInValue), c = y(() => r.value || e.multiple), u = y(() => oa(e.fieldNames)), [f, p] = tt("", {
|
|
648
648
|
value: y(() => e.searchValue !== void 0 ? e.searchValue : e.inputValue),
|
|
649
|
-
postState: (
|
|
650
|
-
}), w = (
|
|
649
|
+
postState: (i) => i || ""
|
|
650
|
+
}), w = (i) => {
|
|
651
651
|
var h;
|
|
652
|
-
|
|
652
|
+
p(i), (h = e.onSearch) === null || h === void 0 || h.call(e, i);
|
|
653
653
|
}, x = ga(oe(e, "treeData"), oe(e, "children"), oe(e, "treeDataSimpleMode")), {
|
|
654
654
|
keyEntities: S,
|
|
655
655
|
valueEntities: g
|
|
656
|
-
} = ba(x,
|
|
657
|
-
const h = [],
|
|
658
|
-
return
|
|
659
|
-
g.value.has(k) ?
|
|
656
|
+
} = ba(x, u), F = (i) => {
|
|
657
|
+
const h = [], m = [];
|
|
658
|
+
return i.forEach((k) => {
|
|
659
|
+
g.value.has(k) ? m.push(k) : h.push(k);
|
|
660
660
|
}), {
|
|
661
661
|
missingRawValues: h,
|
|
662
|
-
existRawValues:
|
|
662
|
+
existRawValues: m
|
|
663
663
|
};
|
|
664
664
|
}, A = Sa(x, f, {
|
|
665
|
-
fieldNames:
|
|
665
|
+
fieldNames: u,
|
|
666
666
|
treeNodeFilterProp: oe(e, "treeNodeFilterProp"),
|
|
667
667
|
filterTreeNode: oe(e, "filterTreeNode")
|
|
668
|
-
}), K = (
|
|
669
|
-
if (
|
|
668
|
+
}), K = (i) => {
|
|
669
|
+
if (i) {
|
|
670
670
|
if (e.treeNodeLabelProp)
|
|
671
|
-
return
|
|
671
|
+
return i[e.treeNodeLabelProp];
|
|
672
672
|
const {
|
|
673
673
|
_title: h
|
|
674
|
-
} =
|
|
675
|
-
for (let
|
|
676
|
-
const k =
|
|
674
|
+
} = u.value;
|
|
675
|
+
for (let m = 0; m < h.length; m += 1) {
|
|
676
|
+
const k = i[h[m]];
|
|
677
677
|
if (k !== void 0)
|
|
678
678
|
return k;
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
|
-
}, O = (
|
|
682
|
-
value:
|
|
683
|
-
} :
|
|
681
|
+
}, O = (i) => na(i).map((m) => wa(m) ? {
|
|
682
|
+
value: m
|
|
683
|
+
} : m), v = (i) => O(i).map((m) => {
|
|
684
684
|
let {
|
|
685
685
|
label: k
|
|
686
|
-
} =
|
|
686
|
+
} = m;
|
|
687
687
|
const {
|
|
688
688
|
value: P,
|
|
689
689
|
halfChecked: L
|
|
690
|
-
} =
|
|
690
|
+
} = m;
|
|
691
691
|
let I;
|
|
692
692
|
const N = g.value.get(P);
|
|
693
693
|
return N && (k = k ?? K(N.node), I = N.node.disabled), {
|
|
@@ -700,38 +700,38 @@ const xa = Ve({
|
|
|
700
700
|
value: oe(e, "value")
|
|
701
701
|
}), D = y(() => O(V.value)), T = M([]), z = M([]);
|
|
702
702
|
Ge(() => {
|
|
703
|
-
const
|
|
704
|
-
D.value.forEach((
|
|
705
|
-
|
|
706
|
-
}), T.value =
|
|
703
|
+
const i = [], h = [];
|
|
704
|
+
D.value.forEach((m) => {
|
|
705
|
+
m.halfChecked ? h.push(m) : i.push(m);
|
|
706
|
+
}), T.value = i, z.value = h;
|
|
707
707
|
});
|
|
708
|
-
const Y = y(() => T.value.map((
|
|
708
|
+
const Y = y(() => T.value.map((i) => i.value)), {
|
|
709
709
|
maxLevel: B,
|
|
710
710
|
levelEntities: le
|
|
711
711
|
} = Yt(S), [q, re] = Ca(T, z, o, S, B, le), se = y(() => {
|
|
712
|
-
const
|
|
712
|
+
const m = ot(q.value, e.showCheckedStrategy, S.value, u.value).map((L) => {
|
|
713
713
|
var I, N, R;
|
|
714
|
-
return (R = (N = (I = S.value[L]) === null || I === void 0 ? void 0 : I.node) === null || N === void 0 ? void 0 : N[
|
|
714
|
+
return (R = (N = (I = S.value[L]) === null || I === void 0 ? void 0 : I.node) === null || N === void 0 ? void 0 : N[u.value.value]) !== null && R !== void 0 ? R : L;
|
|
715
715
|
}).map((L) => {
|
|
716
716
|
const I = T.value.find((N) => N.value === L);
|
|
717
717
|
return {
|
|
718
718
|
value: L,
|
|
719
719
|
label: I == null ? void 0 : I.label
|
|
720
720
|
};
|
|
721
|
-
}), k = v(
|
|
721
|
+
}), k = v(m), P = k[0];
|
|
722
722
|
return !c.value && P && nt(P.value) && nt(P.label) ? [] : k.map((L) => {
|
|
723
723
|
var I;
|
|
724
724
|
return b(b({}, L), {
|
|
725
725
|
label: (I = L.label) !== null && I !== void 0 ? I : L.value
|
|
726
726
|
});
|
|
727
727
|
});
|
|
728
|
-
}), [ce] = ya(se), ne = (
|
|
729
|
-
const k = v(
|
|
730
|
-
if (E(k), e.autoClearSearchValue &&
|
|
731
|
-
let P =
|
|
732
|
-
o.value && (P = ot(
|
|
728
|
+
}), [ce] = ya(se), ne = (i, h, m) => {
|
|
729
|
+
const k = v(i);
|
|
730
|
+
if (E(k), e.autoClearSearchValue && p(""), e.onChange) {
|
|
731
|
+
let P = i;
|
|
732
|
+
o.value && (P = ot(i, e.showCheckedStrategy, S.value, u.value).map((te) => {
|
|
733
733
|
const Se = g.value.get(te);
|
|
734
|
-
return Se ? Se.node[
|
|
734
|
+
return Se ? Se.node[u.value.value] : te;
|
|
735
735
|
}));
|
|
736
736
|
const {
|
|
737
737
|
triggerValue: L,
|
|
@@ -751,58 +751,58 @@ const xa = Ve({
|
|
|
751
751
|
triggerValue: L
|
|
752
752
|
};
|
|
753
753
|
let ee = !0;
|
|
754
|
-
(e.treeCheckStrictly ||
|
|
754
|
+
(e.treeCheckStrictly || m === "selection" && !I) && (ee = !1), pa(Z, L, i, x.value, ee, u.value), r.value ? Z.checked = I : Z.selected = I;
|
|
755
755
|
const $ = d.value ? R : R.map((j) => j.value);
|
|
756
756
|
e.onChange(c.value ? $ : $[0], d.value ? null : R.map((j) => j.label), Z);
|
|
757
757
|
}
|
|
758
|
-
}, G = (
|
|
758
|
+
}, G = (i, h) => {
|
|
759
759
|
let {
|
|
760
|
-
selected:
|
|
760
|
+
selected: m,
|
|
761
761
|
source: k
|
|
762
762
|
} = h;
|
|
763
763
|
var P, L, I;
|
|
764
|
-
const N = ae(S.value), R = ae(g.value), Z = N[
|
|
764
|
+
const N = ae(S.value), R = ae(g.value), Z = N[i], ee = Z == null ? void 0 : Z.node, $ = (P = ee == null ? void 0 : ee[u.value.value]) !== null && P !== void 0 ? P : i;
|
|
765
765
|
if (!c.value)
|
|
766
766
|
ne([$], {
|
|
767
767
|
selected: !0,
|
|
768
768
|
triggerValue: $
|
|
769
769
|
}, "option");
|
|
770
770
|
else {
|
|
771
|
-
let j =
|
|
771
|
+
let j = m ? [...Y.value, $] : q.value.filter((te) => te !== $);
|
|
772
772
|
if (o.value) {
|
|
773
773
|
const {
|
|
774
774
|
missingRawValues: te,
|
|
775
775
|
existRawValues: Se
|
|
776
|
-
} = F(j),
|
|
776
|
+
} = F(j), Qe = Se.map((Re) => R.get(Re).key);
|
|
777
777
|
let He;
|
|
778
|
-
|
|
778
|
+
m ? {
|
|
779
779
|
checkedKeys: He
|
|
780
|
-
} = Xe(
|
|
780
|
+
} = Xe(Qe, !0, N, B.value, le.value) : {
|
|
781
781
|
checkedKeys: He
|
|
782
|
-
} = Xe(
|
|
782
|
+
} = Xe(Qe, {
|
|
783
783
|
checked: !1,
|
|
784
784
|
halfCheckedKeys: re.value
|
|
785
|
-
}, N, B.value, le.value), j = [...te, ...He.map((Re) => N[Re].node[
|
|
785
|
+
}, N, B.value, le.value), j = [...te, ...He.map((Re) => N[Re].node[u.value.value])];
|
|
786
786
|
}
|
|
787
787
|
ne(j, {
|
|
788
|
-
selected:
|
|
788
|
+
selected: m,
|
|
789
789
|
triggerValue: $
|
|
790
790
|
}, k || "option");
|
|
791
791
|
}
|
|
792
|
-
|
|
793
|
-
}, pe = (
|
|
792
|
+
m || !c.value ? (L = e.onSelect) === null || L === void 0 || L.call(e, $, qe(ee)) : (I = e.onDeselect) === null || I === void 0 || I.call(e, $, qe(ee));
|
|
793
|
+
}, pe = (i) => {
|
|
794
794
|
if (e.onDropdownVisibleChange) {
|
|
795
795
|
const h = {};
|
|
796
796
|
Object.defineProperty(h, "documentClickClose", {
|
|
797
797
|
get() {
|
|
798
798
|
return !1;
|
|
799
799
|
}
|
|
800
|
-
}), e.onDropdownVisibleChange(
|
|
800
|
+
}), e.onDropdownVisibleChange(i, h);
|
|
801
801
|
}
|
|
802
|
-
}, me = (
|
|
803
|
-
const
|
|
802
|
+
}, me = (i, h) => {
|
|
803
|
+
const m = i.map((k) => k.value);
|
|
804
804
|
if (h.type === "clear") {
|
|
805
|
-
ne(
|
|
805
|
+
ne(m, {}, "selection");
|
|
806
806
|
return;
|
|
807
807
|
}
|
|
808
808
|
h.values.length && G(h.values[0].value, {
|
|
@@ -812,12 +812,12 @@ const xa = Ve({
|
|
|
812
812
|
}, {
|
|
813
813
|
treeNodeFilterProp: ge,
|
|
814
814
|
// Data
|
|
815
|
-
loadData:
|
|
815
|
+
loadData: ue,
|
|
816
816
|
treeLoadedKeys: C,
|
|
817
817
|
onTreeLoad: _,
|
|
818
818
|
// Expanded
|
|
819
819
|
treeDefaultExpandAll: H,
|
|
820
|
-
treeExpandedKeys:
|
|
820
|
+
treeExpandedKeys: J,
|
|
821
821
|
treeDefaultExpandedKeys: ke,
|
|
822
822
|
onTreeExpand: Ne,
|
|
823
823
|
// Options
|
|
@@ -836,13 +836,13 @@ const xa = Ve({
|
|
|
836
836
|
} = gt(e);
|
|
837
837
|
Bt(lt({
|
|
838
838
|
checkable: r,
|
|
839
|
-
loadData:
|
|
839
|
+
loadData: ue,
|
|
840
840
|
treeLoadedKeys: C,
|
|
841
841
|
onTreeLoad: _,
|
|
842
842
|
checkedKeys: q,
|
|
843
843
|
halfCheckedKeys: re,
|
|
844
844
|
treeDefaultExpandAll: H,
|
|
845
|
-
treeExpandedKeys:
|
|
845
|
+
treeExpandedKeys: J,
|
|
846
846
|
treeDefaultExpandedKeys: ke,
|
|
847
847
|
onTreeExpand: Ne,
|
|
848
848
|
treeIcon: Ce,
|
|
@@ -858,27 +858,27 @@ const xa = Ve({
|
|
|
858
858
|
listHeight: Le,
|
|
859
859
|
listItemHeight: Ee,
|
|
860
860
|
treeData: A,
|
|
861
|
-
fieldNames:
|
|
861
|
+
fieldNames: u,
|
|
862
862
|
onSelect: G,
|
|
863
863
|
dropdownMatchSelectWidth: Fe,
|
|
864
864
|
treeExpandAction: Oe
|
|
865
865
|
}));
|
|
866
|
-
const
|
|
866
|
+
const Q = fe();
|
|
867
867
|
return t({
|
|
868
868
|
focus() {
|
|
869
|
-
var
|
|
870
|
-
(
|
|
869
|
+
var i;
|
|
870
|
+
(i = Q.value) === null || i === void 0 || i.focus();
|
|
871
871
|
},
|
|
872
872
|
blur() {
|
|
873
|
-
var
|
|
874
|
-
(
|
|
873
|
+
var i;
|
|
874
|
+
(i = Q.value) === null || i === void 0 || i.blur();
|
|
875
875
|
},
|
|
876
|
-
scrollTo(
|
|
876
|
+
scrollTo(i) {
|
|
877
877
|
var h;
|
|
878
|
-
(h =
|
|
878
|
+
(h = Q.value) === null || h === void 0 || h.scrollTo(i);
|
|
879
879
|
}
|
|
880
880
|
}), () => {
|
|
881
|
-
var
|
|
881
|
+
var i;
|
|
882
882
|
const h = Ie(e, [
|
|
883
883
|
"id",
|
|
884
884
|
"prefixCls",
|
|
@@ -931,7 +931,7 @@ const xa = Ve({
|
|
|
931
931
|
"treeMotion"
|
|
932
932
|
]);
|
|
933
933
|
return U($t, X(X(X({
|
|
934
|
-
ref:
|
|
934
|
+
ref: Q
|
|
935
935
|
}, l), h), {}, {
|
|
936
936
|
id: n,
|
|
937
937
|
prefixCls: e.prefixCls,
|
|
@@ -940,11 +940,11 @@ const xa = Ve({
|
|
|
940
940
|
onDisplayValuesChange: me,
|
|
941
941
|
searchValue: f.value,
|
|
942
942
|
onSearch: w,
|
|
943
|
-
OptionList:
|
|
943
|
+
OptionList: ia,
|
|
944
944
|
emptyOptions: !x.value.length,
|
|
945
945
|
onDropdownVisibleChange: pe,
|
|
946
946
|
tagRender: e.tagRender || a.tagRender,
|
|
947
|
-
dropdownMatchSelectWidth: (
|
|
947
|
+
dropdownMatchSelectWidth: (i = e.dropdownMatchSelectWidth) !== null && i !== void 0 ? i : !0
|
|
948
948
|
}), a);
|
|
949
949
|
};
|
|
950
950
|
}
|
|
@@ -964,7 +964,7 @@ const xa = Ve({
|
|
|
964
964
|
padding: `${e.paddingXS}px ${e.paddingXS / 2}px`
|
|
965
965
|
},
|
|
966
966
|
// ====================== Tree ======================
|
|
967
|
-
qt(l,
|
|
967
|
+
qt(l, it(e, {
|
|
968
968
|
colorBgContainer: t
|
|
969
969
|
})),
|
|
970
970
|
{
|
|
@@ -999,7 +999,7 @@ const xa = Ve({
|
|
|
999
999
|
};
|
|
1000
1000
|
function Ia(e, s) {
|
|
1001
1001
|
return It("TreeSelect", (l) => {
|
|
1002
|
-
const t =
|
|
1002
|
+
const t = it(l, {
|
|
1003
1003
|
treePrefixCls: s.value
|
|
1004
1004
|
});
|
|
1005
1005
|
return [Va(t)];
|
|
@@ -1029,7 +1029,7 @@ const Ue = Ve({
|
|
|
1029
1029
|
},
|
|
1030
1030
|
name: "ATreeSelect",
|
|
1031
1031
|
inheritAttrs: !1,
|
|
1032
|
-
props:
|
|
1032
|
+
props: ut(ka(), {
|
|
1033
1033
|
choiceTransitionName: "",
|
|
1034
1034
|
listHeight: 256,
|
|
1035
1035
|
treeIcon: !1,
|
|
@@ -1045,11 +1045,11 @@ const Ue = Ve({
|
|
|
1045
1045
|
emit: n
|
|
1046
1046
|
} = s;
|
|
1047
1047
|
kt(!(e.treeData === void 0 && t.default)), $e(e.multiple !== !1 || !e.treeCheckable, "TreeSelect", "`multiple` will always be `true` when `treeCheckable` is true"), $e(e.replaceFields === void 0, "TreeSelect", "`replaceFields` is deprecated, please use fieldNames instead"), $e(!e.dropdownClassName, "TreeSelect", "`dropdownClassName` is deprecated. Please use `popupClassName` instead.");
|
|
1048
|
-
const o =
|
|
1048
|
+
const o = Jt(), r = Qt.useInject(), d = y(() => Zt(r.status, e.status)), {
|
|
1049
1049
|
prefixCls: c,
|
|
1050
|
-
renderEmpty:
|
|
1050
|
+
renderEmpty: u,
|
|
1051
1051
|
direction: f,
|
|
1052
|
-
virtual:
|
|
1052
|
+
virtual: p,
|
|
1053
1053
|
dropdownMatchSelectWidth: w,
|
|
1054
1054
|
size: x,
|
|
1055
1055
|
getPopupContainer: S,
|
|
@@ -1082,13 +1082,13 @@ const Ue = Ve({
|
|
|
1082
1082
|
n("update:treeExpandedKeys", C), n("treeExpand", C);
|
|
1083
1083
|
}, ge = (C) => {
|
|
1084
1084
|
n("update:searchValue", C), n("search", C);
|
|
1085
|
-
},
|
|
1085
|
+
}, ue = (C) => {
|
|
1086
1086
|
n("blur", C), o.onFieldBlur();
|
|
1087
1087
|
};
|
|
1088
1088
|
return () => {
|
|
1089
1089
|
var C, _, H;
|
|
1090
1090
|
const {
|
|
1091
|
-
notFoundContent:
|
|
1091
|
+
notFoundContent: J = (C = t.notFoundContent) === null || C === void 0 ? void 0 : C.call(t),
|
|
1092
1092
|
prefixCls: ke,
|
|
1093
1093
|
bordered: Ne,
|
|
1094
1094
|
listHeight: Te,
|
|
@@ -1103,31 +1103,31 @@ const Ue = Ve({
|
|
|
1103
1103
|
placeholder: Fe = (H = t.placeholder) === null || H === void 0 ? void 0 : H.call(t)
|
|
1104
1104
|
} = e, {
|
|
1105
1105
|
isFormItemInput: Oe,
|
|
1106
|
-
hasFeedback:
|
|
1107
|
-
feedbackIcon:
|
|
1106
|
+
hasFeedback: Q,
|
|
1107
|
+
feedbackIcon: i
|
|
1108
1108
|
} = r, {
|
|
1109
1109
|
suffixIcon: h,
|
|
1110
|
-
removeIcon:
|
|
1110
|
+
removeIcon: m,
|
|
1111
1111
|
clearIcon: k
|
|
1112
1112
|
} = Ut(b(b({}, e), {
|
|
1113
1113
|
multiple: ce.value,
|
|
1114
1114
|
showArrow: ne.value,
|
|
1115
|
-
hasFeedback:
|
|
1116
|
-
feedbackIcon:
|
|
1115
|
+
hasFeedback: Q,
|
|
1116
|
+
feedbackIcon: i,
|
|
1117
1117
|
prefixCls: c.value
|
|
1118
1118
|
}), t);
|
|
1119
1119
|
let P;
|
|
1120
|
-
|
|
1120
|
+
J !== void 0 ? P = J : P = u("Select");
|
|
1121
1121
|
const L = Ie(e, ["suffixIcon", "itemIcon", "removeIcon", "clearIcon", "switcherIcon", "bordered", "status", "onUpdate:value", "onUpdate:treeExpandedKeys", "onUpdate:searchValue"]), I = at(!ke && B.value, {
|
|
1122
1122
|
[`${c.value}-lg`]: O.value === "large",
|
|
1123
1123
|
[`${c.value}-sm`]: O.value === "small",
|
|
1124
1124
|
[`${c.value}-rtl`]: f.value === "rtl",
|
|
1125
1125
|
[`${c.value}-borderless`]: !Ne,
|
|
1126
1126
|
[`${c.value}-in-form-item`]: Oe
|
|
1127
|
-
}, ea(c.value, d.value,
|
|
1127
|
+
}, ea(c.value, d.value, Q), K.value, l.class, q.value), N = {};
|
|
1128
1128
|
return e.treeData === void 0 && t.default && (N.children = _t(t.default())), le(re(U(xa, X(X(X(X({}, l), L), {}, {
|
|
1129
1129
|
disabled: V.value,
|
|
1130
|
-
virtual:
|
|
1130
|
+
virtual: p.value,
|
|
1131
1131
|
dropdownMatchSelectWidth: w.value,
|
|
1132
1132
|
id: Ke,
|
|
1133
1133
|
fieldNames: Ae,
|
|
@@ -1139,7 +1139,7 @@ const Ue = Ve({
|
|
|
1139
1139
|
treeLine: !!Ce,
|
|
1140
1140
|
inputIcon: h,
|
|
1141
1141
|
multiple: Ee,
|
|
1142
|
-
removeIcon:
|
|
1142
|
+
removeIcon: m,
|
|
1143
1143
|
clearIcon: k,
|
|
1144
1144
|
switcherIcon: (R) => ta(Y.value, De, R, t.leafIcon, Ce),
|
|
1145
1145
|
showTreeIcon: _e,
|
|
@@ -1149,7 +1149,7 @@ const Ue = Ve({
|
|
|
1149
1149
|
dropdownClassName: se.value,
|
|
1150
1150
|
choiceTransitionName: z.value,
|
|
1151
1151
|
onChange: pe,
|
|
1152
|
-
onBlur:
|
|
1152
|
+
onBlur: ue,
|
|
1153
1153
|
onSearch: ge,
|
|
1154
1154
|
onTreeExpand: me
|
|
1155
1155
|
}, N), {}, {
|
|
@@ -1161,7 +1161,7 @@ const Ue = Ve({
|
|
|
1161
1161
|
}),
|
|
1162
1162
|
maxTagPlaceholder: e.maxTagPlaceholder || t.maxTagPlaceholder,
|
|
1163
1163
|
placement: D.value,
|
|
1164
|
-
showArrow:
|
|
1164
|
+
showArrow: Q || Pe,
|
|
1165
1165
|
placeholder: Fe
|
|
1166
1166
|
}), b(b({}, t), {
|
|
1167
1167
|
treeCheckable: () => U("span", {
|
|
@@ -1174,18 +1174,18 @@ const Ue = Ve({
|
|
|
1174
1174
|
TreeNode: he,
|
|
1175
1175
|
SHOW_ALL: da,
|
|
1176
1176
|
SHOW_PARENT: vt,
|
|
1177
|
-
SHOW_CHILD:
|
|
1177
|
+
SHOW_CHILD: Je,
|
|
1178
1178
|
install: (e) => (e.component(Ue.name, Ue), e.component(st.displayName, st), e)
|
|
1179
1179
|
}), ze = yt({});
|
|
1180
1180
|
function Na(e) {
|
|
1181
|
-
return be(() => e, (s) => {
|
|
1181
|
+
return be(() => e.categoryList, (s) => {
|
|
1182
1182
|
s.forEach(async (l) => {
|
|
1183
1183
|
if (!ze[l.id]) {
|
|
1184
1184
|
const t = await Kt.getCategoryValues(l.id), { flatAttributeValue: a, treeAttributeValue: n, showWay: o } = t.body;
|
|
1185
1185
|
ze[l.id] = o === "TREE" ? n : a;
|
|
1186
1186
|
}
|
|
1187
1187
|
});
|
|
1188
|
-
}, { immediate: !0 }), {
|
|
1188
|
+
}, { immediate: !0, deep: !0 }), {
|
|
1189
1189
|
categoryValuesMap: ze
|
|
1190
1190
|
};
|
|
1191
1191
|
}
|
|
@@ -1206,16 +1206,16 @@ const Ta = { class: "crane-required" }, La = { class: "crane-category-tips" }, E
|
|
|
1206
1206
|
setup(e, { expose: s }) {
|
|
1207
1207
|
const l = ct.SHOW_PARENT, t = e, a = y(() => ({
|
|
1208
1208
|
categoryList: t.categoryList
|
|
1209
|
-
})), n = y(() => Object.values(d).some((
|
|
1209
|
+
})), n = y(() => Object.values(d).some((u) => u.length > 0)), o = fe(), r = fe(""), { categoryValuesMap: d } = Na(t);
|
|
1210
1210
|
return s({
|
|
1211
|
-
validate: () => new Promise((
|
|
1211
|
+
validate: () => new Promise((u, f) => {
|
|
1212
1212
|
o.value.validate().then(() => {
|
|
1213
|
-
|
|
1213
|
+
u(!0);
|
|
1214
1214
|
}).catch(() => {
|
|
1215
1215
|
f(!1);
|
|
1216
1216
|
});
|
|
1217
1217
|
})
|
|
1218
|
-
}), (
|
|
1218
|
+
}), (u, f) => n.value ? (ie(), Ze(W(la), {
|
|
1219
1219
|
key: 0,
|
|
1220
1220
|
class: "crane-category-wraper",
|
|
1221
1221
|
model: a.value,
|
|
@@ -1226,11 +1226,11 @@ const Ta = { class: "crane-required" }, La = { class: "crane-category-tips" }, E
|
|
|
1226
1226
|
Be("div", Ta, ye(W(xe)("category")), 1),
|
|
1227
1227
|
Be("div", La, ye(W(xe)("categotySelectTips")), 1),
|
|
1228
1228
|
f[1] || (f[1] = Be("div", { class: "crane-category-line" }, null, -1)),
|
|
1229
|
-
(
|
|
1229
|
+
(ie(!0), we(bt, null, Ct(a.value.categoryList, (p, w) => {
|
|
1230
1230
|
var x;
|
|
1231
|
-
return St((
|
|
1232
|
-
key:
|
|
1233
|
-
label:
|
|
1231
|
+
return St((ie(), Ze(W(aa), {
|
|
1232
|
+
key: p.id,
|
|
1233
|
+
label: p.categoryName,
|
|
1234
1234
|
name: ["categoryList", w, "attributeValueIds_view"],
|
|
1235
1235
|
rules: [{ required: !0, message: W(xe)("pleaseChoose"), trigger: ["change", "blur"] }]
|
|
1236
1236
|
}, {
|
|
@@ -1240,11 +1240,11 @@ const Ta = { class: "crane-required" }, La = { class: "crane-category-tips" }, E
|
|
|
1240
1240
|
U(W(ct), {
|
|
1241
1241
|
treeCheckable: "",
|
|
1242
1242
|
treeDefaultExpandAll: "",
|
|
1243
|
-
"tree-data": W(d)[
|
|
1243
|
+
"tree-data": W(d)[p.id],
|
|
1244
1244
|
showSearch: "",
|
|
1245
1245
|
allowClear: "",
|
|
1246
|
-
value:
|
|
1247
|
-
"onUpdate:value": (g) =>
|
|
1246
|
+
value: p.attributeValueIds_view,
|
|
1247
|
+
"onUpdate:value": (g) => p.attributeValueIds_view = g,
|
|
1248
1248
|
treeNodeFilterProp: "attributeName",
|
|
1249
1249
|
searchValue: r.value,
|
|
1250
1250
|
"onUpdate:searchValue": f[0] || (f[0] = (g) => r.value = g),
|
|
@@ -1253,23 +1253,23 @@ const Ta = { class: "crane-required" }, La = { class: "crane-category-tips" }, E
|
|
|
1253
1253
|
"show-checked-strategy": W(l)
|
|
1254
1254
|
}, {
|
|
1255
1255
|
title: Me(({ attributeName: g }) => [
|
|
1256
|
-
r.value.toLowerCase() && g.includes(r.value.toLowerCase()) ? (
|
|
1256
|
+
r.value.toLowerCase() && g.includes(r.value.toLowerCase()) ? (ie(), we("span", Ea, ye(g), 1)) : (ie(), we("span", _a, ye(g), 1))
|
|
1257
1257
|
]),
|
|
1258
1258
|
_: 2
|
|
1259
1259
|
}, 1032, ["tree-data", "value", "onUpdate:value", "searchValue", "show-checked-strategy"]),
|
|
1260
|
-
(S =
|
|
1260
|
+
(S = p.attributeValueIds_view) != null && S.includes(-1) ? (ie(), we("span", Pa, ye(W(xe)("categoryChangeTips", { category: p.categoryName })), 1)) : et("", !0)
|
|
1261
1261
|
];
|
|
1262
1262
|
}),
|
|
1263
1263
|
_: 2
|
|
1264
1264
|
}, 1032, ["label", "name", "rules"])), [
|
|
1265
|
-
[wt, (x = W(d)[
|
|
1265
|
+
[wt, (x = W(d)[p.id]) == null ? void 0 : x.length]
|
|
1266
1266
|
]);
|
|
1267
1267
|
}), 128))
|
|
1268
1268
|
]),
|
|
1269
1269
|
_: 1
|
|
1270
1270
|
}, 8, ["model"])) : et("", !0);
|
|
1271
1271
|
}
|
|
1272
|
-
}), Ha = /* @__PURE__ */ Ft(Da, [["__scopeId", "data-v-
|
|
1272
|
+
}), Ha = /* @__PURE__ */ Ft(Da, [["__scopeId", "data-v-1b90e3f1"]]);
|
|
1273
1273
|
export {
|
|
1274
1274
|
Ha as default
|
|
1275
1275
|
};
|