@skyfox2000/webui 1.3.2 → 1.3.3
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/lib/assets/modules/{file-upload-BVB9c-eZ.js → file-upload-D4Pqs8h3.js} +1 -1
- package/lib/assets/modules/{form-excel-CsQBtfkA.js → form-excel-D1vXB4c4.js} +1 -1
- package/lib/assets/modules/{index-k_AnrbPY.js → index-CSnwbbQT.js} +2 -2
- package/lib/assets/modules/{index-CaaMz5sz.js → index-V1j9haWy.js} +1 -1
- package/lib/assets/modules/{menuTabs-_Ph7P8ES.js → menuTabs-e8XoJN7m.js} +2 -2
- package/lib/assets/modules/{toolIcon-QMXCkImG.js → toolIcon-BSF7eiPf.js} +1 -1
- package/lib/assets/modules/uploadList-Bcf7g1bf.js +382 -0
- package/lib/assets/modules/{uploadList-D-FOtndj.js → uploadList-DA4TRDWR.js} +482 -508
- package/lib/components/form/autoComplete/index.vue.d.ts +10 -48
- package/lib/components/form/upload/uploadList.vue.d.ts +1 -0
- package/lib/es/AceEditor/index.js +3 -3
- package/lib/es/BasicLayout/index.js +3 -3
- package/lib/es/Error403/index.js +1 -1
- package/lib/es/Error404/index.js +1 -1
- package/lib/es/ExcelForm/index.js +4 -4
- package/lib/es/UploadForm/index.js +4 -4
- package/lib/index.d.ts +1 -1
- package/lib/utils/download.d.ts +2 -0
- package/lib/webui.css +1 -1
- package/lib/webui.es.js +207 -205
- package/package.json +1 -1
- package/src/components/content/table/index.vue +22 -10
- package/src/components/form/autoComplete/index.vue +29 -60
- package/src/components/form/upload/uploadList.vue +50 -11
- package/src/index.ts +1 -1
- package/src/utils/download.ts +31 -0
- package/src/utils/options.ts +0 -1
- package/lib/assets/modules/uploadList-CXa3siDj.js +0 -327
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
var da = Object.defineProperty;
|
|
2
2
|
var ha = (e, t, a) => t in e ? da(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
3
|
var F = (e, t, a) => ha(e, typeof t != "symbol" ? t + "" : t, a);
|
|
4
|
-
import { inject as
|
|
4
|
+
import { inject as X, ref as c, provide as Te, watch as I, toRaw as Ye, h as _, nextTick as ma, shallowRef as U, defineComponent as C, reactive as va, onMounted as ye, onUnmounted as ne, createBlock as Se, createCommentVNode as q, openBlock as A, unref as b, mergeProps as re, useAttrs as be, createElementBlock as L, createVNode as ee, withCtx as H, createTextVNode as Ie, toDisplayString as B, Fragment as ae, renderList as _e, normalizeClass as Xe, createElementVNode as ga } from "vue";
|
|
5
5
|
import { Switch as ya, AutoComplete as Sa, CheckboxGroup as ba, Checkbox as Ia, RadioGroup as xa, Radio as Aa, Select as Ea, SelectOption as Oa } from "ant-design-vue";
|
|
6
|
-
import { createPinia as Ra, defineStore as
|
|
6
|
+
import { createPinia as Ra, defineStore as oe } from "pinia";
|
|
7
7
|
import Ta from "pinia-plugin-persistedstate";
|
|
8
|
-
import { combineParams as
|
|
9
|
-
import { ResStatus as R, httpPost as
|
|
8
|
+
import { combineParams as xe, EnvConfig as me, AppAction as qe, AppSource as Be, isMicroApp as ve, mainAppApis as $, isBaseMicroApp as wa } from "@skyfox2000/microbase";
|
|
9
|
+
import { ResStatus as R, httpPost as Q, setToken as pe, fieldMapping as Pa, parseFieldTemplate as Me, API_HOST as we, SERVER_HOST as ka } from "@skyfox2000/fapi";
|
|
10
10
|
import x from "vue-m-message";
|
|
11
|
-
import
|
|
11
|
+
import De from "async-validator";
|
|
12
12
|
import { createRouter as La, createWebHashHistory as Fa } from "vue-router";
|
|
13
13
|
import "dayjs";
|
|
14
14
|
import "vue-draggable-next";
|
|
15
15
|
const Ma = Ra();
|
|
16
16
|
Ma.use(Ta);
|
|
17
|
-
var
|
|
18
|
-
const
|
|
17
|
+
var N = /* @__PURE__ */ ((e) => (e.PageControl = "Page.PageControl", e.EditorControl = "Page.EditorControl", e.GridControl = "Page.GridControl", e.LabelText = "FormItem.LabelText", e.LabelWidth = "FormItem.LabelWidth", e.RuleKey = "FormItem.RuleKey", e.ErrInfo = "FormItem.ErrInfo", e))(N || {});
|
|
18
|
+
const T = class T {
|
|
19
19
|
};
|
|
20
|
-
F(
|
|
20
|
+
F(T, "dict", {}), F(T, "Keys", {
|
|
21
21
|
EnableDisable: "EnableDisable",
|
|
22
22
|
SuccessResult: "SuccessResult",
|
|
23
23
|
YesNo: "YesNo",
|
|
@@ -27,25 +27,25 @@ F(w, "dict", {}), F(w, "Keys", {
|
|
|
27
27
|
* @param key 名称
|
|
28
28
|
* @returns
|
|
29
29
|
*/
|
|
30
|
-
F(
|
|
30
|
+
F(T, "getOptions", (t) => T.dict[t]), /**
|
|
31
31
|
* 静态选择项对象
|
|
32
32
|
* @param key 名称
|
|
33
33
|
* @param value 值
|
|
34
34
|
* @returns
|
|
35
35
|
*/
|
|
36
|
-
F(
|
|
36
|
+
F(T, "getOptionItem", (t, a) => T.dict[t].find((s) => s.value === a)), /**
|
|
37
37
|
* 设置静态选择项
|
|
38
38
|
* @param key 名称
|
|
39
39
|
* @param list 列表
|
|
40
40
|
*/
|
|
41
|
-
F(
|
|
42
|
-
|
|
41
|
+
F(T, "setOptions", (t, a) => {
|
|
42
|
+
T.dict[t] = a;
|
|
43
43
|
}), /**
|
|
44
44
|
* 启用/停用选项
|
|
45
45
|
* - 启用 1
|
|
46
46
|
* - 停用 0
|
|
47
47
|
*/
|
|
48
|
-
F(
|
|
48
|
+
F(T, "EnableDisable", [
|
|
49
49
|
{
|
|
50
50
|
label: "启用",
|
|
51
51
|
text: "✅ 启用",
|
|
@@ -61,7 +61,7 @@ F(w, "EnableDisable", [
|
|
|
61
61
|
* - 成功 1
|
|
62
62
|
* - 失败 0
|
|
63
63
|
*/
|
|
64
|
-
F(
|
|
64
|
+
F(T, "SuccessResult", [
|
|
65
65
|
{
|
|
66
66
|
label: "成功",
|
|
67
67
|
text: "✅ 成功",
|
|
@@ -77,7 +77,7 @@ F(w, "SuccessResult", [
|
|
|
77
77
|
* - 是 1
|
|
78
78
|
* - 否 0
|
|
79
79
|
*/
|
|
80
|
-
F(
|
|
80
|
+
F(T, "YesNo", [
|
|
81
81
|
{
|
|
82
82
|
label: "是",
|
|
83
83
|
text: "✅ 是",
|
|
@@ -93,7 +93,7 @@ F(w, "YesNo", [
|
|
|
93
93
|
* - 男 M
|
|
94
94
|
* - 女 F
|
|
95
95
|
*/
|
|
96
|
-
F(
|
|
96
|
+
F(T, "MaleFemale", [
|
|
97
97
|
{
|
|
98
98
|
label: "男",
|
|
99
99
|
text: "男 👨",
|
|
@@ -105,12 +105,12 @@ F(w, "MaleFemale", [
|
|
|
105
105
|
value: "F"
|
|
106
106
|
}
|
|
107
107
|
]);
|
|
108
|
-
let M =
|
|
108
|
+
let M = T;
|
|
109
109
|
M.setOptions("EnableDisable", M.EnableDisable);
|
|
110
110
|
M.setOptions("SuccessResult", M.SuccessResult);
|
|
111
111
|
M.setOptions("YesNo", M.YesNo);
|
|
112
112
|
M.setOptions("MaleFemale", M.MaleFemale);
|
|
113
|
-
const
|
|
113
|
+
const ie = {
|
|
114
114
|
/**
|
|
115
115
|
* 选项数据接口
|
|
116
116
|
*/
|
|
@@ -190,8 +190,8 @@ const ce = {
|
|
|
190
190
|
}
|
|
191
191
|
s.api || (s.api = a.api), s.authorize === void 0 && (s.authorize = a.authorize);
|
|
192
192
|
let n = JSON.parse(JSON.stringify(t.params));
|
|
193
|
-
return t.processParams && (n = t.processParams(n)), t.loadingState && (t.loadingState.value = !0), t.hideErrorToast && (s.hideErrorToast = !0),
|
|
194
|
-
},
|
|
193
|
+
return t.processParams && (n = t.processParams(n)), t.loadingState && (t.loadingState.value = !0), t.hideErrorToast && (s.hideErrorToast = !0), Q(s, n).then((o) => (t.loadingState && (t.loadingState.value = !1), o)).catch((o) => (t.loadingState && (t.loadingState.value = !1), null));
|
|
194
|
+
}, Ue = (e, t) => {
|
|
195
195
|
t.params || (t.params = {}), t.params.Query || (t.params.Query = {});
|
|
196
196
|
const a = Ae(e, t);
|
|
197
197
|
return t.url = a, Ee(e, t);
|
|
@@ -219,16 +219,16 @@ const ce = {
|
|
|
219
219
|
return x.error("错误!禁止无条件删除数据!"), Promise.resolve(null);
|
|
220
220
|
const o = Ae(e, n);
|
|
221
221
|
return n.url = o, Ee(e, n).then((r) => ((r == null ? void 0 : r.status) === R.SUCCESS && (a.hideErrorToast || x.success("删除成功!")), r));
|
|
222
|
-
}, Na = (e, t) =>
|
|
222
|
+
}, Na = (e, t) => Ue(e, {
|
|
223
223
|
urlKey: "tree",
|
|
224
224
|
params: {},
|
|
225
225
|
loadingState: e.isTreeLoading,
|
|
226
226
|
loadingText: !1,
|
|
227
|
-
processParams: () =>
|
|
227
|
+
processParams: () => xe(e.treeQuery, t)
|
|
228
228
|
}).then((a) => (a == null ? void 0 : a.status) === R.SUCCESS ? (e.data.value = a.data, e.data.value) : []);
|
|
229
|
-
let
|
|
229
|
+
let te;
|
|
230
230
|
const kt = (e) => {
|
|
231
|
-
|
|
231
|
+
te = new De({}), te.messages({
|
|
232
232
|
required: "${label}不能为空",
|
|
233
233
|
types: {
|
|
234
234
|
number: "${label}必须是数字"
|
|
@@ -257,50 +257,50 @@ const kt = (e) => {
|
|
|
257
257
|
}, Lt = (e) => {
|
|
258
258
|
if (!e || P(e))
|
|
259
259
|
return [];
|
|
260
|
-
const t = [], a =
|
|
260
|
+
const t = [], a = te.messages(), s = (o, r, l) => {
|
|
261
261
|
const i = r.type;
|
|
262
262
|
if (i && a.types && i in a.types) {
|
|
263
|
-
const
|
|
264
|
-
n(
|
|
263
|
+
const f = a.types[i];
|
|
264
|
+
n(f, o, { type: i }, l);
|
|
265
265
|
}
|
|
266
|
-
const
|
|
267
|
-
for (const
|
|
268
|
-
if (i ===
|
|
269
|
-
const p = a[
|
|
266
|
+
const u = ["string", "number", "array"];
|
|
267
|
+
for (const f of u)
|
|
268
|
+
if (i === f && a[f]) {
|
|
269
|
+
const p = a[f], m = ["len", "min", "max", "range"];
|
|
270
270
|
for (const d of m)
|
|
271
271
|
d === "range" && r.min != null && r.max != null && p.range ? n(p.range, o, { min: r.min, max: r.max }, l) : d !== "range" && r[d] != null && p[d] && n(p[d], o, { [d]: r[d] }, l);
|
|
272
272
|
}
|
|
273
273
|
if (r.required && a.required && n(a.required, o, {}, l), r.pattern && a.pattern && n(r.message, o, {}, l), r.enum && Array.isArray(r.enum) && a.enum) {
|
|
274
|
-
const
|
|
275
|
-
n(a.enum, o, { enum:
|
|
274
|
+
const f = r.enum.join(", ");
|
|
275
|
+
n(a.enum, o, { enum: f }, l);
|
|
276
276
|
}
|
|
277
277
|
}, n = (o, r, l, i) => {
|
|
278
278
|
if (o)
|
|
279
279
|
try {
|
|
280
|
-
let
|
|
280
|
+
let u;
|
|
281
281
|
if (typeof o == "function") {
|
|
282
|
-
const
|
|
282
|
+
const f = [r];
|
|
283
283
|
for (const p in l)
|
|
284
|
-
|
|
285
|
-
|
|
284
|
+
f.push(l[p]);
|
|
285
|
+
u = o.apply(null, f), u && i.push(u);
|
|
286
286
|
} else {
|
|
287
|
-
|
|
288
|
-
for (const
|
|
289
|
-
|
|
290
|
-
|
|
287
|
+
u = String(o);
|
|
288
|
+
for (const f in l)
|
|
289
|
+
u = u.replace(new RegExp(`\\$\\{${f}\\}`, "g"), l[f]);
|
|
290
|
+
u = u.replace(/\$\{label\}/g, ""), u && i.push(u);
|
|
291
291
|
}
|
|
292
|
-
} catch (
|
|
293
|
-
console.error("格式化验证消息出错:",
|
|
292
|
+
} catch (u) {
|
|
293
|
+
console.error("格式化验证消息出错:", u);
|
|
294
294
|
}
|
|
295
295
|
};
|
|
296
296
|
return Object.keys(e).forEach((o) => {
|
|
297
297
|
const r = e[o], l = [];
|
|
298
298
|
try {
|
|
299
|
-
s(o, r, l), Array.isArray(r) && r.forEach((
|
|
300
|
-
|
|
299
|
+
s(o, r, l), Array.isArray(r) && r.forEach((u) => {
|
|
300
|
+
u && typeof u == "object" && s(o, u, l);
|
|
301
301
|
}), r && typeof r == "object" && "fields" in r;
|
|
302
|
-
} catch (
|
|
303
|
-
console.error("处理验证规则出错:",
|
|
302
|
+
} catch (u) {
|
|
303
|
+
console.error("处理验证规则出错:", u);
|
|
304
304
|
}
|
|
305
305
|
const i = Array.from(new Set(l));
|
|
306
306
|
o && i.length > 0 && t.push({
|
|
@@ -308,34 +308,34 @@ const kt = (e) => {
|
|
|
308
308
|
rules: i
|
|
309
309
|
});
|
|
310
310
|
}), t;
|
|
311
|
-
},
|
|
311
|
+
}, le = async (e) => {
|
|
312
312
|
const t = e.formData.value, a = e.formRules.value;
|
|
313
|
-
P(a) || (
|
|
313
|
+
P(a) || (Ve(e), e.ruleValidator || (e.ruleValidator = new De({}), e.ruleValidator.messages(te.messages()), e.ruleValidator.define(a)), e.ruleResults.value = await e.ruleValidator.validate(t).then(() => {
|
|
314
314
|
}).catch(({ fields: s }) => s));
|
|
315
|
-
}, Ft = async (e, t, a) => (a || (a = new
|
|
316
|
-
}).catch(({ fields: s }) => s)),
|
|
315
|
+
}, Ft = async (e, t, a) => (a || (a = new De({}), a.messages(te.messages()), a.define(t)), a.validate(e).then(() => {
|
|
316
|
+
}).catch(({ fields: s }) => s)), Ve = (e) => {
|
|
317
317
|
e.ruleResults.value = void 0;
|
|
318
|
-
},
|
|
319
|
-
const e =
|
|
318
|
+
}, z = () => {
|
|
319
|
+
const e = X(N.EditorControl, void 0), t = c(X(N.LabelText, "")), a = c(X(N.RuleKey, "")), s = X(N.ErrInfo, void 0);
|
|
320
320
|
return {
|
|
321
321
|
editorCtrl: e,
|
|
322
322
|
labelText: t,
|
|
323
323
|
ruleKey: a,
|
|
324
324
|
errInfo: s
|
|
325
325
|
};
|
|
326
|
-
},
|
|
327
|
-
let a =
|
|
326
|
+
}, _a = (e, t) => {
|
|
327
|
+
let a = c({
|
|
328
328
|
msg: "",
|
|
329
329
|
errClass: ""
|
|
330
330
|
});
|
|
331
331
|
if (!e.label || !e.rule)
|
|
332
332
|
return a;
|
|
333
333
|
const s = t == null ? void 0 : t.ruleResults;
|
|
334
|
-
return
|
|
334
|
+
return I(
|
|
335
335
|
() => s == null ? void 0 : s.value,
|
|
336
336
|
(n) => {
|
|
337
337
|
if (a.value.errClass = "", a.value.msg = "", !P(n)) {
|
|
338
|
-
const o =
|
|
338
|
+
const o = Da(
|
|
339
339
|
{
|
|
340
340
|
label: e.label,
|
|
341
341
|
rule: e.rule
|
|
@@ -348,8 +348,8 @@ const kt = (e) => {
|
|
|
348
348
|
},
|
|
349
349
|
{ deep: !0 }
|
|
350
350
|
), a;
|
|
351
|
-
},
|
|
352
|
-
const s =
|
|
351
|
+
}, Da = (e, t, a) => {
|
|
352
|
+
const s = c([]), n = c(""), o = c("");
|
|
353
353
|
if (!e.rule || !t || !a)
|
|
354
354
|
return { msg: n, ruleErrors: s, errClass: o };
|
|
355
355
|
e.rule.split("|").forEach((i) => {
|
|
@@ -357,41 +357,41 @@ const kt = (e) => {
|
|
|
357
357
|
if (a[i])
|
|
358
358
|
s.value.push(...a[i]);
|
|
359
359
|
else {
|
|
360
|
-
const
|
|
361
|
-
for (let
|
|
362
|
-
|
|
363
|
-
|
|
360
|
+
const u = [];
|
|
361
|
+
for (let f in a)
|
|
362
|
+
f !== i && f.startsWith(i + ".") && u.push(...a[f]);
|
|
363
|
+
u.length > 0 && s.value.push(...u);
|
|
364
364
|
}
|
|
365
365
|
});
|
|
366
366
|
const l = /\${\w+}/g;
|
|
367
367
|
return s.value.forEach((i) => {
|
|
368
368
|
n.value && (n.value += " / "), n.value += i.message.replace("${label}", e.label ?? "");
|
|
369
|
-
const
|
|
370
|
-
if (
|
|
371
|
-
const
|
|
372
|
-
|
|
369
|
+
const u = t[i.field];
|
|
370
|
+
if (u) {
|
|
371
|
+
const f = n.value.match(l);
|
|
372
|
+
f && f.forEach((p) => {
|
|
373
373
|
const m = p.replace("${", "").replace("}", "");
|
|
374
|
-
n.value = n.value.replace(p,
|
|
374
|
+
n.value = n.value.replace(p, u[m] ?? "");
|
|
375
375
|
});
|
|
376
376
|
}
|
|
377
377
|
}), s.value.length > 0 && (o.value = "error"), { msg: n, ruleErrors: s, errClass: o };
|
|
378
378
|
}, Mt = (e, t) => {
|
|
379
|
-
Te(
|
|
380
|
-
const a =
|
|
381
|
-
return Te(
|
|
379
|
+
Te(N.LabelText, e.label || ""), Te(N.RuleKey, e.rule || "");
|
|
380
|
+
const a = _a(e, t);
|
|
381
|
+
return Te(N.ErrInfo, a), a;
|
|
382
382
|
}, $t = (e) => {
|
|
383
383
|
ea(e);
|
|
384
384
|
}, Nt = (e) => {
|
|
385
385
|
const t = e.page, a = e.formData.value;
|
|
386
386
|
a[e.primaryKey ?? t.primaryKey] = null, ea(e);
|
|
387
|
-
},
|
|
388
|
-
|
|
387
|
+
}, _t = (e) => {
|
|
388
|
+
He(e), e.visible.value = !1;
|
|
389
389
|
}, ea = async (e) => {
|
|
390
390
|
var s;
|
|
391
391
|
const t = e.page;
|
|
392
|
-
if (e.isFormSaving.value = !0,
|
|
392
|
+
if (e.isFormSaving.value = !0, Ve(e), e.beforeSave && e.beforeSave() === !1)
|
|
393
393
|
return e.isFormSaving.value = !1, Promise.resolve();
|
|
394
|
-
if (e.formRules.value && await
|
|
394
|
+
if (e.formRules.value && await le(e), e.ruleResults.value)
|
|
395
395
|
return x.error("提交表单时,验证失败!"), console.error("表单验证失败!", e.ruleResults.value), e.isFormSaving.value = !1, Promise.resolve();
|
|
396
396
|
const a = e.formData.value;
|
|
397
397
|
return Ze(
|
|
@@ -418,11 +418,11 @@ const kt = (e) => {
|
|
|
418
418
|
else if (n != null && n.msg && ((o = n == null ? void 0 : n.msg) == null ? void 0 : o.indexOf("Duplicate entry")) > -1) {
|
|
419
419
|
const l = (r = n == null ? void 0 : n.msg) == null ? void 0 : r.match(/Duplicate entry '([^']+)' for key '([^']+)'/);
|
|
420
420
|
if (l && l.length > 2 && l[1] && l[2]) {
|
|
421
|
-
const i = l[1],
|
|
422
|
-
if (
|
|
421
|
+
const i = l[1], u = l[2].replace(/Idx_/g, "").split("_"), f = e.formRules.value;
|
|
422
|
+
if (f && u.length > 0) {
|
|
423
423
|
const p = {};
|
|
424
|
-
|
|
425
|
-
|
|
424
|
+
u.forEach((m) => {
|
|
425
|
+
f[m] && (p[m] = [
|
|
426
426
|
{
|
|
427
427
|
field: m,
|
|
428
428
|
fieldValue: i,
|
|
@@ -436,45 +436,45 @@ const kt = (e) => {
|
|
|
436
436
|
} else
|
|
437
437
|
x.error((n == null ? void 0 : n.msg) ?? "保存失败!");
|
|
438
438
|
});
|
|
439
|
-
},
|
|
439
|
+
}, Dt = async (e) => {
|
|
440
440
|
const t = e.page, a = e.grid;
|
|
441
441
|
e.isFormLoading.value = !0;
|
|
442
442
|
const s = e.formData.value, n = e.primaryKey ?? t.primaryKey;
|
|
443
443
|
return ia(a, { [n]: s[n] }, e.detailUrl).then((o) => {
|
|
444
444
|
e.isFormLoading.value = !1, o && aa(e, o);
|
|
445
445
|
});
|
|
446
|
-
},
|
|
446
|
+
}, Ut = (e) => {
|
|
447
447
|
const t = e.grid;
|
|
448
|
-
t && (t.rowData.value = void 0), e && (
|
|
448
|
+
t && (t.rowData.value = void 0), e && (He(e), e.visible && (e.visible.value = !1), setTimeout(() => {
|
|
449
449
|
e.visible.value = !0;
|
|
450
450
|
}, 1));
|
|
451
451
|
}, aa = (e, t) => {
|
|
452
|
-
|
|
452
|
+
He(e);
|
|
453
453
|
const a = { ...e.formData.value, ...t };
|
|
454
454
|
e.formData.value = JSON.parse(JSON.stringify(a));
|
|
455
|
-
},
|
|
456
|
-
e.formData.value = e.default ? JSON.parse(JSON.stringify(e.default)) : {},
|
|
457
|
-
},
|
|
455
|
+
}, He = (e) => {
|
|
456
|
+
e.formData.value = e.default ? JSON.parse(JSON.stringify(e.default)) : {}, Ve(e);
|
|
457
|
+
}, ge = "/login/", he = [], Ua = (e) => {
|
|
458
458
|
for (const t of e) {
|
|
459
|
-
const a =
|
|
460
|
-
a !== -1 &&
|
|
459
|
+
const a = he.findIndex((s) => s.path === t.path);
|
|
460
|
+
a !== -1 && he.splice(a, 1), he.push(t), se.addRoute(t);
|
|
461
461
|
}
|
|
462
462
|
}, ta = (e, t, a, s = "") => {
|
|
463
463
|
const n = s + (s ? "/" : "") + e.path;
|
|
464
464
|
t[n] = { ...e, parent: a }, e.children && e.children.forEach((o) => ta(o, t, e, n));
|
|
465
|
-
},
|
|
465
|
+
}, se = La({
|
|
466
466
|
history: Fa("/"),
|
|
467
|
-
routes:
|
|
467
|
+
routes: he
|
|
468
468
|
}), Va = (e, t) => {
|
|
469
469
|
var n, o;
|
|
470
470
|
const a = ((n = e.meta) == null ? void 0 : n.roles) ?? [], s = (o = e.meta) == null ? void 0 : o.permission;
|
|
471
471
|
if (!t)
|
|
472
472
|
return a.length === 0 && !s;
|
|
473
473
|
if (t) {
|
|
474
|
-
const r =
|
|
475
|
-
if (
|
|
474
|
+
const r = K();
|
|
475
|
+
if (me.VITE_PERMISSION_MODE === "role")
|
|
476
476
|
return a.length === 0 ? !0 : r.hasRole(a);
|
|
477
|
-
if (
|
|
477
|
+
if (me.VITE_PERMISSION_MODE === "permit") {
|
|
478
478
|
if (a.length === 0 && !s)
|
|
479
479
|
return !0;
|
|
480
480
|
let l = !1, i = !1;
|
|
@@ -482,20 +482,20 @@ const kt = (e) => {
|
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
484
|
return !1;
|
|
485
|
-
},
|
|
486
|
-
|
|
485
|
+
}, Z = c(null);
|
|
486
|
+
se.beforeEach((e, t, a) => {
|
|
487
487
|
var l;
|
|
488
488
|
const s = e;
|
|
489
|
-
if (e.path.startsWith("/error/") || e.path.startsWith(
|
|
489
|
+
if (e.path.startsWith("/error/") || e.path.startsWith(ge))
|
|
490
490
|
return a();
|
|
491
491
|
const n = s.meta, r = ((n == null ? void 0 : n.roles) ?? []).length > 0 || ((l = n == null ? void 0 : n.permission) == null ? void 0 : l.length);
|
|
492
492
|
if (e.path === "/") {
|
|
493
|
-
const i =
|
|
493
|
+
const i = D();
|
|
494
494
|
if (!i.menuLoaded) {
|
|
495
|
-
|
|
495
|
+
Z.value = {
|
|
496
496
|
to: e,
|
|
497
|
-
next: (
|
|
498
|
-
a({ path:
|
|
497
|
+
next: (u) => {
|
|
498
|
+
a({ path: u });
|
|
499
499
|
}
|
|
500
500
|
};
|
|
501
501
|
return;
|
|
@@ -506,35 +506,35 @@ ne.beforeEach((e, t, a) => {
|
|
|
506
506
|
if (!r)
|
|
507
507
|
a();
|
|
508
508
|
else {
|
|
509
|
-
const i =
|
|
509
|
+
const i = K();
|
|
510
510
|
if (!i.isLogin)
|
|
511
|
-
a({ path:
|
|
511
|
+
a({ path: ge });
|
|
512
512
|
else {
|
|
513
|
-
if (!
|
|
514
|
-
|
|
513
|
+
if (!D().menuLoaded) {
|
|
514
|
+
Z.value = {
|
|
515
515
|
to: e,
|
|
516
516
|
next: a
|
|
517
517
|
};
|
|
518
518
|
return;
|
|
519
519
|
}
|
|
520
|
-
const
|
|
520
|
+
const f = Va(s, i.isLogin);
|
|
521
521
|
a();
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
524
|
});
|
|
525
525
|
const Ha = (e) => {
|
|
526
|
-
if (
|
|
527
|
-
const { to: t, next: a } =
|
|
528
|
-
|
|
526
|
+
if (Z.value) {
|
|
527
|
+
const { to: t, next: a } = Z.value;
|
|
528
|
+
Z.value = null, t.path === "/" ? a(e) : a(t.path);
|
|
529
529
|
}
|
|
530
530
|
}, Ka = (e) => {
|
|
531
|
-
const t =
|
|
531
|
+
const t = Ke();
|
|
532
532
|
if (t.TabEnabled) {
|
|
533
533
|
if (Qa(e.key, t.TabPanes))
|
|
534
534
|
return;
|
|
535
535
|
t.TabPanes.push(e);
|
|
536
536
|
}
|
|
537
|
-
}, Qa = (e, t) => t.find((a) => a.key === e),
|
|
537
|
+
}, Qa = (e, t) => t.find((a) => a.key === e), Ke = oe("pageInfo", {
|
|
538
538
|
state: () => ({
|
|
539
539
|
TabActive: "",
|
|
540
540
|
TabPanes: [],
|
|
@@ -547,7 +547,7 @@ const Ha = (e) => {
|
|
|
547
547
|
*/
|
|
548
548
|
removeTabPane(e) {
|
|
549
549
|
if (this.TabEnabled) {
|
|
550
|
-
|
|
550
|
+
D().excludeComponent(e);
|
|
551
551
|
let a = 0, s = [...this.TabPanes];
|
|
552
552
|
for (let n = 0; n < s.length; n++)
|
|
553
553
|
if (s[n].key === e) {
|
|
@@ -568,7 +568,7 @@ const Ha = (e) => {
|
|
|
568
568
|
* @returns
|
|
569
569
|
*/
|
|
570
570
|
async setTabActive(e) {
|
|
571
|
-
let a =
|
|
571
|
+
let a = D().findRoute(e);
|
|
572
572
|
if (!a) return;
|
|
573
573
|
const s = {
|
|
574
574
|
key: e,
|
|
@@ -591,12 +591,12 @@ const Ha = (e) => {
|
|
|
591
591
|
loadingText: !1
|
|
592
592
|
}
|
|
593
593
|
}, Pe = /* @__PURE__ */ new Map(), Ga = (e) => {
|
|
594
|
-
const t =
|
|
594
|
+
const t = K(), { roles: a, permission: s } = e.meta || {};
|
|
595
595
|
if (P(a) && P(s))
|
|
596
596
|
return !0;
|
|
597
|
-
if (
|
|
597
|
+
if (me.VITE_PERMISSION_MODE === "role")
|
|
598
598
|
return P(a) ? !0 : t.hasRole(a);
|
|
599
|
-
if (
|
|
599
|
+
if (me.VITE_PERMISSION_MODE === "permit") {
|
|
600
600
|
let n = !1, o = !1;
|
|
601
601
|
return P(a) || (n = t.hasRole(a)), t.isAdmin() ? n : (P(s) || (o = t.hasPermit(e.path, s)), n || o);
|
|
602
602
|
}
|
|
@@ -604,19 +604,19 @@ const Ha = (e) => {
|
|
|
604
604
|
}, sa = (e) => e.map((t) => {
|
|
605
605
|
const a = { ...t };
|
|
606
606
|
return Ga(a) ? (a.children && (a.children = sa(a.children)), a) : null;
|
|
607
|
-
}).filter(Boolean),
|
|
607
|
+
}).filter(Boolean), na = (e, t = "") => {
|
|
608
608
|
for (const a of e) {
|
|
609
609
|
if (!a.children && !a.redirect) {
|
|
610
610
|
let s = t + a.path;
|
|
611
611
|
return s.startsWith("/") || (s = "/" + s), s;
|
|
612
612
|
}
|
|
613
613
|
if (a.children && a.children.length > 0 && a.path !== "/error" && a.path !== "/login" && a.path !== "/:page(.*)") {
|
|
614
|
-
const s =
|
|
614
|
+
const s = na(a.children, t + a.path + "/");
|
|
615
615
|
if (s)
|
|
616
616
|
return s;
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
|
-
},
|
|
619
|
+
}, D = oe("appInfo", {
|
|
620
620
|
state: () => ({
|
|
621
621
|
appInfo: {
|
|
622
622
|
Id: "",
|
|
@@ -650,7 +650,7 @@ const Ha = (e) => {
|
|
|
650
650
|
});
|
|
651
651
|
},
|
|
652
652
|
async getRemoteAppList() {
|
|
653
|
-
return
|
|
653
|
+
return Q(Ja.appList, {
|
|
654
654
|
Query: {
|
|
655
655
|
AppCode: this.appInfo.AppCode,
|
|
656
656
|
Enabled: 1
|
|
@@ -689,7 +689,7 @@ const Ha = (e) => {
|
|
|
689
689
|
flattenRoutes: {},
|
|
690
690
|
Routes: t ?? [],
|
|
691
691
|
defaultPage: ""
|
|
692
|
-
}), (!
|
|
692
|
+
}), (!ve() || !wa()) && (await K().getRolePermits(a.Id), this.appInfo.Routes.length && this.setAppRoutes(this.appInfo.Routes)));
|
|
693
693
|
},
|
|
694
694
|
/**
|
|
695
695
|
* 设置当前应用路由信息
|
|
@@ -708,12 +708,12 @@ const Ha = (e) => {
|
|
|
708
708
|
if (Object.keys(t).forEach((a) => {
|
|
709
709
|
const s = t[a];
|
|
710
710
|
s.children || !s.component || (s.meta && s.meta.keepAlive === !1 ? this.ExcludeComponents.push(a) : this.CachedComponents.push(a));
|
|
711
|
-
}),
|
|
711
|
+
}), K().isLogin) {
|
|
712
712
|
const a = sa(this.appInfo.Routes);
|
|
713
|
-
if (
|
|
714
|
-
if (this.menuLoaded = !0,
|
|
713
|
+
if (Ua(a), this.appInfo.defaultPage = na(a) || "", this.appInfo.defaultPage) {
|
|
714
|
+
if (this.menuLoaded = !0, $.value && $.value.mainAppPush) {
|
|
715
715
|
const s = this.formatRoute(this.appInfo.defaultPage);
|
|
716
|
-
|
|
716
|
+
$.value.mainAppPush(s);
|
|
717
717
|
}
|
|
718
718
|
Ha(this.appInfo.defaultPage);
|
|
719
719
|
}
|
|
@@ -733,10 +733,10 @@ const Ha = (e) => {
|
|
|
733
733
|
* @param path 路由地址
|
|
734
734
|
*/
|
|
735
735
|
push(e) {
|
|
736
|
-
this.findRoute(e) &&
|
|
737
|
-
if (
|
|
736
|
+
this.findRoute(e) && Ke().setTabActive(e), ma(() => {
|
|
737
|
+
if (se.push({ path: e }), $.value && $.value.mainAppPush) {
|
|
738
738
|
const a = this.formatRoute(e);
|
|
739
|
-
|
|
739
|
+
$.value.mainAppPush(a);
|
|
740
740
|
}
|
|
741
741
|
});
|
|
742
742
|
},
|
|
@@ -804,11 +804,11 @@ const Ha = (e) => {
|
|
|
804
804
|
}, this.CachedComponents.splice(0, this.CachedComponents.length), this.ExcludeComponents.splice(0, this.ExcludeComponents.length), this.appList.splice(0, this.appList.length), this.menuLoaded = !1;
|
|
805
805
|
},
|
|
806
806
|
logout() {
|
|
807
|
-
this.clean(),
|
|
807
|
+
this.clean(), se.push({ path: ge + "#/" }), ve() && $.value && $.value.mainAppPush && $.value.mainAppPush(ge + "#/");
|
|
808
808
|
}
|
|
809
809
|
},
|
|
810
810
|
persist: !1
|
|
811
|
-
}),
|
|
811
|
+
}), ra = "Token解析失败", ze = "登录过期,请重新登录", Qe = {
|
|
812
812
|
login: {
|
|
813
813
|
api: "PLATFORM_API",
|
|
814
814
|
url: "/openapi/LoginSrv/login",
|
|
@@ -833,26 +833,26 @@ const Ha = (e) => {
|
|
|
833
833
|
},
|
|
834
834
|
Query: e
|
|
835
835
|
};
|
|
836
|
-
return
|
|
836
|
+
return Q(Qe.login, t).then((a) => (a == null ? void 0 : a.status) === R.SUCCESS ? a : null);
|
|
837
837
|
}, qa = (e) => {
|
|
838
838
|
let t = {
|
|
839
839
|
Query: {
|
|
840
840
|
AppId: e
|
|
841
841
|
}
|
|
842
842
|
};
|
|
843
|
-
return
|
|
843
|
+
return Q(Qe.auth, t).then((a) => (a == null ? void 0 : a.status) === R.SUCCESS ? a.data : (x.error("获取授权信息失败," + (a == null ? void 0 : a.msg)), null));
|
|
844
844
|
}, Ba = () => {
|
|
845
845
|
let e = {
|
|
846
846
|
Option: {},
|
|
847
847
|
Query: {}
|
|
848
848
|
};
|
|
849
|
-
return
|
|
849
|
+
return Q(Qe.logout, e).then((t) => (t == null ? void 0 : t.status) === R.SUCCESS ? t.data : null);
|
|
850
850
|
}, za = (e) => {
|
|
851
851
|
try {
|
|
852
852
|
const a = JSON.parse(atob(e.split(".")[1])).exp;
|
|
853
853
|
return Date.now() / 1e3 > a;
|
|
854
854
|
} catch (t) {
|
|
855
|
-
return console.error(
|
|
855
|
+
return console.error(ra, t), !0;
|
|
856
856
|
}
|
|
857
857
|
}, ke = (e, t) => e == "" ? (x.error(ze, {
|
|
858
858
|
duration: 3e3,
|
|
@@ -860,14 +860,14 @@ const Ha = (e) => {
|
|
|
860
860
|
}), !1) : za(e) ? (x.error(ze, {
|
|
861
861
|
duration: 3e3,
|
|
862
862
|
onClose: t
|
|
863
|
-
}), !1) : !0,
|
|
863
|
+
}), !1) : !0, Ca = (e) => {
|
|
864
864
|
try {
|
|
865
865
|
const t = JSON.parse(atob(e.token.split(".")[1]));
|
|
866
866
|
return t.user = JSON.parse(t.user), e.UserInfo = t.user, !0;
|
|
867
867
|
} catch (t) {
|
|
868
|
-
return console.error(
|
|
868
|
+
return console.error(ra, t), !1;
|
|
869
869
|
}
|
|
870
|
-
}, k =
|
|
870
|
+
}, k = c(""), Y = c(null), K = oe("userInfo", {
|
|
871
871
|
state: () => ({
|
|
872
872
|
isLogin: !1,
|
|
873
873
|
userInfo: {
|
|
@@ -885,7 +885,7 @@ const Ha = (e) => {
|
|
|
885
885
|
* 启动时初始化用户信息
|
|
886
886
|
*/
|
|
887
887
|
init() {
|
|
888
|
-
|
|
888
|
+
ve() || (this.token ? (ke(this.token, () => this.clean()), pe(this.token), k.value = this.userInfo.UserLevel, this.isLogin = !0) : this.clean());
|
|
889
889
|
},
|
|
890
890
|
/**
|
|
891
891
|
* 登录操作
|
|
@@ -900,7 +900,7 @@ const Ha = (e) => {
|
|
|
900
900
|
return s;
|
|
901
901
|
{
|
|
902
902
|
const n = a.data;
|
|
903
|
-
if (this.token = n.token,
|
|
903
|
+
if (this.token = n.token, pe(this.token), this.isLogin = !0, Ca(n))
|
|
904
904
|
this.userInfo = {
|
|
905
905
|
...this.userInfo,
|
|
906
906
|
...n.UserInfo
|
|
@@ -909,7 +909,7 @@ const Ha = (e) => {
|
|
|
909
909
|
x.error("用户信息解析失败");
|
|
910
910
|
return;
|
|
911
911
|
}
|
|
912
|
-
t &&
|
|
912
|
+
t && D().toDefaultApp();
|
|
913
913
|
}
|
|
914
914
|
}
|
|
915
915
|
},
|
|
@@ -921,11 +921,11 @@ const Ha = (e) => {
|
|
|
921
921
|
async getRolePermits(e) {
|
|
922
922
|
if (!this.isLogin || !this.token)
|
|
923
923
|
return !1;
|
|
924
|
-
if (
|
|
924
|
+
if (Y.value && Y.value.appId === e)
|
|
925
925
|
return !0;
|
|
926
926
|
try {
|
|
927
927
|
const t = await qa(e);
|
|
928
|
-
return t ? (
|
|
928
|
+
return t ? (Y.value = {
|
|
929
929
|
appId: e,
|
|
930
930
|
permits: t.permits || [],
|
|
931
931
|
lastTime: t.lastTime
|
|
@@ -950,7 +950,7 @@ const Ha = (e) => {
|
|
|
950
950
|
*/
|
|
951
951
|
hasPermit(e, t) {
|
|
952
952
|
var s;
|
|
953
|
-
const a =
|
|
953
|
+
const a = Y.value;
|
|
954
954
|
return !a || !a.permits ? !1 : ((s = a.permits[e]) == null ? void 0 : s.includes(t)) ?? !1;
|
|
955
955
|
},
|
|
956
956
|
/**
|
|
@@ -974,7 +974,7 @@ const Ha = (e) => {
|
|
|
974
974
|
k.value || (k.value = e.UserLevel, this.userInfo = {
|
|
975
975
|
...this.userInfo,
|
|
976
976
|
...e
|
|
977
|
-
}, this.token = t,
|
|
977
|
+
}, this.token = t, pe(this.token), this.isLogin = !0);
|
|
978
978
|
},
|
|
979
979
|
/**
|
|
980
980
|
* 获取用户Token
|
|
@@ -1014,7 +1014,7 @@ const Ha = (e) => {
|
|
|
1014
1014
|
Code: "",
|
|
1015
1015
|
TenantId: "",
|
|
1016
1016
|
UserLevel: ""
|
|
1017
|
-
}, this.token = "",
|
|
1017
|
+
}, this.token = "", pe(this.token), this.isLogin = !1, Y.value = null, k.value = "", D().clean(), Promise.resolve();
|
|
1018
1018
|
},
|
|
1019
1019
|
/**
|
|
1020
1020
|
* 登出操作
|
|
@@ -1029,13 +1029,13 @@ const Ha = (e) => {
|
|
|
1029
1029
|
await this.clean(), setTimeout(async () => {
|
|
1030
1030
|
x.success("已退出登录");
|
|
1031
1031
|
}, 1e3), setTimeout(async () => {
|
|
1032
|
-
|
|
1032
|
+
D().logout();
|
|
1033
1033
|
}, 2e3);
|
|
1034
1034
|
}
|
|
1035
1035
|
return Promise.resolve();
|
|
1036
1036
|
}
|
|
1037
1037
|
},
|
|
1038
|
-
persist:
|
|
1038
|
+
persist: ve() ? !1 : {
|
|
1039
1039
|
key: "MICROAPP_USER_INFO",
|
|
1040
1040
|
storage: localStorage,
|
|
1041
1041
|
pick: ["token", "userInfo"],
|
|
@@ -1045,9 +1045,9 @@ const Ha = (e) => {
|
|
|
1045
1045
|
}
|
|
1046
1046
|
}
|
|
1047
1047
|
}), Vt = (e, t) => {
|
|
1048
|
-
const a =
|
|
1048
|
+
const a = K();
|
|
1049
1049
|
return e.filter((s) => {
|
|
1050
|
-
if (s.role && !a.hasRole(s.role) || s.permit && !a.hasPermit(
|
|
1050
|
+
if (s.role && !a.hasRole(s.role) || s.permit && !a.hasPermit(se.currentRoute.value.path, s.permit))
|
|
1051
1051
|
return !1;
|
|
1052
1052
|
if (!t) {
|
|
1053
1053
|
if (s.visible === !1)
|
|
@@ -1065,17 +1065,17 @@ const Ha = (e) => {
|
|
|
1065
1065
|
return n ? { ...s, ...n } : !1;
|
|
1066
1066
|
});
|
|
1067
1067
|
return [...a || [], ...e.filter((s) => !(a != null && a.includes(s)))];
|
|
1068
|
-
},
|
|
1068
|
+
}, Wa = (e) => (e.remotePage = !1, oa(e).then((t) => t.rows)), oa = (e) => {
|
|
1069
1069
|
e.gridQuery || (e.gridQuery = {});
|
|
1070
1070
|
const t = e.remotePage ? "find" : "list";
|
|
1071
|
-
return
|
|
1071
|
+
return Ue(e, {
|
|
1072
1072
|
urlKey: t,
|
|
1073
1073
|
url: e.gridUrl,
|
|
1074
1074
|
params: e.gridQuery,
|
|
1075
1075
|
loadingState: e.isGridLoading,
|
|
1076
1076
|
processParams: (a) => {
|
|
1077
1077
|
var n;
|
|
1078
|
-
return e.remotePage && (a.Query.$limit = [(e.pageNo.value - 1) * e.pageSize.value, e.pageSize.value]),
|
|
1078
|
+
return e.remotePage && (a.Query.$limit = [(e.pageNo.value - 1) * e.pageSize.value, e.pageSize.value]), xe((n = e.gridUrl) == null ? void 0 : n.params, a, e.gridQuery);
|
|
1079
1079
|
}
|
|
1080
1080
|
}).then((a) => {
|
|
1081
1081
|
if ((a == null ? void 0 : a.status) === R.SUCCESS) {
|
|
@@ -1107,7 +1107,7 @@ const Ha = (e) => {
|
|
|
1107
1107
|
loadingText: !1,
|
|
1108
1108
|
hideErrorToast: !0
|
|
1109
1109
|
});
|
|
1110
|
-
}, ia = async (e, t, a) => await
|
|
1110
|
+
}, ia = async (e, t, a) => await Ue(e, {
|
|
1111
1111
|
urlKey: "detail",
|
|
1112
1112
|
url: a,
|
|
1113
1113
|
params: t,
|
|
@@ -1171,30 +1171,30 @@ class Xa {
|
|
|
1171
1171
|
this.listeners[t] && this.listeners[t].forEach((s) => s(t, ...a));
|
|
1172
1172
|
}
|
|
1173
1173
|
}
|
|
1174
|
-
const
|
|
1174
|
+
const j = new Xa(), W = (e, t, a) => {
|
|
1175
1175
|
if (t.inputFactory && (a != null && a.reloadEvent)) {
|
|
1176
1176
|
const s = t.inputFactory.value;
|
|
1177
1177
|
s.reloadHandler = (n, o) => {
|
|
1178
1178
|
Za(t.url, t, o);
|
|
1179
|
-
},
|
|
1179
|
+
}, j.on(a.reloadEvent, s.reloadHandler);
|
|
1180
1180
|
}
|
|
1181
1181
|
if (a != null && a.data)
|
|
1182
|
-
|
|
1182
|
+
I(
|
|
1183
1183
|
() => a.data,
|
|
1184
1184
|
() => {
|
|
1185
|
-
|
|
1185
|
+
Je(t, a.data, !0);
|
|
1186
1186
|
},
|
|
1187
1187
|
{ deep: !0, immediate: !0 }
|
|
1188
1188
|
);
|
|
1189
1189
|
else if (t.url && t.url.url)
|
|
1190
1190
|
e && la(t.url, t, t.params ?? {});
|
|
1191
1191
|
else {
|
|
1192
|
-
const s =
|
|
1192
|
+
const s = c(X(N.LabelText, ""));
|
|
1193
1193
|
x.error("`" + s.value + "` 未配置选项数据!", {
|
|
1194
1194
|
duration: 5e3
|
|
1195
1195
|
});
|
|
1196
1196
|
}
|
|
1197
|
-
},
|
|
1197
|
+
}, Je = (e, t, a) => {
|
|
1198
1198
|
if (a) {
|
|
1199
1199
|
const s = {
|
|
1200
1200
|
...e.fieldMap
|
|
@@ -1206,14 +1206,14 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1206
1206
|
value: e.allValue ?? void 0
|
|
1207
1207
|
}), e.options.value = t;
|
|
1208
1208
|
}, Za = (e, t, a) => {
|
|
1209
|
-
Array.isArray(a) ?
|
|
1210
|
-
},
|
|
1209
|
+
Array.isArray(a) ? Je(t, a, !0) : la(e, t, a);
|
|
1210
|
+
}, ue = (e, t) => {
|
|
1211
1211
|
var a;
|
|
1212
|
-
(a = e.inputFactory) != null && a.value && t.reloadEvent && e.inputFactory.value.reloadHandler &&
|
|
1212
|
+
(a = e.inputFactory) != null && a.value && t.reloadEvent && e.inputFactory.value.reloadHandler && j.off(t.reloadEvent, e.inputFactory.value.reloadHandler);
|
|
1213
1213
|
}, la = (e, t, a) => {
|
|
1214
|
-
const s = JSON.parse(JSON.stringify(e.params ?? {})), n = JSON.parse(JSON.stringify(t.params ?? {})), o =
|
|
1214
|
+
const s = JSON.parse(JSON.stringify(e.params ?? {})), n = JSON.parse(JSON.stringify(t.params ?? {})), o = xe(s, n, a);
|
|
1215
1215
|
et(e, t, t.fieldMap, o).then((r) => {
|
|
1216
|
-
|
|
1216
|
+
Je(t, r, !1);
|
|
1217
1217
|
});
|
|
1218
1218
|
}, et = (e, t, a, s) => {
|
|
1219
1219
|
const { fieldMap: n, ...o } = e, l = {
|
|
@@ -1227,7 +1227,7 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1227
1227
|
},
|
|
1228
1228
|
...o
|
|
1229
1229
|
};
|
|
1230
|
-
return l.loadingText = !1,
|
|
1230
|
+
return l.loadingText = !1, s || (s = {}), s.Query || (s.Query = {}), t.optionQuery = s, t.isOptionLoading.value = !0, Q(l, s).then((i) => (i == null ? void 0 : i.status) === R.SUCCESS && i.data ? i.data : []).finally(() => {
|
|
1231
1231
|
t.isOptionLoading.value = !1;
|
|
1232
1232
|
});
|
|
1233
1233
|
}, at = (e, t) => {
|
|
@@ -1258,34 +1258,34 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1258
1258
|
}, Oe = (e, t, a) => {
|
|
1259
1259
|
var o, r;
|
|
1260
1260
|
const s = (o = e.inputFactory) == null ? void 0 : o.value;
|
|
1261
|
-
s != null && s.editorCtrl && ((r = s.errInfo) != null && r.value.errClass) &&
|
|
1261
|
+
s != null && s.editorCtrl && ((r = s.errInfo) != null && r.value.errClass) && le(s.editorCtrl), e.selected.value = a;
|
|
1262
1262
|
const n = at(a, e.options.value);
|
|
1263
1263
|
if (e.selectedOptions.value = n, t.formData && t.outFields && ua(t.formData, t.outFields, n), t.changeEvent) {
|
|
1264
1264
|
const [l, i] = t.changeEvent;
|
|
1265
1265
|
if (i)
|
|
1266
1266
|
if (Array.isArray(l))
|
|
1267
|
-
l.every((
|
|
1268
|
-
const
|
|
1267
|
+
l.every((u) => {
|
|
1268
|
+
const f = Me(i, { selectedValues: a });
|
|
1269
1269
|
try {
|
|
1270
|
-
const p = JSON.parse(
|
|
1271
|
-
|
|
1270
|
+
const p = JSON.parse(f);
|
|
1271
|
+
j.emit(u, p, a, n);
|
|
1272
1272
|
} catch (p) {
|
|
1273
|
-
console.error("eventParamsValue: ",
|
|
1273
|
+
console.error("eventParamsValue: ", f, p);
|
|
1274
1274
|
}
|
|
1275
1275
|
});
|
|
1276
1276
|
else {
|
|
1277
|
-
const
|
|
1277
|
+
const u = Me(i, { selectedValues: a });
|
|
1278
1278
|
try {
|
|
1279
|
-
const
|
|
1280
|
-
|
|
1281
|
-
} catch (
|
|
1282
|
-
console.error("eventParamsValue: ",
|
|
1279
|
+
const f = JSON.parse(u);
|
|
1280
|
+
j.emit(l, f, a, n);
|
|
1281
|
+
} catch (f) {
|
|
1282
|
+
console.error("eventParamsValue: ", u, f);
|
|
1283
1283
|
}
|
|
1284
1284
|
}
|
|
1285
1285
|
else
|
|
1286
|
-
Array.isArray(l) ? l.every((
|
|
1287
|
-
|
|
1288
|
-
}) :
|
|
1286
|
+
Array.isArray(l) ? l.every((u) => {
|
|
1287
|
+
j.emit(u, n, a);
|
|
1288
|
+
}) : j.emit(l, n, a);
|
|
1289
1289
|
}
|
|
1290
1290
|
return s != null && s.inputEmit && s.inputEmit("change", a, n), n;
|
|
1291
1291
|
}, Re = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((t) => t.label) : [e.label], y = {
|
|
@@ -1298,12 +1298,12 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1298
1298
|
primaryKey: "Id",
|
|
1299
1299
|
statusKey: "Enabled",
|
|
1300
1300
|
remotePage: !0,
|
|
1301
|
-
tableSize:
|
|
1302
|
-
selectable:
|
|
1303
|
-
searchBar:
|
|
1304
|
-
pageSize:
|
|
1305
|
-
rowExpand:
|
|
1306
|
-
buttons:
|
|
1301
|
+
tableSize: c("small"),
|
|
1302
|
+
selectable: c(!1),
|
|
1303
|
+
searchBar: c(!0),
|
|
1304
|
+
pageSize: c(10),
|
|
1305
|
+
rowExpand: c(!1),
|
|
1306
|
+
buttons: c(["New"]),
|
|
1307
1307
|
tools: ["Reload", "RowHeight", "TableHeadset"],
|
|
1308
1308
|
operates: ["Edit", "Delete"]
|
|
1309
1309
|
},
|
|
@@ -1345,51 +1345,51 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1345
1345
|
...y.EditorOption,
|
|
1346
1346
|
name: "",
|
|
1347
1347
|
default: a ? JSON.parse(JSON.stringify(a)) : void 0,
|
|
1348
|
-
visible:
|
|
1348
|
+
visible: c(!1),
|
|
1349
1349
|
page: t,
|
|
1350
|
-
formData:
|
|
1351
|
-
formRules:
|
|
1352
|
-
ruleResults:
|
|
1353
|
-
updateData:
|
|
1350
|
+
formData: c(a ? JSON.parse(JSON.stringify(a)) : void 0),
|
|
1351
|
+
formRules: c(s),
|
|
1352
|
+
ruleResults: c({}),
|
|
1353
|
+
updateData: c(void 0),
|
|
1354
1354
|
saveUrl: e.urls.save,
|
|
1355
1355
|
detailUrl: e.urls.detail,
|
|
1356
|
-
isFormSaving:
|
|
1357
|
-
isFormLoading:
|
|
1356
|
+
isFormSaving: c(!1),
|
|
1357
|
+
isFormLoading: c(!1)
|
|
1358
1358
|
}
|
|
1359
1359
|
}), st = (e, t, a) => {
|
|
1360
1360
|
const s = {
|
|
1361
1361
|
...y.GridOption,
|
|
1362
|
-
tableSize:
|
|
1363
|
-
selectable:
|
|
1364
|
-
searchBar:
|
|
1365
|
-
pageSize:
|
|
1366
|
-
rowExpand:
|
|
1367
|
-
buttons:
|
|
1362
|
+
tableSize: c(y.GridOption.tableSize.value),
|
|
1363
|
+
selectable: c(y.GridOption.selectable.value),
|
|
1364
|
+
searchBar: c(y.GridOption.searchBar.value),
|
|
1365
|
+
pageSize: c(y.GridOption.pageSize.value),
|
|
1366
|
+
rowExpand: c(y.GridOption.rowExpand.value),
|
|
1367
|
+
buttons: c([...y.GridOption.buttons.value]),
|
|
1368
1368
|
tools: [...y.GridOption.tools],
|
|
1369
1369
|
operates: [...y.GridOption.operates],
|
|
1370
|
-
columns:
|
|
1371
|
-
reload:
|
|
1372
|
-
pageNo:
|
|
1373
|
-
total:
|
|
1370
|
+
columns: c(a || []),
|
|
1371
|
+
reload: c(!1),
|
|
1372
|
+
pageNo: c(1),
|
|
1373
|
+
total: c(0),
|
|
1374
1374
|
page: t,
|
|
1375
|
-
selectKeys:
|
|
1376
|
-
selectRows:
|
|
1377
|
-
rowData:
|
|
1375
|
+
selectKeys: c([]),
|
|
1376
|
+
selectRows: c([]),
|
|
1377
|
+
rowData: c(void 0),
|
|
1378
1378
|
gridQuery: {},
|
|
1379
|
-
tableData:
|
|
1380
|
-
expandRows:
|
|
1381
|
-
isGridLoading:
|
|
1382
|
-
isGridSaving:
|
|
1379
|
+
tableData: U(void 0),
|
|
1380
|
+
expandRows: c({}),
|
|
1381
|
+
isGridLoading: c(!1),
|
|
1382
|
+
isGridSaving: c(!1),
|
|
1383
1383
|
gridUrl: e.urls.list || e.urls.find,
|
|
1384
1384
|
updateUrl: e.urls.update,
|
|
1385
1385
|
deleteUrl: e.urls.delete
|
|
1386
1386
|
};
|
|
1387
|
-
return
|
|
1387
|
+
return I(
|
|
1388
1388
|
() => s.reload.value,
|
|
1389
1389
|
(n) => {
|
|
1390
1390
|
n && (setTimeout(() => {
|
|
1391
1391
|
s.reload.value = !1;
|
|
1392
|
-
}, 1), s.remotePage ? oa(s) :
|
|
1392
|
+
}, 1), s.remotePage ? oa(s) : Wa(s));
|
|
1393
1393
|
}
|
|
1394
1394
|
), {
|
|
1395
1395
|
gridCtrl: s
|
|
@@ -1397,14 +1397,14 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1397
1397
|
}, qt = (e, t) => {
|
|
1398
1398
|
const a = {
|
|
1399
1399
|
...y.TreeOption,
|
|
1400
|
-
reload:
|
|
1400
|
+
reload: c(!1),
|
|
1401
1401
|
page: t,
|
|
1402
|
-
node:
|
|
1402
|
+
node: c(void 0),
|
|
1403
1403
|
url: e.urls.tree,
|
|
1404
|
-
data:
|
|
1405
|
-
isTreeLoading:
|
|
1404
|
+
data: U(void 0),
|
|
1405
|
+
isTreeLoading: c(!1)
|
|
1406
1406
|
};
|
|
1407
|
-
return
|
|
1407
|
+
return I(
|
|
1408
1408
|
() => a.reload.value,
|
|
1409
1409
|
(s) => {
|
|
1410
1410
|
s && (setTimeout(() => {
|
|
@@ -1414,24 +1414,24 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1414
1414
|
), {
|
|
1415
1415
|
treeCtrl: a
|
|
1416
1416
|
};
|
|
1417
|
-
},
|
|
1417
|
+
}, ce = (e, t) => {
|
|
1418
1418
|
const a = {
|
|
1419
1419
|
...y.OptionOption,
|
|
1420
1420
|
url: e,
|
|
1421
|
-
reload:
|
|
1421
|
+
reload: c(!1),
|
|
1422
1422
|
optionQuery: {},
|
|
1423
|
-
data:
|
|
1424
|
-
selected:
|
|
1425
|
-
selectedOptions:
|
|
1426
|
-
options:
|
|
1427
|
-
isOptionLoading:
|
|
1423
|
+
data: U([]),
|
|
1424
|
+
selected: c([]),
|
|
1425
|
+
selectedOptions: c([]),
|
|
1426
|
+
options: c([]),
|
|
1427
|
+
isOptionLoading: c(!1)
|
|
1428
1428
|
};
|
|
1429
|
-
return
|
|
1429
|
+
return I(
|
|
1430
1430
|
() => a.reload.value,
|
|
1431
1431
|
(s) => {
|
|
1432
1432
|
s && (setTimeout(() => {
|
|
1433
1433
|
a.reload.value = !1;
|
|
1434
|
-
}, 1),
|
|
1434
|
+
}, 1), W(!0, a, t));
|
|
1435
1435
|
}
|
|
1436
1436
|
), {
|
|
1437
1437
|
optionCtrl: a
|
|
@@ -1448,12 +1448,12 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1448
1448
|
editorCtrl: n,
|
|
1449
1449
|
gridCtrl: o
|
|
1450
1450
|
};
|
|
1451
|
-
},
|
|
1451
|
+
}, nt = 7 * 24 * 60 * 60 * 1e3, Fe = /* @__PURE__ */ new Map(), Ce = /* @__PURE__ */ new Set(), V = c({}), zt = V, Ct = (e) => {
|
|
1452
1452
|
var n;
|
|
1453
1453
|
if (!e.iconUrl) return Ne;
|
|
1454
|
-
const t =
|
|
1454
|
+
const t = c(!0), a = c("");
|
|
1455
1455
|
let s = !0;
|
|
1456
|
-
return (n = e.icons) != null && n.length && (s = e.icons.every((o) =>
|
|
1456
|
+
return (n = e.icons) != null && n.length && (s = e.icons.every((o) => V.value[o] !== void 0)), (e.icon && !V.value[e.icon] || !s) && rt(e, t).then(() => {
|
|
1457
1457
|
lt(e.iconUrl, e.monoColor || !1), t.value = !0;
|
|
1458
1458
|
}), C({
|
|
1459
1459
|
props: {
|
|
@@ -1482,33 +1482,33 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1482
1482
|
},
|
|
1483
1483
|
emits: ["update:iconIndex"],
|
|
1484
1484
|
setup(o, { emit: r }) {
|
|
1485
|
-
const l =
|
|
1485
|
+
const l = c(o.icon), i = c(0), u = () => {
|
|
1486
1486
|
o.icons && i.value++;
|
|
1487
1487
|
};
|
|
1488
|
-
return
|
|
1488
|
+
return I(
|
|
1489
1489
|
() => o.iconIndex,
|
|
1490
|
-
(
|
|
1491
|
-
|
|
1490
|
+
(f) => {
|
|
1491
|
+
f !== void 0 && (i.value = f);
|
|
1492
1492
|
},
|
|
1493
1493
|
{ immediate: !0 }
|
|
1494
|
-
),
|
|
1494
|
+
), I(
|
|
1495
1495
|
() => i.value,
|
|
1496
|
-
(
|
|
1497
|
-
o.icons && (
|
|
1496
|
+
(f) => {
|
|
1497
|
+
o.icons && (f >= o.icons.length && (i.value = 0), l.value = o.icons[i.value], de(a, l, l.value), r("update:iconIndex", i.value));
|
|
1498
1498
|
},
|
|
1499
1499
|
{ immediate: !0 }
|
|
1500
|
-
),
|
|
1501
|
-
() =>
|
|
1500
|
+
), I(
|
|
1501
|
+
() => V.value,
|
|
1502
1502
|
() => {
|
|
1503
|
-
|
|
1503
|
+
de(a, l, l.value);
|
|
1504
1504
|
},
|
|
1505
1505
|
{ deep: !0 }
|
|
1506
|
-
),
|
|
1506
|
+
), I(
|
|
1507
1507
|
() => o.icon,
|
|
1508
|
-
(
|
|
1509
|
-
|
|
1508
|
+
(f) => {
|
|
1509
|
+
de(a, l, f);
|
|
1510
1510
|
}
|
|
1511
|
-
),
|
|
1511
|
+
), de(a, l, l.value), { isLoaded: t, Icon: a, handleClick: u };
|
|
1512
1512
|
},
|
|
1513
1513
|
render() {
|
|
1514
1514
|
if (!t.value)
|
|
@@ -1527,7 +1527,7 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1527
1527
|
}) : _("div", { class: "w-[14px] h-[14px]" });
|
|
1528
1528
|
}
|
|
1529
1529
|
});
|
|
1530
|
-
},
|
|
1530
|
+
}, rt = (e, t) => {
|
|
1531
1531
|
let a = e.iconUrl;
|
|
1532
1532
|
if (!a)
|
|
1533
1533
|
return console.error("图标库地址不能为空"), Promise.resolve();
|
|
@@ -1570,7 +1570,7 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1570
1570
|
windowKey: t,
|
|
1571
1571
|
monoColor: a,
|
|
1572
1572
|
scriptContent: s,
|
|
1573
|
-
expireTime: Date.now() +
|
|
1573
|
+
expireTime: Date.now() + nt
|
|
1574
1574
|
// 缓存时间:7天
|
|
1575
1575
|
};
|
|
1576
1576
|
localStorage.setItem(n, JSON.stringify(o));
|
|
@@ -1585,16 +1585,16 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1585
1585
|
return console.error("解析缓存失败:", n), null;
|
|
1586
1586
|
}
|
|
1587
1587
|
return s.expireTime < Date.now() ? (localStorage.removeItem(e), null) : s;
|
|
1588
|
-
},
|
|
1588
|
+
}, Wt = () => {
|
|
1589
1589
|
const e = Date.now();
|
|
1590
1590
|
for (const t in localStorage)
|
|
1591
1591
|
if (t.startsWith("icon_cache:")) {
|
|
1592
1592
|
const a = localStorage.getItem(t);
|
|
1593
1593
|
a && JSON.parse(a).expireTime < e && localStorage.removeItem(t);
|
|
1594
1594
|
}
|
|
1595
|
-
},
|
|
1595
|
+
}, de = (e, t, a) => {
|
|
1596
1596
|
setTimeout(() => {
|
|
1597
|
-
t.value = a, t.value && (e.value =
|
|
1597
|
+
t.value = a, t.value && (e.value = V.value[t.value]);
|
|
1598
1598
|
}, 1);
|
|
1599
1599
|
}, Ne = _(
|
|
1600
1600
|
"svg",
|
|
@@ -1619,15 +1619,15 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1619
1619
|
), lt = (e, t) => {
|
|
1620
1620
|
const a = fa(e);
|
|
1621
1621
|
Object.keys(window).forEach((s) => {
|
|
1622
|
-
s.startsWith("_iconfont_svg_string_") && (a == null ? void 0 : a.windowKey) === s && !
|
|
1622
|
+
s.startsWith("_iconfont_svg_string_") && (a == null ? void 0 : a.windowKey) === s && !Ce.has(s) && (Ce.add(s), ut(s, t));
|
|
1623
1623
|
});
|
|
1624
1624
|
}, ut = (e, t) => {
|
|
1625
1625
|
const a = window[e], o = new DOMParser().parseFromString(a, "image/svg+xml").getElementsByTagName("symbol"), r = document.querySelectorAll("symbol");
|
|
1626
1626
|
for (const l of o) {
|
|
1627
|
-
const i = l.id,
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
})),
|
|
1627
|
+
const i = l.id, u = Array.from(r).find((f) => f.id === i);
|
|
1628
|
+
u && t && (u.innerHTML = l.innerHTML, u.querySelectorAll("*").forEach((f) => {
|
|
1629
|
+
f.hasAttribute("fill") && f.removeAttribute("fill");
|
|
1630
|
+
})), V.value[i] || (V.value[i] = _("svg", { fill: "currentColor" }, [_("use", { "xlink:href": `#${i}` })]));
|
|
1631
1631
|
}
|
|
1632
1632
|
}, ct = (e, t) => {
|
|
1633
1633
|
let a = "";
|
|
@@ -1635,8 +1635,8 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1635
1635
|
}, Yt = (e, t, a, s) => {
|
|
1636
1636
|
pa(e, [], a, s).forEach((o) => t.push(o));
|
|
1637
1637
|
}, pa = (e, t, a, s) => {
|
|
1638
|
-
var r, l, i,
|
|
1639
|
-
const n = [], o =
|
|
1638
|
+
var r, l, i, u, f;
|
|
1639
|
+
const n = [], o = K();
|
|
1640
1640
|
for (const p of e) {
|
|
1641
1641
|
if (p.redirect || p.path.includes("/login") || p.path.includes("/error") || p.path.includes("/:page(.*)") || (l = (r = p.meta) == null ? void 0 : r.roles) != null && l.length && !o.hasRole(p.meta.roles) && (i = p.meta) != null && i.permission && !o.hasPermit(p.meta.permission, ":page"))
|
|
1642
1642
|
continue;
|
|
@@ -1644,18 +1644,18 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1644
1644
|
m.unshift(...t);
|
|
1645
1645
|
const d = pa(p.children || [], m, a, s), E = {
|
|
1646
1646
|
key: m.join("/"),
|
|
1647
|
-
label: ((
|
|
1648
|
-
title: ((
|
|
1647
|
+
label: ((u = p.name) == null ? void 0 : u.toString()) ?? "",
|
|
1648
|
+
title: ((f = p.name) == null ? void 0 : f.toString()) ?? "",
|
|
1649
1649
|
icon: p.icon ? _(a, { ...s, icon: p.icon }) : void 0,
|
|
1650
1650
|
children: d.length > 0 ? d : void 0
|
|
1651
1651
|
};
|
|
1652
1652
|
(d.length > 0 || !p.children) && n.push(E);
|
|
1653
1653
|
}
|
|
1654
1654
|
return n;
|
|
1655
|
-
},
|
|
1656
|
-
|
|
1657
|
-
const e =
|
|
1658
|
-
let a =
|
|
1655
|
+
}, We = va([]), Xt = () => {
|
|
1656
|
+
We.length = 0;
|
|
1657
|
+
const e = D();
|
|
1658
|
+
let a = Ke().TabActive;
|
|
1659
1659
|
e.matchedRoutes(a).forEach((n, o) => {
|
|
1660
1660
|
var l;
|
|
1661
1661
|
const r = {
|
|
@@ -1663,7 +1663,7 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1663
1663
|
path: n.path,
|
|
1664
1664
|
breadcrumbName: ((l = n.name) == null ? void 0 : l.toString()) ?? ""
|
|
1665
1665
|
};
|
|
1666
|
-
|
|
1666
|
+
We.push(r);
|
|
1667
1667
|
});
|
|
1668
1668
|
}, ft = {
|
|
1669
1669
|
host: {
|
|
@@ -1677,7 +1677,7 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1677
1677
|
// 不显示错误
|
|
1678
1678
|
hideErrorToast: !0
|
|
1679
1679
|
}
|
|
1680
|
-
}, Zt =
|
|
1680
|
+
}, Zt = oe("hostInfo", {
|
|
1681
1681
|
state: () => ({
|
|
1682
1682
|
hostInfo: {
|
|
1683
1683
|
Host: "",
|
|
@@ -1703,7 +1703,7 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1703
1703
|
return new Promise((s) => {
|
|
1704
1704
|
we.SITEHOST_API || (we.SITEHOST_API = e);
|
|
1705
1705
|
const n = t || window.location.origin;
|
|
1706
|
-
|
|
1706
|
+
Q(ft.host, {
|
|
1707
1707
|
Query: {
|
|
1708
1708
|
Host: n
|
|
1709
1709
|
}
|
|
@@ -1739,7 +1739,7 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1739
1739
|
// storage: localStorage,
|
|
1740
1740
|
// pick: ['hostInfo'],
|
|
1741
1741
|
// },
|
|
1742
|
-
}), es =
|
|
1742
|
+
}), es = oe("settingInfo", {
|
|
1743
1743
|
state: () => ({
|
|
1744
1744
|
fullscreen: !1,
|
|
1745
1745
|
menuCollapse: !1,
|
|
@@ -1784,7 +1784,7 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1784
1784
|
}), as = /* @__PURE__ */ C({
|
|
1785
1785
|
__name: "index",
|
|
1786
1786
|
props: {
|
|
1787
|
-
...
|
|
1787
|
+
...ie,
|
|
1788
1788
|
/**
|
|
1789
1789
|
* 选择项数据
|
|
1790
1790
|
*/
|
|
@@ -1795,33 +1795,33 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1795
1795
|
},
|
|
1796
1796
|
emits: ["change"],
|
|
1797
1797
|
setup(e, { emit: t }) {
|
|
1798
|
-
const a = e, s =
|
|
1799
|
-
o.inputFactory =
|
|
1800
|
-
const r =
|
|
1801
|
-
o &&
|
|
1798
|
+
const a = e, s = z(), n = ce(a.url, a), o = a.optionCtrl ?? n.optionCtrl;
|
|
1799
|
+
o.inputFactory = U(s);
|
|
1800
|
+
const r = c([]);
|
|
1801
|
+
o && I(
|
|
1802
1802
|
() => o.options.value,
|
|
1803
1803
|
(p) => {
|
|
1804
1804
|
r.value = p || [];
|
|
1805
1805
|
},
|
|
1806
1806
|
{ immediate: !0, deep: !0 }
|
|
1807
1807
|
);
|
|
1808
|
-
const l = t, { editorCtrl: i, errInfo:
|
|
1809
|
-
|
|
1808
|
+
const l = t, { editorCtrl: i, errInfo: u } = z(), f = (p) => {
|
|
1809
|
+
u != null && u.value.errClass && i && le(i), l("change", p);
|
|
1810
1810
|
};
|
|
1811
|
-
return
|
|
1811
|
+
return ye(() => {
|
|
1812
1812
|
if (!a.data || a.data.length != 2) {
|
|
1813
1813
|
console.error("Switch组件: ", a.data), x.error("Switch组件必须有且只有两个选项");
|
|
1814
1814
|
return;
|
|
1815
1815
|
}
|
|
1816
|
-
o &&
|
|
1817
|
-
}),
|
|
1818
|
-
o &&
|
|
1816
|
+
o && W(o.autoload, o, a);
|
|
1817
|
+
}), ne(() => {
|
|
1818
|
+
o && ue(o, a);
|
|
1819
1819
|
}), (p, m) => {
|
|
1820
1820
|
var d;
|
|
1821
|
-
return r.value.length === 2 ? (A(),
|
|
1821
|
+
return r.value.length === 2 ? (A(), Se(b(ya), re({
|
|
1822
1822
|
key: 0,
|
|
1823
1823
|
class: [
|
|
1824
|
-
((d =
|
|
1824
|
+
((d = b(u)) == null ? void 0 : d.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : "",
|
|
1825
1825
|
"bg-blue-300",
|
|
1826
1826
|
"w-[58px]"
|
|
1827
1827
|
],
|
|
@@ -1829,36 +1829,23 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1829
1829
|
checkedValue: r.value[0].value,
|
|
1830
1830
|
unCheckedChildren: r.value[1].label,
|
|
1831
1831
|
unCheckedValue: r.value[1].value,
|
|
1832
|
-
onChange:
|
|
1833
|
-
}, p.$attrs), null, 16, ["class", "checkedChildren", "checkedValue", "unCheckedChildren", "unCheckedValue"])) :
|
|
1832
|
+
onChange: f
|
|
1833
|
+
}, p.$attrs), null, 16, ["class", "checkedChildren", "checkedValue", "unCheckedChildren", "unCheckedValue"])) : q("", !0);
|
|
1834
1834
|
};
|
|
1835
1835
|
}
|
|
1836
1836
|
}), ts = /* @__PURE__ */ C({
|
|
1837
1837
|
inheritAttrs: !1,
|
|
1838
1838
|
__name: "index",
|
|
1839
1839
|
props: {
|
|
1840
|
-
...
|
|
1840
|
+
...ie,
|
|
1841
1841
|
value: {
|
|
1842
|
-
type: [String, Number,
|
|
1842
|
+
type: [String, Number, Array, null],
|
|
1843
1843
|
default: void 0
|
|
1844
1844
|
},
|
|
1845
|
-
/**
|
|
1846
|
-
* 查询字段
|
|
1847
|
-
* - 模糊查询
|
|
1848
|
-
*/
|
|
1849
|
-
searchField: {
|
|
1850
|
-
type: [String, Array]
|
|
1851
|
-
},
|
|
1852
|
-
/**
|
|
1853
|
-
* 自定义查询参数
|
|
1854
|
-
* - 查询参数
|
|
1855
|
-
* - query参数
|
|
1856
|
-
*/
|
|
1857
|
-
onsearch: {
|
|
1858
|
-
type: Function
|
|
1859
|
-
},
|
|
1860
1845
|
/**
|
|
1861
1846
|
* 修改输入数据则自动清空关联数据
|
|
1847
|
+
* - FormData: 表单数据
|
|
1848
|
+
* - outFields: 输出字段
|
|
1862
1849
|
*/
|
|
1863
1850
|
autoClean: {
|
|
1864
1851
|
type: Boolean,
|
|
@@ -1867,81 +1854,68 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1867
1854
|
},
|
|
1868
1855
|
emits: ["update:value", "select", "change", "update:labels"],
|
|
1869
1856
|
setup(e, { emit: t }) {
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
...r == null ? void 0 : r.
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
loadingText: !1
|
|
1879
|
-
}), i = f((r == null ? void 0 : r.selected.value) || void 0);
|
|
1880
|
-
b(
|
|
1857
|
+
const a = e, s = be(), n = z(), o = ce(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
|
|
1858
|
+
r.inputFactory = U(n), r.fieldMap = {
|
|
1859
|
+
label: "Name",
|
|
1860
|
+
value: "Id",
|
|
1861
|
+
...r == null ? void 0 : r.fieldMap
|
|
1862
|
+
};
|
|
1863
|
+
const l = c((r == null ? void 0 : r.selected.value) || void 0);
|
|
1864
|
+
I(
|
|
1881
1865
|
() => a.value,
|
|
1882
1866
|
() => {
|
|
1883
|
-
|
|
1867
|
+
l.value = a.value;
|
|
1884
1868
|
},
|
|
1885
1869
|
{ immediate: !0 }
|
|
1886
|
-
),
|
|
1887
|
-
() =>
|
|
1870
|
+
), I(
|
|
1871
|
+
() => l.value,
|
|
1888
1872
|
(v) => {
|
|
1889
1873
|
a.autoClean && a.formData && a.outFields && v !== a.value && ua(a.formData, a.outFields, null);
|
|
1890
1874
|
}
|
|
1891
1875
|
);
|
|
1892
|
-
const { editorCtrl:
|
|
1893
|
-
n.inputEmit =
|
|
1894
|
-
const
|
|
1895
|
-
r &&
|
|
1876
|
+
const { editorCtrl: i, errInfo: u, labelText: f } = n, p = t;
|
|
1877
|
+
n.inputEmit = p;
|
|
1878
|
+
const m = c((r == null ? void 0 : r.options.value) || []);
|
|
1879
|
+
r && I(
|
|
1896
1880
|
() => r.options.value,
|
|
1897
1881
|
(v) => {
|
|
1898
|
-
|
|
1882
|
+
m.value = v || [];
|
|
1899
1883
|
},
|
|
1900
1884
|
{ immediate: !0, deep: !0 }
|
|
1901
1885
|
);
|
|
1902
|
-
const
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
let h = v.trim(), O = {
|
|
1906
|
-
...l.value.params,
|
|
1886
|
+
const d = (v) => {
|
|
1887
|
+
if (m.value = [], v === "") return;
|
|
1888
|
+
let h = {
|
|
1907
1889
|
Query: {
|
|
1908
|
-
|
|
1890
|
+
SearchField: "%" + v.trim() + "%"
|
|
1909
1891
|
}
|
|
1910
1892
|
};
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
}), a.onsearch && a.onsearch(h, O), r && Y(r.autoload, r, a);
|
|
1918
|
-
}, T = (v) => {
|
|
1919
|
-
const h = Oe(r, a, v);
|
|
1920
|
-
m("update:value", v), m("select", v);
|
|
1921
|
-
const O = Re(h);
|
|
1922
|
-
m("update:labels", O), u != null && u.value.errClass && c && fe(c);
|
|
1893
|
+
r.params = xe(r.params, h), r && W(!0, r, a);
|
|
1894
|
+
}, E = (v) => {
|
|
1895
|
+
const w = Oe(r, a, v);
|
|
1896
|
+
p("update:value", v), p("select", v);
|
|
1897
|
+
const h = Re(w);
|
|
1898
|
+
p("update:labels", h), u != null && u.value.errClass && i && le(i);
|
|
1923
1899
|
};
|
|
1924
|
-
return
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
value: "Name",
|
|
1929
|
-
key: "Id"
|
|
1930
|
-
});
|
|
1931
|
-
}), ie(() => {
|
|
1932
|
-
r && pe(r, a);
|
|
1933
|
-
}), (v, h) => {
|
|
1934
|
-
var O, N, K;
|
|
1900
|
+
return ne(() => {
|
|
1901
|
+
r && ue(r, a);
|
|
1902
|
+
}), (v, w) => {
|
|
1903
|
+
var h;
|
|
1935
1904
|
return A(), L("div", null, [
|
|
1936
|
-
|
|
1937
|
-
value:
|
|
1938
|
-
"onUpdate:value":
|
|
1939
|
-
class: [(
|
|
1940
|
-
options:
|
|
1941
|
-
onSearch:
|
|
1942
|
-
onSelect:
|
|
1943
|
-
placeholder:
|
|
1944
|
-
},
|
|
1905
|
+
ee(b(Sa), re({
|
|
1906
|
+
value: l.value,
|
|
1907
|
+
"onUpdate:value": w[0] || (w[0] = (S) => l.value = S),
|
|
1908
|
+
class: ["w-full", (h = b(u)) == null ? void 0 : h.errClass],
|
|
1909
|
+
options: m.value,
|
|
1910
|
+
onSearch: d,
|
|
1911
|
+
onSelect: E,
|
|
1912
|
+
placeholder: "请输入并选择" + b(f)
|
|
1913
|
+
}, b(s)), {
|
|
1914
|
+
option: H(({ label: S }) => [
|
|
1915
|
+
Ie(B(S), 1)
|
|
1916
|
+
]),
|
|
1917
|
+
_: 1
|
|
1918
|
+
}, 16, ["value", "class", "options", "placeholder"])
|
|
1945
1919
|
]);
|
|
1946
1920
|
};
|
|
1947
1921
|
}
|
|
@@ -1952,7 +1926,7 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1952
1926
|
inheritAttrs: !1,
|
|
1953
1927
|
__name: "index",
|
|
1954
1928
|
props: {
|
|
1955
|
-
...
|
|
1929
|
+
...ie,
|
|
1956
1930
|
nodata: {
|
|
1957
1931
|
type: String,
|
|
1958
1932
|
default: ""
|
|
@@ -1970,62 +1944,62 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
1970
1944
|
emits: ["change", "update:labels"],
|
|
1971
1945
|
setup(e, { emit: t }) {
|
|
1972
1946
|
var m, d, E;
|
|
1973
|
-
const a = e, s =
|
|
1974
|
-
r.inputFactory =
|
|
1975
|
-
const l =
|
|
1947
|
+
const a = e, s = be(), n = z(), o = ce(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
|
|
1948
|
+
r.inputFactory = U(n);
|
|
1949
|
+
const l = c({
|
|
1976
1950
|
...r == null ? void 0 : r.url,
|
|
1977
1951
|
url: ((m = r == null ? void 0 : r.url) == null ? void 0 : m.url) || "",
|
|
1978
1952
|
fieldMap: (r == null ? void 0 : r.fieldMap) || ((d = r == null ? void 0 : r.url) == null ? void 0 : d.fieldMap),
|
|
1979
1953
|
params: (r == null ? void 0 : r.params) || ((E = r == null ? void 0 : r.url) == null ? void 0 : E.params),
|
|
1980
1954
|
loadingText: !1
|
|
1981
|
-
}), { errInfo: i } = n,
|
|
1982
|
-
n.inputEmit =
|
|
1983
|
-
const
|
|
1984
|
-
r &&
|
|
1955
|
+
}), { errInfo: i } = n, u = t;
|
|
1956
|
+
n.inputEmit = u;
|
|
1957
|
+
const f = c((r == null ? void 0 : r.options.value) || []);
|
|
1958
|
+
r && I(
|
|
1985
1959
|
() => r.options.value,
|
|
1986
|
-
(
|
|
1987
|
-
|
|
1960
|
+
(v) => {
|
|
1961
|
+
f.value = v || [];
|
|
1988
1962
|
},
|
|
1989
1963
|
{ immediate: !0, deep: !0 }
|
|
1990
1964
|
);
|
|
1991
|
-
const p = (
|
|
1992
|
-
const
|
|
1993
|
-
|
|
1965
|
+
const p = (v) => {
|
|
1966
|
+
const h = Oe(r, a, v), S = Re(h);
|
|
1967
|
+
u("update:labels", S);
|
|
1994
1968
|
};
|
|
1995
|
-
return
|
|
1969
|
+
return ye(() => {
|
|
1996
1970
|
l.value && !l.value.fieldMap && (l.value.fieldMap = {
|
|
1997
1971
|
title: "Name",
|
|
1998
1972
|
label: "Name",
|
|
1999
1973
|
value: "Id",
|
|
2000
1974
|
key: "Id"
|
|
2001
|
-
}), r &&
|
|
2002
|
-
}),
|
|
2003
|
-
r &&
|
|
2004
|
-
}), (
|
|
2005
|
-
|
|
1975
|
+
}), r && W(r.autoload, r, a);
|
|
1976
|
+
}), ne(() => {
|
|
1977
|
+
r && ue(r, a);
|
|
1978
|
+
}), (v, w) => (A(), L("div", pt, [
|
|
1979
|
+
ee(b(ba), re({
|
|
2006
1980
|
onChange: p,
|
|
2007
1981
|
class: "w-full mb-[-3px]"
|
|
2008
|
-
},
|
|
2009
|
-
default:
|
|
2010
|
-
|
|
2011
|
-
var
|
|
2012
|
-
return A(),
|
|
2013
|
-
key:
|
|
2014
|
-
value:
|
|
2015
|
-
disabled:
|
|
1982
|
+
}, b(s)), {
|
|
1983
|
+
default: H(() => [
|
|
1984
|
+
f.value.length > 0 ? (A(!0), L(ae, { key: 0 }, _e(f.value, (h) => {
|
|
1985
|
+
var S;
|
|
1986
|
+
return A(), Se(b(Ia), {
|
|
1987
|
+
key: h.value,
|
|
1988
|
+
value: h.value,
|
|
1989
|
+
disabled: h.disabled || h.value && e.disabledItems && e.disabledItems.indexOf(h.value.toString()) > -1,
|
|
2016
1990
|
class: Xe([
|
|
2017
|
-
((
|
|
1991
|
+
((S = b(i)) == null ? void 0 : S.errClass) === "error" ? "error !text-red-400" : "",
|
|
2018
1992
|
"text-nowrap",
|
|
2019
1993
|
"pb-1",
|
|
2020
1994
|
e.wrap ? `w-1/${a.wrap}` : ""
|
|
2021
1995
|
])
|
|
2022
1996
|
}, {
|
|
2023
|
-
default:
|
|
2024
|
-
|
|
1997
|
+
default: H(() => [
|
|
1998
|
+
Ie(B(h.label), 1)
|
|
2025
1999
|
]),
|
|
2026
2000
|
_: 2
|
|
2027
2001
|
}, 1032, ["value", "disabled", "class"]);
|
|
2028
|
-
}), 128)) : e.nodata ? (A(), L("div", dt,
|
|
2002
|
+
}), 128)) : e.nodata ? (A(), L("div", dt, B(e.nodata), 1)) : q("", !0)
|
|
2029
2003
|
]),
|
|
2030
2004
|
_: 1
|
|
2031
2005
|
}, 16)
|
|
@@ -2034,11 +2008,11 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
2034
2008
|
}), ht = { class: "min-h-[32px] pt-1" }, mt = {
|
|
2035
2009
|
key: 1,
|
|
2036
2010
|
class: "text-center text-gray-500"
|
|
2037
|
-
},
|
|
2011
|
+
}, ns = /* @__PURE__ */ C({
|
|
2038
2012
|
inheritAttrs: !1,
|
|
2039
2013
|
__name: "index",
|
|
2040
2014
|
props: {
|
|
2041
|
-
...
|
|
2015
|
+
...ie,
|
|
2042
2016
|
value: {
|
|
2043
2017
|
type: [String, Number, null, Array],
|
|
2044
2018
|
default: void 0
|
|
@@ -2056,78 +2030,78 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
2056
2030
|
},
|
|
2057
2031
|
emits: ["change", "update:value", "update:labels"],
|
|
2058
2032
|
setup(e, { emit: t }) {
|
|
2059
|
-
var E,
|
|
2060
|
-
const a = e, s =
|
|
2061
|
-
r.inputFactory =
|
|
2062
|
-
const l =
|
|
2033
|
+
var E, v, w;
|
|
2034
|
+
const a = e, s = be(), n = z(), o = ce(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
|
|
2035
|
+
r.inputFactory = U(n);
|
|
2036
|
+
const l = c({
|
|
2063
2037
|
...r == null ? void 0 : r.url,
|
|
2064
2038
|
url: ((E = r == null ? void 0 : r.url) == null ? void 0 : E.url) || "",
|
|
2065
|
-
fieldMap: (r == null ? void 0 : r.fieldMap) || ((
|
|
2066
|
-
params: (r == null ? void 0 : r.params) || ((
|
|
2039
|
+
fieldMap: (r == null ? void 0 : r.fieldMap) || ((v = r == null ? void 0 : r.url) == null ? void 0 : v.fieldMap),
|
|
2040
|
+
params: (r == null ? void 0 : r.params) || ((w = r == null ? void 0 : r.url) == null ? void 0 : w.params),
|
|
2067
2041
|
loadingText: !1
|
|
2068
|
-
}), i =
|
|
2069
|
-
n.inputEmit = p, r &&
|
|
2042
|
+
}), i = c(a.value), { errInfo: u } = n, f = c((r == null ? void 0 : r.options.value) || []), p = t;
|
|
2043
|
+
n.inputEmit = p, r && I(
|
|
2070
2044
|
() => r.options.value,
|
|
2071
|
-
(
|
|
2072
|
-
|
|
2045
|
+
(h) => {
|
|
2046
|
+
f.value = h || [];
|
|
2073
2047
|
},
|
|
2074
2048
|
{ immediate: !0, deep: !0 }
|
|
2075
|
-
),
|
|
2049
|
+
), I(
|
|
2076
2050
|
() => i.value,
|
|
2077
|
-
(
|
|
2078
|
-
p("update:value",
|
|
2051
|
+
(h) => {
|
|
2052
|
+
p("update:value", h);
|
|
2079
2053
|
}
|
|
2080
2054
|
);
|
|
2081
|
-
const m = (
|
|
2082
|
-
if (typeof
|
|
2083
|
-
const
|
|
2084
|
-
return
|
|
2055
|
+
const m = (h, S) => {
|
|
2056
|
+
if (typeof h == "object" && typeof S == "object") {
|
|
2057
|
+
const O = JSON.stringify(h) === JSON.stringify(S);
|
|
2058
|
+
return O && (i.value = h), O;
|
|
2085
2059
|
}
|
|
2086
|
-
return
|
|
2087
|
-
}, d = (
|
|
2088
|
-
const
|
|
2089
|
-
p("update:labels",
|
|
2060
|
+
return h === S;
|
|
2061
|
+
}, d = (h) => {
|
|
2062
|
+
const S = h.target.value, O = Oe(r, a, S), g = Re(O);
|
|
2063
|
+
p("update:labels", g);
|
|
2090
2064
|
};
|
|
2091
|
-
return
|
|
2065
|
+
return ye(() => {
|
|
2092
2066
|
l.value && !l.value.fieldMap && (l.value.fieldMap = {
|
|
2093
2067
|
label: "Name",
|
|
2094
2068
|
value: "Id",
|
|
2095
2069
|
key: "Id"
|
|
2096
|
-
}), r &&
|
|
2097
|
-
}),
|
|
2098
|
-
r &&
|
|
2099
|
-
}), (
|
|
2100
|
-
|
|
2070
|
+
}), r && W(r.autoload, r, a);
|
|
2071
|
+
}), ne(() => {
|
|
2072
|
+
r && ue(r, a);
|
|
2073
|
+
}), (h, S) => (A(), L("div", ht, [
|
|
2074
|
+
ee(b(xa), re({
|
|
2101
2075
|
value: i.value,
|
|
2102
|
-
"onUpdate:value":
|
|
2076
|
+
"onUpdate:value": S[0] || (S[0] = (O) => i.value = O),
|
|
2103
2077
|
autocheck: !1,
|
|
2104
2078
|
onChange: d,
|
|
2105
2079
|
class: "w-full flex align-items flex-wrap mb-[-3px]"
|
|
2106
|
-
},
|
|
2107
|
-
default:
|
|
2108
|
-
|
|
2109
|
-
var
|
|
2110
|
-
return A(), L(
|
|
2111
|
-
key:
|
|
2080
|
+
}, b(s)), {
|
|
2081
|
+
default: H(() => [
|
|
2082
|
+
f.value.length > 0 ? (A(!0), L(ae, { key: 0 }, _e(f.value, (O) => {
|
|
2083
|
+
var g;
|
|
2084
|
+
return A(), L(ae, {
|
|
2085
|
+
key: O.value
|
|
2112
2086
|
}, [
|
|
2113
|
-
|
|
2087
|
+
O.visible !== !1 ? (A(), Se(b(Aa), {
|
|
2114
2088
|
key: 0,
|
|
2115
|
-
checked: m(
|
|
2116
|
-
value:
|
|
2089
|
+
checked: m(O.value, a.value),
|
|
2090
|
+
value: O.value,
|
|
2117
2091
|
class: Xe([
|
|
2118
|
-
((
|
|
2092
|
+
((g = b(u)) == null ? void 0 : g.errClass) === "error" ? "error !text-red-400" : "",
|
|
2119
2093
|
"text-nowrap",
|
|
2120
2094
|
"pb-1",
|
|
2121
2095
|
e.wrap ? `w-1/${a.wrap}` : ""
|
|
2122
2096
|
])
|
|
2123
2097
|
}, {
|
|
2124
|
-
default:
|
|
2125
|
-
|
|
2098
|
+
default: H(() => [
|
|
2099
|
+
Ie(B(O.label), 1)
|
|
2126
2100
|
]),
|
|
2127
2101
|
_: 2
|
|
2128
|
-
}, 1032, ["checked", "value", "class"])) :
|
|
2102
|
+
}, 1032, ["checked", "value", "class"])) : q("", !0)
|
|
2129
2103
|
], 64);
|
|
2130
|
-
}), 128)) : e.nodata ? (A(), L("div", mt,
|
|
2104
|
+
}), 128)) : e.nodata ? (A(), L("div", mt, B(e.nodata), 1)) : q("", !0)
|
|
2131
2105
|
]),
|
|
2132
2106
|
_: 1
|
|
2133
2107
|
}, 16, ["value"])
|
|
@@ -2136,11 +2110,11 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
2136
2110
|
}), vt = {
|
|
2137
2111
|
key: 0,
|
|
2138
2112
|
class: "absolute z-10 mt-[5px] mr-[10px] text-[#999] flex items-center"
|
|
2139
|
-
},
|
|
2113
|
+
}, rs = /* @__PURE__ */ C({
|
|
2140
2114
|
inheritAttrs: !1,
|
|
2141
2115
|
__name: "index",
|
|
2142
2116
|
props: {
|
|
2143
|
-
...
|
|
2117
|
+
...ie,
|
|
2144
2118
|
value: {
|
|
2145
2119
|
type: [String, Number, Array, null],
|
|
2146
2120
|
default: void 0
|
|
@@ -2162,89 +2136,89 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
2162
2136
|
},
|
|
2163
2137
|
emits: ["change", "update:value", "update:labels"],
|
|
2164
2138
|
setup(e, { emit: t }) {
|
|
2165
|
-
var
|
|
2166
|
-
const a = e, s =
|
|
2167
|
-
i.inputFactory =
|
|
2168
|
-
const
|
|
2139
|
+
var h, S, O;
|
|
2140
|
+
const a = e, s = z(), { editorCtrl: n, errInfo: o, labelText: r } = s, l = ce(a.url, a), i = a.optionCtrl ?? l.optionCtrl;
|
|
2141
|
+
i.inputFactory = U(s);
|
|
2142
|
+
const u = be(), f = c({
|
|
2169
2143
|
...i == null ? void 0 : i.url,
|
|
2170
|
-
url: ((
|
|
2171
|
-
fieldMap: (i == null ? void 0 : i.fieldMap) || ((
|
|
2172
|
-
params: (i == null ? void 0 : i.params) || ((
|
|
2144
|
+
url: ((h = i == null ? void 0 : i.url) == null ? void 0 : h.url) || "",
|
|
2145
|
+
fieldMap: (i == null ? void 0 : i.fieldMap) || ((S = i == null ? void 0 : i.url) == null ? void 0 : S.fieldMap),
|
|
2146
|
+
params: (i == null ? void 0 : i.params) || ((O = i == null ? void 0 : i.url) == null ? void 0 : O.params),
|
|
2173
2147
|
loadingText: !1
|
|
2174
|
-
}), p =
|
|
2148
|
+
}), p = c(a.value), m = c(u.placeholder), d = c((i == null ? void 0 : i.selected.value) || void 0), E = t;
|
|
2175
2149
|
s.inputEmit = E;
|
|
2176
|
-
const
|
|
2177
|
-
i &&
|
|
2150
|
+
const v = c((i == null ? void 0 : i.options.value) || []);
|
|
2151
|
+
i && I(
|
|
2178
2152
|
() => i.options.value,
|
|
2179
|
-
(
|
|
2180
|
-
|
|
2153
|
+
(g) => {
|
|
2154
|
+
v.value = g || [];
|
|
2181
2155
|
},
|
|
2182
2156
|
{ immediate: !0, deep: !0 }
|
|
2183
2157
|
);
|
|
2184
|
-
const
|
|
2185
|
-
const
|
|
2186
|
-
d.value =
|
|
2158
|
+
const w = (g) => {
|
|
2159
|
+
const J = Oe(i, a, g), fe = Re(J);
|
|
2160
|
+
d.value = g, E("update:labels", fe), E("change", g), o != null && o.value.errClass && n && le(n);
|
|
2187
2161
|
};
|
|
2188
|
-
return
|
|
2189
|
-
() =>
|
|
2190
|
-
(
|
|
2191
|
-
|
|
2162
|
+
return I(
|
|
2163
|
+
() => v.value,
|
|
2164
|
+
(g) => {
|
|
2165
|
+
g.length && P(a.value) && a.selectFirst ? d.value = g[0].value : d.value = a.value === null ? void 0 : a.value, g.length > 0 && d.value && w(d.value);
|
|
2192
2166
|
}
|
|
2193
|
-
),
|
|
2194
|
-
() =>
|
|
2195
|
-
(
|
|
2196
|
-
|
|
2167
|
+
), I(
|
|
2168
|
+
() => f.value.loading,
|
|
2169
|
+
(g) => {
|
|
2170
|
+
g ? m.value = "" : m.value || (m.value = "请选择" + r.value);
|
|
2197
2171
|
},
|
|
2198
2172
|
{ immediate: !0 }
|
|
2199
|
-
),
|
|
2173
|
+
), I(
|
|
2200
2174
|
() => d.value,
|
|
2201
|
-
(
|
|
2202
|
-
if (
|
|
2175
|
+
(g) => {
|
|
2176
|
+
if (u.mode === "multiple" && P(g) && P(p.value)) {
|
|
2203
2177
|
E("update:value", p.value);
|
|
2204
2178
|
return;
|
|
2205
2179
|
}
|
|
2206
|
-
E("update:value",
|
|
2180
|
+
E("update:value", g);
|
|
2207
2181
|
}
|
|
2208
|
-
),
|
|
2209
|
-
if (
|
|
2182
|
+
), ye(() => {
|
|
2183
|
+
if (f.value && !f.value.fieldMap && (f.value.fieldMap = {
|
|
2210
2184
|
label: "Name",
|
|
2211
2185
|
value: "Id",
|
|
2212
2186
|
key: "Id"
|
|
2213
2187
|
}), a.dataKey) {
|
|
2214
|
-
const
|
|
2215
|
-
|
|
2216
|
-
} else i &&
|
|
2217
|
-
}),
|
|
2218
|
-
i &&
|
|
2219
|
-
}), (
|
|
2220
|
-
var
|
|
2188
|
+
const g = JSON.parse(JSON.stringify(M.getOptions(a.dataKey)));
|
|
2189
|
+
v.value = g;
|
|
2190
|
+
} else i && W(i.autoload, i, a);
|
|
2191
|
+
}), ne(() => {
|
|
2192
|
+
i && ue(i, a);
|
|
2193
|
+
}), (g, J) => {
|
|
2194
|
+
var fe, Ge, je;
|
|
2221
2195
|
return A(), L("div", null, [
|
|
2222
|
-
(
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
])) :
|
|
2226
|
-
|
|
2227
|
-
class: [(
|
|
2196
|
+
(Ge = (fe = b(i)) == null ? void 0 : fe.url) != null && Ge.loading ? (A(), L("div", vt, [
|
|
2197
|
+
ee(b(Ne), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
|
|
2198
|
+
J[1] || (J[1] = ga("span", null, "数据加载中...", -1))
|
|
2199
|
+
])) : q("", !0),
|
|
2200
|
+
ee(b(Ea), re({
|
|
2201
|
+
class: [(je = b(o)) == null ? void 0 : je.errClass, "w-full"],
|
|
2228
2202
|
value: d.value,
|
|
2229
|
-
"onUpdate:value":
|
|
2203
|
+
"onUpdate:value": J[0] || (J[0] = (G) => d.value = G),
|
|
2230
2204
|
"allow-clear": !0,
|
|
2231
|
-
onChange:
|
|
2205
|
+
onChange: w,
|
|
2232
2206
|
placeholder: m.value,
|
|
2233
2207
|
"label-in-value": !1
|
|
2234
|
-
},
|
|
2235
|
-
default:
|
|
2236
|
-
(A(!0), L(
|
|
2237
|
-
key:
|
|
2208
|
+
}, b(u)), {
|
|
2209
|
+
default: H(() => [
|
|
2210
|
+
(A(!0), L(ae, null, _e(v.value, (G) => (A(), L(ae, {
|
|
2211
|
+
key: G.value
|
|
2238
2212
|
}, [
|
|
2239
|
-
|
|
2213
|
+
G.visible !== !1 ? (A(), Se(b(Oa), {
|
|
2240
2214
|
key: 0,
|
|
2241
|
-
value:
|
|
2215
|
+
value: G.value
|
|
2242
2216
|
}, {
|
|
2243
|
-
default:
|
|
2244
|
-
|
|
2217
|
+
default: H(() => [
|
|
2218
|
+
Ie(B(G.label), 1)
|
|
2245
2219
|
]),
|
|
2246
2220
|
_: 2
|
|
2247
|
-
}, 1032, ["value"])) :
|
|
2221
|
+
}, 1032, ["value"])) : q("", !0)
|
|
2248
2222
|
], 64))), 128))
|
|
2249
2223
|
]),
|
|
2250
2224
|
_: 1
|
|
@@ -2255,9 +2229,9 @@ const q = new Xa(), Y = (e, t, a) => {
|
|
|
2255
2229
|
});
|
|
2256
2230
|
export {
|
|
2257
2231
|
Ft as $,
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2232
|
+
ns as A,
|
|
2233
|
+
rs as B,
|
|
2234
|
+
Ue as C,
|
|
2261
2235
|
Ma as D,
|
|
2262
2236
|
jt as E,
|
|
2263
2237
|
tt as F,
|
|
@@ -2270,20 +2244,20 @@ export {
|
|
|
2270
2244
|
Re as M,
|
|
2271
2245
|
zt as N,
|
|
2272
2246
|
M as O,
|
|
2273
|
-
|
|
2274
|
-
|
|
2247
|
+
N as P,
|
|
2248
|
+
Wt as Q,
|
|
2275
2249
|
ut as R,
|
|
2276
2250
|
ct as S,
|
|
2277
2251
|
Yt as T,
|
|
2278
|
-
|
|
2252
|
+
We as U,
|
|
2279
2253
|
Xt as V,
|
|
2280
2254
|
ea as W,
|
|
2281
|
-
|
|
2255
|
+
Dt as X,
|
|
2282
2256
|
aa as Y,
|
|
2283
2257
|
kt as Z,
|
|
2284
2258
|
as as _,
|
|
2285
2259
|
es as a,
|
|
2286
|
-
|
|
2260
|
+
Ve as a0,
|
|
2287
2261
|
Lt as a1,
|
|
2288
2262
|
Ht as a2,
|
|
2289
2263
|
Ya as a3,
|
|
@@ -2293,36 +2267,36 @@ export {
|
|
|
2293
2267
|
Ze as a7,
|
|
2294
2268
|
$a as a8,
|
|
2295
2269
|
$e as a9,
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2270
|
+
j as aa,
|
|
2271
|
+
Z as ab,
|
|
2272
|
+
he as ac,
|
|
2273
|
+
D as ad,
|
|
2300
2274
|
Zt as ae,
|
|
2301
|
-
|
|
2302
|
-
|
|
2275
|
+
Ke as af,
|
|
2276
|
+
te as ag,
|
|
2303
2277
|
Nt as b,
|
|
2304
|
-
|
|
2305
|
-
|
|
2278
|
+
Ct as c,
|
|
2279
|
+
_t as d,
|
|
2306
2280
|
Mt as e,
|
|
2307
2281
|
Jt as f,
|
|
2308
2282
|
Gt as g,
|
|
2309
2283
|
Vt as h,
|
|
2310
2284
|
P as i,
|
|
2311
|
-
|
|
2285
|
+
Ut as j,
|
|
2312
2286
|
oa as k,
|
|
2313
|
-
|
|
2287
|
+
Wa as l,
|
|
2314
2288
|
Kt as m,
|
|
2315
2289
|
ts as n,
|
|
2316
2290
|
$t as o,
|
|
2317
|
-
|
|
2291
|
+
ie as p,
|
|
2318
2292
|
Na as q,
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2293
|
+
se as r,
|
|
2294
|
+
z as s,
|
|
2295
|
+
ce as t,
|
|
2296
|
+
K as u,
|
|
2297
|
+
W as v,
|
|
2298
|
+
ue as w,
|
|
2325
2299
|
Ne as x,
|
|
2326
|
-
|
|
2300
|
+
le as y,
|
|
2327
2301
|
ss as z
|
|
2328
2302
|
};
|