vue3-element-dict 2.1.0 → 2.1.2
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 +25 -7
- package/lib/vue3-element-dict.js +1420 -1397
- package/lib/vue3-element-dict.umd.cjs +1 -1
- package/package.json +1 -1
package/lib/vue3-element-dict.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
const dt = (t,
|
|
3
|
-
const
|
|
4
|
-
for (let
|
|
5
|
-
|
|
6
|
-
...
|
|
7
|
-
[e]: f(
|
|
1
|
+
import { reactive as lt, defineComponent as Q, toRefs as kt, toRaw as et, computed as E, ref as B, watchEffect as Bt, resolveComponent as J, openBlock as L, createBlock as x, mergeProps as rt, unref as h, createSlots as X, withCtx as k, createTextVNode as W, toDisplayString as H, renderList as M, renderSlot as Y, normalizeProps as Z, guardReactiveProps as tt, useAttrs as yt, watch as ot, createElementBlock as at, Fragment as it, createVNode as Qt } from "vue";
|
|
2
|
+
const dt = (t, n, f, e) => {
|
|
3
|
+
const r = {};
|
|
4
|
+
for (let a in t)
|
|
5
|
+
r[a] = n(t[a]).map((l) => ({
|
|
6
|
+
...l,
|
|
7
|
+
[e]: f(l) || !!l[e]
|
|
8
8
|
}));
|
|
9
|
-
return
|
|
10
|
-
}, w =
|
|
9
|
+
return r;
|
|
10
|
+
}, w = lt({
|
|
11
11
|
dictConfig: {
|
|
12
|
-
|
|
12
|
+
getLoginStatusFunc: () => !0,
|
|
13
|
+
loginStatusChangeFunc: null,
|
|
14
|
+
getDictCodeApi: new Promise((t, n) => {
|
|
13
15
|
t({});
|
|
14
16
|
}),
|
|
15
17
|
//组件过滤数据 配置
|
|
@@ -49,8 +51,8 @@ const dt = (t, a, f, e) => {
|
|
|
49
51
|
type: "type",
|
|
50
52
|
color: "color"
|
|
51
53
|
},
|
|
52
|
-
formatterRequest: (t,
|
|
53
|
-
formatterDictList: (t,
|
|
54
|
+
formatterRequest: (t, n) => n ? { [t]: n } : { [t]: "" },
|
|
55
|
+
formatterDictList: (t, n) => t.dictCodeList,
|
|
54
56
|
formatterDictVersion: (t) => t.version,
|
|
55
57
|
storage: localStorage,
|
|
56
58
|
usuallyGetDictTypes: "",
|
|
@@ -84,8 +86,8 @@ const dt = (t, a, f, e) => {
|
|
|
84
86
|
},
|
|
85
87
|
//去除正在请求的字典类型字段
|
|
86
88
|
REMOVE_IS_GETTING_DICT_TYPES(t) {
|
|
87
|
-
const
|
|
88
|
-
(e) => !new Set(
|
|
89
|
+
const n = t.split(","), f = [...new Set(w.isGettingDictTypes)].filter(
|
|
90
|
+
(e) => !new Set(n).has(e)
|
|
89
91
|
);
|
|
90
92
|
w.isGettingDictTypes = Array.from(f);
|
|
91
93
|
},
|
|
@@ -100,380 +102,386 @@ const dt = (t, a, f, e) => {
|
|
|
100
102
|
},
|
|
101
103
|
//去除找不到的字典类型字段
|
|
102
104
|
REMOVE_UNFIND_DICT_TYPES(t) {
|
|
103
|
-
const
|
|
104
|
-
(e) => !new Set(
|
|
105
|
+
const n = t.split(","), f = [...new Set(w.unfindDictTypes)].filter(
|
|
106
|
+
(e) => !new Set(n).has(e)
|
|
105
107
|
);
|
|
106
108
|
w.unfindDictTypes = Array.from(f);
|
|
107
109
|
}
|
|
108
|
-
},
|
|
110
|
+
}, Xt = {
|
|
109
111
|
getDictDataObj(t) {
|
|
110
|
-
return new Promise((
|
|
112
|
+
return new Promise((n, f) => {
|
|
111
113
|
if (!t)
|
|
112
114
|
return;
|
|
113
115
|
const {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
116
|
+
getLoginStatusFunc: e,
|
|
117
|
+
storage: r,
|
|
118
|
+
dictDataKey: a,
|
|
119
|
+
getDictCodeApi: l,
|
|
120
|
+
usuallyGetDictTypes: s,
|
|
121
|
+
formatterRequest: c,
|
|
122
|
+
query: i,
|
|
123
|
+
versionKey: d,
|
|
124
|
+
localDictCodes: m,
|
|
125
|
+
formatterDictList: p,
|
|
126
|
+
formatterDictVersion: _,
|
|
127
|
+
isGetAll: j,
|
|
128
|
+
filterDataFun: I,
|
|
129
|
+
disabledDataFun: C,
|
|
130
|
+
format: F
|
|
131
|
+
} = w.dictConfig;
|
|
132
|
+
if (!e()) {
|
|
133
|
+
f("请先登录");
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const $ = w.dictCodes || m;
|
|
137
|
+
if (!$[t] || $[t].length === 0) {
|
|
130
138
|
if (w.isGettingDictTypes.includes(t) || w.isGettingAllDictTypes)
|
|
131
139
|
return;
|
|
132
140
|
if (U.ADD_IS_GETTING_DICT_TYPES(t), w.unfindDictTypes.includes(t)) {
|
|
133
141
|
f(`不存在类型为:${t} 的字典字段,请确认后再填写`);
|
|
134
142
|
return;
|
|
135
143
|
}
|
|
136
|
-
U.ADD_UNFIND_DICT_TYPES(t),
|
|
144
|
+
U.ADD_UNFIND_DICT_TYPES(t), l(c(i, t)).then((O) => {
|
|
137
145
|
U.REMOVE_IS_GETTING_DICT_TYPES(t);
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
let
|
|
141
|
-
if (
|
|
142
|
-
|
|
146
|
+
const v = _(O), g = r.getItem(d);
|
|
147
|
+
if (v !== g) {
|
|
148
|
+
let b = "";
|
|
149
|
+
if (j)
|
|
150
|
+
b = "", U.SETTING_ISGETTING_ALL_DICT_TYPES(!0);
|
|
143
151
|
else {
|
|
144
|
-
if (
|
|
145
|
-
const
|
|
146
|
-
|
|
152
|
+
if (s) {
|
|
153
|
+
const u = Object.keys($), y = s.split(","), D = Object.keys(m), T = y.filter((V) => D.includes(V) ? (console.warn(`注意:usuallyGetDictTypes配置与本地字典配置的字典类型${V}冲突`), !1) : !0), S = u.concat(T);
|
|
154
|
+
S.push(t), b = Array.from(new Set(S)).join(",");
|
|
147
155
|
} else {
|
|
148
|
-
const
|
|
149
|
-
|
|
156
|
+
const u = Object.keys($);
|
|
157
|
+
u.push(t), b = Array.from(new Set(u)).join(",");
|
|
150
158
|
}
|
|
151
|
-
U.ADD_IS_GETTING_DICT_TYPES(
|
|
159
|
+
U.ADD_IS_GETTING_DICT_TYPES(b);
|
|
152
160
|
}
|
|
153
|
-
|
|
154
|
-
(
|
|
155
|
-
const
|
|
156
|
-
|
|
161
|
+
l(c(i, b)).then(
|
|
162
|
+
(u) => {
|
|
163
|
+
const y = p(
|
|
164
|
+
u,
|
|
157
165
|
t
|
|
158
166
|
);
|
|
159
|
-
if (!(
|
|
167
|
+
if (!(y[t] && y[t].length > 0)) {
|
|
160
168
|
f(
|
|
161
169
|
`不存在类型为:${t} 的字典字段,请确认后再填写`
|
|
162
170
|
);
|
|
163
171
|
return;
|
|
164
172
|
}
|
|
165
173
|
U.REMOVE_UNFIND_DICT_TYPES(t);
|
|
166
|
-
const
|
|
167
|
-
JSON.parse(JSON.stringify(
|
|
168
|
-
|
|
169
|
-
),
|
|
170
|
-
|
|
174
|
+
const D = _(u), T = Object.assign(
|
|
175
|
+
JSON.parse(JSON.stringify(m)),
|
|
176
|
+
y
|
|
177
|
+
), S = dt(T, I, C, F == null ? void 0 : F.disabled);
|
|
178
|
+
r.setItem(a, JSON.stringify(S)), r.setItem(d, D), U.SET_DICT_CODES(S), n(w.dictCodes), w.isGettingAllDictTypes ? U.SETTING_ISGETTING_ALL_DICT_TYPES(!1) : U.REMOVE_IS_GETTING_DICT_TYPES(b);
|
|
171
179
|
}
|
|
172
180
|
);
|
|
173
181
|
} else {
|
|
174
|
-
const
|
|
175
|
-
|
|
182
|
+
const b = p(
|
|
183
|
+
O,
|
|
176
184
|
t
|
|
177
185
|
);
|
|
178
|
-
if (!(
|
|
186
|
+
if (!(b[t] && b[t].length > 0)) {
|
|
179
187
|
f(`不存在类型为:${t} 的字典字段,请确认后再填写`);
|
|
180
188
|
return;
|
|
181
189
|
}
|
|
182
190
|
U.REMOVE_UNFIND_DICT_TYPES(t);
|
|
183
|
-
const
|
|
184
|
-
Object.assign(
|
|
191
|
+
const u = w.dictCodes || m, y = dt(b, I, C, F == null ? void 0 : F.disabled);
|
|
192
|
+
Object.assign(u, y), r.setItem(a, JSON.stringify(u)), U.SET_DICT_CODES(u), n(w.dictCodes);
|
|
185
193
|
}
|
|
186
194
|
});
|
|
187
195
|
} else
|
|
188
|
-
U.REMOVE_UNFIND_DICT_TYPES(t), U.SET_DICT_CODES(
|
|
196
|
+
U.REMOVE_UNFIND_DICT_TYPES(t), U.SET_DICT_CODES($), n(w.dictCodes);
|
|
189
197
|
});
|
|
190
198
|
}
|
|
191
|
-
},
|
|
199
|
+
}, o = {
|
|
192
200
|
state: w,
|
|
193
201
|
mutations: U,
|
|
194
|
-
actions:
|
|
195
|
-
},
|
|
196
|
-
const { format:
|
|
197
|
-
let
|
|
198
|
-
if (!
|
|
199
|
-
if (
|
|
200
|
-
const
|
|
201
|
-
if (!(
|
|
202
|
-
if (clearInterval(
|
|
203
|
-
|
|
202
|
+
actions: Xt
|
|
203
|
+
}, Zt = (t, n, f) => new Promise((e, r) => {
|
|
204
|
+
const { format: a } = o.state.dictConfig, l = o.state.dictCodes;
|
|
205
|
+
let s = [];
|
|
206
|
+
if (!l || !l[n])
|
|
207
|
+
if (o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes) {
|
|
208
|
+
const c = setInterval(() => {
|
|
209
|
+
if (!(o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes)) {
|
|
210
|
+
if (clearInterval(c), s = o.state.dictCodes[n], !s) {
|
|
211
|
+
r(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
204
212
|
return;
|
|
205
213
|
}
|
|
206
|
-
const
|
|
207
|
-
e(
|
|
214
|
+
const i = s.find((d) => d[a.value] === t);
|
|
215
|
+
e(i ? i[a.label] : f ?? "");
|
|
208
216
|
}
|
|
209
217
|
}, 1e3);
|
|
210
218
|
} else
|
|
211
|
-
|
|
212
|
-
if (
|
|
213
|
-
|
|
219
|
+
o.actions.getDictDataObj(n).then((c) => {
|
|
220
|
+
if (s = c[n], !s) {
|
|
221
|
+
r(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
214
222
|
return;
|
|
215
223
|
}
|
|
216
|
-
const
|
|
217
|
-
e(
|
|
224
|
+
const i = s.find((d) => d[a.value] === t);
|
|
225
|
+
e(i ? i[a.label] : f ?? "");
|
|
218
226
|
});
|
|
219
227
|
else {
|
|
220
|
-
|
|
221
|
-
const
|
|
222
|
-
e(
|
|
228
|
+
s = l[n];
|
|
229
|
+
const c = s.find((i) => i[a.value] === t);
|
|
230
|
+
e(c ? c[a.label] : f ?? "");
|
|
223
231
|
}
|
|
224
232
|
});
|
|
225
|
-
function gt(t,
|
|
226
|
-
const
|
|
227
|
-
for (let
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
[f.label]: e || t[
|
|
231
|
-
[f.value]: t[
|
|
233
|
+
function gt(t, n, f, e, r = "--") {
|
|
234
|
+
const a = [];
|
|
235
|
+
for (let l = 0; l < t.length; l++) {
|
|
236
|
+
const s = n.find((c) => c[f.value] === t[l]);
|
|
237
|
+
s ? a.push(s) : a.push({
|
|
238
|
+
[f.label]: e || t[l] || r,
|
|
239
|
+
[f.value]: t[l]
|
|
232
240
|
});
|
|
233
241
|
}
|
|
234
|
-
return
|
|
242
|
+
return a;
|
|
235
243
|
}
|
|
236
|
-
const
|
|
244
|
+
const te = (t, n, f) => {
|
|
237
245
|
const e = {
|
|
238
246
|
defaultVal: "",
|
|
239
247
|
emptyText: "--",
|
|
240
|
-
formatFun: (
|
|
248
|
+
formatFun: (r, a) => r.map((l) => l[a.label]).join(","),
|
|
241
249
|
spacer: ","
|
|
242
250
|
};
|
|
243
|
-
return Object.assign(e, f), new Promise((
|
|
251
|
+
return Object.assign(e, f), new Promise((r, a) => {
|
|
252
|
+
let l = [];
|
|
253
|
+
Array.isArray(t) ? l = t : typeof t == "string" && (l = t.split(e.spacer));
|
|
254
|
+
const { format: s } = o.state.dictConfig, c = o.state.dictCodes;
|
|
244
255
|
let i = [];
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
if (!(c.state.isGettingDictTypes.includes(a) || c.state.isGettingAllDictTypes)) {
|
|
252
|
-
if (clearInterval(o), r = c.state.dictCodes[a], !r) {
|
|
253
|
-
n(`不存在类型为:${a} 的字典字段,请确认后再填写`);
|
|
256
|
+
if (!c || !c[n])
|
|
257
|
+
if (o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes) {
|
|
258
|
+
const d = setInterval(() => {
|
|
259
|
+
if (!(o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes)) {
|
|
260
|
+
if (clearInterval(d), i = o.state.dictCodes[n], !i) {
|
|
261
|
+
a(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
254
262
|
return;
|
|
255
263
|
}
|
|
256
|
-
const
|
|
257
|
-
i,
|
|
258
|
-
r,
|
|
264
|
+
const m = gt(
|
|
259
265
|
l,
|
|
266
|
+
i,
|
|
267
|
+
s,
|
|
260
268
|
e.defaultVal,
|
|
261
269
|
e.emptyText
|
|
262
270
|
);
|
|
263
|
-
|
|
264
|
-
|
|
271
|
+
r(
|
|
272
|
+
m && m.length > 0 ? e.formatFun(m, s) : e.defaultVal
|
|
265
273
|
);
|
|
266
274
|
}
|
|
267
275
|
}, 1e3);
|
|
268
276
|
} else
|
|
269
|
-
|
|
270
|
-
if (
|
|
271
|
-
|
|
277
|
+
o.actions.getDictDataObj(n).then((d) => {
|
|
278
|
+
if (i = d[n], !i) {
|
|
279
|
+
a(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
272
280
|
return;
|
|
273
281
|
}
|
|
274
|
-
const
|
|
275
|
-
i,
|
|
276
|
-
r,
|
|
282
|
+
const m = gt(
|
|
277
283
|
l,
|
|
284
|
+
i,
|
|
285
|
+
s,
|
|
278
286
|
e.defaultVal,
|
|
279
287
|
e.emptyText
|
|
280
288
|
);
|
|
281
|
-
|
|
282
|
-
|
|
289
|
+
r(
|
|
290
|
+
m && m.length > 0 ? e.formatFun(m, s) : e.defaultVal
|
|
283
291
|
);
|
|
284
292
|
});
|
|
285
293
|
else {
|
|
286
|
-
|
|
287
|
-
const
|
|
288
|
-
i,
|
|
289
|
-
r,
|
|
294
|
+
i = c[n];
|
|
295
|
+
const d = gt(
|
|
290
296
|
l,
|
|
297
|
+
i,
|
|
298
|
+
s,
|
|
291
299
|
e.defaultVal,
|
|
292
300
|
e.emptyText
|
|
293
301
|
);
|
|
294
|
-
|
|
295
|
-
|
|
302
|
+
r(
|
|
303
|
+
d && d.length > 0 ? e.formatFun(d, s) : e.defaultVal
|
|
296
304
|
);
|
|
297
305
|
}
|
|
298
306
|
});
|
|
299
|
-
},
|
|
300
|
-
const { format:
|
|
301
|
-
let
|
|
302
|
-
if (!
|
|
303
|
-
if (
|
|
304
|
-
const
|
|
305
|
-
if (!(
|
|
306
|
-
if (clearInterval(
|
|
307
|
-
|
|
307
|
+
}, ee = (t, n, f) => new Promise((e, r) => {
|
|
308
|
+
const { format: a } = o.state.dictConfig, l = o.state.dictCodes;
|
|
309
|
+
let s = [];
|
|
310
|
+
if (!l || !l[n])
|
|
311
|
+
if (o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes) {
|
|
312
|
+
const c = setInterval(() => {
|
|
313
|
+
if (!(o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes)) {
|
|
314
|
+
if (clearInterval(c), s = o.state.dictCodes[n], !s) {
|
|
315
|
+
r(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
308
316
|
return;
|
|
309
317
|
}
|
|
310
|
-
const
|
|
311
|
-
e(
|
|
318
|
+
const i = s.find((d) => d[a.label] === t);
|
|
319
|
+
e(i ? i[a.value] : f ?? "");
|
|
312
320
|
}
|
|
313
321
|
}, 1e3);
|
|
314
322
|
} else
|
|
315
|
-
|
|
316
|
-
if (
|
|
317
|
-
|
|
323
|
+
o.actions.getDictDataObj(n).then((c) => {
|
|
324
|
+
if (s = c[n], !s) {
|
|
325
|
+
r(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
318
326
|
return;
|
|
319
327
|
}
|
|
320
|
-
const
|
|
321
|
-
e(
|
|
328
|
+
const i = s.find((d) => d[a.label] === t);
|
|
329
|
+
e(i ? i[a.value] : f ?? "");
|
|
322
330
|
});
|
|
323
331
|
else {
|
|
324
|
-
|
|
325
|
-
const
|
|
326
|
-
e(
|
|
332
|
+
s = l[n];
|
|
333
|
+
const c = s.find((i) => i[a.label] === t);
|
|
334
|
+
e(c ? c[a.value] : f ?? "");
|
|
327
335
|
}
|
|
328
336
|
});
|
|
329
|
-
function bt(t,
|
|
330
|
-
const
|
|
331
|
-
for (let
|
|
332
|
-
const
|
|
333
|
-
|
|
334
|
-
[f.label]: t[
|
|
337
|
+
function bt(t, n, f, e) {
|
|
338
|
+
const r = [];
|
|
339
|
+
for (let a = 0; a < t.length; a++) {
|
|
340
|
+
const l = n.find((s) => s[f.label] === t[a]);
|
|
341
|
+
l ? r.push(l) : r.push({
|
|
342
|
+
[f.label]: t[a],
|
|
335
343
|
[f.value]: e
|
|
336
344
|
});
|
|
337
345
|
}
|
|
338
|
-
return
|
|
346
|
+
return r;
|
|
339
347
|
}
|
|
340
|
-
const
|
|
348
|
+
const ne = (t, n, f) => {
|
|
341
349
|
const e = {
|
|
342
350
|
defaultVal: "",
|
|
343
|
-
formatFun: (
|
|
351
|
+
formatFun: (r, a) => r.map((l) => l[a.value]).join(","),
|
|
344
352
|
spacer: ","
|
|
345
353
|
};
|
|
346
|
-
return Object.assign(e, f), new Promise((
|
|
354
|
+
return Object.assign(e, f), new Promise((r, a) => {
|
|
355
|
+
let l = [];
|
|
356
|
+
Array.isArray(t) ? l = t : typeof t == "string" && (l = t.split(e.spacer));
|
|
357
|
+
const { format: s } = o.state.dictConfig, c = o.state.dictCodes;
|
|
347
358
|
let i = [];
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
if (!(c.state.isGettingDictTypes.includes(a) || c.state.isGettingAllDictTypes)) {
|
|
355
|
-
if (clearInterval(o), r = c.state.dictCodes[a], !r) {
|
|
356
|
-
n(`不存在类型为:${a} 的字典字段,请确认后再填写`);
|
|
359
|
+
if (!c || !c[n])
|
|
360
|
+
if (o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes) {
|
|
361
|
+
const d = setInterval(() => {
|
|
362
|
+
if (!(o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes)) {
|
|
363
|
+
if (clearInterval(d), i = o.state.dictCodes[n], !i) {
|
|
364
|
+
a(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
357
365
|
return;
|
|
358
366
|
}
|
|
359
|
-
const
|
|
360
|
-
i,
|
|
361
|
-
r,
|
|
367
|
+
const m = bt(
|
|
362
368
|
l,
|
|
369
|
+
i,
|
|
370
|
+
s,
|
|
363
371
|
e.defaultVal
|
|
364
372
|
);
|
|
365
|
-
|
|
366
|
-
|
|
373
|
+
r(
|
|
374
|
+
m && m.length > 0 ? e.formatFun(m, s) : e.defaultVal
|
|
367
375
|
);
|
|
368
376
|
}
|
|
369
377
|
}, 1e3);
|
|
370
378
|
} else
|
|
371
|
-
|
|
372
|
-
if (
|
|
373
|
-
|
|
379
|
+
o.actions.getDictDataObj(n).then((d) => {
|
|
380
|
+
if (i = d[n], !i) {
|
|
381
|
+
a(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
374
382
|
return;
|
|
375
383
|
}
|
|
376
|
-
const
|
|
377
|
-
i,
|
|
378
|
-
r,
|
|
384
|
+
const m = bt(
|
|
379
385
|
l,
|
|
386
|
+
i,
|
|
387
|
+
s,
|
|
380
388
|
e.defaultVal
|
|
381
389
|
);
|
|
382
|
-
|
|
383
|
-
|
|
390
|
+
r(
|
|
391
|
+
m && m.length > 0 ? e.formatFun(m, s) : e.defaultVal
|
|
384
392
|
);
|
|
385
393
|
});
|
|
386
394
|
else {
|
|
387
|
-
|
|
388
|
-
const
|
|
389
|
-
i,
|
|
390
|
-
r,
|
|
395
|
+
i = c[n];
|
|
396
|
+
const d = bt(
|
|
391
397
|
l,
|
|
398
|
+
i,
|
|
399
|
+
s,
|
|
392
400
|
e.defaultVal
|
|
393
401
|
);
|
|
394
|
-
|
|
395
|
-
|
|
402
|
+
r(
|
|
403
|
+
d && d.length > 0 ? e.formatFun(d, s) : e.defaultVal
|
|
396
404
|
);
|
|
397
405
|
}
|
|
398
406
|
});
|
|
399
|
-
},
|
|
400
|
-
let e = [],
|
|
401
|
-
Array.isArray(t) ? (
|
|
402
|
-
const
|
|
403
|
-
if (!
|
|
404
|
-
return
|
|
405
|
-
var
|
|
406
|
-
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
JSON.stringify(
|
|
411
|
-
),
|
|
407
|
+
}, ae = (t) => new Promise((n, f) => {
|
|
408
|
+
let e = [], r = "";
|
|
409
|
+
Array.isArray(t) ? (r = t.join(","), e = t) : typeof t == "string" && (r = t, e = t.split(","));
|
|
410
|
+
const a = o.state.dictCodes, l = o.state.dictConfig;
|
|
411
|
+
if (!a || JSON.stringify(a) === "{}")
|
|
412
|
+
return o.mutations.ADD_IS_GETTING_DICT_TYPES(r), l.getDictCodeApi(l.formatterRequest(l.query, r)).then((s) => {
|
|
413
|
+
var p;
|
|
414
|
+
o.mutations.REMOVE_IS_GETTING_DICT_TYPES(r);
|
|
415
|
+
const c = l.formatterDictList(s, t), i = dt(c, l.filterDataFun, l.disabledDataFun, (p = l == null ? void 0 : l.format) == null ? void 0 : p.disabled), d = JSON.parse(JSON.stringify(i)), m = Object.assign(o.state.dictCodes, d);
|
|
416
|
+
l.storage.setItem(
|
|
417
|
+
l.dictDataKey,
|
|
418
|
+
JSON.stringify(m)
|
|
419
|
+
), o.mutations.SET_DICT_CODES(m), n(i);
|
|
412
420
|
});
|
|
413
421
|
{
|
|
414
|
-
const
|
|
415
|
-
for (let
|
|
416
|
-
if (
|
|
417
|
-
|
|
422
|
+
const s = [], c = {};
|
|
423
|
+
for (let i = 0; i < e.length; i++) {
|
|
424
|
+
if (a[e[i]]) {
|
|
425
|
+
c[e[i]] = a[e[i]];
|
|
418
426
|
continue;
|
|
419
427
|
}
|
|
420
|
-
|
|
428
|
+
s.push(e[i]);
|
|
421
429
|
}
|
|
422
|
-
if (
|
|
423
|
-
return
|
|
424
|
-
|
|
425
|
-
).then((
|
|
430
|
+
if (s.length > 0)
|
|
431
|
+
return o.mutations.ADD_IS_GETTING_DICT_TYPES(s.join(",")), l.getDictCodeApi(
|
|
432
|
+
l.formatterRequest(l.query, s.join(","))
|
|
433
|
+
).then((i) => {
|
|
426
434
|
var C;
|
|
427
|
-
|
|
428
|
-
const
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
JSON.stringify(
|
|
432
|
-
),
|
|
433
|
-
const j = Object.assign(
|
|
435
|
+
o.mutations.REMOVE_IS_GETTING_DICT_TYPES(s.join(","));
|
|
436
|
+
const d = l.formatterDictList(i, t), m = dt(d, l.filterDataFun, l.disabledDataFun, (C = l == null ? void 0 : l.format) == null ? void 0 : C.disabled), p = JSON.parse(JSON.stringify(m)), _ = Object.assign(o.state.dictCodes, p);
|
|
437
|
+
l.storage.setItem(
|
|
438
|
+
l.dictDataKey,
|
|
439
|
+
JSON.stringify(_)
|
|
440
|
+
), o.mutations.SET_DICT_CODES(_);
|
|
441
|
+
const j = Object.assign(c, d), I = [];
|
|
434
442
|
for (const F in j)
|
|
435
443
|
(!j[F] || j[F].length === 0) && I.push(F);
|
|
436
444
|
I.length > 0 && f(
|
|
437
445
|
`不存在类型为:${I.join(
|
|
438
446
|
"、"
|
|
439
447
|
)} 的字典字段,请确认后再填写`
|
|
440
|
-
),
|
|
448
|
+
), n(m);
|
|
441
449
|
});
|
|
442
|
-
|
|
450
|
+
n(c);
|
|
443
451
|
}
|
|
444
|
-
}), Dt = (t,
|
|
445
|
-
const { format:
|
|
446
|
-
let
|
|
447
|
-
if (!
|
|
448
|
-
if (
|
|
449
|
-
const
|
|
450
|
-
if (!(
|
|
451
|
-
if (clearInterval(
|
|
452
|
-
|
|
452
|
+
}), Dt = (t, n, f) => new Promise((e, r) => {
|
|
453
|
+
const { format: a } = o.state.dictConfig, l = o.state.dictCodes;
|
|
454
|
+
let s = [];
|
|
455
|
+
if (!l || !l[n])
|
|
456
|
+
if (o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes) {
|
|
457
|
+
const c = setInterval(() => {
|
|
458
|
+
if (!(o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes)) {
|
|
459
|
+
if (clearInterval(c), s = o.state.dictCodes[n], !s) {
|
|
460
|
+
r(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
453
461
|
return;
|
|
454
462
|
}
|
|
455
|
-
const
|
|
456
|
-
e(
|
|
463
|
+
const i = s.find((d) => d[a.value] === t);
|
|
464
|
+
e(i || (f ?? ""));
|
|
457
465
|
}
|
|
458
466
|
}, 1e3);
|
|
459
467
|
} else
|
|
460
|
-
|
|
461
|
-
if (
|
|
462
|
-
|
|
468
|
+
o.actions.getDictDataObj(n).then((c) => {
|
|
469
|
+
if (s = c[n], !s) {
|
|
470
|
+
r(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
463
471
|
return;
|
|
464
472
|
}
|
|
465
|
-
const
|
|
466
|
-
e(
|
|
473
|
+
const i = s.find((d) => d[a.value] === t);
|
|
474
|
+
e(i || (f ?? ""));
|
|
467
475
|
});
|
|
468
476
|
else {
|
|
469
|
-
|
|
470
|
-
const
|
|
471
|
-
e(
|
|
477
|
+
s = l[n];
|
|
478
|
+
const c = s.find((i) => i[a.value] === t);
|
|
479
|
+
e(c || (f ?? ""));
|
|
472
480
|
}
|
|
473
|
-
}),
|
|
481
|
+
}), ie = {
|
|
474
482
|
name: "ElButtonDict"
|
|
475
483
|
}, _t = /* @__PURE__ */ Q({
|
|
476
|
-
...
|
|
484
|
+
...ie,
|
|
477
485
|
props: {
|
|
478
486
|
value: {
|
|
479
487
|
type: [String, Number],
|
|
@@ -505,33 +513,33 @@ const te = (t, a, f) => {
|
|
|
505
513
|
type: Boolean
|
|
506
514
|
}
|
|
507
515
|
},
|
|
508
|
-
setup(t, { expose:
|
|
509
|
-
const f = t, { value: e, dictType:
|
|
510
|
-
let I =
|
|
511
|
-
|
|
512
|
-
Dt(e.value,
|
|
513
|
-
I.value = O, C.value = O[
|
|
516
|
+
setup(t, { expose: n }) {
|
|
517
|
+
const f = t, { value: e, dictType: r, judgeTypeFun: a, type: l, judgeColorFun: s, color: c, judgeDisabledFun: i, disabled: d } = kt(f), m = et(o.state.dictConfig), p = E(() => a != null && a.value ? a.value(e.value) : l.value ? l.value : I.value && I.value[m.format.type] ? I.value[m.format.type] : "primary"), _ = E(() => s != null && s.value ? s.value(e.value) : c != null && c.value ? c.value : I.value && I.value[m.format.color] ? I.value[m.format.color] : ""), j = E(() => I.value && I.value[m.format.disabled] ? I.value[m.format.disabled] : i != null && i.value ? i.value(e.value) : !!d.value);
|
|
518
|
+
let I = B(null), C = B(null);
|
|
519
|
+
Bt(() => {
|
|
520
|
+
Dt(e.value, r.value).then((O) => {
|
|
521
|
+
I.value = O, C.value = O[m.format.label];
|
|
514
522
|
});
|
|
515
523
|
});
|
|
516
|
-
const F =
|
|
517
|
-
return
|
|
524
|
+
const F = B(null);
|
|
525
|
+
return n({ getRef: () => F.value }), (O, v) => {
|
|
518
526
|
const g = J("el-button");
|
|
519
|
-
return
|
|
527
|
+
return L(), x(g, rt({
|
|
520
528
|
ref_key: "ElButtonDict",
|
|
521
529
|
ref: F,
|
|
522
|
-
type: h(
|
|
523
|
-
color: h(
|
|
530
|
+
type: h(p),
|
|
531
|
+
color: h(_),
|
|
524
532
|
disabled: h(j)
|
|
525
533
|
}, O.$attrs), X({
|
|
526
|
-
default:
|
|
527
|
-
H(
|
|
534
|
+
default: k(() => [
|
|
535
|
+
W(H(h(C)), 1)
|
|
528
536
|
]),
|
|
529
537
|
_: 2
|
|
530
538
|
}, [
|
|
531
|
-
M(O.$slots, (
|
|
539
|
+
M(O.$slots, (b, u, y) => ({
|
|
532
540
|
name: u,
|
|
533
|
-
fn:
|
|
534
|
-
Y(O.$slots, u, Z(tt(
|
|
541
|
+
fn: k((D) => [
|
|
542
|
+
Y(O.$slots, u, Z(tt(D)))
|
|
535
543
|
])
|
|
536
544
|
}))
|
|
537
545
|
]), 1040, ["type", "color", "disabled"]);
|
|
@@ -541,10 +549,10 @@ const te = (t, a, f) => {
|
|
|
541
549
|
_t.install = function(t) {
|
|
542
550
|
t.component(_t.name, _t);
|
|
543
551
|
};
|
|
544
|
-
const
|
|
552
|
+
const le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
545
553
|
__proto__: null,
|
|
546
554
|
default: _t
|
|
547
|
-
}, Symbol.toStringTag, { value: "Module" })), Tt = (t,
|
|
555
|
+
}, Symbol.toStringTag, { value: "Module" })), Tt = (t, n, f) => {
|
|
548
556
|
const e = {
|
|
549
557
|
idField: "id",
|
|
550
558
|
//唯一标识字段名
|
|
@@ -567,19 +575,19 @@ const ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
567
575
|
leafField: "leaf"
|
|
568
576
|
//叶子节点标识字段名
|
|
569
577
|
};
|
|
570
|
-
|
|
578
|
+
n && Object.assign(e, n), f || (f = {
|
|
571
579
|
[e.idField]: e.firstId,
|
|
572
580
|
[e.levelField]: e.level,
|
|
573
581
|
[e.labelArrField]: [],
|
|
574
582
|
[e.idArrField]: []
|
|
575
583
|
});
|
|
576
|
-
for (var
|
|
577
|
-
if (t[
|
|
578
|
-
var
|
|
579
|
-
|
|
584
|
+
for (var r = [], a, l = 0; l < t.length; l++)
|
|
585
|
+
if (t[l][e.parentIdField] === f[e.idField]) {
|
|
586
|
+
var s = t[l];
|
|
587
|
+
s[e.levelField] = f[e.levelField] + 1, s[e.labelArrField] = f[e.labelArrField].concat(s[e.labelField]), s[e.idArrField] = f[e.idArrField].concat(s[e.idField]), a = Tt(t, n, s), a.length > 0 ? (s[e.childrenField] = a, s[e.leafField] = !1) : s[e.leafField] = !0, r.push(s);
|
|
580
588
|
}
|
|
581
|
-
return
|
|
582
|
-
},
|
|
589
|
+
return r;
|
|
590
|
+
}, ct = (t, n, f) => {
|
|
583
591
|
const e = {
|
|
584
592
|
idField: "id",
|
|
585
593
|
//唯一标识字段名
|
|
@@ -587,9 +595,9 @@ const ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
587
595
|
//父节点唯一标识字段名
|
|
588
596
|
};
|
|
589
597
|
Object.assign(e, f);
|
|
590
|
-
const
|
|
591
|
-
return
|
|
592
|
-
}, ut = (t,
|
|
598
|
+
const r = n.find((a) => a[e.idField] === t);
|
|
599
|
+
return r ? ct(r[e.parentIdField], n, e).concat([r]) : [];
|
|
600
|
+
}, ut = (t, n, f) => {
|
|
593
601
|
const e = {
|
|
594
602
|
idField: "id",
|
|
595
603
|
labelField: "label",
|
|
@@ -598,12 +606,12 @@ const ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
598
606
|
//父节点唯一标识字段名
|
|
599
607
|
};
|
|
600
608
|
Object.assign(e, f);
|
|
601
|
-
const
|
|
602
|
-
return
|
|
603
|
-
},
|
|
609
|
+
const r = n.find((a) => a[e.labelField] === t);
|
|
610
|
+
return ct(r[e.idField], n, e);
|
|
611
|
+
}, re = {
|
|
604
612
|
name: "ElCascaderDict"
|
|
605
|
-
},
|
|
606
|
-
...
|
|
613
|
+
}, Ot = /* @__PURE__ */ Q({
|
|
614
|
+
...re,
|
|
607
615
|
props: {
|
|
608
616
|
//最大层级
|
|
609
617
|
maxLevel: {
|
|
@@ -626,108 +634,108 @@ const ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
626
634
|
}
|
|
627
635
|
},
|
|
628
636
|
emits: ["dictChange"],
|
|
629
|
-
setup(t, { expose:
|
|
630
|
-
const { maxLevel: e, dictType:
|
|
637
|
+
setup(t, { expose: n, emit: f }) {
|
|
638
|
+
const { maxLevel: e, dictType: r, disableObj: a, filterDataFun: l, disabledDataFun: s } = t, c = yt(), i = B(""), d = et(o.state.dictConfig), m = (g) => {
|
|
631
639
|
f("dictChange", g);
|
|
632
|
-
},
|
|
640
|
+
}, p = lt({
|
|
633
641
|
list: []
|
|
634
|
-
}),
|
|
642
|
+
}), _ = (g, b) => {
|
|
635
643
|
for (let u = 0; u < g.length; u++) {
|
|
636
644
|
const y = g[u];
|
|
637
|
-
if (y[
|
|
645
|
+
if (y[d.treeSetting.levelField] === b) {
|
|
638
646
|
delete y[F.value.children], y[F.value.leaf] = !0;
|
|
639
647
|
continue;
|
|
640
648
|
} else
|
|
641
|
-
|
|
649
|
+
_(y[F.value.children], b);
|
|
642
650
|
}
|
|
643
651
|
}, j = async () => {
|
|
644
|
-
if (!
|
|
652
|
+
if (!r)
|
|
645
653
|
return;
|
|
646
654
|
let g = [];
|
|
647
|
-
if (typeof
|
|
648
|
-
|
|
649
|
-
const
|
|
650
|
-
g = [].concat(
|
|
655
|
+
if (typeof r == "object") {
|
|
656
|
+
i.value = r.type;
|
|
657
|
+
const b = await o.actions.getDictDataObj(i.value);
|
|
658
|
+
g = [].concat(b[i.value]);
|
|
651
659
|
const {
|
|
652
660
|
filters: u,
|
|
653
|
-
filterType: y =
|
|
654
|
-
reverse:
|
|
655
|
-
} =
|
|
656
|
-
|
|
661
|
+
filterType: y = d.format.value,
|
|
662
|
+
reverse: D = !1
|
|
663
|
+
} = r, T = typeof u == "string" ? u.split(",") : u;
|
|
664
|
+
D ? g = g.filter((S) => !T.includes(S[y])) : g = g.filter((S) => T.includes(S[y]));
|
|
657
665
|
} else {
|
|
658
|
-
|
|
659
|
-
const
|
|
660
|
-
g = [].concat(
|
|
666
|
+
i.value = r;
|
|
667
|
+
const b = await o.actions.getDictDataObj(i.value);
|
|
668
|
+
g = [].concat(b[i.value]);
|
|
661
669
|
}
|
|
662
|
-
if (
|
|
663
|
-
...
|
|
664
|
-
[
|
|
665
|
-
}))),
|
|
670
|
+
if (l && (g = l(g)), s && (g = g.map((b) => ({
|
|
671
|
+
...b,
|
|
672
|
+
[d.format.disabled]: !!b[d.format.disabled] || s(b)
|
|
673
|
+
}))), a) {
|
|
666
674
|
const {
|
|
667
|
-
disableValue:
|
|
668
|
-
disableType: u =
|
|
675
|
+
disableValue: b,
|
|
676
|
+
disableType: u = d.format.value,
|
|
669
677
|
reverse: y = !1
|
|
670
|
-
} =
|
|
671
|
-
y ? g = g.map((
|
|
672
|
-
const
|
|
673
|
-
return
|
|
674
|
-
}) : g = g.map((
|
|
675
|
-
const
|
|
676
|
-
return
|
|
678
|
+
} = a, D = typeof b == "string" ? b.split(",") : b;
|
|
679
|
+
y ? g = g.map((T) => {
|
|
680
|
+
const S = JSON.parse(JSON.stringify(T));
|
|
681
|
+
return S[d.format.disabled] = !D.includes(S[u]) || S[d.format.disabled], S;
|
|
682
|
+
}) : g = g.map((T) => {
|
|
683
|
+
const S = JSON.parse(JSON.stringify(T));
|
|
684
|
+
return S[d.format.disabled] = D.includes(S[u]) || S[d.format.disabled], S;
|
|
677
685
|
});
|
|
678
686
|
}
|
|
679
|
-
|
|
680
|
-
}, I = E(() =>
|
|
681
|
-
const g =
|
|
682
|
-
return g.disabled = g.disabled ??
|
|
683
|
-
}),
|
|
684
|
-
const g =
|
|
685
|
-
idField: g.idField ??
|
|
686
|
-
labelField: g.label ??
|
|
687
|
-
childrenField: g.children ??
|
|
688
|
-
leafField: g.leaf ??
|
|
689
|
-
}, u = Object.assign(
|
|
690
|
-
return e &&
|
|
687
|
+
p.list = g;
|
|
688
|
+
}, I = E(() => o.state.isGettingDictTypes.includes(i.value)), C = E(() => o.state.isGettingAllDictTypes), F = E(() => {
|
|
689
|
+
const g = c.props ?? {};
|
|
690
|
+
return g.disabled = g.disabled ?? d.format.disabled, g.value = g.value ?? d.format.value, g.label = g.label ?? d.treeSetting.labelField, g.children = g.children ?? d.treeSetting.childrenField, g.leaf = g.leaf ?? d.treeSetting.leafField, g;
|
|
691
|
+
}), $ = E(() => {
|
|
692
|
+
const g = c.props ?? {}, b = {
|
|
693
|
+
idField: g.idField ?? d.treeSetting.idField,
|
|
694
|
+
labelField: g.label ?? d.treeSetting.labelField,
|
|
695
|
+
childrenField: g.children ?? d.treeSetting.childrenField,
|
|
696
|
+
leafField: g.leaf ?? d.treeSetting.leafField
|
|
697
|
+
}, u = Object.assign(d.treeSetting, b), y = JSON.parse(JSON.stringify(p.list)), D = Tt(y, u);
|
|
698
|
+
return e && _(D, +e), D;
|
|
691
699
|
});
|
|
692
|
-
|
|
700
|
+
ot(
|
|
693
701
|
[I, C],
|
|
694
|
-
([g,
|
|
695
|
-
!g && !
|
|
702
|
+
([g, b]) => {
|
|
703
|
+
!g && !b && j();
|
|
696
704
|
},
|
|
697
705
|
{
|
|
698
706
|
immediate: !0
|
|
699
707
|
}
|
|
700
708
|
);
|
|
701
|
-
const O =
|
|
702
|
-
return
|
|
709
|
+
const O = B(null);
|
|
710
|
+
return n({ getRef: () => O.value }), (g, b) => {
|
|
703
711
|
const u = J("el-cascader");
|
|
704
|
-
return
|
|
712
|
+
return L(), x(u, {
|
|
705
713
|
ref_key: "ElCascaderDict",
|
|
706
714
|
ref: O,
|
|
707
|
-
options: h(
|
|
715
|
+
options: h($),
|
|
708
716
|
props: h(F),
|
|
709
|
-
onChange:
|
|
717
|
+
onChange: m
|
|
710
718
|
}, X({ _: 2 }, [
|
|
711
|
-
M(g.$slots, (y,
|
|
712
|
-
name:
|
|
713
|
-
fn:
|
|
714
|
-
Y(g.$slots,
|
|
719
|
+
M(g.$slots, (y, D, T) => ({
|
|
720
|
+
name: D,
|
|
721
|
+
fn: k((S) => [
|
|
722
|
+
Y(g.$slots, D, Z(tt(S)))
|
|
715
723
|
])
|
|
716
724
|
}))
|
|
717
725
|
]), 1032, ["options", "props"]);
|
|
718
726
|
};
|
|
719
727
|
}
|
|
720
728
|
});
|
|
721
|
-
|
|
722
|
-
t.component(
|
|
729
|
+
Ot.install = function(t) {
|
|
730
|
+
t.component(Ot.name, Ot);
|
|
723
731
|
};
|
|
724
|
-
const
|
|
732
|
+
const se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
725
733
|
__proto__: null,
|
|
726
|
-
default:
|
|
727
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
734
|
+
default: Ot
|
|
735
|
+
}, Symbol.toStringTag, { value: "Module" })), oe = {
|
|
728
736
|
name: "ElCheckboxButtonDict"
|
|
729
|
-
},
|
|
730
|
-
...
|
|
737
|
+
}, Ft = /* @__PURE__ */ Q({
|
|
738
|
+
...oe,
|
|
731
739
|
props: {
|
|
732
740
|
// 自定义数据
|
|
733
741
|
data: {
|
|
@@ -794,97 +802,97 @@ const le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
794
802
|
}
|
|
795
803
|
},
|
|
796
804
|
emits: ["dictChange"],
|
|
797
|
-
setup(t, { expose:
|
|
805
|
+
setup(t, { expose: n, emit: f }) {
|
|
798
806
|
const {
|
|
799
807
|
data: e,
|
|
800
|
-
format:
|
|
801
|
-
dictType:
|
|
802
|
-
disableObj:
|
|
803
|
-
name:
|
|
804
|
-
checked:
|
|
805
|
-
trueValue:
|
|
806
|
-
falseValue:
|
|
807
|
-
trueLabel:
|
|
808
|
-
falseLabel:
|
|
809
|
-
keyValue:
|
|
808
|
+
format: r,
|
|
809
|
+
dictType: a,
|
|
810
|
+
disableObj: l,
|
|
811
|
+
name: s,
|
|
812
|
+
checked: c,
|
|
813
|
+
trueValue: i,
|
|
814
|
+
falseValue: d,
|
|
815
|
+
trueLabel: m,
|
|
816
|
+
falseLabel: p,
|
|
817
|
+
keyValue: _,
|
|
810
818
|
filterDataFun: j,
|
|
811
819
|
disabledDataFun: I
|
|
812
|
-
} = t, C =
|
|
813
|
-
if (!
|
|
814
|
-
f("dictChange",
|
|
820
|
+
} = t, C = B(""), F = et(o.state.dictConfig), $ = (T) => {
|
|
821
|
+
if (!_) {
|
|
822
|
+
f("dictChange", T);
|
|
815
823
|
return;
|
|
816
824
|
}
|
|
817
|
-
const
|
|
818
|
-
f("dictChange",
|
|
819
|
-
}, O =
|
|
825
|
+
const S = O.list.filter((A) => T.includes(A[F.format.value]));
|
|
826
|
+
f("dictChange", S);
|
|
827
|
+
}, O = lt({
|
|
820
828
|
list: []
|
|
821
|
-
}),
|
|
822
|
-
if (!
|
|
829
|
+
}), v = async () => {
|
|
830
|
+
if (!a || e && e.length > 0)
|
|
823
831
|
return;
|
|
824
|
-
let
|
|
825
|
-
if (typeof
|
|
826
|
-
C.value =
|
|
827
|
-
const
|
|
828
|
-
|
|
832
|
+
let T = [];
|
|
833
|
+
if (typeof a == "object") {
|
|
834
|
+
C.value = a.type;
|
|
835
|
+
const S = await o.actions.getDictDataObj(C.value);
|
|
836
|
+
T = [].concat(S[C.value]);
|
|
829
837
|
const {
|
|
830
838
|
filters: A,
|
|
831
|
-
filterType:
|
|
832
|
-
reverse:
|
|
833
|
-
} =
|
|
834
|
-
|
|
839
|
+
filterType: V = F.format.value,
|
|
840
|
+
reverse: N = !1
|
|
841
|
+
} = a, q = typeof A == "string" ? A.split(",") : A;
|
|
842
|
+
N ? T = T.filter((G) => !q.includes(G[V])) : T = T.filter((G) => q.includes(G[V]));
|
|
835
843
|
} else {
|
|
836
|
-
C.value =
|
|
837
|
-
const
|
|
838
|
-
|
|
844
|
+
C.value = a;
|
|
845
|
+
const S = await o.actions.getDictDataObj(C.value);
|
|
846
|
+
T = [].concat(S[C.value]);
|
|
839
847
|
}
|
|
840
|
-
if (j && (
|
|
841
|
-
...
|
|
842
|
-
[F.format.disabled]: !!
|
|
843
|
-
}))),
|
|
848
|
+
if (j && (T = j(T)), I && (T = T.map((S) => ({
|
|
849
|
+
...S,
|
|
850
|
+
[F.format.disabled]: !!S[F.format.disabled] || I(S)
|
|
851
|
+
}))), l) {
|
|
844
852
|
const {
|
|
845
|
-
disableValue:
|
|
853
|
+
disableValue: S,
|
|
846
854
|
disableType: A = F.format.value,
|
|
847
|
-
reverse:
|
|
848
|
-
} =
|
|
849
|
-
|
|
855
|
+
reverse: V = !1
|
|
856
|
+
} = l, N = typeof S == "string" ? S.split(",") : S;
|
|
857
|
+
V ? T = T.map((q) => {
|
|
850
858
|
const G = JSON.parse(JSON.stringify(q));
|
|
851
|
-
return G[F.format.disabled] = !
|
|
852
|
-
}) :
|
|
859
|
+
return G[F.format.disabled] = !N.includes(G[A]) || G[F.format.disabled], G;
|
|
860
|
+
}) : T = T.map((q) => {
|
|
853
861
|
const G = JSON.parse(JSON.stringify(q));
|
|
854
|
-
return G[F.format.disabled] =
|
|
862
|
+
return G[F.format.disabled] = N.includes(G[A]) || G[F.format.disabled], G;
|
|
855
863
|
});
|
|
856
864
|
}
|
|
857
|
-
O.list =
|
|
858
|
-
}, g = E(() =>
|
|
859
|
-
|
|
860
|
-
[g,
|
|
861
|
-
([
|
|
862
|
-
!
|
|
863
|
-
[F.format.value]:
|
|
864
|
-
[F.format.label]:
|
|
865
|
-
[F.format.disabled]: !!
|
|
866
|
-
...
|
|
867
|
-
})) : O.list = O.list.map((
|
|
868
|
-
[F.format.value]:
|
|
869
|
-
[F.format.label]:
|
|
865
|
+
O.list = T;
|
|
866
|
+
}, g = E(() => o.state.isGettingDictTypes.includes(C.value)), b = E(() => o.state.isGettingAllDictTypes), u = E(() => e);
|
|
867
|
+
ot(
|
|
868
|
+
[g, b, u],
|
|
869
|
+
([T, S, A]) => {
|
|
870
|
+
!T && !S && A && A.length === 0 && v(), A.length > 0 && (O.list = JSON.parse(JSON.stringify(A)), O.list.length > 0 && (Object.prototype.toString.call(O.list[0]) === "[object Object]" ? O.list = O.list.map((N) => ({
|
|
871
|
+
[F.format.value]: N[r.value],
|
|
872
|
+
[F.format.label]: N[r.label],
|
|
873
|
+
[F.format.disabled]: !!N[r.disabled],
|
|
874
|
+
...N
|
|
875
|
+
})) : O.list = O.list.map((N) => ({
|
|
876
|
+
[F.format.value]: N,
|
|
877
|
+
[F.format.label]: N
|
|
870
878
|
}))));
|
|
871
879
|
},
|
|
872
880
|
{
|
|
873
881
|
immediate: !0
|
|
874
882
|
}
|
|
875
883
|
);
|
|
876
|
-
const y =
|
|
877
|
-
return
|
|
878
|
-
const A = J("el-checkbox-button"),
|
|
879
|
-
return
|
|
884
|
+
const y = B(null);
|
|
885
|
+
return n({ getRef: () => y.value }), (T, S) => {
|
|
886
|
+
const A = J("el-checkbox-button"), V = J("el-checkbox-group");
|
|
887
|
+
return L(), x(V, rt({
|
|
880
888
|
ref_key: "ElCheckboxButtonDict",
|
|
881
889
|
ref: y
|
|
882
|
-
},
|
|
883
|
-
default:
|
|
884
|
-
(
|
|
885
|
-
key:
|
|
886
|
-
disabled:
|
|
887
|
-
|
|
890
|
+
}, T.$attrs, { onChange: $ }), X({
|
|
891
|
+
default: k(() => [
|
|
892
|
+
(L(!0), at(it, null, M(O.list, (N) => (L(), x(A, {
|
|
893
|
+
key: N[h(F).format.value],
|
|
894
|
+
disabled: N[h(F).format.disabled],
|
|
895
|
+
value: N[h(F).format.value],
|
|
888
896
|
name: t.name,
|
|
889
897
|
"true-value": t.trueValue,
|
|
890
898
|
"false-value": t.falseValue,
|
|
@@ -892,34 +900,34 @@ const le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
892
900
|
"false-label": t.falseLabel,
|
|
893
901
|
checked: t.checked
|
|
894
902
|
}, {
|
|
895
|
-
default:
|
|
896
|
-
H(
|
|
903
|
+
default: k(() => [
|
|
904
|
+
W(H(N[h(F).format.label]), 1)
|
|
897
905
|
]),
|
|
898
906
|
_: 2
|
|
899
|
-
}, 1032, ["disabled", "
|
|
907
|
+
}, 1032, ["disabled", "value", "name", "true-value", "false-value", "true-label", "false-label", "checked"]))), 128))
|
|
900
908
|
]),
|
|
901
909
|
_: 2
|
|
902
910
|
}, [
|
|
903
|
-
M(
|
|
911
|
+
M(T.$slots, (N, q, G) => ({
|
|
904
912
|
name: q,
|
|
905
|
-
fn:
|
|
906
|
-
Y(
|
|
913
|
+
fn: k((R) => [
|
|
914
|
+
Y(T.$slots, q, Z(tt(R)))
|
|
907
915
|
])
|
|
908
916
|
}))
|
|
909
917
|
]), 1040);
|
|
910
918
|
};
|
|
911
919
|
}
|
|
912
920
|
});
|
|
913
|
-
|
|
914
|
-
t.component(
|
|
921
|
+
Ft.install = function(t) {
|
|
922
|
+
t.component(Ft.name, Ft);
|
|
915
923
|
};
|
|
916
|
-
const
|
|
924
|
+
const ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
917
925
|
__proto__: null,
|
|
918
|
-
default:
|
|
919
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
926
|
+
default: Ft
|
|
927
|
+
}, Symbol.toStringTag, { value: "Module" })), ue = {
|
|
920
928
|
name: "ElCheckboxDict"
|
|
921
|
-
},
|
|
922
|
-
...
|
|
929
|
+
}, ht = /* @__PURE__ */ Q({
|
|
930
|
+
...ue,
|
|
923
931
|
props: {
|
|
924
932
|
// 自定义数据
|
|
925
933
|
data: {
|
|
@@ -1010,83 +1018,83 @@ const se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1010
1018
|
}
|
|
1011
1019
|
},
|
|
1012
1020
|
emits: ["dictChange"],
|
|
1013
|
-
setup(t, { expose:
|
|
1021
|
+
setup(t, { expose: n, emit: f }) {
|
|
1014
1022
|
const {
|
|
1015
1023
|
data: e,
|
|
1016
|
-
format:
|
|
1017
|
-
dictType:
|
|
1018
|
-
disableObj:
|
|
1019
|
-
border:
|
|
1020
|
-
size:
|
|
1021
|
-
name:
|
|
1022
|
-
checked:
|
|
1023
|
-
indeterminate:
|
|
1024
|
-
trueValue:
|
|
1025
|
-
falseValue:
|
|
1024
|
+
format: r,
|
|
1025
|
+
dictType: a,
|
|
1026
|
+
disableObj: l,
|
|
1027
|
+
border: s,
|
|
1028
|
+
size: c,
|
|
1029
|
+
name: i,
|
|
1030
|
+
checked: d,
|
|
1031
|
+
indeterminate: m,
|
|
1032
|
+
trueValue: p,
|
|
1033
|
+
falseValue: _,
|
|
1026
1034
|
trueLabel: j,
|
|
1027
1035
|
falseLabel: I,
|
|
1028
1036
|
keyValue: C,
|
|
1029
1037
|
filterDataFun: F,
|
|
1030
|
-
disabledDataFun:
|
|
1038
|
+
disabledDataFun: $,
|
|
1031
1039
|
validateEvent: O,
|
|
1032
|
-
tabindex:
|
|
1040
|
+
tabindex: v,
|
|
1033
1041
|
id: g
|
|
1034
|
-
} = t,
|
|
1042
|
+
} = t, b = B(""), u = et(o.state.dictConfig), y = (G) => {
|
|
1035
1043
|
if (!C) {
|
|
1036
1044
|
f("dictChange", G);
|
|
1037
1045
|
return;
|
|
1038
1046
|
}
|
|
1039
|
-
const R =
|
|
1040
|
-
f("dictChange", R
|
|
1041
|
-
},
|
|
1047
|
+
const R = D.list.filter((z) => G.includes(z[u.format.value]));
|
|
1048
|
+
f("dictChange", R);
|
|
1049
|
+
}, D = lt({
|
|
1042
1050
|
list: []
|
|
1043
|
-
}),
|
|
1044
|
-
if (!
|
|
1051
|
+
}), T = async () => {
|
|
1052
|
+
if (!a || e && e.length > 0)
|
|
1045
1053
|
return;
|
|
1046
1054
|
let G = [];
|
|
1047
|
-
if (typeof
|
|
1048
|
-
|
|
1049
|
-
const R = await
|
|
1050
|
-
G = [].concat(R[
|
|
1055
|
+
if (typeof a == "object") {
|
|
1056
|
+
b.value = a.type;
|
|
1057
|
+
const R = await o.actions.getDictDataObj(b.value);
|
|
1058
|
+
G = [].concat(R[b.value]);
|
|
1051
1059
|
const {
|
|
1052
1060
|
filters: z,
|
|
1053
|
-
filterType:
|
|
1061
|
+
filterType: st = u.format.value,
|
|
1054
1062
|
reverse: P = !1
|
|
1055
|
-
} =
|
|
1056
|
-
P ? G = G.filter((K) => !
|
|
1063
|
+
} = a, nt = typeof z == "string" ? z.split(",") : z;
|
|
1064
|
+
P ? G = G.filter((K) => !nt.includes(K[st])) : G = G.filter((K) => nt.includes(K[st]));
|
|
1057
1065
|
} else {
|
|
1058
|
-
|
|
1059
|
-
const R = await
|
|
1060
|
-
G = [].concat(R[
|
|
1066
|
+
b.value = a;
|
|
1067
|
+
const R = await o.actions.getDictDataObj(b.value);
|
|
1068
|
+
G = [].concat(R[b.value]);
|
|
1061
1069
|
}
|
|
1062
|
-
if (F && (G = F(G)),
|
|
1070
|
+
if (F && (G = F(G)), $ && (G = G.map((R) => ({
|
|
1063
1071
|
...R,
|
|
1064
|
-
[u.format.disabled]: !!R[u.format.disabled] ||
|
|
1065
|
-
}))),
|
|
1072
|
+
[u.format.disabled]: !!R[u.format.disabled] || $(R)
|
|
1073
|
+
}))), l) {
|
|
1066
1074
|
const {
|
|
1067
1075
|
disableValue: R,
|
|
1068
1076
|
disableType: z = u.format.value,
|
|
1069
|
-
reverse:
|
|
1070
|
-
} =
|
|
1071
|
-
|
|
1072
|
-
const K = JSON.parse(JSON.stringify(
|
|
1077
|
+
reverse: st = !1
|
|
1078
|
+
} = l, P = typeof R == "string" ? R.split(",") : R;
|
|
1079
|
+
st ? G = G.map((nt) => {
|
|
1080
|
+
const K = JSON.parse(JSON.stringify(nt));
|
|
1073
1081
|
return K[u.format.disabled] = !P.includes(K[z]) || K[u.format.disabled], K;
|
|
1074
|
-
}) : G = G.map((
|
|
1075
|
-
const K = JSON.parse(JSON.stringify(
|
|
1082
|
+
}) : G = G.map((nt) => {
|
|
1083
|
+
const K = JSON.parse(JSON.stringify(nt));
|
|
1076
1084
|
return K[u.format.disabled] = P.includes(K[z]) || K[u.format.disabled], K;
|
|
1077
1085
|
});
|
|
1078
1086
|
}
|
|
1079
|
-
|
|
1080
|
-
},
|
|
1081
|
-
|
|
1082
|
-
[
|
|
1087
|
+
D.list = G;
|
|
1088
|
+
}, S = E(() => o.state.isGettingDictTypes.includes(b.value)), A = E(() => o.state.isGettingAllDictTypes), V = E(() => e);
|
|
1089
|
+
ot(
|
|
1090
|
+
[S, A, V],
|
|
1083
1091
|
([G, R, z]) => {
|
|
1084
|
-
!G && !R && z && z.length === 0 &&
|
|
1085
|
-
[u.format.value]: P[
|
|
1086
|
-
[u.format.label]: P[
|
|
1087
|
-
[u.format.disabled]: !!P[
|
|
1092
|
+
!G && !R && z && z.length === 0 && T(), z.length > 0 && (D.list = JSON.parse(JSON.stringify(z)), D.list.length > 0 && (Object.prototype.toString.call(D.list[0]) === "[object Object]" ? D.list = D.list.map((P) => ({
|
|
1093
|
+
[u.format.value]: P[r.value],
|
|
1094
|
+
[u.format.label]: P[r.label],
|
|
1095
|
+
[u.format.disabled]: !!P[r.disabled],
|
|
1088
1096
|
...P
|
|
1089
|
-
})) :
|
|
1097
|
+
})) : D.list = D.list.map((P) => ({
|
|
1090
1098
|
[u.format.value]: P,
|
|
1091
1099
|
[u.format.label]: P
|
|
1092
1100
|
}))));
|
|
@@ -1095,17 +1103,17 @@ const se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1095
1103
|
immediate: !0
|
|
1096
1104
|
}
|
|
1097
1105
|
);
|
|
1098
|
-
const
|
|
1099
|
-
return
|
|
1100
|
-
const z = J("el-checkbox"),
|
|
1101
|
-
return
|
|
1106
|
+
const N = B(null);
|
|
1107
|
+
return n({ getRef: () => N.value }), (G, R) => {
|
|
1108
|
+
const z = J("el-checkbox"), st = J("el-checkbox-group");
|
|
1109
|
+
return L(), x(st, rt({
|
|
1102
1110
|
ref_key: "ElCheckboxDict",
|
|
1103
|
-
ref:
|
|
1111
|
+
ref: N
|
|
1104
1112
|
}, G.$attrs, { onChange: y }), X({
|
|
1105
|
-
default:
|
|
1106
|
-
(
|
|
1113
|
+
default: k(() => [
|
|
1114
|
+
(L(!0), at(it, null, M(D.list, (P) => (L(), x(z, {
|
|
1107
1115
|
key: P[h(u).format.value],
|
|
1108
|
-
|
|
1116
|
+
value: P[h(u).format.value],
|
|
1109
1117
|
"true-value": t.trueValue,
|
|
1110
1118
|
"false-value": t.falseValue,
|
|
1111
1119
|
"true-label": t.trueLabel,
|
|
@@ -1120,34 +1128,34 @@ const se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1120
1128
|
tabindex: t.tabindex,
|
|
1121
1129
|
id: t.id
|
|
1122
1130
|
}, {
|
|
1123
|
-
default:
|
|
1124
|
-
H(
|
|
1131
|
+
default: k(() => [
|
|
1132
|
+
W(H(P[h(u).format.label]), 1)
|
|
1125
1133
|
]),
|
|
1126
1134
|
_: 2
|
|
1127
|
-
}, 1032, ["
|
|
1135
|
+
}, 1032, ["value", "true-value", "false-value", "true-label", "false-label", "disabled", "border", "size", "name", "checked", "indeterminate", "validate-event", "tabindex", "id"]))), 128))
|
|
1128
1136
|
]),
|
|
1129
1137
|
_: 2
|
|
1130
1138
|
}, [
|
|
1131
|
-
M(G.$slots, (P,
|
|
1132
|
-
name:
|
|
1133
|
-
fn:
|
|
1134
|
-
Y(G.$slots,
|
|
1139
|
+
M(G.$slots, (P, nt, K) => ({
|
|
1140
|
+
name: nt,
|
|
1141
|
+
fn: k((vt) => [
|
|
1142
|
+
Y(G.$slots, nt, Z(tt(vt)))
|
|
1135
1143
|
])
|
|
1136
1144
|
}))
|
|
1137
1145
|
]), 1040);
|
|
1138
1146
|
};
|
|
1139
1147
|
}
|
|
1140
1148
|
});
|
|
1141
|
-
|
|
1142
|
-
t.component(
|
|
1149
|
+
ht.install = function(t) {
|
|
1150
|
+
t.component(ht.name, ht);
|
|
1143
1151
|
};
|
|
1144
|
-
const
|
|
1152
|
+
const de = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1145
1153
|
__proto__: null,
|
|
1146
|
-
default:
|
|
1147
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1154
|
+
default: ht
|
|
1155
|
+
}, Symbol.toStringTag, { value: "Module" })), fe = {
|
|
1148
1156
|
name: "ElLinkDict"
|
|
1149
|
-
},
|
|
1150
|
-
...
|
|
1157
|
+
}, Ct = /* @__PURE__ */ Q({
|
|
1158
|
+
...fe,
|
|
1151
1159
|
props: {
|
|
1152
1160
|
value: {
|
|
1153
1161
|
type: [String, Number],
|
|
@@ -1172,48 +1180,48 @@ const ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1172
1180
|
type: Boolean
|
|
1173
1181
|
}
|
|
1174
1182
|
},
|
|
1175
|
-
setup(t, { expose:
|
|
1176
|
-
const f = t, { value: e, dictType:
|
|
1177
|
-
let
|
|
1178
|
-
|
|
1179
|
-
Dt(e.value,
|
|
1180
|
-
|
|
1183
|
+
setup(t, { expose: n }) {
|
|
1184
|
+
const f = t, { value: e, dictType: r, judgeTypeFun: a, type: l, judgeDisabledFun: s, disabled: c } = kt(f), i = et(o.state.dictConfig), d = E(() => a != null && a.value ? a.value(e.value) : l.value ? l.value : p.value && p.value[i.format.type] ? p.value[i.format.type] : "primary"), m = E(() => p.value && p.value[i.format.disabled] ? p.value[i.format.disabled] : s != null && s.value ? s.value(e.value) : !!c.value);
|
|
1185
|
+
let p = B(null), _ = B(null);
|
|
1186
|
+
Bt(() => {
|
|
1187
|
+
Dt(e.value, r.value).then((C) => {
|
|
1188
|
+
p.value = C, _.value = C[i.format.label];
|
|
1181
1189
|
});
|
|
1182
1190
|
});
|
|
1183
|
-
const j =
|
|
1184
|
-
return
|
|
1185
|
-
const
|
|
1186
|
-
return
|
|
1191
|
+
const j = B(null);
|
|
1192
|
+
return n({ getRef: () => j.value }), (C, F) => {
|
|
1193
|
+
const $ = J("el-link");
|
|
1194
|
+
return L(), x($, rt({
|
|
1187
1195
|
ref_key: "ElLinkDict",
|
|
1188
1196
|
ref: j,
|
|
1189
|
-
type: h(
|
|
1190
|
-
disabled: h(
|
|
1197
|
+
type: h(d),
|
|
1198
|
+
disabled: h(m)
|
|
1191
1199
|
}, C.$attrs), X({
|
|
1192
|
-
default:
|
|
1193
|
-
|
|
1200
|
+
default: k(() => [
|
|
1201
|
+
W(" " + H(h(_)), 1)
|
|
1194
1202
|
]),
|
|
1195
1203
|
_: 2
|
|
1196
1204
|
}, [
|
|
1197
|
-
M(C.$slots, (O,
|
|
1198
|
-
name:
|
|
1199
|
-
fn:
|
|
1200
|
-
Y(C.$slots,
|
|
1205
|
+
M(C.$slots, (O, v, g) => ({
|
|
1206
|
+
name: v,
|
|
1207
|
+
fn: k((b) => [
|
|
1208
|
+
Y(C.$slots, v, Z(tt(b)))
|
|
1201
1209
|
])
|
|
1202
1210
|
}))
|
|
1203
1211
|
]), 1040, ["type", "disabled"]);
|
|
1204
1212
|
};
|
|
1205
1213
|
}
|
|
1206
1214
|
});
|
|
1207
|
-
|
|
1208
|
-
t.component(
|
|
1215
|
+
Ct.install = function(t) {
|
|
1216
|
+
t.component(Ct.name, Ct);
|
|
1209
1217
|
};
|
|
1210
|
-
const
|
|
1218
|
+
const ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1211
1219
|
__proto__: null,
|
|
1212
|
-
default:
|
|
1213
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1220
|
+
default: Ct
|
|
1221
|
+
}, Symbol.toStringTag, { value: "Module" })), be = {
|
|
1214
1222
|
name: "ElRadioButtonDict"
|
|
1215
|
-
},
|
|
1216
|
-
...
|
|
1223
|
+
}, jt = /* @__PURE__ */ Q({
|
|
1224
|
+
...be,
|
|
1217
1225
|
props: {
|
|
1218
1226
|
// 自定义数据
|
|
1219
1227
|
data: {
|
|
@@ -1255,122 +1263,122 @@ const de = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1255
1263
|
}
|
|
1256
1264
|
},
|
|
1257
1265
|
emits: ["dictChange"],
|
|
1258
|
-
setup(t, { expose:
|
|
1266
|
+
setup(t, { expose: n, emit: f }) {
|
|
1259
1267
|
const {
|
|
1260
1268
|
data: e,
|
|
1261
|
-
format:
|
|
1262
|
-
dictType:
|
|
1263
|
-
disableObj:
|
|
1264
|
-
name:
|
|
1265
|
-
keyValue:
|
|
1266
|
-
filterDataFun:
|
|
1267
|
-
disabledDataFun:
|
|
1268
|
-
} = t,
|
|
1269
|
-
if (!
|
|
1269
|
+
format: r,
|
|
1270
|
+
dictType: a,
|
|
1271
|
+
disableObj: l,
|
|
1272
|
+
name: s,
|
|
1273
|
+
keyValue: c,
|
|
1274
|
+
filterDataFun: i,
|
|
1275
|
+
disabledDataFun: d
|
|
1276
|
+
} = t, m = B(""), p = et(o.state.dictConfig), _ = (g) => {
|
|
1277
|
+
if (!c) {
|
|
1270
1278
|
f("dictChange", g);
|
|
1271
1279
|
return;
|
|
1272
1280
|
}
|
|
1273
|
-
const
|
|
1274
|
-
f("dictChange",
|
|
1275
|
-
}, j =
|
|
1281
|
+
const b = j.list.find((u) => u[p.format.value] === g);
|
|
1282
|
+
f("dictChange", b);
|
|
1283
|
+
}, j = lt({
|
|
1276
1284
|
list: []
|
|
1277
1285
|
}), I = async () => {
|
|
1278
|
-
if (!
|
|
1286
|
+
if (!a || e && e.length > 0)
|
|
1279
1287
|
return;
|
|
1280
1288
|
let g = [];
|
|
1281
|
-
if (typeof
|
|
1282
|
-
|
|
1283
|
-
const
|
|
1284
|
-
g = [].concat(m
|
|
1289
|
+
if (typeof a == "object") {
|
|
1290
|
+
m.value = a.type;
|
|
1291
|
+
const b = await o.actions.getDictDataObj(m.value);
|
|
1292
|
+
g = [].concat(b[m.value]);
|
|
1285
1293
|
const {
|
|
1286
1294
|
filters: u,
|
|
1287
|
-
filterType: y =
|
|
1288
|
-
reverse:
|
|
1289
|
-
} =
|
|
1290
|
-
|
|
1295
|
+
filterType: y = p.format.value,
|
|
1296
|
+
reverse: D = !1
|
|
1297
|
+
} = a, T = typeof u == "string" ? u.split(",") : u;
|
|
1298
|
+
D ? g = g.filter((S) => !T.includes(S[y])) : g = g.filter((S) => T.includes(S[y]));
|
|
1291
1299
|
} else {
|
|
1292
|
-
|
|
1293
|
-
const
|
|
1294
|
-
g = [].concat(m
|
|
1300
|
+
m.value = a;
|
|
1301
|
+
const b = await o.actions.getDictDataObj(m.value);
|
|
1302
|
+
g = [].concat(b[m.value]);
|
|
1295
1303
|
}
|
|
1296
|
-
if (
|
|
1297
|
-
...
|
|
1298
|
-
[
|
|
1299
|
-
}))),
|
|
1304
|
+
if (i && (g = i(g)), d && (g = g.map((b) => ({
|
|
1305
|
+
...b,
|
|
1306
|
+
[p.format.disabled]: !!b[p.format.disabled] || d(b)
|
|
1307
|
+
}))), l) {
|
|
1300
1308
|
const {
|
|
1301
|
-
disableValue:
|
|
1302
|
-
disableType: u =
|
|
1309
|
+
disableValue: b,
|
|
1310
|
+
disableType: u = p.format.value,
|
|
1303
1311
|
reverse: y = !1
|
|
1304
|
-
} =
|
|
1305
|
-
y ? g = g.map((
|
|
1306
|
-
const
|
|
1307
|
-
return
|
|
1308
|
-
}) : g = g.map((
|
|
1309
|
-
const
|
|
1310
|
-
return
|
|
1312
|
+
} = l, D = typeof b == "string" ? b.split(",") : b;
|
|
1313
|
+
y ? g = g.map((T) => {
|
|
1314
|
+
const S = JSON.parse(JSON.stringify(T));
|
|
1315
|
+
return S[p.format.disabled] = !D.includes(S[u]) || S[p.format.disabled], S;
|
|
1316
|
+
}) : g = g.map((T) => {
|
|
1317
|
+
const S = JSON.parse(JSON.stringify(T));
|
|
1318
|
+
return S[p.format.disabled] = D.includes(S[u]) || S[p.format.disabled], S;
|
|
1311
1319
|
});
|
|
1312
1320
|
}
|
|
1313
1321
|
j.list = g;
|
|
1314
|
-
}, C = E(() =>
|
|
1315
|
-
|
|
1316
|
-
[C, F,
|
|
1317
|
-
([g,
|
|
1318
|
-
!g && !
|
|
1319
|
-
[
|
|
1320
|
-
[
|
|
1321
|
-
[
|
|
1322
|
-
...
|
|
1323
|
-
})) : j.list = j.list.map((
|
|
1324
|
-
[
|
|
1325
|
-
[
|
|
1322
|
+
}, C = E(() => o.state.isGettingDictTypes.includes(m.value)), F = E(() => o.state.isGettingAllDictTypes), $ = E(() => e);
|
|
1323
|
+
ot(
|
|
1324
|
+
[C, F, $],
|
|
1325
|
+
([g, b, u]) => {
|
|
1326
|
+
!g && !b && u && u.length === 0 && I(), u.length > 0 && (j.list = JSON.parse(JSON.stringify(u)), j.list.length > 0 && (Object.prototype.toString.call(j.list[0]) === "[object Object]" ? j.list = j.list.map((D) => ({
|
|
1327
|
+
[p.format.value]: D[r.value],
|
|
1328
|
+
[p.format.label]: D[r.label],
|
|
1329
|
+
[p.format.disabled]: !!D[r.disabled],
|
|
1330
|
+
...D
|
|
1331
|
+
})) : j.list = j.list.map((D) => ({
|
|
1332
|
+
[p.format.value]: D,
|
|
1333
|
+
[p.format.label]: D
|
|
1326
1334
|
}))));
|
|
1327
1335
|
},
|
|
1328
1336
|
{
|
|
1329
1337
|
immediate: !0
|
|
1330
1338
|
}
|
|
1331
1339
|
);
|
|
1332
|
-
const O =
|
|
1333
|
-
return
|
|
1340
|
+
const O = B(null);
|
|
1341
|
+
return n({ getRef: () => O.value }), (g, b) => {
|
|
1334
1342
|
const u = J("el-radio-button"), y = J("el-radio-group");
|
|
1335
|
-
return
|
|
1343
|
+
return L(), x(y, rt({
|
|
1336
1344
|
ref_key: "ElRadioButtonDict",
|
|
1337
1345
|
ref: O
|
|
1338
|
-
}, g.$attrs, { onChange:
|
|
1339
|
-
default:
|
|
1340
|
-
(
|
|
1341
|
-
key:
|
|
1342
|
-
disabled:
|
|
1343
|
-
|
|
1346
|
+
}, g.$attrs, { onChange: _ }), X({
|
|
1347
|
+
default: k(() => [
|
|
1348
|
+
(L(!0), at(it, null, M(j.list, (D) => (L(), x(u, {
|
|
1349
|
+
key: D[h(p).format.value],
|
|
1350
|
+
disabled: D[h(p).format.disabled],
|
|
1351
|
+
value: D[h(p).format.value],
|
|
1344
1352
|
name: t.name
|
|
1345
1353
|
}, {
|
|
1346
|
-
default:
|
|
1347
|
-
H(
|
|
1354
|
+
default: k(() => [
|
|
1355
|
+
W(H(D[h(p).format.label]), 1)
|
|
1348
1356
|
]),
|
|
1349
1357
|
_: 2
|
|
1350
|
-
}, 1032, ["disabled", "
|
|
1358
|
+
}, 1032, ["disabled", "value", "name"]))), 128))
|
|
1351
1359
|
]),
|
|
1352
1360
|
_: 2
|
|
1353
1361
|
}, [
|
|
1354
|
-
M(g.$slots, (
|
|
1355
|
-
name:
|
|
1356
|
-
fn:
|
|
1357
|
-
Y(g.$slots,
|
|
1362
|
+
M(g.$slots, (D, T, S) => ({
|
|
1363
|
+
name: T,
|
|
1364
|
+
fn: k((A) => [
|
|
1365
|
+
Y(g.$slots, T, Z(tt(A)))
|
|
1358
1366
|
])
|
|
1359
1367
|
}))
|
|
1360
1368
|
]), 1040);
|
|
1361
1369
|
};
|
|
1362
1370
|
}
|
|
1363
1371
|
});
|
|
1364
|
-
|
|
1365
|
-
t.component(
|
|
1372
|
+
jt.install = function(t) {
|
|
1373
|
+
t.component(jt.name, jt);
|
|
1366
1374
|
};
|
|
1367
|
-
const
|
|
1375
|
+
const me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1368
1376
|
__proto__: null,
|
|
1369
|
-
default:
|
|
1370
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1377
|
+
default: jt
|
|
1378
|
+
}, Symbol.toStringTag, { value: "Module" })), pe = {
|
|
1371
1379
|
name: "ElRadioDict"
|
|
1372
|
-
},
|
|
1373
|
-
...
|
|
1380
|
+
}, It = /* @__PURE__ */ Q({
|
|
1381
|
+
...pe,
|
|
1374
1382
|
props: {
|
|
1375
1383
|
// 自定义数据
|
|
1376
1384
|
data: {
|
|
@@ -1422,126 +1430,126 @@ const ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1422
1430
|
}
|
|
1423
1431
|
},
|
|
1424
1432
|
emits: ["dictChange"],
|
|
1425
|
-
setup(t, { expose:
|
|
1433
|
+
setup(t, { expose: n, emit: f }) {
|
|
1426
1434
|
const {
|
|
1427
1435
|
data: e,
|
|
1428
|
-
format:
|
|
1429
|
-
dictType:
|
|
1430
|
-
disableObj:
|
|
1431
|
-
border:
|
|
1432
|
-
size:
|
|
1433
|
-
name:
|
|
1434
|
-
keyValue:
|
|
1435
|
-
filterDataFun:
|
|
1436
|
-
disabledDataFun:
|
|
1437
|
-
} = t,
|
|
1438
|
-
if (!
|
|
1436
|
+
format: r,
|
|
1437
|
+
dictType: a,
|
|
1438
|
+
disableObj: l,
|
|
1439
|
+
border: s,
|
|
1440
|
+
size: c,
|
|
1441
|
+
name: i,
|
|
1442
|
+
keyValue: d,
|
|
1443
|
+
filterDataFun: m,
|
|
1444
|
+
disabledDataFun: p
|
|
1445
|
+
} = t, _ = B(""), j = et(o.state.dictConfig), I = (u) => {
|
|
1446
|
+
if (!d) {
|
|
1439
1447
|
f("dictChange", u);
|
|
1440
1448
|
return;
|
|
1441
1449
|
}
|
|
1442
|
-
const y = C.list.find((
|
|
1450
|
+
const y = C.list.find((D) => D[j.format.value] === u);
|
|
1443
1451
|
f("dictChange", y);
|
|
1444
|
-
}, C =
|
|
1452
|
+
}, C = lt({
|
|
1445
1453
|
list: []
|
|
1446
1454
|
}), F = async () => {
|
|
1447
|
-
if (!
|
|
1455
|
+
if (!a || e && e.length > 0)
|
|
1448
1456
|
return;
|
|
1449
1457
|
let u = [];
|
|
1450
|
-
if (typeof
|
|
1451
|
-
|
|
1452
|
-
const y = await
|
|
1453
|
-
u = [].concat(y[
|
|
1458
|
+
if (typeof a == "object") {
|
|
1459
|
+
_.value = a.type;
|
|
1460
|
+
const y = await o.actions.getDictDataObj(_.value);
|
|
1461
|
+
u = [].concat(y[_.value]);
|
|
1454
1462
|
const {
|
|
1455
|
-
filters:
|
|
1456
|
-
filterType:
|
|
1457
|
-
reverse:
|
|
1458
|
-
} =
|
|
1459
|
-
|
|
1463
|
+
filters: D,
|
|
1464
|
+
filterType: T = j.format.value,
|
|
1465
|
+
reverse: S = !1
|
|
1466
|
+
} = a, A = typeof D == "string" ? D.split(",") : D;
|
|
1467
|
+
S ? u = u.filter((V) => !A.includes(V[T])) : u = u.filter((V) => A.includes(V[T]));
|
|
1460
1468
|
} else {
|
|
1461
|
-
|
|
1462
|
-
const y = await
|
|
1463
|
-
u = [].concat(y[
|
|
1469
|
+
_.value = a;
|
|
1470
|
+
const y = await o.actions.getDictDataObj(_.value);
|
|
1471
|
+
u = [].concat(y[_.value]);
|
|
1464
1472
|
}
|
|
1465
|
-
if (
|
|
1473
|
+
if (m && (u = m(u)), p && (u = u.map((y) => ({
|
|
1466
1474
|
...y,
|
|
1467
|
-
[j.format.disabled]: !!y[j.format.disabled] ||
|
|
1468
|
-
}))),
|
|
1475
|
+
[j.format.disabled]: !!y[j.format.disabled] || p(y)
|
|
1476
|
+
}))), l) {
|
|
1469
1477
|
const {
|
|
1470
1478
|
disableValue: y,
|
|
1471
|
-
disableType:
|
|
1472
|
-
reverse:
|
|
1473
|
-
} =
|
|
1474
|
-
|
|
1475
|
-
const
|
|
1476
|
-
return
|
|
1479
|
+
disableType: D = j.format.value,
|
|
1480
|
+
reverse: T = !1
|
|
1481
|
+
} = l, S = typeof y == "string" ? y.split(",") : y;
|
|
1482
|
+
T ? u = u.map((A) => {
|
|
1483
|
+
const V = JSON.parse(JSON.stringify(A));
|
|
1484
|
+
return V[j.format.disabled] = !S.includes(V[D]) || V[j.format.disabled], V;
|
|
1477
1485
|
}) : u = u.map((A) => {
|
|
1478
|
-
const
|
|
1479
|
-
return
|
|
1486
|
+
const V = JSON.parse(JSON.stringify(A));
|
|
1487
|
+
return V[j.format.disabled] = S.includes(V[D]) || V[j.format.disabled], V;
|
|
1480
1488
|
});
|
|
1481
1489
|
}
|
|
1482
1490
|
C.list = u;
|
|
1483
|
-
},
|
|
1484
|
-
|
|
1485
|
-
[
|
|
1486
|
-
([u, y,
|
|
1487
|
-
!u && !y &&
|
|
1488
|
-
[j.format.value]:
|
|
1489
|
-
[j.format.label]:
|
|
1490
|
-
[j.format.disabled]: !!
|
|
1491
|
-
...
|
|
1492
|
-
})) : C.list = C.list.map((
|
|
1493
|
-
[j.format.value]:
|
|
1494
|
-
[j.format.label]:
|
|
1491
|
+
}, $ = E(() => o.state.isGettingDictTypes.includes(_.value)), O = E(() => o.state.isGettingAllDictTypes), v = E(() => e);
|
|
1492
|
+
ot(
|
|
1493
|
+
[$, O, v],
|
|
1494
|
+
([u, y, D]) => {
|
|
1495
|
+
!u && !y && D && D.length === 0 && F(), D.length > 0 && (C.list = JSON.parse(JSON.stringify(D)), C.list.length > 0 && (Object.prototype.toString.call(C.list[0]) === "[object Object]" ? C.list = C.list.map((S) => ({
|
|
1496
|
+
[j.format.value]: S[r.value],
|
|
1497
|
+
[j.format.label]: S[r.label],
|
|
1498
|
+
[j.format.disabled]: !!S[r.disabled],
|
|
1499
|
+
...S
|
|
1500
|
+
})) : C.list = C.list.map((S) => ({
|
|
1501
|
+
[j.format.value]: S,
|
|
1502
|
+
[j.format.label]: S
|
|
1495
1503
|
}))));
|
|
1496
1504
|
},
|
|
1497
1505
|
{
|
|
1498
1506
|
immediate: !0
|
|
1499
1507
|
}
|
|
1500
1508
|
);
|
|
1501
|
-
const g =
|
|
1502
|
-
return
|
|
1503
|
-
const
|
|
1504
|
-
return
|
|
1509
|
+
const g = B(null);
|
|
1510
|
+
return n({ getRef: () => g.value }), (u, y) => {
|
|
1511
|
+
const D = J("el-radio"), T = J("el-radio-group");
|
|
1512
|
+
return L(), x(T, rt({
|
|
1505
1513
|
ref_key: "ElRadioDict",
|
|
1506
1514
|
ref: g
|
|
1507
1515
|
}, u.$attrs, { onChange: I }), X({
|
|
1508
|
-
default:
|
|
1509
|
-
(
|
|
1510
|
-
key:
|
|
1511
|
-
disabled:
|
|
1512
|
-
|
|
1516
|
+
default: k(() => [
|
|
1517
|
+
(L(!0), at(it, null, M(C.list, (S) => (L(), x(D, {
|
|
1518
|
+
key: S[h(j).format.value],
|
|
1519
|
+
disabled: S[h(j).format.disabled],
|
|
1520
|
+
value: S[h(j).format.value],
|
|
1513
1521
|
border: t.border,
|
|
1514
1522
|
size: t.size,
|
|
1515
1523
|
name: t.name
|
|
1516
1524
|
}, {
|
|
1517
|
-
default:
|
|
1518
|
-
H(
|
|
1525
|
+
default: k(() => [
|
|
1526
|
+
W(H(S[h(j).format.label]), 1)
|
|
1519
1527
|
]),
|
|
1520
1528
|
_: 2
|
|
1521
|
-
}, 1032, ["disabled", "
|
|
1529
|
+
}, 1032, ["disabled", "value", "border", "size", "name"]))), 128))
|
|
1522
1530
|
]),
|
|
1523
1531
|
_: 2
|
|
1524
1532
|
}, [
|
|
1525
|
-
M(u.$slots, (
|
|
1533
|
+
M(u.$slots, (S, A, V) => ({
|
|
1526
1534
|
name: A,
|
|
1527
|
-
fn:
|
|
1528
|
-
Y(u.$slots, A, Z(tt(
|
|
1535
|
+
fn: k((N) => [
|
|
1536
|
+
Y(u.$slots, A, Z(tt(N)))
|
|
1529
1537
|
])
|
|
1530
1538
|
}))
|
|
1531
1539
|
]), 1040);
|
|
1532
1540
|
};
|
|
1533
1541
|
}
|
|
1534
1542
|
});
|
|
1535
|
-
|
|
1536
|
-
t.component(
|
|
1543
|
+
It.install = function(t) {
|
|
1544
|
+
t.component(It.name, It);
|
|
1537
1545
|
};
|
|
1538
|
-
const
|
|
1546
|
+
const ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1539
1547
|
__proto__: null,
|
|
1540
|
-
default:
|
|
1541
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1548
|
+
default: It
|
|
1549
|
+
}, Symbol.toStringTag, { value: "Module" })), De = {
|
|
1542
1550
|
name: "ElSelectDict"
|
|
1543
|
-
},
|
|
1544
|
-
...
|
|
1551
|
+
}, At = /* @__PURE__ */ Q({
|
|
1552
|
+
...De,
|
|
1545
1553
|
props: {
|
|
1546
1554
|
// 自定义数据
|
|
1547
1555
|
data: {
|
|
@@ -1578,522 +1586,522 @@ const me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1578
1586
|
}
|
|
1579
1587
|
},
|
|
1580
1588
|
emits: ["dictChange"],
|
|
1581
|
-
setup(t, { expose:
|
|
1582
|
-
const { data: e, format:
|
|
1583
|
-
f("dictChange",
|
|
1584
|
-
},
|
|
1589
|
+
setup(t, { expose: n, emit: f }) {
|
|
1590
|
+
const { data: e, format: r, dictType: a, disableObj: l, keyValue: s, filterDataFun: c, disabledDataFun: i } = t, d = B(""), m = et(o.state.dictConfig), p = (v) => {
|
|
1591
|
+
f("dictChange", v);
|
|
1592
|
+
}, _ = lt({
|
|
1585
1593
|
list: []
|
|
1586
1594
|
}), j = async () => {
|
|
1587
|
-
if (!
|
|
1595
|
+
if (!a || e && e.length > 0)
|
|
1588
1596
|
return;
|
|
1589
|
-
let
|
|
1590
|
-
if (typeof
|
|
1591
|
-
|
|
1592
|
-
const g = await
|
|
1593
|
-
|
|
1597
|
+
let v = [];
|
|
1598
|
+
if (typeof a == "object") {
|
|
1599
|
+
d.value = a.type;
|
|
1600
|
+
const g = await o.actions.getDictDataObj(d.value);
|
|
1601
|
+
v = [].concat(g[d.value]);
|
|
1594
1602
|
const {
|
|
1595
|
-
filters:
|
|
1596
|
-
filterType: u =
|
|
1603
|
+
filters: b,
|
|
1604
|
+
filterType: u = m.format.value,
|
|
1597
1605
|
reverse: y = !1
|
|
1598
|
-
} =
|
|
1599
|
-
y ?
|
|
1606
|
+
} = a, D = typeof b == "string" ? b.split(",") : b;
|
|
1607
|
+
y ? v = v.filter((T) => !D.includes(T[u])) : v = v.filter((T) => D.includes(T[u]));
|
|
1600
1608
|
} else {
|
|
1601
|
-
|
|
1602
|
-
const g = await
|
|
1603
|
-
|
|
1609
|
+
d.value = a;
|
|
1610
|
+
const g = await o.actions.getDictDataObj(d.value);
|
|
1611
|
+
v = [].concat(g[d.value]);
|
|
1604
1612
|
}
|
|
1605
|
-
if (
|
|
1613
|
+
if (c && (v = c(v)), i && (v = v.map((g) => ({
|
|
1606
1614
|
...g,
|
|
1607
|
-
[
|
|
1608
|
-
}))),
|
|
1615
|
+
[m.format.disabled]: !!g[m.format.disabled] || i(g)
|
|
1616
|
+
}))), l) {
|
|
1609
1617
|
const {
|
|
1610
1618
|
disableValue: g,
|
|
1611
|
-
disableType:
|
|
1619
|
+
disableType: b = m.format.value,
|
|
1612
1620
|
reverse: u = !1
|
|
1613
|
-
} =
|
|
1614
|
-
u ?
|
|
1615
|
-
const
|
|
1616
|
-
return
|
|
1617
|
-
}) :
|
|
1618
|
-
const
|
|
1619
|
-
return
|
|
1621
|
+
} = l, y = typeof g == "string" ? g.split(",") : g;
|
|
1622
|
+
u ? v = v.map((D) => {
|
|
1623
|
+
const T = JSON.parse(JSON.stringify(D));
|
|
1624
|
+
return T[m.format.disabled] = !y.includes(T[b]) || T[m.format.disabled], T;
|
|
1625
|
+
}) : v = v.map((D) => {
|
|
1626
|
+
const T = JSON.parse(JSON.stringify(D));
|
|
1627
|
+
return T[m.format.disabled] = y.includes(T[b]) || T[m.format.disabled], T;
|
|
1620
1628
|
});
|
|
1621
1629
|
}
|
|
1622
|
-
|
|
1623
|
-
}, I = E(() =>
|
|
1624
|
-
|
|
1630
|
+
_.list = v;
|
|
1631
|
+
}, I = E(() => o.state.isGettingDictTypes.includes(d.value)), C = E(() => o.state.isGettingAllDictTypes), F = E(() => e);
|
|
1632
|
+
ot(
|
|
1625
1633
|
[I, C, F],
|
|
1626
|
-
([
|
|
1627
|
-
!
|
|
1628
|
-
[
|
|
1629
|
-
[
|
|
1630
|
-
[
|
|
1634
|
+
([v, g, b]) => {
|
|
1635
|
+
!v && !g && b && b.length === 0 && j(), b.length > 0 && (_.list = JSON.parse(JSON.stringify(b)), _.list.length > 0 && (Object.prototype.toString.call(_.list[0]) === "[object Object]" ? _.list = _.list.map((y) => ({
|
|
1636
|
+
[m.format.value]: y[r.value],
|
|
1637
|
+
[m.format.label]: y[r.label],
|
|
1638
|
+
[m.format.disabled]: !!y[r.disabled],
|
|
1631
1639
|
...y
|
|
1632
|
-
})) :
|
|
1633
|
-
[
|
|
1634
|
-
[
|
|
1640
|
+
})) : _.list = _.list.map((y) => ({
|
|
1641
|
+
[m.format.value]: y,
|
|
1642
|
+
[m.format.label]: y
|
|
1635
1643
|
}))));
|
|
1636
1644
|
},
|
|
1637
1645
|
{
|
|
1638
1646
|
immediate: !0
|
|
1639
1647
|
}
|
|
1640
1648
|
);
|
|
1641
|
-
const
|
|
1642
|
-
return
|
|
1643
|
-
const
|
|
1644
|
-
return
|
|
1649
|
+
const $ = B(null);
|
|
1650
|
+
return n({ getRef: () => $.value }), (v, g) => {
|
|
1651
|
+
const b = J("el-option"), u = J("el-select");
|
|
1652
|
+
return L(), x(u, rt({
|
|
1645
1653
|
ref_key: "ElSelectDict",
|
|
1646
|
-
ref:
|
|
1647
|
-
},
|
|
1648
|
-
"value-key": t.keyValue ? h(
|
|
1649
|
-
onChange:
|
|
1654
|
+
ref: $
|
|
1655
|
+
}, v.$attrs, {
|
|
1656
|
+
"value-key": t.keyValue ? h(m).format.label : "",
|
|
1657
|
+
onChange: p
|
|
1650
1658
|
}), X({
|
|
1651
|
-
default:
|
|
1652
|
-
(
|
|
1653
|
-
key: y[h(
|
|
1654
|
-
disabled: y[h(
|
|
1655
|
-
label: y[h(
|
|
1656
|
-
value: t.keyValue ? y : y[h(
|
|
1659
|
+
default: k(() => [
|
|
1660
|
+
(L(!0), at(it, null, M(_.list, (y) => (L(), x(b, {
|
|
1661
|
+
key: y[h(m).format.value],
|
|
1662
|
+
disabled: y[h(m).format.disabled],
|
|
1663
|
+
label: y[h(m).format.label],
|
|
1664
|
+
value: t.keyValue ? y : y[h(m).format.value]
|
|
1657
1665
|
}, null, 8, ["disabled", "label", "value"]))), 128))
|
|
1658
1666
|
]),
|
|
1659
1667
|
_: 2
|
|
1660
1668
|
}, [
|
|
1661
|
-
M(
|
|
1662
|
-
name:
|
|
1663
|
-
fn:
|
|
1664
|
-
Y(
|
|
1669
|
+
M(v.$slots, (y, D, T) => ({
|
|
1670
|
+
name: D,
|
|
1671
|
+
fn: k((S) => [
|
|
1672
|
+
Y(v.$slots, D, Z(tt(S)))
|
|
1665
1673
|
])
|
|
1666
1674
|
}))
|
|
1667
1675
|
]), 1040, ["value-key"]);
|
|
1668
1676
|
};
|
|
1669
1677
|
}
|
|
1670
1678
|
});
|
|
1671
|
-
|
|
1672
|
-
t.component(
|
|
1679
|
+
At.install = function(t) {
|
|
1680
|
+
t.component(At.name, At);
|
|
1673
1681
|
};
|
|
1674
|
-
const
|
|
1682
|
+
const Te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1675
1683
|
__proto__: null,
|
|
1676
|
-
default:
|
|
1677
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1678
|
-
const { format: e } =
|
|
1679
|
-
let
|
|
1680
|
-
if (!
|
|
1681
|
-
|
|
1682
|
-
if (
|
|
1684
|
+
default: At
|
|
1685
|
+
}, Symbol.toStringTag, { value: "Module" })), ve = (t, n, f) => {
|
|
1686
|
+
const { format: e } = o.state.dictConfig, r = o.state.dictCodes;
|
|
1687
|
+
let a = [];
|
|
1688
|
+
if (!r || !r[n])
|
|
1689
|
+
o.actions.getDictDataObj(n).then((l) => {
|
|
1690
|
+
if (a = l[n], !a)
|
|
1683
1691
|
return;
|
|
1684
|
-
const
|
|
1685
|
-
return
|
|
1692
|
+
const s = a.find((c) => c[e.value] === t);
|
|
1693
|
+
return s ? s[e.label] : f ?? "";
|
|
1686
1694
|
});
|
|
1687
1695
|
else {
|
|
1688
|
-
|
|
1689
|
-
const
|
|
1690
|
-
return
|
|
1696
|
+
a = r[n];
|
|
1697
|
+
const l = a.find((s) => s[e.value] === t);
|
|
1698
|
+
return l ? l[e.label] : f ?? "";
|
|
1691
1699
|
}
|
|
1692
|
-
},
|
|
1700
|
+
}, wt = (t, n, f) => {
|
|
1693
1701
|
const e = {
|
|
1694
1702
|
defaultVal: "",
|
|
1695
1703
|
emptyText: "--",
|
|
1696
|
-
formatFun: (
|
|
1704
|
+
formatFun: (c, i) => c.map((d) => d[i.label]).join(","),
|
|
1697
1705
|
spacer: ","
|
|
1698
1706
|
};
|
|
1699
1707
|
Object.assign(e, f);
|
|
1708
|
+
let r = [];
|
|
1709
|
+
Array.isArray(t) ? r = t : typeof t == "string" && (r = t.split(e.spacer));
|
|
1710
|
+
const { format: a } = o.state.dictConfig, l = o.state.dictCodes;
|
|
1700
1711
|
let s = [];
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
if (!i || !i[a])
|
|
1705
|
-
c.actions.getDictDataObj(a).then((d) => {
|
|
1706
|
-
if (l = d[a], !l)
|
|
1712
|
+
if (!l || !l[n])
|
|
1713
|
+
o.actions.getDictDataObj(n).then((c) => {
|
|
1714
|
+
if (s = c[n], !s)
|
|
1707
1715
|
return;
|
|
1708
|
-
const
|
|
1716
|
+
const i = gt(
|
|
1717
|
+
r,
|
|
1709
1718
|
s,
|
|
1710
|
-
|
|
1711
|
-
n,
|
|
1719
|
+
a,
|
|
1712
1720
|
e.defaultVal,
|
|
1713
1721
|
e.emptyText
|
|
1714
1722
|
);
|
|
1715
|
-
return
|
|
1723
|
+
return i && i.length > 0 ? e.formatFun(i, a) : e.defaultVal;
|
|
1716
1724
|
});
|
|
1717
1725
|
else {
|
|
1718
|
-
|
|
1719
|
-
const
|
|
1720
|
-
return
|
|
1726
|
+
s = l[n];
|
|
1727
|
+
const c = gt(r, s, a, e.defaultVal, e.emptyText);
|
|
1728
|
+
return c && c.length > 0 ? e.formatFun(c, a) : e.defaultVal;
|
|
1721
1729
|
}
|
|
1722
|
-
},
|
|
1723
|
-
const { format: e } =
|
|
1724
|
-
let
|
|
1725
|
-
if (!
|
|
1726
|
-
|
|
1727
|
-
if (
|
|
1730
|
+
}, Se = (t, n, f) => {
|
|
1731
|
+
const { format: e } = o.state.dictConfig, r = o.state.dictCodes;
|
|
1732
|
+
let a = [];
|
|
1733
|
+
if (!r || !r[n])
|
|
1734
|
+
o.actions.getDictDataObj(n).then((l) => {
|
|
1735
|
+
if (a = l[n], !a)
|
|
1728
1736
|
return;
|
|
1729
|
-
const
|
|
1730
|
-
return
|
|
1737
|
+
const s = a.find((c) => c[e.label] === t);
|
|
1738
|
+
return s ? s[e.value] : f ?? "";
|
|
1731
1739
|
});
|
|
1732
1740
|
else {
|
|
1733
|
-
|
|
1734
|
-
const
|
|
1735
|
-
return
|
|
1741
|
+
a = r[n];
|
|
1742
|
+
const l = a.find((s) => s[e.label] === t);
|
|
1743
|
+
return l ? l[e.value] : f ?? "";
|
|
1736
1744
|
}
|
|
1737
|
-
},
|
|
1745
|
+
}, _e = (t, n, f) => {
|
|
1738
1746
|
const e = {
|
|
1739
1747
|
defaultVal: "",
|
|
1740
|
-
formatFun: (
|
|
1748
|
+
formatFun: (c, i) => c.map((d) => d[i.value]).join(","),
|
|
1741
1749
|
spacer: ","
|
|
1742
1750
|
};
|
|
1743
1751
|
Object.assign(e, f);
|
|
1752
|
+
let r = [];
|
|
1753
|
+
Array.isArray(t) ? r = t : typeof t == "string" && (r = t.split(e.spacer));
|
|
1754
|
+
const { format: a } = o.state.dictConfig, l = o.state.dictCodes;
|
|
1744
1755
|
let s = [];
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
if (!i || !i[a])
|
|
1749
|
-
c.actions.getDictDataObj(a).then((d) => {
|
|
1750
|
-
if (l = d[a], !l)
|
|
1756
|
+
if (!l || !l[n])
|
|
1757
|
+
o.actions.getDictDataObj(n).then((c) => {
|
|
1758
|
+
if (s = c[n], !s)
|
|
1751
1759
|
return;
|
|
1752
|
-
const
|
|
1760
|
+
const i = bt(
|
|
1761
|
+
r,
|
|
1753
1762
|
s,
|
|
1754
|
-
|
|
1755
|
-
n,
|
|
1763
|
+
a,
|
|
1756
1764
|
e.defaultVal
|
|
1757
1765
|
);
|
|
1758
|
-
return
|
|
1766
|
+
return i && i.length > 0 ? e.formatFun(i, a) : e.defaultVal;
|
|
1759
1767
|
});
|
|
1760
1768
|
else {
|
|
1761
|
-
|
|
1762
|
-
const
|
|
1763
|
-
return
|
|
1769
|
+
s = l[n];
|
|
1770
|
+
const c = bt(r, s, a, e.defaultVal);
|
|
1771
|
+
return c && c.length > 0 ? e.formatFun(c, a) : e.defaultVal;
|
|
1764
1772
|
}
|
|
1765
|
-
},
|
|
1773
|
+
}, Oe = (t, n, f) => {
|
|
1766
1774
|
const e = {
|
|
1767
1775
|
defaultVal: "",
|
|
1768
|
-
formatFun: (
|
|
1776
|
+
formatFun: (r, a) => r.map((l) => l[a.labelField]).join("/"),
|
|
1769
1777
|
treeSetting: {}
|
|
1770
1778
|
};
|
|
1771
|
-
return Object.assign(e, f), new Promise((
|
|
1772
|
-
const { treeSetting:
|
|
1773
|
-
let
|
|
1774
|
-
if (!
|
|
1775
|
-
if (
|
|
1776
|
-
const
|
|
1777
|
-
if (!(
|
|
1778
|
-
if (clearInterval(
|
|
1779
|
-
|
|
1779
|
+
return Object.assign(e, f), new Promise((r, a) => {
|
|
1780
|
+
const { treeSetting: l } = o.state.dictConfig, s = Object.assign(l, e.treeSetting), c = o.state.dictCodes;
|
|
1781
|
+
let i = [];
|
|
1782
|
+
if (!c || !c[n])
|
|
1783
|
+
if (o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes) {
|
|
1784
|
+
const d = setInterval(() => {
|
|
1785
|
+
if (!(o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes)) {
|
|
1786
|
+
if (clearInterval(d), i = o.state.dictCodes[n], !i) {
|
|
1787
|
+
a(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1780
1788
|
return;
|
|
1781
1789
|
}
|
|
1782
|
-
const
|
|
1783
|
-
|
|
1790
|
+
const m = i.find((p) => p[s.idField] === t);
|
|
1791
|
+
r(m ? e.formatFun(ct(m[s.idField], i, s), s) : e.defaultVal);
|
|
1784
1792
|
}
|
|
1785
1793
|
}, 1e3);
|
|
1786
1794
|
} else
|
|
1787
|
-
|
|
1788
|
-
if (
|
|
1789
|
-
|
|
1795
|
+
o.actions.getDictDataObj(n).then((d) => {
|
|
1796
|
+
if (i = d[n], !i) {
|
|
1797
|
+
a(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1790
1798
|
return;
|
|
1791
1799
|
}
|
|
1792
|
-
const
|
|
1793
|
-
|
|
1800
|
+
const m = i.find((p) => p[s.idField] === t);
|
|
1801
|
+
r(m ? e.formatFun(ct(m[s.idField], i, s), s) : e.defaultVal);
|
|
1794
1802
|
});
|
|
1795
1803
|
else {
|
|
1796
|
-
|
|
1797
|
-
const
|
|
1798
|
-
|
|
1804
|
+
i = c[n];
|
|
1805
|
+
const d = i.find((m) => m[s.idField] === t);
|
|
1806
|
+
r(d ? e.formatFun(ct(d[s.idField], i, s), s) : e.defaultVal);
|
|
1799
1807
|
}
|
|
1800
1808
|
});
|
|
1801
1809
|
};
|
|
1802
|
-
function mt(t,
|
|
1803
|
-
const
|
|
1804
|
-
for (let
|
|
1805
|
-
const
|
|
1806
|
-
|
|
1810
|
+
function mt(t, n, f, e, r, a = "--") {
|
|
1811
|
+
const l = [];
|
|
1812
|
+
for (let s = 0; s < t.length; s++) {
|
|
1813
|
+
const c = n.find((i) => i[r.idField] === t[s]);
|
|
1814
|
+
c ? l.push(e(ct(c[r.idField], n, r), r)) : l.push(f || t[s] || a);
|
|
1807
1815
|
}
|
|
1808
|
-
return
|
|
1816
|
+
return l;
|
|
1809
1817
|
}
|
|
1810
|
-
const
|
|
1818
|
+
const Fe = (t, n, f) => {
|
|
1811
1819
|
const e = {
|
|
1812
1820
|
defaultVal: "",
|
|
1813
1821
|
emptyText: "--",
|
|
1814
|
-
formatFunIn: (
|
|
1822
|
+
formatFunIn: (r, a) => r.map((l) => l[a.labelField]).join("/"),
|
|
1815
1823
|
treeSetting: {},
|
|
1816
|
-
formatFunOut: (
|
|
1824
|
+
formatFunOut: (r) => r.join(","),
|
|
1817
1825
|
spacer: ","
|
|
1818
1826
|
};
|
|
1819
|
-
return Object.assign(e, f), new Promise((
|
|
1820
|
-
let
|
|
1821
|
-
Array.isArray(t) ?
|
|
1822
|
-
const { treeSetting:
|
|
1823
|
-
let
|
|
1824
|
-
if (!
|
|
1825
|
-
if (
|
|
1826
|
-
const
|
|
1827
|
-
if (!(
|
|
1828
|
-
if (clearInterval(
|
|
1829
|
-
|
|
1827
|
+
return Object.assign(e, f), new Promise((r, a) => {
|
|
1828
|
+
let l = [];
|
|
1829
|
+
Array.isArray(t) ? l = t : typeof t == "string" && (l = t.split(e.spacer));
|
|
1830
|
+
const { treeSetting: s } = o.state.dictConfig, c = Object.assign(s, e.treeSetting), i = o.state.dictCodes;
|
|
1831
|
+
let d = [];
|
|
1832
|
+
if (!i || !i[n])
|
|
1833
|
+
if (o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes) {
|
|
1834
|
+
const m = setInterval(() => {
|
|
1835
|
+
if (!(o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes)) {
|
|
1836
|
+
if (clearInterval(m), d = o.state.dictCodes[n], !d) {
|
|
1837
|
+
a(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1830
1838
|
return;
|
|
1831
1839
|
}
|
|
1832
|
-
const
|
|
1833
|
-
|
|
1840
|
+
const p = mt(l, d, e.defaultVal, e.formatFunIn, c, e.emptyText);
|
|
1841
|
+
r(p && p.length > 0 ? e.formatFunOut(p) : e.defaultVal);
|
|
1834
1842
|
}
|
|
1835
1843
|
}, 1e3);
|
|
1836
1844
|
} else
|
|
1837
|
-
|
|
1838
|
-
if (
|
|
1839
|
-
|
|
1845
|
+
o.actions.getDictDataObj(n).then((m) => {
|
|
1846
|
+
if (d = m[n], !d) {
|
|
1847
|
+
a(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1840
1848
|
return;
|
|
1841
1849
|
}
|
|
1842
|
-
const
|
|
1843
|
-
|
|
1850
|
+
const p = mt(l, d, e.defaultVal, e.formatFunIn, c, e.emptyText);
|
|
1851
|
+
r(p && p.length > 0 ? e.formatFunOut(p) : e.defaultVal);
|
|
1844
1852
|
});
|
|
1845
1853
|
else {
|
|
1846
|
-
|
|
1847
|
-
const
|
|
1848
|
-
|
|
1854
|
+
d = i[n];
|
|
1855
|
+
const m = mt(l, d, e.defaultVal, e.formatFunIn, c, e.emptyText);
|
|
1856
|
+
r(m && m.length > 0 ? e.formatFunOut(m) : e.defaultVal);
|
|
1849
1857
|
}
|
|
1850
1858
|
});
|
|
1851
|
-
},
|
|
1859
|
+
}, he = (t, n, f) => {
|
|
1852
1860
|
const e = {
|
|
1853
1861
|
defaultVal: "",
|
|
1854
|
-
formatFun: (
|
|
1862
|
+
formatFun: (r, a) => r.map((l) => l[a.idField]).join("/"),
|
|
1855
1863
|
treeSetting: {}
|
|
1856
1864
|
};
|
|
1857
|
-
return Object.assign(e, f), new Promise((
|
|
1858
|
-
const { treeSetting:
|
|
1859
|
-
let
|
|
1860
|
-
if (!
|
|
1861
|
-
if (
|
|
1862
|
-
const
|
|
1863
|
-
if (!(
|
|
1864
|
-
if (clearInterval(
|
|
1865
|
-
|
|
1865
|
+
return Object.assign(e, f), new Promise((r, a) => {
|
|
1866
|
+
const { treeSetting: l } = o.state.dictConfig, s = Object.assign(l, e.treeSetting), c = o.state.dictCodes;
|
|
1867
|
+
let i = [];
|
|
1868
|
+
if (!c || !c[n])
|
|
1869
|
+
if (o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes) {
|
|
1870
|
+
const d = setInterval(() => {
|
|
1871
|
+
if (!(o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes)) {
|
|
1872
|
+
if (clearInterval(d), i = o.state.dictCodes[n], !i) {
|
|
1873
|
+
a(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1866
1874
|
return;
|
|
1867
1875
|
}
|
|
1868
|
-
const
|
|
1869
|
-
|
|
1876
|
+
const m = i.find((p) => p[s.labelField] === t);
|
|
1877
|
+
r(m ? e.formatFun(ut(m[s.labelField], i, s), s) : e.defaultVal);
|
|
1870
1878
|
}
|
|
1871
1879
|
}, 1e3);
|
|
1872
1880
|
} else
|
|
1873
|
-
|
|
1874
|
-
if (
|
|
1875
|
-
|
|
1881
|
+
o.actions.getDictDataObj(n).then((d) => {
|
|
1882
|
+
if (i = d[n], !i) {
|
|
1883
|
+
a(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1876
1884
|
return;
|
|
1877
1885
|
}
|
|
1878
|
-
const
|
|
1879
|
-
|
|
1886
|
+
const m = i.find((p) => p[s.labelField] === t);
|
|
1887
|
+
r(m ? e.formatFun(ut(m[s.labelField], i, s), s) : e.defaultVal);
|
|
1880
1888
|
});
|
|
1881
1889
|
else {
|
|
1882
|
-
|
|
1883
|
-
const
|
|
1884
|
-
|
|
1890
|
+
i = c[n];
|
|
1891
|
+
const d = i.find((m) => m[s.labelField] === t);
|
|
1892
|
+
r(d ? e.formatFun(ut(d[s.labelField], i, s), s) : e.defaultVal);
|
|
1885
1893
|
}
|
|
1886
1894
|
});
|
|
1887
1895
|
};
|
|
1888
|
-
function pt(t,
|
|
1889
|
-
const
|
|
1890
|
-
for (let
|
|
1891
|
-
const
|
|
1892
|
-
|
|
1896
|
+
function pt(t, n, f, e, r) {
|
|
1897
|
+
const a = [];
|
|
1898
|
+
for (let l = 0; l < t.length; l++) {
|
|
1899
|
+
const s = n.find((c) => c[r.labelField] === t[l]);
|
|
1900
|
+
s ? a.push(e(ut(s[r.labelField], n, r), r)) : a.push(f);
|
|
1893
1901
|
}
|
|
1894
|
-
return
|
|
1902
|
+
return a;
|
|
1895
1903
|
}
|
|
1896
|
-
const
|
|
1904
|
+
const Ce = (t, n, f) => {
|
|
1897
1905
|
const e = {
|
|
1898
1906
|
defaultVal: "",
|
|
1899
|
-
formatFunIn: (
|
|
1907
|
+
formatFunIn: (r, a) => r.map((l) => l[a.idField]).join("/"),
|
|
1900
1908
|
treeSetting: {},
|
|
1901
|
-
formatFunOut: (
|
|
1909
|
+
formatFunOut: (r) => r.join(","),
|
|
1902
1910
|
spacer: ","
|
|
1903
1911
|
};
|
|
1904
|
-
return Object.assign(e, f), new Promise((
|
|
1905
|
-
let
|
|
1906
|
-
Array.isArray(t) ?
|
|
1907
|
-
const { treeSetting:
|
|
1908
|
-
let
|
|
1909
|
-
if (!
|
|
1910
|
-
if (
|
|
1911
|
-
const
|
|
1912
|
-
if (!(
|
|
1913
|
-
if (clearInterval(
|
|
1914
|
-
|
|
1912
|
+
return Object.assign(e, f), new Promise((r, a) => {
|
|
1913
|
+
let l = [];
|
|
1914
|
+
Array.isArray(t) ? l = t : typeof t == "string" && (l = t.split(e.spacer));
|
|
1915
|
+
const { treeSetting: s } = o.state.dictConfig, c = Object.assign(s, e.treeSetting), i = o.state.dictCodes;
|
|
1916
|
+
let d = [];
|
|
1917
|
+
if (!i || !i[n])
|
|
1918
|
+
if (o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes) {
|
|
1919
|
+
const m = setInterval(() => {
|
|
1920
|
+
if (!(o.state.isGettingDictTypes.includes(n) || o.state.isGettingAllDictTypes)) {
|
|
1921
|
+
if (clearInterval(m), d = o.state.dictCodes[n], !d) {
|
|
1922
|
+
a(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1915
1923
|
return;
|
|
1916
1924
|
}
|
|
1917
|
-
const
|
|
1918
|
-
|
|
1925
|
+
const p = pt(l, d, e.defaultVal, e.formatFunIn, c);
|
|
1926
|
+
r(p && p.length > 0 ? e.formatFunOut(p) : e.defaultVal);
|
|
1919
1927
|
}
|
|
1920
1928
|
}, 1e3);
|
|
1921
1929
|
} else
|
|
1922
|
-
|
|
1923
|
-
if (
|
|
1924
|
-
|
|
1930
|
+
o.actions.getDictDataObj(n).then((m) => {
|
|
1931
|
+
if (d = m[n], !d) {
|
|
1932
|
+
a(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1925
1933
|
return;
|
|
1926
1934
|
}
|
|
1927
|
-
const
|
|
1928
|
-
|
|
1935
|
+
const p = pt(l, d, e.defaultVal, e.formatFunIn, c);
|
|
1936
|
+
r(p && p.length > 0 ? e.formatFunOut(p) : e.defaultVal);
|
|
1929
1937
|
});
|
|
1930
1938
|
else {
|
|
1931
|
-
|
|
1932
|
-
const
|
|
1933
|
-
|
|
1939
|
+
d = i[n];
|
|
1940
|
+
const m = pt(l, d, e.defaultVal, e.formatFunIn, c);
|
|
1941
|
+
r(m && m.length > 0 ? e.formatFunOut(m) : e.defaultVal);
|
|
1934
1942
|
}
|
|
1935
1943
|
});
|
|
1936
|
-
},
|
|
1944
|
+
}, je = (t, n, f) => {
|
|
1937
1945
|
const e = {
|
|
1938
1946
|
defaultVal: "",
|
|
1939
|
-
formatFun: (
|
|
1947
|
+
formatFun: (c, i) => c.map((d) => d[i.labelField]).join("/"),
|
|
1940
1948
|
treeSetting: {}
|
|
1941
1949
|
};
|
|
1942
1950
|
Object.assign(e, f);
|
|
1943
|
-
const { treeSetting:
|
|
1944
|
-
let
|
|
1945
|
-
if (!
|
|
1946
|
-
|
|
1947
|
-
if (
|
|
1948
|
-
return new Error(`不存在类型为:${
|
|
1949
|
-
const
|
|
1950
|
-
return
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1951
|
+
const { treeSetting: r } = o.state.dictConfig, a = Object.assign(r, e.treeSetting), l = o.state.dictCodes;
|
|
1952
|
+
let s = [];
|
|
1953
|
+
if (!l || !l[n])
|
|
1954
|
+
o.actions.getDictDataObj(n).then((c) => {
|
|
1955
|
+
if (s = c[n], !s)
|
|
1956
|
+
return new Error(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1957
|
+
const i = s.find((d) => d[a.idField] === t);
|
|
1958
|
+
return i ? e.formatFun(
|
|
1959
|
+
ct(
|
|
1960
|
+
i[a.idField],
|
|
1961
|
+
s,
|
|
1962
|
+
a
|
|
1955
1963
|
),
|
|
1956
|
-
|
|
1964
|
+
a
|
|
1957
1965
|
) : e.defaultVal;
|
|
1958
1966
|
});
|
|
1959
1967
|
else {
|
|
1960
|
-
|
|
1961
|
-
const
|
|
1962
|
-
return
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1968
|
+
s = l[n];
|
|
1969
|
+
const c = s.find((i) => i[a.idField] === t);
|
|
1970
|
+
return c ? e.formatFun(
|
|
1971
|
+
ct(
|
|
1972
|
+
c[a.idField],
|
|
1973
|
+
s,
|
|
1974
|
+
a
|
|
1967
1975
|
),
|
|
1968
|
-
|
|
1976
|
+
a
|
|
1969
1977
|
) : e.defaultVal;
|
|
1970
1978
|
}
|
|
1971
|
-
},
|
|
1979
|
+
}, Pt = (t, n, f) => {
|
|
1972
1980
|
const e = {
|
|
1973
1981
|
defaultVal: "",
|
|
1974
1982
|
emptyText: "--",
|
|
1975
|
-
formatFunIn: (
|
|
1983
|
+
formatFunIn: (i, d) => i.map((m) => m[d.labelField]).join("/"),
|
|
1976
1984
|
treeSetting: {},
|
|
1977
|
-
formatFunOut: (
|
|
1985
|
+
formatFunOut: (i) => i.join(","),
|
|
1978
1986
|
spacer: ","
|
|
1979
1987
|
};
|
|
1980
1988
|
Object.assign(e, f);
|
|
1981
|
-
let
|
|
1982
|
-
Array.isArray(t) ?
|
|
1983
|
-
const { treeSetting:
|
|
1984
|
-
let
|
|
1985
|
-
if (!
|
|
1986
|
-
|
|
1987
|
-
if (
|
|
1988
|
-
return new Error(`不存在类型为:${
|
|
1989
|
-
const
|
|
1990
|
-
|
|
1991
|
-
|
|
1989
|
+
let r = [];
|
|
1990
|
+
Array.isArray(t) ? r = t : typeof t == "string" && (r = t.split(e.spacer));
|
|
1991
|
+
const { treeSetting: a } = o.state.dictConfig, l = Object.assign(a, e.treeSetting), s = o.state.dictCodes;
|
|
1992
|
+
let c = [];
|
|
1993
|
+
if (!s || !s[n])
|
|
1994
|
+
o.actions.getDictDataObj(n).then((i) => {
|
|
1995
|
+
if (c = i[n], !c)
|
|
1996
|
+
return new Error(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
1997
|
+
const d = mt(
|
|
1998
|
+
r,
|
|
1999
|
+
c,
|
|
1992
2000
|
e.defaultVal,
|
|
1993
2001
|
e.formatFunIn,
|
|
1994
|
-
|
|
2002
|
+
l,
|
|
1995
2003
|
e.emptyText
|
|
1996
2004
|
);
|
|
1997
|
-
return
|
|
2005
|
+
return d && d.length > 0 ? e.formatFunOut(d) : e.defaultVal;
|
|
1998
2006
|
});
|
|
1999
2007
|
else {
|
|
2000
|
-
|
|
2001
|
-
const
|
|
2002
|
-
|
|
2003
|
-
|
|
2008
|
+
c = s[n];
|
|
2009
|
+
const i = mt(
|
|
2010
|
+
r,
|
|
2011
|
+
c,
|
|
2004
2012
|
e.defaultVal,
|
|
2005
2013
|
e.formatFunIn,
|
|
2006
|
-
|
|
2014
|
+
l,
|
|
2007
2015
|
e.emptyText
|
|
2008
2016
|
);
|
|
2009
|
-
return
|
|
2017
|
+
return i && i.length > 0 ? e.formatFunOut(i) : e.defaultVal;
|
|
2010
2018
|
}
|
|
2011
|
-
},
|
|
2019
|
+
}, Ie = (t, n, f) => {
|
|
2012
2020
|
const e = {
|
|
2013
2021
|
defaultVal: "",
|
|
2014
|
-
formatFun: (
|
|
2022
|
+
formatFun: (c, i) => c.map((d) => d[i.idField]).join("/"),
|
|
2015
2023
|
treeSetting: {}
|
|
2016
2024
|
};
|
|
2017
2025
|
Object.assign(e, f);
|
|
2018
|
-
const { treeSetting:
|
|
2019
|
-
let
|
|
2020
|
-
if (!
|
|
2021
|
-
|
|
2022
|
-
if (
|
|
2023
|
-
return new Error(`不存在类型为:${
|
|
2024
|
-
const
|
|
2025
|
-
return
|
|
2026
|
+
const { treeSetting: r } = o.state.dictConfig, a = Object.assign(r, e.treeSetting), l = o.state.dictCodes;
|
|
2027
|
+
let s = [];
|
|
2028
|
+
if (!l || !l[n])
|
|
2029
|
+
o.actions.getDictDataObj(n).then((c) => {
|
|
2030
|
+
if (s = c[n], !s)
|
|
2031
|
+
return new Error(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
2032
|
+
const i = s.find((d) => d[a.labelField] === t);
|
|
2033
|
+
return i ? e.formatFun(
|
|
2026
2034
|
ut(
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2035
|
+
i[a.labelField],
|
|
2036
|
+
s,
|
|
2037
|
+
a
|
|
2030
2038
|
),
|
|
2031
|
-
|
|
2039
|
+
a
|
|
2032
2040
|
) : e.defaultVal;
|
|
2033
2041
|
});
|
|
2034
2042
|
else {
|
|
2035
|
-
|
|
2036
|
-
const
|
|
2037
|
-
return
|
|
2043
|
+
s = l[n];
|
|
2044
|
+
const c = s.find((i) => i[a.labelField] === t);
|
|
2045
|
+
return c ? e.formatFun(
|
|
2038
2046
|
ut(
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2047
|
+
c[a.labelField],
|
|
2048
|
+
s,
|
|
2049
|
+
a
|
|
2042
2050
|
),
|
|
2043
|
-
|
|
2051
|
+
a
|
|
2044
2052
|
) : e.defaultVal;
|
|
2045
2053
|
}
|
|
2046
|
-
},
|
|
2054
|
+
}, Ae = (t, n, f) => {
|
|
2047
2055
|
const e = {
|
|
2048
2056
|
defaultVal: "",
|
|
2049
|
-
formatFunIn: (
|
|
2057
|
+
formatFunIn: (i, d) => i.map((m) => m[d.idField]).join("/"),
|
|
2050
2058
|
treeSetting: {},
|
|
2051
|
-
formatFunOut: (
|
|
2059
|
+
formatFunOut: (i) => i.join(","),
|
|
2052
2060
|
spacer: ","
|
|
2053
2061
|
};
|
|
2054
2062
|
Object.assign(e, f);
|
|
2055
|
-
let
|
|
2056
|
-
Array.isArray(t) ?
|
|
2057
|
-
const { treeSetting:
|
|
2058
|
-
let
|
|
2059
|
-
if (!
|
|
2060
|
-
|
|
2061
|
-
if (
|
|
2062
|
-
return new Error(`不存在类型为:${
|
|
2063
|
-
const
|
|
2064
|
-
|
|
2065
|
-
|
|
2063
|
+
let r = [];
|
|
2064
|
+
Array.isArray(t) ? r = t : typeof t == "string" && (r = t.split(e.spacer));
|
|
2065
|
+
const { treeSetting: a } = o.state.dictConfig, l = Object.assign(a, e.treeSetting), s = o.state.dictCodes;
|
|
2066
|
+
let c = [];
|
|
2067
|
+
if (!s || !s[n])
|
|
2068
|
+
o.actions.getDictDataObj(n).then((i) => {
|
|
2069
|
+
if (c = i[n], !c)
|
|
2070
|
+
return new Error(`不存在类型为:${n} 的字典字段,请确认后再填写`);
|
|
2071
|
+
const d = pt(
|
|
2072
|
+
r,
|
|
2073
|
+
c,
|
|
2066
2074
|
e.defaultVal,
|
|
2067
2075
|
e.formatFunIn,
|
|
2068
|
-
|
|
2076
|
+
l
|
|
2069
2077
|
);
|
|
2070
|
-
return
|
|
2078
|
+
return d && d.length > 0 ? e.formatFunOut(d) : e.defaultVal;
|
|
2071
2079
|
});
|
|
2072
2080
|
else {
|
|
2073
|
-
|
|
2074
|
-
const
|
|
2075
|
-
|
|
2076
|
-
|
|
2081
|
+
c = s[n];
|
|
2082
|
+
const i = pt(
|
|
2083
|
+
r,
|
|
2084
|
+
c,
|
|
2077
2085
|
e.defaultVal,
|
|
2078
2086
|
e.formatFunIn,
|
|
2079
|
-
|
|
2087
|
+
l
|
|
2080
2088
|
);
|
|
2081
|
-
return
|
|
2089
|
+
return i && i.length > 0 ? e.formatFunOut(i) : e.defaultVal;
|
|
2082
2090
|
}
|
|
2083
|
-
},
|
|
2091
|
+
}, Jt = {
|
|
2084
2092
|
date: "yyyy-MM-dd",
|
|
2085
2093
|
month: "yyyy-MM",
|
|
2086
2094
|
datetime: "yyyy-MM-dd hh:mm:ss",
|
|
2087
2095
|
time: "hh:mm:ss",
|
|
2088
2096
|
year: "yyyy"
|
|
2089
|
-
},
|
|
2090
|
-
const
|
|
2091
|
-
var f = new Date(t), e = new Date(
|
|
2097
|
+
}, Mt = (t) => {
|
|
2098
|
+
const n = t.replaceAll("-", "/");
|
|
2099
|
+
var f = new Date(t), e = new Date(n);
|
|
2092
2100
|
return !isNaN(f.getTime()) || !isNaN(e.getTime());
|
|
2093
|
-
},
|
|
2094
|
-
if (!t || !
|
|
2101
|
+
}, qt = (t, n = "datetime", f) => {
|
|
2102
|
+
if (!t || !n)
|
|
2095
2103
|
return f ?? "";
|
|
2096
|
-
Object.keys(
|
|
2104
|
+
Object.keys(Jt).includes(n) && (n = Jt[n]), t = Ge(t), t instanceof Date || (typeof t == "number" || Mt(t) ? t = new Date(t) : t = new Date(Number(t)));
|
|
2097
2105
|
const e = {
|
|
2098
2106
|
"M+": t.getMonth() + 1,
|
|
2099
2107
|
"d+": t.getDate(),
|
|
@@ -2103,59 +2111,59 @@ const Fe = (t, a, f) => {
|
|
|
2103
2111
|
"q+": Math.floor((t.getMonth() + 3) / 3),
|
|
2104
2112
|
S: t.getMilliseconds()
|
|
2105
2113
|
};
|
|
2106
|
-
/(y+)/.test(
|
|
2107
|
-
for (const
|
|
2108
|
-
const
|
|
2109
|
-
|
|
2114
|
+
/(y+)/.test(n) && (n = n.replace(RegExp.$1, String(t.getFullYear()).substr(4 - RegExp.$1.length)));
|
|
2115
|
+
for (const r in e) {
|
|
2116
|
+
const a = new RegExp(`(${r})`);
|
|
2117
|
+
a.test(n) && (n = n.replace(a, RegExp.$1.length === 1 ? e[r] : ("00" + e[r]).substr(String(e[r]).length)));
|
|
2110
2118
|
}
|
|
2111
|
-
return
|
|
2119
|
+
return n;
|
|
2112
2120
|
};
|
|
2113
|
-
function
|
|
2114
|
-
const
|
|
2115
|
-
if (!/^\d+$/.test(
|
|
2116
|
-
return
|
|
2117
|
-
const f =
|
|
2121
|
+
function Ge(t) {
|
|
2122
|
+
const n = String(t);
|
|
2123
|
+
if (!/^\d+$/.test(n))
|
|
2124
|
+
return n;
|
|
2125
|
+
const f = n.length;
|
|
2118
2126
|
if (f === 4)
|
|
2119
|
-
return `${
|
|
2127
|
+
return `${n}/01/01`;
|
|
2120
2128
|
if (f === 6) {
|
|
2121
|
-
const e =
|
|
2122
|
-
return `${e}/${
|
|
2129
|
+
const e = n.substring(0, 4), r = n.substring(4, 6);
|
|
2130
|
+
return `${e}/${r}/01`;
|
|
2123
2131
|
} else if (f === 8) {
|
|
2124
|
-
const e =
|
|
2125
|
-
return `${e}/${
|
|
2132
|
+
const e = n.substring(0, 4), r = n.substring(4, 6), a = n.substring(6, 8);
|
|
2133
|
+
return `${e}/${r}/${a}`;
|
|
2126
2134
|
} else if (f === 10) {
|
|
2127
|
-
const e =
|
|
2128
|
-
return `${e}/${
|
|
2135
|
+
const e = n.substring(0, 4), r = n.substring(4, 6), a = n.substring(6, 8), l = n.substring(8, 10);
|
|
2136
|
+
return `${e}/${r}/${a} ${l}:00:00`;
|
|
2129
2137
|
} else if (f === 12) {
|
|
2130
|
-
const e =
|
|
2131
|
-
return `${e}/${
|
|
2138
|
+
const e = n.substring(0, 4), r = n.substring(4, 6), a = n.substring(6, 8), l = n.substring(8, 10), s = n.substring(10, 12);
|
|
2139
|
+
return `${e}/${r}/${a} ${l}:${s}:00`;
|
|
2132
2140
|
} else if (f === 14) {
|
|
2133
|
-
const e =
|
|
2134
|
-
return `${e}/${
|
|
2141
|
+
const e = n.substring(0, 4), r = n.substring(4, 6), a = n.substring(6, 8), l = n.substring(8, 10), s = n.substring(10, 12), c = n.substring(12, 14);
|
|
2142
|
+
return `${e}/${r}/${a} ${l}:${s}:${c}`;
|
|
2135
2143
|
} else
|
|
2136
2144
|
return t;
|
|
2137
2145
|
}
|
|
2138
|
-
const ft = (t,
|
|
2146
|
+
const ft = (t, n) => {
|
|
2139
2147
|
let e = Object.assign({
|
|
2140
2148
|
start: 0,
|
|
2141
2149
|
end: 0,
|
|
2142
2150
|
middle: 0,
|
|
2143
2151
|
symbol: "*"
|
|
2144
|
-
},
|
|
2152
|
+
}, n);
|
|
2145
2153
|
if (e || (e = { start: 0, end: 0, symbol: "*" }), e.start < 0 || e.end < 0)
|
|
2146
2154
|
return "";
|
|
2147
|
-
const
|
|
2148
|
-
if (e.start + e.end + e.middle >
|
|
2155
|
+
const r = t.length;
|
|
2156
|
+
if (e.start + e.end + e.middle > r)
|
|
2149
2157
|
return t;
|
|
2150
|
-
let
|
|
2151
|
-
for (let
|
|
2152
|
-
|
|
2153
|
-
let
|
|
2154
|
-
for (let
|
|
2155
|
-
|
|
2156
|
-
const
|
|
2157
|
-
return
|
|
2158
|
-
},
|
|
2158
|
+
let a = "";
|
|
2159
|
+
for (let c = 0; c < e.start && c < r; c++)
|
|
2160
|
+
a += t.charAt(c);
|
|
2161
|
+
let l = "";
|
|
2162
|
+
for (let c = r - 1; c >= 0 && c >= r - e.end; c--)
|
|
2163
|
+
l = t.charAt(c) + l;
|
|
2164
|
+
const s = e.symbol.repeat(Math.max(e.middle || r - e.start - e.end, 0));
|
|
2165
|
+
return a + s + l;
|
|
2166
|
+
}, zt = (t, n = "*") => {
|
|
2159
2167
|
if (!t || typeof t != "string")
|
|
2160
2168
|
return t;
|
|
2161
2169
|
const f = [
|
|
@@ -2242,32 +2250,32 @@ const ft = (t, a) => {
|
|
|
2242
2250
|
"褚师"
|
|
2243
2251
|
];
|
|
2244
2252
|
if (f.some(
|
|
2245
|
-
(
|
|
2253
|
+
(r) => t.startsWith(r)
|
|
2246
2254
|
))
|
|
2247
|
-
return t.length <= 2 ? t : t.substring(0, 2) + (t.length > 2 ?
|
|
2255
|
+
return t.length <= 2 ? t : t.substring(0, 2) + (t.length > 2 ? n : "") + (t.length > 3 ? t.substring(3) : "");
|
|
2248
2256
|
{
|
|
2249
2257
|
if (t.length <= 1)
|
|
2250
2258
|
return t;
|
|
2251
|
-
const
|
|
2252
|
-
return t.length >= 4 && !f.includes(
|
|
2259
|
+
const r = t.substring(0, 2);
|
|
2260
|
+
return t.length >= 4 && !f.includes(r) && /^[\u4e00-\u9fa5]{2}$/.test(r) ? t.substring(0, 2) + (t.length > 2 ? n : "") + (t.length > 3 ? t.substring(3) : "") : t[0] + (t.length > 1 ? n : "") + (t.length > 2 ? t.substring(2) : "");
|
|
2253
2261
|
}
|
|
2254
|
-
},
|
|
2262
|
+
}, Kt = (t, n = "*") => t ? ft(t, { start: 4, end: 4, symbol: n }) : "", Yt = (t, n = "*") => t ? ft(String(t), { start: 3, end: 4, symbol: n }) : "", Ut = (t, n = "*") => {
|
|
2255
2263
|
if (!t)
|
|
2256
2264
|
return "";
|
|
2257
2265
|
const f = t.trim().split(/\s+/), e = f.length;
|
|
2258
|
-
let
|
|
2259
|
-
for (let
|
|
2260
|
-
/^[\u4e00-\u9fa5]+$/.test(f[
|
|
2261
|
-
return
|
|
2262
|
-
},
|
|
2263
|
-
mobile:
|
|
2264
|
-
name:
|
|
2265
|
-
address:
|
|
2266
|
-
idCard:
|
|
2267
|
-
},
|
|
2268
|
-
if (typeof
|
|
2269
|
-
maskType:
|
|
2270
|
-
}),
|
|
2266
|
+
let r = "";
|
|
2267
|
+
for (let a = 0; a < e; a++)
|
|
2268
|
+
/^[\u4e00-\u9fa5]+$/.test(f[a]) ? r += ft(f[a], { start: 1, symbol: n }) : r += ft(f[a], { start: 2, symbol: n }), a < e - 1 && (r += " ");
|
|
2269
|
+
return r;
|
|
2270
|
+
}, Ee = {
|
|
2271
|
+
mobile: Yt,
|
|
2272
|
+
name: zt,
|
|
2273
|
+
address: Ut,
|
|
2274
|
+
idCard: Kt
|
|
2275
|
+
}, Wt = (t, n) => {
|
|
2276
|
+
if (typeof n == "string" && (n = {
|
|
2277
|
+
maskType: n
|
|
2278
|
+
}), n.maskType === "none")
|
|
2271
2279
|
return t;
|
|
2272
2280
|
const f = {
|
|
2273
2281
|
start: 0,
|
|
@@ -2279,10 +2287,10 @@ const ft = (t, a) => {
|
|
|
2279
2287
|
defaultVal: "",
|
|
2280
2288
|
maskType: ""
|
|
2281
2289
|
};
|
|
2282
|
-
if (Object.assign(f,
|
|
2290
|
+
if (Object.assign(f, n), !t)
|
|
2283
2291
|
return f.defaultVal;
|
|
2284
2292
|
if (f.maskType)
|
|
2285
|
-
return
|
|
2293
|
+
return Ee[f.maskType](t, f.symbol);
|
|
2286
2294
|
const e = {
|
|
2287
2295
|
start: f.start,
|
|
2288
2296
|
end: f.end,
|
|
@@ -2290,10 +2298,10 @@ const ft = (t, a) => {
|
|
|
2290
2298
|
symbol: f.symbol
|
|
2291
2299
|
};
|
|
2292
2300
|
return ft(t, e);
|
|
2293
|
-
},
|
|
2301
|
+
}, Le = {
|
|
2294
2302
|
name: "ElTableColumnDict"
|
|
2295
|
-
},
|
|
2296
|
-
...
|
|
2303
|
+
}, Gt = /* @__PURE__ */ Q({
|
|
2304
|
+
...Le,
|
|
2297
2305
|
props: {
|
|
2298
2306
|
// 字典类型过滤使用 字典值找不到对应label时 不显示defaultVal字典值不为空时展示字典值,字典值为空时 显示emptyText
|
|
2299
2307
|
emptyText: {
|
|
@@ -2370,82 +2378,82 @@ const ft = (t, a) => {
|
|
|
2370
2378
|
}
|
|
2371
2379
|
}
|
|
2372
2380
|
},
|
|
2373
|
-
setup(t, { expose:
|
|
2381
|
+
setup(t, { expose: n }) {
|
|
2374
2382
|
const {
|
|
2375
2383
|
emptyText: f,
|
|
2376
2384
|
dictType: e,
|
|
2377
|
-
dictTreeType:
|
|
2378
|
-
dateFormat:
|
|
2379
|
-
defaultVal:
|
|
2380
|
-
treeSetting:
|
|
2381
|
-
formatFun:
|
|
2382
|
-
formatFunIn:
|
|
2383
|
-
formatFunOut:
|
|
2384
|
-
spacer:
|
|
2385
|
-
maskType:
|
|
2386
|
-
maskStart:
|
|
2385
|
+
dictTreeType: r,
|
|
2386
|
+
dateFormat: a,
|
|
2387
|
+
defaultVal: l,
|
|
2388
|
+
treeSetting: s,
|
|
2389
|
+
formatFun: c,
|
|
2390
|
+
formatFunIn: i,
|
|
2391
|
+
formatFunOut: d,
|
|
2392
|
+
spacer: m,
|
|
2393
|
+
maskType: p,
|
|
2394
|
+
maskStart: _,
|
|
2387
2395
|
maskEnd: j,
|
|
2388
2396
|
maskMiddle: I,
|
|
2389
2397
|
maskSymbol: C
|
|
2390
|
-
} = t, F = yt(),
|
|
2398
|
+
} = t, F = yt(), $ = E(() => {
|
|
2391
2399
|
let u = {};
|
|
2392
|
-
return
|
|
2400
|
+
return l && (u.defaultVal = l), f && (u.emptyText = f), c && (u.formatFun = c), m && (u.spacer = m), u;
|
|
2393
2401
|
}), O = E(() => {
|
|
2394
2402
|
let u = {};
|
|
2395
|
-
return
|
|
2396
|
-
}),
|
|
2403
|
+
return l && (u.defaultVal = l), f && (u.emptyText = f), i && (u.formatFunIn = i), d && (u.formatFunOut = d), s && (u.treeSetting = s), m && (u.spacer = m), u;
|
|
2404
|
+
}), v = E(() => {
|
|
2397
2405
|
const u = {};
|
|
2398
|
-
return
|
|
2399
|
-
}), g =
|
|
2400
|
-
return
|
|
2401
|
-
const
|
|
2402
|
-
return
|
|
2406
|
+
return l && (u.defaultVal = l), p && (u.maskType = p), _ && (u.start = _), j && (u.end = j), I && (u.middle = I), C && (u.symbol = C), u;
|
|
2407
|
+
}), g = B(null);
|
|
2408
|
+
return n({ getRef: () => g.value }), (u, y) => {
|
|
2409
|
+
const D = J("el-button-dict"), T = J("el-link-dict"), S = J("el-tag-dict"), A = J("el-text-dict"), V = J("el-table-column");
|
|
2410
|
+
return L(), x(V, rt({
|
|
2403
2411
|
ref_key: "ElTableColumnDict",
|
|
2404
2412
|
ref: g
|
|
2405
2413
|
}, u.$attrs), X({
|
|
2406
|
-
default:
|
|
2407
|
-
var q, G, R, z,
|
|
2414
|
+
default: k((N) => {
|
|
2415
|
+
var q, G, R, z, st, P, nt, K, vt;
|
|
2408
2416
|
return [
|
|
2409
|
-
t.dictType ? (
|
|
2410
|
-
t.dictTypeNode === "button" ? (
|
|
2417
|
+
t.dictType ? (L(), at(it, { key: 0 }, [
|
|
2418
|
+
t.dictTypeNode === "button" ? (L(), x(D, {
|
|
2411
2419
|
key: 0,
|
|
2412
|
-
value:
|
|
2420
|
+
value: N.row[(q = h(F)) == null ? void 0 : q.prop] || "",
|
|
2413
2421
|
dictType: t.dictType
|
|
2414
|
-
}, null, 8, ["value", "dictType"])) : t.dictTypeNode === "link" ? (
|
|
2422
|
+
}, null, 8, ["value", "dictType"])) : t.dictTypeNode === "link" ? (L(), x(T, {
|
|
2415
2423
|
key: 1,
|
|
2416
|
-
value:
|
|
2424
|
+
value: N.row[(G = h(F)) == null ? void 0 : G.prop] || "",
|
|
2417
2425
|
dictType: t.dictType
|
|
2418
|
-
}, null, 8, ["value", "dictType"])) : t.dictTypeNode === "tag" ? (
|
|
2426
|
+
}, null, 8, ["value", "dictType"])) : t.dictTypeNode === "tag" ? (L(), x(S, {
|
|
2419
2427
|
key: 2,
|
|
2420
|
-
value:
|
|
2428
|
+
value: N.row[(R = h(F)) == null ? void 0 : R.prop] || "",
|
|
2421
2429
|
dictType: t.dictType
|
|
2422
|
-
}, null, 8, ["value", "dictType"])) : t.dictTypeNode === "text" ? (
|
|
2430
|
+
}, null, 8, ["value", "dictType"])) : t.dictTypeNode === "text" ? (L(), x(A, {
|
|
2423
2431
|
key: 3,
|
|
2424
|
-
value:
|
|
2432
|
+
value: N.row[(z = h(F)) == null ? void 0 : z.prop] || "",
|
|
2425
2433
|
dictType: t.dictType
|
|
2426
|
-
}, null, 8, ["value", "dictType"])) : (
|
|
2427
|
-
H(
|
|
2434
|
+
}, null, 8, ["value", "dictType"])) : (L(), at(it, { key: 4 }, [
|
|
2435
|
+
W(H(h(wt)(N.row[(st = h(F)) == null ? void 0 : st.prop], t.dictType, h($))), 1)
|
|
2428
2436
|
], 64))
|
|
2429
|
-
], 64)) : t.dictTreeType ? (
|
|
2430
|
-
H(
|
|
2431
|
-
|
|
2437
|
+
], 64)) : t.dictTreeType ? (L(), at(it, { key: 1 }, [
|
|
2438
|
+
W(H(h(Pt)(
|
|
2439
|
+
N.row[(P = h(F)) == null ? void 0 : P.prop],
|
|
2432
2440
|
t.dictTreeType,
|
|
2433
2441
|
h(O)
|
|
2434
2442
|
)), 1)
|
|
2435
|
-
], 64)) : t.dateFormat ? (
|
|
2436
|
-
H(
|
|
2437
|
-
], 64)) : t.maskType || t.maskStart ? (
|
|
2438
|
-
H(
|
|
2439
|
-
], 64)) : (
|
|
2440
|
-
H(
|
|
2443
|
+
], 64)) : t.dateFormat ? (L(), at(it, { key: 2 }, [
|
|
2444
|
+
W(H(h(qt)(N.row[(nt = h(F)) == null ? void 0 : nt.prop], t.dateFormat, t.defaultVal)), 1)
|
|
2445
|
+
], 64)) : t.maskType || t.maskStart ? (L(), at(it, { key: 3 }, [
|
|
2446
|
+
W(H(h(Wt)(N.row[(K = h(F)) == null ? void 0 : K.prop], h(v))), 1)
|
|
2447
|
+
], 64)) : (L(), at(it, { key: 4 }, [
|
|
2448
|
+
W(H(N.row[(vt = h(F)) == null ? void 0 : vt.prop] || t.defaultVal), 1)
|
|
2441
2449
|
], 64))
|
|
2442
2450
|
];
|
|
2443
2451
|
}),
|
|
2444
2452
|
_: 2
|
|
2445
2453
|
}, [
|
|
2446
|
-
M(u.$slots, (
|
|
2454
|
+
M(u.$slots, (N, q, G) => ({
|
|
2447
2455
|
name: q,
|
|
2448
|
-
fn:
|
|
2456
|
+
fn: k((R) => [
|
|
2449
2457
|
Y(u.$slots, q, Z(tt(R)))
|
|
2450
2458
|
])
|
|
2451
2459
|
}))
|
|
@@ -2453,16 +2461,16 @@ const ft = (t, a) => {
|
|
|
2453
2461
|
};
|
|
2454
2462
|
}
|
|
2455
2463
|
});
|
|
2456
|
-
|
|
2457
|
-
t.component(
|
|
2464
|
+
Gt.install = function(t) {
|
|
2465
|
+
t.component(Gt.name, Gt);
|
|
2458
2466
|
};
|
|
2459
|
-
const
|
|
2467
|
+
const Ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2460
2468
|
__proto__: null,
|
|
2461
|
-
default:
|
|
2462
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2469
|
+
default: Gt
|
|
2470
|
+
}, Symbol.toStringTag, { value: "Module" })), $e = {
|
|
2463
2471
|
name: "ElTabsDict"
|
|
2464
|
-
},
|
|
2465
|
-
|
|
2472
|
+
}, Et = /* @__PURE__ */ Q({
|
|
2473
|
+
...$e,
|
|
2466
2474
|
props: {
|
|
2467
2475
|
// 自定义数据
|
|
2468
2476
|
data: {
|
|
@@ -2504,121 +2512,121 @@ const Ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2504
2512
|
}
|
|
2505
2513
|
},
|
|
2506
2514
|
emits: ["dictChange"],
|
|
2507
|
-
setup(t, { expose:
|
|
2515
|
+
setup(t, { expose: n, emit: f }) {
|
|
2508
2516
|
const {
|
|
2509
2517
|
data: e,
|
|
2510
|
-
format:
|
|
2511
|
-
badgeObj:
|
|
2512
|
-
dictType:
|
|
2513
|
-
disableObj:
|
|
2514
|
-
keyValue:
|
|
2515
|
-
filterDataFun:
|
|
2516
|
-
disabledDataFun:
|
|
2517
|
-
} = t,
|
|
2518
|
+
format: r,
|
|
2519
|
+
badgeObj: a,
|
|
2520
|
+
dictType: l,
|
|
2521
|
+
disableObj: s,
|
|
2522
|
+
keyValue: c,
|
|
2523
|
+
filterDataFun: i,
|
|
2524
|
+
disabledDataFun: d
|
|
2525
|
+
} = t, m = yt(), p = B(""), _ = et(o.state.dictConfig), j = (b) => {
|
|
2518
2526
|
window.setTimeout(() => {
|
|
2519
|
-
if (!
|
|
2520
|
-
f("dictChange",
|
|
2527
|
+
if (!c) {
|
|
2528
|
+
f("dictChange", m.modelValue);
|
|
2521
2529
|
return;
|
|
2522
2530
|
}
|
|
2523
|
-
const u = I.list.find((y) => y[
|
|
2531
|
+
const u = I.list.find((y) => y[_.format.value] === m.modelValue);
|
|
2524
2532
|
f("dictChange", u);
|
|
2525
2533
|
}, 0);
|
|
2526
|
-
}, I =
|
|
2534
|
+
}, I = lt({
|
|
2527
2535
|
list: []
|
|
2528
2536
|
}), C = async () => {
|
|
2529
|
-
if (!
|
|
2537
|
+
if (!l || e && e.length > 0)
|
|
2530
2538
|
return;
|
|
2531
|
-
let
|
|
2532
|
-
if (typeof
|
|
2533
|
-
|
|
2534
|
-
const u = await
|
|
2535
|
-
|
|
2539
|
+
let b = [];
|
|
2540
|
+
if (typeof l == "object") {
|
|
2541
|
+
p.value = l.type;
|
|
2542
|
+
const u = await o.actions.getDictDataObj(p.value);
|
|
2543
|
+
b = [].concat(u[p.value]);
|
|
2536
2544
|
const {
|
|
2537
2545
|
filters: y,
|
|
2538
|
-
filterType:
|
|
2539
|
-
reverse:
|
|
2540
|
-
} =
|
|
2541
|
-
|
|
2546
|
+
filterType: D = _.format.value,
|
|
2547
|
+
reverse: T = !1
|
|
2548
|
+
} = l, S = typeof y == "string" ? y.split(",") : y;
|
|
2549
|
+
T ? b = b.filter((A) => !S.includes(A[D])) : b = b.filter((A) => S.includes(A[D]));
|
|
2542
2550
|
} else {
|
|
2543
|
-
|
|
2544
|
-
const u = await
|
|
2545
|
-
|
|
2551
|
+
p.value = l;
|
|
2552
|
+
const u = await o.actions.getDictDataObj(p.value);
|
|
2553
|
+
b = [].concat(u[p.value]);
|
|
2546
2554
|
}
|
|
2547
|
-
if (
|
|
2555
|
+
if (i && (b = i(b)), d && (b = b.map((u) => ({
|
|
2548
2556
|
...u,
|
|
2549
|
-
[
|
|
2550
|
-
}))),
|
|
2557
|
+
[_.format.disabled]: !!u[_.format.disabled] || d(u)
|
|
2558
|
+
}))), s) {
|
|
2551
2559
|
const {
|
|
2552
2560
|
disableValue: u,
|
|
2553
|
-
disableType: y =
|
|
2554
|
-
reverse:
|
|
2555
|
-
} =
|
|
2556
|
-
|
|
2557
|
-
const A = JSON.parse(JSON.stringify(
|
|
2558
|
-
return A[
|
|
2559
|
-
}) :
|
|
2560
|
-
const A = JSON.parse(JSON.stringify(
|
|
2561
|
-
return A[
|
|
2561
|
+
disableType: y = _.format.value,
|
|
2562
|
+
reverse: D = !1
|
|
2563
|
+
} = s, T = typeof u == "string" ? u.split(",") : u;
|
|
2564
|
+
D ? b = b.map((S) => {
|
|
2565
|
+
const A = JSON.parse(JSON.stringify(S));
|
|
2566
|
+
return A[_.format.disabled] = !T.includes(A[y]) || A[_.format.disabled], A;
|
|
2567
|
+
}) : b = b.map((S) => {
|
|
2568
|
+
const A = JSON.parse(JSON.stringify(S));
|
|
2569
|
+
return A[_.format.disabled] = T.includes(A[y]) || A[_.format.disabled], A;
|
|
2562
2570
|
});
|
|
2563
2571
|
}
|
|
2564
|
-
I.list =
|
|
2565
|
-
}, F = E(() =>
|
|
2566
|
-
|
|
2567
|
-
[F,
|
|
2568
|
-
([
|
|
2569
|
-
!
|
|
2570
|
-
[
|
|
2571
|
-
[
|
|
2572
|
-
[
|
|
2573
|
-
...
|
|
2574
|
-
})) : I.list = I.list.map((
|
|
2575
|
-
[
|
|
2576
|
-
[
|
|
2572
|
+
I.list = b;
|
|
2573
|
+
}, F = E(() => o.state.isGettingDictTypes.includes(p.value)), $ = E(() => o.state.isGettingAllDictTypes), O = E(() => e);
|
|
2574
|
+
ot(
|
|
2575
|
+
[F, $, O],
|
|
2576
|
+
([b, u, y]) => {
|
|
2577
|
+
!b && !u && y && y.length === 0 && C(), y.length > 0 && (I.list = JSON.parse(JSON.stringify(y)), I.list.length > 0 && (Object.prototype.toString.call(I.list[0]) === "[object Object]" ? I.list = I.list.map((T) => ({
|
|
2578
|
+
[_.format.value]: T[r.value],
|
|
2579
|
+
[_.format.label]: T[r.label],
|
|
2580
|
+
[_.format.disabled]: !!T[r.disabled],
|
|
2581
|
+
...T
|
|
2582
|
+
})) : I.list = I.list.map((T) => ({
|
|
2583
|
+
[_.format.value]: T,
|
|
2584
|
+
[_.format.label]: T
|
|
2577
2585
|
}))));
|
|
2578
2586
|
},
|
|
2579
2587
|
{
|
|
2580
2588
|
immediate: !0
|
|
2581
2589
|
}
|
|
2582
2590
|
);
|
|
2583
|
-
const
|
|
2584
|
-
return
|
|
2585
|
-
const y = J("el-badge"),
|
|
2586
|
-
return
|
|
2591
|
+
const v = B(null);
|
|
2592
|
+
return n({ getRef: () => v.value }), (b, u) => {
|
|
2593
|
+
const y = J("el-badge"), D = J("el-tab-pane"), T = J("el-tabs");
|
|
2594
|
+
return L(), x(T, rt({
|
|
2587
2595
|
ref_key: "ElTabsDict",
|
|
2588
|
-
ref:
|
|
2596
|
+
ref: v,
|
|
2589
2597
|
class: "vue-element-dict-tabs"
|
|
2590
|
-
},
|
|
2591
|
-
default:
|
|
2592
|
-
(
|
|
2593
|
-
disabled:
|
|
2594
|
-
label:
|
|
2595
|
-
key:
|
|
2596
|
-
name:
|
|
2598
|
+
}, b.$attrs, { onTabClick: j }), {
|
|
2599
|
+
default: k(() => [
|
|
2600
|
+
(L(!0), at(it, null, M(I.list, (S) => (L(), x(D, {
|
|
2601
|
+
disabled: S[h(_).format.disabled],
|
|
2602
|
+
label: S[h(_).format.label],
|
|
2603
|
+
key: S[h(_).format.value],
|
|
2604
|
+
name: S[h(_).format.value]
|
|
2597
2605
|
}, X({
|
|
2598
|
-
default:
|
|
2599
|
-
Y(
|
|
2606
|
+
default: k(() => [
|
|
2607
|
+
Y(b.$slots, S[h(_).format.value])
|
|
2600
2608
|
]),
|
|
2601
2609
|
_: 2
|
|
2602
2610
|
}, [
|
|
2603
|
-
M(
|
|
2604
|
-
name:
|
|
2605
|
-
fn:
|
|
2606
|
-
Y(
|
|
2611
|
+
M(b.$slots, (A, V, N) => ({
|
|
2612
|
+
name: V,
|
|
2613
|
+
fn: k((q) => [
|
|
2614
|
+
Y(b.$slots, V, Z(tt(q)))
|
|
2607
2615
|
])
|
|
2608
2616
|
})),
|
|
2609
|
-
t.badgeObj[
|
|
2617
|
+
t.badgeObj[S[h(_).format.value]] ? {
|
|
2610
2618
|
name: "label",
|
|
2611
|
-
fn:
|
|
2612
|
-
|
|
2613
|
-
type: t.badgeObj[
|
|
2614
|
-
"is-dot": t.badgeObj[
|
|
2615
|
-
value: t.badgeObj[
|
|
2616
|
-
max: t.badgeObj[
|
|
2617
|
-
hidden: t.badgeObj[
|
|
2619
|
+
fn: k(() => [
|
|
2620
|
+
Qt(y, {
|
|
2621
|
+
type: t.badgeObj[S[h(_).format.value]].type,
|
|
2622
|
+
"is-dot": t.badgeObj[S[h(_).format.value]].isDot,
|
|
2623
|
+
value: t.badgeObj[S[h(_).format.value]].value,
|
|
2624
|
+
max: t.badgeObj[S[h(_).format.value]].max,
|
|
2625
|
+
hidden: t.badgeObj[S[h(_).format.value]].hidden,
|
|
2618
2626
|
class: "item"
|
|
2619
2627
|
}, {
|
|
2620
|
-
default:
|
|
2621
|
-
H(
|
|
2628
|
+
default: k(() => [
|
|
2629
|
+
W(H(S[h(_).format.label]), 1)
|
|
2622
2630
|
]),
|
|
2623
2631
|
_: 2
|
|
2624
2632
|
}, 1032, ["type", "is-dot", "value", "max", "hidden"])
|
|
@@ -2632,16 +2640,16 @@ const Ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2632
2640
|
};
|
|
2633
2641
|
}
|
|
2634
2642
|
});
|
|
2635
|
-
|
|
2636
|
-
t.component(
|
|
2643
|
+
Et.install = function(t) {
|
|
2644
|
+
t.component(Et.name, Et);
|
|
2637
2645
|
};
|
|
2638
|
-
const
|
|
2646
|
+
const Ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2639
2647
|
__proto__: null,
|
|
2640
|
-
default:
|
|
2641
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2648
|
+
default: Et
|
|
2649
|
+
}, Symbol.toStringTag, { value: "Module" })), ke = {
|
|
2642
2650
|
name: "ElTagDict"
|
|
2643
|
-
},
|
|
2644
|
-
...
|
|
2651
|
+
}, Lt = /* @__PURE__ */ Q({
|
|
2652
|
+
...ke,
|
|
2645
2653
|
props: {
|
|
2646
2654
|
value: {
|
|
2647
2655
|
type: [String, Number],
|
|
@@ -2667,48 +2675,48 @@ const Le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2667
2675
|
default: ""
|
|
2668
2676
|
}
|
|
2669
2677
|
},
|
|
2670
|
-
setup(t, { expose:
|
|
2671
|
-
const f = t, { value: e, dictType:
|
|
2672
|
-
let
|
|
2673
|
-
|
|
2674
|
-
Dt(e.value,
|
|
2675
|
-
|
|
2678
|
+
setup(t, { expose: n }) {
|
|
2679
|
+
const f = t, { value: e, dictType: r, judgeTypeFun: a, type: l, judgeColorFun: s, color: c } = kt(f), i = et(o.state.dictConfig), d = E(() => a != null && a.value ? a == null ? void 0 : a.value(e.value) : l.value ? l.value : p.value && p.value[i.format.type] ? p.value[i.format.type] : "success"), m = E(() => s != null && s.value ? s == null ? void 0 : s.value(e) : c.value ? c.value : p.value && p.value[i.format.color] ? p.value[i.format.color] : "");
|
|
2680
|
+
let p = B(null), _ = B(null);
|
|
2681
|
+
Bt(() => {
|
|
2682
|
+
Dt(e.value, r.value).then((C) => {
|
|
2683
|
+
p.value = C, _.value = C[i.format.label];
|
|
2676
2684
|
});
|
|
2677
2685
|
});
|
|
2678
|
-
const j =
|
|
2679
|
-
return
|
|
2680
|
-
const
|
|
2681
|
-
return
|
|
2686
|
+
const j = B(null);
|
|
2687
|
+
return n({ getRef: () => j.value }), (C, F) => {
|
|
2688
|
+
const $ = J("el-tag");
|
|
2689
|
+
return L(), x($, rt({
|
|
2682
2690
|
ref_key: "ElTagDict",
|
|
2683
2691
|
ref: j,
|
|
2684
|
-
type: h(
|
|
2685
|
-
color: h(
|
|
2692
|
+
type: h(d),
|
|
2693
|
+
color: h(m)
|
|
2686
2694
|
}, C.$attrs), X({
|
|
2687
|
-
default:
|
|
2688
|
-
|
|
2695
|
+
default: k(() => [
|
|
2696
|
+
W(" " + H(h(_)), 1)
|
|
2689
2697
|
]),
|
|
2690
2698
|
_: 2
|
|
2691
2699
|
}, [
|
|
2692
|
-
M(C.$slots, (O,
|
|
2693
|
-
name:
|
|
2694
|
-
fn:
|
|
2695
|
-
Y(C.$slots,
|
|
2700
|
+
M(C.$slots, (O, v, g) => ({
|
|
2701
|
+
name: v,
|
|
2702
|
+
fn: k((b) => [
|
|
2703
|
+
Y(C.$slots, v, Z(tt(b)))
|
|
2696
2704
|
])
|
|
2697
2705
|
}))
|
|
2698
2706
|
]), 1040, ["type", "color"]);
|
|
2699
2707
|
};
|
|
2700
2708
|
}
|
|
2701
2709
|
});
|
|
2702
|
-
|
|
2703
|
-
t.component(
|
|
2710
|
+
Lt.install = function(t) {
|
|
2711
|
+
t.component(Lt.name, Lt);
|
|
2704
2712
|
};
|
|
2705
|
-
const
|
|
2713
|
+
const Be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2706
2714
|
__proto__: null,
|
|
2707
|
-
default:
|
|
2708
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2715
|
+
default: Lt
|
|
2716
|
+
}, Symbol.toStringTag, { value: "Module" })), Je = {
|
|
2709
2717
|
name: "ElTextDict"
|
|
2710
2718
|
}, Nt = /* @__PURE__ */ Q({
|
|
2711
|
-
...
|
|
2719
|
+
...Je,
|
|
2712
2720
|
props: {
|
|
2713
2721
|
value: {
|
|
2714
2722
|
type: [String, Number],
|
|
@@ -2727,30 +2735,30 @@ const $e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2727
2735
|
default: ""
|
|
2728
2736
|
}
|
|
2729
2737
|
},
|
|
2730
|
-
setup(t, { expose:
|
|
2731
|
-
const f = t, { value: e, dictType:
|
|
2732
|
-
let
|
|
2733
|
-
|
|
2734
|
-
Dt(e.value,
|
|
2735
|
-
|
|
2738
|
+
setup(t, { expose: n }) {
|
|
2739
|
+
const f = t, { value: e, dictType: r, judgeTypeFun: a, type: l } = kt(f), s = et(o.state.dictConfig), c = E(() => a != null && a.value ? a == null ? void 0 : a.value(e.value) : l != null && l.value ? l.value : i.value && i.value[s.format.type] ? i.value[s.format.type] : "primary");
|
|
2740
|
+
let i = B(null), d = B(null);
|
|
2741
|
+
Bt(() => {
|
|
2742
|
+
Dt(e.value, r.value).then((_) => {
|
|
2743
|
+
i.value = _, d.value = _[s.format.label];
|
|
2736
2744
|
});
|
|
2737
2745
|
});
|
|
2738
|
-
const
|
|
2739
|
-
return
|
|
2746
|
+
const m = B(null);
|
|
2747
|
+
return n({ getRef: () => m.value }), (_, j) => {
|
|
2740
2748
|
const I = J("el-text");
|
|
2741
|
-
return
|
|
2749
|
+
return L(), x(I, rt({
|
|
2742
2750
|
ref: "ElTextDict",
|
|
2743
|
-
type: h(
|
|
2744
|
-
},
|
|
2745
|
-
default:
|
|
2746
|
-
|
|
2751
|
+
type: h(c)
|
|
2752
|
+
}, _.$attrs), X({
|
|
2753
|
+
default: k(() => [
|
|
2754
|
+
W(" " + H(h(d)), 1)
|
|
2747
2755
|
]),
|
|
2748
2756
|
_: 2
|
|
2749
2757
|
}, [
|
|
2750
|
-
M(
|
|
2758
|
+
M(_.$slots, (C, F, $) => ({
|
|
2751
2759
|
name: F,
|
|
2752
|
-
fn:
|
|
2753
|
-
Y(
|
|
2760
|
+
fn: k((O) => [
|
|
2761
|
+
Y(_.$slots, F, Z(tt(O)))
|
|
2754
2762
|
])
|
|
2755
2763
|
}))
|
|
2756
2764
|
]), 1040, ["type"]);
|
|
@@ -2760,13 +2768,13 @@ const $e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2760
2768
|
Nt.install = function(t) {
|
|
2761
2769
|
t.component(Nt.name, Nt);
|
|
2762
2770
|
};
|
|
2763
|
-
const
|
|
2771
|
+
const xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2764
2772
|
__proto__: null,
|
|
2765
2773
|
default: Nt
|
|
2766
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2774
|
+
}, Symbol.toStringTag, { value: "Module" })), Re = {
|
|
2767
2775
|
name: "ElTreeDict"
|
|
2768
|
-
},
|
|
2769
|
-
...
|
|
2776
|
+
}, $t = /* @__PURE__ */ Q({
|
|
2777
|
+
...Re,
|
|
2770
2778
|
props: {
|
|
2771
2779
|
//最大层级
|
|
2772
2780
|
maxLevel: {
|
|
@@ -2788,104 +2796,104 @@ const Be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2788
2796
|
type: Function
|
|
2789
2797
|
}
|
|
2790
2798
|
},
|
|
2791
|
-
setup(t, { expose:
|
|
2792
|
-
const { maxLevel: f, dictType: e, disableObj:
|
|
2799
|
+
setup(t, { expose: n }) {
|
|
2800
|
+
const { maxLevel: f, dictType: e, disableObj: r, filterDataFun: a, disabledDataFun: l } = t, s = yt(), c = B(""), i = et(o.state.dictConfig), d = lt({
|
|
2793
2801
|
list: []
|
|
2794
|
-
}),
|
|
2802
|
+
}), m = (O, v) => {
|
|
2795
2803
|
for (let g = 0; g < O.length; g++) {
|
|
2796
|
-
const
|
|
2797
|
-
if (
|
|
2798
|
-
delete
|
|
2804
|
+
const b = O[g];
|
|
2805
|
+
if (b[i.treeSetting.levelField] === v) {
|
|
2806
|
+
delete b[I.value.children], b[I.value.isLeaf] = !0;
|
|
2799
2807
|
continue;
|
|
2800
2808
|
} else
|
|
2801
|
-
b
|
|
2809
|
+
m(b[I.value.children], v);
|
|
2802
2810
|
}
|
|
2803
|
-
},
|
|
2811
|
+
}, p = async () => {
|
|
2804
2812
|
if (!e)
|
|
2805
2813
|
return;
|
|
2806
2814
|
let O = [];
|
|
2807
2815
|
if (typeof e == "object") {
|
|
2808
|
-
|
|
2809
|
-
const
|
|
2810
|
-
O = [].concat(
|
|
2816
|
+
c.value = e.type;
|
|
2817
|
+
const v = await o.actions.getDictDataObj(c.value);
|
|
2818
|
+
O = [].concat(v[c.value]);
|
|
2811
2819
|
const {
|
|
2812
2820
|
filters: g,
|
|
2813
|
-
filterType:
|
|
2821
|
+
filterType: b = i.format.value,
|
|
2814
2822
|
reverse: u = !1
|
|
2815
2823
|
} = e, y = typeof g == "string" ? g.split(",") : g;
|
|
2816
|
-
u ? O = O.filter((
|
|
2824
|
+
u ? O = O.filter((D) => !y.includes(D[b])) : O = O.filter((D) => y.includes(D[b]));
|
|
2817
2825
|
} else {
|
|
2818
|
-
|
|
2819
|
-
const
|
|
2820
|
-
O = [].concat(
|
|
2826
|
+
c.value = e;
|
|
2827
|
+
const v = await o.actions.getDictDataObj(c.value);
|
|
2828
|
+
O = [].concat(v[c.value]);
|
|
2821
2829
|
}
|
|
2822
|
-
if (
|
|
2823
|
-
...
|
|
2824
|
-
[
|
|
2825
|
-
}))),
|
|
2830
|
+
if (a && (O = a(O)), l && (O = O.map((v) => ({
|
|
2831
|
+
...v,
|
|
2832
|
+
[i.format.disabled]: !!v[i.format.disabled] || l(v)
|
|
2833
|
+
}))), r) {
|
|
2826
2834
|
const {
|
|
2827
|
-
disableValue:
|
|
2828
|
-
disableType: g =
|
|
2829
|
-
reverse:
|
|
2830
|
-
} =
|
|
2831
|
-
|
|
2832
|
-
const
|
|
2833
|
-
return
|
|
2835
|
+
disableValue: v,
|
|
2836
|
+
disableType: g = i.format.value,
|
|
2837
|
+
reverse: b = !1
|
|
2838
|
+
} = r, u = typeof v == "string" ? v.split(",") : v;
|
|
2839
|
+
b ? O = O.map((y) => {
|
|
2840
|
+
const D = JSON.parse(JSON.stringify(y));
|
|
2841
|
+
return D[i.format.disabled] = !u.includes(D[g]) || D[i.format.disabled], D;
|
|
2834
2842
|
}) : O = O.map((y) => {
|
|
2835
|
-
const
|
|
2836
|
-
return
|
|
2843
|
+
const D = JSON.parse(JSON.stringify(y));
|
|
2844
|
+
return D[i.format.disabled] = u.includes(D[g]) || D[i.format.disabled], D;
|
|
2837
2845
|
});
|
|
2838
2846
|
}
|
|
2839
|
-
|
|
2840
|
-
},
|
|
2841
|
-
const O =
|
|
2842
|
-
return O.disabled = O.disabled ??
|
|
2847
|
+
d.list = O;
|
|
2848
|
+
}, _ = E(() => o.state.isGettingDictTypes.includes(c.value)), j = E(() => o.state.isGettingAllDictTypes), I = E(() => {
|
|
2849
|
+
const O = s.props ?? {};
|
|
2850
|
+
return O.disabled = O.disabled ?? o.state.dictConfig.format.disabled, O.label = O.label ?? o.state.dictConfig.treeSetting.labelField, O.children = O.children ?? o.state.dictConfig.treeSetting.childrenField, O.isLeaf = O.leaf ?? o.state.dictConfig.treeSetting.leafField, O;
|
|
2843
2851
|
}), C = E(() => {
|
|
2844
|
-
const O =
|
|
2845
|
-
labelField: O.label ??
|
|
2846
|
-
childrenField: O.children ??
|
|
2847
|
-
leafField: O.leaf ??
|
|
2848
|
-
}, g = Object.assign(
|
|
2849
|
-
return f &&
|
|
2852
|
+
const O = s.props ?? {}, v = {
|
|
2853
|
+
labelField: O.label ?? i.treeSetting.labelField,
|
|
2854
|
+
childrenField: O.children ?? i.treeSetting.childrenField,
|
|
2855
|
+
leafField: O.leaf ?? i.treeSetting.leafField
|
|
2856
|
+
}, g = Object.assign(o.state.dictConfig.treeSetting, v), b = JSON.parse(JSON.stringify(d.list)), u = Tt(b, g);
|
|
2857
|
+
return f && m(u, +f), u;
|
|
2850
2858
|
});
|
|
2851
|
-
|
|
2852
|
-
[
|
|
2853
|
-
([O,
|
|
2854
|
-
!O && !
|
|
2859
|
+
ot(
|
|
2860
|
+
[_, j],
|
|
2861
|
+
([O, v]) => {
|
|
2862
|
+
!O && !v && p();
|
|
2855
2863
|
},
|
|
2856
2864
|
{
|
|
2857
2865
|
immediate: !0
|
|
2858
2866
|
}
|
|
2859
2867
|
);
|
|
2860
|
-
const F =
|
|
2861
|
-
return
|
|
2868
|
+
const F = B(null);
|
|
2869
|
+
return n({ getRef: () => F.value }), (O, v) => {
|
|
2862
2870
|
const g = J("el-tree");
|
|
2863
|
-
return
|
|
2871
|
+
return L(), x(g, {
|
|
2864
2872
|
ref_key: "ElTreeDict",
|
|
2865
2873
|
ref: F,
|
|
2866
2874
|
data: h(C),
|
|
2867
2875
|
props: h(I)
|
|
2868
2876
|
}, X({ _: 2 }, [
|
|
2869
|
-
M(O.$slots, (
|
|
2877
|
+
M(O.$slots, (b, u, y) => ({
|
|
2870
2878
|
name: u,
|
|
2871
|
-
fn:
|
|
2872
|
-
Y(O.$slots, u, Z(tt(
|
|
2879
|
+
fn: k((D) => [
|
|
2880
|
+
Y(O.$slots, u, Z(tt(D)))
|
|
2873
2881
|
])
|
|
2874
2882
|
}))
|
|
2875
2883
|
]), 1032, ["data", "props"]);
|
|
2876
2884
|
};
|
|
2877
2885
|
}
|
|
2878
2886
|
});
|
|
2879
|
-
|
|
2880
|
-
t.component(
|
|
2887
|
+
$t.install = function(t) {
|
|
2888
|
+
t.component($t.name, $t);
|
|
2881
2889
|
};
|
|
2882
|
-
const
|
|
2890
|
+
const we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2883
2891
|
__proto__: null,
|
|
2884
|
-
default:
|
|
2885
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2892
|
+
default: $t
|
|
2893
|
+
}, Symbol.toStringTag, { value: "Module" })), Pe = {
|
|
2886
2894
|
name: "ElTreeSelectDict"
|
|
2887
2895
|
}, Vt = /* @__PURE__ */ Q({
|
|
2888
|
-
...
|
|
2896
|
+
...Pe,
|
|
2889
2897
|
props: {
|
|
2890
2898
|
//最大层级
|
|
2891
2899
|
maxLevel: {
|
|
@@ -2893,7 +2901,7 @@ const xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2893
2901
|
},
|
|
2894
2902
|
nodeKey: {
|
|
2895
2903
|
type: String,
|
|
2896
|
-
default:
|
|
2904
|
+
default: o.state.dictConfig.treeSetting.idField
|
|
2897
2905
|
},
|
|
2898
2906
|
dictType: {
|
|
2899
2907
|
type: [String, Object],
|
|
@@ -2911,89 +2919,89 @@ const xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2911
2919
|
type: Function
|
|
2912
2920
|
}
|
|
2913
2921
|
},
|
|
2914
|
-
setup(t, { expose:
|
|
2915
|
-
const { maxLevel: f, nodeKey: e, dictType:
|
|
2922
|
+
setup(t, { expose: n }) {
|
|
2923
|
+
const { maxLevel: f, nodeKey: e, dictType: r, disableObj: a, filterDataFun: l, disabledDataFun: s } = t, c = yt(), i = B(""), d = et(o.state.dictConfig), m = lt({
|
|
2916
2924
|
list: []
|
|
2917
|
-
}),
|
|
2918
|
-
for (let
|
|
2919
|
-
const u =
|
|
2920
|
-
if (u[
|
|
2925
|
+
}), p = (v, g) => {
|
|
2926
|
+
for (let b = 0; b < v.length; b++) {
|
|
2927
|
+
const u = v[b];
|
|
2928
|
+
if (u[d.treeSetting.levelField] === g) {
|
|
2921
2929
|
delete u[C.value.children], u[C.value.isLeaf] = !0;
|
|
2922
2930
|
continue;
|
|
2923
2931
|
} else
|
|
2924
|
-
|
|
2932
|
+
p(u[C.value.children], g);
|
|
2925
2933
|
}
|
|
2926
|
-
},
|
|
2927
|
-
if (!
|
|
2934
|
+
}, _ = async () => {
|
|
2935
|
+
if (!r)
|
|
2928
2936
|
return;
|
|
2929
|
-
let
|
|
2930
|
-
if (typeof
|
|
2931
|
-
|
|
2932
|
-
const g = await
|
|
2933
|
-
|
|
2937
|
+
let v = [];
|
|
2938
|
+
if (typeof r == "object") {
|
|
2939
|
+
i.value = r.type;
|
|
2940
|
+
const g = await o.actions.getDictDataObj(i.value);
|
|
2941
|
+
v = [].concat(g[i.value]);
|
|
2934
2942
|
const {
|
|
2935
|
-
filters:
|
|
2936
|
-
filterType: u =
|
|
2943
|
+
filters: b,
|
|
2944
|
+
filterType: u = d.format.value,
|
|
2937
2945
|
reverse: y = !1
|
|
2938
|
-
} =
|
|
2939
|
-
y ?
|
|
2946
|
+
} = r, D = typeof b == "string" ? b.split(",") : b;
|
|
2947
|
+
y ? v = v.filter((T) => !D.includes(T[u])) : v = v.filter((T) => D.includes(T[u]));
|
|
2940
2948
|
} else {
|
|
2941
|
-
|
|
2942
|
-
const g = await
|
|
2943
|
-
|
|
2949
|
+
i.value = r;
|
|
2950
|
+
const g = await o.actions.getDictDataObj(i.value);
|
|
2951
|
+
v = [].concat(g[i.value]);
|
|
2944
2952
|
}
|
|
2945
|
-
if (
|
|
2953
|
+
if (l && (v = l(v)), s && (v = v.map((g) => ({
|
|
2946
2954
|
...g,
|
|
2947
|
-
[
|
|
2948
|
-
}))),
|
|
2955
|
+
[d.format.disabled]: !!g[d.format.disabled] || s(g)
|
|
2956
|
+
}))), a) {
|
|
2949
2957
|
const {
|
|
2950
2958
|
disableValue: g,
|
|
2951
|
-
disableType:
|
|
2959
|
+
disableType: b = d.format.value,
|
|
2952
2960
|
reverse: u = !1
|
|
2953
|
-
} =
|
|
2954
|
-
u ?
|
|
2955
|
-
const
|
|
2956
|
-
return
|
|
2957
|
-
}) :
|
|
2958
|
-
const
|
|
2959
|
-
return
|
|
2961
|
+
} = a, y = typeof g == "string" ? g.split(",") : g;
|
|
2962
|
+
u ? v = v.map((D) => {
|
|
2963
|
+
const T = JSON.parse(JSON.stringify(D));
|
|
2964
|
+
return T[d.format.disabled] = !y.includes(T[b]) || T[d.format.disabled], T;
|
|
2965
|
+
}) : v = v.map((D) => {
|
|
2966
|
+
const T = JSON.parse(JSON.stringify(D));
|
|
2967
|
+
return T[d.format.disabled] = y.includes(T[b]) || T[d.format.disabled], T;
|
|
2960
2968
|
});
|
|
2961
2969
|
}
|
|
2962
|
-
|
|
2963
|
-
}, j = E(() =>
|
|
2964
|
-
const
|
|
2965
|
-
return
|
|
2970
|
+
m.list = v;
|
|
2971
|
+
}, j = E(() => o.state.isGettingDictTypes.includes(i.value)), I = E(() => o.state.isGettingAllDictTypes), C = E(() => {
|
|
2972
|
+
const v = c.props ?? {};
|
|
2973
|
+
return v.disabled = v.disabled ?? o.state.dictConfig.format.disabled, v.label = v.label ?? o.state.dictConfig.treeSetting.labelField, v.children = v.children ?? o.state.dictConfig.treeSetting.childrenField, v.isLeaf = v.leaf ?? o.state.dictConfig.treeSetting.leafField, v;
|
|
2966
2974
|
}), F = E(() => {
|
|
2967
|
-
const
|
|
2968
|
-
labelField:
|
|
2969
|
-
childrenField:
|
|
2970
|
-
leafField:
|
|
2971
|
-
},
|
|
2972
|
-
return f &&
|
|
2975
|
+
const v = c.props ?? {}, g = {
|
|
2976
|
+
labelField: v.label ?? d.treeSetting.labelField,
|
|
2977
|
+
childrenField: v.children ?? d.treeSetting.childrenField,
|
|
2978
|
+
leafField: v.leaf ?? d.treeSetting.leafField
|
|
2979
|
+
}, b = Object.assign(o.state.dictConfig.treeSetting, g), u = JSON.parse(JSON.stringify(m.list)), y = Tt(u, b);
|
|
2980
|
+
return f && p(y, +f), y;
|
|
2973
2981
|
});
|
|
2974
|
-
|
|
2982
|
+
ot(
|
|
2975
2983
|
[j, I],
|
|
2976
|
-
([
|
|
2977
|
-
!
|
|
2984
|
+
([v, g]) => {
|
|
2985
|
+
!v && !g && _();
|
|
2978
2986
|
},
|
|
2979
2987
|
{
|
|
2980
2988
|
immediate: !0
|
|
2981
2989
|
}
|
|
2982
2990
|
);
|
|
2983
|
-
const
|
|
2984
|
-
return
|
|
2985
|
-
const
|
|
2986
|
-
return
|
|
2991
|
+
const $ = B(null);
|
|
2992
|
+
return n({ getRef: () => $.value }), (v, g) => {
|
|
2993
|
+
const b = J("el-tree-select");
|
|
2994
|
+
return L(), x(b, {
|
|
2987
2995
|
ref_key: "ElTreeSelectDict",
|
|
2988
|
-
ref:
|
|
2996
|
+
ref: $,
|
|
2989
2997
|
data: h(F),
|
|
2990
2998
|
"node-key": t.nodeKey,
|
|
2991
2999
|
props: h(C)
|
|
2992
3000
|
}, X({ _: 2 }, [
|
|
2993
|
-
M(
|
|
3001
|
+
M(v.$slots, (u, y, D) => ({
|
|
2994
3002
|
name: y,
|
|
2995
|
-
fn:
|
|
2996
|
-
Y(
|
|
3003
|
+
fn: k((T) => [
|
|
3004
|
+
Y(v.$slots, y, Z(tt(T)))
|
|
2997
3005
|
])
|
|
2998
3006
|
}))
|
|
2999
3007
|
]), 1032, ["data", "node-key", "props"]);
|
|
@@ -3003,60 +3011,63 @@ const xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3003
3011
|
Vt.install = function(t) {
|
|
3004
3012
|
t.component(Vt.name, Vt);
|
|
3005
3013
|
};
|
|
3006
|
-
const
|
|
3014
|
+
const Me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3007
3015
|
__proto__: null,
|
|
3008
3016
|
default: Vt
|
|
3009
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3010
|
-
"./el-button-dict/index.ts":
|
|
3011
|
-
"./el-cascader-dict/index.ts":
|
|
3012
|
-
"./el-checkbox-button-dict/index.ts":
|
|
3013
|
-
"./el-checkbox-dict/index.ts":
|
|
3014
|
-
"./el-link-dict/index.ts":
|
|
3015
|
-
"./el-radio-button-dict/index.ts":
|
|
3016
|
-
"./el-radio-dict/index.ts":
|
|
3017
|
-
"./el-select-dict/index.ts":
|
|
3018
|
-
"./el-table-column-dict/index.ts":
|
|
3019
|
-
"./el-tabs-dict/index.ts":
|
|
3020
|
-
"./el-tag-dict/index.ts":
|
|
3021
|
-
"./el-text-dict/index.ts":
|
|
3022
|
-
"./el-tree-dict/index.ts":
|
|
3023
|
-
"./el-tree-select-dict/index.ts":
|
|
3017
|
+
}, Symbol.toStringTag, { value: "Module" })), xt = /* @__PURE__ */ Object.assign({
|
|
3018
|
+
"./el-button-dict/index.ts": le,
|
|
3019
|
+
"./el-cascader-dict/index.ts": se,
|
|
3020
|
+
"./el-checkbox-button-dict/index.ts": ce,
|
|
3021
|
+
"./el-checkbox-dict/index.ts": de,
|
|
3022
|
+
"./el-link-dict/index.ts": ge,
|
|
3023
|
+
"./el-radio-button-dict/index.ts": me,
|
|
3024
|
+
"./el-radio-dict/index.ts": ye,
|
|
3025
|
+
"./el-select-dict/index.ts": Te,
|
|
3026
|
+
"./el-table-column-dict/index.ts": Ne,
|
|
3027
|
+
"./el-tabs-dict/index.ts": Ve,
|
|
3028
|
+
"./el-tag-dict/index.ts": Be,
|
|
3029
|
+
"./el-text-dict/index.ts": xe,
|
|
3030
|
+
"./el-tree-dict/index.ts": we,
|
|
3031
|
+
"./el-tree-select-dict/index.ts": Me
|
|
3024
3032
|
});
|
|
3025
|
-
let
|
|
3026
|
-
Object.keys(
|
|
3027
|
-
|
|
3033
|
+
let Ht = [];
|
|
3034
|
+
Object.keys(xt).forEach((t) => {
|
|
3035
|
+
Ht.push(xt[t].default);
|
|
3028
3036
|
});
|
|
3029
|
-
const
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3037
|
+
const qe = () => o.state.dictConfig, ze = (t) => o.state.dictConfig[t], Ke = () => o.state.dictCodes, Ye = (t) => o.state.dictCodes[t], We = qe, He = ze, Qe = Ke, Xe = Ye, Ze = Zt, tn = te, en = ee, nn = ne, an = ae, ln = Dt, rn = ve, sn = wt, on = Se, cn = _e, un = ft, dn = Ut, fn = Kt, gn = zt, bn = Yt, mn = Wt, pn = qt, yn = Mt, Dn = Tt, Tn = ct, vn = ut, Sn = Oe, _n = he, On = Fe, Fn = Ce, hn = je, Cn = Ie, jn = Pt, In = Ae;
|
|
3038
|
+
let St = null;
|
|
3039
|
+
async function Rt(t) {
|
|
3040
|
+
var s;
|
|
3041
|
+
const n = t.storage.getItem(t.dictDataKey) || "{}", f = JSON.parse(n), e = t.usuallyGetDictTypes ? t.usuallyGetDictTypes.split(",") : [], r = Object.keys(t.localDictCodes), a = e.filter((c) => r.includes(c) ? (console.warn(`注意:usuallyGetDictTypes配置与本地字典配置的字典类型${c}冲突`), !1) : !0);
|
|
3042
|
+
let l = [];
|
|
3034
3043
|
if (t.usuallyGetDictTypesByApi)
|
|
3035
|
-
|
|
3036
|
-
else if (
|
|
3037
|
-
for (let
|
|
3038
|
-
f[
|
|
3039
|
-
if (
|
|
3040
|
-
let
|
|
3041
|
-
t.isGetAll ? (
|
|
3042
|
-
t.formatterRequest(t.query,
|
|
3043
|
-
),
|
|
3044
|
-
t.formatterRequest(t.query,
|
|
3045
|
-
),
|
|
3046
|
-
const d = t.formatterDictList(
|
|
3047
|
-
t.storage.setItem(t.versionKey,
|
|
3048
|
-
const
|
|
3049
|
-
|
|
3044
|
+
l = a;
|
|
3045
|
+
else if (a.length > 0)
|
|
3046
|
+
for (let c = 0; c < a.length; c++)
|
|
3047
|
+
f[a[c]] || l.push(a[c]);
|
|
3048
|
+
if (n === "{}" || t.isGetAll || l.length > 0) {
|
|
3049
|
+
let c, i = "";
|
|
3050
|
+
t.isGetAll ? (o.mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!0), c = await t.getDictCodeApi(
|
|
3051
|
+
t.formatterRequest(t.query, i)
|
|
3052
|
+
), o.mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!1)) : l.length > 0 && (i = l.join(","), o.mutations.ADD_IS_GETTING_DICT_TYPES(i), c = await t.getDictCodeApi(
|
|
3053
|
+
t.formatterRequest(t.query, i)
|
|
3054
|
+
), o.mutations.REMOVE_IS_GETTING_DICT_TYPES(i));
|
|
3055
|
+
const d = t.formatterDictList(c, i), m = t.formatterDictVersion(c);
|
|
3056
|
+
t.storage.setItem(t.versionKey, m);
|
|
3057
|
+
const p = Object.assign(o.state.dictCodes, d), _ = dt(p, t.filterDataFun, t.disabledDataFun, (s = t == null ? void 0 : t.format) == null ? void 0 : s.disabled);
|
|
3058
|
+
o.mutations.SET_DICT_CODES(_), t.storage.setItem(t.dictDataKey, JSON.stringify(_));
|
|
3050
3059
|
}
|
|
3051
3060
|
}
|
|
3052
|
-
let
|
|
3053
|
-
async install(t,
|
|
3054
|
-
var d,
|
|
3061
|
+
let An = {
|
|
3062
|
+
async install(t, n) {
|
|
3063
|
+
var d, m;
|
|
3055
3064
|
const f = {
|
|
3065
|
+
getLoginStatusFunc: () => !0,
|
|
3066
|
+
loginStatusChangeFunc: null,
|
|
3056
3067
|
//组件过滤数据 配置
|
|
3057
|
-
filterDataFun: (
|
|
3068
|
+
filterDataFun: (p) => p,
|
|
3058
3069
|
//组件禁用数据 配置
|
|
3059
|
-
disabledDataFun: (
|
|
3070
|
+
disabledDataFun: (p) => !1,
|
|
3060
3071
|
//配置数组数据转化成树形数据
|
|
3061
3072
|
treeSetting: {
|
|
3062
3073
|
idField: "id",
|
|
@@ -3090,9 +3101,9 @@ let ja = {
|
|
|
3090
3101
|
type: "type",
|
|
3091
3102
|
color: "color"
|
|
3092
3103
|
},
|
|
3093
|
-
formatterRequest: (
|
|
3094
|
-
formatterDictList: (
|
|
3095
|
-
formatterDictVersion: (
|
|
3104
|
+
formatterRequest: (p, _) => _ ? { [p]: _ } : { [p]: "" },
|
|
3105
|
+
formatterDictList: (p, _) => !p || !p.dictData ? {} : p.dictData,
|
|
3106
|
+
formatterDictVersion: (p) => !p || !p.version ? "unknow" : p.version,
|
|
3096
3107
|
version: "unknow",
|
|
3097
3108
|
storage: localStorage,
|
|
3098
3109
|
isGetAll: !1,
|
|
@@ -3101,64 +3112,76 @@ let ja = {
|
|
|
3101
3112
|
localDictCodes: {}
|
|
3102
3113
|
//本地数据
|
|
3103
3114
|
};
|
|
3104
|
-
|
|
3115
|
+
n.format = Object.assign(
|
|
3105
3116
|
f.format,
|
|
3106
|
-
|
|
3107
|
-
),
|
|
3117
|
+
n.format
|
|
3118
|
+
), n.treeSetting = Object.assign(
|
|
3108
3119
|
f.treeSetting,
|
|
3109
|
-
|
|
3120
|
+
n.treeSetting
|
|
3110
3121
|
);
|
|
3111
|
-
const e = Object.assign(f,
|
|
3112
|
-
|
|
3113
|
-
const
|
|
3114
|
-
let
|
|
3115
|
-
|
|
3116
|
-
const
|
|
3117
|
-
e.storage.setItem(e.dictDataKey, JSON.stringify(
|
|
3118
|
-
const
|
|
3119
|
-
if (e.version !==
|
|
3122
|
+
const e = Object.assign(f, n);
|
|
3123
|
+
o.mutations.SET_DICT_SETTING(e);
|
|
3124
|
+
const r = JSON.parse(e.storage.getItem(e.dictDataKey)) || {};
|
|
3125
|
+
let a = JSON.parse(JSON.stringify(e.localDictCodes));
|
|
3126
|
+
a = Object.assign(r, a);
|
|
3127
|
+
const l = dt(a, e.filterDataFun, e.disabledDataFun, (d = e == null ? void 0 : e.format) == null ? void 0 : d.disabled);
|
|
3128
|
+
e.storage.setItem(e.dictDataKey, JSON.stringify(l)), o.mutations.SET_DICT_CODES(l);
|
|
3129
|
+
const s = e.storage.getItem(e.versionKey);
|
|
3130
|
+
if (e.version !== s) {
|
|
3120
3131
|
e.storage.removeItem(e.dictDataKey), e.storage.setItem(e.versionKey, e.version);
|
|
3121
|
-
const
|
|
3122
|
-
e.storage.setItem(e.dictDataKey, JSON.stringify(
|
|
3132
|
+
const p = JSON.parse(JSON.stringify(e.localDictCodes)), _ = dt(p, e.filterDataFun, e.disabledDataFun, (m = e == null ? void 0 : e.format) == null ? void 0 : m.disabled);
|
|
3133
|
+
e.storage.setItem(e.dictDataKey, JSON.stringify(_)), o.mutations.SET_DICT_CODES(_);
|
|
3123
3134
|
}
|
|
3124
|
-
(e.isGetAll || e.usuallyGetDictTypes) &&
|
|
3125
|
-
t.component(
|
|
3135
|
+
e.getLoginStatusFunc() && (e.isGetAll || e.usuallyGetDictTypes) && Rt(e), Ht.forEach((p) => {
|
|
3136
|
+
t.component(p.name, p);
|
|
3137
|
+
});
|
|
3138
|
+
const c = lt({
|
|
3139
|
+
hadLogin: E(() => o.state.dictConfig.getLoginStatusFunc())
|
|
3126
3140
|
});
|
|
3141
|
+
(() => {
|
|
3142
|
+
St && (St(), St = null), St = ot(
|
|
3143
|
+
() => c.hadLogin,
|
|
3144
|
+
(p) => {
|
|
3145
|
+
e.loginStatusChangeFunc && e.loginStatusChangeFunc(p), p && (e.isGetAll || e.usuallyGetDictTypes) && Rt(e);
|
|
3146
|
+
},
|
|
3147
|
+
{ immediate: !1 }
|
|
3148
|
+
);
|
|
3149
|
+
})();
|
|
3127
3150
|
}
|
|
3128
3151
|
};
|
|
3129
3152
|
export {
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3153
|
+
An as default,
|
|
3154
|
+
mn as desensitization,
|
|
3155
|
+
pn as formatDate,
|
|
3156
|
+
en as getCodeByLabel,
|
|
3157
|
+
on as getCodeByLabelFilter,
|
|
3158
|
+
nn as getCodeByLabels,
|
|
3159
|
+
cn as getCodeByLabelsFilter,
|
|
3160
|
+
We as getDictConfig,
|
|
3138
3161
|
He as getDictConfigByKey,
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3162
|
+
Qe as getDictData,
|
|
3163
|
+
Xe as getDictDataByKey,
|
|
3164
|
+
an as getDictObjByDictTypes,
|
|
3165
|
+
ln as getItemByCode,
|
|
3166
|
+
Ze as getLabelByCode,
|
|
3167
|
+
rn as getLabelByCodeFilter,
|
|
3168
|
+
tn as getLabelByCodes,
|
|
3169
|
+
sn as getLabelByCodesFilter,
|
|
3170
|
+
_n as getTreeCodeByLabel,
|
|
3171
|
+
Cn as getTreeCodeByLabelFilter,
|
|
3172
|
+
Fn as getTreeCodeByLabels,
|
|
3173
|
+
In as getTreeCodeByLabelsFilter,
|
|
3174
|
+
Tn as getTreeItemByCode,
|
|
3175
|
+
vn as getTreeItemByLabel,
|
|
3176
|
+
Sn as getTreeLabelByCode,
|
|
3177
|
+
hn as getTreeLabelByCodeFilter,
|
|
3178
|
+
On as getTreeLabelByCodes,
|
|
3179
|
+
jn as getTreeLabelByCodesFilter,
|
|
3180
|
+
yn as isDate,
|
|
3181
|
+
Dn as listToTree,
|
|
3182
|
+
un as mask,
|
|
3183
|
+
dn as maskAddress,
|
|
3184
|
+
fn as maskIdCard,
|
|
3185
|
+
gn as maskName,
|
|
3186
|
+
bn as maskPhone
|
|
3164
3187
|
};
|