vue3-element-dict 3.3.4 → 3.3.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 +4 -0
- package/lib/vue3-element-dict.js +1269 -1200
- package/package.json +1 -1
package/lib/vue3-element-dict.js
CHANGED
|
@@ -2,79 +2,79 @@ import { reactive, ref, watch, nextTick, onMounted, onBeforeUnmount, createEleme
|
|
|
2
2
|
import { ElAutocomplete, 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
3
|
import { ArrowDown } from "@element-plus/icons-vue";
|
|
4
4
|
const formatDictData = (e, r, c, t) => {
|
|
5
|
-
const
|
|
6
|
-
for (let
|
|
7
|
-
n
|
|
5
|
+
const l = {};
|
|
6
|
+
for (let n in e)
|
|
7
|
+
l[n] = r(e[n]).map((u) => ({
|
|
8
8
|
...u,
|
|
9
9
|
[t]: c(u) || !!u[t]
|
|
10
10
|
}));
|
|
11
|
-
return
|
|
11
|
+
return l;
|
|
12
12
|
};
|
|
13
13
|
function sortComponentsByIdDependencies(e) {
|
|
14
14
|
const r = (b) => {
|
|
15
|
-
const _ = /* @__PURE__ */ new Set(),
|
|
15
|
+
const _ = /* @__PURE__ */ new Set(), o = /\$\{(\w+)\}/g;
|
|
16
16
|
let v;
|
|
17
|
-
for (; (v =
|
|
17
|
+
for (; (v = o.exec(b)) !== null; )
|
|
18
18
|
_.add(v[1]);
|
|
19
19
|
return Array.from(_);
|
|
20
20
|
}, c = (b) => {
|
|
21
|
-
const _ = /* @__PURE__ */ new Set(),
|
|
22
|
-
typeof v == "string" ? r(v).forEach((T) => _.add(T)) : Array.isArray(v) ? v.forEach(
|
|
21
|
+
const _ = /* @__PURE__ */ new Set(), o = (v) => {
|
|
22
|
+
typeof v == "string" ? r(v).forEach((T) => _.add(T)) : Array.isArray(v) ? v.forEach(o) : v && typeof v == "object" && Object.values(v).forEach(o);
|
|
23
23
|
};
|
|
24
|
-
return
|
|
24
|
+
return o(b), Array.from(_);
|
|
25
25
|
}, t = (b) => {
|
|
26
|
-
const { showRuleType: _, showRules:
|
|
27
|
-
return
|
|
26
|
+
const { showRuleType: _, showRules: o } = b, v = /* @__PURE__ */ new Set();
|
|
27
|
+
return o == null ? [] : (_ === "validate" ? typeof o == "string" ? v.add(o) : Array.isArray(o) && o.forEach((T) => {
|
|
28
28
|
typeof T == "string" && v.add(T);
|
|
29
|
-
}) : ["compare", "calculate", ""].includes(_) ? c(
|
|
29
|
+
}) : ["compare", "calculate", ""].includes(_) ? c(o).forEach((T) => v.add(T)) : typeof _ == "string" && Array.isArray(o) && o.forEach((T) => {
|
|
30
30
|
T && typeof T == "object" && "rules" in T && c(T.rules).forEach((w) => v.add(w));
|
|
31
31
|
}), Array.from(v));
|
|
32
|
-
},
|
|
33
|
-
const { validatorRuleType: _, props:
|
|
34
|
-
return
|
|
32
|
+
}, l = (b) => {
|
|
33
|
+
const { validatorRuleType: _, props: o } = b, v = /* @__PURE__ */ new Set();
|
|
34
|
+
return o != null && o.rules ? (o.rules.forEach((T) => {
|
|
35
35
|
if (!(T != null && T.validator))
|
|
36
36
|
return;
|
|
37
37
|
const w = T.validator;
|
|
38
38
|
w != null && (["compare", "calculate", "", void 0].includes(_) ? c(w).forEach((y) => v.add(y)) : typeof _ == "string" && Array.isArray(w) && w.forEach((y) => {
|
|
39
|
-
y && typeof y == "object" && "rules" in y && c(y.rules).forEach((
|
|
39
|
+
y && typeof y == "object" && "rules" in y && c(y.rules).forEach((A) => v.add(A));
|
|
40
40
|
}));
|
|
41
41
|
}), Array.from(v)) : [];
|
|
42
|
-
},
|
|
42
|
+
}, n = /* @__PURE__ */ new Map();
|
|
43
43
|
e.forEach((b) => {
|
|
44
|
-
b.fieldName && b.id &&
|
|
44
|
+
b.fieldName && b.id && n.set(b.fieldName, b.id);
|
|
45
45
|
});
|
|
46
46
|
const u = e.map((b) => {
|
|
47
|
-
const _ = t(b),
|
|
47
|
+
const _ = t(b), o = l(b), T = [.../* @__PURE__ */ new Set([..._, ...o])].map((w) => n.get(w)).filter((w) => w !== void 0 && e.some((y) => y.id === w));
|
|
48
48
|
return {
|
|
49
49
|
id: b.id,
|
|
50
50
|
component: b,
|
|
51
51
|
depsIds: T
|
|
52
52
|
// 该组件id依赖的其他id数组
|
|
53
53
|
};
|
|
54
|
-
}), i = new Set(u.map((b) => b.id)),
|
|
54
|
+
}), i = new Set(u.map((b) => b.id)), a = /* @__PURE__ */ new Map();
|
|
55
55
|
u.forEach(({ id: b }, _) => {
|
|
56
|
-
|
|
56
|
+
a.set(b, _);
|
|
57
57
|
});
|
|
58
|
-
const
|
|
58
|
+
const s = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
|
|
59
59
|
i.forEach((b) => {
|
|
60
|
-
|
|
60
|
+
s.set(b, []), d.set(b, 0);
|
|
61
61
|
}), u.forEach(({ id: b, depsIds: _ }) => {
|
|
62
|
-
_.forEach((
|
|
63
|
-
|
|
62
|
+
_.forEach((o) => {
|
|
63
|
+
s.get(o).push(b), d.set(b, d.get(b) + 1);
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
|
-
const g = [...i].filter((b) => d.get(b) === 0).sort((b, _) =>
|
|
66
|
+
const g = [...i].filter((b) => d.get(b) === 0).sort((b, _) => a.get(b) - a.get(_)), O = [];
|
|
67
67
|
for (; g.length > 0; ) {
|
|
68
68
|
const b = g.shift();
|
|
69
|
-
O.push(b),
|
|
69
|
+
O.push(b), s.get(b).forEach((_) => {
|
|
70
70
|
if (d.set(_, d.get(_) - 1), d.get(_) === 0) {
|
|
71
|
-
const
|
|
72
|
-
|
|
71
|
+
const o = g.findIndex((v) => a.get(v) > a.get(_));
|
|
72
|
+
o === -1 ? g.push(_) : g.splice(o, 0, _);
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
const m = [...i].filter((b) => !O.includes(b));
|
|
77
|
-
m.sort((b, _) =>
|
|
77
|
+
m.sort((b, _) => a.get(b) - a.get(_)), O.push(...m);
|
|
78
78
|
const p = new Map(e.map((b) => [b.id, b]));
|
|
79
79
|
return O.map((b) => p.get(b));
|
|
80
80
|
}
|
|
@@ -184,12 +184,12 @@ const actions = {
|
|
|
184
184
|
getDictDataObj(e) {
|
|
185
185
|
return new Promise((r, c) => {
|
|
186
186
|
e || c("字典类型不能为空");
|
|
187
|
-
const { delayTime: t, getLoginStatusFunc:
|
|
188
|
-
if (!
|
|
187
|
+
const { delayTime: t, getLoginStatusFunc: l, localDictCodes: n } = state.dictConfig;
|
|
188
|
+
if (!l()) {
|
|
189
189
|
c("请先登录");
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
|
-
const u = state.dictCodes ||
|
|
192
|
+
const u = state.dictCodes || n;
|
|
193
193
|
if (!u[e] || u[e].length === 0) {
|
|
194
194
|
if (state.isGettingDictTypes.includes(e) || state.isGettingAllDictTypes)
|
|
195
195
|
return;
|
|
@@ -211,12 +211,12 @@ const actions = {
|
|
|
211
211
|
return new Promise((r, c) => {
|
|
212
212
|
const {
|
|
213
213
|
delayTime: t,
|
|
214
|
-
storage:
|
|
215
|
-
dictDataKey:
|
|
214
|
+
storage: l,
|
|
215
|
+
dictDataKey: n,
|
|
216
216
|
getDictCodeApi: u,
|
|
217
217
|
usuallyGetDictTypes: i,
|
|
218
|
-
formatterRequest:
|
|
219
|
-
query:
|
|
218
|
+
formatterRequest: a,
|
|
219
|
+
query: s,
|
|
220
220
|
versionKey: d,
|
|
221
221
|
localDictCodes: g,
|
|
222
222
|
formatterDictList: O,
|
|
@@ -224,36 +224,36 @@ const actions = {
|
|
|
224
224
|
isGetAll: p,
|
|
225
225
|
filterDataFun: b,
|
|
226
226
|
disabledDataFun: _,
|
|
227
|
-
format:
|
|
227
|
+
format: o
|
|
228
228
|
} = state.dictConfig, v = state.dictCodes || g, T = !t && t !== 0 ? e : state.isGettingDictTypes.join(",");
|
|
229
|
-
u(s
|
|
229
|
+
u(a(s, T)).then((w) => {
|
|
230
230
|
mutations.REMOVE_IS_GETTING_DICT_TYPES(T);
|
|
231
|
-
const y = m(w),
|
|
232
|
-
if (y !==
|
|
231
|
+
const y = m(w), A = l.getItem(d);
|
|
232
|
+
if (y !== A) {
|
|
233
233
|
let V = "";
|
|
234
234
|
if (p)
|
|
235
235
|
V = "", mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!0);
|
|
236
236
|
else {
|
|
237
237
|
if (i) {
|
|
238
|
-
const
|
|
239
|
-
let C = L.concat(
|
|
238
|
+
const x = Object.keys(v), F = i.split(","), B = Object.keys(g), L = x.filter((S) => !B.includes(S)), I = F.filter((S) => B.includes(S) ? (console.warn(`注意:usuallyGetDictTypes配置与本地字典配置的字典类型${S}冲突`), !1) : !0);
|
|
239
|
+
let C = L.concat(I);
|
|
240
240
|
C = C.concat(T.split(",")), V = Array.from(new Set(C)).join(",");
|
|
241
241
|
} else {
|
|
242
|
-
const
|
|
243
|
-
let B =
|
|
242
|
+
const x = Object.keys(v), F = Object.keys(g);
|
|
243
|
+
let B = x.filter((I) => !F.includes(I));
|
|
244
244
|
B = B.concat(T.split(",")), V = Array.from(new Set(B)).join(",");
|
|
245
245
|
}
|
|
246
246
|
mutations.ADD_IS_GETTING_DICT_TYPES(V);
|
|
247
247
|
}
|
|
248
|
-
u(s
|
|
249
|
-
const F = O(
|
|
248
|
+
u(a(s, V)).then((x) => {
|
|
249
|
+
const F = O(x, e);
|
|
250
250
|
if (!(F[e] && F[e].length > 0)) {
|
|
251
251
|
c(`不存在类型为:${e} 的字典字段,请确认后再填写`);
|
|
252
252
|
return;
|
|
253
253
|
}
|
|
254
254
|
mutations.REMOVE_UNFIND_DICT_TYPES(T);
|
|
255
|
-
const B = m(
|
|
256
|
-
|
|
255
|
+
const B = m(x), L = Object.assign(JSON.parse(JSON.stringify(g)), F), I = formatDictData(L, b, _, o == null ? void 0 : o.disabled);
|
|
256
|
+
l.setItem(n, JSON.stringify(I)), l.setItem(d, B), mutations.SET_DICT_CODES(I), r(state.dictCodes), state.isGettingAllDictTypes ? mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!1) : mutations.REMOVE_IS_GETTING_DICT_TYPES(V);
|
|
257
257
|
});
|
|
258
258
|
} else {
|
|
259
259
|
const V = O(w, e);
|
|
@@ -262,8 +262,8 @@ const actions = {
|
|
|
262
262
|
return;
|
|
263
263
|
}
|
|
264
264
|
mutations.REMOVE_UNFIND_DICT_TYPES(T);
|
|
265
|
-
const
|
|
266
|
-
Object.assign(
|
|
265
|
+
const x = state.dictCodes || g, F = formatDictData(V, b, _, o == null ? void 0 : o.disabled);
|
|
266
|
+
Object.assign(x, F), l.setItem(n, JSON.stringify(x)), mutations.SET_DICT_CODES(x), r(state.dictCodes);
|
|
267
267
|
}
|
|
268
268
|
});
|
|
269
269
|
});
|
|
@@ -274,8 +274,8 @@ const actions = {
|
|
|
274
274
|
actions
|
|
275
275
|
}, _export_sfc = (e, r) => {
|
|
276
276
|
const c = e.__vccOpts || e;
|
|
277
|
-
for (const [t,
|
|
278
|
-
c[t] =
|
|
277
|
+
for (const [t, l] of r)
|
|
278
|
+
c[t] = l;
|
|
279
279
|
return c;
|
|
280
280
|
}, _sfc_main$p = /* @__PURE__ */ Object.assign({ name: "DictAutoHeight" }, {
|
|
281
281
|
__name: "index",
|
|
@@ -324,7 +324,7 @@ const actions = {
|
|
|
324
324
|
},
|
|
325
325
|
setup(e) {
|
|
326
326
|
const r = e, c = ref(null), t = ref(null);
|
|
327
|
-
let
|
|
327
|
+
let l = null, n = null;
|
|
328
328
|
function u(m) {
|
|
329
329
|
if (m == null || m === "")
|
|
330
330
|
return 0;
|
|
@@ -343,10 +343,10 @@ const actions = {
|
|
|
343
343
|
const _ = b.value;
|
|
344
344
|
_ instanceof HTMLElement ? p.push(_) : _ && _.$el instanceof HTMLElement && p.push(_.$el);
|
|
345
345
|
} else
|
|
346
|
-
b && b.$el instanceof HTMLElement ? p.push(b.$el) : typeof b == "string" && document.querySelectorAll(b).forEach((
|
|
346
|
+
b && b.$el instanceof HTMLElement ? p.push(b.$el) : typeof b == "string" && document.querySelectorAll(b).forEach((o) => p.push(o));
|
|
347
347
|
return p;
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function a(m) {
|
|
350
350
|
let p = 0;
|
|
351
351
|
for (const b of m) {
|
|
352
352
|
const _ = b.getBoundingClientRect();
|
|
@@ -354,35 +354,35 @@ const actions = {
|
|
|
354
354
|
}
|
|
355
355
|
return p;
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function s() {
|
|
358
358
|
const m = c.value;
|
|
359
359
|
if (!m)
|
|
360
360
|
return;
|
|
361
361
|
const p = u(r.minHeight), b = u(r.offset), _ = m.getBoundingClientRect();
|
|
362
|
-
let
|
|
363
|
-
const v = i(r.excludeDoms), T =
|
|
364
|
-
|
|
362
|
+
let o = Math.floor(_.height);
|
|
363
|
+
const v = i(r.excludeDoms), T = a(v);
|
|
364
|
+
o = Math.floor(o - T - b), o = Math.max(o, p), t.value = o;
|
|
365
365
|
}
|
|
366
366
|
function d() {
|
|
367
|
-
|
|
367
|
+
n && clearTimeout(n), n = setTimeout(s, r.debounceDelay);
|
|
368
368
|
}
|
|
369
369
|
function g() {
|
|
370
370
|
O();
|
|
371
371
|
const m = i(r.listenDoms);
|
|
372
|
-
m.length !== 0 && (
|
|
372
|
+
m.length !== 0 && (l = new ResizeObserver(() => {
|
|
373
373
|
d();
|
|
374
374
|
}), m.forEach((p) => {
|
|
375
|
-
|
|
375
|
+
l.observe(p);
|
|
376
376
|
}));
|
|
377
377
|
}
|
|
378
378
|
function O() {
|
|
379
|
-
|
|
379
|
+
l && (l.disconnect(), l = null);
|
|
380
380
|
}
|
|
381
381
|
return watch(
|
|
382
382
|
() => r.listenDoms,
|
|
383
383
|
() => {
|
|
384
384
|
nextTick(() => {
|
|
385
|
-
|
|
385
|
+
s(), g();
|
|
386
386
|
});
|
|
387
387
|
},
|
|
388
388
|
{ deep: !0 }
|
|
@@ -390,7 +390,7 @@ const actions = {
|
|
|
390
390
|
() => r.excludeDoms,
|
|
391
391
|
() => {
|
|
392
392
|
nextTick(() => {
|
|
393
|
-
|
|
393
|
+
s();
|
|
394
394
|
});
|
|
395
395
|
},
|
|
396
396
|
{ deep: !0 }
|
|
@@ -398,10 +398,10 @@ const actions = {
|
|
|
398
398
|
d();
|
|
399
399
|
}), onMounted(() => {
|
|
400
400
|
nextTick(() => {
|
|
401
|
-
|
|
401
|
+
s(), g(), window.addEventListener("resize", d);
|
|
402
402
|
});
|
|
403
403
|
}), onBeforeUnmount(() => {
|
|
404
|
-
O(),
|
|
404
|
+
O(), n && clearTimeout(n), window.removeEventListener("resize", d);
|
|
405
405
|
}), (m, p) => (openBlock(), createElementBlock("div", {
|
|
406
406
|
class: "auto-height-wrapper",
|
|
407
407
|
ref_key: "wrapperRef",
|
|
@@ -436,45 +436,45 @@ const __vite_glob_0_0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
436
436
|
},
|
|
437
437
|
emits: ["update:modelValue", "select"],
|
|
438
438
|
setup(e, { emit: r }) {
|
|
439
|
-
const c = e, t = r,
|
|
439
|
+
const c = e, t = r, l = ref(null), n = computed({
|
|
440
440
|
get() {
|
|
441
441
|
return c.modelValue;
|
|
442
442
|
},
|
|
443
|
-
set(
|
|
444
|
-
t("update:modelValue",
|
|
443
|
+
set(a) {
|
|
444
|
+
t("update:modelValue", a);
|
|
445
445
|
}
|
|
446
446
|
});
|
|
447
|
-
function u(
|
|
447
|
+
function u(a, s) {
|
|
448
448
|
let d = [];
|
|
449
|
-
if (!
|
|
450
|
-
|
|
449
|
+
if (!a) {
|
|
450
|
+
s(d);
|
|
451
451
|
return;
|
|
452
452
|
}
|
|
453
|
-
const g =
|
|
453
|
+
const g = a.indexOf("@");
|
|
454
454
|
if (g !== -1) {
|
|
455
|
-
const O =
|
|
456
|
-
d = c.domains.filter((p) => p.startsWith(m)).map((p) => ({ value: O + p })), d.length === 0 && d.push({ value:
|
|
455
|
+
const O = a.slice(0, g + 1).replaceAll(" ", ""), m = a.slice(g + 1);
|
|
456
|
+
d = c.domains.filter((p) => p.startsWith(m)).map((p) => ({ value: O + p })), d.length === 0 && d.push({ value: a });
|
|
457
457
|
}
|
|
458
|
-
|
|
458
|
+
s(d), d.length > 0 && l.value && (l.value.activated = !0);
|
|
459
459
|
}
|
|
460
|
-
function i(
|
|
461
|
-
|
|
460
|
+
function i(a) {
|
|
461
|
+
n.value = a.value, t("select");
|
|
462
462
|
}
|
|
463
|
-
return (
|
|
463
|
+
return (a, s) => (openBlock(), createBlock(unref(ElAutocomplete), mergeProps({
|
|
464
464
|
ref_key: "elAutocompleteRef",
|
|
465
|
-
ref:
|
|
466
|
-
modelValue:
|
|
467
|
-
"onUpdate:modelValue":
|
|
465
|
+
ref: l,
|
|
466
|
+
modelValue: n.value,
|
|
467
|
+
"onUpdate:modelValue": s[0] || (s[0] = (d) => n.value = d),
|
|
468
468
|
modelModifiers: { trim: !0 },
|
|
469
469
|
"trigger-on-focus": !1,
|
|
470
470
|
"popper-style": { transition: "opacity 0.2s ease" },
|
|
471
471
|
"fetch-suggestions": u,
|
|
472
472
|
onSelect: i
|
|
473
|
-
},
|
|
474
|
-
renderList(
|
|
473
|
+
}, a.$attrs), createSlots({ _: 2 }, [
|
|
474
|
+
renderList(a.$slots, (d, g, O) => ({
|
|
475
475
|
name: g,
|
|
476
476
|
fn: withCtx((m) => [
|
|
477
|
-
renderSlot(
|
|
477
|
+
renderSlot(a.$slots, g, mergeProps({ key: O }, m))
|
|
478
478
|
])
|
|
479
479
|
}))
|
|
480
480
|
]), 1040, ["modelValue"]));
|
|
@@ -486,207 +486,207 @@ _sfc_main$o.install = function(e) {
|
|
|
486
486
|
const __vite_glob_0_1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
487
487
|
__proto__: null,
|
|
488
488
|
default: _sfc_main$o
|
|
489
|
-
}, Symbol.toStringTag, { value: "Module" })), GetLabelByCode = (e, r, c) => new Promise((t,
|
|
490
|
-
const { format:
|
|
489
|
+
}, Symbol.toStringTag, { value: "Module" })), GetLabelByCode = (e, r, c) => new Promise((t, l) => {
|
|
490
|
+
const { format: n } = store.state.dictConfig, u = store.state.dictCodes;
|
|
491
491
|
let i = [];
|
|
492
492
|
if (!u || !u[r])
|
|
493
493
|
if (store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes) {
|
|
494
|
-
const
|
|
495
|
-
if (Date.now() -
|
|
496
|
-
clearInterval(d),
|
|
494
|
+
const a = store.state.timeout || 3e4, s = Date.now(), d = window.setInterval(() => {
|
|
495
|
+
if (Date.now() - s > a) {
|
|
496
|
+
clearInterval(d), l("getLabelByCode获取字典数据超时");
|
|
497
497
|
return;
|
|
498
498
|
}
|
|
499
499
|
if (!(store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes)) {
|
|
500
500
|
if (clearInterval(d), i = store.state.dictCodes[r], !i) {
|
|
501
|
-
|
|
501
|
+
l(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
502
502
|
return;
|
|
503
503
|
}
|
|
504
|
-
const g = i.find((O) => O[
|
|
505
|
-
t(g ? g[
|
|
504
|
+
const g = i.find((O) => O[n.value] === e);
|
|
505
|
+
t(g ? g[n.label] : c ?? "");
|
|
506
506
|
}
|
|
507
507
|
}, 1e3);
|
|
508
508
|
} else
|
|
509
|
-
store.actions.getDictDataObj(r).then((
|
|
510
|
-
if (i =
|
|
511
|
-
|
|
509
|
+
store.actions.getDictDataObj(r).then((a) => {
|
|
510
|
+
if (i = a[r], !i) {
|
|
511
|
+
l(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
512
512
|
return;
|
|
513
513
|
}
|
|
514
|
-
const
|
|
515
|
-
t(
|
|
514
|
+
const s = i.find((d) => d[n.value] === e);
|
|
515
|
+
t(s ? s[n.label] : c ?? "");
|
|
516
516
|
});
|
|
517
517
|
else {
|
|
518
518
|
i = u[r];
|
|
519
|
-
const
|
|
520
|
-
t(
|
|
519
|
+
const a = i.find((s) => s[n.value] === e);
|
|
520
|
+
t(a ? a[n.label] : c ?? "");
|
|
521
521
|
}
|
|
522
522
|
});
|
|
523
|
-
function GetLabelByCodesDothings(e, r, c, t,
|
|
524
|
-
const
|
|
523
|
+
function GetLabelByCodesDothings(e, r, c, t, l = "--") {
|
|
524
|
+
const n = [];
|
|
525
525
|
for (let u = 0; u < e.length; u++) {
|
|
526
|
-
const i = r.find((
|
|
527
|
-
i ?
|
|
528
|
-
[c.label]: t || e[u] ||
|
|
526
|
+
const i = r.find((a) => a[c.value] === e[u]);
|
|
527
|
+
i ? n.push(i) : n.push({
|
|
528
|
+
[c.label]: t || e[u] || l,
|
|
529
529
|
[c.value]: e[u]
|
|
530
530
|
});
|
|
531
531
|
}
|
|
532
|
-
return
|
|
532
|
+
return n;
|
|
533
533
|
}
|
|
534
534
|
const GetLabelByCodes = (e, r, c) => {
|
|
535
535
|
const t = {
|
|
536
536
|
defaultVal: null,
|
|
537
537
|
emptyText: "--",
|
|
538
|
-
formatFun: (
|
|
538
|
+
formatFun: (l, n) => l.map((u) => u[n.label]).join(","),
|
|
539
539
|
spacer: ","
|
|
540
540
|
};
|
|
541
|
-
return Object.assign(t, c), new Promise((
|
|
541
|
+
return Object.assign(t, c), new Promise((l, n) => {
|
|
542
542
|
let u = [];
|
|
543
543
|
Array.isArray(e) ? u = e : typeof e == "string" ? u = e.split(t.spacer) : typeof e == "number" && (u = [e]);
|
|
544
|
-
const { format: i } = store.state.dictConfig,
|
|
545
|
-
let
|
|
546
|
-
if (!
|
|
544
|
+
const { format: i } = store.state.dictConfig, a = store.state.dictCodes;
|
|
545
|
+
let s = [];
|
|
546
|
+
if (!a || !a[r])
|
|
547
547
|
if (store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes) {
|
|
548
548
|
const d = store.state.timeout || 3e4, g = Date.now(), O = window.setInterval(() => {
|
|
549
549
|
if (Date.now() - g > d) {
|
|
550
|
-
clearInterval(O),
|
|
550
|
+
clearInterval(O), n("getLabelByCodes获取字典数据超时");
|
|
551
551
|
return;
|
|
552
552
|
}
|
|
553
553
|
if (!(store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes)) {
|
|
554
|
-
if (clearInterval(O),
|
|
555
|
-
|
|
554
|
+
if (clearInterval(O), s = store.state.dictCodes[r], !s) {
|
|
555
|
+
n(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
556
556
|
return;
|
|
557
557
|
}
|
|
558
|
-
const m = GetLabelByCodesDothings(u,
|
|
559
|
-
|
|
558
|
+
const m = GetLabelByCodesDothings(u, s, i, t.defaultVal, t.emptyText);
|
|
559
|
+
l(m && m.length > 0 ? t.formatFun(m, i) : t.defaultVal);
|
|
560
560
|
}
|
|
561
561
|
}, 1e3);
|
|
562
562
|
} else
|
|
563
563
|
store.actions.getDictDataObj(r).then((d) => {
|
|
564
|
-
if (
|
|
565
|
-
|
|
564
|
+
if (s = d[r], !s) {
|
|
565
|
+
n(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
566
566
|
return;
|
|
567
567
|
}
|
|
568
568
|
const g = GetLabelByCodesDothings(
|
|
569
569
|
u,
|
|
570
|
-
|
|
570
|
+
s,
|
|
571
571
|
i,
|
|
572
572
|
t.defaultVal,
|
|
573
573
|
t.emptyText
|
|
574
574
|
);
|
|
575
|
-
|
|
575
|
+
l(
|
|
576
576
|
g && g.length > 0 ? t.formatFun(g, i) : t.defaultVal
|
|
577
577
|
);
|
|
578
578
|
});
|
|
579
579
|
else {
|
|
580
|
-
|
|
580
|
+
s = a[r];
|
|
581
581
|
const d = GetLabelByCodesDothings(
|
|
582
582
|
u,
|
|
583
|
-
|
|
583
|
+
s,
|
|
584
584
|
i,
|
|
585
585
|
t.defaultVal,
|
|
586
586
|
t.emptyText
|
|
587
587
|
);
|
|
588
|
-
|
|
588
|
+
l(
|
|
589
589
|
d && d.length > 0 ? t.formatFun(d, i) : t.defaultVal
|
|
590
590
|
);
|
|
591
591
|
}
|
|
592
592
|
});
|
|
593
|
-
}, GetCodeByLabel = (e, r, c) => new Promise((t,
|
|
594
|
-
const { format:
|
|
593
|
+
}, GetCodeByLabel = (e, r, c) => new Promise((t, l) => {
|
|
594
|
+
const { format: n } = store.state.dictConfig, u = store.state.dictCodes;
|
|
595
595
|
let i = [];
|
|
596
596
|
if (!u || !u[r])
|
|
597
597
|
if (store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes) {
|
|
598
|
-
const
|
|
599
|
-
if (Date.now() -
|
|
600
|
-
clearInterval(d),
|
|
598
|
+
const a = store.state.timeout || 3e4, s = Date.now(), d = window.setInterval(() => {
|
|
599
|
+
if (Date.now() - s > a) {
|
|
600
|
+
clearInterval(d), l("getCodeByLabel获取字典数据超时");
|
|
601
601
|
return;
|
|
602
602
|
}
|
|
603
603
|
if (!(store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes)) {
|
|
604
604
|
if (clearInterval(d), i = store.state.dictCodes[r], !i) {
|
|
605
|
-
|
|
605
|
+
l(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
606
606
|
return;
|
|
607
607
|
}
|
|
608
|
-
const g = i.find((O) => O[
|
|
609
|
-
t(g ? g[
|
|
608
|
+
const g = i.find((O) => O[n.label] === e);
|
|
609
|
+
t(g ? g[n.value] : c ?? "");
|
|
610
610
|
}
|
|
611
611
|
}, 1e3);
|
|
612
612
|
} else
|
|
613
|
-
store.actions.getDictDataObj(r).then((
|
|
614
|
-
if (i =
|
|
615
|
-
|
|
613
|
+
store.actions.getDictDataObj(r).then((a) => {
|
|
614
|
+
if (i = a[r], !i) {
|
|
615
|
+
l(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
616
616
|
return;
|
|
617
617
|
}
|
|
618
|
-
const
|
|
619
|
-
t(
|
|
618
|
+
const s = i.find((d) => d[n.label] === e);
|
|
619
|
+
t(s ? s[n.value] : c ?? "");
|
|
620
620
|
});
|
|
621
621
|
else {
|
|
622
622
|
i = u[r];
|
|
623
|
-
const
|
|
624
|
-
t(
|
|
623
|
+
const a = i.find((s) => s[n.label] === e);
|
|
624
|
+
t(a ? a[n.value] : c ?? "");
|
|
625
625
|
}
|
|
626
626
|
});
|
|
627
627
|
function GetCodeByLabelsDothings(e, r, c, t) {
|
|
628
|
-
const
|
|
629
|
-
for (let
|
|
630
|
-
const u = r.find((i) => i[c.label] === e[
|
|
631
|
-
u ?
|
|
632
|
-
[c.label]: e[
|
|
628
|
+
const l = [];
|
|
629
|
+
for (let n = 0; n < e.length; n++) {
|
|
630
|
+
const u = r.find((i) => i[c.label] === e[n]);
|
|
631
|
+
u ? l.push(u) : l.push({
|
|
632
|
+
[c.label]: e[n],
|
|
633
633
|
[c.value]: t
|
|
634
634
|
});
|
|
635
635
|
}
|
|
636
|
-
return
|
|
636
|
+
return l;
|
|
637
637
|
}
|
|
638
638
|
const GetCodeByLabels = (e, r, c) => {
|
|
639
639
|
const t = {
|
|
640
640
|
defaultVal: null,
|
|
641
|
-
formatFun: (
|
|
641
|
+
formatFun: (l, n) => l.map((u) => u[n.value]).join(","),
|
|
642
642
|
spacer: ","
|
|
643
643
|
};
|
|
644
|
-
return Object.assign(t, c), new Promise((
|
|
644
|
+
return Object.assign(t, c), new Promise((l, n) => {
|
|
645
645
|
let u = [];
|
|
646
646
|
Array.isArray(e) ? u = e : typeof e == "string" ? u = e.split(t.spacer) : typeof e == "number" && (u = [e]);
|
|
647
|
-
const { format: i } = store.state.dictConfig,
|
|
648
|
-
let
|
|
649
|
-
if (!
|
|
647
|
+
const { format: i } = store.state.dictConfig, a = store.state.dictCodes;
|
|
648
|
+
let s = [];
|
|
649
|
+
if (!a || !a[r])
|
|
650
650
|
if (store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes) {
|
|
651
651
|
const d = store.state.timeout || 3e4, g = Date.now(), O = window.setInterval(() => {
|
|
652
652
|
if (Date.now() - g > d) {
|
|
653
|
-
clearInterval(O),
|
|
653
|
+
clearInterval(O), n("getCodeByLabels获取字典数据超时");
|
|
654
654
|
return;
|
|
655
655
|
}
|
|
656
656
|
if (!(store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes)) {
|
|
657
|
-
if (clearInterval(O),
|
|
658
|
-
|
|
657
|
+
if (clearInterval(O), s = store.state.dictCodes[r], !s) {
|
|
658
|
+
n(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
659
659
|
return;
|
|
660
660
|
}
|
|
661
|
-
const m = GetCodeByLabelsDothings(u,
|
|
662
|
-
|
|
661
|
+
const m = GetCodeByLabelsDothings(u, s, i, t.defaultVal);
|
|
662
|
+
l(m && m.length > 0 ? t.formatFun(m, i) : t.defaultVal);
|
|
663
663
|
}
|
|
664
664
|
}, 1e3);
|
|
665
665
|
} else
|
|
666
666
|
store.actions.getDictDataObj(r).then((d) => {
|
|
667
|
-
if (
|
|
668
|
-
|
|
667
|
+
if (s = d[r], !s) {
|
|
668
|
+
n(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
669
669
|
return;
|
|
670
670
|
}
|
|
671
671
|
const g = GetCodeByLabelsDothings(
|
|
672
672
|
u,
|
|
673
|
-
|
|
673
|
+
s,
|
|
674
674
|
i,
|
|
675
675
|
t.defaultVal
|
|
676
676
|
);
|
|
677
|
-
|
|
677
|
+
l(
|
|
678
678
|
g && g.length > 0 ? t.formatFun(g, i) : t.defaultVal
|
|
679
679
|
);
|
|
680
680
|
});
|
|
681
681
|
else {
|
|
682
|
-
|
|
682
|
+
s = a[r];
|
|
683
683
|
const d = GetCodeByLabelsDothings(
|
|
684
684
|
u,
|
|
685
|
-
|
|
685
|
+
s,
|
|
686
686
|
i,
|
|
687
687
|
t.defaultVal
|
|
688
688
|
);
|
|
689
|
-
|
|
689
|
+
l(
|
|
690
690
|
d && d.length > 0 ? t.formatFun(d, i) : t.defaultVal
|
|
691
691
|
);
|
|
692
692
|
}
|
|
@@ -694,62 +694,62 @@ const GetCodeByLabels = (e, r, c) => {
|
|
|
694
694
|
}, GetDictObjByDictTypes = (e) => new Promise(async (r, c) => {
|
|
695
695
|
let t = [];
|
|
696
696
|
Array.isArray(e) ? t = e : typeof e == "string" ? t = e.split(",") : typeof e == "number" && (t = [e]);
|
|
697
|
-
let
|
|
698
|
-
const
|
|
697
|
+
let l = {};
|
|
698
|
+
const n = store.state.dictCodes;
|
|
699
699
|
let u = [];
|
|
700
700
|
for (let i = 0; i < t.length; i++) {
|
|
701
|
-
const
|
|
702
|
-
!
|
|
701
|
+
const a = t[i];
|
|
702
|
+
!n || !n[a] ? (store.actions.getDictDataObj(a), u.push(a)) : l[a] = n[a];
|
|
703
703
|
}
|
|
704
704
|
if (u.length > 0) {
|
|
705
|
-
const i = store.state.timeout || 3e4,
|
|
706
|
-
if (Date.now() -
|
|
707
|
-
clearInterval(
|
|
705
|
+
const i = store.state.timeout || 3e4, a = Date.now(), s = window.setInterval(() => {
|
|
706
|
+
if (Date.now() - a > i) {
|
|
707
|
+
clearInterval(s), c("getDictObjByDictTypes获取字典数据超时");
|
|
708
708
|
return;
|
|
709
709
|
}
|
|
710
710
|
if (!store.state.isGettingDictTypes.some((g) => t.includes(g))) {
|
|
711
|
-
clearInterval(
|
|
711
|
+
clearInterval(s);
|
|
712
712
|
for (let g = 0; g < u.length; g++) {
|
|
713
713
|
const O = u[g];
|
|
714
|
-
store.state.dictCodes[O] ?
|
|
714
|
+
store.state.dictCodes[O] ? l[O] = store.state.dictCodes[O] : c(`不存在类型为:${O} 的字典字段,请确认后再填写`);
|
|
715
715
|
}
|
|
716
|
-
r(
|
|
716
|
+
r(l);
|
|
717
717
|
}
|
|
718
718
|
}, 1e3);
|
|
719
719
|
} else
|
|
720
|
-
r(
|
|
721
|
-
}), GetItemByCode = (e, r, c) => new Promise((t,
|
|
722
|
-
const { format:
|
|
720
|
+
r(l);
|
|
721
|
+
}), GetItemByCode = (e, r, c) => new Promise((t, l) => {
|
|
722
|
+
const { format: n } = store.state.dictConfig, u = store.state.dictCodes;
|
|
723
723
|
let i = [];
|
|
724
724
|
if (!u || !u[r])
|
|
725
725
|
if (store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes) {
|
|
726
|
-
const
|
|
727
|
-
if (Date.now() -
|
|
728
|
-
clearInterval(d),
|
|
726
|
+
const a = store.state.timeout || 3e4, s = Date.now(), d = window.setInterval(() => {
|
|
727
|
+
if (Date.now() - s > a) {
|
|
728
|
+
clearInterval(d), l("getItemByCode获取字典数据超时");
|
|
729
729
|
return;
|
|
730
730
|
}
|
|
731
731
|
if (!(store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes)) {
|
|
732
732
|
if (clearInterval(d), i = store.state.dictCodes[r], !i) {
|
|
733
|
-
|
|
733
|
+
l(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
734
734
|
return;
|
|
735
735
|
}
|
|
736
|
-
const g = i.find((O) => O[
|
|
736
|
+
const g = i.find((O) => O[n.value] === e);
|
|
737
737
|
t(g || (c ?? ""));
|
|
738
738
|
}
|
|
739
739
|
}, 1e3);
|
|
740
740
|
} else
|
|
741
|
-
store.actions.getDictDataObj(r).then((
|
|
742
|
-
if (i =
|
|
743
|
-
|
|
741
|
+
store.actions.getDictDataObj(r).then((a) => {
|
|
742
|
+
if (i = a[r], !i) {
|
|
743
|
+
l(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
744
744
|
return;
|
|
745
745
|
}
|
|
746
|
-
const
|
|
747
|
-
t(
|
|
746
|
+
const s = i.find((d) => d[n.value] === e);
|
|
747
|
+
t(s || (c ?? ""));
|
|
748
748
|
});
|
|
749
749
|
else {
|
|
750
750
|
i = u[r];
|
|
751
|
-
const
|
|
752
|
-
t(
|
|
751
|
+
const a = i.find((s) => s[n.value] === e);
|
|
752
|
+
t(a || (c ?? ""));
|
|
753
753
|
}
|
|
754
754
|
}), _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
755
755
|
name: "DictButton",
|
|
@@ -799,33 +799,33 @@ const GetCodeByLabels = (e, r, c) => {
|
|
|
799
799
|
},
|
|
800
800
|
emits: ["submit", "reset", "action"],
|
|
801
801
|
setup(e, { expose: r, emit: c }) {
|
|
802
|
-
const t = e, { actionType:
|
|
803
|
-
let y = ref(null),
|
|
802
|
+
const t = e, { actionType: l, defaultVal: n, emptyText: u, modelValue: i, dictType: a, judgeTypeFun: s, type: d, judgeColorFun: g, color: O, judgeDisabledFun: m, disabled: p } = toRefs(t), b = toRaw(store.state.dictConfig), _ = c, o = useAttrs(), v = computed(() => s.value ? s.value(i.value) : d.value ? d.value : y.value && y.value[b.format.type] ? y.value[b.format.type] : "primary"), T = computed(() => g != null && g.value ? g.value(i.value) : O != null && O.value ? O.value : y.value && y.value[b.format.color] ? y.value[b.format.color] : ""), w = computed(() => m.value ? m.value(i.value) : y.value && y.value[b.format.disabled] ? y.value[b.format.disabled] : !!p.value);
|
|
803
|
+
let y = ref(null), A = ref(null);
|
|
804
804
|
watchEffect(() => {
|
|
805
|
-
if (!
|
|
806
|
-
|
|
805
|
+
if (!a.value) {
|
|
806
|
+
A.value = i.value;
|
|
807
807
|
return;
|
|
808
808
|
}
|
|
809
|
-
GetItemByCode(i.value,
|
|
810
|
-
B ? (y.value = B,
|
|
809
|
+
GetItemByCode(i.value, a.value).then((B) => {
|
|
810
|
+
B ? (y.value = B, A.value = B[b.format.label]) : (y.value = null, A.value = String(n.value ?? (i.value === 0 ? 0 : i.value || u.value)));
|
|
811
811
|
});
|
|
812
812
|
});
|
|
813
813
|
const V = () => {
|
|
814
|
-
w.value || _(
|
|
815
|
-
},
|
|
816
|
-
return r({ getElButtonRef: () =>
|
|
814
|
+
w.value || _(l.value, o);
|
|
815
|
+
}, x = ref(null);
|
|
816
|
+
return r({ getElButtonRef: () => x.value }), (B, L) => (openBlock(), createBlock(unref(ElButton), mergeProps({
|
|
817
817
|
ref_key: "ElButtonRef",
|
|
818
|
-
ref:
|
|
818
|
+
ref: x,
|
|
819
819
|
type: v.value,
|
|
820
820
|
color: T.value,
|
|
821
821
|
disabled: w.value
|
|
822
822
|
}, B.$attrs, { onClick: V }), createSlots({
|
|
823
823
|
default: withCtx(() => [
|
|
824
|
-
createTextVNode(toDisplayString(unref(
|
|
824
|
+
createTextVNode(toDisplayString(unref(A)), 1)
|
|
825
825
|
]),
|
|
826
826
|
_: 2
|
|
827
827
|
}, [
|
|
828
|
-
renderList(B.$slots, (
|
|
828
|
+
renderList(B.$slots, (I, C, j) => ({
|
|
829
829
|
name: C,
|
|
830
830
|
fn: withCtx((S) => [
|
|
831
831
|
renderSlot(B.$slots, C, mergeProps({ key: j }, S))
|
|
@@ -871,10 +871,10 @@ function getNestedValue(e, r) {
|
|
|
871
871
|
if (c == null)
|
|
872
872
|
return;
|
|
873
873
|
if (Array.isArray(c)) {
|
|
874
|
-
const
|
|
875
|
-
if (isNaN(
|
|
874
|
+
const l = Number(t);
|
|
875
|
+
if (isNaN(l) || l < 0 || l >= c.length)
|
|
876
876
|
return;
|
|
877
|
-
c = c[
|
|
877
|
+
c = c[l];
|
|
878
878
|
} else if (typeof c == "object")
|
|
879
879
|
c = c[t];
|
|
880
880
|
else
|
|
@@ -885,82 +885,82 @@ function getNestedValue(e, r) {
|
|
|
885
885
|
function extractField(e, r) {
|
|
886
886
|
if (typeof e == "string" && /^\$\{(.+?)\}$/.test(e)) {
|
|
887
887
|
const t = e.match(/^\$\{(.+?)\}$/)[1].trim().split(".").filter(Boolean);
|
|
888
|
-
let
|
|
889
|
-
return
|
|
888
|
+
let l = getNestedValue(r, t);
|
|
889
|
+
return l == null ? "" : (l = convertDateToTimestamp(l), l);
|
|
890
890
|
}
|
|
891
891
|
return e = convertDateToTimestamp(e), e;
|
|
892
892
|
}
|
|
893
893
|
function CheckConditions(e, r) {
|
|
894
894
|
const c = {
|
|
895
|
-
"<": (t,
|
|
896
|
-
">": (t,
|
|
897
|
-
"==": (t,
|
|
895
|
+
"<": (t, l) => t < l,
|
|
896
|
+
">": (t, l) => t > l,
|
|
897
|
+
"==": (t, l) => t == l,
|
|
898
898
|
// 松散相等
|
|
899
|
-
"===": (t,
|
|
899
|
+
"===": (t, l) => t === l,
|
|
900
900
|
// 严格相等
|
|
901
|
-
"!=": (t,
|
|
902
|
-
"!==": (t,
|
|
903
|
-
">=": (t,
|
|
904
|
-
"<=": (t,
|
|
901
|
+
"!=": (t, l) => t != l,
|
|
902
|
+
"!==": (t, l) => t !== l,
|
|
903
|
+
">=": (t, l) => t >= l,
|
|
904
|
+
"<=": (t, l) => t <= l,
|
|
905
905
|
// 数组/集合相关
|
|
906
|
-
in: (t,
|
|
907
|
-
if (!Array.isArray(
|
|
906
|
+
in: (t, l) => {
|
|
907
|
+
if (!Array.isArray(l))
|
|
908
908
|
throw new Error("运算符 'in' 的目标值必须是数组");
|
|
909
|
-
return
|
|
909
|
+
return l.includes(t);
|
|
910
910
|
},
|
|
911
|
-
"not in": (t,
|
|
912
|
-
if (!Array.isArray(
|
|
911
|
+
"not in": (t, l) => {
|
|
912
|
+
if (!Array.isArray(l))
|
|
913
913
|
throw new Error("运算符 'not in' 的目标值必须是数组");
|
|
914
|
-
return !
|
|
914
|
+
return !l.includes(t);
|
|
915
915
|
},
|
|
916
|
-
startsWith: (t,
|
|
916
|
+
startsWith: (t, l) => {
|
|
917
917
|
if (typeof t != "string") {
|
|
918
918
|
if (typeof t != "number")
|
|
919
919
|
throw new Error("运算符 'endsWith' 的字段值必须是字符串或数字");
|
|
920
920
|
t = String(t);
|
|
921
921
|
}
|
|
922
|
-
return t.startsWith(
|
|
922
|
+
return t.startsWith(l);
|
|
923
923
|
},
|
|
924
|
-
endsWith: (t,
|
|
924
|
+
endsWith: (t, l) => {
|
|
925
925
|
if (typeof t != "string") {
|
|
926
926
|
if (typeof t != "number")
|
|
927
927
|
throw new Error("运算符 'endsWith' 的字段值必须是字符串或数字");
|
|
928
928
|
t = String(t);
|
|
929
929
|
}
|
|
930
|
-
return t.endsWith(
|
|
930
|
+
return t.endsWith(l);
|
|
931
931
|
},
|
|
932
932
|
// 字符串/数组包含
|
|
933
|
-
includes: (t,
|
|
933
|
+
includes: (t, l) => {
|
|
934
934
|
if (typeof t != "string" && !Array.isArray(t))
|
|
935
935
|
throw new Error("运算符 'includes' 的字段值必须是字符串或数组");
|
|
936
|
-
return t.includes(
|
|
936
|
+
return t.includes(l);
|
|
937
937
|
},
|
|
938
|
-
"not includes": (t,
|
|
938
|
+
"not includes": (t, l) => {
|
|
939
939
|
if (typeof t != "string" && !Array.isArray(t))
|
|
940
940
|
throw new Error("运算符 'not includes' 的字段值必须是字符串或数组");
|
|
941
|
-
return !t.includes(
|
|
941
|
+
return !t.includes(l);
|
|
942
942
|
},
|
|
943
943
|
// 范围判断(闭区间,[min, max])
|
|
944
|
-
between: (t,
|
|
945
|
-
if (!Array.isArray(
|
|
944
|
+
between: (t, l) => {
|
|
945
|
+
if (!Array.isArray(l) || l.length !== 2)
|
|
946
946
|
throw new Error("运算符 'between' 的目标值必须是 [min, max] 格式的数组");
|
|
947
|
-
const [
|
|
948
|
-
return t >=
|
|
947
|
+
const [n, u] = l;
|
|
948
|
+
return t >= n && t <= u;
|
|
949
949
|
},
|
|
950
950
|
// 正则表达式匹配
|
|
951
|
-
regex: (t,
|
|
951
|
+
regex: (t, l) => parseRegex(l).test(String(t))
|
|
952
952
|
};
|
|
953
|
-
for (const [t,
|
|
953
|
+
for (const [t, l, n] of e) {
|
|
954
954
|
const u = extractField(t, r);
|
|
955
955
|
if (u === void 0)
|
|
956
956
|
return !1;
|
|
957
|
-
const i = extractField(
|
|
957
|
+
const i = extractField(n, r);
|
|
958
958
|
if (i === void 0)
|
|
959
959
|
return !1;
|
|
960
|
-
const
|
|
961
|
-
if (!
|
|
962
|
-
throw new Error(`不支持的运算符: ${
|
|
963
|
-
if (!
|
|
960
|
+
const a = c[l];
|
|
961
|
+
if (!a)
|
|
962
|
+
throw new Error(`不支持的运算符: ${l}`);
|
|
963
|
+
if (!a(u, i))
|
|
964
964
|
return !1;
|
|
965
965
|
}
|
|
966
966
|
return !0;
|
|
@@ -968,8 +968,8 @@ function CheckConditions(e, r) {
|
|
|
968
968
|
function CheckConditionsByOperation(e, r) {
|
|
969
969
|
let c = !0;
|
|
970
970
|
for (let t = 0; t < e.length; t++) {
|
|
971
|
-
const
|
|
972
|
-
if (c = ValidateNestedRule(
|
|
971
|
+
const l = e[t];
|
|
972
|
+
if (c = ValidateNestedRule(l, r), !c)
|
|
973
973
|
break;
|
|
974
974
|
}
|
|
975
975
|
return c;
|
|
@@ -992,35 +992,35 @@ function ValidateNestedRule(e, r) {
|
|
|
992
992
|
"!=": (m, p) => m != p,
|
|
993
993
|
"===": (m, p) => m === p,
|
|
994
994
|
"!==": (m, p) => m !== p
|
|
995
|
-
},
|
|
995
|
+
}, l = (m, p) => {
|
|
996
996
|
if (typeof m == "string" && /^\$\{(.+?)\}$/.test(m)) {
|
|
997
997
|
const _ = m.match(/^\$\{(.+?)\}$/)[1].trim().split(".").filter(Boolean);
|
|
998
|
-
let
|
|
999
|
-
if (
|
|
998
|
+
let o = getNestedValue(p, _);
|
|
999
|
+
if (o == null)
|
|
1000
1000
|
return "";
|
|
1001
|
-
if (
|
|
1002
|
-
const v =
|
|
1001
|
+
if (o = convertDateToTimestamp(o), typeof o == "string") {
|
|
1002
|
+
const v = o.trim();
|
|
1003
1003
|
return /^-?\d+(\.\d+)?$/.test(v) ? Number(v) : v;
|
|
1004
1004
|
}
|
|
1005
|
-
return
|
|
1005
|
+
return o;
|
|
1006
1006
|
}
|
|
1007
1007
|
return m = convertDateToTimestamp(m), typeof m == "string" && /^-?\d+(\.\d+)?$/.test(m) ? Number(m) : m;
|
|
1008
|
-
},
|
|
1008
|
+
}, n = (m, p) => {
|
|
1009
1009
|
var b;
|
|
1010
1010
|
if (Array.isArray(m)) {
|
|
1011
|
-
let _ = Array.isArray(m[0]) ?
|
|
1012
|
-
for (let
|
|
1013
|
-
const v = m[
|
|
1014
|
-
_ = ((b = c[v]) == null ? void 0 : b.call(c, y,
|
|
1011
|
+
let _ = Array.isArray(m[0]) ? n(m[0], p) : l(m[0], p);
|
|
1012
|
+
for (let o = 1; o < m.length; o += 2) {
|
|
1013
|
+
const v = m[o], T = m[o + 1], w = Array.isArray(T) ? n(T, p) : l(T, p), y = typeof _ == "number" ? _ : NaN, A = typeof w == "number" ? w : NaN;
|
|
1014
|
+
_ = ((b = c[v]) == null ? void 0 : b.call(c, y, A)) ?? NaN;
|
|
1015
1015
|
}
|
|
1016
1016
|
return _;
|
|
1017
1017
|
}
|
|
1018
|
-
return
|
|
1018
|
+
return l(m, p);
|
|
1019
1019
|
};
|
|
1020
1020
|
if (!Array.isArray(e) || e.length < 3)
|
|
1021
1021
|
return !1;
|
|
1022
|
-
const u = e[e.length - 2], i = e[e.length - 1],
|
|
1023
|
-
return typeof
|
|
1022
|
+
const u = e[e.length - 2], i = e[e.length - 1], a = e.slice(0, e.length - 2), s = n(a, r), d = n(i, r);
|
|
1023
|
+
return typeof s != "number" || typeof d != "number" ? ((g = t[u]) == null ? void 0 : g.call(t, s, d)) ?? !1 : isNaN(s) || isNaN(d) ? !1 : ((O = t[u]) == null ? void 0 : O.call(t, s, d)) ?? !1;
|
|
1024
1024
|
}
|
|
1025
1025
|
function CalculateLogicalResult(conditions, expression) {
|
|
1026
1026
|
if (!Array.isArray(conditions))
|
|
@@ -1081,20 +1081,20 @@ function GenerateUUID() {
|
|
|
1081
1081
|
});
|
|
1082
1082
|
}
|
|
1083
1083
|
const Debounce = (e, r = 300, c = !1, t = !1) => {
|
|
1084
|
-
let
|
|
1085
|
-
return function(...
|
|
1086
|
-
|
|
1087
|
-
c && t || e.apply(this,
|
|
1084
|
+
let l = null;
|
|
1085
|
+
return function(...n) {
|
|
1086
|
+
l !== null ? clearTimeout(l) : c && e.apply(this, n), l = setTimeout(() => {
|
|
1087
|
+
c && t || e.apply(this, n), l = null;
|
|
1088
1088
|
}, r);
|
|
1089
1089
|
};
|
|
1090
1090
|
};
|
|
1091
1091
|
function Throttle(e, r = 300, c = !1) {
|
|
1092
|
-
let t,
|
|
1093
|
-
return function(...
|
|
1092
|
+
let t, l;
|
|
1093
|
+
return function(...n) {
|
|
1094
1094
|
const u = +/* @__PURE__ */ new Date();
|
|
1095
|
-
t && u < t + r ? (clearTimeout(
|
|
1096
|
-
e.apply(this,
|
|
1097
|
-
}, r)) : (c ? e.apply(this,
|
|
1095
|
+
t && u < t + r ? (clearTimeout(l), l = setTimeout(function() {
|
|
1096
|
+
e.apply(this, n);
|
|
1097
|
+
}, r)) : (c ? e.apply(this, n) : t && e.apply(this, n), t = u);
|
|
1098
1098
|
};
|
|
1099
1099
|
}
|
|
1100
1100
|
const _hoisted_1$1 = ["innerHTML"], _sfc_main$m = /* @__PURE__ */ Object.assign({
|
|
@@ -1117,15 +1117,15 @@ const _hoisted_1$1 = ["innerHTML"], _sfc_main$m = /* @__PURE__ */ Object.assign(
|
|
|
1117
1117
|
}
|
|
1118
1118
|
},
|
|
1119
1119
|
setup(e) {
|
|
1120
|
-
const r = e, c = ref(null), t = ref(""),
|
|
1120
|
+
const r = e, c = ref(null), t = ref(""), l = (s, d) => {
|
|
1121
1121
|
try {
|
|
1122
1122
|
const g = Object.keys(d), O = g.join(", ");
|
|
1123
|
-
return new Function(O, `return (${
|
|
1123
|
+
return new Function(O, `return (${s});`)(...g.map((p) => d[p]));
|
|
1124
1124
|
} catch {
|
|
1125
1125
|
return "";
|
|
1126
1126
|
}
|
|
1127
|
-
},
|
|
1128
|
-
const O = new DOMParser().parseFromString(
|
|
1127
|
+
}, n = (s) => typeof s == "string" ? s : Array.isArray(s) ? s.map((d) => n(d)).filter(Boolean).join(" ") : typeof s == "object" && s !== null ? Object.entries(s).filter(([d, g]) => !!g).map(([d]) => d).join(" ") : "", u = (s, d) => {
|
|
1128
|
+
const O = new DOMParser().parseFromString(s, "text/html"), m = O.getElementsByTagName("*");
|
|
1129
1129
|
return Array.from(m).forEach((p) => {
|
|
1130
1130
|
Array.from(p.attributes).forEach((b) => {
|
|
1131
1131
|
let _;
|
|
@@ -1135,37 +1135,37 @@ const _hoisted_1$1 = ["innerHTML"], _sfc_main$m = /* @__PURE__ */ Object.assign(
|
|
|
1135
1135
|
_ = b.name.slice(7);
|
|
1136
1136
|
else
|
|
1137
1137
|
return;
|
|
1138
|
-
const
|
|
1138
|
+
const o = b.value;
|
|
1139
1139
|
let v;
|
|
1140
1140
|
try {
|
|
1141
|
-
v =
|
|
1141
|
+
v = l(o, d);
|
|
1142
1142
|
} catch (T) {
|
|
1143
|
-
console.error(`v-bind表达式错误: ${
|
|
1143
|
+
console.error(`v-bind表达式错误: ${o}`, T), v = "";
|
|
1144
1144
|
}
|
|
1145
1145
|
if (v == null)
|
|
1146
1146
|
p.removeAttribute(_);
|
|
1147
1147
|
else {
|
|
1148
|
-
const T = _ === "class" ?
|
|
1148
|
+
const T = _ === "class" ? n(v) : String(v);
|
|
1149
1149
|
p.setAttribute(_, T);
|
|
1150
1150
|
}
|
|
1151
1151
|
p.removeAttribute(b.name);
|
|
1152
1152
|
});
|
|
1153
1153
|
}), O.body.innerHTML;
|
|
1154
|
-
}, i = (
|
|
1155
|
-
const g = i(
|
|
1154
|
+
}, i = (s, d) => s.replace(/\{\{\s*([\s\S]+?)\s*\}\}/g, (g, O) => l(O, d)), a = (s, d) => {
|
|
1155
|
+
const g = i(s, d);
|
|
1156
1156
|
return u(g, d);
|
|
1157
1157
|
};
|
|
1158
1158
|
return watch(
|
|
1159
1159
|
() => [r.render, r.scope, r.formData],
|
|
1160
1160
|
() => {
|
|
1161
|
-
const
|
|
1162
|
-
typeof r.render == "string" ? (t.value =
|
|
1161
|
+
const s = Object.assign({}, r.formData, r.scope);
|
|
1162
|
+
typeof r.render == "string" ? (t.value = a(r.render, s), c.value = null) : (t.value = "", c.value = r.render(h, s));
|
|
1163
1163
|
},
|
|
1164
1164
|
{
|
|
1165
1165
|
immediate: !0,
|
|
1166
1166
|
deep: !0
|
|
1167
1167
|
}
|
|
1168
|
-
), (
|
|
1168
|
+
), (s, d) => typeof e.render == "string" ? (openBlock(), createElementBlock("div", {
|
|
1169
1169
|
key: 0,
|
|
1170
1170
|
innerHTML: t.value
|
|
1171
1171
|
}, null, 8, _hoisted_1$1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
@@ -1215,9 +1215,9 @@ const _hoisted_1$1 = ["innerHTML"], _sfc_main$m = /* @__PURE__ */ Object.assign(
|
|
|
1215
1215
|
},
|
|
1216
1216
|
emits: ["submit", "reset", "action"],
|
|
1217
1217
|
setup(e, { expose: r, emit: c }) {
|
|
1218
|
-
const t = c,
|
|
1218
|
+
const t = c, l = e, { defaultVal: n, emptyText: u, dictType: i, disabledObj: a, filterDataFun: s, disabledDataFun: d, list: g, col: O, gap: m } = toRefs(l), p = toRaw(store.state.dictConfig), b = useAttrs();
|
|
1219
1219
|
let _ = ref("");
|
|
1220
|
-
const
|
|
1220
|
+
const o = computed(() => {
|
|
1221
1221
|
const C = {};
|
|
1222
1222
|
return Object.entries(b).forEach(([j, S]) => {
|
|
1223
1223
|
const f = ToKebabCase(j);
|
|
@@ -1235,11 +1235,11 @@ const _hoisted_1$1 = ["innerHTML"], _sfc_main$m = /* @__PURE__ */ Object.assign(
|
|
|
1235
1235
|
});
|
|
1236
1236
|
function w(C) {
|
|
1237
1237
|
return {
|
|
1238
|
-
...
|
|
1238
|
+
...o.value,
|
|
1239
1239
|
...C
|
|
1240
1240
|
};
|
|
1241
1241
|
}
|
|
1242
|
-
const y = ref([]),
|
|
1242
|
+
const y = ref([]), A = async () => {
|
|
1243
1243
|
if (!i.value)
|
|
1244
1244
|
return;
|
|
1245
1245
|
let C = [];
|
|
@@ -1254,13 +1254,13 @@ const _hoisted_1$1 = ["innerHTML"], _sfc_main$m = /* @__PURE__ */ Object.assign(
|
|
|
1254
1254
|
const j = await store.actions.getDictDataObj(_.value);
|
|
1255
1255
|
C = [].concat(j[_.value]);
|
|
1256
1256
|
}
|
|
1257
|
-
if (
|
|
1257
|
+
if (s.value && (C = s.value(C)), d.value)
|
|
1258
1258
|
C = C.map((j) => ({
|
|
1259
1259
|
...j,
|
|
1260
1260
|
[p.format.disabled]: d.value(j)
|
|
1261
1261
|
}));
|
|
1262
|
-
else if (
|
|
1263
|
-
const { disabledValues: j, disabledType: S = p.format.value, reverse: f = !1 } =
|
|
1262
|
+
else if (a.value) {
|
|
1263
|
+
const { disabledValues: j, disabledType: S = p.format.value, reverse: f = !1 } = a.value, D = typeof j == "string" ? j.split(",") : j;
|
|
1264
1264
|
f ? C = C.map((k) => {
|
|
1265
1265
|
const E = JSON.parse(JSON.stringify(k));
|
|
1266
1266
|
return E[p.format.disabled] = !D.includes(E[S]) || E[p.format.disabled], E;
|
|
@@ -1281,7 +1281,7 @@ const _hoisted_1$1 = ["innerHTML"], _sfc_main$m = /* @__PURE__ */ Object.assign(
|
|
|
1281
1281
|
};
|
|
1282
1282
|
async function V() {
|
|
1283
1283
|
if (i.value) {
|
|
1284
|
-
|
|
1284
|
+
A();
|
|
1285
1285
|
return;
|
|
1286
1286
|
}
|
|
1287
1287
|
let C = [];
|
|
@@ -1290,7 +1290,7 @@ const _hoisted_1$1 = ["innerHTML"], _sfc_main$m = /* @__PURE__ */ Object.assign(
|
|
|
1290
1290
|
if (S.dictType) {
|
|
1291
1291
|
const f = await GetItemByCode(S.modelValue, S.dictType);
|
|
1292
1292
|
S.type = S.type || f[p.format.type] || "", S.label = String(
|
|
1293
|
-
S.label || (f ? f[p.format.label] : (S.defaultVal ||
|
|
1293
|
+
S.label || (f ? f[p.format.label] : (S.defaultVal || n.value) ?? (S.modelValue === 0 ? 0 : S.modelValue || S.emptyText || u.value))
|
|
1294
1294
|
), S.color = S.color || f[p.format.color] || "", S.icon = S.icon || f[p.format.icon] || "", S.disabled = S.disabled ?? (f[p.format.disabled] || !1);
|
|
1295
1295
|
}
|
|
1296
1296
|
C.push(S);
|
|
@@ -1300,14 +1300,14 @@ const _hoisted_1$1 = ["innerHTML"], _sfc_main$m = /* @__PURE__ */ Object.assign(
|
|
|
1300
1300
|
onMounted(() => {
|
|
1301
1301
|
V();
|
|
1302
1302
|
}), watch(
|
|
1303
|
-
() =>
|
|
1303
|
+
() => l.list,
|
|
1304
1304
|
() => {
|
|
1305
1305
|
V();
|
|
1306
1306
|
},
|
|
1307
1307
|
{ deep: !0 }
|
|
1308
1308
|
// 深层监听数组/对象变化
|
|
1309
1309
|
);
|
|
1310
|
-
const
|
|
1310
|
+
const x = (C) => {
|
|
1311
1311
|
C.disabled || (C.actionType === "submit" ? t("submit", C) : C.actionType === "reset" ? t("reset", C) : C.actionType === "action" && t("action", C));
|
|
1312
1312
|
}, F = ref(null), B = () => F.value, L = ref([]);
|
|
1313
1313
|
return r({ getElButtonsRef: B, getElButtonRefs: () => L.value }), (C, j) => (openBlock(), createElementBlock("div", {
|
|
@@ -1324,7 +1324,7 @@ const _hoisted_1$1 = ["innerHTML"], _sfc_main$m = /* @__PURE__ */ Object.assign(
|
|
|
1324
1324
|
},
|
|
1325
1325
|
key: f,
|
|
1326
1326
|
style: { width: v.value, margin: "0 !important" },
|
|
1327
|
-
onClick: (D) =>
|
|
1327
|
+
onClick: (D) => x(S)
|
|
1328
1328
|
}, { ref_for: !0 }, w(S)), createSlots({
|
|
1329
1329
|
default: withCtx(() => [
|
|
1330
1330
|
createTextVNode(toDisplayString(S.label || S.modelValue), 1)
|
|
@@ -1385,12 +1385,12 @@ const __vite_glob_0_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1385
1385
|
[t.valueArrField]: [],
|
|
1386
1386
|
[t.idArrField]: []
|
|
1387
1387
|
});
|
|
1388
|
-
for (var
|
|
1388
|
+
for (var l = [], n, u = 0; u < e.length; u++)
|
|
1389
1389
|
if (e[u][t.parentIdField] === c[t.idField]) {
|
|
1390
1390
|
var i = e[u];
|
|
1391
|
-
i[t.levelField] = c[t.levelField] + 1, i[t.labelArrField] = c[t.labelArrField].concat(i[t.labelField]), i[t.idArrField] = c[t.idArrField].concat(i[t.idField]), i[t.valueArrField] = c[t.valueArrField].concat(i[t.valueField]),
|
|
1391
|
+
i[t.levelField] = c[t.levelField] + 1, i[t.labelArrField] = c[t.labelArrField].concat(i[t.labelField]), i[t.idArrField] = c[t.idArrField].concat(i[t.idField]), i[t.valueArrField] = c[t.valueArrField].concat(i[t.valueField]), n = ListToTree(e, r, i), n.length > 0 ? (i[t.childrenField] = n, i[t.leafField] = !1) : i[t.leafField] = !0, l.push(i);
|
|
1392
1392
|
}
|
|
1393
|
-
return
|
|
1393
|
+
return l;
|
|
1394
1394
|
}, GetTreeItemByCode = (e, r, c) => {
|
|
1395
1395
|
const t = {
|
|
1396
1396
|
idField: "id",
|
|
@@ -1399,8 +1399,8 @@ const __vite_glob_0_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1399
1399
|
//父节点唯一标识字段名
|
|
1400
1400
|
};
|
|
1401
1401
|
Object.assign(t, c);
|
|
1402
|
-
const
|
|
1403
|
-
return
|
|
1402
|
+
const l = r.find((n) => n[t.idField] === e);
|
|
1403
|
+
return l ? GetTreeItemByCode(l[t.parentIdField], r, t).concat([l]) : [];
|
|
1404
1404
|
}, GetTreeItemByLabel = (e, r, c) => {
|
|
1405
1405
|
const t = {
|
|
1406
1406
|
idField: "id",
|
|
@@ -1410,9 +1410,76 @@ const __vite_glob_0_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1410
1410
|
//父节点唯一标识字段名
|
|
1411
1411
|
};
|
|
1412
1412
|
Object.assign(t, c);
|
|
1413
|
-
const
|
|
1414
|
-
return GetTreeItemByCode(
|
|
1415
|
-
},
|
|
1413
|
+
const l = r.find((n) => n[t.labelField] === e);
|
|
1414
|
+
return GetTreeItemByCode(l[t.idField], r, t);
|
|
1415
|
+
}, GetTreePathByValue = (e, r, c) => {
|
|
1416
|
+
const t = {
|
|
1417
|
+
valueField: "value",
|
|
1418
|
+
childrenField: "children"
|
|
1419
|
+
//子节点标识字段名
|
|
1420
|
+
};
|
|
1421
|
+
return Object.assign(t, c), r.reduce((l, n) => {
|
|
1422
|
+
if (n[t.valueField] === e)
|
|
1423
|
+
l.push(n);
|
|
1424
|
+
else if (n[t.childrenField] && n[t.childrenField].length) {
|
|
1425
|
+
const u = GetTreePathByValue(e, n[t.childrenField], c);
|
|
1426
|
+
u && u.length && l.unshift(n, ...u);
|
|
1427
|
+
}
|
|
1428
|
+
return l;
|
|
1429
|
+
}, []);
|
|
1430
|
+
};
|
|
1431
|
+
function TreeToList(e, r, c) {
|
|
1432
|
+
const t = {
|
|
1433
|
+
idField: "id",
|
|
1434
|
+
//唯一标识字段名
|
|
1435
|
+
parentIdField: "parentId",
|
|
1436
|
+
//父节点唯一标识字段名
|
|
1437
|
+
childrenField: "children",
|
|
1438
|
+
//子节点标识字段名
|
|
1439
|
+
firstId: "0",
|
|
1440
|
+
// 根节点值
|
|
1441
|
+
labelField: "label",
|
|
1442
|
+
//label字段名
|
|
1443
|
+
labelArrField: "labelArr",
|
|
1444
|
+
//给对象新增的中文数组字段名
|
|
1445
|
+
idArrField: "idArr",
|
|
1446
|
+
//给对象新增的id数组字段名
|
|
1447
|
+
targetArrField: "",
|
|
1448
|
+
//目标字段数组 多个可以用 , 分隔开
|
|
1449
|
+
levelField: "level",
|
|
1450
|
+
//给对象新增的层级字段名
|
|
1451
|
+
level: 0,
|
|
1452
|
+
// 给根目录配置的层级
|
|
1453
|
+
leafField: "leaf"
|
|
1454
|
+
//叶子节点标识字段名
|
|
1455
|
+
};
|
|
1456
|
+
Object.assign(t, r), c || (c = {
|
|
1457
|
+
[t.idField]: t.firstId,
|
|
1458
|
+
//自身id
|
|
1459
|
+
[t.levelField]: t.level,
|
|
1460
|
+
// 自身层级
|
|
1461
|
+
[t.labelArrField]: [],
|
|
1462
|
+
// 自身labelArr
|
|
1463
|
+
[t.idArrField]: []
|
|
1464
|
+
// 自身labelArr
|
|
1465
|
+
});
|
|
1466
|
+
var l = [];
|
|
1467
|
+
if (Array.isArray(e))
|
|
1468
|
+
for (var n = 0, u = e.length; n < u; n++) {
|
|
1469
|
+
const i = e[n], a = {
|
|
1470
|
+
...i
|
|
1471
|
+
};
|
|
1472
|
+
a[t.levelField] = c[t.levelField] + 1, a[t.parentIdField] = c[t.idField], a[t.labelArrField] = c[t.labelArrField].concat([i[t.labelField]]), a[t.idArrField] = c[t.idArrField].concat([i[t.targetArrField || t.idField]]), Array.isArray(i[t.childrenField]) && i[t.childrenField].length > 0 ? (a[t.leafField] = !1, l.push(a), l = l.concat(
|
|
1473
|
+
TreeToList(
|
|
1474
|
+
i[t.childrenField],
|
|
1475
|
+
r,
|
|
1476
|
+
a
|
|
1477
|
+
)
|
|
1478
|
+
)) : (a[t.leafField] = !0, l.push(a)), delete a[t.childrenField];
|
|
1479
|
+
}
|
|
1480
|
+
return l;
|
|
1481
|
+
}
|
|
1482
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
1416
1483
|
name: "DictCascader",
|
|
1417
1484
|
inheritAttrs: !1,
|
|
1418
1485
|
__name: "index",
|
|
@@ -1439,63 +1506,63 @@ const __vite_glob_0_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1439
1506
|
},
|
|
1440
1507
|
emits: ["dictChange"],
|
|
1441
1508
|
setup(e, { expose: r, emit: c }) {
|
|
1442
|
-
const t = useAttrs(),
|
|
1443
|
-
O("dictChange",
|
|
1509
|
+
const t = useAttrs(), l = e, { maxLevel: n, dictType: u, disabledObj: i, filterDataFun: a, disabledDataFun: s } = toRefs(l), d = ref(""), g = toRaw(store.state.dictConfig), O = c, m = (x) => {
|
|
1510
|
+
O("dictChange", x);
|
|
1444
1511
|
}, p = reactive({
|
|
1445
1512
|
list: []
|
|
1446
1513
|
}), b = async () => {
|
|
1447
1514
|
if (!u.value)
|
|
1448
1515
|
return;
|
|
1449
|
-
let
|
|
1516
|
+
let x = [];
|
|
1450
1517
|
if (typeof u.value == "object") {
|
|
1451
1518
|
d.value = u.value.type;
|
|
1452
1519
|
const F = await store.actions.getDictDataObj(d.value);
|
|
1453
|
-
|
|
1454
|
-
const { filters: B, filterType: L = g.format.value, reverse:
|
|
1455
|
-
|
|
1520
|
+
x = [].concat(F[d.value]);
|
|
1521
|
+
const { filters: B, filterType: L = g.format.value, reverse: I = !1 } = u.value, C = typeof B == "string" ? B.split(",") : B;
|
|
1522
|
+
I ? x = x.filter((j) => !C.includes(j[L])) : x = x.filter((j) => C.includes(j[L]));
|
|
1456
1523
|
} else {
|
|
1457
1524
|
d.value = u.value;
|
|
1458
1525
|
const F = await store.actions.getDictDataObj(d.value);
|
|
1459
|
-
|
|
1526
|
+
x = [].concat(F[d.value]);
|
|
1460
1527
|
}
|
|
1461
|
-
if (
|
|
1462
|
-
|
|
1528
|
+
if (a.value && (x = a.value(x)), s.value)
|
|
1529
|
+
x = x.map((F) => ({
|
|
1463
1530
|
...F,
|
|
1464
|
-
[g.format.disabled]:
|
|
1531
|
+
[g.format.disabled]: s.value(F)
|
|
1465
1532
|
}));
|
|
1466
1533
|
else if (i.value) {
|
|
1467
|
-
const { disabledValues: F, disabledType: B = g.treeSetting.valueField, reverse: L = !1 } = i.value,
|
|
1468
|
-
L ?
|
|
1534
|
+
const { disabledValues: F, disabledType: B = g.treeSetting.valueField, reverse: L = !1 } = i.value, I = typeof F == "string" ? F.split(",") : F;
|
|
1535
|
+
L ? x = x.map((C) => {
|
|
1469
1536
|
const j = JSON.parse(JSON.stringify(C));
|
|
1470
|
-
return j[g.format.disabled] =
|
|
1471
|
-
}) :
|
|
1537
|
+
return j[g.format.disabled] = !I.includes(j[B]) || j[g.format.disabled], j;
|
|
1538
|
+
}) : x = x.map((C) => {
|
|
1472
1539
|
const j = JSON.parse(JSON.stringify(C));
|
|
1473
|
-
return j[g.format.disabled] =
|
|
1540
|
+
return j[g.format.disabled] = I.includes(j[B]) || j[g.format.disabled], j;
|
|
1474
1541
|
});
|
|
1475
1542
|
}
|
|
1476
|
-
p.list =
|
|
1477
|
-
}, _ = computed(() => store.state.isGettingDictTypes.includes(d.value)),
|
|
1478
|
-
const
|
|
1543
|
+
p.list = x;
|
|
1544
|
+
}, _ = computed(() => store.state.isGettingDictTypes.includes(d.value)), o = computed(() => store.state.isGettingAllDictTypes), v = computed(() => {
|
|
1545
|
+
const x = store.state.dictConfig.treeSetting, F = store.state.dictConfig.format, B = t.props ?? {};
|
|
1479
1546
|
return {
|
|
1480
1547
|
disabled: (B == null ? void 0 : B.disabled) ?? F.disabled,
|
|
1481
|
-
label: (B == null ? void 0 : B.label) ??
|
|
1482
|
-
value: (B == null ? void 0 : B.value) ??
|
|
1483
|
-
children: (B == null ? void 0 : B.children) ??
|
|
1484
|
-
leaf: (B == null ? void 0 : B.leaf) ??
|
|
1548
|
+
label: (B == null ? void 0 : B.label) ?? x.labelField,
|
|
1549
|
+
value: (B == null ? void 0 : B.value) ?? x.valueField,
|
|
1550
|
+
children: (B == null ? void 0 : B.children) ?? x.childrenField,
|
|
1551
|
+
leaf: (B == null ? void 0 : B.leaf) ?? x.leafField
|
|
1485
1552
|
};
|
|
1486
1553
|
}), T = computed(() => {
|
|
1487
|
-
const
|
|
1554
|
+
const x = JSON.parse(JSON.stringify(g.treeSetting)), F = t.props || {}, B = {
|
|
1488
1555
|
...F,
|
|
1489
|
-
valueField: F != null && F.value ? F.value :
|
|
1490
|
-
labelField: F != null && F.label ? F.label :
|
|
1491
|
-
childrenField: F != null && F.children ? F.children :
|
|
1492
|
-
leafField: F != null && F.leaf ? F.leaf :
|
|
1556
|
+
valueField: F != null && F.value ? F.value : x.valueField,
|
|
1557
|
+
labelField: F != null && F.label ? F.label : x.labelField,
|
|
1558
|
+
childrenField: F != null && F.children ? F.children : x.childrenField,
|
|
1559
|
+
leafField: F != null && F.leaf ? F.leaf : x.leafField,
|
|
1493
1560
|
disabled: F != null && F.disabled ? F.disabled : g.format.disabled
|
|
1494
1561
|
};
|
|
1495
|
-
return Object.assign(
|
|
1496
|
-
}), w = (
|
|
1497
|
-
for (let B = 0; B <
|
|
1498
|
-
const L =
|
|
1562
|
+
return Object.assign(x, B);
|
|
1563
|
+
}), w = (x, F) => {
|
|
1564
|
+
for (let B = 0; B < x.length; B++) {
|
|
1565
|
+
const L = x[B];
|
|
1499
1566
|
if (L[T.value.levelField] === F) {
|
|
1500
1567
|
delete L[T.value.childrenField], L[T.value.leafField] = !0;
|
|
1501
1568
|
continue;
|
|
@@ -1507,31 +1574,31 @@ const __vite_glob_0_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1507
1574
|
}, y = computed(() => {
|
|
1508
1575
|
if (p.list.length === 0)
|
|
1509
1576
|
return [];
|
|
1510
|
-
const
|
|
1511
|
-
let F = ListToTree(
|
|
1512
|
-
return
|
|
1577
|
+
const x = JSON.parse(JSON.stringify(p.list));
|
|
1578
|
+
let F = ListToTree(x, T.value);
|
|
1579
|
+
return n.value && w(F, +n.value), F || [];
|
|
1513
1580
|
});
|
|
1514
1581
|
watch(
|
|
1515
|
-
[_,
|
|
1516
|
-
([
|
|
1517
|
-
!
|
|
1582
|
+
[_, o],
|
|
1583
|
+
([x, F]) => {
|
|
1584
|
+
!x && !F && b();
|
|
1518
1585
|
},
|
|
1519
1586
|
{
|
|
1520
1587
|
immediate: !0
|
|
1521
1588
|
}
|
|
1522
1589
|
);
|
|
1523
|
-
const
|
|
1524
|
-
return r({ getElCascaderRef: () =>
|
|
1590
|
+
const A = ref(null);
|
|
1591
|
+
return r({ getElCascaderRef: () => A.value }), (x, F) => (openBlock(), createBlock(unref(ElCascader), mergeProps({
|
|
1525
1592
|
ref_key: "ElCascaderRef",
|
|
1526
|
-
ref:
|
|
1593
|
+
ref: A,
|
|
1527
1594
|
options: y.value,
|
|
1528
1595
|
props: v.value,
|
|
1529
1596
|
onChange: m
|
|
1530
|
-
},
|
|
1531
|
-
renderList(
|
|
1597
|
+
}, x.$attrs, { "popper-options": { modifiers: [{ name: "computeStyles", options: { adaptive: !1 } }] } }), createSlots({ _: 2 }, [
|
|
1598
|
+
renderList(x.$slots, (B, L, I) => ({
|
|
1532
1599
|
name: L,
|
|
1533
1600
|
fn: withCtx((C) => [
|
|
1534
|
-
renderSlot(
|
|
1601
|
+
renderSlot(x.$slots, L, mergeProps({ key: I }, C))
|
|
1535
1602
|
])
|
|
1536
1603
|
}))
|
|
1537
1604
|
]), 1040, ["options", "props"]));
|
|
@@ -1588,19 +1655,19 @@ const __vite_glob_0_4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1588
1655
|
}
|
|
1589
1656
|
},
|
|
1590
1657
|
setup(e, { expose: r }) {
|
|
1591
|
-
const c = e, { modelValue: t, dictType:
|
|
1592
|
-
let
|
|
1658
|
+
const c = e, { modelValue: t, dictType: l, judgeTypeFun: n, type: u, judgeColorFun: i, color: a, judgeDisabledFun: s, disabled: d, defaultVal: g, emptyText: O } = toRefs(c), m = toRaw(store.state.dictConfig), p = computed(() => n.value ? n.value(t.value) : u.value ? u.value : o.value && o.value[m.format.type] ? o.value[m.format.type] : "primary"), b = computed(() => i.value ? i.value(t.value) : a.value ? a.value : o.value && o.value[m.format.color] ? o.value[m.format.color] : ""), _ = computed(() => s.value ? s.value(t.value) : o.value && o.value[m.format.disabled] ? o.value[m.format.disabled] : !!d.value);
|
|
1659
|
+
let o = ref(null), v = ref(null);
|
|
1593
1660
|
watchEffect(() => {
|
|
1594
|
-
if (!
|
|
1661
|
+
if (!l.value) {
|
|
1595
1662
|
v.value = t.value;
|
|
1596
1663
|
return;
|
|
1597
1664
|
}
|
|
1598
|
-
GetItemByCode(t.value,
|
|
1599
|
-
y ? (
|
|
1665
|
+
GetItemByCode(t.value, l.value).then((y) => {
|
|
1666
|
+
y ? (o.value = y, v.value = y[m.format.label]) : (o.value = null, v.value = String(g.value ?? (t.value === 0 ? 0 : t.value || O.value)));
|
|
1600
1667
|
});
|
|
1601
1668
|
});
|
|
1602
1669
|
const T = ref(null);
|
|
1603
|
-
return r({ getElCheckTagRef: () => T.value }), (y,
|
|
1670
|
+
return r({ getElCheckTagRef: () => T.value }), (y, A) => (openBlock(), createBlock(unref(ElCheckTag), mergeProps({
|
|
1604
1671
|
class: "el-check-tag-dict",
|
|
1605
1672
|
ref_key: "ElCheckTagRef",
|
|
1606
1673
|
ref: T,
|
|
@@ -1613,10 +1680,10 @@ const __vite_glob_0_4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1613
1680
|
]),
|
|
1614
1681
|
_: 2
|
|
1615
1682
|
}, [
|
|
1616
|
-
renderList(y.$slots, (V,
|
|
1617
|
-
name:
|
|
1683
|
+
renderList(y.$slots, (V, x, F) => ({
|
|
1684
|
+
name: x,
|
|
1618
1685
|
fn: withCtx((B) => [
|
|
1619
|
-
renderSlot(y.$slots,
|
|
1686
|
+
renderSlot(y.$slots, x, mergeProps({ key: F }, B))
|
|
1620
1687
|
])
|
|
1621
1688
|
}))
|
|
1622
1689
|
]), 1040, ["type", "color", "disabled"]));
|
|
@@ -1673,13 +1740,13 @@ const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1673
1740
|
},
|
|
1674
1741
|
emits: ["dictChange", "change", "update:modelValue"],
|
|
1675
1742
|
setup(e, { expose: r, emit: c }) {
|
|
1676
|
-
const t = e, { modelValue:
|
|
1743
|
+
const t = e, { modelValue: l, options: n, fieldNames: u, dictType: i, disabledObj: a, keyValue: s, filterDataFun: d, disabledDataFun: g } = toRefs(t), O = ref([]), m = ref(""), p = toRaw(store.state.dictConfig), b = c, _ = (F, B) => {
|
|
1677
1744
|
b("change", F);
|
|
1678
1745
|
const L = [];
|
|
1679
|
-
for (let
|
|
1680
|
-
const C = v.value[
|
|
1681
|
-
if (
|
|
1682
|
-
if (F && !
|
|
1746
|
+
for (let I = 0; I < v.value.length; I++) {
|
|
1747
|
+
const C = v.value[I];
|
|
1748
|
+
if (l.value.includes(C[p.format.value]) && L.push(C), I === B)
|
|
1749
|
+
if (F && !l.value.includes(C[p.format.value]))
|
|
1683
1750
|
L.push(C);
|
|
1684
1751
|
else {
|
|
1685
1752
|
const j = L.indexOf(C);
|
|
@@ -1688,18 +1755,18 @@ const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1688
1755
|
}
|
|
1689
1756
|
if (b(
|
|
1690
1757
|
"update:modelValue",
|
|
1691
|
-
L.map((
|
|
1692
|
-
),
|
|
1758
|
+
L.map((I) => I[p.format.value])
|
|
1759
|
+
), s.value) {
|
|
1693
1760
|
b("dictChange", L);
|
|
1694
1761
|
return;
|
|
1695
1762
|
}
|
|
1696
1763
|
b(
|
|
1697
1764
|
"dictChange",
|
|
1698
|
-
L.map((
|
|
1765
|
+
L.map((I) => I[p.format.value])
|
|
1699
1766
|
);
|
|
1700
|
-
},
|
|
1767
|
+
}, o = reactive({
|
|
1701
1768
|
list: []
|
|
1702
|
-
}), v = computed(() =>
|
|
1769
|
+
}), v = computed(() => o.list.map((F) => ({
|
|
1703
1770
|
label: F[p.format.label],
|
|
1704
1771
|
value: F[p.format.value],
|
|
1705
1772
|
disabled: !!F[p.format.disabled],
|
|
@@ -1709,8 +1776,8 @@ const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1709
1776
|
[() => v.value, () => t.modelValue],
|
|
1710
1777
|
([F, B]) => {
|
|
1711
1778
|
const L = [];
|
|
1712
|
-
for (let
|
|
1713
|
-
const C = F[
|
|
1779
|
+
for (let I = 0; I < F.length; I++) {
|
|
1780
|
+
const C = F[I];
|
|
1714
1781
|
B.includes(C[p.format.value]) ? L.push(!0) : L.push(!1);
|
|
1715
1782
|
}
|
|
1716
1783
|
O.value = L;
|
|
@@ -1722,15 +1789,15 @@ const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1722
1789
|
// 数组/对象必须加 deep!
|
|
1723
1790
|
);
|
|
1724
1791
|
const T = async () => {
|
|
1725
|
-
if (!i.value ||
|
|
1792
|
+
if (!i.value || n.value && n.value.length > 0)
|
|
1726
1793
|
return;
|
|
1727
1794
|
let F = [];
|
|
1728
1795
|
if (typeof i.value == "object") {
|
|
1729
1796
|
m.value = i.value.type;
|
|
1730
1797
|
const B = await store.actions.getDictDataObj(m.value);
|
|
1731
1798
|
F = [].concat(B[m.value]);
|
|
1732
|
-
const { filters: L, filterType:
|
|
1733
|
-
C ? F = F.filter((S) => !j.includes(S[
|
|
1799
|
+
const { filters: L, filterType: I = p.format.value, reverse: C = !1 } = i.value, j = typeof L == "string" ? L.split(",") : L;
|
|
1800
|
+
C ? F = F.filter((S) => !j.includes(S[I])) : F = F.filter((S) => j.includes(S[I]));
|
|
1734
1801
|
} else {
|
|
1735
1802
|
m.value = i.value;
|
|
1736
1803
|
const B = await store.actions.getDictDataObj(m.value);
|
|
@@ -1741,9 +1808,9 @@ const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1741
1808
|
...B,
|
|
1742
1809
|
[p.format.disabled]: g.value(B)
|
|
1743
1810
|
}));
|
|
1744
|
-
else if (
|
|
1745
|
-
const { disabledValues: B, disabledType: L = p.format.value, reverse:
|
|
1746
|
-
|
|
1811
|
+
else if (a.value) {
|
|
1812
|
+
const { disabledValues: B, disabledType: L = p.format.value, reverse: I = !1 } = a.value, C = typeof B == "string" ? B.split(",") : B;
|
|
1813
|
+
I ? F = F.map((j) => {
|
|
1747
1814
|
const S = JSON.parse(JSON.stringify(j));
|
|
1748
1815
|
return S[p.format.disabled] = !C.includes(S[L]) || S[p.format.disabled], S;
|
|
1749
1816
|
}) : F = F.map((j) => {
|
|
@@ -1751,17 +1818,17 @@ const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1751
1818
|
return S[p.format.disabled] = C.includes(S[L]) || S[p.format.disabled], S;
|
|
1752
1819
|
});
|
|
1753
1820
|
}
|
|
1754
|
-
|
|
1755
|
-
}, w = computed(() => store.state.isGettingDictTypes.includes(m.value)), y = computed(() => store.state.isGettingAllDictTypes),
|
|
1821
|
+
o.list = F;
|
|
1822
|
+
}, w = computed(() => store.state.isGettingDictTypes.includes(m.value)), y = computed(() => store.state.isGettingAllDictTypes), A = computed(() => n.value);
|
|
1756
1823
|
watch(
|
|
1757
|
-
[w, y,
|
|
1824
|
+
[w, y, A],
|
|
1758
1825
|
([F, B, L]) => {
|
|
1759
|
-
!F && !B && L && L.length === 0 && T(), L.length > 0 && (
|
|
1826
|
+
!F && !B && L && L.length === 0 && T(), L.length > 0 && (o.list = JSON.parse(JSON.stringify(L)), o.list.length > 0 && (Object.prototype.toString.call(o.list[0]) === "[object Object]" ? o.list = o.list.map((C) => ({
|
|
1760
1827
|
[p.format.value]: C[u.value.value],
|
|
1761
1828
|
[p.format.label]: C[u.value.label],
|
|
1762
1829
|
[p.format.disabled]: !!C[u.value.disabled],
|
|
1763
1830
|
...C
|
|
1764
|
-
})) :
|
|
1831
|
+
})) : o.list = o.list.map((C) => ({
|
|
1765
1832
|
[p.format.value]: C,
|
|
1766
1833
|
[p.format.label]: C
|
|
1767
1834
|
}))));
|
|
@@ -1771,15 +1838,15 @@ const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1771
1838
|
}
|
|
1772
1839
|
);
|
|
1773
1840
|
const V = ref([]);
|
|
1774
|
-
return r({ getElCheckAbleTagRefs: () => V.value }), (F, B) => (openBlock(!0), createElementBlock(Fragment, null, renderList(v.value, (L,
|
|
1841
|
+
return r({ getElCheckAbleTagRefs: () => V.value }), (F, B) => (openBlock(!0), createElementBlock(Fragment, null, renderList(v.value, (L, I) => (openBlock(), createBlock(unref(ElCheckTag), mergeProps({
|
|
1775
1842
|
ref_for: !0,
|
|
1776
1843
|
ref: (C) => {
|
|
1777
|
-
C && (V.value[
|
|
1844
|
+
C && (V.value[I] = C);
|
|
1778
1845
|
},
|
|
1779
|
-
checked: O.value[
|
|
1846
|
+
checked: O.value[I]
|
|
1780
1847
|
}, { ref_for: !0 }, F.$attrs, {
|
|
1781
|
-
onChange: (C) => _(C,
|
|
1782
|
-
key:
|
|
1848
|
+
onChange: (C) => _(C, I),
|
|
1849
|
+
key: I,
|
|
1783
1850
|
type: L[unref(p).format.type]
|
|
1784
1851
|
}), createSlots({
|
|
1785
1852
|
default: withCtx(() => [
|
|
@@ -1847,7 +1914,7 @@ const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1847
1914
|
},
|
|
1848
1915
|
emits: ["dictChange"],
|
|
1849
1916
|
setup(e, { expose: r, emit: c }) {
|
|
1850
|
-
const t = e, { disabled:
|
|
1917
|
+
const t = e, { disabled: l, data: n, format: u, dictType: i, disabledObj: a, keyValue: s, filterDataFun: d, disabledDataFun: g } = toRefs(t), O = useAttrs(), m = computed(() => {
|
|
1851
1918
|
const S = {};
|
|
1852
1919
|
return Object.entries(O).forEach(([f, D]) => {
|
|
1853
1920
|
const k = ToKebabCase(f);
|
|
@@ -1865,17 +1932,17 @@ const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1865
1932
|
S[E] = D;
|
|
1866
1933
|
}
|
|
1867
1934
|
}), S;
|
|
1868
|
-
}), b = ref(""), _ = toRaw(store.state.dictConfig),
|
|
1869
|
-
if (!
|
|
1870
|
-
|
|
1935
|
+
}), b = ref(""), _ = toRaw(store.state.dictConfig), o = c, v = (S) => {
|
|
1936
|
+
if (!s.value) {
|
|
1937
|
+
o("dictChange", S);
|
|
1871
1938
|
return;
|
|
1872
1939
|
}
|
|
1873
1940
|
const f = T.list.filter((D) => S.includes(D[_.format.value]));
|
|
1874
|
-
|
|
1941
|
+
o("dictChange", f);
|
|
1875
1942
|
}, T = reactive({
|
|
1876
1943
|
list: []
|
|
1877
1944
|
}), w = async () => {
|
|
1878
|
-
if (!i.value ||
|
|
1945
|
+
if (!i.value || n.value && n.value.length > 0)
|
|
1879
1946
|
return;
|
|
1880
1947
|
let S = [];
|
|
1881
1948
|
if (typeof i.value == "object") {
|
|
@@ -1894,8 +1961,8 @@ const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1894
1961
|
...f,
|
|
1895
1962
|
[_.format.disabled]: g.value(f)
|
|
1896
1963
|
}));
|
|
1897
|
-
else if (
|
|
1898
|
-
const { disabledValues: f, disabledType: D = _.format.value, reverse: k = !1 } =
|
|
1964
|
+
else if (a.value) {
|
|
1965
|
+
const { disabledValues: f, disabledType: D = _.format.value, reverse: k = !1 } = a.value, E = typeof f == "string" ? f.split(",") : f;
|
|
1899
1966
|
k ? S = S.map((N) => {
|
|
1900
1967
|
const R = JSON.parse(JSON.stringify(N));
|
|
1901
1968
|
return R[_.format.disabled] = !E.includes(R[D]) || R[_.format.disabled], R;
|
|
@@ -1905,9 +1972,9 @@ const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1905
1972
|
});
|
|
1906
1973
|
}
|
|
1907
1974
|
T.list = S;
|
|
1908
|
-
}, y = computed(() => store.state.isGettingDictTypes.includes(b.value)),
|
|
1975
|
+
}, y = computed(() => store.state.isGettingDictTypes.includes(b.value)), A = computed(() => store.state.isGettingAllDictTypes), V = computed(() => n.value), x = inject(formItemContextKey), F = inject(formContextKey), B = computed(() => l.value || O["checkbox-button-disabled"] === "" || O["checkbox-button-disabled"] || O.checkboxButtonDisabled === "" || O.checkboxButtonDisabled || O.CheckboxButtonDisabled === "" || O.CheckboxButtonDisabled || (x == null ? void 0 : x.disabled) || (F == null ? void 0 : F.disabled) || !1);
|
|
1909
1976
|
watch(
|
|
1910
|
-
[y,
|
|
1977
|
+
[y, A, V],
|
|
1911
1978
|
([S, f, D]) => {
|
|
1912
1979
|
!S && !f && D && D.length === 0 && w(), D.length > 0 && (T.list = JSON.parse(JSON.stringify(D)), T.list.length > 0 && (Object.prototype.toString.call(T.list[0]) === "[object Object]" ? T.list = T.list.map((E) => ({
|
|
1913
1980
|
[_.format.value]: E[u.value.value],
|
|
@@ -1923,8 +1990,8 @@ const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
1923
1990
|
immediate: !0
|
|
1924
1991
|
}
|
|
1925
1992
|
);
|
|
1926
|
-
const L = ref(null),
|
|
1927
|
-
return r({ getElCheckboxGroupRef:
|
|
1993
|
+
const L = ref(null), I = () => L.value, C = ref([]);
|
|
1994
|
+
return r({ getElCheckboxGroupRef: I, getElCheckboxButtonRefs: () => C.value }), (S, f) => (openBlock(), createBlock(unref(ElCheckboxGroup), mergeProps({
|
|
1928
1995
|
ref_key: "ElCheckboxGroupRef",
|
|
1929
1996
|
ref: L,
|
|
1930
1997
|
disabled: B.value
|
|
@@ -2013,7 +2080,7 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
2013
2080
|
},
|
|
2014
2081
|
emits: ["dictChange", "update:modelValue", "change"],
|
|
2015
2082
|
setup(e, { expose: r, emit: c }) {
|
|
2016
|
-
const t = e, { disabled:
|
|
2083
|
+
const t = e, { disabled: l, modelValue: n, addAllText: u, data: i, format: a, dictType: s, disabledObj: d, keyValue: g, filterDataFun: O, disabledDataFun: m } = toRefs(t), p = useAttrs(), b = ref(!1), _ = ref(!1), o = ref([]), v = computed(() => {
|
|
2017
2084
|
const P = {};
|
|
2018
2085
|
return Object.entries(p).forEach(([K, W]) => {
|
|
2019
2086
|
const G = ToKebabCase(K);
|
|
@@ -2031,37 +2098,37 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
2031
2098
|
P[z] = W;
|
|
2032
2099
|
}
|
|
2033
2100
|
}), P;
|
|
2034
|
-
}), w = ref(""), y = toRaw(store.state.dictConfig),
|
|
2101
|
+
}), w = ref(""), y = toRaw(store.state.dictConfig), A = c, V = computed(() => B.list.filter((P) => !P[y.format.disabled])), x = (P) => {
|
|
2035
2102
|
const K = P.length, W = V.value.length;
|
|
2036
2103
|
_.value = K === W, b.value = K > 0 && K < W;
|
|
2037
2104
|
}, F = (P) => {
|
|
2038
|
-
if (
|
|
2039
|
-
|
|
2105
|
+
if (o.value = P, x(P), !g.value) {
|
|
2106
|
+
A("dictChange", P);
|
|
2040
2107
|
return;
|
|
2041
2108
|
}
|
|
2042
2109
|
const K = B.list.filter((W) => P.includes(W[y.format.value]));
|
|
2043
|
-
|
|
2110
|
+
A("dictChange", K);
|
|
2044
2111
|
}, B = reactive({
|
|
2045
2112
|
list: []
|
|
2046
2113
|
});
|
|
2047
2114
|
watch(
|
|
2048
2115
|
() => V.value,
|
|
2049
2116
|
() => {
|
|
2050
|
-
|
|
2117
|
+
x(n.value);
|
|
2051
2118
|
}
|
|
2052
2119
|
);
|
|
2053
2120
|
const L = async () => {
|
|
2054
|
-
if (!
|
|
2121
|
+
if (!s.value || i.value && i.value.length > 0)
|
|
2055
2122
|
return;
|
|
2056
2123
|
let P = [];
|
|
2057
|
-
if (typeof
|
|
2058
|
-
w.value =
|
|
2124
|
+
if (typeof s.value == "object") {
|
|
2125
|
+
w.value = s.value.type;
|
|
2059
2126
|
const K = await store.actions.getDictDataObj(w.value);
|
|
2060
2127
|
P = [].concat(K[w.value]);
|
|
2061
|
-
const { filters: W, filterType: G = y.format.value, reverse: z = !1 } =
|
|
2128
|
+
const { filters: W, filterType: G = y.format.value, reverse: z = !1 } = s.value, ee = typeof W == "string" ? W.split(",") : W;
|
|
2062
2129
|
z ? P = P.filter((q) => !ee.includes(q[G])) : P = P.filter((q) => ee.includes(q[G]));
|
|
2063
2130
|
} else {
|
|
2064
|
-
w.value =
|
|
2131
|
+
w.value = s.value;
|
|
2065
2132
|
const K = await store.actions.getDictDataObj(w.value);
|
|
2066
2133
|
P = [].concat(K[w.value]);
|
|
2067
2134
|
}
|
|
@@ -2081,12 +2148,12 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
2081
2148
|
});
|
|
2082
2149
|
}
|
|
2083
2150
|
B.list = P;
|
|
2084
|
-
},
|
|
2151
|
+
}, I = computed(() => store.state.isGettingDictTypes.includes(w.value)), C = computed(() => store.state.isGettingAllDictTypes), j = computed(() => i.value), S = inject(formItemContextKey), f = inject(formContextKey), D = computed(() => l.value || p["checkbox-disabled"] === "" || p["checkbox-disabled"] || p.checkboxDisabled === "" || p.checkboxDisabled || p.CheckboxDisabled === "" || p.CheckboxDisabled || (S == null ? void 0 : S.disabled) || (f == null ? void 0 : f.disabled) || !1);
|
|
2085
2152
|
watch(
|
|
2086
2153
|
() => t.modelValue,
|
|
2087
2154
|
// 正确监听方式
|
|
2088
2155
|
(P) => {
|
|
2089
|
-
|
|
2156
|
+
o.value = P;
|
|
2090
2157
|
},
|
|
2091
2158
|
{
|
|
2092
2159
|
deep: !0,
|
|
@@ -2094,17 +2161,17 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
2094
2161
|
}
|
|
2095
2162
|
// 数组/对象必须加 deep!
|
|
2096
2163
|
), watch(
|
|
2097
|
-
() =>
|
|
2164
|
+
() => o.value,
|
|
2098
2165
|
(P) => {
|
|
2099
|
-
|
|
2166
|
+
A("update:modelValue", P), A("change", P);
|
|
2100
2167
|
}
|
|
2101
2168
|
), watch(
|
|
2102
|
-
[
|
|
2169
|
+
[I, C, j],
|
|
2103
2170
|
([P, K, W]) => {
|
|
2104
2171
|
!P && !K && W && W.length === 0 && L(), W.length > 0 && (B.list = JSON.parse(JSON.stringify(W)), B.list.length > 0 && (Object.prototype.toString.call(B.list[0]) === "[object Object]" ? B.list = B.list.map((z) => ({
|
|
2105
|
-
[y.format.value]: z[
|
|
2106
|
-
[y.format.label]: z[
|
|
2107
|
-
[y.format.disabled]: !!z[
|
|
2172
|
+
[y.format.value]: z[a.value.value],
|
|
2173
|
+
[y.format.label]: z[a.value.label],
|
|
2174
|
+
[y.format.disabled]: !!z[a.value.disabled],
|
|
2108
2175
|
...z
|
|
2109
2176
|
})) : B.list = B.list.map((z) => ({
|
|
2110
2177
|
[y.format.value]: z,
|
|
@@ -2141,8 +2208,8 @@ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
2141
2208
|
ref_key: "ElCheckboxGroupRef",
|
|
2142
2209
|
ref: E,
|
|
2143
2210
|
disabled: D.value,
|
|
2144
|
-
modelValue:
|
|
2145
|
-
"onUpdate:modelValue": K[1] || (K[1] = (W) =>
|
|
2211
|
+
modelValue: o.value,
|
|
2212
|
+
"onUpdate:modelValue": K[1] || (K[1] = (W) => o.value = W)
|
|
2146
2213
|
}, v.value, { onChange: F }), createSlots({
|
|
2147
2214
|
default: withCtx(() => [
|
|
2148
2215
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(B.list, (W, G) => (openBlock(), createBlock(unref(ElCheckbox), mergeProps({
|
|
@@ -2179,139 +2246,139 @@ const __vite_glob_0_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
2179
2246
|
__proto__: null,
|
|
2180
2247
|
default: dictComponent$4
|
|
2181
2248
|
}, Symbol.toStringTag, { value: "Module" })), GetLabelByCodeFilter = (e, r, c) => {
|
|
2182
|
-
const { format: t } = store.state.dictConfig,
|
|
2183
|
-
let
|
|
2184
|
-
if (!
|
|
2249
|
+
const { format: t } = store.state.dictConfig, l = store.state.dictCodes;
|
|
2250
|
+
let n = [];
|
|
2251
|
+
if (!l || !l[r])
|
|
2185
2252
|
store.actions.getDictDataObj(r).then((u) => {
|
|
2186
|
-
if (
|
|
2253
|
+
if (n = u[r], !n)
|
|
2187
2254
|
return;
|
|
2188
|
-
const i =
|
|
2255
|
+
const i = n.find((a) => a[t.value] === e);
|
|
2189
2256
|
return i ? i[t.label] : c ?? "";
|
|
2190
2257
|
});
|
|
2191
2258
|
else {
|
|
2192
|
-
|
|
2193
|
-
const u =
|
|
2259
|
+
n = l[r];
|
|
2260
|
+
const u = n.find((i) => i[t.value] === e);
|
|
2194
2261
|
return u ? u[t.label] : c ?? "";
|
|
2195
2262
|
}
|
|
2196
2263
|
}, GetLabelByCodesFilter = (e, r, c) => {
|
|
2197
2264
|
const t = {
|
|
2198
2265
|
defaultVal: null,
|
|
2199
2266
|
emptyText: "--",
|
|
2200
|
-
formatFun: (
|
|
2267
|
+
formatFun: (a, s) => a.map((d) => d[s.label]).join(","),
|
|
2201
2268
|
spacer: ","
|
|
2202
2269
|
};
|
|
2203
2270
|
Object.assign(t, c);
|
|
2204
|
-
let
|
|
2205
|
-
Array.isArray(e) ?
|
|
2206
|
-
const { format:
|
|
2271
|
+
let l = [];
|
|
2272
|
+
Array.isArray(e) ? l = e : typeof e == "string" ? l = e.split(t.spacer) : typeof e == "number" && (l = [e]);
|
|
2273
|
+
const { format: n } = store.state.dictConfig, u = store.state.dictCodes;
|
|
2207
2274
|
let i = [];
|
|
2208
2275
|
if (!u || !u[r])
|
|
2209
|
-
store.actions.getDictDataObj(r).then((
|
|
2210
|
-
if (i =
|
|
2276
|
+
store.actions.getDictDataObj(r).then((a) => {
|
|
2277
|
+
if (i = a[r], !i)
|
|
2211
2278
|
return;
|
|
2212
|
-
const
|
|
2213
|
-
n,
|
|
2214
|
-
i,
|
|
2279
|
+
const s = GetLabelByCodesDothings(
|
|
2215
2280
|
l,
|
|
2281
|
+
i,
|
|
2282
|
+
n,
|
|
2216
2283
|
t.defaultVal,
|
|
2217
2284
|
t.emptyText
|
|
2218
2285
|
);
|
|
2219
|
-
return
|
|
2286
|
+
return s && s.length > 0 ? t.formatFun(s, n) : t.defaultVal;
|
|
2220
2287
|
});
|
|
2221
2288
|
else {
|
|
2222
2289
|
i = u[r];
|
|
2223
|
-
const
|
|
2224
|
-
return
|
|
2290
|
+
const a = GetLabelByCodesDothings(l, i, n, t.defaultVal, t.emptyText);
|
|
2291
|
+
return a && a.length > 0 ? t.formatFun(a, n) : t.defaultVal;
|
|
2225
2292
|
}
|
|
2226
2293
|
}, GetCodeByLabelFilter = (e, r, c) => {
|
|
2227
|
-
const { format: t } = store.state.dictConfig,
|
|
2228
|
-
let
|
|
2229
|
-
if (!
|
|
2294
|
+
const { format: t } = store.state.dictConfig, l = store.state.dictCodes;
|
|
2295
|
+
let n = [];
|
|
2296
|
+
if (!l || !l[r])
|
|
2230
2297
|
store.actions.getDictDataObj(r).then((u) => {
|
|
2231
|
-
if (
|
|
2298
|
+
if (n = u[r], !n)
|
|
2232
2299
|
return;
|
|
2233
|
-
const i =
|
|
2300
|
+
const i = n.find((a) => a[t.label] === e);
|
|
2234
2301
|
return i ? i[t.value] : c ?? "";
|
|
2235
2302
|
});
|
|
2236
2303
|
else {
|
|
2237
|
-
|
|
2238
|
-
const u =
|
|
2304
|
+
n = l[r];
|
|
2305
|
+
const u = n.find((i) => i[t.label] === e);
|
|
2239
2306
|
return u ? u[t.value] : c ?? "";
|
|
2240
2307
|
}
|
|
2241
2308
|
}, GetCodeByLabelsFilter = (e, r, c) => {
|
|
2242
2309
|
const t = {
|
|
2243
2310
|
defaultVal: null,
|
|
2244
|
-
formatFun: (
|
|
2311
|
+
formatFun: (a, s) => a.map((d) => d[s.value]).join(","),
|
|
2245
2312
|
spacer: ","
|
|
2246
2313
|
};
|
|
2247
2314
|
Object.assign(t, c);
|
|
2248
|
-
let
|
|
2249
|
-
Array.isArray(e) ?
|
|
2250
|
-
const { format:
|
|
2315
|
+
let l = [];
|
|
2316
|
+
Array.isArray(e) ? l = e : typeof e == "string" ? l = e.split(t.spacer) : typeof e == "number" && (l = [e]);
|
|
2317
|
+
const { format: n } = store.state.dictConfig, u = store.state.dictCodes;
|
|
2251
2318
|
let i = [];
|
|
2252
2319
|
if (!u || !u[r])
|
|
2253
|
-
store.actions.getDictDataObj(r).then((
|
|
2254
|
-
if (i =
|
|
2320
|
+
store.actions.getDictDataObj(r).then((a) => {
|
|
2321
|
+
if (i = a[r], !i)
|
|
2255
2322
|
return;
|
|
2256
|
-
const
|
|
2257
|
-
n,
|
|
2258
|
-
i,
|
|
2323
|
+
const s = GetCodeByLabelsDothings(
|
|
2259
2324
|
l,
|
|
2325
|
+
i,
|
|
2326
|
+
n,
|
|
2260
2327
|
t.defaultVal
|
|
2261
2328
|
);
|
|
2262
|
-
return
|
|
2329
|
+
return s && s.length > 0 ? t.formatFun(s, n) : t.defaultVal;
|
|
2263
2330
|
});
|
|
2264
2331
|
else {
|
|
2265
2332
|
i = u[r];
|
|
2266
|
-
const
|
|
2267
|
-
return
|
|
2333
|
+
const a = GetCodeByLabelsDothings(l, i, n, t.defaultVal);
|
|
2334
|
+
return a && a.length > 0 ? t.formatFun(a, n) : t.defaultVal;
|
|
2268
2335
|
}
|
|
2269
2336
|
}, GetTreeLabelByCode = (e, r, c) => {
|
|
2270
2337
|
const t = {
|
|
2271
2338
|
defaultVal: null,
|
|
2272
|
-
formatFun: (
|
|
2339
|
+
formatFun: (l, n) => l.map((u) => u[n.labelField]).join("/"),
|
|
2273
2340
|
treeSetting: {}
|
|
2274
2341
|
};
|
|
2275
|
-
return Object.assign(t, c), new Promise((
|
|
2276
|
-
const { treeSetting: u } = store.state.dictConfig, i = Object.assign(u, t.treeSetting),
|
|
2277
|
-
let
|
|
2278
|
-
if (!
|
|
2342
|
+
return Object.assign(t, c), new Promise((l, n) => {
|
|
2343
|
+
const { treeSetting: u } = store.state.dictConfig, i = Object.assign(u, t.treeSetting), a = store.state.dictCodes;
|
|
2344
|
+
let s = [];
|
|
2345
|
+
if (!a || !a[r])
|
|
2279
2346
|
if (store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes) {
|
|
2280
2347
|
const d = store.state.timeout || 3e4, g = Date.now(), O = window.setInterval(() => {
|
|
2281
2348
|
if (Date.now() - g > d) {
|
|
2282
|
-
clearInterval(O),
|
|
2349
|
+
clearInterval(O), n("getTreeLabelByCode获取字典数据超时");
|
|
2283
2350
|
return;
|
|
2284
2351
|
}
|
|
2285
2352
|
if (!(store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes)) {
|
|
2286
|
-
if (clearInterval(O),
|
|
2287
|
-
|
|
2353
|
+
if (clearInterval(O), s = store.state.dictCodes[r], !s) {
|
|
2354
|
+
n(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2288
2355
|
return;
|
|
2289
2356
|
}
|
|
2290
|
-
const m =
|
|
2291
|
-
|
|
2357
|
+
const m = s.find((p) => p[i.valueField] === e);
|
|
2358
|
+
l(m ? t.formatFun(GetTreeItemByCode(m[i.idField], s, i), i) : t.defaultVal);
|
|
2292
2359
|
}
|
|
2293
2360
|
}, 1e3);
|
|
2294
2361
|
} else
|
|
2295
2362
|
store.actions.getDictDataObj(r).then((d) => {
|
|
2296
|
-
if (
|
|
2297
|
-
|
|
2363
|
+
if (s = d[r], !s) {
|
|
2364
|
+
n(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2298
2365
|
return;
|
|
2299
2366
|
}
|
|
2300
|
-
const g =
|
|
2301
|
-
|
|
2367
|
+
const g = s.find((O) => O[i.valueField] === e);
|
|
2368
|
+
l(g ? t.formatFun(GetTreeItemByCode(g[i.idField], s, i), i) : t.defaultVal);
|
|
2302
2369
|
});
|
|
2303
2370
|
else {
|
|
2304
|
-
|
|
2305
|
-
const d =
|
|
2306
|
-
|
|
2371
|
+
s = a[r];
|
|
2372
|
+
const d = s.find((g) => g[i.valueField] === e);
|
|
2373
|
+
l(d ? t.formatFun(GetTreeItemByCode(d[i.idField], s, i), i) : t.defaultVal);
|
|
2307
2374
|
}
|
|
2308
2375
|
});
|
|
2309
2376
|
};
|
|
2310
|
-
function GetTreeLabelByCodesDothings(e, r, c, t,
|
|
2377
|
+
function GetTreeLabelByCodesDothings(e, r, c, t, l, n = "--") {
|
|
2311
2378
|
const u = [];
|
|
2312
2379
|
for (let i = 0; i < e.length; i++) {
|
|
2313
|
-
const
|
|
2314
|
-
|
|
2380
|
+
const a = r.find((s) => s[l.valueField] === e[i]);
|
|
2381
|
+
a ? u.push(t(GetTreeItemByCode(a[l.idField], r, l), l)) : u.push(c || e[i] || n);
|
|
2315
2382
|
}
|
|
2316
2383
|
return u;
|
|
2317
2384
|
}
|
|
@@ -2319,196 +2386,196 @@ const GetTreeLabelByCodes = (e, r, c) => {
|
|
|
2319
2386
|
const t = {
|
|
2320
2387
|
defaultVal: null,
|
|
2321
2388
|
emptyText: "--",
|
|
2322
|
-
formatFunIn: (
|
|
2389
|
+
formatFunIn: (l, n) => l.map((u) => u[n.labelField]).join("/"),
|
|
2323
2390
|
treeSetting: {},
|
|
2324
|
-
formatFunOut: (
|
|
2391
|
+
formatFunOut: (l) => l.join(","),
|
|
2325
2392
|
spacer: ","
|
|
2326
2393
|
};
|
|
2327
|
-
return Object.assign(t, c), new Promise((
|
|
2394
|
+
return Object.assign(t, c), new Promise((l, n) => {
|
|
2328
2395
|
let u = [];
|
|
2329
2396
|
Array.isArray(e) ? u = e : typeof e == "string" ? u = e.split(t.spacer) : typeof e == "number" && (u = [e]);
|
|
2330
|
-
const { treeSetting: i } = store.state.dictConfig,
|
|
2397
|
+
const { treeSetting: i } = store.state.dictConfig, a = Object.assign(i, t.treeSetting), s = store.state.dictCodes;
|
|
2331
2398
|
let d = [];
|
|
2332
|
-
if (!
|
|
2399
|
+
if (!s || !s[r])
|
|
2333
2400
|
if (store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes) {
|
|
2334
2401
|
const g = store.state.timeout || 3e4, O = Date.now(), m = window.setInterval(() => {
|
|
2335
2402
|
if (Date.now() - O > g) {
|
|
2336
|
-
clearInterval(m),
|
|
2403
|
+
clearInterval(m), n("getTreeLabelByCodes获取字典数据超时");
|
|
2337
2404
|
return;
|
|
2338
2405
|
}
|
|
2339
2406
|
if (!(store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes)) {
|
|
2340
2407
|
if (clearInterval(m), d = store.state.dictCodes[r], !d) {
|
|
2341
|
-
|
|
2408
|
+
n(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2342
2409
|
return;
|
|
2343
2410
|
}
|
|
2344
|
-
const p = GetTreeLabelByCodesDothings(u, d, t.defaultVal, t.formatFunIn,
|
|
2345
|
-
|
|
2411
|
+
const p = GetTreeLabelByCodesDothings(u, d, t.defaultVal, t.formatFunIn, a, t.emptyText);
|
|
2412
|
+
l(p && p.length > 0 ? t.formatFunOut(p) : t.defaultVal);
|
|
2346
2413
|
}
|
|
2347
2414
|
}, 1e3);
|
|
2348
2415
|
} else
|
|
2349
2416
|
store.actions.getDictDataObj(r).then((g) => {
|
|
2350
2417
|
if (d = g[r], !d) {
|
|
2351
|
-
|
|
2418
|
+
n(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2352
2419
|
return;
|
|
2353
2420
|
}
|
|
2354
|
-
const O = GetTreeLabelByCodesDothings(u, d, t.defaultVal, t.formatFunIn,
|
|
2355
|
-
|
|
2421
|
+
const O = GetTreeLabelByCodesDothings(u, d, t.defaultVal, t.formatFunIn, a, t.emptyText);
|
|
2422
|
+
l(O && O.length > 0 ? t.formatFunOut(O) : t.defaultVal);
|
|
2356
2423
|
});
|
|
2357
2424
|
else {
|
|
2358
|
-
d =
|
|
2359
|
-
const g = GetTreeLabelByCodesDothings(u, d, t.defaultVal, t.formatFunIn,
|
|
2360
|
-
|
|
2425
|
+
d = s[r];
|
|
2426
|
+
const g = GetTreeLabelByCodesDothings(u, d, t.defaultVal, t.formatFunIn, a, t.emptyText);
|
|
2427
|
+
l(g && g.length > 0 ? t.formatFunOut(g) : t.defaultVal);
|
|
2361
2428
|
}
|
|
2362
2429
|
});
|
|
2363
2430
|
}, GetTreeCodeByLabel = (e, r, c) => {
|
|
2364
2431
|
const t = {
|
|
2365
2432
|
defaultVal: null,
|
|
2366
|
-
formatFun: (
|
|
2433
|
+
formatFun: (l, n) => l.map((u) => u[n.valueField]).join("/"),
|
|
2367
2434
|
treeSetting: {}
|
|
2368
2435
|
};
|
|
2369
|
-
return Object.assign(t, c), new Promise((
|
|
2370
|
-
const { treeSetting: u } = store.state.dictConfig, i = Object.assign(u, t.treeSetting),
|
|
2371
|
-
let
|
|
2372
|
-
if (!
|
|
2436
|
+
return Object.assign(t, c), new Promise((l, n) => {
|
|
2437
|
+
const { treeSetting: u } = store.state.dictConfig, i = Object.assign(u, t.treeSetting), a = store.state.dictCodes;
|
|
2438
|
+
let s = [];
|
|
2439
|
+
if (!a || !a[r])
|
|
2373
2440
|
if (store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes) {
|
|
2374
2441
|
const d = store.state.timeout || 3e4, g = Date.now(), O = window.setInterval(() => {
|
|
2375
2442
|
if (Date.now() - g > d) {
|
|
2376
|
-
clearInterval(O),
|
|
2443
|
+
clearInterval(O), n("getTreeCodeByLabel获取字典数据超时");
|
|
2377
2444
|
return;
|
|
2378
2445
|
}
|
|
2379
2446
|
if (!(store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes)) {
|
|
2380
|
-
if (clearInterval(O),
|
|
2381
|
-
|
|
2447
|
+
if (clearInterval(O), s = store.state.dictCodes[r], !s) {
|
|
2448
|
+
n(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2382
2449
|
return;
|
|
2383
2450
|
}
|
|
2384
|
-
const m =
|
|
2385
|
-
|
|
2451
|
+
const m = s.find((p) => p[i.labelField] === e);
|
|
2452
|
+
l(m ? t.formatFun(GetTreeItemByLabel(m[i.labelField], s, i), i) : t.defaultVal);
|
|
2386
2453
|
}
|
|
2387
2454
|
}, 1e3);
|
|
2388
2455
|
} else
|
|
2389
2456
|
store.actions.getDictDataObj(r).then((d) => {
|
|
2390
|
-
if (
|
|
2391
|
-
|
|
2457
|
+
if (s = d[r], !s) {
|
|
2458
|
+
n(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2392
2459
|
return;
|
|
2393
2460
|
}
|
|
2394
|
-
const g =
|
|
2395
|
-
|
|
2461
|
+
const g = s.find((O) => O[i.labelField] === e);
|
|
2462
|
+
l(g ? t.formatFun(GetTreeItemByLabel(g[i.labelField], s, i), i) : t.defaultVal);
|
|
2396
2463
|
});
|
|
2397
2464
|
else {
|
|
2398
|
-
|
|
2399
|
-
const d =
|
|
2400
|
-
|
|
2465
|
+
s = a[r];
|
|
2466
|
+
const d = s.find((g) => g[i.labelField] === e);
|
|
2467
|
+
l(d ? t.formatFun(GetTreeItemByLabel(d[i.labelField], s, i), i) : t.defaultVal);
|
|
2401
2468
|
}
|
|
2402
2469
|
});
|
|
2403
2470
|
};
|
|
2404
|
-
function GetTreeCodeByLabelsDothings(e, r, c, t,
|
|
2405
|
-
const
|
|
2471
|
+
function GetTreeCodeByLabelsDothings(e, r, c, t, l) {
|
|
2472
|
+
const n = [];
|
|
2406
2473
|
for (let u = 0; u < e.length; u++) {
|
|
2407
|
-
const i = r.find((
|
|
2408
|
-
i ?
|
|
2474
|
+
const i = r.find((a) => a[l.labelField] === e[u]);
|
|
2475
|
+
i ? n.push(t(GetTreeItemByLabel(i[l.labelField], r, l), l)) : n.push(c);
|
|
2409
2476
|
}
|
|
2410
|
-
return
|
|
2477
|
+
return n;
|
|
2411
2478
|
}
|
|
2412
2479
|
const GetTreeCodeByLabels = (e, r, c) => {
|
|
2413
2480
|
const t = {
|
|
2414
2481
|
defaultVal: null,
|
|
2415
|
-
formatFunIn: (
|
|
2482
|
+
formatFunIn: (l, n) => l.map((u) => u[n.valueField]).join("/"),
|
|
2416
2483
|
treeSetting: {},
|
|
2417
|
-
formatFunOut: (
|
|
2484
|
+
formatFunOut: (l) => l.join(","),
|
|
2418
2485
|
spacer: ","
|
|
2419
2486
|
};
|
|
2420
|
-
return Object.assign(t, c), new Promise((
|
|
2487
|
+
return Object.assign(t, c), new Promise((l, n) => {
|
|
2421
2488
|
let u = [];
|
|
2422
2489
|
Array.isArray(e) ? u = e : typeof e == "string" ? u = e.split(t.spacer) : typeof e == "number" && (u = [e]);
|
|
2423
|
-
const { treeSetting: i } = store.state.dictConfig,
|
|
2490
|
+
const { treeSetting: i } = store.state.dictConfig, a = Object.assign(i, t.treeSetting), s = store.state.dictCodes;
|
|
2424
2491
|
let d = [];
|
|
2425
|
-
if (!
|
|
2492
|
+
if (!s || !s[r])
|
|
2426
2493
|
if (store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes) {
|
|
2427
2494
|
const g = store.state.timeout || 3e4, O = Date.now(), m = window.setInterval(() => {
|
|
2428
2495
|
if (Date.now() - O > g) {
|
|
2429
|
-
clearInterval(m),
|
|
2496
|
+
clearInterval(m), n("getTreeCodeByLabels获取字典数据超时");
|
|
2430
2497
|
return;
|
|
2431
2498
|
}
|
|
2432
2499
|
if (!(store.state.isGettingDictTypes.includes(r) || store.state.isGettingAllDictTypes)) {
|
|
2433
2500
|
if (clearInterval(m), d = store.state.dictCodes[r], !d) {
|
|
2434
|
-
|
|
2501
|
+
n(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2435
2502
|
return;
|
|
2436
2503
|
}
|
|
2437
|
-
const p = GetTreeCodeByLabelsDothings(u, d, t.defaultVal, t.formatFunIn,
|
|
2438
|
-
|
|
2504
|
+
const p = GetTreeCodeByLabelsDothings(u, d, t.defaultVal, t.formatFunIn, a);
|
|
2505
|
+
l(p && p.length > 0 ? t.formatFunOut(p) : t.defaultVal);
|
|
2439
2506
|
}
|
|
2440
2507
|
}, 1e3);
|
|
2441
2508
|
} else
|
|
2442
2509
|
store.actions.getDictDataObj(r).then((g) => {
|
|
2443
2510
|
if (d = g[r], !d) {
|
|
2444
|
-
|
|
2511
|
+
n(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2445
2512
|
return;
|
|
2446
2513
|
}
|
|
2447
|
-
const O = GetTreeCodeByLabelsDothings(u, d, t.defaultVal, t.formatFunIn,
|
|
2448
|
-
|
|
2514
|
+
const O = GetTreeCodeByLabelsDothings(u, d, t.defaultVal, t.formatFunIn, a);
|
|
2515
|
+
l(O && O.length > 0 ? t.formatFunOut(O) : t.defaultVal);
|
|
2449
2516
|
});
|
|
2450
2517
|
else {
|
|
2451
|
-
d =
|
|
2452
|
-
const g = GetTreeCodeByLabelsDothings(u, d, t.defaultVal, t.formatFunIn,
|
|
2453
|
-
|
|
2518
|
+
d = s[r];
|
|
2519
|
+
const g = GetTreeCodeByLabelsDothings(u, d, t.defaultVal, t.formatFunIn, a);
|
|
2520
|
+
l(g && g.length > 0 ? t.formatFunOut(g) : t.defaultVal);
|
|
2454
2521
|
}
|
|
2455
2522
|
});
|
|
2456
2523
|
}, GetTreeLabelByCodeFilter = (e, r, c) => {
|
|
2457
2524
|
const t = {
|
|
2458
2525
|
defaultVal: null,
|
|
2459
|
-
formatFun: (
|
|
2526
|
+
formatFun: (a, s) => a.map((d) => d[s.labelField]).join("/"),
|
|
2460
2527
|
treeSetting: {}
|
|
2461
2528
|
};
|
|
2462
2529
|
Object.assign(t, c);
|
|
2463
|
-
const { treeSetting:
|
|
2530
|
+
const { treeSetting: l } = store.state.dictConfig, n = Object.assign(l, t.treeSetting), u = store.state.dictCodes;
|
|
2464
2531
|
let i = [];
|
|
2465
2532
|
if (!u || !u[r])
|
|
2466
|
-
store.actions.getDictDataObj(r).then((
|
|
2467
|
-
if (i =
|
|
2533
|
+
store.actions.getDictDataObj(r).then((a) => {
|
|
2534
|
+
if (i = a[r], !i)
|
|
2468
2535
|
return new Error(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2469
|
-
const
|
|
2470
|
-
return
|
|
2536
|
+
const s = i.find((d) => d[n.valueField] === e);
|
|
2537
|
+
return s ? t.formatFun(
|
|
2471
2538
|
GetTreeItemByCode(
|
|
2472
|
-
|
|
2539
|
+
s[n.idField],
|
|
2473
2540
|
i,
|
|
2474
|
-
|
|
2541
|
+
n
|
|
2475
2542
|
),
|
|
2476
|
-
|
|
2543
|
+
n
|
|
2477
2544
|
) : t.defaultVal;
|
|
2478
2545
|
});
|
|
2479
2546
|
else {
|
|
2480
2547
|
i = u[r];
|
|
2481
|
-
const
|
|
2482
|
-
return
|
|
2548
|
+
const a = i.find((s) => s[n.valueField] === e);
|
|
2549
|
+
return a ? t.formatFun(
|
|
2483
2550
|
GetTreeItemByCode(
|
|
2484
|
-
|
|
2551
|
+
a[n.idField],
|
|
2485
2552
|
i,
|
|
2486
|
-
|
|
2553
|
+
n
|
|
2487
2554
|
),
|
|
2488
|
-
|
|
2555
|
+
n
|
|
2489
2556
|
) : t.defaultVal;
|
|
2490
2557
|
}
|
|
2491
2558
|
}, GetTreeLabelByCodesFilter = (e, r, c) => {
|
|
2492
2559
|
const t = {
|
|
2493
2560
|
defaultVal: null,
|
|
2494
2561
|
emptyText: "--",
|
|
2495
|
-
formatFunIn: (
|
|
2562
|
+
formatFunIn: (s, d) => s.map((g) => g[d.labelField]).join("/"),
|
|
2496
2563
|
treeSetting: {},
|
|
2497
|
-
formatFunOut: (
|
|
2564
|
+
formatFunOut: (s) => s.join(","),
|
|
2498
2565
|
spacer: ","
|
|
2499
2566
|
};
|
|
2500
2567
|
Object.assign(t, c);
|
|
2501
|
-
let
|
|
2502
|
-
Array.isArray(e) ?
|
|
2503
|
-
const { treeSetting:
|
|
2504
|
-
let
|
|
2568
|
+
let l = [];
|
|
2569
|
+
Array.isArray(e) ? l = e : typeof e == "string" ? l = e.split(t.spacer) : typeof e == "number" && (l = [e]);
|
|
2570
|
+
const { treeSetting: n } = store.state.dictConfig, u = Object.assign(n, t.treeSetting), i = store.state.dictCodes;
|
|
2571
|
+
let a = [];
|
|
2505
2572
|
if (!i || !i[r])
|
|
2506
|
-
store.actions.getDictDataObj(r).then((
|
|
2507
|
-
if (
|
|
2573
|
+
store.actions.getDictDataObj(r).then((s) => {
|
|
2574
|
+
if (a = s[r], !a)
|
|
2508
2575
|
return new Error(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2509
2576
|
const d = GetTreeLabelByCodesDothings(
|
|
2510
|
-
|
|
2511
|
-
|
|
2577
|
+
l,
|
|
2578
|
+
a,
|
|
2512
2579
|
t.defaultVal,
|
|
2513
2580
|
t.formatFunIn,
|
|
2514
2581
|
u,
|
|
@@ -2517,72 +2584,72 @@ const GetTreeCodeByLabels = (e, r, c) => {
|
|
|
2517
2584
|
return d && d.length > 0 ? t.formatFunOut(d) : t.defaultVal;
|
|
2518
2585
|
});
|
|
2519
2586
|
else {
|
|
2520
|
-
|
|
2521
|
-
const
|
|
2522
|
-
|
|
2523
|
-
|
|
2587
|
+
a = i[r];
|
|
2588
|
+
const s = GetTreeLabelByCodesDothings(
|
|
2589
|
+
l,
|
|
2590
|
+
a,
|
|
2524
2591
|
t.defaultVal,
|
|
2525
2592
|
t.formatFunIn,
|
|
2526
2593
|
u,
|
|
2527
2594
|
t.emptyText
|
|
2528
2595
|
);
|
|
2529
|
-
return
|
|
2596
|
+
return s && s.length > 0 ? t.formatFunOut(s) : t.defaultVal;
|
|
2530
2597
|
}
|
|
2531
2598
|
}, GetTreeCodeByLabelFilter = (e, r, c) => {
|
|
2532
2599
|
const t = {
|
|
2533
2600
|
defaultVal: null,
|
|
2534
|
-
formatFun: (
|
|
2601
|
+
formatFun: (a, s) => a.map((d) => d[s.valueField]).join("/"),
|
|
2535
2602
|
treeSetting: {}
|
|
2536
2603
|
};
|
|
2537
2604
|
Object.assign(t, c);
|
|
2538
|
-
const { treeSetting:
|
|
2605
|
+
const { treeSetting: l } = store.state.dictConfig, n = Object.assign(l, t.treeSetting), u = store.state.dictCodes;
|
|
2539
2606
|
let i = [];
|
|
2540
2607
|
if (!u || !u[r])
|
|
2541
|
-
store.actions.getDictDataObj(r).then((
|
|
2542
|
-
if (i =
|
|
2608
|
+
store.actions.getDictDataObj(r).then((a) => {
|
|
2609
|
+
if (i = a[r], !i)
|
|
2543
2610
|
return new Error(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2544
|
-
const
|
|
2545
|
-
return
|
|
2611
|
+
const s = i.find((d) => d[n.labelField] === e);
|
|
2612
|
+
return s ? t.formatFun(
|
|
2546
2613
|
GetTreeItemByLabel(
|
|
2547
|
-
|
|
2614
|
+
s[n.labelField],
|
|
2548
2615
|
i,
|
|
2549
|
-
|
|
2616
|
+
n
|
|
2550
2617
|
),
|
|
2551
|
-
|
|
2618
|
+
n
|
|
2552
2619
|
) : t.defaultVal;
|
|
2553
2620
|
});
|
|
2554
2621
|
else {
|
|
2555
2622
|
i = u[r];
|
|
2556
|
-
const
|
|
2557
|
-
return
|
|
2623
|
+
const a = i.find((s) => s[n.labelField] === e);
|
|
2624
|
+
return a ? t.formatFun(
|
|
2558
2625
|
GetTreeItemByLabel(
|
|
2559
|
-
|
|
2626
|
+
a[n.labelField],
|
|
2560
2627
|
i,
|
|
2561
|
-
|
|
2628
|
+
n
|
|
2562
2629
|
),
|
|
2563
|
-
|
|
2630
|
+
n
|
|
2564
2631
|
) : t.defaultVal;
|
|
2565
2632
|
}
|
|
2566
2633
|
}, GetTreeCodeByLabelsFilter = (e, r, c) => {
|
|
2567
2634
|
const t = {
|
|
2568
2635
|
defaultVal: null,
|
|
2569
|
-
formatFunIn: (
|
|
2636
|
+
formatFunIn: (s, d) => s.map((g) => g[d.valueField]).join("/"),
|
|
2570
2637
|
treeSetting: {},
|
|
2571
|
-
formatFunOut: (
|
|
2638
|
+
formatFunOut: (s) => s.join(","),
|
|
2572
2639
|
spacer: ","
|
|
2573
2640
|
};
|
|
2574
2641
|
Object.assign(t, c);
|
|
2575
|
-
let
|
|
2576
|
-
Array.isArray(e) ?
|
|
2577
|
-
const { treeSetting:
|
|
2578
|
-
let
|
|
2642
|
+
let l = [];
|
|
2643
|
+
Array.isArray(e) ? l = e : typeof e == "string" ? l = e.split(t.spacer) : typeof e == "number" && (l = [e]);
|
|
2644
|
+
const { treeSetting: n } = store.state.dictConfig, u = Object.assign(n, t.treeSetting), i = store.state.dictCodes;
|
|
2645
|
+
let a = [];
|
|
2579
2646
|
if (!i || !i[r])
|
|
2580
|
-
store.actions.getDictDataObj(r).then((
|
|
2581
|
-
if (
|
|
2647
|
+
store.actions.getDictDataObj(r).then((s) => {
|
|
2648
|
+
if (a = s[r], !a)
|
|
2582
2649
|
return new Error(`不存在类型为:${r} 的字典字段,请确认后再填写`);
|
|
2583
2650
|
const d = GetTreeCodeByLabelsDothings(
|
|
2584
|
-
|
|
2585
|
-
|
|
2651
|
+
l,
|
|
2652
|
+
a,
|
|
2586
2653
|
t.defaultVal,
|
|
2587
2654
|
t.formatFunIn,
|
|
2588
2655
|
u
|
|
@@ -2590,15 +2657,15 @@ const GetTreeCodeByLabels = (e, r, c) => {
|
|
|
2590
2657
|
return d && d.length > 0 ? t.formatFunOut(d) : t.defaultVal;
|
|
2591
2658
|
});
|
|
2592
2659
|
else {
|
|
2593
|
-
|
|
2594
|
-
const
|
|
2595
|
-
|
|
2596
|
-
|
|
2660
|
+
a = i[r];
|
|
2661
|
+
const s = GetTreeCodeByLabelsDothings(
|
|
2662
|
+
l,
|
|
2663
|
+
a,
|
|
2597
2664
|
t.defaultVal,
|
|
2598
2665
|
t.formatFunIn,
|
|
2599
2666
|
u
|
|
2600
2667
|
);
|
|
2601
|
-
return
|
|
2668
|
+
return s && s.length > 0 ? t.formatFunOut(s) : t.defaultVal;
|
|
2602
2669
|
}
|
|
2603
2670
|
}, DEFAULT_FORMATS = {
|
|
2604
2671
|
date: "yyyy-MM-dd",
|
|
@@ -2620,7 +2687,7 @@ const GetTreeCodeByLabels = (e, r, c) => {
|
|
|
2620
2687
|
return c || "";
|
|
2621
2688
|
if (r === "timestamp")
|
|
2622
2689
|
return e.getTime();
|
|
2623
|
-
const
|
|
2690
|
+
const n = {
|
|
2624
2691
|
"M+": e.getMonth() + 1,
|
|
2625
2692
|
"d+": e.getDate(),
|
|
2626
2693
|
"h+": e.getHours(),
|
|
@@ -2633,11 +2700,11 @@ const GetTreeCodeByLabels = (e, r, c) => {
|
|
|
2633
2700
|
RegExp.$1,
|
|
2634
2701
|
String(e.getFullYear()).substr(4 - RegExp.$1.length)
|
|
2635
2702
|
));
|
|
2636
|
-
for (const u in
|
|
2703
|
+
for (const u in n) {
|
|
2637
2704
|
const i = new RegExp(`(${u})`);
|
|
2638
2705
|
i.test(r) && (r = r.replace(
|
|
2639
2706
|
i,
|
|
2640
|
-
RegExp.$1.length === 1 ?
|
|
2707
|
+
RegExp.$1.length === 1 ? n[u] : ("00" + n[u]).substr(String(n[u]).length)
|
|
2641
2708
|
));
|
|
2642
2709
|
}
|
|
2643
2710
|
return r;
|
|
@@ -2654,20 +2721,20 @@ function formatDateString(e) {
|
|
|
2654
2721
|
const t = `${r}/01/01`;
|
|
2655
2722
|
return IsDate(t) ? t : e;
|
|
2656
2723
|
} else if (c === 6) {
|
|
2657
|
-
const t = r.substring(0, 4),
|
|
2658
|
-
return IsDate(
|
|
2724
|
+
const t = r.substring(0, 4), l = r.substring(4, 6), n = `${t}/${l}/01`;
|
|
2725
|
+
return IsDate(n) ? n : e;
|
|
2659
2726
|
} else if (c === 8) {
|
|
2660
|
-
const t = r.substring(0, 4),
|
|
2727
|
+
const t = r.substring(0, 4), l = r.substring(4, 6), n = r.substring(6, 8), u = `${t}/${l}/${n}`;
|
|
2661
2728
|
return IsDate(u) ? u : e;
|
|
2662
2729
|
} else if (c === 10) {
|
|
2663
|
-
const t = r.substring(0, 4),
|
|
2730
|
+
const t = r.substring(0, 4), l = r.substring(4, 6), n = r.substring(6, 8), u = r.substring(8, 10), i = `${t}/${l}/${n} ${u}:00:00`;
|
|
2664
2731
|
return IsDate(i) ? i : e;
|
|
2665
2732
|
} else if (c === 12) {
|
|
2666
|
-
const t = r.substring(0, 4),
|
|
2667
|
-
return IsDate(
|
|
2733
|
+
const t = r.substring(0, 4), l = r.substring(4, 6), n = r.substring(6, 8), u = r.substring(8, 10), i = r.substring(10, 12), a = `${t}/${l}/${n} ${u}:${i}:00`;
|
|
2734
|
+
return IsDate(a) ? a : e;
|
|
2668
2735
|
} else if (c === 14) {
|
|
2669
|
-
const t = r.substring(0, 4),
|
|
2670
|
-
return IsDate(
|
|
2736
|
+
const t = r.substring(0, 4), l = r.substring(4, 6), n = r.substring(6, 8), u = r.substring(8, 10), i = r.substring(10, 12), a = r.substring(12, 14), s = `${t}/${l}/${n} ${u}:${i}:${a}`;
|
|
2737
|
+
return IsDate(s) ? s : e;
|
|
2671
2738
|
} else
|
|
2672
2739
|
return e;
|
|
2673
2740
|
}
|
|
@@ -2680,17 +2747,17 @@ const Mask = (e, r) => {
|
|
|
2680
2747
|
}, r);
|
|
2681
2748
|
if (t ? (t.start = Number(t.start), t.end = Number(t.end), t.middle = Number(t.middle)) : t = { start: 0, end: 0, symbol: "*" }, t.start < 0 || t.end < 0)
|
|
2682
2749
|
return "";
|
|
2683
|
-
const
|
|
2684
|
-
if (t.start + t.end + t.middle >
|
|
2750
|
+
const l = e.length;
|
|
2751
|
+
if (t.start + t.end + t.middle > l)
|
|
2685
2752
|
return e;
|
|
2686
|
-
let
|
|
2687
|
-
for (let
|
|
2688
|
-
|
|
2753
|
+
let n = "";
|
|
2754
|
+
for (let a = 0; a < t.start && a < l; a++)
|
|
2755
|
+
n += e.charAt(a);
|
|
2689
2756
|
let u = "";
|
|
2690
|
-
for (let
|
|
2691
|
-
u = e.charAt(
|
|
2692
|
-
const i = t.symbol.repeat(Math.max(t.middle ||
|
|
2693
|
-
return
|
|
2757
|
+
for (let a = l - 1; a >= 0 && a >= l - t.end; a--)
|
|
2758
|
+
u = e.charAt(a) + u;
|
|
2759
|
+
const i = t.symbol.repeat(Math.max(t.middle || l - t.start - t.end, 0));
|
|
2760
|
+
return n + i + u;
|
|
2694
2761
|
}, MaskName = (e, r = "*") => {
|
|
2695
2762
|
const c = store.state.dictConfig.mask;
|
|
2696
2763
|
if (c.name)
|
|
@@ -2781,14 +2848,14 @@ const Mask = (e, r) => {
|
|
|
2781
2848
|
"褚师"
|
|
2782
2849
|
];
|
|
2783
2850
|
if (t.some(
|
|
2784
|
-
(
|
|
2851
|
+
(n) => e.startsWith(n)
|
|
2785
2852
|
))
|
|
2786
2853
|
return e.length <= 2 ? e : e.substring(0, 2) + (e.length > 2 ? r : "") + (e.length > 3 ? e.substring(3) : "");
|
|
2787
2854
|
{
|
|
2788
2855
|
if (e.length <= 1)
|
|
2789
2856
|
return e;
|
|
2790
|
-
const
|
|
2791
|
-
return e.length >= 4 && !t.includes(
|
|
2857
|
+
const n = e.substring(0, 2);
|
|
2858
|
+
return e.length >= 4 && !t.includes(n) && /^[\u4e00-\u9fa5]{2}$/.test(n) ? e.substring(0, 2) + (e.length > 2 ? r : "") + (e.length > 3 ? e.substring(3) : "") : e[0] + (e.length > 1 ? r : "") + (e.length > 2 ? e.substring(2) : "");
|
|
2792
2859
|
}
|
|
2793
2860
|
}, MaskIdCard = (e, r = "*") => {
|
|
2794
2861
|
const c = store.state.dictConfig.mask;
|
|
@@ -2797,9 +2864,9 @@ const Mask = (e, r) => {
|
|
|
2797
2864
|
const c = store.state.dictConfig.mask;
|
|
2798
2865
|
return c.mobile ? c.mobile(e, r) : e ? Mask(String(e), { start: 3, end: 4, symbol: r }) : "";
|
|
2799
2866
|
}, MaskEmail = (e, r = "*", c = 2, t = 1) => {
|
|
2800
|
-
const
|
|
2801
|
-
if (
|
|
2802
|
-
return
|
|
2867
|
+
const l = store.state.dictConfig.mask;
|
|
2868
|
+
if (l.email)
|
|
2869
|
+
return l.email(e, r, c, t);
|
|
2803
2870
|
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))
|
|
2804
2871
|
return e;
|
|
2805
2872
|
const [u, i] = e.split("@");
|
|
@@ -2810,11 +2877,11 @@ const Mask = (e, r) => {
|
|
|
2810
2877
|
return c.address(e, r);
|
|
2811
2878
|
if (!e)
|
|
2812
2879
|
return "";
|
|
2813
|
-
const t = e.trim().split(/\s+/),
|
|
2814
|
-
let
|
|
2815
|
-
for (let u = 0; u <
|
|
2816
|
-
/^[\u4e00-\u9fa5]+$/.test(t[u]) ?
|
|
2817
|
-
return
|
|
2880
|
+
const t = e.trim().split(/\s+/), l = t.length;
|
|
2881
|
+
let n = "";
|
|
2882
|
+
for (let u = 0; u < l; u++)
|
|
2883
|
+
/^[\u4e00-\u9fa5]+$/.test(t[u]) ? n += Mask(t[u], { start: 1, symbol: r }) : n += Mask(t[u], { start: 2, symbol: r }), u < l - 1 && (n += " ");
|
|
2884
|
+
return n;
|
|
2818
2885
|
}, maskTypeObj = {
|
|
2819
2886
|
mobile: MaskPhone,
|
|
2820
2887
|
name: MaskName,
|
|
@@ -2841,13 +2908,13 @@ const Mask = (e, r) => {
|
|
|
2841
2908
|
return t.defaultVal;
|
|
2842
2909
|
if (t.maskType)
|
|
2843
2910
|
return Object.keys(c).includes(t.maskType) ? c[t.maskType](e, t.symbol) : (console.error("maskType参数错误"), "");
|
|
2844
|
-
const
|
|
2911
|
+
const l = {
|
|
2845
2912
|
start: Number(t.start),
|
|
2846
2913
|
end: Number(t.end),
|
|
2847
2914
|
middle: Number(t.middle),
|
|
2848
2915
|
symbol: t.symbol
|
|
2849
2916
|
};
|
|
2850
|
-
return Mask(e,
|
|
2917
|
+
return Mask(e, l);
|
|
2851
2918
|
}, _sfc_main$f = /* @__PURE__ */ Object.assign({
|
|
2852
2919
|
name: "DictTag",
|
|
2853
2920
|
inheritAttrs: !1
|
|
@@ -2893,19 +2960,19 @@ const Mask = (e, r) => {
|
|
|
2893
2960
|
}
|
|
2894
2961
|
},
|
|
2895
2962
|
setup(e, { expose: r }) {
|
|
2896
|
-
const c = e, { modelValue: t, dictType:
|
|
2897
|
-
let
|
|
2963
|
+
const c = e, { modelValue: t, dictType: l, judgeTypeFun: n, type: u, judgeColorFun: i, color: a, judgeDisabledFun: s, disabled: d, defaultVal: g, emptyText: O } = toRefs(c), m = toRaw(store.state.dictConfig), p = computed(() => n.value ? n.value(t.value) : u.value ? u.value : o.value && o.value[m.format.type] ? o.value[m.format.type] : "primary"), b = computed(() => i.value ? i.value(t.value) : a.value ? a.value : o.value && o.value[m.format.color] ? o.value[m.format.color] : ""), _ = computed(() => s.value ? s.value(t.value) : o.value && o.value[m.format.disabled] ? o.value[m.format.disabled] : !!d.value);
|
|
2964
|
+
let o = ref(null), v = ref(null);
|
|
2898
2965
|
watchEffect(() => {
|
|
2899
|
-
if (!
|
|
2966
|
+
if (!l.value) {
|
|
2900
2967
|
v.value = t.value;
|
|
2901
2968
|
return;
|
|
2902
2969
|
}
|
|
2903
|
-
GetItemByCode(t.value,
|
|
2904
|
-
y ? (
|
|
2970
|
+
GetItemByCode(t.value, l.value).then((y) => {
|
|
2971
|
+
y ? (o.value = y, v.value = y[m.format.label]) : (o.value = null, v.value = String(g.value ?? (t.value === 0 ? 0 : t.value || O.value)));
|
|
2905
2972
|
});
|
|
2906
2973
|
});
|
|
2907
2974
|
const T = ref(null);
|
|
2908
|
-
return r({ getElTagRef: () => T.value }), (y,
|
|
2975
|
+
return r({ getElTagRef: () => T.value }), (y, A) => (openBlock(), createBlock(unref(ElTag), mergeProps({
|
|
2909
2976
|
class: "el-tag-dict",
|
|
2910
2977
|
ref_key: "ElTagRef",
|
|
2911
2978
|
ref: T,
|
|
@@ -2918,10 +2985,10 @@ const Mask = (e, r) => {
|
|
|
2918
2985
|
]),
|
|
2919
2986
|
_: 2
|
|
2920
2987
|
}, [
|
|
2921
|
-
renderList(y.$slots, (V,
|
|
2922
|
-
name:
|
|
2988
|
+
renderList(y.$slots, (V, x, F) => ({
|
|
2989
|
+
name: x,
|
|
2923
2990
|
fn: withCtx((B) => [
|
|
2924
|
-
renderSlot(y.$slots,
|
|
2991
|
+
renderSlot(y.$slots, x, mergeProps({ key: F }, B))
|
|
2925
2992
|
])
|
|
2926
2993
|
}))
|
|
2927
2994
|
]), 1040, ["type", "color", "disabled"]));
|
|
@@ -2976,37 +3043,37 @@ const Mask = (e, r) => {
|
|
|
2976
3043
|
},
|
|
2977
3044
|
emits: ["submit", "reset", "action"],
|
|
2978
3045
|
setup(e, { expose: r, emit: c }) {
|
|
2979
|
-
const t = e, { actionType:
|
|
3046
|
+
const t = e, { actionType: l, modelValue: n, dictType: u, judgeTypeFun: i, type: a, judgeColorFun: s, color: d, judgeDisabledFun: g, disabled: O, defaultVal: m, emptyText: p } = toRefs(t), b = c, _ = toRaw(store.state.dictConfig), o = computed(() => i.value ? i.value(n.value) : a.value ? a.value : w.value && w.value[_.format.type] ? w.value[_.format.type] : "primary"), v = computed(() => s.value ? s.value(n.value) : d.value ? d.value : w.value && w.value[_.format.color] ? w.value[_.format.color] : ""), T = computed(() => g.value ? g.value(n.value) : w.value && w.value[_.format.disabled] ? w.value[_.format.disabled] : !!O.value);
|
|
2980
3047
|
let w = ref(null), y = ref(null);
|
|
2981
3048
|
watchEffect(() => {
|
|
2982
3049
|
if (!u.value) {
|
|
2983
|
-
y.value =
|
|
3050
|
+
y.value = n.value;
|
|
2984
3051
|
return;
|
|
2985
3052
|
}
|
|
2986
|
-
GetItemByCode(
|
|
2987
|
-
F ? (w.value = F, y.value = F[_.format.label]) : (w.value = null, y.value = String(m.value ?? (
|
|
3053
|
+
GetItemByCode(n.value, u.value).then((F) => {
|
|
3054
|
+
F ? (w.value = F, y.value = F[_.format.label]) : (w.value = null, y.value = String(m.value ?? (n.value === 0 ? 0 : n.value || p.value)));
|
|
2988
3055
|
});
|
|
2989
3056
|
});
|
|
2990
|
-
const
|
|
2991
|
-
T.value || b(
|
|
3057
|
+
const A = () => {
|
|
3058
|
+
T.value || b(l.value, attrs);
|
|
2992
3059
|
}, V = ref(null);
|
|
2993
3060
|
return r({ getElLinkRef: () => V.value }), (F, B) => (openBlock(), createBlock(unref(ElLink), mergeProps({
|
|
2994
3061
|
class: "el-link-dict",
|
|
2995
3062
|
ref_key: "ElLinkRef",
|
|
2996
3063
|
ref: V,
|
|
2997
|
-
type:
|
|
3064
|
+
type: o.value,
|
|
2998
3065
|
color: v.value,
|
|
2999
3066
|
disabled: T.value
|
|
3000
|
-
}, F.$attrs, { onClick:
|
|
3067
|
+
}, F.$attrs, { onClick: A }), createSlots({
|
|
3001
3068
|
default: withCtx(() => [
|
|
3002
3069
|
createTextVNode(toDisplayString(unref(y)), 1)
|
|
3003
3070
|
]),
|
|
3004
3071
|
_: 2
|
|
3005
3072
|
}, [
|
|
3006
|
-
renderList(F.$slots, (L,
|
|
3007
|
-
name:
|
|
3073
|
+
renderList(F.$slots, (L, I, C) => ({
|
|
3074
|
+
name: I,
|
|
3008
3075
|
fn: withCtx((j) => [
|
|
3009
|
-
renderSlot(F.$slots,
|
|
3076
|
+
renderSlot(F.$slots, I, mergeProps({ key: C }, j))
|
|
3010
3077
|
])
|
|
3011
3078
|
}))
|
|
3012
3079
|
]), 1040, ["type", "color", "disabled"]));
|
|
@@ -3056,19 +3123,19 @@ const Mask = (e, r) => {
|
|
|
3056
3123
|
}
|
|
3057
3124
|
},
|
|
3058
3125
|
setup(e, { expose: r }) {
|
|
3059
|
-
const c = e, { modelValue: t, dictType:
|
|
3060
|
-
let
|
|
3126
|
+
const c = e, { modelValue: t, dictType: l, judgeTypeFun: n, type: u, judgeColorFun: i, color: a, judgeDisabledFun: s, disabled: d, defaultVal: g, emptyText: O } = toRefs(c), m = toRaw(store.state.dictConfig), p = computed(() => n.value ? n.value(t.value) : u.value ? u.value : o.value && o.value[m.format.type] ? o.value[m.format.type] : "primary"), b = computed(() => i.value ? i.value(t.value) : a.value ? a.value : o.value && o.value[m.format.color] ? o.value[m.format.color] : ""), _ = computed(() => s.value ? s.value(t.value) : o.value && o.value[m.format.disabled] ? o.value[m.format.disabled] : !!d.value);
|
|
3127
|
+
let o = ref(null), v = ref(null);
|
|
3061
3128
|
watchEffect(() => {
|
|
3062
|
-
if (!
|
|
3129
|
+
if (!l.value) {
|
|
3063
3130
|
v.value = t.value;
|
|
3064
3131
|
return;
|
|
3065
3132
|
}
|
|
3066
|
-
GetItemByCode(t.value,
|
|
3067
|
-
y ? (
|
|
3133
|
+
GetItemByCode(t.value, l.value).then((y) => {
|
|
3134
|
+
y ? (o.value = y, v.value = y[m.format.label]) : (o.value = null, v.value = String(g.value ?? (t.value === 0 ? 0 : t.value || O.value)));
|
|
3068
3135
|
});
|
|
3069
3136
|
});
|
|
3070
3137
|
const T = ref(null);
|
|
3071
|
-
return r({ getElTextRef: () => T.value }), (y,
|
|
3138
|
+
return r({ getElTextRef: () => T.value }), (y, A) => (openBlock(), createBlock(unref(ElText), mergeProps({
|
|
3072
3139
|
class: "el-text-dict",
|
|
3073
3140
|
ref_key: "ElTextRef",
|
|
3074
3141
|
ref: T,
|
|
@@ -3081,10 +3148,10 @@ const Mask = (e, r) => {
|
|
|
3081
3148
|
]),
|
|
3082
3149
|
_: 2
|
|
3083
3150
|
}, [
|
|
3084
|
-
renderList(y.$slots, (V,
|
|
3085
|
-
name:
|
|
3151
|
+
renderList(y.$slots, (V, x, F) => ({
|
|
3152
|
+
name: x,
|
|
3086
3153
|
fn: withCtx((B) => [
|
|
3087
|
-
renderSlot(y.$slots,
|
|
3154
|
+
renderSlot(y.$slots, x, mergeProps({ key: F }, B))
|
|
3088
3155
|
])
|
|
3089
3156
|
}))
|
|
3090
3157
|
]), 1040, ["type", "color", "disabled"]));
|
|
@@ -3102,73 +3169,73 @@ const Mask = (e, r) => {
|
|
|
3102
3169
|
}
|
|
3103
3170
|
},
|
|
3104
3171
|
setup(e, { expose: r }) {
|
|
3105
|
-
const c = e, { list: t } = toRefs(c),
|
|
3172
|
+
const c = e, { list: t } = toRefs(c), l = useAttrs();
|
|
3106
3173
|
ref("");
|
|
3107
|
-
const
|
|
3108
|
-
const
|
|
3109
|
-
return Object.entries(
|
|
3174
|
+
const n = computed(() => {
|
|
3175
|
+
const o = {};
|
|
3176
|
+
return Object.entries(l).forEach(([v, T]) => {
|
|
3110
3177
|
const w = ToKebabCase(v);
|
|
3111
3178
|
if (!w.startsWith("descriptions-item-") && !w.startsWith("on-descriptions-item-")) {
|
|
3112
3179
|
const y = ToCamelCase(w);
|
|
3113
|
-
|
|
3180
|
+
o[y] = T;
|
|
3114
3181
|
}
|
|
3115
|
-
}),
|
|
3182
|
+
}), o;
|
|
3116
3183
|
}), u = computed(() => {
|
|
3117
|
-
const
|
|
3118
|
-
return Object.entries(
|
|
3184
|
+
const o = {};
|
|
3185
|
+
return Object.entries(l).forEach(([v, T]) => {
|
|
3119
3186
|
const w = ToKebabCase(v);
|
|
3120
3187
|
if (w.startsWith("descriptions-item-") || w.startsWith("on-descriptions-item")) {
|
|
3121
3188
|
const y = ToCamelCase(w.replace("descriptions-item-", ""));
|
|
3122
|
-
|
|
3189
|
+
o[y] = T;
|
|
3123
3190
|
}
|
|
3124
|
-
}),
|
|
3191
|
+
}), o;
|
|
3125
3192
|
});
|
|
3126
|
-
function i(
|
|
3193
|
+
function i(o) {
|
|
3127
3194
|
return {
|
|
3128
3195
|
...u.value,
|
|
3129
|
-
...
|
|
3196
|
+
...o
|
|
3130
3197
|
};
|
|
3131
3198
|
}
|
|
3132
|
-
const
|
|
3199
|
+
const a = (o) => {
|
|
3133
3200
|
const v = {};
|
|
3134
|
-
return
|
|
3135
|
-
},
|
|
3201
|
+
return o.defaultVal !== void 0 && o.defaultVal !== null && (v.defaultVal = o.defaultVal), o.emptyText !== void 0 && o.emptyText !== null && (v.emptyText = o.emptyText), o.formatFun !== void 0 && o.formatFun !== null && (v.formatFun = o.formatFun), o.spacer !== void 0 && o.spacer !== null && (v.spacer = o.spacer), Object.assign(v, o.dictOptions || {});
|
|
3202
|
+
}, s = (o) => {
|
|
3136
3203
|
const v = {};
|
|
3137
|
-
return
|
|
3138
|
-
}, d = (
|
|
3139
|
-
if (
|
|
3140
|
-
if (Array.isArray(
|
|
3204
|
+
return o.defaultVal !== void 0 && o.defaultVal !== null && (v.defaultVal = o.defaultVal), o.emptyText !== void 0 && o.emptyText !== null && (v.emptyText = o.emptyText), o.formatFunIn !== void 0 && o.formatFunIn !== null && (v.formatFunIn = o.formatFunIn), o.formatFunOut !== void 0 && o.formatFunOut !== null && (v.formatFunOut = o.formatFunOut), o.treeSetting !== void 0 && o.treeSetting !== null && (v.treeSetting = o.treeSetting), o.spacer !== void 0 && o.spacer !== null && (v.spacer = o.spacer), Object.assign(v, o.dictOptions || {});
|
|
3205
|
+
}, d = (o) => !!o.maskType || !!o.maskStart || !!o.maskMiddle || !!o.maskEnd, g = (o) => {
|
|
3206
|
+
if (o.maskType) {
|
|
3207
|
+
if (Array.isArray(o.maskType))
|
|
3141
3208
|
return {
|
|
3142
|
-
start:
|
|
3143
|
-
middle:
|
|
3144
|
-
end:
|
|
3145
|
-
symbol:
|
|
3146
|
-
defaultVal:
|
|
3209
|
+
start: o.maskStart || o.maskType[0] || 0,
|
|
3210
|
+
middle: o.maskMiddle || o.maskType[1] || 0,
|
|
3211
|
+
end: o.maskEnd || o.maskType[2] || 0,
|
|
3212
|
+
symbol: o.maskSymbol || o.maskType[3] || "*",
|
|
3213
|
+
defaultVal: o.defaultVal
|
|
3147
3214
|
};
|
|
3148
|
-
if (typeof
|
|
3215
|
+
if (typeof o.maskType == "object") {
|
|
3149
3216
|
const v = {
|
|
3150
|
-
start:
|
|
3151
|
-
middle:
|
|
3152
|
-
end:
|
|
3153
|
-
symbol:
|
|
3154
|
-
defaultVal:
|
|
3217
|
+
start: o.maskStart || 0,
|
|
3218
|
+
middle: o.maskMiddle || 0,
|
|
3219
|
+
end: o.maskEnd || 0,
|
|
3220
|
+
symbol: o.maskSymbol || "*",
|
|
3221
|
+
defaultVal: o.defaultVal
|
|
3155
3222
|
};
|
|
3156
|
-
return Object.assign(v,
|
|
3223
|
+
return Object.assign(v, o.maskType);
|
|
3157
3224
|
} else
|
|
3158
|
-
return
|
|
3225
|
+
return o.maskType;
|
|
3159
3226
|
} else
|
|
3160
3227
|
return {
|
|
3161
|
-
start:
|
|
3162
|
-
middle:
|
|
3163
|
-
end:
|
|
3164
|
-
symbol:
|
|
3165
|
-
defaultVal:
|
|
3228
|
+
start: o.maskStart || 0,
|
|
3229
|
+
middle: o.maskMiddle || 0,
|
|
3230
|
+
end: o.maskEnd || 0,
|
|
3231
|
+
symbol: o.maskSymbol || "*",
|
|
3232
|
+
defaultVal: o.defaultVal
|
|
3166
3233
|
};
|
|
3167
|
-
}, O = (
|
|
3168
|
-
return r({ getElDescriptionsRef: () => m.value, getElDescriptionsItemRefs: () => p.value }), (
|
|
3234
|
+
}, O = (o, v = {}) => Array.isArray(o) ? o : typeof o == "string" ? o.split(v.spacer || ",") : typeof o == "number" ? [o] : [], m = ref(null), p = ref([]);
|
|
3235
|
+
return r({ getElDescriptionsRef: () => m.value, getElDescriptionsItemRefs: () => p.value }), (o, v) => (openBlock(), createBlock(unref(ElDescriptions), mergeProps({
|
|
3169
3236
|
ref_key: "ElDescriptionsRef",
|
|
3170
3237
|
ref: m
|
|
3171
|
-
},
|
|
3238
|
+
}, n.value), createSlots({
|
|
3172
3239
|
default: withCtx(() => [
|
|
3173
3240
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(t), (T, w) => (openBlock(), createBlock(unref(ElDescriptionsItem), mergeProps({
|
|
3174
3241
|
ref_for: !0,
|
|
@@ -3179,27 +3246,27 @@ const Mask = (e, r) => {
|
|
|
3179
3246
|
}, { ref_for: !0 }, i(T)), createSlots({
|
|
3180
3247
|
default: withCtx(() => [
|
|
3181
3248
|
T.dictType ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3182
|
-
T.dictTypeNode === "button" ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(O(T.modelValue,
|
|
3183
|
-
key:
|
|
3249
|
+
T.dictTypeNode === "button" ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(O(T.modelValue, a(T)), (y, A) => (openBlock(), createBlock(_sfc_main$n, {
|
|
3250
|
+
key: A,
|
|
3184
3251
|
modelValue: y || "",
|
|
3185
3252
|
dictType: T.dictType
|
|
3186
|
-
}, null, 8, ["modelValue", "dictType"]))), 128)) : T.dictTypeNode === "link" ? (openBlock(!0), createElementBlock(Fragment, { key: 1 }, renderList(O(T.modelValue,
|
|
3187
|
-
key:
|
|
3253
|
+
}, null, 8, ["modelValue", "dictType"]))), 128)) : T.dictTypeNode === "link" ? (openBlock(!0), createElementBlock(Fragment, { key: 1 }, renderList(O(T.modelValue, a(T)), (y, A) => (openBlock(), createBlock(_sfc_main$e, {
|
|
3254
|
+
key: A,
|
|
3188
3255
|
modelValue: y || "",
|
|
3189
3256
|
dictType: T.dictType
|
|
3190
|
-
}, null, 8, ["modelValue", "dictType"]))), 128)) : T.dictTypeNode === "tag" ? (openBlock(!0), createElementBlock(Fragment, { key: 2 }, renderList(O(T.modelValue,
|
|
3191
|
-
key:
|
|
3257
|
+
}, null, 8, ["modelValue", "dictType"]))), 128)) : T.dictTypeNode === "tag" ? (openBlock(!0), createElementBlock(Fragment, { key: 2 }, renderList(O(T.modelValue, a(T)), (y, A) => (openBlock(), createBlock(_sfc_main$f, {
|
|
3258
|
+
key: A,
|
|
3192
3259
|
modelValue: y || "",
|
|
3193
3260
|
dictType: T.dictType
|
|
3194
|
-
}, null, 8, ["modelValue", "dictType"]))), 128)) : T.dictTypeNode === "text" ? (openBlock(!0), createElementBlock(Fragment, { key: 3 }, renderList(O(T.modelValue,
|
|
3195
|
-
key:
|
|
3261
|
+
}, null, 8, ["modelValue", "dictType"]))), 128)) : T.dictTypeNode === "text" ? (openBlock(!0), createElementBlock(Fragment, { key: 3 }, renderList(O(T.modelValue, a(T)), (y, A) => (openBlock(), createBlock(_sfc_main$d, {
|
|
3262
|
+
key: A,
|
|
3196
3263
|
modelValue: y || "",
|
|
3197
3264
|
dictType: T.dictType
|
|
3198
3265
|
}, null, 8, ["modelValue", "dictType"]))), 128)) : (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
3199
|
-
createTextVNode(toDisplayString(unref(GetLabelByCodesFilter)(T.modelValue, T.dictType,
|
|
3266
|
+
createTextVNode(toDisplayString(unref(GetLabelByCodesFilter)(T.modelValue, T.dictType, a(T))), 1)
|
|
3200
3267
|
], 64))
|
|
3201
3268
|
], 64)) : T.dictTreeType ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3202
|
-
createTextVNode(toDisplayString(unref(GetTreeLabelByCodesFilter)(T.modelValue, T.dictTreeType,
|
|
3269
|
+
createTextVNode(toDisplayString(unref(GetTreeLabelByCodesFilter)(T.modelValue, T.dictTreeType, s(T))), 1)
|
|
3203
3270
|
], 64)) : T.dateFormat && T.modelValue ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
3204
3271
|
createTextVNode(toDisplayString(unref(FormatDate)(T.modelValue, T.dateFormat, T.defaultVal)), 1)
|
|
3205
3272
|
], 64)) : d(T) && T.modelValue ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
@@ -3210,11 +3277,11 @@ const Mask = (e, r) => {
|
|
|
3210
3277
|
]),
|
|
3211
3278
|
_: 2
|
|
3212
3279
|
}, [
|
|
3213
|
-
renderList(T.slotList, (y,
|
|
3280
|
+
renderList(T.slotList, (y, A) => ({
|
|
3214
3281
|
name: y.slotName,
|
|
3215
3282
|
fn: withCtx((V) => [
|
|
3216
3283
|
(openBlock(), createBlock(_sfc_main$m, {
|
|
3217
|
-
key:
|
|
3284
|
+
key: A,
|
|
3218
3285
|
render: y.render,
|
|
3219
3286
|
scope: V
|
|
3220
3287
|
}, null, 8, ["render", "scope"]))
|
|
@@ -3224,10 +3291,10 @@ const Mask = (e, r) => {
|
|
|
3224
3291
|
]),
|
|
3225
3292
|
_: 2
|
|
3226
3293
|
}, [
|
|
3227
|
-
renderList(
|
|
3294
|
+
renderList(o.$slots, (T, w, y) => ({
|
|
3228
3295
|
name: w,
|
|
3229
|
-
fn: withCtx((
|
|
3230
|
-
renderSlot(
|
|
3296
|
+
fn: withCtx((A) => [
|
|
3297
|
+
renderSlot(o.$slots, w, mergeProps({ key: y }, A), void 0, !0)
|
|
3231
3298
|
])
|
|
3232
3299
|
}))
|
|
3233
3300
|
]), 1040));
|
|
@@ -3267,126 +3334,126 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3267
3334
|
},
|
|
3268
3335
|
emits: ["pass", "fail", "update:modelValue", "action"],
|
|
3269
3336
|
setup(e, { expose: r, emit: c }) {
|
|
3270
|
-
const t = useAttrs(),
|
|
3337
|
+
const t = useAttrs(), l = toRaw(store.state.dictConfig), n = ref(null), u = e, { modelValue: i, rules: a, idField: s, componentList: d } = toRefs(u), g = c, O = computed(() => {
|
|
3271
3338
|
var D;
|
|
3272
3339
|
if (typeof t.colon == "boolean")
|
|
3273
3340
|
return t.colon;
|
|
3274
3341
|
if (typeof t.colon == "string" && t.colon === "")
|
|
3275
3342
|
return !0;
|
|
3276
|
-
const f = (D =
|
|
3343
|
+
const f = (D = l == null ? void 0 : l.dynamicComponentsConfig) == null ? void 0 : D.isShowLabelColon;
|
|
3277
3344
|
return typeof f == "boolean" ? f : !1;
|
|
3278
3345
|
}), m = ref([]), p = ref({});
|
|
3279
3346
|
let b = JSON.parse(JSON.stringify(p));
|
|
3280
3347
|
const _ = (f) => {
|
|
3281
3348
|
var k, E, N, R, H;
|
|
3282
|
-
if ((k =
|
|
3349
|
+
if ((k = l.dynamicComponentsConfig) != null && k.disabledNoPlaceholder && (f != null && f.disabled || (typeof t.disabled == "string" && t.disabled === "" || t.disabled) && (f == null ? void 0 : f.disabled) !== !1) || (E = l.dynamicComponentsConfig) != null && E.readonlyNoPlaceholder && (f != null && f.readonly || (typeof t.readonly == "string" && t.readonly === "" || t.readonly) && (f == null ? void 0 : f.readonly) !== !1))
|
|
3283
3350
|
return "";
|
|
3284
3351
|
let D = "请选择";
|
|
3285
|
-
return f != null && f.compName && ToKebabCase(f == null ? void 0 : f.compName).includes("input") && (D = "请输入"), (N =
|
|
3286
|
-
},
|
|
3352
|
+
return f != null && f.compName && ToKebabCase(f == null ? void 0 : f.compName).includes("input") && (D = "请输入"), (N = l.dynamicComponentsConfig) != null && N.isShowLabelPlaceholder && (D = D + ((R = f.formItemProps) == null ? void 0 : R.label)), ((H = f.props) == null ? void 0 : H.placeholder) || D || "";
|
|
3353
|
+
}, o = ref(!1), v = ref(""), T = JSON.parse(JSON.stringify(i.value)), w = () => {
|
|
3287
3354
|
var k, E, N, R, H, P, K, W, G, z, ee;
|
|
3288
3355
|
v.value = "id" + GenerateUUID();
|
|
3289
3356
|
let f = [];
|
|
3290
3357
|
for (let q = 0; q < d.value.length; q++) {
|
|
3291
|
-
const
|
|
3292
|
-
let
|
|
3293
|
-
if (
|
|
3294
|
-
|
|
3295
|
-
id:
|
|
3296
|
-
showRuleType: (
|
|
3297
|
-
validatorRuleType: (
|
|
3358
|
+
const $ = d.value[q];
|
|
3359
|
+
let le = null;
|
|
3360
|
+
if ($ != null && $.isFormData && ($ != null && $.fieldName) ? le = {
|
|
3361
|
+
...$,
|
|
3362
|
+
id: $ != null && $[s.value] ? $[s.value] : GenerateUUID(),
|
|
3363
|
+
showRuleType: ($ == null ? void 0 : $.showRuleType) || ((k = l == null ? void 0 : l.dynamicComponentsConfig) == null ? void 0 : k.showRuleType) || "compare",
|
|
3364
|
+
validatorRuleType: ($ == null ? void 0 : $.validatorRuleType) || ((E = l == null ? void 0 : l.dynamicComponentsConfig) == null ? void 0 : E.validatorRuleType) || "compare",
|
|
3298
3365
|
// 解决重置无法正常显示或隐藏的问题 有显示规则的先给他设置为 false
|
|
3299
|
-
visible:
|
|
3366
|
+
visible: $.showRules && $.showRules.length > 0 || $.hidden ? !1 : ($ == null ? void 0 : $.visible) ?? !0,
|
|
3300
3367
|
//
|
|
3301
3368
|
// 重点:拷贝props为新对象(若存在),断开与原item.props的引用
|
|
3302
|
-
props:
|
|
3303
|
-
...(N =
|
|
3304
|
-
|
|
3305
|
-
placeholder: _(
|
|
3369
|
+
props: $.props ? {
|
|
3370
|
+
...(N = l.dynamicComponentsConfig) == null ? void 0 : N.props,
|
|
3371
|
+
...$.props,
|
|
3372
|
+
placeholder: _($)
|
|
3306
3373
|
} : {
|
|
3307
|
-
...(R =
|
|
3308
|
-
placeholder: _(
|
|
3374
|
+
...(R = l.dynamicComponentsConfig) == null ? void 0 : R.props,
|
|
3375
|
+
placeholder: _($)
|
|
3309
3376
|
},
|
|
3310
|
-
formItemProps:
|
|
3311
|
-
|
|
3312
|
-
id:
|
|
3313
|
-
class: (H =
|
|
3377
|
+
formItemProps: $.formItemProps ? {
|
|
3378
|
+
...$.formItemProps,
|
|
3379
|
+
id: $ != null && $[s.value] ? $[s.value] : GenerateUUID(),
|
|
3380
|
+
class: (H = $.props) != null && H.class ? $.props.class + " " + (($ == null ? void 0 : $.fieldName) || "") : ($ == null ? void 0 : $.fieldName) || ""
|
|
3314
3381
|
} : {
|
|
3315
|
-
id:
|
|
3316
|
-
class: (
|
|
3382
|
+
id: $ != null && $[s.value] ? $[s.value] : GenerateUUID(),
|
|
3383
|
+
class: ($ == null ? void 0 : $.fieldName) || ""
|
|
3317
3384
|
}
|
|
3318
|
-
} :
|
|
3319
|
-
|
|
3320
|
-
id:
|
|
3321
|
-
showRuleType: (
|
|
3322
|
-
validatorRuleType: (
|
|
3385
|
+
} : le = {
|
|
3386
|
+
...$,
|
|
3387
|
+
id: $ != null && $[s.value] ? $[s.value] : GenerateUUID(),
|
|
3388
|
+
showRuleType: ($ == null ? void 0 : $.showRuleType) || ((P = l == null ? void 0 : l.dynamicComponentsConfig) == null ? void 0 : P.showRuleType) || "compare",
|
|
3389
|
+
validatorRuleType: ($ == null ? void 0 : $.validatorRuleType) || ((K = l == null ? void 0 : l.dynamicComponentsConfig) == null ? void 0 : K.validatorRuleType) || "compare",
|
|
3323
3390
|
// 解决重置无法正常显示或隐藏的问题 有显示规则的先给他设置为 false
|
|
3324
|
-
visible:
|
|
3391
|
+
visible: $.showRules && $.showRules.length > 0 || $.hidden ? !1 : ($ == null ? void 0 : $.visible) ?? !0,
|
|
3325
3392
|
// 默认为true(显示)
|
|
3326
3393
|
// 重点:拷贝props为新对象(若存在),断开与原item.props的引用
|
|
3327
|
-
props:
|
|
3328
|
-
|
|
3394
|
+
props: $.props ? {
|
|
3395
|
+
...$.props
|
|
3329
3396
|
} : {}
|
|
3330
|
-
}, (W =
|
|
3331
|
-
const ie = ((z =
|
|
3332
|
-
|
|
3397
|
+
}, (W = $.formItemProps) != null && W.rules || (G = a.value) != null && G[$.fieldName]) {
|
|
3398
|
+
const ie = ((z = $.formItemProps) == null ? void 0 : z.rules) || ((ee = a.value) == null ? void 0 : ee[$.fieldName]) || [];
|
|
3399
|
+
$.fieldName && (le.formItemProps.prop = le.formItemProps.prop || $.fieldName), le.formItemProps.required = ie.some((ve) => ve.required) || le.formItemProps.required || !1;
|
|
3333
3400
|
const ge = [...ie];
|
|
3334
|
-
|
|
3401
|
+
le.formItemProps.rules = ge.map((ve) => {
|
|
3335
3402
|
var M;
|
|
3336
3403
|
const Q = { ...ve };
|
|
3337
|
-
if (Q.required && !Q.message && (Q.message =
|
|
3404
|
+
if (Q.required && !Q.message && (Q.message = le.props.placeholder || `${le.formItemProps.label}不能为空`), Q.pattern && typeof Q.pattern == "string" && (Q.pattern = new RegExp(Q.pattern)), Q.validator) {
|
|
3338
3405
|
if (typeof Q.validator == "string") {
|
|
3339
|
-
const U = (M =
|
|
3406
|
+
const U = (M = l.validator) == null ? void 0 : M[Q.validator];
|
|
3340
3407
|
Q.validator = (Z, oe, re) => {
|
|
3341
3408
|
U(oe) ? re() : re((Q == null ? void 0 : Q.message) || "错误提示");
|
|
3342
3409
|
};
|
|
3343
3410
|
} else if (Array.isArray(Q.validator)) {
|
|
3344
3411
|
const U = [...Q.validator];
|
|
3345
|
-
|
|
3412
|
+
le.validatorRuleType === "calculate" ? Q.validator = (Z, oe, re) => {
|
|
3346
3413
|
U.some((ce) => CheckConditionsByOperation(ce, p.value)) ? re() : re((Q == null ? void 0 : Q.message) || "错误提示");
|
|
3347
|
-
} :
|
|
3414
|
+
} : le.validatorRuleType === "compare" ? Q.validator = (Z, oe, re) => {
|
|
3348
3415
|
U.some((ce) => CheckConditions(ce, p.value)) ? re() : re((Q == null ? void 0 : Q.message) || "错误提示");
|
|
3349
|
-
} :
|
|
3416
|
+
} : le.validatorRuleType && (Q.validator = (Z, oe, re) => {
|
|
3350
3417
|
let te = [];
|
|
3351
|
-
for (let
|
|
3352
|
-
const J = U[
|
|
3418
|
+
for (let ne = 0; ne < U.length; ne++) {
|
|
3419
|
+
const J = U[ne];
|
|
3353
3420
|
J.type === "calculate" ? te.push(J.rules.some((ue) => CheckConditionsByOperation(ue, p.value))) : J.type === "compare" && te.push(J.rules.some((ue) => CheckConditions(ue, p.value)));
|
|
3354
3421
|
}
|
|
3355
|
-
CalculateLogicalResult(te,
|
|
3422
|
+
CalculateLogicalResult(te, le.validatorRuleType) ? re() : re((Q == null ? void 0 : Q.message) || "错误提示");
|
|
3356
3423
|
});
|
|
3357
3424
|
}
|
|
3358
3425
|
}
|
|
3359
3426
|
return Q;
|
|
3360
3427
|
});
|
|
3361
3428
|
}
|
|
3362
|
-
f.push(
|
|
3429
|
+
f.push(le);
|
|
3363
3430
|
}
|
|
3364
3431
|
m.value = f;
|
|
3365
3432
|
const D = {};
|
|
3366
3433
|
m.value.forEach((q) => {
|
|
3367
|
-
var
|
|
3434
|
+
var $;
|
|
3368
3435
|
if (q.isFormData && q.fieldName) {
|
|
3369
|
-
const
|
|
3370
|
-
D[q.fieldName] = (q == null ? void 0 : q.modelValue) !== void 0 ? q.modelValue : ((
|
|
3436
|
+
const le = T == null ? void 0 : T[q.fieldName];
|
|
3437
|
+
D[q.fieldName] = (q == null ? void 0 : q.modelValue) !== void 0 ? q.modelValue : (($ = q == null ? void 0 : q.props) == null ? void 0 : $.modelValue) !== void 0 ? q.props.modelValue : le !== void 0 ? le : null;
|
|
3371
3438
|
}
|
|
3372
3439
|
}), p.value = JSON.parse(JSON.stringify(D));
|
|
3373
|
-
}, y = computed(() => typeof t.isScrollToFormError == "boolean" ? t.isScrollToFormError :
|
|
3440
|
+
}, y = computed(() => typeof t.isScrollToFormError == "boolean" ? t.isScrollToFormError : l.dynamicComponentsConfig.isScrollToFormError), A = async (f) => {
|
|
3374
3441
|
const D = JSON.parse(JSON.stringify(p.value)), k = sortComponentsByIdDependencies(m.value), E = [], N = (G) => typeof G == "string" ? G.split(",").filter(Boolean) : Array.isArray(G) ? G : [], R = async () => {
|
|
3375
|
-
if (
|
|
3442
|
+
if (n.value)
|
|
3376
3443
|
return;
|
|
3377
3444
|
const G = 1e3, z = 50;
|
|
3378
3445
|
let ee = 0;
|
|
3379
3446
|
return new Promise((q) => {
|
|
3380
|
-
const
|
|
3381
|
-
|
|
3447
|
+
const $ = () => {
|
|
3448
|
+
n.value || ee >= G ? q() : (ee += z, setTimeout($, z));
|
|
3382
3449
|
};
|
|
3383
|
-
|
|
3450
|
+
$();
|
|
3384
3451
|
});
|
|
3385
3452
|
}, H = async (G) => {
|
|
3386
|
-
if (await R(), !
|
|
3453
|
+
if (await R(), !n.value)
|
|
3387
3454
|
return !1;
|
|
3388
3455
|
try {
|
|
3389
|
-
return await (
|
|
3456
|
+
return await (n == null ? void 0 : n.value.validateField(G));
|
|
3390
3457
|
} catch {
|
|
3391
3458
|
return !1;
|
|
3392
3459
|
}
|
|
@@ -3394,11 +3461,11 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3394
3461
|
var z;
|
|
3395
3462
|
await R();
|
|
3396
3463
|
for (let ee = 0; ee < G.length; ee++) {
|
|
3397
|
-
const q = G[ee],
|
|
3464
|
+
const q = G[ee], $ = m.value.find((le) => {
|
|
3398
3465
|
var ie;
|
|
3399
|
-
return ((ie =
|
|
3466
|
+
return ((ie = le == null ? void 0 : le.formItemProps) == null ? void 0 : ie.prop) === q;
|
|
3400
3467
|
});
|
|
3401
|
-
|
|
3468
|
+
$ && (!p.value[$.fieldName] || Array.isArray(p.value[$.fieldName]) && p.value[$.fieldName].length === 0) && ((z = n.value) == null || z.clearValidate(q));
|
|
3402
3469
|
}
|
|
3403
3470
|
}, K = {
|
|
3404
3471
|
// 处理"calculate"类型
|
|
@@ -3410,15 +3477,15 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3410
3477
|
const z = N(G.showRules);
|
|
3411
3478
|
await R();
|
|
3412
3479
|
const ee = /* @__PURE__ */ new Set();
|
|
3413
|
-
if (
|
|
3480
|
+
if (n.value.fields.forEach((ge) => {
|
|
3414
3481
|
ge.validateState === "error" && ee.add(ge.prop);
|
|
3415
3482
|
}), await H(z))
|
|
3416
3483
|
return !0;
|
|
3417
|
-
const
|
|
3418
|
-
|
|
3419
|
-
ge.validateState === "error" &&
|
|
3484
|
+
const $ = /* @__PURE__ */ new Set();
|
|
3485
|
+
n.value.fields.forEach((ge) => {
|
|
3486
|
+
ge.validateState === "error" && $.add(ge.prop);
|
|
3420
3487
|
});
|
|
3421
|
-
const ie = [
|
|
3488
|
+
const ie = [...$].filter((ge) => !ee.has(ge)).filter((ge) => ge !== f);
|
|
3422
3489
|
return ie.length > 0 && await P(ie), !1;
|
|
3423
3490
|
},
|
|
3424
3491
|
// 处理嵌套类型(showRuleType为逻辑运算符,如"&&"、"||")
|
|
@@ -3435,20 +3502,20 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3435
3502
|
case "validate": {
|
|
3436
3503
|
const q = N(ee.rules);
|
|
3437
3504
|
await R();
|
|
3438
|
-
const
|
|
3439
|
-
|
|
3440
|
-
ie.validateState === "error" &&
|
|
3505
|
+
const $ = /* @__PURE__ */ new Set();
|
|
3506
|
+
n.value.fields.forEach((ie) => {
|
|
3507
|
+
ie.validateState === "error" && $.add(ie.prop);
|
|
3441
3508
|
});
|
|
3442
|
-
const
|
|
3443
|
-
if (!
|
|
3509
|
+
const le = await H(q);
|
|
3510
|
+
if (!le) {
|
|
3444
3511
|
const ie = /* @__PURE__ */ new Set();
|
|
3445
|
-
|
|
3512
|
+
n.value.fields.forEach((Q) => {
|
|
3446
3513
|
Q.validateState === "error" && ie.add(Q.prop);
|
|
3447
3514
|
});
|
|
3448
|
-
const ve = [...ie].filter((Q) =>
|
|
3515
|
+
const ve = [...ie].filter((Q) => !$.has(Q)).filter((Q) => Q !== f);
|
|
3449
3516
|
ve.length > 0 && await P(ve);
|
|
3450
3517
|
}
|
|
3451
|
-
z.push(
|
|
3518
|
+
z.push(le);
|
|
3452
3519
|
break;
|
|
3453
3520
|
}
|
|
3454
3521
|
default:
|
|
@@ -3465,9 +3532,9 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3465
3532
|
G.showRules && G.showRules.length > 0 && (ee = await (K[G.showRuleType] || K.default)(G)), G.visible = ee, G.fieldName && !z && ee && E.push(G.fieldName), !ee && G.fieldName && (D[G.fieldName] = Array.isArray(D[G.fieldName]) ? [] : "");
|
|
3466
3533
|
}
|
|
3467
3534
|
const W = E.filter((G) => {
|
|
3468
|
-
var
|
|
3535
|
+
var le, ie;
|
|
3469
3536
|
const z = k.find((ge) => ge.fieldName === G);
|
|
3470
|
-
if (!(((ie = (
|
|
3537
|
+
if (!(((ie = (le = z == null ? void 0 : z.formItemProps) == null ? void 0 : le.rules) == null ? void 0 : ie.length) > 0))
|
|
3471
3538
|
return !1;
|
|
3472
3539
|
const q = p.value[G];
|
|
3473
3540
|
return typeof q == "string" ? !!q.trim() : typeof q == "object" && q !== null && Object.keys(q).length > 0;
|
|
@@ -3475,9 +3542,9 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3475
3542
|
if (W.length > 0) {
|
|
3476
3543
|
await R();
|
|
3477
3544
|
const G = V();
|
|
3478
|
-
|
|
3545
|
+
o.value = !0, g("update:modelValue", G), setTimeout(() => {
|
|
3479
3546
|
var z;
|
|
3480
|
-
(z =
|
|
3547
|
+
(z = n.value) == null || z.validateField(W);
|
|
3481
3548
|
}, 0);
|
|
3482
3549
|
}
|
|
3483
3550
|
}, V = () => {
|
|
@@ -3487,7 +3554,7 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3487
3554
|
!k.visible && !k.hidden && delete f[k.fieldName];
|
|
3488
3555
|
}
|
|
3489
3556
|
return f;
|
|
3490
|
-
},
|
|
3557
|
+
}, x = (f, D, k = "") => {
|
|
3491
3558
|
const E = [];
|
|
3492
3559
|
if (typeof f != "object" || f === null || D === null)
|
|
3493
3560
|
return f !== D && E.push({
|
|
@@ -3498,7 +3565,7 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3498
3565
|
const N = /* @__PURE__ */ new Set([...Object.keys(f), ...Object.keys(D)]);
|
|
3499
3566
|
for (const R of N) {
|
|
3500
3567
|
const H = k ? `${k}.${R}` : R, P = f[R], K = D[R];
|
|
3501
|
-
typeof P == "object" && P !== null && !Array.isArray(P) ? E.push(...
|
|
3568
|
+
typeof P == "object" && P !== null && !Array.isArray(P) ? E.push(...x(P, K, H)) : P !== K && E.push({
|
|
3502
3569
|
key: H,
|
|
3503
3570
|
oldVal: K,
|
|
3504
3571
|
newVal: P
|
|
@@ -3524,17 +3591,17 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3524
3591
|
var E;
|
|
3525
3592
|
const D = JSON.parse(JSON.stringify(f));
|
|
3526
3593
|
if (F)
|
|
3527
|
-
|
|
3594
|
+
A();
|
|
3528
3595
|
else {
|
|
3529
|
-
const R = (E =
|
|
3596
|
+
const R = (E = x(D, b).find((H) => {
|
|
3530
3597
|
if (JSON.stringify(H.newVal) !== JSON.stringify(H.oldVal))
|
|
3531
3598
|
return !0;
|
|
3532
3599
|
})) == null ? void 0 : E.key;
|
|
3533
|
-
|
|
3600
|
+
A(R);
|
|
3534
3601
|
}
|
|
3535
3602
|
b = D;
|
|
3536
3603
|
const k = V();
|
|
3537
|
-
|
|
3604
|
+
o.value = !0, g("update:modelValue", k), F = !1;
|
|
3538
3605
|
},
|
|
3539
3606
|
{
|
|
3540
3607
|
deep: !0,
|
|
@@ -3543,8 +3610,8 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3543
3610
|
), watch(
|
|
3544
3611
|
() => u.modelValue,
|
|
3545
3612
|
() => {
|
|
3546
|
-
if (
|
|
3547
|
-
|
|
3613
|
+
if (o.value) {
|
|
3614
|
+
o.value = !1;
|
|
3548
3615
|
return;
|
|
3549
3616
|
}
|
|
3550
3617
|
w();
|
|
@@ -3562,20 +3629,20 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3562
3629
|
}
|
|
3563
3630
|
});
|
|
3564
3631
|
}, L = async () => {
|
|
3565
|
-
w(), await nextTick(),
|
|
3566
|
-
|
|
3632
|
+
w(), await nextTick(), n.value && setTimeout(() => {
|
|
3633
|
+
n.value.clearValidate();
|
|
3567
3634
|
}, 30);
|
|
3568
|
-
},
|
|
3635
|
+
}, I = (f) => {
|
|
3569
3636
|
const D = V();
|
|
3570
3637
|
g("action", f, D);
|
|
3571
3638
|
}, C = ref({});
|
|
3572
|
-
return r({ getFormData: V, resetFormData: w, getComponentRef: (f) => f ? C.value[f] : C.value, getDynamicComponentsRef: () =>
|
|
3639
|
+
return r({ getFormData: V, resetFormData: w, getComponentRef: (f) => f ? C.value[f] : C.value, getDynamicComponentsRef: () => n.value }), (f, D) => {
|
|
3573
3640
|
const k = resolveComponent("el-form-item"), E = resolveComponent("el-form");
|
|
3574
3641
|
return openBlock(), createBlock(E, mergeProps({
|
|
3575
3642
|
model: p.value,
|
|
3576
3643
|
class: ["dict-dynamic-components container-class", v.value],
|
|
3577
3644
|
ref_key: "DynamicComponentsRef",
|
|
3578
|
-
ref:
|
|
3645
|
+
ref: n
|
|
3579
3646
|
}, f.$attrs, { colon: O.value }), {
|
|
3580
3647
|
default: withCtx(() => [
|
|
3581
3648
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(m.value, (N, R) => {
|
|
@@ -3620,9 +3687,9 @@ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
3620
3687
|
class: "comp-item",
|
|
3621
3688
|
key: R
|
|
3622
3689
|
}, { ref_for: !0 }, N.props, {
|
|
3623
|
-
onSubmit: (P) => B(
|
|
3690
|
+
onSubmit: (P) => B(n.value, N),
|
|
3624
3691
|
onReset: L,
|
|
3625
|
-
onAction: (P) =>
|
|
3692
|
+
onAction: (P) => I(N)
|
|
3626
3693
|
}), createSlots({ _: 2 }, [
|
|
3627
3694
|
renderList((H = N == null ? void 0 : N.props) == null ? void 0 : H.slotList, (P, K) => ({
|
|
3628
3695
|
name: P.slotName,
|
|
@@ -3664,20 +3731,20 @@ const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
3664
3731
|
}
|
|
3665
3732
|
},
|
|
3666
3733
|
setup(e, { expose: r }) {
|
|
3667
|
-
const c = e, t = (i,
|
|
3734
|
+
const c = e, t = (i, a = {}) => Array.isArray(i) ? i : typeof i == "string" ? i.split(a.spacer || ",") : typeof i == "number" ? [i] : [], l = inject("tableConfig"), n = (i) => !i.children || i.children.length === 0 ? i.minWidth : "", u = () => c.column.children ? void 0 : c.column.prop;
|
|
3668
3735
|
return r({
|
|
3669
|
-
getMinWidth:
|
|
3736
|
+
getMinWidth: n,
|
|
3670
3737
|
getProp: u
|
|
3671
|
-
}), (i,
|
|
3672
|
-
const
|
|
3738
|
+
}), (i, a) => {
|
|
3739
|
+
const s = resolveComponent("recursive-header", !0);
|
|
3673
3740
|
return openBlock(), createBlock(unref(ElTableColumn), mergeProps({
|
|
3674
3741
|
label: e.column.label,
|
|
3675
|
-
"min-width":
|
|
3742
|
+
"min-width": n(e.column),
|
|
3676
3743
|
prop: u(),
|
|
3677
3744
|
fixed: e.column.fixed
|
|
3678
3745
|
}, i.$attrs), createSlots({
|
|
3679
3746
|
default: withCtx(() => [
|
|
3680
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.column.children, (d) => (openBlock(), createBlock(
|
|
3747
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.column.children, (d) => (openBlock(), createBlock(s, mergeProps({
|
|
3681
3748
|
key: d.prop || d.label + Math.random(),
|
|
3682
3749
|
column: d
|
|
3683
3750
|
}, { ref_for: !0 }, i.$attrs), null, 16, ["column"]))), 128))
|
|
@@ -3689,43 +3756,43 @@ const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
3689
3756
|
fn: withCtx((d) => {
|
|
3690
3757
|
var g, O, m, p, b, _;
|
|
3691
3758
|
return [
|
|
3692
|
-
(g = unref(
|
|
3693
|
-
key:
|
|
3759
|
+
(g = unref(l).findNodeByProp(e.column.prop)) != null && g.slotList ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(unref(l).findNodeByProp(e.column.prop).slotList, (o) => (openBlock(), createElementBlock("div", {
|
|
3760
|
+
key: o.slotName
|
|
3694
3761
|
}, [
|
|
3695
3762
|
(openBlock(), createBlock(_sfc_main$m, {
|
|
3696
|
-
key:
|
|
3697
|
-
render:
|
|
3763
|
+
key: o.slotName,
|
|
3764
|
+
render: o.render,
|
|
3698
3765
|
scope: d,
|
|
3699
3766
|
formData: d.row
|
|
3700
3767
|
}, null, 8, ["render", "scope", "formData"]))
|
|
3701
|
-
]))), 128)) : (O = unref(
|
|
3702
|
-
unref(
|
|
3768
|
+
]))), 128)) : (O = unref(l).findNodeByProp(e.column.prop)) != null && O.dictType ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3769
|
+
unref(l).findNodeByProp(e.column.prop).dictTypeNode === "button" ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(t(d.row[e.column.prop], unref(l).dictOptions), (o, v) => (openBlock(), createBlock(_sfc_main$n, {
|
|
3703
3770
|
key: v,
|
|
3704
|
-
dictType: unref(
|
|
3705
|
-
modelValue:
|
|
3706
|
-
}, null, 8, ["dictType", "modelValue"]))), 128)) : unref(
|
|
3771
|
+
dictType: unref(l).findNodeByProp(e.column.prop).dictType,
|
|
3772
|
+
modelValue: o || ""
|
|
3773
|
+
}, null, 8, ["dictType", "modelValue"]))), 128)) : unref(l).findNodeByProp(e.column.prop).dictTypeNode === "link" ? (openBlock(!0), createElementBlock(Fragment, { key: 1 }, renderList(t(d.row[e.column.prop], unref(l).dictOptions), (o, v) => (openBlock(), createBlock(_sfc_main$e, {
|
|
3707
3774
|
key: v,
|
|
3708
|
-
dictType: unref(
|
|
3709
|
-
modelValue:
|
|
3710
|
-
}, null, 8, ["dictType", "modelValue"]))), 128)) : unref(
|
|
3775
|
+
dictType: unref(l).findNodeByProp(e.column.prop).dictType,
|
|
3776
|
+
modelValue: o || ""
|
|
3777
|
+
}, null, 8, ["dictType", "modelValue"]))), 128)) : unref(l).findNodeByProp(e.column.prop).dictTypeNode === "tag" ? (openBlock(!0), createElementBlock(Fragment, { key: 2 }, renderList(t(d.row[e.column.prop], unref(l).dictOptions), (o, v) => (openBlock(), createBlock(_sfc_main$f, {
|
|
3711
3778
|
key: v,
|
|
3712
|
-
dictType: unref(
|
|
3713
|
-
modelValue:
|
|
3714
|
-
}, null, 8, ["dictType", "modelValue"]))), 128)) : unref(
|
|
3779
|
+
dictType: unref(l).findNodeByProp(e.column.prop).dictType,
|
|
3780
|
+
modelValue: o || ""
|
|
3781
|
+
}, null, 8, ["dictType", "modelValue"]))), 128)) : unref(l).findNodeByProp(e.column.prop).dictTypeNode === "text" ? (openBlock(!0), createElementBlock(Fragment, { key: 3 }, renderList(t(d.row[e.column.prop], unref(l).dictOptions), (o, v) => (openBlock(), createBlock(_sfc_main$d, {
|
|
3715
3782
|
key: v,
|
|
3716
|
-
dictType: unref(
|
|
3717
|
-
modelValue:
|
|
3783
|
+
dictType: unref(l).findNodeByProp(e.column.prop).dictType,
|
|
3784
|
+
modelValue: o || ""
|
|
3718
3785
|
}, null, 8, ["dictType", "modelValue"]))), 128)) : (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
3719
|
-
createTextVNode(toDisplayString(unref(
|
|
3786
|
+
createTextVNode(toDisplayString(unref(l).GetLabelByCodesFilter(d.row[e.column.prop], unref(l).findNodeByProp(e.column.prop).dictType, unref(l).dictOptions(unref(l).findNodeByProp(e.column.prop)))), 1)
|
|
3720
3787
|
], 64))
|
|
3721
|
-
], 64)) : (m = unref(
|
|
3722
|
-
createTextVNode(toDisplayString(unref(
|
|
3723
|
-
], 64)) : (p = unref(
|
|
3724
|
-
createTextVNode(toDisplayString(unref(
|
|
3725
|
-
], 64)) : (b = unref(
|
|
3726
|
-
createTextVNode(toDisplayString(unref(
|
|
3788
|
+
], 64)) : (m = unref(l).findNodeByProp(e.column.prop)) != null && m.dictTreeType ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
3789
|
+
createTextVNode(toDisplayString(unref(l).GetTreeLabelByCodesFilter(d.row[e.column.prop], unref(l).findNodeByProp(e.column.prop).dictTreeType, unref(l).dictTreeOptions(unref(l).findNodeByProp(e.column.prop)))), 1)
|
|
3790
|
+
], 64)) : (p = unref(l).findNodeByProp(e.column.prop)) != null && p.dateFormat ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
3791
|
+
createTextVNode(toDisplayString(unref(l).FormatDate(d.row[e.column.prop], unref(l).findNodeByProp(e.column.prop).dateFormat, unref(l).findNodeByProp(e.column.prop).defaultVal)), 1)
|
|
3792
|
+
], 64)) : (b = unref(l).findNodeByProp(e.column.prop)) != null && b.maskType || (_ = unref(l).findNodeByProp(e.column.prop)) != null && _.maskStart ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
3793
|
+
createTextVNode(toDisplayString(unref(l).Desensitization(d.row[e.column.prop], unref(l).maskOptions(unref(l).findNodeByProp(e.column.prop)))), 1)
|
|
3727
3794
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 5 }, [
|
|
3728
|
-
createTextVNode(toDisplayString(d.row[e.column.prop] || unref(
|
|
3795
|
+
createTextVNode(toDisplayString(d.row[e.column.prop] || unref(l).defaultVal), 1)
|
|
3729
3796
|
], 64))
|
|
3730
3797
|
];
|
|
3731
3798
|
}),
|
|
@@ -3751,22 +3818,22 @@ const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
3751
3818
|
}
|
|
3752
3819
|
},
|
|
3753
3820
|
setup(e, { expose: r }) {
|
|
3754
|
-
const c = e, t = (
|
|
3755
|
-
const
|
|
3756
|
-
return
|
|
3757
|
-
},
|
|
3758
|
-
const
|
|
3759
|
-
return
|
|
3760
|
-
}, u = (
|
|
3761
|
-
const
|
|
3762
|
-
return
|
|
3763
|
-
}, i = (
|
|
3764
|
-
for (let d = 0; d <
|
|
3765
|
-
const g =
|
|
3766
|
-
if (g.prop ===
|
|
3821
|
+
const c = e, t = (a) => !a.children || a.children.length === 0 ? a.minWidth : "", l = (a) => {
|
|
3822
|
+
const s = {};
|
|
3823
|
+
return a.defaultVal && (s.defaultVal = a.defaultVal), a.maskType && (s.maskType = a.maskType), a.maskStart && (s.start = a.maskStart), a.maskEnd && (s.end = a.maskEnd), a.maskMiddle && (s.middle = a.maskMiddle), a.maskSymbol && (s.symbol = a.maskSymbol), s;
|
|
3824
|
+
}, n = (a) => {
|
|
3825
|
+
const s = {};
|
|
3826
|
+
return a.defaultVal && (s.defaultVal = a.defaultVal), a.formatFunIn && (s.formatFunIn = a.formatFunIn), a.formatFunOut && (s.formatFunOut = a.formatFunOut), a.treeSetting && (s.treeSetting = a.treeSetting), a.spacer && (s.spacer = a.spacer), s;
|
|
3827
|
+
}, u = (a) => {
|
|
3828
|
+
const s = {};
|
|
3829
|
+
return a.defaultVal && (s.defaultVal = a.defaultVal), a.formatFun && (s.formatFun = a.formatFun), a.spacer && (s.spacer = a.spacer), s;
|
|
3830
|
+
}, i = (a, s = c.tableHeader) => {
|
|
3831
|
+
for (let d = 0; d < s.length; d++) {
|
|
3832
|
+
const g = s[d];
|
|
3833
|
+
if (g.prop === a)
|
|
3767
3834
|
return g;
|
|
3768
3835
|
if (g.children && g.children.length > 0) {
|
|
3769
|
-
const O = i(
|
|
3836
|
+
const O = i(a, g.children);
|
|
3770
3837
|
if (O)
|
|
3771
3838
|
return O;
|
|
3772
3839
|
}
|
|
@@ -3779,26 +3846,26 @@ const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
3779
3846
|
GetTreeLabelByCodesFilter,
|
|
3780
3847
|
FormatDate,
|
|
3781
3848
|
Desensitization,
|
|
3782
|
-
maskOptions:
|
|
3783
|
-
dictTreeOptions:
|
|
3849
|
+
maskOptions: l,
|
|
3850
|
+
dictTreeOptions: n,
|
|
3784
3851
|
dictOptions: u,
|
|
3785
3852
|
defaultVal: c.defaultVal
|
|
3786
3853
|
}), r({
|
|
3787
3854
|
getMinWidth: t,
|
|
3788
|
-
maskOptions:
|
|
3789
|
-
dictTreeOptions:
|
|
3855
|
+
maskOptions: l,
|
|
3856
|
+
dictTreeOptions: n,
|
|
3790
3857
|
dictOptions: u,
|
|
3791
3858
|
findNodeByProp: i,
|
|
3792
3859
|
GetLabelByCodesFilter,
|
|
3793
3860
|
GetTreeLabelByCodesFilter,
|
|
3794
3861
|
FormatDate,
|
|
3795
3862
|
Desensitization
|
|
3796
|
-
}), (
|
|
3863
|
+
}), (a, s) => (openBlock(), createBlock(unref(ElTable), normalizeProps(guardReactiveProps(a.$attrs)), {
|
|
3797
3864
|
default: withCtx(() => [
|
|
3798
3865
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.tableHeader, (d) => (openBlock(), createBlock(RecursiveHeader, mergeProps({
|
|
3799
3866
|
key: d.prop || d.label + Math.random(),
|
|
3800
3867
|
column: d
|
|
3801
|
-
}, { ref_for: !0 },
|
|
3868
|
+
}, { ref_for: !0 }, a.$attrs), null, 16, ["column"]))), 128))
|
|
3802
3869
|
]),
|
|
3803
3870
|
_: 1
|
|
3804
3871
|
}, 16));
|
|
@@ -3923,12 +3990,12 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
3923
3990
|
emits: ["fail", "pass", "reset", "update:modelValue"],
|
|
3924
3991
|
setup(e, { emit: r }) {
|
|
3925
3992
|
const c = toRaw(store.state.dictConfig), t = e, {
|
|
3926
|
-
rules:
|
|
3927
|
-
idField:
|
|
3993
|
+
rules: l,
|
|
3994
|
+
idField: n,
|
|
3928
3995
|
debounceTime: u,
|
|
3929
3996
|
debounceImmediate: i,
|
|
3930
|
-
expandText:
|
|
3931
|
-
foldText:
|
|
3997
|
+
expandText: a,
|
|
3998
|
+
foldText: s,
|
|
3932
3999
|
searchText: d,
|
|
3933
4000
|
resetText: g,
|
|
3934
4001
|
foldOnReset: O,
|
|
@@ -3936,20 +4003,20 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
3936
4003
|
expandOnError: p,
|
|
3937
4004
|
modelValue: b,
|
|
3938
4005
|
rows: _,
|
|
3939
|
-
isAutoSetPlaceholder:
|
|
4006
|
+
isAutoSetPlaceholder: o,
|
|
3940
4007
|
isShowLabelPlaceholder: v,
|
|
3941
4008
|
list: T,
|
|
3942
4009
|
largeWidth: w,
|
|
3943
4010
|
mediumWidth: y,
|
|
3944
|
-
smallWidth:
|
|
4011
|
+
smallWidth: A,
|
|
3945
4012
|
foldStatus: V,
|
|
3946
|
-
showFold:
|
|
4013
|
+
showFold: x,
|
|
3947
4014
|
showReset: F,
|
|
3948
4015
|
showSearch: B
|
|
3949
|
-
} = toRefs(t), L = r,
|
|
3950
|
-
let S = JSON.parse(JSON.stringify(
|
|
3951
|
-
const f = ref(V.value), D = ref(window.innerWidth), k = computed(() => D.value > w.value ? 4 : D.value > y.value ? 3 : D.value >
|
|
3952
|
-
if (!
|
|
4016
|
+
} = toRefs(t), L = r, I = ref({}), C = ref(null), j = ref([]);
|
|
4017
|
+
let S = JSON.parse(JSON.stringify(I));
|
|
4018
|
+
const f = ref(V.value), D = ref(window.innerWidth), k = computed(() => D.value > w.value ? 4 : D.value > y.value ? 3 : D.value > A.value ? 2 : 1), E = computed(() => {
|
|
4019
|
+
if (!x.value || !f.value)
|
|
3953
4020
|
return [];
|
|
3954
4021
|
const M = [];
|
|
3955
4022
|
for (let U = 0; U < ie.value.length; U++) {
|
|
@@ -3961,12 +4028,12 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
3961
4028
|
}), N = (M = {}) => {
|
|
3962
4029
|
var oe;
|
|
3963
4030
|
let U = (oe = M == null ? void 0 : M.formItemProps) != null && oe.class ? M.formItemProps.class + " " + ((M == null ? void 0 : M.fieldName) || "") : (M == null ? void 0 : M.fieldName) || "";
|
|
3964
|
-
if (k.value === 4 ? U += " quarter" : k.value === 3 ? U += " triple" : k.value === 2 ? U += " half" : U += " full", !
|
|
4031
|
+
if (k.value === 4 ? U += " quarter" : k.value === 3 ? U += " triple" : k.value === 2 ? U += " half" : U += " full", !x.value || !f.value)
|
|
3965
4032
|
return U;
|
|
3966
4033
|
const Z = ie.value.findIndex((re) => re.fieldName === M.fieldName);
|
|
3967
4034
|
return k.value === 1 ? Z + 1 > _.value && (U += " hide") : Z + 1 > _.value * k.value - 1 && (U += " hide"), U;
|
|
3968
4035
|
}, R = () => {
|
|
3969
|
-
const M = JSON.parse(JSON.stringify(
|
|
4036
|
+
const M = JSON.parse(JSON.stringify(I.value));
|
|
3970
4037
|
for (let U = 0; U < j.value.length; U++) {
|
|
3971
4038
|
const Z = j.value[U];
|
|
3972
4039
|
!Z.visible && !Z.hidden && delete M[Z.fieldName];
|
|
@@ -3982,16 +4049,16 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
3982
4049
|
}), oe;
|
|
3983
4050
|
const re = /* @__PURE__ */ new Set([...Object.keys(M), ...Object.keys(U)]);
|
|
3984
4051
|
for (const te of re) {
|
|
3985
|
-
const ce = Z ? `${Z}.${te}` : te,
|
|
3986
|
-
typeof
|
|
4052
|
+
const ce = Z ? `${Z}.${te}` : te, ne = M[te], J = U[te];
|
|
4053
|
+
typeof ne == "object" && ne !== null && !Array.isArray(ne) ? oe.push(...H(ne, J, ce)) : ne !== J && oe.push({
|
|
3987
4054
|
key: ce,
|
|
3988
4055
|
oldVal: J,
|
|
3989
|
-
newVal:
|
|
4056
|
+
newVal: ne
|
|
3990
4057
|
});
|
|
3991
4058
|
}
|
|
3992
4059
|
return oe;
|
|
3993
4060
|
}, P = async (M) => {
|
|
3994
|
-
const U = JSON.parse(JSON.stringify(
|
|
4061
|
+
const U = JSON.parse(JSON.stringify(I.value)), Z = sortComponentsByIdDependencies(j.value), oe = [], re = (X) => typeof X == "string" ? X.split(",").filter(Boolean) : Array.isArray(X) ? X : [], te = async () => {
|
|
3995
4062
|
if (C.value)
|
|
3996
4063
|
return;
|
|
3997
4064
|
const X = 1e3, ae = 50;
|
|
@@ -4010,7 +4077,7 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4010
4077
|
} catch {
|
|
4011
4078
|
return !1;
|
|
4012
4079
|
}
|
|
4013
|
-
},
|
|
4080
|
+
}, ne = async (X) => {
|
|
4014
4081
|
var ae;
|
|
4015
4082
|
await te();
|
|
4016
4083
|
for (let se = 0; se < X.length; se++) {
|
|
@@ -4018,7 +4085,7 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4018
4085
|
var de;
|
|
4019
4086
|
return ((de = pe == null ? void 0 : pe.formItemProps) == null ? void 0 : de.prop) === Y;
|
|
4020
4087
|
});
|
|
4021
|
-
fe && (
|
|
4088
|
+
fe && (!I.value[fe.fieldName] || Array.isArray(I.value[fe.fieldName]) && I.value[fe.fieldName].length === 0) && ((ae = C.value) == null || ae.clearValidate(Y));
|
|
4022
4089
|
}
|
|
4023
4090
|
}, J = {
|
|
4024
4091
|
// 处理"calculate"类型
|
|
@@ -4039,7 +4106,7 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4039
4106
|
me.validateState === "error" && fe.add(me.prop);
|
|
4040
4107
|
});
|
|
4041
4108
|
const de = [...fe].filter((me) => !se.has(me)).filter((me) => me !== M);
|
|
4042
|
-
return de.length > 0 && await
|
|
4109
|
+
return de.length > 0 && await ne(de), !1;
|
|
4043
4110
|
},
|
|
4044
4111
|
// 处理嵌套类型(showRuleType为逻辑运算符,如"&&"、"||")
|
|
4045
4112
|
default: async (X) => {
|
|
@@ -4066,7 +4133,7 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4066
4133
|
be.validateState === "error" && de.add(be.prop);
|
|
4067
4134
|
});
|
|
4068
4135
|
const ye = [...de].filter((be) => !fe.has(be)).filter((be) => be !== M);
|
|
4069
|
-
ye.length > 0 && await
|
|
4136
|
+
ye.length > 0 && await ne(ye);
|
|
4070
4137
|
}
|
|
4071
4138
|
ae.push(pe);
|
|
4072
4139
|
break;
|
|
@@ -4089,7 +4156,7 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4089
4156
|
const ae = Z.find((me) => me.fieldName === X);
|
|
4090
4157
|
if (!(((de = (pe = ae == null ? void 0 : ae.formItemProps) == null ? void 0 : pe.rules) == null ? void 0 : de.length) > 0))
|
|
4091
4158
|
return !1;
|
|
4092
|
-
const Y =
|
|
4159
|
+
const Y = I.value[X];
|
|
4093
4160
|
return typeof Y == "string" ? !!Y.trim() : typeof Y == "object" && Y !== null && Object.keys(Y).length > 0;
|
|
4094
4161
|
});
|
|
4095
4162
|
if (ue.length > 0) {
|
|
@@ -4103,7 +4170,7 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4103
4170
|
};
|
|
4104
4171
|
let K = !0;
|
|
4105
4172
|
watch(
|
|
4106
|
-
|
|
4173
|
+
I,
|
|
4107
4174
|
(M) => {
|
|
4108
4175
|
var oe;
|
|
4109
4176
|
const U = JSON.parse(JSON.stringify(M));
|
|
@@ -4130,7 +4197,7 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4130
4197
|
ee.value = !1;
|
|
4131
4198
|
return;
|
|
4132
4199
|
}
|
|
4133
|
-
|
|
4200
|
+
le();
|
|
4134
4201
|
},
|
|
4135
4202
|
{ deep: !0 }
|
|
4136
4203
|
);
|
|
@@ -4153,14 +4220,14 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4153
4220
|
var U, Z;
|
|
4154
4221
|
if ((U = M == null ? void 0 : M.props) != null && U.placeholder)
|
|
4155
4222
|
return (Z = M == null ? void 0 : M.props) == null ? void 0 : Z.placeholder;
|
|
4156
|
-
if (
|
|
4223
|
+
if (o.value)
|
|
4157
4224
|
return M.compName.toLocaleLowerCase().includes("input") ? v.value ? "请输入" + M.label : "请输入" : v.value ? "请选择" + M.label : "请选择";
|
|
4158
|
-
}, ee = ref(!1), q = ref(""),
|
|
4225
|
+
}, ee = ref(!1), q = ref(""), $ = JSON.parse(JSON.stringify(b.value)), le = () => {
|
|
4159
4226
|
var oe, re, te, ce;
|
|
4160
4227
|
q.value = "id" + GenerateUUID();
|
|
4161
4228
|
let M = [], U = [];
|
|
4162
|
-
for (let
|
|
4163
|
-
const J = T.value[
|
|
4229
|
+
for (let ne = 0; ne < T.value.length; ne++) {
|
|
4230
|
+
const J = T.value[ne];
|
|
4164
4231
|
let ue = null;
|
|
4165
4232
|
if (J != null && J.fieldName) {
|
|
4166
4233
|
if (U.includes(J == null ? void 0 : J.fieldName)) {
|
|
@@ -4171,7 +4238,7 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4171
4238
|
const X = J.showRules && J.showRules.length > 0 || J.hidden ? !1 : (J == null ? void 0 : J.visible) ?? !0;
|
|
4172
4239
|
ue = {
|
|
4173
4240
|
...J,
|
|
4174
|
-
id: J != null && J[
|
|
4241
|
+
id: J != null && J[n.value] ? J[n.value] : GenerateUUID(),
|
|
4175
4242
|
showRuleType: (J == null ? void 0 : J.showRuleType) || "compare",
|
|
4176
4243
|
validatorRuleType: (J == null ? void 0 : J.validatorRuleType) || "compare",
|
|
4177
4244
|
// 解决重置无法正常显示或隐藏的问题 有显示规则的先给他设置为 false
|
|
@@ -4186,15 +4253,15 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4186
4253
|
},
|
|
4187
4254
|
formItemProps: J.formItemProps ? {
|
|
4188
4255
|
...J.formItemProps,
|
|
4189
|
-
id: J != null && J[
|
|
4256
|
+
id: J != null && J[n.value] ? J[n.value] : GenerateUUID()
|
|
4190
4257
|
} : {
|
|
4191
|
-
id: J != null && J[
|
|
4258
|
+
id: J != null && J[n.value] ? J[n.value] : GenerateUUID()
|
|
4192
4259
|
}
|
|
4193
4260
|
};
|
|
4194
4261
|
} else
|
|
4195
4262
|
console.log("缺少fieldName", J);
|
|
4196
|
-
if ((oe = J.formItemProps) != null && oe.rules || (re =
|
|
4197
|
-
const X = ((te = J.formItemProps) == null ? void 0 : te.rules) || ((ce =
|
|
4263
|
+
if ((oe = J.formItemProps) != null && oe.rules || (re = l.value) != null && re[J.fieldName]) {
|
|
4264
|
+
const X = ((te = J.formItemProps) == null ? void 0 : te.rules) || ((ce = l.value) == null ? void 0 : ce[J.fieldName]) || [];
|
|
4198
4265
|
J.fieldName && (ue.formItemProps.prop = ue.formItemProps.prop || J.fieldName), ue.formItemProps.required = X.some((se) => se.required) || ue.formItemProps.required || !1;
|
|
4199
4266
|
const ae = [...X];
|
|
4200
4267
|
ue.formItemProps.rules = ae.map((se) => {
|
|
@@ -4209,14 +4276,14 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4209
4276
|
} else if (Array.isArray(Y.validator)) {
|
|
4210
4277
|
const pe = [...Y.validator];
|
|
4211
4278
|
ue.validatorRuleType === "calculate" ? Y.validator = (de, me, ye) => {
|
|
4212
|
-
pe.some((he) => CheckConditionsByOperation(he,
|
|
4279
|
+
pe.some((he) => CheckConditionsByOperation(he, I.value)) ? ye() : ye((Y == null ? void 0 : Y.message) || "错误提示");
|
|
4213
4280
|
} : ue.validatorRuleType === "compare" ? Y.validator = (de, me, ye) => {
|
|
4214
|
-
pe.some((he) => CheckConditions(he,
|
|
4281
|
+
pe.some((he) => CheckConditions(he, I.value)) ? ye() : ye((Y == null ? void 0 : Y.message) || "错误提示");
|
|
4215
4282
|
} : ue.validatorRuleType && (Y.validator = (de, me, ye) => {
|
|
4216
4283
|
let be = [];
|
|
4217
4284
|
for (let De = 0; De < pe.length; De++) {
|
|
4218
4285
|
const Te = pe[De];
|
|
4219
|
-
Te.type === "calculate" ? be.push(Te.rules.some((_e) => CheckConditionsByOperation(_e,
|
|
4286
|
+
Te.type === "calculate" ? be.push(Te.rules.some((_e) => CheckConditionsByOperation(_e, I.value))) : Te.type === "compare" && be.push(Te.rules.some((_e) => CheckConditions(_e, I.value)));
|
|
4220
4287
|
}
|
|
4221
4288
|
CalculateLogicalResult(be, ue.validatorRuleType) ? ye() : ye((Y == null ? void 0 : Y.message) || "错误提示");
|
|
4222
4289
|
});
|
|
@@ -4229,18 +4296,18 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4229
4296
|
}
|
|
4230
4297
|
j.value = M;
|
|
4231
4298
|
const Z = {};
|
|
4232
|
-
j.value.forEach((
|
|
4299
|
+
j.value.forEach((ne) => {
|
|
4233
4300
|
var J;
|
|
4234
|
-
if (
|
|
4235
|
-
const ue =
|
|
4236
|
-
Z[
|
|
4301
|
+
if (ne.fieldName) {
|
|
4302
|
+
const ue = $ == null ? void 0 : $[ne.fieldName];
|
|
4303
|
+
Z[ne.fieldName] = (ne == null ? void 0 : ne.modelValue) !== void 0 ? ne.modelValue : ((J = ne == null ? void 0 : ne.props) == null ? void 0 : J.modelValue) !== void 0 ? ne.props.modelValue : ue !== void 0 ? ue : null;
|
|
4237
4304
|
}
|
|
4238
|
-
}),
|
|
4305
|
+
}), I.value = JSON.parse(JSON.stringify(Z));
|
|
4239
4306
|
};
|
|
4240
4307
|
watch(
|
|
4241
4308
|
T,
|
|
4242
4309
|
(M) => {
|
|
4243
|
-
|
|
4310
|
+
le();
|
|
4244
4311
|
},
|
|
4245
4312
|
{
|
|
4246
4313
|
immediate: !0,
|
|
@@ -4248,27 +4315,27 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4248
4315
|
}
|
|
4249
4316
|
);
|
|
4250
4317
|
const ie = computed(() => j.value.filter((M) => M.visible)), ge = computed(() => k.value === 1 ? ie.value.length > _.value : ie.value.length > _.value * k.value - 1), ve = async () => {
|
|
4251
|
-
|
|
4318
|
+
le(), await nextTick(), C.value && setTimeout(() => {
|
|
4252
4319
|
C.value.clearValidate(), O.value && (f.value = !0), L("reset");
|
|
4253
4320
|
}, 30);
|
|
4254
4321
|
}, Q = async () => {
|
|
4255
4322
|
await nextTick(), C.value.validate((M, U) => {
|
|
4256
|
-
M ? (Object.keys(
|
|
4257
|
-
const te =
|
|
4323
|
+
M ? (Object.keys(I.value).filter((re) => {
|
|
4324
|
+
const te = I.value[re];
|
|
4258
4325
|
return !(te == null || te === "" || typeof te == "number" && Number.isNaN(te) || Array.isArray(te) && te.length === 0 || typeof te == "string" && te.trim() === "");
|
|
4259
|
-
}).some((re) => E.value.includes(re)) && m.value && (f.value = !1), L("pass",
|
|
4326
|
+
}).some((re) => E.value.includes(re)) && m.value && (f.value = !1), L("pass", I.value)) : ((Object.keys(U).some((re) => E.value.includes(re)) || p.value) && (f.value = !1), L("fail", U, I.value));
|
|
4260
4327
|
});
|
|
4261
4328
|
};
|
|
4262
4329
|
return (M, U) => (openBlock(), createBlock(unref(ElForm), mergeProps({
|
|
4263
4330
|
ref_key: "SearchFormRef",
|
|
4264
4331
|
ref: C,
|
|
4265
4332
|
style: { minWidth: e.minWidth + "px" },
|
|
4266
|
-
model:
|
|
4333
|
+
model: I.value,
|
|
4267
4334
|
class: ["dict-search-box dict-clearfix", q.value]
|
|
4268
4335
|
}, M.$attrs), {
|
|
4269
4336
|
default: withCtx(() => [
|
|
4270
4337
|
renderSlot(M.$slots, "prepend", {
|
|
4271
|
-
searchForm:
|
|
4338
|
+
searchForm: I.value,
|
|
4272
4339
|
fold: f.value,
|
|
4273
4340
|
itemsPerRow: k.value
|
|
4274
4341
|
}, void 0, !0),
|
|
@@ -4282,20 +4349,20 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4282
4349
|
var re;
|
|
4283
4350
|
return [
|
|
4284
4351
|
(openBlock(), createBlock(resolveDynamicComponent(Z.compName), mergeProps({
|
|
4285
|
-
modelValue:
|
|
4352
|
+
modelValue: I.value[Z.fieldName],
|
|
4286
4353
|
"onUpdate:modelValue": (te) => {
|
|
4287
|
-
|
|
4354
|
+
I.value[Z.fieldName] = te;
|
|
4288
4355
|
},
|
|
4289
4356
|
clearable: !Z.props.clearable && Z.props.clearable !== !1 ? !0 : Z.props.clearable
|
|
4290
4357
|
}, { ref_for: !0 }, Z.props), createSlots({ _: 2 }, [
|
|
4291
4358
|
renderList((re = Z == null ? void 0 : Z.props) == null ? void 0 : re.slotList, (te, ce) => ({
|
|
4292
4359
|
name: te.slotName,
|
|
4293
|
-
fn: withCtx((
|
|
4360
|
+
fn: withCtx((ne) => [
|
|
4294
4361
|
(openBlock(), createBlock(_sfc_main$m, {
|
|
4295
4362
|
key: ce,
|
|
4296
4363
|
render: te.render,
|
|
4297
|
-
scope:
|
|
4298
|
-
searchForm:
|
|
4364
|
+
scope: ne,
|
|
4365
|
+
searchForm: I.value
|
|
4299
4366
|
}, null, 8, ["render", "scope", "searchForm"]))
|
|
4300
4367
|
])
|
|
4301
4368
|
}))
|
|
@@ -4310,7 +4377,7 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4310
4377
|
}, {
|
|
4311
4378
|
default: withCtx(() => [
|
|
4312
4379
|
renderSlot(M.$slots, "button-prefix", {
|
|
4313
|
-
searchForm:
|
|
4380
|
+
searchForm: I.value,
|
|
4314
4381
|
fold: f.value,
|
|
4315
4382
|
itemsPerRow: k.value
|
|
4316
4383
|
}, void 0, !0),
|
|
@@ -4337,11 +4404,11 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4337
4404
|
[vShow, unref(B)]
|
|
4338
4405
|
]),
|
|
4339
4406
|
renderSlot(M.$slots, "button-suffix", {
|
|
4340
|
-
searchForm:
|
|
4407
|
+
searchForm: I.value,
|
|
4341
4408
|
fold: f.value,
|
|
4342
4409
|
itemsPerRow: k.value
|
|
4343
4410
|
}, void 0, !0),
|
|
4344
|
-
unref(
|
|
4411
|
+
unref(x) && ge.value ? (openBlock(), createBlock(unref(ElLink), {
|
|
4345
4412
|
key: 0,
|
|
4346
4413
|
class: "no-underline",
|
|
4347
4414
|
underline: "never",
|
|
@@ -4349,7 +4416,7 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4349
4416
|
onClick: U[0] || (U[0] = (Z) => f.value = !f.value)
|
|
4350
4417
|
}, {
|
|
4351
4418
|
default: withCtx(() => [
|
|
4352
|
-
createTextVNode(toDisplayString(f.value ? unref(
|
|
4419
|
+
createTextVNode(toDisplayString(f.value ? unref(a) : unref(s)), 1),
|
|
4353
4420
|
createVNode(unref(ElIcon), {
|
|
4354
4421
|
class: normalizeClass(f.value ? "" : "rotate")
|
|
4355
4422
|
}, {
|
|
@@ -4365,7 +4432,7 @@ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4365
4432
|
_: 3
|
|
4366
4433
|
}, 8, ["class"]),
|
|
4367
4434
|
renderSlot(M.$slots, "append", {
|
|
4368
|
-
searchForm:
|
|
4435
|
+
searchForm: I.value,
|
|
4369
4436
|
fold: f.value,
|
|
4370
4437
|
itemsPerRow: k.value
|
|
4371
4438
|
}, void 0, !0)
|
|
@@ -4416,32 +4483,32 @@ const __vite_glob_0_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4416
4483
|
},
|
|
4417
4484
|
emits: ["update:modelValue", "focus", "blur"],
|
|
4418
4485
|
setup(e, { emit: r }) {
|
|
4419
|
-
const c = e, { modelValue: t, maskType:
|
|
4486
|
+
const c = e, { modelValue: t, maskType: l, maskStart: n, maskMiddle: u, maskEnd: i, maskSymbol: a } = toRefs(c), s = r, d = ref(c.modelValue), g = ref(!1), O = computed(() => !!l.value || Number(n.value) > 0 || Number(u.value) > 0 || Number(i.value) > 0), m = computed(() => {
|
|
4420
4487
|
const v = {
|
|
4421
|
-
start: Number(
|
|
4488
|
+
start: Number(n.value) || 0,
|
|
4422
4489
|
middle: Number(u.value) || 0,
|
|
4423
4490
|
end: Number(i.value) || 0,
|
|
4424
|
-
symbol:
|
|
4491
|
+
symbol: a.value || "*",
|
|
4425
4492
|
defaultVal: ""
|
|
4426
4493
|
};
|
|
4427
|
-
return typeof
|
|
4494
|
+
return typeof l.value == "string" ? l.value : Array.isArray(l.value) ? {
|
|
4428
4495
|
...v,
|
|
4429
|
-
start:
|
|
4430
|
-
middle:
|
|
4431
|
-
end:
|
|
4432
|
-
symbol:
|
|
4433
|
-
} : typeof
|
|
4496
|
+
start: l.value[0] || v.start,
|
|
4497
|
+
middle: l.value[1] || v.middle,
|
|
4498
|
+
end: l.value[2] || v.end,
|
|
4499
|
+
symbol: l.value[3] || v.symbol
|
|
4500
|
+
} : typeof l.value == "object" && l.value !== null ? { ...v, ...l.value } : v;
|
|
4434
4501
|
}), p = (v = t.value) => {
|
|
4435
4502
|
g.value ? d.value = v : O.value ? d.value = Desensitization(v, m.value) : d.value = v;
|
|
4436
4503
|
}, b = inject("elFormItem", null), _ = (v) => {
|
|
4437
|
-
g.value = !0, p(),
|
|
4438
|
-
},
|
|
4439
|
-
g.value = !1,
|
|
4504
|
+
g.value = !0, p(), s("focus", v);
|
|
4505
|
+
}, o = (v) => {
|
|
4506
|
+
g.value = !1, s("update:modelValue", d.value), p(), s("blur", v), b && b.validate("blur");
|
|
4440
4507
|
};
|
|
4441
4508
|
return watch(
|
|
4442
4509
|
d,
|
|
4443
4510
|
(v) => {
|
|
4444
|
-
g.value &&
|
|
4511
|
+
g.value && s("update:modelValue", v);
|
|
4445
4512
|
},
|
|
4446
4513
|
{ immediate: !1 }
|
|
4447
4514
|
), watch(
|
|
@@ -4457,10 +4524,10 @@ const __vite_glob_0_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4457
4524
|
"onUpdate:modelValue": T[0] || (T[0] = (w) => d.value = w)
|
|
4458
4525
|
}, v.$attrs, {
|
|
4459
4526
|
onFocus: _,
|
|
4460
|
-
onBlur:
|
|
4527
|
+
onBlur: o,
|
|
4461
4528
|
autocomplete: "off"
|
|
4462
4529
|
}), createSlots({ _: 2 }, [
|
|
4463
|
-
renderList(v.$slots, (w, y,
|
|
4530
|
+
renderList(v.$slots, (w, y, A) => ({
|
|
4464
4531
|
name: y,
|
|
4465
4532
|
fn: withCtx((V) => [
|
|
4466
4533
|
renderSlot(v.$slots, y, normalizeProps(guardReactiveProps(V)))
|
|
@@ -4532,7 +4599,7 @@ const __vite_glob_0_14 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4532
4599
|
},
|
|
4533
4600
|
emits: ["dictChange"],
|
|
4534
4601
|
setup(e, { expose: r, emit: c }) {
|
|
4535
|
-
const t = e, { disabled:
|
|
4602
|
+
const t = e, { disabled: l, addAllText: n, data: u, format: i, dictType: a, disabledObj: s, keyValue: d, filterDataFun: g, disabledDataFun: O } = toRefs(t), m = useAttrs(), p = computed(() => {
|
|
4536
4603
|
const f = {};
|
|
4537
4604
|
return Object.entries(m).forEach(([D, k]) => {
|
|
4538
4605
|
const E = ToKebabCase(D);
|
|
@@ -4550,71 +4617,71 @@ const __vite_glob_0_14 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4550
4617
|
f[N] = k;
|
|
4551
4618
|
}
|
|
4552
4619
|
}), f;
|
|
4553
|
-
}), _ = ref(""),
|
|
4620
|
+
}), _ = ref(""), o = toRaw(store.state.dictConfig), v = c, T = (f) => {
|
|
4554
4621
|
if (!d.value) {
|
|
4555
4622
|
v("dictChange", f);
|
|
4556
4623
|
return;
|
|
4557
4624
|
}
|
|
4558
|
-
const D = w.list.find((k) => k[
|
|
4625
|
+
const D = w.list.find((k) => k[o.format.value] === f);
|
|
4559
4626
|
v("dictChange", D);
|
|
4560
4627
|
}, w = reactive({
|
|
4561
4628
|
list: []
|
|
4562
4629
|
}), y = async () => {
|
|
4563
|
-
if (!
|
|
4630
|
+
if (!a.value || u.value && u.value.length > 0)
|
|
4564
4631
|
return;
|
|
4565
4632
|
let f = [];
|
|
4566
|
-
if (typeof
|
|
4567
|
-
_.value =
|
|
4633
|
+
if (typeof a.value == "object") {
|
|
4634
|
+
_.value = a.value.type;
|
|
4568
4635
|
const D = await store.actions.getDictDataObj(_.value);
|
|
4569
4636
|
f = [].concat(D[_.value]);
|
|
4570
|
-
const { filters: k, filterType: E =
|
|
4637
|
+
const { filters: k, filterType: E = o.format.value, reverse: N = !1 } = a.value, R = typeof k == "string" ? k.split(",") : k;
|
|
4571
4638
|
N ? f = f.filter((H) => !R.includes(H[E])) : f = f.filter((H) => R.includes(H[E]));
|
|
4572
4639
|
} else {
|
|
4573
|
-
_.value =
|
|
4640
|
+
_.value = a.value;
|
|
4574
4641
|
const D = await store.actions.getDictDataObj(_.value);
|
|
4575
4642
|
f = [].concat(D[_.value]);
|
|
4576
4643
|
}
|
|
4577
4644
|
if (g.value && (f = g.value(f)), O.value)
|
|
4578
4645
|
f = f.map((D) => ({
|
|
4579
4646
|
...D,
|
|
4580
|
-
[
|
|
4647
|
+
[o.format.disabled]: O.value(D)
|
|
4581
4648
|
}));
|
|
4582
|
-
else if (
|
|
4583
|
-
const { disabledValues: D, disabledType: k =
|
|
4649
|
+
else if (s.value) {
|
|
4650
|
+
const { disabledValues: D, disabledType: k = o.format.value, reverse: E = !1 } = s.value, N = typeof D == "string" ? D.split(",") : D;
|
|
4584
4651
|
E ? f = f.map((R) => {
|
|
4585
4652
|
const H = JSON.parse(JSON.stringify(R));
|
|
4586
|
-
return H[
|
|
4653
|
+
return H[o.format.disabled] = !N.includes(H[k]) || H[o.format.disabled], H;
|
|
4587
4654
|
}) : f = f.map((R) => {
|
|
4588
4655
|
const H = JSON.parse(JSON.stringify(R));
|
|
4589
|
-
return H[
|
|
4656
|
+
return H[o.format.disabled] = N.includes(H[k]) || H[o.format.disabled], H;
|
|
4590
4657
|
});
|
|
4591
4658
|
}
|
|
4592
|
-
|
|
4593
|
-
[
|
|
4594
|
-
[
|
|
4659
|
+
n.value && f.unshift({
|
|
4660
|
+
[o.format.value]: "",
|
|
4661
|
+
[o.format.label]: n.value
|
|
4595
4662
|
}), w.list = f;
|
|
4596
|
-
},
|
|
4663
|
+
}, A = computed(() => store.state.isGettingDictTypes.includes(_.value)), V = computed(() => store.state.isGettingAllDictTypes), x = computed(() => u.value), F = inject(formItemContextKey), B = inject(formContextKey), L = computed(() => l.value || m["radio-disabled"] === "" || m["radio-disabled"] || m.radioDisabled === "" || m.radioDisabled || m.RadioDisabled === "" || m.RadioDisabled || (F == null ? void 0 : F.disabled) || (B == null ? void 0 : B.disabled) || !1);
|
|
4597
4664
|
watch(
|
|
4598
|
-
[
|
|
4665
|
+
[A, V, x],
|
|
4599
4666
|
([f, D, k]) => {
|
|
4600
4667
|
!f && !D && k && k.length === 0 && y(), k.length > 0 && (w.list = JSON.parse(JSON.stringify(k)), w.list.length > 0 && (Object.prototype.toString.call(w.list[0]) === "[object Object]" ? w.list = w.list.map((N) => ({
|
|
4601
|
-
[
|
|
4602
|
-
[
|
|
4603
|
-
[
|
|
4668
|
+
[o.format.value]: N[i.value.value],
|
|
4669
|
+
[o.format.label]: N[i.value.label],
|
|
4670
|
+
[o.format.disabled]: !!N[i.value.disabled],
|
|
4604
4671
|
...N
|
|
4605
4672
|
})) : w.list = w.list.map((N) => ({
|
|
4606
|
-
[
|
|
4607
|
-
[
|
|
4608
|
-
})),
|
|
4609
|
-
[
|
|
4610
|
-
[
|
|
4673
|
+
[o.format.value]: N,
|
|
4674
|
+
[o.format.label]: N
|
|
4675
|
+
})), n.value && w.list.unshift({
|
|
4676
|
+
[o.format.value]: "",
|
|
4677
|
+
[o.format.label]: n.value
|
|
4611
4678
|
})));
|
|
4612
4679
|
},
|
|
4613
4680
|
{
|
|
4614
4681
|
immediate: !0
|
|
4615
4682
|
}
|
|
4616
4683
|
);
|
|
4617
|
-
const
|
|
4684
|
+
const I = ref([]), C = () => I.value, j = ref(null);
|
|
4618
4685
|
return r({ getElRadioGroupRef: () => j.value, getElRadioButtonRefs: C }), (f, D) => (openBlock(), createBlock(unref(ElRadioGroup), mergeProps({
|
|
4619
4686
|
ref_key: "ElRadioGroupRef",
|
|
4620
4687
|
ref: j,
|
|
@@ -4624,14 +4691,14 @@ const __vite_glob_0_14 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4624
4691
|
f.$attrs.options ? createCommentVNode("", !0) : (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(w.list, (k, E) => (openBlock(), createBlock(unref(ElRadioButton), mergeProps({
|
|
4625
4692
|
ref_for: !0,
|
|
4626
4693
|
ref: (N) => {
|
|
4627
|
-
N && (
|
|
4694
|
+
N && (I.value[E] = N);
|
|
4628
4695
|
},
|
|
4629
|
-
key: k[unref(
|
|
4630
|
-
disabled: L.value || k[unref(
|
|
4631
|
-
label: k[unref(
|
|
4696
|
+
key: k[unref(o).format.value],
|
|
4697
|
+
disabled: L.value || k[unref(o).format.disabled],
|
|
4698
|
+
label: k[unref(o).format.value]
|
|
4632
4699
|
}, { ref_for: !0 }, b.value), {
|
|
4633
4700
|
default: withCtx(() => [
|
|
4634
|
-
createTextVNode(toDisplayString(k[unref(
|
|
4701
|
+
createTextVNode(toDisplayString(k[unref(o).format.label]), 1)
|
|
4635
4702
|
]),
|
|
4636
4703
|
_: 2
|
|
4637
4704
|
}, 1040, ["disabled", "label"]))), 128))
|
|
@@ -4705,7 +4772,7 @@ const __vite_glob_0_15 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4705
4772
|
},
|
|
4706
4773
|
emits: ["dictChange"],
|
|
4707
4774
|
setup(e, { expose: r, emit: c }) {
|
|
4708
|
-
const t = e, { disabled:
|
|
4775
|
+
const t = e, { disabled: l, addAllText: n, data: u, format: i, dictType: a, disabledObj: s, keyValue: d, filterDataFun: g, disabledDataFun: O } = toRefs(t), m = useAttrs(), p = computed(() => {
|
|
4709
4776
|
const f = {};
|
|
4710
4777
|
return Object.entries(m).forEach(([D, k]) => {
|
|
4711
4778
|
const E = ToKebabCase(D);
|
|
@@ -4723,71 +4790,71 @@ const __vite_glob_0_15 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4723
4790
|
f[N] = k;
|
|
4724
4791
|
}
|
|
4725
4792
|
}), f;
|
|
4726
|
-
}), _ = ref(""),
|
|
4793
|
+
}), _ = ref(""), o = toRaw(store.state.dictConfig), v = c, T = (f) => {
|
|
4727
4794
|
if (!d.value) {
|
|
4728
4795
|
v("dictChange", f);
|
|
4729
4796
|
return;
|
|
4730
4797
|
}
|
|
4731
|
-
const D = w.list.find((k) => k[
|
|
4798
|
+
const D = w.list.find((k) => k[o.format.value] === f);
|
|
4732
4799
|
v("dictChange", D);
|
|
4733
4800
|
}, w = reactive({
|
|
4734
4801
|
list: []
|
|
4735
4802
|
}), y = async () => {
|
|
4736
|
-
if (!
|
|
4803
|
+
if (!a.value || u.value && u.value.length > 0)
|
|
4737
4804
|
return;
|
|
4738
4805
|
let f = [];
|
|
4739
|
-
if (typeof
|
|
4740
|
-
_.value =
|
|
4806
|
+
if (typeof a.value == "object") {
|
|
4807
|
+
_.value = a.value.type;
|
|
4741
4808
|
const D = await store.actions.getDictDataObj(_.value);
|
|
4742
4809
|
f = [].concat(D[_.value]);
|
|
4743
|
-
const { filters: k, filterType: E =
|
|
4810
|
+
const { filters: k, filterType: E = o.format.value, reverse: N = !1 } = a.value, R = typeof k == "string" ? k.split(",") : k;
|
|
4744
4811
|
N ? f = f.filter((H) => !R.includes(H[E])) : f = f.filter((H) => R.includes(H[E]));
|
|
4745
4812
|
} else {
|
|
4746
|
-
_.value =
|
|
4813
|
+
_.value = a.value;
|
|
4747
4814
|
const D = await store.actions.getDictDataObj(_.value);
|
|
4748
4815
|
f = [].concat(D[_.value]);
|
|
4749
4816
|
}
|
|
4750
4817
|
if (g.value && (f = g.value(f)), O.value)
|
|
4751
4818
|
f = f.map((D) => ({
|
|
4752
4819
|
...D,
|
|
4753
|
-
[
|
|
4820
|
+
[o.format.disabled]: O.value(D)
|
|
4754
4821
|
}));
|
|
4755
|
-
else if (
|
|
4756
|
-
const { disabledValues: D, disabledType: k =
|
|
4822
|
+
else if (s.value) {
|
|
4823
|
+
const { disabledValues: D, disabledType: k = o.format.value, reverse: E = !1 } = s.value, N = typeof D == "string" ? D.split(",") : D;
|
|
4757
4824
|
E ? f = f.map((R) => {
|
|
4758
4825
|
const H = JSON.parse(JSON.stringify(R));
|
|
4759
|
-
return H[
|
|
4826
|
+
return H[o.format.disabled] = !N.includes(H[k]) || H[o.format.disabled], H;
|
|
4760
4827
|
}) : f = f.map((R) => {
|
|
4761
4828
|
const H = JSON.parse(JSON.stringify(R));
|
|
4762
|
-
return H[
|
|
4829
|
+
return H[o.format.disabled] = N.includes(H[k]) || H[o.format.disabled], H;
|
|
4763
4830
|
});
|
|
4764
4831
|
}
|
|
4765
|
-
|
|
4766
|
-
[
|
|
4767
|
-
[
|
|
4832
|
+
n.value && f.unshift({
|
|
4833
|
+
[o.format.value]: "",
|
|
4834
|
+
[o.format.label]: n.value
|
|
4768
4835
|
}), w.list = f;
|
|
4769
|
-
},
|
|
4836
|
+
}, A = computed(() => store.state.isGettingDictTypes.includes(_.value)), V = computed(() => store.state.isGettingAllDictTypes), x = computed(() => u.value), F = inject(formItemContextKey), B = inject(formContextKey), L = computed(() => l.value || m["radio-disabled"] === "" || m["radio-disabled"] || m.radioDisabled === "" || m.radioDisabled || m.RadioDisabled === "" || m.RadioDisabled || (F == null ? void 0 : F.disabled) || (B == null ? void 0 : B.disabled) || !1);
|
|
4770
4837
|
watch(
|
|
4771
|
-
[
|
|
4838
|
+
[A, V, x],
|
|
4772
4839
|
([f, D, k]) => {
|
|
4773
4840
|
!f && !D && k && k.length === 0 && y(), k.length > 0 && (w.list = JSON.parse(JSON.stringify(k)), w.list.length > 0 && (Object.prototype.toString.call(w.list[0]) === "[object Object]" ? w.list = w.list.map((N) => ({
|
|
4774
|
-
[
|
|
4775
|
-
[
|
|
4776
|
-
[
|
|
4841
|
+
[o.format.value]: N[i.value.value],
|
|
4842
|
+
[o.format.label]: N[i.value.label],
|
|
4843
|
+
[o.format.disabled]: !!N[i.value.disabled],
|
|
4777
4844
|
...N
|
|
4778
4845
|
})) : w.list = w.list.map((N) => ({
|
|
4779
|
-
[
|
|
4780
|
-
[
|
|
4781
|
-
})),
|
|
4782
|
-
[
|
|
4783
|
-
[
|
|
4846
|
+
[o.format.value]: N,
|
|
4847
|
+
[o.format.label]: N
|
|
4848
|
+
})), n.value && w.list.unshift({
|
|
4849
|
+
[o.format.value]: "",
|
|
4850
|
+
[o.format.label]: n.value
|
|
4784
4851
|
})));
|
|
4785
4852
|
},
|
|
4786
4853
|
{
|
|
4787
4854
|
immediate: !0
|
|
4788
4855
|
}
|
|
4789
4856
|
);
|
|
4790
|
-
const
|
|
4857
|
+
const I = ref([]), C = () => I.value, j = ref(null);
|
|
4791
4858
|
return r({ geElRadioGroupRef: () => j.value, getElRadioRefs: C }), (f, D) => (openBlock(), createBlock(unref(ElRadioGroup), mergeProps({
|
|
4792
4859
|
ref_key: "ElRadioGroupRef",
|
|
4793
4860
|
ref: j,
|
|
@@ -4797,14 +4864,14 @@ const __vite_glob_0_15 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4797
4864
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(w.list, (k, E) => (openBlock(), createBlock(unref(ElRadio), mergeProps({
|
|
4798
4865
|
ref_for: !0,
|
|
4799
4866
|
ref: (N) => {
|
|
4800
|
-
N && (
|
|
4867
|
+
N && (I.value[E] = N);
|
|
4801
4868
|
},
|
|
4802
|
-
key: k[unref(
|
|
4803
|
-
disabled: L.value || k[unref(
|
|
4804
|
-
label: k[unref(
|
|
4869
|
+
key: k[unref(o).format.value],
|
|
4870
|
+
disabled: L.value || k[unref(o).format.disabled],
|
|
4871
|
+
label: k[unref(o).format.value]
|
|
4805
4872
|
}, { ref_for: !0 }, b.value), {
|
|
4806
4873
|
default: withCtx(() => [
|
|
4807
|
-
createTextVNode(toDisplayString(k[unref(
|
|
4874
|
+
createTextVNode(toDisplayString(k[unref(o).format.label]), 1)
|
|
4808
4875
|
]),
|
|
4809
4876
|
_: 2
|
|
4810
4877
|
}, 1040, ["disabled", "label"]))), 128))
|
|
@@ -4879,7 +4946,7 @@ const __vite_glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4879
4946
|
},
|
|
4880
4947
|
emits: ["dictChange"],
|
|
4881
4948
|
setup(e, { expose: r, emit: c }) {
|
|
4882
|
-
const t = e, { addAllText:
|
|
4949
|
+
const t = e, { addAllText: l, emptyValues: n, valueOnClear: u, data: i, format: a, dictType: s, disabledObj: d, keyValue: g, filterDataFun: O, disabledDataFun: m } = toRefs(t), p = useAttrs(), b = computed(() => {
|
|
4883
4950
|
const S = {};
|
|
4884
4951
|
return Object.entries(p).forEach(([f, D]) => {
|
|
4885
4952
|
const k = ToKebabCase(f);
|
|
@@ -4897,7 +4964,7 @@ const __vite_glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4897
4964
|
S[E] = D;
|
|
4898
4965
|
}
|
|
4899
4966
|
}), S;
|
|
4900
|
-
}),
|
|
4967
|
+
}), o = ref(""), v = toRaw(store.state.dictConfig), T = c, w = (S) => {
|
|
4901
4968
|
if (!g.value) {
|
|
4902
4969
|
T("dictChange", S);
|
|
4903
4970
|
return;
|
|
@@ -4911,20 +4978,20 @@ const __vite_glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4911
4978
|
}
|
|
4912
4979
|
}, y = reactive({
|
|
4913
4980
|
list: []
|
|
4914
|
-
}),
|
|
4915
|
-
if (!
|
|
4981
|
+
}), A = async () => {
|
|
4982
|
+
if (!s.value || i.value && i.value.length > 0)
|
|
4916
4983
|
return;
|
|
4917
4984
|
let S = [];
|
|
4918
|
-
if (typeof
|
|
4919
|
-
|
|
4920
|
-
const f = await store.actions.getDictDataObj(
|
|
4921
|
-
S = [].concat(f[
|
|
4922
|
-
const { filters: D, filterType: k = v.format.value, reverse: E = !1 } =
|
|
4985
|
+
if (typeof s.value == "object") {
|
|
4986
|
+
o.value = s.value.type;
|
|
4987
|
+
const f = await store.actions.getDictDataObj(o.value);
|
|
4988
|
+
S = [].concat(f[o.value]);
|
|
4989
|
+
const { filters: D, filterType: k = v.format.value, reverse: E = !1 } = s.value, N = typeof D == "string" ? D.split(",") : D;
|
|
4923
4990
|
E ? S = S.filter((R) => !N.includes(R[k])) : S = S.filter((R) => N.includes(R[k]));
|
|
4924
4991
|
} else {
|
|
4925
|
-
|
|
4926
|
-
const f = await store.actions.getDictDataObj(
|
|
4927
|
-
S = [].concat(f[
|
|
4992
|
+
o.value = s.value;
|
|
4993
|
+
const f = await store.actions.getDictDataObj(o.value);
|
|
4994
|
+
S = [].concat(f[o.value]);
|
|
4928
4995
|
}
|
|
4929
4996
|
if (O.value && (S = O.value(S)), m.value)
|
|
4930
4997
|
S = S.map((f) => ({
|
|
@@ -4941,27 +5008,27 @@ const __vite_glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4941
5008
|
return R[v.format.disabled] = E.includes(R[D]) || R[v.format.disabled], R;
|
|
4942
5009
|
});
|
|
4943
5010
|
}
|
|
4944
|
-
|
|
5011
|
+
l.value && !p.multiple && p.multiple !== "" && S.unshift({
|
|
4945
5012
|
[v.format.value]: "",
|
|
4946
|
-
[v.format.label]:
|
|
5013
|
+
[v.format.label]: l.value
|
|
4947
5014
|
}), y.list = S;
|
|
4948
|
-
}, V = computed(() => store.state.isGettingDictTypes.includes(
|
|
5015
|
+
}, V = computed(() => store.state.isGettingDictTypes.includes(o.value)), x = computed(() => store.state.isGettingAllDictTypes), F = computed(() => i.value);
|
|
4949
5016
|
watch(
|
|
4950
|
-
[V,
|
|
5017
|
+
[V, x, F],
|
|
4951
5018
|
([S, f, D]) => {
|
|
4952
|
-
if (!S && !f && D && D.length === 0 &&
|
|
5019
|
+
if (!S && !f && D && D.length === 0 && A(), D.length > 0) {
|
|
4953
5020
|
let k = JSON.parse(JSON.stringify(D));
|
|
4954
5021
|
k.length > 0 && (Object.prototype.toString.call(k[0]) === "[object Object]" ? k = k.map((N) => ({
|
|
4955
|
-
[v.format.value]: N[
|
|
4956
|
-
[v.format.label]: N[
|
|
4957
|
-
[v.format.disabled]: !!N[
|
|
5022
|
+
[v.format.value]: N[a.value.value],
|
|
5023
|
+
[v.format.label]: N[a.value.label],
|
|
5024
|
+
[v.format.disabled]: !!N[a.value.disabled],
|
|
4958
5025
|
...N
|
|
4959
5026
|
})) : k = k.map((N) => ({
|
|
4960
5027
|
[v.format.value]: N,
|
|
4961
5028
|
[v.format.label]: N
|
|
4962
|
-
})),
|
|
5029
|
+
})), l.value && !p.multiple && p.multiple !== "" && k.unshift({
|
|
4963
5030
|
[v.format.value]: "",
|
|
4964
|
-
[v.format.label]:
|
|
5031
|
+
[v.format.label]: l.value
|
|
4965
5032
|
}), y.list = k);
|
|
4966
5033
|
}
|
|
4967
5034
|
},
|
|
@@ -4969,16 +5036,16 @@ const __vite_glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
4969
5036
|
immediate: !0
|
|
4970
5037
|
}
|
|
4971
5038
|
);
|
|
4972
|
-
const B = () =>
|
|
4973
|
-
return r({ getElSelectRef:
|
|
5039
|
+
const B = () => l.value && !p.multiple && p.multiple !== "" ? "" : u.value, L = ref(null), I = () => L.value, C = ref([]);
|
|
5040
|
+
return r({ getElSelectRef: I, getElOptionRefs: () => C.value }), (S, f) => (openBlock(), createBlock(unref(ElSelect), mergeProps({
|
|
4974
5041
|
ref_key: "ElSelectRef",
|
|
4975
5042
|
ref: L
|
|
4976
5043
|
}, b.value, {
|
|
4977
5044
|
"value-on-clear": B,
|
|
4978
|
-
"empty-values": unref(
|
|
5045
|
+
"empty-values": unref(l) ? [null, void 0] : unref(n),
|
|
4979
5046
|
"value-key": unref(v).format.value,
|
|
4980
5047
|
onChange: w,
|
|
4981
|
-
class: unref(p).modelValue === "" && unref(
|
|
5048
|
+
class: unref(p).modelValue === "" && unref(l) ? "no-clear" : "",
|
|
4982
5049
|
"popper-options": { modifiers: [{ name: "computeStyles", options: { adaptive: !1 } }] }
|
|
4983
5050
|
}), createSlots({
|
|
4984
5051
|
default: withCtx(() => [
|
|
@@ -5091,29 +5158,29 @@ const __vite_glob_0_17 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
5091
5158
|
}
|
|
5092
5159
|
},
|
|
5093
5160
|
setup(e, { expose: r }) {
|
|
5094
|
-
const c = useAttrs(), t = e, { emptyText:
|
|
5161
|
+
const c = useAttrs(), t = e, { emptyText: l, dictType: n, dictTreeType: u, dateFormat: i, defaultVal: a, treeSetting: s, formatFun: d, formatFunIn: g, formatFunOut: O, spacer: m, maskType: p, maskStart: b, maskEnd: _, maskMiddle: o, maskSymbol: v } = toRefs(t), T = computed(() => {
|
|
5095
5162
|
const B = {};
|
|
5096
|
-
return
|
|
5163
|
+
return a.value !== void 0 && a.value !== null && (B.defaultVal = a.value), l.value !== void 0 && l.value !== null && (B.emptyText = l.value), d.value !== void 0 && d.value !== null && (B.formatFun = d.value), m.value !== void 0 && m.value !== null && (B.spacer = m.value), B;
|
|
5097
5164
|
}), w = computed(() => {
|
|
5098
5165
|
const B = {};
|
|
5099
|
-
return
|
|
5100
|
-
}), y = computed(() => !!p.value || !!b.value || !!
|
|
5166
|
+
return a.value !== void 0 && a.value !== null && (B.defaultVal = a.value), l.value !== void 0 && l.value !== null && (B.emptyText = l.value), g.value !== void 0 && g.value !== null && (B.formatFunIn = g.value), O.value !== void 0 && O.value !== null && (B.formatFunOut = O.value), s.value !== void 0 && s.value !== null && (B.treeSetting = s.value), m.value !== void 0 && m.value !== null && (B.spacer = m.value), B;
|
|
5167
|
+
}), y = computed(() => !!p.value || !!b.value || !!o.value || !!_.value), A = computed(() => {
|
|
5101
5168
|
if (p.value) {
|
|
5102
5169
|
if (Array.isArray(p.value))
|
|
5103
5170
|
return {
|
|
5104
5171
|
start: b.value || p.value[0] || 0,
|
|
5105
|
-
middle:
|
|
5172
|
+
middle: o.value || p.value[1] || 0,
|
|
5106
5173
|
end: _.value || p.value[2] || 0,
|
|
5107
5174
|
symbol: v.value || p.value[3] || "*",
|
|
5108
|
-
defaultVal:
|
|
5175
|
+
defaultVal: a.value
|
|
5109
5176
|
};
|
|
5110
5177
|
if (typeof p.value == "object") {
|
|
5111
5178
|
const B = {
|
|
5112
5179
|
start: b.value || 0,
|
|
5113
|
-
middle:
|
|
5180
|
+
middle: o.value || 0,
|
|
5114
5181
|
end: _.value || 0,
|
|
5115
5182
|
symbol: v.value || "*",
|
|
5116
|
-
defaultVal:
|
|
5183
|
+
defaultVal: a.value
|
|
5117
5184
|
};
|
|
5118
5185
|
return Object.assign(B, p.value);
|
|
5119
5186
|
} else
|
|
@@ -5121,53 +5188,53 @@ const __vite_glob_0_17 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
5121
5188
|
} else
|
|
5122
5189
|
return {
|
|
5123
5190
|
start: b.value || 0,
|
|
5124
|
-
middle:
|
|
5191
|
+
middle: o.value || 0,
|
|
5125
5192
|
end: _.value || 0,
|
|
5126
5193
|
symbol: v.value || "*",
|
|
5127
|
-
defaultVal:
|
|
5194
|
+
defaultVal: a.value
|
|
5128
5195
|
};
|
|
5129
|
-
}), V = (B, L = {}) => Array.isArray(B) ? B : typeof B == "string" ? B.split(L.spacer || ",") : typeof B == "number" ? [B] : [],
|
|
5130
|
-
return r({ getElTableColumnRef: () =>
|
|
5196
|
+
}), V = (B, L = {}) => Array.isArray(B) ? B : typeof B == "string" ? B.split(L.spacer || ",") : typeof B == "number" ? [B] : [], x = ref(null);
|
|
5197
|
+
return r({ getElTableColumnRef: () => x.value }), (B, L) => (openBlock(), createBlock(unref(ElTableColumn), mergeProps({
|
|
5131
5198
|
ref_key: "ElTableColumnRef",
|
|
5132
|
-
ref:
|
|
5199
|
+
ref: x
|
|
5133
5200
|
}, B.$attrs), createSlots({
|
|
5134
|
-
default: withCtx((
|
|
5201
|
+
default: withCtx((I) => {
|
|
5135
5202
|
var C, j, S, f, D, k, E, N, R, H, P, K;
|
|
5136
5203
|
return [
|
|
5137
|
-
unref(
|
|
5138
|
-
e.dictTypeNode === "button" ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(V(
|
|
5204
|
+
unref(n) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
5205
|
+
e.dictTypeNode === "button" ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(V(I.row[(C = unref(c)) == null ? void 0 : C.prop], T.value), (W, G) => (openBlock(), createBlock(_sfc_main$n, {
|
|
5139
5206
|
key: G,
|
|
5140
5207
|
modelValue: W || "",
|
|
5141
|
-
dictType: unref(
|
|
5142
|
-
}, null, 8, ["modelValue", "dictType"]))), 128)) : e.dictTypeNode === "link" ? (openBlock(!0), createElementBlock(Fragment, { key: 1 }, renderList(V(
|
|
5208
|
+
dictType: unref(n)
|
|
5209
|
+
}, null, 8, ["modelValue", "dictType"]))), 128)) : e.dictTypeNode === "link" ? (openBlock(!0), createElementBlock(Fragment, { key: 1 }, renderList(V(I.row[(j = unref(c)) == null ? void 0 : j.prop], T.value), (W, G) => (openBlock(), createBlock(_sfc_main$e, {
|
|
5143
5210
|
key: G,
|
|
5144
5211
|
modelValue: W || "",
|
|
5145
|
-
dictType: unref(
|
|
5146
|
-
}, null, 8, ["modelValue", "dictType"]))), 128)) : e.dictTypeNode === "tag" ? (openBlock(!0), createElementBlock(Fragment, { key: 2 }, renderList(V(
|
|
5212
|
+
dictType: unref(n)
|
|
5213
|
+
}, null, 8, ["modelValue", "dictType"]))), 128)) : e.dictTypeNode === "tag" ? (openBlock(!0), createElementBlock(Fragment, { key: 2 }, renderList(V(I.row[(S = unref(c)) == null ? void 0 : S.prop], T.value), (W, G) => (openBlock(), createBlock(_sfc_main$f, {
|
|
5147
5214
|
key: G,
|
|
5148
5215
|
modelValue: W || "",
|
|
5149
|
-
dictType: unref(
|
|
5150
|
-
}, null, 8, ["modelValue", "dictType"]))), 128)) : e.dictTypeNode === "text" ? (openBlock(!0), createElementBlock(Fragment, { key: 3 }, renderList(V(
|
|
5216
|
+
dictType: unref(n)
|
|
5217
|
+
}, null, 8, ["modelValue", "dictType"]))), 128)) : e.dictTypeNode === "text" ? (openBlock(!0), createElementBlock(Fragment, { key: 3 }, renderList(V(I.row[(f = unref(c)) == null ? void 0 : f.prop], T.value), (W, G) => (openBlock(), createBlock(_sfc_main$d, {
|
|
5151
5218
|
key: G,
|
|
5152
5219
|
modelValue: W || "",
|
|
5153
|
-
dictType: unref(
|
|
5220
|
+
dictType: unref(n)
|
|
5154
5221
|
}, null, 8, ["modelValue", "dictType"]))), 128)) : (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
5155
|
-
createTextVNode(toDisplayString(unref(GetLabelByCodesFilter)(
|
|
5222
|
+
createTextVNode(toDisplayString(unref(GetLabelByCodesFilter)(I.row[(D = unref(c)) == null ? void 0 : D.prop], unref(n), T.value)), 1)
|
|
5156
5223
|
], 64))
|
|
5157
|
-
], 64)) : unref(u) &&
|
|
5158
|
-
createTextVNode(toDisplayString(unref(GetTreeLabelByCodesFilter)(
|
|
5159
|
-
], 64)) : unref(i) &&
|
|
5160
|
-
createTextVNode(toDisplayString(unref(FormatDate)(
|
|
5161
|
-
], 64)) : y.value &&
|
|
5162
|
-
createTextVNode(toDisplayString(unref(Desensitization)(
|
|
5224
|
+
], 64)) : unref(u) && I.row[(k = unref(c)) == null ? void 0 : k.prop] ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
5225
|
+
createTextVNode(toDisplayString(unref(GetTreeLabelByCodesFilter)(I.row[(E = unref(c)) == null ? void 0 : E.prop], unref(u), w.value)), 1)
|
|
5226
|
+
], 64)) : unref(i) && I.row[(N = unref(c)) == null ? void 0 : N.prop] ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
5227
|
+
createTextVNode(toDisplayString(unref(FormatDate)(I.row[(R = unref(c)) == null ? void 0 : R.prop], unref(i), unref(a))), 1)
|
|
5228
|
+
], 64)) : y.value && I.row[(H = unref(c)) == null ? void 0 : H.prop] ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
5229
|
+
createTextVNode(toDisplayString(unref(Desensitization)(I.row[(P = unref(c)) == null ? void 0 : P.prop], A.value)), 1)
|
|
5163
5230
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
5164
|
-
createTextVNode(toDisplayString(
|
|
5231
|
+
createTextVNode(toDisplayString(I.row[(K = unref(c)) == null ? void 0 : K.prop] || unref(a)), 1)
|
|
5165
5232
|
], 64))
|
|
5166
5233
|
];
|
|
5167
5234
|
}),
|
|
5168
5235
|
_: 2
|
|
5169
5236
|
}, [
|
|
5170
|
-
renderList(B.$slots, (
|
|
5237
|
+
renderList(B.$slots, (I, C, j) => ({
|
|
5171
5238
|
name: C,
|
|
5172
5239
|
fn: withCtx((S) => [
|
|
5173
5240
|
renderSlot(B.$slots, C, mergeProps({ key: j }, S), void 0, !0)
|
|
@@ -5233,7 +5300,7 @@ const __vite_glob_0_18 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
5233
5300
|
},
|
|
5234
5301
|
emits: ["dictChange"],
|
|
5235
5302
|
setup(e, { expose: r, emit: c }) {
|
|
5236
|
-
const t = useAttrs(),
|
|
5303
|
+
const t = useAttrs(), l = e, { addAllText: n, data: u, format: i, badgeObj: a, dictType: s, disabledObj: d, keyValue: g, filterDataFun: O, disabledDataFun: m } = toRefs(l), p = computed(() => {
|
|
5237
5304
|
const C = {};
|
|
5238
5305
|
return Object.entries(t).forEach(([j, S]) => {
|
|
5239
5306
|
const f = ToKebabCase(j);
|
|
@@ -5251,66 +5318,66 @@ const __vite_glob_0_18 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
5251
5318
|
C[D] = S;
|
|
5252
5319
|
}
|
|
5253
5320
|
}), C;
|
|
5254
|
-
}), _ = ref(""),
|
|
5321
|
+
}), _ = ref(""), o = toRaw(store.state.dictConfig), v = c, T = (C) => {
|
|
5255
5322
|
window.setTimeout(() => {
|
|
5256
5323
|
if (!g.value) {
|
|
5257
5324
|
v("dictChange", t.modelValue);
|
|
5258
5325
|
return;
|
|
5259
5326
|
}
|
|
5260
|
-
const j = w.list.find((S) => S[
|
|
5327
|
+
const j = w.list.find((S) => S[o.format.value] === t.modelValue);
|
|
5261
5328
|
v("dictChange", j);
|
|
5262
5329
|
}, 0);
|
|
5263
5330
|
}, w = reactive({
|
|
5264
5331
|
list: []
|
|
5265
5332
|
}), y = async () => {
|
|
5266
|
-
if (!
|
|
5333
|
+
if (!s.value || u.value && u.value.length > 0)
|
|
5267
5334
|
return;
|
|
5268
5335
|
let C = [];
|
|
5269
|
-
if (typeof
|
|
5270
|
-
_.value =
|
|
5336
|
+
if (typeof s.value == "object") {
|
|
5337
|
+
_.value = s.value.type;
|
|
5271
5338
|
const j = await store.actions.getDictDataObj(_.value);
|
|
5272
5339
|
C = [].concat(j[_.value]);
|
|
5273
|
-
const { filters: S, filterType: f =
|
|
5340
|
+
const { filters: S, filterType: f = o.format.value, reverse: D = !1 } = s.value, k = typeof S == "string" ? S.split(",") : S;
|
|
5274
5341
|
D ? C = C.filter((E) => !k.includes(E[f])) : C = C.filter((E) => k.includes(E[f]));
|
|
5275
5342
|
} else {
|
|
5276
|
-
_.value =
|
|
5343
|
+
_.value = s.value;
|
|
5277
5344
|
const j = await store.actions.getDictDataObj(_.value);
|
|
5278
5345
|
C = [].concat(j[_.value]);
|
|
5279
5346
|
}
|
|
5280
5347
|
if (O.value && (C = O.value(C)), m.value)
|
|
5281
5348
|
C = C.map((j) => ({
|
|
5282
5349
|
...j,
|
|
5283
|
-
[
|
|
5350
|
+
[o.format.disabled]: m.value(j)
|
|
5284
5351
|
}));
|
|
5285
5352
|
else if (d.value) {
|
|
5286
|
-
const { disabledValues: j, disabledType: S =
|
|
5353
|
+
const { disabledValues: j, disabledType: S = o.format.value, reverse: f = !1 } = d.value, D = typeof j == "string" ? j.split(",") : j;
|
|
5287
5354
|
f ? C = C.map((k) => {
|
|
5288
5355
|
const E = JSON.parse(JSON.stringify(k));
|
|
5289
|
-
return E[
|
|
5356
|
+
return E[o.format.disabled] = !D.includes(E[S]) || E[o.format.disabled], E;
|
|
5290
5357
|
}) : C = C.map((k) => {
|
|
5291
5358
|
const E = JSON.parse(JSON.stringify(k));
|
|
5292
|
-
return E[
|
|
5359
|
+
return E[o.format.disabled] = D.includes(E[S]) || E[o.format.disabled], E;
|
|
5293
5360
|
});
|
|
5294
5361
|
}
|
|
5295
|
-
|
|
5296
|
-
[
|
|
5297
|
-
[
|
|
5362
|
+
n.value && C.unshift({
|
|
5363
|
+
[o.format.value]: "",
|
|
5364
|
+
[o.format.label]: n.value
|
|
5298
5365
|
}), w.list = C;
|
|
5299
|
-
},
|
|
5366
|
+
}, A = computed(() => store.state.isGettingDictTypes.includes(_.value)), V = computed(() => store.state.isGettingAllDictTypes), x = computed(() => u.value);
|
|
5300
5367
|
watch(
|
|
5301
|
-
[
|
|
5368
|
+
[A, V, x],
|
|
5302
5369
|
([C, j, S]) => {
|
|
5303
5370
|
!C && !j && S && S.length === 0 && y(), S.length > 0 && (w.list = JSON.parse(JSON.stringify(S)), w.list.length > 0 && (Object.prototype.toString.call(w.list[0]) === "[object Object]" ? w.list = w.list.map((D) => ({
|
|
5304
|
-
[
|
|
5305
|
-
[
|
|
5306
|
-
[
|
|
5371
|
+
[o.format.value]: D[i.value.value],
|
|
5372
|
+
[o.format.label]: D[i.value.label],
|
|
5373
|
+
[o.format.disabled]: !!D[i.value.disabled],
|
|
5307
5374
|
...D
|
|
5308
5375
|
})) : w.list = w.list.map((D) => ({
|
|
5309
|
-
[
|
|
5310
|
-
[
|
|
5311
|
-
})),
|
|
5312
|
-
[
|
|
5313
|
-
[
|
|
5376
|
+
[o.format.value]: D,
|
|
5377
|
+
[o.format.label]: D
|
|
5378
|
+
})), n.value && w.list.unshift({
|
|
5379
|
+
[o.format.value]: "",
|
|
5380
|
+
[o.format.label]: n.value
|
|
5314
5381
|
})));
|
|
5315
5382
|
},
|
|
5316
5383
|
{
|
|
@@ -5331,22 +5398,22 @@ const __vite_glob_0_18 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
5331
5398
|
ref: (D) => {
|
|
5332
5399
|
D && (L.value[C.index] = D);
|
|
5333
5400
|
},
|
|
5334
|
-
disabled: f[unref(
|
|
5335
|
-
label: f[unref(
|
|
5336
|
-
key: f[unref(
|
|
5337
|
-
name: f[unref(
|
|
5401
|
+
disabled: f[unref(o).format.disabled],
|
|
5402
|
+
label: f[unref(o).format.label],
|
|
5403
|
+
key: f[unref(o).format.value],
|
|
5404
|
+
name: f[unref(o).format.value]
|
|
5338
5405
|
}, { ref_for: !0 }, b.value), createSlots({
|
|
5339
5406
|
default: withCtx(() => [
|
|
5340
|
-
renderSlot(C.$slots, f[unref(
|
|
5407
|
+
renderSlot(C.$slots, f[unref(o).format.value] ? "tabs-item-" + f[unref(o).format.value] : "tabs-item")
|
|
5341
5408
|
]),
|
|
5342
5409
|
_: 2
|
|
5343
5410
|
}, [
|
|
5344
|
-
unref(
|
|
5411
|
+
unref(a)[f[unref(o).format.value]] ? {
|
|
5345
5412
|
name: "label",
|
|
5346
5413
|
fn: withCtx(() => [
|
|
5347
|
-
createVNode(S, mergeProps({ ref_for: !0 }, unref(
|
|
5414
|
+
createVNode(S, mergeProps({ ref_for: !0 }, unref(a)[f[unref(o).format.value]], { class: "item" }), {
|
|
5348
5415
|
default: withCtx(() => [
|
|
5349
|
-
createTextVNode(toDisplayString(f[unref(
|
|
5416
|
+
createTextVNode(toDisplayString(f[unref(o).format.label]), 1)
|
|
5350
5417
|
]),
|
|
5351
5418
|
_: 2
|
|
5352
5419
|
}, 1040)
|
|
@@ -5406,51 +5473,51 @@ const __vite_glob_0_21 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
5406
5473
|
}
|
|
5407
5474
|
},
|
|
5408
5475
|
setup(e, { expose: r }) {
|
|
5409
|
-
const c = useAttrs(), t = e, { maxLevel:
|
|
5476
|
+
const c = useAttrs(), t = e, { maxLevel: l, dictType: n, disabledObj: u, filterDataFun: i, disabledDataFun: a } = toRefs(t), s = ref(""), d = toRaw(store.state.dictConfig), g = reactive({
|
|
5410
5477
|
list: []
|
|
5411
5478
|
}), O = computed(() => {
|
|
5412
|
-
const y = JSON.parse(JSON.stringify(d.treeSetting)),
|
|
5413
|
-
valueField:
|
|
5414
|
-
labelField:
|
|
5415
|
-
childrenField:
|
|
5416
|
-
leafField:
|
|
5417
|
-
disabled:
|
|
5479
|
+
const y = JSON.parse(JSON.stringify(d.treeSetting)), A = c.props || {}, V = {
|
|
5480
|
+
valueField: A != null && A.value ? A.value : y.valueField,
|
|
5481
|
+
labelField: A != null && A.label ? A.label : y.labelField,
|
|
5482
|
+
childrenField: A != null && A.children ? A.children : y.childrenField,
|
|
5483
|
+
leafField: A != null && A.leaf ? A.leaf : y.leafField,
|
|
5484
|
+
disabled: A != null && A.disabled ? A.disabled : d.format.disabled
|
|
5418
5485
|
};
|
|
5419
5486
|
return Object.assign(y, V);
|
|
5420
|
-
}), m = (y,
|
|
5487
|
+
}), m = (y, A) => {
|
|
5421
5488
|
for (let V = 0; V < y.length; V++) {
|
|
5422
|
-
const
|
|
5423
|
-
if (
|
|
5424
|
-
delete
|
|
5489
|
+
const x = y[V];
|
|
5490
|
+
if (x[O.value.levelField] === A) {
|
|
5491
|
+
delete x[O.value.childrenField], x[O.value.leafField] = !0;
|
|
5425
5492
|
continue;
|
|
5426
5493
|
} else {
|
|
5427
|
-
const B =
|
|
5428
|
-
m(B,
|
|
5494
|
+
const B = x[O.value.childrenField];
|
|
5495
|
+
m(B, A);
|
|
5429
5496
|
}
|
|
5430
5497
|
}
|
|
5431
5498
|
}, p = async () => {
|
|
5432
|
-
if (!
|
|
5499
|
+
if (!n.value)
|
|
5433
5500
|
return;
|
|
5434
5501
|
let y = [];
|
|
5435
|
-
if (typeof
|
|
5436
|
-
|
|
5437
|
-
const
|
|
5438
|
-
y = [].concat(
|
|
5439
|
-
const { filters: V, filterType:
|
|
5440
|
-
F ? y = y.filter((L) => !B.includes(L[
|
|
5502
|
+
if (typeof n.value == "object") {
|
|
5503
|
+
s.value = n.value.type;
|
|
5504
|
+
const A = await store.actions.getDictDataObj(s.value);
|
|
5505
|
+
y = [].concat(A[s.value]);
|
|
5506
|
+
const { filters: V, filterType: x = d.format.value, reverse: F = !1 } = n.value, B = typeof V == "string" ? V.split(",") : V;
|
|
5507
|
+
F ? y = y.filter((L) => !B.includes(L[x])) : y = y.filter((L) => B.includes(L[x]));
|
|
5441
5508
|
} else {
|
|
5442
|
-
|
|
5443
|
-
const
|
|
5444
|
-
y = [].concat(
|
|
5509
|
+
s.value = n.value;
|
|
5510
|
+
const A = await store.actions.getDictDataObj(s.value);
|
|
5511
|
+
y = [].concat(A[s.value]);
|
|
5445
5512
|
}
|
|
5446
|
-
if (i.value && (y = i.value(y)),
|
|
5447
|
-
y = y.map((
|
|
5448
|
-
...
|
|
5449
|
-
[d.format.disabled]:
|
|
5513
|
+
if (i.value && (y = i.value(y)), a.value)
|
|
5514
|
+
y = y.map((A) => ({
|
|
5515
|
+
...A,
|
|
5516
|
+
[d.format.disabled]: a.value(A)
|
|
5450
5517
|
}));
|
|
5451
5518
|
else if (u.value) {
|
|
5452
|
-
const { disabledValues:
|
|
5453
|
-
|
|
5519
|
+
const { disabledValues: A, disabledType: V = d.treeSetting.valueField, reverse: x = !1 } = u.value, F = typeof A == "string" ? A.split(",") : A;
|
|
5520
|
+
x ? y = y.map((B) => {
|
|
5454
5521
|
const L = JSON.parse(JSON.stringify(B));
|
|
5455
5522
|
return L[d.format.disabled] = !F.includes(L[V]) || L[d.format.disabled], L;
|
|
5456
5523
|
}) : y = y.map((B) => {
|
|
@@ -5459,10 +5526,10 @@ const __vite_glob_0_21 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
5459
5526
|
});
|
|
5460
5527
|
}
|
|
5461
5528
|
g.list = y;
|
|
5462
|
-
}, b = computed(() => store.state.isGettingDictTypes.includes(
|
|
5463
|
-
const y = store.state.dictConfig.treeSetting,
|
|
5529
|
+
}, b = computed(() => store.state.isGettingDictTypes.includes(s.value)), _ = computed(() => store.state.isGettingAllDictTypes), o = computed(() => {
|
|
5530
|
+
const y = store.state.dictConfig.treeSetting, A = store.state.dictConfig.format, V = c.props ?? {};
|
|
5464
5531
|
return {
|
|
5465
|
-
disabled: (V == null ? void 0 : V.disabled) ??
|
|
5532
|
+
disabled: (V == null ? void 0 : V.disabled) ?? A.disabled,
|
|
5466
5533
|
label: (V == null ? void 0 : V.label) ?? y.labelField,
|
|
5467
5534
|
children: (V == null ? void 0 : V.children) ?? y.childrenField,
|
|
5468
5535
|
isLeaf: (V == null ? void 0 : V.leaf) ?? y.leafField
|
|
@@ -5474,29 +5541,29 @@ const __vite_glob_0_21 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
5474
5541
|
id: V[O.value.valueField],
|
|
5475
5542
|
...V
|
|
5476
5543
|
}));
|
|
5477
|
-
let
|
|
5478
|
-
return
|
|
5544
|
+
let A = ListToTree(y, O.value);
|
|
5545
|
+
return l.value && m(A, +l.value), A;
|
|
5479
5546
|
});
|
|
5480
5547
|
watch(
|
|
5481
5548
|
[b, _],
|
|
5482
|
-
([y,
|
|
5483
|
-
!y && !
|
|
5549
|
+
([y, A]) => {
|
|
5550
|
+
!y && !A && p();
|
|
5484
5551
|
},
|
|
5485
5552
|
{
|
|
5486
5553
|
immediate: !0
|
|
5487
5554
|
}
|
|
5488
5555
|
);
|
|
5489
5556
|
const T = ref(null);
|
|
5490
|
-
return r({ getElTreeRef: () => T.value }), (y,
|
|
5557
|
+
return r({ getElTreeRef: () => T.value }), (y, A) => (openBlock(), createBlock(unref(ElTree), mergeProps({
|
|
5491
5558
|
ref_key: "ElTreeRef",
|
|
5492
5559
|
ref: T,
|
|
5493
5560
|
data: v.value,
|
|
5494
|
-
props:
|
|
5561
|
+
props: o.value
|
|
5495
5562
|
}, y.$attrs), createSlots({ _: 2 }, [
|
|
5496
|
-
renderList(y.$slots, (V,
|
|
5497
|
-
name:
|
|
5563
|
+
renderList(y.$slots, (V, x, F) => ({
|
|
5564
|
+
name: x,
|
|
5498
5565
|
fn: withCtx((B) => [
|
|
5499
|
-
renderSlot(y.$slots,
|
|
5566
|
+
renderSlot(y.$slots, x, mergeProps({ key: F }, B))
|
|
5500
5567
|
])
|
|
5501
5568
|
}))
|
|
5502
5569
|
]), 1040, ["data", "props"]));
|
|
@@ -5535,59 +5602,59 @@ const __vite_glob_0_22 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
5535
5602
|
},
|
|
5536
5603
|
setup(e, { expose: r }) {
|
|
5537
5604
|
useAttrs();
|
|
5538
|
-
const c = e, { maxLevel: t, dictType:
|
|
5605
|
+
const c = e, { maxLevel: t, dictType: l, disabledObj: n, filterDataFun: u, disabledDataFun: i } = toRefs(c), a = ref(""), s = toRaw(store.state.dictConfig), d = reactive({
|
|
5539
5606
|
list: []
|
|
5540
5607
|
}), g = computed(() => {
|
|
5541
5608
|
const T = {
|
|
5542
5609
|
labelField: "label",
|
|
5543
5610
|
valueField: "value",
|
|
5544
5611
|
childrenField: "children",
|
|
5545
|
-
leafField:
|
|
5546
|
-
}, w = JSON.parse(JSON.stringify(
|
|
5612
|
+
leafField: s.treeSetting.leafField
|
|
5613
|
+
}, w = JSON.parse(JSON.stringify(s.treeSetting));
|
|
5547
5614
|
return Object.assign(w, T);
|
|
5548
5615
|
}), O = (T, w) => {
|
|
5549
5616
|
for (let y = 0; y < T.length; y++) {
|
|
5550
|
-
const
|
|
5551
|
-
if (
|
|
5552
|
-
delete
|
|
5617
|
+
const A = T[y];
|
|
5618
|
+
if (A[g.value.levelField] === w) {
|
|
5619
|
+
delete A[g.value.childrenField], A[g.value.leafField] = !0;
|
|
5553
5620
|
continue;
|
|
5554
5621
|
} else {
|
|
5555
|
-
const
|
|
5556
|
-
O(
|
|
5622
|
+
const x = A[g.value.childrenField];
|
|
5623
|
+
O(x, w);
|
|
5557
5624
|
}
|
|
5558
5625
|
}
|
|
5559
5626
|
}, m = async () => {
|
|
5560
|
-
if (!
|
|
5627
|
+
if (!l.value)
|
|
5561
5628
|
return;
|
|
5562
5629
|
let T = [];
|
|
5563
|
-
if (typeof
|
|
5564
|
-
|
|
5565
|
-
const w = await store.actions.getDictDataObj(
|
|
5566
|
-
T = [].concat(w[
|
|
5567
|
-
const { filters: y, filterType:
|
|
5568
|
-
V ? T = T.filter((F) => !
|
|
5630
|
+
if (typeof l.value == "object") {
|
|
5631
|
+
a.value = l.value.type;
|
|
5632
|
+
const w = await store.actions.getDictDataObj(a.value);
|
|
5633
|
+
T = [].concat(w[a.value]);
|
|
5634
|
+
const { filters: y, filterType: A = s.format.value, reverse: V = !1 } = l.value, x = typeof y == "string" ? y.split(",") : y;
|
|
5635
|
+
V ? T = T.filter((F) => !x.includes(F[A])) : T = T.filter((F) => x.includes(F[A]));
|
|
5569
5636
|
} else {
|
|
5570
|
-
|
|
5571
|
-
const w = await store.actions.getDictDataObj(
|
|
5572
|
-
T = [].concat(w[
|
|
5637
|
+
a.value = l.value;
|
|
5638
|
+
const w = await store.actions.getDictDataObj(a.value);
|
|
5639
|
+
T = [].concat(w[a.value]);
|
|
5573
5640
|
}
|
|
5574
5641
|
if (u.value && (T = u.value(T)), i.value)
|
|
5575
5642
|
T = T.map((w) => ({
|
|
5576
5643
|
...w,
|
|
5577
|
-
[
|
|
5644
|
+
[s.format.disabled]: i.value(w)
|
|
5578
5645
|
}));
|
|
5579
|
-
else if (
|
|
5580
|
-
const { disabledValues: w, disabledType: y =
|
|
5581
|
-
|
|
5582
|
-
const F = JSON.parse(JSON.stringify(
|
|
5583
|
-
return F[
|
|
5584
|
-
}) : T = T.map((
|
|
5585
|
-
const F = JSON.parse(JSON.stringify(
|
|
5586
|
-
return F[
|
|
5646
|
+
else if (n.value) {
|
|
5647
|
+
const { disabledValues: w, disabledType: y = s.treeSetting.valueField, reverse: A = !1 } = n.value, V = typeof w == "string" ? w.split(",") : w;
|
|
5648
|
+
A ? T = T.map((x) => {
|
|
5649
|
+
const F = JSON.parse(JSON.stringify(x));
|
|
5650
|
+
return F[s.format.disabled] = !V.includes(F[y]) || F[s.format.disabled], F;
|
|
5651
|
+
}) : T = T.map((x) => {
|
|
5652
|
+
const F = JSON.parse(JSON.stringify(x));
|
|
5653
|
+
return F[s.format.disabled] = V.includes(F[y]) || F[s.format.disabled], F;
|
|
5587
5654
|
});
|
|
5588
5655
|
}
|
|
5589
5656
|
d.list = T;
|
|
5590
|
-
}, p = computed(() => store.state.isGettingDictTypes.includes(
|
|
5657
|
+
}, p = computed(() => store.state.isGettingDictTypes.includes(a.value)), b = computed(() => store.state.isGettingAllDictTypes), _ = computed(() => {
|
|
5591
5658
|
const T = JSON.parse(JSON.stringify(d.list)).map((y) => ({
|
|
5592
5659
|
label: y[g.value.labelField],
|
|
5593
5660
|
value: y[g.value.valueField],
|
|
@@ -5606,16 +5673,16 @@ const __vite_glob_0_22 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
5606
5673
|
immediate: !0
|
|
5607
5674
|
}
|
|
5608
5675
|
);
|
|
5609
|
-
const
|
|
5610
|
-
return r({ getElTreeSelectRef: () =>
|
|
5676
|
+
const o = ref(null);
|
|
5677
|
+
return r({ getElTreeSelectRef: () => o.value }), (T, w) => (openBlock(), createBlock(unref(ElTreeSelect), mergeProps({
|
|
5611
5678
|
ref_key: "ElTreeSelectRef",
|
|
5612
|
-
ref:
|
|
5679
|
+
ref: o,
|
|
5613
5680
|
data: _.value
|
|
5614
5681
|
}, T.$attrs, { "popper-options": { modifiers: [{ name: "computeStyles", options: { adaptive: !1 } }] } }), createSlots({ _: 2 }, [
|
|
5615
|
-
renderList(T.$slots, (y,
|
|
5616
|
-
name:
|
|
5617
|
-
fn: withCtx((
|
|
5618
|
-
renderSlot(T.$slots,
|
|
5682
|
+
renderList(T.$slots, (y, A, V) => ({
|
|
5683
|
+
name: A,
|
|
5684
|
+
fn: withCtx((x) => [
|
|
5685
|
+
renderSlot(T.$slots, A, mergeProps({ key: V }, x))
|
|
5619
5686
|
])
|
|
5620
5687
|
}))
|
|
5621
5688
|
]), 1040, ["data"]));
|
|
@@ -5679,10 +5746,10 @@ const validatorMap = {
|
|
|
5679
5746
|
if (!/^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dXx]$/.test(e))
|
|
5680
5747
|
return !1;
|
|
5681
5748
|
const c = "10X98765432", t = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
|
|
5682
|
-
let
|
|
5749
|
+
let l = 0;
|
|
5683
5750
|
for (let u = 0; u < 17; u++)
|
|
5684
|
-
|
|
5685
|
-
return c[
|
|
5751
|
+
l += parseInt(e[u]) * t[u];
|
|
5752
|
+
return c[l % 11].toUpperCase() === e[17].toUpperCase();
|
|
5686
5753
|
},
|
|
5687
5754
|
// 密码(简单强度:6-20位,字母+数字)
|
|
5688
5755
|
passwordSimple: (e) => e == null || e === "" ? !0 : /^(?=.*[A-Za-z])(?=.*\d).{6,20}$/.test(e),
|
|
@@ -5702,8 +5769,8 @@ const validatorMap = {
|
|
|
5702
5769
|
return !0;
|
|
5703
5770
|
if (!/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/.test(e))
|
|
5704
5771
|
return !1;
|
|
5705
|
-
const [c, t,
|
|
5706
|
-
return
|
|
5772
|
+
const [c, t, l] = e.split("-").map(Number), n = new Date(c, t - 1, l);
|
|
5773
|
+
return n.getFullYear() === c && n.getMonth() + 1 === t && n.getDate() === l;
|
|
5707
5774
|
},
|
|
5708
5775
|
// 邮政编码(中国6位数字)
|
|
5709
5776
|
postalCode: (e) => e == null || e === "" ? !0 : /^[1-9]\d{5}$/.test(e),
|
|
@@ -5722,53 +5789,53 @@ const validatorMap = {
|
|
|
5722
5789
|
}, closeDropdown = {
|
|
5723
5790
|
beforeMount(e, r) {
|
|
5724
5791
|
const { value: c } = r;
|
|
5725
|
-
let t = !0,
|
|
5792
|
+
let t = !0, l = 50, n = [".el-popper"];
|
|
5726
5793
|
if (typeof c == "boolean")
|
|
5727
5794
|
t = c;
|
|
5728
5795
|
else if (typeof c == "object" && c !== null) {
|
|
5729
|
-
if (t = !!c.window,
|
|
5730
|
-
let
|
|
5731
|
-
const
|
|
5732
|
-
Array.isArray(
|
|
5796
|
+
if (t = !!c.window, l = Number(c.distance) || l, c != null && c.classNameList) {
|
|
5797
|
+
let a = [];
|
|
5798
|
+
const s = c.classNameList;
|
|
5799
|
+
Array.isArray(s) ? a = s : typeof s == "string" && (a = s.split(",").map((d) => d.trim()).filter(Boolean)), n = [.../* @__PURE__ */ new Set([...n, ...a])];
|
|
5733
5800
|
}
|
|
5734
5801
|
} else
|
|
5735
|
-
typeof c == "number" ?
|
|
5802
|
+
typeof c == "number" ? l = Number(c) || l : Array.isArray(c) && (n = c);
|
|
5736
5803
|
const u = t ? window : e;
|
|
5737
5804
|
e._closeDropdownState = {
|
|
5738
5805
|
lastScrollTop: t ? window.scrollY : e.scrollTop,
|
|
5739
|
-
scrollDistance:
|
|
5806
|
+
scrollDistance: l,
|
|
5740
5807
|
isWindow: t,
|
|
5741
5808
|
isTriggered: !1
|
|
5742
5809
|
};
|
|
5743
5810
|
const i = () => {
|
|
5744
|
-
["pointerdown", "mousedown", "mouseup", "click"].forEach((
|
|
5745
|
-
const
|
|
5811
|
+
["pointerdown", "mousedown", "mouseup", "click"].forEach((a) => {
|
|
5812
|
+
const s = new MouseEvent(a, {
|
|
5746
5813
|
bubbles: !0,
|
|
5747
5814
|
cancelable: !0,
|
|
5748
5815
|
view: window,
|
|
5749
5816
|
clientX: 0,
|
|
5750
5817
|
clientY: 0
|
|
5751
5818
|
});
|
|
5752
|
-
document.body.dispatchEvent(
|
|
5819
|
+
document.body.dispatchEvent(s);
|
|
5753
5820
|
}), setTimeout(() => {
|
|
5754
|
-
|
|
5755
|
-
|
|
5821
|
+
n.length !== 0 && document.querySelectorAll(n.join(",")).forEach((a) => {
|
|
5822
|
+
a.getAttribute("aria-hidden") !== "true" && (a.style.display = "none");
|
|
5756
5823
|
});
|
|
5757
5824
|
}, 0);
|
|
5758
5825
|
};
|
|
5759
5826
|
e._debounceHandler = Debounce(i, 99, !0, !0), e._resetHandler = Debounce(() => {
|
|
5760
|
-
const
|
|
5761
|
-
let
|
|
5762
|
-
if (
|
|
5827
|
+
const a = n.length === 0 ? [] : document.querySelectorAll(n.join(","));
|
|
5828
|
+
let s = !1;
|
|
5829
|
+
if (a.forEach((g) => {
|
|
5763
5830
|
const O = g.getAttribute("aria-hidden"), m = window.getComputedStyle(g);
|
|
5764
|
-
O === "true" || m.display === "none" || (
|
|
5765
|
-
}), !e._closeDropdownState.isTriggered &&
|
|
5831
|
+
O === "true" || m.display === "none" || (s = !0);
|
|
5832
|
+
}), !e._closeDropdownState.isTriggered && s)
|
|
5766
5833
|
return;
|
|
5767
5834
|
const d = e._closeDropdownState;
|
|
5768
5835
|
d.lastScrollTop = d.isWindow ? window.scrollY : e.scrollTop, d.isTriggered = !1;
|
|
5769
5836
|
}, 101), e._scrollHandler = () => {
|
|
5770
|
-
const
|
|
5771
|
-
e._resetHandler(),
|
|
5837
|
+
const a = e._closeDropdownState, s = a.isWindow ? window.scrollY : e.scrollTop;
|
|
5838
|
+
e._resetHandler(), a.scrollDistance <= 0 || a.isTriggered ? e._debounceHandler() : Math.abs(s - a.lastScrollTop) >= a.scrollDistance && (a.isTriggered = !0, e._debounceHandler());
|
|
5772
5839
|
}, u.addEventListener("scroll", e._scrollHandler);
|
|
5773
5840
|
},
|
|
5774
5841
|
unmounted(e, r) {
|
|
@@ -5780,37 +5847,37 @@ const validatorMap = {
|
|
|
5780
5847
|
closeDropdown.install = function(e) {
|
|
5781
5848
|
e.directive("closeDropdown", closeDropdown);
|
|
5782
5849
|
};
|
|
5783
|
-
const directives = [{ name: "closeDropdown", directive: closeDropdown }], getDictConfig = GetDictConfig, getDictConfigByKey = GetDictConfigByKey, getDictData = GetDictData, getDictDataByKey = GetDictDataByKey, debounce = Debounce, throttle = Throttle, getLabelByCode = GetLabelByCode, getLabelByCodes = GetLabelByCodes, getCodeByLabel = GetCodeByLabel, getCodeByLabels = GetCodeByLabels, getDictObjByDictTypes = GetDictObjByDictTypes, getItemByCode = GetItemByCode, getLabelByCodeFilter = GetLabelByCodeFilter, getLabelByCodesFilter = GetLabelByCodesFilter, getCodeByLabelFilter = GetCodeByLabelFilter, getCodeByLabelsFilter = GetCodeByLabelsFilter, mask = Mask, maskAddress = MaskAddress, maskIdCard = MaskIdCard, maskName = MaskName, maskPhone = MaskPhone, desensitization = Desensitization, formatDate = FormatDate, isDate = IsDate, listToTree = ListToTree, getTreeItemByCode = GetTreeItemByCode, getTreeItemByLabel = GetTreeItemByLabel, getTreeLabelByCode = GetTreeLabelByCode, getTreeCodeByLabel = GetTreeCodeByLabel, getTreeLabelByCodes = GetTreeLabelByCodes, getTreeCodeByLabels = GetTreeCodeByLabels, getTreeLabelByCodeFilter = GetTreeLabelByCodeFilter, getTreeCodeByLabelFilter = GetTreeCodeByLabelFilter, getTreeLabelByCodesFilter = GetTreeLabelByCodesFilter, getTreeCodeByLabelsFilter = GetTreeCodeByLabelsFilter;
|
|
5850
|
+
const directives = [{ name: "closeDropdown", directive: closeDropdown }], getDictConfig = GetDictConfig, getDictConfigByKey = GetDictConfigByKey, getDictData = GetDictData, getDictDataByKey = GetDictDataByKey, debounce = Debounce, throttle = Throttle, getLabelByCode = GetLabelByCode, getLabelByCodes = GetLabelByCodes, getCodeByLabel = GetCodeByLabel, getCodeByLabels = GetCodeByLabels, getDictObjByDictTypes = GetDictObjByDictTypes, getItemByCode = GetItemByCode, getLabelByCodeFilter = GetLabelByCodeFilter, getLabelByCodesFilter = GetLabelByCodesFilter, getCodeByLabelFilter = GetCodeByLabelFilter, getCodeByLabelsFilter = GetCodeByLabelsFilter, mask = Mask, maskAddress = MaskAddress, maskIdCard = MaskIdCard, maskName = MaskName, maskPhone = MaskPhone, desensitization = Desensitization, formatDate = FormatDate, isDate = IsDate, listToTree = ListToTree, getTreeItemByCode = GetTreeItemByCode, getTreeItemByLabel = GetTreeItemByLabel, getTreePathByValue = GetTreePathByValue, treeToList = TreeToList, getTreeLabelByCode = GetTreeLabelByCode, getTreeCodeByLabel = GetTreeCodeByLabel, getTreeLabelByCodes = GetTreeLabelByCodes, getTreeCodeByLabels = GetTreeCodeByLabels, getTreeLabelByCodeFilter = GetTreeLabelByCodeFilter, getTreeCodeByLabelFilter = GetTreeCodeByLabelFilter, getTreeLabelByCodesFilter = GetTreeLabelByCodesFilter, getTreeCodeByLabelsFilter = GetTreeCodeByLabelsFilter;
|
|
5784
5851
|
let loginWatcher = null;
|
|
5785
5852
|
async function getDictCodeReq(e, r) {
|
|
5786
|
-
var
|
|
5853
|
+
var a;
|
|
5787
5854
|
let c = e.storage.getItem(e.dictDataKey) || "{}", t = {};
|
|
5788
5855
|
try {
|
|
5789
5856
|
t = c ? JSON.parse(c) : {};
|
|
5790
|
-
} catch (
|
|
5791
|
-
c = "{}", t = {}, console.error(
|
|
5857
|
+
} catch (s) {
|
|
5858
|
+
c = "{}", t = {}, console.error(s);
|
|
5792
5859
|
}
|
|
5793
|
-
const
|
|
5860
|
+
const l = r, n = Object.keys(e.localDictCodes), u = l.filter((s) => n.includes(s) ? (console.warn(`注意:usuallyGetDictTypes配置与本地字典配置的字典类型${s}冲突`), !1) : !0);
|
|
5794
5861
|
let i = [];
|
|
5795
5862
|
if (e.usuallyGetDictTypesByApi) {
|
|
5796
|
-
const
|
|
5863
|
+
const s = store.state.dictCodes;
|
|
5797
5864
|
i = u;
|
|
5798
|
-
const d = { ...
|
|
5865
|
+
const d = { ...s };
|
|
5799
5866
|
i.forEach((g) => {
|
|
5800
5867
|
d.hasOwnProperty(g) && delete d[g];
|
|
5801
5868
|
}), store.mutations.SET_DICT_CODES(d), e.storage.setItem(e.dictDataKey, JSON.stringify(d));
|
|
5802
5869
|
} else if (u.length > 0)
|
|
5803
|
-
for (let
|
|
5804
|
-
t[u[
|
|
5870
|
+
for (let s = 0; s < u.length; s++)
|
|
5871
|
+
t[u[s]] || i.push(u[s]);
|
|
5805
5872
|
if (c === "{}" || e.isGetAll || i.length > 0) {
|
|
5806
|
-
let
|
|
5873
|
+
let s = "";
|
|
5807
5874
|
if (e.isGetAll) {
|
|
5808
5875
|
store.mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!0);
|
|
5809
|
-
const d = await e.getDictCodeApi(e.formatterRequest(e.query,
|
|
5876
|
+
const d = await e.getDictCodeApi(e.formatterRequest(e.query, s));
|
|
5810
5877
|
store.mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!1);
|
|
5811
|
-
const g = e.formatterDictList(d,
|
|
5878
|
+
const g = e.formatterDictList(d, s), O = e.formatterDictVersion(d);
|
|
5812
5879
|
e.storage.setItem(e.versionKey, O);
|
|
5813
|
-
const m = Object.assign(store.state.dictCodes, g), p = formatDictData(m, e.filterDataFun, e.disabledDataFun, (
|
|
5880
|
+
const m = Object.assign(store.state.dictCodes, g), p = formatDictData(m, e.filterDataFun, e.disabledDataFun, (a = e == null ? void 0 : e.format) == null ? void 0 : a.disabled);
|
|
5814
5881
|
store.mutations.SET_DICT_CODES(p), e.storage.setItem(e.dictDataKey, JSON.stringify(p));
|
|
5815
5882
|
} else if (i.length > 0)
|
|
5816
5883
|
for (let d = 0; d < i.length; d++) {
|
|
@@ -5828,10 +5895,10 @@ let vue3ElementDict = {
|
|
|
5828
5895
|
_.includes("formItemContextKey") || _.includes("formContextKey") || c.apply(console, b);
|
|
5829
5896
|
};
|
|
5830
5897
|
const t = e.config.warnHandler;
|
|
5831
|
-
e.config.warnHandler = (b, _,
|
|
5832
|
-
typeof b == "string" && (b.includes("formItemContextKey") || b.includes("formContextKey")) || t == null || t(b, _,
|
|
5898
|
+
e.config.warnHandler = (b, _, o) => {
|
|
5899
|
+
typeof b == "string" && (b.includes("formItemContextKey") || b.includes("formContextKey")) || t == null || t(b, _, o);
|
|
5833
5900
|
};
|
|
5834
|
-
const
|
|
5901
|
+
const l = {
|
|
5835
5902
|
timeout: 3e4,
|
|
5836
5903
|
// 请求字典数据方法超时时间
|
|
5837
5904
|
delayTime: null,
|
|
@@ -5916,40 +5983,40 @@ let vue3ElementDict = {
|
|
|
5916
5983
|
localDictCodes: {}
|
|
5917
5984
|
//本地数据
|
|
5918
5985
|
};
|
|
5919
|
-
r.format = Object.assign(
|
|
5920
|
-
const
|
|
5921
|
-
store.mutations.SET_DICT_SETTING(
|
|
5986
|
+
r.format = Object.assign(l.format, r.format), r.treeSetting = Object.assign(l.treeSetting, r.treeSetting), r.treeSetting.labelField = r.treeSetting.labelField || r.format.label, r.treeSetting.valueField = r.treeSetting.valueField || r.format.value, r.treeSetting.level = 0;
|
|
5987
|
+
const n = Object.assign(l, r);
|
|
5988
|
+
store.mutations.SET_DICT_SETTING(n);
|
|
5922
5989
|
let u = {};
|
|
5923
5990
|
try {
|
|
5924
|
-
const b =
|
|
5991
|
+
const b = n.storage.getItem(n.dictDataKey);
|
|
5925
5992
|
u = b ? JSON.parse(b) : {};
|
|
5926
5993
|
} catch (b) {
|
|
5927
5994
|
u = {}, console.log(b);
|
|
5928
5995
|
}
|
|
5929
|
-
let i = JSON.parse(JSON.stringify(
|
|
5996
|
+
let i = JSON.parse(JSON.stringify(n.localDictCodes));
|
|
5930
5997
|
i = Object.assign(u, i);
|
|
5931
|
-
const
|
|
5932
|
-
|
|
5933
|
-
const
|
|
5934
|
-
let d =
|
|
5935
|
-
if (
|
|
5936
|
-
const b =
|
|
5998
|
+
const a = formatDictData(i, n.filterDataFun, n.disabledDataFun, (m = n == null ? void 0 : n.format) == null ? void 0 : m.disabled);
|
|
5999
|
+
n.storage.setItem(n.dictDataKey, JSON.stringify(a)), store.mutations.SET_DICT_CODES(a);
|
|
6000
|
+
const s = n.storage.getItem(n.versionKey);
|
|
6001
|
+
let d = n.usuallyGetDictTypes ? n.usuallyGetDictTypes.split(",") : [];
|
|
6002
|
+
if (n.version !== s) {
|
|
6003
|
+
const b = n.storage.getItem(n.dictDataKey);
|
|
5937
6004
|
let _ = {};
|
|
5938
6005
|
try {
|
|
5939
6006
|
_ = b ? JSON.parse(b) : {};
|
|
5940
6007
|
} catch (V) {
|
|
5941
6008
|
_ = {}, console.error(V);
|
|
5942
6009
|
}
|
|
5943
|
-
const
|
|
5944
|
-
d = [...new Set(w)],
|
|
5945
|
-
const y = JSON.parse(JSON.stringify(
|
|
5946
|
-
|
|
6010
|
+
const o = _ ? Object.keys(_) : [], v = n.localDictCodes ? Object.keys(n.localDictCodes) : [], T = o.filter((V) => !v.includes(V)), w = [...d, ...T];
|
|
6011
|
+
d = [...new Set(w)], n.storage.removeItem(n.dictDataKey), n.storage.setItem(n.versionKey, n.version);
|
|
6012
|
+
const y = JSON.parse(JSON.stringify(n.localDictCodes)), A = formatDictData(y, n.filterDataFun, n.disabledDataFun, (p = n == null ? void 0 : n.format) == null ? void 0 : p.disabled);
|
|
6013
|
+
n.storage.setItem(n.dictDataKey, JSON.stringify(A)), store.mutations.SET_DICT_CODES(A);
|
|
5947
6014
|
}
|
|
5948
|
-
|
|
6015
|
+
n.getLoginStatusFunc() && (n.isGetAll || d.length > 0) && getDictCodeReq(n, d), directives.forEach(({ name: b, directive: _ }) => {
|
|
5949
6016
|
e.directive(b, _);
|
|
5950
6017
|
}), components.forEach((b) => {
|
|
5951
|
-
const _ = b.name.slice(4),
|
|
5952
|
-
e.component(
|
|
6018
|
+
const _ = b.name.slice(4), o = n.componentsPreFix + _;
|
|
6019
|
+
e.component(o, b);
|
|
5953
6020
|
});
|
|
5954
6021
|
const g = reactive({
|
|
5955
6022
|
hadLogin: computed(() => store.state.dictConfig.getLoginStatusFunc())
|
|
@@ -5958,7 +6025,7 @@ let vue3ElementDict = {
|
|
|
5958
6025
|
loginWatcher && (loginWatcher(), loginWatcher = null), loginWatcher = watch(
|
|
5959
6026
|
() => g.hadLogin,
|
|
5960
6027
|
(b) => {
|
|
5961
|
-
|
|
6028
|
+
n.loginStatusChangeFunc && n.loginStatusChangeFunc(b), b && (n.isGetAll || d.length > 0) && getDictCodeReq(n, d);
|
|
5962
6029
|
},
|
|
5963
6030
|
{ immediate: !1 }
|
|
5964
6031
|
);
|
|
@@ -5994,6 +6061,7 @@ export {
|
|
|
5994
6061
|
getTreeLabelByCodeFilter,
|
|
5995
6062
|
getTreeLabelByCodes,
|
|
5996
6063
|
getTreeLabelByCodesFilter,
|
|
6064
|
+
getTreePathByValue,
|
|
5997
6065
|
isDate,
|
|
5998
6066
|
listToTree,
|
|
5999
6067
|
mask,
|
|
@@ -6001,5 +6069,6 @@ export {
|
|
|
6001
6069
|
maskIdCard,
|
|
6002
6070
|
maskName,
|
|
6003
6071
|
maskPhone,
|
|
6004
|
-
throttle
|
|
6072
|
+
throttle,
|
|
6073
|
+
treeToList
|
|
6005
6074
|
};
|