vue3-element-dict 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/lib/vue3-element-dict.js +834 -824
- package/lib/vue3-element-dict.umd.cjs +1 -1
- package/package.json +1 -1
package/lib/vue3-element-dict.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { reactive as ae, defineComponent as H, toRefs as Le, toRaw as P, computed as
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
for (let
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { reactive as ae, defineComponent as H, toRefs as Le, toRaw as P, computed as N, ref as k, watchEffect as Ve, resolveComponent as $, openBlock as G, createBlock as w, mergeProps as ie, unref as S, createSlots as Q, withCtx as L, createTextVNode as K, toDisplayString as U, renderList as x, renderSlot as M, normalizeProps as W, guardReactiveProps as X, useAttrs as me, watch as re, createElementBlock as te, Fragment as ne, createVNode as Ue } from "vue";
|
|
2
|
+
const ce = (e, n, g, t) => {
|
|
3
|
+
const s = {};
|
|
4
|
+
for (let l in e)
|
|
5
|
+
s[l] = n(e[l]).map((c) => ({
|
|
6
|
+
...c,
|
|
7
|
+
[t]: g(c) || !!c[t]
|
|
8
|
+
}));
|
|
9
|
+
return s;
|
|
10
|
+
}, R = ae({
|
|
8
11
|
dictConfig: {
|
|
9
12
|
getDictCodeApi: new Promise((e, n) => {
|
|
10
13
|
e({});
|
|
@@ -12,7 +15,7 @@ const Ne = (e, n, g) => {
|
|
|
12
15
|
//组件过滤数据 配置
|
|
13
16
|
filterDataFun: (e) => e,
|
|
14
17
|
//组件禁用数据 配置
|
|
15
|
-
disabledDataFun: (e) =>
|
|
18
|
+
disabledDataFun: (e) => !1,
|
|
16
19
|
//配置数组数据转化成树形数据
|
|
17
20
|
treeSetting: {
|
|
18
21
|
idField: "id",
|
|
@@ -68,39 +71,39 @@ const Ne = (e, n, g) => {
|
|
|
68
71
|
}), Y = {
|
|
69
72
|
//设置字典配置
|
|
70
73
|
SET_DICT_SETTING(e) {
|
|
71
|
-
|
|
74
|
+
R.dictConfig = e;
|
|
72
75
|
},
|
|
73
76
|
//设置字典数据值
|
|
74
77
|
SET_DICT_CODES(e) {
|
|
75
|
-
|
|
78
|
+
R.dictCodes = e;
|
|
76
79
|
},
|
|
77
80
|
//添加正在请求的字典类型字段
|
|
78
81
|
ADD_IS_EGTTING_DICT_TYPES(e) {
|
|
79
|
-
const g = [...e.split(","), ...
|
|
80
|
-
|
|
82
|
+
const g = [...e.split(","), ...R.isGettingDictTypes], t = new Set(g);
|
|
83
|
+
R.isGettingDictTypes = Array.from(t);
|
|
81
84
|
},
|
|
82
85
|
//去除正在请求的字典类型字段
|
|
83
86
|
REMOVE_IS_EGTTING_DICT_TYPES(e) {
|
|
84
|
-
const n = e.split(","), g = [...new Set(
|
|
87
|
+
const n = e.split(","), g = [...new Set(R.isGettingDictTypes)].filter(
|
|
85
88
|
(t) => !new Set(n).has(t)
|
|
86
89
|
);
|
|
87
|
-
|
|
90
|
+
R.isGettingDictTypes = Array.from(g);
|
|
88
91
|
},
|
|
89
92
|
//设置是否正在请求所有字典数据
|
|
90
93
|
SETTING_ISGETTING_ALL_DICT_TYPES(e) {
|
|
91
|
-
|
|
94
|
+
R.isGettingAllDictTypes = e;
|
|
92
95
|
},
|
|
93
96
|
//添加找不到的字典类型字段
|
|
94
97
|
ADD_UNFIND_DICT_TYPES(e) {
|
|
95
|
-
const g = [...e.split(","), ...
|
|
96
|
-
|
|
98
|
+
const g = [...e.split(","), ...R.unfindDictTypes], t = new Set(g);
|
|
99
|
+
R.unfindDictTypes = Array.from(t);
|
|
97
100
|
},
|
|
98
101
|
//去除找不到的字典类型字段
|
|
99
102
|
REMOVE_UNFIND_DICT_TYPES(e) {
|
|
100
|
-
const n = e.split(","), g = [...new Set(
|
|
103
|
+
const n = e.split(","), g = [...new Set(R.unfindDictTypes)].filter(
|
|
101
104
|
(t) => !new Set(n).has(t)
|
|
102
105
|
);
|
|
103
|
-
|
|
106
|
+
R.unfindDictTypes = Array.from(g);
|
|
104
107
|
}
|
|
105
108
|
}, He = {
|
|
106
109
|
getDictDataObj(e) {
|
|
@@ -109,358 +112,359 @@ const Ne = (e, n, g) => {
|
|
|
109
112
|
return;
|
|
110
113
|
const {
|
|
111
114
|
storage: t,
|
|
112
|
-
dictDataKey:
|
|
115
|
+
dictDataKey: s,
|
|
113
116
|
getDictCodeApi: l,
|
|
114
117
|
usuallyGetDictTypes: c,
|
|
115
118
|
formatterRequest: a,
|
|
116
|
-
query:
|
|
119
|
+
query: d,
|
|
117
120
|
versionKey: i,
|
|
118
|
-
localDictCodes:
|
|
119
|
-
formatterDictList:
|
|
121
|
+
localDictCodes: r,
|
|
122
|
+
formatterDictList: b,
|
|
120
123
|
formatterDictVersion: T,
|
|
121
124
|
isGetAll: h,
|
|
122
125
|
filterDataFun: I,
|
|
123
|
-
disabledDataFun:
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
126
|
+
disabledDataFun: O,
|
|
127
|
+
format: F
|
|
128
|
+
} = R.dictConfig, E = R.dictCodes || r;
|
|
129
|
+
if (!E[e] || E[e].length === 0) {
|
|
130
|
+
if (R.isGettingDictTypes.includes(e) || R.isGettingAllDictTypes)
|
|
127
131
|
return;
|
|
128
|
-
if (Y.ADD_IS_EGTTING_DICT_TYPES(e),
|
|
132
|
+
if (Y.ADD_IS_EGTTING_DICT_TYPES(e), R.unfindDictTypes.includes(e)) {
|
|
129
133
|
g(`不存在类型为:${e} 的字典字段,请确认后再填写`);
|
|
130
134
|
return;
|
|
131
135
|
}
|
|
132
|
-
Y.ADD_UNFIND_DICT_TYPES(e), l(a(
|
|
136
|
+
Y.ADD_UNFIND_DICT_TYPES(e), l(a(d, e)).then((C) => {
|
|
133
137
|
Y.REMOVE_IS_EGTTING_DICT_TYPES(e);
|
|
134
|
-
const
|
|
135
|
-
if (
|
|
136
|
-
let
|
|
138
|
+
const v = T(C), m = t.getItem(i);
|
|
139
|
+
if (v !== m) {
|
|
140
|
+
let f = "";
|
|
137
141
|
if (h)
|
|
138
|
-
|
|
142
|
+
f = "", Y.SETTING_ISGETTING_ALL_DICT_TYPES(!0);
|
|
139
143
|
else {
|
|
140
144
|
if (c) {
|
|
141
|
-
const
|
|
142
|
-
|
|
145
|
+
const u = Object.keys(E), D = c.split(","), p = u.concat(D);
|
|
146
|
+
p.push(e), f = Array.from(new Set(p)).join(",");
|
|
143
147
|
} else {
|
|
144
|
-
const
|
|
145
|
-
|
|
148
|
+
const u = Object.keys(E);
|
|
149
|
+
u.push(e), f = Array.from(new Set(u)).join(",");
|
|
146
150
|
}
|
|
147
|
-
Y.ADD_IS_EGTTING_DICT_TYPES(
|
|
151
|
+
Y.ADD_IS_EGTTING_DICT_TYPES(f);
|
|
148
152
|
}
|
|
149
|
-
l(a(
|
|
150
|
-
(
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
+
l(a(d, f)).then(
|
|
154
|
+
(u) => {
|
|
155
|
+
const D = b(
|
|
156
|
+
u,
|
|
153
157
|
e
|
|
154
158
|
);
|
|
155
|
-
if (!(
|
|
159
|
+
if (!(D[e] && D[e].length > 0)) {
|
|
156
160
|
g(
|
|
157
161
|
`不存在类型为:${e} 的字典字段,请确认后再填写`
|
|
158
162
|
);
|
|
159
163
|
return;
|
|
160
164
|
}
|
|
161
165
|
Y.REMOVE_UNFIND_DICT_TYPES(e);
|
|
162
|
-
const
|
|
163
|
-
JSON.parse(JSON.stringify(
|
|
164
|
-
|
|
165
|
-
),
|
|
166
|
-
t.setItem(
|
|
166
|
+
const p = T(u), y = Object.assign(
|
|
167
|
+
JSON.parse(JSON.stringify(r)),
|
|
168
|
+
D
|
|
169
|
+
), _ = ce(y, I, O, F == null ? void 0 : F.disabled);
|
|
170
|
+
t.setItem(s, JSON.stringify(_)), t.setItem(i, p), Y.SET_DICT_CODES(_), n(R.dictCodes), R.isGettingAllDictTypes ? Y.SETTING_ISGETTING_ALL_DICT_TYPES(!1) : Y.REMOVE_IS_EGTTING_DICT_TYPES(f);
|
|
167
171
|
}
|
|
168
172
|
);
|
|
169
173
|
} else {
|
|
170
|
-
const
|
|
171
|
-
|
|
174
|
+
const f = b(
|
|
175
|
+
C,
|
|
172
176
|
e
|
|
173
177
|
);
|
|
174
|
-
if (!(
|
|
178
|
+
if (!(f[e] && f[e].length > 0)) {
|
|
175
179
|
g(`不存在类型为:${e} 的字典字段,请确认后再填写`);
|
|
176
180
|
return;
|
|
177
181
|
}
|
|
178
182
|
Y.REMOVE_UNFIND_DICT_TYPES(e);
|
|
179
|
-
const
|
|
180
|
-
Object.assign(
|
|
183
|
+
const u = R.dictCodes || r, D = ce(f, I, O, F == null ? void 0 : F.disabled);
|
|
184
|
+
Object.assign(u, D), t.setItem(s, JSON.stringify(u)), Y.SET_DICT_CODES(u), n(R.dictCodes);
|
|
181
185
|
}
|
|
182
186
|
});
|
|
183
187
|
} else
|
|
184
|
-
Y.REMOVE_UNFIND_DICT_TYPES(e), Y.SET_DICT_CODES(
|
|
188
|
+
Y.REMOVE_UNFIND_DICT_TYPES(e), Y.SET_DICT_CODES(E), n(R.dictCodes);
|
|
185
189
|
});
|
|
186
190
|
}
|
|
187
|
-
},
|
|
188
|
-
state:
|
|
191
|
+
}, o = {
|
|
192
|
+
state: R,
|
|
189
193
|
mutations: Y,
|
|
190
194
|
actions: He
|
|
191
|
-
}, Qe = (e, n, g) => new Promise((t,
|
|
192
|
-
const { format: l } =
|
|
195
|
+
}, Qe = (e, n, g) => new Promise((t, s) => {
|
|
196
|
+
const { format: l } = o.state.dictConfig, c = o.state.dictCodes;
|
|
193
197
|
let a = [];
|
|
194
198
|
if (!c || !c[n])
|
|
195
|
-
if (
|
|
196
|
-
const
|
|
197
|
-
if (!(
|
|
198
|
-
if (clearInterval(
|
|
199
|
-
|
|
199
|
+
if (o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes) {
|
|
200
|
+
const d = setInterval(() => {
|
|
201
|
+
if (!(o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes)) {
|
|
202
|
+
if (clearInterval(d), a = o.state.dictCodes[n], !a) {
|
|
203
|
+
s(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
200
204
|
return;
|
|
201
205
|
}
|
|
202
|
-
const i = a.find((
|
|
206
|
+
const i = a.find((r) => r[l.value] === e);
|
|
203
207
|
t(i ? i[l.label] : g ?? "");
|
|
204
208
|
}
|
|
205
209
|
}, 1e3);
|
|
206
210
|
} else
|
|
207
|
-
|
|
208
|
-
if (a =
|
|
209
|
-
|
|
211
|
+
o.actions.getDictDataObj(n).then((d) => {
|
|
212
|
+
if (a = d[n], !a) {
|
|
213
|
+
s(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
210
214
|
return;
|
|
211
215
|
}
|
|
212
|
-
const i = a.find((
|
|
216
|
+
const i = a.find((r) => r[l.value] === e);
|
|
213
217
|
t(i ? i[l.label] : g ?? "");
|
|
214
218
|
});
|
|
215
219
|
else {
|
|
216
220
|
a = c[n];
|
|
217
|
-
const
|
|
218
|
-
t(
|
|
221
|
+
const d = a.find((i) => i[l.value] === e);
|
|
222
|
+
t(d ? d[l.label] : g ?? "");
|
|
219
223
|
}
|
|
220
224
|
});
|
|
221
|
-
function
|
|
222
|
-
const
|
|
225
|
+
function de(e, n, g, t) {
|
|
226
|
+
const s = [];
|
|
223
227
|
for (let l = 0; l < e.length; l++) {
|
|
224
228
|
const c = n.find((a) => a[g.value] === e[l]);
|
|
225
|
-
c ?
|
|
229
|
+
c ? s.push(c) : s.push({
|
|
226
230
|
[g.label]: t,
|
|
227
231
|
[g.value]: e[l]
|
|
228
232
|
});
|
|
229
233
|
}
|
|
230
|
-
return
|
|
234
|
+
return s;
|
|
231
235
|
}
|
|
232
236
|
const We = (e, n, g) => {
|
|
233
237
|
const t = {
|
|
234
238
|
defaultVal: "",
|
|
235
|
-
formatFun: (
|
|
239
|
+
formatFun: (s, l) => s.map((c) => c[l.label]).join(","),
|
|
236
240
|
spacer: ","
|
|
237
241
|
};
|
|
238
|
-
return Object.assign(t, g), new Promise((
|
|
242
|
+
return Object.assign(t, g), new Promise((s, l) => {
|
|
239
243
|
let c = [];
|
|
240
244
|
Array.isArray(e) ? c = e : typeof e == "string" && (c = e.split(t.spacer));
|
|
241
|
-
const { format: a } =
|
|
245
|
+
const { format: a } = o.state.dictConfig, d = o.state.dictCodes;
|
|
242
246
|
let i = [];
|
|
243
|
-
if (!
|
|
244
|
-
if (
|
|
245
|
-
const
|
|
246
|
-
if (!(
|
|
247
|
-
if (clearInterval(
|
|
247
|
+
if (!d || !d[n])
|
|
248
|
+
if (o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes) {
|
|
249
|
+
const r = setInterval(() => {
|
|
250
|
+
if (!(o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes)) {
|
|
251
|
+
if (clearInterval(r), i = o.state.dictCodes[n], !i) {
|
|
248
252
|
l(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
249
253
|
return;
|
|
250
254
|
}
|
|
251
|
-
const
|
|
255
|
+
const b = de(
|
|
252
256
|
c,
|
|
253
257
|
i,
|
|
254
258
|
a,
|
|
255
259
|
t.defaultVal
|
|
256
260
|
);
|
|
257
|
-
|
|
258
|
-
|
|
261
|
+
s(
|
|
262
|
+
b && b.length > 0 ? t.formatFun(b, a) : t.defaultVal
|
|
259
263
|
);
|
|
260
264
|
}
|
|
261
265
|
}, 1e3);
|
|
262
266
|
} else
|
|
263
|
-
|
|
264
|
-
if (i =
|
|
267
|
+
o.actions.getDictDataObj(n).then((r) => {
|
|
268
|
+
if (i = r[n], !i) {
|
|
265
269
|
l(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
266
270
|
return;
|
|
267
271
|
}
|
|
268
|
-
const
|
|
272
|
+
const b = de(
|
|
269
273
|
c,
|
|
270
274
|
i,
|
|
271
275
|
a,
|
|
272
276
|
t.defaultVal
|
|
273
277
|
);
|
|
274
|
-
|
|
275
|
-
|
|
278
|
+
s(
|
|
279
|
+
b && b.length > 0 ? t.formatFun(b, a) : t.defaultVal
|
|
276
280
|
);
|
|
277
281
|
});
|
|
278
282
|
else {
|
|
279
|
-
i =
|
|
280
|
-
const
|
|
283
|
+
i = d[n];
|
|
284
|
+
const r = de(
|
|
281
285
|
c,
|
|
282
286
|
i,
|
|
283
287
|
a,
|
|
284
288
|
t.defaultVal
|
|
285
289
|
);
|
|
286
|
-
|
|
287
|
-
|
|
290
|
+
s(
|
|
291
|
+
r && r.length > 0 ? t.formatFun(r, a) : t.defaultVal
|
|
288
292
|
);
|
|
289
293
|
}
|
|
290
294
|
});
|
|
291
|
-
}, Xe = (e, n, g) => new Promise((t,
|
|
292
|
-
const { format: l } =
|
|
295
|
+
}, Xe = (e, n, g) => new Promise((t, s) => {
|
|
296
|
+
const { format: l } = o.state.dictConfig, c = o.state.dictCodes;
|
|
293
297
|
let a = [];
|
|
294
298
|
if (!c || !c[n])
|
|
295
|
-
if (
|
|
296
|
-
const
|
|
297
|
-
if (!(
|
|
298
|
-
if (clearInterval(
|
|
299
|
-
|
|
299
|
+
if (o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes) {
|
|
300
|
+
const d = setInterval(() => {
|
|
301
|
+
if (!(o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes)) {
|
|
302
|
+
if (clearInterval(d), a = o.state.dictCodes[n], !a) {
|
|
303
|
+
s(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
300
304
|
return;
|
|
301
305
|
}
|
|
302
|
-
const i = a.find((
|
|
306
|
+
const i = a.find((r) => r[l.label] === e);
|
|
303
307
|
t(i ? i[l.value] : g ?? "");
|
|
304
308
|
}
|
|
305
309
|
}, 1e3);
|
|
306
310
|
} else
|
|
307
|
-
|
|
308
|
-
if (a =
|
|
309
|
-
|
|
311
|
+
o.actions.getDictDataObj(n).then((d) => {
|
|
312
|
+
if (a = d[n], !a) {
|
|
313
|
+
s(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
310
314
|
return;
|
|
311
315
|
}
|
|
312
|
-
const i = a.find((
|
|
316
|
+
const i = a.find((r) => r[l.label] === e);
|
|
313
317
|
t(i ? i[l.value] : g ?? "");
|
|
314
318
|
});
|
|
315
319
|
else {
|
|
316
320
|
a = c[n];
|
|
317
|
-
const
|
|
318
|
-
t(
|
|
321
|
+
const d = a.find((i) => i[l.label] === e);
|
|
322
|
+
t(d ? d[l.value] : g ?? "");
|
|
319
323
|
}
|
|
320
324
|
});
|
|
321
|
-
function
|
|
322
|
-
const
|
|
325
|
+
function fe(e, n, g, t) {
|
|
326
|
+
const s = [];
|
|
323
327
|
for (let l = 0; l < e.length; l++) {
|
|
324
328
|
const c = n.find((a) => a[g.label] === e[l]);
|
|
325
|
-
c ?
|
|
329
|
+
c ? s.push(c) : s.push({
|
|
326
330
|
[g.label]: e[l],
|
|
327
331
|
[g.value]: t
|
|
328
332
|
});
|
|
329
333
|
}
|
|
330
|
-
return
|
|
334
|
+
return s;
|
|
331
335
|
}
|
|
332
336
|
const Ze = (e, n, g) => {
|
|
333
337
|
const t = {
|
|
334
338
|
defaultVal: "",
|
|
335
|
-
formatFun: (
|
|
339
|
+
formatFun: (s, l) => s.map((c) => c[l.value]).join(","),
|
|
336
340
|
spacer: ","
|
|
337
341
|
};
|
|
338
|
-
return Object.assign(t, g), new Promise((
|
|
342
|
+
return Object.assign(t, g), new Promise((s, l) => {
|
|
339
343
|
let c = [];
|
|
340
344
|
Array.isArray(e) ? c = e : typeof e == "string" && (c = e.split(t.spacer));
|
|
341
|
-
const { format: a } =
|
|
345
|
+
const { format: a } = o.state.dictConfig, d = o.state.dictCodes;
|
|
342
346
|
let i = [];
|
|
343
|
-
if (!
|
|
344
|
-
if (
|
|
345
|
-
const
|
|
346
|
-
if (!(
|
|
347
|
-
if (clearInterval(
|
|
347
|
+
if (!d || !d[n])
|
|
348
|
+
if (o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes) {
|
|
349
|
+
const r = setInterval(() => {
|
|
350
|
+
if (!(o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes)) {
|
|
351
|
+
if (clearInterval(r), i = o.state.dictCodes[n], !i) {
|
|
348
352
|
l(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
349
353
|
return;
|
|
350
354
|
}
|
|
351
|
-
const
|
|
355
|
+
const b = fe(
|
|
352
356
|
c,
|
|
353
357
|
i,
|
|
354
358
|
a,
|
|
355
359
|
t.defaultVal
|
|
356
360
|
);
|
|
357
|
-
|
|
358
|
-
|
|
361
|
+
s(
|
|
362
|
+
b && b.length > 0 ? t.formatFun(b, a) : t.defaultVal
|
|
359
363
|
);
|
|
360
364
|
}
|
|
361
365
|
}, 1e3);
|
|
362
366
|
} else
|
|
363
|
-
|
|
364
|
-
if (i =
|
|
367
|
+
o.actions.getDictDataObj(n).then((r) => {
|
|
368
|
+
if (i = r[n], !i) {
|
|
365
369
|
l(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
366
370
|
return;
|
|
367
371
|
}
|
|
368
|
-
const
|
|
372
|
+
const b = fe(
|
|
369
373
|
c,
|
|
370
374
|
i,
|
|
371
375
|
a,
|
|
372
376
|
t.defaultVal
|
|
373
377
|
);
|
|
374
|
-
|
|
375
|
-
|
|
378
|
+
s(
|
|
379
|
+
b && b.length > 0 ? t.formatFun(b, a) : t.defaultVal
|
|
376
380
|
);
|
|
377
381
|
});
|
|
378
382
|
else {
|
|
379
|
-
i =
|
|
380
|
-
const
|
|
383
|
+
i = d[n];
|
|
384
|
+
const r = fe(
|
|
381
385
|
c,
|
|
382
386
|
i,
|
|
383
387
|
a,
|
|
384
388
|
t.defaultVal
|
|
385
389
|
);
|
|
386
|
-
|
|
387
|
-
|
|
390
|
+
s(
|
|
391
|
+
r && r.length > 0 ? t.formatFun(r, a) : t.defaultVal
|
|
388
392
|
);
|
|
389
393
|
}
|
|
390
394
|
});
|
|
391
395
|
}, et = (e) => new Promise((n, g) => {
|
|
392
|
-
let t = [],
|
|
393
|
-
Array.isArray(e) ? (
|
|
394
|
-
const l =
|
|
396
|
+
let t = [], s = "";
|
|
397
|
+
Array.isArray(e) ? (s = e.join(","), t = e) : typeof e == "string" && (t = e.split(","));
|
|
398
|
+
const l = o.state.dictCodes, c = o.state.dictConfig;
|
|
395
399
|
if (!l)
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
const
|
|
400
|
+
o.mutations.ADD_IS_EGTTING_DICT_TYPES(s), c.getDictCodeApi(c.formatterRequest(c.query, s)).then((a) => {
|
|
401
|
+
o.mutations.REMOVE_IS_EGTTING_DICT_TYPES(s);
|
|
402
|
+
const d = c.formatterDictList(a, e), i = ce(d, c.filterDataFun, c.disabledDataFun), r = JSON.parse(JSON.stringify(i)), b = Object.assign(o.state.dictCodes, r);
|
|
399
403
|
c.storage.setItem(
|
|
400
404
|
c.dictDataKey,
|
|
401
|
-
JSON.stringify(
|
|
402
|
-
),
|
|
405
|
+
JSON.stringify(b)
|
|
406
|
+
), o.mutations.SET_DICT_CODES(b), n(i);
|
|
403
407
|
});
|
|
404
408
|
else {
|
|
405
|
-
const a = [],
|
|
409
|
+
const a = [], d = {};
|
|
406
410
|
for (let i = 0; i < t.length; i++) {
|
|
407
411
|
if (l[t[i]]) {
|
|
408
|
-
|
|
412
|
+
d[t[i]] = l[t[i]];
|
|
409
413
|
continue;
|
|
410
414
|
}
|
|
411
415
|
a.push(t[i]);
|
|
412
416
|
}
|
|
413
|
-
a.length > 0 ? (
|
|
417
|
+
a.length > 0 ? (o.mutations.ADD_IS_EGTTING_DICT_TYPES(a.join(",")), c.getDictCodeApi(
|
|
414
418
|
c.formatterRequest(c.query, a.join(","))
|
|
415
419
|
).then((i) => {
|
|
416
|
-
|
|
417
|
-
const
|
|
420
|
+
o.mutations.REMOVE_IS_EGTTING_DICT_TYPES(a.join(","));
|
|
421
|
+
const r = c.formatterDictList(i, e), b = ce(r, c.filterDataFun, c.disabledDataFun), T = JSON.parse(JSON.stringify(b)), h = Object.assign(o.state.dictCodes, T);
|
|
418
422
|
c.storage.setItem(
|
|
419
423
|
c.dictDataKey,
|
|
420
424
|
JSON.stringify(h)
|
|
421
|
-
),
|
|
422
|
-
const I = Object.assign(
|
|
425
|
+
), o.mutations.SET_DICT_CODES(h);
|
|
426
|
+
const I = Object.assign(d, r), O = [];
|
|
423
427
|
for (const F in I)
|
|
424
|
-
(!I[F] || I[F].length === 0) &&
|
|
425
|
-
|
|
426
|
-
`不存在类型为:${
|
|
428
|
+
(!I[F] || I[F].length === 0) && O.push(F);
|
|
429
|
+
O.length > 0 && g(
|
|
430
|
+
`不存在类型为:${O.join(
|
|
427
431
|
"、"
|
|
428
432
|
)} 的字典字段,请确认后再填写`
|
|
429
|
-
), n(
|
|
430
|
-
})) : n(
|
|
433
|
+
), n(b);
|
|
434
|
+
})) : n(d);
|
|
431
435
|
}
|
|
432
|
-
}),
|
|
433
|
-
const { format: l } =
|
|
436
|
+
}), pe = (e, n, g) => new Promise((t, s) => {
|
|
437
|
+
const { format: l } = o.state.dictConfig, c = o.state.dictCodes;
|
|
434
438
|
let a = [];
|
|
435
439
|
if (!c || !c[n])
|
|
436
|
-
if (
|
|
437
|
-
const
|
|
438
|
-
if (!(
|
|
439
|
-
if (clearInterval(
|
|
440
|
-
|
|
440
|
+
if (o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes) {
|
|
441
|
+
const d = setInterval(() => {
|
|
442
|
+
if (!(o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes)) {
|
|
443
|
+
if (clearInterval(d), a = o.state.dictCodes[n], !a) {
|
|
444
|
+
s(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
441
445
|
return;
|
|
442
446
|
}
|
|
443
|
-
const i = a.find((
|
|
447
|
+
const i = a.find((r) => r[l.value] === e);
|
|
444
448
|
t(i || (g ?? ""));
|
|
445
449
|
}
|
|
446
450
|
}, 1e3);
|
|
447
451
|
} else
|
|
448
|
-
|
|
449
|
-
if (a =
|
|
450
|
-
|
|
452
|
+
o.actions.getDictDataObj(n).then((d) => {
|
|
453
|
+
if (a = d[n], !a) {
|
|
454
|
+
s(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
451
455
|
return;
|
|
452
456
|
}
|
|
453
|
-
const i = a.find((
|
|
457
|
+
const i = a.find((r) => r[l.value] === e);
|
|
454
458
|
t(i || (g ?? ""));
|
|
455
459
|
});
|
|
456
460
|
else {
|
|
457
461
|
a = c[n];
|
|
458
|
-
const
|
|
459
|
-
t(
|
|
462
|
+
const d = a.find((i) => i[l.value] === e);
|
|
463
|
+
t(d || (g ?? ""));
|
|
460
464
|
}
|
|
461
465
|
}), tt = {
|
|
462
466
|
name: "ElButtonDict"
|
|
463
|
-
},
|
|
467
|
+
}, Te = /* @__PURE__ */ H({
|
|
464
468
|
...tt,
|
|
465
469
|
props: {
|
|
466
470
|
value: {
|
|
@@ -494,19 +498,19 @@ const Ze = (e, n, g) => {
|
|
|
494
498
|
}
|
|
495
499
|
},
|
|
496
500
|
setup(e, { expose: n }) {
|
|
497
|
-
const g = e, { value: t, dictType:
|
|
498
|
-
let
|
|
501
|
+
const g = e, { value: t, dictType: s, judgeTypeFun: l, type: c, judgeColorFun: a, color: d, judgeDisabledFun: i, disabled: r } = Le(g), b = P(o.state.dictConfig), T = N(() => l != null && l.value ? l.value(t.value) : c.value ? c.value : O.value && O.value[b.format.type] ? O.value[b.format.type] : "primary"), h = N(() => a != null && a.value ? a.value(t.value) : d != null && d.value ? d.value : O.value && O.value[b.format.color] ? O.value[b.format.color] : ""), I = N(() => O.value && O.value[b.format.disabled] ? O.value[b.format.disabled] : i != null && i.value ? i.value(t.value) : !!r.value);
|
|
502
|
+
let O = k(null), F = k(null);
|
|
499
503
|
Ve(() => {
|
|
500
|
-
|
|
501
|
-
|
|
504
|
+
pe(t.value, s.value).then((v) => {
|
|
505
|
+
O.value = v, F.value = v[b.format.label];
|
|
502
506
|
});
|
|
503
507
|
});
|
|
504
|
-
const
|
|
505
|
-
return n({ getRef: () =>
|
|
508
|
+
const E = k(null);
|
|
509
|
+
return n({ getRef: () => E.value }), (v, m) => {
|
|
506
510
|
const f = $("el-button");
|
|
507
511
|
return G(), w(f, ie({
|
|
508
512
|
ref_key: "ElButtonDict",
|
|
509
|
-
ref:
|
|
513
|
+
ref: E,
|
|
510
514
|
type: S(T),
|
|
511
515
|
color: S(h),
|
|
512
516
|
disabled: S(I)
|
|
@@ -516,7 +520,7 @@ const Ze = (e, n, g) => {
|
|
|
516
520
|
]),
|
|
517
521
|
_: 2
|
|
518
522
|
}, [
|
|
519
|
-
x(v.$slots, (
|
|
523
|
+
x(v.$slots, (u, D, p) => ({
|
|
520
524
|
name: D,
|
|
521
525
|
fn: L((y) => [
|
|
522
526
|
M(v.$slots, D, W(X(y)))
|
|
@@ -526,13 +530,13 @@ const Ze = (e, n, g) => {
|
|
|
526
530
|
};
|
|
527
531
|
}
|
|
528
532
|
});
|
|
529
|
-
|
|
530
|
-
e.component(
|
|
533
|
+
Te.install = function(e) {
|
|
534
|
+
e.component(Te.name, Te);
|
|
531
535
|
};
|
|
532
536
|
const nt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
533
537
|
__proto__: null,
|
|
534
|
-
default:
|
|
535
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
538
|
+
default: Te
|
|
539
|
+
}, Symbol.toStringTag, { value: "Module" })), ye = (e, n, g) => {
|
|
536
540
|
const t = {
|
|
537
541
|
idField: "id",
|
|
538
542
|
//唯一标识字段名
|
|
@@ -561,12 +565,12 @@ const nt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
561
565
|
[t.labelArrField]: [],
|
|
562
566
|
[t.idArrField]: []
|
|
563
567
|
});
|
|
564
|
-
for (var
|
|
568
|
+
for (var s = [], l, c = 0; c < e.length; c++)
|
|
565
569
|
if (e[c][t.parentIdField] === g[t.idField]) {
|
|
566
570
|
var a = e[c];
|
|
567
|
-
a[t.levelField] = g[t.levelField] + 1, a[t.labelArrField] = g[t.labelArrField].concat(a[t.labelField]), a[t.idArrField] = g[t.idArrField].concat(a[t.idField]), l =
|
|
571
|
+
a[t.levelField] = g[t.levelField] + 1, a[t.labelArrField] = g[t.labelArrField].concat(a[t.labelField]), a[t.idArrField] = g[t.idArrField].concat(a[t.idField]), l = ye(e, n, a), l.length > 0 ? (a[t.childrenField] = l, a[t.leafField] = !1) : a[t.leafField] = !0, s.push(a);
|
|
568
572
|
}
|
|
569
|
-
return
|
|
573
|
+
return s;
|
|
570
574
|
}, le = (e, n, g) => {
|
|
571
575
|
const t = {
|
|
572
576
|
idField: "id",
|
|
@@ -575,8 +579,8 @@ const nt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
575
579
|
//父节点唯一标识字段名
|
|
576
580
|
};
|
|
577
581
|
Object.assign(t, g);
|
|
578
|
-
const
|
|
579
|
-
return
|
|
582
|
+
const s = n.find((l) => l[t.idField] === e);
|
|
583
|
+
return s ? le(s[t.parentIdField], n, t).concat([s]) : [];
|
|
580
584
|
}, oe = (e, n, g) => {
|
|
581
585
|
const t = {
|
|
582
586
|
idField: "id",
|
|
@@ -586,11 +590,11 @@ const nt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
586
590
|
//父节点唯一标识字段名
|
|
587
591
|
};
|
|
588
592
|
Object.assign(t, g);
|
|
589
|
-
const
|
|
590
|
-
return le(
|
|
593
|
+
const s = n.find((l) => l[t.labelField] === e);
|
|
594
|
+
return le(s[t.idField], n, t);
|
|
591
595
|
}, it = {
|
|
592
596
|
name: "ElCascaderDict"
|
|
593
|
-
},
|
|
597
|
+
}, _e = /* @__PURE__ */ H({
|
|
594
598
|
...it,
|
|
595
599
|
props: {
|
|
596
600
|
//最大层级
|
|
@@ -615,101 +619,101 @@ const nt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
615
619
|
},
|
|
616
620
|
emits: ["dictChange"],
|
|
617
621
|
setup(e, { expose: n, emit: g }) {
|
|
618
|
-
const { maxLevel: t, dictType:
|
|
619
|
-
g("dictChange",
|
|
622
|
+
const { maxLevel: t, dictType: s, disableObj: l, filterDataFun: c, disabledDataFun: a } = e, d = me(), i = k(""), r = P(o.state.dictConfig), b = P(o.state.dictCodes), T = (u) => {
|
|
623
|
+
g("dictChange", u);
|
|
620
624
|
}, h = ae({
|
|
621
625
|
list: []
|
|
622
|
-
}), I = (
|
|
623
|
-
for (let p = 0; p <
|
|
624
|
-
const y =
|
|
625
|
-
if (y[
|
|
626
|
-
delete y[
|
|
626
|
+
}), I = (u, D) => {
|
|
627
|
+
for (let p = 0; p < u.length; p++) {
|
|
628
|
+
const y = u[p];
|
|
629
|
+
if (y[r.treeSetting.levelField] === D) {
|
|
630
|
+
delete y[C.value.children], y[C.value.leaf] = !0;
|
|
627
631
|
continue;
|
|
628
632
|
} else
|
|
629
|
-
I(y[
|
|
633
|
+
I(y[C.value.children], D);
|
|
630
634
|
}
|
|
631
|
-
},
|
|
632
|
-
if (!
|
|
635
|
+
}, O = async () => {
|
|
636
|
+
if (!s)
|
|
633
637
|
return;
|
|
634
|
-
let
|
|
635
|
-
if (typeof
|
|
636
|
-
i.value =
|
|
638
|
+
let u = [];
|
|
639
|
+
if (typeof s == "object") {
|
|
640
|
+
i.value = s.type, await o.actions.getDictDataObj(i.value), u = [].concat(b[i.value]);
|
|
637
641
|
const {
|
|
638
642
|
filters: D,
|
|
639
|
-
filterType: p =
|
|
643
|
+
filterType: p = r.format.value,
|
|
640
644
|
reverse: y = !1
|
|
641
|
-
} =
|
|
642
|
-
y ?
|
|
645
|
+
} = s, _ = typeof D == "string" ? D.split(",") : D;
|
|
646
|
+
y ? u = u.filter((j) => !_.includes(j[p])) : u = u.filter((j) => _.includes(j[p]));
|
|
643
647
|
} else
|
|
644
|
-
i.value =
|
|
645
|
-
if (c && (
|
|
648
|
+
i.value = s, await o.actions.getDictDataObj(i.value), u = [].concat(b[i.value]);
|
|
649
|
+
if (c && (u = c(u)), a && (u = u.map((D) => ({
|
|
646
650
|
...D,
|
|
647
|
-
[
|
|
651
|
+
[r.format.disabled]: !!D[r.format.disabled] || a(D)
|
|
648
652
|
}))), l) {
|
|
649
653
|
const {
|
|
650
654
|
disableValue: D,
|
|
651
|
-
disableType: p =
|
|
655
|
+
disableType: p = r.format.value,
|
|
652
656
|
reverse: y = !1
|
|
653
657
|
} = l, _ = typeof D == "string" ? D.split(",") : D;
|
|
654
|
-
y ?
|
|
658
|
+
y ? u = u.map((j) => {
|
|
655
659
|
const V = JSON.parse(JSON.stringify(j));
|
|
656
|
-
return V[
|
|
657
|
-
}) :
|
|
660
|
+
return V[r.format.disabled] = !_.includes(V[p]) || V[r.format.disabled], V;
|
|
661
|
+
}) : u = u.map((j) => {
|
|
658
662
|
const V = JSON.parse(JSON.stringify(j));
|
|
659
|
-
return V[
|
|
663
|
+
return V[r.format.disabled] = _.includes(V[p]) || V[r.format.disabled], V;
|
|
660
664
|
});
|
|
661
665
|
}
|
|
662
|
-
h.list =
|
|
663
|
-
}, F =
|
|
664
|
-
const
|
|
665
|
-
return
|
|
666
|
-
}), v =
|
|
667
|
-
const
|
|
668
|
-
idField:
|
|
669
|
-
labelField:
|
|
670
|
-
childrenField:
|
|
671
|
-
leafField:
|
|
672
|
-
}, p = Object.assign(
|
|
666
|
+
h.list = u;
|
|
667
|
+
}, F = N(() => o.state.isGettingDictTypes.includes(i.value)), E = N(() => o.state.isGettingAllDictTypes), C = N(() => {
|
|
668
|
+
const u = d.props ?? {};
|
|
669
|
+
return u.disabled = u.disabled ?? r.format.disabled, u.value = u.value ?? r.treeSetting.idField, u.label = u.label ?? r.treeSetting.labelField, u.children = u.children ?? r.treeSetting.childrenField, u.leaf = u.leaf ?? r.treeSetting.leafField, u;
|
|
670
|
+
}), v = N(() => {
|
|
671
|
+
const u = d.props ?? {}, D = {
|
|
672
|
+
idField: u.value ?? r.treeSetting.idField,
|
|
673
|
+
labelField: u.label ?? r.treeSetting.labelField,
|
|
674
|
+
childrenField: u.children ?? r.treeSetting.childrenField,
|
|
675
|
+
leafField: u.leaf ?? r.treeSetting.leafField
|
|
676
|
+
}, p = Object.assign(r.treeSetting, D), y = JSON.parse(JSON.stringify(h.list)), _ = ye(y, p);
|
|
673
677
|
return t && I(_, +t), _;
|
|
674
678
|
});
|
|
675
679
|
re(
|
|
676
|
-
[F,
|
|
677
|
-
([
|
|
678
|
-
|
|
680
|
+
[F, E],
|
|
681
|
+
([u], [D]) => {
|
|
682
|
+
!u && !D && O();
|
|
679
683
|
},
|
|
680
684
|
{
|
|
681
685
|
immediate: !0
|
|
682
686
|
}
|
|
683
687
|
);
|
|
684
|
-
const
|
|
685
|
-
return n({ getRef: () =>
|
|
688
|
+
const m = k(null);
|
|
689
|
+
return n({ getRef: () => m.value }), (u, D) => {
|
|
686
690
|
const p = $("el-cascader");
|
|
687
691
|
return G(), w(p, {
|
|
688
692
|
ref_key: "ElCascaderDict",
|
|
689
|
-
ref:
|
|
693
|
+
ref: m,
|
|
690
694
|
options: S(v),
|
|
691
|
-
props: S(
|
|
695
|
+
props: S(C),
|
|
692
696
|
onChange: T
|
|
693
697
|
}, Q({ _: 2 }, [
|
|
694
|
-
x(
|
|
698
|
+
x(u.$slots, (y, _, j) => ({
|
|
695
699
|
name: _,
|
|
696
700
|
fn: L((V) => [
|
|
697
|
-
M(
|
|
701
|
+
M(u.$slots, _, W(X(V)))
|
|
698
702
|
])
|
|
699
703
|
}))
|
|
700
704
|
]), 1032, ["options", "props"]);
|
|
701
705
|
};
|
|
702
706
|
}
|
|
703
707
|
});
|
|
704
|
-
|
|
705
|
-
e.component(
|
|
708
|
+
_e.install = function(e) {
|
|
709
|
+
e.component(_e.name, _e);
|
|
706
710
|
};
|
|
707
711
|
const at = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
708
712
|
__proto__: null,
|
|
709
|
-
default:
|
|
713
|
+
default: _e
|
|
710
714
|
}, Symbol.toStringTag, { value: "Module" })), lt = {
|
|
711
715
|
name: "ElCheckboxButtonDict"
|
|
712
|
-
},
|
|
716
|
+
}, ve = /* @__PURE__ */ H({
|
|
713
717
|
...lt,
|
|
714
718
|
props: {
|
|
715
719
|
dictType: {
|
|
@@ -767,79 +771,79 @@ const at = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
767
771
|
setup(e, { expose: n, emit: g }) {
|
|
768
772
|
const {
|
|
769
773
|
dictType: t,
|
|
770
|
-
disableObj:
|
|
774
|
+
disableObj: s,
|
|
771
775
|
name: l,
|
|
772
776
|
checked: c,
|
|
773
777
|
trueValue: a,
|
|
774
|
-
falseValue:
|
|
778
|
+
falseValue: d,
|
|
775
779
|
trueLabel: i,
|
|
776
|
-
falseLabel:
|
|
777
|
-
keyValue:
|
|
780
|
+
falseLabel: r,
|
|
781
|
+
keyValue: b,
|
|
778
782
|
filterDataFun: T,
|
|
779
783
|
disabledDataFun: h
|
|
780
|
-
} = e, I = k(""),
|
|
781
|
-
if (!
|
|
784
|
+
} = e, I = k(""), O = P(o.state.dictConfig), F = P(o.state.dictCodes), E = (p) => {
|
|
785
|
+
if (!b) {
|
|
782
786
|
g("dictChange", p);
|
|
783
787
|
return;
|
|
784
788
|
}
|
|
785
|
-
const y =
|
|
789
|
+
const y = C.list.filter((_) => p.includes(_[O.format.value]));
|
|
786
790
|
g("dictChange", y);
|
|
787
|
-
},
|
|
791
|
+
}, C = ae({
|
|
788
792
|
list: []
|
|
789
793
|
}), v = async () => {
|
|
790
794
|
if (!t)
|
|
791
795
|
return;
|
|
792
796
|
let p = [];
|
|
793
797
|
if (typeof t == "object") {
|
|
794
|
-
I.value = t.type, await
|
|
798
|
+
I.value = t.type, await o.actions.getDictDataObj(I.value), p = [].concat(F[I.value]);
|
|
795
799
|
const {
|
|
796
800
|
filters: y,
|
|
797
|
-
filterType: _ =
|
|
801
|
+
filterType: _ = O.format.value,
|
|
798
802
|
reverse: j = !1
|
|
799
803
|
} = t, V = typeof y == "string" ? y.split(",") : y;
|
|
800
804
|
j ? p = p.filter((B) => !V.includes(B[_])) : p = p.filter((B) => V.includes(B[_]));
|
|
801
805
|
} else
|
|
802
|
-
I.value = t, await
|
|
806
|
+
I.value = t, await o.actions.getDictDataObj(I.value), p = [].concat(F[I.value]);
|
|
803
807
|
if (T && (p = T(p)), h && (p = p.map((y) => ({
|
|
804
808
|
...y,
|
|
805
|
-
[
|
|
806
|
-
}))),
|
|
809
|
+
[O.format.disabled]: !!y[O.format.disabled] || h(y)
|
|
810
|
+
}))), s) {
|
|
807
811
|
const {
|
|
808
812
|
disableValue: y,
|
|
809
|
-
disableType: _ =
|
|
813
|
+
disableType: _ = O.format.value,
|
|
810
814
|
reverse: j = !1
|
|
811
|
-
} =
|
|
815
|
+
} = s, V = typeof y == "string" ? y.split(",") : y;
|
|
812
816
|
j ? p = p.map((B) => {
|
|
813
817
|
const A = JSON.parse(JSON.stringify(B));
|
|
814
|
-
return A[
|
|
818
|
+
return A[O.format.disabled] = !V.includes(A[_]) || A[O.format.disabled], A;
|
|
815
819
|
}) : p = p.map((B) => {
|
|
816
820
|
const A = JSON.parse(JSON.stringify(B));
|
|
817
|
-
return A[
|
|
821
|
+
return A[O.format.disabled] = V.includes(A[_]) || A[O.format.disabled], A;
|
|
818
822
|
});
|
|
819
823
|
}
|
|
820
|
-
|
|
821
|
-
},
|
|
824
|
+
C.list = p;
|
|
825
|
+
}, m = N(() => o.state.isGettingDictTypes.includes(I.value)), f = N(() => o.state.isGettingAllDictTypes);
|
|
822
826
|
re(
|
|
823
|
-
[
|
|
827
|
+
[m, f],
|
|
824
828
|
([p], [y]) => {
|
|
825
|
-
|
|
829
|
+
!p && !y && v();
|
|
826
830
|
},
|
|
827
831
|
{
|
|
828
832
|
immediate: !0
|
|
829
833
|
}
|
|
830
834
|
);
|
|
831
|
-
const
|
|
832
|
-
return n({ getRef: () =>
|
|
835
|
+
const u = k(null);
|
|
836
|
+
return n({ getRef: () => u.value }), (p, y) => {
|
|
833
837
|
const _ = $("el-checkbox-button"), j = $("el-checkbox-group");
|
|
834
838
|
return G(), w(j, ie({
|
|
835
839
|
ref_key: "ElCheckboxButtonDict",
|
|
836
|
-
ref:
|
|
837
|
-
}, p.$attrs, { onChange:
|
|
840
|
+
ref: u
|
|
841
|
+
}, p.$attrs, { onChange: E }), Q({
|
|
838
842
|
default: L(() => [
|
|
839
|
-
(G(!0), te(ne, null, x(
|
|
840
|
-
key: V[S(
|
|
841
|
-
disabled: V[S(
|
|
842
|
-
label: V[S(
|
|
843
|
+
(G(!0), te(ne, null, x(C.list, (V) => (G(), w(_, {
|
|
844
|
+
key: V[S(O).format.value],
|
|
845
|
+
disabled: V[S(O).format.disabled],
|
|
846
|
+
label: V[S(O).format.value],
|
|
843
847
|
name: e.name,
|
|
844
848
|
"true-value": e.trueValue,
|
|
845
849
|
"false-value": e.falseValue,
|
|
@@ -848,7 +852,7 @@ const at = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
848
852
|
checked: e.checked
|
|
849
853
|
}, {
|
|
850
854
|
default: L(() => [
|
|
851
|
-
K(U(V[S(
|
|
855
|
+
K(U(V[S(O).format.label]), 1)
|
|
852
856
|
]),
|
|
853
857
|
_: 2
|
|
854
858
|
}, 1032, ["disabled", "label", "name", "true-value", "false-value", "true-label", "false-label", "checked"]))), 128))
|
|
@@ -857,23 +861,23 @@ const at = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
857
861
|
}, [
|
|
858
862
|
x(p.$slots, (V, B, A) => ({
|
|
859
863
|
name: B,
|
|
860
|
-
fn: L((
|
|
861
|
-
M(p.$slots, B, W(X(
|
|
864
|
+
fn: L((J) => [
|
|
865
|
+
M(p.$slots, B, W(X(J)))
|
|
862
866
|
])
|
|
863
867
|
}))
|
|
864
868
|
]), 1040);
|
|
865
869
|
};
|
|
866
870
|
}
|
|
867
871
|
});
|
|
868
|
-
|
|
869
|
-
e.component(
|
|
872
|
+
ve.install = function(e) {
|
|
873
|
+
e.component(ve.name, ve);
|
|
870
874
|
};
|
|
871
875
|
const rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
872
876
|
__proto__: null,
|
|
873
|
-
default:
|
|
877
|
+
default: ve
|
|
874
878
|
}, Symbol.toStringTag, { value: "Module" })), st = {
|
|
875
879
|
name: "ElCheckboxDict"
|
|
876
|
-
},
|
|
880
|
+
}, Se = /* @__PURE__ */ H({
|
|
877
881
|
...st,
|
|
878
882
|
props: {
|
|
879
883
|
dictType: {
|
|
@@ -955,29 +959,29 @@ const rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
955
959
|
setup(e, { expose: n, emit: g }) {
|
|
956
960
|
const {
|
|
957
961
|
dictType: t,
|
|
958
|
-
disableObj:
|
|
962
|
+
disableObj: s,
|
|
959
963
|
border: l,
|
|
960
964
|
size: c,
|
|
961
965
|
name: a,
|
|
962
|
-
checked:
|
|
966
|
+
checked: d,
|
|
963
967
|
indeterminate: i,
|
|
964
|
-
trueValue:
|
|
965
|
-
falseValue:
|
|
968
|
+
trueValue: r,
|
|
969
|
+
falseValue: b,
|
|
966
970
|
trueLabel: T,
|
|
967
971
|
falseLabel: h,
|
|
968
972
|
keyValue: I,
|
|
969
|
-
filterDataFun:
|
|
973
|
+
filterDataFun: O,
|
|
970
974
|
disabledDataFun: F,
|
|
971
|
-
validateEvent:
|
|
972
|
-
tabindex:
|
|
975
|
+
validateEvent: E,
|
|
976
|
+
tabindex: C,
|
|
973
977
|
id: v
|
|
974
|
-
} = e,
|
|
978
|
+
} = e, m = k(""), f = P(o.state.dictConfig), u = P(o.state.dictCodes), D = (A) => {
|
|
975
979
|
if (!I) {
|
|
976
980
|
g("dictChange", A);
|
|
977
981
|
return;
|
|
978
982
|
}
|
|
979
|
-
const
|
|
980
|
-
g("dictChange",
|
|
983
|
+
const J = p.list.find((q) => A.includes(q[f.format.value]));
|
|
984
|
+
g("dictChange", J);
|
|
981
985
|
}, p = ae({
|
|
982
986
|
list: []
|
|
983
987
|
}), y = async () => {
|
|
@@ -985,24 +989,24 @@ const rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
985
989
|
return;
|
|
986
990
|
let A = [];
|
|
987
991
|
if (typeof t == "object") {
|
|
988
|
-
|
|
992
|
+
m.value = t.type, await o.actions.getDictDataObj(m.value), A = [].concat(u[m.value]);
|
|
989
993
|
const {
|
|
990
|
-
filters:
|
|
994
|
+
filters: J,
|
|
991
995
|
filterType: q = f.format.value,
|
|
992
996
|
reverse: se = !1
|
|
993
|
-
} = t, z = typeof
|
|
997
|
+
} = t, z = typeof J == "string" ? J.split(",") : J;
|
|
994
998
|
se ? A = A.filter((Z) => !z.includes(Z[q])) : A = A.filter((Z) => z.includes(Z[q]));
|
|
995
999
|
} else
|
|
996
|
-
|
|
997
|
-
if (
|
|
998
|
-
...
|
|
999
|
-
[f.format.disabled]:
|
|
1000
|
-
}))),
|
|
1000
|
+
m.value = t, await o.actions.getDictDataObj(m.value), A = [].concat(u[m.value]);
|
|
1001
|
+
if (O && (A = O(A)), F && (A = A.map((J) => ({
|
|
1002
|
+
...J,
|
|
1003
|
+
[f.format.disabled]: !!J[f.format.disabled] || F(J)
|
|
1004
|
+
}))), s) {
|
|
1001
1005
|
const {
|
|
1002
|
-
disableValue:
|
|
1006
|
+
disableValue: J,
|
|
1003
1007
|
disableType: q = f.format.value,
|
|
1004
1008
|
reverse: se = !1
|
|
1005
|
-
} =
|
|
1009
|
+
} = s, z = typeof J == "string" ? J.split(",") : J;
|
|
1006
1010
|
se ? A = A.map((Z) => {
|
|
1007
1011
|
const ee = JSON.parse(JSON.stringify(Z));
|
|
1008
1012
|
return ee[f.format.disabled] = !z.includes(ee[q]) || ee[f.format.disabled], ee;
|
|
@@ -1012,18 +1016,18 @@ const rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1012
1016
|
});
|
|
1013
1017
|
}
|
|
1014
1018
|
p.list = A;
|
|
1015
|
-
}, _ =
|
|
1019
|
+
}, _ = N(() => o.state.isGettingDictTypes.includes(m.value)), j = N(() => o.state.isGettingAllDictTypes);
|
|
1016
1020
|
re(
|
|
1017
1021
|
[_, j],
|
|
1018
|
-
([A], [
|
|
1019
|
-
|
|
1022
|
+
([A], [J]) => {
|
|
1023
|
+
!A && !J && y();
|
|
1020
1024
|
},
|
|
1021
1025
|
{
|
|
1022
1026
|
immediate: !0
|
|
1023
1027
|
}
|
|
1024
1028
|
);
|
|
1025
1029
|
const V = k(null);
|
|
1026
|
-
return n({ getRef: () => V.value }), (A,
|
|
1030
|
+
return n({ getRef: () => V.value }), (A, J) => {
|
|
1027
1031
|
const q = $("el-checkbox"), se = $("el-checkbox-group");
|
|
1028
1032
|
return G(), w(se, ie({
|
|
1029
1033
|
ref_key: "ElCheckboxDict",
|
|
@@ -1057,23 +1061,23 @@ const rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1057
1061
|
}, [
|
|
1058
1062
|
x(A.$slots, (z, Z, ee) => ({
|
|
1059
1063
|
name: Z,
|
|
1060
|
-
fn: L((
|
|
1061
|
-
M(A.$slots, Z, W(X(
|
|
1064
|
+
fn: L((De) => [
|
|
1065
|
+
M(A.$slots, Z, W(X(De)))
|
|
1062
1066
|
])
|
|
1063
1067
|
}))
|
|
1064
1068
|
]), 1040);
|
|
1065
1069
|
};
|
|
1066
1070
|
}
|
|
1067
1071
|
});
|
|
1068
|
-
|
|
1069
|
-
e.component(
|
|
1072
|
+
Se.install = function(e) {
|
|
1073
|
+
e.component(Se.name, Se);
|
|
1070
1074
|
};
|
|
1071
1075
|
const ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1072
1076
|
__proto__: null,
|
|
1073
|
-
default:
|
|
1077
|
+
default: Se
|
|
1074
1078
|
}, Symbol.toStringTag, { value: "Module" })), ct = {
|
|
1075
1079
|
name: "ElLinkDict"
|
|
1076
|
-
},
|
|
1080
|
+
}, Fe = /* @__PURE__ */ H({
|
|
1077
1081
|
...ct,
|
|
1078
1082
|
props: {
|
|
1079
1083
|
value: {
|
|
@@ -1100,46 +1104,46 @@ const ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1100
1104
|
}
|
|
1101
1105
|
},
|
|
1102
1106
|
setup(e, { expose: n }) {
|
|
1103
|
-
const g = e, { value: t, dictType:
|
|
1107
|
+
const g = e, { value: t, dictType: s, judgeTypeFun: l, type: c, judgeDisabledFun: a, disabled: d } = Le(g), i = P(o.state.dictConfig), r = N(() => l != null && l.value ? l.value(t.value) : c.value ? c.value : T.value && T.value[i.format.type] ? T.value[i.format.type] : "primary"), b = N(() => T.value && T.value[i.format.disabled] ? T.value[i.format.disabled] : a != null && a.value ? a.value(t.value) : !!d.value);
|
|
1104
1108
|
let T = k(null), h = k(null);
|
|
1105
1109
|
Ve(() => {
|
|
1106
|
-
|
|
1110
|
+
pe(t.value, s.value).then((F) => {
|
|
1107
1111
|
T.value = F, h.value = F[i.format.label];
|
|
1108
1112
|
});
|
|
1109
1113
|
});
|
|
1110
1114
|
const I = k(null);
|
|
1111
|
-
return n({ getRef: () => I.value }), (F,
|
|
1112
|
-
const
|
|
1113
|
-
return G(), w(
|
|
1115
|
+
return n({ getRef: () => I.value }), (F, E) => {
|
|
1116
|
+
const C = $("el-link");
|
|
1117
|
+
return G(), w(C, ie({
|
|
1114
1118
|
ref_key: "ElLinkDict",
|
|
1115
1119
|
ref: I,
|
|
1116
|
-
type: S(
|
|
1117
|
-
disabled: S(
|
|
1120
|
+
type: S(r),
|
|
1121
|
+
disabled: S(b)
|
|
1118
1122
|
}, F.$attrs), Q({
|
|
1119
1123
|
default: L(() => [
|
|
1120
1124
|
K(" " + U(S(h)), 1)
|
|
1121
1125
|
]),
|
|
1122
1126
|
_: 2
|
|
1123
1127
|
}, [
|
|
1124
|
-
x(F.$slots, (v,
|
|
1125
|
-
name:
|
|
1126
|
-
fn: L((
|
|
1127
|
-
M(F.$slots,
|
|
1128
|
+
x(F.$slots, (v, m, f) => ({
|
|
1129
|
+
name: m,
|
|
1130
|
+
fn: L((u) => [
|
|
1131
|
+
M(F.$slots, m, W(X(u)))
|
|
1128
1132
|
])
|
|
1129
1133
|
}))
|
|
1130
1134
|
]), 1040, ["type", "disabled"]);
|
|
1131
1135
|
};
|
|
1132
1136
|
}
|
|
1133
1137
|
});
|
|
1134
|
-
|
|
1135
|
-
e.component(
|
|
1138
|
+
Fe.install = function(e) {
|
|
1139
|
+
e.component(Fe.name, Fe);
|
|
1136
1140
|
};
|
|
1137
1141
|
const ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1138
1142
|
__proto__: null,
|
|
1139
|
-
default:
|
|
1143
|
+
default: Fe
|
|
1140
1144
|
}, Symbol.toStringTag, { value: "Module" })), dt = {
|
|
1141
1145
|
name: "ElRadioButtonDict"
|
|
1142
|
-
},
|
|
1146
|
+
}, Oe = /* @__PURE__ */ H({
|
|
1143
1147
|
...dt,
|
|
1144
1148
|
props: {
|
|
1145
1149
|
dictType: {
|
|
@@ -1172,18 +1176,18 @@ const ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1172
1176
|
setup(e, { expose: n, emit: g }) {
|
|
1173
1177
|
const {
|
|
1174
1178
|
dictType: t,
|
|
1175
|
-
disableObj:
|
|
1179
|
+
disableObj: s,
|
|
1176
1180
|
name: l,
|
|
1177
1181
|
keyValue: c,
|
|
1178
1182
|
filterDataFun: a,
|
|
1179
|
-
disabledDataFun:
|
|
1180
|
-
} = e, i = k(""),
|
|
1183
|
+
disabledDataFun: d
|
|
1184
|
+
} = e, i = k(""), r = P(o.state.dictConfig), b = P(o.state.dictCodes), T = (v) => {
|
|
1181
1185
|
if (!c) {
|
|
1182
1186
|
g("dictChange", v);
|
|
1183
1187
|
return;
|
|
1184
1188
|
}
|
|
1185
|
-
const
|
|
1186
|
-
g("dictChange",
|
|
1189
|
+
const m = h.list.find((f) => f[r.format.value] === v);
|
|
1190
|
+
g("dictChange", m);
|
|
1187
1191
|
}, h = ae({
|
|
1188
1192
|
list: []
|
|
1189
1193
|
}), I = async () => {
|
|
@@ -1191,59 +1195,59 @@ const ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1191
1195
|
return;
|
|
1192
1196
|
let v = [];
|
|
1193
1197
|
if (typeof t == "object") {
|
|
1194
|
-
i.value = t.type, await
|
|
1198
|
+
i.value = t.type, await o.actions.getDictDataObj(i.value), v = [].concat(b[i.value]);
|
|
1195
1199
|
const {
|
|
1196
|
-
filters:
|
|
1197
|
-
filterType: f =
|
|
1198
|
-
reverse:
|
|
1199
|
-
} = t, D = typeof
|
|
1200
|
-
|
|
1200
|
+
filters: m,
|
|
1201
|
+
filterType: f = r.format.value,
|
|
1202
|
+
reverse: u = !1
|
|
1203
|
+
} = t, D = typeof m == "string" ? m.split(",") : m;
|
|
1204
|
+
u ? v = v.filter((p) => !D.includes(p[f])) : v = v.filter((p) => D.includes(p[f]));
|
|
1201
1205
|
} else
|
|
1202
|
-
i.value = t, await
|
|
1203
|
-
if (a && (v = a(v)),
|
|
1204
|
-
...
|
|
1205
|
-
[
|
|
1206
|
-
}))),
|
|
1206
|
+
i.value = t, await o.actions.getDictDataObj(i.value), v = [].concat(b[i.value]);
|
|
1207
|
+
if (a && (v = a(v)), d && (v = v.map((m) => ({
|
|
1208
|
+
...m,
|
|
1209
|
+
[r.format.disabled]: !!m[r.format.disabled] || d(m)
|
|
1210
|
+
}))), s) {
|
|
1207
1211
|
const {
|
|
1208
|
-
disableValue:
|
|
1209
|
-
disableType: f =
|
|
1210
|
-
reverse:
|
|
1211
|
-
} =
|
|
1212
|
-
|
|
1212
|
+
disableValue: m,
|
|
1213
|
+
disableType: f = r.format.value,
|
|
1214
|
+
reverse: u = !1
|
|
1215
|
+
} = s, D = typeof m == "string" ? m.split(",") : m;
|
|
1216
|
+
u ? v = v.map((p) => {
|
|
1213
1217
|
const y = JSON.parse(JSON.stringify(p));
|
|
1214
|
-
return y[
|
|
1218
|
+
return y[r.format.disabled] = !D.includes(y[f]) || y[r.format.disabled], y;
|
|
1215
1219
|
}) : v = v.map((p) => {
|
|
1216
1220
|
const y = JSON.parse(JSON.stringify(p));
|
|
1217
|
-
return y[
|
|
1221
|
+
return y[r.format.disabled] = D.includes(y[f]) || y[r.format.disabled], y;
|
|
1218
1222
|
});
|
|
1219
1223
|
}
|
|
1220
1224
|
h.list = v;
|
|
1221
|
-
},
|
|
1225
|
+
}, O = N(() => o.state.isGettingDictTypes.includes(i.value)), F = N(() => o.state.isGettingAllDictTypes);
|
|
1222
1226
|
re(
|
|
1223
|
-
[
|
|
1224
|
-
([v], [
|
|
1225
|
-
|
|
1227
|
+
[O, F],
|
|
1228
|
+
([v], [m]) => {
|
|
1229
|
+
!v && !m && I();
|
|
1226
1230
|
},
|
|
1227
1231
|
{
|
|
1228
1232
|
immediate: !0
|
|
1229
1233
|
}
|
|
1230
1234
|
);
|
|
1231
|
-
const
|
|
1232
|
-
return n({ getRef: () =>
|
|
1233
|
-
const f = $("el-radio-button"),
|
|
1234
|
-
return G(), w(
|
|
1235
|
+
const E = k(null);
|
|
1236
|
+
return n({ getRef: () => E.value }), (v, m) => {
|
|
1237
|
+
const f = $("el-radio-button"), u = $("el-radio-group");
|
|
1238
|
+
return G(), w(u, ie({
|
|
1235
1239
|
ref_key: "ElRadioButtonDict",
|
|
1236
|
-
ref:
|
|
1240
|
+
ref: E
|
|
1237
1241
|
}, v.$attrs, { onChange: T }), Q({
|
|
1238
1242
|
default: L(() => [
|
|
1239
1243
|
(G(!0), te(ne, null, x(h.list, (D) => (G(), w(f, {
|
|
1240
|
-
key: D[S(
|
|
1241
|
-
disabled: D[S(
|
|
1242
|
-
label: D[S(
|
|
1244
|
+
key: D[S(r).format.value],
|
|
1245
|
+
disabled: D[S(r).format.disabled],
|
|
1246
|
+
label: D[S(r).format.value],
|
|
1243
1247
|
name: e.name
|
|
1244
1248
|
}, {
|
|
1245
1249
|
default: L(() => [
|
|
1246
|
-
K(U(D[S(
|
|
1250
|
+
K(U(D[S(r).format.label]), 1)
|
|
1247
1251
|
]),
|
|
1248
1252
|
_: 2
|
|
1249
1253
|
}, 1032, ["disabled", "label", "name"]))), 128))
|
|
@@ -1260,12 +1264,12 @@ const ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1260
1264
|
};
|
|
1261
1265
|
}
|
|
1262
1266
|
});
|
|
1263
|
-
|
|
1264
|
-
e.component(
|
|
1267
|
+
Oe.install = function(e) {
|
|
1268
|
+
e.component(Oe.name, Oe);
|
|
1265
1269
|
};
|
|
1266
1270
|
const ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1267
1271
|
__proto__: null,
|
|
1268
|
-
default:
|
|
1272
|
+
default: Oe
|
|
1269
1273
|
}, Symbol.toStringTag, { value: "Module" })), gt = {
|
|
1270
1274
|
name: "ElRadioDict"
|
|
1271
1275
|
}, Ce = /* @__PURE__ */ H({
|
|
@@ -1311,45 +1315,45 @@ const ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1311
1315
|
setup(e, { expose: n, emit: g }) {
|
|
1312
1316
|
const {
|
|
1313
1317
|
dictType: t,
|
|
1314
|
-
disableObj:
|
|
1318
|
+
disableObj: s,
|
|
1315
1319
|
border: l,
|
|
1316
1320
|
size: c,
|
|
1317
1321
|
name: a,
|
|
1318
|
-
keyValue:
|
|
1322
|
+
keyValue: d,
|
|
1319
1323
|
filterDataFun: i,
|
|
1320
|
-
disabledDataFun:
|
|
1321
|
-
} = e,
|
|
1322
|
-
if (!
|
|
1324
|
+
disabledDataFun: r
|
|
1325
|
+
} = e, b = k(""), T = P(o.state.dictConfig), h = P(o.state.dictCodes), I = (f) => {
|
|
1326
|
+
if (!d) {
|
|
1323
1327
|
g("dictChange", f);
|
|
1324
1328
|
return;
|
|
1325
1329
|
}
|
|
1326
|
-
const
|
|
1327
|
-
g("dictChange",
|
|
1328
|
-
},
|
|
1330
|
+
const u = O.list.find((D) => D[T.format.value] === f);
|
|
1331
|
+
g("dictChange", u);
|
|
1332
|
+
}, O = ae({
|
|
1329
1333
|
list: []
|
|
1330
1334
|
}), F = async () => {
|
|
1331
1335
|
if (!t)
|
|
1332
1336
|
return;
|
|
1333
1337
|
let f = [];
|
|
1334
1338
|
if (typeof t == "object") {
|
|
1335
|
-
|
|
1339
|
+
b.value = t.type, await o.actions.getDictDataObj(b.value), f = [].concat(h[b.value]);
|
|
1336
1340
|
const {
|
|
1337
|
-
filters:
|
|
1341
|
+
filters: u,
|
|
1338
1342
|
filterType: D = T.format.value,
|
|
1339
1343
|
reverse: p = !1
|
|
1340
|
-
} = t, y = typeof
|
|
1344
|
+
} = t, y = typeof u == "string" ? u.split(",") : u;
|
|
1341
1345
|
p ? f = f.filter((_) => !y.includes(_[D])) : f = f.filter((_) => y.includes(_[D]));
|
|
1342
1346
|
} else
|
|
1343
|
-
|
|
1344
|
-
if (i && (f = i(f)),
|
|
1345
|
-
...
|
|
1346
|
-
[T.format.disabled]:
|
|
1347
|
-
}))),
|
|
1347
|
+
b.value = t, await o.actions.getDictDataObj(b.value), f = [].concat(h[b.value]);
|
|
1348
|
+
if (i && (f = i(f)), r && (f = f.map((u) => ({
|
|
1349
|
+
...u,
|
|
1350
|
+
[T.format.disabled]: !!u[T.format.disabled] || r(u)
|
|
1351
|
+
}))), s) {
|
|
1348
1352
|
const {
|
|
1349
|
-
disableValue:
|
|
1353
|
+
disableValue: u,
|
|
1350
1354
|
disableType: D = T.format.value,
|
|
1351
1355
|
reverse: p = !1
|
|
1352
|
-
} =
|
|
1356
|
+
} = s, y = typeof u == "string" ? u.split(",") : u;
|
|
1353
1357
|
p ? f = f.map((_) => {
|
|
1354
1358
|
const j = JSON.parse(JSON.stringify(_));
|
|
1355
1359
|
return j[T.format.disabled] = !y.includes(j[D]) || j[T.format.disabled], j;
|
|
@@ -1358,26 +1362,26 @@ const ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1358
1362
|
return j[T.format.disabled] = y.includes(j[D]) || j[T.format.disabled], j;
|
|
1359
1363
|
});
|
|
1360
1364
|
}
|
|
1361
|
-
|
|
1362
|
-
},
|
|
1365
|
+
O.list = f;
|
|
1366
|
+
}, E = N(() => o.state.isGettingDictTypes.includes(b.value)), C = N(() => o.state.isGettingAllDictTypes);
|
|
1363
1367
|
re(
|
|
1364
|
-
[
|
|
1365
|
-
([f], [
|
|
1366
|
-
|
|
1368
|
+
[E, C],
|
|
1369
|
+
([f], [u]) => {
|
|
1370
|
+
!f && !u && F();
|
|
1367
1371
|
},
|
|
1368
1372
|
{
|
|
1369
1373
|
immediate: !0
|
|
1370
1374
|
}
|
|
1371
1375
|
);
|
|
1372
1376
|
const v = k(null);
|
|
1373
|
-
return n({ getRef: () => v.value }), (f,
|
|
1377
|
+
return n({ getRef: () => v.value }), (f, u) => {
|
|
1374
1378
|
const D = $("el-radio"), p = $("el-radio-group");
|
|
1375
1379
|
return G(), w(p, ie({
|
|
1376
1380
|
ref_key: "ElRadioDict",
|
|
1377
1381
|
ref: v
|
|
1378
1382
|
}, f.$attrs, { onChange: I }), Q({
|
|
1379
1383
|
default: L(() => [
|
|
1380
|
-
(G(!0), te(ne, null, x(
|
|
1384
|
+
(G(!0), te(ne, null, x(O.list, (y) => (G(), w(D, {
|
|
1381
1385
|
key: y[S(T).format.value],
|
|
1382
1386
|
disabled: y[S(T).format.disabled],
|
|
1383
1387
|
label: y[S(T).format.value],
|
|
@@ -1406,13 +1410,13 @@ const ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1406
1410
|
Ce.install = function(e) {
|
|
1407
1411
|
e.component(Ce.name, Ce);
|
|
1408
1412
|
};
|
|
1409
|
-
const
|
|
1413
|
+
const bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1410
1414
|
__proto__: null,
|
|
1411
1415
|
default: Ce
|
|
1412
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1416
|
+
}, Symbol.toStringTag, { value: "Module" })), mt = {
|
|
1413
1417
|
name: "ElSelectDict"
|
|
1414
|
-
},
|
|
1415
|
-
...
|
|
1418
|
+
}, he = /* @__PURE__ */ H({
|
|
1419
|
+
...mt,
|
|
1416
1420
|
props: {
|
|
1417
1421
|
dictType: {
|
|
1418
1422
|
type: [String, Object],
|
|
@@ -1437,120 +1441,120 @@ const mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1437
1441
|
},
|
|
1438
1442
|
emits: ["dictChange"],
|
|
1439
1443
|
setup(e, { expose: n, emit: g }) {
|
|
1440
|
-
const { dictType: t, disableObj:
|
|
1441
|
-
g("dictChange",
|
|
1444
|
+
const { dictType: t, disableObj: s, keyValue: l, filterDataFun: c, disabledDataFun: a } = e, d = k(""), i = P(o.state.dictConfig), r = P(o.state.dictCodes), b = (C) => {
|
|
1445
|
+
g("dictChange", C);
|
|
1442
1446
|
}, T = ae({
|
|
1443
1447
|
list: []
|
|
1444
1448
|
}), h = async () => {
|
|
1445
1449
|
if (!t)
|
|
1446
1450
|
return;
|
|
1447
|
-
let
|
|
1451
|
+
let C = [];
|
|
1448
1452
|
if (typeof t == "object") {
|
|
1449
|
-
|
|
1453
|
+
d.value = t.type, await o.actions.getDictDataObj(d.value), C = [].concat(r[d.value]);
|
|
1450
1454
|
const {
|
|
1451
1455
|
filters: v,
|
|
1452
|
-
filterType:
|
|
1456
|
+
filterType: m = i.format.value,
|
|
1453
1457
|
reverse: f = !1
|
|
1454
|
-
} = t,
|
|
1455
|
-
f ?
|
|
1458
|
+
} = t, u = typeof v == "string" ? v.split(",") : v;
|
|
1459
|
+
f ? C = C.filter((D) => !u.includes(D[m])) : C = C.filter((D) => u.includes(D[m]));
|
|
1456
1460
|
} else
|
|
1457
|
-
|
|
1458
|
-
if (c && (
|
|
1461
|
+
d.value = t, await o.actions.getDictDataObj(d.value), C = [].concat(r[d.value]);
|
|
1462
|
+
if (c && (C = c(C)), a && (C = C.map((v) => ({
|
|
1459
1463
|
...v,
|
|
1460
|
-
[i.format.disabled]: v[i.format.disabled] || a(v)
|
|
1461
|
-
}))),
|
|
1464
|
+
[i.format.disabled]: !!v[i.format.disabled] || a(v)
|
|
1465
|
+
}))), s) {
|
|
1462
1466
|
const {
|
|
1463
1467
|
disableValue: v,
|
|
1464
|
-
disableType:
|
|
1468
|
+
disableType: m = i.format.value,
|
|
1465
1469
|
reverse: f = !1
|
|
1466
|
-
} =
|
|
1467
|
-
f ?
|
|
1470
|
+
} = s, u = typeof v == "string" ? v.split(",") : v;
|
|
1471
|
+
f ? C = C.map((D) => {
|
|
1468
1472
|
const p = JSON.parse(JSON.stringify(D));
|
|
1469
|
-
return p[i.format.disabled] = !
|
|
1470
|
-
}) :
|
|
1473
|
+
return p[i.format.disabled] = !u.includes(p[m]) || p[i.format.disabled], p;
|
|
1474
|
+
}) : C = C.map((D) => {
|
|
1471
1475
|
const p = JSON.parse(JSON.stringify(D));
|
|
1472
|
-
return p[i.format.disabled] =
|
|
1476
|
+
return p[i.format.disabled] = u.includes(p[m]) || p[i.format.disabled], p;
|
|
1473
1477
|
});
|
|
1474
1478
|
}
|
|
1475
|
-
T.list =
|
|
1476
|
-
}, I =
|
|
1479
|
+
T.list = C;
|
|
1480
|
+
}, I = N(() => o.state.isGettingDictTypes.includes(d.value)), O = N(() => o.state.isGettingAllDictTypes);
|
|
1477
1481
|
re(
|
|
1478
|
-
[I,
|
|
1479
|
-
([
|
|
1480
|
-
|
|
1482
|
+
[I, O],
|
|
1483
|
+
([C], [v]) => {
|
|
1484
|
+
!C && !v && h();
|
|
1481
1485
|
},
|
|
1482
1486
|
{
|
|
1483
1487
|
immediate: !0
|
|
1484
1488
|
}
|
|
1485
1489
|
);
|
|
1486
1490
|
const F = k(null);
|
|
1487
|
-
return n({ getRef: () => F.value }), (
|
|
1488
|
-
const
|
|
1491
|
+
return n({ getRef: () => F.value }), (C, v) => {
|
|
1492
|
+
const m = $("el-option"), f = $("el-select");
|
|
1489
1493
|
return G(), w(f, ie({
|
|
1490
1494
|
ref_key: "ElSelectDict",
|
|
1491
1495
|
ref: F
|
|
1492
|
-
},
|
|
1496
|
+
}, C.$attrs, {
|
|
1493
1497
|
"value-key": e.keyValue ? S(i).format.label : "",
|
|
1494
|
-
onChange:
|
|
1498
|
+
onChange: b
|
|
1495
1499
|
}), Q({
|
|
1496
1500
|
default: L(() => [
|
|
1497
|
-
(G(!0), te(ne, null, x(T.list, (
|
|
1498
|
-
key:
|
|
1499
|
-
disabled:
|
|
1500
|
-
label:
|
|
1501
|
-
value: e.keyValue ?
|
|
1501
|
+
(G(!0), te(ne, null, x(T.list, (u) => (G(), w(m, {
|
|
1502
|
+
key: u[S(i).format.value],
|
|
1503
|
+
disabled: u[S(i).format.disabled],
|
|
1504
|
+
label: u[S(i).format.label],
|
|
1505
|
+
value: e.keyValue ? u : u[S(i).format.value]
|
|
1502
1506
|
}, null, 8, ["disabled", "label", "value"]))), 128))
|
|
1503
1507
|
]),
|
|
1504
1508
|
_: 2
|
|
1505
1509
|
}, [
|
|
1506
|
-
x(
|
|
1510
|
+
x(C.$slots, (u, D, p) => ({
|
|
1507
1511
|
name: D,
|
|
1508
1512
|
fn: L((y) => [
|
|
1509
|
-
M(
|
|
1513
|
+
M(C.$slots, D, W(X(y)))
|
|
1510
1514
|
])
|
|
1511
1515
|
}))
|
|
1512
1516
|
]), 1040, ["value-key"]);
|
|
1513
1517
|
};
|
|
1514
1518
|
}
|
|
1515
1519
|
});
|
|
1516
|
-
|
|
1517
|
-
e.component(
|
|
1520
|
+
he.install = function(e) {
|
|
1521
|
+
e.component(he.name, he);
|
|
1518
1522
|
};
|
|
1519
1523
|
const pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1520
1524
|
__proto__: null,
|
|
1521
|
-
default:
|
|
1525
|
+
default: he
|
|
1522
1526
|
}, Symbol.toStringTag, { value: "Module" })), yt = (e, n, g) => {
|
|
1523
|
-
const { format: t } =
|
|
1527
|
+
const { format: t } = o.state.dictConfig, s = o.state.dictCodes;
|
|
1524
1528
|
let l = [];
|
|
1525
|
-
if (!
|
|
1526
|
-
|
|
1529
|
+
if (!s || !s[n])
|
|
1530
|
+
o.actions.getDictDataObj(n).then((c) => {
|
|
1527
1531
|
if (l = c[n], !l)
|
|
1528
1532
|
return;
|
|
1529
|
-
const a = l.find((
|
|
1533
|
+
const a = l.find((d) => d[t.value] === e);
|
|
1530
1534
|
return a ? a[t.label] : g ?? "";
|
|
1531
1535
|
});
|
|
1532
1536
|
else {
|
|
1533
|
-
l =
|
|
1537
|
+
l = s[n];
|
|
1534
1538
|
const c = l.find((a) => a[t.value] === e);
|
|
1535
1539
|
return c ? c[t.label] : g ?? "";
|
|
1536
1540
|
}
|
|
1537
1541
|
}, we = (e, n, g) => {
|
|
1538
1542
|
const t = {
|
|
1539
1543
|
defaultVal: "",
|
|
1540
|
-
formatFun: (
|
|
1544
|
+
formatFun: (d, i) => d.map((r) => r[i.label]).join(","),
|
|
1541
1545
|
spacer: ","
|
|
1542
1546
|
};
|
|
1543
1547
|
Object.assign(t, g);
|
|
1544
|
-
let
|
|
1545
|
-
Array.isArray(e) ?
|
|
1546
|
-
const { format: l } =
|
|
1548
|
+
let s = [];
|
|
1549
|
+
Array.isArray(e) ? s = e : typeof e == "string" && (s = e.split(t.spacer));
|
|
1550
|
+
const { format: l } = o.state.dictConfig, c = o.state.dictCodes;
|
|
1547
1551
|
let a = [];
|
|
1548
1552
|
if (!c || !c[n])
|
|
1549
|
-
|
|
1550
|
-
if (a =
|
|
1553
|
+
o.actions.getDictDataObj(n).then((d) => {
|
|
1554
|
+
if (a = d[n], !a)
|
|
1551
1555
|
return;
|
|
1552
|
-
const i =
|
|
1553
|
-
|
|
1556
|
+
const i = de(
|
|
1557
|
+
s,
|
|
1554
1558
|
a,
|
|
1555
1559
|
l,
|
|
1556
1560
|
t.defaultVal
|
|
@@ -1559,41 +1563,41 @@ const pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1559
1563
|
});
|
|
1560
1564
|
else {
|
|
1561
1565
|
a = c[n];
|
|
1562
|
-
const
|
|
1563
|
-
return
|
|
1566
|
+
const d = de(s, a, l, t.defaultVal);
|
|
1567
|
+
return d && d.length > 0 ? t.formatFun(d, l) : t.defaultVal;
|
|
1564
1568
|
}
|
|
1565
1569
|
}, Dt = (e, n, g) => {
|
|
1566
|
-
const { format: t } =
|
|
1570
|
+
const { format: t } = o.state.dictConfig, s = o.state.dictCodes;
|
|
1567
1571
|
let l = [];
|
|
1568
|
-
if (!
|
|
1569
|
-
|
|
1572
|
+
if (!s || !s[n])
|
|
1573
|
+
o.actions.getDictDataObj(n).then((c) => {
|
|
1570
1574
|
if (l = c[n], !l)
|
|
1571
1575
|
return;
|
|
1572
|
-
const a = l.find((
|
|
1576
|
+
const a = l.find((d) => d[t.label] === e);
|
|
1573
1577
|
return a ? a[t.value] : g ?? "";
|
|
1574
1578
|
});
|
|
1575
1579
|
else {
|
|
1576
|
-
l =
|
|
1580
|
+
l = s[n];
|
|
1577
1581
|
const c = l.find((a) => a[t.label] === e);
|
|
1578
1582
|
return c ? c[t.value] : g ?? "";
|
|
1579
1583
|
}
|
|
1580
1584
|
}, Tt = (e, n, g) => {
|
|
1581
1585
|
const t = {
|
|
1582
1586
|
defaultVal: "",
|
|
1583
|
-
formatFun: (
|
|
1587
|
+
formatFun: (d, i) => d.map((r) => r[i.value]).join(","),
|
|
1584
1588
|
spacer: ","
|
|
1585
1589
|
};
|
|
1586
1590
|
Object.assign(t, g);
|
|
1587
|
-
let
|
|
1588
|
-
Array.isArray(e) ?
|
|
1589
|
-
const { format: l } =
|
|
1591
|
+
let s = [];
|
|
1592
|
+
Array.isArray(e) ? s = e : typeof e == "string" && (s = e.split(t.spacer));
|
|
1593
|
+
const { format: l } = o.state.dictConfig, c = o.state.dictCodes;
|
|
1590
1594
|
let a = [];
|
|
1591
1595
|
if (!c || !c[n])
|
|
1592
|
-
|
|
1593
|
-
if (a =
|
|
1596
|
+
o.actions.getDictDataObj(n).then((d) => {
|
|
1597
|
+
if (a = d[n], !a)
|
|
1594
1598
|
return;
|
|
1595
|
-
const i =
|
|
1596
|
-
|
|
1599
|
+
const i = fe(
|
|
1600
|
+
s,
|
|
1597
1601
|
a,
|
|
1598
1602
|
l,
|
|
1599
1603
|
t.defaultVal
|
|
@@ -1602,193 +1606,193 @@ const pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1602
1606
|
});
|
|
1603
1607
|
else {
|
|
1604
1608
|
a = c[n];
|
|
1605
|
-
const
|
|
1606
|
-
return
|
|
1609
|
+
const d = fe(s, a, l, t.defaultVal);
|
|
1610
|
+
return d && d.length > 0 ? t.formatFun(d, l) : t.defaultVal;
|
|
1607
1611
|
}
|
|
1608
1612
|
}, _t = (e, n, g) => {
|
|
1609
1613
|
const t = {
|
|
1610
1614
|
defaultVal: "",
|
|
1611
|
-
formatFun: (
|
|
1615
|
+
formatFun: (s, l) => s.map((c) => c[l.labelField]).join(","),
|
|
1612
1616
|
treeSetting: {}
|
|
1613
1617
|
};
|
|
1614
|
-
return Object.assign(t, g), new Promise((
|
|
1615
|
-
const { treeSetting: c } =
|
|
1618
|
+
return Object.assign(t, g), new Promise((s, l) => {
|
|
1619
|
+
const { treeSetting: c } = o.state.dictConfig, a = Object.assign(c, t.treeSetting), d = o.state.dictCodes;
|
|
1616
1620
|
let i = [];
|
|
1617
|
-
if (!
|
|
1618
|
-
if (
|
|
1619
|
-
const
|
|
1620
|
-
if (!(
|
|
1621
|
-
if (clearInterval(
|
|
1621
|
+
if (!d || !d[n])
|
|
1622
|
+
if (o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes) {
|
|
1623
|
+
const r = setInterval(() => {
|
|
1624
|
+
if (!(o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes)) {
|
|
1625
|
+
if (clearInterval(r), i = o.state.dictCodes[n], !i) {
|
|
1622
1626
|
l(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1623
1627
|
return;
|
|
1624
1628
|
}
|
|
1625
|
-
const
|
|
1626
|
-
|
|
1629
|
+
const b = i.find((T) => T[a.idField] === e);
|
|
1630
|
+
s(b ? t.formatFun(le(b[a.idField], i, a), a) : t.defaultVal);
|
|
1627
1631
|
}
|
|
1628
1632
|
}, 1e3);
|
|
1629
1633
|
} else
|
|
1630
|
-
|
|
1631
|
-
if (i =
|
|
1634
|
+
o.actions.getDictDataObj(n).then((r) => {
|
|
1635
|
+
if (i = r[n], !i) {
|
|
1632
1636
|
l(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1633
1637
|
return;
|
|
1634
1638
|
}
|
|
1635
|
-
const
|
|
1636
|
-
|
|
1639
|
+
const b = i.find((T) => T[a.idField] === e);
|
|
1640
|
+
s(b ? t.formatFun(le(b[a.idField], i, a), a) : t.defaultVal);
|
|
1637
1641
|
});
|
|
1638
1642
|
else {
|
|
1639
|
-
i =
|
|
1640
|
-
const
|
|
1641
|
-
r
|
|
1643
|
+
i = d[n];
|
|
1644
|
+
const r = i.find((b) => b[a.idField] === e);
|
|
1645
|
+
s(r ? t.formatFun(le(r[a.idField], i, a), a) : t.defaultVal);
|
|
1642
1646
|
}
|
|
1643
1647
|
});
|
|
1644
1648
|
};
|
|
1645
|
-
function
|
|
1649
|
+
function ge(e, n, g, t, s) {
|
|
1646
1650
|
const l = [];
|
|
1647
1651
|
for (let c = 0; c < e.length; c++) {
|
|
1648
|
-
const a = n.find((
|
|
1649
|
-
a ? l.push(t(le(a[
|
|
1652
|
+
const a = n.find((d) => d[s.idField] === e[c]);
|
|
1653
|
+
a ? l.push(t(le(a[s.idField], n, s), s)) : l.push(g);
|
|
1650
1654
|
}
|
|
1651
1655
|
return l;
|
|
1652
1656
|
}
|
|
1653
1657
|
const vt = (e, n, g) => {
|
|
1654
1658
|
const t = {
|
|
1655
1659
|
defaultVal: "",
|
|
1656
|
-
formatFunIn: (
|
|
1660
|
+
formatFunIn: (s, l) => s.map((c) => c[l.labelField]).join("/"),
|
|
1657
1661
|
treeSetting: {},
|
|
1658
|
-
formatFunOut: (
|
|
1662
|
+
formatFunOut: (s) => s.join(","),
|
|
1659
1663
|
spacer: ","
|
|
1660
1664
|
};
|
|
1661
|
-
return Object.assign(t, g), new Promise((
|
|
1665
|
+
return Object.assign(t, g), new Promise((s, l) => {
|
|
1662
1666
|
let c = [];
|
|
1663
1667
|
Array.isArray(e) ? c = e : typeof e == "string" && (c = e.split(t.spacer));
|
|
1664
|
-
const { treeSetting: a } =
|
|
1665
|
-
let
|
|
1668
|
+
const { treeSetting: a } = o.state.dictConfig, d = Object.assign(a, t.treeSetting), i = o.state.dictCodes;
|
|
1669
|
+
let r = [];
|
|
1666
1670
|
if (!i || !i[n])
|
|
1667
|
-
if (
|
|
1668
|
-
const
|
|
1669
|
-
if (!(
|
|
1670
|
-
if (clearInterval(
|
|
1671
|
+
if (o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes) {
|
|
1672
|
+
const b = setInterval(() => {
|
|
1673
|
+
if (!(o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes)) {
|
|
1674
|
+
if (clearInterval(b), r = o.state.dictCodes[n], !r) {
|
|
1671
1675
|
l(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1672
1676
|
return;
|
|
1673
1677
|
}
|
|
1674
|
-
const T =
|
|
1675
|
-
|
|
1678
|
+
const T = ge(c, r, t.defaultVal, t.formatFunIn, d);
|
|
1679
|
+
s(T && T.length > 0 ? t.formatFunOut(T) : t.defaultVal);
|
|
1676
1680
|
}
|
|
1677
1681
|
}, 1e3);
|
|
1678
1682
|
} else
|
|
1679
|
-
|
|
1680
|
-
if (
|
|
1683
|
+
o.actions.getDictDataObj(n).then((b) => {
|
|
1684
|
+
if (r = b[n], !r) {
|
|
1681
1685
|
l(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1682
1686
|
return;
|
|
1683
1687
|
}
|
|
1684
|
-
const T =
|
|
1685
|
-
|
|
1688
|
+
const T = ge(c, r, t.defaultVal, t.formatFunIn, d);
|
|
1689
|
+
s(T && T.length > 0 ? t.formatFunOut(T) : t.defaultVal);
|
|
1686
1690
|
});
|
|
1687
1691
|
else {
|
|
1688
|
-
|
|
1689
|
-
const
|
|
1690
|
-
|
|
1692
|
+
r = i[n];
|
|
1693
|
+
const b = ge(c, r, t.defaultVal, t.formatFunIn, d);
|
|
1694
|
+
s(b && b.length > 0 ? t.formatFunOut(b) : t.defaultVal);
|
|
1691
1695
|
}
|
|
1692
1696
|
});
|
|
1693
1697
|
}, St = (e, n, g) => {
|
|
1694
1698
|
const t = {
|
|
1695
1699
|
defaultVal: "",
|
|
1696
|
-
formatFun: (
|
|
1700
|
+
formatFun: (s, l) => s.map((c) => c[l.idField]).join(","),
|
|
1697
1701
|
treeSetting: {}
|
|
1698
1702
|
};
|
|
1699
|
-
return Object.assign(t, g), new Promise((
|
|
1700
|
-
const { treeSetting: c } =
|
|
1703
|
+
return Object.assign(t, g), new Promise((s, l) => {
|
|
1704
|
+
const { treeSetting: c } = o.state.dictConfig, a = Object.assign(c, t.treeSetting), d = o.state.dictCodes;
|
|
1701
1705
|
let i = [];
|
|
1702
|
-
if (!
|
|
1703
|
-
if (
|
|
1704
|
-
const
|
|
1705
|
-
if (!(
|
|
1706
|
-
if (clearInterval(
|
|
1706
|
+
if (!d || !d[n])
|
|
1707
|
+
if (o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes) {
|
|
1708
|
+
const r = setInterval(() => {
|
|
1709
|
+
if (!(o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes)) {
|
|
1710
|
+
if (clearInterval(r), i = o.state.dictCodes[n], !i) {
|
|
1707
1711
|
l(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1708
1712
|
return;
|
|
1709
1713
|
}
|
|
1710
|
-
const
|
|
1711
|
-
|
|
1714
|
+
const b = i.find((T) => T[a.labelField] === e);
|
|
1715
|
+
s(b ? t.formatFun(oe(b[a.labelField], i, a), a) : t.defaultVal);
|
|
1712
1716
|
}
|
|
1713
1717
|
}, 1e3);
|
|
1714
1718
|
} else
|
|
1715
|
-
|
|
1716
|
-
if (i =
|
|
1719
|
+
o.actions.getDictDataObj(n).then((r) => {
|
|
1720
|
+
if (i = r[n], !i) {
|
|
1717
1721
|
l(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1718
1722
|
return;
|
|
1719
1723
|
}
|
|
1720
|
-
const
|
|
1721
|
-
|
|
1724
|
+
const b = i.find((T) => T[a.labelField] === e);
|
|
1725
|
+
s(b ? t.formatFun(oe(b[a.labelField], i, a), a) : t.defaultVal);
|
|
1722
1726
|
});
|
|
1723
1727
|
else {
|
|
1724
|
-
i =
|
|
1725
|
-
const
|
|
1726
|
-
r
|
|
1728
|
+
i = d[n];
|
|
1729
|
+
const r = i.find((b) => b[a.labelField] === e);
|
|
1730
|
+
s(r ? t.formatFun(oe(r[a.labelField], i, a), a) : t.defaultVal);
|
|
1727
1731
|
}
|
|
1728
1732
|
});
|
|
1729
1733
|
};
|
|
1730
|
-
function
|
|
1734
|
+
function be(e, n, g, t, s) {
|
|
1731
1735
|
const l = [];
|
|
1732
1736
|
for (let c = 0; c < e.length; c++) {
|
|
1733
|
-
const a = n.find((
|
|
1734
|
-
a ? l.push(t(oe(a[
|
|
1737
|
+
const a = n.find((d) => d[s.labelField] === e[c]);
|
|
1738
|
+
a ? l.push(t(oe(a[s.labelField], n, s), s)) : l.push(g);
|
|
1735
1739
|
}
|
|
1736
1740
|
return l;
|
|
1737
1741
|
}
|
|
1738
1742
|
const Ft = (e, n, g) => {
|
|
1739
1743
|
const t = {
|
|
1740
1744
|
defaultVal: "",
|
|
1741
|
-
formatFunIn: (
|
|
1745
|
+
formatFunIn: (s, l) => s.map((c) => c[l.idField]).join("/"),
|
|
1742
1746
|
treeSetting: {},
|
|
1743
|
-
formatFunOut: (
|
|
1747
|
+
formatFunOut: (s) => s.join(","),
|
|
1744
1748
|
spacer: ","
|
|
1745
1749
|
};
|
|
1746
|
-
return Object.assign(t, g), new Promise((
|
|
1750
|
+
return Object.assign(t, g), new Promise((s, l) => {
|
|
1747
1751
|
let c = [];
|
|
1748
1752
|
Array.isArray(e) ? c = e : typeof e == "string" && (c = e.split(t.spacer));
|
|
1749
|
-
const { treeSetting: a } =
|
|
1750
|
-
let
|
|
1753
|
+
const { treeSetting: a } = o.state.dictConfig, d = Object.assign(a, t.treeSetting), i = o.state.dictCodes;
|
|
1754
|
+
let r = [];
|
|
1751
1755
|
if (!i || !i[n])
|
|
1752
|
-
if (
|
|
1753
|
-
const
|
|
1754
|
-
if (!(
|
|
1755
|
-
if (clearInterval(
|
|
1756
|
+
if (o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes) {
|
|
1757
|
+
const b = setInterval(() => {
|
|
1758
|
+
if (!(o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes)) {
|
|
1759
|
+
if (clearInterval(b), r = o.state.dictCodes[n], !r) {
|
|
1756
1760
|
l(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1757
1761
|
return;
|
|
1758
1762
|
}
|
|
1759
|
-
const T =
|
|
1760
|
-
|
|
1763
|
+
const T = be(c, r, t.defaultVal, t.formatFunIn, d);
|
|
1764
|
+
s(T && T.length > 0 ? t.formatFunOut(T) : t.defaultVal);
|
|
1761
1765
|
}
|
|
1762
1766
|
}, 1e3);
|
|
1763
1767
|
} else
|
|
1764
|
-
|
|
1765
|
-
if (
|
|
1768
|
+
o.actions.getDictDataObj(n).then((b) => {
|
|
1769
|
+
if (r = b[n], !r) {
|
|
1766
1770
|
l(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1767
1771
|
return;
|
|
1768
1772
|
}
|
|
1769
|
-
const T =
|
|
1770
|
-
|
|
1773
|
+
const T = be(c, r, t.defaultVal, t.formatFunIn, d);
|
|
1774
|
+
s(T && T.length > 0 ? t.formatFunOut(T) : t.defaultVal);
|
|
1771
1775
|
});
|
|
1772
1776
|
else {
|
|
1773
|
-
|
|
1774
|
-
const
|
|
1775
|
-
|
|
1777
|
+
r = i[n];
|
|
1778
|
+
const b = be(c, r, t.defaultVal, t.formatFunIn, d);
|
|
1779
|
+
s(b && b.length > 0 ? t.formatFunOut(b) : t.defaultVal);
|
|
1776
1780
|
}
|
|
1777
1781
|
});
|
|
1778
|
-
},
|
|
1782
|
+
}, Ot = (e, n, g) => {
|
|
1779
1783
|
const t = {
|
|
1780
1784
|
defaultVal: "",
|
|
1781
|
-
formatFun: (
|
|
1785
|
+
formatFun: (d, i) => d.map((r) => r[i.labelField]).join(","),
|
|
1782
1786
|
treeSetting: {}
|
|
1783
1787
|
};
|
|
1784
1788
|
Object.assign(t, g);
|
|
1785
|
-
const { treeSetting:
|
|
1789
|
+
const { treeSetting: s } = o.state.dictConfig, l = Object.assign(s, t.treeSetting), c = o.state.dictCodes;
|
|
1786
1790
|
let a = [];
|
|
1787
1791
|
if (!c || !c[n])
|
|
1788
|
-
|
|
1789
|
-
if (a =
|
|
1792
|
+
o.actions.getDictDataObj(n).then((d) => {
|
|
1793
|
+
if (a = d[n], !a)
|
|
1790
1794
|
return new Error(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1791
|
-
const i = a.find((
|
|
1795
|
+
const i = a.find((r) => r[l.idField] === e);
|
|
1792
1796
|
return i ? t.formatFun(
|
|
1793
1797
|
le(
|
|
1794
1798
|
i[l.idField],
|
|
@@ -1800,67 +1804,67 @@ const Ft = (e, n, g) => {
|
|
|
1800
1804
|
});
|
|
1801
1805
|
else {
|
|
1802
1806
|
a = c[n];
|
|
1803
|
-
const
|
|
1804
|
-
return
|
|
1807
|
+
const d = a.find((i) => i[l.idField] === e);
|
|
1808
|
+
return d ? t.formatFun(
|
|
1805
1809
|
le(
|
|
1806
|
-
|
|
1810
|
+
d[l.idField],
|
|
1807
1811
|
a,
|
|
1808
1812
|
l
|
|
1809
1813
|
),
|
|
1810
1814
|
l
|
|
1811
1815
|
) : t.defaultVal;
|
|
1812
1816
|
}
|
|
1813
|
-
},
|
|
1817
|
+
}, Je = (e, n, g) => {
|
|
1814
1818
|
const t = {
|
|
1815
1819
|
defaultVal: "",
|
|
1816
|
-
formatFunIn: (i,
|
|
1820
|
+
formatFunIn: (i, r) => i.map((b) => b[r.labelField]).join("/"),
|
|
1817
1821
|
treeSetting: {},
|
|
1818
1822
|
formatFunOut: (i) => i.join(","),
|
|
1819
1823
|
spacer: ","
|
|
1820
1824
|
};
|
|
1821
1825
|
Object.assign(t, g);
|
|
1822
|
-
let
|
|
1823
|
-
Array.isArray(e) ?
|
|
1824
|
-
const { treeSetting: l } =
|
|
1825
|
-
let
|
|
1826
|
+
let s = [];
|
|
1827
|
+
Array.isArray(e) ? s = e : typeof e == "string" && (s = e.split(t.spacer));
|
|
1828
|
+
const { treeSetting: l } = o.state.dictConfig, c = Object.assign(l, t.treeSetting), a = o.state.dictCodes;
|
|
1829
|
+
let d = [];
|
|
1826
1830
|
if (!a || !a[n])
|
|
1827
|
-
|
|
1828
|
-
if (
|
|
1831
|
+
o.actions.getDictDataObj(n).then((i) => {
|
|
1832
|
+
if (d = i[n], !d)
|
|
1829
1833
|
return new Error(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1830
|
-
const
|
|
1831
|
-
|
|
1832
|
-
|
|
1834
|
+
const r = ge(
|
|
1835
|
+
s,
|
|
1836
|
+
d,
|
|
1833
1837
|
t.defaultVal,
|
|
1834
1838
|
t.formatFunIn,
|
|
1835
1839
|
c
|
|
1836
1840
|
);
|
|
1837
|
-
return
|
|
1841
|
+
return r && r.length > 0 ? t.formatFunOut(r) : t.defaultVal;
|
|
1838
1842
|
});
|
|
1839
1843
|
else {
|
|
1840
|
-
|
|
1841
|
-
const i =
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
+
d = a[n];
|
|
1845
|
+
const i = ge(
|
|
1846
|
+
s,
|
|
1847
|
+
d,
|
|
1844
1848
|
t.defaultVal,
|
|
1845
1849
|
t.formatFunIn,
|
|
1846
1850
|
c
|
|
1847
1851
|
);
|
|
1848
1852
|
return i && i.length > 0 ? t.formatFunOut(i) : t.defaultVal;
|
|
1849
1853
|
}
|
|
1850
|
-
},
|
|
1854
|
+
}, Ct = (e, n, g) => {
|
|
1851
1855
|
const t = {
|
|
1852
1856
|
defaultVal: "",
|
|
1853
|
-
formatFun: (
|
|
1857
|
+
formatFun: (d, i) => d.map((r) => r[i.idField]).join(","),
|
|
1854
1858
|
treeSetting: {}
|
|
1855
1859
|
};
|
|
1856
1860
|
Object.assign(t, g);
|
|
1857
|
-
const { treeSetting:
|
|
1861
|
+
const { treeSetting: s } = o.state.dictConfig, l = Object.assign(s, t.treeSetting), c = o.state.dictCodes;
|
|
1858
1862
|
let a = [];
|
|
1859
1863
|
if (!c || !c[n])
|
|
1860
|
-
|
|
1861
|
-
if (a =
|
|
1864
|
+
o.actions.getDictDataObj(n).then((d) => {
|
|
1865
|
+
if (a = d[n], !a)
|
|
1862
1866
|
return new Error(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1863
|
-
const i = a.find((
|
|
1867
|
+
const i = a.find((r) => r[l.labelField] === e);
|
|
1864
1868
|
return i ? t.formatFun(
|
|
1865
1869
|
oe(
|
|
1866
1870
|
i[l.labelField],
|
|
@@ -1872,10 +1876,10 @@ const Ft = (e, n, g) => {
|
|
|
1872
1876
|
});
|
|
1873
1877
|
else {
|
|
1874
1878
|
a = c[n];
|
|
1875
|
-
const
|
|
1876
|
-
return
|
|
1879
|
+
const d = a.find((i) => i[l.labelField] === e);
|
|
1880
|
+
return d ? t.formatFun(
|
|
1877
1881
|
oe(
|
|
1878
|
-
|
|
1882
|
+
d[l.labelField],
|
|
1879
1883
|
a,
|
|
1880
1884
|
l
|
|
1881
1885
|
),
|
|
@@ -1885,34 +1889,34 @@ const Ft = (e, n, g) => {
|
|
|
1885
1889
|
}, ht = (e, n, g) => {
|
|
1886
1890
|
const t = {
|
|
1887
1891
|
defaultVal: "",
|
|
1888
|
-
formatFunIn: (i,
|
|
1892
|
+
formatFunIn: (i, r) => i.map((b) => b[r.idField]).join("/"),
|
|
1889
1893
|
treeSetting: {},
|
|
1890
1894
|
formatFunOut: (i) => i.join(","),
|
|
1891
1895
|
spacer: ","
|
|
1892
1896
|
};
|
|
1893
1897
|
Object.assign(t, g);
|
|
1894
|
-
let
|
|
1895
|
-
Array.isArray(e) ?
|
|
1896
|
-
const { treeSetting: l } =
|
|
1897
|
-
let
|
|
1898
|
+
let s = [];
|
|
1899
|
+
Array.isArray(e) ? s = e : typeof e == "string" && (s = e.split(t.spacer));
|
|
1900
|
+
const { treeSetting: l } = o.state.dictConfig, c = Object.assign(l, t.treeSetting), a = o.state.dictCodes;
|
|
1901
|
+
let d = [];
|
|
1898
1902
|
if (!a || !a[n])
|
|
1899
|
-
|
|
1900
|
-
if (
|
|
1903
|
+
o.actions.getDictDataObj(n).then((i) => {
|
|
1904
|
+
if (d = i[n], !d)
|
|
1901
1905
|
return new Error(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1902
|
-
const
|
|
1903
|
-
|
|
1904
|
-
|
|
1906
|
+
const r = be(
|
|
1907
|
+
s,
|
|
1908
|
+
d,
|
|
1905
1909
|
t.defaultVal,
|
|
1906
1910
|
t.formatFunIn,
|
|
1907
1911
|
c
|
|
1908
1912
|
);
|
|
1909
|
-
return
|
|
1913
|
+
return r && r.length > 0 ? t.formatFunOut(r) : t.defaultVal;
|
|
1910
1914
|
});
|
|
1911
1915
|
else {
|
|
1912
|
-
|
|
1913
|
-
const i =
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
+
d = a[n];
|
|
1917
|
+
const i = be(
|
|
1918
|
+
s,
|
|
1919
|
+
d,
|
|
1916
1920
|
t.defaultVal,
|
|
1917
1921
|
t.formatFunIn,
|
|
1918
1922
|
c
|
|
@@ -1925,14 +1929,14 @@ const Ft = (e, n, g) => {
|
|
|
1925
1929
|
datetime: "yyyy-MM-dd hh:mm:ss",
|
|
1926
1930
|
time: "hh:mm:ss",
|
|
1927
1931
|
year: "yyyy"
|
|
1928
|
-
},
|
|
1932
|
+
}, Re = (e) => {
|
|
1929
1933
|
const n = e.replaceAll("-", "/");
|
|
1930
1934
|
var g = new Date(e), t = new Date(n);
|
|
1931
1935
|
return !isNaN(g.getTime()) || !isNaN(t.getTime());
|
|
1932
1936
|
}, Pe = (e, n = "datetime", g) => {
|
|
1933
1937
|
if (!e || !n)
|
|
1934
1938
|
return g ?? "";
|
|
1935
|
-
Object.keys($e).includes(n) && (n = $e[n]), e instanceof Date || (typeof e == "number" ||
|
|
1939
|
+
Object.keys($e).includes(n) && (n = $e[n]), e instanceof Date || (typeof e == "number" || Re(e) ? e = new Date(e) : e = new Date(Number(e)));
|
|
1936
1940
|
const t = {
|
|
1937
1941
|
"M+": e.getMonth() + 1,
|
|
1938
1942
|
"d+": e.getDate(),
|
|
@@ -1943,12 +1947,12 @@ const Ft = (e, n, g) => {
|
|
|
1943
1947
|
S: e.getMilliseconds()
|
|
1944
1948
|
};
|
|
1945
1949
|
/(y+)/.test(n) && (n = n.replace(RegExp.$1, String(e.getFullYear()).substr(4 - RegExp.$1.length)));
|
|
1946
|
-
for (const
|
|
1947
|
-
const l = new RegExp(`(${
|
|
1948
|
-
l.test(n) && (n = n.replace(l, RegExp.$1.length === 1 ? t[
|
|
1950
|
+
for (const s in t) {
|
|
1951
|
+
const l = new RegExp(`(${s})`);
|
|
1952
|
+
l.test(n) && (n = n.replace(l, RegExp.$1.length === 1 ? t[s] : ("00" + t[s]).substr(String(t[s]).length)));
|
|
1949
1953
|
}
|
|
1950
1954
|
return n;
|
|
1951
|
-
},
|
|
1955
|
+
}, ue = (e, n) => {
|
|
1952
1956
|
let t = Object.assign({
|
|
1953
1957
|
start: 0,
|
|
1954
1958
|
end: 0,
|
|
@@ -1957,16 +1961,16 @@ const Ft = (e, n, g) => {
|
|
|
1957
1961
|
}, n);
|
|
1958
1962
|
if (t || (t = { start: 0, end: 0, symbol: "*" }), t.start < 0 || t.end < 0)
|
|
1959
1963
|
return "";
|
|
1960
|
-
const
|
|
1961
|
-
if (t.start + t.end + t.middle >
|
|
1964
|
+
const s = e.length;
|
|
1965
|
+
if (t.start + t.end + t.middle > s)
|
|
1962
1966
|
return e;
|
|
1963
1967
|
let l = "";
|
|
1964
|
-
for (let
|
|
1965
|
-
l += e.charAt(
|
|
1968
|
+
for (let d = 0; d < t.start && d < s; d++)
|
|
1969
|
+
l += e.charAt(d);
|
|
1966
1970
|
let c = "";
|
|
1967
|
-
for (let
|
|
1968
|
-
c = e.charAt(
|
|
1969
|
-
const a = t.symbol.repeat(Math.max(t.middle ||
|
|
1971
|
+
for (let d = s - 1; d >= 0 && d >= s - t.end; d--)
|
|
1972
|
+
c = e.charAt(d) + c;
|
|
1973
|
+
const a = t.symbol.repeat(Math.max(t.middle || s - t.start - t.end, 0));
|
|
1970
1974
|
return l + a + c;
|
|
1971
1975
|
}, xe = (e, n = "*") => {
|
|
1972
1976
|
if (!e)
|
|
@@ -1974,16 +1978,16 @@ const Ft = (e, n, g) => {
|
|
|
1974
1978
|
const g = e.length;
|
|
1975
1979
|
if (g === 1)
|
|
1976
1980
|
return e;
|
|
1977
|
-
const t = e.charAt(0),
|
|
1978
|
-
return
|
|
1979
|
-
}, Me = (e, n = "*") => e ?
|
|
1981
|
+
const t = e.charAt(0), s = e.charAt(g - 1);
|
|
1982
|
+
return ue(e.substring(1, g - 1), { start: 1, symbol: n }) ? `${t}*${s}` : `${t}${s}`;
|
|
1983
|
+
}, Me = (e, n = "*") => e ? ue(e, { start: 4, end: 4, symbol: n }) : "", qe = (e, n = "*") => e ? ue(String(e), { start: 3, end: 4, symbol: n }) : "", ze = (e, n = "*") => {
|
|
1980
1984
|
if (!e)
|
|
1981
1985
|
return "";
|
|
1982
1986
|
const g = e.trim().split(/\s+/), t = g.length;
|
|
1983
|
-
let
|
|
1987
|
+
let s = "";
|
|
1984
1988
|
for (let l = 0; l < t; l++)
|
|
1985
|
-
/^[\u4e00-\u9fa5]+$/.test(g[l]) ?
|
|
1986
|
-
return
|
|
1989
|
+
/^[\u4e00-\u9fa5]+$/.test(g[l]) ? s += ue(g[l], { start: 1, symbol: n }) : s += ue(g[l], { start: 2, symbol: n }), l < t - 1 && (s += " ");
|
|
1990
|
+
return s;
|
|
1987
1991
|
}, It = {
|
|
1988
1992
|
mobile: qe,
|
|
1989
1993
|
name: xe,
|
|
@@ -2014,10 +2018,10 @@ const Ft = (e, n, g) => {
|
|
|
2014
2018
|
middle: g.middle,
|
|
2015
2019
|
symbol: g.symbol
|
|
2016
2020
|
};
|
|
2017
|
-
return
|
|
2021
|
+
return ue(e, t);
|
|
2018
2022
|
}, jt = {
|
|
2019
2023
|
name: "ElTableColumnDict"
|
|
2020
|
-
},
|
|
2024
|
+
}, Ie = /* @__PURE__ */ H({
|
|
2021
2025
|
...jt,
|
|
2022
2026
|
props: {
|
|
2023
2027
|
// 字典类型
|
|
@@ -2094,36 +2098,36 @@ const Ft = (e, n, g) => {
|
|
|
2094
2098
|
const {
|
|
2095
2099
|
dictType: g,
|
|
2096
2100
|
dictTreeType: t,
|
|
2097
|
-
dateFormat:
|
|
2101
|
+
dateFormat: s,
|
|
2098
2102
|
defaultVal: l,
|
|
2099
2103
|
treeSetting: c,
|
|
2100
2104
|
formatFun: a,
|
|
2101
|
-
formatFunIn:
|
|
2105
|
+
formatFunIn: d,
|
|
2102
2106
|
formatFunOut: i,
|
|
2103
|
-
spacer:
|
|
2104
|
-
maskType:
|
|
2107
|
+
spacer: r,
|
|
2108
|
+
maskType: b,
|
|
2105
2109
|
maskStart: T,
|
|
2106
2110
|
maskEnd: h,
|
|
2107
2111
|
maskMiddle: I,
|
|
2108
|
-
maskSymbol:
|
|
2109
|
-
} = e, F = me(),
|
|
2110
|
-
let
|
|
2111
|
-
return l && (
|
|
2112
|
-
}),
|
|
2113
|
-
let
|
|
2114
|
-
return l && (
|
|
2115
|
-
}), v =
|
|
2116
|
-
const
|
|
2117
|
-
return l && (
|
|
2118
|
-
}),
|
|
2119
|
-
return n({ getRef: () =>
|
|
2112
|
+
maskSymbol: O
|
|
2113
|
+
} = e, F = me(), E = N(() => {
|
|
2114
|
+
let u = {};
|
|
2115
|
+
return l && (u.defaultVal = l), a && (u.formatFun = a), r && (u.spacer = r), u;
|
|
2116
|
+
}), C = N(() => {
|
|
2117
|
+
let u = {};
|
|
2118
|
+
return l && (u.defaultVal = l), d && (u.formatFunIn = d), i && (u.formatFunOut = i), c && (u.treeSetting = c), r && (u.spacer = r), u;
|
|
2119
|
+
}), v = N(() => {
|
|
2120
|
+
const u = {};
|
|
2121
|
+
return l && (u.defaultVal = l), b && (u.maskType = b), T && (u.start = T), h && (u.end = h), I && (u.middle = I), O && (u.symbol = O), u;
|
|
2122
|
+
}), m = k(null);
|
|
2123
|
+
return n({ getRef: () => m.value }), (u, D) => {
|
|
2120
2124
|
const p = $("el-button-dict"), y = $("el-link-dict"), _ = $("el-tag-dict"), j = $("el-text-dict"), V = $("el-table-column");
|
|
2121
2125
|
return G(), w(V, ie({
|
|
2122
2126
|
ref_key: "ElTableColumnDict",
|
|
2123
|
-
ref:
|
|
2124
|
-
},
|
|
2127
|
+
ref: m
|
|
2128
|
+
}, u.$attrs), Q({
|
|
2125
2129
|
default: L((B) => {
|
|
2126
|
-
var A,
|
|
2130
|
+
var A, J, q, se, z, Z, ee, De, ke;
|
|
2127
2131
|
return [
|
|
2128
2132
|
e.dictType ? (G(), te(ne, { key: 0 }, [
|
|
2129
2133
|
e.dictTypeNode === "button" ? (G(), w(p, {
|
|
@@ -2132,7 +2136,7 @@ const Ft = (e, n, g) => {
|
|
|
2132
2136
|
dictType: e.dictType
|
|
2133
2137
|
}, null, 8, ["value", "dictType"])) : e.dictTypeNode === "link" ? (G(), w(y, {
|
|
2134
2138
|
key: 1,
|
|
2135
|
-
value: B.row[(
|
|
2139
|
+
value: B.row[(J = S(F)) == null ? void 0 : J.prop] || "",
|
|
2136
2140
|
dictType: e.dictType
|
|
2137
2141
|
}, null, 8, ["value", "dictType"])) : e.dictTypeNode === "tag" ? (G(), w(_, {
|
|
2138
2142
|
key: 2,
|
|
@@ -2143,18 +2147,18 @@ const Ft = (e, n, g) => {
|
|
|
2143
2147
|
value: B.row[(se = S(F)) == null ? void 0 : se.prop] || "",
|
|
2144
2148
|
dictType: e.dictType
|
|
2145
2149
|
}, null, 8, ["value", "dictType"])) : (G(), te(ne, { key: 4 }, [
|
|
2146
|
-
K(U(S(we)(B.row[(z = S(F)) == null ? void 0 : z.prop], e.dictType, S(
|
|
2150
|
+
K(U(S(we)(B.row[(z = S(F)) == null ? void 0 : z.prop], e.dictType, S(E))), 1)
|
|
2147
2151
|
], 64))
|
|
2148
2152
|
], 64)) : e.dictTreeType ? (G(), te(ne, { key: 1 }, [
|
|
2149
|
-
K(U(S(
|
|
2153
|
+
K(U(S(Je)(
|
|
2150
2154
|
B.row[(Z = S(F)) == null ? void 0 : Z.prop],
|
|
2151
2155
|
e.dictTreeType,
|
|
2152
|
-
S(
|
|
2156
|
+
S(C)
|
|
2153
2157
|
)), 1)
|
|
2154
2158
|
], 64)) : e.dateFormat ? (G(), te(ne, { key: 2 }, [
|
|
2155
2159
|
K(U(S(Pe)(B.row[(ee = S(F)) == null ? void 0 : ee.prop], e.dateFormat, e.defaultVal)), 1)
|
|
2156
2160
|
], 64)) : e.maskType || e.maskStart ? (G(), te(ne, { key: 3 }, [
|
|
2157
|
-
K(U(S(Ye)(B.row[(
|
|
2161
|
+
K(U(S(Ye)(B.row[(De = S(F)) == null ? void 0 : De.prop], S(v))), 1)
|
|
2158
2162
|
], 64)) : (G(), te(ne, { key: 4 }, [
|
|
2159
2163
|
K(U(B.row[(ke = S(F)) == null ? void 0 : ke.prop] || e.defaultVal), 1)
|
|
2160
2164
|
], 64))
|
|
@@ -2162,25 +2166,25 @@ const Ft = (e, n, g) => {
|
|
|
2162
2166
|
}),
|
|
2163
2167
|
_: 2
|
|
2164
2168
|
}, [
|
|
2165
|
-
x(
|
|
2169
|
+
x(u.$slots, (B, A, J) => ({
|
|
2166
2170
|
name: A,
|
|
2167
2171
|
fn: L((q) => [
|
|
2168
|
-
M(
|
|
2172
|
+
M(u.$slots, A, W(X(q)))
|
|
2169
2173
|
])
|
|
2170
2174
|
}))
|
|
2171
2175
|
]), 1040);
|
|
2172
2176
|
};
|
|
2173
2177
|
}
|
|
2174
2178
|
});
|
|
2175
|
-
|
|
2176
|
-
e.component(
|
|
2179
|
+
Ie.install = function(e) {
|
|
2180
|
+
e.component(Ie.name, Ie);
|
|
2177
2181
|
};
|
|
2178
2182
|
const At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2179
2183
|
__proto__: null,
|
|
2180
|
-
default:
|
|
2184
|
+
default: Ie
|
|
2181
2185
|
}, Symbol.toStringTag, { value: "Module" })), Gt = {
|
|
2182
2186
|
name: "ElTabsDict"
|
|
2183
|
-
},
|
|
2187
|
+
}, je = /* @__PURE__ */ H({
|
|
2184
2188
|
...Gt,
|
|
2185
2189
|
props: {
|
|
2186
2190
|
//角标对象
|
|
@@ -2213,103 +2217,103 @@ const At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2213
2217
|
setup(e, { expose: n, emit: g }) {
|
|
2214
2218
|
const {
|
|
2215
2219
|
badgeObj: t,
|
|
2216
|
-
dictType:
|
|
2220
|
+
dictType: s,
|
|
2217
2221
|
disableObj: l,
|
|
2218
2222
|
keyValue: c,
|
|
2219
2223
|
filterDataFun: a,
|
|
2220
|
-
disabledDataFun:
|
|
2221
|
-
} = e, i = me(),
|
|
2224
|
+
disabledDataFun: d
|
|
2225
|
+
} = e, i = me(), r = k(""), b = P(o.state.dictConfig), T = P(o.state.dictCodes), h = (m) => {
|
|
2222
2226
|
window.setTimeout(() => {
|
|
2223
2227
|
if (!c) {
|
|
2224
2228
|
g("dictChange", i.modelValue);
|
|
2225
2229
|
return;
|
|
2226
2230
|
}
|
|
2227
|
-
const f = I.list.find((
|
|
2231
|
+
const f = I.list.find((u) => u[b.format.value] === i.modelValue);
|
|
2228
2232
|
g("dictChange", f);
|
|
2229
2233
|
}, 0);
|
|
2230
2234
|
}, I = ae({
|
|
2231
2235
|
list: []
|
|
2232
|
-
}),
|
|
2233
|
-
if (!
|
|
2236
|
+
}), O = async () => {
|
|
2237
|
+
if (!s)
|
|
2234
2238
|
return;
|
|
2235
|
-
let
|
|
2236
|
-
if (typeof
|
|
2237
|
-
|
|
2239
|
+
let m = [];
|
|
2240
|
+
if (typeof s == "object") {
|
|
2241
|
+
r.value = s.type, await o.actions.getDictDataObj(r.value), m = [].concat(T[r.value]);
|
|
2238
2242
|
const {
|
|
2239
2243
|
filters: f,
|
|
2240
|
-
filterType:
|
|
2244
|
+
filterType: u = b.format.value,
|
|
2241
2245
|
reverse: D = !1
|
|
2242
|
-
} =
|
|
2243
|
-
D ?
|
|
2246
|
+
} = s, p = typeof f == "string" ? f.split(",") : f;
|
|
2247
|
+
D ? m = m.filter((y) => !p.includes(y[u])) : m = m.filter((y) => p.includes(y[u]));
|
|
2244
2248
|
} else
|
|
2245
|
-
|
|
2246
|
-
if (a && (
|
|
2249
|
+
r.value = s, await o.actions.getDictDataObj(r.value), m = [].concat(T[r.value]);
|
|
2250
|
+
if (a && (m = a(m)), d && (m = m.map((f) => ({
|
|
2247
2251
|
...f,
|
|
2248
|
-
[
|
|
2252
|
+
[b.format.disabled]: !!f[b.format.disabled] || d(f)
|
|
2249
2253
|
}))), l) {
|
|
2250
2254
|
const {
|
|
2251
2255
|
disableValue: f,
|
|
2252
|
-
disableType:
|
|
2256
|
+
disableType: u = b.format.value,
|
|
2253
2257
|
reverse: D = !1
|
|
2254
2258
|
} = l, p = typeof f == "string" ? f.split(",") : f;
|
|
2255
|
-
D ?
|
|
2259
|
+
D ? m = m.map((y) => {
|
|
2256
2260
|
const _ = JSON.parse(JSON.stringify(y));
|
|
2257
|
-
return _[
|
|
2258
|
-
}) :
|
|
2261
|
+
return _[b.format.disabled] = !p.includes(_[u]) || _[b.format.disabled], _;
|
|
2262
|
+
}) : m = m.map((y) => {
|
|
2259
2263
|
const _ = JSON.parse(JSON.stringify(y));
|
|
2260
|
-
return _[
|
|
2264
|
+
return _[b.format.disabled] = p.includes(_[u]) || _[b.format.disabled], _;
|
|
2261
2265
|
});
|
|
2262
2266
|
}
|
|
2263
|
-
I.list =
|
|
2264
|
-
}, F =
|
|
2267
|
+
I.list = m;
|
|
2268
|
+
}, F = N(() => o.state.isGettingDictTypes.includes(r.value)), E = N(() => o.state.isGettingAllDictTypes);
|
|
2265
2269
|
re(
|
|
2266
|
-
[F,
|
|
2267
|
-
([
|
|
2268
|
-
|
|
2270
|
+
[F, E],
|
|
2271
|
+
([m], [f]) => {
|
|
2272
|
+
!m && !f && O();
|
|
2269
2273
|
},
|
|
2270
2274
|
{
|
|
2271
2275
|
immediate: !0
|
|
2272
2276
|
}
|
|
2273
2277
|
);
|
|
2274
|
-
const
|
|
2275
|
-
return n({ getRef: () =>
|
|
2276
|
-
const
|
|
2278
|
+
const C = k(null);
|
|
2279
|
+
return n({ getRef: () => C.value }), (m, f) => {
|
|
2280
|
+
const u = $("el-badge"), D = $("el-tab-pane"), p = $("el-tabs");
|
|
2277
2281
|
return G(), w(p, ie({
|
|
2278
2282
|
ref_key: "ElTabsDict",
|
|
2279
|
-
ref:
|
|
2283
|
+
ref: C,
|
|
2280
2284
|
class: "vue-element-dict-tabs"
|
|
2281
|
-
},
|
|
2285
|
+
}, m.$attrs, { onTabClick: h }), {
|
|
2282
2286
|
default: L(() => [
|
|
2283
2287
|
(G(!0), te(ne, null, x(I.list, (y) => (G(), w(D, {
|
|
2284
|
-
disabled: y[S(
|
|
2285
|
-
label: y[S(
|
|
2286
|
-
key: y[S(
|
|
2287
|
-
name: y[S(
|
|
2288
|
+
disabled: y[S(b).format.disabled],
|
|
2289
|
+
label: y[S(b).format.label],
|
|
2290
|
+
key: y[S(b).format.value],
|
|
2291
|
+
name: y[S(b).format.value]
|
|
2288
2292
|
}, Q({
|
|
2289
2293
|
default: L(() => [
|
|
2290
|
-
M(
|
|
2294
|
+
M(m.$slots, y[S(b).format.value])
|
|
2291
2295
|
]),
|
|
2292
2296
|
_: 2
|
|
2293
2297
|
}, [
|
|
2294
|
-
x(
|
|
2298
|
+
x(m.$slots, (_, j, V) => ({
|
|
2295
2299
|
name: j,
|
|
2296
2300
|
fn: L((B) => [
|
|
2297
|
-
M(
|
|
2301
|
+
M(m.$slots, j, W(X(B)))
|
|
2298
2302
|
])
|
|
2299
2303
|
})),
|
|
2300
|
-
e.badgeObj[y[S(
|
|
2304
|
+
e.badgeObj[y[S(b).format.value]] ? {
|
|
2301
2305
|
name: "label",
|
|
2302
2306
|
fn: L(() => [
|
|
2303
|
-
Ue(
|
|
2304
|
-
type: e.badgeObj[y[S(
|
|
2305
|
-
"is-dot": e.badgeObj[y[S(
|
|
2306
|
-
value: e.badgeObj[y[S(
|
|
2307
|
-
max: e.badgeObj[y[S(
|
|
2308
|
-
hidden: e.badgeObj[y[S(
|
|
2307
|
+
Ue(u, {
|
|
2308
|
+
type: e.badgeObj[y[S(b).format.value]].type,
|
|
2309
|
+
"is-dot": e.badgeObj[y[S(b).format.value]].isDot,
|
|
2310
|
+
value: e.badgeObj[y[S(b).format.value]].value,
|
|
2311
|
+
max: e.badgeObj[y[S(b).format.value]].max,
|
|
2312
|
+
hidden: e.badgeObj[y[S(b).format.value]].hidden,
|
|
2309
2313
|
class: "item"
|
|
2310
2314
|
}, {
|
|
2311
2315
|
default: L(() => [
|
|
2312
|
-
K(U(y[S(
|
|
2316
|
+
K(U(y[S(b).format.label]), 1)
|
|
2313
2317
|
]),
|
|
2314
2318
|
_: 2
|
|
2315
2319
|
}, 1032, ["type", "is-dot", "value", "max", "hidden"])
|
|
@@ -2323,15 +2327,15 @@ const At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2323
2327
|
};
|
|
2324
2328
|
}
|
|
2325
2329
|
});
|
|
2326
|
-
|
|
2327
|
-
e.component(
|
|
2330
|
+
je.install = function(e) {
|
|
2331
|
+
e.component(je.name, je);
|
|
2328
2332
|
};
|
|
2329
2333
|
const Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2330
2334
|
__proto__: null,
|
|
2331
|
-
default:
|
|
2335
|
+
default: je
|
|
2332
2336
|
}, Symbol.toStringTag, { value: "Module" })), Nt = {
|
|
2333
2337
|
name: "ElTagDict"
|
|
2334
|
-
},
|
|
2338
|
+
}, Ae = /* @__PURE__ */ H({
|
|
2335
2339
|
...Nt,
|
|
2336
2340
|
props: {
|
|
2337
2341
|
value: {
|
|
@@ -2359,46 +2363,46 @@ const Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2359
2363
|
}
|
|
2360
2364
|
},
|
|
2361
2365
|
setup(e, { expose: n }) {
|
|
2362
|
-
const g = e, { value: t, dictType:
|
|
2366
|
+
const g = e, { value: t, dictType: s, judgeTypeFun: l, type: c, judgeColorFun: a, color: d } = Le(g), i = P(o.state.dictConfig), r = N(() => l != null && l.value ? l == null ? void 0 : l.value(t.value) : c.value ? c.value : T.value && T.value[i.format.type] ? T.value[i.format.type] : "success"), b = N(() => a != null && a.value ? a == null ? void 0 : a.value(t) : d.value ? d.value : T.value && T.value[i.format.color] ? T.value[i.format.color] : "");
|
|
2363
2367
|
let T = k(null), h = k(null);
|
|
2364
2368
|
Ve(() => {
|
|
2365
|
-
|
|
2369
|
+
pe(t.value, s.value).then((F) => {
|
|
2366
2370
|
T.value = F, h.value = F[i.format.label];
|
|
2367
2371
|
});
|
|
2368
2372
|
});
|
|
2369
2373
|
const I = k(null);
|
|
2370
|
-
return n({ getRef: () => I.value }), (F,
|
|
2371
|
-
const
|
|
2372
|
-
return G(), w(
|
|
2374
|
+
return n({ getRef: () => I.value }), (F, E) => {
|
|
2375
|
+
const C = $("el-tag");
|
|
2376
|
+
return G(), w(C, ie({
|
|
2373
2377
|
ref_key: "ElTagDict",
|
|
2374
2378
|
ref: I,
|
|
2375
|
-
type: S(
|
|
2376
|
-
color: S(
|
|
2379
|
+
type: S(r),
|
|
2380
|
+
color: S(b)
|
|
2377
2381
|
}, F.$attrs), Q({
|
|
2378
2382
|
default: L(() => [
|
|
2379
2383
|
K(" " + U(S(h)), 1)
|
|
2380
2384
|
]),
|
|
2381
2385
|
_: 2
|
|
2382
2386
|
}, [
|
|
2383
|
-
x(F.$slots, (v,
|
|
2384
|
-
name:
|
|
2385
|
-
fn: L((
|
|
2386
|
-
M(F.$slots,
|
|
2387
|
+
x(F.$slots, (v, m, f) => ({
|
|
2388
|
+
name: m,
|
|
2389
|
+
fn: L((u) => [
|
|
2390
|
+
M(F.$slots, m, W(X(u)))
|
|
2387
2391
|
])
|
|
2388
2392
|
}))
|
|
2389
2393
|
]), 1040, ["type", "color"]);
|
|
2390
2394
|
};
|
|
2391
2395
|
}
|
|
2392
2396
|
});
|
|
2393
|
-
|
|
2394
|
-
e.component(
|
|
2397
|
+
Ae.install = function(e) {
|
|
2398
|
+
e.component(Ae.name, Ae);
|
|
2395
2399
|
};
|
|
2396
2400
|
const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2397
2401
|
__proto__: null,
|
|
2398
|
-
default:
|
|
2402
|
+
default: Ae
|
|
2399
2403
|
}, Symbol.toStringTag, { value: "Module" })), Vt = {
|
|
2400
2404
|
name: "ElTextDict"
|
|
2401
|
-
},
|
|
2405
|
+
}, Ge = /* @__PURE__ */ H({
|
|
2402
2406
|
...Vt,
|
|
2403
2407
|
props: {
|
|
2404
2408
|
value: {
|
|
@@ -2419,44 +2423,44 @@ const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2419
2423
|
}
|
|
2420
2424
|
},
|
|
2421
2425
|
setup(e, { expose: n }) {
|
|
2422
|
-
const g = e, { value: t, dictType:
|
|
2423
|
-
let i = k(null),
|
|
2426
|
+
const g = e, { value: t, dictType: s, judgeTypeFun: l, type: c } = Le(g), a = P(o.state.dictConfig), d = N(() => l != null && l.value ? l == null ? void 0 : l.value(t.value) : c != null && c.value ? c.value : i.value && i.value[a.format.type] ? i.value[a.format.type] : "primary");
|
|
2427
|
+
let i = k(null), r = k(null);
|
|
2424
2428
|
Ve(() => {
|
|
2425
|
-
|
|
2426
|
-
i.value = h,
|
|
2429
|
+
pe(t.value, s.value).then((h) => {
|
|
2430
|
+
i.value = h, r.value = h[a.format.label];
|
|
2427
2431
|
});
|
|
2428
2432
|
});
|
|
2429
|
-
const
|
|
2430
|
-
return n({ getRef: () =>
|
|
2431
|
-
const
|
|
2432
|
-
return G(), w(
|
|
2433
|
+
const b = k(null);
|
|
2434
|
+
return n({ getRef: () => b.value }), (h, I) => {
|
|
2435
|
+
const O = $("el-text");
|
|
2436
|
+
return G(), w(O, ie({
|
|
2433
2437
|
ref: "ElTextDict",
|
|
2434
|
-
type: S(
|
|
2438
|
+
type: S(d)
|
|
2435
2439
|
}, h.$attrs), Q({
|
|
2436
2440
|
default: L(() => [
|
|
2437
|
-
K(" " + U(S(
|
|
2441
|
+
K(" " + U(S(r)), 1)
|
|
2438
2442
|
]),
|
|
2439
2443
|
_: 2
|
|
2440
2444
|
}, [
|
|
2441
|
-
x(h.$slots, (F,
|
|
2442
|
-
name:
|
|
2445
|
+
x(h.$slots, (F, E, C) => ({
|
|
2446
|
+
name: E,
|
|
2443
2447
|
fn: L((v) => [
|
|
2444
|
-
M(h.$slots,
|
|
2448
|
+
M(h.$slots, E, W(X(v)))
|
|
2445
2449
|
])
|
|
2446
2450
|
}))
|
|
2447
2451
|
]), 1040, ["type"]);
|
|
2448
2452
|
};
|
|
2449
2453
|
}
|
|
2450
2454
|
});
|
|
2451
|
-
|
|
2452
|
-
e.component(
|
|
2455
|
+
Ge.install = function(e) {
|
|
2456
|
+
e.component(Ge.name, Ge);
|
|
2453
2457
|
};
|
|
2454
2458
|
const kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2455
2459
|
__proto__: null,
|
|
2456
|
-
default:
|
|
2460
|
+
default: Ge
|
|
2457
2461
|
}, Symbol.toStringTag, { value: "Module" })), $t = {
|
|
2458
2462
|
name: "ElTreeDict"
|
|
2459
|
-
},
|
|
2463
|
+
}, Ee = /* @__PURE__ */ H({
|
|
2460
2464
|
...$t,
|
|
2461
2465
|
props: {
|
|
2462
2466
|
//最大层级
|
|
@@ -2480,11 +2484,11 @@ const kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2480
2484
|
}
|
|
2481
2485
|
},
|
|
2482
2486
|
setup(e, { expose: n }) {
|
|
2483
|
-
const { maxLevel: g, dictType: t, disableObj:
|
|
2487
|
+
const { maxLevel: g, dictType: t, disableObj: s, filterDataFun: l, disabledDataFun: c } = e, a = me(), d = k(""), i = P(o.state.dictConfig), r = P(o.state.dictCodes), b = ae({
|
|
2484
2488
|
list: []
|
|
2485
|
-
}), T = (
|
|
2486
|
-
for (let
|
|
2487
|
-
const D =
|
|
2489
|
+
}), T = (m, f) => {
|
|
2490
|
+
for (let u = 0; u < m.length; u++) {
|
|
2491
|
+
const D = m[u];
|
|
2488
2492
|
if (D[i.treeSetting.levelField] === f) {
|
|
2489
2493
|
delete D[F.value.children], D[F.value.isLeaf] = !0;
|
|
2490
2494
|
continue;
|
|
@@ -2494,83 +2498,83 @@ const kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2494
2498
|
}, h = async () => {
|
|
2495
2499
|
if (!t)
|
|
2496
2500
|
return;
|
|
2497
|
-
let
|
|
2501
|
+
let m = [];
|
|
2498
2502
|
if (typeof t == "object") {
|
|
2499
|
-
|
|
2503
|
+
d.value = t.type, await o.actions.getDictDataObj(d.value), m = [].concat(r[d.value]);
|
|
2500
2504
|
const {
|
|
2501
2505
|
filters: f,
|
|
2502
|
-
filterType:
|
|
2506
|
+
filterType: u = i.format.value,
|
|
2503
2507
|
reverse: D = !1
|
|
2504
2508
|
} = t, p = typeof f == "string" ? f.split(",") : f;
|
|
2505
|
-
D ?
|
|
2509
|
+
D ? m = m.filter((y) => !p.includes(y[u])) : m = m.filter((y) => p.includes(y[u]));
|
|
2506
2510
|
} else
|
|
2507
|
-
|
|
2508
|
-
if (l && (
|
|
2511
|
+
d.value = t, await o.actions.getDictDataObj(d.value), m = [].concat(r[d.value]);
|
|
2512
|
+
if (l && (m = l(m)), c && (m = m.map((f) => ({
|
|
2509
2513
|
...f,
|
|
2510
|
-
[i.format.disabled]: f[i.format.disabled] || c(f)
|
|
2511
|
-
}))),
|
|
2514
|
+
[i.format.disabled]: !!f[i.format.disabled] || c(f)
|
|
2515
|
+
}))), s) {
|
|
2512
2516
|
const {
|
|
2513
2517
|
disableValue: f,
|
|
2514
|
-
disableType:
|
|
2518
|
+
disableType: u = i.format.value,
|
|
2515
2519
|
reverse: D = !1
|
|
2516
|
-
} =
|
|
2517
|
-
D ?
|
|
2520
|
+
} = s, p = typeof f == "string" ? f.split(",") : f;
|
|
2521
|
+
D ? m = m.map((y) => {
|
|
2518
2522
|
const _ = JSON.parse(JSON.stringify(y));
|
|
2519
|
-
return _[i.format.disabled] = !p.includes(_[
|
|
2520
|
-
}) :
|
|
2523
|
+
return _[i.format.disabled] = !p.includes(_[u]) || _[i.format.disabled], _;
|
|
2524
|
+
}) : m = m.map((y) => {
|
|
2521
2525
|
const _ = JSON.parse(JSON.stringify(y));
|
|
2522
|
-
return _[i.format.disabled] = p.includes(_[
|
|
2526
|
+
return _[i.format.disabled] = p.includes(_[u]) || _[i.format.disabled], _;
|
|
2523
2527
|
});
|
|
2524
2528
|
}
|
|
2525
|
-
|
|
2526
|
-
}, I =
|
|
2527
|
-
const
|
|
2528
|
-
return
|
|
2529
|
-
}),
|
|
2530
|
-
const
|
|
2531
|
-
labelField:
|
|
2532
|
-
childrenField:
|
|
2533
|
-
leafField:
|
|
2534
|
-
},
|
|
2529
|
+
b.list = m;
|
|
2530
|
+
}, I = N(() => o.state.isGettingDictTypes.includes(d.value)), O = N(() => o.state.isGettingAllDictTypes), F = N(() => {
|
|
2531
|
+
const m = a.props ?? {};
|
|
2532
|
+
return m.disabled = m.disabled ?? o.state.dictConfig.format.disabled, m.label = m.label ?? o.state.dictConfig.treeSetting.labelField, m.children = m.children ?? o.state.dictConfig.treeSetting.childrenField, m.isLeaf = m.leaf ?? o.state.dictConfig.treeSetting.leafField, m;
|
|
2533
|
+
}), E = N(() => {
|
|
2534
|
+
const m = a.props ?? {}, f = {
|
|
2535
|
+
labelField: m.label ?? i.treeSetting.labelField,
|
|
2536
|
+
childrenField: m.children ?? i.treeSetting.childrenField,
|
|
2537
|
+
leafField: m.leaf ?? i.treeSetting.leafField
|
|
2538
|
+
}, u = Object.assign(o.state.dictConfig.treeSetting, f), D = JSON.parse(JSON.stringify(b.list)), p = ye(D, u);
|
|
2535
2539
|
return g && T(p, +g), p;
|
|
2536
2540
|
});
|
|
2537
2541
|
re(
|
|
2538
|
-
[I,
|
|
2539
|
-
([
|
|
2540
|
-
|
|
2542
|
+
[I, O],
|
|
2543
|
+
([m], [f]) => {
|
|
2544
|
+
!m && !f && h();
|
|
2541
2545
|
},
|
|
2542
2546
|
{
|
|
2543
2547
|
immediate: !0
|
|
2544
2548
|
}
|
|
2545
2549
|
);
|
|
2546
|
-
const
|
|
2547
|
-
return n({ getRef: () =>
|
|
2548
|
-
const
|
|
2549
|
-
return G(), w(
|
|
2550
|
+
const C = k(null);
|
|
2551
|
+
return n({ getRef: () => C.value }), (m, f) => {
|
|
2552
|
+
const u = $("el-tree");
|
|
2553
|
+
return G(), w(u, {
|
|
2550
2554
|
ref_key: "ElTreeDict",
|
|
2551
|
-
ref:
|
|
2552
|
-
data: S(
|
|
2555
|
+
ref: C,
|
|
2556
|
+
data: S(E),
|
|
2553
2557
|
props: S(F)
|
|
2554
2558
|
}, Q({ _: 2 }, [
|
|
2555
|
-
x(
|
|
2559
|
+
x(m.$slots, (D, p, y) => ({
|
|
2556
2560
|
name: p,
|
|
2557
2561
|
fn: L((_) => [
|
|
2558
|
-
M(
|
|
2562
|
+
M(m.$slots, p, W(X(_)))
|
|
2559
2563
|
])
|
|
2560
2564
|
}))
|
|
2561
2565
|
]), 1032, ["data", "props"]);
|
|
2562
2566
|
};
|
|
2563
2567
|
}
|
|
2564
2568
|
});
|
|
2565
|
-
|
|
2566
|
-
e.component(
|
|
2569
|
+
Ee.install = function(e) {
|
|
2570
|
+
e.component(Ee.name, Ee);
|
|
2567
2571
|
};
|
|
2568
2572
|
const Bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2569
2573
|
__proto__: null,
|
|
2570
|
-
default:
|
|
2574
|
+
default: Ee
|
|
2571
2575
|
}, Symbol.toStringTag, { value: "Module" })), wt = {
|
|
2572
2576
|
name: "ElTreeSelectDict"
|
|
2573
|
-
},
|
|
2577
|
+
}, Ne = /* @__PURE__ */ H({
|
|
2574
2578
|
...wt,
|
|
2575
2579
|
props: {
|
|
2576
2580
|
//最大层级
|
|
@@ -2579,7 +2583,7 @@ const Bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2579
2583
|
},
|
|
2580
2584
|
nodeKey: {
|
|
2581
2585
|
type: String,
|
|
2582
|
-
default:
|
|
2586
|
+
default: o.state.dictConfig.treeSetting.idField
|
|
2583
2587
|
},
|
|
2584
2588
|
dictType: {
|
|
2585
2589
|
type: [String, Object],
|
|
@@ -2598,78 +2602,78 @@ const Bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2598
2602
|
}
|
|
2599
2603
|
},
|
|
2600
2604
|
setup(e, { expose: n }) {
|
|
2601
|
-
const { maxLevel: g, nodeKey: t, dictType:
|
|
2605
|
+
const { maxLevel: g, nodeKey: t, dictType: s, disableObj: l, filterDataFun: c, disabledDataFun: a } = e, d = me(), i = k(""), r = P(o.state.dictConfig), b = P(o.state.dictCodes), T = ae({
|
|
2602
2606
|
list: []
|
|
2603
|
-
}), h = (f,
|
|
2607
|
+
}), h = (f, u) => {
|
|
2604
2608
|
for (let D = 0; D < f.length; D++) {
|
|
2605
2609
|
const p = f[D];
|
|
2606
|
-
if (p[
|
|
2607
|
-
delete p[
|
|
2610
|
+
if (p[r.treeSetting.levelField] === u) {
|
|
2611
|
+
delete p[E.value.children], p[E.value.isLeaf] = !0;
|
|
2608
2612
|
continue;
|
|
2609
2613
|
} else
|
|
2610
|
-
h(p[
|
|
2614
|
+
h(p[E.value.children], u);
|
|
2611
2615
|
}
|
|
2612
2616
|
}, I = async () => {
|
|
2613
|
-
if (!
|
|
2617
|
+
if (!s)
|
|
2614
2618
|
return;
|
|
2615
2619
|
let f = [];
|
|
2616
|
-
if (typeof
|
|
2617
|
-
i.value =
|
|
2620
|
+
if (typeof s == "object") {
|
|
2621
|
+
i.value = s.type, await o.actions.getDictDataObj(i.value), f = [].concat(b[i.value]);
|
|
2618
2622
|
const {
|
|
2619
|
-
filters:
|
|
2620
|
-
filterType: D =
|
|
2623
|
+
filters: u,
|
|
2624
|
+
filterType: D = r.format.value,
|
|
2621
2625
|
reverse: p = !1
|
|
2622
|
-
} =
|
|
2626
|
+
} = s, y = typeof u == "string" ? u.split(",") : u;
|
|
2623
2627
|
p ? f = f.filter((_) => !y.includes(_[D])) : f = f.filter((_) => y.includes(_[D]));
|
|
2624
2628
|
} else
|
|
2625
|
-
i.value =
|
|
2626
|
-
if (c && (f = c(f)), a && (f = f.map((
|
|
2627
|
-
...
|
|
2628
|
-
[
|
|
2629
|
+
i.value = s, await o.actions.getDictDataObj(i.value), f = [].concat(b[i.value]);
|
|
2630
|
+
if (c && (f = c(f)), a && (f = f.map((u) => ({
|
|
2631
|
+
...u,
|
|
2632
|
+
[r.format.disabled]: !!u[r.format.disabled] || a(u)
|
|
2629
2633
|
}))), l) {
|
|
2630
2634
|
const {
|
|
2631
|
-
disableValue:
|
|
2632
|
-
disableType: D =
|
|
2635
|
+
disableValue: u,
|
|
2636
|
+
disableType: D = r.format.value,
|
|
2633
2637
|
reverse: p = !1
|
|
2634
|
-
} = l, y = typeof
|
|
2638
|
+
} = l, y = typeof u == "string" ? u.split(",") : u;
|
|
2635
2639
|
p ? f = f.map((_) => {
|
|
2636
2640
|
const j = JSON.parse(JSON.stringify(_));
|
|
2637
|
-
return j[
|
|
2641
|
+
return j[r.format.disabled] = !y.includes(j[D]) || j[r.format.disabled], j;
|
|
2638
2642
|
}) : f = f.map((_) => {
|
|
2639
2643
|
const j = JSON.parse(JSON.stringify(_));
|
|
2640
|
-
return j[
|
|
2644
|
+
return j[r.format.disabled] = y.includes(j[D]) || j[r.format.disabled], j;
|
|
2641
2645
|
});
|
|
2642
2646
|
}
|
|
2643
2647
|
T.list = f;
|
|
2644
|
-
},
|
|
2645
|
-
const f =
|
|
2646
|
-
return f.disabled = f.disabled ??
|
|
2647
|
-
}),
|
|
2648
|
-
const f =
|
|
2649
|
-
labelField: f.label ??
|
|
2650
|
-
childrenField: f.children ??
|
|
2651
|
-
leafField: f.leaf ??
|
|
2652
|
-
}, D = Object.assign(
|
|
2648
|
+
}, O = N(() => o.state.isGettingDictTypes.includes(i.value)), F = N(() => o.state.isGettingAllDictTypes), E = N(() => {
|
|
2649
|
+
const f = d.props ?? {};
|
|
2650
|
+
return f.disabled = f.disabled ?? o.state.dictConfig.format.disabled, f.label = f.label ?? o.state.dictConfig.treeSetting.labelField, f.children = f.children ?? o.state.dictConfig.treeSetting.childrenField, f.isLeaf = f.leaf ?? o.state.dictConfig.treeSetting.leafField, f;
|
|
2651
|
+
}), C = N(() => {
|
|
2652
|
+
const f = d.props ?? {}, u = {
|
|
2653
|
+
labelField: f.label ?? r.treeSetting.labelField,
|
|
2654
|
+
childrenField: f.children ?? r.treeSetting.childrenField,
|
|
2655
|
+
leafField: f.leaf ?? r.treeSetting.leafField
|
|
2656
|
+
}, D = Object.assign(o.state.dictConfig.treeSetting, u), p = JSON.parse(JSON.stringify(T.list)), y = ye(p, D);
|
|
2653
2657
|
return g && h(y, +g), y;
|
|
2654
2658
|
});
|
|
2655
2659
|
re(
|
|
2656
|
-
[
|
|
2657
|
-
([f], [
|
|
2658
|
-
|
|
2660
|
+
[O, F],
|
|
2661
|
+
([f], [u]) => {
|
|
2662
|
+
!f && !u && I();
|
|
2659
2663
|
},
|
|
2660
2664
|
{
|
|
2661
2665
|
immediate: !0
|
|
2662
2666
|
}
|
|
2663
2667
|
);
|
|
2664
2668
|
const v = k(null);
|
|
2665
|
-
return n({ getRef: () => v.value }), (f,
|
|
2669
|
+
return n({ getRef: () => v.value }), (f, u) => {
|
|
2666
2670
|
const D = $("el-tree-select");
|
|
2667
2671
|
return G(), w(D, {
|
|
2668
2672
|
ref_key: "ElTreeSelectDict",
|
|
2669
2673
|
ref: v,
|
|
2670
|
-
data: S(
|
|
2674
|
+
data: S(C),
|
|
2671
2675
|
"node-key": e.nodeKey,
|
|
2672
|
-
props: S(
|
|
2676
|
+
props: S(E)
|
|
2673
2677
|
}, Q({ _: 2 }, [
|
|
2674
2678
|
x(f.$slots, (p, y, _) => ({
|
|
2675
2679
|
name: y,
|
|
@@ -2681,12 +2685,12 @@ const Bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2681
2685
|
};
|
|
2682
2686
|
}
|
|
2683
2687
|
});
|
|
2684
|
-
|
|
2685
|
-
e.component(
|
|
2688
|
+
Ne.install = function(e) {
|
|
2689
|
+
e.component(Ne.name, Ne);
|
|
2686
2690
|
};
|
|
2687
|
-
const
|
|
2691
|
+
const Jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2688
2692
|
__proto__: null,
|
|
2689
|
-
default:
|
|
2693
|
+
default: Ne
|
|
2690
2694
|
}, Symbol.toStringTag, { value: "Module" })), Be = /* @__PURE__ */ Object.assign({
|
|
2691
2695
|
"./el-button-dict/index.ts": nt,
|
|
2692
2696
|
"./el-cascader-dict/index.ts": at,
|
|
@@ -2694,48 +2698,50 @@ const Rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2694
2698
|
"./el-checkbox-dict/index.ts": ot,
|
|
2695
2699
|
"./el-link-dict/index.ts": ut,
|
|
2696
2700
|
"./el-radio-button-dict/index.ts": ft,
|
|
2697
|
-
"./el-radio-dict/index.ts":
|
|
2701
|
+
"./el-radio-dict/index.ts": bt,
|
|
2698
2702
|
"./el-select-dict/index.ts": pt,
|
|
2699
2703
|
"./el-table-column-dict/index.ts": At,
|
|
2700
2704
|
"./el-tabs-dict/index.ts": Et,
|
|
2701
2705
|
"./el-tag-dict/index.ts": Lt,
|
|
2702
2706
|
"./el-text-dict/index.ts": kt,
|
|
2703
2707
|
"./el-tree-dict/index.ts": Bt,
|
|
2704
|
-
"./el-tree-select-dict/index.ts":
|
|
2708
|
+
"./el-tree-select-dict/index.ts": Jt
|
|
2705
2709
|
});
|
|
2706
2710
|
let Ke = [];
|
|
2707
2711
|
Object.keys(Be).forEach((e) => {
|
|
2708
2712
|
Ke.push(Be[e].default);
|
|
2709
2713
|
});
|
|
2710
|
-
const
|
|
2714
|
+
const Rt = () => o.state.dictConfig, Pt = (e) => o.state.dictConfig[e], qt = Rt, zt = Pt, Yt = Qe, Kt = We, Ut = Xe, Ht = Ze, Qt = et, Wt = pe, Xt = yt, Zt = we, en = Dt, tn = Tt, nn = ue, an = ze, ln = Me, rn = xe, sn = qe, on = Ye, cn = Pe, un = Re, dn = ye, fn = le, gn = oe, bn = _t, mn = St, pn = vt, yn = Ft, Dn = Ot, Tn = Ct, _n = Je, vn = ht;
|
|
2711
2715
|
async function xt(e) {
|
|
2716
|
+
var l;
|
|
2712
2717
|
const n = e.storage.getItem(e.dictDataKey) || "{}", g = JSON.parse(n), t = e.usuallyGetDictTypes ? e.usuallyGetDictTypes.split(",") : [];
|
|
2713
|
-
let
|
|
2718
|
+
let s = [];
|
|
2714
2719
|
if (e.usuallyGetDictTypesByApi)
|
|
2715
|
-
|
|
2720
|
+
s = t;
|
|
2716
2721
|
else if (t.length > 0)
|
|
2717
|
-
for (let
|
|
2718
|
-
g[t[
|
|
2719
|
-
if (n === "{}" || e.isGetAll ||
|
|
2720
|
-
let
|
|
2721
|
-
e.isGetAll ? (
|
|
2722
|
-
e.formatterRequest(e.query,
|
|
2723
|
-
),
|
|
2724
|
-
e.formatterRequest(e.query,
|
|
2725
|
-
),
|
|
2726
|
-
const
|
|
2727
|
-
e.storage.setItem(e.versionKey,
|
|
2728
|
-
const
|
|
2729
|
-
|
|
2722
|
+
for (let c = 0; c < t.length; c++)
|
|
2723
|
+
g[t[c]] || s.push(t[c]);
|
|
2724
|
+
if (n === "{}" || e.isGetAll || s.length > 0) {
|
|
2725
|
+
let c, a = "";
|
|
2726
|
+
e.isGetAll ? (o.mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!0), c = await e.getDictCodeApi(
|
|
2727
|
+
e.formatterRequest(e.query, a)
|
|
2728
|
+
), o.mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!1)) : s.length > 0 && (a = s.join(","), o.mutations.ADD_IS_EGTTING_DICT_TYPES(a), c = await e.getDictCodeApi(
|
|
2729
|
+
e.formatterRequest(e.query, a)
|
|
2730
|
+
), o.mutations.REMOVE_IS_EGTTING_DICT_TYPES(a));
|
|
2731
|
+
const d = e.formatterDictList(c, a), i = e.formatterDictVersion(c);
|
|
2732
|
+
e.storage.setItem(e.versionKey, i);
|
|
2733
|
+
const r = Object.assign(o.state.dictCodes, d), b = ce(r, e.filterDataFun, e.disabledDataFun, (l = e == null ? void 0 : e.format) == null ? void 0 : l.disabled);
|
|
2734
|
+
o.mutations.SET_DICT_CODES(b), e.storage.setItem(e.dictDataKey, JSON.stringify(b));
|
|
2730
2735
|
}
|
|
2731
2736
|
}
|
|
2732
2737
|
let Sn = {
|
|
2733
2738
|
async install(e, n) {
|
|
2739
|
+
var d, i;
|
|
2734
2740
|
const g = {
|
|
2735
2741
|
//组件过滤数据 配置
|
|
2736
|
-
filterDataFun: (
|
|
2742
|
+
filterDataFun: (r) => r,
|
|
2737
2743
|
//组件禁用数据 配置
|
|
2738
|
-
disabledDataFun: (
|
|
2744
|
+
disabledDataFun: (r) => !1,
|
|
2739
2745
|
//配置数组数据转化成树形数据
|
|
2740
2746
|
treeSetting: {
|
|
2741
2747
|
idField: "id",
|
|
@@ -2769,9 +2775,9 @@ let Sn = {
|
|
|
2769
2775
|
type: "type",
|
|
2770
2776
|
color: "color"
|
|
2771
2777
|
},
|
|
2772
|
-
formatterRequest: (
|
|
2773
|
-
formatterDictList: (
|
|
2774
|
-
formatterDictVersion: (
|
|
2778
|
+
formatterRequest: (r, b) => b ? { [r]: b } : { [r]: "" },
|
|
2779
|
+
formatterDictList: (r, b) => !r || !r.dictData ? {} : r.dictData,
|
|
2780
|
+
formatterDictVersion: (r) => !r || !r.version ? "unknow" : r.version,
|
|
2775
2781
|
version: "unknow",
|
|
2776
2782
|
storage: localStorage,
|
|
2777
2783
|
isGetAll: !1,
|
|
@@ -2788,16 +2794,20 @@ let Sn = {
|
|
|
2788
2794
|
n.treeSetting
|
|
2789
2795
|
);
|
|
2790
2796
|
const t = Object.assign(g, n);
|
|
2791
|
-
|
|
2792
|
-
const
|
|
2797
|
+
o.mutations.SET_DICT_SETTING(t);
|
|
2798
|
+
const s = JSON.parse(t.storage.getItem(t.dictDataKey)) || {};
|
|
2793
2799
|
let l = JSON.parse(JSON.stringify(t.localDictCodes));
|
|
2794
|
-
l = Object.assign(
|
|
2795
|
-
const c = t.
|
|
2796
|
-
t.
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2800
|
+
l = Object.assign(s, l);
|
|
2801
|
+
const c = ce(l, t.filterDataFun, t.disabledDataFun, (d = t == null ? void 0 : t.format) == null ? void 0 : d.disabled);
|
|
2802
|
+
t.storage.setItem(t.dictDataKey, JSON.stringify(c)), o.mutations.SET_DICT_CODES(c);
|
|
2803
|
+
const a = t.storage.getItem(t.versionKey);
|
|
2804
|
+
if (t.version !== a) {
|
|
2805
|
+
t.storage.removeItem(t.dictDataKey), t.storage.setItem(t.versionKey, t.version);
|
|
2806
|
+
const r = JSON.parse(JSON.stringify(t.localDictCodes)), b = ce(r, t.filterDataFun, t.disabledDataFun, (i = t == null ? void 0 : t.format) == null ? void 0 : i.disabled);
|
|
2807
|
+
t.storage.setItem(t.dictDataKey, JSON.stringify(b)), o.mutations.SET_DICT_CODES(b);
|
|
2808
|
+
}
|
|
2809
|
+
(t.isGetAll || t.usuallyGetDictTypes) && xt(t), Ke.forEach((r) => {
|
|
2810
|
+
e.component(r.name, r);
|
|
2801
2811
|
});
|
|
2802
2812
|
}
|
|
2803
2813
|
};
|
|
@@ -2817,13 +2827,13 @@ export {
|
|
|
2817
2827
|
Xt as getLabelByCodeFilter,
|
|
2818
2828
|
Kt as getLabelByCodes,
|
|
2819
2829
|
Zt as getLabelByCodesFilter,
|
|
2820
|
-
|
|
2830
|
+
mn as getTreeCodeByLabel,
|
|
2821
2831
|
Tn as getTreeCodeByLabelFilter,
|
|
2822
2832
|
yn as getTreeCodeByLabels,
|
|
2823
2833
|
vn as getTreeCodeByLabelsFilter,
|
|
2824
2834
|
fn as getTreeItemByCode,
|
|
2825
2835
|
gn as getTreeItemByLabel,
|
|
2826
|
-
|
|
2836
|
+
bn as getTreeLabelByCode,
|
|
2827
2837
|
Dn as getTreeLabelByCodeFilter,
|
|
2828
2838
|
pn as getTreeLabelByCodes,
|
|
2829
2839
|
_n as getTreeLabelByCodesFilter,
|