@skyfox2000/webui 1.2.2 → 1.2.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/{download-C3KYmuzo.js → download-D6JcG5ZR.js} +3 -3
- package/lib/assets/modules/{file-upload-CMHnVQty.js → file-upload-D5dPRmq8.js} +1 -1
- package/lib/assets/modules/{form-excel-Xre5F1Ez.js → form-excel-DITF2FoK.js} +1 -1
- package/lib/assets/modules/{index-htdsukeW.js → index-CRKPVlgC.js} +1 -1
- package/lib/assets/modules/{index-lc53kVVe.js → index-XIk9IJH2.js} +2 -2
- package/lib/assets/modules/{menuTabs-CkAkFKU8.js → menuTabs-D2OgHmBc.js} +2 -2
- package/lib/assets/modules/{hostInfo-DK8lknRe.js → pinia-8iujwf8y.js} +273 -269
- package/lib/assets/modules/{toolIcon-Dpr1pbgl.js → toolIcon-Cwggvppx.js} +1 -1
- 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 +2 -1
- package/lib/webui.es.js +52 -50
- package/package.json +1 -1
- package/src/index.ts +4 -1
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var ia = Object.defineProperty;
|
|
2
|
+
var la = (e, t, a) => t in e ? ia(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
|
+
var P = (e, t, a) => la(e, typeof t != "symbol" ? t + "" : t, a);
|
|
4
4
|
import { ref as f, h as D, defineComponent as W, toRaw as Qe, watch as T, useAttrs as ae, onMounted as te, onUnmounted as se, createElementBlock as O, openBlock as E, createVNode as q, unref as x, mergeProps as re, withCtx as H, createCommentVNode as j, Fragment as B, renderList as Ee, createBlock as Ae, normalizeClass as Ge, createTextVNode as Re, toDisplayString as J, createElementVNode as ua, inject as G, provide as he, nextTick as ca, shallowRef as Ve, reactive as fa } from "vue";
|
|
5
5
|
import { AutoComplete as pa, CheckboxGroup as da, Checkbox as ha, RadioGroup as ma, Radio as va, Select as ga, SelectOption as ya } from "ant-design-vue";
|
|
6
6
|
import { ResStatus as A, httpPost as _, setToken as me, fieldMapping as ba, parseFieldTemplate as Sa, API_HOST as ve, SERVER_HOST as Ia } from "@skyfox2000/fapi";
|
|
7
7
|
import S from "vue-m-message";
|
|
8
|
-
import { defineStore as Y } from "pinia";
|
|
8
|
+
import { defineStore as Y, createPinia as xa } from "pinia";
|
|
9
9
|
import "vue-draggable-next";
|
|
10
10
|
import "dayjs";
|
|
11
11
|
import { combineParams as Te, isMicroApp as qe, mainAppApis as $e, EnvConfig as De, AppAction as Fe, AppSource as Ne, isBaseMicroApp as Ce } from "@skyfox2000/microbase";
|
|
12
12
|
import we from "async-validator";
|
|
13
|
-
import
|
|
14
|
-
|
|
13
|
+
import Ea from "pinia-plugin-persistedstate";
|
|
14
|
+
import { createRouter as Aa, createWebHashHistory as Ra } from "vue-router";
|
|
15
|
+
const Ta = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PURE__ */ new Set(), C = f({}), At = C, Rt = (e) => {
|
|
15
16
|
var r;
|
|
16
17
|
if (!e.iconUrl) return Se;
|
|
17
18
|
const t = f(!0), a = f("");
|
|
18
19
|
let s = !0;
|
|
19
|
-
return (r = e.icons) != null && r.length && (s = e.icons.every((n) => C.value[n] !== void 0)), (e.icon && !C.value[e.icon] || !s) &&
|
|
20
|
-
|
|
20
|
+
return (r = e.icons) != null && r.length && (s = e.icons.every((n) => C.value[n] !== void 0)), (e.icon && !C.value[e.icon] || !s) && wa(e, t).then(() => {
|
|
21
|
+
ka(e.iconUrl, e.monoColor || !1), t.value = !0;
|
|
21
22
|
}), W({
|
|
22
23
|
props: {
|
|
23
24
|
icon: {
|
|
@@ -45,52 +46,52 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
45
46
|
},
|
|
46
47
|
emits: ["update:iconIndex"],
|
|
47
48
|
setup(n, { emit: o }) {
|
|
48
|
-
const
|
|
49
|
-
n.icons &&
|
|
49
|
+
const i = f(n.icon), l = f(0), u = () => {
|
|
50
|
+
n.icons && l.value++;
|
|
50
51
|
};
|
|
51
52
|
return T(
|
|
52
53
|
() => n.iconIndex,
|
|
53
54
|
(c) => {
|
|
54
|
-
c !== void 0 && (
|
|
55
|
+
c !== void 0 && (l.value = c);
|
|
55
56
|
},
|
|
56
57
|
{ immediate: !0 }
|
|
57
58
|
), T(
|
|
58
|
-
() =>
|
|
59
|
+
() => l.value,
|
|
59
60
|
(c) => {
|
|
60
|
-
n.icons && (c >= n.icons.length && (
|
|
61
|
+
n.icons && (c >= n.icons.length && (l.value = 0), i.value = n.icons[l.value], X(a, i, i.value), o("update:iconIndex", l.value));
|
|
61
62
|
},
|
|
62
63
|
{ immediate: !0 }
|
|
63
64
|
), T(
|
|
64
65
|
() => C.value,
|
|
65
66
|
() => {
|
|
66
|
-
X(a,
|
|
67
|
+
X(a, i, i.value);
|
|
67
68
|
},
|
|
68
69
|
{ deep: !0 }
|
|
69
70
|
), T(
|
|
70
71
|
() => n.icon,
|
|
71
72
|
(c) => {
|
|
72
|
-
X(a,
|
|
73
|
+
X(a, i, c);
|
|
73
74
|
}
|
|
74
|
-
), X(a,
|
|
75
|
+
), X(a, i, i.value), { isLoaded: t, Icon: a, handleClick: u };
|
|
75
76
|
},
|
|
76
77
|
render() {
|
|
77
78
|
if (!t.value)
|
|
78
79
|
return Se;
|
|
79
80
|
let n = this.class, o = "";
|
|
80
81
|
Array.isArray(n) ? o = n.join(" ") : typeof n == "string" && (o = n);
|
|
81
|
-
let
|
|
82
|
-
return !/\bw-/.test(o) && !/$w-/.test(o) &&
|
|
82
|
+
let i = [o];
|
|
83
|
+
return !/\bw-/.test(o) && !/$w-/.test(o) && i.push("w-4"), !/\bh-/.test(o) && !/$h-/.test(o) && i.push("h-4"), a.value ? D(Qe(a.value), {
|
|
83
84
|
onClick: this.$props.clickable ? this.handleClick : void 0,
|
|
84
|
-
class: `${
|
|
85
|
+
class: `${i.join(" ")}`,
|
|
85
86
|
style: {
|
|
86
87
|
fill: "currentColor",
|
|
87
88
|
cursor: this.$props.clickable ? "pointer" : "default",
|
|
88
|
-
transform:
|
|
89
|
+
transform: Ma(this.angle, this.flip)
|
|
89
90
|
}
|
|
90
91
|
}) : D("div", { class: "w-[14px] h-[14px]" });
|
|
91
92
|
}
|
|
92
93
|
});
|
|
93
|
-
},
|
|
94
|
+
}, wa = (e, t) => {
|
|
94
95
|
let a = e.iconUrl;
|
|
95
96
|
if (!a)
|
|
96
97
|
return console.error("图标库地址不能为空"), Promise.resolve();
|
|
@@ -101,10 +102,10 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
101
102
|
return new Promise(async (n) => (je(s.scriptContent), n()));
|
|
102
103
|
t.value = !1;
|
|
103
104
|
const r = new Promise(async (n) => {
|
|
104
|
-
await
|
|
105
|
+
await Oa(a, e.monoColor || !1), n(), ge.delete(a);
|
|
105
106
|
});
|
|
106
107
|
return ge.set(a, r), r;
|
|
107
|
-
},
|
|
108
|
+
}, Oa = async (e, t) => {
|
|
108
109
|
try {
|
|
109
110
|
const a = await fetch(e);
|
|
110
111
|
if (!a.ok) {
|
|
@@ -117,7 +118,7 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
117
118
|
const n = s.match(r);
|
|
118
119
|
if (n && n.length > 1) {
|
|
119
120
|
let o = n[1];
|
|
120
|
-
|
|
121
|
+
Pa(e, o, t, s);
|
|
121
122
|
}
|
|
122
123
|
je(s);
|
|
123
124
|
return;
|
|
@@ -127,13 +128,13 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
127
128
|
}, je = (e) => {
|
|
128
129
|
const t = document.createElement("script");
|
|
129
130
|
t.textContent = e, document.head.appendChild(t);
|
|
130
|
-
},
|
|
131
|
+
}, Pa = (e, t, a, s) => {
|
|
131
132
|
let r = `icon_cache:${e}`;
|
|
132
133
|
const n = {
|
|
133
134
|
windowKey: t,
|
|
134
135
|
monoColor: a,
|
|
135
136
|
scriptContent: s,
|
|
136
|
-
expireTime: Date.now() +
|
|
137
|
+
expireTime: Date.now() + Ta
|
|
137
138
|
// 缓存时间:7天
|
|
138
139
|
};
|
|
139
140
|
localStorage.setItem(r, JSON.stringify(n));
|
|
@@ -148,7 +149,7 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
148
149
|
return console.error("解析缓存失败:", r), null;
|
|
149
150
|
}
|
|
150
151
|
return s.expireTime < Date.now() ? (localStorage.removeItem(e), null) : s;
|
|
151
|
-
},
|
|
152
|
+
}, Tt = () => {
|
|
152
153
|
const e = Date.now();
|
|
153
154
|
for (const t in localStorage)
|
|
154
155
|
if (t.startsWith("icon_cache:")) {
|
|
@@ -179,23 +180,23 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
179
180
|
fill: "currentColor"
|
|
180
181
|
})
|
|
181
182
|
]
|
|
182
|
-
),
|
|
183
|
+
), ka = (e, t) => {
|
|
183
184
|
const a = Be(e);
|
|
184
185
|
Object.keys(window).forEach((s) => {
|
|
185
|
-
s.startsWith("_iconfont_svg_string_") && (a == null ? void 0 : a.windowKey) === s && !Ue.has(s) && (Ue.add(s),
|
|
186
|
+
s.startsWith("_iconfont_svg_string_") && (a == null ? void 0 : a.windowKey) === s && !Ue.has(s) && (Ue.add(s), La(s, t));
|
|
186
187
|
});
|
|
187
|
-
},
|
|
188
|
+
}, La = (e, t) => {
|
|
188
189
|
const a = window[e], n = new DOMParser().parseFromString(a, "image/svg+xml").getElementsByTagName("symbol"), o = document.querySelectorAll("symbol");
|
|
189
|
-
for (const
|
|
190
|
-
const
|
|
191
|
-
u && t && (u.innerHTML =
|
|
190
|
+
for (const i of n) {
|
|
191
|
+
const l = i.id, u = Array.from(o).find((c) => c.id === l);
|
|
192
|
+
u && t && (u.innerHTML = i.innerHTML, u.querySelectorAll("*").forEach((c) => {
|
|
192
193
|
c.hasAttribute("fill") && c.removeAttribute("fill");
|
|
193
|
-
})), C.value[
|
|
194
|
+
})), C.value[l] || (C.value[l] = D("svg", { fill: "currentColor" }, [D("use", { "xlink:href": `#${l}` })]));
|
|
194
195
|
}
|
|
195
|
-
},
|
|
196
|
+
}, Ma = (e, t) => {
|
|
196
197
|
let a = "";
|
|
197
198
|
return e && (a += `rotate(${e}deg)`), t && (a += " scaleX(-1)"), a;
|
|
198
|
-
},
|
|
199
|
+
}, $a = "settingInfoStore", wt = Y("settingInfo", {
|
|
199
200
|
state: () => ({
|
|
200
201
|
fullscreen: !1,
|
|
201
202
|
menuCollapse: !1,
|
|
@@ -237,11 +238,11 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
237
238
|
}
|
|
238
239
|
},
|
|
239
240
|
persist: {
|
|
240
|
-
key:
|
|
241
|
+
key: $a,
|
|
241
242
|
storage: localStorage,
|
|
242
243
|
pick: ["fullscreen", "menuCollapse", "tableColumns"]
|
|
243
244
|
}
|
|
244
|
-
}),
|
|
245
|
+
}), Ot = /* @__PURE__ */ W({
|
|
245
246
|
inheritAttrs: !1,
|
|
246
247
|
__name: "index",
|
|
247
248
|
props: {
|
|
@@ -299,7 +300,7 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
299
300
|
a.autoClean && a.formData && a.outFields && g !== a.value && na(a.formData, a.outFields, null);
|
|
300
301
|
}
|
|
301
302
|
);
|
|
302
|
-
const o = ue(), { editorCtrl:
|
|
303
|
+
const o = ue(), { editorCtrl: i, errInfo: l, labelText: u } = o, c = t;
|
|
303
304
|
o.inputEmit = c;
|
|
304
305
|
const p = f([]), h = (g) => {
|
|
305
306
|
var M;
|
|
@@ -317,7 +318,7 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
317
318
|
const d = pe(a, g, p, o);
|
|
318
319
|
c("update:value", g), c("select", g);
|
|
319
320
|
const I = de(d);
|
|
320
|
-
c("update:labels", I),
|
|
321
|
+
c("update:labels", I), l != null && l.value.errClass && i && le(i);
|
|
321
322
|
};
|
|
322
323
|
return te(() => {
|
|
323
324
|
r.value && !r.value.fieldMap && (r.value.fieldMap = {
|
|
@@ -334,7 +335,7 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
334
335
|
q(x(pa), re({
|
|
335
336
|
value: n.value,
|
|
336
337
|
"onUpdate:value": d[0] || (d[0] = (M) => n.value = M),
|
|
337
|
-
class: [(I = x(
|
|
338
|
+
class: [(I = x(l)) == null ? void 0 : I.errClass, "error w-full"],
|
|
338
339
|
options: p.value,
|
|
339
340
|
onSearch: h,
|
|
340
341
|
onSelect: v,
|
|
@@ -343,10 +344,10 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
343
344
|
]);
|
|
344
345
|
};
|
|
345
346
|
}
|
|
346
|
-
}),
|
|
347
|
+
}), Da = { class: "min-h-[32px] pt-[5px]" }, Fa = {
|
|
347
348
|
key: 1,
|
|
348
349
|
class: "text-center text-gray-500"
|
|
349
|
-
},
|
|
350
|
+
}, Pt = /* @__PURE__ */ W({
|
|
350
351
|
inheritAttrs: !1,
|
|
351
352
|
__name: "index",
|
|
352
353
|
props: {
|
|
@@ -374,11 +375,11 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
374
375
|
fieldMap: a.fieldMap || ((p = a.url) == null ? void 0 : p.fieldMap),
|
|
375
376
|
params: a.params || ((h = a.url) == null ? void 0 : h.params),
|
|
376
377
|
loadingText: !1
|
|
377
|
-
}), n = ue(), { errInfo: o } = n,
|
|
378
|
-
n.inputEmit =
|
|
379
|
-
const
|
|
380
|
-
const m = pe(a, v,
|
|
381
|
-
|
|
378
|
+
}), n = ue(), { errInfo: o } = n, i = t;
|
|
379
|
+
n.inputEmit = i;
|
|
380
|
+
const l = f([]), u = (v) => {
|
|
381
|
+
const m = pe(a, v, l, n), b = de(m);
|
|
382
|
+
i("update:labels", b);
|
|
382
383
|
};
|
|
383
384
|
return te(() => {
|
|
384
385
|
r.value && !r.value.fieldMap && (r.value.fieldMap = {
|
|
@@ -386,16 +387,16 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
386
387
|
label: "Name",
|
|
387
388
|
value: "Id",
|
|
388
389
|
key: "Id"
|
|
389
|
-
}), ce(a.autoload, a,
|
|
390
|
+
}), ce(a.autoload, a, l, n, r.value, r.value.params);
|
|
390
391
|
}), se(() => {
|
|
391
392
|
fe(a, n);
|
|
392
|
-
}), (v, w) => (E(), O("div",
|
|
393
|
+
}), (v, w) => (E(), O("div", Da, [
|
|
393
394
|
q(x(da), re({
|
|
394
395
|
onChange: u,
|
|
395
396
|
class: "w-full mb-[-3px]"
|
|
396
397
|
}, x(s)), {
|
|
397
398
|
default: H(() => [
|
|
398
|
-
|
|
399
|
+
l.value.length > 0 ? (E(!0), O(B, { key: 0 }, Ee(l.value, (m) => {
|
|
399
400
|
var b;
|
|
400
401
|
return E(), Ae(x(ha), {
|
|
401
402
|
key: m.value,
|
|
@@ -413,16 +414,16 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
413
414
|
]),
|
|
414
415
|
_: 2
|
|
415
416
|
}, 1032, ["value", "disabled", "class"]);
|
|
416
|
-
}), 128)) : e.nodata ? (E(), O("div",
|
|
417
|
+
}), 128)) : e.nodata ? (E(), O("div", Fa, J(e.nodata), 1)) : j("", !0)
|
|
417
418
|
]),
|
|
418
419
|
_: 1
|
|
419
420
|
}, 16)
|
|
420
421
|
]));
|
|
421
422
|
}
|
|
422
|
-
}),
|
|
423
|
+
}), Na = { class: "min-h-[32px] pt-1" }, Ca = {
|
|
423
424
|
key: 1,
|
|
424
425
|
class: "text-center text-gray-500"
|
|
425
|
-
},
|
|
426
|
+
}, kt = /* @__PURE__ */ W({
|
|
426
427
|
inheritAttrs: !1,
|
|
427
428
|
__name: "index",
|
|
428
429
|
props: {
|
|
@@ -451,7 +452,7 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
451
452
|
fieldMap: a.fieldMap || ((v = a.url) == null ? void 0 : v.fieldMap),
|
|
452
453
|
params: a.params || ((w = a.url) == null ? void 0 : w.params),
|
|
453
454
|
loadingText: !1
|
|
454
|
-
}), n = f(a.value), o = ue(), { errInfo:
|
|
455
|
+
}), n = f(a.value), o = ue(), { errInfo: i } = o, l = f([]), u = t;
|
|
455
456
|
o.inputEmit = u, T(
|
|
456
457
|
() => n.value,
|
|
457
458
|
(m) => {
|
|
@@ -465,7 +466,7 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
465
466
|
}
|
|
466
467
|
return m === b;
|
|
467
468
|
}, p = (m) => {
|
|
468
|
-
const b = m.target.value, g = pe(a, b,
|
|
469
|
+
const b = m.target.value, g = pe(a, b, l, o), d = de(g);
|
|
469
470
|
u("update:labels", d);
|
|
470
471
|
};
|
|
471
472
|
return te(() => {
|
|
@@ -474,10 +475,10 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
474
475
|
label: "Name",
|
|
475
476
|
value: "Id",
|
|
476
477
|
key: "Id"
|
|
477
|
-
}), ce(a.autoload, a,
|
|
478
|
+
}), ce(a.autoload, a, l, o, r.value, (m = r.value) == null ? void 0 : m.params);
|
|
478
479
|
}), se(() => {
|
|
479
480
|
fe(a, o);
|
|
480
|
-
}), (m, b) => (E(), O("div",
|
|
481
|
+
}), (m, b) => (E(), O("div", Na, [
|
|
481
482
|
q(x(ma), re({
|
|
482
483
|
value: n.value,
|
|
483
484
|
"onUpdate:value": b[0] || (b[0] = (g) => n.value = g),
|
|
@@ -486,7 +487,7 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
486
487
|
class: "w-full flex align-items flex-wrap mb-[-3px]"
|
|
487
488
|
}, x(s)), {
|
|
488
489
|
default: H(() => [
|
|
489
|
-
|
|
490
|
+
l.value.length > 0 ? (E(!0), O(B, { key: 0 }, Ee(l.value, (g) => {
|
|
490
491
|
var d;
|
|
491
492
|
return E(), O(B, {
|
|
492
493
|
key: g.value
|
|
@@ -496,7 +497,7 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
496
497
|
checked: c(g.value, a.value),
|
|
497
498
|
value: g.value,
|
|
498
499
|
class: Ge([
|
|
499
|
-
((d = x(
|
|
500
|
+
((d = x(i)) == null ? void 0 : d.errClass) === "error" ? "error !text-red-400" : "",
|
|
500
501
|
"text-nowrap",
|
|
501
502
|
"pb-1",
|
|
502
503
|
e.wrap ? `w-1/${a.wrap}` : ""
|
|
@@ -508,16 +509,16 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
508
509
|
_: 2
|
|
509
510
|
}, 1032, ["checked", "value", "class"])) : j("", !0)
|
|
510
511
|
], 64);
|
|
511
|
-
}), 128)) : e.nodata ? (E(), O("div",
|
|
512
|
+
}), 128)) : e.nodata ? (E(), O("div", Ca, J(e.nodata), 1)) : j("", !0)
|
|
512
513
|
]),
|
|
513
514
|
_: 1
|
|
514
515
|
}, 16, ["value"])
|
|
515
516
|
]));
|
|
516
517
|
}
|
|
517
|
-
}),
|
|
518
|
+
}), Ua = {
|
|
518
519
|
key: 0,
|
|
519
520
|
class: "absolute z-10 mt-[5px] mr-[10px] text-[#999] flex items-center"
|
|
520
|
-
},
|
|
521
|
+
}, Lt = /* @__PURE__ */ W({
|
|
521
522
|
inheritAttrs: !1,
|
|
522
523
|
__name: "index",
|
|
523
524
|
props: {
|
|
@@ -566,7 +567,7 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
566
567
|
fieldMap: a.fieldMap || ((b = a.url) == null ? void 0 : b.fieldMap),
|
|
567
568
|
params: a.params || ((g = a.url) == null ? void 0 : g.params),
|
|
568
569
|
loadingText: !1
|
|
569
|
-
}), n = ue(), { editorCtrl: o, errInfo:
|
|
570
|
+
}), n = ue(), { editorCtrl: o, errInfo: i, labelText: l } = n, u = f(void 0), c = t;
|
|
570
571
|
n.inputEmit = c;
|
|
571
572
|
const p = f([]);
|
|
572
573
|
T(
|
|
@@ -579,7 +580,7 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
579
580
|
T(
|
|
580
581
|
() => r.value.loading,
|
|
581
582
|
(d) => {
|
|
582
|
-
d ? h.value = "" : h.value || (h.value = "请选择" +
|
|
583
|
+
d ? h.value = "" : h.value || (h.value = "请选择" + l.value);
|
|
583
584
|
},
|
|
584
585
|
{ immediate: !0 }
|
|
585
586
|
);
|
|
@@ -596,7 +597,7 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
596
597
|
);
|
|
597
598
|
const w = (d) => {
|
|
598
599
|
const I = pe(a, d, p, n), M = de(I);
|
|
599
|
-
u.value = d, c("update:labels", M), c("change", d),
|
|
600
|
+
u.value = d, c("update:labels", M), c("change", d), i != null && i.value.errClass && o && le(o);
|
|
600
601
|
};
|
|
601
602
|
return te(() => {
|
|
602
603
|
var d;
|
|
@@ -613,12 +614,12 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
613
614
|
}), (d, I) => {
|
|
614
615
|
var M;
|
|
615
616
|
return E(), O("div", null, [
|
|
616
|
-
a.url && a.url.loading === !0 ? (E(), O("div",
|
|
617
|
+
a.url && a.url.loading === !0 ? (E(), O("div", Ua, [
|
|
617
618
|
q(x(Se), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
|
|
618
619
|
I[1] || (I[1] = ua("span", null, "数据加载中...", -1))
|
|
619
620
|
])) : j("", !0),
|
|
620
621
|
q(x(ga), re({
|
|
621
|
-
class: [(M = x(
|
|
622
|
+
class: [(M = x(i)) == null ? void 0 : M.errClass, "w-full"],
|
|
622
623
|
value: u.value,
|
|
623
624
|
"onUpdate:value": I[0] || (I[0] = (K) => u.value = K),
|
|
624
625
|
"allow-clear": !0,
|
|
@@ -650,7 +651,7 @@ const Aa = 7 * 24 * 60 * 60 * 1e3, ge = /* @__PURE__ */ new Map(), Ue = /* @__PU
|
|
|
650
651
|
var $ = /* @__PURE__ */ ((e) => (e.PageControl = "Page.PageControl", e.EditorControl = "Page.EditorControl", e.GridControl = "Page.GridControl", e.LabelText = "FormItem.LabelText", e.RuleKey = "FormItem.RuleKey", e.ErrInfo = "FormItem.ErrInfo", e))($ || {});
|
|
651
652
|
const R = class R {
|
|
652
653
|
};
|
|
653
|
-
|
|
654
|
+
P(R, "dict", {}), P(R, "Keys", {
|
|
654
655
|
EnableDisable: "EnableDisable",
|
|
655
656
|
SuccessResult: "SuccessResult",
|
|
656
657
|
YesNo: "YesNo",
|
|
@@ -660,25 +661,25 @@ k(R, "dict", {}), k(R, "Keys", {
|
|
|
660
661
|
* @param key 名称
|
|
661
662
|
* @returns
|
|
662
663
|
*/
|
|
663
|
-
|
|
664
|
+
P(R, "getOptions", (t) => R.dict[t]), /**
|
|
664
665
|
* 静态选择项对象
|
|
665
666
|
* @param key 名称
|
|
666
667
|
* @param value 值
|
|
667
668
|
* @returns
|
|
668
669
|
*/
|
|
669
|
-
|
|
670
|
+
P(R, "getOptionItem", (t, a) => R.dict[t].find((s) => s.value === a)), /**
|
|
670
671
|
* 设置静态选择项
|
|
671
672
|
* @param key 名称
|
|
672
673
|
* @param list 列表
|
|
673
674
|
*/
|
|
674
|
-
|
|
675
|
+
P(R, "setOptions", (t, a) => {
|
|
675
676
|
R.dict[t] = a;
|
|
676
677
|
}), /**
|
|
677
678
|
* 启用/停用选项
|
|
678
679
|
* - 启用 1
|
|
679
680
|
* - 停用 0
|
|
680
681
|
*/
|
|
681
|
-
|
|
682
|
+
P(R, "EnableDisable", [
|
|
682
683
|
{
|
|
683
684
|
label: "启用",
|
|
684
685
|
text: "✅ 启用",
|
|
@@ -694,7 +695,7 @@ k(R, "EnableDisable", [
|
|
|
694
695
|
* - 成功 1
|
|
695
696
|
* - 失败 0
|
|
696
697
|
*/
|
|
697
|
-
|
|
698
|
+
P(R, "SuccessResult", [
|
|
698
699
|
{
|
|
699
700
|
label: "成功",
|
|
700
701
|
text: "✅ 成功",
|
|
@@ -710,7 +711,7 @@ k(R, "SuccessResult", [
|
|
|
710
711
|
* - 是 1
|
|
711
712
|
* - 否 0
|
|
712
713
|
*/
|
|
713
|
-
|
|
714
|
+
P(R, "YesNo", [
|
|
714
715
|
{
|
|
715
716
|
label: "是",
|
|
716
717
|
text: "✅ 是",
|
|
@@ -726,7 +727,7 @@ k(R, "YesNo", [
|
|
|
726
727
|
* - 男 M
|
|
727
728
|
* - 女 F
|
|
728
729
|
*/
|
|
729
|
-
|
|
730
|
+
P(R, "MaleFemale", [
|
|
730
731
|
{
|
|
731
732
|
label: "男",
|
|
732
733
|
text: "男 👨",
|
|
@@ -844,7 +845,7 @@ const ne = {
|
|
|
844
845
|
...t.url,
|
|
845
846
|
loadingText: t.loadingText
|
|
846
847
|
};
|
|
847
|
-
},
|
|
848
|
+
}, ie = (e, t) => {
|
|
848
849
|
const a = e.page, s = t.url;
|
|
849
850
|
if (!s || !s.url) {
|
|
850
851
|
const n = `URL未设置: ${t.urlKey}`;
|
|
@@ -856,8 +857,8 @@ const ne = {
|
|
|
856
857
|
}, Oe = (e, t) => {
|
|
857
858
|
t.params || (t.params = {}), t.params.Query || (t.params.Query = {});
|
|
858
859
|
const a = oe(e, t);
|
|
859
|
-
return t.url = a,
|
|
860
|
-
},
|
|
860
|
+
return t.url = a, ie(e, t);
|
|
861
|
+
}, Mt = (e, t) => (t.params || (t.params = {}), t.params.Query || (t.params.Query = {}), t.loadingText = t.loadingText === !1 ? !1 : t.loadingText || "开始执行...", t.url = oe(e, t), ie(e, t).then((a) => ((a == null ? void 0 : a.status) === A.SUCCESS && (t.hideErrorToast || S.success("执行成功!")), a))), Je = (e, t = {}) => {
|
|
861
862
|
const a = t.primaryKey || "Id";
|
|
862
863
|
if (t.params || (t.params = {}), t.params.Query || (t.params.Query = {}), !t.params.Data)
|
|
863
864
|
return S.error("错误!无保存数据!"), Promise.resolve(null);
|
|
@@ -868,8 +869,8 @@ const ne = {
|
|
|
868
869
|
};
|
|
869
870
|
s.params.Query[a] = s.params.Data[a];
|
|
870
871
|
const r = oe(e, s);
|
|
871
|
-
return s.url = r,
|
|
872
|
-
},
|
|
872
|
+
return s.url = r, ie(e, s).then((n) => ((n == null ? void 0 : n.status) === A.SUCCESS && (t.hideErrorToast || S.success("保存成功!")), n));
|
|
873
|
+
}, _a = (e, t, a = {}) => {
|
|
873
874
|
const s = a.primaryKey || "Id";
|
|
874
875
|
a.params || (a.params = {}), a.params.Query || (a.params.Query = {});
|
|
875
876
|
const r = {
|
|
@@ -880,8 +881,8 @@ const ne = {
|
|
|
880
881
|
if (Array.isArray(t) ? r.params.Query[s] = t : r.params.Query[s] = t[s], F(r.params.Query) || F(r.params.Query[s]))
|
|
881
882
|
return S.error("错误!禁止无条件删除数据!"), Promise.resolve(null);
|
|
882
883
|
const n = oe(e, r);
|
|
883
|
-
return r.url = n,
|
|
884
|
-
},
|
|
884
|
+
return r.url = n, ie(e, r).then((o) => ((o == null ? void 0 : o.status) === A.SUCCESS && (a.hideErrorToast || S.success("删除成功!")), o));
|
|
885
|
+
}, Ka = (e, t) => Oe(e, {
|
|
885
886
|
urlKey: "tree",
|
|
886
887
|
params: {},
|
|
887
888
|
loadingState: e.isTreeLoading,
|
|
@@ -889,7 +890,7 @@ const ne = {
|
|
|
889
890
|
processParams: () => Te(e.treeQuery, t)
|
|
890
891
|
}).then((a) => (a == null ? void 0 : a.status) === A.SUCCESS ? (e.data.value = a.data, e.data.value) : []);
|
|
891
892
|
let z;
|
|
892
|
-
const
|
|
893
|
+
const $t = (e) => {
|
|
893
894
|
z = new we({}), z.messages({
|
|
894
895
|
required: "${label}不能为空",
|
|
895
896
|
types: {
|
|
@@ -916,66 +917,66 @@ const kt = (e) => {
|
|
|
916
917
|
},
|
|
917
918
|
...e
|
|
918
919
|
});
|
|
919
|
-
},
|
|
920
|
+
}, Dt = (e) => {
|
|
920
921
|
if (!e || F(e))
|
|
921
922
|
return [];
|
|
922
|
-
const t = [], a = z.messages(), s = (n, o,
|
|
923
|
-
const
|
|
924
|
-
if (
|
|
925
|
-
const c = a.types[
|
|
926
|
-
r(c, n, { type:
|
|
923
|
+
const t = [], a = z.messages(), s = (n, o, i) => {
|
|
924
|
+
const l = o.type;
|
|
925
|
+
if (l && a.types && l in a.types) {
|
|
926
|
+
const c = a.types[l];
|
|
927
|
+
r(c, n, { type: l }, i);
|
|
927
928
|
}
|
|
928
929
|
const u = ["string", "number", "array"];
|
|
929
930
|
for (const c of u)
|
|
930
|
-
if (
|
|
931
|
+
if (l === c && a[c]) {
|
|
931
932
|
const p = a[c], h = ["len", "min", "max", "range"];
|
|
932
933
|
for (const v of h)
|
|
933
|
-
v === "range" && o.min != null && o.max != null && p.range ? r(p.range, n, { min: o.min, max: o.max },
|
|
934
|
+
v === "range" && o.min != null && o.max != null && p.range ? r(p.range, n, { min: o.min, max: o.max }, i) : v !== "range" && o[v] != null && p[v] && r(p[v], n, { [v]: o[v] }, i);
|
|
934
935
|
}
|
|
935
|
-
if (o.required && a.required && r(a.required, n, {},
|
|
936
|
+
if (o.required && a.required && r(a.required, n, {}, i), o.pattern && a.pattern && r(o.message, n, {}, i), o.enum && Array.isArray(o.enum) && a.enum) {
|
|
936
937
|
const c = o.enum.join(", ");
|
|
937
|
-
r(a.enum, n, { enum: c },
|
|
938
|
+
r(a.enum, n, { enum: c }, i);
|
|
938
939
|
}
|
|
939
|
-
}, r = (n, o,
|
|
940
|
+
}, r = (n, o, i, l) => {
|
|
940
941
|
if (n)
|
|
941
942
|
try {
|
|
942
943
|
let u;
|
|
943
944
|
if (typeof n == "function") {
|
|
944
945
|
const c = [o];
|
|
945
|
-
for (const p in
|
|
946
|
-
c.push(
|
|
947
|
-
u = n.apply(null, c), u &&
|
|
946
|
+
for (const p in i)
|
|
947
|
+
c.push(i[p]);
|
|
948
|
+
u = n.apply(null, c), u && l.push(u);
|
|
948
949
|
} else {
|
|
949
950
|
u = String(n);
|
|
950
|
-
for (const c in
|
|
951
|
-
u = u.replace(new RegExp(`\\$\\{${c}\\}`, "g"),
|
|
952
|
-
u = u.replace(/\$\{label\}/g, ""), u &&
|
|
951
|
+
for (const c in i)
|
|
952
|
+
u = u.replace(new RegExp(`\\$\\{${c}\\}`, "g"), i[c]);
|
|
953
|
+
u = u.replace(/\$\{label\}/g, ""), u && l.push(u);
|
|
953
954
|
}
|
|
954
955
|
} catch (u) {
|
|
955
956
|
console.error("格式化验证消息出错:", u);
|
|
956
957
|
}
|
|
957
958
|
};
|
|
958
959
|
return Object.keys(e).forEach((n) => {
|
|
959
|
-
const o = e[n],
|
|
960
|
+
const o = e[n], i = [];
|
|
960
961
|
try {
|
|
961
|
-
s(n, o,
|
|
962
|
-
u && typeof u == "object" && s(n, u,
|
|
962
|
+
s(n, o, i), Array.isArray(o) && o.forEach((u) => {
|
|
963
|
+
u && typeof u == "object" && s(n, u, i);
|
|
963
964
|
}), o && typeof o == "object" && "fields" in o;
|
|
964
965
|
} catch (u) {
|
|
965
966
|
console.error("处理验证规则出错:", u);
|
|
966
967
|
}
|
|
967
|
-
const
|
|
968
|
-
n &&
|
|
968
|
+
const l = Array.from(new Set(i));
|
|
969
|
+
n && l.length > 0 && t.push({
|
|
969
970
|
field: n,
|
|
970
|
-
rules:
|
|
971
|
+
rules: l
|
|
971
972
|
});
|
|
972
973
|
}), t;
|
|
973
|
-
},
|
|
974
|
+
}, le = async (e) => {
|
|
974
975
|
const t = e.formData.value, a = e.formRules.value;
|
|
975
|
-
F(a) || (
|
|
976
|
+
F(a) || (Pe(e), e.ruleValidator || (e.ruleValidator = new we({}), e.ruleValidator.messages(z.messages()), e.ruleValidator.define(a)), e.ruleResults.value = await e.ruleValidator.validate(t).then(() => {
|
|
976
977
|
}).catch(({ fields: s }) => s));
|
|
977
|
-
},
|
|
978
|
-
}).catch(({ fields: s }) => s)),
|
|
978
|
+
}, Ft = async (e, t, a) => (a || (a = new we({}), a.messages(z.messages()), a.define(t)), a.validate(e).then(() => {
|
|
979
|
+
}).catch(({ fields: s }) => s)), Pe = (e) => {
|
|
979
980
|
e.ruleResults.value = void 0;
|
|
980
981
|
}, ue = () => {
|
|
981
982
|
const e = G($.EditorControl, void 0), t = f(G($.LabelText, "")), a = f(G($.RuleKey, "")), s = G($.ErrInfo, void 0);
|
|
@@ -985,7 +986,7 @@ const kt = (e) => {
|
|
|
985
986
|
ruleKey: a,
|
|
986
987
|
errInfo: s
|
|
987
988
|
};
|
|
988
|
-
},
|
|
989
|
+
}, Ha = (e, t) => {
|
|
989
990
|
let a = f({
|
|
990
991
|
msg: "",
|
|
991
992
|
errClass: ""
|
|
@@ -997,7 +998,7 @@ const kt = (e) => {
|
|
|
997
998
|
() => s == null ? void 0 : s.value,
|
|
998
999
|
(r) => {
|
|
999
1000
|
if (a.value.errClass = "", a.value.msg = "", !F(r)) {
|
|
1000
|
-
const n =
|
|
1001
|
+
const n = Qa(
|
|
1001
1002
|
{
|
|
1002
1003
|
label: e.label,
|
|
1003
1004
|
rule: e.rule
|
|
@@ -1010,50 +1011,50 @@ const kt = (e) => {
|
|
|
1010
1011
|
},
|
|
1011
1012
|
{ deep: !0 }
|
|
1012
1013
|
), a;
|
|
1013
|
-
},
|
|
1014
|
+
}, Qa = (e, t, a) => {
|
|
1014
1015
|
const s = f([]), r = f(""), n = f("");
|
|
1015
1016
|
if (!e.rule || !t || !a)
|
|
1016
1017
|
return { msg: r, ruleErrors: s, errClass: n };
|
|
1017
|
-
e.rule.split("|").forEach((
|
|
1018
|
-
if (
|
|
1019
|
-
if (a[
|
|
1020
|
-
s.value.push(...a[
|
|
1018
|
+
e.rule.split("|").forEach((l) => {
|
|
1019
|
+
if (l = l.trim(), l)
|
|
1020
|
+
if (a[l])
|
|
1021
|
+
s.value.push(...a[l]);
|
|
1021
1022
|
else {
|
|
1022
1023
|
const u = [];
|
|
1023
1024
|
for (let c in a)
|
|
1024
|
-
c !==
|
|
1025
|
+
c !== l && c.startsWith(l + ".") && u.push(...a[c]);
|
|
1025
1026
|
u.length > 0 && s.value.push(...u);
|
|
1026
1027
|
}
|
|
1027
1028
|
});
|
|
1028
|
-
const
|
|
1029
|
-
return s.value.forEach((
|
|
1030
|
-
r.value && (r.value += " / "), r.value +=
|
|
1031
|
-
const u = t[
|
|
1029
|
+
const i = /\${\w+}/g;
|
|
1030
|
+
return s.value.forEach((l) => {
|
|
1031
|
+
r.value && (r.value += " / "), r.value += l.message.replace("${label}", e.label ?? "");
|
|
1032
|
+
const u = t[l.field];
|
|
1032
1033
|
if (u) {
|
|
1033
|
-
const c = r.value.match(
|
|
1034
|
+
const c = r.value.match(i);
|
|
1034
1035
|
c && c.forEach((p) => {
|
|
1035
1036
|
const h = p.replace("${", "").replace("}", "");
|
|
1036
1037
|
r.value = r.value.replace(p, u[h] ?? "");
|
|
1037
1038
|
});
|
|
1038
1039
|
}
|
|
1039
1040
|
}), s.value.length > 0 && (n.value = "error"), { msg: r, ruleErrors: s, errClass: n };
|
|
1040
|
-
},
|
|
1041
|
+
}, Nt = (e, t) => {
|
|
1041
1042
|
he($.LabelText, e.label || ""), he($.RuleKey, e.rule || "");
|
|
1042
|
-
const a =
|
|
1043
|
+
const a = Ha(e, t);
|
|
1043
1044
|
return he($.ErrInfo, a), a;
|
|
1044
|
-
},
|
|
1045
|
+
}, Ct = (e) => {
|
|
1045
1046
|
ze(e);
|
|
1046
|
-
},
|
|
1047
|
+
}, Ut = (e) => {
|
|
1047
1048
|
const t = e.page, a = e.formData.value;
|
|
1048
1049
|
a[e.primaryKey ?? t.primaryKey] = null, ze(e);
|
|
1049
|
-
},
|
|
1050
|
+
}, _t = (e) => {
|
|
1050
1051
|
e.visible.value = !1;
|
|
1051
1052
|
}, ze = async (e) => {
|
|
1052
1053
|
var s;
|
|
1053
1054
|
const t = e.page;
|
|
1054
|
-
if (e.isFormSaving.value = !0,
|
|
1055
|
+
if (e.isFormSaving.value = !0, Pe(e), e.beforeSave && e.beforeSave() === !1)
|
|
1055
1056
|
return e.isFormSaving.value = !1, Promise.resolve();
|
|
1056
|
-
if (e.formRules.value && await
|
|
1057
|
+
if (e.formRules.value && await le(e), e.ruleResults.value)
|
|
1057
1058
|
return S.error("提交表单时,验证失败!"), console.error("表单验证失败!", e.ruleResults.value), e.isFormSaving.value = !1, Promise.resolve();
|
|
1058
1059
|
const a = e.formData.value;
|
|
1059
1060
|
return Je(
|
|
@@ -1078,34 +1079,34 @@ const kt = (e) => {
|
|
|
1078
1079
|
if ((r == null ? void 0 : r.status) === A.SUCCESS)
|
|
1079
1080
|
S.success("保存成功!"), e.grid && (e.grid.reload.value = !0), e.afterSave && e.afterSave(), e.autoClose !== !1 && (e.visible.value = !1);
|
|
1080
1081
|
else if (r != null && r.msg && ((n = r == null ? void 0 : r.msg) == null ? void 0 : n.indexOf("Duplicate entry")) > -1) {
|
|
1081
|
-
const
|
|
1082
|
-
if (
|
|
1083
|
-
const
|
|
1082
|
+
const i = (o = r == null ? void 0 : r.msg) == null ? void 0 : o.match(/Duplicate entry '([^']+)' for key '([^']+)'/);
|
|
1083
|
+
if (i && i.length > 2 && i[1] && i[2]) {
|
|
1084
|
+
const l = i[1], u = i[2].replace(/Idx_/g, "").split("_"), c = e.formRules.value;
|
|
1084
1085
|
if (c && u.length > 0) {
|
|
1085
1086
|
const p = {};
|
|
1086
1087
|
u.forEach((h) => {
|
|
1087
1088
|
c[h] && (p[h] = [
|
|
1088
1089
|
{
|
|
1089
1090
|
field: h,
|
|
1090
|
-
fieldValue:
|
|
1091
|
+
fieldValue: l,
|
|
1091
1092
|
message: "数据重复"
|
|
1092
1093
|
}
|
|
1093
1094
|
]);
|
|
1094
1095
|
}), Object.keys(p).length > 0 && (console.error("保存失败!", p), e.ruleResults.value = p);
|
|
1095
1096
|
}
|
|
1096
|
-
S.error(`保存失败!数据 \`${
|
|
1097
|
+
S.error(`保存失败!数据 \`${l}\` 已存在!`);
|
|
1097
1098
|
} else S.error((r == null ? void 0 : r.msg) ?? "保存失败!");
|
|
1098
1099
|
} else
|
|
1099
1100
|
S.error((r == null ? void 0 : r.msg) ?? "保存失败!");
|
|
1100
1101
|
});
|
|
1101
|
-
},
|
|
1102
|
+
}, Kt = async (e) => {
|
|
1102
1103
|
const t = e.page, a = e.grid;
|
|
1103
1104
|
e.isFormLoading.value = !0;
|
|
1104
1105
|
const s = e.formData.value, r = e.primaryKey ?? t.primaryKey;
|
|
1105
1106
|
return ta(a, { [r]: s[r] }, e.detailUrl).then((n) => {
|
|
1106
1107
|
e.isFormLoading.value = !1, n && We(e, n);
|
|
1107
1108
|
});
|
|
1108
|
-
},
|
|
1109
|
+
}, Ht = (e) => {
|
|
1109
1110
|
const t = e.grid;
|
|
1110
1111
|
t && (t.rowData.value = void 0), e && (Ye(e), e.visible && (e.visible.value = !1), setTimeout(() => {
|
|
1111
1112
|
e.visible.value = !0;
|
|
@@ -1113,8 +1114,8 @@ const kt = (e) => {
|
|
|
1113
1114
|
}, We = (e, t) => {
|
|
1114
1115
|
Ye(e), e.formData.value = { ...e.formData.value, ...t };
|
|
1115
1116
|
}, Ye = (e) => {
|
|
1116
|
-
e.formData.value = e.default ? JSON.parse(JSON.stringify(e.default)) : {},
|
|
1117
|
-
}, Ie = "/login/", Z = [],
|
|
1117
|
+
e.formData.value = e.default ? JSON.parse(JSON.stringify(e.default)) : {}, Pe(e);
|
|
1118
|
+
}, Ie = "/login/", Z = [], Ga = (e) => {
|
|
1118
1119
|
for (const t of e) {
|
|
1119
1120
|
const a = Z.findIndex((s) => s.path === t.path);
|
|
1120
1121
|
a !== -1 && Z.splice(a, 1), Z.push(t), U.addRoute(t);
|
|
@@ -1122,10 +1123,10 @@ const kt = (e) => {
|
|
|
1122
1123
|
}, Xe = (e, t, a, s = "") => {
|
|
1123
1124
|
const r = s + (s ? "/" : "") + e.path;
|
|
1124
1125
|
t[r] = { ...e, parent: a }, e.children && e.children.forEach((n) => Xe(n, t, e, r));
|
|
1125
|
-
}, U =
|
|
1126
|
-
history:
|
|
1126
|
+
}, U = Aa({
|
|
1127
|
+
history: Ra("/"),
|
|
1127
1128
|
routes: Z
|
|
1128
|
-
}),
|
|
1129
|
+
}), Va = (e, t) => {
|
|
1129
1130
|
var r, n;
|
|
1130
1131
|
const a = ((r = e.meta) == null ? void 0 : r.roles) ?? [], s = (n = e.meta) == null ? void 0 : n.permission;
|
|
1131
1132
|
if (!t)
|
|
@@ -1137,21 +1138,21 @@ const kt = (e) => {
|
|
|
1137
1138
|
if (De.VITE_PERMISSION_MODE === "permit") {
|
|
1138
1139
|
if (a.length === 0 && !s)
|
|
1139
1140
|
return !0;
|
|
1140
|
-
let
|
|
1141
|
-
return a.length > 0 && (
|
|
1141
|
+
let i = !1, l = !1;
|
|
1142
|
+
return a.length > 0 && (i = o.hasRole(a)), s && (l = o.hasPermit(e.path, ":page")), i || l;
|
|
1142
1143
|
}
|
|
1143
1144
|
}
|
|
1144
1145
|
return !1;
|
|
1145
1146
|
}, V = f(null);
|
|
1146
1147
|
U.beforeEach((e, t, a) => {
|
|
1147
|
-
var
|
|
1148
|
+
var i;
|
|
1148
1149
|
const s = e;
|
|
1149
1150
|
if (e.path.startsWith("/error/") || e.path.startsWith(Ie))
|
|
1150
1151
|
return a();
|
|
1151
|
-
const r = s.meta, o = ((r == null ? void 0 : r.roles) ?? []).length > 0 || ((
|
|
1152
|
+
const r = s.meta, o = ((r == null ? void 0 : r.roles) ?? []).length > 0 || ((i = r == null ? void 0 : r.permission) == null ? void 0 : i.length);
|
|
1152
1153
|
if (e.path === "/") {
|
|
1153
|
-
const
|
|
1154
|
-
if (!
|
|
1154
|
+
const l = N();
|
|
1155
|
+
if (!l.menuLoaded) {
|
|
1155
1156
|
V.value = {
|
|
1156
1157
|
to: e,
|
|
1157
1158
|
next: (u) => {
|
|
@@ -1160,14 +1161,14 @@ U.beforeEach((e, t, a) => {
|
|
|
1160
1161
|
};
|
|
1161
1162
|
return;
|
|
1162
1163
|
}
|
|
1163
|
-
|
|
1164
|
+
l.toDefaultApp();
|
|
1164
1165
|
return;
|
|
1165
1166
|
}
|
|
1166
1167
|
if (!o)
|
|
1167
1168
|
a();
|
|
1168
1169
|
else {
|
|
1169
|
-
const
|
|
1170
|
-
if (!
|
|
1170
|
+
const l = Q();
|
|
1171
|
+
if (!l.isLogin)
|
|
1171
1172
|
a({ path: Ie });
|
|
1172
1173
|
else {
|
|
1173
1174
|
if (!N().menuLoaded) {
|
|
@@ -1177,7 +1178,7 @@ U.beforeEach((e, t, a) => {
|
|
|
1177
1178
|
};
|
|
1178
1179
|
return;
|
|
1179
1180
|
}
|
|
1180
|
-
const c =
|
|
1181
|
+
const c = Va(s, l.isLogin);
|
|
1181
1182
|
a();
|
|
1182
1183
|
}
|
|
1183
1184
|
}
|
|
@@ -1188,19 +1189,19 @@ U.afterEach((e) => {
|
|
|
1188
1189
|
t && t(e.hash);
|
|
1189
1190
|
}
|
|
1190
1191
|
});
|
|
1191
|
-
const
|
|
1192
|
+
const qa = (e) => {
|
|
1192
1193
|
if (V.value) {
|
|
1193
1194
|
const { to: t, next: a } = V.value;
|
|
1194
1195
|
V.value = null, t.path === "/" ? a(e) : a(t.path);
|
|
1195
1196
|
}
|
|
1196
|
-
},
|
|
1197
|
-
const t =
|
|
1197
|
+
}, ja = (e) => {
|
|
1198
|
+
const t = ke();
|
|
1198
1199
|
if (t.TabEnabled) {
|
|
1199
|
-
if (
|
|
1200
|
+
if (Ba(e.key, t.TabPanes))
|
|
1200
1201
|
return;
|
|
1201
1202
|
t.TabPanes.push(e);
|
|
1202
1203
|
}
|
|
1203
|
-
},
|
|
1204
|
+
}, Ba = (e, t) => t.find((a) => a.key === e), ke = Y("pageInfo", {
|
|
1204
1205
|
state: () => ({
|
|
1205
1206
|
TabActive: "",
|
|
1206
1207
|
TabPanes: [],
|
|
@@ -1245,10 +1246,10 @@ const Ga = (e) => {
|
|
|
1245
1246
|
// 默认为true
|
|
1246
1247
|
keepAlive: !(a.meta && !a.meta.keepAlive)
|
|
1247
1248
|
};
|
|
1248
|
-
|
|
1249
|
+
ja(s), this.TabActive = e;
|
|
1249
1250
|
}
|
|
1250
1251
|
}
|
|
1251
|
-
}),
|
|
1252
|
+
}), Ja = "appInfoStore", za = {
|
|
1252
1253
|
appList: {
|
|
1253
1254
|
api: "PLATFORM_API",
|
|
1254
1255
|
authorize: !0,
|
|
@@ -1256,9 +1257,9 @@ const Ga = (e) => {
|
|
|
1256
1257
|
loadingText: !1
|
|
1257
1258
|
}
|
|
1258
1259
|
}, ye = /* @__PURE__ */ new Map(), xe = (e, t) => e.map((a) => {
|
|
1259
|
-
var o,
|
|
1260
|
+
var o, i, l, u, c, p, h, v;
|
|
1260
1261
|
const s = { ...a };
|
|
1261
|
-
if (!((
|
|
1262
|
+
if (!((i = (o = s.meta) == null ? void 0 : o.roles) != null && i.length) && !((u = (l = s.meta) == null ? void 0 : l.permission) != null && u.length))
|
|
1262
1263
|
return s.children && (s.children = xe(s.children, t)), s;
|
|
1263
1264
|
const r = (p = (c = s.meta) == null ? void 0 : c.roles) != null && p.length ? t.hasRole(s.meta.roles) : !1, n = (v = (h = s.meta) == null ? void 0 : h.permission) != null && v.length ? t.hasPermit(s.meta.permission, ":page") : !1;
|
|
1264
1265
|
return r || n ? (s.children && (s.children = xe(s.children, t)), s) : null;
|
|
@@ -1313,7 +1314,7 @@ const Ga = (e) => {
|
|
|
1313
1314
|
});
|
|
1314
1315
|
},
|
|
1315
1316
|
async getRemoteAppList() {
|
|
1316
|
-
return _(
|
|
1317
|
+
return _(za.appList, {
|
|
1317
1318
|
Query: {}
|
|
1318
1319
|
}).then((e) => {
|
|
1319
1320
|
(e == null ? void 0 : e.status) === A.SUCCESS && e.data && (this.appList.length = 0, this.appList.push(...e.data));
|
|
@@ -1372,7 +1373,7 @@ const Ga = (e) => {
|
|
|
1372
1373
|
const a = Q();
|
|
1373
1374
|
if (a.isLogin) {
|
|
1374
1375
|
const s = xe(this.appInfo.Routes, a);
|
|
1375
|
-
|
|
1376
|
+
Ga(s), this.appInfo.defaultPage = Ze(s) || "", this.appInfo.defaultPage && (this.menuLoaded = !0, qa(this.appInfo.defaultPage));
|
|
1376
1377
|
}
|
|
1377
1378
|
},
|
|
1378
1379
|
/**
|
|
@@ -1389,7 +1390,7 @@ const Ga = (e) => {
|
|
|
1389
1390
|
* @param path 路由地址
|
|
1390
1391
|
*/
|
|
1391
1392
|
push(e) {
|
|
1392
|
-
this.findRoute(e) &&
|
|
1393
|
+
this.findRoute(e) && ke().setTabActive(e), ca(() => {
|
|
1393
1394
|
Ce() ? (e = this.formatRoute(e), this.microRouter ? this.microRouter.push({ path: e }) : U.push({ path: e })) : U.push({ path: e });
|
|
1394
1395
|
});
|
|
1395
1396
|
},
|
|
@@ -1461,11 +1462,11 @@ const Ga = (e) => {
|
|
|
1461
1462
|
}
|
|
1462
1463
|
},
|
|
1463
1464
|
persist: {
|
|
1464
|
-
key:
|
|
1465
|
+
key: Ja,
|
|
1465
1466
|
storage: localStorage,
|
|
1466
1467
|
pick: ["appList"]
|
|
1467
1468
|
}
|
|
1468
|
-
}),
|
|
1469
|
+
}), Wa = "userInfoStore", ea = "Token解析失败", _e = "登录过期,请重新登录", Le = {
|
|
1469
1470
|
login: {
|
|
1470
1471
|
api: "PLATFORM_API",
|
|
1471
1472
|
url: "/openapi/LoginSrv/login",
|
|
@@ -1483,26 +1484,26 @@ const Ga = (e) => {
|
|
|
1483
1484
|
url: "/api/LoginSrv/logout",
|
|
1484
1485
|
loadingText: "正在退出..."
|
|
1485
1486
|
}
|
|
1486
|
-
},
|
|
1487
|
+
}, Ya = (e) => {
|
|
1487
1488
|
let t = {
|
|
1488
1489
|
Option: {},
|
|
1489
1490
|
Query: e
|
|
1490
1491
|
};
|
|
1491
1492
|
return _(Le.login, t).then((a) => (a == null ? void 0 : a.status) === A.SUCCESS ? a : null);
|
|
1492
|
-
},
|
|
1493
|
+
}, Xa = (e) => {
|
|
1493
1494
|
let t = {
|
|
1494
1495
|
Query: {
|
|
1495
1496
|
AppId: e
|
|
1496
1497
|
}
|
|
1497
1498
|
};
|
|
1498
1499
|
return _(Le.auth, t).then((a) => (a == null ? void 0 : a.status) === A.SUCCESS ? a.data : (S.error("获取授权信息失败," + (a == null ? void 0 : a.msg)), null));
|
|
1499
|
-
},
|
|
1500
|
+
}, Za = () => {
|
|
1500
1501
|
let e = {
|
|
1501
1502
|
Option: {},
|
|
1502
1503
|
Query: {}
|
|
1503
1504
|
};
|
|
1504
1505
|
return _(Le.logout, e).then((t) => (t == null ? void 0 : t.status) === A.SUCCESS ? t.data : null);
|
|
1505
|
-
},
|
|
1506
|
+
}, et = (e) => {
|
|
1506
1507
|
try {
|
|
1507
1508
|
const a = JSON.parse(atob(e.split(".")[1])).exp;
|
|
1508
1509
|
return Date.now() / 1e3 > a;
|
|
@@ -1512,17 +1513,17 @@ const Ga = (e) => {
|
|
|
1512
1513
|
}, Ke = (e, t) => e == "" ? (S.error(_e, {
|
|
1513
1514
|
duration: 3e3,
|
|
1514
1515
|
onClose: t
|
|
1515
|
-
}), !1) :
|
|
1516
|
+
}), !1) : et(e) ? (S.error(_e, {
|
|
1516
1517
|
duration: 3e3,
|
|
1517
1518
|
onClose: t
|
|
1518
|
-
}), !1) : !0,
|
|
1519
|
+
}), !1) : !0, at = (e) => {
|
|
1519
1520
|
try {
|
|
1520
1521
|
const t = JSON.parse(atob(e.token.split(".")[1]));
|
|
1521
1522
|
return t.user = JSON.parse(t.user), e.UserInfo = t.user, !0;
|
|
1522
1523
|
} catch (t) {
|
|
1523
1524
|
return console.error(ea, t), !1;
|
|
1524
1525
|
}
|
|
1525
|
-
},
|
|
1526
|
+
}, k = f(null), Q = Y("userInfo", {
|
|
1526
1527
|
state: () => ({
|
|
1527
1528
|
isLogin: !1,
|
|
1528
1529
|
userInfo: {
|
|
@@ -1548,14 +1549,14 @@ const Ga = (e) => {
|
|
|
1548
1549
|
* @returns
|
|
1549
1550
|
*/
|
|
1550
1551
|
async login(e, t) {
|
|
1551
|
-
const a = await
|
|
1552
|
+
const a = await Ya(e);
|
|
1552
1553
|
if (a) {
|
|
1553
1554
|
const s = a;
|
|
1554
1555
|
if (s.errno)
|
|
1555
1556
|
return s;
|
|
1556
1557
|
{
|
|
1557
1558
|
const r = a.data;
|
|
1558
|
-
if (this.token = r.token, me(this.token), this.isLogin = !0,
|
|
1559
|
+
if (this.token = r.token, me(this.token), this.isLogin = !0, at(r))
|
|
1559
1560
|
this.userInfo = {
|
|
1560
1561
|
...this.userInfo,
|
|
1561
1562
|
...r.UserInfo
|
|
@@ -1576,11 +1577,11 @@ const Ga = (e) => {
|
|
|
1576
1577
|
async getRolePermits(e) {
|
|
1577
1578
|
if (!this.isLogin || !this.token)
|
|
1578
1579
|
return !1;
|
|
1579
|
-
if (
|
|
1580
|
+
if (k.value && k.value.appId === e)
|
|
1580
1581
|
return !0;
|
|
1581
1582
|
try {
|
|
1582
|
-
const t = await
|
|
1583
|
-
return t ? (
|
|
1583
|
+
const t = await Xa(e);
|
|
1584
|
+
return t ? (k.value = {
|
|
1584
1585
|
appId: e,
|
|
1585
1586
|
level: this.userInfo.UserLevel,
|
|
1586
1587
|
permits: t.permits || [],
|
|
@@ -1596,7 +1597,7 @@ const Ga = (e) => {
|
|
|
1596
1597
|
* @returns 是否有角色权限
|
|
1597
1598
|
*/
|
|
1598
1599
|
hasRole(e) {
|
|
1599
|
-
return !
|
|
1600
|
+
return !k.value || !k.value.level ? !1 : Array.isArray(e) ? e.includes(k.value.level) : k.value.level === e;
|
|
1600
1601
|
},
|
|
1601
1602
|
/**
|
|
1602
1603
|
* 检查功能权限
|
|
@@ -1605,7 +1606,7 @@ const Ga = (e) => {
|
|
|
1605
1606
|
*/
|
|
1606
1607
|
hasPermit(e, t) {
|
|
1607
1608
|
var a;
|
|
1608
|
-
return !
|
|
1609
|
+
return !k.value || !k.value.permits ? !1 : ((a = k.value.permits[e]) == null ? void 0 : a.includes(t)) ?? !1;
|
|
1609
1610
|
},
|
|
1610
1611
|
/**
|
|
1611
1612
|
* 获取用户信息
|
|
@@ -1633,7 +1634,7 @@ const Ga = (e) => {
|
|
|
1633
1634
|
Code: "",
|
|
1634
1635
|
TenantId: "",
|
|
1635
1636
|
UserLevel: ""
|
|
1636
|
-
}, this.token = "", me(this.token), this.isLogin = !1,
|
|
1637
|
+
}, this.token = "", me(this.token), this.isLogin = !1, k.value = null, (await N()).clear(), Promise.resolve();
|
|
1637
1638
|
},
|
|
1638
1639
|
/**
|
|
1639
1640
|
* 登出操作
|
|
@@ -1641,7 +1642,7 @@ const Ga = (e) => {
|
|
|
1641
1642
|
*/
|
|
1642
1643
|
async logout() {
|
|
1643
1644
|
try {
|
|
1644
|
-
await
|
|
1645
|
+
await Za();
|
|
1645
1646
|
} catch (e) {
|
|
1646
1647
|
console.error("调用登出接口失败", e);
|
|
1647
1648
|
} finally {
|
|
@@ -1655,11 +1656,11 @@ const Ga = (e) => {
|
|
|
1655
1656
|
}
|
|
1656
1657
|
},
|
|
1657
1658
|
persist: {
|
|
1658
|
-
key:
|
|
1659
|
+
key: Wa,
|
|
1659
1660
|
storage: localStorage,
|
|
1660
1661
|
pick: ["isLogin", "userInfo", "token", "refreshToken"]
|
|
1661
1662
|
}
|
|
1662
|
-
}),
|
|
1663
|
+
}), Qt = (e, t) => {
|
|
1663
1664
|
const a = Q();
|
|
1664
1665
|
return e.filter((s) => {
|
|
1665
1666
|
if (s.role && !a.hasRole(s.role) || s.permit && !a.hasPermit(U.currentRoute.value.path, s.permit))
|
|
@@ -1672,7 +1673,7 @@ const Ga = (e) => {
|
|
|
1672
1673
|
}
|
|
1673
1674
|
return !0;
|
|
1674
1675
|
});
|
|
1675
|
-
},
|
|
1676
|
+
}, Gt = (e, t) => {
|
|
1676
1677
|
const a = t == null ? void 0 : t.filter((s) => {
|
|
1677
1678
|
const r = e.find(
|
|
1678
1679
|
(n) => n.dataIndex === s.dataIndex || n.key === s.key || n.title === s.title
|
|
@@ -1680,7 +1681,7 @@ const Ga = (e) => {
|
|
|
1680
1681
|
return r ? { ...s, ...r } : !1;
|
|
1681
1682
|
});
|
|
1682
1683
|
return [...a || [], ...e.filter((s) => !(a != null && a.includes(s)))];
|
|
1683
|
-
},
|
|
1684
|
+
}, tt = (e) => (e.remotePage = !1, aa(e).then((t) => t.rows)), aa = (e) => {
|
|
1684
1685
|
e.gridQuery || (e.gridQuery = {});
|
|
1685
1686
|
const t = e.remotePage ? "find" : "list";
|
|
1686
1687
|
return Oe(e, {
|
|
@@ -1705,7 +1706,7 @@ const Ga = (e) => {
|
|
|
1705
1706
|
rows: []
|
|
1706
1707
|
};
|
|
1707
1708
|
});
|
|
1708
|
-
},
|
|
1709
|
+
}, st = (e, t, a = {}) => Je(e, {
|
|
1709
1710
|
urlKey: "update",
|
|
1710
1711
|
url: e.updateUrl,
|
|
1711
1712
|
params: {
|
|
@@ -1716,9 +1717,9 @@ const Ga = (e) => {
|
|
|
1716
1717
|
...a
|
|
1717
1718
|
}).then((s) => ((s == null ? void 0 : s.status) === A.SUCCESS && setTimeout(() => {
|
|
1718
1719
|
e.reload.value = !0, e.afterUpdate && e.afterUpdate(t);
|
|
1719
|
-
}, 50), s)),
|
|
1720
|
+
}, 50), s)), Vt = (e, t) => {
|
|
1720
1721
|
const a = {};
|
|
1721
|
-
return a[e.primaryKey] = t[e.primaryKey], a[e.statusKey] = t[e.statusKey],
|
|
1722
|
+
return a[e.primaryKey] = t[e.primaryKey], a[e.statusKey] = t[e.statusKey], st(e, a, {
|
|
1722
1723
|
loadingText: !1,
|
|
1723
1724
|
hideErrorToast: !0
|
|
1724
1725
|
});
|
|
@@ -1727,13 +1728,13 @@ const Ga = (e) => {
|
|
|
1727
1728
|
url: a,
|
|
1728
1729
|
params: t,
|
|
1729
1730
|
loadingState: e.isGridLoading
|
|
1730
|
-
}),
|
|
1731
|
+
}), qt = (e, t) => {
|
|
1731
1732
|
const a = t;
|
|
1732
1733
|
return ta(e, { [e.primaryKey]: a[e.primaryKey] }).then((s) => ((s == null ? void 0 : s.status) === A.SUCCESS && s.data && (e.expandRows.value[a[e.primaryKey]] = s), s));
|
|
1733
|
-
},
|
|
1734
|
+
}, jt = (e, t) => {
|
|
1734
1735
|
let a = e.editor;
|
|
1735
1736
|
e.rowData.value = t, a && (We(a, t), a.visible.value = !0);
|
|
1736
|
-
},
|
|
1737
|
+
}, Bt = (e, t) => _a(e, t, {
|
|
1737
1738
|
url: e.deleteUrl,
|
|
1738
1739
|
primaryKey: e.primaryKey
|
|
1739
1740
|
}).then((a) => ((a == null ? void 0 : a.status) === A.SUCCESS && setTimeout(() => {
|
|
@@ -1767,7 +1768,7 @@ const Ga = (e) => {
|
|
|
1767
1768
|
TreeOption: {
|
|
1768
1769
|
autoload: !0
|
|
1769
1770
|
}
|
|
1770
|
-
},
|
|
1771
|
+
}, Jt = (e) => {
|
|
1771
1772
|
y.PageOption = {
|
|
1772
1773
|
...y.PageOption,
|
|
1773
1774
|
...e.pageOption
|
|
@@ -1781,7 +1782,7 @@ const Ga = (e) => {
|
|
|
1781
1782
|
...y.TreeOption,
|
|
1782
1783
|
...e.treeOption
|
|
1783
1784
|
};
|
|
1784
|
-
},
|
|
1785
|
+
}, rt = (e, t, a, s) => ({
|
|
1785
1786
|
editorCtrl: {
|
|
1786
1787
|
...y.EditorOption,
|
|
1787
1788
|
name: "",
|
|
@@ -1797,7 +1798,7 @@ const Ga = (e) => {
|
|
|
1797
1798
|
isFormSaving: f(!1),
|
|
1798
1799
|
isFormLoading: f(!1)
|
|
1799
1800
|
}
|
|
1800
|
-
}),
|
|
1801
|
+
}), nt = (e, t, a) => {
|
|
1801
1802
|
const s = {
|
|
1802
1803
|
...y.GridOption,
|
|
1803
1804
|
tableSize: f(y.GridOption.tableSize.value),
|
|
@@ -1830,12 +1831,12 @@ const Ga = (e) => {
|
|
|
1830
1831
|
(r) => {
|
|
1831
1832
|
r && (setTimeout(() => {
|
|
1832
1833
|
s.reload.value = !1;
|
|
1833
|
-
}, 1), s.remotePage ? aa(s) :
|
|
1834
|
+
}, 1), s.remotePage ? aa(s) : tt(s));
|
|
1834
1835
|
}
|
|
1835
1836
|
), {
|
|
1836
1837
|
gridCtrl: s
|
|
1837
1838
|
};
|
|
1838
|
-
},
|
|
1839
|
+
}, zt = (e, t) => {
|
|
1839
1840
|
const a = {
|
|
1840
1841
|
...y.TreeOption,
|
|
1841
1842
|
reload: f(!1),
|
|
@@ -1850,18 +1851,18 @@ const Ga = (e) => {
|
|
|
1850
1851
|
(s) => {
|
|
1851
1852
|
s && (setTimeout(() => {
|
|
1852
1853
|
a.reload.value = !1;
|
|
1853
|
-
}, 1),
|
|
1854
|
+
}, 1), Ka(a));
|
|
1854
1855
|
}
|
|
1855
1856
|
), {
|
|
1856
1857
|
treeCtrl: a
|
|
1857
1858
|
};
|
|
1858
|
-
},
|
|
1859
|
+
}, Wt = (e, t, a) => {
|
|
1859
1860
|
for (const o in e.urls)
|
|
1860
1861
|
e.urls[o] && (e.urls[o].api || (e.urls[o].api = e.api), e.urls[o].authorize === void 0 && (e.urls[o].authorize = e.authorize));
|
|
1861
1862
|
const s = {
|
|
1862
1863
|
...y.PageOption,
|
|
1863
1864
|
...e
|
|
1864
|
-
}, { editorCtrl: r } =
|
|
1865
|
+
}, { editorCtrl: r } = rt(e, s, t, a), { gridCtrl: n } = nt(e, s);
|
|
1865
1866
|
return s.editor = r, s.grid = n, n.editor = r, n.tools = ["Reload", "RowHeight", "TableHeadset", "Fullscreen"], r.grid = n, {
|
|
1866
1867
|
pageCtrl: s,
|
|
1867
1868
|
editorCtrl: r,
|
|
@@ -1869,9 +1870,9 @@ const Ga = (e) => {
|
|
|
1869
1870
|
};
|
|
1870
1871
|
};
|
|
1871
1872
|
var sa = /* @__PURE__ */ ((e) => (e.SelectReload = "Select.Reload", e.RadioReload = "Radio.Reload", e.CheckboxReload = "Checkbox.Reload", e.TreeSelectReload = "TreeSelect.Reload", e.TreeCheckReload = "TreeCheck.Reload", e))(sa || {});
|
|
1872
|
-
class
|
|
1873
|
+
class ot {
|
|
1873
1874
|
constructor() {
|
|
1874
|
-
|
|
1875
|
+
P(this, "listeners", {});
|
|
1875
1876
|
}
|
|
1876
1877
|
// 检查事件名是否符合前缀
|
|
1877
1878
|
isValidPrefix(t) {
|
|
@@ -1915,9 +1916,9 @@ class rt {
|
|
|
1915
1916
|
this.listeners[t] && this.listeners[t].forEach((s) => s(t, ...a));
|
|
1916
1917
|
}
|
|
1917
1918
|
}
|
|
1918
|
-
const ee = new
|
|
1919
|
-
if (s && t.reloadEvent && (s.reloadHandler = (o,
|
|
1920
|
-
|
|
1919
|
+
const ee = new ot(), ce = (e, t, a, s, r, n) => {
|
|
1920
|
+
if (s && t.reloadEvent && (s.reloadHandler = (o, i) => {
|
|
1921
|
+
it(r, t, i, a);
|
|
1921
1922
|
}, ee.on(t.reloadEvent, s.reloadHandler)), t.data)
|
|
1922
1923
|
T(
|
|
1923
1924
|
() => t.data,
|
|
@@ -1949,16 +1950,16 @@ const ee = new rt(), ce = (e, t, a, s, r, n) => {
|
|
|
1949
1950
|
label: "全部",
|
|
1950
1951
|
value: void 0
|
|
1951
1952
|
}), a.value = t;
|
|
1952
|
-
},
|
|
1953
|
+
}, it = (e, t, a, s) => {
|
|
1953
1954
|
Array.isArray(a) ? Me(t, a, s, !0) : ra(e, t, { Query: a }, s);
|
|
1954
1955
|
}, fe = (e, t) => {
|
|
1955
1956
|
t && e.reloadEvent && t.reloadHandler && ee.off(e.reloadEvent, t.reloadHandler);
|
|
1956
1957
|
}, ra = (e, t, a, s) => {
|
|
1957
1958
|
const r = Te(e.params, a, t.params);
|
|
1958
|
-
|
|
1959
|
+
lt(e, t.fieldMap, r).then((n) => {
|
|
1959
1960
|
Me(t, n, s, !1);
|
|
1960
1961
|
});
|
|
1961
|
-
},
|
|
1962
|
+
}, lt = (e, t, a) => {
|
|
1962
1963
|
const { fieldMap: s, ...r } = e, o = {
|
|
1963
1964
|
...{
|
|
1964
1965
|
url: "",
|
|
@@ -1970,8 +1971,8 @@ const ee = new rt(), ce = (e, t, a, s, r, n) => {
|
|
|
1970
1971
|
},
|
|
1971
1972
|
...r
|
|
1972
1973
|
};
|
|
1973
|
-
return o.loadingText = !1, a || (a = {}), a.Query || (a.Query = {}), _(o, a).then((
|
|
1974
|
-
},
|
|
1974
|
+
return o.loadingText = !1, a || (a = {}), a.Query || (a.Query = {}), _(o, a).then((i) => (i == null ? void 0 : i.status) === A.SUCCESS && i.data ? i.data : []);
|
|
1975
|
+
}, ut = (e, t) => {
|
|
1975
1976
|
if (e !== void 0)
|
|
1976
1977
|
return Array.isArray(e) ? t.filter((a) => e.includes(a.value)) : t.find((a) => a.value === e);
|
|
1977
1978
|
}, be = (e, t, a) => {
|
|
@@ -1998,18 +1999,18 @@ const ee = new rt(), ce = (e, t, a, s, r, n) => {
|
|
|
1998
1999
|
});
|
|
1999
2000
|
}, pe = (e, t, a, s) => {
|
|
2000
2001
|
var n;
|
|
2001
|
-
s.editorCtrl && ((n = s.errInfo) != null && n.value.errClass) &&
|
|
2002
|
-
const r =
|
|
2002
|
+
s.editorCtrl && ((n = s.errInfo) != null && n.value.errClass) && le(s.editorCtrl);
|
|
2003
|
+
const r = ut(t, a.value);
|
|
2003
2004
|
return e.formData && e.outFields && na(e.formData, e.outFields, r), e.changeEvent && (Array.isArray(e.changeEvent) ? e.changeEvent.every((o) => {
|
|
2004
2005
|
ee.emit(o, t, r);
|
|
2005
2006
|
}) : ee.emit(e.changeEvent, t, r)), s.inputEmit && s.inputEmit("change", t, r), r;
|
|
2006
|
-
}, de = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((t) => t.label) : [e.label],
|
|
2007
|
+
}, de = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((t) => t.label) : [e.label], Yt = (e, t, a, s) => {
|
|
2007
2008
|
oa(e, [], a, s).forEach((n) => t.push(n));
|
|
2008
2009
|
}, oa = (e, t, a, s) => {
|
|
2009
|
-
var o,
|
|
2010
|
+
var o, i, l, u, c;
|
|
2010
2011
|
const r = [], n = Q();
|
|
2011
2012
|
for (const p of e) {
|
|
2012
|
-
if (p.redirect || p.path.includes("/login") || p.path.includes("/error") || p.path.includes("/:page(.*)") || (
|
|
2013
|
+
if (p.redirect || p.path.includes("/login") || p.path.includes("/error") || p.path.includes("/:page(.*)") || (i = (o = p.meta) == null ? void 0 : o.roles) != null && i.length && !n.hasRole(p.meta.roles) && (l = p.meta) != null && l.permission && !n.hasPermit(p.meta.permission, ":page"))
|
|
2013
2014
|
continue;
|
|
2014
2015
|
const h = p.path.split("/");
|
|
2015
2016
|
h.unshift(...t);
|
|
@@ -2023,20 +2024,20 @@ const ee = new rt(), ce = (e, t, a, s, r, n) => {
|
|
|
2023
2024
|
(v.length > 0 || !p.children) && r.push(w);
|
|
2024
2025
|
}
|
|
2025
2026
|
return r;
|
|
2026
|
-
}, He = fa([]),
|
|
2027
|
+
}, He = fa([]), Xt = () => {
|
|
2027
2028
|
He.length = 0;
|
|
2028
2029
|
const e = N();
|
|
2029
|
-
let a =
|
|
2030
|
+
let a = ke().TabActive;
|
|
2030
2031
|
e.matchedRoutes(a).forEach((r, n) => {
|
|
2031
|
-
var
|
|
2032
|
+
var i;
|
|
2032
2033
|
const o = {
|
|
2033
2034
|
index: n,
|
|
2034
2035
|
path: r.path,
|
|
2035
|
-
breadcrumbName: ((
|
|
2036
|
+
breadcrumbName: ((i = r.name) == null ? void 0 : i.toString()) ?? ""
|
|
2036
2037
|
};
|
|
2037
2038
|
He.push(o);
|
|
2038
2039
|
});
|
|
2039
|
-
},
|
|
2040
|
+
}, ct = {
|
|
2040
2041
|
host: {
|
|
2041
2042
|
api: "SITEHOST_API",
|
|
2042
2043
|
url: "/openapi/RCSiteHostSrv/get",
|
|
@@ -2048,7 +2049,7 @@ const ee = new rt(), ce = (e, t, a, s, r, n) => {
|
|
|
2048
2049
|
// 不显示错误
|
|
2049
2050
|
hideErrorToast: !0
|
|
2050
2051
|
}
|
|
2051
|
-
},
|
|
2052
|
+
}, Zt = Y("hostInfo", {
|
|
2052
2053
|
state: () => ({
|
|
2053
2054
|
hostInfo: {
|
|
2054
2055
|
Host: "",
|
|
@@ -2074,7 +2075,7 @@ const ee = new rt(), ce = (e, t, a, s, r, n) => {
|
|
|
2074
2075
|
return new Promise((s) => {
|
|
2075
2076
|
ve.SITEHOST_API || (ve.SITEHOST_API = e);
|
|
2076
2077
|
const r = t || window.location.origin;
|
|
2077
|
-
_(
|
|
2078
|
+
_(ct.host, {
|
|
2078
2079
|
Query: {
|
|
2079
2080
|
Host: r
|
|
2080
2081
|
}
|
|
@@ -2110,73 +2111,76 @@ const ee = new rt(), ce = (e, t, a, s, r, n) => {
|
|
|
2110
2111
|
// storage: localStorage,
|
|
2111
2112
|
// pick: ['hostInfo'],
|
|
2112
2113
|
// },
|
|
2113
|
-
});
|
|
2114
|
+
}), ft = xa();
|
|
2115
|
+
ft.use(Ea);
|
|
2114
2116
|
export {
|
|
2115
|
-
|
|
2117
|
+
Gt as $,
|
|
2116
2118
|
F as A,
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2119
|
+
Jt as B,
|
|
2120
|
+
rt as C,
|
|
2121
|
+
nt as D,
|
|
2122
|
+
zt as E,
|
|
2123
|
+
Wt as F,
|
|
2124
|
+
ut as G,
|
|
2123
2125
|
na as H,
|
|
2124
2126
|
pe as I,
|
|
2125
2127
|
de as J,
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2128
|
+
At as K,
|
|
2129
|
+
Tt as L,
|
|
2130
|
+
La as M,
|
|
2131
|
+
Ma as N,
|
|
2130
2132
|
L as O,
|
|
2131
2133
|
$ as P,
|
|
2132
|
-
|
|
2134
|
+
Yt as Q,
|
|
2133
2135
|
He as R,
|
|
2134
|
-
|
|
2136
|
+
Xt as S,
|
|
2135
2137
|
ze as T,
|
|
2136
|
-
|
|
2138
|
+
Kt as U,
|
|
2137
2139
|
We as V,
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2140
|
+
$t as W,
|
|
2141
|
+
Ft as X,
|
|
2142
|
+
Pe as Y,
|
|
2143
|
+
Dt as Z,
|
|
2144
|
+
Ot as _,
|
|
2145
|
+
Ut as a,
|
|
2146
|
+
st as a0,
|
|
2145
2147
|
ta as a1,
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
+
qt as a2,
|
|
2149
|
+
Mt as a3,
|
|
2148
2150
|
Je as a4,
|
|
2149
|
-
|
|
2151
|
+
_a as a5,
|
|
2150
2152
|
sa as a6,
|
|
2151
2153
|
ee as a7,
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2154
|
+
ft as a8,
|
|
2155
|
+
V as a9,
|
|
2156
|
+
Z as aa,
|
|
2157
|
+
N as ab,
|
|
2158
|
+
Zt as ac,
|
|
2159
|
+
ke as ad,
|
|
2160
|
+
z as ae,
|
|
2161
|
+
Ct as b,
|
|
2162
|
+
Rt as c,
|
|
2163
|
+
Nt as d,
|
|
2164
|
+
jt as e,
|
|
2165
|
+
Bt as f,
|
|
2166
|
+
Qt as g,
|
|
2167
|
+
Ht as h,
|
|
2164
2168
|
ue as i,
|
|
2165
2169
|
fe as j,
|
|
2166
|
-
|
|
2170
|
+
le as k,
|
|
2167
2171
|
ce as l,
|
|
2168
2172
|
aa as m,
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
+
tt as n,
|
|
2174
|
+
_t as o,
|
|
2175
|
+
Vt as p,
|
|
2176
|
+
Ka as q,
|
|
2173
2177
|
U as r,
|
|
2174
2178
|
ne as s,
|
|
2175
2179
|
Se as t,
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
+
wt as u,
|
|
2181
|
+
Pt as v,
|
|
2182
|
+
kt as w,
|
|
2183
|
+
Lt as x,
|
|
2180
2184
|
Oe as y,
|
|
2181
2185
|
Q as z
|
|
2182
2186
|
};
|