@skyfox2000/webui 1.2.5 → 1.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +441 -91
- package/lib/assets/modules/{file-upload-CoDWKNFQ.js → file-upload-D4bA7go8.js} +1 -1
- package/lib/assets/modules/{form-excel-DitXm4uj.js → form-excel-DL2_SNiS.js} +1 -1
- package/lib/assets/modules/{index-DG2jNBuv.js → index-BZvwPKou.js} +1 -1
- package/lib/assets/modules/{index-C4515EtU.js → index-CKMDsqve.js} +749 -735
- package/lib/assets/modules/{index-B5NckHoK.js → index-D16E7UbH.js} +2 -2
- package/lib/assets/modules/{menuTabs-BwX6S1WN.js → menuTabs-izaFx0kk.js} +196 -175
- package/lib/assets/modules/{toolIcon-B5Qojob9.js → toolIcon-66dclHit.js} +1 -1
- package/lib/assets/modules/{uploadList-BdeV2JlK.js → uploadList-Dw6eRrJT.js} +3 -3
- package/lib/components/common/icon/index.vue.d.ts +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/stores/appInfo.d.ts +2 -5
- package/lib/stores/userInfo.d.ts +3 -1
- package/lib/webui.css +1 -1
- package/lib/webui.es.js +279 -290
- package/package.json +2 -2
- package/src/components/layout/header/headerExits.vue +5 -4
- package/src/components/layout/header/index.vue +4 -2
- package/src/components/layout/header/user.vue +4 -1
- package/src/directives/permission.ts +6 -2
- package/src/router/index.ts +1 -11
- package/src/stores/appInfo.ts +87 -58
- package/src/stores/pageInfo.ts +1 -0
- package/src/stores/settingInfo.ts +1 -7
- package/src/stores/userInfo.ts +78 -53
- package/src/utils/main-openapis.ts +1 -9
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { inject as G, ref as
|
|
1
|
+
var la = Object.defineProperty;
|
|
2
|
+
var ia = (e, t, a) => t in e ? la(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
|
+
var k = (e, t, a) => ia(e, typeof t != "symbol" ? t + "" : t, a);
|
|
4
|
+
import { inject as G, ref as u, provide as ye, watch as R, toRaw as Qe, h as C, nextTick as ua, shallowRef as Ve, defineComponent as X, reactive as ca, useAttrs as ne, onMounted as oe, onUnmounted as le, createElementBlock as O, openBlock as A, createVNode as j, unref as x, mergeProps as ie, withCtx as Q, createCommentVNode as B, Fragment as J, renderList as Te, createBlock as Re, normalizeClass as Ge, createTextVNode as we, toDisplayString as z, createElementVNode 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
|
-
import { createPinia as ba, defineStore as
|
|
6
|
+
import { createPinia as ba, defineStore as Z } from "pinia";
|
|
7
7
|
import Sa from "pinia-plugin-persistedstate";
|
|
8
|
-
import { combineParams as
|
|
9
|
-
import { ResStatus as
|
|
8
|
+
import { combineParams as Pe, EnvConfig as te, AppAction as Ue, AppSource as Ce, isMicroApp as Ne, mainAppApis as D, isBaseMicroApp as Ia } from "@skyfox2000/microbase";
|
|
9
|
+
import { ResStatus as E, httpPost as K, setToken as be, fieldMapping as xa, parseFieldTemplate as Aa, API_HOST as Se, SERVER_HOST as Ea } from "@skyfox2000/fapi";
|
|
10
10
|
import S from "vue-m-message";
|
|
11
11
|
import Oe from "async-validator";
|
|
12
|
-
import { createRouter as
|
|
12
|
+
import { createRouter as Ta, createWebHashHistory as Ra } from "vue-router";
|
|
13
13
|
import "dayjs";
|
|
14
14
|
import "vue-draggable-next";
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
const
|
|
15
|
+
const wa = ba();
|
|
16
|
+
wa.use(Sa);
|
|
17
|
+
var U = /* @__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))(U || {});
|
|
18
|
+
const T = class T {
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
k(T, "dict", {}), k(T, "Keys", {
|
|
21
21
|
EnableDisable: "EnableDisable",
|
|
22
22
|
SuccessResult: "SuccessResult",
|
|
23
23
|
YesNo: "YesNo",
|
|
@@ -27,25 +27,25 @@ P(R, "dict", {}), P(R, "Keys", {
|
|
|
27
27
|
* @param key 名称
|
|
28
28
|
* @returns
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
k(T, "getOptions", (t) => T.dict[t]), /**
|
|
31
31
|
* 静态选择项对象
|
|
32
32
|
* @param key 名称
|
|
33
33
|
* @param value 值
|
|
34
34
|
* @returns
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
k(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
|
-
|
|
42
|
-
|
|
41
|
+
k(T, "setOptions", (t, a) => {
|
|
42
|
+
T.dict[t] = a;
|
|
43
43
|
}), /**
|
|
44
44
|
* 启用/停用选项
|
|
45
45
|
* - 启用 1
|
|
46
46
|
* - 停用 0
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
k(T, "EnableDisable", [
|
|
49
49
|
{
|
|
50
50
|
label: "启用",
|
|
51
51
|
text: "✅ 启用",
|
|
@@ -61,7 +61,7 @@ P(R, "EnableDisable", [
|
|
|
61
61
|
* - 成功 1
|
|
62
62
|
* - 失败 0
|
|
63
63
|
*/
|
|
64
|
-
|
|
64
|
+
k(T, "SuccessResult", [
|
|
65
65
|
{
|
|
66
66
|
label: "成功",
|
|
67
67
|
text: "✅ 成功",
|
|
@@ -77,7 +77,7 @@ P(R, "SuccessResult", [
|
|
|
77
77
|
* - 是 1
|
|
78
78
|
* - 否 0
|
|
79
79
|
*/
|
|
80
|
-
|
|
80
|
+
k(T, "YesNo", [
|
|
81
81
|
{
|
|
82
82
|
label: "是",
|
|
83
83
|
text: "✅ 是",
|
|
@@ -93,7 +93,7 @@ P(R, "YesNo", [
|
|
|
93
93
|
* - 男 M
|
|
94
94
|
* - 女 F
|
|
95
95
|
*/
|
|
96
|
-
|
|
96
|
+
k(T, "MaleFemale", [
|
|
97
97
|
{
|
|
98
98
|
label: "男",
|
|
99
99
|
text: "男 👨",
|
|
@@ -105,12 +105,12 @@ P(R, "MaleFemale", [
|
|
|
105
105
|
value: "F"
|
|
106
106
|
}
|
|
107
107
|
]);
|
|
108
|
-
let
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const
|
|
108
|
+
let M = T;
|
|
109
|
+
M.setOptions("EnableDisable", M.EnableDisable);
|
|
110
|
+
M.setOptions("SuccessResult", M.SuccessResult);
|
|
111
|
+
M.setOptions("YesNo", M.YesNo);
|
|
112
|
+
M.setOptions("MaleFemale", M.MaleFemale);
|
|
113
|
+
const ue = {
|
|
114
114
|
/**
|
|
115
115
|
* 自动接口加载数据
|
|
116
116
|
* - 默认为true
|
|
@@ -202,29 +202,29 @@ const oe = {
|
|
|
202
202
|
type: [String, Array],
|
|
203
203
|
required: !1
|
|
204
204
|
}
|
|
205
|
-
},
|
|
206
|
-
var
|
|
205
|
+
}, w = (e) => e == null || e === "" ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1, ce = (e, t) => {
|
|
206
|
+
var r;
|
|
207
207
|
return {
|
|
208
208
|
url: "",
|
|
209
|
-
...(
|
|
209
|
+
...(r = e.page.urls) == null ? void 0 : r[t.urlKey],
|
|
210
210
|
...e.url,
|
|
211
211
|
...t.url,
|
|
212
212
|
loadingText: t.loadingText
|
|
213
213
|
};
|
|
214
|
-
},
|
|
214
|
+
}, fe = (e, t) => {
|
|
215
215
|
const a = e.page, s = t.url;
|
|
216
216
|
if (!s || !s.url) {
|
|
217
|
-
const
|
|
218
|
-
return console.warn(
|
|
217
|
+
const n = `URL未设置: ${t.urlKey}`;
|
|
218
|
+
return console.warn(n), Promise.reject(new Error(n));
|
|
219
219
|
}
|
|
220
220
|
s.api || (s.api = a.api), s.authorize === void 0 && (s.authorize = a.authorize);
|
|
221
|
-
let
|
|
222
|
-
return t.processParams && (
|
|
223
|
-
},
|
|
221
|
+
let r = JSON.parse(JSON.stringify(t.params));
|
|
222
|
+
return t.processParams && (r = t.processParams(r)), t.loadingState && (t.loadingState.value = !0), t.hideErrorToast && (s.hideErrorToast = !0), K(s, r).then((n) => (t.loadingState && (t.loadingState.value = !1), n)).catch((n) => (t.loadingState && (t.loadingState.value = !1), null));
|
|
223
|
+
}, ke = (e, t) => {
|
|
224
224
|
t.params || (t.params = {}), t.params.Query || (t.params.Query = {});
|
|
225
|
-
const a =
|
|
226
|
-
return t.url = a,
|
|
227
|
-
}, At = (e, t) => (t.params || (t.params = {}), t.params.Query || (t.params.Query = {}), t.loadingText = t.loadingText === !1 ? !1 : t.loadingText || "开始执行...", t.url =
|
|
225
|
+
const a = ce(e, t);
|
|
226
|
+
return t.url = a, fe(e, t);
|
|
227
|
+
}, At = (e, t) => (t.params || (t.params = {}), t.params.Query || (t.params.Query = {}), t.loadingText = t.loadingText === !1 ? !1 : t.loadingText || "开始执行...", t.url = ce(e, t), fe(e, t).then((a) => ((a == null ? void 0 : a.status) === E.SUCCESS && (t.hideErrorToast || S.success("执行成功!")), a))), qe = (e, t = {}) => {
|
|
228
228
|
const a = t.primaryKey || "Id";
|
|
229
229
|
if (t.params || (t.params = {}), t.params.Query || (t.params.Query = {}), !t.params.Data)
|
|
230
230
|
return S.error("错误!无保存数据!"), Promise.resolve(null);
|
|
@@ -234,30 +234,30 @@ const oe = {
|
|
|
234
234
|
loadingText: t.loadingText === !1 ? !1 : t.loadingText || "数据保存中..."
|
|
235
235
|
};
|
|
236
236
|
s.params.Query[a] = s.params.Data[a];
|
|
237
|
-
const
|
|
238
|
-
return s.url =
|
|
239
|
-
},
|
|
237
|
+
const r = ce(e, s);
|
|
238
|
+
return s.url = r, fe(e, s).then((n) => ((n == null ? void 0 : n.status) === E.SUCCESS && (t.hideErrorToast || S.success("保存成功!")), n));
|
|
239
|
+
}, Pa = (e, t, a = {}) => {
|
|
240
240
|
const s = a.primaryKey || "Id";
|
|
241
241
|
a.params || (a.params = {}), a.params.Query || (a.params.Query = {});
|
|
242
|
-
const
|
|
242
|
+
const r = {
|
|
243
243
|
...a,
|
|
244
244
|
urlKey: "delete",
|
|
245
245
|
loadingText: a.loadingText === !1 ? !1 : a.loadingText || "数据删除中..."
|
|
246
246
|
};
|
|
247
|
-
if (Array.isArray(t) ?
|
|
247
|
+
if (Array.isArray(t) ? r.params.Query[s] = t : r.params.Query[s] = t[s], w(r.params.Query) || w(r.params.Query[s]))
|
|
248
248
|
return S.error("错误!禁止无条件删除数据!"), Promise.resolve(null);
|
|
249
|
-
const
|
|
250
|
-
return
|
|
251
|
-
}, Oa = (e, t) =>
|
|
249
|
+
const n = ce(e, r);
|
|
250
|
+
return r.url = n, fe(e, r).then((o) => ((o == null ? void 0 : o.status) === E.SUCCESS && (a.hideErrorToast || S.success("删除成功!")), o));
|
|
251
|
+
}, Oa = (e, t) => ke(e, {
|
|
252
252
|
urlKey: "tree",
|
|
253
253
|
params: {},
|
|
254
254
|
loadingState: e.isTreeLoading,
|
|
255
255
|
loadingText: !1,
|
|
256
|
-
processParams: () =>
|
|
257
|
-
}).then((a) => (a == null ? void 0 : a.status) ===
|
|
258
|
-
let
|
|
259
|
-
const
|
|
260
|
-
|
|
256
|
+
processParams: () => Pe(e.treeQuery, t)
|
|
257
|
+
}).then((a) => (a == null ? void 0 : a.status) === E.SUCCESS ? (e.data.value = a.data, e.data.value) : []);
|
|
258
|
+
let W;
|
|
259
|
+
const Et = (e) => {
|
|
260
|
+
W = new Oe({}), W.messages({
|
|
261
261
|
required: "${label}不能为空",
|
|
262
262
|
types: {
|
|
263
263
|
number: "${label}必须是数字"
|
|
@@ -284,146 +284,146 @@ const Rt = (e) => {
|
|
|
284
284
|
...e
|
|
285
285
|
});
|
|
286
286
|
}, Tt = (e) => {
|
|
287
|
-
if (!e ||
|
|
287
|
+
if (!e || w(e))
|
|
288
288
|
return [];
|
|
289
|
-
const t = [], a =
|
|
290
|
-
const
|
|
291
|
-
if (
|
|
292
|
-
const
|
|
293
|
-
|
|
289
|
+
const t = [], a = W.messages(), s = (n, o, l) => {
|
|
290
|
+
const i = o.type;
|
|
291
|
+
if (i && a.types && i in a.types) {
|
|
292
|
+
const f = a.types[i];
|
|
293
|
+
r(f, n, { type: i }, l);
|
|
294
294
|
}
|
|
295
|
-
const
|
|
296
|
-
for (const
|
|
297
|
-
if (
|
|
298
|
-
const p = a[
|
|
299
|
-
for (const
|
|
300
|
-
|
|
295
|
+
const c = ["string", "number", "array"];
|
|
296
|
+
for (const f of c)
|
|
297
|
+
if (i === f && a[f]) {
|
|
298
|
+
const p = a[f], v = ["len", "min", "max", "range"];
|
|
299
|
+
for (const g of v)
|
|
300
|
+
g === "range" && o.min != null && o.max != null && p.range ? r(p.range, n, { min: o.min, max: o.max }, l) : g !== "range" && o[g] != null && p[g] && r(p[g], n, { [g]: o[g] }, l);
|
|
301
301
|
}
|
|
302
|
-
if (o.required && a.required &&
|
|
303
|
-
const
|
|
304
|
-
|
|
302
|
+
if (o.required && a.required && r(a.required, n, {}, l), o.pattern && a.pattern && r(o.message, n, {}, l), o.enum && Array.isArray(o.enum) && a.enum) {
|
|
303
|
+
const f = o.enum.join(", ");
|
|
304
|
+
r(a.enum, n, { enum: f }, l);
|
|
305
305
|
}
|
|
306
|
-
},
|
|
307
|
-
if (
|
|
306
|
+
}, r = (n, o, l, i) => {
|
|
307
|
+
if (n)
|
|
308
308
|
try {
|
|
309
|
-
let
|
|
310
|
-
if (typeof
|
|
311
|
-
const
|
|
312
|
-
for (const p in
|
|
313
|
-
|
|
314
|
-
|
|
309
|
+
let c;
|
|
310
|
+
if (typeof n == "function") {
|
|
311
|
+
const f = [o];
|
|
312
|
+
for (const p in l)
|
|
313
|
+
f.push(l[p]);
|
|
314
|
+
c = n.apply(null, f), c && i.push(c);
|
|
315
315
|
} else {
|
|
316
|
-
|
|
317
|
-
for (const
|
|
318
|
-
|
|
319
|
-
|
|
316
|
+
c = String(n);
|
|
317
|
+
for (const f in l)
|
|
318
|
+
c = c.replace(new RegExp(`\\$\\{${f}\\}`, "g"), l[f]);
|
|
319
|
+
c = c.replace(/\$\{label\}/g, ""), c && i.push(c);
|
|
320
320
|
}
|
|
321
|
-
} catch (
|
|
322
|
-
console.error("格式化验证消息出错:",
|
|
321
|
+
} catch (c) {
|
|
322
|
+
console.error("格式化验证消息出错:", c);
|
|
323
323
|
}
|
|
324
324
|
};
|
|
325
|
-
return Object.keys(e).forEach((
|
|
326
|
-
const o = e[
|
|
325
|
+
return Object.keys(e).forEach((n) => {
|
|
326
|
+
const o = e[n], l = [];
|
|
327
327
|
try {
|
|
328
|
-
s(
|
|
329
|
-
|
|
328
|
+
s(n, o, l), Array.isArray(o) && o.forEach((c) => {
|
|
329
|
+
c && typeof c == "object" && s(n, c, l);
|
|
330
330
|
}), o && typeof o == "object" && "fields" in o;
|
|
331
|
-
} catch (
|
|
332
|
-
console.error("处理验证规则出错:",
|
|
331
|
+
} catch (c) {
|
|
332
|
+
console.error("处理验证规则出错:", c);
|
|
333
333
|
}
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
field:
|
|
337
|
-
rules:
|
|
334
|
+
const i = Array.from(new Set(l));
|
|
335
|
+
n && i.length > 0 && t.push({
|
|
336
|
+
field: n,
|
|
337
|
+
rules: i
|
|
338
338
|
});
|
|
339
339
|
}), t;
|
|
340
|
-
},
|
|
340
|
+
}, pe = async (e) => {
|
|
341
341
|
const t = e.formData.value, a = e.formRules.value;
|
|
342
|
-
|
|
342
|
+
w(a) || (Le(e), e.ruleValidator || (e.ruleValidator = new Oe({}), e.ruleValidator.messages(W.messages()), e.ruleValidator.define(a)), e.ruleResults.value = await e.ruleValidator.validate(t).then(() => {
|
|
343
343
|
}).catch(({ fields: s }) => s));
|
|
344
|
-
},
|
|
345
|
-
}).catch(({ fields: s }) => s)),
|
|
344
|
+
}, Rt = async (e, t, a) => (a || (a = new Oe({}), a.messages(W.messages()), a.define(t)), a.validate(e).then(() => {
|
|
345
|
+
}).catch(({ fields: s }) => s)), Le = (e) => {
|
|
346
346
|
e.ruleResults.value = void 0;
|
|
347
|
-
},
|
|
348
|
-
const e = G(
|
|
347
|
+
}, de = () => {
|
|
348
|
+
const e = G(U.EditorControl, void 0), t = u(G(U.LabelText, "")), a = u(G(U.RuleKey, "")), s = G(U.ErrInfo, void 0);
|
|
349
349
|
return {
|
|
350
350
|
editorCtrl: e,
|
|
351
351
|
labelText: t,
|
|
352
352
|
ruleKey: a,
|
|
353
353
|
errInfo: s
|
|
354
354
|
};
|
|
355
|
-
},
|
|
356
|
-
let a =
|
|
355
|
+
}, ka = (e, t) => {
|
|
356
|
+
let a = u({
|
|
357
357
|
msg: "",
|
|
358
358
|
errClass: ""
|
|
359
359
|
});
|
|
360
360
|
if (!e.label || !e.rule)
|
|
361
361
|
return a;
|
|
362
362
|
const s = t == null ? void 0 : t.ruleResults;
|
|
363
|
-
return
|
|
363
|
+
return R(
|
|
364
364
|
() => s == null ? void 0 : s.value,
|
|
365
|
-
(
|
|
366
|
-
if (a.value.errClass = "", a.value.msg = "", !
|
|
367
|
-
const
|
|
365
|
+
(r) => {
|
|
366
|
+
if (a.value.errClass = "", a.value.msg = "", !w(r)) {
|
|
367
|
+
const n = La(
|
|
368
368
|
{
|
|
369
369
|
label: e.label,
|
|
370
370
|
rule: e.rule
|
|
371
371
|
},
|
|
372
372
|
t == null ? void 0 : t.formRules.value,
|
|
373
|
-
Qe(
|
|
373
|
+
Qe(r)
|
|
374
374
|
);
|
|
375
|
-
a.value.errClass =
|
|
375
|
+
a.value.errClass = n.errClass.value, a.value.msg = n.msg.value;
|
|
376
376
|
}
|
|
377
377
|
},
|
|
378
378
|
{ deep: !0 }
|
|
379
379
|
), a;
|
|
380
|
-
},
|
|
381
|
-
const s =
|
|
380
|
+
}, La = (e, t, a) => {
|
|
381
|
+
const s = u([]), r = u(""), n = u("");
|
|
382
382
|
if (!e.rule || !t || !a)
|
|
383
|
-
return { msg:
|
|
384
|
-
e.rule.split("|").forEach((
|
|
385
|
-
if (
|
|
386
|
-
if (a[
|
|
387
|
-
s.value.push(...a[
|
|
383
|
+
return { msg: r, ruleErrors: s, errClass: n };
|
|
384
|
+
e.rule.split("|").forEach((i) => {
|
|
385
|
+
if (i = i.trim(), i)
|
|
386
|
+
if (a[i])
|
|
387
|
+
s.value.push(...a[i]);
|
|
388
388
|
else {
|
|
389
|
-
const
|
|
390
|
-
for (let
|
|
391
|
-
|
|
392
|
-
|
|
389
|
+
const c = [];
|
|
390
|
+
for (let f in a)
|
|
391
|
+
f !== i && f.startsWith(i + ".") && c.push(...a[f]);
|
|
392
|
+
c.length > 0 && s.value.push(...c);
|
|
393
393
|
}
|
|
394
394
|
});
|
|
395
|
-
const
|
|
396
|
-
return s.value.forEach((
|
|
397
|
-
|
|
398
|
-
const
|
|
399
|
-
if (
|
|
400
|
-
const
|
|
401
|
-
|
|
402
|
-
const
|
|
403
|
-
|
|
395
|
+
const l = /\${\w+}/g;
|
|
396
|
+
return s.value.forEach((i) => {
|
|
397
|
+
r.value && (r.value += " / "), r.value += i.message.replace("${label}", e.label ?? "");
|
|
398
|
+
const c = t[i.field];
|
|
399
|
+
if (c) {
|
|
400
|
+
const f = r.value.match(l);
|
|
401
|
+
f && f.forEach((p) => {
|
|
402
|
+
const v = p.replace("${", "").replace("}", "");
|
|
403
|
+
r.value = r.value.replace(p, c[v] ?? "");
|
|
404
404
|
});
|
|
405
405
|
}
|
|
406
|
-
}), s.value.length > 0 && (
|
|
407
|
-
},
|
|
408
|
-
|
|
409
|
-
const a =
|
|
410
|
-
return
|
|
406
|
+
}), s.value.length > 0 && (n.value = "error"), { msg: r, ruleErrors: s, errClass: n };
|
|
407
|
+
}, wt = (e, t) => {
|
|
408
|
+
ye(U.LabelText, e.label || ""), ye(U.RuleKey, e.rule || "");
|
|
409
|
+
const a = ka(e, t);
|
|
410
|
+
return ye(U.ErrInfo, a), a;
|
|
411
411
|
}, Pt = (e) => {
|
|
412
|
-
|
|
413
|
-
},
|
|
412
|
+
je(e);
|
|
413
|
+
}, Ot = (e) => {
|
|
414
414
|
const t = e.page, a = e.formData.value;
|
|
415
|
-
a[e.primaryKey ?? t.primaryKey] = null,
|
|
416
|
-
},
|
|
415
|
+
a[e.primaryKey ?? t.primaryKey] = null, je(e);
|
|
416
|
+
}, kt = (e) => {
|
|
417
417
|
e.visible.value = !1;
|
|
418
|
-
},
|
|
418
|
+
}, je = async (e) => {
|
|
419
419
|
var s;
|
|
420
420
|
const t = e.page;
|
|
421
|
-
if (e.isFormSaving.value = !0,
|
|
421
|
+
if (e.isFormSaving.value = !0, Le(e), e.beforeSave && e.beforeSave() === !1)
|
|
422
422
|
return e.isFormSaving.value = !1, Promise.resolve();
|
|
423
|
-
if (e.formRules.value && await
|
|
423
|
+
if (e.formRules.value && await pe(e), e.ruleResults.value)
|
|
424
424
|
return S.error("提交表单时,验证失败!"), console.error("表单验证失败!", e.ruleResults.value), e.isFormSaving.value = !1, Promise.resolve();
|
|
425
425
|
const a = e.formData.value;
|
|
426
|
-
return
|
|
426
|
+
return qe(
|
|
427
427
|
{
|
|
428
428
|
page: t,
|
|
429
429
|
// 转换为AnyControl接口
|
|
@@ -440,134 +440,128 @@ const Rt = (e) => {
|
|
|
440
440
|
// 隐藏自动错误提示,特殊判断控制
|
|
441
441
|
loadingState: e.isFormSaving
|
|
442
442
|
}
|
|
443
|
-
).then((
|
|
444
|
-
var
|
|
445
|
-
if ((
|
|
443
|
+
).then((r) => {
|
|
444
|
+
var n, o;
|
|
445
|
+
if ((r == null ? void 0 : r.status) === E.SUCCESS)
|
|
446
446
|
S.success("保存成功!"), e.grid && (e.grid.reload.value = !0), e.afterSave && e.afterSave(), e.autoClose !== !1 && (e.visible.value = !1);
|
|
447
|
-
else if (
|
|
448
|
-
const
|
|
449
|
-
if (
|
|
450
|
-
const
|
|
451
|
-
if (
|
|
447
|
+
else if (r != null && r.msg && ((n = r == null ? void 0 : r.msg) == null ? void 0 : n.indexOf("Duplicate entry")) > -1) {
|
|
448
|
+
const l = (o = r == null ? void 0 : r.msg) == null ? void 0 : o.match(/Duplicate entry '([^']+)' for key '([^']+)'/);
|
|
449
|
+
if (l && l.length > 2 && l[1] && l[2]) {
|
|
450
|
+
const i = l[1], c = l[2].replace(/Idx_/g, "").split("_"), f = e.formRules.value;
|
|
451
|
+
if (f && c.length > 0) {
|
|
452
452
|
const p = {};
|
|
453
|
-
|
|
454
|
-
|
|
453
|
+
c.forEach((v) => {
|
|
454
|
+
f[v] && (p[v] = [
|
|
455
455
|
{
|
|
456
|
-
field:
|
|
457
|
-
fieldValue:
|
|
456
|
+
field: v,
|
|
457
|
+
fieldValue: i,
|
|
458
458
|
message: "数据重复"
|
|
459
459
|
}
|
|
460
460
|
]);
|
|
461
461
|
}), Object.keys(p).length > 0 && (console.error("保存失败!", p), e.ruleResults.value = p);
|
|
462
462
|
}
|
|
463
|
-
S.error(`保存失败!数据 \`${
|
|
464
|
-
} else S.error((
|
|
463
|
+
S.error(`保存失败!数据 \`${i}\` 已存在!`);
|
|
464
|
+
} else S.error((r == null ? void 0 : r.msg) ?? "保存失败!");
|
|
465
465
|
} else
|
|
466
|
-
S.error((
|
|
466
|
+
S.error((r == null ? void 0 : r.msg) ?? "保存失败!");
|
|
467
467
|
});
|
|
468
|
-
},
|
|
468
|
+
}, Lt = async (e) => {
|
|
469
469
|
const t = e.page, a = e.grid;
|
|
470
470
|
e.isFormLoading.value = !0;
|
|
471
|
-
const s = e.formData.value,
|
|
472
|
-
return ea(a, { [
|
|
473
|
-
e.isFormLoading.value = !1,
|
|
471
|
+
const s = e.formData.value, r = e.primaryKey ?? t.primaryKey;
|
|
472
|
+
return ea(a, { [r]: s[r] }, e.detailUrl).then((n) => {
|
|
473
|
+
e.isFormLoading.value = !1, n && Be(e, n);
|
|
474
474
|
});
|
|
475
|
-
},
|
|
475
|
+
}, Mt = (e) => {
|
|
476
476
|
const t = e.grid;
|
|
477
|
-
t && (t.rowData.value = void 0), e && (
|
|
477
|
+
t && (t.rowData.value = void 0), e && (Je(e), e.visible && (e.visible.value = !1), setTimeout(() => {
|
|
478
478
|
e.visible.value = !0;
|
|
479
479
|
}, 1));
|
|
480
|
-
},
|
|
481
|
-
|
|
482
|
-
},
|
|
483
|
-
e.formData.value = e.default ? JSON.parse(JSON.stringify(e.default)) : {},
|
|
484
|
-
},
|
|
480
|
+
}, Be = (e, t) => {
|
|
481
|
+
Je(e), e.formData.value = { ...e.formData.value, ...t };
|
|
482
|
+
}, Je = (e) => {
|
|
483
|
+
e.formData.value = e.default ? JSON.parse(JSON.stringify(e.default)) : {}, Le(e);
|
|
484
|
+
}, se = "/login/", ae = [], Ma = (e) => {
|
|
485
485
|
for (const t of e) {
|
|
486
|
-
const a =
|
|
487
|
-
a !== -1 &&
|
|
486
|
+
const a = ae.findIndex((s) => s.path === t.path);
|
|
487
|
+
a !== -1 && ae.splice(a, 1), ae.push(t), Y.addRoute(t);
|
|
488
488
|
}
|
|
489
|
-
},
|
|
490
|
-
const
|
|
491
|
-
t[
|
|
492
|
-
},
|
|
489
|
+
}, ze = (e, t, a, s = "") => {
|
|
490
|
+
const r = s + (s ? "/" : "") + e.path;
|
|
491
|
+
t[r] = { ...e, parent: a }, e.children && e.children.forEach((n) => ze(n, t, e, r));
|
|
492
|
+
}, Y = Ta({
|
|
493
493
|
history: Ra("/"),
|
|
494
|
-
routes:
|
|
495
|
-
}),
|
|
496
|
-
var
|
|
497
|
-
const a = ((
|
|
494
|
+
routes: ae
|
|
495
|
+
}), $a = (e, t) => {
|
|
496
|
+
var r, n;
|
|
497
|
+
const a = ((r = e.meta) == null ? void 0 : r.roles) ?? [], s = (n = e.meta) == null ? void 0 : n.permission;
|
|
498
498
|
if (!t)
|
|
499
499
|
return a.length === 0 && !s;
|
|
500
500
|
if (t) {
|
|
501
|
-
const o =
|
|
502
|
-
if (
|
|
501
|
+
const o = _();
|
|
502
|
+
if (te.VITE_PERMISSION_MODE === "role")
|
|
503
503
|
return a.length === 0 ? !0 : o.hasRole(a);
|
|
504
|
-
if (
|
|
504
|
+
if (te.VITE_PERMISSION_MODE === "permit") {
|
|
505
505
|
if (a.length === 0 && !s)
|
|
506
506
|
return !0;
|
|
507
|
-
let
|
|
508
|
-
return a.length > 0 && (
|
|
507
|
+
let l = !1, i = !1;
|
|
508
|
+
return a.length > 0 && (l = o.hasRole(a)), s && (i = o.hasPermit(e.path, ":page")), l || i;
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
511
|
return !1;
|
|
512
|
-
},
|
|
513
|
-
|
|
514
|
-
var
|
|
512
|
+
}, q = u(null);
|
|
513
|
+
Y.beforeEach((e, t, a) => {
|
|
514
|
+
var l;
|
|
515
515
|
const s = e;
|
|
516
|
-
if (e.path.startsWith("/error/") || e.path.startsWith(
|
|
516
|
+
if (e.path.startsWith("/error/") || e.path.startsWith(se))
|
|
517
517
|
return a();
|
|
518
|
-
const
|
|
518
|
+
const r = s.meta, o = ((r == null ? void 0 : r.roles) ?? []).length > 0 || ((l = r == null ? void 0 : r.permission) == null ? void 0 : l.length);
|
|
519
519
|
if (e.path === "/") {
|
|
520
|
-
const
|
|
521
|
-
if (!
|
|
522
|
-
|
|
520
|
+
const i = N();
|
|
521
|
+
if (!i.menuLoaded) {
|
|
522
|
+
q.value = {
|
|
523
523
|
to: e,
|
|
524
|
-
next: (
|
|
525
|
-
a({ path:
|
|
524
|
+
next: (c) => {
|
|
525
|
+
a({ path: c });
|
|
526
526
|
}
|
|
527
527
|
};
|
|
528
528
|
return;
|
|
529
529
|
}
|
|
530
|
-
|
|
530
|
+
i.toDefaultApp();
|
|
531
531
|
return;
|
|
532
532
|
}
|
|
533
533
|
if (!o)
|
|
534
534
|
a();
|
|
535
535
|
else {
|
|
536
|
-
const
|
|
537
|
-
if (!
|
|
538
|
-
a({ path:
|
|
536
|
+
const i = _();
|
|
537
|
+
if (!i.isLogin)
|
|
538
|
+
a({ path: se });
|
|
539
539
|
else {
|
|
540
|
-
if (!
|
|
541
|
-
|
|
540
|
+
if (!N().menuLoaded) {
|
|
541
|
+
q.value = {
|
|
542
542
|
to: e,
|
|
543
543
|
next: a
|
|
544
544
|
};
|
|
545
545
|
return;
|
|
546
546
|
}
|
|
547
|
-
const
|
|
547
|
+
const f = $a(s, i.isLogin);
|
|
548
548
|
a();
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
551
|
});
|
|
552
|
-
|
|
553
|
-
if (
|
|
554
|
-
const {
|
|
555
|
-
t
|
|
556
|
-
}
|
|
557
|
-
});
|
|
558
|
-
const $a = (e) => {
|
|
559
|
-
if (V.value) {
|
|
560
|
-
const { to: t, next: a } = V.value;
|
|
561
|
-
V.value = null, t.path === "/" ? a(e) : a(t.path);
|
|
552
|
+
const Da = (e) => {
|
|
553
|
+
if (q.value) {
|
|
554
|
+
const { to: t, next: a } = q.value;
|
|
555
|
+
q.value = null, t.path === "/" ? a(e) : a(t.path);
|
|
562
556
|
}
|
|
563
|
-
},
|
|
564
|
-
const t =
|
|
557
|
+
}, Ua = (e) => {
|
|
558
|
+
const t = Me();
|
|
565
559
|
if (t.TabEnabled) {
|
|
566
|
-
if (
|
|
560
|
+
if (Ca(e.key, t.TabPanes))
|
|
567
561
|
return;
|
|
568
562
|
t.TabPanes.push(e);
|
|
569
563
|
}
|
|
570
|
-
},
|
|
564
|
+
}, Ca = (e, t) => t.find((a) => a.key === e), Me = Z("pageInfo", {
|
|
571
565
|
state: () => ({
|
|
572
566
|
TabActive: "",
|
|
573
567
|
TabPanes: [],
|
|
@@ -580,16 +574,16 @@ const $a = (e) => {
|
|
|
580
574
|
*/
|
|
581
575
|
removeTabPane(e) {
|
|
582
576
|
if (this.TabEnabled) {
|
|
583
|
-
|
|
577
|
+
N().excludeComponent(e);
|
|
584
578
|
let a = 0, s = [...this.TabPanes];
|
|
585
|
-
for (let
|
|
586
|
-
if (s[
|
|
587
|
-
s.splice(
|
|
579
|
+
for (let r = 0; r < s.length; r++)
|
|
580
|
+
if (s[r].key === e) {
|
|
581
|
+
s.splice(r, 1), a = r - 1 < 0 ? 0 : r - 1;
|
|
588
582
|
break;
|
|
589
583
|
}
|
|
590
|
-
for (let
|
|
591
|
-
if (s[
|
|
592
|
-
a =
|
|
584
|
+
for (let r = 0; r < s.length; r++)
|
|
585
|
+
if (s[r].key === this.TabActive) {
|
|
586
|
+
a = r;
|
|
593
587
|
break;
|
|
594
588
|
}
|
|
595
589
|
this.TabPanes = s, this.setTabActive(s[a].key);
|
|
@@ -601,7 +595,7 @@ const $a = (e) => {
|
|
|
601
595
|
* @returns
|
|
602
596
|
*/
|
|
603
597
|
async setTabActive(e) {
|
|
604
|
-
let a =
|
|
598
|
+
let a = N().findRoute(e);
|
|
605
599
|
if (!a) return;
|
|
606
600
|
const s = {
|
|
607
601
|
key: e,
|
|
@@ -612,23 +606,31 @@ const $a = (e) => {
|
|
|
612
606
|
// 默认为true
|
|
613
607
|
keepAlive: !(a.meta && !a.meta.keepAlive)
|
|
614
608
|
};
|
|
615
|
-
|
|
609
|
+
Ua(s), this.TabActive = e;
|
|
616
610
|
}
|
|
617
|
-
}
|
|
618
|
-
|
|
611
|
+
},
|
|
612
|
+
persist: !1
|
|
613
|
+
}), Na = {
|
|
619
614
|
appList: {
|
|
620
615
|
api: "PLATFORM_API",
|
|
621
616
|
authorize: !0,
|
|
622
617
|
url: "/api/RCTenanetOpSrv/getApps",
|
|
623
618
|
loadingText: !1
|
|
624
619
|
}
|
|
625
|
-
},
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
620
|
+
}, Ie = /* @__PURE__ */ new Map(), Fa = (e) => {
|
|
621
|
+
const t = _(), { roles: a, permission: s } = e.meta || {};
|
|
622
|
+
if (w(a) && w(s))
|
|
623
|
+
return !0;
|
|
624
|
+
if (te.VITE_PERMISSION_MODE === "role")
|
|
625
|
+
return !w(a) && a ? t.hasRole(a) : !0;
|
|
626
|
+
if (te.VITE_PERMISSION_MODE === "permit") {
|
|
627
|
+
let r = !1, n = !1;
|
|
628
|
+
return !w(a) && a && (r = t.hasRole(a)), t.isAdmin() ? r : (!w(s) && s && (n = t.hasPermit(e.path, s)), r || n);
|
|
629
|
+
}
|
|
630
|
+
return !1;
|
|
631
|
+
}, We = (e) => e.map((t) => {
|
|
632
|
+
const a = { ...t };
|
|
633
|
+
return Fa(a) ? (a.children && (a.children = We(a.children)), a) : null;
|
|
632
634
|
}).filter(Boolean), Ye = (e, t = "") => {
|
|
633
635
|
for (const a of e) {
|
|
634
636
|
if (!a.children && !a.redirect) {
|
|
@@ -641,18 +643,16 @@ const $a = (e) => {
|
|
|
641
643
|
return s;
|
|
642
644
|
}
|
|
643
645
|
}
|
|
644
|
-
},
|
|
646
|
+
}, N = Z("appInfo", {
|
|
645
647
|
state: () => ({
|
|
646
|
-
microRouter: null,
|
|
647
|
-
microActions: {},
|
|
648
648
|
appInfo: {
|
|
649
649
|
Id: "",
|
|
650
650
|
Name: "",
|
|
651
651
|
AppCode: "",
|
|
652
652
|
Version: "",
|
|
653
653
|
Host: "",
|
|
654
|
-
Source:
|
|
655
|
-
Action:
|
|
654
|
+
Source: Ce.Manual,
|
|
655
|
+
Action: Ue.App,
|
|
656
656
|
Path: "",
|
|
657
657
|
Icon: "",
|
|
658
658
|
Routes: [],
|
|
@@ -666,9 +666,6 @@ const $a = (e) => {
|
|
|
666
666
|
menuLoaded: !1
|
|
667
667
|
}),
|
|
668
668
|
actions: {
|
|
669
|
-
init(e, t) {
|
|
670
|
-
this.microRouter = e, this.microActions = t;
|
|
671
|
-
},
|
|
672
669
|
/**
|
|
673
670
|
* 加载授权应用列表
|
|
674
671
|
*/
|
|
@@ -680,13 +677,13 @@ const $a = (e) => {
|
|
|
680
677
|
});
|
|
681
678
|
},
|
|
682
679
|
async getRemoteAppList() {
|
|
683
|
-
return
|
|
680
|
+
return K(Na.appList, {
|
|
684
681
|
Query: {
|
|
685
682
|
AppCode: this.appInfo.AppCode,
|
|
686
683
|
Enabled: 1
|
|
687
684
|
}
|
|
688
685
|
}).then((e) => {
|
|
689
|
-
(e == null ? void 0 : e.status) ===
|
|
686
|
+
(e == null ? void 0 : e.status) === E.SUCCESS && e.data && (this.appList.length = 0, this.appList.push(...e.data));
|
|
690
687
|
});
|
|
691
688
|
},
|
|
692
689
|
async toDefaultApp(e) {
|
|
@@ -697,14 +694,14 @@ const $a = (e) => {
|
|
|
697
694
|
let t = "";
|
|
698
695
|
const a = window.location.pathname.split("/");
|
|
699
696
|
if (a.length > 1) {
|
|
700
|
-
for (let
|
|
701
|
-
if (a[
|
|
702
|
-
t = a[
|
|
697
|
+
for (let r = a.length - 1; r >= 0; r--)
|
|
698
|
+
if (a[r] !== "") {
|
|
699
|
+
t = a[r];
|
|
703
700
|
break;
|
|
704
701
|
}
|
|
705
702
|
}
|
|
706
703
|
let s = null;
|
|
707
|
-
t && t != "login" ? s = this.appList.find((
|
|
704
|
+
t && t != "login" ? s = this.appList.find((r) => r.AppCode === t) : s = this.appList.find((r) => r.Default), t = s ? s.AppCode : this.appList[0].AppCode, await this.setActiveApp(t), (!e || e.startsWith("/#/") || e.includes("/error/") || window.location.hash.includes("/error/")) && this.push(this.appInfo.defaultPage);
|
|
708
705
|
},
|
|
709
706
|
/**
|
|
710
707
|
* 设置当前应用
|
|
@@ -719,7 +716,7 @@ const $a = (e) => {
|
|
|
719
716
|
flattenRoutes: {},
|
|
720
717
|
Routes: t ?? [],
|
|
721
718
|
defaultPage: ""
|
|
722
|
-
}), (!
|
|
719
|
+
}), (!Ne() || !Ia()) && (await _().getRolePermits(a.Id), this.appInfo.Routes.length && this.setAppRoutes(this.appInfo.Routes)));
|
|
723
720
|
},
|
|
724
721
|
/**
|
|
725
722
|
* 设置当前应用路由信息
|
|
@@ -733,16 +730,20 @@ const $a = (e) => {
|
|
|
733
730
|
defaultPage: ""
|
|
734
731
|
};
|
|
735
732
|
const t = this.appInfo.flattenRoutes;
|
|
736
|
-
for (const
|
|
737
|
-
|
|
738
|
-
Object.keys(t).forEach((
|
|
739
|
-
const
|
|
740
|
-
|
|
741
|
-
})
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
733
|
+
for (const a of e)
|
|
734
|
+
ze(a, t, void 0);
|
|
735
|
+
if (Object.keys(t).forEach((a) => {
|
|
736
|
+
const s = t[a];
|
|
737
|
+
s.children || !s.component || (s.meta && s.meta.keepAlive === !1 ? this.ExcludeComponents.push(a) : this.CachedComponents.push(a));
|
|
738
|
+
}), _().isLogin) {
|
|
739
|
+
const a = We(this.appInfo.Routes);
|
|
740
|
+
if (Ma(a), this.appInfo.defaultPage = Ye(a) || "", this.appInfo.defaultPage) {
|
|
741
|
+
if (this.menuLoaded = !0, D.value && D.value.mainAppPush) {
|
|
742
|
+
const s = this.formatRoute(this.appInfo.defaultPage);
|
|
743
|
+
D.value.mainAppPush(s);
|
|
744
|
+
}
|
|
745
|
+
Da(this.appInfo.defaultPage);
|
|
746
|
+
}
|
|
746
747
|
}
|
|
747
748
|
},
|
|
748
749
|
/**
|
|
@@ -759,8 +760,11 @@ const $a = (e) => {
|
|
|
759
760
|
* @param path 路由地址
|
|
760
761
|
*/
|
|
761
762
|
push(e) {
|
|
762
|
-
this.findRoute(e) &&
|
|
763
|
-
|
|
763
|
+
this.findRoute(e) && Me().setTabActive(e), ua(() => {
|
|
764
|
+
if (Y.push({ path: e }), D.value && D.value.mainAppPush) {
|
|
765
|
+
const a = this.formatRoute(e);
|
|
766
|
+
D.value.mainAppPush(a);
|
|
767
|
+
}
|
|
764
768
|
});
|
|
765
769
|
},
|
|
766
770
|
/**
|
|
@@ -778,7 +782,7 @@ const $a = (e) => {
|
|
|
778
782
|
* @returns 组件实例
|
|
779
783
|
*/
|
|
780
784
|
cacheComponent(e, t) {
|
|
781
|
-
let a =
|
|
785
|
+
let a = Ie.get(t.path);
|
|
782
786
|
if (!a)
|
|
783
787
|
if (this.CachedComponents.includes(t.path))
|
|
784
788
|
a = {
|
|
@@ -787,7 +791,7 @@ const $a = (e) => {
|
|
|
787
791
|
render() {
|
|
788
792
|
return C(e);
|
|
789
793
|
}
|
|
790
|
-
},
|
|
794
|
+
}, Ie.set(t.path, a);
|
|
791
795
|
else return e;
|
|
792
796
|
return a;
|
|
793
797
|
},
|
|
@@ -796,7 +800,7 @@ const $a = (e) => {
|
|
|
796
800
|
* @param path 路由地址
|
|
797
801
|
*/
|
|
798
802
|
excludeComponent(e) {
|
|
799
|
-
this.ExcludeComponents.includes(e) || this.ExcludeComponents.push(e), this.CachedComponents.splice(this.CachedComponents.indexOf(e), 1),
|
|
803
|
+
this.ExcludeComponents.includes(e) || this.ExcludeComponents.push(e), this.CachedComponents.splice(this.CachedComponents.indexOf(e), 1), Ie.delete(e);
|
|
800
804
|
},
|
|
801
805
|
/**
|
|
802
806
|
* 路由路径层级查询,返回面包屑
|
|
@@ -809,15 +813,15 @@ const $a = (e) => {
|
|
|
809
813
|
}
|
|
810
814
|
return t.reverse();
|
|
811
815
|
},
|
|
812
|
-
|
|
816
|
+
clean() {
|
|
813
817
|
this.appInfo = {
|
|
814
818
|
Id: "",
|
|
815
819
|
Name: "",
|
|
816
820
|
AppCode: "",
|
|
817
821
|
Version: "",
|
|
818
822
|
Host: "",
|
|
819
|
-
Source:
|
|
820
|
-
Action:
|
|
823
|
+
Source: Ce.Manual,
|
|
824
|
+
Action: Ue.App,
|
|
821
825
|
Path: "",
|
|
822
826
|
Icon: "",
|
|
823
827
|
Routes: [],
|
|
@@ -827,15 +831,11 @@ const $a = (e) => {
|
|
|
827
831
|
}, this.CachedComponents.splice(0, this.CachedComponents.length), this.ExcludeComponents.splice(0, this.ExcludeComponents.length), this.appList.splice(0, this.appList.length), this.menuLoaded = !1;
|
|
828
832
|
},
|
|
829
833
|
logout() {
|
|
830
|
-
this.
|
|
834
|
+
this.clean(), Y.push({ path: se + "#/" }), Ne() && D.value && D.value.mainAppPush && D.value.mainAppPush(se + "#/");
|
|
831
835
|
}
|
|
832
836
|
},
|
|
833
|
-
persist:
|
|
834
|
-
|
|
835
|
-
storage: localStorage,
|
|
836
|
-
pick: ["appList"]
|
|
837
|
-
}
|
|
838
|
-
}), Ua = "userInfoStore", Xe = "Token解析失败", _e = "登录过期,请重新登录", Me = {
|
|
837
|
+
persist: !1
|
|
838
|
+
}), Xe = "Token解析失败", Fe = "登录过期,请重新登录", $e = {
|
|
839
839
|
login: {
|
|
840
840
|
api: "PLATFORM_API",
|
|
841
841
|
url: "/openapi/LoginSrv/login",
|
|
@@ -855,23 +855,25 @@ const $a = (e) => {
|
|
|
855
855
|
}
|
|
856
856
|
}, _a = (e) => {
|
|
857
857
|
let t = {
|
|
858
|
-
Option: {
|
|
858
|
+
Option: {
|
|
859
|
+
Mode: "MicroApp"
|
|
860
|
+
},
|
|
859
861
|
Query: e
|
|
860
862
|
};
|
|
861
|
-
return
|
|
863
|
+
return K($e.login, t).then((a) => (a == null ? void 0 : a.status) === E.SUCCESS ? a : null);
|
|
862
864
|
}, Ka = (e) => {
|
|
863
865
|
let t = {
|
|
864
866
|
Query: {
|
|
865
867
|
AppId: e
|
|
866
868
|
}
|
|
867
869
|
};
|
|
868
|
-
return
|
|
870
|
+
return K($e.auth, t).then((a) => (a == null ? void 0 : a.status) === E.SUCCESS ? a.data : (S.error("获取授权信息失败," + (a == null ? void 0 : a.msg)), null));
|
|
869
871
|
}, Ha = () => {
|
|
870
872
|
let e = {
|
|
871
873
|
Option: {},
|
|
872
874
|
Query: {}
|
|
873
875
|
};
|
|
874
|
-
return
|
|
876
|
+
return K($e.logout, e).then((t) => (t == null ? void 0 : t.status) === E.SUCCESS ? t.data : null);
|
|
875
877
|
}, Qa = (e) => {
|
|
876
878
|
try {
|
|
877
879
|
const a = JSON.parse(atob(e.split(".")[1])).exp;
|
|
@@ -879,20 +881,20 @@ const $a = (e) => {
|
|
|
879
881
|
} catch (t) {
|
|
880
882
|
return console.error(Xe, t), !0;
|
|
881
883
|
}
|
|
882
|
-
},
|
|
884
|
+
}, _e = (e, t) => e == "" ? (S.error(Fe, {
|
|
883
885
|
duration: 3e3,
|
|
884
886
|
onClose: t
|
|
885
|
-
}), !1) : Qa(e) ? (S.error(
|
|
887
|
+
}), !1) : Qa(e) ? (S.error(Fe, {
|
|
886
888
|
duration: 3e3,
|
|
887
889
|
onClose: t
|
|
888
|
-
}), !1) : !0,
|
|
890
|
+
}), !1) : !0, Va = (e) => {
|
|
889
891
|
try {
|
|
890
892
|
const t = JSON.parse(atob(e.token.split(".")[1]));
|
|
891
893
|
return t.user = JSON.parse(t.user), e.UserInfo = t.user, !0;
|
|
892
894
|
} catch (t) {
|
|
893
895
|
return console.error(Xe, t), !1;
|
|
894
896
|
}
|
|
895
|
-
},
|
|
897
|
+
}, L = u(""), V = u(null), _ = Z("userInfo", {
|
|
896
898
|
state: () => ({
|
|
897
899
|
isLogin: !1,
|
|
898
900
|
userInfo: {
|
|
@@ -900,18 +902,12 @@ const $a = (e) => {
|
|
|
900
902
|
Name: "",
|
|
901
903
|
Code: "",
|
|
902
904
|
TenantId: null,
|
|
903
|
-
UserLevel: "
|
|
905
|
+
UserLevel: ""
|
|
904
906
|
},
|
|
905
907
|
token: "",
|
|
906
908
|
refreshToken: ""
|
|
907
909
|
}),
|
|
908
910
|
actions: {
|
|
909
|
-
/**
|
|
910
|
-
* 启动时初始化用户信息
|
|
911
|
-
*/
|
|
912
|
-
init() {
|
|
913
|
-
this.token && this.isLogin ? (ye(this.token, () => this.clean()), X(this.token)) : this.clean();
|
|
914
|
-
},
|
|
915
911
|
/**
|
|
916
912
|
* 登录操作
|
|
917
913
|
* @param loginInfo 登录信息
|
|
@@ -924,17 +920,17 @@ const $a = (e) => {
|
|
|
924
920
|
if (s.errno)
|
|
925
921
|
return s;
|
|
926
922
|
{
|
|
927
|
-
const
|
|
928
|
-
if (this.token =
|
|
923
|
+
const r = a.data;
|
|
924
|
+
if (this.token = r.token, be(this.token), this.isLogin = !0, Va(r))
|
|
929
925
|
this.userInfo = {
|
|
930
926
|
...this.userInfo,
|
|
931
|
-
...
|
|
932
|
-
};
|
|
927
|
+
...r.UserInfo
|
|
928
|
+
}, L.value = r.UserInfo.UserLevel;
|
|
933
929
|
else {
|
|
934
930
|
S.error("用户信息解析失败");
|
|
935
931
|
return;
|
|
936
932
|
}
|
|
937
|
-
t && (
|
|
933
|
+
t && N().toDefaultApp();
|
|
938
934
|
}
|
|
939
935
|
}
|
|
940
936
|
},
|
|
@@ -946,13 +942,12 @@ const $a = (e) => {
|
|
|
946
942
|
async getRolePermits(e) {
|
|
947
943
|
if (!this.isLogin || !this.token)
|
|
948
944
|
return !1;
|
|
949
|
-
if (
|
|
945
|
+
if (V.value && V.value.appId === e)
|
|
950
946
|
return !0;
|
|
951
947
|
try {
|
|
952
948
|
const t = await Ka(e);
|
|
953
|
-
return t ? (
|
|
949
|
+
return t ? (V.value = {
|
|
954
950
|
appId: e,
|
|
955
|
-
level: this.userInfo.UserLevel,
|
|
956
951
|
permits: t.permits || [],
|
|
957
952
|
lastTime: t.lastTime
|
|
958
953
|
}, !0) : !1;
|
|
@@ -966,16 +961,18 @@ const $a = (e) => {
|
|
|
966
961
|
* @returns 是否有角色权限
|
|
967
962
|
*/
|
|
968
963
|
hasRole(e) {
|
|
969
|
-
return
|
|
964
|
+
return L.value ? Array.isArray(e) ? e.includes(L.value) : L.value === e : !1;
|
|
970
965
|
},
|
|
971
966
|
/**
|
|
972
967
|
* 检查功能权限
|
|
968
|
+
* @param url 所在页面
|
|
973
969
|
* @param permitCode 资源权限编码
|
|
974
970
|
* @returns 是否有功能权限
|
|
975
971
|
*/
|
|
976
972
|
hasPermit(e, t) {
|
|
977
|
-
var
|
|
978
|
-
|
|
973
|
+
var s;
|
|
974
|
+
const a = V.value;
|
|
975
|
+
return !a || !a.permits ? !1 : ((s = a.permits[e]) == null ? void 0 : s.includes(t)) ?? !1;
|
|
979
976
|
},
|
|
980
977
|
/**
|
|
981
978
|
* 获取用户信息
|
|
@@ -984,25 +981,50 @@ const $a = (e) => {
|
|
|
984
981
|
getUserInfo() {
|
|
985
982
|
return this.userInfo;
|
|
986
983
|
},
|
|
984
|
+
/**
|
|
985
|
+
* 设置用户信息
|
|
986
|
+
* 仅允许设置一次,启动时设置,避免通过其它方式设置
|
|
987
|
+
* @param userInfo 用户信息
|
|
988
|
+
* @param token 用户Token
|
|
989
|
+
*/
|
|
987
990
|
setUserInfo(e, t) {
|
|
988
|
-
if (!
|
|
991
|
+
if (!_e(t)) {
|
|
989
992
|
this.clean();
|
|
990
993
|
return;
|
|
991
994
|
}
|
|
992
|
-
this.userInfo = {
|
|
995
|
+
L.value || (L.value = e.UserLevel, this.userInfo = {
|
|
993
996
|
...this.userInfo,
|
|
994
997
|
...e
|
|
995
|
-
}, this.token = t,
|
|
998
|
+
}, this.token = t, be(this.token), this.isLogin = !0);
|
|
996
999
|
},
|
|
997
1000
|
/**
|
|
998
1001
|
* 获取用户Token
|
|
999
1002
|
* @returns 用户Token
|
|
1000
1003
|
*/
|
|
1001
1004
|
getToken() {
|
|
1002
|
-
return
|
|
1005
|
+
return _e(this.token, () => {
|
|
1003
1006
|
this.clean(), this.logout();
|
|
1004
1007
|
}) ? this.token : "";
|
|
1005
1008
|
},
|
|
1009
|
+
/**
|
|
1010
|
+
* 是否超级管理员
|
|
1011
|
+
*/
|
|
1012
|
+
isSuperAdmin() {
|
|
1013
|
+
return L.value === "Super";
|
|
1014
|
+
},
|
|
1015
|
+
/**
|
|
1016
|
+
* 是否管理员
|
|
1017
|
+
*/
|
|
1018
|
+
isAdmin() {
|
|
1019
|
+
return L.value === "Super" || L.value === "Admin";
|
|
1020
|
+
},
|
|
1021
|
+
/**
|
|
1022
|
+
* 获取用户级别
|
|
1023
|
+
* @returns 用户级别
|
|
1024
|
+
*/
|
|
1025
|
+
getUserLevel() {
|
|
1026
|
+
return L.value;
|
|
1027
|
+
},
|
|
1006
1028
|
/*
|
|
1007
1029
|
* 清理登录信息
|
|
1008
1030
|
*/
|
|
@@ -1013,7 +1035,7 @@ const $a = (e) => {
|
|
|
1013
1035
|
Code: "",
|
|
1014
1036
|
TenantId: "",
|
|
1015
1037
|
UserLevel: ""
|
|
1016
|
-
}, this.token = "",
|
|
1038
|
+
}, this.token = "", be(this.token), this.isLogin = !1, V.value = null, L.value = "", N().clean(), Promise.resolve();
|
|
1017
1039
|
},
|
|
1018
1040
|
/**
|
|
1019
1041
|
* 登出操作
|
|
@@ -1028,21 +1050,17 @@ const $a = (e) => {
|
|
|
1028
1050
|
await this.clean(), setTimeout(async () => {
|
|
1029
1051
|
S.success("已退出登录");
|
|
1030
1052
|
}, 1e3), setTimeout(async () => {
|
|
1031
|
-
(
|
|
1053
|
+
N().logout();
|
|
1032
1054
|
}, 2e3);
|
|
1033
1055
|
}
|
|
1034
1056
|
return Promise.resolve();
|
|
1035
1057
|
}
|
|
1036
1058
|
},
|
|
1037
|
-
persist:
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
pick: ["isLogin", "userInfo", "token", "refreshToken"]
|
|
1041
|
-
}
|
|
1042
|
-
}), Ct = (e, t) => {
|
|
1043
|
-
const a = Q();
|
|
1059
|
+
persist: !1
|
|
1060
|
+
}), $t = (e, t) => {
|
|
1061
|
+
const a = _();
|
|
1044
1062
|
return e.filter((s) => {
|
|
1045
|
-
if (s.role && !a.hasRole(s.role) || s.permit && !a.hasPermit(
|
|
1063
|
+
if (s.role && !a.hasRole(s.role) || s.permit && !a.hasPermit(Y.currentRoute.value.path, s.permit))
|
|
1046
1064
|
return !1;
|
|
1047
1065
|
if (!t) {
|
|
1048
1066
|
if (s.visible === !1)
|
|
@@ -1054,26 +1072,26 @@ const $a = (e) => {
|
|
|
1054
1072
|
});
|
|
1055
1073
|
}, Dt = (e, t) => {
|
|
1056
1074
|
const a = t == null ? void 0 : t.filter((s) => {
|
|
1057
|
-
const
|
|
1058
|
-
(
|
|
1075
|
+
const r = e.find(
|
|
1076
|
+
(n) => n.dataIndex === s.dataIndex || n.key === s.key || n.title === s.title
|
|
1059
1077
|
);
|
|
1060
|
-
return
|
|
1078
|
+
return r ? { ...s, ...r } : !1;
|
|
1061
1079
|
});
|
|
1062
1080
|
return [...a || [], ...e.filter((s) => !(a != null && a.includes(s)))];
|
|
1063
|
-
},
|
|
1081
|
+
}, Ga = (e) => (e.remotePage = !1, Ze(e).then((t) => t.rows)), Ze = (e) => {
|
|
1064
1082
|
e.gridQuery || (e.gridQuery = {});
|
|
1065
1083
|
const t = e.remotePage ? "find" : "list";
|
|
1066
|
-
return
|
|
1084
|
+
return ke(e, {
|
|
1067
1085
|
urlKey: t,
|
|
1068
1086
|
url: e.gridUrl,
|
|
1069
1087
|
params: e.gridQuery,
|
|
1070
1088
|
loadingState: e.isGridLoading,
|
|
1071
1089
|
processParams: (a) => {
|
|
1072
|
-
var
|
|
1073
|
-
return e.remotePage && (a.Query.$limit = [(e.pageNo.value - 1) * e.pageSize.value, e.pageSize.value]),
|
|
1090
|
+
var r;
|
|
1091
|
+
return e.remotePage && (a.Query.$limit = [(e.pageNo.value - 1) * e.pageSize.value, e.pageSize.value]), Pe((r = e.gridUrl) == null ? void 0 : r.params, a, e.gridQuery);
|
|
1074
1092
|
}
|
|
1075
1093
|
}).then((a) => {
|
|
1076
|
-
if ((a == null ? void 0 : a.status) ===
|
|
1094
|
+
if ((a == null ? void 0 : a.status) === E.SUCCESS) {
|
|
1077
1095
|
let s = a.data;
|
|
1078
1096
|
return s.rows ? (e.tableData.value = s.rows, e.total.value = s.total) : (e.tableData.value = a.data, e.total.value = a.data.length, s = {
|
|
1079
1097
|
total: e.total.value,
|
|
@@ -1085,7 +1103,7 @@ const $a = (e) => {
|
|
|
1085
1103
|
rows: []
|
|
1086
1104
|
};
|
|
1087
1105
|
});
|
|
1088
|
-
}, qa = (e, t, a = {}) =>
|
|
1106
|
+
}, qa = (e, t, a = {}) => qe(e, {
|
|
1089
1107
|
urlKey: "update",
|
|
1090
1108
|
url: e.updateUrl,
|
|
1091
1109
|
params: {
|
|
@@ -1094,29 +1112,29 @@ const $a = (e) => {
|
|
|
1094
1112
|
},
|
|
1095
1113
|
loadingState: e.isGridSaving,
|
|
1096
1114
|
...a
|
|
1097
|
-
}).then((s) => ((s == null ? void 0 : s.status) ===
|
|
1115
|
+
}).then((s) => ((s == null ? void 0 : s.status) === E.SUCCESS && setTimeout(() => {
|
|
1098
1116
|
e.reload.value = !0, e.afterUpdate && e.afterUpdate(t);
|
|
1099
|
-
}, 50), s)),
|
|
1117
|
+
}, 50), s)), Ut = (e, t) => {
|
|
1100
1118
|
const a = {};
|
|
1101
1119
|
return a[e.primaryKey] = t[e.primaryKey], a[e.statusKey] = t[e.statusKey], qa(e, a, {
|
|
1102
1120
|
loadingText: !1,
|
|
1103
1121
|
hideErrorToast: !0
|
|
1104
1122
|
});
|
|
1105
|
-
}, ea = async (e, t, a) => await
|
|
1123
|
+
}, ea = async (e, t, a) => await ke(e, {
|
|
1106
1124
|
urlKey: "detail",
|
|
1107
1125
|
url: a,
|
|
1108
1126
|
params: t,
|
|
1109
1127
|
loadingState: e.isGridLoading
|
|
1110
|
-
}),
|
|
1128
|
+
}), Ct = (e, t) => {
|
|
1111
1129
|
const a = t;
|
|
1112
|
-
return ea(e, { [e.primaryKey]: a[e.primaryKey] }).then((s) => ((s == null ? void 0 : s.status) ===
|
|
1113
|
-
},
|
|
1130
|
+
return ea(e, { [e.primaryKey]: a[e.primaryKey] }).then((s) => ((s == null ? void 0 : s.status) === E.SUCCESS && s.data && (e.expandRows.value[a[e.primaryKey]] = s), s));
|
|
1131
|
+
}, Nt = (e, t) => {
|
|
1114
1132
|
let a = e.editor;
|
|
1115
|
-
e.rowData.value = t, a && (
|
|
1116
|
-
},
|
|
1133
|
+
e.rowData.value = t, a && (Be(a, t), a.visible.value = !0);
|
|
1134
|
+
}, Ft = (e, t) => Pa(e, t, {
|
|
1117
1135
|
url: e.deleteUrl,
|
|
1118
1136
|
primaryKey: e.primaryKey
|
|
1119
|
-
}).then((a) => ((a == null ? void 0 : a.status) ===
|
|
1137
|
+
}).then((a) => ((a == null ? void 0 : a.status) === E.SUCCESS && setTimeout(() => {
|
|
1120
1138
|
e.reload.value = !0, e.afterDelete && !Array.isArray(t) && e.afterDelete(t);
|
|
1121
1139
|
}, 50), a)), y = {
|
|
1122
1140
|
PageOption: {
|
|
@@ -1128,12 +1146,12 @@ const $a = (e) => {
|
|
|
1128
1146
|
primaryKey: "Id",
|
|
1129
1147
|
statusKey: "Enabled",
|
|
1130
1148
|
remotePage: !0,
|
|
1131
|
-
tableSize:
|
|
1132
|
-
selectable:
|
|
1133
|
-
searchBar:
|
|
1134
|
-
pageSize:
|
|
1135
|
-
rowExpand:
|
|
1136
|
-
buttons:
|
|
1149
|
+
tableSize: u("small"),
|
|
1150
|
+
selectable: u(!1),
|
|
1151
|
+
searchBar: u(!0),
|
|
1152
|
+
pageSize: u(10),
|
|
1153
|
+
rowExpand: u(!1),
|
|
1154
|
+
buttons: u(["New"]),
|
|
1137
1155
|
tools: ["Reload", "RowHeight", "TableHeadset"],
|
|
1138
1156
|
operates: ["Edit", "Delete"]
|
|
1139
1157
|
},
|
|
@@ -1147,7 +1165,7 @@ const $a = (e) => {
|
|
|
1147
1165
|
TreeOption: {
|
|
1148
1166
|
autoload: !0
|
|
1149
1167
|
}
|
|
1150
|
-
},
|
|
1168
|
+
}, _t = (e) => {
|
|
1151
1169
|
y.PageOption = {
|
|
1152
1170
|
...y.PageOption,
|
|
1153
1171
|
...e.pageOption
|
|
@@ -1166,66 +1184,66 @@ const $a = (e) => {
|
|
|
1166
1184
|
...y.EditorOption,
|
|
1167
1185
|
name: "",
|
|
1168
1186
|
default: a ? JSON.parse(JSON.stringify(a)) : void 0,
|
|
1169
|
-
visible:
|
|
1187
|
+
visible: u(!1),
|
|
1170
1188
|
page: t,
|
|
1171
|
-
formData:
|
|
1172
|
-
formRules:
|
|
1173
|
-
ruleResults:
|
|
1174
|
-
updateData:
|
|
1189
|
+
formData: u(a ? JSON.parse(JSON.stringify(a)) : void 0),
|
|
1190
|
+
formRules: u(s),
|
|
1191
|
+
ruleResults: u({}),
|
|
1192
|
+
updateData: u(void 0),
|
|
1175
1193
|
saveUrl: e.urls.save,
|
|
1176
1194
|
detailUrl: e.urls.detail,
|
|
1177
|
-
isFormSaving:
|
|
1178
|
-
isFormLoading:
|
|
1195
|
+
isFormSaving: u(!1),
|
|
1196
|
+
isFormLoading: u(!1)
|
|
1179
1197
|
}
|
|
1180
1198
|
}), Ba = (e, t, a) => {
|
|
1181
1199
|
const s = {
|
|
1182
1200
|
...y.GridOption,
|
|
1183
|
-
tableSize:
|
|
1184
|
-
selectable:
|
|
1185
|
-
searchBar:
|
|
1186
|
-
pageSize:
|
|
1187
|
-
rowExpand:
|
|
1188
|
-
buttons:
|
|
1201
|
+
tableSize: u(y.GridOption.tableSize.value),
|
|
1202
|
+
selectable: u(y.GridOption.selectable.value),
|
|
1203
|
+
searchBar: u(y.GridOption.searchBar.value),
|
|
1204
|
+
pageSize: u(y.GridOption.pageSize.value),
|
|
1205
|
+
rowExpand: u(y.GridOption.rowExpand.value),
|
|
1206
|
+
buttons: u([...y.GridOption.buttons.value]),
|
|
1189
1207
|
tools: [...y.GridOption.tools],
|
|
1190
1208
|
operates: [...y.GridOption.operates],
|
|
1191
|
-
columns:
|
|
1192
|
-
reload:
|
|
1193
|
-
pageNo:
|
|
1194
|
-
total:
|
|
1209
|
+
columns: u(a || []),
|
|
1210
|
+
reload: u(!1),
|
|
1211
|
+
pageNo: u(1),
|
|
1212
|
+
total: u(0),
|
|
1195
1213
|
page: t,
|
|
1196
|
-
selectKeys:
|
|
1197
|
-
selectRows:
|
|
1198
|
-
rowData:
|
|
1214
|
+
selectKeys: u([]),
|
|
1215
|
+
selectRows: u([]),
|
|
1216
|
+
rowData: u(void 0),
|
|
1199
1217
|
gridQuery: {},
|
|
1200
|
-
tableData:
|
|
1201
|
-
expandRows:
|
|
1202
|
-
isGridLoading:
|
|
1203
|
-
isGridSaving:
|
|
1218
|
+
tableData: Ve(void 0),
|
|
1219
|
+
expandRows: u({}),
|
|
1220
|
+
isGridLoading: u(!1),
|
|
1221
|
+
isGridSaving: u(!1),
|
|
1204
1222
|
gridUrl: e.urls.list || e.urls.find,
|
|
1205
1223
|
updateUrl: e.urls.update,
|
|
1206
1224
|
deleteUrl: e.urls.delete
|
|
1207
1225
|
};
|
|
1208
|
-
return
|
|
1226
|
+
return R(
|
|
1209
1227
|
() => s.reload.value,
|
|
1210
|
-
(
|
|
1211
|
-
|
|
1228
|
+
(r) => {
|
|
1229
|
+
r && (setTimeout(() => {
|
|
1212
1230
|
s.reload.value = !1;
|
|
1213
|
-
}, 1), s.remotePage ? Ze(s) :
|
|
1231
|
+
}, 1), s.remotePage ? Ze(s) : Ga(s));
|
|
1214
1232
|
}
|
|
1215
1233
|
), {
|
|
1216
1234
|
gridCtrl: s
|
|
1217
1235
|
};
|
|
1218
|
-
},
|
|
1236
|
+
}, Kt = (e, t) => {
|
|
1219
1237
|
const a = {
|
|
1220
1238
|
...y.TreeOption,
|
|
1221
|
-
reload:
|
|
1239
|
+
reload: u(!1),
|
|
1222
1240
|
page: t,
|
|
1223
|
-
node:
|
|
1241
|
+
node: u(void 0),
|
|
1224
1242
|
url: e.urls.tree,
|
|
1225
|
-
data:
|
|
1226
|
-
isTreeLoading:
|
|
1243
|
+
data: Ve(void 0),
|
|
1244
|
+
isTreeLoading: u(!1)
|
|
1227
1245
|
};
|
|
1228
|
-
return
|
|
1246
|
+
return R(
|
|
1229
1247
|
() => a.reload.value,
|
|
1230
1248
|
(s) => {
|
|
1231
1249
|
s && (setTimeout(() => {
|
|
@@ -1235,23 +1253,23 @@ const $a = (e) => {
|
|
|
1235
1253
|
), {
|
|
1236
1254
|
treeCtrl: a
|
|
1237
1255
|
};
|
|
1238
|
-
},
|
|
1256
|
+
}, Ht = (e, t, a) => {
|
|
1239
1257
|
for (const o in e.urls)
|
|
1240
1258
|
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));
|
|
1241
1259
|
const s = {
|
|
1242
1260
|
...y.PageOption,
|
|
1243
1261
|
...e
|
|
1244
|
-
}, { editorCtrl:
|
|
1245
|
-
return s.editor =
|
|
1262
|
+
}, { editorCtrl: r } = ja(e, s, t, a), { gridCtrl: n } = Ba(e, s);
|
|
1263
|
+
return s.editor = r, s.grid = n, n.editor = r, n.tools = ["Reload", "RowHeight", "TableHeadset", "Fullscreen"], r.grid = n, {
|
|
1246
1264
|
pageCtrl: s,
|
|
1247
|
-
editorCtrl:
|
|
1248
|
-
gridCtrl:
|
|
1265
|
+
editorCtrl: r,
|
|
1266
|
+
gridCtrl: n
|
|
1249
1267
|
};
|
|
1250
1268
|
};
|
|
1251
1269
|
var aa = /* @__PURE__ */ ((e) => (e.SelectReload = "Select.Reload", e.RadioReload = "Radio.Reload", e.CheckboxReload = "Checkbox.Reload", e.TreeSelectReload = "TreeSelect.Reload", e.TreeCheckReload = "TreeCheck.Reload", e))(aa || {});
|
|
1252
1270
|
class Ja {
|
|
1253
1271
|
constructor() {
|
|
1254
|
-
|
|
1272
|
+
k(this, "listeners", {});
|
|
1255
1273
|
}
|
|
1256
1274
|
// 检查事件名是否符合前缀
|
|
1257
1275
|
isValidPrefix(t) {
|
|
@@ -1295,51 +1313,51 @@ class Ja {
|
|
|
1295
1313
|
this.listeners[t] && this.listeners[t].forEach((s) => s(t, ...a));
|
|
1296
1314
|
}
|
|
1297
1315
|
}
|
|
1298
|
-
const
|
|
1299
|
-
if (s && t.reloadEvent && (s.reloadHandler = (o,
|
|
1300
|
-
za(
|
|
1301
|
-
},
|
|
1302
|
-
|
|
1316
|
+
const re = new Ja(), he = (e, t, a, s, r, n) => {
|
|
1317
|
+
if (s && t.reloadEvent && (s.reloadHandler = (o, l) => {
|
|
1318
|
+
za(r, t, l, a);
|
|
1319
|
+
}, re.on(t.reloadEvent, s.reloadHandler)), t.data)
|
|
1320
|
+
R(
|
|
1303
1321
|
() => t.data,
|
|
1304
1322
|
() => {
|
|
1305
|
-
|
|
1323
|
+
De(t, t.data, a, !0);
|
|
1306
1324
|
},
|
|
1307
1325
|
{ deep: !0, immediate: !0 }
|
|
1308
1326
|
);
|
|
1309
|
-
else if (
|
|
1310
|
-
e !== !1 && ta(
|
|
1327
|
+
else if (r && r.url)
|
|
1328
|
+
e !== !1 && ta(r, t, n ?? {}, a);
|
|
1311
1329
|
else {
|
|
1312
|
-
const o =
|
|
1330
|
+
const o = u(G(U.LabelText, ""));
|
|
1313
1331
|
S.error("`" + o.value + "` 未配置选项数据!", {
|
|
1314
1332
|
duration: 5e3
|
|
1315
1333
|
});
|
|
1316
1334
|
}
|
|
1317
|
-
},
|
|
1335
|
+
}, De = (e, t, a, s) => {
|
|
1318
1336
|
if (!t || t.length === 0) {
|
|
1319
1337
|
a.value = [];
|
|
1320
1338
|
return;
|
|
1321
1339
|
}
|
|
1322
1340
|
if (s) {
|
|
1323
|
-
const
|
|
1341
|
+
const r = {
|
|
1324
1342
|
...e.fieldMap
|
|
1325
1343
|
};
|
|
1326
|
-
t =
|
|
1344
|
+
t = xa(r, t);
|
|
1327
1345
|
}
|
|
1328
1346
|
t = JSON.parse(JSON.stringify(t)), e.all && t.unshift({
|
|
1329
1347
|
label: "全部",
|
|
1330
1348
|
value: void 0
|
|
1331
1349
|
}), a.value = t;
|
|
1332
1350
|
}, za = (e, t, a, s) => {
|
|
1333
|
-
Array.isArray(a) ?
|
|
1334
|
-
},
|
|
1335
|
-
t && e.reloadEvent && t.reloadHandler &&
|
|
1351
|
+
Array.isArray(a) ? De(t, a, s, !0) : ta(e, t, { Query: a }, s);
|
|
1352
|
+
}, me = (e, t) => {
|
|
1353
|
+
t && e.reloadEvent && t.reloadHandler && re.off(e.reloadEvent, t.reloadHandler);
|
|
1336
1354
|
}, ta = (e, t, a, s) => {
|
|
1337
|
-
const
|
|
1338
|
-
Wa(e, t.fieldMap,
|
|
1339
|
-
|
|
1355
|
+
const r = Pe(e.params, a, t.params);
|
|
1356
|
+
Wa(e, t.fieldMap, r).then((n) => {
|
|
1357
|
+
De(t, n, s, !1);
|
|
1340
1358
|
});
|
|
1341
1359
|
}, Wa = (e, t, a) => {
|
|
1342
|
-
const { fieldMap: s, ...
|
|
1360
|
+
const { fieldMap: s, ...r } = e, o = {
|
|
1343
1361
|
...{
|
|
1344
1362
|
url: "",
|
|
1345
1363
|
cacheTime: 6e4,
|
|
@@ -1348,49 +1366,49 @@ const ae = new Ja(), fe = (e, t, a, s, n, r) => {
|
|
|
1348
1366
|
...e.fieldMap
|
|
1349
1367
|
}
|
|
1350
1368
|
},
|
|
1351
|
-
...
|
|
1369
|
+
...r
|
|
1352
1370
|
};
|
|
1353
|
-
return o.loadingText = !1, a || (a = {}), a.Query || (a.Query = {}),
|
|
1371
|
+
return o.loadingText = !1, a || (a = {}), a.Query || (a.Query = {}), K(o, a).then((l) => (l == null ? void 0 : l.status) === E.SUCCESS && l.data ? l.data : []);
|
|
1354
1372
|
}, Ya = (e, t) => {
|
|
1355
1373
|
if (e !== void 0)
|
|
1356
1374
|
return Array.isArray(e) ? t.filter((a) => e.includes(a.value)) : t.find((a) => a.value === e);
|
|
1357
|
-
},
|
|
1375
|
+
}, xe = (e, t, a) => {
|
|
1358
1376
|
const s = t.split(".");
|
|
1359
|
-
let
|
|
1360
|
-
for (let
|
|
1361
|
-
const o = s[
|
|
1362
|
-
|
|
1377
|
+
let r = e;
|
|
1378
|
+
for (let n = 0; n < s.length - 1; n++) {
|
|
1379
|
+
const o = s[n];
|
|
1380
|
+
r[o] || (r[o] = {}), r = r[o];
|
|
1363
1381
|
}
|
|
1364
|
-
|
|
1382
|
+
r[s[s.length - 1]] = a;
|
|
1365
1383
|
}, sa = (e, t, a) => {
|
|
1366
1384
|
if (a == null) {
|
|
1367
1385
|
Object.entries(t).forEach(([s]) => {
|
|
1368
|
-
|
|
1386
|
+
xe(e, s, a);
|
|
1369
1387
|
});
|
|
1370
1388
|
return;
|
|
1371
1389
|
}
|
|
1372
|
-
Array.isArray(a) || Object.entries(t).forEach(([s,
|
|
1373
|
-
if (
|
|
1374
|
-
const
|
|
1375
|
-
|
|
1390
|
+
Array.isArray(a) || Object.entries(t).forEach(([s, r]) => {
|
|
1391
|
+
if (r.includes("${")) {
|
|
1392
|
+
const n = Aa(r, a);
|
|
1393
|
+
xe(e, s, n);
|
|
1376
1394
|
} else
|
|
1377
|
-
|
|
1395
|
+
xe(e, s, a[r]);
|
|
1378
1396
|
});
|
|
1379
|
-
},
|
|
1380
|
-
var r;
|
|
1381
|
-
s.editorCtrl && ((r = s.errInfo) != null && r.value.errClass) && ue(s.editorCtrl);
|
|
1382
|
-
const n = Ya(t, a.value);
|
|
1383
|
-
return e.formData && e.outFields && sa(e.formData, e.outFields, n), e.changeEvent && (Array.isArray(e.changeEvent) ? e.changeEvent.every((o) => {
|
|
1384
|
-
ae.emit(o, t, n);
|
|
1385
|
-
}) : ae.emit(e.changeEvent, t, n)), s.inputEmit && s.inputEmit("change", t, n), n;
|
|
1386
|
-
}, he = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((t) => t.label) : [e.label], Xa = 7 * 24 * 60 * 60 * 1e3, Se = /* @__PURE__ */ new Map(), Ke = /* @__PURE__ */ new Set(), U = f({}), Gt = U, Vt = (e) => {
|
|
1397
|
+
}, ve = (e, t, a, s) => {
|
|
1387
1398
|
var n;
|
|
1388
|
-
|
|
1389
|
-
const
|
|
1399
|
+
s.editorCtrl && ((n = s.errInfo) != null && n.value.errClass) && pe(s.editorCtrl);
|
|
1400
|
+
const r = Ya(t, a.value);
|
|
1401
|
+
return e.formData && e.outFields && sa(e.formData, e.outFields, r), e.changeEvent && (Array.isArray(e.changeEvent) ? e.changeEvent.every((o) => {
|
|
1402
|
+
re.emit(o, t, r);
|
|
1403
|
+
}) : re.emit(e.changeEvent, t, r)), s.inputEmit && s.inputEmit("change", t, r), r;
|
|
1404
|
+
}, ge = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((t) => t.label) : [e.label], Xa = 7 * 24 * 60 * 60 * 1e3, Ae = /* @__PURE__ */ new Map(), Ke = /* @__PURE__ */ new Set(), F = u({}), Qt = F, Vt = (e) => {
|
|
1405
|
+
var r;
|
|
1406
|
+
if (!e.iconUrl) return Ee;
|
|
1407
|
+
const t = u(!0), a = u("");
|
|
1390
1408
|
let s = !0;
|
|
1391
|
-
return (
|
|
1409
|
+
return (r = e.icons) != null && r.length && (s = e.icons.every((n) => F.value[n] !== void 0)), (e.icon && !F.value[e.icon] || !s) && Za(e, t).then(() => {
|
|
1392
1410
|
tt(e.iconUrl, e.monoColor || !1), t.value = !0;
|
|
1393
|
-
}),
|
|
1411
|
+
}), X({
|
|
1394
1412
|
props: {
|
|
1395
1413
|
icon: {
|
|
1396
1414
|
type: String
|
|
@@ -1416,48 +1434,48 @@ const ae = new Ja(), fe = (e, t, a, s, n, r) => {
|
|
|
1416
1434
|
}
|
|
1417
1435
|
},
|
|
1418
1436
|
emits: ["update:iconIndex"],
|
|
1419
|
-
setup(
|
|
1420
|
-
const
|
|
1421
|
-
|
|
1437
|
+
setup(n, { emit: o }) {
|
|
1438
|
+
const l = u(n.icon), i = u(0), c = () => {
|
|
1439
|
+
n.icons && i.value++;
|
|
1422
1440
|
};
|
|
1423
|
-
return
|
|
1424
|
-
() =>
|
|
1425
|
-
(
|
|
1426
|
-
|
|
1441
|
+
return R(
|
|
1442
|
+
() => n.iconIndex,
|
|
1443
|
+
(f) => {
|
|
1444
|
+
f !== void 0 && (i.value = f);
|
|
1427
1445
|
},
|
|
1428
1446
|
{ immediate: !0 }
|
|
1429
|
-
),
|
|
1430
|
-
() =>
|
|
1431
|
-
(
|
|
1432
|
-
|
|
1447
|
+
), R(
|
|
1448
|
+
() => i.value,
|
|
1449
|
+
(f) => {
|
|
1450
|
+
n.icons && (f >= n.icons.length && (i.value = 0), l.value = n.icons[i.value], ee(a, l, l.value), o("update:iconIndex", i.value));
|
|
1433
1451
|
},
|
|
1434
1452
|
{ immediate: !0 }
|
|
1435
|
-
),
|
|
1436
|
-
() =>
|
|
1453
|
+
), R(
|
|
1454
|
+
() => F.value,
|
|
1437
1455
|
() => {
|
|
1438
|
-
|
|
1456
|
+
ee(a, l, l.value);
|
|
1439
1457
|
},
|
|
1440
1458
|
{ deep: !0 }
|
|
1441
|
-
),
|
|
1442
|
-
() =>
|
|
1443
|
-
(
|
|
1444
|
-
|
|
1459
|
+
), R(
|
|
1460
|
+
() => n.icon,
|
|
1461
|
+
(f) => {
|
|
1462
|
+
ee(a, l, f);
|
|
1445
1463
|
}
|
|
1446
|
-
),
|
|
1464
|
+
), ee(a, l, l.value), { isLoaded: t, Icon: a, handleClick: c };
|
|
1447
1465
|
},
|
|
1448
1466
|
render() {
|
|
1449
1467
|
if (!t.value)
|
|
1450
|
-
return
|
|
1451
|
-
let
|
|
1452
|
-
Array.isArray(
|
|
1453
|
-
let
|
|
1454
|
-
return !/\bw-/.test(o) && !/$w-/.test(o) &&
|
|
1468
|
+
return Ee;
|
|
1469
|
+
let n = this.class, o = "";
|
|
1470
|
+
Array.isArray(n) ? o = n.join(" ") : typeof n == "string" && (o = n);
|
|
1471
|
+
let l = [o];
|
|
1472
|
+
return !/\bw-/.test(o) && !/$w-/.test(o) && l.push("w-4"), !/\bh-/.test(o) && !/$h-/.test(o) && l.push("h-4"), a.value ? C(Qe(a.value), {
|
|
1455
1473
|
onClick: this.$props.clickable ? this.handleClick : void 0,
|
|
1456
|
-
class: `${
|
|
1474
|
+
class: `${l.join(" ")}`,
|
|
1457
1475
|
style: {
|
|
1458
1476
|
fill: "currentColor",
|
|
1459
1477
|
cursor: this.$props.clickable ? "pointer" : "default",
|
|
1460
|
-
transform:
|
|
1478
|
+
transform: rt(this.angle, this.flip)
|
|
1461
1479
|
}
|
|
1462
1480
|
}) : C("div", { class: "w-[14px] h-[14px]" });
|
|
1463
1481
|
}
|
|
@@ -1466,16 +1484,16 @@ const ae = new Ja(), fe = (e, t, a, s, n, r) => {
|
|
|
1466
1484
|
let a = e.iconUrl;
|
|
1467
1485
|
if (!a)
|
|
1468
1486
|
return console.error("图标库地址不能为空"), Promise.resolve();
|
|
1469
|
-
if (
|
|
1487
|
+
if (Ae.has(a))
|
|
1470
1488
|
return Promise.resolve();
|
|
1471
|
-
const s =
|
|
1489
|
+
const s = na(a);
|
|
1472
1490
|
if (s)
|
|
1473
|
-
return new Promise(async (
|
|
1491
|
+
return new Promise(async (n) => (ra(s.scriptContent), n()));
|
|
1474
1492
|
t.value = !1;
|
|
1475
|
-
const
|
|
1476
|
-
await et(a, e.monoColor || !1),
|
|
1493
|
+
const r = new Promise(async (n) => {
|
|
1494
|
+
await et(a, e.monoColor || !1), n(), Ae.delete(a);
|
|
1477
1495
|
});
|
|
1478
|
-
return
|
|
1496
|
+
return Ae.set(a, r), r;
|
|
1479
1497
|
}, et = async (e, t) => {
|
|
1480
1498
|
try {
|
|
1481
1499
|
const a = await fetch(e);
|
|
@@ -1485,53 +1503,53 @@ const ae = new Ja(), fe = (e, t, a, s, n, r) => {
|
|
|
1485
1503
|
}
|
|
1486
1504
|
let s = await a.text();
|
|
1487
1505
|
s = t ? s.replace(/fill=\"[^\"]*\"/gi, "") : s;
|
|
1488
|
-
let
|
|
1489
|
-
const
|
|
1490
|
-
if (
|
|
1491
|
-
let o =
|
|
1506
|
+
let r = /^window\.(\w+)\s*=/;
|
|
1507
|
+
const n = s.match(r);
|
|
1508
|
+
if (n && n.length > 1) {
|
|
1509
|
+
let o = n[1];
|
|
1492
1510
|
at(e, o, t, s);
|
|
1493
1511
|
}
|
|
1494
|
-
|
|
1512
|
+
ra(s);
|
|
1495
1513
|
return;
|
|
1496
1514
|
} catch (a) {
|
|
1497
1515
|
return console.error("网络异常,无法加载图标库:", a), null;
|
|
1498
1516
|
}
|
|
1499
|
-
},
|
|
1517
|
+
}, ra = (e) => {
|
|
1500
1518
|
const t = document.createElement("script");
|
|
1501
1519
|
t.textContent = e, document.head.appendChild(t);
|
|
1502
1520
|
}, at = (e, t, a, s) => {
|
|
1503
|
-
let
|
|
1504
|
-
const
|
|
1521
|
+
let r = `icon_cache:${e}`;
|
|
1522
|
+
const n = {
|
|
1505
1523
|
windowKey: t,
|
|
1506
1524
|
monoColor: a,
|
|
1507
1525
|
scriptContent: s,
|
|
1508
1526
|
expireTime: Date.now() + Xa
|
|
1509
1527
|
// 缓存时间:7天
|
|
1510
1528
|
};
|
|
1511
|
-
localStorage.setItem(
|
|
1512
|
-
},
|
|
1529
|
+
localStorage.setItem(r, JSON.stringify(n));
|
|
1530
|
+
}, na = (e) => {
|
|
1513
1531
|
let t = `icon_cache:${e}`;
|
|
1514
1532
|
const a = localStorage.getItem(t);
|
|
1515
1533
|
if (!a) return null;
|
|
1516
1534
|
let s;
|
|
1517
1535
|
try {
|
|
1518
1536
|
s = JSON.parse(a);
|
|
1519
|
-
} catch (
|
|
1520
|
-
return console.error("解析缓存失败:",
|
|
1537
|
+
} catch (r) {
|
|
1538
|
+
return console.error("解析缓存失败:", r), null;
|
|
1521
1539
|
}
|
|
1522
1540
|
return s.expireTime < Date.now() ? (localStorage.removeItem(e), null) : s;
|
|
1523
|
-
},
|
|
1541
|
+
}, Gt = () => {
|
|
1524
1542
|
const e = Date.now();
|
|
1525
1543
|
for (const t in localStorage)
|
|
1526
1544
|
if (t.startsWith("icon_cache:")) {
|
|
1527
1545
|
const a = localStorage.getItem(t);
|
|
1528
1546
|
a && JSON.parse(a).expireTime < e && localStorage.removeItem(t);
|
|
1529
1547
|
}
|
|
1530
|
-
},
|
|
1548
|
+
}, ee = (e, t, a) => {
|
|
1531
1549
|
setTimeout(() => {
|
|
1532
|
-
t.value = a, t.value && (e.value =
|
|
1550
|
+
t.value = a, t.value && (e.value = F.value[t.value]);
|
|
1533
1551
|
}, 1);
|
|
1534
|
-
},
|
|
1552
|
+
}, Ee = C(
|
|
1535
1553
|
"svg",
|
|
1536
1554
|
{ class: "w-4 h-4", viewBox: "0 0 50 50", style: { animation: "rotate 2s linear infinite" } },
|
|
1537
1555
|
[
|
|
@@ -1552,55 +1570,55 @@ const ae = new Ja(), fe = (e, t, a, s, n, r) => {
|
|
|
1552
1570
|
})
|
|
1553
1571
|
]
|
|
1554
1572
|
), tt = (e, t) => {
|
|
1555
|
-
const a =
|
|
1573
|
+
const a = na(e);
|
|
1556
1574
|
Object.keys(window).forEach((s) => {
|
|
1557
1575
|
s.startsWith("_iconfont_svg_string_") && (a == null ? void 0 : a.windowKey) === s && !Ke.has(s) && (Ke.add(s), st(s, t));
|
|
1558
1576
|
});
|
|
1559
1577
|
}, st = (e, t) => {
|
|
1560
|
-
const a = window[e],
|
|
1561
|
-
for (const
|
|
1562
|
-
const
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
})),
|
|
1578
|
+
const a = window[e], n = new DOMParser().parseFromString(a, "image/svg+xml").getElementsByTagName("symbol"), o = document.querySelectorAll("symbol");
|
|
1579
|
+
for (const l of n) {
|
|
1580
|
+
const i = l.id, c = Array.from(o).find((f) => f.id === i);
|
|
1581
|
+
c && t && (c.innerHTML = l.innerHTML, c.querySelectorAll("*").forEach((f) => {
|
|
1582
|
+
f.hasAttribute("fill") && f.removeAttribute("fill");
|
|
1583
|
+
})), F.value[i] || (F.value[i] = C("svg", { fill: "currentColor" }, [C("use", { "xlink:href": `#${i}` })]));
|
|
1566
1584
|
}
|
|
1567
|
-
},
|
|
1585
|
+
}, rt = (e, t) => {
|
|
1568
1586
|
let a = "";
|
|
1569
1587
|
return e && (a += `rotate(${e}deg)`), t && (a += " scaleX(-1)"), a;
|
|
1570
|
-
},
|
|
1571
|
-
oa(e, [], a, s).forEach((
|
|
1588
|
+
}, qt = (e, t, a, s) => {
|
|
1589
|
+
oa(e, [], a, s).forEach((n) => t.push(n));
|
|
1572
1590
|
}, oa = (e, t, a, s) => {
|
|
1573
|
-
var o,
|
|
1574
|
-
const
|
|
1591
|
+
var o, l, i, c, f;
|
|
1592
|
+
const r = [], n = _();
|
|
1575
1593
|
for (const p of e) {
|
|
1576
|
-
if (p.redirect || p.path.includes("/login") || p.path.includes("/error") || p.path.includes("/:page(.*)") || (
|
|
1594
|
+
if (p.redirect || p.path.includes("/login") || p.path.includes("/error") || p.path.includes("/:page(.*)") || (l = (o = p.meta) == null ? void 0 : o.roles) != null && l.length && !n.hasRole(p.meta.roles) && (i = p.meta) != null && i.permission && !n.hasPermit(p.meta.permission, ":page"))
|
|
1577
1595
|
continue;
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1580
|
-
const
|
|
1581
|
-
key:
|
|
1582
|
-
label: ((
|
|
1583
|
-
title: ((
|
|
1596
|
+
const v = p.path.split("/");
|
|
1597
|
+
v.unshift(...t);
|
|
1598
|
+
const g = oa(p.children || [], v, a, s), P = {
|
|
1599
|
+
key: v.join("/"),
|
|
1600
|
+
label: ((c = p.name) == null ? void 0 : c.toString()) ?? "",
|
|
1601
|
+
title: ((f = p.name) == null ? void 0 : f.toString()) ?? "",
|
|
1584
1602
|
icon: p.icon ? C(a, { ...s, icon: p.icon }) : void 0,
|
|
1585
|
-
children:
|
|
1603
|
+
children: g.length > 0 ? g : void 0
|
|
1586
1604
|
};
|
|
1587
|
-
(
|
|
1605
|
+
(g.length > 0 || !p.children) && r.push(P);
|
|
1588
1606
|
}
|
|
1589
|
-
return
|
|
1590
|
-
}, He = ca([]),
|
|
1607
|
+
return r;
|
|
1608
|
+
}, He = ca([]), jt = () => {
|
|
1591
1609
|
He.length = 0;
|
|
1592
|
-
const e =
|
|
1593
|
-
let a =
|
|
1594
|
-
e.matchedRoutes(a).forEach((
|
|
1595
|
-
var
|
|
1610
|
+
const e = N();
|
|
1611
|
+
let a = Me().TabActive;
|
|
1612
|
+
e.matchedRoutes(a).forEach((r, n) => {
|
|
1613
|
+
var l;
|
|
1596
1614
|
const o = {
|
|
1597
|
-
index:
|
|
1598
|
-
path:
|
|
1599
|
-
breadcrumbName: ((
|
|
1615
|
+
index: n,
|
|
1616
|
+
path: r.path,
|
|
1617
|
+
breadcrumbName: ((l = r.name) == null ? void 0 : l.toString()) ?? ""
|
|
1600
1618
|
};
|
|
1601
1619
|
He.push(o);
|
|
1602
1620
|
});
|
|
1603
|
-
},
|
|
1621
|
+
}, nt = {
|
|
1604
1622
|
host: {
|
|
1605
1623
|
api: "SITEHOST_API",
|
|
1606
1624
|
url: "/openapi/RCSiteHostSrv/get",
|
|
@@ -1612,7 +1630,7 @@ const ae = new Ja(), fe = (e, t, a, s, n, r) => {
|
|
|
1612
1630
|
// 不显示错误
|
|
1613
1631
|
hideErrorToast: !0
|
|
1614
1632
|
}
|
|
1615
|
-
},
|
|
1633
|
+
}, Bt = Z("hostInfo", {
|
|
1616
1634
|
state: () => ({
|
|
1617
1635
|
hostInfo: {
|
|
1618
1636
|
Host: "",
|
|
@@ -1636,15 +1654,15 @@ const ae = new Ja(), fe = (e, t, a, s, n, r) => {
|
|
|
1636
1654
|
return;
|
|
1637
1655
|
}
|
|
1638
1656
|
return new Promise((s) => {
|
|
1639
|
-
|
|
1640
|
-
const
|
|
1641
|
-
|
|
1657
|
+
Se.SITEHOST_API || (Se.SITEHOST_API = e);
|
|
1658
|
+
const r = t || window.location.origin;
|
|
1659
|
+
K(nt.host, {
|
|
1642
1660
|
Query: {
|
|
1643
|
-
Host:
|
|
1661
|
+
Host: r
|
|
1644
1662
|
}
|
|
1645
|
-
}).then((
|
|
1646
|
-
if ((
|
|
1647
|
-
const o =
|
|
1663
|
+
}).then((n) => {
|
|
1664
|
+
if ((n == null ? void 0 : n.status) === E.SUCCESS && n.data) {
|
|
1665
|
+
const o = n.data;
|
|
1648
1666
|
this._setHostInfo(o);
|
|
1649
1667
|
}
|
|
1650
1668
|
s();
|
|
@@ -1659,9 +1677,9 @@ const ae = new Ja(), fe = (e, t, a, s, n, r) => {
|
|
|
1659
1677
|
...this.hostInfo,
|
|
1660
1678
|
...e
|
|
1661
1679
|
}, this.hostInfo.API_HOST)
|
|
1662
|
-
for (const t in this.hostInfo.API_HOST)
|
|
1680
|
+
for (const t in this.hostInfo.API_HOST) Se[t] = this.hostInfo.API_HOST[t];
|
|
1663
1681
|
if (this.hostInfo.SERVER_HOST)
|
|
1664
|
-
for (const t in this.hostInfo.SERVER_HOST)
|
|
1682
|
+
for (const t in this.hostInfo.SERVER_HOST) Ea[t] = this.hostInfo.SERVER_HOST[t];
|
|
1665
1683
|
},
|
|
1666
1684
|
getHostInfo() {
|
|
1667
1685
|
return this.hostInfo;
|
|
@@ -1674,7 +1692,7 @@ const ae = new Ja(), fe = (e, t, a, s, n, r) => {
|
|
|
1674
1692
|
// storage: localStorage,
|
|
1675
1693
|
// pick: ['hostInfo'],
|
|
1676
1694
|
// },
|
|
1677
|
-
}),
|
|
1695
|
+
}), Jt = Z("settingInfo", {
|
|
1678
1696
|
state: () => ({
|
|
1679
1697
|
fullscreen: !1,
|
|
1680
1698
|
menuCollapse: !1,
|
|
@@ -1715,16 +1733,12 @@ const ae = new Ja(), fe = (e, t, a, s, n, r) => {
|
|
|
1715
1733
|
});
|
|
1716
1734
|
}
|
|
1717
1735
|
},
|
|
1718
|
-
persist:
|
|
1719
|
-
|
|
1720
|
-
storage: localStorage,
|
|
1721
|
-
pick: ["fullscreen", "menuCollapse", "tableColumns"]
|
|
1722
|
-
}
|
|
1723
|
-
}), Wt = /* @__PURE__ */ W({
|
|
1736
|
+
persist: !1
|
|
1737
|
+
}), zt = /* @__PURE__ */ X({
|
|
1724
1738
|
inheritAttrs: !1,
|
|
1725
1739
|
__name: "index",
|
|
1726
1740
|
props: {
|
|
1727
|
-
...
|
|
1741
|
+
...ue,
|
|
1728
1742
|
autoload: {
|
|
1729
1743
|
type: Boolean,
|
|
1730
1744
|
default: !1
|
|
@@ -1758,78 +1772,78 @@ const ae = new Ja(), fe = (e, t, a, s, n, r) => {
|
|
|
1758
1772
|
},
|
|
1759
1773
|
emits: ["update:value", "select", "change", "update:labels"],
|
|
1760
1774
|
setup(e, { emit: t }) {
|
|
1761
|
-
var
|
|
1762
|
-
const a = e, s =
|
|
1775
|
+
var P, h, b;
|
|
1776
|
+
const a = e, s = ne(), r = u({
|
|
1763
1777
|
...a.url,
|
|
1764
|
-
url: ((
|
|
1765
|
-
fieldMap: a.fieldMap || ((
|
|
1778
|
+
url: ((P = a.url) == null ? void 0 : P.url) || "",
|
|
1779
|
+
fieldMap: a.fieldMap || ((h = a.url) == null ? void 0 : h.fieldMap),
|
|
1766
1780
|
params: a.params || ((b = a.url) == null ? void 0 : b.params),
|
|
1767
1781
|
loadingText: !1
|
|
1768
|
-
}),
|
|
1769
|
-
|
|
1782
|
+
}), n = u(void 0);
|
|
1783
|
+
R(
|
|
1770
1784
|
() => a.value,
|
|
1771
1785
|
() => {
|
|
1772
|
-
|
|
1786
|
+
n.value = a.value;
|
|
1773
1787
|
},
|
|
1774
1788
|
{ immediate: !0 }
|
|
1775
|
-
),
|
|
1776
|
-
() =>
|
|
1777
|
-
(
|
|
1778
|
-
a.autoClean && a.formData && a.outFields &&
|
|
1789
|
+
), R(
|
|
1790
|
+
() => n.value,
|
|
1791
|
+
(m) => {
|
|
1792
|
+
a.autoClean && a.formData && a.outFields && m !== a.value && sa(a.formData, a.outFields, null);
|
|
1779
1793
|
}
|
|
1780
1794
|
);
|
|
1781
|
-
const o =
|
|
1782
|
-
o.inputEmit =
|
|
1783
|
-
const p =
|
|
1784
|
-
var
|
|
1785
|
-
if (p.value = [],
|
|
1786
|
-
let d =
|
|
1787
|
-
...
|
|
1795
|
+
const o = de(), { editorCtrl: l, errInfo: i, labelText: c } = o, f = t;
|
|
1796
|
+
o.inputEmit = f;
|
|
1797
|
+
const p = u([]), v = (m) => {
|
|
1798
|
+
var $;
|
|
1799
|
+
if (p.value = [], m === "") return;
|
|
1800
|
+
let d = m.trim(), I = {
|
|
1801
|
+
...r.value.params,
|
|
1788
1802
|
Query: {
|
|
1789
|
-
...(
|
|
1803
|
+
...($ = r.value.params) == null ? void 0 : $.Query
|
|
1790
1804
|
}
|
|
1791
1805
|
};
|
|
1792
1806
|
a.searchField && (I.Query[a.searchField] = {
|
|
1793
1807
|
$like: "%" + d + "%"
|
|
1794
|
-
}), a.onsearch && a.onsearch(d, I),
|
|
1795
|
-
},
|
|
1796
|
-
const d =
|
|
1797
|
-
|
|
1798
|
-
const I =
|
|
1799
|
-
|
|
1808
|
+
}), a.onsearch && a.onsearch(d, I), he(!0, a, p, o, r.value, I);
|
|
1809
|
+
}, g = (m) => {
|
|
1810
|
+
const d = ve(a, m, p, o);
|
|
1811
|
+
f("update:value", m), f("select", m);
|
|
1812
|
+
const I = ge(d);
|
|
1813
|
+
f("update:labels", I), i != null && i.value.errClass && l && pe(l);
|
|
1800
1814
|
};
|
|
1801
|
-
return
|
|
1802
|
-
|
|
1815
|
+
return oe(() => {
|
|
1816
|
+
r.value && !r.value.fieldMap && (r.value.fieldMap = {
|
|
1803
1817
|
title: "Name",
|
|
1804
1818
|
label: "Name",
|
|
1805
1819
|
value: "Name",
|
|
1806
1820
|
key: "Id"
|
|
1807
1821
|
});
|
|
1808
|
-
}),
|
|
1809
|
-
|
|
1810
|
-
}), (
|
|
1822
|
+
}), le(() => {
|
|
1823
|
+
me(a, o);
|
|
1824
|
+
}), (m, d) => {
|
|
1811
1825
|
var I;
|
|
1812
|
-
return
|
|
1813
|
-
|
|
1814
|
-
value:
|
|
1815
|
-
"onUpdate:value": d[0] || (d[0] = (
|
|
1816
|
-
class: [(I =
|
|
1826
|
+
return A(), O("div", null, [
|
|
1827
|
+
j(x(pa), ie({
|
|
1828
|
+
value: n.value,
|
|
1829
|
+
"onUpdate:value": d[0] || (d[0] = ($) => n.value = $),
|
|
1830
|
+
class: [(I = x(i)) == null ? void 0 : I.errClass, "error w-full"],
|
|
1817
1831
|
options: p.value,
|
|
1818
|
-
onSearch:
|
|
1819
|
-
onSelect:
|
|
1820
|
-
placeholder: a.url && !a.url.loading ? "请输入并选择" +
|
|
1821
|
-
},
|
|
1832
|
+
onSearch: v,
|
|
1833
|
+
onSelect: g,
|
|
1834
|
+
placeholder: a.url && !a.url.loading ? "请输入并选择" + x(c) : ""
|
|
1835
|
+
}, x(s)), null, 16, ["value", "class", "options", "placeholder"])
|
|
1822
1836
|
]);
|
|
1823
1837
|
};
|
|
1824
1838
|
}
|
|
1825
|
-
}),
|
|
1839
|
+
}), ot = { class: "min-h-[32px] pt-[5px]" }, lt = {
|
|
1826
1840
|
key: 1,
|
|
1827
1841
|
class: "text-center text-gray-500"
|
|
1828
|
-
},
|
|
1842
|
+
}, Wt = /* @__PURE__ */ X({
|
|
1829
1843
|
inheritAttrs: !1,
|
|
1830
1844
|
__name: "index",
|
|
1831
1845
|
props: {
|
|
1832
|
-
...
|
|
1846
|
+
...ue,
|
|
1833
1847
|
nodata: {
|
|
1834
1848
|
type: String,
|
|
1835
1849
|
default: ""
|
|
@@ -1846,66 +1860,66 @@ const ae = new Ja(), fe = (e, t, a, s, n, r) => {
|
|
|
1846
1860
|
},
|
|
1847
1861
|
emits: ["change", "update:labels"],
|
|
1848
1862
|
setup(e, { emit: t }) {
|
|
1849
|
-
var
|
|
1850
|
-
const a = e, s =
|
|
1863
|
+
var f, p, v;
|
|
1864
|
+
const a = e, s = ne(), r = u({
|
|
1851
1865
|
...a.url,
|
|
1852
|
-
url: ((
|
|
1866
|
+
url: ((f = a.url) == null ? void 0 : f.url) || "",
|
|
1853
1867
|
fieldMap: a.fieldMap || ((p = a.url) == null ? void 0 : p.fieldMap),
|
|
1854
|
-
params: a.params || ((
|
|
1868
|
+
params: a.params || ((v = a.url) == null ? void 0 : v.params),
|
|
1855
1869
|
loadingText: !1
|
|
1856
|
-
}),
|
|
1857
|
-
|
|
1858
|
-
const
|
|
1859
|
-
const
|
|
1860
|
-
|
|
1870
|
+
}), n = de(), { errInfo: o } = n, l = t;
|
|
1871
|
+
n.inputEmit = l;
|
|
1872
|
+
const i = u([]), c = (g) => {
|
|
1873
|
+
const h = ve(a, g, i, n), b = ge(h);
|
|
1874
|
+
l("update:labels", b);
|
|
1861
1875
|
};
|
|
1862
|
-
return
|
|
1863
|
-
|
|
1876
|
+
return oe(() => {
|
|
1877
|
+
r.value && !r.value.fieldMap && (r.value.fieldMap = {
|
|
1864
1878
|
title: "Name",
|
|
1865
1879
|
label: "Name",
|
|
1866
1880
|
value: "Id",
|
|
1867
1881
|
key: "Id"
|
|
1868
|
-
}),
|
|
1869
|
-
}),
|
|
1870
|
-
|
|
1871
|
-
}), (
|
|
1872
|
-
|
|
1873
|
-
onChange:
|
|
1882
|
+
}), he(a.autoload, a, i, n, r.value, r.value.params);
|
|
1883
|
+
}), le(() => {
|
|
1884
|
+
me(a, n);
|
|
1885
|
+
}), (g, P) => (A(), O("div", ot, [
|
|
1886
|
+
j(x(da), ie({
|
|
1887
|
+
onChange: c,
|
|
1874
1888
|
class: "w-full mb-[-3px]"
|
|
1875
|
-
},
|
|
1876
|
-
default:
|
|
1877
|
-
|
|
1889
|
+
}, x(s)), {
|
|
1890
|
+
default: Q(() => [
|
|
1891
|
+
i.value.length > 0 ? (A(!0), O(J, { key: 0 }, Te(i.value, (h) => {
|
|
1878
1892
|
var b;
|
|
1879
|
-
return
|
|
1880
|
-
key:
|
|
1881
|
-
value:
|
|
1882
|
-
disabled:
|
|
1883
|
-
class:
|
|
1884
|
-
((b =
|
|
1893
|
+
return A(), Re(x(ha), {
|
|
1894
|
+
key: h.value,
|
|
1895
|
+
value: h.value,
|
|
1896
|
+
disabled: h.disabled || h.value && e.disabledItems && e.disabledItems.indexOf(h.value.toString()) > -1,
|
|
1897
|
+
class: Ge([
|
|
1898
|
+
((b = x(o)) == null ? void 0 : b.errClass) === "error" ? "error !text-red-400" : "",
|
|
1885
1899
|
"text-nowrap",
|
|
1886
1900
|
"pb-1",
|
|
1887
1901
|
e.wrap ? `w-1/${a.wrap}` : ""
|
|
1888
1902
|
])
|
|
1889
1903
|
}, {
|
|
1890
|
-
default:
|
|
1891
|
-
|
|
1904
|
+
default: Q(() => [
|
|
1905
|
+
we(z(h.label), 1)
|
|
1892
1906
|
]),
|
|
1893
1907
|
_: 2
|
|
1894
1908
|
}, 1032, ["value", "disabled", "class"]);
|
|
1895
|
-
}), 128)) : e.nodata ? (
|
|
1909
|
+
}), 128)) : e.nodata ? (A(), O("div", lt, z(e.nodata), 1)) : B("", !0)
|
|
1896
1910
|
]),
|
|
1897
1911
|
_: 1
|
|
1898
1912
|
}, 16)
|
|
1899
1913
|
]));
|
|
1900
1914
|
}
|
|
1901
|
-
}),
|
|
1915
|
+
}), it = { class: "min-h-[32px] pt-1" }, ut = {
|
|
1902
1916
|
key: 1,
|
|
1903
1917
|
class: "text-center text-gray-500"
|
|
1904
|
-
},
|
|
1918
|
+
}, Yt = /* @__PURE__ */ X({
|
|
1905
1919
|
inheritAttrs: !1,
|
|
1906
1920
|
__name: "index",
|
|
1907
1921
|
props: {
|
|
1908
|
-
...
|
|
1922
|
+
...ue,
|
|
1909
1923
|
value: {
|
|
1910
1924
|
type: [String, Number, null, Array],
|
|
1911
1925
|
default: void 0
|
|
@@ -1923,84 +1937,84 @@ const ae = new Ja(), fe = (e, t, a, s, n, r) => {
|
|
|
1923
1937
|
},
|
|
1924
1938
|
emits: ["change", "update:value", "update:labels"],
|
|
1925
1939
|
setup(e, { emit: t }) {
|
|
1926
|
-
var
|
|
1927
|
-
const a = e, s =
|
|
1940
|
+
var v, g, P;
|
|
1941
|
+
const a = e, s = ne(), r = u({
|
|
1928
1942
|
...a.url,
|
|
1929
|
-
url: ((
|
|
1930
|
-
fieldMap: a.fieldMap || ((
|
|
1931
|
-
params: a.params || ((
|
|
1943
|
+
url: ((v = a.url) == null ? void 0 : v.url) || "",
|
|
1944
|
+
fieldMap: a.fieldMap || ((g = a.url) == null ? void 0 : g.fieldMap),
|
|
1945
|
+
params: a.params || ((P = a.url) == null ? void 0 : P.params),
|
|
1932
1946
|
loadingText: !1
|
|
1933
|
-
}),
|
|
1934
|
-
o.inputEmit =
|
|
1935
|
-
() =>
|
|
1936
|
-
(
|
|
1937
|
-
|
|
1947
|
+
}), n = u(a.value), o = de(), { errInfo: l } = o, i = u([]), c = t;
|
|
1948
|
+
o.inputEmit = c, R(
|
|
1949
|
+
() => n.value,
|
|
1950
|
+
(h) => {
|
|
1951
|
+
c("update:value", h);
|
|
1938
1952
|
}
|
|
1939
1953
|
);
|
|
1940
|
-
const
|
|
1941
|
-
if (typeof
|
|
1942
|
-
const
|
|
1943
|
-
return
|
|
1954
|
+
const f = (h, b) => {
|
|
1955
|
+
if (typeof h == "object" && typeof b == "object") {
|
|
1956
|
+
const m = JSON.stringify(h) === JSON.stringify(b);
|
|
1957
|
+
return m && (n.value = h), m;
|
|
1944
1958
|
}
|
|
1945
|
-
return
|
|
1946
|
-
}, p = (
|
|
1947
|
-
const b =
|
|
1948
|
-
|
|
1959
|
+
return h === b;
|
|
1960
|
+
}, p = (h) => {
|
|
1961
|
+
const b = h.target.value, m = ve(a, b, i, o), d = ge(m);
|
|
1962
|
+
c("update:labels", d);
|
|
1949
1963
|
};
|
|
1950
|
-
return
|
|
1951
|
-
var
|
|
1952
|
-
|
|
1964
|
+
return oe(() => {
|
|
1965
|
+
var h;
|
|
1966
|
+
r.value && !r.value.fieldMap && (r.value.fieldMap = {
|
|
1953
1967
|
label: "Name",
|
|
1954
1968
|
value: "Id",
|
|
1955
1969
|
key: "Id"
|
|
1956
|
-
}),
|
|
1957
|
-
}),
|
|
1958
|
-
|
|
1959
|
-
}), (
|
|
1960
|
-
|
|
1961
|
-
value:
|
|
1962
|
-
"onUpdate:value": b[0] || (b[0] = (
|
|
1970
|
+
}), he(a.autoload, a, i, o, r.value, (h = r.value) == null ? void 0 : h.params);
|
|
1971
|
+
}), le(() => {
|
|
1972
|
+
me(a, o);
|
|
1973
|
+
}), (h, b) => (A(), O("div", it, [
|
|
1974
|
+
j(x(ma), ie({
|
|
1975
|
+
value: n.value,
|
|
1976
|
+
"onUpdate:value": b[0] || (b[0] = (m) => n.value = m),
|
|
1963
1977
|
autocheck: !1,
|
|
1964
1978
|
onChange: p,
|
|
1965
1979
|
class: "w-full flex align-items flex-wrap mb-[-3px]"
|
|
1966
|
-
},
|
|
1967
|
-
default:
|
|
1968
|
-
|
|
1980
|
+
}, x(s)), {
|
|
1981
|
+
default: Q(() => [
|
|
1982
|
+
i.value.length > 0 ? (A(!0), O(J, { key: 0 }, Te(i.value, (m) => {
|
|
1969
1983
|
var d;
|
|
1970
|
-
return
|
|
1971
|
-
key:
|
|
1984
|
+
return A(), O(J, {
|
|
1985
|
+
key: m.value
|
|
1972
1986
|
}, [
|
|
1973
|
-
|
|
1987
|
+
m.visible !== !1 ? (A(), Re(x(va), {
|
|
1974
1988
|
key: 0,
|
|
1975
|
-
checked:
|
|
1976
|
-
value:
|
|
1977
|
-
class:
|
|
1978
|
-
((d =
|
|
1989
|
+
checked: f(m.value, a.value),
|
|
1990
|
+
value: m.value,
|
|
1991
|
+
class: Ge([
|
|
1992
|
+
((d = x(l)) == null ? void 0 : d.errClass) === "error" ? "error !text-red-400" : "",
|
|
1979
1993
|
"text-nowrap",
|
|
1980
1994
|
"pb-1",
|
|
1981
1995
|
e.wrap ? `w-1/${a.wrap}` : ""
|
|
1982
1996
|
])
|
|
1983
1997
|
}, {
|
|
1984
|
-
default:
|
|
1985
|
-
|
|
1998
|
+
default: Q(() => [
|
|
1999
|
+
we(z(m.label), 1)
|
|
1986
2000
|
]),
|
|
1987
2001
|
_: 2
|
|
1988
|
-
}, 1032, ["checked", "value", "class"])) :
|
|
2002
|
+
}, 1032, ["checked", "value", "class"])) : B("", !0)
|
|
1989
2003
|
], 64);
|
|
1990
|
-
}), 128)) : e.nodata ? (
|
|
2004
|
+
}), 128)) : e.nodata ? (A(), O("div", ut, z(e.nodata), 1)) : B("", !0)
|
|
1991
2005
|
]),
|
|
1992
2006
|
_: 1
|
|
1993
2007
|
}, 16, ["value"])
|
|
1994
2008
|
]));
|
|
1995
2009
|
}
|
|
1996
|
-
}),
|
|
2010
|
+
}), ct = {
|
|
1997
2011
|
key: 0,
|
|
1998
2012
|
class: "absolute z-10 mt-[5px] mr-[10px] text-[#999] flex items-center"
|
|
1999
|
-
},
|
|
2013
|
+
}, Xt = /* @__PURE__ */ X({
|
|
2000
2014
|
inheritAttrs: !1,
|
|
2001
2015
|
__name: "index",
|
|
2002
2016
|
props: {
|
|
2003
|
-
...
|
|
2017
|
+
...ue,
|
|
2004
2018
|
value: {
|
|
2005
2019
|
type: [String, Number, Array, null],
|
|
2006
2020
|
default: void 0
|
|
@@ -2038,86 +2052,86 @@ const ae = new Ja(), fe = (e, t, a, s, n, r) => {
|
|
|
2038
2052
|
},
|
|
2039
2053
|
emits: ["change", "update:value", "update:labels"],
|
|
2040
2054
|
setup(e, { emit: t }) {
|
|
2041
|
-
var
|
|
2042
|
-
const a = e, s =
|
|
2055
|
+
var h, b, m;
|
|
2056
|
+
const a = e, s = ne(), r = u({
|
|
2043
2057
|
...a.url,
|
|
2044
|
-
url: ((
|
|
2058
|
+
url: ((h = a.url) == null ? void 0 : h.url) || "",
|
|
2045
2059
|
fieldMap: a.fieldMap || ((b = a.url) == null ? void 0 : b.fieldMap),
|
|
2046
|
-
params: a.params || ((
|
|
2060
|
+
params: a.params || ((m = a.url) == null ? void 0 : m.params),
|
|
2047
2061
|
loadingText: !1
|
|
2048
|
-
}),
|
|
2049
|
-
|
|
2050
|
-
const p =
|
|
2051
|
-
|
|
2062
|
+
}), n = de(), { editorCtrl: o, errInfo: l, labelText: i } = n, c = u(void 0), f = t;
|
|
2063
|
+
n.inputEmit = f;
|
|
2064
|
+
const p = u([]);
|
|
2065
|
+
R(
|
|
2052
2066
|
() => p.value,
|
|
2053
2067
|
(d) => {
|
|
2054
|
-
d.length > 0 &&
|
|
2068
|
+
d.length > 0 && w(a.value) && a.selectFirst ? (c.value = d[0].value, P(d[0].value)) : c.value = a.value === null ? void 0 : a.value;
|
|
2055
2069
|
}
|
|
2056
2070
|
);
|
|
2057
|
-
const
|
|
2058
|
-
|
|
2059
|
-
() =>
|
|
2071
|
+
const v = u(s.placeholder);
|
|
2072
|
+
R(
|
|
2073
|
+
() => r.value.loading,
|
|
2060
2074
|
(d) => {
|
|
2061
|
-
d ?
|
|
2075
|
+
d ? v.value = "" : v.value || (v.value = "请选择" + i.value);
|
|
2062
2076
|
},
|
|
2063
2077
|
{ immediate: !0 }
|
|
2064
2078
|
);
|
|
2065
|
-
const
|
|
2066
|
-
|
|
2067
|
-
() =>
|
|
2079
|
+
const g = u(a.value);
|
|
2080
|
+
R(
|
|
2081
|
+
() => c.value,
|
|
2068
2082
|
(d) => {
|
|
2069
|
-
if (s.mode === "multiple" &&
|
|
2070
|
-
|
|
2083
|
+
if (s.mode === "multiple" && w(d) && w(g.value)) {
|
|
2084
|
+
f("update:value", g.value);
|
|
2071
2085
|
return;
|
|
2072
2086
|
}
|
|
2073
|
-
|
|
2087
|
+
f("update:value", d);
|
|
2074
2088
|
}
|
|
2075
2089
|
);
|
|
2076
|
-
const
|
|
2077
|
-
const I =
|
|
2078
|
-
|
|
2090
|
+
const P = (d) => {
|
|
2091
|
+
const I = ve(a, d, p, n), $ = ge(I);
|
|
2092
|
+
c.value = d, f("update:labels", $), f("change", d), l != null && l.value.errClass && o && pe(o);
|
|
2079
2093
|
};
|
|
2080
|
-
return
|
|
2094
|
+
return oe(() => {
|
|
2081
2095
|
var d;
|
|
2082
|
-
if (
|
|
2096
|
+
if (r.value && !r.value.fieldMap && (r.value.fieldMap = {
|
|
2083
2097
|
label: "Name",
|
|
2084
2098
|
value: "Id",
|
|
2085
2099
|
key: "Id"
|
|
2086
2100
|
}), a.dataKey) {
|
|
2087
|
-
const I = JSON.parse(JSON.stringify(
|
|
2101
|
+
const I = JSON.parse(JSON.stringify(M.getOptions(a.dataKey)));
|
|
2088
2102
|
p.value = I;
|
|
2089
|
-
} else
|
|
2090
|
-
}),
|
|
2091
|
-
|
|
2103
|
+
} else he(a.autoload, a, p, n, r.value, (d = r.value) == null ? void 0 : d.params);
|
|
2104
|
+
}), le(() => {
|
|
2105
|
+
me(a, n);
|
|
2092
2106
|
}), (d, I) => {
|
|
2093
|
-
var
|
|
2094
|
-
return
|
|
2095
|
-
a.url && a.url.loading === !0 ? (
|
|
2096
|
-
|
|
2107
|
+
var $;
|
|
2108
|
+
return A(), O("div", null, [
|
|
2109
|
+
a.url && a.url.loading === !0 ? (A(), O("div", ct, [
|
|
2110
|
+
j(x(Ee), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
|
|
2097
2111
|
I[1] || (I[1] = fa("span", null, "数据加载中...", -1))
|
|
2098
|
-
])) :
|
|
2099
|
-
|
|
2100
|
-
class: [(
|
|
2101
|
-
value:
|
|
2102
|
-
"onUpdate:value": I[0] || (I[0] = (
|
|
2112
|
+
])) : B("", !0),
|
|
2113
|
+
j(x(ga), ie({
|
|
2114
|
+
class: [($ = x(l)) == null ? void 0 : $.errClass, "w-full"],
|
|
2115
|
+
value: c.value,
|
|
2116
|
+
"onUpdate:value": I[0] || (I[0] = (H) => c.value = H),
|
|
2103
2117
|
"allow-clear": !0,
|
|
2104
|
-
onChange:
|
|
2105
|
-
placeholder:
|
|
2118
|
+
onChange: P,
|
|
2119
|
+
placeholder: v.value,
|
|
2106
2120
|
"label-in-value": !1
|
|
2107
|
-
},
|
|
2108
|
-
default:
|
|
2109
|
-
(
|
|
2110
|
-
key:
|
|
2121
|
+
}, x(s)), {
|
|
2122
|
+
default: Q(() => [
|
|
2123
|
+
(A(!0), O(J, null, Te(p.value, (H) => (A(), O(J, {
|
|
2124
|
+
key: H.value
|
|
2111
2125
|
}, [
|
|
2112
|
-
|
|
2126
|
+
H.visible !== !1 ? (A(), Re(x(ya), {
|
|
2113
2127
|
key: 0,
|
|
2114
|
-
value:
|
|
2128
|
+
value: H.value
|
|
2115
2129
|
}, {
|
|
2116
|
-
default:
|
|
2117
|
-
|
|
2130
|
+
default: Q(() => [
|
|
2131
|
+
we(z(H.label), 1)
|
|
2118
2132
|
]),
|
|
2119
2133
|
_: 2
|
|
2120
|
-
}, 1032, ["value"])) :
|
|
2134
|
+
}, 1032, ["value"])) : B("", !0)
|
|
2121
2135
|
], 64))), 128))
|
|
2122
2136
|
]),
|
|
2123
2137
|
_: 1
|
|
@@ -2128,72 +2142,72 @@ const ae = new Ja(), fe = (e, t, a, s, n, r) => {
|
|
|
2128
2142
|
});
|
|
2129
2143
|
export {
|
|
2130
2144
|
Tt as $,
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2145
|
+
ke as A,
|
|
2146
|
+
wa as B,
|
|
2147
|
+
_t as C,
|
|
2134
2148
|
ja as D,
|
|
2135
2149
|
Ba as E,
|
|
2136
|
-
|
|
2137
|
-
|
|
2150
|
+
Kt as F,
|
|
2151
|
+
Ht as G,
|
|
2138
2152
|
Ya as H,
|
|
2139
2153
|
sa as I,
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2154
|
+
ve as J,
|
|
2155
|
+
ge as K,
|
|
2156
|
+
Qt as L,
|
|
2157
|
+
Gt as M,
|
|
2144
2158
|
st as N,
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2159
|
+
M as O,
|
|
2160
|
+
U as P,
|
|
2161
|
+
rt as Q,
|
|
2162
|
+
qt as R,
|
|
2149
2163
|
He as S,
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2164
|
+
jt as T,
|
|
2165
|
+
je as U,
|
|
2166
|
+
Lt as V,
|
|
2167
|
+
Be as W,
|
|
2168
|
+
Et as X,
|
|
2169
|
+
Rt as Y,
|
|
2170
|
+
Le as Z,
|
|
2171
|
+
zt as _,
|
|
2172
|
+
Jt as a,
|
|
2159
2173
|
Dt as a0,
|
|
2160
2174
|
qa as a1,
|
|
2161
2175
|
ea as a2,
|
|
2162
|
-
|
|
2176
|
+
Ct as a3,
|
|
2163
2177
|
At as a4,
|
|
2164
|
-
|
|
2165
|
-
|
|
2178
|
+
qe as a5,
|
|
2179
|
+
Pa as a6,
|
|
2166
2180
|
aa as a7,
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2181
|
+
re as a8,
|
|
2182
|
+
q as a9,
|
|
2183
|
+
ae as aa,
|
|
2184
|
+
N as ab,
|
|
2185
|
+
Bt as ac,
|
|
2186
|
+
Me as ad,
|
|
2187
|
+
W as ae,
|
|
2188
|
+
Ot as b,
|
|
2175
2189
|
Vt as c,
|
|
2176
2190
|
Pt as d,
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2191
|
+
wt as e,
|
|
2192
|
+
Nt as f,
|
|
2193
|
+
Ft as g,
|
|
2194
|
+
$t as h,
|
|
2195
|
+
w as i,
|
|
2196
|
+
Mt as j,
|
|
2197
|
+
de as k,
|
|
2198
|
+
he as l,
|
|
2199
|
+
me as m,
|
|
2200
|
+
pe as n,
|
|
2201
|
+
kt as o,
|
|
2188
2202
|
Ze as p,
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2203
|
+
Ga as q,
|
|
2204
|
+
Y as r,
|
|
2205
|
+
Ut as s,
|
|
2192
2206
|
Oa as t,
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2207
|
+
_ as u,
|
|
2208
|
+
ue as v,
|
|
2209
|
+
Ee as w,
|
|
2210
|
+
Wt as x,
|
|
2211
|
+
Yt as y,
|
|
2212
|
+
Xt as z
|
|
2199
2213
|
};
|