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