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