vue3-element-dict 3.2.6 → 3.2.8
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/README.md +6 -0
- package/lib/style.css +1 -1
- package/lib/vue3-element-dict.js +1492 -1450
- package/package.json +1 -1
package/lib/vue3-element-dict.js
CHANGED
|
@@ -12,69 +12,69 @@ const formatDictData = (e, r, d, t) => {
|
|
|
12
12
|
};
|
|
13
13
|
function sortComponentsByIdDependencies(e) {
|
|
14
14
|
const r = (C) => {
|
|
15
|
-
const
|
|
16
|
-
let
|
|
17
|
-
for (; (
|
|
18
|
-
|
|
19
|
-
return Array.from(
|
|
15
|
+
const _ = /* @__PURE__ */ new Set(), l = /\$\{(\w+)\}/g;
|
|
16
|
+
let v;
|
|
17
|
+
for (; (v = l.exec(C)) !== null; )
|
|
18
|
+
_.add(v[1]);
|
|
19
|
+
return Array.from(_);
|
|
20
20
|
}, d = (C) => {
|
|
21
|
-
const
|
|
22
|
-
typeof
|
|
21
|
+
const _ = /* @__PURE__ */ new Set(), l = (v) => {
|
|
22
|
+
typeof v == "string" ? r(v).forEach((b) => _.add(b)) : Array.isArray(v) ? v.forEach(l) : v && typeof v == "object" && Object.values(v).forEach(l);
|
|
23
23
|
};
|
|
24
|
-
return l(C), Array.from(
|
|
24
|
+
return l(C), Array.from(_);
|
|
25
25
|
}, t = (C) => {
|
|
26
|
-
const { showRuleType:
|
|
27
|
-
return l == null ? [] : (
|
|
28
|
-
typeof
|
|
29
|
-
}) : ["compare", "calculate", ""].includes(
|
|
30
|
-
|
|
31
|
-
}), Array.from(
|
|
26
|
+
const { showRuleType: _, showRules: l } = C, v = /* @__PURE__ */ new Set();
|
|
27
|
+
return l == null ? [] : (_ === "validate" ? typeof l == "string" ? v.add(l) : Array.isArray(l) && l.forEach((b) => {
|
|
28
|
+
typeof b == "string" && v.add(b);
|
|
29
|
+
}) : ["compare", "calculate", ""].includes(_) ? d(l).forEach((b) => v.add(b)) : typeof _ == "string" && Array.isArray(l) && l.forEach((b) => {
|
|
30
|
+
b && typeof b == "object" && "rules" in b && d(b.rules).forEach((E) => v.add(E));
|
|
31
|
+
}), Array.from(v));
|
|
32
32
|
}, n = (C) => {
|
|
33
|
-
const { validatorRuleType:
|
|
34
|
-
return l != null && l.rules ? (l.rules.forEach((
|
|
35
|
-
if (!(
|
|
33
|
+
const { validatorRuleType: _, props: l } = C, v = /* @__PURE__ */ new Set();
|
|
34
|
+
return l != null && l.rules ? (l.rules.forEach((b) => {
|
|
35
|
+
if (!(b != null && b.validator))
|
|
36
36
|
return;
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
const E = b.validator;
|
|
38
|
+
E != null && (["compare", "calculate", "", void 0].includes(_) ? d(E).forEach((T) => v.add(T)) : typeof _ == "string" && Array.isArray(E) && E.forEach((T) => {
|
|
39
|
+
T && typeof T == "object" && "rules" in T && d(T.rules).forEach((x) => v.add(x));
|
|
40
40
|
}));
|
|
41
|
-
}), Array.from(
|
|
41
|
+
}), Array.from(v)) : [];
|
|
42
42
|
}, a = /* @__PURE__ */ new Map();
|
|
43
43
|
e.forEach((C) => {
|
|
44
44
|
C.fieldName && C.id && a.set(C.fieldName, C.id);
|
|
45
45
|
});
|
|
46
46
|
const u = e.map((C) => {
|
|
47
|
-
const
|
|
47
|
+
const _ = t(C), l = n(C), b = [.../* @__PURE__ */ new Set([..._, ...l])].map((E) => a.get(E)).filter((E) => E !== void 0 && e.some((T) => T.id === E));
|
|
48
48
|
return {
|
|
49
49
|
id: C.id,
|
|
50
50
|
component: C,
|
|
51
|
-
depsIds:
|
|
51
|
+
depsIds: b
|
|
52
52
|
// 该组件id依赖的其他id数组
|
|
53
53
|
};
|
|
54
54
|
}), o = new Set(u.map((C) => C.id)), i = /* @__PURE__ */ new Map();
|
|
55
|
-
u.forEach(({ id: C },
|
|
56
|
-
i.set(C,
|
|
55
|
+
u.forEach(({ id: C }, _) => {
|
|
56
|
+
i.set(C, _);
|
|
57
57
|
});
|
|
58
58
|
const s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
|
|
59
59
|
o.forEach((C) => {
|
|
60
60
|
s.set(C, []), c.set(C, 0);
|
|
61
|
-
}), u.forEach(({ id: C, depsIds:
|
|
62
|
-
|
|
61
|
+
}), u.forEach(({ id: C, depsIds: _ }) => {
|
|
62
|
+
_.forEach((l) => {
|
|
63
63
|
s.get(l).push(C), c.set(C, c.get(C) + 1);
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
|
-
const
|
|
67
|
-
for (;
|
|
68
|
-
const C =
|
|
69
|
-
w.push(C), s.get(C).forEach((
|
|
70
|
-
if (c.set(
|
|
71
|
-
const l =
|
|
72
|
-
l === -1 ?
|
|
66
|
+
const g = [...o].filter((C) => c.get(C) === 0).sort((C, _) => i.get(C) - i.get(_)), w = [];
|
|
67
|
+
for (; g.length > 0; ) {
|
|
68
|
+
const C = g.shift();
|
|
69
|
+
w.push(C), s.get(C).forEach((_) => {
|
|
70
|
+
if (c.set(_, c.get(_) - 1), c.get(_) === 0) {
|
|
71
|
+
const l = g.findIndex((v) => i.get(v) > i.get(_));
|
|
72
|
+
l === -1 ? g.push(_) : g.splice(l, 0, _);
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
const
|
|
77
|
-
|
|
76
|
+
const y = [...o].filter((C) => !w.includes(C));
|
|
77
|
+
y.sort((C, _) => i.get(C) - i.get(_)), w.push(...y);
|
|
78
78
|
const m = new Map(e.map((C) => [C.id, C]));
|
|
79
79
|
return w.map((C) => m.get(C));
|
|
80
80
|
}
|
|
@@ -218,52 +218,52 @@ const actions = {
|
|
|
218
218
|
formatterRequest: i,
|
|
219
219
|
query: s,
|
|
220
220
|
versionKey: c,
|
|
221
|
-
localDictCodes:
|
|
221
|
+
localDictCodes: g,
|
|
222
222
|
formatterDictList: w,
|
|
223
|
-
formatterDictVersion:
|
|
223
|
+
formatterDictVersion: y,
|
|
224
224
|
isGetAll: m,
|
|
225
225
|
filterDataFun: C,
|
|
226
|
-
disabledDataFun:
|
|
226
|
+
disabledDataFun: _,
|
|
227
227
|
format: l
|
|
228
|
-
} = state.dictConfig,
|
|
229
|
-
u(i(s,
|
|
230
|
-
mutations.REMOVE_IS_GETTING_DICT_TYPES(
|
|
231
|
-
const
|
|
232
|
-
if (
|
|
233
|
-
let
|
|
228
|
+
} = state.dictConfig, v = state.dictCodes || g, b = !t && t !== 0 ? e : state.isGettingDictTypes.join(",");
|
|
229
|
+
u(i(s, b)).then((E) => {
|
|
230
|
+
mutations.REMOVE_IS_GETTING_DICT_TYPES(b);
|
|
231
|
+
const T = y(E), x = n.getItem(c);
|
|
232
|
+
if (T !== x) {
|
|
233
|
+
let j = "";
|
|
234
234
|
if (m)
|
|
235
|
-
|
|
235
|
+
j = "", mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!0);
|
|
236
236
|
else {
|
|
237
237
|
if (o) {
|
|
238
|
-
const A = Object.keys(
|
|
239
|
-
let
|
|
240
|
-
|
|
238
|
+
const A = Object.keys(v), D = o.split(","), S = Object.keys(g), R = A.filter((p) => !S.includes(p)), P = D.filter((p) => S.includes(p) ? (console.warn(`注意:usuallyGetDictTypes配置与本地字典配置的字典类型${p}冲突`), !1) : !0);
|
|
239
|
+
let O = R.concat(P);
|
|
240
|
+
O = O.concat(b.split(",")), j = Array.from(new Set(O)).join(",");
|
|
241
241
|
} else {
|
|
242
|
-
const A = Object.keys(
|
|
243
|
-
let
|
|
244
|
-
|
|
242
|
+
const A = Object.keys(v), D = Object.keys(g);
|
|
243
|
+
let S = A.filter((P) => !D.includes(P));
|
|
244
|
+
S = S.concat(b.split(",")), j = Array.from(new Set(S)).join(",");
|
|
245
245
|
}
|
|
246
|
-
mutations.ADD_IS_GETTING_DICT_TYPES(
|
|
246
|
+
mutations.ADD_IS_GETTING_DICT_TYPES(j);
|
|
247
247
|
}
|
|
248
|
-
u(i(s,
|
|
249
|
-
const
|
|
250
|
-
if (!(
|
|
248
|
+
u(i(s, j)).then((A) => {
|
|
249
|
+
const D = w(A, e);
|
|
250
|
+
if (!(D[e] && D[e].length > 0)) {
|
|
251
251
|
d(`不存在类型为:${e} 的字典字段,请确认后再填写`);
|
|
252
252
|
return;
|
|
253
253
|
}
|
|
254
|
-
mutations.REMOVE_UNFIND_DICT_TYPES(
|
|
255
|
-
const
|
|
256
|
-
n.setItem(a, JSON.stringify(
|
|
254
|
+
mutations.REMOVE_UNFIND_DICT_TYPES(b);
|
|
255
|
+
const S = y(A), R = Object.assign(JSON.parse(JSON.stringify(g)), D), P = formatDictData(R, C, _, l == null ? void 0 : l.disabled);
|
|
256
|
+
n.setItem(a, JSON.stringify(P)), n.setItem(c, S), mutations.SET_DICT_CODES(P), r(state.dictCodes), state.isGettingAllDictTypes ? mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!1) : mutations.REMOVE_IS_GETTING_DICT_TYPES(j);
|
|
257
257
|
});
|
|
258
258
|
} else {
|
|
259
|
-
const
|
|
260
|
-
if (!(
|
|
259
|
+
const j = w(E, e);
|
|
260
|
+
if (!(j[e] && j[e].length > 0)) {
|
|
261
261
|
d(`不存在类型为:${e} 的字典字段,请确认后再填写`);
|
|
262
262
|
return;
|
|
263
263
|
}
|
|
264
|
-
mutations.REMOVE_UNFIND_DICT_TYPES(
|
|
265
|
-
const A = state.dictCodes ||
|
|
266
|
-
Object.assign(A,
|
|
264
|
+
mutations.REMOVE_UNFIND_DICT_TYPES(b);
|
|
265
|
+
const A = state.dictCodes || g, D = formatDictData(j, C, _, l == null ? void 0 : l.disabled);
|
|
266
|
+
Object.assign(A, D), n.setItem(a, JSON.stringify(A)), mutations.SET_DICT_CODES(A), r(state.dictCodes);
|
|
267
267
|
}
|
|
268
268
|
});
|
|
269
269
|
});
|
|
@@ -287,8 +287,8 @@ const actions = {
|
|
|
287
287
|
n(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
288
288
|
return;
|
|
289
289
|
}
|
|
290
|
-
const
|
|
291
|
-
t(
|
|
290
|
+
const g = o.find((w) => w[a.value] === e);
|
|
291
|
+
t(g ? g[a.label] : d ?? "");
|
|
292
292
|
}
|
|
293
293
|
}, 1e3);
|
|
294
294
|
} else
|
|
@@ -331,8 +331,8 @@ const GetLabelByCodes = (e, r, d) => {
|
|
|
331
331
|
let s = [];
|
|
332
332
|
if (!i || !i[r])
|
|
333
333
|
if (store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes) {
|
|
334
|
-
const c = store.state.timeout || 3e4,
|
|
335
|
-
if (Date.now() -
|
|
334
|
+
const c = store.state.timeout || 3e4, g = Date.now(), w = window.setInterval(() => {
|
|
335
|
+
if (Date.now() - g > c) {
|
|
336
336
|
clearInterval(w), a("getLabelByCodes获取字典数据超时");
|
|
337
337
|
return;
|
|
338
338
|
}
|
|
@@ -341,8 +341,8 @@ const GetLabelByCodes = (e, r, d) => {
|
|
|
341
341
|
a(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
342
342
|
return;
|
|
343
343
|
}
|
|
344
|
-
const
|
|
345
|
-
n(
|
|
344
|
+
const y = GetLabelByCodesDothings(u, s, o, t.defaultVal, t.emptyText);
|
|
345
|
+
n(y && y.length > 0 ? t.formatFun(y, o) : t.defaultVal);
|
|
346
346
|
}
|
|
347
347
|
}, 1e3);
|
|
348
348
|
} else
|
|
@@ -351,7 +351,7 @@ const GetLabelByCodes = (e, r, d) => {
|
|
|
351
351
|
a(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
352
352
|
return;
|
|
353
353
|
}
|
|
354
|
-
const
|
|
354
|
+
const g = GetLabelByCodesDothings(
|
|
355
355
|
u,
|
|
356
356
|
s,
|
|
357
357
|
o,
|
|
@@ -359,7 +359,7 @@ const GetLabelByCodes = (e, r, d) => {
|
|
|
359
359
|
t.emptyText
|
|
360
360
|
);
|
|
361
361
|
n(
|
|
362
|
-
|
|
362
|
+
g && g.length > 0 ? t.formatFun(g, o) : t.defaultVal
|
|
363
363
|
);
|
|
364
364
|
});
|
|
365
365
|
else {
|
|
@@ -391,8 +391,8 @@ const GetLabelByCodes = (e, r, d) => {
|
|
|
391
391
|
n(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
392
392
|
return;
|
|
393
393
|
}
|
|
394
|
-
const
|
|
395
|
-
t(
|
|
394
|
+
const g = o.find((w) => w[a.label] === e);
|
|
395
|
+
t(g ? g[a.value] : d ?? "");
|
|
396
396
|
}
|
|
397
397
|
}, 1e3);
|
|
398
398
|
} else
|
|
@@ -434,8 +434,8 @@ const GetCodeByLabels = (e, r, d) => {
|
|
|
434
434
|
let s = [];
|
|
435
435
|
if (!i || !i[r])
|
|
436
436
|
if (store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes) {
|
|
437
|
-
const c = store.state.timeout || 3e4,
|
|
438
|
-
if (Date.now() -
|
|
437
|
+
const c = store.state.timeout || 3e4, g = Date.now(), w = window.setInterval(() => {
|
|
438
|
+
if (Date.now() - g > c) {
|
|
439
439
|
clearInterval(w), a("getCodeByLabels获取字典数据超时");
|
|
440
440
|
return;
|
|
441
441
|
}
|
|
@@ -444,8 +444,8 @@ const GetCodeByLabels = (e, r, d) => {
|
|
|
444
444
|
a(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
445
445
|
return;
|
|
446
446
|
}
|
|
447
|
-
const
|
|
448
|
-
n(
|
|
447
|
+
const y = GetCodeByLabelsDothings(u, s, o, t.defaultVal);
|
|
448
|
+
n(y && y.length > 0 ? t.formatFun(y, o) : t.defaultVal);
|
|
449
449
|
}
|
|
450
450
|
}, 1e3);
|
|
451
451
|
} else
|
|
@@ -454,14 +454,14 @@ const GetCodeByLabels = (e, r, d) => {
|
|
|
454
454
|
a(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
455
455
|
return;
|
|
456
456
|
}
|
|
457
|
-
const
|
|
457
|
+
const g = GetCodeByLabelsDothings(
|
|
458
458
|
u,
|
|
459
459
|
s,
|
|
460
460
|
o,
|
|
461
461
|
t.defaultVal
|
|
462
462
|
);
|
|
463
463
|
n(
|
|
464
|
-
|
|
464
|
+
g && g.length > 0 ? t.formatFun(g, o) : t.defaultVal
|
|
465
465
|
);
|
|
466
466
|
});
|
|
467
467
|
else {
|
|
@@ -493,10 +493,10 @@ const GetCodeByLabels = (e, r, d) => {
|
|
|
493
493
|
clearInterval(s), d("getDictObjByDictTypes获取字典数据超时");
|
|
494
494
|
return;
|
|
495
495
|
}
|
|
496
|
-
if (!store.state.isGettingDictTypes.some((
|
|
496
|
+
if (!store.state.isGettingDictTypes.some((g) => t.includes(g))) {
|
|
497
497
|
clearInterval(s);
|
|
498
|
-
for (let
|
|
499
|
-
const w = u[
|
|
498
|
+
for (let g = 0; g < u.length; g++) {
|
|
499
|
+
const w = u[g];
|
|
500
500
|
store.state.dictCodes[w] ? n[w] = store.state.dictCodes[w] : d(`不存在类型为:${w} 的字典字段,请确认后再填写`);
|
|
501
501
|
}
|
|
502
502
|
r(n);
|
|
@@ -519,8 +519,8 @@ const GetCodeByLabels = (e, r, d) => {
|
|
|
519
519
|
n(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
520
520
|
return;
|
|
521
521
|
}
|
|
522
|
-
const
|
|
523
|
-
t(
|
|
522
|
+
const g = o.find((w) => w[a.value] === e);
|
|
523
|
+
t(g || (d ?? ""));
|
|
524
524
|
}
|
|
525
525
|
}, 1e3);
|
|
526
526
|
} else
|
|
@@ -585,36 +585,36 @@ const GetCodeByLabels = (e, r, d) => {
|
|
|
585
585
|
},
|
|
586
586
|
emits: ["submit", "reset", "action"],
|
|
587
587
|
setup(e, { expose: r, emit: d }) {
|
|
588
|
-
const t = e, { actionType: n, defaultVal: a, emptyText: u, modelValue: o, dictType: i, judgeTypeFun: s, type: c, judgeColorFun:
|
|
589
|
-
let
|
|
588
|
+
const t = e, { actionType: n, defaultVal: a, emptyText: u, modelValue: o, dictType: i, judgeTypeFun: s, type: c, judgeColorFun: g, color: w, judgeDisabledFun: y, disabled: m } = toRefs(t), C = toRaw(store.state.dictConfig), _ = d, l = useAttrs(), v = computed(() => s.value ? s.value(o.value) : c.value ? c.value : T.value && T.value[C.format.type] ? T.value[C.format.type] : "primary"), b = computed(() => g != null && g.value ? g.value(o.value) : w != null && w.value ? w.value : T.value && T.value[C.format.color] ? T.value[C.format.color] : ""), E = computed(() => y.value ? y.value(o.value) : T.value && T.value[C.format.disabled] ? T.value[C.format.disabled] : !!m.value);
|
|
589
|
+
let T = ref(null), x = ref(null);
|
|
590
590
|
watchEffect(() => {
|
|
591
591
|
if (!i.value) {
|
|
592
|
-
|
|
592
|
+
x.value = o.value;
|
|
593
593
|
return;
|
|
594
594
|
}
|
|
595
|
-
GetItemByCode(o.value, i.value).then((
|
|
596
|
-
|
|
595
|
+
GetItemByCode(o.value, i.value).then((S) => {
|
|
596
|
+
S ? (T.value = S, x.value = S[C.format.label]) : (T.value = null, x.value = String(a.value ?? (o.value === 0 ? 0 : o.value || u.value)));
|
|
597
597
|
});
|
|
598
598
|
});
|
|
599
|
-
const
|
|
600
|
-
|
|
599
|
+
const j = () => {
|
|
600
|
+
E.value || _(n.value, l);
|
|
601
601
|
}, A = ref(null);
|
|
602
|
-
return r({ getElButtonRef: () => A.value }), (
|
|
602
|
+
return r({ getElButtonRef: () => A.value }), (S, R) => (openBlock(), createBlock(unref(ElButton), mergeProps({
|
|
603
603
|
ref_key: "ElButtonRef",
|
|
604
604
|
ref: A,
|
|
605
|
-
type:
|
|
606
|
-
color:
|
|
607
|
-
disabled:
|
|
608
|
-
},
|
|
605
|
+
type: v.value,
|
|
606
|
+
color: b.value,
|
|
607
|
+
disabled: E.value
|
|
608
|
+
}, S.$attrs, { onClick: j }), createSlots({
|
|
609
609
|
default: withCtx(() => [
|
|
610
|
-
createTextVNode(toDisplayString(unref(
|
|
610
|
+
createTextVNode(toDisplayString(unref(x)), 1)
|
|
611
611
|
]),
|
|
612
612
|
_: 2
|
|
613
613
|
}, [
|
|
614
|
-
renderList(
|
|
615
|
-
name:
|
|
616
|
-
fn: withCtx((
|
|
617
|
-
renderSlot(
|
|
614
|
+
renderList(S.$slots, (P, O, $) => ({
|
|
615
|
+
name: O,
|
|
616
|
+
fn: withCtx((p) => [
|
|
617
|
+
renderSlot(S.$slots, O, mergeProps({ key: $ }, p))
|
|
618
618
|
])
|
|
619
619
|
}))
|
|
620
620
|
]), 1040, ["type", "color", "disabled"]));
|
|
@@ -753,62 +753,62 @@ function CheckConditionsByOperation(e, r) {
|
|
|
753
753
|
return d;
|
|
754
754
|
}
|
|
755
755
|
function ValidateNestedRule(e, r) {
|
|
756
|
-
var
|
|
756
|
+
var g, w;
|
|
757
757
|
const d = {
|
|
758
|
-
"+": (
|
|
759
|
-
"-": (
|
|
760
|
-
"*": (
|
|
761
|
-
"/": (
|
|
762
|
-
"%": (
|
|
763
|
-
"**": (
|
|
758
|
+
"+": (y, m) => y + m,
|
|
759
|
+
"-": (y, m) => y - m,
|
|
760
|
+
"*": (y, m) => y * m,
|
|
761
|
+
"/": (y, m) => m !== 0 ? y / m : NaN,
|
|
762
|
+
"%": (y, m) => m !== 0 ? y % m : NaN,
|
|
763
|
+
"**": (y, m) => y ** m
|
|
764
764
|
}, t = {
|
|
765
|
-
">": (
|
|
766
|
-
"<": (
|
|
767
|
-
">=": (
|
|
768
|
-
"<=": (
|
|
769
|
-
"==": (
|
|
770
|
-
"!=": (
|
|
771
|
-
"===": (
|
|
772
|
-
"!==": (
|
|
773
|
-
}, n = (
|
|
774
|
-
const C = (
|
|
775
|
-
if (
|
|
776
|
-
return
|
|
777
|
-
if (typeof
|
|
778
|
-
const
|
|
779
|
-
if (!isNaN(
|
|
780
|
-
return
|
|
765
|
+
">": (y, m) => y > m,
|
|
766
|
+
"<": (y, m) => y < m,
|
|
767
|
+
">=": (y, m) => y >= m,
|
|
768
|
+
"<=": (y, m) => y <= m,
|
|
769
|
+
"==": (y, m) => y == m,
|
|
770
|
+
"!=": (y, m) => y != m,
|
|
771
|
+
"===": (y, m) => y === m,
|
|
772
|
+
"!==": (y, m) => y !== m
|
|
773
|
+
}, n = (y, m) => {
|
|
774
|
+
const C = (_) => {
|
|
775
|
+
if (_ instanceof Date)
|
|
776
|
+
return _.getTime();
|
|
777
|
+
if (typeof _ == "string" && /^\d{4}[-/]\d{2}[-/]\d{2}(?:\s+\d{2}:\d{2}:\d{2})?$/.test(_)) {
|
|
778
|
+
const v = new Date(_);
|
|
779
|
+
if (!isNaN(v.getTime()))
|
|
780
|
+
return v.getTime();
|
|
781
781
|
}
|
|
782
|
-
return
|
|
782
|
+
return _;
|
|
783
783
|
};
|
|
784
|
-
if (typeof
|
|
785
|
-
const l =
|
|
786
|
-
let
|
|
787
|
-
if (
|
|
784
|
+
if (typeof y == "string" && /^\$\{(.+?)\}$/.test(y)) {
|
|
785
|
+
const l = y.match(/^\$\{(.+?)\}$/)[1].trim().split(".").filter(Boolean);
|
|
786
|
+
let v = getNestedValue(m, l);
|
|
787
|
+
if (v == null)
|
|
788
788
|
return "";
|
|
789
|
-
if (
|
|
790
|
-
const
|
|
791
|
-
return /^-?\d+(\.\d+)?$/.test(
|
|
789
|
+
if (v = C(v), typeof v == "string") {
|
|
790
|
+
const b = v.trim();
|
|
791
|
+
return /^-?\d+(\.\d+)?$/.test(b) ? Number(b) : b;
|
|
792
792
|
}
|
|
793
|
-
return
|
|
793
|
+
return v;
|
|
794
794
|
}
|
|
795
|
-
return typeof
|
|
796
|
-
}, a = (
|
|
795
|
+
return typeof y == "string" && /^-?\d+(\.\d+)?$/.test(y) ? Number(y) : y;
|
|
796
|
+
}, a = (y, m) => {
|
|
797
797
|
var C;
|
|
798
|
-
if (Array.isArray(
|
|
799
|
-
let
|
|
800
|
-
for (let l = 1; l <
|
|
801
|
-
const
|
|
802
|
-
|
|
798
|
+
if (Array.isArray(y)) {
|
|
799
|
+
let _ = Array.isArray(y[0]) ? a(y[0], m) : n(y[0], m);
|
|
800
|
+
for (let l = 1; l < y.length; l += 2) {
|
|
801
|
+
const v = y[l], b = y[l + 1], E = Array.isArray(b) ? a(b, m) : n(b, m), T = typeof _ == "number" ? _ : NaN, x = typeof E == "number" ? E : NaN;
|
|
802
|
+
_ = ((C = d[v]) == null ? void 0 : C.call(d, T, x)) ?? NaN;
|
|
803
803
|
}
|
|
804
|
-
return
|
|
804
|
+
return _;
|
|
805
805
|
}
|
|
806
|
-
return n(
|
|
806
|
+
return n(y, m);
|
|
807
807
|
};
|
|
808
808
|
if (!Array.isArray(e) || e.length < 3)
|
|
809
809
|
return !1;
|
|
810
810
|
const u = e[e.length - 2], o = e[e.length - 1], i = e.slice(0, e.length - 2), s = a(i, r), c = a(o, r);
|
|
811
|
-
return typeof s != "number" || typeof c != "number" ? ((
|
|
811
|
+
return typeof s != "number" || typeof c != "number" ? ((g = t[u]) == null ? void 0 : g.call(t, s, c)) ?? !1 : isNaN(s) || isNaN(c) ? !1 : ((w = t[u]) == null ? void 0 : w.call(t, s, c)) ?? !1;
|
|
812
812
|
}
|
|
813
813
|
function CalculateLogicalResult(conditions, expression) {
|
|
814
814
|
if (!Array.isArray(conditions))
|
|
@@ -927,41 +927,41 @@ const _hoisted_1$1 = ["innerHTML"], _sfc_main$m = /* @__PURE__ */ Object.assign(
|
|
|
927
927
|
setup(e) {
|
|
928
928
|
const r = e, d = ref(null), t = ref(""), n = (s, c) => {
|
|
929
929
|
try {
|
|
930
|
-
const
|
|
931
|
-
return new Function(w, `return (${s});`)(...
|
|
930
|
+
const g = Object.keys(c), w = g.join(", ");
|
|
931
|
+
return new Function(w, `return (${s});`)(...g.map((m) => c[m]));
|
|
932
932
|
} catch {
|
|
933
933
|
return "";
|
|
934
934
|
}
|
|
935
|
-
}, a = (s) => typeof s == "string" ? s : Array.isArray(s) ? s.map((c) => a(c)).filter(Boolean).join(" ") : typeof s == "object" && s !== null ? Object.entries(s).filter(([c,
|
|
936
|
-
const w = new DOMParser().parseFromString(s, "text/html"),
|
|
937
|
-
return Array.from(
|
|
935
|
+
}, a = (s) => typeof s == "string" ? s : Array.isArray(s) ? s.map((c) => a(c)).filter(Boolean).join(" ") : typeof s == "object" && s !== null ? Object.entries(s).filter(([c, g]) => !!g).map(([c]) => c).join(" ") : "", u = (s, c) => {
|
|
936
|
+
const w = new DOMParser().parseFromString(s, "text/html"), y = w.getElementsByTagName("*");
|
|
937
|
+
return Array.from(y).forEach((m) => {
|
|
938
938
|
Array.from(m.attributes).forEach((C) => {
|
|
939
|
-
let
|
|
939
|
+
let _;
|
|
940
940
|
if (C.name.startsWith(":"))
|
|
941
|
-
|
|
941
|
+
_ = C.name.slice(1);
|
|
942
942
|
else if (C.name.startsWith("v-bind:"))
|
|
943
|
-
|
|
943
|
+
_ = C.name.slice(7);
|
|
944
944
|
else
|
|
945
945
|
return;
|
|
946
946
|
const l = C.value;
|
|
947
|
-
let
|
|
947
|
+
let v;
|
|
948
948
|
try {
|
|
949
|
-
|
|
950
|
-
} catch (
|
|
951
|
-
console.error(`v-bind表达式错误: ${l}`,
|
|
949
|
+
v = n(l, c);
|
|
950
|
+
} catch (b) {
|
|
951
|
+
console.error(`v-bind表达式错误: ${l}`, b), v = "";
|
|
952
952
|
}
|
|
953
|
-
if (
|
|
954
|
-
m.removeAttribute(
|
|
953
|
+
if (v == null)
|
|
954
|
+
m.removeAttribute(_);
|
|
955
955
|
else {
|
|
956
|
-
const
|
|
957
|
-
m.setAttribute(
|
|
956
|
+
const b = _ === "class" ? a(v) : String(v);
|
|
957
|
+
m.setAttribute(_, b);
|
|
958
958
|
}
|
|
959
959
|
m.removeAttribute(C.name);
|
|
960
960
|
});
|
|
961
961
|
}), w.body.innerHTML;
|
|
962
|
-
}, o = (s, c) => s.replace(/\{\{\s*([\s\S]+?)\s*\}\}/g, (
|
|
963
|
-
const
|
|
964
|
-
return u(
|
|
962
|
+
}, o = (s, c) => s.replace(/\{\{\s*([\s\S]+?)\s*\}\}/g, (g, w) => n(w, c)), i = (s, c) => {
|
|
963
|
+
const g = o(s, c);
|
|
964
|
+
return u(g, c);
|
|
965
965
|
};
|
|
966
966
|
return watch(
|
|
967
967
|
() => [r.render, r.scope, r.formData],
|
|
@@ -1023,129 +1023,129 @@ const _hoisted_1$1 = ["innerHTML"], _sfc_main$m = /* @__PURE__ */ Object.assign(
|
|
|
1023
1023
|
},
|
|
1024
1024
|
emits: ["submit", "reset", "action"],
|
|
1025
1025
|
setup(e, { expose: r, emit: d }) {
|
|
1026
|
-
const t = d, n = e, { defaultVal: a, emptyText: u, dictType: o, disabledObj: i, filterDataFun: s, disabledDataFun: c, list:
|
|
1027
|
-
let
|
|
1026
|
+
const t = d, n = e, { defaultVal: a, emptyText: u, dictType: o, disabledObj: i, filterDataFun: s, disabledDataFun: c, list: g, col: w, gap: y } = toRefs(n), m = toRaw(store.state.dictConfig), C = useAttrs();
|
|
1027
|
+
let _ = ref("");
|
|
1028
1028
|
const l = computed(() => {
|
|
1029
|
-
const
|
|
1030
|
-
return Object.entries(C).forEach(([
|
|
1031
|
-
const
|
|
1032
|
-
if (
|
|
1033
|
-
const
|
|
1034
|
-
|
|
1029
|
+
const O = {};
|
|
1030
|
+
return Object.entries(C).forEach(([$, p]) => {
|
|
1031
|
+
const f = ToKebabCase($);
|
|
1032
|
+
if (f.startsWith("button-") || f.startsWith("on-button")) {
|
|
1033
|
+
const k = ToCamelCase(f.replace("button-", ""));
|
|
1034
|
+
O[k] = p;
|
|
1035
1035
|
}
|
|
1036
|
-
}),
|
|
1037
|
-
}),
|
|
1038
|
-
const
|
|
1039
|
-
return `calc(${
|
|
1040
|
-
}),
|
|
1041
|
-
const
|
|
1042
|
-
return `${
|
|
1036
|
+
}), O;
|
|
1037
|
+
}), v = computed(() => {
|
|
1038
|
+
const O = Number(w.value), $ = 100 / O, p = Array.isArray(y.value) ? y.value : String(y.value).split(" "), f = p[0], B = (p[1] || f) * (O - 1) / O;
|
|
1039
|
+
return `calc(${$}% - ${B}px) !important`;
|
|
1040
|
+
}), b = computed(() => {
|
|
1041
|
+
const O = Array.isArray(y.value) ? y.value : String(y.value).split(" "), $ = O[0], p = O[1] || $;
|
|
1042
|
+
return `${$}px ${p}px`;
|
|
1043
1043
|
});
|
|
1044
|
-
function
|
|
1044
|
+
function E(O) {
|
|
1045
1045
|
return {
|
|
1046
1046
|
...l.value,
|
|
1047
|
-
...
|
|
1047
|
+
...O
|
|
1048
1048
|
};
|
|
1049
1049
|
}
|
|
1050
|
-
const
|
|
1050
|
+
const T = ref([]), x = async () => {
|
|
1051
1051
|
if (!o.value)
|
|
1052
1052
|
return;
|
|
1053
|
-
let
|
|
1053
|
+
let O = [];
|
|
1054
1054
|
if (typeof o.value == "object") {
|
|
1055
|
-
|
|
1056
|
-
const
|
|
1057
|
-
|
|
1058
|
-
const { filters:
|
|
1059
|
-
|
|
1055
|
+
_.value = o.value.type;
|
|
1056
|
+
const $ = await store.actions.getDictDataObj(_.value);
|
|
1057
|
+
O = [].concat($[_.value]);
|
|
1058
|
+
const { filters: p, filterType: f = m.format.value, reverse: k = !1 } = o.value, B = typeof p == "string" ? p.split(",") : p;
|
|
1059
|
+
k ? O = O.filter((F) => !B.includes(F[f])) : O = O.filter((F) => B.includes(F[f]));
|
|
1060
1060
|
} else {
|
|
1061
|
-
|
|
1062
|
-
const
|
|
1063
|
-
|
|
1061
|
+
_.value = o.value;
|
|
1062
|
+
const $ = await store.actions.getDictDataObj(_.value);
|
|
1063
|
+
O = [].concat($[_.value]);
|
|
1064
1064
|
}
|
|
1065
|
-
if (s.value && (
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
[m.format.disabled]: c.value(
|
|
1065
|
+
if (s.value && (O = s.value(O)), c.value)
|
|
1066
|
+
O = O.map(($) => ({
|
|
1067
|
+
...$,
|
|
1068
|
+
[m.format.disabled]: c.value($)
|
|
1069
1069
|
}));
|
|
1070
1070
|
else if (i.value) {
|
|
1071
|
-
const { disabledValues:
|
|
1072
|
-
|
|
1073
|
-
const
|
|
1074
|
-
return
|
|
1075
|
-
}) :
|
|
1076
|
-
const
|
|
1077
|
-
return
|
|
1071
|
+
const { disabledValues: $, disabledType: p = m.format.value, reverse: f = !1 } = i.value, k = typeof $ == "string" ? $.split(",") : $;
|
|
1072
|
+
f ? O = O.map((B) => {
|
|
1073
|
+
const F = JSON.parse(JSON.stringify(B));
|
|
1074
|
+
return F[m.format.disabled] = !k.includes(F[p]) || F[m.format.disabled], F;
|
|
1075
|
+
}) : O = O.map((B) => {
|
|
1076
|
+
const F = JSON.parse(JSON.stringify(B));
|
|
1077
|
+
return F[m.format.disabled] = k.includes(F[p]) || F[m.format.disabled], F;
|
|
1078
1078
|
});
|
|
1079
1079
|
}
|
|
1080
|
-
|
|
1081
|
-
type:
|
|
1082
|
-
label:
|
|
1083
|
-
color:
|
|
1084
|
-
icon:
|
|
1085
|
-
disabled:
|
|
1080
|
+
T.value = O.map(($) => ({
|
|
1081
|
+
type: $[m.format.type],
|
|
1082
|
+
label: $[m.format.label],
|
|
1083
|
+
color: $[m.format.color],
|
|
1084
|
+
icon: $[m.format.icon],
|
|
1085
|
+
disabled: $[m.format.disabled],
|
|
1086
1086
|
actionType: "submit",
|
|
1087
|
-
|
|
1087
|
+
...$
|
|
1088
1088
|
}));
|
|
1089
1089
|
};
|
|
1090
|
-
async function
|
|
1090
|
+
async function j() {
|
|
1091
1091
|
if (o.value) {
|
|
1092
|
-
|
|
1092
|
+
x();
|
|
1093
1093
|
return;
|
|
1094
1094
|
}
|
|
1095
|
-
let
|
|
1096
|
-
for (let
|
|
1097
|
-
const
|
|
1098
|
-
if (
|
|
1099
|
-
const
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
),
|
|
1095
|
+
let O = [];
|
|
1096
|
+
for (let $ = 0; $ < g.value.length; $++) {
|
|
1097
|
+
const p = g.value[$];
|
|
1098
|
+
if (p.dictType) {
|
|
1099
|
+
const f = await GetItemByCode(p.modelValue, p.dictType);
|
|
1100
|
+
p.type = p.type || f[m.format.type] || "", p.label = String(
|
|
1101
|
+
p.label || (f ? f[m.format.label] : (p.defaultVal || a.value) ?? (p.modelValue === 0 ? 0 : p.modelValue || p.emptyText || u.value))
|
|
1102
|
+
), p.color = p.color || f[m.format.color] || "", p.icon = p.icon || f[m.format.icon] || "", p.disabled = p.disabled ?? (f[m.format.disabled] || !1);
|
|
1103
1103
|
}
|
|
1104
|
-
|
|
1104
|
+
O.push(p);
|
|
1105
1105
|
}
|
|
1106
|
-
|
|
1106
|
+
T.value = O;
|
|
1107
1107
|
}
|
|
1108
1108
|
onMounted(() => {
|
|
1109
|
-
|
|
1109
|
+
j();
|
|
1110
1110
|
}), watch(
|
|
1111
1111
|
() => n.list,
|
|
1112
1112
|
() => {
|
|
1113
|
-
|
|
1113
|
+
j();
|
|
1114
1114
|
},
|
|
1115
1115
|
{ deep: !0 }
|
|
1116
1116
|
// 深层监听数组/对象变化
|
|
1117
1117
|
);
|
|
1118
|
-
const A = (
|
|
1119
|
-
|
|
1120
|
-
},
|
|
1121
|
-
return r({ getElButtonsRef:
|
|
1118
|
+
const A = (O) => {
|
|
1119
|
+
O.disabled || (O.actionType === "submit" ? t("submit", O) : O.actionType === "reset" ? t("reset", O) : O.actionType === "action" && t("action", O));
|
|
1120
|
+
}, D = ref(null), S = () => D.value, R = ref([]);
|
|
1121
|
+
return r({ getElButtonsRef: S, getElButtonRefs: () => R.value }), (O, $) => (openBlock(), createElementBlock("div", {
|
|
1122
1122
|
ref_key: "ElButtonsRef",
|
|
1123
|
-
ref:
|
|
1124
|
-
class: normalizeClass(["el-buttons-dict",
|
|
1125
|
-
id:
|
|
1126
|
-
style: normalizeStyle({ ...
|
|
1123
|
+
ref: D,
|
|
1124
|
+
class: normalizeClass(["el-buttons-dict", O.$attrs.class]),
|
|
1125
|
+
id: O.$attrs.id,
|
|
1126
|
+
style: normalizeStyle({ ...O.$attrs.style, gap: b.value })
|
|
1127
1127
|
}, [
|
|
1128
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
1128
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(T.value, (p, f) => (openBlock(), createBlock(unref(ElButton), mergeProps({
|
|
1129
1129
|
ref_for: !0,
|
|
1130
|
-
ref: (
|
|
1131
|
-
|
|
1130
|
+
ref: (k) => {
|
|
1131
|
+
k && (R.value[f] = k);
|
|
1132
1132
|
},
|
|
1133
|
-
key:
|
|
1134
|
-
style: { width:
|
|
1135
|
-
onClick: (
|
|
1136
|
-
},
|
|
1133
|
+
key: f,
|
|
1134
|
+
style: { width: v.value, margin: "0 !important" },
|
|
1135
|
+
onClick: (k) => A(p)
|
|
1136
|
+
}, E(p)), createSlots({
|
|
1137
1137
|
default: withCtx(() => [
|
|
1138
|
-
createTextVNode(toDisplayString(
|
|
1138
|
+
createTextVNode(toDisplayString(p.label || p.modelValue), 1)
|
|
1139
1139
|
]),
|
|
1140
1140
|
_: 2
|
|
1141
1141
|
}, [
|
|
1142
|
-
renderList(
|
|
1143
|
-
name:
|
|
1144
|
-
fn: withCtx((
|
|
1142
|
+
renderList(p.slotList, (k, B) => ({
|
|
1143
|
+
name: k.slotName,
|
|
1144
|
+
fn: withCtx((F) => [
|
|
1145
1145
|
(openBlock(), createBlock(_sfc_main$m, {
|
|
1146
|
-
key:
|
|
1147
|
-
render:
|
|
1148
|
-
scope:
|
|
1146
|
+
key: B,
|
|
1147
|
+
render: k.render,
|
|
1148
|
+
scope: F
|
|
1149
1149
|
}, null, 8, ["render", "scope"]))
|
|
1150
1150
|
])
|
|
1151
1151
|
}))
|
|
@@ -1252,7 +1252,7 @@ const __vite_glob_0_1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1252
1252
|
},
|
|
1253
1253
|
emits: ["dictChange"],
|
|
1254
1254
|
setup(e, { expose: r, emit: d }) {
|
|
1255
|
-
const t = useAttrs(), n = e, { maxLevel: a, dictType: u, disabledObj: o, filterDataFun: i, disabledDataFun: s } = toRefs(n), c = ref(""),
|
|
1255
|
+
const t = useAttrs(), n = e, { maxLevel: a, dictType: u, disabledObj: o, filterDataFun: i, disabledDataFun: s } = toRefs(n), c = ref(""), g = toRaw(store.state.dictConfig), w = d, y = (A) => {
|
|
1256
1256
|
w("dictChange", A);
|
|
1257
1257
|
}, m = reactive({
|
|
1258
1258
|
list: []
|
|
@@ -1262,89 +1262,89 @@ const __vite_glob_0_1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1262
1262
|
let A = [];
|
|
1263
1263
|
if (typeof u.value == "object") {
|
|
1264
1264
|
c.value = u.value.type;
|
|
1265
|
-
const
|
|
1266
|
-
A = [].concat(
|
|
1267
|
-
const { filters:
|
|
1268
|
-
|
|
1265
|
+
const D = await store.actions.getDictDataObj(c.value);
|
|
1266
|
+
A = [].concat(D[c.value]);
|
|
1267
|
+
const { filters: S, filterType: R = g.format.value, reverse: P = !1 } = u.value, O = typeof S == "string" ? S.split(",") : S;
|
|
1268
|
+
P ? A = A.filter(($) => !O.includes($[R])) : A = A.filter(($) => O.includes($[R]));
|
|
1269
1269
|
} else {
|
|
1270
1270
|
c.value = u.value;
|
|
1271
|
-
const
|
|
1272
|
-
A = [].concat(
|
|
1271
|
+
const D = await store.actions.getDictDataObj(c.value);
|
|
1272
|
+
A = [].concat(D[c.value]);
|
|
1273
1273
|
}
|
|
1274
1274
|
if (i.value && (A = i.value(A)), s.value)
|
|
1275
|
-
A = A.map((
|
|
1276
|
-
...
|
|
1277
|
-
[
|
|
1275
|
+
A = A.map((D) => ({
|
|
1276
|
+
...D,
|
|
1277
|
+
[g.format.disabled]: s.value(D)
|
|
1278
1278
|
}));
|
|
1279
1279
|
else if (o.value) {
|
|
1280
|
-
const { disabledValues:
|
|
1281
|
-
|
|
1282
|
-
const
|
|
1283
|
-
return
|
|
1284
|
-
}) : A = A.map((
|
|
1285
|
-
const
|
|
1286
|
-
return
|
|
1280
|
+
const { disabledValues: D, disabledType: S = g.treeSetting.valueField, reverse: R = !1 } = o.value, P = typeof D == "string" ? D.split(",") : D;
|
|
1281
|
+
R ? A = A.map((O) => {
|
|
1282
|
+
const $ = JSON.parse(JSON.stringify(O));
|
|
1283
|
+
return $[g.format.disabled] = !P.includes($[S]) || $[g.format.disabled], $;
|
|
1284
|
+
}) : A = A.map((O) => {
|
|
1285
|
+
const $ = JSON.parse(JSON.stringify(O));
|
|
1286
|
+
return $[g.format.disabled] = P.includes($[S]) || $[g.format.disabled], $;
|
|
1287
1287
|
});
|
|
1288
1288
|
}
|
|
1289
1289
|
m.list = A;
|
|
1290
|
-
},
|
|
1291
|
-
const A = store.state.dictConfig.treeSetting,
|
|
1290
|
+
}, _ = computed(() => store.state.isGettingDictTypes.includes(c.value)), l = computed(() => store.state.isGettingAllDictTypes), v = computed(() => {
|
|
1291
|
+
const A = store.state.dictConfig.treeSetting, D = store.state.dictConfig.format, S = t.props ?? {};
|
|
1292
1292
|
return {
|
|
1293
|
-
disabled: (
|
|
1294
|
-
label: (
|
|
1295
|
-
value: (
|
|
1296
|
-
children: (
|
|
1297
|
-
leaf: (
|
|
1293
|
+
disabled: (S == null ? void 0 : S.disabled) ?? D.disabled,
|
|
1294
|
+
label: (S == null ? void 0 : S.label) ?? A.labelField,
|
|
1295
|
+
value: (S == null ? void 0 : S.value) ?? A.valueField,
|
|
1296
|
+
children: (S == null ? void 0 : S.children) ?? A.childrenField,
|
|
1297
|
+
leaf: (S == null ? void 0 : S.leaf) ?? A.leafField
|
|
1298
1298
|
};
|
|
1299
|
-
}),
|
|
1300
|
-
const A = JSON.parse(JSON.stringify(
|
|
1301
|
-
...
|
|
1302
|
-
valueField:
|
|
1303
|
-
labelField:
|
|
1304
|
-
childrenField:
|
|
1305
|
-
leafField:
|
|
1306
|
-
disabled:
|
|
1299
|
+
}), b = computed(() => {
|
|
1300
|
+
const A = JSON.parse(JSON.stringify(g.treeSetting)), D = t.props || {}, S = {
|
|
1301
|
+
...D,
|
|
1302
|
+
valueField: D != null && D.value ? D.value : A.valueField,
|
|
1303
|
+
labelField: D != null && D.label ? D.label : A.labelField,
|
|
1304
|
+
childrenField: D != null && D.children ? D.children : A.childrenField,
|
|
1305
|
+
leafField: D != null && D.leaf ? D.leaf : A.leafField,
|
|
1306
|
+
disabled: D != null && D.disabled ? D.disabled : g.format.disabled
|
|
1307
1307
|
};
|
|
1308
|
-
return Object.assign(A,
|
|
1309
|
-
}),
|
|
1310
|
-
for (let
|
|
1311
|
-
const
|
|
1312
|
-
if (
|
|
1313
|
-
delete
|
|
1308
|
+
return Object.assign(A, S);
|
|
1309
|
+
}), E = (A, D) => {
|
|
1310
|
+
for (let S = 0; S < A.length; S++) {
|
|
1311
|
+
const R = A[S];
|
|
1312
|
+
if (R[b.value.levelField] === D) {
|
|
1313
|
+
delete R[b.value.childrenField], R[b.value.leafField] = !0;
|
|
1314
1314
|
continue;
|
|
1315
1315
|
} else {
|
|
1316
|
-
const
|
|
1317
|
-
|
|
1316
|
+
const O = R[b.value.childrenField];
|
|
1317
|
+
E(O, D);
|
|
1318
1318
|
}
|
|
1319
1319
|
}
|
|
1320
|
-
},
|
|
1320
|
+
}, T = computed(() => {
|
|
1321
1321
|
if (m.list.length === 0)
|
|
1322
1322
|
return [];
|
|
1323
1323
|
const A = JSON.parse(JSON.stringify(m.list));
|
|
1324
|
-
let
|
|
1325
|
-
return a.value &&
|
|
1324
|
+
let D = ListToTree(A, b.value);
|
|
1325
|
+
return a.value && E(D, +a.value), D || [];
|
|
1326
1326
|
});
|
|
1327
1327
|
watch(
|
|
1328
|
-
[
|
|
1329
|
-
([A,
|
|
1330
|
-
!A && !
|
|
1328
|
+
[_, l],
|
|
1329
|
+
([A, D]) => {
|
|
1330
|
+
!A && !D && C();
|
|
1331
1331
|
},
|
|
1332
1332
|
{
|
|
1333
1333
|
immediate: !0
|
|
1334
1334
|
}
|
|
1335
1335
|
);
|
|
1336
|
-
const
|
|
1337
|
-
return r({ getElCascaderRef: () =>
|
|
1336
|
+
const x = ref(null);
|
|
1337
|
+
return r({ getElCascaderRef: () => x.value }), (A, D) => (openBlock(), createBlock(unref(ElCascader), mergeProps({
|
|
1338
1338
|
ref_key: "ElCascaderRef",
|
|
1339
|
-
ref:
|
|
1340
|
-
options:
|
|
1341
|
-
props:
|
|
1342
|
-
onChange:
|
|
1339
|
+
ref: x,
|
|
1340
|
+
options: T.value,
|
|
1341
|
+
props: v.value,
|
|
1342
|
+
onChange: y
|
|
1343
1343
|
}, A.$attrs, { "popper-options": { modifiers: [{ name: "computeStyles", options: { adaptive: !1 } }] } }), createSlots({ _: 2 }, [
|
|
1344
|
-
renderList(A.$slots, (
|
|
1345
|
-
name:
|
|
1346
|
-
fn: withCtx((
|
|
1347
|
-
renderSlot(A.$slots,
|
|
1344
|
+
renderList(A.$slots, (S, R, P) => ({
|
|
1345
|
+
name: R,
|
|
1346
|
+
fn: withCtx((O) => [
|
|
1347
|
+
renderSlot(A.$slots, R, mergeProps({ key: P }, O))
|
|
1348
1348
|
])
|
|
1349
1349
|
}))
|
|
1350
1350
|
]), 1040, ["options", "props"]));
|
|
@@ -1401,35 +1401,35 @@ const __vite_glob_0_2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1401
1401
|
}
|
|
1402
1402
|
},
|
|
1403
1403
|
setup(e, { expose: r }) {
|
|
1404
|
-
const d = e, { modelValue: t, dictType: n, judgeTypeFun: a, type: u, judgeColorFun: o, color: i, judgeDisabledFun: s, disabled: c, defaultVal:
|
|
1405
|
-
let l = ref(null),
|
|
1404
|
+
const d = e, { modelValue: t, dictType: n, judgeTypeFun: a, type: u, judgeColorFun: o, color: i, judgeDisabledFun: s, disabled: c, defaultVal: g, emptyText: w } = toRefs(d), y = toRaw(store.state.dictConfig), m = computed(() => a.value ? a.value(t.value) : u.value ? u.value : l.value && l.value[y.format.type] ? l.value[y.format.type] : "primary"), C = computed(() => o.value ? o.value(t.value) : i.value ? i.value : l.value && l.value[y.format.color] ? l.value[y.format.color] : ""), _ = computed(() => s.value ? s.value(t.value) : l.value && l.value[y.format.disabled] ? l.value[y.format.disabled] : !!c.value);
|
|
1405
|
+
let l = ref(null), v = ref(null);
|
|
1406
1406
|
watchEffect(() => {
|
|
1407
1407
|
if (!n.value) {
|
|
1408
|
-
|
|
1408
|
+
v.value = t.value;
|
|
1409
1409
|
return;
|
|
1410
1410
|
}
|
|
1411
|
-
GetItemByCode(t.value, n.value).then((
|
|
1412
|
-
|
|
1411
|
+
GetItemByCode(t.value, n.value).then((T) => {
|
|
1412
|
+
T ? (l.value = T, v.value = T[y.format.label]) : (l.value = null, v.value = String(g.value ?? (t.value === 0 ? 0 : t.value || w.value)));
|
|
1413
1413
|
});
|
|
1414
1414
|
});
|
|
1415
|
-
const
|
|
1416
|
-
return r({ getElCheckTagRef: () =>
|
|
1415
|
+
const b = ref(null);
|
|
1416
|
+
return r({ getElCheckTagRef: () => b.value }), (T, x) => (openBlock(), createBlock(unref(ElCheckTag), mergeProps({
|
|
1417
1417
|
class: "el-check-tag-dict",
|
|
1418
1418
|
ref_key: "ElCheckTagRef",
|
|
1419
|
-
ref:
|
|
1419
|
+
ref: b,
|
|
1420
1420
|
type: m.value,
|
|
1421
1421
|
color: C.value,
|
|
1422
|
-
disabled:
|
|
1423
|
-
},
|
|
1422
|
+
disabled: _.value
|
|
1423
|
+
}, T.$attrs), createSlots({
|
|
1424
1424
|
default: withCtx(() => [
|
|
1425
|
-
createTextVNode(toDisplayString(unref(
|
|
1425
|
+
createTextVNode(toDisplayString(unref(v)), 1)
|
|
1426
1426
|
]),
|
|
1427
1427
|
_: 2
|
|
1428
1428
|
}, [
|
|
1429
|
-
renderList(
|
|
1429
|
+
renderList(T.$slots, (j, A, D) => ({
|
|
1430
1430
|
name: A,
|
|
1431
|
-
fn: withCtx((
|
|
1432
|
-
renderSlot(
|
|
1431
|
+
fn: withCtx((S) => [
|
|
1432
|
+
renderSlot(T.$slots, A, mergeProps({ key: D }, S))
|
|
1433
1433
|
])
|
|
1434
1434
|
}))
|
|
1435
1435
|
]), 1040, ["type", "color", "disabled"]));
|
|
@@ -1486,47 +1486,47 @@ const __vite_glob_0_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1486
1486
|
},
|
|
1487
1487
|
emits: ["dictChange", "change", "update:modelValue"],
|
|
1488
1488
|
setup(e, { expose: r, emit: d }) {
|
|
1489
|
-
const t = e, { modelValue: n, options: a, fieldNames: u, dictType: o, disabledObj: i, keyValue: s, filterDataFun: c, disabledDataFun:
|
|
1490
|
-
C("change",
|
|
1491
|
-
const
|
|
1492
|
-
for (let
|
|
1493
|
-
const
|
|
1494
|
-
if (n.value.includes(
|
|
1495
|
-
if (
|
|
1496
|
-
|
|
1489
|
+
const t = e, { modelValue: n, options: a, fieldNames: u, dictType: o, disabledObj: i, keyValue: s, filterDataFun: c, disabledDataFun: g } = toRefs(t), w = ref([]), y = ref(""), m = toRaw(store.state.dictConfig), C = d, _ = (D, S) => {
|
|
1490
|
+
C("change", D);
|
|
1491
|
+
const R = [];
|
|
1492
|
+
for (let P = 0; P < v.value.length; P++) {
|
|
1493
|
+
const O = v.value[P];
|
|
1494
|
+
if (n.value.includes(O[m.format.value]) && R.push(O), P === S)
|
|
1495
|
+
if (D && !n.value.includes(O[m.format.value]))
|
|
1496
|
+
R.push(O);
|
|
1497
1497
|
else {
|
|
1498
|
-
const
|
|
1499
|
-
|
|
1498
|
+
const $ = R.indexOf(O);
|
|
1499
|
+
R.splice($, 1);
|
|
1500
1500
|
}
|
|
1501
1501
|
}
|
|
1502
1502
|
if (C(
|
|
1503
1503
|
"update:modelValue",
|
|
1504
|
-
|
|
1504
|
+
R.map((P) => P[m.format.value])
|
|
1505
1505
|
), s.value) {
|
|
1506
|
-
C("dictChange",
|
|
1506
|
+
C("dictChange", R);
|
|
1507
1507
|
return;
|
|
1508
1508
|
}
|
|
1509
1509
|
C(
|
|
1510
1510
|
"dictChange",
|
|
1511
|
-
|
|
1511
|
+
R.map((P) => P[m.format.value])
|
|
1512
1512
|
);
|
|
1513
1513
|
}, l = reactive({
|
|
1514
1514
|
list: []
|
|
1515
|
-
}),
|
|
1516
|
-
label:
|
|
1517
|
-
value:
|
|
1518
|
-
disabled: !!
|
|
1519
|
-
...
|
|
1515
|
+
}), v = computed(() => l.list.map((D) => ({
|
|
1516
|
+
label: D[m.format.label],
|
|
1517
|
+
value: D[m.format.value],
|
|
1518
|
+
disabled: !!D[m.format.disabled],
|
|
1519
|
+
...D
|
|
1520
1520
|
})));
|
|
1521
1521
|
watch(
|
|
1522
|
-
[() =>
|
|
1523
|
-
([
|
|
1524
|
-
const
|
|
1525
|
-
for (let
|
|
1526
|
-
const
|
|
1527
|
-
|
|
1522
|
+
[() => v.value, () => t.modelValue],
|
|
1523
|
+
([D, S]) => {
|
|
1524
|
+
const R = [];
|
|
1525
|
+
for (let P = 0; P < D.length; P++) {
|
|
1526
|
+
const O = D[P];
|
|
1527
|
+
S.includes(O[m.format.value]) ? R.push(!0) : R.push(!1);
|
|
1528
1528
|
}
|
|
1529
|
-
w.value =
|
|
1529
|
+
w.value = R;
|
|
1530
1530
|
},
|
|
1531
1531
|
{
|
|
1532
1532
|
deep: !0,
|
|
@@ -1534,76 +1534,76 @@ const __vite_glob_0_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1534
1534
|
}
|
|
1535
1535
|
// 数组/对象必须加 deep!
|
|
1536
1536
|
);
|
|
1537
|
-
const
|
|
1537
|
+
const b = async () => {
|
|
1538
1538
|
if (!o.value || a.value && a.value.length > 0)
|
|
1539
1539
|
return;
|
|
1540
|
-
let
|
|
1540
|
+
let D = [];
|
|
1541
1541
|
if (typeof o.value == "object") {
|
|
1542
|
-
|
|
1543
|
-
const
|
|
1544
|
-
|
|
1545
|
-
const { filters:
|
|
1546
|
-
|
|
1542
|
+
y.value = o.value.type;
|
|
1543
|
+
const S = await store.actions.getDictDataObj(y.value);
|
|
1544
|
+
D = [].concat(S[y.value]);
|
|
1545
|
+
const { filters: R, filterType: P = m.format.value, reverse: O = !1 } = o.value, $ = typeof R == "string" ? R.split(",") : R;
|
|
1546
|
+
O ? D = D.filter((p) => !$.includes(p[P])) : D = D.filter((p) => $.includes(p[P]));
|
|
1547
1547
|
} else {
|
|
1548
|
-
|
|
1549
|
-
const
|
|
1550
|
-
|
|
1548
|
+
y.value = o.value;
|
|
1549
|
+
const S = await store.actions.getDictDataObj(y.value);
|
|
1550
|
+
D = [].concat(S[y.value]);
|
|
1551
1551
|
}
|
|
1552
|
-
if (c.value && (
|
|
1553
|
-
|
|
1554
|
-
...
|
|
1555
|
-
[m.format.disabled]:
|
|
1552
|
+
if (c.value && (D = c.value(D)), g.value)
|
|
1553
|
+
D = D.map((S) => ({
|
|
1554
|
+
...S,
|
|
1555
|
+
[m.format.disabled]: g.value(S)
|
|
1556
1556
|
}));
|
|
1557
1557
|
else if (i.value) {
|
|
1558
|
-
const { disabledValues:
|
|
1559
|
-
|
|
1560
|
-
const
|
|
1561
|
-
return
|
|
1562
|
-
}) :
|
|
1563
|
-
const
|
|
1564
|
-
return
|
|
1558
|
+
const { disabledValues: S, disabledType: R = m.format.value, reverse: P = !1 } = i.value, O = typeof S == "string" ? S.split(",") : S;
|
|
1559
|
+
P ? D = D.map(($) => {
|
|
1560
|
+
const p = JSON.parse(JSON.stringify($));
|
|
1561
|
+
return p[m.format.disabled] = !O.includes(p[R]) || p[m.format.disabled], p;
|
|
1562
|
+
}) : D = D.map(($) => {
|
|
1563
|
+
const p = JSON.parse(JSON.stringify($));
|
|
1564
|
+
return p[m.format.disabled] = O.includes(p[R]) || p[m.format.disabled], p;
|
|
1565
1565
|
});
|
|
1566
1566
|
}
|
|
1567
|
-
l.list =
|
|
1568
|
-
},
|
|
1567
|
+
l.list = D;
|
|
1568
|
+
}, E = computed(() => store.state.isGettingDictTypes.includes(y.value)), T = computed(() => store.state.isGettingAllDictTypes), x = computed(() => a.value);
|
|
1569
1569
|
watch(
|
|
1570
|
-
[
|
|
1571
|
-
([
|
|
1572
|
-
!
|
|
1573
|
-
[m.format.value]:
|
|
1574
|
-
[m.format.label]:
|
|
1575
|
-
[m.format.disabled]: !!
|
|
1576
|
-
...
|
|
1577
|
-
})) : l.list = l.list.map((
|
|
1578
|
-
[m.format.value]:
|
|
1579
|
-
[m.format.label]:
|
|
1570
|
+
[E, T, x],
|
|
1571
|
+
([D, S, R]) => {
|
|
1572
|
+
!D && !S && R && R.length === 0 && b(), R.length > 0 && (l.list = JSON.parse(JSON.stringify(R)), l.list.length > 0 && (Object.prototype.toString.call(l.list[0]) === "[object Object]" ? l.list = l.list.map((O) => ({
|
|
1573
|
+
[m.format.value]: O[u.value.value],
|
|
1574
|
+
[m.format.label]: O[u.value.label],
|
|
1575
|
+
[m.format.disabled]: !!O[u.value.disabled],
|
|
1576
|
+
...O
|
|
1577
|
+
})) : l.list = l.list.map((O) => ({
|
|
1578
|
+
[m.format.value]: O,
|
|
1579
|
+
[m.format.label]: O
|
|
1580
1580
|
}))));
|
|
1581
1581
|
},
|
|
1582
1582
|
{
|
|
1583
1583
|
immediate: !0
|
|
1584
1584
|
}
|
|
1585
1585
|
);
|
|
1586
|
-
const
|
|
1587
|
-
return r({ getElCheckAbleTagRefs: () =>
|
|
1586
|
+
const j = ref([]);
|
|
1587
|
+
return r({ getElCheckAbleTagRefs: () => j.value }), (D, S) => (openBlock(!0), createElementBlock(Fragment, null, renderList(v.value, (R, P) => (openBlock(), createBlock(unref(ElCheckTag), mergeProps({
|
|
1588
1588
|
ref_for: !0,
|
|
1589
|
-
ref: (
|
|
1590
|
-
|
|
1589
|
+
ref: (O) => {
|
|
1590
|
+
O && (j.value[P] = O);
|
|
1591
1591
|
},
|
|
1592
|
-
checked: w.value[
|
|
1593
|
-
},
|
|
1594
|
-
onChange: (
|
|
1595
|
-
key:
|
|
1596
|
-
type:
|
|
1592
|
+
checked: w.value[P]
|
|
1593
|
+
}, D.$attrs, {
|
|
1594
|
+
onChange: (O) => _(O, P),
|
|
1595
|
+
key: P,
|
|
1596
|
+
type: R[unref(m).format.type]
|
|
1597
1597
|
}), createSlots({
|
|
1598
1598
|
default: withCtx(() => [
|
|
1599
|
-
createTextVNode(" " + toDisplayString(
|
|
1599
|
+
createTextVNode(" " + toDisplayString(R[unref(m).format.label]), 1)
|
|
1600
1600
|
]),
|
|
1601
1601
|
_: 2
|
|
1602
1602
|
}, [
|
|
1603
|
-
renderList(
|
|
1604
|
-
name:
|
|
1605
|
-
fn: withCtx((
|
|
1606
|
-
renderSlot(
|
|
1603
|
+
renderList(D.$slots, (O, $, p) => ({
|
|
1604
|
+
name: $,
|
|
1605
|
+
fn: withCtx((f) => [
|
|
1606
|
+
renderSlot(D.$slots, $, normalizeProps(guardReactiveProps(f)), void 0, !0)
|
|
1607
1607
|
])
|
|
1608
1608
|
}))
|
|
1609
1609
|
]), 1040, ["checked", "onChange", "type"]))), 128));
|
|
@@ -1660,110 +1660,110 @@ const __vite_glob_0_4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1660
1660
|
},
|
|
1661
1661
|
emits: ["dictChange"],
|
|
1662
1662
|
setup(e, { expose: r, emit: d }) {
|
|
1663
|
-
const t = e, { disabled: n, data: a, format: u, dictType: o, disabledObj: i, keyValue: s, filterDataFun: c, disabledDataFun:
|
|
1664
|
-
const
|
|
1665
|
-
return Object.entries(w).forEach(([
|
|
1666
|
-
const
|
|
1667
|
-
if (!
|
|
1668
|
-
const
|
|
1669
|
-
|
|
1663
|
+
const t = e, { disabled: n, data: a, format: u, dictType: o, disabledObj: i, keyValue: s, filterDataFun: c, disabledDataFun: g } = toRefs(t), w = useAttrs(), y = computed(() => {
|
|
1664
|
+
const p = {};
|
|
1665
|
+
return Object.entries(w).forEach(([f, k]) => {
|
|
1666
|
+
const B = ToKebabCase(f);
|
|
1667
|
+
if (!B.startsWith("checkbox-button-") && !B.startsWith("on-checkbox-button-")) {
|
|
1668
|
+
const F = ToCamelCase(B);
|
|
1669
|
+
p[F] = k;
|
|
1670
1670
|
}
|
|
1671
|
-
}),
|
|
1671
|
+
}), p;
|
|
1672
1672
|
}), m = computed(() => {
|
|
1673
|
-
const
|
|
1674
|
-
return Object.entries(w).forEach(([
|
|
1675
|
-
const
|
|
1676
|
-
if (
|
|
1677
|
-
const
|
|
1678
|
-
|
|
1673
|
+
const p = {};
|
|
1674
|
+
return Object.entries(w).forEach(([f, k]) => {
|
|
1675
|
+
const B = ToKebabCase(f);
|
|
1676
|
+
if (B.startsWith("checkbox-button-") || B.startsWith("on-checkbox-button-")) {
|
|
1677
|
+
const F = ToCamelCase(B.replace("checkbox-button-", ""));
|
|
1678
|
+
p[F] = k;
|
|
1679
1679
|
}
|
|
1680
|
-
}),
|
|
1681
|
-
}), C = ref(""),
|
|
1680
|
+
}), p;
|
|
1681
|
+
}), C = ref(""), _ = toRaw(store.state.dictConfig), l = d, v = (p) => {
|
|
1682
1682
|
if (!s.value) {
|
|
1683
|
-
l("dictChange",
|
|
1683
|
+
l("dictChange", p);
|
|
1684
1684
|
return;
|
|
1685
1685
|
}
|
|
1686
|
-
const
|
|
1687
|
-
l("dictChange",
|
|
1688
|
-
},
|
|
1686
|
+
const f = b.list.filter((k) => p.includes(k[_.format.value]));
|
|
1687
|
+
l("dictChange", f);
|
|
1688
|
+
}, b = reactive({
|
|
1689
1689
|
list: []
|
|
1690
|
-
}),
|
|
1690
|
+
}), E = async () => {
|
|
1691
1691
|
if (!o.value || a.value && a.value.length > 0)
|
|
1692
1692
|
return;
|
|
1693
|
-
let
|
|
1693
|
+
let p = [];
|
|
1694
1694
|
if (typeof o.value == "object") {
|
|
1695
1695
|
C.value = o.value.type;
|
|
1696
|
-
const
|
|
1697
|
-
|
|
1698
|
-
const { filters:
|
|
1699
|
-
|
|
1696
|
+
const f = await store.actions.getDictDataObj(C.value);
|
|
1697
|
+
p = [].concat(f[C.value]);
|
|
1698
|
+
const { filters: k, filterType: B = _.format.value, reverse: F = !1 } = o.value, V = typeof k == "string" ? k.split(",") : k;
|
|
1699
|
+
F ? p = p.filter((J) => !V.includes(J[B])) : p = p.filter((J) => V.includes(J[B]));
|
|
1700
1700
|
} else {
|
|
1701
1701
|
C.value = o.value;
|
|
1702
|
-
const
|
|
1703
|
-
|
|
1702
|
+
const f = await store.actions.getDictDataObj(C.value);
|
|
1703
|
+
p = [].concat(f[C.value]);
|
|
1704
1704
|
}
|
|
1705
|
-
if (c.value && (
|
|
1706
|
-
|
|
1707
|
-
...
|
|
1708
|
-
[
|
|
1705
|
+
if (c.value && (p = c.value(p)), g.value)
|
|
1706
|
+
p = p.map((f) => ({
|
|
1707
|
+
...f,
|
|
1708
|
+
[_.format.disabled]: g.value(f)
|
|
1709
1709
|
}));
|
|
1710
1710
|
else if (i.value) {
|
|
1711
|
-
const { disabledValues:
|
|
1712
|
-
|
|
1713
|
-
const
|
|
1714
|
-
return
|
|
1715
|
-
}) :
|
|
1716
|
-
const
|
|
1717
|
-
return
|
|
1711
|
+
const { disabledValues: f, disabledType: k = _.format.value, reverse: B = !1 } = i.value, F = typeof f == "string" ? f.split(",") : f;
|
|
1712
|
+
B ? p = p.map((V) => {
|
|
1713
|
+
const J = JSON.parse(JSON.stringify(V));
|
|
1714
|
+
return J[_.format.disabled] = !F.includes(J[k]) || J[_.format.disabled], J;
|
|
1715
|
+
}) : p = p.map((V) => {
|
|
1716
|
+
const J = JSON.parse(JSON.stringify(V));
|
|
1717
|
+
return J[_.format.disabled] = F.includes(J[k]) || J[_.format.disabled], J;
|
|
1718
1718
|
});
|
|
1719
1719
|
}
|
|
1720
|
-
|
|
1721
|
-
},
|
|
1720
|
+
b.list = p;
|
|
1721
|
+
}, T = computed(() => store.state.isGettingDictTypes.includes(C.value)), x = computed(() => store.state.isGettingAllDictTypes), j = computed(() => a.value), A = inject(formItemContextKey), D = inject(formContextKey), S = computed(() => n.value || w["checkbox-button-disabled"] === "" || w["checkbox-button-disabled"] || w.checkboxButtonDisabled === "" || w.checkboxButtonDisabled || w.CheckboxButtonDisabled === "" || w.CheckboxButtonDisabled || (A == null ? void 0 : A.disabled) || (D == null ? void 0 : D.disabled) || !1);
|
|
1722
1722
|
watch(
|
|
1723
|
-
[
|
|
1724
|
-
([
|
|
1725
|
-
!
|
|
1726
|
-
[
|
|
1727
|
-
[
|
|
1728
|
-
[
|
|
1729
|
-
...
|
|
1730
|
-
})) :
|
|
1731
|
-
[
|
|
1732
|
-
[
|
|
1723
|
+
[T, x, j],
|
|
1724
|
+
([p, f, k]) => {
|
|
1725
|
+
!p && !f && k && k.length === 0 && E(), k.length > 0 && (b.list = JSON.parse(JSON.stringify(k)), b.list.length > 0 && (Object.prototype.toString.call(b.list[0]) === "[object Object]" ? b.list = b.list.map((F) => ({
|
|
1726
|
+
[_.format.value]: F[u.value.value],
|
|
1727
|
+
[_.format.label]: F[u.value.label],
|
|
1728
|
+
[_.format.disabled]: !!F[u.value.disabled],
|
|
1729
|
+
...F
|
|
1730
|
+
})) : b.list = b.list.map((F) => ({
|
|
1731
|
+
[_.format.value]: F,
|
|
1732
|
+
[_.format.label]: F
|
|
1733
1733
|
}))));
|
|
1734
1734
|
},
|
|
1735
1735
|
{
|
|
1736
1736
|
immediate: !0
|
|
1737
1737
|
}
|
|
1738
1738
|
);
|
|
1739
|
-
const
|
|
1740
|
-
return r({ getElCheckboxGroupRef:
|
|
1739
|
+
const R = ref(null), P = () => R.value, O = ref([]);
|
|
1740
|
+
return r({ getElCheckboxGroupRef: P, getElCheckboxButtonRefs: () => O.value }), (p, f) => (openBlock(), createBlock(unref(ElCheckboxGroup), mergeProps({
|
|
1741
1741
|
ref_key: "ElCheckboxGroupRef",
|
|
1742
|
-
ref:
|
|
1743
|
-
disabled:
|
|
1744
|
-
},
|
|
1742
|
+
ref: R,
|
|
1743
|
+
disabled: S.value
|
|
1744
|
+
}, y.value, { onChange: v }), createSlots({
|
|
1745
1745
|
default: withCtx(() => [
|
|
1746
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
1746
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(b.list, (k, B) => (openBlock(), createBlock(unref(ElCheckboxButton), mergeProps({
|
|
1747
1747
|
ref_for: !0,
|
|
1748
|
-
ref: (
|
|
1749
|
-
|
|
1748
|
+
ref: (F) => {
|
|
1749
|
+
F && (O.value[B] = F);
|
|
1750
1750
|
},
|
|
1751
|
-
key:
|
|
1752
|
-
disabled:
|
|
1753
|
-
label:
|
|
1751
|
+
key: k[unref(_).format.value],
|
|
1752
|
+
disabled: S.value || k[unref(_).format.disabled],
|
|
1753
|
+
label: k[unref(_).format.value]
|
|
1754
1754
|
}, m.value), {
|
|
1755
1755
|
default: withCtx(() => [
|
|
1756
|
-
createTextVNode(toDisplayString(
|
|
1756
|
+
createTextVNode(toDisplayString(k[unref(_).format.label]), 1)
|
|
1757
1757
|
]),
|
|
1758
1758
|
_: 2
|
|
1759
1759
|
}, 1040, ["disabled", "label"]))), 128))
|
|
1760
1760
|
]),
|
|
1761
1761
|
_: 2
|
|
1762
1762
|
}, [
|
|
1763
|
-
renderList(
|
|
1764
|
-
name:
|
|
1765
|
-
fn: withCtx((
|
|
1766
|
-
renderSlot(
|
|
1763
|
+
renderList(p.$slots, (k, B, F) => ({
|
|
1764
|
+
name: B,
|
|
1765
|
+
fn: withCtx((V) => [
|
|
1766
|
+
renderSlot(p.$slots, B, mergeProps({ key: F }, V))
|
|
1767
1767
|
])
|
|
1768
1768
|
}))
|
|
1769
1769
|
]), 1040, ["disabled"]));
|
|
@@ -1826,80 +1826,80 @@ const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1826
1826
|
},
|
|
1827
1827
|
emits: ["dictChange", "update:modelValue", "change"],
|
|
1828
1828
|
setup(e, { expose: r, emit: d }) {
|
|
1829
|
-
const t = e, { disabled: n, modelValue: a, addAllText: u, data: o, format: i, dictType: s, disabledObj: c, keyValue:
|
|
1830
|
-
const
|
|
1831
|
-
return Object.entries(m).forEach(([K,
|
|
1829
|
+
const t = e, { disabled: n, modelValue: a, addAllText: u, data: o, format: i, dictType: s, disabledObj: c, keyValue: g, filterDataFun: w, disabledDataFun: y } = toRefs(t), m = useAttrs(), C = ref(!1), _ = ref(!1), l = ref([]), v = computed(() => {
|
|
1830
|
+
const G = {};
|
|
1831
|
+
return Object.entries(m).forEach(([K, I]) => {
|
|
1832
1832
|
const M = ToKebabCase(K);
|
|
1833
1833
|
if (!M.startsWith("checkbox-") && !M.startsWith("on-checkbox-")) {
|
|
1834
1834
|
const W = ToCamelCase(M);
|
|
1835
|
-
|
|
1835
|
+
G[W] = I;
|
|
1836
1836
|
}
|
|
1837
|
-
}),
|
|
1838
|
-
}),
|
|
1839
|
-
const
|
|
1840
|
-
return Object.entries(m).forEach(([K,
|
|
1837
|
+
}), G;
|
|
1838
|
+
}), b = computed(() => {
|
|
1839
|
+
const G = {};
|
|
1840
|
+
return Object.entries(m).forEach(([K, I]) => {
|
|
1841
1841
|
const M = ToKebabCase(K);
|
|
1842
1842
|
if (M.startsWith("checkbox-") || M.startsWith("on-checkbox-")) {
|
|
1843
1843
|
const W = ToCamelCase(M.replace("checkbox-", ""));
|
|
1844
|
-
|
|
1844
|
+
G[W] = I;
|
|
1845
1845
|
}
|
|
1846
|
-
}),
|
|
1847
|
-
}),
|
|
1848
|
-
const K =
|
|
1849
|
-
|
|
1850
|
-
},
|
|
1851
|
-
if (A(
|
|
1852
|
-
|
|
1846
|
+
}), G;
|
|
1847
|
+
}), E = ref(""), T = toRaw(store.state.dictConfig), x = d, j = computed(() => S.list.filter((G) => !G[T.format.disabled])), A = (G) => {
|
|
1848
|
+
const K = G.length, I = j.value.length;
|
|
1849
|
+
_.value = K === I, C.value = K > 0 && K < I;
|
|
1850
|
+
}, D = (G) => {
|
|
1851
|
+
if (A(G), !g.value) {
|
|
1852
|
+
x("dictChange", G);
|
|
1853
1853
|
return;
|
|
1854
1854
|
}
|
|
1855
|
-
const K =
|
|
1856
|
-
|
|
1857
|
-
},
|
|
1855
|
+
const K = S.list.filter((I) => G.includes(I[T.format.value]));
|
|
1856
|
+
x("dictChange", K);
|
|
1857
|
+
}, S = reactive({
|
|
1858
1858
|
list: []
|
|
1859
1859
|
});
|
|
1860
1860
|
watch(
|
|
1861
|
-
() =>
|
|
1861
|
+
() => j.value,
|
|
1862
1862
|
() => {
|
|
1863
1863
|
A(a.value);
|
|
1864
1864
|
}
|
|
1865
1865
|
);
|
|
1866
|
-
const
|
|
1866
|
+
const R = async () => {
|
|
1867
1867
|
if (!s.value || o.value && o.value.length > 0)
|
|
1868
1868
|
return;
|
|
1869
|
-
let
|
|
1869
|
+
let G = [];
|
|
1870
1870
|
if (typeof s.value == "object") {
|
|
1871
|
-
|
|
1872
|
-
const K = await store.actions.getDictDataObj(
|
|
1873
|
-
|
|
1874
|
-
const { filters:
|
|
1875
|
-
W ?
|
|
1871
|
+
E.value = s.value.type;
|
|
1872
|
+
const K = await store.actions.getDictDataObj(E.value);
|
|
1873
|
+
G = [].concat(K[E.value]);
|
|
1874
|
+
const { filters: I, filterType: M = T.format.value, reverse: W = !1 } = s.value, z = typeof I == "string" ? I.split(",") : I;
|
|
1875
|
+
W ? G = G.filter((N) => !z.includes(N[M])) : G = G.filter((N) => z.includes(N[M]));
|
|
1876
1876
|
} else {
|
|
1877
|
-
|
|
1878
|
-
const K = await store.actions.getDictDataObj(
|
|
1879
|
-
|
|
1877
|
+
E.value = s.value;
|
|
1878
|
+
const K = await store.actions.getDictDataObj(E.value);
|
|
1879
|
+
G = [].concat(K[E.value]);
|
|
1880
1880
|
}
|
|
1881
|
-
if (w.value && (
|
|
1882
|
-
|
|
1881
|
+
if (w.value && (G = w.value(G)), y.value)
|
|
1882
|
+
G = G.map((K) => ({
|
|
1883
1883
|
...K,
|
|
1884
|
-
[
|
|
1884
|
+
[T.format.disabled]: y.value(K)
|
|
1885
1885
|
}));
|
|
1886
1886
|
else if (c.value) {
|
|
1887
|
-
const { disabledValues: K, disabledType:
|
|
1888
|
-
M ?
|
|
1889
|
-
const
|
|
1890
|
-
return
|
|
1891
|
-
}) :
|
|
1892
|
-
const
|
|
1893
|
-
return
|
|
1887
|
+
const { disabledValues: K, disabledType: I = T.format.value, reverse: M = !1 } = c.value, W = typeof K == "string" ? K.split(",") : K;
|
|
1888
|
+
M ? G = G.map((z) => {
|
|
1889
|
+
const N = JSON.parse(JSON.stringify(z));
|
|
1890
|
+
return N[T.format.disabled] = !W.includes(N[I]) || N[T.format.disabled], N;
|
|
1891
|
+
}) : G = G.map((z) => {
|
|
1892
|
+
const N = JSON.parse(JSON.stringify(z));
|
|
1893
|
+
return N[T.format.disabled] = W.includes(N[I]) || N[T.format.disabled], N;
|
|
1894
1894
|
});
|
|
1895
1895
|
}
|
|
1896
|
-
|
|
1897
|
-
},
|
|
1896
|
+
S.list = G;
|
|
1897
|
+
}, P = computed(() => store.state.isGettingDictTypes.includes(E.value)), O = computed(() => store.state.isGettingAllDictTypes), $ = computed(() => o.value), p = inject(formItemContextKey), f = inject(formContextKey), k = computed(() => n.value || m["checkbox-disabled"] === "" || m["checkbox-disabled"] || m.checkboxDisabled === "" || m.checkboxDisabled || m.CheckboxDisabled === "" || m.CheckboxDisabled || (p == null ? void 0 : p.disabled) || (f == null ? void 0 : f.disabled) || !1);
|
|
1898
1898
|
watch(
|
|
1899
1899
|
() => t.modelValue,
|
|
1900
1900
|
// 正确监听方式
|
|
1901
|
-
(
|
|
1902
|
-
l.value =
|
|
1901
|
+
(G) => {
|
|
1902
|
+
l.value = G;
|
|
1903
1903
|
},
|
|
1904
1904
|
{
|
|
1905
1905
|
deep: !0,
|
|
@@ -1908,42 +1908,42 @@ const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1908
1908
|
// 数组/对象必须加 deep!
|
|
1909
1909
|
), watch(
|
|
1910
1910
|
() => l.value,
|
|
1911
|
-
(
|
|
1912
|
-
|
|
1911
|
+
(G) => {
|
|
1912
|
+
x("update:modelValue", G), x("change", G);
|
|
1913
1913
|
}
|
|
1914
1914
|
), watch(
|
|
1915
|
-
[
|
|
1916
|
-
([
|
|
1917
|
-
!
|
|
1918
|
-
[
|
|
1919
|
-
[
|
|
1920
|
-
[
|
|
1915
|
+
[P, O, $],
|
|
1916
|
+
([G, K, I]) => {
|
|
1917
|
+
!G && !K && I && I.length === 0 && R(), I.length > 0 && (S.list = JSON.parse(JSON.stringify(I)), S.list.length > 0 && (Object.prototype.toString.call(S.list[0]) === "[object Object]" ? S.list = S.list.map((W) => ({
|
|
1918
|
+
[T.format.value]: W[i.value.value],
|
|
1919
|
+
[T.format.label]: W[i.value.label],
|
|
1920
|
+
[T.format.disabled]: !!W[i.value.disabled],
|
|
1921
1921
|
...W
|
|
1922
|
-
})) :
|
|
1923
|
-
[
|
|
1924
|
-
[
|
|
1922
|
+
})) : S.list = S.list.map((W) => ({
|
|
1923
|
+
[T.format.value]: W,
|
|
1924
|
+
[T.format.label]: W
|
|
1925
1925
|
}))));
|
|
1926
1926
|
},
|
|
1927
1927
|
{
|
|
1928
1928
|
immediate: !0
|
|
1929
1929
|
}
|
|
1930
1930
|
);
|
|
1931
|
-
const
|
|
1932
|
-
if (C.value = !1,
|
|
1933
|
-
const K =
|
|
1934
|
-
|
|
1931
|
+
const B = (G) => {
|
|
1932
|
+
if (C.value = !1, G) {
|
|
1933
|
+
const K = j.value.map((I) => I[T.format.value]);
|
|
1934
|
+
D(K);
|
|
1935
1935
|
} else
|
|
1936
|
-
|
|
1937
|
-
},
|
|
1938
|
-
return r({ getElCheckboxGroupRef:
|
|
1939
|
-
unref(u) && !
|
|
1936
|
+
D([]);
|
|
1937
|
+
}, F = ref(null), V = () => F.value, J = ref([]);
|
|
1938
|
+
return r({ getElCheckboxGroupRef: V, getElCheckboxRefs: () => J.value }), (G, K) => (openBlock(), createElementBlock(Fragment, null, [
|
|
1939
|
+
unref(u) && !k.value ? (openBlock(), createBlock(unref(ElCheckbox), {
|
|
1940
1940
|
key: 0,
|
|
1941
1941
|
class: "check-all",
|
|
1942
|
-
disabled:
|
|
1942
|
+
disabled: k.value,
|
|
1943
1943
|
indeterminate: C.value,
|
|
1944
|
-
modelValue:
|
|
1945
|
-
"onUpdate:modelValue": K[0] || (K[0] = (
|
|
1946
|
-
onChange:
|
|
1944
|
+
modelValue: _.value,
|
|
1945
|
+
"onUpdate:modelValue": K[0] || (K[0] = (I) => _.value = I),
|
|
1946
|
+
onChange: B
|
|
1947
1947
|
}, {
|
|
1948
1948
|
default: withCtx(() => [
|
|
1949
1949
|
createTextVNode(toDisplayString(unref(u)), 1)
|
|
@@ -1952,33 +1952,33 @@ const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1952
1952
|
}, 8, ["disabled", "indeterminate", "modelValue"])) : createCommentVNode("", !0),
|
|
1953
1953
|
createVNode(unref(ElCheckboxGroup), mergeProps({
|
|
1954
1954
|
ref_key: "ElCheckboxGroupRef",
|
|
1955
|
-
ref:
|
|
1956
|
-
disabled:
|
|
1955
|
+
ref: F,
|
|
1956
|
+
disabled: k.value,
|
|
1957
1957
|
modelValue: l.value,
|
|
1958
|
-
"onUpdate:modelValue": K[1] || (K[1] = (
|
|
1959
|
-
},
|
|
1958
|
+
"onUpdate:modelValue": K[1] || (K[1] = (I) => l.value = I)
|
|
1959
|
+
}, v.value, { onChange: D }), createSlots({
|
|
1960
1960
|
default: withCtx(() => [
|
|
1961
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
1961
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(S.list, (I, M) => (openBlock(), createBlock(unref(ElCheckbox), mergeProps({
|
|
1962
1962
|
ref_for: !0,
|
|
1963
1963
|
ref: (W) => {
|
|
1964
|
-
W && (
|
|
1964
|
+
W && (J.value[M] = W);
|
|
1965
1965
|
},
|
|
1966
|
-
key:
|
|
1967
|
-
label:
|
|
1968
|
-
disabled:
|
|
1969
|
-
},
|
|
1966
|
+
key: I[unref(T).format.value],
|
|
1967
|
+
label: I[unref(T).format.value],
|
|
1968
|
+
disabled: k.value || I[unref(T).format.disabled]
|
|
1969
|
+
}, b.value), {
|
|
1970
1970
|
default: withCtx(() => [
|
|
1971
|
-
createTextVNode(toDisplayString(
|
|
1971
|
+
createTextVNode(toDisplayString(I[unref(T).format.label]), 1)
|
|
1972
1972
|
]),
|
|
1973
1973
|
_: 2
|
|
1974
1974
|
}, 1040, ["label", "disabled"]))), 128))
|
|
1975
1975
|
]),
|
|
1976
1976
|
_: 2
|
|
1977
1977
|
}, [
|
|
1978
|
-
renderList(
|
|
1978
|
+
renderList(G.$slots, (I, M, W) => ({
|
|
1979
1979
|
name: M,
|
|
1980
1980
|
fn: withCtx((z) => [
|
|
1981
|
-
renderSlot(
|
|
1981
|
+
renderSlot(G.$slots, M, normalizeProps(guardReactiveProps(z)), void 0, !0)
|
|
1982
1982
|
])
|
|
1983
1983
|
}))
|
|
1984
1984
|
]), 1040, ["disabled", "modelValue"])
|
|
@@ -2090,8 +2090,8 @@ const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
2090
2090
|
let s = [];
|
|
2091
2091
|
if (!i || !i[r])
|
|
2092
2092
|
if (store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes) {
|
|
2093
|
-
const c = store.state.timeout || 3e4,
|
|
2094
|
-
if (Date.now() -
|
|
2093
|
+
const c = store.state.timeout || 3e4, g = Date.now(), w = window.setInterval(() => {
|
|
2094
|
+
if (Date.now() - g > c) {
|
|
2095
2095
|
clearInterval(w), a("getTreeLabelByCode获取字典数据超时");
|
|
2096
2096
|
return;
|
|
2097
2097
|
}
|
|
@@ -2100,8 +2100,8 @@ const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
2100
2100
|
a(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2101
2101
|
return;
|
|
2102
2102
|
}
|
|
2103
|
-
const
|
|
2104
|
-
n(
|
|
2103
|
+
const y = s.find((m) => m[o.valueField] === e);
|
|
2104
|
+
n(y ? t.formatFun(GetTreeItemByCode(y[o.idField], s, o), o) : t.defaultVal);
|
|
2105
2105
|
}
|
|
2106
2106
|
}, 1e3);
|
|
2107
2107
|
} else
|
|
@@ -2110,12 +2110,12 @@ const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
2110
2110
|
a(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2111
2111
|
return;
|
|
2112
2112
|
}
|
|
2113
|
-
const
|
|
2114
|
-
n(
|
|
2113
|
+
const g = s.find((w) => w[o.valueField] === e);
|
|
2114
|
+
n(g ? t.formatFun(GetTreeItemByCode(g[o.idField], s, o), o) : t.defaultVal);
|
|
2115
2115
|
});
|
|
2116
2116
|
else {
|
|
2117
2117
|
s = i[r];
|
|
2118
|
-
const c = s.find((
|
|
2118
|
+
const c = s.find((g) => g[o.valueField] === e);
|
|
2119
2119
|
n(c ? t.formatFun(GetTreeItemByCode(c[o.idField], s, o), o) : t.defaultVal);
|
|
2120
2120
|
}
|
|
2121
2121
|
});
|
|
@@ -2144,13 +2144,13 @@ const GetTreeLabelByCodes = (e, r, d) => {
|
|
|
2144
2144
|
let c = [];
|
|
2145
2145
|
if (!s || !s[r])
|
|
2146
2146
|
if (store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes) {
|
|
2147
|
-
const
|
|
2148
|
-
if (Date.now() - w >
|
|
2149
|
-
clearInterval(
|
|
2147
|
+
const g = store.state.timeout || 3e4, w = Date.now(), y = window.setInterval(() => {
|
|
2148
|
+
if (Date.now() - w > g) {
|
|
2149
|
+
clearInterval(y), a("getTreeLabelByCodes获取字典数据超时");
|
|
2150
2150
|
return;
|
|
2151
2151
|
}
|
|
2152
2152
|
if (!(store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes)) {
|
|
2153
|
-
if (clearInterval(
|
|
2153
|
+
if (clearInterval(y), c = store.state.dictCodes[r], !c) {
|
|
2154
2154
|
a(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2155
2155
|
return;
|
|
2156
2156
|
}
|
|
@@ -2159,8 +2159,8 @@ const GetTreeLabelByCodes = (e, r, d) => {
|
|
|
2159
2159
|
}
|
|
2160
2160
|
}, 1e3);
|
|
2161
2161
|
} else
|
|
2162
|
-
store.actions.getDictDataObj(r).then((
|
|
2163
|
-
if (c =
|
|
2162
|
+
store.actions.getDictDataObj(r).then((g) => {
|
|
2163
|
+
if (c = g[r], !c) {
|
|
2164
2164
|
a(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2165
2165
|
return;
|
|
2166
2166
|
}
|
|
@@ -2169,8 +2169,8 @@ const GetTreeLabelByCodes = (e, r, d) => {
|
|
|
2169
2169
|
});
|
|
2170
2170
|
else {
|
|
2171
2171
|
c = s[r];
|
|
2172
|
-
const
|
|
2173
|
-
n(
|
|
2172
|
+
const g = GetTreeLabelByCodesDothings(u, c, t.defaultVal, t.formatFunIn, i, t.emptyText);
|
|
2173
|
+
n(g && g.length > 0 ? t.formatFunOut(g) : t.defaultVal);
|
|
2174
2174
|
}
|
|
2175
2175
|
});
|
|
2176
2176
|
}, GetTreeCodeByLabel = (e, r, d) => {
|
|
@@ -2184,8 +2184,8 @@ const GetTreeLabelByCodes = (e, r, d) => {
|
|
|
2184
2184
|
let s = [];
|
|
2185
2185
|
if (!i || !i[r])
|
|
2186
2186
|
if (store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes) {
|
|
2187
|
-
const c = store.state.timeout || 3e4,
|
|
2188
|
-
if (Date.now() -
|
|
2187
|
+
const c = store.state.timeout || 3e4, g = Date.now(), w = window.setInterval(() => {
|
|
2188
|
+
if (Date.now() - g > c) {
|
|
2189
2189
|
clearInterval(w), a("getTreeCodeByLabel获取字典数据超时");
|
|
2190
2190
|
return;
|
|
2191
2191
|
}
|
|
@@ -2194,8 +2194,8 @@ const GetTreeLabelByCodes = (e, r, d) => {
|
|
|
2194
2194
|
a(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2195
2195
|
return;
|
|
2196
2196
|
}
|
|
2197
|
-
const
|
|
2198
|
-
n(
|
|
2197
|
+
const y = s.find((m) => m[o.labelField] === e);
|
|
2198
|
+
n(y ? t.formatFun(GetTreeItemByLabel(y[o.labelField], s, o), o) : t.defaultVal);
|
|
2199
2199
|
}
|
|
2200
2200
|
}, 1e3);
|
|
2201
2201
|
} else
|
|
@@ -2204,12 +2204,12 @@ const GetTreeLabelByCodes = (e, r, d) => {
|
|
|
2204
2204
|
a(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2205
2205
|
return;
|
|
2206
2206
|
}
|
|
2207
|
-
const
|
|
2208
|
-
n(
|
|
2207
|
+
const g = s.find((w) => w[o.labelField] === e);
|
|
2208
|
+
n(g ? t.formatFun(GetTreeItemByLabel(g[o.labelField], s, o), o) : t.defaultVal);
|
|
2209
2209
|
});
|
|
2210
2210
|
else {
|
|
2211
2211
|
s = i[r];
|
|
2212
|
-
const c = s.find((
|
|
2212
|
+
const c = s.find((g) => g[o.labelField] === e);
|
|
2213
2213
|
n(c ? t.formatFun(GetTreeItemByLabel(c[o.labelField], s, o), o) : t.defaultVal);
|
|
2214
2214
|
}
|
|
2215
2215
|
});
|
|
@@ -2237,13 +2237,13 @@ const GetTreeCodeByLabels = (e, r, d) => {
|
|
|
2237
2237
|
let c = [];
|
|
2238
2238
|
if (!s || !s[r])
|
|
2239
2239
|
if (store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes) {
|
|
2240
|
-
const
|
|
2241
|
-
if (Date.now() - w >
|
|
2242
|
-
clearInterval(
|
|
2240
|
+
const g = store.state.timeout || 3e4, w = Date.now(), y = window.setInterval(() => {
|
|
2241
|
+
if (Date.now() - w > g) {
|
|
2242
|
+
clearInterval(y), a("getTreeCodeByLabels获取字典数据超时");
|
|
2243
2243
|
return;
|
|
2244
2244
|
}
|
|
2245
2245
|
if (!(store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes)) {
|
|
2246
|
-
if (clearInterval(
|
|
2246
|
+
if (clearInterval(y), c = store.state.dictCodes[r], !c) {
|
|
2247
2247
|
a(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2248
2248
|
return;
|
|
2249
2249
|
}
|
|
@@ -2252,8 +2252,8 @@ const GetTreeCodeByLabels = (e, r, d) => {
|
|
|
2252
2252
|
}
|
|
2253
2253
|
}, 1e3);
|
|
2254
2254
|
} else
|
|
2255
|
-
store.actions.getDictDataObj(r).then((
|
|
2256
|
-
if (c =
|
|
2255
|
+
store.actions.getDictDataObj(r).then((g) => {
|
|
2256
|
+
if (c = g[r], !c) {
|
|
2257
2257
|
a(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2258
2258
|
return;
|
|
2259
2259
|
}
|
|
@@ -2262,8 +2262,8 @@ const GetTreeCodeByLabels = (e, r, d) => {
|
|
|
2262
2262
|
});
|
|
2263
2263
|
else {
|
|
2264
2264
|
c = s[r];
|
|
2265
|
-
const
|
|
2266
|
-
n(
|
|
2265
|
+
const g = GetTreeCodeByLabelsDothings(u, c, t.defaultVal, t.formatFunIn, i);
|
|
2266
|
+
n(g && g.length > 0 ? t.formatFunOut(g) : t.defaultVal);
|
|
2267
2267
|
}
|
|
2268
2268
|
});
|
|
2269
2269
|
}, GetTreeLabelByCodeFilter = (e, r, d) => {
|
|
@@ -2305,7 +2305,7 @@ const GetTreeCodeByLabels = (e, r, d) => {
|
|
|
2305
2305
|
const t = {
|
|
2306
2306
|
defaultVal: null,
|
|
2307
2307
|
emptyText: "--",
|
|
2308
|
-
formatFunIn: (s, c) => s.map((
|
|
2308
|
+
formatFunIn: (s, c) => s.map((g) => g[c.labelField]).join("/"),
|
|
2309
2309
|
treeSetting: {},
|
|
2310
2310
|
formatFunOut: (s) => s.join(","),
|
|
2311
2311
|
spacer: ","
|
|
@@ -2379,7 +2379,7 @@ const GetTreeCodeByLabels = (e, r, d) => {
|
|
|
2379
2379
|
}, GetTreeCodeByLabelsFilter = (e, r, d) => {
|
|
2380
2380
|
const t = {
|
|
2381
2381
|
defaultVal: null,
|
|
2382
|
-
formatFunIn: (s, c) => s.map((
|
|
2382
|
+
formatFunIn: (s, c) => s.map((g) => g[c.valueField]).join("/"),
|
|
2383
2383
|
treeSetting: {},
|
|
2384
2384
|
formatFunOut: (s) => s.join(","),
|
|
2385
2385
|
spacer: ","
|
|
@@ -2706,35 +2706,35 @@ const Mask = (e, r) => {
|
|
|
2706
2706
|
}
|
|
2707
2707
|
},
|
|
2708
2708
|
setup(e, { expose: r }) {
|
|
2709
|
-
const d = e, { modelValue: t, dictType: n, judgeTypeFun: a, type: u, judgeColorFun: o, color: i, judgeDisabledFun: s, disabled: c, defaultVal:
|
|
2710
|
-
let l = ref(null),
|
|
2709
|
+
const d = e, { modelValue: t, dictType: n, judgeTypeFun: a, type: u, judgeColorFun: o, color: i, judgeDisabledFun: s, disabled: c, defaultVal: g, emptyText: w } = toRefs(d), y = toRaw(store.state.dictConfig), m = computed(() => a.value ? a.value(t.value) : u.value ? u.value : l.value && l.value[y.format.type] ? l.value[y.format.type] : "primary"), C = computed(() => o.value ? o.value(t.value) : i.value ? i.value : l.value && l.value[y.format.color] ? l.value[y.format.color] : ""), _ = computed(() => s.value ? s.value(t.value) : l.value && l.value[y.format.disabled] ? l.value[y.format.disabled] : !!c.value);
|
|
2710
|
+
let l = ref(null), v = ref(null);
|
|
2711
2711
|
watchEffect(() => {
|
|
2712
2712
|
if (!n.value) {
|
|
2713
|
-
|
|
2713
|
+
v.value = t.value;
|
|
2714
2714
|
return;
|
|
2715
2715
|
}
|
|
2716
|
-
GetItemByCode(t.value, n.value).then((
|
|
2717
|
-
|
|
2716
|
+
GetItemByCode(t.value, n.value).then((T) => {
|
|
2717
|
+
T ? (l.value = T, v.value = T[y.format.label]) : (l.value = null, v.value = String(g.value ?? (t.value === 0 ? 0 : t.value || w.value)));
|
|
2718
2718
|
});
|
|
2719
2719
|
});
|
|
2720
|
-
const
|
|
2721
|
-
return r({ getElTagRef: () =>
|
|
2720
|
+
const b = ref(null);
|
|
2721
|
+
return r({ getElTagRef: () => b.value }), (T, x) => (openBlock(), createBlock(unref(ElTag), mergeProps({
|
|
2722
2722
|
class: "el-tag-dict",
|
|
2723
2723
|
ref_key: "ElTagRef",
|
|
2724
|
-
ref:
|
|
2724
|
+
ref: b,
|
|
2725
2725
|
type: m.value,
|
|
2726
2726
|
color: C.value,
|
|
2727
|
-
disabled:
|
|
2728
|
-
},
|
|
2727
|
+
disabled: _.value
|
|
2728
|
+
}, T.$attrs), createSlots({
|
|
2729
2729
|
default: withCtx(() => [
|
|
2730
|
-
createTextVNode(toDisplayString(unref(
|
|
2730
|
+
createTextVNode(toDisplayString(unref(v)), 1)
|
|
2731
2731
|
]),
|
|
2732
2732
|
_: 2
|
|
2733
2733
|
}, [
|
|
2734
|
-
renderList(
|
|
2734
|
+
renderList(T.$slots, (j, A, D) => ({
|
|
2735
2735
|
name: A,
|
|
2736
|
-
fn: withCtx((
|
|
2737
|
-
renderSlot(
|
|
2736
|
+
fn: withCtx((S) => [
|
|
2737
|
+
renderSlot(T.$slots, A, mergeProps({ key: D }, S))
|
|
2738
2738
|
])
|
|
2739
2739
|
}))
|
|
2740
2740
|
]), 1040, ["type", "color", "disabled"]));
|
|
@@ -2789,37 +2789,37 @@ const Mask = (e, r) => {
|
|
|
2789
2789
|
},
|
|
2790
2790
|
emits: ["submit", "reset", "action"],
|
|
2791
2791
|
setup(e, { expose: r, emit: d }) {
|
|
2792
|
-
const t = e, { actionType: n, modelValue: a, dictType: u, judgeTypeFun: o, type: i, judgeColorFun: s, color: c, judgeDisabledFun:
|
|
2793
|
-
let
|
|
2792
|
+
const t = e, { actionType: n, modelValue: a, dictType: u, judgeTypeFun: o, type: i, judgeColorFun: s, color: c, judgeDisabledFun: g, disabled: w, defaultVal: y, emptyText: m } = toRefs(t), C = d, _ = toRaw(store.state.dictConfig), l = computed(() => o.value ? o.value(a.value) : i.value ? i.value : E.value && E.value[_.format.type] ? E.value[_.format.type] : "primary"), v = computed(() => s.value ? s.value(a.value) : c.value ? c.value : E.value && E.value[_.format.color] ? E.value[_.format.color] : ""), b = computed(() => g.value ? g.value(a.value) : E.value && E.value[_.format.disabled] ? E.value[_.format.disabled] : !!w.value);
|
|
2793
|
+
let E = ref(null), T = ref(null);
|
|
2794
2794
|
watchEffect(() => {
|
|
2795
2795
|
if (!u.value) {
|
|
2796
|
-
|
|
2796
|
+
T.value = a.value;
|
|
2797
2797
|
return;
|
|
2798
2798
|
}
|
|
2799
|
-
GetItemByCode(a.value, u.value).then((
|
|
2800
|
-
|
|
2799
|
+
GetItemByCode(a.value, u.value).then((D) => {
|
|
2800
|
+
D ? (E.value = D, T.value = D[_.format.label]) : (E.value = null, T.value = String(y.value ?? (a.value === 0 ? 0 : a.value || m.value)));
|
|
2801
2801
|
});
|
|
2802
2802
|
});
|
|
2803
|
-
const
|
|
2804
|
-
|
|
2805
|
-
},
|
|
2806
|
-
return r({ getElLinkRef: () =>
|
|
2803
|
+
const x = () => {
|
|
2804
|
+
b.value || C(n.value, attrs);
|
|
2805
|
+
}, j = ref(null);
|
|
2806
|
+
return r({ getElLinkRef: () => j.value }), (D, S) => (openBlock(), createBlock(unref(ElLink), mergeProps({
|
|
2807
2807
|
class: "el-link-dict",
|
|
2808
2808
|
ref_key: "ElLinkRef",
|
|
2809
|
-
ref:
|
|
2809
|
+
ref: j,
|
|
2810
2810
|
type: l.value,
|
|
2811
|
-
color:
|
|
2812
|
-
disabled:
|
|
2813
|
-
},
|
|
2811
|
+
color: v.value,
|
|
2812
|
+
disabled: b.value
|
|
2813
|
+
}, D.$attrs, { onClick: x }), createSlots({
|
|
2814
2814
|
default: withCtx(() => [
|
|
2815
|
-
createTextVNode(toDisplayString(unref(
|
|
2815
|
+
createTextVNode(toDisplayString(unref(T)), 1)
|
|
2816
2816
|
]),
|
|
2817
2817
|
_: 2
|
|
2818
2818
|
}, [
|
|
2819
|
-
renderList(
|
|
2820
|
-
name:
|
|
2821
|
-
fn: withCtx((
|
|
2822
|
-
renderSlot(
|
|
2819
|
+
renderList(D.$slots, (R, P, O) => ({
|
|
2820
|
+
name: P,
|
|
2821
|
+
fn: withCtx(($) => [
|
|
2822
|
+
renderSlot(D.$slots, P, mergeProps({ key: O }, $))
|
|
2823
2823
|
])
|
|
2824
2824
|
}))
|
|
2825
2825
|
]), 1040, ["type", "color", "disabled"]));
|
|
@@ -2869,35 +2869,35 @@ const Mask = (e, r) => {
|
|
|
2869
2869
|
}
|
|
2870
2870
|
},
|
|
2871
2871
|
setup(e, { expose: r }) {
|
|
2872
|
-
const d = e, { modelValue: t, dictType: n, judgeTypeFun: a, type: u, judgeColorFun: o, color: i, judgeDisabledFun: s, disabled: c, defaultVal:
|
|
2873
|
-
let l = ref(null),
|
|
2872
|
+
const d = e, { modelValue: t, dictType: n, judgeTypeFun: a, type: u, judgeColorFun: o, color: i, judgeDisabledFun: s, disabled: c, defaultVal: g, emptyText: w } = toRefs(d), y = toRaw(store.state.dictConfig), m = computed(() => a.value ? a.value(t.value) : u.value ? u.value : l.value && l.value[y.format.type] ? l.value[y.format.type] : "primary"), C = computed(() => o.value ? o.value(t.value) : i.value ? i.value : l.value && l.value[y.format.color] ? l.value[y.format.color] : ""), _ = computed(() => s.value ? s.value(t.value) : l.value && l.value[y.format.disabled] ? l.value[y.format.disabled] : !!c.value);
|
|
2873
|
+
let l = ref(null), v = ref(null);
|
|
2874
2874
|
watchEffect(() => {
|
|
2875
2875
|
if (!n.value) {
|
|
2876
|
-
|
|
2876
|
+
v.value = t.value;
|
|
2877
2877
|
return;
|
|
2878
2878
|
}
|
|
2879
|
-
GetItemByCode(t.value, n.value).then((
|
|
2880
|
-
|
|
2879
|
+
GetItemByCode(t.value, n.value).then((T) => {
|
|
2880
|
+
T ? (l.value = T, v.value = T[y.format.label]) : (l.value = null, v.value = String(g.value ?? (t.value === 0 ? 0 : t.value || w.value)));
|
|
2881
2881
|
});
|
|
2882
2882
|
});
|
|
2883
|
-
const
|
|
2884
|
-
return r({ getElTextRef: () =>
|
|
2883
|
+
const b = ref(null);
|
|
2884
|
+
return r({ getElTextRef: () => b.value }), (T, x) => (openBlock(), createBlock(unref(ElText), mergeProps({
|
|
2885
2885
|
class: "el-text-dict",
|
|
2886
2886
|
ref_key: "ElTextRef",
|
|
2887
|
-
ref:
|
|
2887
|
+
ref: b,
|
|
2888
2888
|
type: m.value,
|
|
2889
2889
|
color: C.value,
|
|
2890
|
-
disabled:
|
|
2891
|
-
},
|
|
2890
|
+
disabled: _.value
|
|
2891
|
+
}, T.$attrs), createSlots({
|
|
2892
2892
|
default: withCtx(() => [
|
|
2893
|
-
createTextVNode(toDisplayString(unref(
|
|
2893
|
+
createTextVNode(toDisplayString(unref(v)), 1)
|
|
2894
2894
|
]),
|
|
2895
2895
|
_: 2
|
|
2896
2896
|
}, [
|
|
2897
|
-
renderList(
|
|
2897
|
+
renderList(T.$slots, (j, A, D) => ({
|
|
2898
2898
|
name: A,
|
|
2899
|
-
fn: withCtx((
|
|
2900
|
-
renderSlot(
|
|
2899
|
+
fn: withCtx((S) => [
|
|
2900
|
+
renderSlot(T.$slots, A, mergeProps({ key: D }, S))
|
|
2901
2901
|
])
|
|
2902
2902
|
}))
|
|
2903
2903
|
]), 1040, ["type", "color", "disabled"]));
|
|
@@ -2919,20 +2919,20 @@ const Mask = (e, r) => {
|
|
|
2919
2919
|
ref("");
|
|
2920
2920
|
const a = computed(() => {
|
|
2921
2921
|
const l = {};
|
|
2922
|
-
return Object.entries(n).forEach(([
|
|
2923
|
-
const
|
|
2924
|
-
if (!
|
|
2925
|
-
const
|
|
2926
|
-
l[
|
|
2922
|
+
return Object.entries(n).forEach(([v, b]) => {
|
|
2923
|
+
const E = ToKebabCase(v);
|
|
2924
|
+
if (!E.startsWith("descriptions-item-") && !E.startsWith("on-descriptions-item-")) {
|
|
2925
|
+
const T = ToCamelCase(E);
|
|
2926
|
+
l[T] = b;
|
|
2927
2927
|
}
|
|
2928
2928
|
}), l;
|
|
2929
2929
|
}), u = computed(() => {
|
|
2930
2930
|
const l = {};
|
|
2931
|
-
return Object.entries(n).forEach(([
|
|
2932
|
-
const
|
|
2933
|
-
if (
|
|
2934
|
-
const
|
|
2935
|
-
l[
|
|
2931
|
+
return Object.entries(n).forEach(([v, b]) => {
|
|
2932
|
+
const E = ToKebabCase(v);
|
|
2933
|
+
if (E.startsWith("descriptions-item-") || E.startsWith("on-descriptions-item")) {
|
|
2934
|
+
const T = ToCamelCase(E.replace("descriptions-item-", ""));
|
|
2935
|
+
l[T] = b;
|
|
2936
2936
|
}
|
|
2937
2937
|
}), l;
|
|
2938
2938
|
});
|
|
@@ -2943,12 +2943,12 @@ const Mask = (e, r) => {
|
|
|
2943
2943
|
};
|
|
2944
2944
|
}
|
|
2945
2945
|
const i = (l) => {
|
|
2946
|
-
const
|
|
2947
|
-
return l.defaultVal !== void 0 && l.defaultVal !== null && (
|
|
2946
|
+
const v = {};
|
|
2947
|
+
return l.defaultVal !== void 0 && l.defaultVal !== null && (v.defaultVal = l.defaultVal), l.emptyText !== void 0 && l.emptyText !== null && (v.emptyText = l.emptyText), l.formatFun !== void 0 && l.formatFun !== null && (v.formatFun = l.formatFun), l.spacer !== void 0 && l.spacer !== null && (v.spacer = l.spacer), Object.assign(v, l.dictOptions || {});
|
|
2948
2948
|
}, s = (l) => {
|
|
2949
|
-
const
|
|
2950
|
-
return l.defaultVal !== void 0 && l.defaultVal !== null && (
|
|
2951
|
-
}, c = (l) => !!l.maskType || !!l.maskStart || !!l.maskMiddle || !!l.maskEnd,
|
|
2949
|
+
const v = {};
|
|
2950
|
+
return l.defaultVal !== void 0 && l.defaultVal !== null && (v.defaultVal = l.defaultVal), l.emptyText !== void 0 && l.emptyText !== null && (v.emptyText = l.emptyText), l.formatFunIn !== void 0 && l.formatFunIn !== null && (v.formatFunIn = l.formatFunIn), l.formatFunOut !== void 0 && l.formatFunOut !== null && (v.formatFunOut = l.formatFunOut), l.treeSetting !== void 0 && l.treeSetting !== null && (v.treeSetting = l.treeSetting), l.spacer !== void 0 && l.spacer !== null && (v.spacer = l.spacer), Object.assign(v, l.dictOptions || {});
|
|
2951
|
+
}, c = (l) => !!l.maskType || !!l.maskStart || !!l.maskMiddle || !!l.maskEnd, g = (l) => {
|
|
2952
2952
|
if (l.maskType) {
|
|
2953
2953
|
if (Array.isArray(l.maskType))
|
|
2954
2954
|
return {
|
|
@@ -2959,14 +2959,14 @@ const Mask = (e, r) => {
|
|
|
2959
2959
|
defaultVal: l.defaultVal
|
|
2960
2960
|
};
|
|
2961
2961
|
if (typeof l.maskType == "object") {
|
|
2962
|
-
const
|
|
2962
|
+
const v = {
|
|
2963
2963
|
start: l.maskStart || 0,
|
|
2964
2964
|
middle: l.maskMiddle || 0,
|
|
2965
2965
|
end: l.maskEnd || 0,
|
|
2966
2966
|
symbol: l.maskSymbol || "*",
|
|
2967
2967
|
defaultVal: l.defaultVal
|
|
2968
2968
|
};
|
|
2969
|
-
return Object.assign(
|
|
2969
|
+
return Object.assign(v, l.maskType);
|
|
2970
2970
|
} else
|
|
2971
2971
|
return l.maskType;
|
|
2972
2972
|
} else
|
|
@@ -2977,59 +2977,59 @@ const Mask = (e, r) => {
|
|
|
2977
2977
|
symbol: l.maskSymbol || "*",
|
|
2978
2978
|
defaultVal: l.defaultVal
|
|
2979
2979
|
};
|
|
2980
|
-
}, w = (l,
|
|
2981
|
-
return r({ getElDescriptionsRef: () =>
|
|
2980
|
+
}, w = (l, v = {}) => Array.isArray(l) ? l : typeof l == "string" ? l.split(v.spacer || ",") : typeof l == "number" ? [l] : [], y = ref(null), m = ref([]);
|
|
2981
|
+
return r({ getElDescriptionsRef: () => y.value, getElDescriptionsItemRefs: () => m.value }), (l, v) => (openBlock(), createBlock(unref(ElDescriptions), mergeProps({
|
|
2982
2982
|
ref_key: "ElDescriptionsRef",
|
|
2983
|
-
ref:
|
|
2983
|
+
ref: y
|
|
2984
2984
|
}, a.value), createSlots({
|
|
2985
2985
|
default: withCtx(() => [
|
|
2986
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(t), (
|
|
2986
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(t), (b, E) => (openBlock(), createBlock(unref(ElDescriptionsItem), mergeProps({
|
|
2987
2987
|
ref_for: !0,
|
|
2988
|
-
ref: (
|
|
2989
|
-
|
|
2988
|
+
ref: (T) => {
|
|
2989
|
+
T && (m.value[E] = T);
|
|
2990
2990
|
},
|
|
2991
|
-
key:
|
|
2992
|
-
}, o(
|
|
2991
|
+
key: E
|
|
2992
|
+
}, o(b)), createSlots({
|
|
2993
2993
|
default: withCtx(() => [
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
key:
|
|
2997
|
-
modelValue:
|
|
2998
|
-
dictType:
|
|
2999
|
-
}, null, 8, ["modelValue", "dictType"]))), 128)) :
|
|
3000
|
-
key:
|
|
3001
|
-
modelValue:
|
|
3002
|
-
dictType:
|
|
3003
|
-
}, null, 8, ["modelValue", "dictType"]))), 128)) :
|
|
3004
|
-
key:
|
|
3005
|
-
modelValue:
|
|
3006
|
-
dictType:
|
|
3007
|
-
}, null, 8, ["modelValue", "dictType"]))), 128)) :
|
|
3008
|
-
key:
|
|
3009
|
-
modelValue:
|
|
3010
|
-
dictType:
|
|
2994
|
+
b.dictType ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2995
|
+
b.dictTypeNode === "button" ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(w(b.modelValue, i(b)), (T, x) => (openBlock(), createBlock(_sfc_main$n, {
|
|
2996
|
+
key: x,
|
|
2997
|
+
modelValue: T || "",
|
|
2998
|
+
dictType: b.dictType
|
|
2999
|
+
}, null, 8, ["modelValue", "dictType"]))), 128)) : b.dictTypeNode === "link" ? (openBlock(!0), createElementBlock(Fragment, { key: 1 }, renderList(w(b.modelValue, i(b)), (T, x) => (openBlock(), createBlock(_sfc_main$e, {
|
|
3000
|
+
key: x,
|
|
3001
|
+
modelValue: T || "",
|
|
3002
|
+
dictType: b.dictType
|
|
3003
|
+
}, null, 8, ["modelValue", "dictType"]))), 128)) : b.dictTypeNode === "tag" ? (openBlock(!0), createElementBlock(Fragment, { key: 2 }, renderList(w(b.modelValue, i(b)), (T, x) => (openBlock(), createBlock(_sfc_main$f, {
|
|
3004
|
+
key: x,
|
|
3005
|
+
modelValue: T || "",
|
|
3006
|
+
dictType: b.dictType
|
|
3007
|
+
}, null, 8, ["modelValue", "dictType"]))), 128)) : b.dictTypeNode === "text" ? (openBlock(!0), createElementBlock(Fragment, { key: 3 }, renderList(w(b.modelValue, i(b)), (T, x) => (openBlock(), createBlock(_sfc_main$d, {
|
|
3008
|
+
key: x,
|
|
3009
|
+
modelValue: T || "",
|
|
3010
|
+
dictType: b.dictType
|
|
3011
3011
|
}, null, 8, ["modelValue", "dictType"]))), 128)) : (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
3012
|
-
createTextVNode(toDisplayString(unref(GetLabelByCodesFilter)(
|
|
3012
|
+
createTextVNode(toDisplayString(unref(GetLabelByCodesFilter)(b.modelValue, b.dictType, i(b))), 1)
|
|
3013
3013
|
], 64))
|
|
3014
|
-
], 64)) :
|
|
3015
|
-
createTextVNode(toDisplayString(unref(GetTreeLabelByCodesFilter)(
|
|
3016
|
-
], 64)) :
|
|
3017
|
-
createTextVNode(toDisplayString(unref(FormatDate)(
|
|
3018
|
-
], 64)) : c(
|
|
3019
|
-
createTextVNode(toDisplayString(unref(Desensitization)(
|
|
3014
|
+
], 64)) : b.dictTreeType ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3015
|
+
createTextVNode(toDisplayString(unref(GetTreeLabelByCodesFilter)(b.modelValue, b.dictTreeType, s(b))), 1)
|
|
3016
|
+
], 64)) : b.dateFormat && b.modelValue ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
3017
|
+
createTextVNode(toDisplayString(unref(FormatDate)(b.modelValue, b.dateFormat, b.defaultVal)), 1)
|
|
3018
|
+
], 64)) : c(b) && b.modelValue ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
3019
|
+
createTextVNode(toDisplayString(unref(Desensitization)(b.modelValue, g(b))), 1)
|
|
3020
3020
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
3021
|
-
createTextVNode(toDisplayString(
|
|
3021
|
+
createTextVNode(toDisplayString(b.modelValue !== void 0 && b.modelValue !== null ? b.modelValue : b.defaultVal), 1)
|
|
3022
3022
|
], 64))
|
|
3023
3023
|
]),
|
|
3024
3024
|
_: 2
|
|
3025
3025
|
}, [
|
|
3026
|
-
renderList(
|
|
3027
|
-
name:
|
|
3028
|
-
fn: withCtx((
|
|
3026
|
+
renderList(b.slotList, (T, x) => ({
|
|
3027
|
+
name: T.slotName,
|
|
3028
|
+
fn: withCtx((j) => [
|
|
3029
3029
|
(openBlock(), createBlock(_sfc_main$m, {
|
|
3030
|
-
key:
|
|
3031
|
-
render:
|
|
3032
|
-
scope:
|
|
3030
|
+
key: x,
|
|
3031
|
+
render: T.render,
|
|
3032
|
+
scope: j
|
|
3033
3033
|
}, null, 8, ["render", "scope"]))
|
|
3034
3034
|
])
|
|
3035
3035
|
}))
|
|
@@ -3037,10 +3037,10 @@ const Mask = (e, r) => {
|
|
|
3037
3037
|
]),
|
|
3038
3038
|
_: 2
|
|
3039
3039
|
}, [
|
|
3040
|
-
renderList(l.$slots, (
|
|
3041
|
-
name:
|
|
3042
|
-
fn: withCtx((
|
|
3043
|
-
renderSlot(l.$slots,
|
|
3040
|
+
renderList(l.$slots, (b, E, T) => ({
|
|
3041
|
+
name: E,
|
|
3042
|
+
fn: withCtx((x) => [
|
|
3043
|
+
renderSlot(l.$slots, E, mergeProps({ key: T }, x), void 0, !0)
|
|
3044
3044
|
])
|
|
3045
3045
|
}))
|
|
3046
3046
|
]), 1040));
|
|
@@ -3080,69 +3080,69 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3080
3080
|
},
|
|
3081
3081
|
emits: ["pass", "fail", "update:modelValue", "action"],
|
|
3082
3082
|
setup(e, { expose: r, emit: d }) {
|
|
3083
|
-
const t = useAttrs(), n = toRaw(store.state.dictConfig), a = ref(null), u = e, { modelValue: o, rules: i, idField: s, componentList: c } = toRefs(u),
|
|
3084
|
-
var
|
|
3083
|
+
const t = useAttrs(), n = toRaw(store.state.dictConfig), a = ref(null), u = e, { modelValue: o, rules: i, idField: s, componentList: c } = toRefs(u), g = d, w = computed(() => {
|
|
3084
|
+
var f;
|
|
3085
3085
|
if (typeof t.colon == "boolean")
|
|
3086
3086
|
return t.colon;
|
|
3087
3087
|
if (typeof t.colon == "string" && t.colon === "")
|
|
3088
3088
|
return !0;
|
|
3089
|
-
const
|
|
3090
|
-
return typeof
|
|
3091
|
-
}),
|
|
3089
|
+
const p = (f = n == null ? void 0 : n.dynamicComponentsConfig) == null ? void 0 : f.isShowLabelColon;
|
|
3090
|
+
return typeof p == "boolean" ? p : !1;
|
|
3091
|
+
}), y = ref([]), m = ref({});
|
|
3092
3092
|
let C = JSON.parse(JSON.stringify(m));
|
|
3093
|
-
const
|
|
3094
|
-
var
|
|
3095
|
-
if ((
|
|
3093
|
+
const _ = (p) => {
|
|
3094
|
+
var k, B, F, V, J;
|
|
3095
|
+
if ((k = n.dynamicComponentsConfig) != null && k.disabledNoPlaceholder && (p != null && p.disabled || (typeof t.disabled == "string" && t.disabled === "" || t.disabled) && (p == null ? void 0 : p.disabled) !== !1) || (B = n.dynamicComponentsConfig) != null && B.readonlyNoPlaceholder && (p != null && p.readonly || (typeof t.readonly == "string" && t.readonly === "" || t.readonly) && (p == null ? void 0 : p.readonly) !== !1))
|
|
3096
3096
|
return "";
|
|
3097
|
-
let
|
|
3098
|
-
return
|
|
3099
|
-
}, l = ref(!1),
|
|
3100
|
-
var
|
|
3101
|
-
|
|
3102
|
-
let
|
|
3097
|
+
let f = "请选择";
|
|
3098
|
+
return p != null && p.compName && ToKebabCase(p == null ? void 0 : p.compName).includes("input") && (f = "请输入"), (F = n.dynamicComponentsConfig) != null && F.isShowLabelPlaceholder && (f = f + ((V = p.formItemProps) == null ? void 0 : V.label)), ((J = p.props) == null ? void 0 : J.placeholder) || f || "";
|
|
3099
|
+
}, l = ref(!1), v = ref(""), b = () => {
|
|
3100
|
+
var k, B, F, V, J, L, G, K, I, M, W;
|
|
3101
|
+
v.value = "id" + GenerateUUID();
|
|
3102
|
+
let p = [];
|
|
3103
3103
|
for (let z = 0; z < c.value.length; z++) {
|
|
3104
|
-
const
|
|
3104
|
+
const N = c.value[z];
|
|
3105
3105
|
let q = null;
|
|
3106
|
-
if (
|
|
3107
|
-
|
|
3108
|
-
id:
|
|
3109
|
-
showRuleType: (
|
|
3110
|
-
validatorRuleType: (
|
|
3106
|
+
if (N != null && N.isFormData && (N != null && N.fieldName) ? q = {
|
|
3107
|
+
...N,
|
|
3108
|
+
id: N != null && N[s.value] ? N[s.value] : GenerateUUID(),
|
|
3109
|
+
showRuleType: (N == null ? void 0 : N.showRuleType) || ((k = n == null ? void 0 : n.dynamicComponentsConfig) == null ? void 0 : k.showRuleType) || "compare",
|
|
3110
|
+
validatorRuleType: (N == null ? void 0 : N.validatorRuleType) || ((B = n == null ? void 0 : n.dynamicComponentsConfig) == null ? void 0 : B.validatorRuleType) || "compare",
|
|
3111
3111
|
// 解决重置无法正常显示或隐藏的问题 有显示规则的先给他设置为 false
|
|
3112
|
-
visible:
|
|
3112
|
+
visible: N.showRules && N.showRules.length > 0 || N.hidden ? !1 : (N == null ? void 0 : N.visible) ?? !0,
|
|
3113
3113
|
//
|
|
3114
3114
|
// 重点:拷贝props为新对象(若存在),断开与原item.props的引用
|
|
3115
|
-
props:
|
|
3116
|
-
...(
|
|
3117
|
-
|
|
3118
|
-
placeholder:
|
|
3115
|
+
props: N.props ? {
|
|
3116
|
+
...(F = n.dynamicComponentsConfig) == null ? void 0 : F.props,
|
|
3117
|
+
...N.props,
|
|
3118
|
+
placeholder: _(N)
|
|
3119
3119
|
} : {
|
|
3120
|
-
...(
|
|
3121
|
-
placeholder:
|
|
3120
|
+
...(V = n.dynamicComponentsConfig) == null ? void 0 : V.props,
|
|
3121
|
+
placeholder: _(N)
|
|
3122
3122
|
},
|
|
3123
|
-
formItemProps:
|
|
3124
|
-
|
|
3125
|
-
id:
|
|
3126
|
-
class: (
|
|
3123
|
+
formItemProps: N.formItemProps ? {
|
|
3124
|
+
...N.formItemProps,
|
|
3125
|
+
id: N != null && N[s.value] ? N[s.value] : GenerateUUID(),
|
|
3126
|
+
class: (J = N.props) != null && J.class ? N.props.class + " " + ((N == null ? void 0 : N.fieldName) || "") : (N == null ? void 0 : N.fieldName) || ""
|
|
3127
3127
|
} : {
|
|
3128
|
-
id:
|
|
3129
|
-
class: (
|
|
3128
|
+
id: N != null && N[s.value] ? N[s.value] : GenerateUUID(),
|
|
3129
|
+
class: (N == null ? void 0 : N.fieldName) || ""
|
|
3130
3130
|
}
|
|
3131
3131
|
} : q = {
|
|
3132
|
-
|
|
3133
|
-
id:
|
|
3134
|
-
showRuleType: (
|
|
3135
|
-
validatorRuleType: (
|
|
3132
|
+
...N,
|
|
3133
|
+
id: N != null && N[s.value] ? N[s.value] : GenerateUUID(),
|
|
3134
|
+
showRuleType: (N == null ? void 0 : N.showRuleType) || ((L = n == null ? void 0 : n.dynamicComponentsConfig) == null ? void 0 : L.showRuleType) || "compare",
|
|
3135
|
+
validatorRuleType: (N == null ? void 0 : N.validatorRuleType) || ((G = n == null ? void 0 : n.dynamicComponentsConfig) == null ? void 0 : G.validatorRuleType) || "compare",
|
|
3136
3136
|
// 解决重置无法正常显示或隐藏的问题 有显示规则的先给他设置为 false
|
|
3137
|
-
visible:
|
|
3137
|
+
visible: N.showRules && N.showRules.length > 0 || N.hidden ? !1 : (N == null ? void 0 : N.visible) ?? !0,
|
|
3138
3138
|
// 默认为true(显示)
|
|
3139
3139
|
// 重点:拷贝props为新对象(若存在),断开与原item.props的引用
|
|
3140
|
-
props:
|
|
3141
|
-
|
|
3140
|
+
props: N.props ? {
|
|
3141
|
+
...N.props
|
|
3142
3142
|
} : {}
|
|
3143
|
-
}, (K =
|
|
3144
|
-
const Y = ((M =
|
|
3145
|
-
|
|
3143
|
+
}, (K = N.formItemProps) != null && K.rules || (I = i.value) != null && I[N.fieldName]) {
|
|
3144
|
+
const Y = ((M = N.formItemProps) == null ? void 0 : M.rules) || ((W = i.value) == null ? void 0 : W[N.fieldName]) || [];
|
|
3145
|
+
N.fieldName && (q.formItemProps.prop = q.formItemProps.prop || N.fieldName), q.formItemProps.required = Y.some((ne) => ne.required) || q.formItemProps.required || !1;
|
|
3146
3146
|
const re = [...Y];
|
|
3147
3147
|
q.formItemProps.rules = re.map((ne) => {
|
|
3148
3148
|
var se;
|
|
@@ -3172,141 +3172,141 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3172
3172
|
return U;
|
|
3173
3173
|
});
|
|
3174
3174
|
}
|
|
3175
|
-
|
|
3175
|
+
p.push(q);
|
|
3176
3176
|
}
|
|
3177
|
-
|
|
3178
|
-
const
|
|
3179
|
-
|
|
3180
|
-
var
|
|
3177
|
+
y.value = p;
|
|
3178
|
+
const f = {};
|
|
3179
|
+
y.value.forEach((z) => {
|
|
3180
|
+
var N, q;
|
|
3181
3181
|
if (z.isFormData && z.fieldName) {
|
|
3182
|
-
const Y = (
|
|
3183
|
-
|
|
3182
|
+
const Y = (N = o.value) == null ? void 0 : N[z.fieldName];
|
|
3183
|
+
f[z.fieldName] = ((q = z == null ? void 0 : z.props) == null ? void 0 : q.modelValue) !== void 0 ? z.props.modelValue : Y !== void 0 ? Y : null;
|
|
3184
3184
|
}
|
|
3185
|
-
}), m.value = JSON.parse(JSON.stringify(
|
|
3186
|
-
},
|
|
3187
|
-
const
|
|
3185
|
+
}), m.value = JSON.parse(JSON.stringify(f));
|
|
3186
|
+
}, E = computed(() => typeof t.isScrollToFormError == "boolean" ? t.isScrollToFormError : n.dynamicComponentsConfig.isScrollToFormError), T = async (p) => {
|
|
3187
|
+
const f = JSON.parse(JSON.stringify(m.value)), k = sortComponentsByIdDependencies(y.value), B = [], F = (I) => typeof I == "string" ? I.split(",").filter(Boolean) : Array.isArray(I) ? I : [], V = async () => {
|
|
3188
3188
|
if (a.value)
|
|
3189
3189
|
return;
|
|
3190
|
-
const
|
|
3190
|
+
const I = 1e3, M = 50;
|
|
3191
3191
|
let W = 0;
|
|
3192
3192
|
return new Promise((z) => {
|
|
3193
|
-
const
|
|
3194
|
-
a.value || W >=
|
|
3193
|
+
const N = () => {
|
|
3194
|
+
a.value || W >= I ? z() : (W += M, setTimeout(N, M));
|
|
3195
3195
|
};
|
|
3196
|
-
|
|
3196
|
+
N();
|
|
3197
3197
|
});
|
|
3198
|
-
},
|
|
3199
|
-
if (await
|
|
3198
|
+
}, J = async (I) => {
|
|
3199
|
+
if (await V(), !a.value)
|
|
3200
3200
|
return !1;
|
|
3201
3201
|
try {
|
|
3202
|
-
return await (a == null ? void 0 : a.value.validateField(
|
|
3202
|
+
return await (a == null ? void 0 : a.value.validateField(I));
|
|
3203
3203
|
} catch {
|
|
3204
3204
|
return !1;
|
|
3205
3205
|
}
|
|
3206
|
-
},
|
|
3206
|
+
}, L = async (I) => {
|
|
3207
3207
|
var M;
|
|
3208
|
-
await
|
|
3209
|
-
for (let W = 0; W <
|
|
3210
|
-
const z =
|
|
3208
|
+
await V();
|
|
3209
|
+
for (let W = 0; W < I.length; W++) {
|
|
3210
|
+
const z = I[W], N = y.value.find((q) => {
|
|
3211
3211
|
var Y;
|
|
3212
3212
|
return ((Y = q == null ? void 0 : q.formItemProps) == null ? void 0 : Y.prop) === z;
|
|
3213
3213
|
});
|
|
3214
|
-
m.value[
|
|
3214
|
+
m.value[N.fieldName] || (M = a.value) == null || M.clearValidate(z);
|
|
3215
3215
|
}
|
|
3216
|
-
},
|
|
3216
|
+
}, G = {
|
|
3217
3217
|
// 处理"calculate"类型
|
|
3218
|
-
calculate: (
|
|
3218
|
+
calculate: (I) => I.showRules.some((M) => CheckConditionsByOperation(M, f)),
|
|
3219
3219
|
// 处理"compare"类型
|
|
3220
|
-
compare: (
|
|
3220
|
+
compare: (I) => I.showRules.some((M) => CheckConditions(M, f)),
|
|
3221
3221
|
// 处理"validate"类型
|
|
3222
|
-
validate: async (
|
|
3223
|
-
const M =
|
|
3224
|
-
if (await
|
|
3222
|
+
validate: async (I) => {
|
|
3223
|
+
const M = F(I.showRules);
|
|
3224
|
+
if (await J(M))
|
|
3225
3225
|
return !0;
|
|
3226
3226
|
{
|
|
3227
|
-
const z = M.filter((
|
|
3228
|
-
return await
|
|
3227
|
+
const z = M.filter((N) => N !== p);
|
|
3228
|
+
return await L(z), !1;
|
|
3229
3229
|
}
|
|
3230
3230
|
},
|
|
3231
3231
|
// 处理嵌套类型(showRuleType为逻辑运算符,如"&&"、"||")
|
|
3232
|
-
default: async (
|
|
3232
|
+
default: async (I) => {
|
|
3233
3233
|
const M = [];
|
|
3234
|
-
for (const W of
|
|
3234
|
+
for (const W of I.showRules)
|
|
3235
3235
|
switch (W.type) {
|
|
3236
3236
|
case "calculate":
|
|
3237
|
-
M.push(W.rules.some((z) => CheckConditionsByOperation(z,
|
|
3237
|
+
M.push(W.rules.some((z) => CheckConditionsByOperation(z, f)));
|
|
3238
3238
|
break;
|
|
3239
3239
|
case "compare":
|
|
3240
|
-
M.push(W.rules.some((z) => CheckConditions(z,
|
|
3240
|
+
M.push(W.rules.some((z) => CheckConditions(z, f)));
|
|
3241
3241
|
break;
|
|
3242
3242
|
case "validate": {
|
|
3243
|
-
const z =
|
|
3244
|
-
if (
|
|
3245
|
-
const q = z.filter((Y) => Y !==
|
|
3246
|
-
await
|
|
3243
|
+
const z = F(W.rules), N = await J(z);
|
|
3244
|
+
if (!N) {
|
|
3245
|
+
const q = z.filter((Y) => Y !== p);
|
|
3246
|
+
await L(q);
|
|
3247
3247
|
}
|
|
3248
|
-
M.push(
|
|
3248
|
+
M.push(N);
|
|
3249
3249
|
break;
|
|
3250
3250
|
}
|
|
3251
3251
|
default:
|
|
3252
3252
|
M.push(!1);
|
|
3253
3253
|
}
|
|
3254
|
-
return CalculateLogicalResult(M,
|
|
3254
|
+
return CalculateLogicalResult(M, I.showRuleType);
|
|
3255
3255
|
}
|
|
3256
3256
|
};
|
|
3257
|
-
for (const
|
|
3258
|
-
if (
|
|
3257
|
+
for (const I of k) {
|
|
3258
|
+
if (I.hidden)
|
|
3259
3259
|
continue;
|
|
3260
|
-
const M =
|
|
3260
|
+
const M = I.visible;
|
|
3261
3261
|
let W = M;
|
|
3262
|
-
|
|
3262
|
+
I.showRules && I.showRules.length > 0 && (W = await (G[I.showRuleType] || G.default)(I)), I.visible = W, I.fieldName && !M && W && B.push(I.fieldName), !W && I.fieldName && (f[I.fieldName] = Array.isArray(f[I.fieldName]) ? [] : "");
|
|
3263
3263
|
}
|
|
3264
|
-
const K =
|
|
3264
|
+
const K = B.filter((I) => {
|
|
3265
3265
|
var q, Y;
|
|
3266
|
-
const M =
|
|
3266
|
+
const M = k.find((re) => re.fieldName === I);
|
|
3267
3267
|
if (!(((Y = (q = M == null ? void 0 : M.formItemProps) == null ? void 0 : q.rules) == null ? void 0 : Y.length) > 0))
|
|
3268
3268
|
return !1;
|
|
3269
|
-
const z = m.value[
|
|
3269
|
+
const z = m.value[I];
|
|
3270
3270
|
return typeof z == "string" ? !!z.trim() : typeof z == "object" && z !== null && Object.keys(z).length > 0;
|
|
3271
3271
|
});
|
|
3272
3272
|
if (K.length > 0) {
|
|
3273
|
-
await
|
|
3274
|
-
const
|
|
3275
|
-
l.value = !0,
|
|
3273
|
+
await V();
|
|
3274
|
+
const I = x();
|
|
3275
|
+
l.value = !0, g("update:modelValue", I), setTimeout(() => {
|
|
3276
3276
|
var M;
|
|
3277
3277
|
(M = a.value) == null || M.validateField(K);
|
|
3278
3278
|
}, 0);
|
|
3279
3279
|
}
|
|
3280
|
-
},
|
|
3281
|
-
const
|
|
3282
|
-
for (let
|
|
3283
|
-
const
|
|
3284
|
-
!
|
|
3280
|
+
}, x = () => {
|
|
3281
|
+
const p = JSON.parse(JSON.stringify(m.value));
|
|
3282
|
+
for (let f = 0; f < y.value.length; f++) {
|
|
3283
|
+
const k = y.value[f];
|
|
3284
|
+
!k.visible && !k.hidden && delete p[k.fieldName];
|
|
3285
3285
|
}
|
|
3286
|
-
return
|
|
3287
|
-
},
|
|
3288
|
-
const
|
|
3289
|
-
if (typeof
|
|
3290
|
-
return
|
|
3291
|
-
key:
|
|
3292
|
-
oldVal:
|
|
3293
|
-
newVal:
|
|
3294
|
-
}),
|
|
3295
|
-
const
|
|
3296
|
-
for (const
|
|
3297
|
-
const
|
|
3298
|
-
typeof
|
|
3299
|
-
key:
|
|
3300
|
-
oldVal:
|
|
3301
|
-
newVal:
|
|
3286
|
+
return p;
|
|
3287
|
+
}, j = (p, f, k = "") => {
|
|
3288
|
+
const B = [];
|
|
3289
|
+
if (typeof p != "object" || p === null || f === null)
|
|
3290
|
+
return p !== f && B.push({
|
|
3291
|
+
key: k,
|
|
3292
|
+
oldVal: f,
|
|
3293
|
+
newVal: p
|
|
3294
|
+
}), B;
|
|
3295
|
+
const F = /* @__PURE__ */ new Set([...Object.keys(p), ...Object.keys(f)]);
|
|
3296
|
+
for (const V of F) {
|
|
3297
|
+
const J = k ? `${k}.${V}` : V, L = p[V], G = f[V];
|
|
3298
|
+
typeof L == "object" && L !== null && !Array.isArray(L) ? B.push(...j(L, G, J)) : L !== G && B.push({
|
|
3299
|
+
key: J,
|
|
3300
|
+
oldVal: G,
|
|
3301
|
+
newVal: L
|
|
3302
3302
|
});
|
|
3303
3303
|
}
|
|
3304
|
-
return
|
|
3304
|
+
return B;
|
|
3305
3305
|
};
|
|
3306
3306
|
watch(
|
|
3307
3307
|
c,
|
|
3308
3308
|
() => {
|
|
3309
|
-
|
|
3309
|
+
b();
|
|
3310
3310
|
},
|
|
3311
3311
|
{
|
|
3312
3312
|
deep: !0,
|
|
@@ -3317,21 +3317,21 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3317
3317
|
let A = !0;
|
|
3318
3318
|
watch(
|
|
3319
3319
|
m,
|
|
3320
|
-
(
|
|
3321
|
-
var
|
|
3322
|
-
const
|
|
3320
|
+
(p) => {
|
|
3321
|
+
var B;
|
|
3322
|
+
const f = JSON.parse(JSON.stringify(p));
|
|
3323
3323
|
if (A)
|
|
3324
|
-
|
|
3324
|
+
T();
|
|
3325
3325
|
else {
|
|
3326
|
-
const
|
|
3327
|
-
if (JSON.stringify(
|
|
3326
|
+
const V = (B = j(f, C).find((J) => {
|
|
3327
|
+
if (JSON.stringify(J.newVal) !== JSON.stringify(J.oldVal))
|
|
3328
3328
|
return !0;
|
|
3329
|
-
})) == null ? void 0 :
|
|
3330
|
-
|
|
3329
|
+
})) == null ? void 0 : B.key;
|
|
3330
|
+
T(V);
|
|
3331
3331
|
}
|
|
3332
|
-
C =
|
|
3333
|
-
const
|
|
3334
|
-
l.value = !0,
|
|
3332
|
+
C = f;
|
|
3333
|
+
const k = x();
|
|
3334
|
+
l.value = !0, g("update:modelValue", k), A = !1;
|
|
3335
3335
|
},
|
|
3336
3336
|
{
|
|
3337
3337
|
deep: !0,
|
|
@@ -3344,64 +3344,64 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3344
3344
|
l.value = !1;
|
|
3345
3345
|
return;
|
|
3346
3346
|
}
|
|
3347
|
-
|
|
3347
|
+
b();
|
|
3348
3348
|
},
|
|
3349
3349
|
{ deep: !0 }
|
|
3350
3350
|
);
|
|
3351
|
-
const
|
|
3352
|
-
const
|
|
3353
|
-
|
|
3354
|
-
if (
|
|
3355
|
-
|
|
3356
|
-
else if (
|
|
3357
|
-
const
|
|
3358
|
-
|
|
3351
|
+
const D = async (p, f) => {
|
|
3352
|
+
const k = x();
|
|
3353
|
+
p && p.validate((B, F) => {
|
|
3354
|
+
if (B)
|
|
3355
|
+
g("pass", k, f);
|
|
3356
|
+
else if (g("fail", F, k, f), E.value) {
|
|
3357
|
+
const V = Object.keys(F)[0];
|
|
3358
|
+
p.scrollToField(V);
|
|
3359
3359
|
}
|
|
3360
3360
|
});
|
|
3361
|
-
},
|
|
3362
|
-
|
|
3361
|
+
}, S = async () => {
|
|
3362
|
+
b(), await nextTick(), a.value && setTimeout(() => {
|
|
3363
3363
|
a.value.resetFields();
|
|
3364
3364
|
}, 30);
|
|
3365
|
-
},
|
|
3366
|
-
const
|
|
3367
|
-
|
|
3368
|
-
},
|
|
3369
|
-
return r({ getFormData:
|
|
3370
|
-
const
|
|
3371
|
-
return openBlock(), createBlock(
|
|
3365
|
+
}, R = (p) => {
|
|
3366
|
+
const f = x();
|
|
3367
|
+
g("action", p, f);
|
|
3368
|
+
}, P = ref({});
|
|
3369
|
+
return r({ getFormData: x, resetFormData: b, getComponentRef: (p) => p ? P.value[p] : P.value, getDynamicComponentsRef: () => a.value }), (p, f) => {
|
|
3370
|
+
const k = resolveComponent("el-form-item"), B = resolveComponent("el-form");
|
|
3371
|
+
return openBlock(), createBlock(B, mergeProps({
|
|
3372
3372
|
model: m.value,
|
|
3373
|
-
class: ["dict-dynamic-components container-class",
|
|
3373
|
+
class: ["dict-dynamic-components container-class", v.value],
|
|
3374
3374
|
ref_key: "DynamicComponentsRef",
|
|
3375
3375
|
ref: a
|
|
3376
|
-
},
|
|
3376
|
+
}, p.$attrs, { colon: w.value }), {
|
|
3377
3377
|
default: withCtx(() => [
|
|
3378
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
3379
|
-
var
|
|
3378
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(y.value, (F, V) => {
|
|
3379
|
+
var J;
|
|
3380
3380
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
3381
|
-
|
|
3382
|
-
|
|
3381
|
+
F.visible ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3382
|
+
F.isFormData ? (openBlock(), createBlock(k, mergeProps({ key: 0 }, F.formItemProps, { class: "comp-item form" }), {
|
|
3383
3383
|
default: withCtx(() => {
|
|
3384
|
-
var
|
|
3384
|
+
var L;
|
|
3385
3385
|
return [
|
|
3386
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
3386
|
+
(openBlock(), createBlock(resolveDynamicComponent(F.compName), mergeProps({
|
|
3387
3387
|
ref_for: !0,
|
|
3388
|
-
ref: (
|
|
3389
|
-
|
|
3388
|
+
ref: (G) => {
|
|
3389
|
+
G && F.fieldName && (P.value[F.fieldName] = G);
|
|
3390
3390
|
},
|
|
3391
|
-
key:
|
|
3392
|
-
},
|
|
3393
|
-
modelValue: m.value[
|
|
3394
|
-
"onUpdate:modelValue": (
|
|
3395
|
-
m.value[
|
|
3391
|
+
key: V
|
|
3392
|
+
}, F.props, {
|
|
3393
|
+
modelValue: m.value[F.fieldName],
|
|
3394
|
+
"onUpdate:modelValue": (G) => {
|
|
3395
|
+
m.value[F.fieldName] = G;
|
|
3396
3396
|
}
|
|
3397
3397
|
}), createSlots({ _: 2 }, [
|
|
3398
|
-
renderList((
|
|
3399
|
-
name:
|
|
3400
|
-
fn: withCtx((
|
|
3398
|
+
renderList((L = F == null ? void 0 : F.props) == null ? void 0 : L.slotList, (G, K) => ({
|
|
3399
|
+
name: G.slotName,
|
|
3400
|
+
fn: withCtx((I) => [
|
|
3401
3401
|
(openBlock(), createBlock(_sfc_main$m, {
|
|
3402
3402
|
key: K,
|
|
3403
|
-
render:
|
|
3404
|
-
scope:
|
|
3403
|
+
render: G.render,
|
|
3404
|
+
scope: I,
|
|
3405
3405
|
formData: m.value
|
|
3406
3406
|
}, null, 8, ["render", "scope", "formData"]))
|
|
3407
3407
|
])
|
|
@@ -3410,20 +3410,20 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3410
3410
|
];
|
|
3411
3411
|
}),
|
|
3412
3412
|
_: 2
|
|
3413
|
-
}, 1040)) : (openBlock(), createBlock(resolveDynamicComponent(
|
|
3413
|
+
}, 1040)) : (openBlock(), createBlock(resolveDynamicComponent(F.compName), mergeProps({
|
|
3414
3414
|
class: "comp-item",
|
|
3415
|
-
key:
|
|
3416
|
-
},
|
|
3417
|
-
onSubmit: (
|
|
3418
|
-
onReset:
|
|
3419
|
-
onAction: (
|
|
3415
|
+
key: V
|
|
3416
|
+
}, F.props, {
|
|
3417
|
+
onSubmit: (L) => D(a.value, F),
|
|
3418
|
+
onReset: S,
|
|
3419
|
+
onAction: (L) => R(F)
|
|
3420
3420
|
}), createSlots({ _: 2 }, [
|
|
3421
|
-
renderList((
|
|
3422
|
-
name:
|
|
3421
|
+
renderList((J = F == null ? void 0 : F.props) == null ? void 0 : J.slotList, (L, G) => ({
|
|
3422
|
+
name: L.slotName,
|
|
3423
3423
|
fn: withCtx((K) => [
|
|
3424
3424
|
(openBlock(), createBlock(_sfc_main$m, {
|
|
3425
|
-
key:
|
|
3426
|
-
render:
|
|
3425
|
+
key: G,
|
|
3426
|
+
render: L.render,
|
|
3427
3427
|
scope: K,
|
|
3428
3428
|
formData: m.value
|
|
3429
3429
|
}, null, 8, ["render", "scope", "formData"]))
|
|
@@ -3481,9 +3481,9 @@ const __vite_glob_0_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3481
3481
|
!e.column.children || e.column.children.length === 0 ? {
|
|
3482
3482
|
name: "default",
|
|
3483
3483
|
fn: withCtx((c) => {
|
|
3484
|
-
var
|
|
3484
|
+
var g, w, y, m, C, _;
|
|
3485
3485
|
return [
|
|
3486
|
-
(
|
|
3486
|
+
(g = unref(n).findNodeByProp(e.column.prop)) != null && g.slotList ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(unref(n).findNodeByProp(e.column.prop).slotList, (l) => (openBlock(), createElementBlock("div", {
|
|
3487
3487
|
key: l.slotName
|
|
3488
3488
|
}, [
|
|
3489
3489
|
(openBlock(), createBlock(_sfc_main$m, {
|
|
@@ -3493,30 +3493,30 @@ const __vite_glob_0_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3493
3493
|
formData: c.row
|
|
3494
3494
|
}, null, 8, ["render", "scope", "formData"]))
|
|
3495
3495
|
]))), 128)) : (w = unref(n).findNodeByProp(e.column.prop)) != null && w.dictType ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3496
|
-
unref(n).findNodeByProp(e.column.prop).dictTypeNode === "button" ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(t(c.row[e.column.prop], unref(n).dictOptions), (l,
|
|
3497
|
-
key:
|
|
3496
|
+
unref(n).findNodeByProp(e.column.prop).dictTypeNode === "button" ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(t(c.row[e.column.prop], unref(n).dictOptions), (l, v) => (openBlock(), createBlock(_sfc_main$n, {
|
|
3497
|
+
key: v,
|
|
3498
3498
|
dictType: unref(n).findNodeByProp(e.column.prop).dictType,
|
|
3499
3499
|
modelValue: l || ""
|
|
3500
|
-
}, null, 8, ["dictType", "modelValue"]))), 128)) : unref(n).findNodeByProp(e.column.prop).dictTypeNode === "link" ? (openBlock(!0), createElementBlock(Fragment, { key: 1 }, renderList(t(c.row[e.column.prop], unref(n).dictOptions), (l,
|
|
3501
|
-
key:
|
|
3500
|
+
}, null, 8, ["dictType", "modelValue"]))), 128)) : unref(n).findNodeByProp(e.column.prop).dictTypeNode === "link" ? (openBlock(!0), createElementBlock(Fragment, { key: 1 }, renderList(t(c.row[e.column.prop], unref(n).dictOptions), (l, v) => (openBlock(), createBlock(_sfc_main$e, {
|
|
3501
|
+
key: v,
|
|
3502
3502
|
dictType: unref(n).findNodeByProp(e.column.prop).dictType,
|
|
3503
3503
|
modelValue: l || ""
|
|
3504
|
-
}, null, 8, ["dictType", "modelValue"]))), 128)) : unref(n).findNodeByProp(e.column.prop).dictTypeNode === "tag" ? (openBlock(!0), createElementBlock(Fragment, { key: 2 }, renderList(t(c.row[e.column.prop], unref(n).dictOptions), (l,
|
|
3505
|
-
key:
|
|
3504
|
+
}, null, 8, ["dictType", "modelValue"]))), 128)) : unref(n).findNodeByProp(e.column.prop).dictTypeNode === "tag" ? (openBlock(!0), createElementBlock(Fragment, { key: 2 }, renderList(t(c.row[e.column.prop], unref(n).dictOptions), (l, v) => (openBlock(), createBlock(_sfc_main$f, {
|
|
3505
|
+
key: v,
|
|
3506
3506
|
dictType: unref(n).findNodeByProp(e.column.prop).dictType,
|
|
3507
3507
|
modelValue: l || ""
|
|
3508
|
-
}, null, 8, ["dictType", "modelValue"]))), 128)) : unref(n).findNodeByProp(e.column.prop).dictTypeNode === "text" ? (openBlock(!0), createElementBlock(Fragment, { key: 3 }, renderList(t(c.row[e.column.prop], unref(n).dictOptions), (l,
|
|
3509
|
-
key:
|
|
3508
|
+
}, null, 8, ["dictType", "modelValue"]))), 128)) : unref(n).findNodeByProp(e.column.prop).dictTypeNode === "text" ? (openBlock(!0), createElementBlock(Fragment, { key: 3 }, renderList(t(c.row[e.column.prop], unref(n).dictOptions), (l, v) => (openBlock(), createBlock(_sfc_main$d, {
|
|
3509
|
+
key: v,
|
|
3510
3510
|
dictType: unref(n).findNodeByProp(e.column.prop).dictType,
|
|
3511
3511
|
modelValue: l || ""
|
|
3512
3512
|
}, null, 8, ["dictType", "modelValue"]))), 128)) : (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
3513
3513
|
createTextVNode(toDisplayString(unref(n).GetLabelByCodesFilter(c.row[e.column.prop], unref(n).findNodeByProp(e.column.prop).dictType, unref(n).dictOptions(unref(n).findNodeByProp(e.column.prop)))), 1)
|
|
3514
3514
|
], 64))
|
|
3515
|
-
], 64)) : (
|
|
3515
|
+
], 64)) : (y = unref(n).findNodeByProp(e.column.prop)) != null && y.dictTreeType ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
3516
3516
|
createTextVNode(toDisplayString(unref(n).GetTreeLabelByCodesFilter(c.row[e.column.prop], unref(n).findNodeByProp(e.column.prop).dictTreeType, unref(n).dictTreeOptions(unref(n).findNodeByProp(e.column.prop)))), 1)
|
|
3517
3517
|
], 64)) : (m = unref(n).findNodeByProp(e.column.prop)) != null && m.dateFormat ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
3518
3518
|
createTextVNode(toDisplayString(unref(n).FormatDate(c.row[e.column.prop], unref(n).findNodeByProp(e.column.prop).dateFormat, unref(n).findNodeByProp(e.column.prop).defaultVal)), 1)
|
|
3519
|
-
], 64)) : (C = unref(n).findNodeByProp(e.column.prop)) != null && C.maskType || (
|
|
3519
|
+
], 64)) : (C = unref(n).findNodeByProp(e.column.prop)) != null && C.maskType || (_ = unref(n).findNodeByProp(e.column.prop)) != null && _.maskStart ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
3520
3520
|
createTextVNode(toDisplayString(unref(n).Desensitization(c.row[e.column.prop], unref(n).maskOptions(unref(n).findNodeByProp(e.column.prop)))), 1)
|
|
3521
3521
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 5 }, [
|
|
3522
3522
|
createTextVNode(toDisplayString(c.row[e.column.prop] || unref(n).defaultVal), 1)
|
|
@@ -3556,11 +3556,11 @@ const __vite_glob_0_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3556
3556
|
return i.defaultVal && (s.defaultVal = i.defaultVal), i.formatFun && (s.formatFun = i.formatFun), i.spacer && (s.spacer = i.spacer), s;
|
|
3557
3557
|
}, o = (i, s = d.tableHeader) => {
|
|
3558
3558
|
for (let c = 0; c < s.length; c++) {
|
|
3559
|
-
const
|
|
3560
|
-
if (
|
|
3561
|
-
return
|
|
3562
|
-
if (
|
|
3563
|
-
const w = o(i,
|
|
3559
|
+
const g = s[c];
|
|
3560
|
+
if (g.prop === i)
|
|
3561
|
+
return g;
|
|
3562
|
+
if (g.children && g.children.length > 0) {
|
|
3563
|
+
const w = o(i, g.children);
|
|
3564
3564
|
if (w)
|
|
3565
3565
|
return w;
|
|
3566
3566
|
}
|
|
@@ -3610,6 +3610,37 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3610
3610
|
}, {
|
|
3611
3611
|
__name: "index",
|
|
3612
3612
|
props: {
|
|
3613
|
+
expandText: {
|
|
3614
|
+
type: String,
|
|
3615
|
+
default: "展开"
|
|
3616
|
+
},
|
|
3617
|
+
foldText: {
|
|
3618
|
+
type: String,
|
|
3619
|
+
default: "收起"
|
|
3620
|
+
},
|
|
3621
|
+
searchText: {
|
|
3622
|
+
type: String,
|
|
3623
|
+
default: "查 询"
|
|
3624
|
+
},
|
|
3625
|
+
resetText: {
|
|
3626
|
+
type: String,
|
|
3627
|
+
default: "重 置"
|
|
3628
|
+
},
|
|
3629
|
+
// 重置时 折叠
|
|
3630
|
+
foldOnReset: {
|
|
3631
|
+
type: Boolean,
|
|
3632
|
+
default: !0
|
|
3633
|
+
},
|
|
3634
|
+
// 当隐藏的搜索框有值时 点击查询 自动展开
|
|
3635
|
+
expandOnNoEmptySearch: {
|
|
3636
|
+
type: Boolean,
|
|
3637
|
+
default: !0
|
|
3638
|
+
},
|
|
3639
|
+
// 错误时 自动展开
|
|
3640
|
+
expandOnError: {
|
|
3641
|
+
type: Boolean,
|
|
3642
|
+
default: !1
|
|
3643
|
+
},
|
|
3613
3644
|
modelValue: {
|
|
3614
3645
|
type: Object,
|
|
3615
3646
|
default: () => ({})
|
|
@@ -3666,46 +3697,54 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3666
3697
|
},
|
|
3667
3698
|
emits: ["fail", "pass", "reset", "update:modelValue"],
|
|
3668
3699
|
setup(e, { emit: r }) {
|
|
3669
|
-
const d = e, {
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3700
|
+
const d = e, { expandText: t, foldText: n, searchText: a, resetText: u, foldOnReset: o, expandOnNoEmptySearch: i, expandOnError: s, modelValue: c, rows: g, isAutoSetPlaceholder: w, isShowLabelPlaceholder: y, list: m, largeWidth: C, mediumWidth: _, smallWidth: l, foldStatus: v, showFold: b, showReset: E, showSearch: T } = toRefs(d), x = r, j = ref(v.value), A = ref(window.innerWidth), D = computed(() => A.value > C.value ? 4 : A.value > _.value ? 3 : A.value > l.value ? 2 : 1), S = computed(() => {
|
|
3701
|
+
const L = [];
|
|
3702
|
+
for (let G = 0; G < m.value.length; G++) {
|
|
3703
|
+
const K = m.value[G], I = G;
|
|
3704
|
+
let M = !1;
|
|
3705
|
+
D.value === 1 ? M = b.value && j.value && I + 1 > g.value : M = b.value && j.value && I + 1 > g.value * D.value - 1, M && K.fieldName && L.push(K.fieldName);
|
|
3706
|
+
}
|
|
3707
|
+
return L;
|
|
3708
|
+
}), R = (L) => {
|
|
3709
|
+
let G = "";
|
|
3710
|
+
return D.value === 4 ? G += "quarter" : D.value === 3 ? G += "triple" : D.value === 2 ? G += "half" : G += "full", D.value === 1 ? b.value && j.value && L + 1 > g.value && (G += " hide") : b.value && j.value && L + 1 > g.value * D.value - 1 && (G += " hide"), G;
|
|
3711
|
+
}, P = ref(null);
|
|
3712
|
+
let O = null, $ = null;
|
|
3713
|
+
const p = (L) => {
|
|
3714
|
+
$ && clearTimeout($), $ = setTimeout(() => {
|
|
3715
|
+
L && L.length > 0 && (A.value = L[0].contentRect.width);
|
|
3677
3716
|
}, 300);
|
|
3678
3717
|
};
|
|
3679
3718
|
onMounted(() => {
|
|
3680
|
-
var
|
|
3681
|
-
const
|
|
3682
|
-
|
|
3719
|
+
var G;
|
|
3720
|
+
const L = (G = P.value) == null ? void 0 : G.$el;
|
|
3721
|
+
L && (A.value = L.offsetWidth, O = new ResizeObserver(p), O.observe(L));
|
|
3683
3722
|
}), onUnmounted(() => {
|
|
3684
|
-
|
|
3723
|
+
O && (O.disconnect(), O = null);
|
|
3685
3724
|
});
|
|
3686
|
-
const
|
|
3687
|
-
var
|
|
3688
|
-
const
|
|
3689
|
-
let
|
|
3690
|
-
for (let
|
|
3691
|
-
const
|
|
3692
|
-
if (
|
|
3693
|
-
|
|
3694
|
-
const
|
|
3695
|
-
|
|
3725
|
+
const f = ref({}), k = (L) => {
|
|
3726
|
+
var I;
|
|
3727
|
+
const G = {};
|
|
3728
|
+
let K = [];
|
|
3729
|
+
for (let M = 0; M < L.length; M++) {
|
|
3730
|
+
const W = L[M];
|
|
3731
|
+
if (W.fieldName && !K.includes(W.fieldName)) {
|
|
3732
|
+
K.push(W.fieldName);
|
|
3733
|
+
const z = (I = c.value) == null ? void 0 : I[W.fieldName];
|
|
3734
|
+
G[W.fieldName] = (W == null ? void 0 : W.modelValue) !== void 0 ? W.modelValue : z !== void 0 ? z : null;
|
|
3696
3735
|
} else
|
|
3697
|
-
console.warn("字段名称重复:",
|
|
3736
|
+
console.warn("字段名称重复:", W.fieldName);
|
|
3698
3737
|
}
|
|
3699
|
-
|
|
3738
|
+
f.value = JSON.parse(JSON.stringify(G));
|
|
3700
3739
|
};
|
|
3701
3740
|
watch(
|
|
3702
|
-
() => ({ ...
|
|
3741
|
+
() => ({ ...f.value }),
|
|
3703
3742
|
() => {
|
|
3704
|
-
const
|
|
3705
|
-
...JSON.parse(JSON.stringify(
|
|
3706
|
-
...
|
|
3743
|
+
const L = {
|
|
3744
|
+
...JSON.parse(JSON.stringify(c.value || {})),
|
|
3745
|
+
...f.value
|
|
3707
3746
|
};
|
|
3708
|
-
|
|
3747
|
+
x("update:modelValue", L);
|
|
3709
3748
|
},
|
|
3710
3749
|
{
|
|
3711
3750
|
deep: !0,
|
|
@@ -3713,66 +3752,69 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3713
3752
|
}
|
|
3714
3753
|
), watch(
|
|
3715
3754
|
() => d.list,
|
|
3716
|
-
(
|
|
3717
|
-
|
|
3755
|
+
(L) => {
|
|
3756
|
+
k(L);
|
|
3718
3757
|
},
|
|
3719
3758
|
{
|
|
3720
3759
|
immediate: !0
|
|
3721
3760
|
}
|
|
3722
3761
|
);
|
|
3723
|
-
const
|
|
3724
|
-
var
|
|
3725
|
-
if ((
|
|
3726
|
-
return (
|
|
3727
|
-
if (
|
|
3728
|
-
return
|
|
3729
|
-
},
|
|
3730
|
-
await nextTick(),
|
|
3731
|
-
|
|
3762
|
+
const B = computed(() => D.value === 1 ? m.value.length > g.value : m.value.length > g.value * D.value - 1), F = (L) => {
|
|
3763
|
+
var G, K;
|
|
3764
|
+
if ((G = L == null ? void 0 : L.props) != null && G.placeholder)
|
|
3765
|
+
return (K = L == null ? void 0 : L.props) == null ? void 0 : K.placeholder;
|
|
3766
|
+
if (w.value)
|
|
3767
|
+
return L.compName.toLocaleLowerCase().includes("input") ? y.value ? "请输入" + L.label : "请输入" : y.value ? "请选择" + L.label : "请选择";
|
|
3768
|
+
}, V = async () => {
|
|
3769
|
+
await nextTick(), P.value.resetFields(), setTimeout(() => {
|
|
3770
|
+
o.value && (j.value = !0), x("reset");
|
|
3732
3771
|
}, 100);
|
|
3733
|
-
},
|
|
3734
|
-
await nextTick(),
|
|
3735
|
-
|
|
3772
|
+
}, J = async () => {
|
|
3773
|
+
await nextTick(), P.value.validate((L, G) => {
|
|
3774
|
+
L ? (Object.keys(f.value).filter((M) => {
|
|
3775
|
+
const W = f.value[M];
|
|
3776
|
+
return !(W == null || W === "" || typeof W == "number" && Number.isNaN(W) || Array.isArray(W) && W.length === 0 || typeof W == "string" && W.trim() === "");
|
|
3777
|
+
}).some((M) => S.value.includes(M)) && i.value && (j.value = !1), x("pass", f.value)) : ((Object.keys(G).some((M) => S.value.includes(M)) || s.value) && (j.value = !1), x("fail", G, f.value));
|
|
3736
3778
|
});
|
|
3737
3779
|
};
|
|
3738
|
-
return (
|
|
3780
|
+
return (L, G) => (openBlock(), createBlock(unref(ElForm), mergeProps({
|
|
3739
3781
|
ref_key: "searchFormRef",
|
|
3740
|
-
ref:
|
|
3782
|
+
ref: P,
|
|
3741
3783
|
style: { minWidth: e.minWidth + "px" },
|
|
3742
|
-
model:
|
|
3784
|
+
model: f.value,
|
|
3743
3785
|
class: "dict-search-box dict-clearfix"
|
|
3744
|
-
},
|
|
3786
|
+
}, L.$attrs), {
|
|
3745
3787
|
default: withCtx(() => [
|
|
3746
|
-
renderSlot(
|
|
3747
|
-
searchForm:
|
|
3748
|
-
fold:
|
|
3749
|
-
itemsPerRow:
|
|
3788
|
+
renderSlot(L.$slots, "prepend", {
|
|
3789
|
+
searchForm: f.value,
|
|
3790
|
+
fold: j.value,
|
|
3791
|
+
itemsPerRow: D.value
|
|
3750
3792
|
}, void 0, !0),
|
|
3751
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
3752
|
-
key:
|
|
3753
|
-
class:
|
|
3754
|
-
label:
|
|
3755
|
-
prop:
|
|
3756
|
-
},
|
|
3793
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(m), (K, I) => (openBlock(), createBlock(unref(ElFormItem), mergeProps({
|
|
3794
|
+
key: I,
|
|
3795
|
+
class: R(I),
|
|
3796
|
+
label: K.label,
|
|
3797
|
+
prop: K.fieldName
|
|
3798
|
+
}, K.formItemProps), {
|
|
3757
3799
|
default: withCtx(() => {
|
|
3758
|
-
var
|
|
3800
|
+
var M, W;
|
|
3759
3801
|
return [
|
|
3760
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
3761
|
-
modelValue:
|
|
3762
|
-
"onUpdate:modelValue": (
|
|
3763
|
-
|
|
3802
|
+
(openBlock(), createBlock(resolveDynamicComponent(K.compName), mergeProps({
|
|
3803
|
+
modelValue: f.value[K.fieldName],
|
|
3804
|
+
"onUpdate:modelValue": (z) => {
|
|
3805
|
+
f.value[K.fieldName] = z;
|
|
3764
3806
|
},
|
|
3765
|
-
clearable: ((
|
|
3766
|
-
placeholder:
|
|
3767
|
-
},
|
|
3768
|
-
renderList((
|
|
3769
|
-
name:
|
|
3770
|
-
fn: withCtx((
|
|
3807
|
+
clearable: ((M = K == null ? void 0 : K.props) == null ? void 0 : M.clearable) || !0,
|
|
3808
|
+
placeholder: F(K)
|
|
3809
|
+
}, K.props), createSlots({ _: 2 }, [
|
|
3810
|
+
renderList((W = K == null ? void 0 : K.props) == null ? void 0 : W.slotList, (z, N) => ({
|
|
3811
|
+
name: z.slotName,
|
|
3812
|
+
fn: withCtx((q) => [
|
|
3771
3813
|
(openBlock(), createBlock(_sfc_main$m, {
|
|
3772
|
-
key:
|
|
3773
|
-
render:
|
|
3774
|
-
scope:
|
|
3775
|
-
formData:
|
|
3814
|
+
key: N,
|
|
3815
|
+
render: z.render,
|
|
3816
|
+
scope: q,
|
|
3817
|
+
formData: f.value
|
|
3776
3818
|
}, null, 8, ["render", "scope", "formData"]))
|
|
3777
3819
|
])
|
|
3778
3820
|
}))
|
|
@@ -3782,52 +3824,52 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3782
3824
|
_: 2
|
|
3783
3825
|
}, 1040, ["class", "label", "prop"]))), 128)),
|
|
3784
3826
|
createVNode(unref(ElFormItem), {
|
|
3785
|
-
class: normalizeClass(
|
|
3827
|
+
class: normalizeClass(R(0) + " fr")
|
|
3786
3828
|
}, {
|
|
3787
3829
|
default: withCtx(() => [
|
|
3788
|
-
renderSlot(
|
|
3789
|
-
searchForm:
|
|
3790
|
-
fold:
|
|
3791
|
-
itemsPerRow:
|
|
3830
|
+
renderSlot(L.$slots, "button-prefix", {
|
|
3831
|
+
searchForm: f.value,
|
|
3832
|
+
fold: j.value,
|
|
3833
|
+
itemsPerRow: D.value
|
|
3792
3834
|
}, void 0, !0),
|
|
3793
3835
|
withDirectives(createVNode(unref(ElButton), {
|
|
3794
3836
|
plain: "",
|
|
3795
|
-
onClick:
|
|
3837
|
+
onClick: V
|
|
3796
3838
|
}, {
|
|
3797
3839
|
default: withCtx(() => [
|
|
3798
|
-
createTextVNode(
|
|
3840
|
+
createTextVNode(toDisplayString(unref(u)), 1)
|
|
3799
3841
|
]),
|
|
3800
3842
|
_: 1
|
|
3801
3843
|
}, 512), [
|
|
3802
|
-
[vShow, unref(
|
|
3844
|
+
[vShow, unref(E)]
|
|
3803
3845
|
]),
|
|
3804
3846
|
withDirectives(createVNode(unref(ElButton), {
|
|
3805
3847
|
type: "primary",
|
|
3806
|
-
onClick:
|
|
3848
|
+
onClick: J
|
|
3807
3849
|
}, {
|
|
3808
3850
|
default: withCtx(() => [
|
|
3809
|
-
createTextVNode(
|
|
3851
|
+
createTextVNode(toDisplayString(unref(a)), 1)
|
|
3810
3852
|
]),
|
|
3811
3853
|
_: 1
|
|
3812
3854
|
}, 512), [
|
|
3813
|
-
[vShow, unref(
|
|
3855
|
+
[vShow, unref(T)]
|
|
3814
3856
|
]),
|
|
3815
|
-
renderSlot(
|
|
3816
|
-
searchForm:
|
|
3817
|
-
fold:
|
|
3818
|
-
itemsPerRow:
|
|
3857
|
+
renderSlot(L.$slots, "button-suffix", {
|
|
3858
|
+
searchForm: f.value,
|
|
3859
|
+
fold: j.value,
|
|
3860
|
+
itemsPerRow: D.value
|
|
3819
3861
|
}, void 0, !0),
|
|
3820
|
-
unref(
|
|
3862
|
+
unref(b) && B.value ? (openBlock(), createBlock(unref(ElLink), {
|
|
3821
3863
|
key: 0,
|
|
3822
3864
|
class: "no-underline",
|
|
3823
3865
|
underline: "never",
|
|
3824
3866
|
type: "primary",
|
|
3825
|
-
onClick:
|
|
3867
|
+
onClick: G[0] || (G[0] = (K) => j.value = !j.value)
|
|
3826
3868
|
}, {
|
|
3827
3869
|
default: withCtx(() => [
|
|
3828
|
-
createTextVNode(toDisplayString(
|
|
3870
|
+
createTextVNode(toDisplayString(j.value ? unref(t) : unref(n)), 1),
|
|
3829
3871
|
createVNode(unref(ElIcon), {
|
|
3830
|
-
class: normalizeClass(
|
|
3872
|
+
class: normalizeClass(j.value ? "" : "rotate")
|
|
3831
3873
|
}, {
|
|
3832
3874
|
default: withCtx(() => [
|
|
3833
3875
|
createVNode(unref(ArrowDown))
|
|
@@ -3840,16 +3882,16 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3840
3882
|
]),
|
|
3841
3883
|
_: 3
|
|
3842
3884
|
}, 8, ["class"]),
|
|
3843
|
-
renderSlot(
|
|
3844
|
-
searchForm:
|
|
3845
|
-
fold:
|
|
3846
|
-
itemsPerRow:
|
|
3885
|
+
renderSlot(L.$slots, "append", {
|
|
3886
|
+
searchForm: f.value,
|
|
3887
|
+
fold: j.value,
|
|
3888
|
+
itemsPerRow: D.value
|
|
3847
3889
|
}, void 0, !0)
|
|
3848
3890
|
]),
|
|
3849
3891
|
_: 3
|
|
3850
3892
|
}, 16, ["style", "model"]));
|
|
3851
3893
|
}
|
|
3852
|
-
}), dictComponent$1 = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-
|
|
3894
|
+
}), dictComponent$1 = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-9701cfcc"]]);
|
|
3853
3895
|
dictComponent$1.install = function(e) {
|
|
3854
3896
|
e.component(dictComponent$1.name, dictComponent$1);
|
|
3855
3897
|
};
|
|
@@ -3892,8 +3934,8 @@ const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
3892
3934
|
},
|
|
3893
3935
|
emits: ["update:modelValue", "focus", "blur"],
|
|
3894
3936
|
setup(e, { emit: r }) {
|
|
3895
|
-
const d = e, { modelValue: t, maskType: n, maskStart: a, maskMiddle: u, maskEnd: o, maskSymbol: i } = toRefs(d), s = r, c = ref(d.modelValue),
|
|
3896
|
-
const
|
|
3937
|
+
const d = e, { modelValue: t, maskType: n, maskStart: a, maskMiddle: u, maskEnd: o, maskSymbol: i } = toRefs(d), s = r, c = ref(d.modelValue), g = ref(!1), w = computed(() => !!n.value || Number(a.value) > 0 || Number(u.value) > 0 || Number(o.value) > 0), y = computed(() => {
|
|
3938
|
+
const v = {
|
|
3897
3939
|
start: Number(a.value) || 0,
|
|
3898
3940
|
middle: Number(u.value) || 0,
|
|
3899
3941
|
end: Number(o.value) || 0,
|
|
@@ -3901,45 +3943,45 @@ const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
3901
3943
|
defaultVal: ""
|
|
3902
3944
|
};
|
|
3903
3945
|
return typeof n.value == "string" ? n.value : Array.isArray(n.value) ? {
|
|
3904
|
-
...
|
|
3905
|
-
start: n.value[0] ||
|
|
3906
|
-
middle: n.value[1] ||
|
|
3907
|
-
end: n.value[2] ||
|
|
3908
|
-
symbol: n.value[3] ||
|
|
3909
|
-
} : typeof n.value == "object" && n.value !== null ? { ...
|
|
3910
|
-
}), m = (
|
|
3911
|
-
|
|
3912
|
-
}, C = inject("elFormItem", null),
|
|
3913
|
-
|
|
3914
|
-
}, l = (
|
|
3915
|
-
|
|
3946
|
+
...v,
|
|
3947
|
+
start: n.value[0] || v.start,
|
|
3948
|
+
middle: n.value[1] || v.middle,
|
|
3949
|
+
end: n.value[2] || v.end,
|
|
3950
|
+
symbol: n.value[3] || v.symbol
|
|
3951
|
+
} : typeof n.value == "object" && n.value !== null ? { ...v, ...n.value } : v;
|
|
3952
|
+
}), m = (v = t.value) => {
|
|
3953
|
+
g.value ? c.value = v : w.value ? c.value = Desensitization(v, y.value) : c.value = v;
|
|
3954
|
+
}, C = inject("elFormItem", null), _ = (v) => {
|
|
3955
|
+
g.value = !0, m(), s("focus", v);
|
|
3956
|
+
}, l = (v) => {
|
|
3957
|
+
g.value = !1, s("update:modelValue", c.value), m(), s("blur", v), C && C.validate("blur");
|
|
3916
3958
|
};
|
|
3917
3959
|
return watch(
|
|
3918
3960
|
c,
|
|
3919
|
-
(
|
|
3920
|
-
|
|
3961
|
+
(v) => {
|
|
3962
|
+
g.value && s("update:modelValue", v);
|
|
3921
3963
|
},
|
|
3922
3964
|
{ immediate: !1 }
|
|
3923
3965
|
), watch(
|
|
3924
3966
|
t,
|
|
3925
|
-
(
|
|
3926
|
-
m(
|
|
3967
|
+
(v) => {
|
|
3968
|
+
m(v);
|
|
3927
3969
|
},
|
|
3928
3970
|
{ immediate: !0, deep: !0 }
|
|
3929
3971
|
), onUnmounted(() => {
|
|
3930
|
-
|
|
3931
|
-
}), (
|
|
3972
|
+
g.value = !1;
|
|
3973
|
+
}), (v, b) => (openBlock(), createBlock(unref(ElInput), mergeProps({
|
|
3932
3974
|
modelValue: c.value,
|
|
3933
|
-
"onUpdate:modelValue":
|
|
3934
|
-
},
|
|
3935
|
-
onFocus:
|
|
3975
|
+
"onUpdate:modelValue": b[0] || (b[0] = (E) => c.value = E)
|
|
3976
|
+
}, v.$attrs, {
|
|
3977
|
+
onFocus: _,
|
|
3936
3978
|
onBlur: l,
|
|
3937
3979
|
autocomplete: "off"
|
|
3938
3980
|
}), createSlots({ _: 2 }, [
|
|
3939
|
-
renderList(
|
|
3940
|
-
name:
|
|
3941
|
-
fn: withCtx((
|
|
3942
|
-
renderSlot(
|
|
3981
|
+
renderList(v.$slots, (E, T, x) => ({
|
|
3982
|
+
name: T,
|
|
3983
|
+
fn: withCtx((j) => [
|
|
3984
|
+
renderSlot(v.$slots, T, normalizeProps(guardReactiveProps(j)))
|
|
3943
3985
|
])
|
|
3944
3986
|
}))
|
|
3945
3987
|
]), 1040, ["modelValue"]));
|
|
@@ -4008,80 +4050,80 @@ const __vite_glob_0_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4008
4050
|
},
|
|
4009
4051
|
emits: ["dictChange"],
|
|
4010
4052
|
setup(e, { expose: r, emit: d }) {
|
|
4011
|
-
const t = e, { disabled: n, addAllText: a, data: u, format: o, dictType: i, disabledObj: s, keyValue: c, filterDataFun:
|
|
4012
|
-
const
|
|
4013
|
-
return Object.entries(
|
|
4014
|
-
const
|
|
4015
|
-
if (!
|
|
4016
|
-
const
|
|
4017
|
-
|
|
4053
|
+
const t = e, { disabled: n, addAllText: a, data: u, format: o, dictType: i, disabledObj: s, keyValue: c, filterDataFun: g, disabledDataFun: w } = toRefs(t), y = useAttrs(), m = computed(() => {
|
|
4054
|
+
const f = {};
|
|
4055
|
+
return Object.entries(y).forEach(([k, B]) => {
|
|
4056
|
+
const F = ToKebabCase(k);
|
|
4057
|
+
if (!F.startsWith("radio-button-") && !F.startsWith("on-radio-button-")) {
|
|
4058
|
+
const V = ToCamelCase(F);
|
|
4059
|
+
f[V] = B;
|
|
4018
4060
|
}
|
|
4019
|
-
}),
|
|
4061
|
+
}), f;
|
|
4020
4062
|
}), C = computed(() => {
|
|
4021
|
-
const
|
|
4022
|
-
return Object.entries(
|
|
4023
|
-
const
|
|
4024
|
-
if (
|
|
4025
|
-
const
|
|
4026
|
-
|
|
4063
|
+
const f = {};
|
|
4064
|
+
return Object.entries(y).forEach(([k, B]) => {
|
|
4065
|
+
const F = ToKebabCase(k);
|
|
4066
|
+
if (F.startsWith("radio-button-") || F.startsWith("on-radio-button-")) {
|
|
4067
|
+
const V = ToCamelCase(F.replace("radio-button-", ""));
|
|
4068
|
+
f[V] = B;
|
|
4027
4069
|
}
|
|
4028
|
-
}),
|
|
4029
|
-
}),
|
|
4070
|
+
}), f;
|
|
4071
|
+
}), _ = ref(""), l = toRaw(store.state.dictConfig), v = d, b = (f) => {
|
|
4030
4072
|
if (!c.value) {
|
|
4031
|
-
|
|
4073
|
+
v("dictChange", f);
|
|
4032
4074
|
return;
|
|
4033
4075
|
}
|
|
4034
|
-
const
|
|
4035
|
-
|
|
4036
|
-
},
|
|
4076
|
+
const k = E.list.find((B) => B[l.format.value] === f);
|
|
4077
|
+
v("dictChange", k);
|
|
4078
|
+
}, E = reactive({
|
|
4037
4079
|
list: []
|
|
4038
|
-
}),
|
|
4080
|
+
}), T = async () => {
|
|
4039
4081
|
if (!i.value || u.value && u.value.length > 0)
|
|
4040
4082
|
return;
|
|
4041
|
-
let
|
|
4083
|
+
let f = [];
|
|
4042
4084
|
if (typeof i.value == "object") {
|
|
4043
|
-
|
|
4044
|
-
const
|
|
4045
|
-
|
|
4046
|
-
const { filters:
|
|
4047
|
-
|
|
4085
|
+
_.value = i.value.type;
|
|
4086
|
+
const k = await store.actions.getDictDataObj(_.value);
|
|
4087
|
+
f = [].concat(k[_.value]);
|
|
4088
|
+
const { filters: B, filterType: F = l.format.value, reverse: V = !1 } = i.value, J = typeof B == "string" ? B.split(",") : B;
|
|
4089
|
+
V ? f = f.filter((L) => !J.includes(L[F])) : f = f.filter((L) => J.includes(L[F]));
|
|
4048
4090
|
} else {
|
|
4049
|
-
|
|
4050
|
-
const
|
|
4051
|
-
|
|
4091
|
+
_.value = i.value;
|
|
4092
|
+
const k = await store.actions.getDictDataObj(_.value);
|
|
4093
|
+
f = [].concat(k[_.value]);
|
|
4052
4094
|
}
|
|
4053
|
-
if (
|
|
4054
|
-
|
|
4055
|
-
...
|
|
4056
|
-
[l.format.disabled]: w.value(
|
|
4095
|
+
if (g.value && (f = g.value(f)), w.value)
|
|
4096
|
+
f = f.map((k) => ({
|
|
4097
|
+
...k,
|
|
4098
|
+
[l.format.disabled]: w.value(k)
|
|
4057
4099
|
}));
|
|
4058
4100
|
else if (s.value) {
|
|
4059
|
-
const { disabledValues:
|
|
4060
|
-
|
|
4061
|
-
const
|
|
4062
|
-
return
|
|
4063
|
-
}) :
|
|
4064
|
-
const
|
|
4065
|
-
return
|
|
4101
|
+
const { disabledValues: k, disabledType: B = l.format.value, reverse: F = !1 } = s.value, V = typeof k == "string" ? k.split(",") : k;
|
|
4102
|
+
F ? f = f.map((J) => {
|
|
4103
|
+
const L = JSON.parse(JSON.stringify(J));
|
|
4104
|
+
return L[l.format.disabled] = !V.includes(L[B]) || L[l.format.disabled], L;
|
|
4105
|
+
}) : f = f.map((J) => {
|
|
4106
|
+
const L = JSON.parse(JSON.stringify(J));
|
|
4107
|
+
return L[l.format.disabled] = V.includes(L[B]) || L[l.format.disabled], L;
|
|
4066
4108
|
});
|
|
4067
4109
|
}
|
|
4068
|
-
a.value &&
|
|
4110
|
+
a.value && f.unshift({
|
|
4069
4111
|
[l.format.value]: "",
|
|
4070
4112
|
[l.format.label]: a.value
|
|
4071
|
-
}),
|
|
4072
|
-
},
|
|
4113
|
+
}), E.list = f;
|
|
4114
|
+
}, x = computed(() => store.state.isGettingDictTypes.includes(_.value)), j = computed(() => store.state.isGettingAllDictTypes), A = computed(() => u.value), D = inject(formItemContextKey), S = inject(formContextKey), R = computed(() => n.value || y["radio-disabled"] === "" || y["radio-disabled"] || y.radioDisabled === "" || y.radioDisabled || y.RadioDisabled === "" || y.RadioDisabled || (D == null ? void 0 : D.disabled) || (S == null ? void 0 : S.disabled) || !1);
|
|
4073
4115
|
watch(
|
|
4074
|
-
[
|
|
4075
|
-
([
|
|
4076
|
-
!
|
|
4077
|
-
[l.format.value]:
|
|
4078
|
-
[l.format.label]:
|
|
4079
|
-
[l.format.disabled]: !!
|
|
4080
|
-
...
|
|
4081
|
-
})) :
|
|
4082
|
-
[l.format.value]:
|
|
4083
|
-
[l.format.label]:
|
|
4084
|
-
})), a.value &&
|
|
4116
|
+
[x, j, A],
|
|
4117
|
+
([f, k, B]) => {
|
|
4118
|
+
!f && !k && B && B.length === 0 && T(), B.length > 0 && (E.list = JSON.parse(JSON.stringify(B)), E.list.length > 0 && (Object.prototype.toString.call(E.list[0]) === "[object Object]" ? E.list = E.list.map((V) => ({
|
|
4119
|
+
[l.format.value]: V[o.value.value],
|
|
4120
|
+
[l.format.label]: V[o.value.label],
|
|
4121
|
+
[l.format.disabled]: !!V[o.value.disabled],
|
|
4122
|
+
...V
|
|
4123
|
+
})) : E.list = E.list.map((V) => ({
|
|
4124
|
+
[l.format.value]: V,
|
|
4125
|
+
[l.format.label]: V
|
|
4126
|
+
})), a.value && E.list.unshift({
|
|
4085
4127
|
[l.format.value]: "",
|
|
4086
4128
|
[l.format.label]: a.value
|
|
4087
4129
|
})));
|
|
@@ -4090,34 +4132,34 @@ const __vite_glob_0_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4090
4132
|
immediate: !0
|
|
4091
4133
|
}
|
|
4092
4134
|
);
|
|
4093
|
-
const
|
|
4094
|
-
return r({ getElRadioGroupRef: () =>
|
|
4135
|
+
const P = ref([]), O = () => P.value, $ = ref(null);
|
|
4136
|
+
return r({ getElRadioGroupRef: () => $.value, getElRadioButtonRefs: O }), (f, k) => (openBlock(), createBlock(unref(ElRadioGroup), mergeProps({
|
|
4095
4137
|
ref_key: "ElRadioGroupRef",
|
|
4096
|
-
ref:
|
|
4097
|
-
disabled:
|
|
4098
|
-
}, m.value, { onChange:
|
|
4138
|
+
ref: $,
|
|
4139
|
+
disabled: R.value
|
|
4140
|
+
}, m.value, { onChange: b }), createSlots({
|
|
4099
4141
|
default: withCtx(() => [
|
|
4100
|
-
|
|
4142
|
+
f.$attrs.options ? createCommentVNode("", !0) : (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(E.list, (B, F) => (openBlock(), createBlock(unref(ElRadioButton), mergeProps({
|
|
4101
4143
|
ref_for: !0,
|
|
4102
|
-
ref: (
|
|
4103
|
-
|
|
4144
|
+
ref: (V) => {
|
|
4145
|
+
V && (P.value[F] = V);
|
|
4104
4146
|
},
|
|
4105
|
-
key:
|
|
4106
|
-
disabled:
|
|
4107
|
-
label:
|
|
4147
|
+
key: B[unref(l).format.value],
|
|
4148
|
+
disabled: R.value || B[unref(l).format.disabled],
|
|
4149
|
+
label: B[unref(l).format.value]
|
|
4108
4150
|
}, C.value), {
|
|
4109
4151
|
default: withCtx(() => [
|
|
4110
|
-
createTextVNode(toDisplayString(
|
|
4152
|
+
createTextVNode(toDisplayString(B[unref(l).format.label]), 1)
|
|
4111
4153
|
]),
|
|
4112
4154
|
_: 2
|
|
4113
4155
|
}, 1040, ["disabled", "label"]))), 128))
|
|
4114
4156
|
]),
|
|
4115
4157
|
_: 2
|
|
4116
4158
|
}, [
|
|
4117
|
-
renderList(
|
|
4118
|
-
name:
|
|
4119
|
-
fn: withCtx((
|
|
4120
|
-
renderSlot(
|
|
4159
|
+
renderList(f.$slots, (B, F, V) => ({
|
|
4160
|
+
name: F,
|
|
4161
|
+
fn: withCtx((J) => [
|
|
4162
|
+
renderSlot(f.$slots, F, normalizeProps(guardReactiveProps(J)))
|
|
4121
4163
|
])
|
|
4122
4164
|
}))
|
|
4123
4165
|
]), 1040, ["disabled"]));
|
|
@@ -4181,80 +4223,80 @@ const __vite_glob_0_13 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4181
4223
|
},
|
|
4182
4224
|
emits: ["dictChange"],
|
|
4183
4225
|
setup(e, { expose: r, emit: d }) {
|
|
4184
|
-
const t = e, { disabled: n, addAllText: a, data: u, format: o, dictType: i, disabledObj: s, keyValue: c, filterDataFun:
|
|
4185
|
-
const
|
|
4186
|
-
return Object.entries(
|
|
4187
|
-
const
|
|
4188
|
-
if (!
|
|
4189
|
-
const
|
|
4190
|
-
|
|
4226
|
+
const t = e, { disabled: n, addAllText: a, data: u, format: o, dictType: i, disabledObj: s, keyValue: c, filterDataFun: g, disabledDataFun: w } = toRefs(t), y = useAttrs(), m = computed(() => {
|
|
4227
|
+
const f = {};
|
|
4228
|
+
return Object.entries(y).forEach(([k, B]) => {
|
|
4229
|
+
const F = ToKebabCase(k);
|
|
4230
|
+
if (!F.startsWith("radio-") && !F.startsWith("on-radio-")) {
|
|
4231
|
+
const V = ToCamelCase(F);
|
|
4232
|
+
f[V] = B;
|
|
4191
4233
|
}
|
|
4192
|
-
}),
|
|
4234
|
+
}), f;
|
|
4193
4235
|
}), C = computed(() => {
|
|
4194
|
-
const
|
|
4195
|
-
return Object.entries(
|
|
4196
|
-
const
|
|
4197
|
-
if (
|
|
4198
|
-
const
|
|
4199
|
-
|
|
4236
|
+
const f = {};
|
|
4237
|
+
return Object.entries(y).forEach(([k, B]) => {
|
|
4238
|
+
const F = ToKebabCase(k);
|
|
4239
|
+
if (F.startsWith("radio-") || F.startsWith("on-radio-")) {
|
|
4240
|
+
const V = ToCamelCase(F.replace("radio-", ""));
|
|
4241
|
+
f[V] = B;
|
|
4200
4242
|
}
|
|
4201
|
-
}),
|
|
4202
|
-
}),
|
|
4243
|
+
}), f;
|
|
4244
|
+
}), _ = ref(""), l = toRaw(store.state.dictConfig), v = d, b = (f) => {
|
|
4203
4245
|
if (!c.value) {
|
|
4204
|
-
|
|
4246
|
+
v("dictChange", f);
|
|
4205
4247
|
return;
|
|
4206
4248
|
}
|
|
4207
|
-
const
|
|
4208
|
-
|
|
4209
|
-
},
|
|
4249
|
+
const k = E.list.find((B) => B[l.format.value] === f);
|
|
4250
|
+
v("dictChange", k);
|
|
4251
|
+
}, E = reactive({
|
|
4210
4252
|
list: []
|
|
4211
|
-
}),
|
|
4253
|
+
}), T = async () => {
|
|
4212
4254
|
if (!i.value || u.value && u.value.length > 0)
|
|
4213
4255
|
return;
|
|
4214
|
-
let
|
|
4256
|
+
let f = [];
|
|
4215
4257
|
if (typeof i.value == "object") {
|
|
4216
|
-
|
|
4217
|
-
const
|
|
4218
|
-
|
|
4219
|
-
const { filters:
|
|
4220
|
-
|
|
4258
|
+
_.value = i.value.type;
|
|
4259
|
+
const k = await store.actions.getDictDataObj(_.value);
|
|
4260
|
+
f = [].concat(k[_.value]);
|
|
4261
|
+
const { filters: B, filterType: F = l.format.value, reverse: V = !1 } = i.value, J = typeof B == "string" ? B.split(",") : B;
|
|
4262
|
+
V ? f = f.filter((L) => !J.includes(L[F])) : f = f.filter((L) => J.includes(L[F]));
|
|
4221
4263
|
} else {
|
|
4222
|
-
|
|
4223
|
-
const
|
|
4224
|
-
|
|
4264
|
+
_.value = i.value;
|
|
4265
|
+
const k = await store.actions.getDictDataObj(_.value);
|
|
4266
|
+
f = [].concat(k[_.value]);
|
|
4225
4267
|
}
|
|
4226
|
-
if (
|
|
4227
|
-
|
|
4228
|
-
...
|
|
4229
|
-
[l.format.disabled]: w.value(
|
|
4268
|
+
if (g.value && (f = g.value(f)), w.value)
|
|
4269
|
+
f = f.map((k) => ({
|
|
4270
|
+
...k,
|
|
4271
|
+
[l.format.disabled]: w.value(k)
|
|
4230
4272
|
}));
|
|
4231
4273
|
else if (s.value) {
|
|
4232
|
-
const { disabledValues:
|
|
4233
|
-
|
|
4234
|
-
const
|
|
4235
|
-
return
|
|
4236
|
-
}) :
|
|
4237
|
-
const
|
|
4238
|
-
return
|
|
4274
|
+
const { disabledValues: k, disabledType: B = l.format.value, reverse: F = !1 } = s.value, V = typeof k == "string" ? k.split(",") : k;
|
|
4275
|
+
F ? f = f.map((J) => {
|
|
4276
|
+
const L = JSON.parse(JSON.stringify(J));
|
|
4277
|
+
return L[l.format.disabled] = !V.includes(L[B]) || L[l.format.disabled], L;
|
|
4278
|
+
}) : f = f.map((J) => {
|
|
4279
|
+
const L = JSON.parse(JSON.stringify(J));
|
|
4280
|
+
return L[l.format.disabled] = V.includes(L[B]) || L[l.format.disabled], L;
|
|
4239
4281
|
});
|
|
4240
4282
|
}
|
|
4241
|
-
a.value &&
|
|
4283
|
+
a.value && f.unshift({
|
|
4242
4284
|
[l.format.value]: "",
|
|
4243
4285
|
[l.format.label]: a.value
|
|
4244
|
-
}),
|
|
4245
|
-
},
|
|
4286
|
+
}), E.list = f;
|
|
4287
|
+
}, x = computed(() => store.state.isGettingDictTypes.includes(_.value)), j = computed(() => store.state.isGettingAllDictTypes), A = computed(() => u.value), D = inject(formItemContextKey), S = inject(formContextKey), R = computed(() => n.value || y["radio-disabled"] === "" || y["radio-disabled"] || y.radioDisabled === "" || y.radioDisabled || y.RadioDisabled === "" || y.RadioDisabled || (D == null ? void 0 : D.disabled) || (S == null ? void 0 : S.disabled) || !1);
|
|
4246
4288
|
watch(
|
|
4247
|
-
[
|
|
4248
|
-
([
|
|
4249
|
-
!
|
|
4250
|
-
[l.format.value]:
|
|
4251
|
-
[l.format.label]:
|
|
4252
|
-
[l.format.disabled]: !!
|
|
4253
|
-
...
|
|
4254
|
-
})) :
|
|
4255
|
-
[l.format.value]:
|
|
4256
|
-
[l.format.label]:
|
|
4257
|
-
})), a.value &&
|
|
4289
|
+
[x, j, A],
|
|
4290
|
+
([f, k, B]) => {
|
|
4291
|
+
!f && !k && B && B.length === 0 && T(), B.length > 0 && (E.list = JSON.parse(JSON.stringify(B)), E.list.length > 0 && (Object.prototype.toString.call(E.list[0]) === "[object Object]" ? E.list = E.list.map((V) => ({
|
|
4292
|
+
[l.format.value]: V[o.value.value],
|
|
4293
|
+
[l.format.label]: V[o.value.label],
|
|
4294
|
+
[l.format.disabled]: !!V[o.value.disabled],
|
|
4295
|
+
...V
|
|
4296
|
+
})) : E.list = E.list.map((V) => ({
|
|
4297
|
+
[l.format.value]: V,
|
|
4298
|
+
[l.format.label]: V
|
|
4299
|
+
})), a.value && E.list.unshift({
|
|
4258
4300
|
[l.format.value]: "",
|
|
4259
4301
|
[l.format.label]: a.value
|
|
4260
4302
|
})));
|
|
@@ -4263,34 +4305,34 @@ const __vite_glob_0_13 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4263
4305
|
immediate: !0
|
|
4264
4306
|
}
|
|
4265
4307
|
);
|
|
4266
|
-
const
|
|
4267
|
-
return r({ geElRadioGroupRef: () =>
|
|
4308
|
+
const P = ref([]), O = () => P.value, $ = ref(null);
|
|
4309
|
+
return r({ geElRadioGroupRef: () => $.value, getElRadioRefs: O }), (f, k) => (openBlock(), createBlock(unref(ElRadioGroup), mergeProps({
|
|
4268
4310
|
ref_key: "ElRadioGroupRef",
|
|
4269
|
-
ref:
|
|
4270
|
-
disabled:
|
|
4271
|
-
}, m.value, { onChange:
|
|
4311
|
+
ref: $,
|
|
4312
|
+
disabled: R.value
|
|
4313
|
+
}, m.value, { onChange: b }), createSlots({
|
|
4272
4314
|
default: withCtx(() => [
|
|
4273
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
4315
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(E.list, (B, F) => (openBlock(), createBlock(unref(ElRadio), mergeProps({
|
|
4274
4316
|
ref_for: !0,
|
|
4275
|
-
ref: (
|
|
4276
|
-
|
|
4317
|
+
ref: (V) => {
|
|
4318
|
+
V && (P.value[F] = V);
|
|
4277
4319
|
},
|
|
4278
|
-
key:
|
|
4279
|
-
disabled:
|
|
4280
|
-
label:
|
|
4320
|
+
key: B[unref(l).format.value],
|
|
4321
|
+
disabled: R.value || B[unref(l).format.disabled],
|
|
4322
|
+
label: B[unref(l).format.value]
|
|
4281
4323
|
}, C.value), {
|
|
4282
4324
|
default: withCtx(() => [
|
|
4283
|
-
createTextVNode(toDisplayString(
|
|
4325
|
+
createTextVNode(toDisplayString(B[unref(l).format.label]), 1)
|
|
4284
4326
|
]),
|
|
4285
4327
|
_: 2
|
|
4286
4328
|
}, 1040, ["disabled", "label"]))), 128))
|
|
4287
4329
|
]),
|
|
4288
4330
|
_: 2
|
|
4289
4331
|
}, [
|
|
4290
|
-
renderList(
|
|
4291
|
-
name:
|
|
4292
|
-
fn: withCtx((
|
|
4293
|
-
renderSlot(
|
|
4332
|
+
renderList(f.$slots, (B, F, V) => ({
|
|
4333
|
+
name: F,
|
|
4334
|
+
fn: withCtx((J) => [
|
|
4335
|
+
renderSlot(f.$slots, F, normalizeProps(guardReactiveProps(J)))
|
|
4294
4336
|
])
|
|
4295
4337
|
}))
|
|
4296
4338
|
]), 1040, ["disabled"]));
|
|
@@ -4355,126 +4397,126 @@ const __vite_glob_0_14 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4355
4397
|
},
|
|
4356
4398
|
emits: ["dictChange"],
|
|
4357
4399
|
setup(e, { expose: r, emit: d }) {
|
|
4358
|
-
const t = e, { addAllText: n, emptyValues: a, valueOnClear: u, data: o, format: i, dictType: s, disabledObj: c, keyValue:
|
|
4359
|
-
const
|
|
4360
|
-
return Object.entries(m).forEach(([
|
|
4361
|
-
const
|
|
4362
|
-
if (!
|
|
4363
|
-
const
|
|
4364
|
-
|
|
4400
|
+
const t = e, { addAllText: n, emptyValues: a, valueOnClear: u, data: o, format: i, dictType: s, disabledObj: c, keyValue: g, filterDataFun: w, disabledDataFun: y } = toRefs(t), m = useAttrs(), C = computed(() => {
|
|
4401
|
+
const p = {};
|
|
4402
|
+
return Object.entries(m).forEach(([f, k]) => {
|
|
4403
|
+
const B = ToKebabCase(f);
|
|
4404
|
+
if (!B.startsWith("option-") && !B.startsWith("on-option-")) {
|
|
4405
|
+
const F = ToCamelCase(B);
|
|
4406
|
+
p[F] = k;
|
|
4365
4407
|
}
|
|
4366
|
-
}),
|
|
4367
|
-
}),
|
|
4368
|
-
const
|
|
4369
|
-
return Object.entries(m).forEach(([
|
|
4370
|
-
const
|
|
4371
|
-
if (
|
|
4372
|
-
const
|
|
4373
|
-
|
|
4408
|
+
}), p;
|
|
4409
|
+
}), _ = computed(() => {
|
|
4410
|
+
const p = {};
|
|
4411
|
+
return Object.entries(m).forEach(([f, k]) => {
|
|
4412
|
+
const B = ToKebabCase(f);
|
|
4413
|
+
if (B.startsWith("option-") || B.startsWith("on-option-")) {
|
|
4414
|
+
const F = ToCamelCase(B.replace("option-", ""));
|
|
4415
|
+
p[F] = k;
|
|
4374
4416
|
}
|
|
4375
|
-
}),
|
|
4376
|
-
}), l = ref(""),
|
|
4377
|
-
if (!
|
|
4378
|
-
|
|
4417
|
+
}), p;
|
|
4418
|
+
}), l = ref(""), v = toRaw(store.state.dictConfig), b = d, E = (p) => {
|
|
4419
|
+
if (!g.value) {
|
|
4420
|
+
b("dictChange", p);
|
|
4379
4421
|
return;
|
|
4380
4422
|
}
|
|
4381
4423
|
if (!m.multiple && m.multiple !== "") {
|
|
4382
|
-
const
|
|
4383
|
-
|
|
4424
|
+
const f = T.list.find((k) => k[v.format.value] === p);
|
|
4425
|
+
b("dictChange", f);
|
|
4384
4426
|
} else {
|
|
4385
|
-
const
|
|
4386
|
-
|
|
4427
|
+
const f = T.list.filter((k) => p.includes(k[v.format.value]));
|
|
4428
|
+
b("dictChange", f);
|
|
4387
4429
|
}
|
|
4388
|
-
},
|
|
4430
|
+
}, T = reactive({
|
|
4389
4431
|
list: []
|
|
4390
|
-
}),
|
|
4432
|
+
}), x = async () => {
|
|
4391
4433
|
if (!s.value || o.value && o.value.length > 0)
|
|
4392
4434
|
return;
|
|
4393
|
-
let
|
|
4435
|
+
let p = [];
|
|
4394
4436
|
if (typeof s.value == "object") {
|
|
4395
4437
|
l.value = s.value.type;
|
|
4396
|
-
const
|
|
4397
|
-
|
|
4398
|
-
const { filters:
|
|
4399
|
-
|
|
4438
|
+
const f = await store.actions.getDictDataObj(l.value);
|
|
4439
|
+
p = [].concat(f[l.value]);
|
|
4440
|
+
const { filters: k, filterType: B = v.format.value, reverse: F = !1 } = s.value, V = typeof k == "string" ? k.split(",") : k;
|
|
4441
|
+
F ? p = p.filter((J) => !V.includes(J[B])) : p = p.filter((J) => V.includes(J[B]));
|
|
4400
4442
|
} else {
|
|
4401
4443
|
l.value = s.value;
|
|
4402
|
-
const
|
|
4403
|
-
|
|
4444
|
+
const f = await store.actions.getDictDataObj(l.value);
|
|
4445
|
+
p = [].concat(f[l.value]);
|
|
4404
4446
|
}
|
|
4405
|
-
if (w.value && (
|
|
4406
|
-
|
|
4407
|
-
...
|
|
4408
|
-
[
|
|
4447
|
+
if (w.value && (p = w.value(p)), y.value)
|
|
4448
|
+
p = p.map((f) => ({
|
|
4449
|
+
...f,
|
|
4450
|
+
[v.format.disabled]: y.value(f)
|
|
4409
4451
|
}));
|
|
4410
4452
|
else if (c.value) {
|
|
4411
|
-
const { disabledValues:
|
|
4412
|
-
|
|
4413
|
-
const
|
|
4414
|
-
return
|
|
4415
|
-
}) :
|
|
4416
|
-
const
|
|
4417
|
-
return
|
|
4453
|
+
const { disabledValues: f, disabledType: k = v.format.value, reverse: B = !1 } = c.value, F = typeof f == "string" ? f.split(",") : f;
|
|
4454
|
+
B ? p = p.map((V) => {
|
|
4455
|
+
const J = JSON.parse(JSON.stringify(V));
|
|
4456
|
+
return J[v.format.disabled] = !F.includes(J[k]) || J[v.format.disabled], J;
|
|
4457
|
+
}) : p = p.map((V) => {
|
|
4458
|
+
const J = JSON.parse(JSON.stringify(V));
|
|
4459
|
+
return J[v.format.disabled] = F.includes(J[k]) || J[v.format.disabled], J;
|
|
4418
4460
|
});
|
|
4419
4461
|
}
|
|
4420
|
-
n.value && !m.multiple && m.multiple !== "" &&
|
|
4421
|
-
[
|
|
4422
|
-
[
|
|
4423
|
-
}),
|
|
4424
|
-
},
|
|
4462
|
+
n.value && !m.multiple && m.multiple !== "" && p.unshift({
|
|
4463
|
+
[v.format.value]: "",
|
|
4464
|
+
[v.format.label]: n.value
|
|
4465
|
+
}), T.list = p;
|
|
4466
|
+
}, j = computed(() => store.state.isGettingDictTypes.includes(l.value)), A = computed(() => store.state.isGettingAllDictTypes), D = computed(() => o.value);
|
|
4425
4467
|
watch(
|
|
4426
|
-
[
|
|
4427
|
-
([
|
|
4428
|
-
if (!
|
|
4429
|
-
let
|
|
4430
|
-
|
|
4431
|
-
[
|
|
4432
|
-
[
|
|
4433
|
-
[
|
|
4434
|
-
...
|
|
4435
|
-
})) :
|
|
4436
|
-
[
|
|
4437
|
-
[
|
|
4438
|
-
})), n.value && !m.multiple && m.multiple !== "" &&
|
|
4439
|
-
[
|
|
4440
|
-
[
|
|
4441
|
-
}),
|
|
4468
|
+
[j, A, D],
|
|
4469
|
+
([p, f, k]) => {
|
|
4470
|
+
if (!p && !f && k && k.length === 0 && x(), k.length > 0) {
|
|
4471
|
+
let B = JSON.parse(JSON.stringify(k));
|
|
4472
|
+
B.length > 0 && (Object.prototype.toString.call(B[0]) === "[object Object]" ? B = B.map((V) => ({
|
|
4473
|
+
[v.format.value]: V[i.value.value],
|
|
4474
|
+
[v.format.label]: V[i.value.label],
|
|
4475
|
+
[v.format.disabled]: !!V[i.value.disabled],
|
|
4476
|
+
...V
|
|
4477
|
+
})) : B = B.map((V) => ({
|
|
4478
|
+
[v.format.value]: V,
|
|
4479
|
+
[v.format.label]: V
|
|
4480
|
+
})), n.value && !m.multiple && m.multiple !== "" && B.unshift({
|
|
4481
|
+
[v.format.value]: "",
|
|
4482
|
+
[v.format.label]: n.value
|
|
4483
|
+
}), T.list = B);
|
|
4442
4484
|
}
|
|
4443
4485
|
},
|
|
4444
4486
|
{
|
|
4445
4487
|
immediate: !0
|
|
4446
4488
|
}
|
|
4447
4489
|
);
|
|
4448
|
-
const
|
|
4449
|
-
return r({ getElSelectRef:
|
|
4490
|
+
const S = () => n.value && !m.multiple && m.multiple !== "" ? "" : u.value, R = ref(null), P = () => R.value, O = ref([]);
|
|
4491
|
+
return r({ getElSelectRef: P, getElOptionRefs: () => O.value }), (p, f) => (openBlock(), createBlock(unref(ElSelect), mergeProps({
|
|
4450
4492
|
ref_key: "ElSelectRef",
|
|
4451
|
-
ref:
|
|
4493
|
+
ref: R
|
|
4452
4494
|
}, C.value, {
|
|
4453
|
-
"value-on-clear":
|
|
4495
|
+
"value-on-clear": S,
|
|
4454
4496
|
"empty-values": unref(n) ? [null, void 0] : unref(a),
|
|
4455
|
-
"value-key": unref(
|
|
4456
|
-
onChange:
|
|
4497
|
+
"value-key": unref(v).format.value,
|
|
4498
|
+
onChange: E,
|
|
4457
4499
|
class: unref(m).modelValue === "" && unref(n) ? "no-clear" : "",
|
|
4458
4500
|
"popper-options": { modifiers: [{ name: "computeStyles", options: { adaptive: !1 } }] }
|
|
4459
4501
|
}), createSlots({
|
|
4460
4502
|
default: withCtx(() => [
|
|
4461
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
4503
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(T.list, (k) => (openBlock(), createBlock(unref(ElOption), mergeProps({
|
|
4462
4504
|
ref_for: !0,
|
|
4463
|
-
ref: (
|
|
4464
|
-
|
|
4505
|
+
ref: (B) => {
|
|
4506
|
+
B && (O.value[p.index] = B);
|
|
4465
4507
|
},
|
|
4466
|
-
key:
|
|
4467
|
-
disabled:
|
|
4468
|
-
label:
|
|
4469
|
-
value:
|
|
4470
|
-
},
|
|
4508
|
+
key: k[unref(v).format.value],
|
|
4509
|
+
disabled: k[unref(v).format.disabled],
|
|
4510
|
+
label: k[unref(v).format.label],
|
|
4511
|
+
value: k[unref(v).format.value]
|
|
4512
|
+
}, _.value), null, 16, ["disabled", "label", "value"]))), 128))
|
|
4471
4513
|
]),
|
|
4472
4514
|
_: 2
|
|
4473
4515
|
}, [
|
|
4474
|
-
renderList(
|
|
4475
|
-
name:
|
|
4476
|
-
fn: withCtx((
|
|
4477
|
-
renderSlot(
|
|
4516
|
+
renderList(p.$slots, (k, B, F) => ({
|
|
4517
|
+
name: B,
|
|
4518
|
+
fn: withCtx((V) => [
|
|
4519
|
+
renderSlot(p.$slots, B, mergeProps({ key: F }, V))
|
|
4478
4520
|
])
|
|
4479
4521
|
}))
|
|
4480
4522
|
]), 1040, ["empty-values", "value-key", "class"]));
|
|
@@ -4567,86 +4609,86 @@ const __vite_glob_0_15 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4567
4609
|
}
|
|
4568
4610
|
},
|
|
4569
4611
|
setup(e, { expose: r }) {
|
|
4570
|
-
const d = useAttrs(), t = e, { emptyText: n, dictType: a, dictTreeType: u, dateFormat: o, defaultVal: i, treeSetting: s, formatFun: c, formatFunIn:
|
|
4571
|
-
const
|
|
4572
|
-
return i.value !== void 0 && i.value !== null && (
|
|
4573
|
-
}),
|
|
4574
|
-
const
|
|
4575
|
-
return i.value !== void 0 && i.value !== null && (
|
|
4576
|
-
}),
|
|
4612
|
+
const d = useAttrs(), t = e, { emptyText: n, dictType: a, dictTreeType: u, dateFormat: o, defaultVal: i, treeSetting: s, formatFun: c, formatFunIn: g, formatFunOut: w, spacer: y, maskType: m, maskStart: C, maskEnd: _, maskMiddle: l, maskSymbol: v } = toRefs(t), b = computed(() => {
|
|
4613
|
+
const S = {};
|
|
4614
|
+
return i.value !== void 0 && i.value !== null && (S.defaultVal = i.value), n.value !== void 0 && n.value !== null && (S.emptyText = n.value), c.value !== void 0 && c.value !== null && (S.formatFun = c.value), y.value !== void 0 && y.value !== null && (S.spacer = y.value), S;
|
|
4615
|
+
}), E = computed(() => {
|
|
4616
|
+
const S = {};
|
|
4617
|
+
return i.value !== void 0 && i.value !== null && (S.defaultVal = i.value), n.value !== void 0 && n.value !== null && (S.emptyText = n.value), g.value !== void 0 && g.value !== null && (S.formatFunIn = g.value), w.value !== void 0 && w.value !== null && (S.formatFunOut = w.value), s.value !== void 0 && s.value !== null && (S.treeSetting = s.value), y.value !== void 0 && y.value !== null && (S.spacer = y.value), S;
|
|
4618
|
+
}), T = computed(() => !!m.value || !!C.value || !!l.value || !!_.value), x = computed(() => {
|
|
4577
4619
|
if (m.value) {
|
|
4578
4620
|
if (Array.isArray(m.value))
|
|
4579
4621
|
return {
|
|
4580
4622
|
start: C.value || m.value[0] || 0,
|
|
4581
4623
|
middle: l.value || m.value[1] || 0,
|
|
4582
|
-
end:
|
|
4583
|
-
symbol:
|
|
4624
|
+
end: _.value || m.value[2] || 0,
|
|
4625
|
+
symbol: v.value || m.value[3] || "*",
|
|
4584
4626
|
defaultVal: i.value
|
|
4585
4627
|
};
|
|
4586
4628
|
if (typeof m.value == "object") {
|
|
4587
|
-
const
|
|
4629
|
+
const S = {
|
|
4588
4630
|
start: C.value || 0,
|
|
4589
4631
|
middle: l.value || 0,
|
|
4590
|
-
end:
|
|
4591
|
-
symbol:
|
|
4632
|
+
end: _.value || 0,
|
|
4633
|
+
symbol: v.value || "*",
|
|
4592
4634
|
defaultVal: i.value
|
|
4593
4635
|
};
|
|
4594
|
-
return Object.assign(
|
|
4636
|
+
return Object.assign(S, m.value);
|
|
4595
4637
|
} else
|
|
4596
4638
|
return m.value;
|
|
4597
4639
|
} else
|
|
4598
4640
|
return {
|
|
4599
4641
|
start: C.value || 0,
|
|
4600
4642
|
middle: l.value || 0,
|
|
4601
|
-
end:
|
|
4602
|
-
symbol:
|
|
4643
|
+
end: _.value || 0,
|
|
4644
|
+
symbol: v.value || "*",
|
|
4603
4645
|
defaultVal: i.value
|
|
4604
4646
|
};
|
|
4605
|
-
}),
|
|
4606
|
-
return r({ getElTableColumnRef: () => A.value }), (
|
|
4647
|
+
}), j = (S, R = {}) => Array.isArray(S) ? S : typeof S == "string" ? S.split(R.spacer || ",") : typeof S == "number" ? [S] : [], A = ref(null);
|
|
4648
|
+
return r({ getElTableColumnRef: () => A.value }), (S, R) => (openBlock(), createBlock(unref(ElTableColumn), mergeProps({
|
|
4607
4649
|
ref_key: "ElTableColumnRef",
|
|
4608
4650
|
ref: A
|
|
4609
|
-
},
|
|
4610
|
-
default: withCtx((
|
|
4611
|
-
var
|
|
4651
|
+
}, S.$attrs), createSlots({
|
|
4652
|
+
default: withCtx((P) => {
|
|
4653
|
+
var O, $, p, f, k, B, F, V, J, L, G, K;
|
|
4612
4654
|
return [
|
|
4613
4655
|
unref(a) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
4614
|
-
e.dictTypeNode === "button" ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(
|
|
4656
|
+
e.dictTypeNode === "button" ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(j(P.row[(O = unref(d)) == null ? void 0 : O.prop], b.value), (I, M) => (openBlock(), createBlock(_sfc_main$n, {
|
|
4615
4657
|
key: M,
|
|
4616
|
-
modelValue:
|
|
4658
|
+
modelValue: I || "",
|
|
4617
4659
|
dictType: unref(a)
|
|
4618
|
-
}, null, 8, ["modelValue", "dictType"]))), 128)) : e.dictTypeNode === "link" ? (openBlock(!0), createElementBlock(Fragment, { key: 1 }, renderList(
|
|
4660
|
+
}, null, 8, ["modelValue", "dictType"]))), 128)) : e.dictTypeNode === "link" ? (openBlock(!0), createElementBlock(Fragment, { key: 1 }, renderList(j(P.row[($ = unref(d)) == null ? void 0 : $.prop], b.value), (I, M) => (openBlock(), createBlock(_sfc_main$e, {
|
|
4619
4661
|
key: M,
|
|
4620
|
-
modelValue:
|
|
4662
|
+
modelValue: I || "",
|
|
4621
4663
|
dictType: unref(a)
|
|
4622
|
-
}, null, 8, ["modelValue", "dictType"]))), 128)) : e.dictTypeNode === "tag" ? (openBlock(!0), createElementBlock(Fragment, { key: 2 }, renderList(
|
|
4664
|
+
}, null, 8, ["modelValue", "dictType"]))), 128)) : e.dictTypeNode === "tag" ? (openBlock(!0), createElementBlock(Fragment, { key: 2 }, renderList(j(P.row[(p = unref(d)) == null ? void 0 : p.prop], b.value), (I, M) => (openBlock(), createBlock(_sfc_main$f, {
|
|
4623
4665
|
key: M,
|
|
4624
|
-
modelValue:
|
|
4666
|
+
modelValue: I || "",
|
|
4625
4667
|
dictType: unref(a)
|
|
4626
|
-
}, null, 8, ["modelValue", "dictType"]))), 128)) : e.dictTypeNode === "text" ? (openBlock(!0), createElementBlock(Fragment, { key: 3 }, renderList(
|
|
4668
|
+
}, null, 8, ["modelValue", "dictType"]))), 128)) : e.dictTypeNode === "text" ? (openBlock(!0), createElementBlock(Fragment, { key: 3 }, renderList(j(P.row[(f = unref(d)) == null ? void 0 : f.prop], b.value), (I, M) => (openBlock(), createBlock(_sfc_main$d, {
|
|
4627
4669
|
key: M,
|
|
4628
|
-
modelValue:
|
|
4670
|
+
modelValue: I || "",
|
|
4629
4671
|
dictType: unref(a)
|
|
4630
4672
|
}, null, 8, ["modelValue", "dictType"]))), 128)) : (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
4631
|
-
createTextVNode(toDisplayString(unref(GetLabelByCodesFilter)(
|
|
4673
|
+
createTextVNode(toDisplayString(unref(GetLabelByCodesFilter)(P.row[(k = unref(d)) == null ? void 0 : k.prop], unref(a), b.value)), 1)
|
|
4632
4674
|
], 64))
|
|
4633
|
-
], 64)) : unref(u) &&
|
|
4634
|
-
createTextVNode(toDisplayString(unref(GetTreeLabelByCodesFilter)(
|
|
4635
|
-
], 64)) : unref(o) &&
|
|
4636
|
-
createTextVNode(toDisplayString(unref(FormatDate)(
|
|
4637
|
-
], 64)) :
|
|
4638
|
-
createTextVNode(toDisplayString(unref(Desensitization)(
|
|
4675
|
+
], 64)) : unref(u) && P.row[(B = unref(d)) == null ? void 0 : B.prop] ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
4676
|
+
createTextVNode(toDisplayString(unref(GetTreeLabelByCodesFilter)(P.row[(F = unref(d)) == null ? void 0 : F.prop], unref(u), E.value)), 1)
|
|
4677
|
+
], 64)) : unref(o) && P.row[(V = unref(d)) == null ? void 0 : V.prop] ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
4678
|
+
createTextVNode(toDisplayString(unref(FormatDate)(P.row[(J = unref(d)) == null ? void 0 : J.prop], unref(o), unref(i))), 1)
|
|
4679
|
+
], 64)) : T.value && P.row[(L = unref(d)) == null ? void 0 : L.prop] ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
4680
|
+
createTextVNode(toDisplayString(unref(Desensitization)(P.row[(G = unref(d)) == null ? void 0 : G.prop], x.value)), 1)
|
|
4639
4681
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
4640
|
-
createTextVNode(toDisplayString(
|
|
4682
|
+
createTextVNode(toDisplayString(P.row[(K = unref(d)) == null ? void 0 : K.prop] || unref(i)), 1)
|
|
4641
4683
|
], 64))
|
|
4642
4684
|
];
|
|
4643
4685
|
}),
|
|
4644
4686
|
_: 2
|
|
4645
4687
|
}, [
|
|
4646
|
-
renderList(
|
|
4647
|
-
name:
|
|
4648
|
-
fn: withCtx((
|
|
4649
|
-
renderSlot(
|
|
4688
|
+
renderList(S.$slots, (P, O, $) => ({
|
|
4689
|
+
name: O,
|
|
4690
|
+
fn: withCtx((p) => [
|
|
4691
|
+
renderSlot(S.$slots, O, mergeProps({ key: $ }, p), void 0, !0)
|
|
4650
4692
|
])
|
|
4651
4693
|
}))
|
|
4652
4694
|
]), 1040));
|
|
@@ -4709,82 +4751,82 @@ const __vite_glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4709
4751
|
},
|
|
4710
4752
|
emits: ["dictChange"],
|
|
4711
4753
|
setup(e, { expose: r, emit: d }) {
|
|
4712
|
-
const t = useAttrs(), n = e, { addAllText: a, data: u, format: o, badgeObj: i, dictType: s, disabledObj: c, keyValue:
|
|
4713
|
-
const
|
|
4714
|
-
return Object.entries(t).forEach(([
|
|
4715
|
-
const
|
|
4716
|
-
if (!
|
|
4717
|
-
const
|
|
4718
|
-
|
|
4754
|
+
const t = useAttrs(), n = e, { addAllText: a, data: u, format: o, badgeObj: i, dictType: s, disabledObj: c, keyValue: g, filterDataFun: w, disabledDataFun: y } = toRefs(n), m = computed(() => {
|
|
4755
|
+
const O = {};
|
|
4756
|
+
return Object.entries(t).forEach(([$, p]) => {
|
|
4757
|
+
const f = ToKebabCase($);
|
|
4758
|
+
if (!f.startsWith("tab-pane-") && !f.startsWith("on-tab-pane-")) {
|
|
4759
|
+
const k = ToCamelCase(f);
|
|
4760
|
+
O[k] = p;
|
|
4719
4761
|
}
|
|
4720
|
-
}),
|
|
4762
|
+
}), O;
|
|
4721
4763
|
}), C = computed(() => {
|
|
4722
|
-
const
|
|
4723
|
-
return Object.entries(t).forEach(([
|
|
4724
|
-
const
|
|
4725
|
-
if (
|
|
4726
|
-
const
|
|
4727
|
-
|
|
4764
|
+
const O = {};
|
|
4765
|
+
return Object.entries(t).forEach(([$, p]) => {
|
|
4766
|
+
const f = ToKebabCase($);
|
|
4767
|
+
if (f.startsWith("tab-pane-") || f.startsWith("on-tab-pane-")) {
|
|
4768
|
+
const k = ToCamelCase(f.replace("tab-pane-", ""));
|
|
4769
|
+
O[k] = p;
|
|
4728
4770
|
}
|
|
4729
|
-
}),
|
|
4730
|
-
}),
|
|
4771
|
+
}), O;
|
|
4772
|
+
}), _ = ref(""), l = toRaw(store.state.dictConfig), v = d, b = (O) => {
|
|
4731
4773
|
window.setTimeout(() => {
|
|
4732
|
-
if (!
|
|
4733
|
-
|
|
4774
|
+
if (!g.value) {
|
|
4775
|
+
v("dictChange", t.modelValue);
|
|
4734
4776
|
return;
|
|
4735
4777
|
}
|
|
4736
|
-
const
|
|
4737
|
-
|
|
4778
|
+
const $ = E.list.find((p) => p[l.format.value] === t.modelValue);
|
|
4779
|
+
v("dictChange", $);
|
|
4738
4780
|
}, 0);
|
|
4739
|
-
},
|
|
4781
|
+
}, E = reactive({
|
|
4740
4782
|
list: []
|
|
4741
|
-
}),
|
|
4783
|
+
}), T = async () => {
|
|
4742
4784
|
if (!s.value || u.value && u.value.length > 0)
|
|
4743
4785
|
return;
|
|
4744
|
-
let
|
|
4786
|
+
let O = [];
|
|
4745
4787
|
if (typeof s.value == "object") {
|
|
4746
|
-
|
|
4747
|
-
const
|
|
4748
|
-
|
|
4749
|
-
const { filters:
|
|
4750
|
-
|
|
4788
|
+
_.value = s.value.type;
|
|
4789
|
+
const $ = await store.actions.getDictDataObj(_.value);
|
|
4790
|
+
O = [].concat($[_.value]);
|
|
4791
|
+
const { filters: p, filterType: f = l.format.value, reverse: k = !1 } = s.value, B = typeof p == "string" ? p.split(",") : p;
|
|
4792
|
+
k ? O = O.filter((F) => !B.includes(F[f])) : O = O.filter((F) => B.includes(F[f]));
|
|
4751
4793
|
} else {
|
|
4752
|
-
|
|
4753
|
-
const
|
|
4754
|
-
|
|
4794
|
+
_.value = s.value;
|
|
4795
|
+
const $ = await store.actions.getDictDataObj(_.value);
|
|
4796
|
+
O = [].concat($[_.value]);
|
|
4755
4797
|
}
|
|
4756
|
-
if (w.value && (
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
[l.format.disabled]:
|
|
4798
|
+
if (w.value && (O = w.value(O)), y.value)
|
|
4799
|
+
O = O.map(($) => ({
|
|
4800
|
+
...$,
|
|
4801
|
+
[l.format.disabled]: y.value($)
|
|
4760
4802
|
}));
|
|
4761
4803
|
else if (c.value) {
|
|
4762
|
-
const { disabledValues:
|
|
4763
|
-
|
|
4764
|
-
const
|
|
4765
|
-
return
|
|
4766
|
-
}) :
|
|
4767
|
-
const
|
|
4768
|
-
return
|
|
4804
|
+
const { disabledValues: $, disabledType: p = l.format.value, reverse: f = !1 } = c.value, k = typeof $ == "string" ? $.split(",") : $;
|
|
4805
|
+
f ? O = O.map((B) => {
|
|
4806
|
+
const F = JSON.parse(JSON.stringify(B));
|
|
4807
|
+
return F[l.format.disabled] = !k.includes(F[p]) || F[l.format.disabled], F;
|
|
4808
|
+
}) : O = O.map((B) => {
|
|
4809
|
+
const F = JSON.parse(JSON.stringify(B));
|
|
4810
|
+
return F[l.format.disabled] = k.includes(F[p]) || F[l.format.disabled], F;
|
|
4769
4811
|
});
|
|
4770
4812
|
}
|
|
4771
|
-
a.value &&
|
|
4813
|
+
a.value && O.unshift({
|
|
4772
4814
|
[l.format.value]: "",
|
|
4773
4815
|
[l.format.label]: a.value
|
|
4774
|
-
}),
|
|
4775
|
-
},
|
|
4816
|
+
}), E.list = O;
|
|
4817
|
+
}, x = computed(() => store.state.isGettingDictTypes.includes(_.value)), j = computed(() => store.state.isGettingAllDictTypes), A = computed(() => u.value);
|
|
4776
4818
|
watch(
|
|
4777
|
-
[
|
|
4778
|
-
([
|
|
4779
|
-
!
|
|
4780
|
-
[l.format.value]:
|
|
4781
|
-
[l.format.label]:
|
|
4782
|
-
[l.format.disabled]: !!
|
|
4783
|
-
...
|
|
4784
|
-
})) :
|
|
4785
|
-
[l.format.value]:
|
|
4786
|
-
[l.format.label]:
|
|
4787
|
-
})), a.value &&
|
|
4819
|
+
[x, j, A],
|
|
4820
|
+
([O, $, p]) => {
|
|
4821
|
+
!O && !$ && p && p.length === 0 && T(), p.length > 0 && (E.list = JSON.parse(JSON.stringify(p)), E.list.length > 0 && (Object.prototype.toString.call(E.list[0]) === "[object Object]" ? E.list = E.list.map((k) => ({
|
|
4822
|
+
[l.format.value]: k[o.value.value],
|
|
4823
|
+
[l.format.label]: k[o.value.label],
|
|
4824
|
+
[l.format.disabled]: !!k[o.value.disabled],
|
|
4825
|
+
...k
|
|
4826
|
+
})) : E.list = E.list.map((k) => ({
|
|
4827
|
+
[l.format.value]: k,
|
|
4828
|
+
[l.format.label]: k
|
|
4829
|
+
})), a.value && E.list.unshift({
|
|
4788
4830
|
[l.format.value]: "",
|
|
4789
4831
|
[l.format.label]: a.value
|
|
4790
4832
|
})));
|
|
@@ -4793,36 +4835,36 @@ const __vite_glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4793
4835
|
immediate: !0
|
|
4794
4836
|
}
|
|
4795
4837
|
);
|
|
4796
|
-
const
|
|
4797
|
-
return r({ getElTabsRef:
|
|
4798
|
-
const
|
|
4838
|
+
const D = ref(null), S = () => D.value, R = ref([]);
|
|
4839
|
+
return r({ getElTabsRef: S, getElTabPaneRefs: () => R.value }), (O, $) => {
|
|
4840
|
+
const p = resolveComponent("el-badge");
|
|
4799
4841
|
return openBlock(), createBlock(unref(ElTabs), mergeProps({
|
|
4800
4842
|
ref_key: "ElTabsRef",
|
|
4801
|
-
ref:
|
|
4843
|
+
ref: D,
|
|
4802
4844
|
class: "vue-element-dict-tabs"
|
|
4803
|
-
}, m.value, { onTabClick:
|
|
4845
|
+
}, m.value, { onTabClick: b }), {
|
|
4804
4846
|
default: withCtx(() => [
|
|
4805
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
4847
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(E.list, (f) => (openBlock(), createBlock(unref(ElTabPane), mergeProps({
|
|
4806
4848
|
ref_for: !0,
|
|
4807
|
-
ref: (
|
|
4808
|
-
|
|
4849
|
+
ref: (k) => {
|
|
4850
|
+
k && (R.value[O.index] = k);
|
|
4809
4851
|
},
|
|
4810
|
-
disabled:
|
|
4811
|
-
label:
|
|
4812
|
-
key:
|
|
4813
|
-
name:
|
|
4852
|
+
disabled: f[unref(l).format.disabled],
|
|
4853
|
+
label: f[unref(l).format.label],
|
|
4854
|
+
key: f[unref(l).format.value],
|
|
4855
|
+
name: f[unref(l).format.value]
|
|
4814
4856
|
}, C.value), createSlots({
|
|
4815
4857
|
default: withCtx(() => [
|
|
4816
|
-
renderSlot(
|
|
4858
|
+
renderSlot(O.$slots, f[unref(l).format.value] ? "tabs-item-" + f[unref(l).format.value] : "tabs-item")
|
|
4817
4859
|
]),
|
|
4818
4860
|
_: 2
|
|
4819
4861
|
}, [
|
|
4820
|
-
unref(i)[
|
|
4862
|
+
unref(i)[f[unref(l).format.value]] ? {
|
|
4821
4863
|
name: "label",
|
|
4822
4864
|
fn: withCtx(() => [
|
|
4823
|
-
createVNode(
|
|
4865
|
+
createVNode(p, mergeProps(unref(i)[f[unref(l).format.value]], { class: "item" }), {
|
|
4824
4866
|
default: withCtx(() => [
|
|
4825
|
-
createTextVNode(toDisplayString(
|
|
4867
|
+
createTextVNode(toDisplayString(f[unref(l).format.label]), 1)
|
|
4826
4868
|
]),
|
|
4827
4869
|
_: 2
|
|
4828
4870
|
}, 1040)
|
|
@@ -4882,97 +4924,97 @@ const __vite_glob_0_19 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4882
4924
|
}
|
|
4883
4925
|
},
|
|
4884
4926
|
setup(e, { expose: r }) {
|
|
4885
|
-
const d = useAttrs(), t = e, { maxLevel: n, dictType: a, disabledObj: u, filterDataFun: o, disabledDataFun: i } = toRefs(t), s = ref(""), c = toRaw(store.state.dictConfig),
|
|
4927
|
+
const d = useAttrs(), t = e, { maxLevel: n, dictType: a, disabledObj: u, filterDataFun: o, disabledDataFun: i } = toRefs(t), s = ref(""), c = toRaw(store.state.dictConfig), g = reactive({
|
|
4886
4928
|
list: []
|
|
4887
4929
|
}), w = computed(() => {
|
|
4888
|
-
const
|
|
4889
|
-
valueField:
|
|
4890
|
-
labelField:
|
|
4891
|
-
childrenField:
|
|
4892
|
-
leafField:
|
|
4893
|
-
disabled:
|
|
4930
|
+
const T = JSON.parse(JSON.stringify(c.treeSetting)), x = d.props || {}, j = {
|
|
4931
|
+
valueField: x != null && x.value ? x.value : T.valueField,
|
|
4932
|
+
labelField: x != null && x.label ? x.label : T.labelField,
|
|
4933
|
+
childrenField: x != null && x.children ? x.children : T.childrenField,
|
|
4934
|
+
leafField: x != null && x.leaf ? x.leaf : T.leafField,
|
|
4935
|
+
disabled: x != null && x.disabled ? x.disabled : c.format.disabled
|
|
4894
4936
|
};
|
|
4895
|
-
return Object.assign(
|
|
4896
|
-
}),
|
|
4897
|
-
for (let
|
|
4898
|
-
const A =
|
|
4899
|
-
if (A[w.value.levelField] ===
|
|
4937
|
+
return Object.assign(T, j);
|
|
4938
|
+
}), y = (T, x) => {
|
|
4939
|
+
for (let j = 0; j < T.length; j++) {
|
|
4940
|
+
const A = T[j];
|
|
4941
|
+
if (A[w.value.levelField] === x) {
|
|
4900
4942
|
delete A[w.value.childrenField], A[w.value.leafField] = !0;
|
|
4901
4943
|
continue;
|
|
4902
4944
|
} else {
|
|
4903
|
-
const
|
|
4904
|
-
|
|
4945
|
+
const S = A[w.value.childrenField];
|
|
4946
|
+
y(S, x);
|
|
4905
4947
|
}
|
|
4906
4948
|
}
|
|
4907
4949
|
}, m = async () => {
|
|
4908
4950
|
if (!a.value)
|
|
4909
4951
|
return;
|
|
4910
|
-
let
|
|
4952
|
+
let T = [];
|
|
4911
4953
|
if (typeof a.value == "object") {
|
|
4912
4954
|
s.value = a.value.type;
|
|
4913
|
-
const
|
|
4914
|
-
|
|
4915
|
-
const { filters:
|
|
4916
|
-
|
|
4955
|
+
const x = await store.actions.getDictDataObj(s.value);
|
|
4956
|
+
T = [].concat(x[s.value]);
|
|
4957
|
+
const { filters: j, filterType: A = c.format.value, reverse: D = !1 } = a.value, S = typeof j == "string" ? j.split(",") : j;
|
|
4958
|
+
D ? T = T.filter((R) => !S.includes(R[A])) : T = T.filter((R) => S.includes(R[A]));
|
|
4917
4959
|
} else {
|
|
4918
4960
|
s.value = a.value;
|
|
4919
|
-
const
|
|
4920
|
-
|
|
4961
|
+
const x = await store.actions.getDictDataObj(s.value);
|
|
4962
|
+
T = [].concat(x[s.value]);
|
|
4921
4963
|
}
|
|
4922
|
-
if (o.value && (
|
|
4923
|
-
|
|
4924
|
-
...
|
|
4925
|
-
[c.format.disabled]: i.value(
|
|
4964
|
+
if (o.value && (T = o.value(T)), i.value)
|
|
4965
|
+
T = T.map((x) => ({
|
|
4966
|
+
...x,
|
|
4967
|
+
[c.format.disabled]: i.value(x)
|
|
4926
4968
|
}));
|
|
4927
4969
|
else if (u.value) {
|
|
4928
|
-
const { disabledValues:
|
|
4929
|
-
A ?
|
|
4930
|
-
const
|
|
4931
|
-
return
|
|
4932
|
-
}) :
|
|
4933
|
-
const
|
|
4934
|
-
return
|
|
4970
|
+
const { disabledValues: x, disabledType: j = c.treeSetting.valueField, reverse: A = !1 } = u.value, D = typeof x == "string" ? x.split(",") : x;
|
|
4971
|
+
A ? T = T.map((S) => {
|
|
4972
|
+
const R = JSON.parse(JSON.stringify(S));
|
|
4973
|
+
return R[c.format.disabled] = !D.includes(R[j]) || R[c.format.disabled], R;
|
|
4974
|
+
}) : T = T.map((S) => {
|
|
4975
|
+
const R = JSON.parse(JSON.stringify(S));
|
|
4976
|
+
return R[c.format.disabled] = D.includes(R[j]) || R[c.format.disabled], R;
|
|
4935
4977
|
});
|
|
4936
4978
|
}
|
|
4937
|
-
|
|
4938
|
-
}, C = computed(() => store.state.isGettingDictTypes.includes(s.value)),
|
|
4939
|
-
const
|
|
4979
|
+
g.list = T;
|
|
4980
|
+
}, C = computed(() => store.state.isGettingDictTypes.includes(s.value)), _ = computed(() => store.state.isGettingAllDictTypes), l = computed(() => {
|
|
4981
|
+
const T = store.state.dictConfig.treeSetting, x = store.state.dictConfig.format, j = d.props ?? {};
|
|
4940
4982
|
return {
|
|
4941
|
-
disabled: (
|
|
4942
|
-
label: (
|
|
4943
|
-
children: (
|
|
4944
|
-
isLeaf: (
|
|
4983
|
+
disabled: (j == null ? void 0 : j.disabled) ?? x.disabled,
|
|
4984
|
+
label: (j == null ? void 0 : j.label) ?? T.labelField,
|
|
4985
|
+
children: (j == null ? void 0 : j.children) ?? T.childrenField,
|
|
4986
|
+
isLeaf: (j == null ? void 0 : j.leaf) ?? T.leafField
|
|
4945
4987
|
};
|
|
4946
|
-
}),
|
|
4947
|
-
if (
|
|
4988
|
+
}), v = computed(() => {
|
|
4989
|
+
if (g.list.length === 0)
|
|
4948
4990
|
return [];
|
|
4949
|
-
const
|
|
4950
|
-
id:
|
|
4951
|
-
...
|
|
4991
|
+
const T = JSON.parse(JSON.stringify(g.list)).map((j) => ({
|
|
4992
|
+
id: j[w.value.valueField],
|
|
4993
|
+
...j
|
|
4952
4994
|
}));
|
|
4953
|
-
let
|
|
4954
|
-
return n.value &&
|
|
4995
|
+
let x = ListToTree(T, w.value);
|
|
4996
|
+
return n.value && y(x, +n.value), x;
|
|
4955
4997
|
});
|
|
4956
4998
|
watch(
|
|
4957
|
-
[C,
|
|
4958
|
-
([
|
|
4959
|
-
!
|
|
4999
|
+
[C, _],
|
|
5000
|
+
([T, x]) => {
|
|
5001
|
+
!T && !x && m();
|
|
4960
5002
|
},
|
|
4961
5003
|
{
|
|
4962
5004
|
immediate: !0
|
|
4963
5005
|
}
|
|
4964
5006
|
);
|
|
4965
|
-
const
|
|
4966
|
-
return r({ getElTreeRef: () =>
|
|
5007
|
+
const b = ref(null);
|
|
5008
|
+
return r({ getElTreeRef: () => b.value }), (T, x) => (openBlock(), createBlock(unref(ElTree), mergeProps({
|
|
4967
5009
|
ref_key: "ElTreeRef",
|
|
4968
|
-
ref:
|
|
4969
|
-
data:
|
|
5010
|
+
ref: b,
|
|
5011
|
+
data: v.value,
|
|
4970
5012
|
props: l.value
|
|
4971
|
-
},
|
|
4972
|
-
renderList(
|
|
5013
|
+
}, T.$attrs), createSlots({ _: 2 }, [
|
|
5014
|
+
renderList(T.$slots, (j, A, D) => ({
|
|
4973
5015
|
name: A,
|
|
4974
|
-
fn: withCtx((
|
|
4975
|
-
renderSlot(
|
|
5016
|
+
fn: withCtx((S) => [
|
|
5017
|
+
renderSlot(T.$slots, A, mergeProps({ key: D }, S))
|
|
4976
5018
|
])
|
|
4977
5019
|
}))
|
|
4978
5020
|
]), 1040, ["data", "props"]));
|
|
@@ -5013,85 +5055,85 @@ const __vite_glob_0_20 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
5013
5055
|
useAttrs();
|
|
5014
5056
|
const d = e, { maxLevel: t, dictType: n, disabledObj: a, filterDataFun: u, disabledDataFun: o } = toRefs(d), i = ref(""), s = toRaw(store.state.dictConfig), c = reactive({
|
|
5015
5057
|
list: []
|
|
5016
|
-
}),
|
|
5017
|
-
const
|
|
5058
|
+
}), g = computed(() => {
|
|
5059
|
+
const b = {
|
|
5018
5060
|
labelField: "label",
|
|
5019
5061
|
valueField: "value",
|
|
5020
5062
|
childrenField: "children",
|
|
5021
5063
|
leafField: s.treeSetting.leafField
|
|
5022
|
-
},
|
|
5023
|
-
return Object.assign(
|
|
5024
|
-
}), w = (
|
|
5025
|
-
for (let
|
|
5026
|
-
const
|
|
5027
|
-
if (
|
|
5028
|
-
delete
|
|
5064
|
+
}, E = JSON.parse(JSON.stringify(s.treeSetting));
|
|
5065
|
+
return Object.assign(E, b);
|
|
5066
|
+
}), w = (b, E) => {
|
|
5067
|
+
for (let T = 0; T < b.length; T++) {
|
|
5068
|
+
const x = b[T];
|
|
5069
|
+
if (x[g.value.levelField] === E) {
|
|
5070
|
+
delete x[g.value.childrenField], x[g.value.leafField] = !0;
|
|
5029
5071
|
continue;
|
|
5030
5072
|
} else {
|
|
5031
|
-
const A =
|
|
5032
|
-
w(A,
|
|
5073
|
+
const A = x[g.value.childrenField];
|
|
5074
|
+
w(A, E);
|
|
5033
5075
|
}
|
|
5034
5076
|
}
|
|
5035
|
-
},
|
|
5077
|
+
}, y = async () => {
|
|
5036
5078
|
if (!n.value)
|
|
5037
5079
|
return;
|
|
5038
|
-
let
|
|
5080
|
+
let b = [];
|
|
5039
5081
|
if (typeof n.value == "object") {
|
|
5040
5082
|
i.value = n.value.type;
|
|
5041
|
-
const
|
|
5042
|
-
|
|
5043
|
-
const { filters:
|
|
5044
|
-
|
|
5083
|
+
const E = await store.actions.getDictDataObj(i.value);
|
|
5084
|
+
b = [].concat(E[i.value]);
|
|
5085
|
+
const { filters: T, filterType: x = s.format.value, reverse: j = !1 } = n.value, A = typeof T == "string" ? T.split(",") : T;
|
|
5086
|
+
j ? b = b.filter((D) => !A.includes(D[x])) : b = b.filter((D) => A.includes(D[x]));
|
|
5045
5087
|
} else {
|
|
5046
5088
|
i.value = n.value;
|
|
5047
|
-
const
|
|
5048
|
-
|
|
5089
|
+
const E = await store.actions.getDictDataObj(i.value);
|
|
5090
|
+
b = [].concat(E[i.value]);
|
|
5049
5091
|
}
|
|
5050
|
-
if (u.value && (
|
|
5051
|
-
|
|
5052
|
-
...
|
|
5053
|
-
[s.format.disabled]: o.value(
|
|
5092
|
+
if (u.value && (b = u.value(b)), o.value)
|
|
5093
|
+
b = b.map((E) => ({
|
|
5094
|
+
...E,
|
|
5095
|
+
[s.format.disabled]: o.value(E)
|
|
5054
5096
|
}));
|
|
5055
5097
|
else if (a.value) {
|
|
5056
|
-
const { disabledValues:
|
|
5057
|
-
|
|
5058
|
-
const
|
|
5059
|
-
return
|
|
5060
|
-
}) :
|
|
5061
|
-
const
|
|
5062
|
-
return
|
|
5098
|
+
const { disabledValues: E, disabledType: T = s.treeSetting.valueField, reverse: x = !1 } = a.value, j = typeof E == "string" ? E.split(",") : E;
|
|
5099
|
+
x ? b = b.map((A) => {
|
|
5100
|
+
const D = JSON.parse(JSON.stringify(A));
|
|
5101
|
+
return D[s.format.disabled] = !j.includes(D[T]) || D[s.format.disabled], D;
|
|
5102
|
+
}) : b = b.map((A) => {
|
|
5103
|
+
const D = JSON.parse(JSON.stringify(A));
|
|
5104
|
+
return D[s.format.disabled] = j.includes(D[T]) || D[s.format.disabled], D;
|
|
5063
5105
|
});
|
|
5064
5106
|
}
|
|
5065
|
-
c.list =
|
|
5066
|
-
}, m = computed(() => store.state.isGettingDictTypes.includes(i.value)), C = computed(() => store.state.isGettingAllDictTypes),
|
|
5067
|
-
const
|
|
5068
|
-
label:
|
|
5069
|
-
value:
|
|
5070
|
-
children:
|
|
5071
|
-
...
|
|
5107
|
+
c.list = b;
|
|
5108
|
+
}, m = computed(() => store.state.isGettingDictTypes.includes(i.value)), C = computed(() => store.state.isGettingAllDictTypes), _ = computed(() => {
|
|
5109
|
+
const b = JSON.parse(JSON.stringify(c.list)).map((T) => ({
|
|
5110
|
+
label: T[g.value.labelField],
|
|
5111
|
+
value: T[g.value.valueField],
|
|
5112
|
+
children: T[g.value.childrenField],
|
|
5113
|
+
...T
|
|
5072
5114
|
}));
|
|
5073
|
-
let
|
|
5074
|
-
return t.value && w(
|
|
5115
|
+
let E = ListToTree(b, g.value);
|
|
5116
|
+
return t.value && w(E, +t.value), E;
|
|
5075
5117
|
});
|
|
5076
5118
|
watch(
|
|
5077
5119
|
[m, C],
|
|
5078
|
-
([
|
|
5079
|
-
!
|
|
5120
|
+
([b, E]) => {
|
|
5121
|
+
!b && !E && y();
|
|
5080
5122
|
},
|
|
5081
5123
|
{
|
|
5082
5124
|
immediate: !0
|
|
5083
5125
|
}
|
|
5084
5126
|
);
|
|
5085
5127
|
const l = ref(null);
|
|
5086
|
-
return r({ getElTreeSelectRef: () => l.value }), (
|
|
5128
|
+
return r({ getElTreeSelectRef: () => l.value }), (b, E) => (openBlock(), createBlock(unref(ElTreeSelect), mergeProps({
|
|
5087
5129
|
ref_key: "ElTreeSelectRef",
|
|
5088
5130
|
ref: l,
|
|
5089
|
-
data:
|
|
5090
|
-
},
|
|
5091
|
-
renderList(
|
|
5092
|
-
name:
|
|
5131
|
+
data: _.value
|
|
5132
|
+
}, b.$attrs, { "popper-options": { modifiers: [{ name: "computeStyles", options: { adaptive: !1 } }] } }), createSlots({ _: 2 }, [
|
|
5133
|
+
renderList(b.$slots, (T, x, j) => ({
|
|
5134
|
+
name: x,
|
|
5093
5135
|
fn: withCtx((A) => [
|
|
5094
|
-
renderSlot(
|
|
5136
|
+
renderSlot(b.$slots, x, mergeProps({ key: j }, A))
|
|
5095
5137
|
])
|
|
5096
5138
|
}))
|
|
5097
5139
|
]), 1040, ["data"]));
|
|
@@ -5209,8 +5251,8 @@ async function getDictCodeReq(e, r) {
|
|
|
5209
5251
|
const s = store.state.dictCodes;
|
|
5210
5252
|
o = u;
|
|
5211
5253
|
const c = { ...s };
|
|
5212
|
-
o.forEach((
|
|
5213
|
-
c.hasOwnProperty(
|
|
5254
|
+
o.forEach((g) => {
|
|
5255
|
+
c.hasOwnProperty(g) && delete c[g];
|
|
5214
5256
|
}), store.mutations.SET_DICT_CODES(c), e.storage.setItem(e.dictDataKey, JSON.stringify(c));
|
|
5215
5257
|
} else if (u.length > 0)
|
|
5216
5258
|
for (let s = 0; s < u.length; s++)
|
|
@@ -5221,28 +5263,28 @@ async function getDictCodeReq(e, r) {
|
|
|
5221
5263
|
store.mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!0);
|
|
5222
5264
|
const c = await e.getDictCodeApi(e.formatterRequest(e.query, s));
|
|
5223
5265
|
store.mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!1);
|
|
5224
|
-
const
|
|
5266
|
+
const g = e.formatterDictList(c, s), w = e.formatterDictVersion(c);
|
|
5225
5267
|
e.storage.setItem(e.versionKey, w);
|
|
5226
|
-
const
|
|
5268
|
+
const y = Object.assign(store.state.dictCodes, g), m = formatDictData(y, e.filterDataFun, e.disabledDataFun, (i = e == null ? void 0 : e.format) == null ? void 0 : i.disabled);
|
|
5227
5269
|
store.mutations.SET_DICT_CODES(m), e.storage.setItem(e.dictDataKey, JSON.stringify(m));
|
|
5228
5270
|
} else if (o.length > 0)
|
|
5229
5271
|
for (let c = 0; c < o.length; c++) {
|
|
5230
|
-
const
|
|
5231
|
-
store.actions.getDictDataObj(
|
|
5272
|
+
const g = o[c];
|
|
5273
|
+
store.actions.getDictDataObj(g);
|
|
5232
5274
|
}
|
|
5233
5275
|
}
|
|
5234
5276
|
}
|
|
5235
5277
|
let vue3ElementDict = {
|
|
5236
5278
|
async install(e, r) {
|
|
5237
|
-
var
|
|
5279
|
+
var y, m;
|
|
5238
5280
|
const d = console.warn;
|
|
5239
5281
|
console.warn = (...C) => {
|
|
5240
|
-
const
|
|
5241
|
-
|
|
5282
|
+
const _ = typeof C[0] == "string" ? C[0] : "";
|
|
5283
|
+
_.includes("formItemContextKey") || _.includes("formContextKey") || d.apply(console, C);
|
|
5242
5284
|
};
|
|
5243
5285
|
const t = e.config.warnHandler;
|
|
5244
|
-
e.config.warnHandler = (C,
|
|
5245
|
-
typeof C == "string" && (C.includes("formItemContextKey") || C.includes("formContextKey")) || t == null || t(C,
|
|
5286
|
+
e.config.warnHandler = (C, _, l) => {
|
|
5287
|
+
typeof C == "string" && (C.includes("formItemContextKey") || C.includes("formContextKey")) || t == null || t(C, _, l);
|
|
5246
5288
|
};
|
|
5247
5289
|
const n = {
|
|
5248
5290
|
timeout: 3e4,
|
|
@@ -5318,8 +5360,8 @@ let vue3ElementDict = {
|
|
|
5318
5360
|
type: "type",
|
|
5319
5361
|
color: "color"
|
|
5320
5362
|
},
|
|
5321
|
-
formatterRequest: (C,
|
|
5322
|
-
formatterDictList: (C,
|
|
5363
|
+
formatterRequest: (C, _) => _ ? { [C]: _ } : { [C]: "" },
|
|
5364
|
+
formatterDictList: (C, _) => !C || !C.dictData ? {} : C.dictData,
|
|
5323
5365
|
formatterDictVersion: (C) => !C || !C.version ? "unknow" : C.version,
|
|
5324
5366
|
version: "unknow",
|
|
5325
5367
|
storage: localStorage,
|
|
@@ -5341,33 +5383,33 @@ let vue3ElementDict = {
|
|
|
5341
5383
|
}
|
|
5342
5384
|
let o = JSON.parse(JSON.stringify(a.localDictCodes));
|
|
5343
5385
|
o = Object.assign(u, o);
|
|
5344
|
-
const i = formatDictData(o, a.filterDataFun, a.disabledDataFun, (
|
|
5386
|
+
const i = formatDictData(o, a.filterDataFun, a.disabledDataFun, (y = a == null ? void 0 : a.format) == null ? void 0 : y.disabled);
|
|
5345
5387
|
a.storage.setItem(a.dictDataKey, JSON.stringify(i)), store.mutations.SET_DICT_CODES(i);
|
|
5346
5388
|
const s = a.storage.getItem(a.versionKey);
|
|
5347
5389
|
let c = a.usuallyGetDictTypes ? a.usuallyGetDictTypes.split(",") : [];
|
|
5348
5390
|
if (a.version !== s) {
|
|
5349
5391
|
const C = a.storage.getItem(a.dictDataKey);
|
|
5350
|
-
let
|
|
5392
|
+
let _ = {};
|
|
5351
5393
|
try {
|
|
5352
|
-
|
|
5394
|
+
_ = C ? JSON.parse(C) : {};
|
|
5353
5395
|
} catch {
|
|
5354
|
-
|
|
5396
|
+
_ = {}, console.error();
|
|
5355
5397
|
}
|
|
5356
|
-
const l =
|
|
5357
|
-
c = [...new Set(
|
|
5358
|
-
const
|
|
5359
|
-
a.storage.setItem(a.dictDataKey, JSON.stringify(
|
|
5398
|
+
const l = _ ? Object.keys(_) : [], v = a.localDictCodes ? Object.keys(a.localDictCodes) : [], b = l.filter((j) => !v.includes(j)), E = [...c, ...b];
|
|
5399
|
+
c = [...new Set(E)], a.storage.removeItem(a.dictDataKey), a.storage.setItem(a.versionKey, a.version);
|
|
5400
|
+
const T = JSON.parse(JSON.stringify(a.localDictCodes)), x = formatDictData(T, a.filterDataFun, a.disabledDataFun, (m = a == null ? void 0 : a.format) == null ? void 0 : m.disabled);
|
|
5401
|
+
a.storage.setItem(a.dictDataKey, JSON.stringify(x)), store.mutations.SET_DICT_CODES(x);
|
|
5360
5402
|
}
|
|
5361
5403
|
a.getLoginStatusFunc() && (a.isGetAll || c.length > 0) && getDictCodeReq(a, c), components.forEach((C) => {
|
|
5362
|
-
const
|
|
5404
|
+
const _ = C.name.slice(4), l = a.componentsPreFix + _;
|
|
5363
5405
|
e.component(l, C);
|
|
5364
5406
|
});
|
|
5365
|
-
const
|
|
5407
|
+
const g = reactive({
|
|
5366
5408
|
hadLogin: computed(() => store.state.dictConfig.getLoginStatusFunc())
|
|
5367
5409
|
});
|
|
5368
5410
|
(() => {
|
|
5369
5411
|
loginWatcher && (loginWatcher(), loginWatcher = null), loginWatcher = watch(
|
|
5370
|
-
() =>
|
|
5412
|
+
() => g.hadLogin,
|
|
5371
5413
|
(C) => {
|
|
5372
5414
|
a.loginStatusChangeFunc && a.loginStatusChangeFunc(C), C && (a.isGetAll || c.length > 0) && getDictCodeReq(a, c);
|
|
5373
5415
|
},
|