vue3-element-dict 3.2.3 → 3.2.5
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 -4
- package/lib/style.css +1 -1
- package/lib/vue3-element-dict.js +1115 -1103
- package/package.json +1 -1
package/lib/vue3-element-dict.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { reactive, defineComponent, toRefs, toRaw, useAttrs, computed, ref, watchEffect, createBlock, openBlock, unref, mergeProps, createSlots, withCtx, createTextVNode, toDisplayString, renderList, renderSlot, watch, h, createElementBlock, Fragment, createCommentVNode, resolveDynamicComponent, onMounted, normalizeStyle, normalizeClass, normalizeProps, guardReactiveProps, inject, createVNode, resolveComponent, nextTick, provide, onUnmounted, withDirectives, vShow } from "vue";
|
|
2
2
|
import { ElButton, ElCascader, ElCheckTag, formItemContextKey, formContextKey, ElCheckboxGroup, ElCheckboxButton, ElCheckbox, ElTag, ElLink, ElText, ElDescriptions, ElDescriptionsItem, ElTableColumn, ElTable, ElForm, ElFormItem, ElIcon, ElInput, ElRadioGroup, ElRadioButton, ElRadio, ElSelect, ElOption, ElTabs, ElTabPane, ElTree, ElTreeSelect } from "element-plus";
|
|
3
|
-
import { ArrowDown
|
|
3
|
+
import { ArrowDown } from "@element-plus/icons-vue";
|
|
4
4
|
const formatDictData = (e, r, d, t) => {
|
|
5
5
|
const n = {};
|
|
6
6
|
for (let a in e)
|
|
@@ -11,72 +11,72 @@ const formatDictData = (e, r, d, t) => {
|
|
|
11
11
|
return n;
|
|
12
12
|
};
|
|
13
13
|
function sortComponentsByIdDependencies(e) {
|
|
14
|
-
const r = (
|
|
14
|
+
const r = (_) => {
|
|
15
15
|
const C = /* @__PURE__ */ new Set(), l = /\$\{(\w+)\}/g;
|
|
16
|
-
let
|
|
17
|
-
for (; (
|
|
18
|
-
C.add(
|
|
16
|
+
let g;
|
|
17
|
+
for (; (g = l.exec(_)) !== null; )
|
|
18
|
+
C.add(g[1]);
|
|
19
19
|
return Array.from(C);
|
|
20
|
-
}, d = (
|
|
21
|
-
const C = /* @__PURE__ */ new Set(), l = (
|
|
22
|
-
typeof
|
|
20
|
+
}, d = (_) => {
|
|
21
|
+
const C = /* @__PURE__ */ new Set(), l = (g) => {
|
|
22
|
+
typeof g == "string" ? r(g).forEach((T) => C.add(T)) : Array.isArray(g) ? g.forEach(l) : g && typeof g == "object" && Object.values(g).forEach(l);
|
|
23
23
|
};
|
|
24
|
-
return l(
|
|
25
|
-
}, t = (
|
|
26
|
-
const { showRuleType: C, showRules: l } =
|
|
27
|
-
return l == null ? [] : (C === "validate" ? typeof l == "string" ?
|
|
28
|
-
typeof
|
|
29
|
-
}) : ["compare", "calculate", ""].includes(C) ? d(l).forEach((
|
|
30
|
-
|
|
31
|
-
}), Array.from(
|
|
32
|
-
}, n = (
|
|
33
|
-
const { validatorRuleType: C, props: l } =
|
|
34
|
-
return l != null && l.rules ? (l.rules.forEach((
|
|
35
|
-
if (!(
|
|
24
|
+
return l(_), Array.from(C);
|
|
25
|
+
}, t = (_) => {
|
|
26
|
+
const { showRuleType: C, showRules: l } = _, g = /* @__PURE__ */ new Set();
|
|
27
|
+
return l == null ? [] : (C === "validate" ? typeof l == "string" ? g.add(l) : Array.isArray(l) && l.forEach((T) => {
|
|
28
|
+
typeof T == "string" && g.add(T);
|
|
29
|
+
}) : ["compare", "calculate", ""].includes(C) ? d(l).forEach((T) => g.add(T)) : typeof C == "string" && Array.isArray(l) && l.forEach((T) => {
|
|
30
|
+
T && typeof T == "object" && "rules" in T && d(T.rules).forEach((E) => g.add(E));
|
|
31
|
+
}), Array.from(g));
|
|
32
|
+
}, n = (_) => {
|
|
33
|
+
const { validatorRuleType: C, props: l } = _, g = /* @__PURE__ */ new Set();
|
|
34
|
+
return l != null && l.rules ? (l.rules.forEach((T) => {
|
|
35
|
+
if (!(T != null && T.validator))
|
|
36
36
|
return;
|
|
37
|
-
const E =
|
|
38
|
-
E != null && (["compare", "calculate", "", void 0].includes(C) ? d(E).forEach((
|
|
39
|
-
|
|
37
|
+
const E = T.validator;
|
|
38
|
+
E != null && (["compare", "calculate", "", void 0].includes(C) ? d(E).forEach((y) => g.add(y)) : typeof C == "string" && Array.isArray(E) && E.forEach((y) => {
|
|
39
|
+
y && typeof y == "object" && "rules" in y && d(y.rules).forEach((x) => g.add(x));
|
|
40
40
|
}));
|
|
41
|
-
}), Array.from(
|
|
41
|
+
}), Array.from(g)) : [];
|
|
42
42
|
}, a = /* @__PURE__ */ new Map();
|
|
43
|
-
e.forEach((
|
|
44
|
-
|
|
43
|
+
e.forEach((_) => {
|
|
44
|
+
_.fieldName && _.id && a.set(_.fieldName, _.id);
|
|
45
45
|
});
|
|
46
|
-
const u = e.map((
|
|
47
|
-
const C = t(
|
|
46
|
+
const u = e.map((_) => {
|
|
47
|
+
const C = t(_), l = n(_), T = [.../* @__PURE__ */ new Set([...C, ...l])].map((E) => a.get(E)).filter((E) => E !== void 0 && e.some((y) => y.id === E));
|
|
48
48
|
return {
|
|
49
|
-
id:
|
|
50
|
-
component:
|
|
51
|
-
depsIds:
|
|
49
|
+
id: _.id,
|
|
50
|
+
component: _,
|
|
51
|
+
depsIds: T
|
|
52
52
|
// 该组件id依赖的其他id数组
|
|
53
53
|
};
|
|
54
|
-
}), o = new Set(u.map((
|
|
55
|
-
u.forEach(({ id:
|
|
56
|
-
i.set(
|
|
54
|
+
}), o = new Set(u.map((_) => _.id)), i = /* @__PURE__ */ new Map();
|
|
55
|
+
u.forEach(({ id: _ }, C) => {
|
|
56
|
+
i.set(_, C);
|
|
57
57
|
});
|
|
58
58
|
const s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
|
|
59
|
-
o.forEach((
|
|
60
|
-
s.set(
|
|
61
|
-
}), u.forEach(({ id:
|
|
59
|
+
o.forEach((_) => {
|
|
60
|
+
s.set(_, []), c.set(_, 0);
|
|
61
|
+
}), u.forEach(({ id: _, depsIds: C }) => {
|
|
62
62
|
C.forEach((l) => {
|
|
63
|
-
s.get(l).push(
|
|
63
|
+
s.get(l).push(_), c.set(_, c.get(_) + 1);
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
|
-
const
|
|
67
|
-
for (;
|
|
68
|
-
const
|
|
69
|
-
w.push(
|
|
66
|
+
const v = [...o].filter((_) => c.get(_) === 0).sort((_, C) => i.get(_) - i.get(C)), w = [];
|
|
67
|
+
for (; v.length > 0; ) {
|
|
68
|
+
const _ = v.shift();
|
|
69
|
+
w.push(_), s.get(_).forEach((C) => {
|
|
70
70
|
if (c.set(C, c.get(C) - 1), c.get(C) === 0) {
|
|
71
|
-
const l =
|
|
72
|
-
l === -1 ?
|
|
71
|
+
const l = v.findIndex((g) => i.get(g) > i.get(C));
|
|
72
|
+
l === -1 ? v.push(C) : v.splice(l, 0, C);
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
const b = [...o].filter((
|
|
77
|
-
b.sort((
|
|
78
|
-
const m = new Map(e.map((
|
|
79
|
-
return w.map((
|
|
76
|
+
const b = [...o].filter((_) => !w.includes(_));
|
|
77
|
+
b.sort((_, C) => i.get(_) - i.get(C)), w.push(...b);
|
|
78
|
+
const m = new Map(e.map((_) => [_.id, _]));
|
|
79
|
+
return w.map((_) => m.get(_));
|
|
80
80
|
}
|
|
81
81
|
const state = reactive({
|
|
82
82
|
//超时时间
|
|
@@ -218,52 +218,52 @@ const actions = {
|
|
|
218
218
|
formatterRequest: i,
|
|
219
219
|
query: s,
|
|
220
220
|
versionKey: c,
|
|
221
|
-
localDictCodes:
|
|
221
|
+
localDictCodes: v,
|
|
222
222
|
formatterDictList: w,
|
|
223
223
|
formatterDictVersion: b,
|
|
224
224
|
isGetAll: m,
|
|
225
|
-
filterDataFun:
|
|
225
|
+
filterDataFun: _,
|
|
226
226
|
disabledDataFun: C,
|
|
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, g = state.dictCodes || v, T = !t && t !== 0 ? e : state.isGettingDictTypes.join(",");
|
|
229
|
+
u(i(s, T)).then((E) => {
|
|
230
|
+
mutations.REMOVE_IS_GETTING_DICT_TYPES(T);
|
|
231
|
+
const y = b(E), x = n.getItem(c);
|
|
232
|
+
if (y !== x) {
|
|
233
|
+
let N = "";
|
|
234
234
|
if (m)
|
|
235
|
-
|
|
235
|
+
N = "", mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!0);
|
|
236
236
|
else {
|
|
237
237
|
if (o) {
|
|
238
|
-
const j = Object.keys(
|
|
239
|
-
let
|
|
240
|
-
|
|
238
|
+
const j = Object.keys(g), F = o.split(","), B = Object.keys(v), I = j.filter((f) => !B.includes(f)), G = F.filter((f) => B.includes(f) ? (console.warn(`注意:usuallyGetDictTypes配置与本地字典配置的字典类型${f}冲突`), !1) : !0);
|
|
239
|
+
let D = I.concat(G);
|
|
240
|
+
D = D.concat(T.split(",")), N = Array.from(new Set(D)).join(",");
|
|
241
241
|
} else {
|
|
242
|
-
const j = Object.keys(
|
|
243
|
-
let
|
|
244
|
-
|
|
242
|
+
const j = Object.keys(g), F = Object.keys(v);
|
|
243
|
+
let B = j.filter((G) => !F.includes(G));
|
|
244
|
+
B = B.concat(T.split(",")), N = Array.from(new Set(B)).join(",");
|
|
245
245
|
}
|
|
246
|
-
mutations.ADD_IS_GETTING_DICT_TYPES(
|
|
246
|
+
mutations.ADD_IS_GETTING_DICT_TYPES(N);
|
|
247
247
|
}
|
|
248
|
-
u(i(s,
|
|
249
|
-
const
|
|
250
|
-
if (!(
|
|
248
|
+
u(i(s, N)).then((j) => {
|
|
249
|
+
const F = w(j, e);
|
|
250
|
+
if (!(F[e] && F[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(T);
|
|
255
|
+
const B = b(j), I = Object.assign(JSON.parse(JSON.stringify(v)), F), G = formatDictData(I, _, C, l == null ? void 0 : l.disabled);
|
|
256
|
+
n.setItem(a, JSON.stringify(G)), n.setItem(c, B), mutations.SET_DICT_CODES(G), r(state.dictCodes), state.isGettingAllDictTypes ? mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!1) : mutations.REMOVE_IS_GETTING_DICT_TYPES(N);
|
|
257
257
|
});
|
|
258
258
|
} else {
|
|
259
|
-
const
|
|
260
|
-
if (!(
|
|
259
|
+
const N = w(E, e);
|
|
260
|
+
if (!(N[e] && N[e].length > 0)) {
|
|
261
261
|
d(`不存在类型为:${e} 的字典字段,请确认后再填写`);
|
|
262
262
|
return;
|
|
263
263
|
}
|
|
264
|
-
mutations.REMOVE_UNFIND_DICT_TYPES(
|
|
265
|
-
const j = state.dictCodes ||
|
|
266
|
-
Object.assign(j,
|
|
264
|
+
mutations.REMOVE_UNFIND_DICT_TYPES(T);
|
|
265
|
+
const j = state.dictCodes || v, F = formatDictData(N, _, C, l == null ? void 0 : l.disabled);
|
|
266
|
+
Object.assign(j, F), n.setItem(a, JSON.stringify(j)), mutations.SET_DICT_CODES(j), 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 v = o.find((w) => w[a.value] === e);
|
|
291
|
+
t(v ? v[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, v = Date.now(), w = window.setInterval(() => {
|
|
335
|
+
if (Date.now() - v > c) {
|
|
336
336
|
clearInterval(w), a("getLabelByCodes获取字典数据超时");
|
|
337
337
|
return;
|
|
338
338
|
}
|
|
@@ -351,7 +351,7 @@ const GetLabelByCodes = (e, r, d) => {
|
|
|
351
351
|
a(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
352
352
|
return;
|
|
353
353
|
}
|
|
354
|
-
const
|
|
354
|
+
const v = 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
|
+
v && v.length > 0 ? t.formatFun(v, 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 v = o.find((w) => w[a.label] === e);
|
|
395
|
+
t(v ? v[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, v = Date.now(), w = window.setInterval(() => {
|
|
438
|
+
if (Date.now() - v > c) {
|
|
439
439
|
clearInterval(w), a("getCodeByLabels获取字典数据超时");
|
|
440
440
|
return;
|
|
441
441
|
}
|
|
@@ -454,14 +454,14 @@ const GetCodeByLabels = (e, r, d) => {
|
|
|
454
454
|
a(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
455
455
|
return;
|
|
456
456
|
}
|
|
457
|
-
const
|
|
457
|
+
const v = GetCodeByLabelsDothings(
|
|
458
458
|
u,
|
|
459
459
|
s,
|
|
460
460
|
o,
|
|
461
461
|
t.defaultVal
|
|
462
462
|
);
|
|
463
463
|
n(
|
|
464
|
-
|
|
464
|
+
v && v.length > 0 ? t.formatFun(v, 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((v) => t.includes(v))) {
|
|
497
497
|
clearInterval(s);
|
|
498
|
-
for (let
|
|
499
|
-
const w = u[
|
|
498
|
+
for (let v = 0; v < u.length; v++) {
|
|
499
|
+
const w = u[v];
|
|
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 v = o.find((w) => w[a.value] === e);
|
|
523
|
+
t(v || (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: v, color: w, judgeDisabledFun: b, disabled: m } = toRefs(t), _ = toRaw(store.state.dictConfig), C = d, l = useAttrs(), g = computed(() => s.value ? s.value(o.value) : c.value ? c.value : y.value && y.value[_.format.type] ? y.value[_.format.type] : "primary"), T = computed(() => v != null && v.value ? v.value(o.value) : w != null && w.value ? w.value : y.value && y.value[_.format.color] ? y.value[_.format.color] : ""), E = computed(() => b.value ? b.value(o.value) : y.value && y.value[_.format.disabled] ? y.value[_.format.disabled] : !!m.value);
|
|
589
|
+
let y = 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((B) => {
|
|
596
|
+
B ? (y.value = B, x.value = B[_.format.label]) : (y.value = null, x.value = String(a.value ?? (o.value === 0 ? 0 : o.value || u.value)));
|
|
597
597
|
});
|
|
598
598
|
});
|
|
599
|
-
const
|
|
599
|
+
const N = () => {
|
|
600
600
|
E.value || C(n.value, l);
|
|
601
601
|
}, j = ref(null);
|
|
602
|
-
return r({ getElButtonRef: () => j.value }), (
|
|
602
|
+
return r({ getElButtonRef: () => j.value }), (B, I) => (openBlock(), createBlock(unref(ElButton), mergeProps({
|
|
603
603
|
ref_key: "ElButtonRef",
|
|
604
604
|
ref: j,
|
|
605
|
-
type:
|
|
606
|
-
color:
|
|
605
|
+
type: g.value,
|
|
606
|
+
color: T.value,
|
|
607
607
|
disabled: E.value
|
|
608
|
-
},
|
|
608
|
+
}, B.$attrs, { onClick: N }), createSlots({
|
|
609
609
|
default: withCtx(() => [
|
|
610
610
|
createTextVNode(toDisplayString(unref(x)), 1)
|
|
611
611
|
]),
|
|
612
612
|
_: 2
|
|
613
613
|
}, [
|
|
614
|
-
renderList(
|
|
615
|
-
name:
|
|
614
|
+
renderList(B.$slots, (G, D, A) => ({
|
|
615
|
+
name: D,
|
|
616
616
|
fn: withCtx((f) => [
|
|
617
|
-
renderSlot(
|
|
617
|
+
renderSlot(B.$slots, D, mergeProps({ key: A }, f))
|
|
618
618
|
])
|
|
619
619
|
}))
|
|
620
620
|
]), 1040, ["type", "color", "disabled"]));
|
|
@@ -753,7 +753,7 @@ function CheckConditionsByOperation(e, r) {
|
|
|
753
753
|
return d;
|
|
754
754
|
}
|
|
755
755
|
function ValidateNestedRule(e, r) {
|
|
756
|
-
var
|
|
756
|
+
var v, w;
|
|
757
757
|
const d = {
|
|
758
758
|
"+": (b, m) => b + m,
|
|
759
759
|
"-": (b, m) => b - m,
|
|
@@ -771,35 +771,35 @@ function ValidateNestedRule(e, r) {
|
|
|
771
771
|
"===": (b, m) => b === m,
|
|
772
772
|
"!==": (b, m) => b !== m
|
|
773
773
|
}, n = (b, m) => {
|
|
774
|
-
const
|
|
774
|
+
const _ = (C) => {
|
|
775
775
|
if (C instanceof Date)
|
|
776
776
|
return C.getTime();
|
|
777
777
|
if (typeof C == "string" && /^\d{4}[-/]\d{2}[-/]\d{2}(?:\s+\d{2}:\d{2}:\d{2})?$/.test(C)) {
|
|
778
|
-
const
|
|
779
|
-
if (!isNaN(
|
|
780
|
-
return
|
|
778
|
+
const g = new Date(C);
|
|
779
|
+
if (!isNaN(g.getTime()))
|
|
780
|
+
return g.getTime();
|
|
781
781
|
}
|
|
782
782
|
return C;
|
|
783
783
|
};
|
|
784
784
|
if (typeof b == "string" && /^\$\{(.+?)\}$/.test(b)) {
|
|
785
785
|
const l = b.match(/^\$\{(.+?)\}$/)[1].trim().split(".").filter(Boolean);
|
|
786
|
-
let
|
|
787
|
-
if (
|
|
786
|
+
let g = getNestedValue(m, l);
|
|
787
|
+
if (g == null)
|
|
788
788
|
return "";
|
|
789
|
-
if (
|
|
790
|
-
const
|
|
791
|
-
return /^-?\d+(\.\d+)?$/.test(
|
|
789
|
+
if (g = _(g), typeof g == "string") {
|
|
790
|
+
const T = g.trim();
|
|
791
|
+
return /^-?\d+(\.\d+)?$/.test(T) ? Number(T) : T;
|
|
792
792
|
}
|
|
793
|
-
return
|
|
793
|
+
return g;
|
|
794
794
|
}
|
|
795
795
|
return typeof b == "string" && /^-?\d+(\.\d+)?$/.test(b) ? Number(b) : b;
|
|
796
796
|
}, a = (b, m) => {
|
|
797
|
-
var
|
|
797
|
+
var _;
|
|
798
798
|
if (Array.isArray(b)) {
|
|
799
799
|
let C = Array.isArray(b[0]) ? a(b[0], m) : n(b[0], m);
|
|
800
800
|
for (let l = 1; l < b.length; l += 2) {
|
|
801
|
-
const
|
|
802
|
-
C = ((
|
|
801
|
+
const g = b[l], T = b[l + 1], E = Array.isArray(T) ? a(T, m) : n(T, m), y = typeof C == "number" ? C : NaN, x = typeof E == "number" ? E : NaN;
|
|
802
|
+
C = ((_ = d[g]) == null ? void 0 : _.call(d, y, x)) ?? NaN;
|
|
803
803
|
}
|
|
804
804
|
return C;
|
|
805
805
|
}
|
|
@@ -808,7 +808,7 @@ function ValidateNestedRule(e, r) {
|
|
|
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" ? ((v = t[u]) == null ? void 0 : v.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 v = Object.keys(c), w = v.join(", ");
|
|
931
|
+
return new Function(w, `return (${s});`)(...v.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,
|
|
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, v]) => !!v).map(([c]) => c).join(" ") : "", u = (s, c) => {
|
|
936
936
|
const w = new DOMParser().parseFromString(s, "text/html"), b = w.getElementsByTagName("*");
|
|
937
937
|
return Array.from(b).forEach((m) => {
|
|
938
|
-
Array.from(m.attributes).forEach((
|
|
938
|
+
Array.from(m.attributes).forEach((_) => {
|
|
939
939
|
let C;
|
|
940
|
-
if (
|
|
941
|
-
C =
|
|
942
|
-
else if (
|
|
943
|
-
C =
|
|
940
|
+
if (_.name.startsWith(":"))
|
|
941
|
+
C = _.name.slice(1);
|
|
942
|
+
else if (_.name.startsWith("v-bind:"))
|
|
943
|
+
C = _.name.slice(7);
|
|
944
944
|
else
|
|
945
945
|
return;
|
|
946
|
-
const l =
|
|
947
|
-
let
|
|
946
|
+
const l = _.value;
|
|
947
|
+
let g;
|
|
948
948
|
try {
|
|
949
|
-
|
|
950
|
-
} catch (
|
|
951
|
-
console.error(`v-bind表达式错误: ${l}`,
|
|
949
|
+
g = n(l, c);
|
|
950
|
+
} catch (T) {
|
|
951
|
+
console.error(`v-bind表达式错误: ${l}`, T), g = "";
|
|
952
952
|
}
|
|
953
|
-
if (
|
|
953
|
+
if (g == null)
|
|
954
954
|
m.removeAttribute(C);
|
|
955
955
|
else {
|
|
956
|
-
const
|
|
957
|
-
m.setAttribute(C,
|
|
956
|
+
const T = C === "class" ? a(g) : String(g);
|
|
957
|
+
m.setAttribute(C, T);
|
|
958
958
|
}
|
|
959
|
-
m.removeAttribute(
|
|
959
|
+
m.removeAttribute(_.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, (v, w) => n(w, c)), i = (s, c) => {
|
|
963
|
+
const v = o(s, c);
|
|
964
|
+
return u(v, c);
|
|
965
965
|
};
|
|
966
966
|
return watch(
|
|
967
967
|
() => [r.render, r.scope, r.formData],
|
|
@@ -1023,61 +1023,61 @@ 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:
|
|
1026
|
+
const t = d, n = e, { defaultVal: a, emptyText: u, dictType: o, disabledObj: i, filterDataFun: s, disabledDataFun: c, list: v, col: w, gap: b } = toRefs(n), m = toRaw(store.state.dictConfig), _ = useAttrs();
|
|
1027
1027
|
let C = ref("");
|
|
1028
1028
|
const l = computed(() => {
|
|
1029
|
-
const
|
|
1030
|
-
return Object.entries(
|
|
1029
|
+
const D = {};
|
|
1030
|
+
return Object.entries(_).forEach(([A, f]) => {
|
|
1031
1031
|
const p = ToKebabCase(A);
|
|
1032
1032
|
if (p.startsWith("button-") || p.startsWith("on-button")) {
|
|
1033
1033
|
const k = ToCamelCase(p.replace("button-", ""));
|
|
1034
|
-
|
|
1034
|
+
D[k] = f;
|
|
1035
1035
|
}
|
|
1036
|
-
}),
|
|
1037
|
-
}),
|
|
1038
|
-
const
|
|
1039
|
-
return `calc(${A}% - ${
|
|
1040
|
-
}),
|
|
1041
|
-
const
|
|
1036
|
+
}), D;
|
|
1037
|
+
}), g = computed(() => {
|
|
1038
|
+
const D = Number(w.value), A = 100 / D, f = Array.isArray(b.value) ? b.value : String(b.value).split(" "), p = f[0], S = (f[1] || p) * (D - 1) / D;
|
|
1039
|
+
return `calc(${A}% - ${S}px) !important`;
|
|
1040
|
+
}), T = computed(() => {
|
|
1041
|
+
const D = Array.isArray(b.value) ? b.value : String(b.value).split(" "), A = D[0], f = D[1] || A;
|
|
1042
1042
|
return `${A}px ${f}px`;
|
|
1043
1043
|
});
|
|
1044
|
-
function E(
|
|
1044
|
+
function E(D) {
|
|
1045
1045
|
return {
|
|
1046
1046
|
...l.value,
|
|
1047
|
-
...
|
|
1047
|
+
...D
|
|
1048
1048
|
};
|
|
1049
1049
|
}
|
|
1050
|
-
const
|
|
1050
|
+
const y = ref([]), x = async () => {
|
|
1051
1051
|
if (!o.value)
|
|
1052
1052
|
return;
|
|
1053
|
-
let
|
|
1053
|
+
let D = [];
|
|
1054
1054
|
if (typeof o.value == "object") {
|
|
1055
1055
|
C.value = o.value.type;
|
|
1056
1056
|
const A = await store.actions.getDictDataObj(C.value);
|
|
1057
|
-
|
|
1058
|
-
const { filters: f, filterType: p = m.format.value, reverse: k = !1 } = o.value,
|
|
1059
|
-
k ?
|
|
1057
|
+
D = [].concat(A[C.value]);
|
|
1058
|
+
const { filters: f, filterType: p = m.format.value, reverse: k = !1 } = o.value, S = typeof f == "string" ? f.split(",") : f;
|
|
1059
|
+
k ? D = D.filter((O) => !S.includes(O[p])) : D = D.filter((O) => S.includes(O[p]));
|
|
1060
1060
|
} else {
|
|
1061
1061
|
C.value = o.value;
|
|
1062
1062
|
const A = await store.actions.getDictDataObj(C.value);
|
|
1063
|
-
|
|
1063
|
+
D = [].concat(A[C.value]);
|
|
1064
1064
|
}
|
|
1065
|
-
if (s.value && (
|
|
1066
|
-
|
|
1065
|
+
if (s.value && (D = s.value(D)), c.value)
|
|
1066
|
+
D = D.map((A) => ({
|
|
1067
1067
|
...A,
|
|
1068
1068
|
[m.format.disabled]: c.value(A)
|
|
1069
1069
|
}));
|
|
1070
1070
|
else if (i.value) {
|
|
1071
1071
|
const { disabledValues: A, disabledType: f = m.format.value, reverse: p = !1 } = i.value, k = typeof A == "string" ? A.split(",") : A;
|
|
1072
|
-
p ?
|
|
1073
|
-
const
|
|
1074
|
-
return
|
|
1075
|
-
}) :
|
|
1076
|
-
const
|
|
1077
|
-
return
|
|
1072
|
+
p ? D = D.map((S) => {
|
|
1073
|
+
const O = JSON.parse(JSON.stringify(S));
|
|
1074
|
+
return O[m.format.disabled] = !k.includes(O[f]) || O[m.format.disabled], O;
|
|
1075
|
+
}) : D = D.map((S) => {
|
|
1076
|
+
const O = JSON.parse(JSON.stringify(S));
|
|
1077
|
+
return O[m.format.disabled] = k.includes(O[f]) || O[m.format.disabled], O;
|
|
1078
1078
|
});
|
|
1079
1079
|
}
|
|
1080
|
-
|
|
1080
|
+
y.value = D.map((A) => ({
|
|
1081
1081
|
type: A[m.format.type],
|
|
1082
1082
|
label: A[m.format.label],
|
|
1083
1083
|
color: A[m.format.color],
|
|
@@ -1087,51 +1087,51 @@ const _hoisted_1$1 = ["innerHTML"], _sfc_main$m = /* @__PURE__ */ Object.assign(
|
|
|
1087
1087
|
...A
|
|
1088
1088
|
}));
|
|
1089
1089
|
};
|
|
1090
|
-
async function
|
|
1090
|
+
async function N() {
|
|
1091
1091
|
if (o.value) {
|
|
1092
1092
|
x();
|
|
1093
1093
|
return;
|
|
1094
1094
|
}
|
|
1095
|
-
let
|
|
1096
|
-
for (let A = 0; A <
|
|
1097
|
-
const f =
|
|
1095
|
+
let D = [];
|
|
1096
|
+
for (let A = 0; A < v.value.length; A++) {
|
|
1097
|
+
const f = v.value[A];
|
|
1098
1098
|
if (f.dictType) {
|
|
1099
1099
|
const p = await GetItemByCode(f.modelValue, f.dictType);
|
|
1100
1100
|
f.type = f.type || p[m.format.type] || "", f.label = String(
|
|
1101
1101
|
f.label || (p ? p[m.format.label] : (f.defaultVal || a.value) ?? (f.modelValue === 0 ? 0 : f.modelValue || f.emptyText || u.value))
|
|
1102
1102
|
), f.color = f.color || p[m.format.color] || "", f.icon = f.icon || p[m.format.icon] || "", f.disabled = f.disabled ?? (p[m.format.disabled] || !1);
|
|
1103
1103
|
}
|
|
1104
|
-
|
|
1104
|
+
D.push(f);
|
|
1105
1105
|
}
|
|
1106
|
-
|
|
1106
|
+
y.value = D;
|
|
1107
1107
|
}
|
|
1108
1108
|
onMounted(() => {
|
|
1109
|
-
|
|
1109
|
+
N();
|
|
1110
1110
|
}), watch(
|
|
1111
1111
|
() => n.list,
|
|
1112
1112
|
() => {
|
|
1113
|
-
|
|
1113
|
+
N();
|
|
1114
1114
|
},
|
|
1115
1115
|
{ deep: !0 }
|
|
1116
1116
|
// 深层监听数组/对象变化
|
|
1117
1117
|
);
|
|
1118
|
-
const j = (
|
|
1119
|
-
|
|
1120
|
-
},
|
|
1121
|
-
return r({ getElButtonsRef:
|
|
1118
|
+
const j = (D) => {
|
|
1119
|
+
D.disabled || (D.actionType === "submit" ? t("submit", D) : D.actionType === "reset" ? t("reset", D) : D.actionType === "action" && t("action", D));
|
|
1120
|
+
}, F = ref(null), B = () => F.value, I = ref([]);
|
|
1121
|
+
return r({ getElButtonsRef: B, getElButtonRefs: () => I.value }), (D, A) => (openBlock(), createElementBlock("div", {
|
|
1122
1122
|
ref_key: "ElButtonsRef",
|
|
1123
|
-
ref:
|
|
1124
|
-
class: normalizeClass(["el-buttons-dict",
|
|
1125
|
-
id:
|
|
1126
|
-
style: normalizeStyle({ ...
|
|
1123
|
+
ref: F,
|
|
1124
|
+
class: normalizeClass(["el-buttons-dict", D.$attrs.class]),
|
|
1125
|
+
id: D.$attrs.id,
|
|
1126
|
+
style: normalizeStyle({ ...D.$attrs.style, gap: T.value })
|
|
1127
1127
|
}, [
|
|
1128
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
1128
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(y.value, (f, p) => (openBlock(), createBlock(unref(ElButton), mergeProps({
|
|
1129
1129
|
ref_for: !0,
|
|
1130
1130
|
ref: (k) => {
|
|
1131
|
-
k && (
|
|
1131
|
+
k && (I.value[p] = k);
|
|
1132
1132
|
},
|
|
1133
1133
|
key: p,
|
|
1134
|
-
style: { width:
|
|
1134
|
+
style: { width: g.value, margin: "0 !important" },
|
|
1135
1135
|
onClick: (k) => j(f)
|
|
1136
1136
|
}, E(f)), createSlots({
|
|
1137
1137
|
default: withCtx(() => [
|
|
@@ -1139,13 +1139,13 @@ const _hoisted_1$1 = ["innerHTML"], _sfc_main$m = /* @__PURE__ */ Object.assign(
|
|
|
1139
1139
|
]),
|
|
1140
1140
|
_: 2
|
|
1141
1141
|
}, [
|
|
1142
|
-
renderList(f.slotList, (k,
|
|
1142
|
+
renderList(f.slotList, (k, S) => ({
|
|
1143
1143
|
name: k.slotName,
|
|
1144
|
-
fn: withCtx((
|
|
1144
|
+
fn: withCtx((O) => [
|
|
1145
1145
|
(openBlock(), createBlock(_sfc_main$m, {
|
|
1146
|
-
key:
|
|
1146
|
+
key: S,
|
|
1147
1147
|
render: k.render,
|
|
1148
|
-
scope:
|
|
1148
|
+
scope: O
|
|
1149
1149
|
}, null, 8, ["render", "scope"]))
|
|
1150
1150
|
])
|
|
1151
1151
|
}))
|
|
@@ -1252,99 +1252,99 @@ 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(""), v = toRaw(store.state.dictConfig), w = d, b = (j) => {
|
|
1256
1256
|
w("dictChange", j);
|
|
1257
1257
|
}, m = reactive({
|
|
1258
1258
|
list: []
|
|
1259
|
-
}),
|
|
1259
|
+
}), _ = async () => {
|
|
1260
1260
|
if (!u.value)
|
|
1261
1261
|
return;
|
|
1262
1262
|
let j = [];
|
|
1263
1263
|
if (typeof u.value == "object") {
|
|
1264
1264
|
c.value = u.value.type;
|
|
1265
|
-
const
|
|
1266
|
-
j = [].concat(
|
|
1267
|
-
const { filters:
|
|
1268
|
-
|
|
1265
|
+
const F = await store.actions.getDictDataObj(c.value);
|
|
1266
|
+
j = [].concat(F[c.value]);
|
|
1267
|
+
const { filters: B, filterType: I = v.format.value, reverse: G = !1 } = u.value, D = typeof B == "string" ? B.split(",") : B;
|
|
1268
|
+
G ? j = j.filter((A) => !D.includes(A[I])) : j = j.filter((A) => D.includes(A[I]));
|
|
1269
1269
|
} else {
|
|
1270
1270
|
c.value = u.value;
|
|
1271
|
-
const
|
|
1272
|
-
j = [].concat(
|
|
1271
|
+
const F = await store.actions.getDictDataObj(c.value);
|
|
1272
|
+
j = [].concat(F[c.value]);
|
|
1273
1273
|
}
|
|
1274
1274
|
if (i.value && (j = i.value(j)), s.value)
|
|
1275
|
-
j = j.map((
|
|
1276
|
-
...
|
|
1277
|
-
[
|
|
1275
|
+
j = j.map((F) => ({
|
|
1276
|
+
...F,
|
|
1277
|
+
[v.format.disabled]: s.value(F)
|
|
1278
1278
|
}));
|
|
1279
1279
|
else if (o.value) {
|
|
1280
|
-
const { disabledValues:
|
|
1281
|
-
|
|
1282
|
-
const A = JSON.parse(JSON.stringify(
|
|
1283
|
-
return A[
|
|
1284
|
-
}) : j = j.map((
|
|
1285
|
-
const A = JSON.parse(JSON.stringify(
|
|
1286
|
-
return A[
|
|
1280
|
+
const { disabledValues: F, disabledType: B = v.treeSetting.valueField, reverse: I = !1 } = o.value, G = typeof F == "string" ? F.split(",") : F;
|
|
1281
|
+
I ? j = j.map((D) => {
|
|
1282
|
+
const A = JSON.parse(JSON.stringify(D));
|
|
1283
|
+
return A[v.format.disabled] = !G.includes(A[B]) || A[v.format.disabled], A;
|
|
1284
|
+
}) : j = j.map((D) => {
|
|
1285
|
+
const A = JSON.parse(JSON.stringify(D));
|
|
1286
|
+
return A[v.format.disabled] = G.includes(A[B]) || A[v.format.disabled], A;
|
|
1287
1287
|
});
|
|
1288
1288
|
}
|
|
1289
1289
|
m.list = j;
|
|
1290
|
-
}, C = computed(() => store.state.isGettingDictTypes.includes(c.value)), l = computed(() => store.state.isGettingAllDictTypes),
|
|
1291
|
-
const j = store.state.dictConfig.treeSetting,
|
|
1290
|
+
}, C = computed(() => store.state.isGettingDictTypes.includes(c.value)), l = computed(() => store.state.isGettingAllDictTypes), g = computed(() => {
|
|
1291
|
+
const j = store.state.dictConfig.treeSetting, F = store.state.dictConfig.format, B = t.props ?? {};
|
|
1292
1292
|
return {
|
|
1293
|
-
disabled: (
|
|
1294
|
-
label: (
|
|
1295
|
-
value: (
|
|
1296
|
-
children: (
|
|
1297
|
-
leaf: (
|
|
1293
|
+
disabled: (B == null ? void 0 : B.disabled) ?? F.disabled,
|
|
1294
|
+
label: (B == null ? void 0 : B.label) ?? j.labelField,
|
|
1295
|
+
value: (B == null ? void 0 : B.value) ?? j.valueField,
|
|
1296
|
+
children: (B == null ? void 0 : B.children) ?? j.childrenField,
|
|
1297
|
+
leaf: (B == null ? void 0 : B.leaf) ?? j.leafField
|
|
1298
1298
|
};
|
|
1299
|
-
}),
|
|
1300
|
-
const j = JSON.parse(JSON.stringify(
|
|
1301
|
-
...
|
|
1302
|
-
valueField:
|
|
1303
|
-
labelField:
|
|
1304
|
-
childrenField:
|
|
1305
|
-
leafField:
|
|
1306
|
-
disabled:
|
|
1299
|
+
}), T = computed(() => {
|
|
1300
|
+
const j = JSON.parse(JSON.stringify(v.treeSetting)), F = t.props || {}, B = {
|
|
1301
|
+
...F,
|
|
1302
|
+
valueField: F != null && F.value ? F.value : j.valueField,
|
|
1303
|
+
labelField: F != null && F.label ? F.label : j.labelField,
|
|
1304
|
+
childrenField: F != null && F.children ? F.children : j.childrenField,
|
|
1305
|
+
leafField: F != null && F.leaf ? F.leaf : j.leafField,
|
|
1306
|
+
disabled: F != null && F.disabled ? F.disabled : v.format.disabled
|
|
1307
1307
|
};
|
|
1308
|
-
return Object.assign(j,
|
|
1309
|
-
}), E = (j,
|
|
1310
|
-
for (let
|
|
1311
|
-
const
|
|
1312
|
-
if (
|
|
1313
|
-
delete
|
|
1308
|
+
return Object.assign(j, B);
|
|
1309
|
+
}), E = (j, F) => {
|
|
1310
|
+
for (let B = 0; B < j.length; B++) {
|
|
1311
|
+
const I = j[B];
|
|
1312
|
+
if (I[T.value.levelField] === F) {
|
|
1313
|
+
delete I[T.value.childrenField], I[T.value.leafField] = !0;
|
|
1314
1314
|
continue;
|
|
1315
1315
|
} else {
|
|
1316
|
-
const
|
|
1317
|
-
E(
|
|
1316
|
+
const D = I[T.value.childrenField];
|
|
1317
|
+
E(D, F);
|
|
1318
1318
|
}
|
|
1319
1319
|
}
|
|
1320
|
-
},
|
|
1320
|
+
}, y = computed(() => {
|
|
1321
1321
|
if (m.list.length === 0)
|
|
1322
1322
|
return [];
|
|
1323
1323
|
const j = JSON.parse(JSON.stringify(m.list));
|
|
1324
|
-
let
|
|
1325
|
-
return a.value && E(
|
|
1324
|
+
let F = ListToTree(j, T.value);
|
|
1325
|
+
return a.value && E(F, +a.value), F || [];
|
|
1326
1326
|
});
|
|
1327
1327
|
watch(
|
|
1328
1328
|
[C, l],
|
|
1329
|
-
([j,
|
|
1330
|
-
!j && !
|
|
1329
|
+
([j, F]) => {
|
|
1330
|
+
!j && !F && _();
|
|
1331
1331
|
},
|
|
1332
1332
|
{
|
|
1333
1333
|
immediate: !0
|
|
1334
1334
|
}
|
|
1335
1335
|
);
|
|
1336
1336
|
const x = ref(null);
|
|
1337
|
-
return r({ getElCascaderRef: () => x.value }), (j,
|
|
1337
|
+
return r({ getElCascaderRef: () => x.value }), (j, F) => (openBlock(), createBlock(unref(ElCascader), mergeProps({
|
|
1338
1338
|
ref_key: "ElCascaderRef",
|
|
1339
1339
|
ref: x,
|
|
1340
|
-
options:
|
|
1341
|
-
props:
|
|
1340
|
+
options: y.value,
|
|
1341
|
+
props: g.value,
|
|
1342
1342
|
onChange: b
|
|
1343
1343
|
}, j.$attrs, { "popper-options": { modifiers: [{ name: "computeStyles", options: { adaptive: !1 } }] } }), createSlots({ _: 2 }, [
|
|
1344
|
-
renderList(j.$slots, (
|
|
1345
|
-
name:
|
|
1346
|
-
fn: withCtx((
|
|
1347
|
-
renderSlot(j.$slots,
|
|
1344
|
+
renderList(j.$slots, (B, I, G) => ({
|
|
1345
|
+
name: I,
|
|
1346
|
+
fn: withCtx((D) => [
|
|
1347
|
+
renderSlot(j.$slots, I, mergeProps({ key: G }, D))
|
|
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: v, emptyText: w } = toRefs(d), b = toRaw(store.state.dictConfig), m = computed(() => a.value ? a.value(t.value) : u.value ? u.value : l.value && l.value[b.format.type] ? l.value[b.format.type] : "primary"), _ = computed(() => o.value ? o.value(t.value) : i.value ? i.value : l.value && l.value[b.format.color] ? l.value[b.format.color] : ""), C = computed(() => s.value ? s.value(t.value) : l.value && l.value[b.format.disabled] ? l.value[b.format.disabled] : !!c.value);
|
|
1405
|
+
let l = ref(null), g = ref(null);
|
|
1406
1406
|
watchEffect(() => {
|
|
1407
1407
|
if (!n.value) {
|
|
1408
|
-
|
|
1408
|
+
g.value = t.value;
|
|
1409
1409
|
return;
|
|
1410
1410
|
}
|
|
1411
|
-
GetItemByCode(t.value, n.value).then((
|
|
1412
|
-
|
|
1411
|
+
GetItemByCode(t.value, n.value).then((y) => {
|
|
1412
|
+
y ? (l.value = y, g.value = y[b.format.label]) : (l.value = null, g.value = String(v.value ?? (t.value === 0 ? 0 : t.value || w.value)));
|
|
1413
1413
|
});
|
|
1414
1414
|
});
|
|
1415
|
-
const
|
|
1416
|
-
return r({ getElCheckTagRef: () =>
|
|
1415
|
+
const T = ref(null);
|
|
1416
|
+
return r({ getElCheckTagRef: () => T.value }), (y, x) => (openBlock(), createBlock(unref(ElCheckTag), mergeProps({
|
|
1417
1417
|
class: "el-check-tag-dict",
|
|
1418
1418
|
ref_key: "ElCheckTagRef",
|
|
1419
|
-
ref:
|
|
1419
|
+
ref: T,
|
|
1420
1420
|
type: m.value,
|
|
1421
|
-
color:
|
|
1421
|
+
color: _.value,
|
|
1422
1422
|
disabled: C.value
|
|
1423
|
-
},
|
|
1423
|
+
}, y.$attrs), createSlots({
|
|
1424
1424
|
default: withCtx(() => [
|
|
1425
|
-
createTextVNode(toDisplayString(unref(
|
|
1425
|
+
createTextVNode(toDisplayString(unref(g)), 1)
|
|
1426
1426
|
]),
|
|
1427
1427
|
_: 2
|
|
1428
1428
|
}, [
|
|
1429
|
-
renderList(
|
|
1429
|
+
renderList(y.$slots, (N, j, F) => ({
|
|
1430
1430
|
name: j,
|
|
1431
|
-
fn: withCtx((
|
|
1432
|
-
renderSlot(
|
|
1431
|
+
fn: withCtx((B) => [
|
|
1432
|
+
renderSlot(y.$slots, j, mergeProps({ key: F }, B))
|
|
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
|
-
|
|
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: v } = toRefs(t), w = ref([]), b = ref(""), m = toRaw(store.state.dictConfig), _ = d, C = (F, B) => {
|
|
1490
|
+
_("change", F);
|
|
1491
|
+
const I = [];
|
|
1492
|
+
for (let G = 0; G < g.value.length; G++) {
|
|
1493
|
+
const D = g.value[G];
|
|
1494
|
+
if (n.value.includes(D[m.format.value]) && I.push(D), G === B)
|
|
1495
|
+
if (F && !n.value.includes(D[m.format.value]))
|
|
1496
|
+
I.push(D);
|
|
1497
1497
|
else {
|
|
1498
|
-
const A =
|
|
1499
|
-
|
|
1498
|
+
const A = I.indexOf(D);
|
|
1499
|
+
I.splice(A, 1);
|
|
1500
1500
|
}
|
|
1501
1501
|
}
|
|
1502
|
-
if (
|
|
1502
|
+
if (_(
|
|
1503
1503
|
"update:modelValue",
|
|
1504
|
-
|
|
1504
|
+
I.map((G) => G[m.format.value])
|
|
1505
1505
|
), s.value) {
|
|
1506
|
-
|
|
1506
|
+
_("dictChange", I);
|
|
1507
1507
|
return;
|
|
1508
1508
|
}
|
|
1509
|
-
|
|
1509
|
+
_(
|
|
1510
1510
|
"dictChange",
|
|
1511
|
-
|
|
1511
|
+
I.map((G) => G[m.format.value])
|
|
1512
1512
|
);
|
|
1513
1513
|
}, l = reactive({
|
|
1514
1514
|
list: []
|
|
1515
|
-
}),
|
|
1516
|
-
label:
|
|
1517
|
-
value:
|
|
1518
|
-
disabled: !!
|
|
1519
|
-
...
|
|
1515
|
+
}), g = computed(() => l.list.map((F) => ({
|
|
1516
|
+
label: F[m.format.label],
|
|
1517
|
+
value: F[m.format.value],
|
|
1518
|
+
disabled: !!F[m.format.disabled],
|
|
1519
|
+
...F
|
|
1520
1520
|
})));
|
|
1521
1521
|
watch(
|
|
1522
|
-
[() =>
|
|
1523
|
-
([
|
|
1524
|
-
const
|
|
1525
|
-
for (let
|
|
1526
|
-
const
|
|
1527
|
-
|
|
1522
|
+
[() => g.value, () => t.modelValue],
|
|
1523
|
+
([F, B]) => {
|
|
1524
|
+
const I = [];
|
|
1525
|
+
for (let G = 0; G < F.length; G++) {
|
|
1526
|
+
const D = F[G];
|
|
1527
|
+
B.includes(D[m.format.value]) ? I.push(!0) : I.push(!1);
|
|
1528
1528
|
}
|
|
1529
|
-
w.value =
|
|
1529
|
+
w.value = I;
|
|
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 T = async () => {
|
|
1538
1538
|
if (!o.value || a.value && a.value.length > 0)
|
|
1539
1539
|
return;
|
|
1540
|
-
let
|
|
1540
|
+
let F = [];
|
|
1541
1541
|
if (typeof o.value == "object") {
|
|
1542
1542
|
b.value = o.value.type;
|
|
1543
|
-
const
|
|
1544
|
-
|
|
1545
|
-
const { filters:
|
|
1546
|
-
|
|
1543
|
+
const B = await store.actions.getDictDataObj(b.value);
|
|
1544
|
+
F = [].concat(B[b.value]);
|
|
1545
|
+
const { filters: I, filterType: G = m.format.value, reverse: D = !1 } = o.value, A = typeof I == "string" ? I.split(",") : I;
|
|
1546
|
+
D ? F = F.filter((f) => !A.includes(f[G])) : F = F.filter((f) => A.includes(f[G]));
|
|
1547
1547
|
} else {
|
|
1548
1548
|
b.value = o.value;
|
|
1549
|
-
const
|
|
1550
|
-
|
|
1549
|
+
const B = await store.actions.getDictDataObj(b.value);
|
|
1550
|
+
F = [].concat(B[b.value]);
|
|
1551
1551
|
}
|
|
1552
|
-
if (c.value && (
|
|
1553
|
-
|
|
1554
|
-
...
|
|
1555
|
-
[m.format.disabled]:
|
|
1552
|
+
if (c.value && (F = c.value(F)), v.value)
|
|
1553
|
+
F = F.map((B) => ({
|
|
1554
|
+
...B,
|
|
1555
|
+
[m.format.disabled]: v.value(B)
|
|
1556
1556
|
}));
|
|
1557
1557
|
else if (i.value) {
|
|
1558
|
-
const { disabledValues:
|
|
1559
|
-
|
|
1558
|
+
const { disabledValues: B, disabledType: I = m.format.value, reverse: G = !1 } = i.value, D = typeof B == "string" ? B.split(",") : B;
|
|
1559
|
+
G ? F = F.map((A) => {
|
|
1560
1560
|
const f = JSON.parse(JSON.stringify(A));
|
|
1561
|
-
return f[m.format.disabled] = !
|
|
1562
|
-
}) :
|
|
1561
|
+
return f[m.format.disabled] = !D.includes(f[I]) || f[m.format.disabled], f;
|
|
1562
|
+
}) : F = F.map((A) => {
|
|
1563
1563
|
const f = JSON.parse(JSON.stringify(A));
|
|
1564
|
-
return f[m.format.disabled] =
|
|
1564
|
+
return f[m.format.disabled] = D.includes(f[I]) || f[m.format.disabled], f;
|
|
1565
1565
|
});
|
|
1566
1566
|
}
|
|
1567
|
-
l.list =
|
|
1568
|
-
}, E = computed(() => store.state.isGettingDictTypes.includes(b.value)),
|
|
1567
|
+
l.list = F;
|
|
1568
|
+
}, E = computed(() => store.state.isGettingDictTypes.includes(b.value)), y = computed(() => store.state.isGettingAllDictTypes), x = computed(() => a.value);
|
|
1569
1569
|
watch(
|
|
1570
|
-
[E,
|
|
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, y, x],
|
|
1571
|
+
([F, B, I]) => {
|
|
1572
|
+
!F && !B && I && I.length === 0 && T(), I.length > 0 && (l.list = JSON.parse(JSON.stringify(I)), l.list.length > 0 && (Object.prototype.toString.call(l.list[0]) === "[object Object]" ? l.list = l.list.map((D) => ({
|
|
1573
|
+
[m.format.value]: D[u.value.value],
|
|
1574
|
+
[m.format.label]: D[u.value.label],
|
|
1575
|
+
[m.format.disabled]: !!D[u.value.disabled],
|
|
1576
|
+
...D
|
|
1577
|
+
})) : l.list = l.list.map((D) => ({
|
|
1578
|
+
[m.format.value]: D,
|
|
1579
|
+
[m.format.label]: D
|
|
1580
1580
|
}))));
|
|
1581
1581
|
},
|
|
1582
1582
|
{
|
|
1583
1583
|
immediate: !0
|
|
1584
1584
|
}
|
|
1585
1585
|
);
|
|
1586
|
-
const
|
|
1587
|
-
return r({ getElCheckAbleTagRefs: () =>
|
|
1586
|
+
const N = ref([]);
|
|
1587
|
+
return r({ getElCheckAbleTagRefs: () => N.value }), (F, B) => (openBlock(!0), createElementBlock(Fragment, null, renderList(g.value, (I, G) => (openBlock(), createBlock(unref(ElCheckTag), mergeProps({
|
|
1588
1588
|
ref_for: !0,
|
|
1589
|
-
ref: (
|
|
1590
|
-
|
|
1589
|
+
ref: (D) => {
|
|
1590
|
+
D && (N.value[G] = D);
|
|
1591
1591
|
},
|
|
1592
|
-
checked: w.value[
|
|
1593
|
-
},
|
|
1594
|
-
onChange: (
|
|
1595
|
-
key:
|
|
1596
|
-
type:
|
|
1592
|
+
checked: w.value[G]
|
|
1593
|
+
}, F.$attrs, {
|
|
1594
|
+
onChange: (D) => C(D, G),
|
|
1595
|
+
key: G,
|
|
1596
|
+
type: I[unref(m).format.type]
|
|
1597
1597
|
}), createSlots({
|
|
1598
1598
|
default: withCtx(() => [
|
|
1599
|
-
createTextVNode(" " + toDisplayString(
|
|
1599
|
+
createTextVNode(" " + toDisplayString(I[unref(m).format.label]), 1)
|
|
1600
1600
|
]),
|
|
1601
1601
|
_: 2
|
|
1602
1602
|
}, [
|
|
1603
|
-
renderList(
|
|
1603
|
+
renderList(F.$slots, (D, A, f) => ({
|
|
1604
1604
|
name: A,
|
|
1605
1605
|
fn: withCtx((p) => [
|
|
1606
|
-
renderSlot(
|
|
1606
|
+
renderSlot(F.$slots, A, normalizeProps(guardReactiveProps(p)), void 0, !0)
|
|
1607
1607
|
])
|
|
1608
1608
|
}))
|
|
1609
1609
|
]), 1040, ["checked", "onChange", "type"]))), 128));
|
|
@@ -1660,96 +1660,96 @@ 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:
|
|
1663
|
+
const t = e, { disabled: n, data: a, format: u, dictType: o, disabledObj: i, keyValue: s, filterDataFun: c, disabledDataFun: v } = toRefs(t), w = useAttrs(), b = computed(() => {
|
|
1664
1664
|
const f = {};
|
|
1665
1665
|
return Object.entries(w).forEach(([p, k]) => {
|
|
1666
|
-
const
|
|
1667
|
-
if (!
|
|
1668
|
-
const
|
|
1669
|
-
f[
|
|
1666
|
+
const S = ToKebabCase(p);
|
|
1667
|
+
if (!S.startsWith("checkbox-button-") && !S.startsWith("on-checkbox-button-")) {
|
|
1668
|
+
const O = ToCamelCase(S);
|
|
1669
|
+
f[O] = k;
|
|
1670
1670
|
}
|
|
1671
1671
|
}), f;
|
|
1672
1672
|
}), m = computed(() => {
|
|
1673
1673
|
const f = {};
|
|
1674
1674
|
return Object.entries(w).forEach(([p, k]) => {
|
|
1675
|
-
const
|
|
1676
|
-
if (
|
|
1677
|
-
const
|
|
1678
|
-
f[
|
|
1675
|
+
const S = ToKebabCase(p);
|
|
1676
|
+
if (S.startsWith("checkbox-button-") || S.startsWith("on-checkbox-button-")) {
|
|
1677
|
+
const O = ToCamelCase(S.replace("checkbox-button-", ""));
|
|
1678
|
+
f[O] = k;
|
|
1679
1679
|
}
|
|
1680
1680
|
}), f;
|
|
1681
|
-
}),
|
|
1681
|
+
}), _ = ref(""), C = toRaw(store.state.dictConfig), l = d, g = (f) => {
|
|
1682
1682
|
if (!s.value) {
|
|
1683
1683
|
l("dictChange", f);
|
|
1684
1684
|
return;
|
|
1685
1685
|
}
|
|
1686
|
-
const p =
|
|
1686
|
+
const p = T.list.filter((k) => f.includes(k[C.format.value]));
|
|
1687
1687
|
l("dictChange", p);
|
|
1688
|
-
},
|
|
1688
|
+
}, T = reactive({
|
|
1689
1689
|
list: []
|
|
1690
1690
|
}), E = async () => {
|
|
1691
1691
|
if (!o.value || a.value && a.value.length > 0)
|
|
1692
1692
|
return;
|
|
1693
1693
|
let f = [];
|
|
1694
1694
|
if (typeof o.value == "object") {
|
|
1695
|
-
|
|
1696
|
-
const p = await store.actions.getDictDataObj(
|
|
1697
|
-
f = [].concat(p[
|
|
1698
|
-
const { filters: k, filterType:
|
|
1699
|
-
|
|
1695
|
+
_.value = o.value.type;
|
|
1696
|
+
const p = await store.actions.getDictDataObj(_.value);
|
|
1697
|
+
f = [].concat(p[_.value]);
|
|
1698
|
+
const { filters: k, filterType: S = C.format.value, reverse: O = !1 } = o.value, V = typeof k == "string" ? k.split(",") : k;
|
|
1699
|
+
O ? f = f.filter((R) => !V.includes(R[S])) : f = f.filter((R) => V.includes(R[S]));
|
|
1700
1700
|
} else {
|
|
1701
|
-
|
|
1702
|
-
const p = await store.actions.getDictDataObj(
|
|
1703
|
-
f = [].concat(p[
|
|
1701
|
+
_.value = o.value;
|
|
1702
|
+
const p = await store.actions.getDictDataObj(_.value);
|
|
1703
|
+
f = [].concat(p[_.value]);
|
|
1704
1704
|
}
|
|
1705
|
-
if (c.value && (f = c.value(f)),
|
|
1705
|
+
if (c.value && (f = c.value(f)), v.value)
|
|
1706
1706
|
f = f.map((p) => ({
|
|
1707
1707
|
...p,
|
|
1708
|
-
[C.format.disabled]:
|
|
1708
|
+
[C.format.disabled]: v.value(p)
|
|
1709
1709
|
}));
|
|
1710
1710
|
else if (i.value) {
|
|
1711
|
-
const { disabledValues: p, disabledType: k = C.format.value, reverse:
|
|
1712
|
-
|
|
1711
|
+
const { disabledValues: p, disabledType: k = C.format.value, reverse: S = !1 } = i.value, O = typeof p == "string" ? p.split(",") : p;
|
|
1712
|
+
S ? f = f.map((V) => {
|
|
1713
1713
|
const R = JSON.parse(JSON.stringify(V));
|
|
1714
|
-
return R[C.format.disabled] = !
|
|
1714
|
+
return R[C.format.disabled] = !O.includes(R[k]) || R[C.format.disabled], R;
|
|
1715
1715
|
}) : f = f.map((V) => {
|
|
1716
1716
|
const R = JSON.parse(JSON.stringify(V));
|
|
1717
|
-
return R[C.format.disabled] =
|
|
1717
|
+
return R[C.format.disabled] = O.includes(R[k]) || R[C.format.disabled], R;
|
|
1718
1718
|
});
|
|
1719
1719
|
}
|
|
1720
|
-
|
|
1721
|
-
},
|
|
1720
|
+
T.list = f;
|
|
1721
|
+
}, y = computed(() => store.state.isGettingDictTypes.includes(_.value)), x = computed(() => store.state.isGettingAllDictTypes), N = computed(() => a.value), j = inject(formItemContextKey), F = inject(formContextKey), B = computed(() => n.value || w["checkbox-button-disabled"] === "" || w["checkbox-button-disabled"] || w.checkboxButtonDisabled === "" || w.checkboxButtonDisabled || w.CheckboxButtonDisabled === "" || w.CheckboxButtonDisabled || (j == null ? void 0 : j.disabled) || (F == null ? void 0 : F.disabled) || !1);
|
|
1722
1722
|
watch(
|
|
1723
|
-
[
|
|
1723
|
+
[y, x, N],
|
|
1724
1724
|
([f, p, k]) => {
|
|
1725
|
-
!f && !p && k && k.length === 0 && E(), k.length > 0 && (
|
|
1726
|
-
[C.format.value]:
|
|
1727
|
-
[C.format.label]:
|
|
1728
|
-
[C.format.disabled]: !!
|
|
1729
|
-
...
|
|
1730
|
-
})) :
|
|
1731
|
-
[C.format.value]:
|
|
1732
|
-
[C.format.label]:
|
|
1725
|
+
!f && !p && k && k.length === 0 && E(), k.length > 0 && (T.list = JSON.parse(JSON.stringify(k)), T.list.length > 0 && (Object.prototype.toString.call(T.list[0]) === "[object Object]" ? T.list = T.list.map((O) => ({
|
|
1726
|
+
[C.format.value]: O[u.value.value],
|
|
1727
|
+
[C.format.label]: O[u.value.label],
|
|
1728
|
+
[C.format.disabled]: !!O[u.value.disabled],
|
|
1729
|
+
...O
|
|
1730
|
+
})) : T.list = T.list.map((O) => ({
|
|
1731
|
+
[C.format.value]: O,
|
|
1732
|
+
[C.format.label]: O
|
|
1733
1733
|
}))));
|
|
1734
1734
|
},
|
|
1735
1735
|
{
|
|
1736
1736
|
immediate: !0
|
|
1737
1737
|
}
|
|
1738
1738
|
);
|
|
1739
|
-
const
|
|
1740
|
-
return r({ getElCheckboxGroupRef:
|
|
1739
|
+
const I = ref(null), G = () => I.value, D = ref([]);
|
|
1740
|
+
return r({ getElCheckboxGroupRef: G, getElCheckboxButtonRefs: () => D.value }), (f, p) => (openBlock(), createBlock(unref(ElCheckboxGroup), mergeProps({
|
|
1741
1741
|
ref_key: "ElCheckboxGroupRef",
|
|
1742
|
-
ref:
|
|
1743
|
-
disabled:
|
|
1744
|
-
}, b.value, { onChange:
|
|
1742
|
+
ref: I,
|
|
1743
|
+
disabled: B.value
|
|
1744
|
+
}, b.value, { onChange: g }), createSlots({
|
|
1745
1745
|
default: withCtx(() => [
|
|
1746
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
1746
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(T.list, (k, S) => (openBlock(), createBlock(unref(ElCheckboxButton), mergeProps({
|
|
1747
1747
|
ref_for: !0,
|
|
1748
|
-
ref: (
|
|
1749
|
-
|
|
1748
|
+
ref: (O) => {
|
|
1749
|
+
O && (D.value[S] = O);
|
|
1750
1750
|
},
|
|
1751
1751
|
key: k[unref(C).format.value],
|
|
1752
|
-
disabled:
|
|
1752
|
+
disabled: B.value || k[unref(C).format.disabled],
|
|
1753
1753
|
label: k[unref(C).format.value]
|
|
1754
1754
|
}, m.value), {
|
|
1755
1755
|
default: withCtx(() => [
|
|
@@ -1760,10 +1760,10 @@ const __vite_glob_0_4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1760
1760
|
]),
|
|
1761
1761
|
_: 2
|
|
1762
1762
|
}, [
|
|
1763
|
-
renderList(f.$slots, (k,
|
|
1764
|
-
name:
|
|
1763
|
+
renderList(f.$slots, (k, S, O) => ({
|
|
1764
|
+
name: S,
|
|
1765
1765
|
fn: withCtx((V) => [
|
|
1766
|
-
renderSlot(f.$slots,
|
|
1766
|
+
renderSlot(f.$slots, S, mergeProps({ key: O }, V))
|
|
1767
1767
|
])
|
|
1768
1768
|
}))
|
|
1769
1769
|
]), 1040, ["disabled"]));
|
|
@@ -1826,44 +1826,44 @@ 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:
|
|
1829
|
+
const t = e, { disabled: n, modelValue: a, addAllText: u, data: o, format: i, dictType: s, disabledObj: c, keyValue: v, filterDataFun: w, disabledDataFun: b } = toRefs(t), m = useAttrs(), _ = ref(!1), C = ref(!1), l = ref([]), g = computed(() => {
|
|
1830
1830
|
const P = {};
|
|
1831
|
-
return Object.entries(m).forEach(([K,
|
|
1831
|
+
return Object.entries(m).forEach(([K, L]) => {
|
|
1832
1832
|
const M = ToKebabCase(K);
|
|
1833
1833
|
if (!M.startsWith("checkbox-") && !M.startsWith("on-checkbox-")) {
|
|
1834
1834
|
const W = ToCamelCase(M);
|
|
1835
|
-
P[W] =
|
|
1835
|
+
P[W] = L;
|
|
1836
1836
|
}
|
|
1837
1837
|
}), P;
|
|
1838
|
-
}),
|
|
1838
|
+
}), T = computed(() => {
|
|
1839
1839
|
const P = {};
|
|
1840
|
-
return Object.entries(m).forEach(([K,
|
|
1840
|
+
return Object.entries(m).forEach(([K, L]) => {
|
|
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
|
-
P[W] =
|
|
1844
|
+
P[W] = L;
|
|
1845
1845
|
}
|
|
1846
1846
|
}), P;
|
|
1847
|
-
}), E = ref(""),
|
|
1848
|
-
const K = P.length,
|
|
1849
|
-
C.value = K ===
|
|
1850
|
-
},
|
|
1851
|
-
if (j(P), !
|
|
1847
|
+
}), E = ref(""), y = toRaw(store.state.dictConfig), x = d, N = computed(() => B.list.filter((P) => !P[y.format.disabled])), j = (P) => {
|
|
1848
|
+
const K = P.length, L = N.value.length;
|
|
1849
|
+
C.value = K === L, _.value = K > 0 && K < L;
|
|
1850
|
+
}, F = (P) => {
|
|
1851
|
+
if (j(P), !v.value) {
|
|
1852
1852
|
x("dictChange", P);
|
|
1853
1853
|
return;
|
|
1854
1854
|
}
|
|
1855
|
-
const K =
|
|
1855
|
+
const K = B.list.filter((L) => P.includes(L[y.format.value]));
|
|
1856
1856
|
x("dictChange", K);
|
|
1857
|
-
},
|
|
1857
|
+
}, B = reactive({
|
|
1858
1858
|
list: []
|
|
1859
1859
|
});
|
|
1860
1860
|
watch(
|
|
1861
|
-
() =>
|
|
1861
|
+
() => N.value,
|
|
1862
1862
|
() => {
|
|
1863
1863
|
j(a.value);
|
|
1864
1864
|
}
|
|
1865
1865
|
);
|
|
1866
|
-
const
|
|
1866
|
+
const I = async () => {
|
|
1867
1867
|
if (!s.value || o.value && o.value.length > 0)
|
|
1868
1868
|
return;
|
|
1869
1869
|
let P = [];
|
|
@@ -1871,7 +1871,7 @@ const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1871
1871
|
E.value = s.value.type;
|
|
1872
1872
|
const K = await store.actions.getDictDataObj(E.value);
|
|
1873
1873
|
P = [].concat(K[E.value]);
|
|
1874
|
-
const { filters:
|
|
1874
|
+
const { filters: L, filterType: M = y.format.value, reverse: W = !1 } = s.value, z = typeof L == "string" ? L.split(",") : L;
|
|
1875
1875
|
W ? P = P.filter(($) => !z.includes($[M])) : P = P.filter(($) => z.includes($[M]));
|
|
1876
1876
|
} else {
|
|
1877
1877
|
E.value = s.value;
|
|
@@ -1881,20 +1881,20 @@ const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1881
1881
|
if (w.value && (P = w.value(P)), b.value)
|
|
1882
1882
|
P = P.map((K) => ({
|
|
1883
1883
|
...K,
|
|
1884
|
-
[
|
|
1884
|
+
[y.format.disabled]: b.value(K)
|
|
1885
1885
|
}));
|
|
1886
1886
|
else if (c.value) {
|
|
1887
|
-
const { disabledValues: K, disabledType:
|
|
1887
|
+
const { disabledValues: K, disabledType: L = y.format.value, reverse: M = !1 } = c.value, W = typeof K == "string" ? K.split(",") : K;
|
|
1888
1888
|
M ? P = P.map((z) => {
|
|
1889
1889
|
const $ = JSON.parse(JSON.stringify(z));
|
|
1890
|
-
return $[
|
|
1890
|
+
return $[y.format.disabled] = !W.includes($[L]) || $[y.format.disabled], $;
|
|
1891
1891
|
}) : P = P.map((z) => {
|
|
1892
1892
|
const $ = JSON.parse(JSON.stringify(z));
|
|
1893
|
-
return $[
|
|
1893
|
+
return $[y.format.disabled] = W.includes($[L]) || $[y.format.disabled], $;
|
|
1894
1894
|
});
|
|
1895
1895
|
}
|
|
1896
|
-
|
|
1897
|
-
},
|
|
1896
|
+
B.list = P;
|
|
1897
|
+
}, G = computed(() => store.state.isGettingDictTypes.includes(E.value)), D = computed(() => store.state.isGettingAllDictTypes), A = computed(() => o.value), f = inject(formItemContextKey), p = inject(formContextKey), k = computed(() => n.value || m["checkbox-disabled"] === "" || m["checkbox-disabled"] || m.checkboxDisabled === "" || m.checkboxDisabled || m.CheckboxDisabled === "" || m.CheckboxDisabled || (f == null ? void 0 : f.disabled) || (p == null ? void 0 : p.disabled) || !1);
|
|
1898
1898
|
watch(
|
|
1899
1899
|
() => t.modelValue,
|
|
1900
1900
|
// 正确监听方式
|
|
@@ -1912,38 +1912,38 @@ const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1912
1912
|
x("update:modelValue", P), x("change", P);
|
|
1913
1913
|
}
|
|
1914
1914
|
), watch(
|
|
1915
|
-
[
|
|
1916
|
-
([P, K,
|
|
1917
|
-
!P && !K &&
|
|
1918
|
-
[
|
|
1919
|
-
[
|
|
1920
|
-
[
|
|
1915
|
+
[G, D, A],
|
|
1916
|
+
([P, K, L]) => {
|
|
1917
|
+
!P && !K && L && L.length === 0 && I(), L.length > 0 && (B.list = JSON.parse(JSON.stringify(L)), B.list.length > 0 && (Object.prototype.toString.call(B.list[0]) === "[object Object]" ? B.list = B.list.map((W) => ({
|
|
1918
|
+
[y.format.value]: W[i.value.value],
|
|
1919
|
+
[y.format.label]: W[i.value.label],
|
|
1920
|
+
[y.format.disabled]: !!W[i.value.disabled],
|
|
1921
1921
|
...W
|
|
1922
|
-
})) :
|
|
1923
|
-
[
|
|
1924
|
-
[
|
|
1922
|
+
})) : B.list = B.list.map((W) => ({
|
|
1923
|
+
[y.format.value]: W,
|
|
1924
|
+
[y.format.label]: W
|
|
1925
1925
|
}))));
|
|
1926
1926
|
},
|
|
1927
1927
|
{
|
|
1928
1928
|
immediate: !0
|
|
1929
1929
|
}
|
|
1930
1930
|
);
|
|
1931
|
-
const
|
|
1932
|
-
if (
|
|
1933
|
-
const K =
|
|
1934
|
-
|
|
1931
|
+
const S = (P) => {
|
|
1932
|
+
if (_.value = !1, P) {
|
|
1933
|
+
const K = N.value.map((L) => L[y.format.value]);
|
|
1934
|
+
F(K);
|
|
1935
1935
|
} else
|
|
1936
|
-
|
|
1937
|
-
},
|
|
1936
|
+
F([]);
|
|
1937
|
+
}, O = ref(null), V = () => O.value, R = ref([]);
|
|
1938
1938
|
return r({ getElCheckboxGroupRef: V, getElCheckboxRefs: () => R.value }), (P, K) => (openBlock(), createElementBlock(Fragment, null, [
|
|
1939
1939
|
unref(u) && !k.value ? (openBlock(), createBlock(unref(ElCheckbox), {
|
|
1940
1940
|
key: 0,
|
|
1941
1941
|
class: "check-all",
|
|
1942
1942
|
disabled: k.value,
|
|
1943
|
-
indeterminate:
|
|
1943
|
+
indeterminate: _.value,
|
|
1944
1944
|
modelValue: C.value,
|
|
1945
|
-
"onUpdate:modelValue": K[0] || (K[0] = (
|
|
1946
|
-
onChange:
|
|
1945
|
+
"onUpdate:modelValue": K[0] || (K[0] = (L) => C.value = L),
|
|
1946
|
+
onChange: S
|
|
1947
1947
|
}, {
|
|
1948
1948
|
default: withCtx(() => [
|
|
1949
1949
|
createTextVNode(toDisplayString(unref(u)), 1)
|
|
@@ -1952,30 +1952,30 @@ 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:
|
|
1955
|
+
ref: O,
|
|
1956
1956
|
disabled: k.value,
|
|
1957
1957
|
modelValue: l.value,
|
|
1958
|
-
"onUpdate:modelValue": K[1] || (K[1] = (
|
|
1959
|
-
},
|
|
1958
|
+
"onUpdate:modelValue": K[1] || (K[1] = (L) => l.value = L)
|
|
1959
|
+
}, g.value, { onChange: F }), createSlots({
|
|
1960
1960
|
default: withCtx(() => [
|
|
1961
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
1961
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(B.list, (L, M) => (openBlock(), createBlock(unref(ElCheckbox), mergeProps({
|
|
1962
1962
|
ref_for: !0,
|
|
1963
1963
|
ref: (W) => {
|
|
1964
1964
|
W && (R.value[M] = W);
|
|
1965
1965
|
},
|
|
1966
|
-
key:
|
|
1967
|
-
label:
|
|
1968
|
-
disabled: k.value ||
|
|
1969
|
-
},
|
|
1966
|
+
key: L[unref(y).format.value],
|
|
1967
|
+
label: L[unref(y).format.value],
|
|
1968
|
+
disabled: k.value || L[unref(y).format.disabled]
|
|
1969
|
+
}, T.value), {
|
|
1970
1970
|
default: withCtx(() => [
|
|
1971
|
-
createTextVNode(toDisplayString(
|
|
1971
|
+
createTextVNode(toDisplayString(L[unref(y).format.label]), 1)
|
|
1972
1972
|
]),
|
|
1973
1973
|
_: 2
|
|
1974
1974
|
}, 1040, ["label", "disabled"]))), 128))
|
|
1975
1975
|
]),
|
|
1976
1976
|
_: 2
|
|
1977
1977
|
}, [
|
|
1978
|
-
renderList(P.$slots, (
|
|
1978
|
+
renderList(P.$slots, (L, M, W) => ({
|
|
1979
1979
|
name: M,
|
|
1980
1980
|
fn: withCtx((z) => [
|
|
1981
1981
|
renderSlot(P.$slots, M, normalizeProps(guardReactiveProps(z)), void 0, !0)
|
|
@@ -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, v = Date.now(), w = window.setInterval(() => {
|
|
2094
|
+
if (Date.now() - v > c) {
|
|
2095
2095
|
clearInterval(w), a("getTreeLabelByCode获取字典数据超时");
|
|
2096
2096
|
return;
|
|
2097
2097
|
}
|
|
@@ -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 v = s.find((w) => w[o.valueField] === e);
|
|
2114
|
+
n(v ? t.formatFun(GetTreeItemByCode(v[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((v) => v[o.valueField] === e);
|
|
2119
2119
|
n(c ? t.formatFun(GetTreeItemByCode(c[o.idField], s, o), o) : t.defaultVal);
|
|
2120
2120
|
}
|
|
2121
2121
|
});
|
|
@@ -2144,8 +2144,8 @@ 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 >
|
|
2147
|
+
const v = store.state.timeout || 3e4, w = Date.now(), b = window.setInterval(() => {
|
|
2148
|
+
if (Date.now() - w > v) {
|
|
2149
2149
|
clearInterval(b), a("getTreeLabelByCodes获取字典数据超时");
|
|
2150
2150
|
return;
|
|
2151
2151
|
}
|
|
@@ -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((v) => {
|
|
2163
|
+
if (c = v[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 v = GetTreeLabelByCodesDothings(u, c, t.defaultVal, t.formatFunIn, i, t.emptyText);
|
|
2173
|
+
n(v && v.length > 0 ? t.formatFunOut(v) : 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, v = Date.now(), w = window.setInterval(() => {
|
|
2188
|
+
if (Date.now() - v > c) {
|
|
2189
2189
|
clearInterval(w), a("getTreeCodeByLabel获取字典数据超时");
|
|
2190
2190
|
return;
|
|
2191
2191
|
}
|
|
@@ -2204,12 +2204,12 @@ const GetTreeLabelByCodes = (e, r, d) => {
|
|
|
2204
2204
|
a(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2205
2205
|
return;
|
|
2206
2206
|
}
|
|
2207
|
-
const
|
|
2208
|
-
n(
|
|
2207
|
+
const v = s.find((w) => w[o.labelField] === e);
|
|
2208
|
+
n(v ? t.formatFun(GetTreeItemByLabel(v[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((v) => v[o.labelField] === e);
|
|
2213
2213
|
n(c ? t.formatFun(GetTreeItemByLabel(c[o.labelField], s, o), o) : t.defaultVal);
|
|
2214
2214
|
}
|
|
2215
2215
|
});
|
|
@@ -2237,8 +2237,8 @@ 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 >
|
|
2240
|
+
const v = store.state.timeout || 3e4, w = Date.now(), b = window.setInterval(() => {
|
|
2241
|
+
if (Date.now() - w > v) {
|
|
2242
2242
|
clearInterval(b), a("getTreeCodeByLabels获取字典数据超时");
|
|
2243
2243
|
return;
|
|
2244
2244
|
}
|
|
@@ -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((v) => {
|
|
2256
|
+
if (c = v[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 v = GetTreeCodeByLabelsDothings(u, c, t.defaultVal, t.formatFunIn, i);
|
|
2266
|
+
n(v && v.length > 0 ? t.formatFunOut(v) : 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((v) => v[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((v) => v[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: v, emptyText: w } = toRefs(d), b = toRaw(store.state.dictConfig), m = computed(() => a.value ? a.value(t.value) : u.value ? u.value : l.value && l.value[b.format.type] ? l.value[b.format.type] : "primary"), _ = computed(() => o.value ? o.value(t.value) : i.value ? i.value : l.value && l.value[b.format.color] ? l.value[b.format.color] : ""), C = computed(() => s.value ? s.value(t.value) : l.value && l.value[b.format.disabled] ? l.value[b.format.disabled] : !!c.value);
|
|
2710
|
+
let l = ref(null), g = ref(null);
|
|
2711
2711
|
watchEffect(() => {
|
|
2712
2712
|
if (!n.value) {
|
|
2713
|
-
|
|
2713
|
+
g.value = t.value;
|
|
2714
2714
|
return;
|
|
2715
2715
|
}
|
|
2716
|
-
GetItemByCode(t.value, n.value).then((
|
|
2717
|
-
|
|
2716
|
+
GetItemByCode(t.value, n.value).then((y) => {
|
|
2717
|
+
y ? (l.value = y, g.value = y[b.format.label]) : (l.value = null, g.value = String(v.value ?? (t.value === 0 ? 0 : t.value || w.value)));
|
|
2718
2718
|
});
|
|
2719
2719
|
});
|
|
2720
|
-
const
|
|
2721
|
-
return r({ getElTagRef: () =>
|
|
2720
|
+
const T = ref(null);
|
|
2721
|
+
return r({ getElTagRef: () => T.value }), (y, x) => (openBlock(), createBlock(unref(ElTag), mergeProps({
|
|
2722
2722
|
class: "el-tag-dict",
|
|
2723
2723
|
ref_key: "ElTagRef",
|
|
2724
|
-
ref:
|
|
2724
|
+
ref: T,
|
|
2725
2725
|
type: m.value,
|
|
2726
|
-
color:
|
|
2726
|
+
color: _.value,
|
|
2727
2727
|
disabled: C.value
|
|
2728
|
-
},
|
|
2728
|
+
}, y.$attrs), createSlots({
|
|
2729
2729
|
default: withCtx(() => [
|
|
2730
|
-
createTextVNode(toDisplayString(unref(
|
|
2730
|
+
createTextVNode(toDisplayString(unref(g)), 1)
|
|
2731
2731
|
]),
|
|
2732
2732
|
_: 2
|
|
2733
2733
|
}, [
|
|
2734
|
-
renderList(
|
|
2734
|
+
renderList(y.$slots, (N, j, F) => ({
|
|
2735
2735
|
name: j,
|
|
2736
|
-
fn: withCtx((
|
|
2737
|
-
renderSlot(
|
|
2736
|
+
fn: withCtx((B) => [
|
|
2737
|
+
renderSlot(y.$slots, j, mergeProps({ key: F }, B))
|
|
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 E = ref(null),
|
|
2792
|
+
const t = e, { actionType: n, modelValue: a, dictType: u, judgeTypeFun: o, type: i, judgeColorFun: s, color: c, judgeDisabledFun: v, disabled: w, defaultVal: b, emptyText: m } = toRefs(t), _ = d, C = toRaw(store.state.dictConfig), l = computed(() => o.value ? o.value(a.value) : i.value ? i.value : E.value && E.value[C.format.type] ? E.value[C.format.type] : "primary"), g = computed(() => s.value ? s.value(a.value) : c.value ? c.value : E.value && E.value[C.format.color] ? E.value[C.format.color] : ""), T = computed(() => v.value ? v.value(a.value) : E.value && E.value[C.format.disabled] ? E.value[C.format.disabled] : !!w.value);
|
|
2793
|
+
let E = ref(null), y = ref(null);
|
|
2794
2794
|
watchEffect(() => {
|
|
2795
2795
|
if (!u.value) {
|
|
2796
|
-
|
|
2796
|
+
y.value = a.value;
|
|
2797
2797
|
return;
|
|
2798
2798
|
}
|
|
2799
|
-
GetItemByCode(a.value, u.value).then((
|
|
2800
|
-
|
|
2799
|
+
GetItemByCode(a.value, u.value).then((F) => {
|
|
2800
|
+
F ? (E.value = F, y.value = F[C.format.label]) : (E.value = null, y.value = String(b.value ?? (a.value === 0 ? 0 : a.value || m.value)));
|
|
2801
2801
|
});
|
|
2802
2802
|
});
|
|
2803
2803
|
const x = () => {
|
|
2804
|
-
|
|
2805
|
-
},
|
|
2806
|
-
return r({ getElLinkRef: () =>
|
|
2804
|
+
T.value || _(n.value, attrs);
|
|
2805
|
+
}, N = ref(null);
|
|
2806
|
+
return r({ getElLinkRef: () => N.value }), (F, B) => (openBlock(), createBlock(unref(ElLink), mergeProps({
|
|
2807
2807
|
class: "el-link-dict",
|
|
2808
2808
|
ref_key: "ElLinkRef",
|
|
2809
|
-
ref:
|
|
2809
|
+
ref: N,
|
|
2810
2810
|
type: l.value,
|
|
2811
|
-
color:
|
|
2812
|
-
disabled:
|
|
2813
|
-
},
|
|
2811
|
+
color: g.value,
|
|
2812
|
+
disabled: T.value
|
|
2813
|
+
}, F.$attrs, { onClick: x }), createSlots({
|
|
2814
2814
|
default: withCtx(() => [
|
|
2815
|
-
createTextVNode(toDisplayString(unref(
|
|
2815
|
+
createTextVNode(toDisplayString(unref(y)), 1)
|
|
2816
2816
|
]),
|
|
2817
2817
|
_: 2
|
|
2818
2818
|
}, [
|
|
2819
|
-
renderList(
|
|
2820
|
-
name:
|
|
2819
|
+
renderList(F.$slots, (I, G, D) => ({
|
|
2820
|
+
name: G,
|
|
2821
2821
|
fn: withCtx((A) => [
|
|
2822
|
-
renderSlot(
|
|
2822
|
+
renderSlot(F.$slots, G, mergeProps({ key: D }, A))
|
|
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: v, emptyText: w } = toRefs(d), b = toRaw(store.state.dictConfig), m = computed(() => a.value ? a.value(t.value) : u.value ? u.value : l.value && l.value[b.format.type] ? l.value[b.format.type] : "primary"), _ = computed(() => o.value ? o.value(t.value) : i.value ? i.value : l.value && l.value[b.format.color] ? l.value[b.format.color] : ""), C = computed(() => s.value ? s.value(t.value) : l.value && l.value[b.format.disabled] ? l.value[b.format.disabled] : !!c.value);
|
|
2873
|
+
let l = ref(null), g = ref(null);
|
|
2874
2874
|
watchEffect(() => {
|
|
2875
2875
|
if (!n.value) {
|
|
2876
|
-
|
|
2876
|
+
g.value = t.value;
|
|
2877
2877
|
return;
|
|
2878
2878
|
}
|
|
2879
|
-
GetItemByCode(t.value, n.value).then((
|
|
2880
|
-
|
|
2879
|
+
GetItemByCode(t.value, n.value).then((y) => {
|
|
2880
|
+
y ? (l.value = y, g.value = y[b.format.label]) : (l.value = null, g.value = String(v.value ?? (t.value === 0 ? 0 : t.value || w.value)));
|
|
2881
2881
|
});
|
|
2882
2882
|
});
|
|
2883
|
-
const
|
|
2884
|
-
return r({ getElTextRef: () =>
|
|
2883
|
+
const T = ref(null);
|
|
2884
|
+
return r({ getElTextRef: () => T.value }), (y, x) => (openBlock(), createBlock(unref(ElText), mergeProps({
|
|
2885
2885
|
class: "el-text-dict",
|
|
2886
2886
|
ref_key: "ElTextRef",
|
|
2887
|
-
ref:
|
|
2887
|
+
ref: T,
|
|
2888
2888
|
type: m.value,
|
|
2889
|
-
color:
|
|
2889
|
+
color: _.value,
|
|
2890
2890
|
disabled: C.value
|
|
2891
|
-
},
|
|
2891
|
+
}, y.$attrs), createSlots({
|
|
2892
2892
|
default: withCtx(() => [
|
|
2893
|
-
createTextVNode(toDisplayString(unref(
|
|
2893
|
+
createTextVNode(toDisplayString(unref(g)), 1)
|
|
2894
2894
|
]),
|
|
2895
2895
|
_: 2
|
|
2896
2896
|
}, [
|
|
2897
|
-
renderList(
|
|
2897
|
+
renderList(y.$slots, (N, j, F) => ({
|
|
2898
2898
|
name: j,
|
|
2899
|
-
fn: withCtx((
|
|
2900
|
-
renderSlot(
|
|
2899
|
+
fn: withCtx((B) => [
|
|
2900
|
+
renderSlot(y.$slots, j, mergeProps({ key: F }, B))
|
|
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 E = ToKebabCase(
|
|
2922
|
+
return Object.entries(n).forEach(([g, T]) => {
|
|
2923
|
+
const E = ToKebabCase(g);
|
|
2924
2924
|
if (!E.startsWith("descriptions-item-") && !E.startsWith("on-descriptions-item-")) {
|
|
2925
|
-
const
|
|
2926
|
-
l[
|
|
2925
|
+
const y = ToCamelCase(E);
|
|
2926
|
+
l[y] = T;
|
|
2927
2927
|
}
|
|
2928
2928
|
}), l;
|
|
2929
2929
|
}), u = computed(() => {
|
|
2930
2930
|
const l = {};
|
|
2931
|
-
return Object.entries(n).forEach(([
|
|
2932
|
-
const E = ToKebabCase(
|
|
2931
|
+
return Object.entries(n).forEach(([g, T]) => {
|
|
2932
|
+
const E = ToKebabCase(g);
|
|
2933
2933
|
if (E.startsWith("descriptions-item-") || E.startsWith("on-descriptions-item")) {
|
|
2934
|
-
const
|
|
2935
|
-
l[
|
|
2934
|
+
const y = ToCamelCase(E.replace("descriptions-item-", ""));
|
|
2935
|
+
l[y] = T;
|
|
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 g = {};
|
|
2947
|
+
return l.defaultVal !== void 0 && l.defaultVal !== null && (g.defaultVal = l.defaultVal), l.emptyText !== void 0 && l.emptyText !== null && (g.emptyText = l.emptyText), l.formatFun !== void 0 && l.formatFun !== null && (g.formatFun = l.formatFun), l.spacer !== void 0 && l.spacer !== null && (g.spacer = l.spacer), Object.assign(g, 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 g = {};
|
|
2950
|
+
return l.defaultVal !== void 0 && l.defaultVal !== null && (g.defaultVal = l.defaultVal), l.emptyText !== void 0 && l.emptyText !== null && (g.emptyText = l.emptyText), l.formatFunIn !== void 0 && l.formatFunIn !== null && (g.formatFunIn = l.formatFunIn), l.formatFunOut !== void 0 && l.formatFunOut !== null && (g.formatFunOut = l.formatFunOut), l.treeSetting !== void 0 && l.treeSetting !== null && (g.treeSetting = l.treeSetting), l.spacer !== void 0 && l.spacer !== null && (g.spacer = l.spacer), Object.assign(g, l.dictOptions || {});
|
|
2951
|
+
}, c = (l) => !!l.maskType || !!l.maskStart || !!l.maskMiddle || !!l.maskEnd, v = (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 g = {
|
|
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(g, 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: () => b.value, getElDescriptionsItemRefs: () => m.value }), (l,
|
|
2980
|
+
}, w = (l, g = {}) => Array.isArray(l) ? l : typeof l == "string" ? l.split(g.spacer || ",") : typeof l == "number" ? [l] : [], b = ref(null), m = ref([]);
|
|
2981
|
+
return r({ getElDescriptionsRef: () => b.value, getElDescriptionsItemRefs: () => m.value }), (l, g) => (openBlock(), createBlock(unref(ElDescriptions), mergeProps({
|
|
2982
2982
|
ref_key: "ElDescriptionsRef",
|
|
2983
2983
|
ref: b
|
|
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), (T, E) => (openBlock(), createBlock(unref(ElDescriptionsItem), mergeProps({
|
|
2987
2987
|
ref_for: !0,
|
|
2988
|
-
ref: (
|
|
2989
|
-
|
|
2988
|
+
ref: (y) => {
|
|
2989
|
+
y && (m.value[E] = y);
|
|
2990
2990
|
},
|
|
2991
2991
|
key: E
|
|
2992
|
-
}, o(
|
|
2992
|
+
}, o(T)), createSlots({
|
|
2993
2993
|
default: withCtx(() => [
|
|
2994
|
-
|
|
2995
|
-
|
|
2994
|
+
T.dictType ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2995
|
+
T.dictTypeNode === "button" ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(w(T.modelValue, i(T)), (y, x) => (openBlock(), createBlock(_sfc_main$n, {
|
|
2996
2996
|
key: x,
|
|
2997
|
-
modelValue:
|
|
2998
|
-
dictType:
|
|
2999
|
-
}, null, 8, ["modelValue", "dictType"]))), 128)) :
|
|
2997
|
+
modelValue: y || "",
|
|
2998
|
+
dictType: T.dictType
|
|
2999
|
+
}, null, 8, ["modelValue", "dictType"]))), 128)) : T.dictTypeNode === "link" ? (openBlock(!0), createElementBlock(Fragment, { key: 1 }, renderList(w(T.modelValue, i(T)), (y, x) => (openBlock(), createBlock(_sfc_main$e, {
|
|
3000
3000
|
key: x,
|
|
3001
|
-
modelValue:
|
|
3002
|
-
dictType:
|
|
3003
|
-
}, null, 8, ["modelValue", "dictType"]))), 128)) :
|
|
3001
|
+
modelValue: y || "",
|
|
3002
|
+
dictType: T.dictType
|
|
3003
|
+
}, null, 8, ["modelValue", "dictType"]))), 128)) : T.dictTypeNode === "tag" ? (openBlock(!0), createElementBlock(Fragment, { key: 2 }, renderList(w(T.modelValue, i(T)), (y, x) => (openBlock(), createBlock(_sfc_main$f, {
|
|
3004
3004
|
key: x,
|
|
3005
|
-
modelValue:
|
|
3006
|
-
dictType:
|
|
3007
|
-
}, null, 8, ["modelValue", "dictType"]))), 128)) :
|
|
3005
|
+
modelValue: y || "",
|
|
3006
|
+
dictType: T.dictType
|
|
3007
|
+
}, null, 8, ["modelValue", "dictType"]))), 128)) : T.dictTypeNode === "text" ? (openBlock(!0), createElementBlock(Fragment, { key: 3 }, renderList(w(T.modelValue, i(T)), (y, x) => (openBlock(), createBlock(_sfc_main$d, {
|
|
3008
3008
|
key: x,
|
|
3009
|
-
modelValue:
|
|
3010
|
-
dictType:
|
|
3009
|
+
modelValue: y || "",
|
|
3010
|
+
dictType: T.dictType
|
|
3011
3011
|
}, null, 8, ["modelValue", "dictType"]))), 128)) : (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
3012
|
-
createTextVNode(toDisplayString(unref(GetLabelByCodesFilter)(
|
|
3012
|
+
createTextVNode(toDisplayString(unref(GetLabelByCodesFilter)(T.modelValue, T.dictType, i(T))), 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)) : T.dictTreeType ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3015
|
+
createTextVNode(toDisplayString(unref(GetTreeLabelByCodesFilter)(T.modelValue, T.dictTreeType, s(T))), 1)
|
|
3016
|
+
], 64)) : T.dateFormat && T.modelValue ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
3017
|
+
createTextVNode(toDisplayString(unref(FormatDate)(T.modelValue, T.dateFormat, T.defaultVal)), 1)
|
|
3018
|
+
], 64)) : c(T) && T.modelValue ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
3019
|
+
createTextVNode(toDisplayString(unref(Desensitization)(T.modelValue, v(T))), 1)
|
|
3020
3020
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
3021
|
-
createTextVNode(toDisplayString(
|
|
3021
|
+
createTextVNode(toDisplayString(T.modelValue !== void 0 && T.modelValue !== null ? T.modelValue : T.defaultVal), 1)
|
|
3022
3022
|
], 64))
|
|
3023
3023
|
]),
|
|
3024
3024
|
_: 2
|
|
3025
3025
|
}, [
|
|
3026
|
-
renderList(
|
|
3027
|
-
name:
|
|
3028
|
-
fn: withCtx((
|
|
3026
|
+
renderList(T.slotList, (y, x) => ({
|
|
3027
|
+
name: y.slotName,
|
|
3028
|
+
fn: withCtx((N) => [
|
|
3029
3029
|
(openBlock(), createBlock(_sfc_main$m, {
|
|
3030
3030
|
key: x,
|
|
3031
|
-
render:
|
|
3032
|
-
scope:
|
|
3031
|
+
render: y.render,
|
|
3032
|
+
scope: N
|
|
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, (
|
|
3040
|
+
renderList(l.$slots, (T, E, y) => ({
|
|
3041
3041
|
name: E,
|
|
3042
3042
|
fn: withCtx((x) => [
|
|
3043
|
-
renderSlot(l.$slots, E, mergeProps({ key:
|
|
3043
|
+
renderSlot(l.$slots, E, mergeProps({ key: y }, x), void 0, !0)
|
|
3044
3044
|
])
|
|
3045
3045
|
}))
|
|
3046
3046
|
]), 1040));
|
|
@@ -3080,7 +3080,7 @@ 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),
|
|
3083
|
+
const t = useAttrs(), n = toRaw(store.state.dictConfig), a = ref(null), u = e, { modelValue: o, rules: i, idField: s, componentList: c } = toRefs(u), v = d, w = computed(() => {
|
|
3084
3084
|
var p;
|
|
3085
3085
|
if (typeof t.colon == "boolean")
|
|
3086
3086
|
return t.colon;
|
|
@@ -3089,16 +3089,16 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3089
3089
|
const f = (p = n == null ? void 0 : n.dynamicComponentsConfig) == null ? void 0 : p.isShowLabelColon;
|
|
3090
3090
|
return typeof f == "boolean" ? f : !1;
|
|
3091
3091
|
}), b = ref([]), m = ref({});
|
|
3092
|
-
let
|
|
3092
|
+
let _ = JSON.parse(JSON.stringify(m));
|
|
3093
3093
|
const C = (f) => {
|
|
3094
|
-
var k,
|
|
3095
|
-
if ((k = n.dynamicComponentsConfig) != null && k.disabledNoPlaceholder && (f != null && f.disabled || (typeof t.disabled == "string" && t.disabled === "" || t.disabled) && (f == null ? void 0 : f.disabled) !== !1) || (
|
|
3094
|
+
var k, S, O, V, R;
|
|
3095
|
+
if ((k = n.dynamicComponentsConfig) != null && k.disabledNoPlaceholder && (f != null && f.disabled || (typeof t.disabled == "string" && t.disabled === "" || t.disabled) && (f == null ? void 0 : f.disabled) !== !1) || (S = n.dynamicComponentsConfig) != null && S.readonlyNoPlaceholder && (f != null && f.readonly || (typeof t.readonly == "string" && t.readonly === "" || t.readonly) && (f == null ? void 0 : f.readonly) !== !1))
|
|
3096
3096
|
return "";
|
|
3097
3097
|
let p = "请选择";
|
|
3098
|
-
return f != null && f.compName && ToKebabCase(f == null ? void 0 : f.compName).includes("input") && (p = "请输入"), (
|
|
3099
|
-
}, l = ref(!1),
|
|
3100
|
-
var k,
|
|
3101
|
-
|
|
3098
|
+
return f != null && f.compName && ToKebabCase(f == null ? void 0 : f.compName).includes("input") && (p = "请输入"), (O = n.dynamicComponentsConfig) != null && O.isShowLabelPlaceholder && (p = p + ((V = f.formItemProps) == null ? void 0 : V.label)), ((R = f.props) == null ? void 0 : R.placeholder) || p || "";
|
|
3099
|
+
}, l = ref(!1), g = ref(""), T = () => {
|
|
3100
|
+
var k, S, O, V, R, J, P, K, L, M, W;
|
|
3101
|
+
g.value = "id" + GenerateUUID();
|
|
3102
3102
|
let f = [];
|
|
3103
3103
|
for (let z = 0; z < c.value.length; z++) {
|
|
3104
3104
|
const $ = c.value[z];
|
|
@@ -3107,13 +3107,13 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3107
3107
|
...$,
|
|
3108
3108
|
id: $ != null && $[s.value] ? $[s.value] : GenerateUUID(),
|
|
3109
3109
|
showRuleType: ($ == null ? void 0 : $.showRuleType) || ((k = n == null ? void 0 : n.dynamicComponentsConfig) == null ? void 0 : k.showRuleType) || "compare",
|
|
3110
|
-
validatorRuleType: ($ == null ? void 0 : $.validatorRuleType) || ((
|
|
3110
|
+
validatorRuleType: ($ == null ? void 0 : $.validatorRuleType) || ((S = n == null ? void 0 : n.dynamicComponentsConfig) == null ? void 0 : S.validatorRuleType) || "compare",
|
|
3111
3111
|
// 解决重置无法正常显示或隐藏的问题 有显示规则的先给他设置为 false
|
|
3112
3112
|
visible: $.showRules && $.showRules.length > 0 || $.hidden ? !1 : ($ == null ? void 0 : $.visible) ?? !0,
|
|
3113
3113
|
//
|
|
3114
3114
|
// 重点:拷贝props为新对象(若存在),断开与原item.props的引用
|
|
3115
3115
|
props: $.props ? {
|
|
3116
|
-
...(
|
|
3116
|
+
...(O = n.dynamicComponentsConfig) == null ? void 0 : O.props,
|
|
3117
3117
|
...$.props,
|
|
3118
3118
|
placeholder: C($)
|
|
3119
3119
|
} : {
|
|
@@ -3140,7 +3140,7 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3140
3140
|
props: $.props ? {
|
|
3141
3141
|
...$.props
|
|
3142
3142
|
} : {}
|
|
3143
|
-
}, (K = $.formItemProps) != null && K.rules || (
|
|
3143
|
+
}, (K = $.formItemProps) != null && K.rules || (L = i.value) != null && L[$.fieldName]) {
|
|
3144
3144
|
const Y = ((M = $.formItemProps) == null ? void 0 : M.rules) || ((W = i.value) == null ? void 0 : W[$.fieldName]) || [];
|
|
3145
3145
|
$.fieldName && (q.formItemProps.prop = q.formItemProps.prop || $.fieldName), q.formItemProps.required = Y.some((ne) => ne.required) || q.formItemProps.required || !1;
|
|
3146
3146
|
const re = [...Y];
|
|
@@ -3183,31 +3183,31 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3183
3183
|
p[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
3185
|
}), m.value = JSON.parse(JSON.stringify(p));
|
|
3186
|
-
}, E = computed(() => typeof t.isScrollToFormError == "boolean" ? t.isScrollToFormError : n.dynamicComponentsConfig.isScrollToFormError),
|
|
3187
|
-
const p = JSON.parse(JSON.stringify(m.value)), k = sortComponentsByIdDependencies(b.value),
|
|
3186
|
+
}, E = computed(() => typeof t.isScrollToFormError == "boolean" ? t.isScrollToFormError : n.dynamicComponentsConfig.isScrollToFormError), y = async (f) => {
|
|
3187
|
+
const p = JSON.parse(JSON.stringify(m.value)), k = sortComponentsByIdDependencies(b.value), S = [], O = (L) => typeof L == "string" ? L.split(",").filter(Boolean) : Array.isArray(L) ? L : [], V = async () => {
|
|
3188
3188
|
if (a.value)
|
|
3189
3189
|
return;
|
|
3190
|
-
const
|
|
3190
|
+
const L = 1e3, M = 50;
|
|
3191
3191
|
let W = 0;
|
|
3192
3192
|
return new Promise((z) => {
|
|
3193
3193
|
const $ = () => {
|
|
3194
|
-
a.value || W >=
|
|
3194
|
+
a.value || W >= L ? z() : (W += M, setTimeout($, M));
|
|
3195
3195
|
};
|
|
3196
3196
|
$();
|
|
3197
3197
|
});
|
|
3198
|
-
}, R = async (
|
|
3198
|
+
}, R = async (L) => {
|
|
3199
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(L));
|
|
3203
3203
|
} catch {
|
|
3204
3204
|
return !1;
|
|
3205
3205
|
}
|
|
3206
|
-
}, J = async (
|
|
3206
|
+
}, J = async (L) => {
|
|
3207
3207
|
var M;
|
|
3208
3208
|
await V();
|
|
3209
|
-
for (let W = 0; W <
|
|
3210
|
-
const z =
|
|
3209
|
+
for (let W = 0; W < L.length; W++) {
|
|
3210
|
+
const z = L[W], $ = b.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
|
});
|
|
@@ -3215,12 +3215,12 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3215
3215
|
}
|
|
3216
3216
|
}, P = {
|
|
3217
3217
|
// 处理"calculate"类型
|
|
3218
|
-
calculate: (
|
|
3218
|
+
calculate: (L) => L.showRules.some((M) => CheckConditionsByOperation(M, p)),
|
|
3219
3219
|
// 处理"compare"类型
|
|
3220
|
-
compare: (
|
|
3220
|
+
compare: (L) => L.showRules.some((M) => CheckConditions(M, p)),
|
|
3221
3221
|
// 处理"validate"类型
|
|
3222
|
-
validate: async (
|
|
3223
|
-
const M =
|
|
3222
|
+
validate: async (L) => {
|
|
3223
|
+
const M = O(L.showRules);
|
|
3224
3224
|
if (await R(M))
|
|
3225
3225
|
return !0;
|
|
3226
3226
|
{
|
|
@@ -3229,9 +3229,9 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3229
3229
|
}
|
|
3230
3230
|
},
|
|
3231
3231
|
// 处理嵌套类型(showRuleType为逻辑运算符,如"&&"、"||")
|
|
3232
|
-
default: async (
|
|
3232
|
+
default: async (L) => {
|
|
3233
3233
|
const M = [];
|
|
3234
|
-
for (const W of
|
|
3234
|
+
for (const W of L.showRules)
|
|
3235
3235
|
switch (W.type) {
|
|
3236
3236
|
case "calculate":
|
|
3237
3237
|
M.push(W.rules.some((z) => CheckConditionsByOperation(z, p)));
|
|
@@ -3240,7 +3240,7 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3240
3240
|
M.push(W.rules.some((z) => CheckConditions(z, p)));
|
|
3241
3241
|
break;
|
|
3242
3242
|
case "validate": {
|
|
3243
|
-
const z =
|
|
3243
|
+
const z = O(W.rules), $ = await R(z);
|
|
3244
3244
|
if (!$) {
|
|
3245
3245
|
const q = z.filter((Y) => Y !== f);
|
|
3246
3246
|
await J(q);
|
|
@@ -3251,28 +3251,28 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3251
3251
|
default:
|
|
3252
3252
|
M.push(!1);
|
|
3253
3253
|
}
|
|
3254
|
-
return CalculateLogicalResult(M,
|
|
3254
|
+
return CalculateLogicalResult(M, L.showRuleType);
|
|
3255
3255
|
}
|
|
3256
3256
|
};
|
|
3257
|
-
for (const
|
|
3258
|
-
if (
|
|
3257
|
+
for (const L of k) {
|
|
3258
|
+
if (L.hidden)
|
|
3259
3259
|
continue;
|
|
3260
|
-
const M =
|
|
3260
|
+
const M = L.visible;
|
|
3261
3261
|
let W = M;
|
|
3262
|
-
|
|
3262
|
+
L.showRules && L.showRules.length > 0 && (W = await (P[L.showRuleType] || P.default)(L)), L.visible = W, L.fieldName && !M && W && S.push(L.fieldName), !W && L.fieldName && (p[L.fieldName] = Array.isArray(p[L.fieldName]) ? [] : "");
|
|
3263
3263
|
}
|
|
3264
|
-
const K =
|
|
3264
|
+
const K = S.filter((L) => {
|
|
3265
3265
|
var q, Y;
|
|
3266
|
-
const M = k.find((re) => re.fieldName ===
|
|
3266
|
+
const M = k.find((re) => re.fieldName === L);
|
|
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[L];
|
|
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
3273
|
await V();
|
|
3274
|
-
const
|
|
3275
|
-
l.value = !0,
|
|
3274
|
+
const L = x();
|
|
3275
|
+
l.value = !0, v("update:modelValue", L), setTimeout(() => {
|
|
3276
3276
|
var M;
|
|
3277
3277
|
(M = a.value) == null || M.validateField(K);
|
|
3278
3278
|
}, 0);
|
|
@@ -3284,29 +3284,29 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3284
3284
|
!k.visible && !k.hidden && delete f[k.fieldName];
|
|
3285
3285
|
}
|
|
3286
3286
|
return f;
|
|
3287
|
-
},
|
|
3288
|
-
const
|
|
3287
|
+
}, N = (f, p, k = "") => {
|
|
3288
|
+
const S = [];
|
|
3289
3289
|
if (typeof f != "object" || f === null || p === null)
|
|
3290
|
-
return f !== p &&
|
|
3290
|
+
return f !== p && S.push({
|
|
3291
3291
|
key: k,
|
|
3292
3292
|
oldVal: p,
|
|
3293
3293
|
newVal: f
|
|
3294
|
-
}),
|
|
3295
|
-
const
|
|
3296
|
-
for (const V of
|
|
3294
|
+
}), S;
|
|
3295
|
+
const O = /* @__PURE__ */ new Set([...Object.keys(f), ...Object.keys(p)]);
|
|
3296
|
+
for (const V of O) {
|
|
3297
3297
|
const R = k ? `${k}.${V}` : V, J = f[V], P = p[V];
|
|
3298
|
-
typeof J == "object" && J !== null && !Array.isArray(J) ?
|
|
3298
|
+
typeof J == "object" && J !== null && !Array.isArray(J) ? S.push(...N(J, P, R)) : J !== P && S.push({
|
|
3299
3299
|
key: R,
|
|
3300
3300
|
oldVal: P,
|
|
3301
3301
|
newVal: J
|
|
3302
3302
|
});
|
|
3303
3303
|
}
|
|
3304
|
-
return
|
|
3304
|
+
return S;
|
|
3305
3305
|
};
|
|
3306
3306
|
watch(
|
|
3307
3307
|
c,
|
|
3308
3308
|
() => {
|
|
3309
|
-
|
|
3309
|
+
T();
|
|
3310
3310
|
},
|
|
3311
3311
|
{
|
|
3312
3312
|
deep: !0,
|
|
@@ -3318,20 +3318,20 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3318
3318
|
watch(
|
|
3319
3319
|
m,
|
|
3320
3320
|
(f) => {
|
|
3321
|
-
var
|
|
3321
|
+
var S;
|
|
3322
3322
|
const p = JSON.parse(JSON.stringify(f));
|
|
3323
3323
|
if (j)
|
|
3324
|
-
|
|
3324
|
+
y();
|
|
3325
3325
|
else {
|
|
3326
|
-
const V = (
|
|
3326
|
+
const V = (S = N(p, _).find((R) => {
|
|
3327
3327
|
if (JSON.stringify(R.newVal) !== JSON.stringify(R.oldVal))
|
|
3328
3328
|
return !0;
|
|
3329
|
-
})) == null ? void 0 :
|
|
3330
|
-
|
|
3329
|
+
})) == null ? void 0 : S.key;
|
|
3330
|
+
y(V);
|
|
3331
3331
|
}
|
|
3332
|
-
|
|
3332
|
+
_ = p;
|
|
3333
3333
|
const k = x();
|
|
3334
|
-
l.value = !0,
|
|
3334
|
+
l.value = !0, v("update:modelValue", k), j = !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
|
+
T();
|
|
3348
3348
|
},
|
|
3349
3349
|
{ deep: !0 }
|
|
3350
3350
|
);
|
|
3351
|
-
const
|
|
3351
|
+
const F = async (f, p) => {
|
|
3352
3352
|
const k = x();
|
|
3353
|
-
f && f.validate((
|
|
3354
|
-
if (
|
|
3355
|
-
|
|
3356
|
-
else if (
|
|
3357
|
-
const V = Object.keys(
|
|
3353
|
+
f && f.validate((S, O) => {
|
|
3354
|
+
if (S)
|
|
3355
|
+
v("pass", k, p);
|
|
3356
|
+
else if (v("fail", O, k, p), E.value) {
|
|
3357
|
+
const V = Object.keys(O)[0];
|
|
3358
3358
|
f.scrollToField(V);
|
|
3359
3359
|
}
|
|
3360
3360
|
});
|
|
3361
|
-
},
|
|
3362
|
-
|
|
3361
|
+
}, B = async () => {
|
|
3362
|
+
T(), await nextTick(), a.value && setTimeout(() => {
|
|
3363
3363
|
a.value.resetFields();
|
|
3364
3364
|
}, 30);
|
|
3365
|
-
},
|
|
3365
|
+
}, I = (f) => {
|
|
3366
3366
|
const p = x();
|
|
3367
|
-
|
|
3368
|
-
},
|
|
3369
|
-
return r({ getFormData: x, resetFormData:
|
|
3370
|
-
const k = resolveComponent("el-form-item"),
|
|
3371
|
-
return openBlock(), createBlock(
|
|
3367
|
+
v("action", f, p);
|
|
3368
|
+
}, G = ref({});
|
|
3369
|
+
return r({ getFormData: x, resetFormData: T, getComponentRef: (f) => f ? G.value[f] : G.value, getDynamicComponentsRef: () => a.value }), (f, p) => {
|
|
3370
|
+
const k = resolveComponent("el-form-item"), S = resolveComponent("el-form");
|
|
3371
|
+
return openBlock(), createBlock(S, mergeProps({
|
|
3372
3372
|
model: m.value,
|
|
3373
|
-
class: ["dict-dynamic-components container-class",
|
|
3373
|
+
class: ["dict-dynamic-components container-class", g.value],
|
|
3374
3374
|
ref_key: "DynamicComponentsRef",
|
|
3375
3375
|
ref: a
|
|
3376
3376
|
}, f.$attrs, { colon: w.value }), {
|
|
3377
3377
|
default: withCtx(() => [
|
|
3378
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(b.value, (
|
|
3378
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(b.value, (O, V) => {
|
|
3379
3379
|
var R;
|
|
3380
3380
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
3381
|
-
|
|
3382
|
-
|
|
3381
|
+
O.visible ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3382
|
+
O.isFormData ? (openBlock(), createBlock(k, mergeProps({ key: 0 }, O.formItemProps, { class: "comp-item form" }), {
|
|
3383
3383
|
default: withCtx(() => {
|
|
3384
3384
|
var J;
|
|
3385
3385
|
return [
|
|
3386
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
3386
|
+
(openBlock(), createBlock(resolveDynamicComponent(O.compName), mergeProps({
|
|
3387
3387
|
ref_for: !0,
|
|
3388
3388
|
ref: (P) => {
|
|
3389
|
-
P &&
|
|
3389
|
+
P && O.fieldName && (G.value[O.fieldName] = P);
|
|
3390
3390
|
},
|
|
3391
3391
|
key: V
|
|
3392
|
-
},
|
|
3393
|
-
modelValue: m.value[
|
|
3392
|
+
}, O.props, {
|
|
3393
|
+
modelValue: m.value[O.fieldName],
|
|
3394
3394
|
"onUpdate:modelValue": (P) => {
|
|
3395
|
-
m.value[
|
|
3395
|
+
m.value[O.fieldName] = P;
|
|
3396
3396
|
}
|
|
3397
3397
|
}), createSlots({ _: 2 }, [
|
|
3398
|
-
renderList((J =
|
|
3398
|
+
renderList((J = O == null ? void 0 : O.props) == null ? void 0 : J.slotList, (P, K) => ({
|
|
3399
3399
|
name: P.slotName,
|
|
3400
|
-
fn: withCtx((
|
|
3400
|
+
fn: withCtx((L) => [
|
|
3401
3401
|
(openBlock(), createBlock(_sfc_main$m, {
|
|
3402
3402
|
key: K,
|
|
3403
3403
|
render: P.render,
|
|
3404
|
-
scope:
|
|
3404
|
+
scope: L,
|
|
3405
3405
|
formData: m.value
|
|
3406
3406
|
}, null, 8, ["render", "scope", "formData"]))
|
|
3407
3407
|
])
|
|
@@ -3410,15 +3410,15 @@ 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(O.compName), mergeProps({
|
|
3414
3414
|
class: "comp-item",
|
|
3415
3415
|
key: V
|
|
3416
|
-
},
|
|
3417
|
-
onSubmit: (J) =>
|
|
3418
|
-
onReset:
|
|
3419
|
-
onAction: (J) =>
|
|
3416
|
+
}, O.props, {
|
|
3417
|
+
onSubmit: (J) => F(a.value, O),
|
|
3418
|
+
onReset: B,
|
|
3419
|
+
onAction: (J) => I(O)
|
|
3420
3420
|
}), createSlots({ _: 2 }, [
|
|
3421
|
-
renderList((R =
|
|
3421
|
+
renderList((R = O == null ? void 0 : O.props) == null ? void 0 : R.slotList, (J, P) => ({
|
|
3422
3422
|
name: J.slotName,
|
|
3423
3423
|
fn: withCtx((K) => [
|
|
3424
3424
|
(openBlock(), createBlock(_sfc_main$m, {
|
|
@@ -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 v, w, b, m, _, C;
|
|
3485
3485
|
return [
|
|
3486
|
-
(
|
|
3486
|
+
(v = unref(n).findNodeByProp(e.column.prop)) != null && v.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,20 +3493,20 @@ 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, g) => (openBlock(), createBlock(_sfc_main$n, {
|
|
3497
|
+
key: g,
|
|
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, g) => (openBlock(), createBlock(_sfc_main$e, {
|
|
3501
|
+
key: g,
|
|
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, g) => (openBlock(), createBlock(_sfc_main$f, {
|
|
3505
|
+
key: g,
|
|
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, g) => (openBlock(), createBlock(_sfc_main$d, {
|
|
3509
|
+
key: g,
|
|
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 }, [
|
|
@@ -3516,7 +3516,7 @@ const __vite_glob_0_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
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)) : (
|
|
3519
|
+
], 64)) : (_ = unref(n).findNodeByProp(e.column.prop)) != null && _.maskType || (C = unref(n).findNodeByProp(e.column.prop)) != null && C.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 v = s[c];
|
|
3560
|
+
if (v.prop === i)
|
|
3561
|
+
return v;
|
|
3562
|
+
if (v.children && v.children.length > 0) {
|
|
3563
|
+
const w = o(i, v.children);
|
|
3564
3564
|
if (w)
|
|
3565
3565
|
return w;
|
|
3566
3566
|
}
|
|
@@ -3610,6 +3610,10 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3610
3610
|
}, {
|
|
3611
3611
|
__name: "index",
|
|
3612
3612
|
props: {
|
|
3613
|
+
modelValue: {
|
|
3614
|
+
type: Object,
|
|
3615
|
+
default: () => ({})
|
|
3616
|
+
},
|
|
3613
3617
|
rows: {
|
|
3614
3618
|
type: Number,
|
|
3615
3619
|
default: 2
|
|
@@ -3660,89 +3664,113 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3660
3664
|
default: !0
|
|
3661
3665
|
}
|
|
3662
3666
|
},
|
|
3663
|
-
emits: ["fail", "pass", "reset"],
|
|
3667
|
+
emits: ["fail", "pass", "reset", "update:modelValue"],
|
|
3664
3668
|
setup(e, { emit: r }) {
|
|
3665
|
-
const d = e, {
|
|
3666
|
-
let
|
|
3667
|
-
return
|
|
3668
|
-
},
|
|
3669
|
-
let
|
|
3670
|
-
const
|
|
3671
|
-
|
|
3669
|
+
const d = e, { modelValue: t, rows: n, isAutoSetPlaceholder: a, isShowLabelPlaceholder: u, list: o, largeWidth: i, mediumWidth: s, smallWidth: c, foldStatus: v, showFold: w, showReset: b, showSearch: m } = toRefs(d), _ = r, C = ref(v.value), l = ref(window.innerWidth), g = computed(() => l.value > i.value ? 4 : l.value > s.value ? 3 : l.value > c.value ? 2 : 1), T = (D) => {
|
|
3670
|
+
let A = "";
|
|
3671
|
+
return g.value === 4 ? A += "quarter" : g.value === 3 ? A += "triple" : g.value === 2 ? A += "half" : A += "full", g.value === 1 ? w.value && C.value && D + 1 > n.value && (A += " hide") : w.value && C.value && D + 1 > n.value * g.value - 1 && (A += " hide"), A;
|
|
3672
|
+
}, E = ref(null);
|
|
3673
|
+
let y = null;
|
|
3674
|
+
const x = (D) => {
|
|
3675
|
+
D && D.length > 0 && (l.value = D[0].contentRect.width);
|
|
3672
3676
|
};
|
|
3673
3677
|
onMounted(() => {
|
|
3674
|
-
var
|
|
3675
|
-
const
|
|
3676
|
-
|
|
3678
|
+
var A;
|
|
3679
|
+
const D = (A = E.value) == null ? void 0 : A.$el;
|
|
3680
|
+
D && (l.value = D.offsetWidth, y = new ResizeObserver(x), y.observe(D));
|
|
3677
3681
|
}), onUnmounted(() => {
|
|
3678
|
-
|
|
3682
|
+
y && (y.disconnect(), y = null);
|
|
3679
3683
|
});
|
|
3680
|
-
const
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3684
|
+
const N = reactive({}), j = (D) => {
|
|
3685
|
+
var p;
|
|
3686
|
+
const A = {};
|
|
3687
|
+
let f = [];
|
|
3688
|
+
for (let k = 0; k < D.length; k++) {
|
|
3689
|
+
const S = D[k];
|
|
3690
|
+
if (S.fieldName && !f.includes(S.fieldName)) {
|
|
3691
|
+
f.push(S.fieldName);
|
|
3692
|
+
const O = (p = t.value) == null ? void 0 : p[S.fieldName];
|
|
3693
|
+
A[S.fieldName] = (S == null ? void 0 : S.modelValue) !== void 0 ? S.modelValue : O !== void 0 ? O : null;
|
|
3694
|
+
} else
|
|
3695
|
+
console.warn("字段名称重复:", S.fieldName);
|
|
3685
3696
|
}
|
|
3686
|
-
Object.assign(
|
|
3697
|
+
Object.assign(N, A);
|
|
3687
3698
|
};
|
|
3688
3699
|
watch(
|
|
3700
|
+
() => ({ ...N }),
|
|
3701
|
+
() => {
|
|
3702
|
+
const D = {
|
|
3703
|
+
...JSON.parse(JSON.stringify(t.value || {})),
|
|
3704
|
+
...N
|
|
3705
|
+
};
|
|
3706
|
+
_("update:modelValue", D);
|
|
3707
|
+
},
|
|
3708
|
+
{
|
|
3709
|
+
deep: !0,
|
|
3710
|
+
immediate: !0
|
|
3711
|
+
}
|
|
3712
|
+
), watch(
|
|
3689
3713
|
() => d.list,
|
|
3690
|
-
(
|
|
3691
|
-
|
|
3714
|
+
(D) => {
|
|
3715
|
+
j(D);
|
|
3692
3716
|
},
|
|
3693
3717
|
{
|
|
3694
3718
|
immediate: !0
|
|
3695
3719
|
}
|
|
3696
3720
|
);
|
|
3697
|
-
const
|
|
3698
|
-
var
|
|
3699
|
-
if ((
|
|
3700
|
-
return (
|
|
3701
|
-
if (
|
|
3702
|
-
return
|
|
3703
|
-
},
|
|
3704
|
-
await nextTick(),
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3721
|
+
const F = computed(() => g.value === 1 ? o.value.length > n.value : o.value.length > n.value * g.value - 1), B = (D) => {
|
|
3722
|
+
var A, f;
|
|
3723
|
+
if ((A = D == null ? void 0 : D.props) != null && A.placeholder)
|
|
3724
|
+
return (f = D == null ? void 0 : D.props) == null ? void 0 : f.placeholder;
|
|
3725
|
+
if (a.value)
|
|
3726
|
+
return D.compName.toLocaleLowerCase().includes("input") ? u.value ? "请输入" + D.label : "请输入" : u.value ? "请选择" + D.label : "请选择";
|
|
3727
|
+
}, I = async () => {
|
|
3728
|
+
await nextTick(), E.value.resetFields(), setTimeout(() => {
|
|
3729
|
+
_("reset");
|
|
3730
|
+
}, 50);
|
|
3731
|
+
}, G = async () => {
|
|
3732
|
+
await nextTick(), E.value.validate((D, A) => {
|
|
3733
|
+
D ? _("pass", N) : _("fail", A, N);
|
|
3708
3734
|
});
|
|
3709
3735
|
};
|
|
3710
|
-
return (
|
|
3736
|
+
return (D, A) => (openBlock(), createBlock(unref(ElForm), mergeProps({
|
|
3711
3737
|
ref_key: "searchFormRef",
|
|
3712
|
-
ref:
|
|
3738
|
+
ref: E,
|
|
3713
3739
|
style: { minWidth: e.minWidth + "px" },
|
|
3714
|
-
model:
|
|
3740
|
+
model: N,
|
|
3715
3741
|
class: "dict-search-box dict-clearfix"
|
|
3716
|
-
},
|
|
3742
|
+
}, D.$attrs), {
|
|
3717
3743
|
default: withCtx(() => [
|
|
3718
|
-
renderSlot(
|
|
3719
|
-
searchForm:
|
|
3720
|
-
fold:
|
|
3721
|
-
itemsPerRow:
|
|
3744
|
+
renderSlot(D.$slots, "prepend", {
|
|
3745
|
+
searchForm: N,
|
|
3746
|
+
fold: C.value,
|
|
3747
|
+
itemsPerRow: g.value
|
|
3722
3748
|
}, void 0, !0),
|
|
3723
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
3724
|
-
key:
|
|
3725
|
-
class:
|
|
3726
|
-
label:
|
|
3727
|
-
prop:
|
|
3728
|
-
},
|
|
3749
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (f, p) => (openBlock(), createBlock(unref(ElFormItem), mergeProps({
|
|
3750
|
+
key: p,
|
|
3751
|
+
class: T(p),
|
|
3752
|
+
label: f.label,
|
|
3753
|
+
prop: f.fieldName
|
|
3754
|
+
}, f.formItemProps), {
|
|
3729
3755
|
default: withCtx(() => {
|
|
3730
|
-
var
|
|
3756
|
+
var k, S;
|
|
3731
3757
|
return [
|
|
3732
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
3733
|
-
modelValue:
|
|
3734
|
-
"onUpdate:modelValue": (O) =>
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3758
|
+
(openBlock(), createBlock(resolveDynamicComponent(f.compName), mergeProps({
|
|
3759
|
+
modelValue: N[f.fieldName],
|
|
3760
|
+
"onUpdate:modelValue": (O) => {
|
|
3761
|
+
N[f.fieldName] = O;
|
|
3762
|
+
},
|
|
3763
|
+
clearable: ((k = f == null ? void 0 : f.props) == null ? void 0 : k.clearable) || !0,
|
|
3764
|
+
placeholder: B(f)
|
|
3765
|
+
}, f.props), createSlots({ _: 2 }, [
|
|
3766
|
+
renderList((S = f == null ? void 0 : f.props) == null ? void 0 : S.slotList, (O, V) => ({
|
|
3739
3767
|
name: O.slotName,
|
|
3740
|
-
fn: withCtx((
|
|
3768
|
+
fn: withCtx((R) => [
|
|
3741
3769
|
(openBlock(), createBlock(_sfc_main$m, {
|
|
3742
|
-
key:
|
|
3770
|
+
key: V,
|
|
3743
3771
|
render: O.render,
|
|
3744
|
-
scope:
|
|
3745
|
-
formData:
|
|
3772
|
+
scope: R,
|
|
3773
|
+
formData: N
|
|
3746
3774
|
}, null, 8, ["render", "scope", "formData"]))
|
|
3747
3775
|
])
|
|
3748
3776
|
}))
|
|
@@ -3752,90 +3780,74 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3752
3780
|
_: 2
|
|
3753
3781
|
}, 1040, ["class", "label", "prop"]))), 128)),
|
|
3754
3782
|
createVNode(unref(ElFormItem), {
|
|
3755
|
-
class: normalizeClass(
|
|
3783
|
+
class: normalizeClass(T(0) + " fr")
|
|
3756
3784
|
}, {
|
|
3757
3785
|
default: withCtx(() => [
|
|
3758
|
-
renderSlot(
|
|
3759
|
-
searchForm:
|
|
3760
|
-
fold:
|
|
3761
|
-
itemsPerRow:
|
|
3786
|
+
renderSlot(D.$slots, "button-prefix", {
|
|
3787
|
+
searchForm: N,
|
|
3788
|
+
fold: C.value,
|
|
3789
|
+
itemsPerRow: g.value
|
|
3762
3790
|
}, void 0, !0),
|
|
3763
3791
|
withDirectives(createVNode(unref(ElButton), {
|
|
3764
3792
|
plain: "",
|
|
3765
|
-
onClick:
|
|
3793
|
+
onClick: I
|
|
3766
3794
|
}, {
|
|
3767
3795
|
default: withCtx(() => [
|
|
3768
3796
|
createTextVNode("重 置")
|
|
3769
3797
|
]),
|
|
3770
3798
|
_: 1
|
|
3771
3799
|
}, 512), [
|
|
3772
|
-
[vShow, unref(
|
|
3800
|
+
[vShow, unref(b)]
|
|
3773
3801
|
]),
|
|
3774
3802
|
withDirectives(createVNode(unref(ElButton), {
|
|
3775
3803
|
type: "primary",
|
|
3776
|
-
onClick:
|
|
3804
|
+
onClick: G
|
|
3777
3805
|
}, {
|
|
3778
3806
|
default: withCtx(() => [
|
|
3779
3807
|
createTextVNode("查 询")
|
|
3780
3808
|
]),
|
|
3781
3809
|
_: 1
|
|
3782
3810
|
}, 512), [
|
|
3783
|
-
[vShow, unref(
|
|
3811
|
+
[vShow, unref(m)]
|
|
3784
3812
|
]),
|
|
3785
|
-
renderSlot(
|
|
3786
|
-
searchForm:
|
|
3787
|
-
fold:
|
|
3788
|
-
itemsPerRow:
|
|
3813
|
+
renderSlot(D.$slots, "button-suffix", {
|
|
3814
|
+
searchForm: N,
|
|
3815
|
+
fold: C.value,
|
|
3816
|
+
itemsPerRow: g.value
|
|
3789
3817
|
}, void 0, !0),
|
|
3790
|
-
unref(
|
|
3818
|
+
unref(w) && F.value ? (openBlock(), createBlock(unref(ElLink), {
|
|
3791
3819
|
key: 0,
|
|
3792
3820
|
class: "no-underline",
|
|
3793
3821
|
underline: "never",
|
|
3794
3822
|
type: "primary",
|
|
3795
|
-
onClick:
|
|
3823
|
+
onClick: A[0] || (A[0] = (f) => C.value = !C.value)
|
|
3796
3824
|
}, {
|
|
3797
3825
|
default: withCtx(() => [
|
|
3798
|
-
createTextVNode("展开"),
|
|
3799
|
-
createVNode(unref(ElIcon),
|
|
3826
|
+
createTextVNode(toDisplayString(C.value ? "展开" : "收起"), 1),
|
|
3827
|
+
createVNode(unref(ElIcon), {
|
|
3828
|
+
class: normalizeClass(C.value ? "" : "rotate")
|
|
3829
|
+
}, {
|
|
3800
3830
|
default: withCtx(() => [
|
|
3801
3831
|
createVNode(unref(ArrowDown))
|
|
3802
3832
|
]),
|
|
3803
3833
|
_: 1
|
|
3804
|
-
})
|
|
3805
|
-
]),
|
|
3806
|
-
_: 1
|
|
3807
|
-
})) : createCommentVNode("", !0),
|
|
3808
|
-
unref(g) && !D.value && j.value ? (openBlock(), createBlock(unref(ElLink), {
|
|
3809
|
-
key: 1,
|
|
3810
|
-
class: "no-underline",
|
|
3811
|
-
underline: "never",
|
|
3812
|
-
type: "primary",
|
|
3813
|
-
onClick: _[1] || (_[1] = (A) => D.value = !D.value)
|
|
3814
|
-
}, {
|
|
3815
|
-
default: withCtx(() => [
|
|
3816
|
-
createTextVNode("收起"),
|
|
3817
|
-
createVNode(unref(ElIcon), null, {
|
|
3818
|
-
default: withCtx(() => [
|
|
3819
|
-
createVNode(unref(ArrowUp))
|
|
3820
|
-
]),
|
|
3821
|
-
_: 1
|
|
3822
|
-
})
|
|
3834
|
+
}, 8, ["class"])
|
|
3823
3835
|
]),
|
|
3824
3836
|
_: 1
|
|
3825
3837
|
})) : createCommentVNode("", !0)
|
|
3826
3838
|
]),
|
|
3827
3839
|
_: 3
|
|
3828
3840
|
}, 8, ["class"]),
|
|
3829
|
-
renderSlot(
|
|
3830
|
-
searchForm:
|
|
3831
|
-
fold:
|
|
3832
|
-
itemsPerRow:
|
|
3841
|
+
renderSlot(D.$slots, "append", {
|
|
3842
|
+
searchForm: N,
|
|
3843
|
+
fold: C.value,
|
|
3844
|
+
itemsPerRow: g.value
|
|
3833
3845
|
}, void 0, !0)
|
|
3834
3846
|
]),
|
|
3835
3847
|
_: 3
|
|
3836
3848
|
}, 16, ["style", "model"]));
|
|
3837
3849
|
}
|
|
3838
|
-
}), dictComponent$1 = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-
|
|
3850
|
+
}), dictComponent$1 = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-7b1bd4d6"]]);
|
|
3839
3851
|
dictComponent$1.install = function(e) {
|
|
3840
3852
|
e.component(dictComponent$1.name, dictComponent$1);
|
|
3841
3853
|
};
|
|
@@ -3878,8 +3890,8 @@ const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
3878
3890
|
},
|
|
3879
3891
|
emits: ["update:modelValue", "focus", "blur"],
|
|
3880
3892
|
setup(e, { emit: r }) {
|
|
3881
|
-
const d = e, { modelValue: t, maskType: n, maskStart: a, maskMiddle: u, maskEnd: o, maskSymbol: i } = toRefs(d), s = r, c = ref(d.modelValue),
|
|
3882
|
-
const
|
|
3893
|
+
const d = e, { modelValue: t, maskType: n, maskStart: a, maskMiddle: u, maskEnd: o, maskSymbol: i } = toRefs(d), s = r, c = ref(d.modelValue), v = ref(!1), w = computed(() => !!n.value || Number(a.value) > 0 || Number(u.value) > 0 || Number(o.value) > 0), b = computed(() => {
|
|
3894
|
+
const g = {
|
|
3883
3895
|
start: Number(a.value) || 0,
|
|
3884
3896
|
middle: Number(u.value) || 0,
|
|
3885
3897
|
end: Number(o.value) || 0,
|
|
@@ -3887,45 +3899,45 @@ const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
3887
3899
|
defaultVal: ""
|
|
3888
3900
|
};
|
|
3889
3901
|
return typeof n.value == "string" ? n.value : Array.isArray(n.value) ? {
|
|
3890
|
-
...
|
|
3891
|
-
start: n.value[0] ||
|
|
3892
|
-
middle: n.value[1] ||
|
|
3893
|
-
end: n.value[2] ||
|
|
3894
|
-
symbol: n.value[3] ||
|
|
3895
|
-
} : typeof n.value == "object" && n.value !== null ? { ...
|
|
3896
|
-
}), m = (
|
|
3897
|
-
|
|
3898
|
-
},
|
|
3899
|
-
|
|
3900
|
-
}, l = (
|
|
3901
|
-
|
|
3902
|
+
...g,
|
|
3903
|
+
start: n.value[0] || g.start,
|
|
3904
|
+
middle: n.value[1] || g.middle,
|
|
3905
|
+
end: n.value[2] || g.end,
|
|
3906
|
+
symbol: n.value[3] || g.symbol
|
|
3907
|
+
} : typeof n.value == "object" && n.value !== null ? { ...g, ...n.value } : g;
|
|
3908
|
+
}), m = (g = t.value) => {
|
|
3909
|
+
v.value ? c.value = g : w.value ? c.value = Desensitization(g, b.value) : c.value = g;
|
|
3910
|
+
}, _ = inject("elFormItem", null), C = (g) => {
|
|
3911
|
+
v.value = !0, m(), s("focus", g);
|
|
3912
|
+
}, l = (g) => {
|
|
3913
|
+
v.value = !1, s("update:modelValue", c.value), m(), s("blur", g), _ && _.validate("blur");
|
|
3902
3914
|
};
|
|
3903
3915
|
return watch(
|
|
3904
3916
|
c,
|
|
3905
|
-
(
|
|
3906
|
-
|
|
3917
|
+
(g) => {
|
|
3918
|
+
v.value && s("update:modelValue", g);
|
|
3907
3919
|
},
|
|
3908
3920
|
{ immediate: !1 }
|
|
3909
3921
|
), watch(
|
|
3910
3922
|
t,
|
|
3911
|
-
(
|
|
3912
|
-
m(
|
|
3923
|
+
(g) => {
|
|
3924
|
+
m(g);
|
|
3913
3925
|
},
|
|
3914
3926
|
{ immediate: !0, deep: !0 }
|
|
3915
3927
|
), onUnmounted(() => {
|
|
3916
|
-
|
|
3917
|
-
}), (
|
|
3928
|
+
v.value = !1;
|
|
3929
|
+
}), (g, T) => (openBlock(), createBlock(unref(ElInput), mergeProps({
|
|
3918
3930
|
modelValue: c.value,
|
|
3919
|
-
"onUpdate:modelValue":
|
|
3920
|
-
},
|
|
3931
|
+
"onUpdate:modelValue": T[0] || (T[0] = (E) => c.value = E)
|
|
3932
|
+
}, g.$attrs, {
|
|
3921
3933
|
onFocus: C,
|
|
3922
3934
|
onBlur: l,
|
|
3923
3935
|
autocomplete: "off"
|
|
3924
3936
|
}), createSlots({ _: 2 }, [
|
|
3925
|
-
renderList(
|
|
3926
|
-
name:
|
|
3927
|
-
fn: withCtx((
|
|
3928
|
-
renderSlot(
|
|
3937
|
+
renderList(g.$slots, (E, y, x) => ({
|
|
3938
|
+
name: y,
|
|
3939
|
+
fn: withCtx((N) => [
|
|
3940
|
+
renderSlot(g.$slots, y, normalizeProps(guardReactiveProps(N)))
|
|
3929
3941
|
])
|
|
3930
3942
|
}))
|
|
3931
3943
|
]), 1040, ["modelValue"]));
|
|
@@ -3994,34 +4006,34 @@ const __vite_glob_0_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
3994
4006
|
},
|
|
3995
4007
|
emits: ["dictChange"],
|
|
3996
4008
|
setup(e, { expose: r, emit: d }) {
|
|
3997
|
-
const t = e, { disabled: n, addAllText: a, data: u, format: o, dictType: i, disabledObj: s, keyValue: c, filterDataFun:
|
|
4009
|
+
const t = e, { disabled: n, addAllText: a, data: u, format: o, dictType: i, disabledObj: s, keyValue: c, filterDataFun: v, disabledDataFun: w } = toRefs(t), b = useAttrs(), m = computed(() => {
|
|
3998
4010
|
const p = {};
|
|
3999
|
-
return Object.entries(b).forEach(([k,
|
|
4000
|
-
const
|
|
4001
|
-
if (!
|
|
4002
|
-
const V = ToCamelCase(
|
|
4003
|
-
p[V] =
|
|
4011
|
+
return Object.entries(b).forEach(([k, S]) => {
|
|
4012
|
+
const O = ToKebabCase(k);
|
|
4013
|
+
if (!O.startsWith("radio-button-") && !O.startsWith("on-radio-button-")) {
|
|
4014
|
+
const V = ToCamelCase(O);
|
|
4015
|
+
p[V] = S;
|
|
4004
4016
|
}
|
|
4005
4017
|
}), p;
|
|
4006
|
-
}),
|
|
4018
|
+
}), _ = computed(() => {
|
|
4007
4019
|
const p = {};
|
|
4008
|
-
return Object.entries(b).forEach(([k,
|
|
4009
|
-
const
|
|
4010
|
-
if (
|
|
4011
|
-
const V = ToCamelCase(
|
|
4012
|
-
p[V] =
|
|
4020
|
+
return Object.entries(b).forEach(([k, S]) => {
|
|
4021
|
+
const O = ToKebabCase(k);
|
|
4022
|
+
if (O.startsWith("radio-button-") || O.startsWith("on-radio-button-")) {
|
|
4023
|
+
const V = ToCamelCase(O.replace("radio-button-", ""));
|
|
4024
|
+
p[V] = S;
|
|
4013
4025
|
}
|
|
4014
4026
|
}), p;
|
|
4015
|
-
}), C = ref(""), l = toRaw(store.state.dictConfig),
|
|
4027
|
+
}), C = ref(""), l = toRaw(store.state.dictConfig), g = d, T = (p) => {
|
|
4016
4028
|
if (!c.value) {
|
|
4017
|
-
|
|
4029
|
+
g("dictChange", p);
|
|
4018
4030
|
return;
|
|
4019
4031
|
}
|
|
4020
|
-
const k = E.list.find((
|
|
4021
|
-
|
|
4032
|
+
const k = E.list.find((S) => S[l.format.value] === p);
|
|
4033
|
+
g("dictChange", k);
|
|
4022
4034
|
}, E = reactive({
|
|
4023
4035
|
list: []
|
|
4024
|
-
}),
|
|
4036
|
+
}), y = async () => {
|
|
4025
4037
|
if (!i.value || u.value && u.value.length > 0)
|
|
4026
4038
|
return;
|
|
4027
4039
|
let p = [];
|
|
@@ -4029,37 +4041,37 @@ const __vite_glob_0_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4029
4041
|
C.value = i.value.type;
|
|
4030
4042
|
const k = await store.actions.getDictDataObj(C.value);
|
|
4031
4043
|
p = [].concat(k[C.value]);
|
|
4032
|
-
const { filters:
|
|
4033
|
-
V ? p = p.filter((J) => !R.includes(J[
|
|
4044
|
+
const { filters: S, filterType: O = l.format.value, reverse: V = !1 } = i.value, R = typeof S == "string" ? S.split(",") : S;
|
|
4045
|
+
V ? p = p.filter((J) => !R.includes(J[O])) : p = p.filter((J) => R.includes(J[O]));
|
|
4034
4046
|
} else {
|
|
4035
4047
|
C.value = i.value;
|
|
4036
4048
|
const k = await store.actions.getDictDataObj(C.value);
|
|
4037
4049
|
p = [].concat(k[C.value]);
|
|
4038
4050
|
}
|
|
4039
|
-
if (
|
|
4051
|
+
if (v.value && (p = v.value(p)), w.value)
|
|
4040
4052
|
p = p.map((k) => ({
|
|
4041
4053
|
...k,
|
|
4042
4054
|
[l.format.disabled]: w.value(k)
|
|
4043
4055
|
}));
|
|
4044
4056
|
else if (s.value) {
|
|
4045
|
-
const { disabledValues: k, disabledType:
|
|
4046
|
-
|
|
4057
|
+
const { disabledValues: k, disabledType: S = l.format.value, reverse: O = !1 } = s.value, V = typeof k == "string" ? k.split(",") : k;
|
|
4058
|
+
O ? p = p.map((R) => {
|
|
4047
4059
|
const J = JSON.parse(JSON.stringify(R));
|
|
4048
|
-
return J[l.format.disabled] = !V.includes(J[
|
|
4060
|
+
return J[l.format.disabled] = !V.includes(J[S]) || J[l.format.disabled], J;
|
|
4049
4061
|
}) : p = p.map((R) => {
|
|
4050
4062
|
const J = JSON.parse(JSON.stringify(R));
|
|
4051
|
-
return J[l.format.disabled] = V.includes(J[
|
|
4063
|
+
return J[l.format.disabled] = V.includes(J[S]) || J[l.format.disabled], J;
|
|
4052
4064
|
});
|
|
4053
4065
|
}
|
|
4054
4066
|
a.value && p.unshift({
|
|
4055
4067
|
[l.format.value]: "",
|
|
4056
4068
|
[l.format.label]: a.value
|
|
4057
4069
|
}), E.list = p;
|
|
4058
|
-
}, x = computed(() => store.state.isGettingDictTypes.includes(C.value)),
|
|
4070
|
+
}, x = computed(() => store.state.isGettingDictTypes.includes(C.value)), N = computed(() => store.state.isGettingAllDictTypes), j = computed(() => u.value), F = inject(formItemContextKey), B = inject(formContextKey), I = computed(() => n.value || b["radio-disabled"] === "" || b["radio-disabled"] || b.radioDisabled === "" || b.radioDisabled || b.RadioDisabled === "" || b.RadioDisabled || (F == null ? void 0 : F.disabled) || (B == null ? void 0 : B.disabled) || !1);
|
|
4059
4071
|
watch(
|
|
4060
|
-
[x,
|
|
4061
|
-
([p, k,
|
|
4062
|
-
!p && !k &&
|
|
4072
|
+
[x, N, j],
|
|
4073
|
+
([p, k, S]) => {
|
|
4074
|
+
!p && !k && S && S.length === 0 && y(), S.length > 0 && (E.list = JSON.parse(JSON.stringify(S)), E.list.length > 0 && (Object.prototype.toString.call(E.list[0]) === "[object Object]" ? E.list = E.list.map((V) => ({
|
|
4063
4075
|
[l.format.value]: V[o.value.value],
|
|
4064
4076
|
[l.format.label]: V[o.value.label],
|
|
4065
4077
|
[l.format.disabled]: !!V[o.value.disabled],
|
|
@@ -4076,34 +4088,34 @@ const __vite_glob_0_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4076
4088
|
immediate: !0
|
|
4077
4089
|
}
|
|
4078
4090
|
);
|
|
4079
|
-
const
|
|
4080
|
-
return r({ getElRadioGroupRef: () => A.value, getElRadioButtonRefs:
|
|
4091
|
+
const G = ref([]), D = () => G.value, A = ref(null);
|
|
4092
|
+
return r({ getElRadioGroupRef: () => A.value, getElRadioButtonRefs: D }), (p, k) => (openBlock(), createBlock(unref(ElRadioGroup), mergeProps({
|
|
4081
4093
|
ref_key: "ElRadioGroupRef",
|
|
4082
4094
|
ref: A,
|
|
4083
|
-
disabled:
|
|
4084
|
-
}, m.value, { onChange:
|
|
4095
|
+
disabled: I.value
|
|
4096
|
+
}, m.value, { onChange: T }), createSlots({
|
|
4085
4097
|
default: withCtx(() => [
|
|
4086
|
-
p.$attrs.options ? createCommentVNode("", !0) : (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(E.list, (
|
|
4098
|
+
p.$attrs.options ? createCommentVNode("", !0) : (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(E.list, (S, O) => (openBlock(), createBlock(unref(ElRadioButton), mergeProps({
|
|
4087
4099
|
ref_for: !0,
|
|
4088
4100
|
ref: (V) => {
|
|
4089
|
-
V && (
|
|
4101
|
+
V && (G.value[O] = V);
|
|
4090
4102
|
},
|
|
4091
|
-
key:
|
|
4092
|
-
disabled:
|
|
4093
|
-
label:
|
|
4094
|
-
},
|
|
4103
|
+
key: S[unref(l).format.value],
|
|
4104
|
+
disabled: I.value || S[unref(l).format.disabled],
|
|
4105
|
+
label: S[unref(l).format.value]
|
|
4106
|
+
}, _.value), {
|
|
4095
4107
|
default: withCtx(() => [
|
|
4096
|
-
createTextVNode(toDisplayString(
|
|
4108
|
+
createTextVNode(toDisplayString(S[unref(l).format.label]), 1)
|
|
4097
4109
|
]),
|
|
4098
4110
|
_: 2
|
|
4099
4111
|
}, 1040, ["disabled", "label"]))), 128))
|
|
4100
4112
|
]),
|
|
4101
4113
|
_: 2
|
|
4102
4114
|
}, [
|
|
4103
|
-
renderList(p.$slots, (
|
|
4104
|
-
name:
|
|
4115
|
+
renderList(p.$slots, (S, O, V) => ({
|
|
4116
|
+
name: O,
|
|
4105
4117
|
fn: withCtx((R) => [
|
|
4106
|
-
renderSlot(p.$slots,
|
|
4118
|
+
renderSlot(p.$slots, O, normalizeProps(guardReactiveProps(R)))
|
|
4107
4119
|
])
|
|
4108
4120
|
}))
|
|
4109
4121
|
]), 1040, ["disabled"]));
|
|
@@ -4167,34 +4179,34 @@ const __vite_glob_0_13 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4167
4179
|
},
|
|
4168
4180
|
emits: ["dictChange"],
|
|
4169
4181
|
setup(e, { expose: r, emit: d }) {
|
|
4170
|
-
const t = e, { disabled: n, addAllText: a, data: u, format: o, dictType: i, disabledObj: s, keyValue: c, filterDataFun:
|
|
4182
|
+
const t = e, { disabled: n, addAllText: a, data: u, format: o, dictType: i, disabledObj: s, keyValue: c, filterDataFun: v, disabledDataFun: w } = toRefs(t), b = useAttrs(), m = computed(() => {
|
|
4171
4183
|
const p = {};
|
|
4172
|
-
return Object.entries(b).forEach(([k,
|
|
4173
|
-
const
|
|
4174
|
-
if (!
|
|
4175
|
-
const V = ToCamelCase(
|
|
4176
|
-
p[V] =
|
|
4184
|
+
return Object.entries(b).forEach(([k, S]) => {
|
|
4185
|
+
const O = ToKebabCase(k);
|
|
4186
|
+
if (!O.startsWith("radio-") && !O.startsWith("on-radio-")) {
|
|
4187
|
+
const V = ToCamelCase(O);
|
|
4188
|
+
p[V] = S;
|
|
4177
4189
|
}
|
|
4178
4190
|
}), p;
|
|
4179
|
-
}),
|
|
4191
|
+
}), _ = computed(() => {
|
|
4180
4192
|
const p = {};
|
|
4181
|
-
return Object.entries(b).forEach(([k,
|
|
4182
|
-
const
|
|
4183
|
-
if (
|
|
4184
|
-
const V = ToCamelCase(
|
|
4185
|
-
p[V] =
|
|
4193
|
+
return Object.entries(b).forEach(([k, S]) => {
|
|
4194
|
+
const O = ToKebabCase(k);
|
|
4195
|
+
if (O.startsWith("radio-") || O.startsWith("on-radio-")) {
|
|
4196
|
+
const V = ToCamelCase(O.replace("radio-", ""));
|
|
4197
|
+
p[V] = S;
|
|
4186
4198
|
}
|
|
4187
4199
|
}), p;
|
|
4188
|
-
}), C = ref(""), l = toRaw(store.state.dictConfig),
|
|
4200
|
+
}), C = ref(""), l = toRaw(store.state.dictConfig), g = d, T = (p) => {
|
|
4189
4201
|
if (!c.value) {
|
|
4190
|
-
|
|
4202
|
+
g("dictChange", p);
|
|
4191
4203
|
return;
|
|
4192
4204
|
}
|
|
4193
|
-
const k = E.list.find((
|
|
4194
|
-
|
|
4205
|
+
const k = E.list.find((S) => S[l.format.value] === p);
|
|
4206
|
+
g("dictChange", k);
|
|
4195
4207
|
}, E = reactive({
|
|
4196
4208
|
list: []
|
|
4197
|
-
}),
|
|
4209
|
+
}), y = async () => {
|
|
4198
4210
|
if (!i.value || u.value && u.value.length > 0)
|
|
4199
4211
|
return;
|
|
4200
4212
|
let p = [];
|
|
@@ -4202,37 +4214,37 @@ const __vite_glob_0_13 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4202
4214
|
C.value = i.value.type;
|
|
4203
4215
|
const k = await store.actions.getDictDataObj(C.value);
|
|
4204
4216
|
p = [].concat(k[C.value]);
|
|
4205
|
-
const { filters:
|
|
4206
|
-
V ? p = p.filter((J) => !R.includes(J[
|
|
4217
|
+
const { filters: S, filterType: O = l.format.value, reverse: V = !1 } = i.value, R = typeof S == "string" ? S.split(",") : S;
|
|
4218
|
+
V ? p = p.filter((J) => !R.includes(J[O])) : p = p.filter((J) => R.includes(J[O]));
|
|
4207
4219
|
} else {
|
|
4208
4220
|
C.value = i.value;
|
|
4209
4221
|
const k = await store.actions.getDictDataObj(C.value);
|
|
4210
4222
|
p = [].concat(k[C.value]);
|
|
4211
4223
|
}
|
|
4212
|
-
if (
|
|
4224
|
+
if (v.value && (p = v.value(p)), w.value)
|
|
4213
4225
|
p = p.map((k) => ({
|
|
4214
4226
|
...k,
|
|
4215
4227
|
[l.format.disabled]: w.value(k)
|
|
4216
4228
|
}));
|
|
4217
4229
|
else if (s.value) {
|
|
4218
|
-
const { disabledValues: k, disabledType:
|
|
4219
|
-
|
|
4230
|
+
const { disabledValues: k, disabledType: S = l.format.value, reverse: O = !1 } = s.value, V = typeof k == "string" ? k.split(",") : k;
|
|
4231
|
+
O ? p = p.map((R) => {
|
|
4220
4232
|
const J = JSON.parse(JSON.stringify(R));
|
|
4221
|
-
return J[l.format.disabled] = !V.includes(J[
|
|
4233
|
+
return J[l.format.disabled] = !V.includes(J[S]) || J[l.format.disabled], J;
|
|
4222
4234
|
}) : p = p.map((R) => {
|
|
4223
4235
|
const J = JSON.parse(JSON.stringify(R));
|
|
4224
|
-
return J[l.format.disabled] = V.includes(J[
|
|
4236
|
+
return J[l.format.disabled] = V.includes(J[S]) || J[l.format.disabled], J;
|
|
4225
4237
|
});
|
|
4226
4238
|
}
|
|
4227
4239
|
a.value && p.unshift({
|
|
4228
4240
|
[l.format.value]: "",
|
|
4229
4241
|
[l.format.label]: a.value
|
|
4230
4242
|
}), E.list = p;
|
|
4231
|
-
}, x = computed(() => store.state.isGettingDictTypes.includes(C.value)),
|
|
4243
|
+
}, x = computed(() => store.state.isGettingDictTypes.includes(C.value)), N = computed(() => store.state.isGettingAllDictTypes), j = computed(() => u.value), F = inject(formItemContextKey), B = inject(formContextKey), I = computed(() => n.value || b["radio-disabled"] === "" || b["radio-disabled"] || b.radioDisabled === "" || b.radioDisabled || b.RadioDisabled === "" || b.RadioDisabled || (F == null ? void 0 : F.disabled) || (B == null ? void 0 : B.disabled) || !1);
|
|
4232
4244
|
watch(
|
|
4233
|
-
[x,
|
|
4234
|
-
([p, k,
|
|
4235
|
-
!p && !k &&
|
|
4245
|
+
[x, N, j],
|
|
4246
|
+
([p, k, S]) => {
|
|
4247
|
+
!p && !k && S && S.length === 0 && y(), S.length > 0 && (E.list = JSON.parse(JSON.stringify(S)), E.list.length > 0 && (Object.prototype.toString.call(E.list[0]) === "[object Object]" ? E.list = E.list.map((V) => ({
|
|
4236
4248
|
[l.format.value]: V[o.value.value],
|
|
4237
4249
|
[l.format.label]: V[o.value.label],
|
|
4238
4250
|
[l.format.disabled]: !!V[o.value.disabled],
|
|
@@ -4249,34 +4261,34 @@ const __vite_glob_0_13 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4249
4261
|
immediate: !0
|
|
4250
4262
|
}
|
|
4251
4263
|
);
|
|
4252
|
-
const
|
|
4253
|
-
return r({ geElRadioGroupRef: () => A.value, getElRadioRefs:
|
|
4264
|
+
const G = ref([]), D = () => G.value, A = ref(null);
|
|
4265
|
+
return r({ geElRadioGroupRef: () => A.value, getElRadioRefs: D }), (p, k) => (openBlock(), createBlock(unref(ElRadioGroup), mergeProps({
|
|
4254
4266
|
ref_key: "ElRadioGroupRef",
|
|
4255
4267
|
ref: A,
|
|
4256
|
-
disabled:
|
|
4257
|
-
}, m.value, { onChange:
|
|
4268
|
+
disabled: I.value
|
|
4269
|
+
}, m.value, { onChange: T }), createSlots({
|
|
4258
4270
|
default: withCtx(() => [
|
|
4259
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(E.list, (
|
|
4271
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(E.list, (S, O) => (openBlock(), createBlock(unref(ElRadio), mergeProps({
|
|
4260
4272
|
ref_for: !0,
|
|
4261
4273
|
ref: (V) => {
|
|
4262
|
-
V && (
|
|
4274
|
+
V && (G.value[O] = V);
|
|
4263
4275
|
},
|
|
4264
|
-
key:
|
|
4265
|
-
disabled:
|
|
4266
|
-
label:
|
|
4267
|
-
},
|
|
4276
|
+
key: S[unref(l).format.value],
|
|
4277
|
+
disabled: I.value || S[unref(l).format.disabled],
|
|
4278
|
+
label: S[unref(l).format.value]
|
|
4279
|
+
}, _.value), {
|
|
4268
4280
|
default: withCtx(() => [
|
|
4269
|
-
createTextVNode(toDisplayString(
|
|
4281
|
+
createTextVNode(toDisplayString(S[unref(l).format.label]), 1)
|
|
4270
4282
|
]),
|
|
4271
4283
|
_: 2
|
|
4272
4284
|
}, 1040, ["disabled", "label"]))), 128))
|
|
4273
4285
|
]),
|
|
4274
4286
|
_: 2
|
|
4275
4287
|
}, [
|
|
4276
|
-
renderList(p.$slots, (
|
|
4277
|
-
name:
|
|
4288
|
+
renderList(p.$slots, (S, O, V) => ({
|
|
4289
|
+
name: O,
|
|
4278
4290
|
fn: withCtx((R) => [
|
|
4279
|
-
renderSlot(p.$slots,
|
|
4291
|
+
renderSlot(p.$slots, O, normalizeProps(guardReactiveProps(R)))
|
|
4280
4292
|
])
|
|
4281
4293
|
}))
|
|
4282
4294
|
]), 1040, ["disabled"]));
|
|
@@ -4341,37 +4353,37 @@ const __vite_glob_0_14 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4341
4353
|
},
|
|
4342
4354
|
emits: ["dictChange"],
|
|
4343
4355
|
setup(e, { expose: r, emit: d }) {
|
|
4344
|
-
const t = e, { addAllText: n, emptyValues: a, valueOnClear: u, data: o, format: i, dictType: s, disabledObj: c, keyValue:
|
|
4356
|
+
const t = e, { addAllText: n, emptyValues: a, valueOnClear: u, data: o, format: i, dictType: s, disabledObj: c, keyValue: v, filterDataFun: w, disabledDataFun: b } = toRefs(t), m = useAttrs(), _ = computed(() => {
|
|
4345
4357
|
const f = {};
|
|
4346
4358
|
return Object.entries(m).forEach(([p, k]) => {
|
|
4347
|
-
const
|
|
4348
|
-
if (!
|
|
4349
|
-
const
|
|
4350
|
-
f[
|
|
4359
|
+
const S = ToKebabCase(p);
|
|
4360
|
+
if (!S.startsWith("option-") && !S.startsWith("on-option-")) {
|
|
4361
|
+
const O = ToCamelCase(S);
|
|
4362
|
+
f[O] = k;
|
|
4351
4363
|
}
|
|
4352
4364
|
}), f;
|
|
4353
4365
|
}), C = computed(() => {
|
|
4354
4366
|
const f = {};
|
|
4355
4367
|
return Object.entries(m).forEach(([p, k]) => {
|
|
4356
|
-
const
|
|
4357
|
-
if (
|
|
4358
|
-
const
|
|
4359
|
-
f[
|
|
4368
|
+
const S = ToKebabCase(p);
|
|
4369
|
+
if (S.startsWith("option-") || S.startsWith("on-option-")) {
|
|
4370
|
+
const O = ToCamelCase(S.replace("option-", ""));
|
|
4371
|
+
f[O] = k;
|
|
4360
4372
|
}
|
|
4361
4373
|
}), f;
|
|
4362
|
-
}), l = ref(""),
|
|
4363
|
-
if (!
|
|
4364
|
-
|
|
4374
|
+
}), l = ref(""), g = toRaw(store.state.dictConfig), T = d, E = (f) => {
|
|
4375
|
+
if (!v.value) {
|
|
4376
|
+
T("dictChange", f);
|
|
4365
4377
|
return;
|
|
4366
4378
|
}
|
|
4367
4379
|
if (!m.multiple && m.multiple !== "") {
|
|
4368
|
-
const p =
|
|
4369
|
-
|
|
4380
|
+
const p = y.list.find((k) => k[g.format.value] === f);
|
|
4381
|
+
T("dictChange", p);
|
|
4370
4382
|
} else {
|
|
4371
|
-
const p =
|
|
4372
|
-
|
|
4383
|
+
const p = y.list.filter((k) => f.includes(k[g.format.value]));
|
|
4384
|
+
T("dictChange", p);
|
|
4373
4385
|
}
|
|
4374
|
-
},
|
|
4386
|
+
}, y = reactive({
|
|
4375
4387
|
list: []
|
|
4376
4388
|
}), x = async () => {
|
|
4377
4389
|
if (!s.value || o.value && o.value.length > 0)
|
|
@@ -4381,8 +4393,8 @@ const __vite_glob_0_14 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4381
4393
|
l.value = s.value.type;
|
|
4382
4394
|
const p = await store.actions.getDictDataObj(l.value);
|
|
4383
4395
|
f = [].concat(p[l.value]);
|
|
4384
|
-
const { filters: k, filterType:
|
|
4385
|
-
|
|
4396
|
+
const { filters: k, filterType: S = g.format.value, reverse: O = !1 } = s.value, V = typeof k == "string" ? k.split(",") : k;
|
|
4397
|
+
O ? f = f.filter((R) => !V.includes(R[S])) : f = f.filter((R) => V.includes(R[S]));
|
|
4386
4398
|
} else {
|
|
4387
4399
|
l.value = s.value;
|
|
4388
4400
|
const p = await store.actions.getDictDataObj(l.value);
|
|
@@ -4391,76 +4403,76 @@ const __vite_glob_0_14 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4391
4403
|
if (w.value && (f = w.value(f)), b.value)
|
|
4392
4404
|
f = f.map((p) => ({
|
|
4393
4405
|
...p,
|
|
4394
|
-
[
|
|
4406
|
+
[g.format.disabled]: b.value(p)
|
|
4395
4407
|
}));
|
|
4396
4408
|
else if (c.value) {
|
|
4397
|
-
const { disabledValues: p, disabledType: k =
|
|
4398
|
-
|
|
4409
|
+
const { disabledValues: p, disabledType: k = g.format.value, reverse: S = !1 } = c.value, O = typeof p == "string" ? p.split(",") : p;
|
|
4410
|
+
S ? f = f.map((V) => {
|
|
4399
4411
|
const R = JSON.parse(JSON.stringify(V));
|
|
4400
|
-
return R[
|
|
4412
|
+
return R[g.format.disabled] = !O.includes(R[k]) || R[g.format.disabled], R;
|
|
4401
4413
|
}) : f = f.map((V) => {
|
|
4402
4414
|
const R = JSON.parse(JSON.stringify(V));
|
|
4403
|
-
return R[
|
|
4415
|
+
return R[g.format.disabled] = O.includes(R[k]) || R[g.format.disabled], R;
|
|
4404
4416
|
});
|
|
4405
4417
|
}
|
|
4406
4418
|
n.value && !m.multiple && m.multiple !== "" && f.unshift({
|
|
4407
|
-
[
|
|
4408
|
-
[
|
|
4409
|
-
}),
|
|
4410
|
-
},
|
|
4419
|
+
[g.format.value]: "",
|
|
4420
|
+
[g.format.label]: n.value
|
|
4421
|
+
}), y.list = f;
|
|
4422
|
+
}, N = computed(() => store.state.isGettingDictTypes.includes(l.value)), j = computed(() => store.state.isGettingAllDictTypes), F = computed(() => o.value);
|
|
4411
4423
|
watch(
|
|
4412
|
-
[
|
|
4424
|
+
[N, j, F],
|
|
4413
4425
|
([f, p, k]) => {
|
|
4414
4426
|
if (!f && !p && k && k.length === 0 && x(), k.length > 0) {
|
|
4415
|
-
let
|
|
4416
|
-
|
|
4417
|
-
[
|
|
4418
|
-
[
|
|
4419
|
-
[
|
|
4427
|
+
let S = JSON.parse(JSON.stringify(k));
|
|
4428
|
+
S.length > 0 && (Object.prototype.toString.call(S[0]) === "[object Object]" ? S = S.map((V) => ({
|
|
4429
|
+
[g.format.value]: V[i.value.value],
|
|
4430
|
+
[g.format.label]: V[i.value.label],
|
|
4431
|
+
[g.format.disabled]: !!V[i.value.disabled],
|
|
4420
4432
|
...V
|
|
4421
|
-
})) :
|
|
4422
|
-
[
|
|
4423
|
-
[
|
|
4424
|
-
})), n.value && !m.multiple && m.multiple !== "" &&
|
|
4425
|
-
[
|
|
4426
|
-
[
|
|
4427
|
-
}),
|
|
4433
|
+
})) : S = S.map((V) => ({
|
|
4434
|
+
[g.format.value]: V,
|
|
4435
|
+
[g.format.label]: V
|
|
4436
|
+
})), n.value && !m.multiple && m.multiple !== "" && S.unshift({
|
|
4437
|
+
[g.format.value]: "",
|
|
4438
|
+
[g.format.label]: n.value
|
|
4439
|
+
}), y.list = S);
|
|
4428
4440
|
}
|
|
4429
4441
|
},
|
|
4430
4442
|
{
|
|
4431
4443
|
immediate: !0
|
|
4432
4444
|
}
|
|
4433
4445
|
);
|
|
4434
|
-
const
|
|
4435
|
-
return r({ getElSelectRef:
|
|
4446
|
+
const B = () => n.value && !m.multiple && m.multiple !== "" ? "" : u.value, I = ref(null), G = () => I.value, D = ref([]);
|
|
4447
|
+
return r({ getElSelectRef: G, getElOptionRefs: () => D.value }), (f, p) => (openBlock(), createBlock(unref(ElSelect), mergeProps({
|
|
4436
4448
|
ref_key: "ElSelectRef",
|
|
4437
|
-
ref:
|
|
4438
|
-
},
|
|
4439
|
-
"value-on-clear":
|
|
4449
|
+
ref: I
|
|
4450
|
+
}, _.value, {
|
|
4451
|
+
"value-on-clear": B,
|
|
4440
4452
|
"empty-values": unref(n) ? [null, void 0] : unref(a),
|
|
4441
|
-
"value-key": unref(
|
|
4453
|
+
"value-key": unref(g).format.value,
|
|
4442
4454
|
onChange: E,
|
|
4443
4455
|
class: unref(m).modelValue === "" && unref(n) ? "no-clear" : "",
|
|
4444
4456
|
"popper-options": { modifiers: [{ name: "computeStyles", options: { adaptive: !1 } }] }
|
|
4445
4457
|
}), createSlots({
|
|
4446
4458
|
default: withCtx(() => [
|
|
4447
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
4459
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(y.list, (k) => (openBlock(), createBlock(unref(ElOption), mergeProps({
|
|
4448
4460
|
ref_for: !0,
|
|
4449
|
-
ref: (
|
|
4450
|
-
|
|
4461
|
+
ref: (S) => {
|
|
4462
|
+
S && (D.value[f.index] = S);
|
|
4451
4463
|
},
|
|
4452
|
-
key: k[unref(
|
|
4453
|
-
disabled: k[unref(
|
|
4454
|
-
label: k[unref(
|
|
4455
|
-
value: k[unref(
|
|
4464
|
+
key: k[unref(g).format.value],
|
|
4465
|
+
disabled: k[unref(g).format.disabled],
|
|
4466
|
+
label: k[unref(g).format.label],
|
|
4467
|
+
value: k[unref(g).format.value]
|
|
4456
4468
|
}, C.value), null, 16, ["disabled", "label", "value"]))), 128))
|
|
4457
4469
|
]),
|
|
4458
4470
|
_: 2
|
|
4459
4471
|
}, [
|
|
4460
|
-
renderList(f.$slots, (k,
|
|
4461
|
-
name:
|
|
4472
|
+
renderList(f.$slots, (k, S, O) => ({
|
|
4473
|
+
name: S,
|
|
4462
4474
|
fn: withCtx((V) => [
|
|
4463
|
-
renderSlot(f.$slots,
|
|
4475
|
+
renderSlot(f.$slots, S, mergeProps({ key: O }, V))
|
|
4464
4476
|
])
|
|
4465
4477
|
}))
|
|
4466
4478
|
]), 1040, ["empty-values", "value-key", "class"]));
|
|
@@ -4553,86 +4565,86 @@ const __vite_glob_0_15 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4553
4565
|
}
|
|
4554
4566
|
},
|
|
4555
4567
|
setup(e, { expose: r }) {
|
|
4556
|
-
const d = useAttrs(), t = e, { emptyText: n, dictType: a, dictTreeType: u, dateFormat: o, defaultVal: i, treeSetting: s, formatFun: c, formatFunIn:
|
|
4557
|
-
const
|
|
4558
|
-
return i.value !== void 0 && i.value !== null && (
|
|
4568
|
+
const d = useAttrs(), t = e, { emptyText: n, dictType: a, dictTreeType: u, dateFormat: o, defaultVal: i, treeSetting: s, formatFun: c, formatFunIn: v, formatFunOut: w, spacer: b, maskType: m, maskStart: _, maskEnd: C, maskMiddle: l, maskSymbol: g } = toRefs(t), T = computed(() => {
|
|
4569
|
+
const B = {};
|
|
4570
|
+
return i.value !== void 0 && i.value !== null && (B.defaultVal = i.value), n.value !== void 0 && n.value !== null && (B.emptyText = n.value), c.value !== void 0 && c.value !== null && (B.formatFun = c.value), b.value !== void 0 && b.value !== null && (B.spacer = b.value), B;
|
|
4559
4571
|
}), E = computed(() => {
|
|
4560
|
-
const
|
|
4561
|
-
return i.value !== void 0 && i.value !== null && (
|
|
4562
|
-
}),
|
|
4572
|
+
const B = {};
|
|
4573
|
+
return i.value !== void 0 && i.value !== null && (B.defaultVal = i.value), n.value !== void 0 && n.value !== null && (B.emptyText = n.value), v.value !== void 0 && v.value !== null && (B.formatFunIn = v.value), w.value !== void 0 && w.value !== null && (B.formatFunOut = w.value), s.value !== void 0 && s.value !== null && (B.treeSetting = s.value), b.value !== void 0 && b.value !== null && (B.spacer = b.value), B;
|
|
4574
|
+
}), y = computed(() => !!m.value || !!_.value || !!l.value || !!C.value), x = computed(() => {
|
|
4563
4575
|
if (m.value) {
|
|
4564
4576
|
if (Array.isArray(m.value))
|
|
4565
4577
|
return {
|
|
4566
|
-
start:
|
|
4578
|
+
start: _.value || m.value[0] || 0,
|
|
4567
4579
|
middle: l.value || m.value[1] || 0,
|
|
4568
4580
|
end: C.value || m.value[2] || 0,
|
|
4569
|
-
symbol:
|
|
4581
|
+
symbol: g.value || m.value[3] || "*",
|
|
4570
4582
|
defaultVal: i.value
|
|
4571
4583
|
};
|
|
4572
4584
|
if (typeof m.value == "object") {
|
|
4573
|
-
const
|
|
4574
|
-
start:
|
|
4585
|
+
const B = {
|
|
4586
|
+
start: _.value || 0,
|
|
4575
4587
|
middle: l.value || 0,
|
|
4576
4588
|
end: C.value || 0,
|
|
4577
|
-
symbol:
|
|
4589
|
+
symbol: g.value || "*",
|
|
4578
4590
|
defaultVal: i.value
|
|
4579
4591
|
};
|
|
4580
|
-
return Object.assign(
|
|
4592
|
+
return Object.assign(B, m.value);
|
|
4581
4593
|
} else
|
|
4582
4594
|
return m.value;
|
|
4583
4595
|
} else
|
|
4584
4596
|
return {
|
|
4585
|
-
start:
|
|
4597
|
+
start: _.value || 0,
|
|
4586
4598
|
middle: l.value || 0,
|
|
4587
4599
|
end: C.value || 0,
|
|
4588
|
-
symbol:
|
|
4600
|
+
symbol: g.value || "*",
|
|
4589
4601
|
defaultVal: i.value
|
|
4590
4602
|
};
|
|
4591
|
-
}),
|
|
4592
|
-
return r({ getElTableColumnRef: () => j.value }), (
|
|
4603
|
+
}), N = (B, I = {}) => Array.isArray(B) ? B : typeof B == "string" ? B.split(I.spacer || ",") : typeof B == "number" ? [B] : [], j = ref(null);
|
|
4604
|
+
return r({ getElTableColumnRef: () => j.value }), (B, I) => (openBlock(), createBlock(unref(ElTableColumn), mergeProps({
|
|
4593
4605
|
ref_key: "ElTableColumnRef",
|
|
4594
4606
|
ref: j
|
|
4595
|
-
},
|
|
4596
|
-
default: withCtx((
|
|
4597
|
-
var
|
|
4607
|
+
}, B.$attrs), createSlots({
|
|
4608
|
+
default: withCtx((G) => {
|
|
4609
|
+
var D, A, f, p, k, S, O, V, R, J, P, K;
|
|
4598
4610
|
return [
|
|
4599
4611
|
unref(a) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
4600
|
-
e.dictTypeNode === "button" ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(
|
|
4612
|
+
e.dictTypeNode === "button" ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(N(G.row[(D = unref(d)) == null ? void 0 : D.prop], T.value), (L, M) => (openBlock(), createBlock(_sfc_main$n, {
|
|
4601
4613
|
key: M,
|
|
4602
|
-
modelValue:
|
|
4614
|
+
modelValue: L || "",
|
|
4603
4615
|
dictType: unref(a)
|
|
4604
|
-
}, null, 8, ["modelValue", "dictType"]))), 128)) : e.dictTypeNode === "link" ? (openBlock(!0), createElementBlock(Fragment, { key: 1 }, renderList(
|
|
4616
|
+
}, null, 8, ["modelValue", "dictType"]))), 128)) : e.dictTypeNode === "link" ? (openBlock(!0), createElementBlock(Fragment, { key: 1 }, renderList(N(G.row[(A = unref(d)) == null ? void 0 : A.prop], T.value), (L, M) => (openBlock(), createBlock(_sfc_main$e, {
|
|
4605
4617
|
key: M,
|
|
4606
|
-
modelValue:
|
|
4618
|
+
modelValue: L || "",
|
|
4607
4619
|
dictType: unref(a)
|
|
4608
|
-
}, null, 8, ["modelValue", "dictType"]))), 128)) : e.dictTypeNode === "tag" ? (openBlock(!0), createElementBlock(Fragment, { key: 2 }, renderList(
|
|
4620
|
+
}, null, 8, ["modelValue", "dictType"]))), 128)) : e.dictTypeNode === "tag" ? (openBlock(!0), createElementBlock(Fragment, { key: 2 }, renderList(N(G.row[(f = unref(d)) == null ? void 0 : f.prop], T.value), (L, M) => (openBlock(), createBlock(_sfc_main$f, {
|
|
4609
4621
|
key: M,
|
|
4610
|
-
modelValue:
|
|
4622
|
+
modelValue: L || "",
|
|
4611
4623
|
dictType: unref(a)
|
|
4612
|
-
}, null, 8, ["modelValue", "dictType"]))), 128)) : e.dictTypeNode === "text" ? (openBlock(!0), createElementBlock(Fragment, { key: 3 }, renderList(
|
|
4624
|
+
}, null, 8, ["modelValue", "dictType"]))), 128)) : e.dictTypeNode === "text" ? (openBlock(!0), createElementBlock(Fragment, { key: 3 }, renderList(N(G.row[(p = unref(d)) == null ? void 0 : p.prop], T.value), (L, M) => (openBlock(), createBlock(_sfc_main$d, {
|
|
4613
4625
|
key: M,
|
|
4614
|
-
modelValue:
|
|
4626
|
+
modelValue: L || "",
|
|
4615
4627
|
dictType: unref(a)
|
|
4616
4628
|
}, null, 8, ["modelValue", "dictType"]))), 128)) : (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
4617
|
-
createTextVNode(toDisplayString(unref(GetLabelByCodesFilter)(
|
|
4629
|
+
createTextVNode(toDisplayString(unref(GetLabelByCodesFilter)(G.row[(k = unref(d)) == null ? void 0 : k.prop], unref(a), T.value)), 1)
|
|
4618
4630
|
], 64))
|
|
4619
|
-
], 64)) : unref(u) &&
|
|
4620
|
-
createTextVNode(toDisplayString(unref(GetTreeLabelByCodesFilter)(
|
|
4621
|
-
], 64)) : unref(o) &&
|
|
4622
|
-
createTextVNode(toDisplayString(unref(FormatDate)(
|
|
4623
|
-
], 64)) :
|
|
4624
|
-
createTextVNode(toDisplayString(unref(Desensitization)(
|
|
4631
|
+
], 64)) : unref(u) && G.row[(S = unref(d)) == null ? void 0 : S.prop] ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
4632
|
+
createTextVNode(toDisplayString(unref(GetTreeLabelByCodesFilter)(G.row[(O = unref(d)) == null ? void 0 : O.prop], unref(u), E.value)), 1)
|
|
4633
|
+
], 64)) : unref(o) && G.row[(V = unref(d)) == null ? void 0 : V.prop] ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
4634
|
+
createTextVNode(toDisplayString(unref(FormatDate)(G.row[(R = unref(d)) == null ? void 0 : R.prop], unref(o), unref(i))), 1)
|
|
4635
|
+
], 64)) : y.value && G.row[(J = unref(d)) == null ? void 0 : J.prop] ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
4636
|
+
createTextVNode(toDisplayString(unref(Desensitization)(G.row[(P = unref(d)) == null ? void 0 : P.prop], x.value)), 1)
|
|
4625
4637
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
4626
|
-
createTextVNode(toDisplayString(
|
|
4638
|
+
createTextVNode(toDisplayString(G.row[(K = unref(d)) == null ? void 0 : K.prop] || unref(i)), 1)
|
|
4627
4639
|
], 64))
|
|
4628
4640
|
];
|
|
4629
4641
|
}),
|
|
4630
4642
|
_: 2
|
|
4631
4643
|
}, [
|
|
4632
|
-
renderList(
|
|
4633
|
-
name:
|
|
4644
|
+
renderList(B.$slots, (G, D, A) => ({
|
|
4645
|
+
name: D,
|
|
4634
4646
|
fn: withCtx((f) => [
|
|
4635
|
-
renderSlot(
|
|
4647
|
+
renderSlot(B.$slots, D, mergeProps({ key: A }, f), void 0, !0)
|
|
4636
4648
|
])
|
|
4637
4649
|
}))
|
|
4638
4650
|
]), 1040));
|
|
@@ -4695,74 +4707,74 @@ const __vite_glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4695
4707
|
},
|
|
4696
4708
|
emits: ["dictChange"],
|
|
4697
4709
|
setup(e, { expose: r, emit: d }) {
|
|
4698
|
-
const t = useAttrs(), n = e, { addAllText: a, data: u, format: o, badgeObj: i, dictType: s, disabledObj: c, keyValue:
|
|
4699
|
-
const
|
|
4710
|
+
const t = useAttrs(), n = e, { addAllText: a, data: u, format: o, badgeObj: i, dictType: s, disabledObj: c, keyValue: v, filterDataFun: w, disabledDataFun: b } = toRefs(n), m = computed(() => {
|
|
4711
|
+
const D = {};
|
|
4700
4712
|
return Object.entries(t).forEach(([A, f]) => {
|
|
4701
4713
|
const p = ToKebabCase(A);
|
|
4702
4714
|
if (!p.startsWith("tab-pane-") && !p.startsWith("on-tab-pane-")) {
|
|
4703
4715
|
const k = ToCamelCase(p);
|
|
4704
|
-
|
|
4716
|
+
D[k] = f;
|
|
4705
4717
|
}
|
|
4706
|
-
}),
|
|
4707
|
-
}),
|
|
4708
|
-
const
|
|
4718
|
+
}), D;
|
|
4719
|
+
}), _ = computed(() => {
|
|
4720
|
+
const D = {};
|
|
4709
4721
|
return Object.entries(t).forEach(([A, f]) => {
|
|
4710
4722
|
const p = ToKebabCase(A);
|
|
4711
4723
|
if (p.startsWith("tab-pane-") || p.startsWith("on-tab-pane-")) {
|
|
4712
4724
|
const k = ToCamelCase(p.replace("tab-pane-", ""));
|
|
4713
|
-
|
|
4725
|
+
D[k] = f;
|
|
4714
4726
|
}
|
|
4715
|
-
}),
|
|
4716
|
-
}), C = ref(""), l = toRaw(store.state.dictConfig),
|
|
4727
|
+
}), D;
|
|
4728
|
+
}), C = ref(""), l = toRaw(store.state.dictConfig), g = d, T = (D) => {
|
|
4717
4729
|
window.setTimeout(() => {
|
|
4718
|
-
if (!
|
|
4719
|
-
|
|
4730
|
+
if (!v.value) {
|
|
4731
|
+
g("dictChange", t.modelValue);
|
|
4720
4732
|
return;
|
|
4721
4733
|
}
|
|
4722
4734
|
const A = E.list.find((f) => f[l.format.value] === t.modelValue);
|
|
4723
|
-
|
|
4735
|
+
g("dictChange", A);
|
|
4724
4736
|
}, 0);
|
|
4725
4737
|
}, E = reactive({
|
|
4726
4738
|
list: []
|
|
4727
|
-
}),
|
|
4739
|
+
}), y = async () => {
|
|
4728
4740
|
if (!s.value || u.value && u.value.length > 0)
|
|
4729
4741
|
return;
|
|
4730
|
-
let
|
|
4742
|
+
let D = [];
|
|
4731
4743
|
if (typeof s.value == "object") {
|
|
4732
4744
|
C.value = s.value.type;
|
|
4733
4745
|
const A = await store.actions.getDictDataObj(C.value);
|
|
4734
|
-
|
|
4735
|
-
const { filters: f, filterType: p = l.format.value, reverse: k = !1 } = s.value,
|
|
4736
|
-
k ?
|
|
4746
|
+
D = [].concat(A[C.value]);
|
|
4747
|
+
const { filters: f, filterType: p = l.format.value, reverse: k = !1 } = s.value, S = typeof f == "string" ? f.split(",") : f;
|
|
4748
|
+
k ? D = D.filter((O) => !S.includes(O[p])) : D = D.filter((O) => S.includes(O[p]));
|
|
4737
4749
|
} else {
|
|
4738
4750
|
C.value = s.value;
|
|
4739
4751
|
const A = await store.actions.getDictDataObj(C.value);
|
|
4740
|
-
|
|
4752
|
+
D = [].concat(A[C.value]);
|
|
4741
4753
|
}
|
|
4742
|
-
if (w.value && (
|
|
4743
|
-
|
|
4754
|
+
if (w.value && (D = w.value(D)), b.value)
|
|
4755
|
+
D = D.map((A) => ({
|
|
4744
4756
|
...A,
|
|
4745
4757
|
[l.format.disabled]: b.value(A)
|
|
4746
4758
|
}));
|
|
4747
4759
|
else if (c.value) {
|
|
4748
4760
|
const { disabledValues: A, disabledType: f = l.format.value, reverse: p = !1 } = c.value, k = typeof A == "string" ? A.split(",") : A;
|
|
4749
|
-
p ?
|
|
4750
|
-
const
|
|
4751
|
-
return
|
|
4752
|
-
}) :
|
|
4753
|
-
const
|
|
4754
|
-
return
|
|
4761
|
+
p ? D = D.map((S) => {
|
|
4762
|
+
const O = JSON.parse(JSON.stringify(S));
|
|
4763
|
+
return O[l.format.disabled] = !k.includes(O[f]) || O[l.format.disabled], O;
|
|
4764
|
+
}) : D = D.map((S) => {
|
|
4765
|
+
const O = JSON.parse(JSON.stringify(S));
|
|
4766
|
+
return O[l.format.disabled] = k.includes(O[f]) || O[l.format.disabled], O;
|
|
4755
4767
|
});
|
|
4756
4768
|
}
|
|
4757
|
-
a.value &&
|
|
4769
|
+
a.value && D.unshift({
|
|
4758
4770
|
[l.format.value]: "",
|
|
4759
4771
|
[l.format.label]: a.value
|
|
4760
|
-
}), E.list =
|
|
4761
|
-
}, x = computed(() => store.state.isGettingDictTypes.includes(C.value)),
|
|
4772
|
+
}), E.list = D;
|
|
4773
|
+
}, x = computed(() => store.state.isGettingDictTypes.includes(C.value)), N = computed(() => store.state.isGettingAllDictTypes), j = computed(() => u.value);
|
|
4762
4774
|
watch(
|
|
4763
|
-
[x,
|
|
4764
|
-
([
|
|
4765
|
-
!
|
|
4775
|
+
[x, N, j],
|
|
4776
|
+
([D, A, f]) => {
|
|
4777
|
+
!D && !A && f && f.length === 0 && y(), f.length > 0 && (E.list = JSON.parse(JSON.stringify(f)), E.list.length > 0 && (Object.prototype.toString.call(E.list[0]) === "[object Object]" ? E.list = E.list.map((k) => ({
|
|
4766
4778
|
[l.format.value]: k[o.value.value],
|
|
4767
4779
|
[l.format.label]: k[o.value.label],
|
|
4768
4780
|
[l.format.disabled]: !!k[o.value.disabled],
|
|
@@ -4779,27 +4791,27 @@ const __vite_glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4779
4791
|
immediate: !0
|
|
4780
4792
|
}
|
|
4781
4793
|
);
|
|
4782
|
-
const
|
|
4783
|
-
return r({ getElTabsRef:
|
|
4794
|
+
const F = ref(null), B = () => F.value, I = ref([]);
|
|
4795
|
+
return r({ getElTabsRef: B, getElTabPaneRefs: () => I.value }), (D, A) => {
|
|
4784
4796
|
const f = resolveComponent("el-badge");
|
|
4785
4797
|
return openBlock(), createBlock(unref(ElTabs), mergeProps({
|
|
4786
4798
|
ref_key: "ElTabsRef",
|
|
4787
|
-
ref:
|
|
4799
|
+
ref: F,
|
|
4788
4800
|
class: "vue-element-dict-tabs"
|
|
4789
|
-
}, m.value, { onTabClick:
|
|
4801
|
+
}, m.value, { onTabClick: T }), {
|
|
4790
4802
|
default: withCtx(() => [
|
|
4791
4803
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(E.list, (p) => (openBlock(), createBlock(unref(ElTabPane), mergeProps({
|
|
4792
4804
|
ref_for: !0,
|
|
4793
4805
|
ref: (k) => {
|
|
4794
|
-
k && (
|
|
4806
|
+
k && (I.value[D.index] = k);
|
|
4795
4807
|
},
|
|
4796
4808
|
disabled: p[unref(l).format.disabled],
|
|
4797
4809
|
label: p[unref(l).format.label],
|
|
4798
4810
|
key: p[unref(l).format.value],
|
|
4799
4811
|
name: p[unref(l).format.value]
|
|
4800
|
-
},
|
|
4812
|
+
}, _.value), createSlots({
|
|
4801
4813
|
default: withCtx(() => [
|
|
4802
|
-
renderSlot(
|
|
4814
|
+
renderSlot(D.$slots, p[unref(l).format.value] ? "tabs-item-" + p[unref(l).format.value] : "tabs-item")
|
|
4803
4815
|
]),
|
|
4804
4816
|
_: 2
|
|
4805
4817
|
}, [
|
|
@@ -4868,97 +4880,97 @@ const __vite_glob_0_19 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4868
4880
|
}
|
|
4869
4881
|
},
|
|
4870
4882
|
setup(e, { expose: r }) {
|
|
4871
|
-
const d = useAttrs(), t = e, { maxLevel: n, dictType: a, disabledObj: u, filterDataFun: o, disabledDataFun: i } = toRefs(t), s = ref(""), c = toRaw(store.state.dictConfig),
|
|
4883
|
+
const d = useAttrs(), t = e, { maxLevel: n, dictType: a, disabledObj: u, filterDataFun: o, disabledDataFun: i } = toRefs(t), s = ref(""), c = toRaw(store.state.dictConfig), v = reactive({
|
|
4872
4884
|
list: []
|
|
4873
4885
|
}), w = computed(() => {
|
|
4874
|
-
const
|
|
4875
|
-
valueField: x != null && x.value ? x.value :
|
|
4876
|
-
labelField: x != null && x.label ? x.label :
|
|
4877
|
-
childrenField: x != null && x.children ? x.children :
|
|
4878
|
-
leafField: x != null && x.leaf ? x.leaf :
|
|
4886
|
+
const y = JSON.parse(JSON.stringify(c.treeSetting)), x = d.props || {}, N = {
|
|
4887
|
+
valueField: x != null && x.value ? x.value : y.valueField,
|
|
4888
|
+
labelField: x != null && x.label ? x.label : y.labelField,
|
|
4889
|
+
childrenField: x != null && x.children ? x.children : y.childrenField,
|
|
4890
|
+
leafField: x != null && x.leaf ? x.leaf : y.leafField,
|
|
4879
4891
|
disabled: x != null && x.disabled ? x.disabled : c.format.disabled
|
|
4880
4892
|
};
|
|
4881
|
-
return Object.assign(
|
|
4882
|
-
}), b = (
|
|
4883
|
-
for (let
|
|
4884
|
-
const j =
|
|
4893
|
+
return Object.assign(y, N);
|
|
4894
|
+
}), b = (y, x) => {
|
|
4895
|
+
for (let N = 0; N < y.length; N++) {
|
|
4896
|
+
const j = y[N];
|
|
4885
4897
|
if (j[w.value.levelField] === x) {
|
|
4886
4898
|
delete j[w.value.childrenField], j[w.value.leafField] = !0;
|
|
4887
4899
|
continue;
|
|
4888
4900
|
} else {
|
|
4889
|
-
const
|
|
4890
|
-
b(
|
|
4901
|
+
const B = j[w.value.childrenField];
|
|
4902
|
+
b(B, x);
|
|
4891
4903
|
}
|
|
4892
4904
|
}
|
|
4893
4905
|
}, m = async () => {
|
|
4894
4906
|
if (!a.value)
|
|
4895
4907
|
return;
|
|
4896
|
-
let
|
|
4908
|
+
let y = [];
|
|
4897
4909
|
if (typeof a.value == "object") {
|
|
4898
4910
|
s.value = a.value.type;
|
|
4899
4911
|
const x = await store.actions.getDictDataObj(s.value);
|
|
4900
|
-
|
|
4901
|
-
const { filters:
|
|
4902
|
-
|
|
4912
|
+
y = [].concat(x[s.value]);
|
|
4913
|
+
const { filters: N, filterType: j = c.format.value, reverse: F = !1 } = a.value, B = typeof N == "string" ? N.split(",") : N;
|
|
4914
|
+
F ? y = y.filter((I) => !B.includes(I[j])) : y = y.filter((I) => B.includes(I[j]));
|
|
4903
4915
|
} else {
|
|
4904
4916
|
s.value = a.value;
|
|
4905
4917
|
const x = await store.actions.getDictDataObj(s.value);
|
|
4906
|
-
|
|
4918
|
+
y = [].concat(x[s.value]);
|
|
4907
4919
|
}
|
|
4908
|
-
if (o.value && (
|
|
4909
|
-
|
|
4920
|
+
if (o.value && (y = o.value(y)), i.value)
|
|
4921
|
+
y = y.map((x) => ({
|
|
4910
4922
|
...x,
|
|
4911
4923
|
[c.format.disabled]: i.value(x)
|
|
4912
4924
|
}));
|
|
4913
4925
|
else if (u.value) {
|
|
4914
|
-
const { disabledValues: x, disabledType:
|
|
4915
|
-
j ?
|
|
4916
|
-
const
|
|
4917
|
-
return
|
|
4918
|
-
}) :
|
|
4919
|
-
const
|
|
4920
|
-
return
|
|
4926
|
+
const { disabledValues: x, disabledType: N = c.treeSetting.valueField, reverse: j = !1 } = u.value, F = typeof x == "string" ? x.split(",") : x;
|
|
4927
|
+
j ? y = y.map((B) => {
|
|
4928
|
+
const I = JSON.parse(JSON.stringify(B));
|
|
4929
|
+
return I[c.format.disabled] = !F.includes(I[N]) || I[c.format.disabled], I;
|
|
4930
|
+
}) : y = y.map((B) => {
|
|
4931
|
+
const I = JSON.parse(JSON.stringify(B));
|
|
4932
|
+
return I[c.format.disabled] = F.includes(I[N]) || I[c.format.disabled], I;
|
|
4921
4933
|
});
|
|
4922
4934
|
}
|
|
4923
|
-
|
|
4924
|
-
},
|
|
4925
|
-
const
|
|
4935
|
+
v.list = y;
|
|
4936
|
+
}, _ = computed(() => store.state.isGettingDictTypes.includes(s.value)), C = computed(() => store.state.isGettingAllDictTypes), l = computed(() => {
|
|
4937
|
+
const y = store.state.dictConfig.treeSetting, x = store.state.dictConfig.format, N = d.props ?? {};
|
|
4926
4938
|
return {
|
|
4927
|
-
disabled: (
|
|
4928
|
-
label: (
|
|
4929
|
-
children: (
|
|
4930
|
-
isLeaf: (
|
|
4939
|
+
disabled: (N == null ? void 0 : N.disabled) ?? x.disabled,
|
|
4940
|
+
label: (N == null ? void 0 : N.label) ?? y.labelField,
|
|
4941
|
+
children: (N == null ? void 0 : N.children) ?? y.childrenField,
|
|
4942
|
+
isLeaf: (N == null ? void 0 : N.leaf) ?? y.leafField
|
|
4931
4943
|
};
|
|
4932
|
-
}),
|
|
4933
|
-
if (
|
|
4944
|
+
}), g = computed(() => {
|
|
4945
|
+
if (v.list.length === 0)
|
|
4934
4946
|
return [];
|
|
4935
|
-
const
|
|
4936
|
-
id:
|
|
4937
|
-
...
|
|
4947
|
+
const y = JSON.parse(JSON.stringify(v.list)).map((N) => ({
|
|
4948
|
+
id: N[w.value.valueField],
|
|
4949
|
+
...N
|
|
4938
4950
|
}));
|
|
4939
|
-
let x = ListToTree(
|
|
4951
|
+
let x = ListToTree(y, w.value);
|
|
4940
4952
|
return n.value && b(x, +n.value), x;
|
|
4941
4953
|
});
|
|
4942
4954
|
watch(
|
|
4943
|
-
[
|
|
4944
|
-
([
|
|
4945
|
-
!
|
|
4955
|
+
[_, C],
|
|
4956
|
+
([y, x]) => {
|
|
4957
|
+
!y && !x && m();
|
|
4946
4958
|
},
|
|
4947
4959
|
{
|
|
4948
4960
|
immediate: !0
|
|
4949
4961
|
}
|
|
4950
4962
|
);
|
|
4951
|
-
const
|
|
4952
|
-
return r({ getElTreeRef: () =>
|
|
4963
|
+
const T = ref(null);
|
|
4964
|
+
return r({ getElTreeRef: () => T.value }), (y, x) => (openBlock(), createBlock(unref(ElTree), mergeProps({
|
|
4953
4965
|
ref_key: "ElTreeRef",
|
|
4954
|
-
ref:
|
|
4955
|
-
data:
|
|
4966
|
+
ref: T,
|
|
4967
|
+
data: g.value,
|
|
4956
4968
|
props: l.value
|
|
4957
|
-
},
|
|
4958
|
-
renderList(
|
|
4969
|
+
}, y.$attrs), createSlots({ _: 2 }, [
|
|
4970
|
+
renderList(y.$slots, (N, j, F) => ({
|
|
4959
4971
|
name: j,
|
|
4960
|
-
fn: withCtx((
|
|
4961
|
-
renderSlot(
|
|
4972
|
+
fn: withCtx((B) => [
|
|
4973
|
+
renderSlot(y.$slots, j, mergeProps({ key: F }, B))
|
|
4962
4974
|
])
|
|
4963
4975
|
}))
|
|
4964
4976
|
]), 1040, ["data", "props"]));
|
|
@@ -4999,85 +5011,85 @@ const __vite_glob_0_20 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4999
5011
|
useAttrs();
|
|
5000
5012
|
const d = e, { maxLevel: t, dictType: n, disabledObj: a, filterDataFun: u, disabledDataFun: o } = toRefs(d), i = ref(""), s = toRaw(store.state.dictConfig), c = reactive({
|
|
5001
5013
|
list: []
|
|
5002
|
-
}),
|
|
5003
|
-
const
|
|
5014
|
+
}), v = computed(() => {
|
|
5015
|
+
const T = {
|
|
5004
5016
|
labelField: "label",
|
|
5005
5017
|
valueField: "value",
|
|
5006
5018
|
childrenField: "children",
|
|
5007
5019
|
leafField: s.treeSetting.leafField
|
|
5008
5020
|
}, E = JSON.parse(JSON.stringify(s.treeSetting));
|
|
5009
|
-
return Object.assign(E,
|
|
5010
|
-
}), w = (
|
|
5011
|
-
for (let
|
|
5012
|
-
const x =
|
|
5013
|
-
if (x[
|
|
5014
|
-
delete x[
|
|
5021
|
+
return Object.assign(E, T);
|
|
5022
|
+
}), w = (T, E) => {
|
|
5023
|
+
for (let y = 0; y < T.length; y++) {
|
|
5024
|
+
const x = T[y];
|
|
5025
|
+
if (x[v.value.levelField] === E) {
|
|
5026
|
+
delete x[v.value.childrenField], x[v.value.leafField] = !0;
|
|
5015
5027
|
continue;
|
|
5016
5028
|
} else {
|
|
5017
|
-
const j = x[
|
|
5029
|
+
const j = x[v.value.childrenField];
|
|
5018
5030
|
w(j, E);
|
|
5019
5031
|
}
|
|
5020
5032
|
}
|
|
5021
5033
|
}, b = async () => {
|
|
5022
5034
|
if (!n.value)
|
|
5023
5035
|
return;
|
|
5024
|
-
let
|
|
5036
|
+
let T = [];
|
|
5025
5037
|
if (typeof n.value == "object") {
|
|
5026
5038
|
i.value = n.value.type;
|
|
5027
5039
|
const E = await store.actions.getDictDataObj(i.value);
|
|
5028
|
-
|
|
5029
|
-
const { filters:
|
|
5030
|
-
|
|
5040
|
+
T = [].concat(E[i.value]);
|
|
5041
|
+
const { filters: y, filterType: x = s.format.value, reverse: N = !1 } = n.value, j = typeof y == "string" ? y.split(",") : y;
|
|
5042
|
+
N ? T = T.filter((F) => !j.includes(F[x])) : T = T.filter((F) => j.includes(F[x]));
|
|
5031
5043
|
} else {
|
|
5032
5044
|
i.value = n.value;
|
|
5033
5045
|
const E = await store.actions.getDictDataObj(i.value);
|
|
5034
|
-
|
|
5046
|
+
T = [].concat(E[i.value]);
|
|
5035
5047
|
}
|
|
5036
|
-
if (u.value && (
|
|
5037
|
-
|
|
5048
|
+
if (u.value && (T = u.value(T)), o.value)
|
|
5049
|
+
T = T.map((E) => ({
|
|
5038
5050
|
...E,
|
|
5039
5051
|
[s.format.disabled]: o.value(E)
|
|
5040
5052
|
}));
|
|
5041
5053
|
else if (a.value) {
|
|
5042
|
-
const { disabledValues: E, disabledType:
|
|
5043
|
-
x ?
|
|
5044
|
-
const
|
|
5045
|
-
return
|
|
5046
|
-
}) :
|
|
5047
|
-
const
|
|
5048
|
-
return
|
|
5054
|
+
const { disabledValues: E, disabledType: y = s.treeSetting.valueField, reverse: x = !1 } = a.value, N = typeof E == "string" ? E.split(",") : E;
|
|
5055
|
+
x ? T = T.map((j) => {
|
|
5056
|
+
const F = JSON.parse(JSON.stringify(j));
|
|
5057
|
+
return F[s.format.disabled] = !N.includes(F[y]) || F[s.format.disabled], F;
|
|
5058
|
+
}) : T = T.map((j) => {
|
|
5059
|
+
const F = JSON.parse(JSON.stringify(j));
|
|
5060
|
+
return F[s.format.disabled] = N.includes(F[y]) || F[s.format.disabled], F;
|
|
5049
5061
|
});
|
|
5050
5062
|
}
|
|
5051
|
-
c.list =
|
|
5052
|
-
}, m = computed(() => store.state.isGettingDictTypes.includes(i.value)),
|
|
5053
|
-
const
|
|
5054
|
-
label:
|
|
5055
|
-
value:
|
|
5056
|
-
children:
|
|
5057
|
-
...
|
|
5063
|
+
c.list = T;
|
|
5064
|
+
}, m = computed(() => store.state.isGettingDictTypes.includes(i.value)), _ = computed(() => store.state.isGettingAllDictTypes), C = computed(() => {
|
|
5065
|
+
const T = JSON.parse(JSON.stringify(c.list)).map((y) => ({
|
|
5066
|
+
label: y[v.value.labelField],
|
|
5067
|
+
value: y[v.value.valueField],
|
|
5068
|
+
children: y[v.value.childrenField],
|
|
5069
|
+
...y
|
|
5058
5070
|
}));
|
|
5059
|
-
let E = ListToTree(
|
|
5071
|
+
let E = ListToTree(T, v.value);
|
|
5060
5072
|
return t.value && w(E, +t.value), E;
|
|
5061
5073
|
});
|
|
5062
5074
|
watch(
|
|
5063
|
-
[m,
|
|
5064
|
-
([
|
|
5065
|
-
!
|
|
5075
|
+
[m, _],
|
|
5076
|
+
([T, E]) => {
|
|
5077
|
+
!T && !E && b();
|
|
5066
5078
|
},
|
|
5067
5079
|
{
|
|
5068
5080
|
immediate: !0
|
|
5069
5081
|
}
|
|
5070
5082
|
);
|
|
5071
5083
|
const l = ref(null);
|
|
5072
|
-
return r({ getElTreeSelectRef: () => l.value }), (
|
|
5084
|
+
return r({ getElTreeSelectRef: () => l.value }), (T, E) => (openBlock(), createBlock(unref(ElTreeSelect), mergeProps({
|
|
5073
5085
|
ref_key: "ElTreeSelectRef",
|
|
5074
5086
|
ref: l,
|
|
5075
5087
|
data: C.value
|
|
5076
|
-
},
|
|
5077
|
-
renderList(
|
|
5088
|
+
}, T.$attrs, { "popper-options": { modifiers: [{ name: "computeStyles", options: { adaptive: !1 } }] } }), createSlots({ _: 2 }, [
|
|
5089
|
+
renderList(T.$slots, (y, x, N) => ({
|
|
5078
5090
|
name: x,
|
|
5079
5091
|
fn: withCtx((j) => [
|
|
5080
|
-
renderSlot(
|
|
5092
|
+
renderSlot(T.$slots, x, mergeProps({ key: N }, j))
|
|
5081
5093
|
])
|
|
5082
5094
|
}))
|
|
5083
5095
|
]), 1040, ["data"]));
|
|
@@ -5195,8 +5207,8 @@ async function getDictCodeReq(e, r) {
|
|
|
5195
5207
|
const s = store.state.dictCodes;
|
|
5196
5208
|
o = u;
|
|
5197
5209
|
const c = { ...s };
|
|
5198
|
-
o.forEach((
|
|
5199
|
-
c.hasOwnProperty(
|
|
5210
|
+
o.forEach((v) => {
|
|
5211
|
+
c.hasOwnProperty(v) && delete c[v];
|
|
5200
5212
|
}), store.mutations.SET_DICT_CODES(c), e.storage.setItem(e.dictDataKey, JSON.stringify(c));
|
|
5201
5213
|
} else if (u.length > 0)
|
|
5202
5214
|
for (let s = 0; s < u.length; s++)
|
|
@@ -5207,14 +5219,14 @@ async function getDictCodeReq(e, r) {
|
|
|
5207
5219
|
store.mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!0);
|
|
5208
5220
|
const c = await e.getDictCodeApi(e.formatterRequest(e.query, s));
|
|
5209
5221
|
store.mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!1);
|
|
5210
|
-
const
|
|
5222
|
+
const v = e.formatterDictList(c, s), w = e.formatterDictVersion(c);
|
|
5211
5223
|
e.storage.setItem(e.versionKey, w);
|
|
5212
|
-
const b = Object.assign(store.state.dictCodes,
|
|
5224
|
+
const b = Object.assign(store.state.dictCodes, v), m = formatDictData(b, e.filterDataFun, e.disabledDataFun, (i = e == null ? void 0 : e.format) == null ? void 0 : i.disabled);
|
|
5213
5225
|
store.mutations.SET_DICT_CODES(m), e.storage.setItem(e.dictDataKey, JSON.stringify(m));
|
|
5214
5226
|
} else if (o.length > 0)
|
|
5215
5227
|
for (let c = 0; c < o.length; c++) {
|
|
5216
|
-
const
|
|
5217
|
-
store.actions.getDictDataObj(
|
|
5228
|
+
const v = o[c];
|
|
5229
|
+
store.actions.getDictDataObj(v);
|
|
5218
5230
|
}
|
|
5219
5231
|
}
|
|
5220
5232
|
}
|
|
@@ -5222,13 +5234,13 @@ let vue3ElementDict = {
|
|
|
5222
5234
|
async install(e, r) {
|
|
5223
5235
|
var b, m;
|
|
5224
5236
|
const d = console.warn;
|
|
5225
|
-
console.warn = (...
|
|
5226
|
-
const C = typeof
|
|
5227
|
-
C.includes("formItemContextKey") || C.includes("formContextKey") || d.apply(console,
|
|
5237
|
+
console.warn = (..._) => {
|
|
5238
|
+
const C = typeof _[0] == "string" ? _[0] : "";
|
|
5239
|
+
C.includes("formItemContextKey") || C.includes("formContextKey") || d.apply(console, _);
|
|
5228
5240
|
};
|
|
5229
5241
|
const t = e.config.warnHandler;
|
|
5230
|
-
e.config.warnHandler = (
|
|
5231
|
-
typeof
|
|
5242
|
+
e.config.warnHandler = (_, C, l) => {
|
|
5243
|
+
typeof _ == "string" && (_.includes("formItemContextKey") || _.includes("formContextKey")) || t == null || t(_, C, l);
|
|
5232
5244
|
};
|
|
5233
5245
|
const n = {
|
|
5234
5246
|
timeout: 3e4,
|
|
@@ -5266,9 +5278,9 @@ let vue3ElementDict = {
|
|
|
5266
5278
|
getLoginStatusFunc: () => !0,
|
|
5267
5279
|
loginStatusChangeFunc: null,
|
|
5268
5280
|
//组件过滤数据 配置
|
|
5269
|
-
filterDataFun: (
|
|
5281
|
+
filterDataFun: (_) => _,
|
|
5270
5282
|
//组件禁用数据 配置
|
|
5271
|
-
disabledDataFun: (
|
|
5283
|
+
disabledDataFun: (_) => !1,
|
|
5272
5284
|
//配置数组数据转化成树形数据
|
|
5273
5285
|
treeSetting: {
|
|
5274
5286
|
idField: "id",
|
|
@@ -5304,9 +5316,9 @@ let vue3ElementDict = {
|
|
|
5304
5316
|
type: "type",
|
|
5305
5317
|
color: "color"
|
|
5306
5318
|
},
|
|
5307
|
-
formatterRequest: (
|
|
5308
|
-
formatterDictList: (
|
|
5309
|
-
formatterDictVersion: (
|
|
5319
|
+
formatterRequest: (_, C) => C ? { [_]: C } : { [_]: "" },
|
|
5320
|
+
formatterDictList: (_, C) => !_ || !_.dictData ? {} : _.dictData,
|
|
5321
|
+
formatterDictVersion: (_) => !_ || !_.version ? "unknow" : _.version,
|
|
5310
5322
|
version: "unknow",
|
|
5311
5323
|
storage: localStorage,
|
|
5312
5324
|
isGetAll: !1,
|
|
@@ -5320,10 +5332,10 @@ let vue3ElementDict = {
|
|
|
5320
5332
|
store.mutations.SET_DICT_SETTING(a);
|
|
5321
5333
|
let u = {};
|
|
5322
5334
|
try {
|
|
5323
|
-
const
|
|
5324
|
-
u =
|
|
5325
|
-
} catch (
|
|
5326
|
-
u = {}, console.log(
|
|
5335
|
+
const _ = a.storage.getItem(a.dictDataKey);
|
|
5336
|
+
u = _ ? JSON.parse(_) : {};
|
|
5337
|
+
} catch (_) {
|
|
5338
|
+
u = {}, console.log(_);
|
|
5327
5339
|
}
|
|
5328
5340
|
let o = JSON.parse(JSON.stringify(a.localDictCodes));
|
|
5329
5341
|
o = Object.assign(u, o);
|
|
@@ -5332,30 +5344,30 @@ let vue3ElementDict = {
|
|
|
5332
5344
|
const s = a.storage.getItem(a.versionKey);
|
|
5333
5345
|
let c = a.usuallyGetDictTypes ? a.usuallyGetDictTypes.split(",") : [];
|
|
5334
5346
|
if (a.version !== s) {
|
|
5335
|
-
const
|
|
5347
|
+
const _ = a.storage.getItem(a.dictDataKey);
|
|
5336
5348
|
let C = {};
|
|
5337
5349
|
try {
|
|
5338
|
-
C =
|
|
5350
|
+
C = _ ? JSON.parse(_) : {};
|
|
5339
5351
|
} catch {
|
|
5340
5352
|
C = {}, console.error();
|
|
5341
5353
|
}
|
|
5342
|
-
const l = C ? Object.keys(C) : [],
|
|
5354
|
+
const l = C ? Object.keys(C) : [], g = a.localDictCodes ? Object.keys(a.localDictCodes) : [], T = l.filter((N) => !g.includes(N)), E = [...c, ...T];
|
|
5343
5355
|
c = [...new Set(E)], a.storage.removeItem(a.dictDataKey), a.storage.setItem(a.versionKey, a.version);
|
|
5344
|
-
const
|
|
5356
|
+
const y = JSON.parse(JSON.stringify(a.localDictCodes)), x = formatDictData(y, a.filterDataFun, a.disabledDataFun, (m = a == null ? void 0 : a.format) == null ? void 0 : m.disabled);
|
|
5345
5357
|
a.storage.setItem(a.dictDataKey, JSON.stringify(x)), store.mutations.SET_DICT_CODES(x);
|
|
5346
5358
|
}
|
|
5347
|
-
a.getLoginStatusFunc() && (a.isGetAll || c.length > 0) && getDictCodeReq(a, c), components.forEach((
|
|
5348
|
-
const C =
|
|
5349
|
-
e.component(l,
|
|
5359
|
+
a.getLoginStatusFunc() && (a.isGetAll || c.length > 0) && getDictCodeReq(a, c), components.forEach((_) => {
|
|
5360
|
+
const C = _.name.slice(4), l = a.componentsPreFix + C;
|
|
5361
|
+
e.component(l, _);
|
|
5350
5362
|
});
|
|
5351
|
-
const
|
|
5363
|
+
const v = reactive({
|
|
5352
5364
|
hadLogin: computed(() => store.state.dictConfig.getLoginStatusFunc())
|
|
5353
5365
|
});
|
|
5354
5366
|
(() => {
|
|
5355
5367
|
loginWatcher && (loginWatcher(), loginWatcher = null), loginWatcher = watch(
|
|
5356
|
-
() =>
|
|
5357
|
-
(
|
|
5358
|
-
a.loginStatusChangeFunc && a.loginStatusChangeFunc(
|
|
5368
|
+
() => v.hadLogin,
|
|
5369
|
+
(_) => {
|
|
5370
|
+
a.loginStatusChangeFunc && a.loginStatusChangeFunc(_), _ && (a.isGetAll || c.length > 0) && getDictCodeReq(a, c);
|
|
5359
5371
|
},
|
|
5360
5372
|
{ immediate: !1 }
|
|
5361
5373
|
);
|