@skyfox2000/webui 1.3.21 → 1.4.1

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 (31) hide show
  1. package/lib/assets/modules/{baseLayout-Bz3oRE5o.js → baseLayout-BLUY_tDF.js} +6 -6
  2. package/lib/assets/modules/{file-upload-CmnCEJze.js → file-upload-Dk4VFMgz.js} +2 -2
  3. package/lib/assets/modules/{index-CvQ24Mzh.js → index-Bb4qTaRC.js} +2 -2
  4. package/lib/assets/modules/{index-D0njzOzQ.js → index-BuP8i92E.js} +1 -1
  5. package/lib/assets/modules/{index-CAqiqqdd.js → index-DLY7idvQ.js} +134 -133
  6. package/lib/assets/modules/{menuTabs-NVgroqVO.js → menuTabs-DzoBrCZE.js} +7 -7
  7. package/lib/assets/modules/{toolIcon-BuqRfX4F.js → toolIcon-FTelEQwg.js} +1 -1
  8. package/lib/assets/modules/{uploadList-B6MIYOtN.js → uploadList-DIfhRlbh.js} +705 -700
  9. package/lib/assets/modules/{uploadList-KG6kpOaY.js → uploadList-DTAFNhow.js} +152 -146
  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 +2 -2
  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 +5 -5
  16. package/lib/es/MenuLayout/index.js +2 -2
  17. package/lib/es/UploadForm/index.js +4 -4
  18. package/lib/stores/userInfo.d.ts +2 -1
  19. package/lib/utils/micro-openapis.d.ts +35 -0
  20. package/lib/webui.es.js +358 -353
  21. package/package.json +1 -2
  22. package/src/components/layout/header/headerExits.vue +1 -1
  23. package/src/stores/appInfo.ts +7 -8
  24. package/src/stores/userInfo.ts +20 -63
  25. package/src/utils/data.ts +6 -0
  26. package/src/utils/download.ts +10 -1
  27. package/src/utils/export-table.ts +5 -0
  28. package/src/utils/form-excel.ts +14 -9
  29. package/src/utils/main-openapis.ts +2 -2
  30. package/src/utils/micro-openapis.ts +146 -0
  31. package/src/utils/options.ts +5 -0
@@ -1,19 +1,19 @@
1
- var ma = Object.defineProperty;
2
- var va = (e, t, a) => t in e ? ma(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
3
- var $ = (e, t, a) => va(e, typeof t != "symbol" ? t + "" : t, a);
4
- import { inject as te, ref as f, provide as Le, watch as g, toRaw as Ze, h as U, nextTick as ga, shallowRef as K, defineComponent as X, reactive as ya, onMounted as xe, onUnmounted as ie, createBlock as Ae, createCommentVNode as B, openBlock as E, unref as b, mergeProps as le, useAttrs as Ee, createElementBlock as L, createVNode as z, withCtx as V, createTextVNode as Oe, toDisplayString as C, Fragment as ne, renderList as Ue, normalizeClass as ea, createElementVNode as Sa } from "vue";
5
- import { Switch as ba, AutoComplete as Ia, Input as xa, CheckboxGroup as Aa, Checkbox as Ea, RadioGroup as Oa, Radio as Ra, Select as Ta, SelectOption as wa } from "ant-design-vue";
6
- import { createPinia as Pa, defineStore as ue } from "pinia";
7
- import ka from "pinia-plugin-persistedstate";
8
- import { combineParams as ce, EnvConfig as ye, AppAction as Be, AppSource as ze, isMicroApp as Se, mainAppApis as N, isBaseMicroApp as La } from "@skyfox2000/microbase";
9
- import { ResStatus as T, httpPost as G, setToken as me, fieldMapping as $a, parseFieldTemplate as be, API_HOST as $e, SERVER_HOST as Fa } from "@skyfox2000/fapi";
1
+ var pa = Object.defineProperty;
2
+ var ha = (e, t, a) => t in e ? pa(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
3
+ var $ = (e, t, a) => ha(e, typeof t != "symbol" ? t + "" : t, a);
4
+ import { ref as f, h as U, nextTick as ma, inject as te, provide as ke, watch as g, toRaw as Xe, shallowRef as K, defineComponent as X, reactive as va, onMounted as Se, onUnmounted as oe, createBlock as be, createCommentVNode as B, openBlock as A, unref as b, mergeProps as ie, useAttrs as Ie, createElementBlock as L, createVNode as z, withCtx as V, createTextVNode as xe, toDisplayString as C, Fragment as ne, renderList as De, normalizeClass as Ze, createElementVNode as ga } from "vue";
5
+ import { Switch as ya, AutoComplete as Sa, Input as ba, CheckboxGroup as Ia, Checkbox as xa, RadioGroup as Ea, Radio as Aa, Select as Oa, SelectOption as Ra } from "ant-design-vue";
6
+ import { createPinia as Ta, defineStore as le } from "pinia";
7
+ import wa from "pinia-plugin-persistedstate";
8
+ import { EnvConfig as ge, AppAction as qe, AppSource as Be, mainAppApis as W, isMicroApp as Me, isBaseMicroApp as Pa, combineParams as ue } from "@skyfox2000/microbase";
9
+ import { httpPost as j, ResStatus as T, setToken as he, fieldMapping as ka, parseFieldTemplate as ye, API_HOST as Le, SERVER_HOST as La } from "@skyfox2000/fapi";
10
10
  import x from "vue-m-message";
11
- import He from "async-validator";
12
- import { createRouter as Ma, createWebHashHistory as _a } from "vue-router";
11
+ import { createRouter as $a, createWebHashHistory as Fa } from "vue-router";
12
+ import Ue from "async-validator";
13
13
  import "dayjs";
14
14
  import "vue-draggable-next";
15
- const Na = Pa();
16
- Na.use(ka);
15
+ const Ma = Ta();
16
+ Ma.use(wa);
17
17
  var D = /* @__PURE__ */ ((e) => (e.PageControl = "Page.PageControl", e.EditorControl = "Page.EditorControl", e.GridControl = "Page.GridControl", e.LabelText = "FormItem.LabelText", e.LabelWidth = "FormItem.LabelWidth", e.RuleKey = "FormItem.RuleKey", e.ErrInfo = "FormItem.ErrInfo", e))(D || {});
18
18
  const w = class w {
19
19
  };
@@ -105,12 +105,12 @@ $(w, "MaleFemale", [
105
105
  value: "F"
106
106
  }
107
107
  ]);
108
- let M = w;
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 fe = {
108
+ let _ = w;
109
+ _.setOptions("EnableDisable", _.EnableDisable);
110
+ _.setOptions("SuccessResult", _.SuccessResult);
111
+ _.setOptions("YesNo", _.YesNo);
112
+ _.setOptions("MaleFemale", _.MaleFemale);
113
+ const ce = {
114
114
  /**
115
115
  * 选项数据接口
116
116
  */
@@ -173,313 +173,27 @@ const fe = {
173
173
  type: Object,
174
174
  required: !1
175
175
  }
176
- }, F = (e) => e == null || e === "" ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1, Re = (e, t) => {
177
- var n;
178
- const a = e.page;
179
- return {
180
- url: "",
181
- ...e.url,
182
- ...(n = a.urls) == null ? void 0 : n[t.urlKey],
183
- ...t.url,
184
- loadingText: t.loadingText
185
- };
186
- }, Te = (e, t) => {
187
- const a = e.page, s = t.url;
188
- if (!s || !s.url) {
189
- const o = `URL未设置: ${t.urlKey}`;
190
- return console.warn(o), Promise.reject(new Error(o));
191
- }
192
- s.api || (s.api = a.api), s.authorize === void 0 && (s.authorize = a.authorize);
193
- let n = ce(
194
- JSON.parse(JSON.stringify(s.params ?? {})),
195
- JSON.parse(JSON.stringify(t.params ?? {}))
196
- );
197
- return t.processParams && (n = t.processParams(n)), t.loadingState && (t.loadingState.value = !0), t.hideErrorToast && (s.hideErrorToast = !0), G(s, n).then((o) => (t.loadingState && (t.loadingState.value = !1), o)).catch((o) => (t.loadingState && (t.loadingState.value = !1), null));
198
- }, Ve = (e, t) => {
199
- t.params || (t.params = {}), t.params.Query || (t.params.Query = {});
200
- const a = Re(e, t);
201
- return t.url = a, Te(e, t);
202
- }, $t = (e, t) => (t.params || (t.params = {}), t.params.Query || (t.params.Query = {}), t.loadingText = t.loadingText === !1 ? !1 : t.loadingText || "开始执行...", t.url = Re(e, t), Te(e, t).then((a) => ((a == null ? void 0 : a.status) === T.SUCCESS && (t.hideErrorToast || x.success("执行成功!")), a))), aa = (e, t = {}) => {
203
- const a = t.primaryKey || "Id";
204
- if (t.params || (t.params = {}), t.params.Query || (t.params.Query = {}), !t.params.Data)
205
- return x.error("错误!无保存数据!"), Promise.resolve(null);
206
- const s = {
207
- ...t,
208
- urlKey: t.urlKey || "save",
209
- loadingText: t.loadingText === !1 ? !1 : t.loadingText || "数据保存中..."
210
- };
211
- s.params.Query[a] = s.params.Data[a];
212
- const n = Re(e, s);
213
- return s.url = n, Te(e, s).then((o) => ((o == null ? void 0 : o.status) === T.SUCCESS && (t.hideErrorToast || x.success("保存成功!")), o));
214
- }, Da = (e, t, a = {}) => {
215
- const s = a.primaryKey || "Id";
216
- a.params || (a.params = {}), a.params.Query || (a.params.Query = {});
217
- const n = {
218
- ...a,
219
- urlKey: "delete",
220
- loadingText: a.loadingText === !1 ? !1 : a.loadingText || "数据删除中..."
221
- };
222
- if (Array.isArray(t) ? n.params.Query[s] = t : n.params.Query[s] = t[s], F(n.params.Query) || F(n.params.Query[s]))
223
- return x.error("错误!禁止无条件删除数据!"), Promise.resolve(null);
224
- const o = Re(e, n);
225
- return n.url = o, Te(e, n).then((r) => ((r == null ? void 0 : r.status) === T.SUCCESS && (a.hideErrorToast || x.success("删除成功!")), r));
226
- }, Ua = (e, t) => Ve(e, {
227
- urlKey: "tree",
228
- params: {},
229
- loadingState: e.isTreeLoading,
230
- loadingText: !1,
231
- processParams: () => ce(e.treeQuery, t)
232
- }).then((a) => (a == null ? void 0 : a.status) === T.SUCCESS ? (e.data.value = a.data || [], e.afterLoad && e.afterLoad(e.data.value), e.data.value) : (e.afterLoad && e.afterLoad((a == null ? void 0 : a.data) || []), []));
233
- let re;
234
- const Ft = (e) => {
235
- re = new He({}), re.messages({
236
- required: "${label}不能为空",
237
- types: {
238
- number: "${label}必须是数字"
239
- },
240
- enum: "${label}必须是${enum}中的一个",
241
- string: {
242
- len: "${label}长度必须为${len}",
243
- min: "${label}长度不能小于${min}",
244
- max: "${label}长度不能大于${max}",
245
- range: "${label}长度必须在${min}和${max}之间"
246
- },
247
- number: {
248
- len: "${label}必须为${len}",
249
- min: "${label}不能小于${min}",
250
- max: "${label}不能大于${max}",
251
- range: "${label}必须在${min}和${max}之间"
252
- },
253
- array: {
254
- len: "${label}长度必须为${len}",
255
- min: "${label}长度不能小于${min}",
256
- max: "${label}长度不能大于${max}",
257
- range: "${label}长度必须在${min}和${max}之间"
258
- },
259
- ...e
260
- });
261
- }, Mt = (e) => {
262
- if (!e || F(e))
263
- return [];
264
- const t = [], a = re.messages(), s = (o, r, l) => {
265
- const u = r.type;
266
- if (u && a.types && u in a.types) {
267
- const c = a.types[u];
268
- n(c, o, { type: u }, l);
269
- }
270
- const i = ["string", "number", "array"];
271
- for (const c of i)
272
- if (u === c && a[c]) {
273
- const p = a[c], v = ["len", "min", "max", "range"];
274
- for (const d of v)
275
- d === "range" && r.min != null && r.max != null && p.range ? n(p.range, o, { min: r.min, max: r.max }, l) : d !== "range" && r[d] != null && p[d] && n(p[d], o, { [d]: r[d] }, l);
276
- }
277
- if (r.required && a.required && n(a.required, o, {}, l), r.pattern && a.pattern && n(r.message, o, {}, l), r.enum && Array.isArray(r.enum) && a.enum) {
278
- const c = r.enum.join(", ");
279
- n(a.enum, o, { enum: c }, l);
280
- }
281
- }, n = (o, r, l, u) => {
282
- if (o)
283
- try {
284
- let i;
285
- if (typeof o == "function") {
286
- const c = [r];
287
- for (const p in l)
288
- c.push(l[p]);
289
- i = o.apply(null, c), i && u.push(i);
290
- } else {
291
- i = String(o);
292
- for (const c in l)
293
- i = i.replace(new RegExp(`\\$\\{${c}\\}`, "g"), l[c]);
294
- i = i.replace(/\$\{label\}/g, ""), i && u.push(i);
295
- }
296
- } catch (i) {
297
- console.error("格式化验证消息出错:", i);
298
- }
299
- };
300
- return Object.keys(e).forEach((o) => {
301
- const r = e[o], l = [];
302
- try {
303
- s(o, r, l), Array.isArray(r) && r.forEach((i) => {
304
- i && typeof i == "object" && s(o, i, l);
305
- }), r && typeof r == "object" && "fields" in r;
306
- } catch (i) {
307
- console.error("处理验证规则出错:", i);
308
- }
309
- const u = Array.from(new Set(l));
310
- o && u.length > 0 && t.push({
311
- field: o,
312
- rules: u
313
- });
314
- }), t;
315
- }, pe = async (e) => {
316
- const t = e.formData.value, a = e.formRules.value;
317
- F(a) || (Ke(e), e.ruleValidator || (e.ruleValidator = new He({}), e.ruleValidator.messages(re.messages()), e.ruleValidator.define(a)), e.ruleResults.value = await e.ruleValidator.validate(t).then(() => {
318
- }).catch(({ fields: s }) => s));
319
- }, _t = async (e, t, a) => (a || (a = new He({}), a.messages(re.messages()), a.define(t)), a.validate(e).then(() => {
320
- }).catch(({ fields: s }) => s)), Ke = (e) => {
321
- e.ruleResults.value = void 0;
322
- }, Y = () => {
323
- const e = te(D.EditorControl, void 0), t = f(te(D.LabelText, "")), a = f(te(D.RuleKey, "")), s = te(D.ErrInfo, void 0);
324
- return {
325
- editorCtrl: e,
326
- labelText: t,
327
- ruleKey: a,
328
- errInfo: s
329
- };
330
- }, Ha = (e, t) => {
331
- let a = f({
332
- msg: "",
333
- errClass: ""
334
- });
335
- if (!e.label || !e.rule)
336
- return a;
337
- const s = t == null ? void 0 : t.ruleResults;
338
- return g(
339
- () => s == null ? void 0 : s.value,
340
- (n) => {
341
- if (a.value.errClass = "", a.value.msg = "", !F(n)) {
342
- const o = Va(
343
- {
344
- label: e.label,
345
- rule: e.rule
346
- },
347
- t == null ? void 0 : t.formRules.value,
348
- Ze(n)
349
- );
350
- a.value.errClass = o.errClass.value, a.value.msg = o.msg.value;
351
- }
352
- },
353
- { deep: !0 }
354
- ), a;
355
- }, Va = (e, t, a) => {
356
- const s = f([]), n = f(""), o = f("");
357
- if (!e.rule || !t || !a)
358
- return { msg: n, ruleErrors: s, errClass: o };
359
- e.rule.split("|").forEach((u) => {
360
- if (u = u.trim(), u)
361
- if (a[u])
362
- s.value.push(...a[u]);
363
- else {
364
- const i = [];
365
- for (let c in a)
366
- c !== u && c.startsWith(u + ".") && i.push(...a[c]);
367
- i.length > 0 && s.value.push(...i);
368
- }
369
- });
370
- const l = /\${\w+}/g;
371
- return s.value.forEach((u) => {
372
- n.value && (n.value += " / "), n.value += u.message.replace("${label}", e.label ?? "");
373
- const i = t[u.field];
374
- if (i) {
375
- const c = n.value.match(l);
376
- c && c.forEach((p) => {
377
- const v = p.replace("${", "").replace("}", "");
378
- n.value = n.value.replace(p, i[v] ?? "");
379
- });
380
- }
381
- }), s.value.length > 0 && (o.value = "error"), { msg: n, ruleErrors: s, errClass: o };
382
- }, Nt = (e, t) => {
383
- Le(D.LabelText, e.label || ""), Le(D.RuleKey, e.rule || "");
384
- const a = Ha(e, t);
385
- return Le(D.ErrInfo, a), a;
386
- }, Dt = (e) => {
387
- ta(e);
388
- }, Ut = (e) => {
389
- const t = e.page, a = e.formData.value;
390
- a[e.primaryKey ?? t.primaryKey] = null, ta(e);
391
- }, Ht = (e) => {
392
- Qe(e), e.visible.value = !1;
393
- }, ta = async (e) => {
394
- var s;
395
- const t = e.page;
396
- if (e.isFormSaving.value = !0, Ke(e), e.beforeSave && e.beforeSave() === !1)
397
- return e.isFormSaving.value = !1, Promise.resolve();
398
- if (e.formRules.value && await pe(e), e.ruleResults.value)
399
- return x.error("提交表单时,验证失败!"), console.error("表单验证失败!", e.ruleResults.value), e.isFormSaving.value = !1, Promise.resolve();
400
- const a = e.formData.value;
401
- return aa(
402
- {
403
- page: t,
404
- // 转换为AnyControl接口
405
- reload: (s = e.grid) == null ? void 0 : s.reload
406
- },
407
- {
408
- url: e.saveUrl,
409
- primaryKey: e.primaryKey ?? t.primaryKey,
410
- params: {
411
- Data: a,
412
- Query: {}
413
- },
414
- hideErrorToast: !0,
415
- // 隐藏自动错误提示,特殊判断控制
416
- loadingState: e.isFormSaving
417
- }
418
- ).then((n) => {
419
- var o, r;
420
- if ((n == null ? void 0 : n.status) === T.SUCCESS)
421
- x.success("保存成功!"), e.grid && (e.grid.reload.value = !0), e.afterSave && e.afterSave(n), e.autoClose !== !1 && (e.visible.value = !1);
422
- else if (n != null && n.msg && ((o = n == null ? void 0 : n.msg) == null ? void 0 : o.indexOf("Duplicate entry")) > -1) {
423
- const l = (r = n == null ? void 0 : n.msg) == null ? void 0 : r.match(/Duplicate entry '([^']+)' for key '([^']+)'/);
424
- if (l && l.length > 2 && l[1] && l[2]) {
425
- const u = l[1], i = l[2].replace(/Idx_/g, "").split("_"), c = e.formRules.value;
426
- if (c && i.length > 0) {
427
- const p = {};
428
- i.forEach((v) => {
429
- c[v] && (p[v] = [
430
- {
431
- field: v,
432
- fieldValue: u,
433
- message: "数据重复"
434
- }
435
- ]);
436
- }), Object.keys(p).length > 0 && (console.error("保存失败!", p), e.ruleResults.value = p);
437
- }
438
- x.error(`保存失败!数据 \`${u}\` 已存在!`);
439
- } else x.error((n == null ? void 0 : n.msg) ?? "保存失败!");
440
- e.afterSave && e.afterSave(n);
441
- } else
442
- x.error((n == null ? void 0 : n.msg) ?? "保存失败!"), e.afterSave && e.afterSave(n);
443
- });
444
- }, Vt = async (e) => {
445
- const t = e.page, a = e.grid;
446
- e.isFormLoading.value = !0;
447
- const s = e.formData.value, n = e.primaryKey ?? t.primaryKey;
448
- return ua(a, { [n]: s[n] }, e.detailUrl).then((o) => {
449
- e.isFormLoading.value = !1, o && sa(e, o);
450
- });
451
- }, Kt = (e) => {
452
- const t = e.grid;
453
- t && (t.rowData.value = void 0), e && (Qe(e), e.visible && (e.visible.value = !1), setTimeout(() => {
454
- e.visible.value = !0;
455
- }, 1));
456
- }, sa = (e, t) => {
457
- Qe(e);
458
- const a = { ...e.formData.value, ...t };
459
- e.formData.value = JSON.parse(JSON.stringify(a));
460
- }, Qe = (e) => {
461
- e.formData.value = e.default ? JSON.parse(JSON.stringify(e.default)) : {}, Ke(e);
462
- }, Ie = "/login/", ge = [], Ka = (e) => {
176
+ }, F = (e) => e == null || e === "" ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1, ze = "/login/", ve = [], _a = (e) => {
463
177
  for (const t of e) {
464
- const a = ge.findIndex((s) => s.path === t.path);
465
- a !== -1 && ge.splice(a, 1), ge.push(t), oe.addRoute(t);
178
+ const a = ve.findIndex((s) => s.path === t.path);
179
+ a !== -1 && ve.splice(a, 1), ve.push(t), Ee.addRoute(t);
466
180
  }
467
- }, na = (e, t, a, s = "") => {
181
+ }, ea = (e, t, a, s = "") => {
468
182
  const n = s + (s ? "/" : "") + e.path;
469
- t[n] = { ...e, parent: a }, e.children && e.children.forEach((o) => na(o, t, e, n));
470
- }, oe = Ma({
471
- history: _a("/"),
472
- routes: ge
473
- }), Qa = (e, t) => {
183
+ t[n] = { ...e, parent: a }, e.children && e.children.forEach((o) => ea(o, t, e, n));
184
+ }, Ee = $a({
185
+ history: Fa("/"),
186
+ routes: ve
187
+ }), Na = (e, t) => {
474
188
  var n, o;
475
189
  const a = ((n = e.meta) == null ? void 0 : n.roles) ?? [], s = (o = e.meta) == null ? void 0 : o.permission;
476
190
  if (!t)
477
191
  return a.length === 0 && !s;
478
192
  if (t) {
479
- const r = j();
480
- if (ye.VITE_PERMISSION_MODE === "role")
193
+ const r = M();
194
+ if (ge.VITE_PERMISSION_MODE === "role")
481
195
  return a.length === 0 ? !0 : r.hasRole(a);
482
- if (ye.VITE_PERMISSION_MODE === "permit") {
196
+ if (ge.VITE_PERMISSION_MODE === "permit") {
483
197
  if (a.length === 0 && !s)
484
198
  return !0;
485
199
  let l = !1, u = !1;
@@ -488,10 +202,10 @@ const Ft = (e) => {
488
202
  }
489
203
  return !1;
490
204
  }, se = f(null);
491
- oe.beforeEach((e, t, a) => {
205
+ Ee.beforeEach((e, t, a) => {
492
206
  var l;
493
207
  const s = e;
494
- if (e.path.startsWith("/error/") || e.path.startsWith(Ie))
208
+ if (e.path.startsWith("/error/") || e.path.startsWith(ze))
495
209
  return a();
496
210
  const n = s.meta, r = ((n == null ? void 0 : n.roles) ?? []).length > 0 || ((l = n == null ? void 0 : n.permission) == null ? void 0 : l.length);
497
211
  if (e.path === "/") {
@@ -511,9 +225,9 @@ oe.beforeEach((e, t, a) => {
511
225
  if (!r)
512
226
  a();
513
227
  else {
514
- const u = j();
228
+ const u = M();
515
229
  if (!u.isLogin)
516
- a({ path: Ie });
230
+ a({ path: ze });
517
231
  else {
518
232
  if (!H().menuLoaded) {
519
233
  se.value = {
@@ -522,24 +236,24 @@ oe.beforeEach((e, t, a) => {
522
236
  };
523
237
  return;
524
238
  }
525
- const c = Qa(s, u.isLogin);
239
+ const c = Na(s, u.isLogin);
526
240
  a();
527
241
  }
528
242
  }
529
243
  });
530
- const Ja = (e) => {
244
+ const Da = (e) => {
531
245
  if (se.value) {
532
246
  const { to: t, next: a } = se.value;
533
247
  se.value = null, t.path === "/" ? a(e) : a(t.path);
534
248
  }
535
- }, ja = (e) => {
536
- const t = Je();
249
+ }, Ua = (e) => {
250
+ const t = He();
537
251
  if (t.TabEnabled) {
538
- if (Ga(e.key, t.TabPanes))
252
+ if (Ha(e.key, t.TabPanes))
539
253
  return;
540
254
  t.TabPanes.push(e);
541
255
  }
542
- }, Ga = (e, t) => t.find((a) => a.key === e), Je = ue("pageInfo", {
256
+ }, Ha = (e, t) => t.find((a) => a.key === e), He = le("pageInfo", {
543
257
  state: () => ({
544
258
  TabActive: "",
545
259
  TabPanes: [],
@@ -584,44 +298,44 @@ const Ja = (e) => {
584
298
  // 默认为true
585
299
  keepAlive: !(a.meta && !a.meta.keepAlive)
586
300
  };
587
- ja(s), this.TabActive = e;
301
+ Ua(s), this.TabActive = e;
588
302
  }
589
303
  },
590
304
  persist: !1
591
- }), Wa = {
305
+ }), Va = {
592
306
  appList: {
593
307
  api: "PLATFORM_API",
594
308
  authorize: !0,
595
309
  url: "/api/RCTenanetOpSrv/getApps",
596
310
  loadingText: !1
597
311
  }
598
- }, Fe = /* @__PURE__ */ new Map(), qa = (e) => {
599
- const t = j(), { roles: a, permission: s } = e.meta || {};
312
+ }, $e = /* @__PURE__ */ new Map(), Ka = (e) => {
313
+ const t = M(), { roles: a, permission: s } = e.meta || {};
600
314
  if (F(a) && F(s))
601
315
  return !0;
602
- if (ye.VITE_PERMISSION_MODE === "role")
316
+ if (ge.VITE_PERMISSION_MODE === "role")
603
317
  return F(a) ? !0 : t.hasRole(a);
604
- if (ye.VITE_PERMISSION_MODE === "permit") {
318
+ if (ge.VITE_PERMISSION_MODE === "permit") {
605
319
  let n = !1, o = !1;
606
320
  return F(a) || (n = t.hasRole(a)), t.isAdmin() ? n : (F(s) || (o = t.hasPermit(e.path, s)), n || o);
607
321
  }
608
322
  return !1;
609
- }, ra = (e) => e.map((t) => {
323
+ }, aa = (e) => e.map((t) => {
610
324
  const a = { ...t };
611
- return qa(a) ? (a.children && (a.children = ra(a.children)), a) : null;
612
- }).filter(Boolean), oa = (e, t = "") => {
325
+ return Ka(a) ? (a.children && (a.children = aa(a.children)), a) : null;
326
+ }).filter(Boolean), ta = (e, t = "") => {
613
327
  for (const a of e) {
614
328
  if (!a.children && !a.redirect) {
615
329
  let s = t + a.path;
616
330
  return s.startsWith("/") || (s = "/" + s), s;
617
331
  }
618
332
  if (a.children && a.children.length > 0 && a.path !== "/error" && a.path !== "/login" && a.path !== "/:page(.*)") {
619
- const s = oa(a.children, t + a.path + "/");
333
+ const s = ta(a.children, t + a.path + "/");
620
334
  if (s)
621
335
  return s;
622
336
  }
623
337
  }
624
- }, H = ue("appInfo", {
338
+ }, H = le("appInfo", {
625
339
  state: () => ({
626
340
  appInfo: {
627
341
  Id: "",
@@ -629,8 +343,8 @@ const Ja = (e) => {
629
343
  AppCode: "",
630
344
  Version: "",
631
345
  Host: "",
632
- Source: ze.Manual,
633
- Action: Be.App,
346
+ Source: Be.Manual,
347
+ Action: qe.App,
634
348
  Path: "",
635
349
  Icon: "",
636
350
  Routes: [],
@@ -655,13 +369,18 @@ const Ja = (e) => {
655
369
  });
656
370
  },
657
371
  async getRemoteAppList() {
658
- return G(Wa.appList, {
372
+ return j(Va.appList, {
659
373
  Query: {
660
374
  AppCode: this.appInfo.AppCode,
661
375
  Enabled: 1
662
376
  }
663
377
  }).then((e) => {
664
- (e == null ? void 0 : e.status) === T.SUCCESS && e.data && (this.appList.length = 0, this.appList.push(...e.data));
378
+ if ((e == null ? void 0 : e.status) === T.SUCCESS && e.data)
379
+ this.appList.length = 0, this.appList.push(...e.data);
380
+ else if ((e == null ? void 0 : e.errno) == Ae) {
381
+ M().logout(!1);
382
+ return;
383
+ }
665
384
  });
666
385
  },
667
386
  async toDefaultApp(e) {
@@ -694,7 +413,7 @@ const Ja = (e) => {
694
413
  flattenRoutes: {},
695
414
  Routes: t ?? [],
696
415
  defaultPage: ""
697
- }), (!Se() || !La()) && (await j().getRolePermits(a.Id), this.appInfo.Routes.length && this.setAppRoutes(this.appInfo.Routes)));
416
+ }), (!Me() || !Pa()) && (await M().getRolePermits(a.Id), this.appInfo.Routes.length && this.setAppRoutes(this.appInfo.Routes)));
698
417
  },
699
418
  /**
700
419
  * 设置当前应用路由信息
@@ -709,18 +428,18 @@ const Ja = (e) => {
709
428
  };
710
429
  const t = this.appInfo.flattenRoutes;
711
430
  for (const a of e)
712
- na(a, t, void 0);
431
+ ea(a, t, void 0);
713
432
  if (Object.keys(t).forEach((a) => {
714
433
  const s = t[a];
715
434
  s.children || !s.component || (s.meta && s.meta.keepAlive === !1 ? this.ExcludeComponents.push(a) : this.CachedComponents.push(a));
716
- }), j().isLogin) {
717
- const a = ra(this.appInfo.Routes);
718
- if (Ka(a), this.appInfo.defaultPage = oa(a) || "", this.appInfo.defaultPage) {
719
- if (this.menuLoaded = !0, N.value && N.value.mainAppPush) {
435
+ }), M().isLogin) {
436
+ const a = aa(this.appInfo.Routes);
437
+ if (_a(a), this.appInfo.defaultPage = ta(a) || "", this.appInfo.defaultPage) {
438
+ if (this.menuLoaded = !0, W.value && W.value.mainAppPush) {
720
439
  const s = this.formatRoute(this.appInfo.defaultPage);
721
- N.value.mainAppPush(s);
440
+ W.value.mainAppPush(s);
722
441
  }
723
- Ja(this.appInfo.defaultPage);
442
+ Da(this.appInfo.defaultPage);
724
443
  }
725
444
  }
726
445
  },
@@ -738,10 +457,10 @@ const Ja = (e) => {
738
457
  * @param path 路由地址
739
458
  */
740
459
  push(e) {
741
- this.findRoute(e) && Je().setTabActive(e), ga(() => {
742
- if (oe.push({ path: e }), N.value && N.value.mainAppPush) {
460
+ this.findRoute(e) && He().setTabActive(e), ma(() => {
461
+ if (Ee.push({ path: e }), W.value && W.value.mainAppPush) {
743
462
  const a = this.formatRoute(e);
744
- N.value.mainAppPush(a);
463
+ W.value.mainAppPush(a);
745
464
  }
746
465
  });
747
466
  },
@@ -760,7 +479,7 @@ const Ja = (e) => {
760
479
  * @returns 组件实例
761
480
  */
762
481
  cacheComponent(e, t) {
763
- let a = Fe.get(t.path);
482
+ let a = $e.get(t.path);
764
483
  if (!a)
765
484
  if (this.CachedComponents.includes(t.path))
766
485
  a = {
@@ -769,7 +488,7 @@ const Ja = (e) => {
769
488
  render() {
770
489
  return U(e);
771
490
  }
772
- }, Fe.set(t.path, a);
491
+ }, $e.set(t.path, a);
773
492
  else return e;
774
493
  return a;
775
494
  },
@@ -778,7 +497,7 @@ const Ja = (e) => {
778
497
  * @param path 路由地址
779
498
  */
780
499
  excludeComponent(e) {
781
- this.ExcludeComponents.includes(e) || this.ExcludeComponents.push(e), this.CachedComponents.splice(this.CachedComponents.indexOf(e), 1), Fe.delete(e);
500
+ this.ExcludeComponents.includes(e) || this.ExcludeComponents.push(e), this.CachedComponents.splice(this.CachedComponents.indexOf(e), 1), $e.delete(e);
782
501
  },
783
502
  /**
784
503
  * 路由路径层级查询,返回面包屑
@@ -798,8 +517,8 @@ const Ja = (e) => {
798
517
  AppCode: "",
799
518
  Version: "",
800
519
  Host: "",
801
- Source: ze.Manual,
802
- Action: Be.App,
520
+ Source: Be.Manual,
521
+ Action: qe.App,
803
522
  Path: "",
804
523
  Icon: "",
805
524
  Routes: [],
@@ -809,11 +528,11 @@ const Ja = (e) => {
809
528
  }, this.CachedComponents.splice(0, this.CachedComponents.length), this.ExcludeComponents.splice(0, this.ExcludeComponents.length), this.appList.splice(0, this.appList.length), this.menuLoaded = !1;
810
529
  },
811
530
  logout() {
812
- this.clean(), oe.push({ path: Ie + "#/" }), Se() && N.value && N.value.mainAppPush && N.value.mainAppPush(Ie + "#/");
531
+ this.clean(), window.location.assign("/");
813
532
  }
814
533
  },
815
534
  persist: !1
816
- }), ia = "Token解析失败", Ce = "登录过期,请重新登录", je = {
535
+ }), Qa = "Token解析失败", Ae = 1400, Ve = {
817
536
  login: {
818
537
  api: "PLATFORM_API",
819
538
  url: "/openapi/LoginSrv/login",
@@ -831,48 +550,43 @@ const Ja = (e) => {
831
550
  url: "/api/LoginSrv/logout",
832
551
  loadingText: "正在退出..."
833
552
  }
834
- }, Ba = (e) => {
553
+ }, Ja = (e) => {
835
554
  let t = {
836
555
  Option: {
837
556
  Mode: "MicroApp"
838
557
  },
839
558
  Query: e
840
559
  };
841
- return G(je.login, t).then((a) => (a == null ? void 0 : a.status) === T.SUCCESS ? a : null);
842
- }, za = (e) => {
560
+ return j(Ve.login, t).then((a) => (a == null ? void 0 : a.status) === T.SUCCESS ? a : null);
561
+ }, ja = (e) => {
843
562
  let t = {
844
563
  Query: {
845
564
  AppId: e
846
565
  }
847
566
  };
848
- return G(je.auth, t).then((a) => (a == null ? void 0 : a.status) === T.SUCCESS ? a.data : (x.error("获取授权信息失败," + (a == null ? void 0 : a.msg)), null));
849
- }, Ca = () => {
567
+ return j(Ve.auth, t).then((a) => {
568
+ if ((a == null ? void 0 : a.status) === T.SUCCESS)
569
+ return a.data;
570
+ if ((a == null ? void 0 : a.errno) == Ae) {
571
+ M().logout(!1);
572
+ return;
573
+ }
574
+ return x.error("获取授权信息失败," + (a == null ? void 0 : a.msg)), null;
575
+ });
576
+ }, Ga = () => {
850
577
  let e = {
851
578
  Option: {},
852
579
  Query: {}
853
580
  };
854
- return G(je.logout, e).then((t) => (t == null ? void 0 : t.status) === T.SUCCESS ? t.data : null);
855
- }, Ya = (e) => {
856
- try {
857
- const a = JSON.parse(atob(e.split(".")[1])).exp;
858
- return Date.now() / 1e3 > a;
859
- } catch (t) {
860
- return console.error(ia, t), !0;
861
- }
862
- }, Me = (e, t) => e == "" ? (x.error(Ce, {
863
- duration: 3e3,
864
- onClose: t
865
- }), !1) : Ya(e) ? (x.error(Ce, {
866
- duration: 3e3,
867
- onClose: t
868
- }), !1) : !0, Xa = (e) => {
581
+ return j(Ve.logout, e).then((t) => (t == null ? void 0 : t.status) === T.SUCCESS ? t.data : null);
582
+ }, Wa = (e) => {
869
583
  try {
870
584
  const t = JSON.parse(atob(e.token.split(".")[1]));
871
585
  return t.user = JSON.parse(t.user), e.UserInfo = t.user, !0;
872
586
  } catch (t) {
873
- return console.error(ia, t), !1;
587
+ return console.error(Qa, t), !1;
874
588
  }
875
- }, k = f(""), ee = f(null), j = ue("userInfo", {
589
+ }, k = f(""), ee = f(null), M = le("userInfo", {
876
590
  state: () => ({
877
591
  isLogin: !1,
878
592
  userInfo: {
@@ -890,7 +604,7 @@ const Ja = (e) => {
890
604
  * 启动时初始化用户信息
891
605
  */
892
606
  init() {
893
- Se() || (this.token ? (Me(this.token, () => this.clean()), me(this.token), k.value = this.userInfo.UserLevel, this.isLogin = !0) : this.clean());
607
+ Me() || (this.token ? (he(this.token), k.value = this.userInfo.UserLevel, this.isLogin = !0) : this.clean());
894
608
  },
895
609
  /**
896
610
  * 登录操作
@@ -898,14 +612,14 @@ const Ja = (e) => {
898
612
  * @returns
899
613
  */
900
614
  async login(e, t) {
901
- const a = await Ba(e);
615
+ const a = await Ja(e);
902
616
  if (a) {
903
617
  const s = a;
904
618
  if (s.errno)
905
619
  return s;
906
620
  {
907
621
  const n = a.data;
908
- if (this.token = n.token, me(this.token), this.isLogin = !0, Xa(n))
622
+ if (this.token = n.token, he(this.token), this.isLogin = !0, Wa(n))
909
623
  this.userInfo = {
910
624
  ...this.userInfo,
911
625
  ...n.UserInfo
@@ -929,7 +643,7 @@ const Ja = (e) => {
929
643
  if (ee.value && ee.value.appId === e)
930
644
  return !0;
931
645
  try {
932
- const t = await za(e);
646
+ const t = await ja(e);
933
647
  return t ? (ee.value = {
934
648
  appId: e,
935
649
  permits: t.permits || [],
@@ -972,23 +686,17 @@ const Ja = (e) => {
972
686
  * @param token 用户Token
973
687
  */
974
688
  setUserInfo(e, t) {
975
- if (!Me(t)) {
976
- this.clean();
977
- return;
978
- }
979
689
  k.value || (k.value = e.UserLevel, this.userInfo = {
980
690
  ...this.userInfo,
981
691
  ...e
982
- }, this.token = t, me(this.token), this.isLogin = !0);
692
+ }, this.token = t, he(this.token), this.isLogin = !0);
983
693
  },
984
694
  /**
985
695
  * 获取用户Token
986
696
  * @returns 用户Token
987
697
  */
988
698
  getToken() {
989
- return Me(this.token, () => {
990
- this.clean(), this.logout();
991
- }) ? this.token : "";
699
+ return this.token || (this.clean(), this.logout(!1)), "";
992
700
  },
993
701
  /**
994
702
  * 是否超级管理员
@@ -1019,19 +727,20 @@ const Ja = (e) => {
1019
727
  Code: "",
1020
728
  TenantId: "",
1021
729
  UserLevel: ""
1022
- }, this.token = "", me(this.token), this.isLogin = !1, ee.value = null, k.value = "", H().clean(), Promise.resolve();
730
+ }, this.token = "", he(this.token), this.isLogin = !1, ee.value = null, k.value = "", H().clean(), Promise.resolve();
1023
731
  },
1024
732
  /**
1025
733
  * 登出操作
734
+ * @param exit 是否主动退出应用
1026
735
  * @returns
1027
736
  */
1028
- async logout() {
737
+ async logout(e) {
1029
738
  try {
1030
- await Ca();
1031
- } catch (e) {
1032
- console.error("调用登出接口失败", e);
739
+ e && await Ga();
740
+ } catch (t) {
741
+ console.error("调用登出接口失败", t);
1033
742
  } finally {
1034
- await this.clean(), setTimeout(async () => {
743
+ await this.clean(), e && setTimeout(async () => {
1035
744
  x.success("已退出登录");
1036
745
  }, 1e3), setTimeout(async () => {
1037
746
  H().logout();
@@ -1040,7 +749,7 @@ const Ja = (e) => {
1040
749
  return Promise.resolve();
1041
750
  }
1042
751
  },
1043
- persist: Se() ? !1 : {
752
+ persist: Me() ? !1 : {
1044
753
  key: "MICROAPP_USER_INFO",
1045
754
  storage: localStorage,
1046
755
  pick: ["token", "userInfo"],
@@ -1049,9 +758,295 @@ const Ja = (e) => {
1049
758
  e.store.init();
1050
759
  }
1051
760
  }
1052
- }), Qt = (e, t) => {
1053
- const a = j();
1054
- return e.filter((n) => n.role && !a.hasRole(n.role) || n.permit && !a.hasPermit(oe.currentRoute.value.path, n.permit) || n.enabled === !1 ? !1 : typeof n.enabled == "function" ? n.enabled() : !0).filter((n) => {
761
+ }), Oe = (e, t) => {
762
+ var n;
763
+ const a = e.page;
764
+ return {
765
+ url: "",
766
+ ...e.url,
767
+ ...(n = a.urls) == null ? void 0 : n[t.urlKey],
768
+ ...t.url,
769
+ loadingText: t.loadingText
770
+ };
771
+ }, Re = (e, t) => {
772
+ const a = e.page, s = t.url;
773
+ if (!s || !s.url) {
774
+ const o = `URL未设置: ${t.urlKey}`;
775
+ return console.warn(o), Promise.reject(new Error(o));
776
+ }
777
+ s.api || (s.api = a.api), s.authorize === void 0 && (s.authorize = a.authorize);
778
+ let n = ue(
779
+ JSON.parse(JSON.stringify(s.params ?? {})),
780
+ JSON.parse(JSON.stringify(t.params ?? {}))
781
+ );
782
+ return t.processParams && (n = t.processParams(n)), t.loadingState && (t.loadingState.value = !0), t.hideErrorToast && (s.hideErrorToast = !0), j(s, n).then((o) => (t.loadingState && (t.loadingState.value = !1), (o == null ? void 0 : o.errno) == Ae ? (M().logout(!1), null) : o)).catch((o) => (t.loadingState && (t.loadingState.value = !1), null));
783
+ }, Ke = (e, t) => {
784
+ t.params || (t.params = {}), t.params.Query || (t.params.Query = {});
785
+ const a = Oe(e, t);
786
+ return t.url = a, Re(e, t);
787
+ }, kt = (e, t) => (t.params || (t.params = {}), t.params.Query || (t.params.Query = {}), t.loadingText = t.loadingText === !1 ? !1 : t.loadingText || "开始执行...", t.url = Oe(e, t), Re(e, t).then((a) => ((a == null ? void 0 : a.status) === T.SUCCESS && (t.hideErrorToast || x.success("执行成功!")), a))), sa = (e, t = {}) => {
788
+ const a = t.primaryKey || "Id";
789
+ if (t.params || (t.params = {}), t.params.Query || (t.params.Query = {}), !t.params.Data)
790
+ return x.error("错误!无保存数据!"), Promise.resolve(null);
791
+ const s = {
792
+ ...t,
793
+ urlKey: t.urlKey || "save",
794
+ loadingText: t.loadingText === !1 ? !1 : t.loadingText || "数据保存中..."
795
+ };
796
+ s.params.Query[a] = s.params.Data[a];
797
+ const n = Oe(e, s);
798
+ return s.url = n, Re(e, s).then((o) => ((o == null ? void 0 : o.status) === T.SUCCESS && (t.hideErrorToast || x.success("保存成功!")), o));
799
+ }, qa = (e, t, a = {}) => {
800
+ const s = a.primaryKey || "Id";
801
+ a.params || (a.params = {}), a.params.Query || (a.params.Query = {});
802
+ const n = {
803
+ ...a,
804
+ urlKey: "delete",
805
+ loadingText: a.loadingText === !1 ? !1 : a.loadingText || "数据删除中..."
806
+ };
807
+ if (Array.isArray(t) ? n.params.Query[s] = t : n.params.Query[s] = t[s], F(n.params.Query) || F(n.params.Query[s]))
808
+ return x.error("错误!禁止无条件删除数据!"), Promise.resolve(null);
809
+ const o = Oe(e, n);
810
+ return n.url = o, Re(e, n).then((r) => ((r == null ? void 0 : r.status) === T.SUCCESS && (a.hideErrorToast || x.success("删除成功!")), r));
811
+ }, Ba = (e, t) => Ke(e, {
812
+ urlKey: "tree",
813
+ params: {},
814
+ loadingState: e.isTreeLoading,
815
+ loadingText: !1,
816
+ processParams: () => ue(e.treeQuery, t)
817
+ }).then((a) => (a == null ? void 0 : a.status) === T.SUCCESS ? (e.data.value = a.data || [], e.afterLoad && e.afterLoad(e.data.value), e.data.value) : (e.afterLoad && e.afterLoad((a == null ? void 0 : a.data) || []), []));
818
+ let re;
819
+ const Lt = (e) => {
820
+ re = new Ue({}), re.messages({
821
+ required: "${label}不能为空",
822
+ types: {
823
+ number: "${label}必须是数字"
824
+ },
825
+ enum: "${label}必须是${enum}中的一个",
826
+ string: {
827
+ len: "${label}长度必须为${len}",
828
+ min: "${label}长度不能小于${min}",
829
+ max: "${label}长度不能大于${max}",
830
+ range: "${label}长度必须在${min}和${max}之间"
831
+ },
832
+ number: {
833
+ len: "${label}必须为${len}",
834
+ min: "${label}不能小于${min}",
835
+ max: "${label}不能大于${max}",
836
+ range: "${label}必须在${min}和${max}之间"
837
+ },
838
+ array: {
839
+ len: "${label}长度必须为${len}",
840
+ min: "${label}长度不能小于${min}",
841
+ max: "${label}长度不能大于${max}",
842
+ range: "${label}长度必须在${min}和${max}之间"
843
+ },
844
+ ...e
845
+ });
846
+ }, $t = (e) => {
847
+ if (!e || F(e))
848
+ return [];
849
+ const t = [], a = re.messages(), s = (o, r, l) => {
850
+ const u = r.type;
851
+ if (u && a.types && u in a.types) {
852
+ const c = a.types[u];
853
+ n(c, o, { type: u }, l);
854
+ }
855
+ const i = ["string", "number", "array"];
856
+ for (const c of i)
857
+ if (u === c && a[c]) {
858
+ const d = a[c], v = ["len", "min", "max", "range"];
859
+ for (const p of v)
860
+ p === "range" && r.min != null && r.max != null && d.range ? n(d.range, o, { min: r.min, max: r.max }, l) : p !== "range" && r[p] != null && d[p] && n(d[p], o, { [p]: r[p] }, l);
861
+ }
862
+ if (r.required && a.required && n(a.required, o, {}, l), r.pattern && a.pattern && n(r.message, o, {}, l), r.enum && Array.isArray(r.enum) && a.enum) {
863
+ const c = r.enum.join(", ");
864
+ n(a.enum, o, { enum: c }, l);
865
+ }
866
+ }, n = (o, r, l, u) => {
867
+ if (o)
868
+ try {
869
+ let i;
870
+ if (typeof o == "function") {
871
+ const c = [r];
872
+ for (const d in l)
873
+ c.push(l[d]);
874
+ i = o.apply(null, c), i && u.push(i);
875
+ } else {
876
+ i = String(o);
877
+ for (const c in l)
878
+ i = i.replace(new RegExp(`\\$\\{${c}\\}`, "g"), l[c]);
879
+ i = i.replace(/\$\{label\}/g, ""), i && u.push(i);
880
+ }
881
+ } catch (i) {
882
+ console.error("格式化验证消息出错:", i);
883
+ }
884
+ };
885
+ return Object.keys(e).forEach((o) => {
886
+ const r = e[o], l = [];
887
+ try {
888
+ s(o, r, l), Array.isArray(r) && r.forEach((i) => {
889
+ i && typeof i == "object" && s(o, i, l);
890
+ }), r && typeof r == "object" && "fields" in r;
891
+ } catch (i) {
892
+ console.error("处理验证规则出错:", i);
893
+ }
894
+ const u = Array.from(new Set(l));
895
+ o && u.length > 0 && t.push({
896
+ field: o,
897
+ rules: u
898
+ });
899
+ }), t;
900
+ }, fe = async (e) => {
901
+ const t = e.formData.value, a = e.formRules.value;
902
+ F(a) || (Qe(e), e.ruleValidator || (e.ruleValidator = new Ue({}), e.ruleValidator.messages(re.messages()), e.ruleValidator.define(a)), e.ruleResults.value = await e.ruleValidator.validate(t).then(() => {
903
+ }).catch(({ fields: s }) => s));
904
+ }, Ft = async (e, t, a) => (a || (a = new Ue({}), a.messages(re.messages()), a.define(t)), a.validate(e).then(() => {
905
+ }).catch(({ fields: s }) => s)), Qe = (e) => {
906
+ e.ruleResults.value = void 0;
907
+ }, Y = () => {
908
+ const e = te(D.EditorControl, void 0), t = f(te(D.LabelText, "")), a = f(te(D.RuleKey, "")), s = te(D.ErrInfo, void 0);
909
+ return {
910
+ editorCtrl: e,
911
+ labelText: t,
912
+ ruleKey: a,
913
+ errInfo: s
914
+ };
915
+ }, za = (e, t) => {
916
+ let a = f({
917
+ msg: "",
918
+ errClass: ""
919
+ });
920
+ if (!e.label || !e.rule)
921
+ return a;
922
+ const s = t == null ? void 0 : t.ruleResults;
923
+ return g(
924
+ () => s == null ? void 0 : s.value,
925
+ (n) => {
926
+ if (a.value.errClass = "", a.value.msg = "", !F(n)) {
927
+ const o = Ca(
928
+ {
929
+ label: e.label,
930
+ rule: e.rule
931
+ },
932
+ t == null ? void 0 : t.formRules.value,
933
+ Xe(n)
934
+ );
935
+ a.value.errClass = o.errClass.value, a.value.msg = o.msg.value;
936
+ }
937
+ },
938
+ { deep: !0 }
939
+ ), a;
940
+ }, Ca = (e, t, a) => {
941
+ const s = f([]), n = f(""), o = f("");
942
+ if (!e.rule || !t || !a)
943
+ return { msg: n, ruleErrors: s, errClass: o };
944
+ e.rule.split("|").forEach((u) => {
945
+ if (u = u.trim(), u)
946
+ if (a[u])
947
+ s.value.push(...a[u]);
948
+ else {
949
+ const i = [];
950
+ for (let c in a)
951
+ c !== u && c.startsWith(u + ".") && i.push(...a[c]);
952
+ i.length > 0 && s.value.push(...i);
953
+ }
954
+ });
955
+ const l = /\${\w+}/g;
956
+ return s.value.forEach((u) => {
957
+ n.value && (n.value += " / "), n.value += u.message.replace("${label}", e.label ?? "");
958
+ const i = t[u.field];
959
+ if (i) {
960
+ const c = n.value.match(l);
961
+ c && c.forEach((d) => {
962
+ const v = d.replace("${", "").replace("}", "");
963
+ n.value = n.value.replace(d, i[v] ?? "");
964
+ });
965
+ }
966
+ }), s.value.length > 0 && (o.value = "error"), { msg: n, ruleErrors: s, errClass: o };
967
+ }, Mt = (e, t) => {
968
+ ke(D.LabelText, e.label || ""), ke(D.RuleKey, e.rule || "");
969
+ const a = za(e, t);
970
+ return ke(D.ErrInfo, a), a;
971
+ }, _t = (e) => {
972
+ na(e);
973
+ }, Nt = (e) => {
974
+ const t = e.page, a = e.formData.value;
975
+ a[e.primaryKey ?? t.primaryKey] = null, na(e);
976
+ }, Dt = (e) => {
977
+ Je(e), e.visible.value = !1;
978
+ }, na = async (e) => {
979
+ var s;
980
+ const t = e.page;
981
+ if (e.isFormSaving.value = !0, Qe(e), e.beforeSave && e.beforeSave() === !1)
982
+ return e.isFormSaving.value = !1, Promise.resolve();
983
+ if (e.formRules.value && await fe(e), e.ruleResults.value)
984
+ return x.error("提交表单时,验证失败!"), console.error("表单验证失败!", e.ruleResults.value), e.isFormSaving.value = !1, Promise.resolve();
985
+ const a = e.formData.value;
986
+ return sa(
987
+ {
988
+ page: t,
989
+ // 转换为AnyControl接口
990
+ reload: (s = e.grid) == null ? void 0 : s.reload
991
+ },
992
+ {
993
+ url: e.saveUrl,
994
+ primaryKey: e.primaryKey ?? t.primaryKey,
995
+ params: {
996
+ Data: a,
997
+ Query: {}
998
+ },
999
+ hideErrorToast: !0,
1000
+ // 隐藏自动错误提示,特殊判断控制
1001
+ loadingState: e.isFormSaving
1002
+ }
1003
+ ).then((n) => {
1004
+ var o, r;
1005
+ if ((n == null ? void 0 : n.status) === T.SUCCESS)
1006
+ x.success("保存成功!"), e.grid && (e.grid.reload.value = !0), e.afterSave && e.afterSave(n), e.autoClose !== !1 && (e.visible.value = !1);
1007
+ else if (n != null && n.msg && ((o = n == null ? void 0 : n.msg) == null ? void 0 : o.indexOf("Duplicate entry")) > -1) {
1008
+ const l = (r = n == null ? void 0 : n.msg) == null ? void 0 : r.match(/Duplicate entry '([^']+)' for key '([^']+)'/);
1009
+ if (l && l.length > 2 && l[1] && l[2]) {
1010
+ const u = l[1], i = l[2].replace(/Idx_/g, "").split("_"), c = e.formRules.value;
1011
+ if (c && i.length > 0) {
1012
+ const d = {};
1013
+ i.forEach((v) => {
1014
+ c[v] && (d[v] = [
1015
+ {
1016
+ field: v,
1017
+ fieldValue: u,
1018
+ message: "数据重复"
1019
+ }
1020
+ ]);
1021
+ }), Object.keys(d).length > 0 && (console.error("保存失败!", d), e.ruleResults.value = d);
1022
+ }
1023
+ x.error(`保存失败!数据 \`${u}\` 已存在!`);
1024
+ } else x.error((n == null ? void 0 : n.msg) ?? "保存失败!");
1025
+ e.afterSave && e.afterSave(n);
1026
+ } else
1027
+ x.error((n == null ? void 0 : n.msg) ?? "保存失败!"), e.afterSave && e.afterSave(n);
1028
+ });
1029
+ }, Ut = async (e) => {
1030
+ const t = e.page, a = e.grid;
1031
+ e.isFormLoading.value = !0;
1032
+ const s = e.formData.value, n = e.primaryKey ?? t.primaryKey;
1033
+ return ia(a, { [n]: s[n] }, e.detailUrl).then((o) => {
1034
+ e.isFormLoading.value = !1, o && ra(e, o);
1035
+ });
1036
+ }, Ht = (e) => {
1037
+ const t = e.grid;
1038
+ t && (t.rowData.value = void 0), e && (Je(e), e.visible && (e.visible.value = !1), setTimeout(() => {
1039
+ e.visible.value = !0;
1040
+ }, 1));
1041
+ }, ra = (e, t) => {
1042
+ Je(e);
1043
+ const a = { ...e.formData.value, ...t };
1044
+ e.formData.value = JSON.parse(JSON.stringify(a));
1045
+ }, Je = (e) => {
1046
+ e.formData.value = e.default ? JSON.parse(JSON.stringify(e.default)) : {}, Qe(e);
1047
+ }, Vt = (e, t) => {
1048
+ const a = M();
1049
+ return e.filter((n) => n.role && !a.hasRole(n.role) || n.permit && !a.hasPermit(Ee.currentRoute.value.path, n.permit) || n.enabled === !1 ? !1 : typeof n.enabled == "function" ? n.enabled() : !0).filter((n) => {
1055
1050
  if (!t) {
1056
1051
  if (n.visible === !1)
1057
1052
  return !1;
@@ -1060,7 +1055,7 @@ const Ja = (e) => {
1060
1055
  }
1061
1056
  return !0;
1062
1057
  });
1063
- }, Jt = (e, t) => {
1058
+ }, Kt = (e, t) => {
1064
1059
  const a = t == null ? void 0 : t.filter((s) => {
1065
1060
  const n = e.find(
1066
1061
  (o) => o.dataIndex === s.dataIndex || o.key === s.key || o.title === s.title
@@ -1068,17 +1063,17 @@ const Ja = (e) => {
1068
1063
  return n ? { ...s, ...n } : !1;
1069
1064
  });
1070
1065
  return [...a || [], ...e.filter((s) => !(a != null && a.includes(s)))];
1071
- }, Za = (e) => (e.remotePage = !1, la(e).then((t) => t.rows)), la = (e) => {
1066
+ }, Ya = (e) => (e.remotePage = !1, oa(e).then((t) => t.rows)), oa = (e) => {
1072
1067
  e.gridQuery || (e.gridQuery = {});
1073
1068
  const t = e.remotePage ? "find" : "list";
1074
- return Ve(e, {
1069
+ return Ke(e, {
1075
1070
  urlKey: t,
1076
1071
  url: e.gridUrl,
1077
1072
  params: e.gridQuery,
1078
1073
  loadingState: e.isGridLoading,
1079
1074
  processParams: (a) => {
1080
1075
  var n;
1081
- return e.remotePage && (a.Query.$limit = [(e.pageNo.value - 1) * e.pageSize.value, e.pageSize.value]), ce((n = e.gridUrl) == null ? void 0 : n.params, a, e.gridQuery);
1076
+ return e.remotePage && (a.Query.$limit = [(e.pageNo.value - 1) * e.pageSize.value, e.pageSize.value]), ue((n = e.gridUrl) == null ? void 0 : n.params, a, e.gridQuery);
1082
1077
  }
1083
1078
  }).then((a) => {
1084
1079
  if ((a == null ? void 0 : a.status) === T.SUCCESS) {
@@ -1096,7 +1091,7 @@ const Ja = (e) => {
1096
1091
  rows: []
1097
1092
  };
1098
1093
  });
1099
- }, et = (e, t, a = {}) => aa(e, {
1094
+ }, Xa = (e, t, a = {}) => sa(e, {
1100
1095
  urlKey: "update",
1101
1096
  url: e.updateUrl,
1102
1097
  params: {
@@ -1107,37 +1102,37 @@ const Ja = (e) => {
1107
1102
  ...a
1108
1103
  }).then((s) => ((s == null ? void 0 : s.status) === T.SUCCESS && setTimeout(() => {
1109
1104
  e.reload.value = !0, e.afterUpdate && e.afterUpdate(t);
1110
- }, 50), s)), jt = (e, t) => {
1105
+ }, 50), s)), Qt = (e, t) => {
1111
1106
  const a = {};
1112
- return a[e.primaryKey] = t[e.primaryKey], a[e.statusKey] = t[e.statusKey], et(e, a, {
1107
+ return a[e.primaryKey] = t[e.primaryKey], a[e.statusKey] = t[e.statusKey], Xa(e, a, {
1113
1108
  loadingText: !1,
1114
1109
  hideErrorToast: !0
1115
1110
  });
1116
- }, ua = async (e, t, a) => await Ve(e, {
1111
+ }, ia = async (e, t, a) => await Ke(e, {
1117
1112
  urlKey: "detail",
1118
1113
  url: a,
1119
1114
  params: t,
1120
1115
  loadingState: e.isGridLoading
1121
- }), Gt = (e, t) => {
1116
+ }), Jt = (e, t) => {
1122
1117
  const a = t;
1123
- return ua(e, { [e.primaryKey]: a[e.primaryKey] }).then((s) => ((s == null ? void 0 : s.status) === T.SUCCESS && s.data && (e.expandRows.value[a[e.primaryKey]] = s), s));
1124
- }, Wt = (e, t) => {
1118
+ return ia(e, { [e.primaryKey]: a[e.primaryKey] }).then((s) => ((s == null ? void 0 : s.status) === T.SUCCESS && s.data && (e.expandRows.value[a[e.primaryKey]] = s), s));
1119
+ }, jt = (e, t) => {
1125
1120
  let a = e.editor;
1126
- e.rowData.value = t, a && (sa(a, t), a.visible.value = !0);
1127
- }, qt = (e, t) => Da(e, t, {
1121
+ e.rowData.value = t, a && (ra(a, t), a.visible.value = !0);
1122
+ }, Gt = (e, t) => qa(e, t, {
1128
1123
  url: e.deleteUrl,
1129
1124
  primaryKey: e.primaryKey
1130
1125
  }).then((a) => ((a == null ? void 0 : a.status) === T.SUCCESS && setTimeout(() => {
1131
1126
  e.reload.value = !0, e.afterDelete && !Array.isArray(t) && e.afterDelete(t);
1132
1127
  }, 50), a));
1133
- var Ne = /* @__PURE__ */ ((e) => (e.SelectReload = "Select.Reload", e.RadioReload = "Radio.Reload", e.CheckboxReload = "Checkbox.Reload", e.TreeSelectReload = "TreeSelect.Reload", e.TreeCheckReload = "TreeCheck.Reload", e))(Ne || {});
1134
- class at {
1128
+ var _e = /* @__PURE__ */ ((e) => (e.SelectReload = "Select.Reload", e.RadioReload = "Radio.Reload", e.CheckboxReload = "Checkbox.Reload", e.TreeSelectReload = "TreeSelect.Reload", e.TreeCheckReload = "TreeCheck.Reload", e))(_e || {});
1129
+ class Za {
1135
1130
  constructor() {
1136
1131
  $(this, "listeners", {});
1137
1132
  }
1138
1133
  // 检查事件名是否符合前缀
1139
1134
  isValidPrefix(t) {
1140
- return Object.values(Ne).some((a) => t.startsWith(a + "."));
1135
+ return Object.values(_e).some((a) => t.startsWith(a + "."));
1141
1136
  }
1142
1137
  /**
1143
1138
  * 事件订阅
@@ -1146,7 +1141,7 @@ class at {
1146
1141
  */
1147
1142
  on(t, a) {
1148
1143
  if (!this.isValidPrefix(t)) {
1149
- console.error(`事件前缀不正确: ${t}, 事件名必须以 ${Object.values(Ne).join(", ")} 开头`);
1144
+ console.error(`事件前缀不正确: ${t}, 事件名必须以 ${Object.values(_e).join(", ")} 开头`);
1150
1145
  return;
1151
1146
  }
1152
1147
  this.listeners[t] || (this.listeners[t] = []), this.listeners[t].push(a);
@@ -1177,51 +1172,51 @@ class at {
1177
1172
  this.listeners[t] && this.listeners[t].forEach((s) => s(t, ...a));
1178
1173
  }
1179
1174
  }
1180
- const q = new at(), Z = (e, t, a) => {
1175
+ const q = new Za(), Z = (e, t, a) => {
1181
1176
  if (t.inputFactory && (a != null && a.reloadEvent)) {
1182
1177
  const s = t.inputFactory.value;
1183
1178
  s.reloadHandler = (n, o) => {
1184
- tt(t.url, t, o);
1179
+ et(t.url, t, o);
1185
1180
  }, q.on(a.reloadEvent, s.reloadHandler);
1186
1181
  }
1187
1182
  if (a != null && a.data)
1188
1183
  g(
1189
1184
  () => a.data,
1190
1185
  () => {
1191
- Ge(t, a.data, !0);
1186
+ je(t, a.data, !0);
1192
1187
  },
1193
1188
  { deep: !0, immediate: !0 }
1194
1189
  );
1195
1190
  else if (t.url && t.url.url)
1196
- e && ca(t.url, t, t.params ?? {});
1191
+ e && la(t.url, t, t.params ?? {});
1197
1192
  else {
1198
1193
  const s = f(te(D.LabelText, ""));
1199
1194
  x.error("`" + s.value + "` 未配置选项数据!", {
1200
1195
  duration: 5e3
1201
1196
  });
1202
1197
  }
1203
- }, Ge = (e, t, a) => {
1198
+ }, je = (e, t, a) => {
1204
1199
  if (a) {
1205
1200
  const s = {
1206
1201
  ...e.fieldMap
1207
1202
  };
1208
- t = $a(s, t);
1203
+ t = ka(s, t);
1209
1204
  }
1210
1205
  t = JSON.parse(JSON.stringify(t ?? [])), e.all && t.unshift({
1211
1206
  label: "全部",
1212
1207
  value: e.allValue ?? void 0
1213
1208
  }), e.options.value = t;
1214
- }, tt = (e, t, a) => {
1215
- Array.isArray(a) ? Ge(t, a, !0) : ca(e, t, a);
1209
+ }, et = (e, t, a) => {
1210
+ Array.isArray(a) ? je(t, a, !0) : la(e, t, a);
1216
1211
  }, de = (e, t) => {
1217
1212
  var a;
1218
1213
  (a = e.inputFactory) != null && a.value && t.reloadEvent && e.inputFactory.value.reloadHandler && q.off(t.reloadEvent, e.inputFactory.value.reloadHandler);
1219
- }, ca = (e, t, a) => {
1220
- const s = JSON.parse(JSON.stringify(e.params ?? {})), n = JSON.parse(JSON.stringify(t.params ?? {})), o = ce(s, n, a);
1221
- st(e, t, t.fieldMap, o).then((r) => {
1222
- Ge(t, r, !1);
1214
+ }, la = (e, t, a) => {
1215
+ const s = JSON.parse(JSON.stringify(e.params ?? {})), n = JSON.parse(JSON.stringify(t.params ?? {})), o = ue(s, n, a);
1216
+ at(e, t, t.fieldMap, o).then((r) => {
1217
+ je(t, r, !1);
1223
1218
  });
1224
- }, st = (e, t, a, s) => {
1219
+ }, at = (e, t, a, s) => {
1225
1220
  const { fieldMap: n, ...o } = e, l = {
1226
1221
  ...{
1227
1222
  url: "",
@@ -1233,10 +1228,19 @@ const q = new at(), Z = (e, t, a) => {
1233
1228
  },
1234
1229
  ...o
1235
1230
  };
1236
- return l.loadingText = !1, s || (s = {}), s.Query || (s.Query = {}), t.optionQuery = s, t.isOptionLoading.value = !0, G(l, s).then((u) => (u == null ? void 0 : u.status) === T.SUCCESS && u.data ? u.data : []).finally(() => {
1231
+ return l.loadingText = !1, s || (s = {}), s.Query || (s.Query = {}), t.optionQuery = s, t.isOptionLoading.value = !0, j(l, s).then((u) => {
1232
+ if ((u == null ? void 0 : u.status) === T.SUCCESS) {
1233
+ if (u.data)
1234
+ return u.data;
1235
+ } else if ((u == null ? void 0 : u.errno) == Ae) {
1236
+ M().logout(!1);
1237
+ return;
1238
+ }
1239
+ return [];
1240
+ }).finally(() => {
1237
1241
  t.isOptionLoading.value = !1;
1238
1242
  });
1239
- }, nt = (e, t, a) => {
1243
+ }, tt = (e, t, a) => {
1240
1244
  if (e === void 0) return;
1241
1245
  const s = (o) => {
1242
1246
  const r = { ...o };
@@ -1256,7 +1260,7 @@ const q = new at(), Z = (e, t, a) => {
1256
1260
  const o = n([e], t);
1257
1261
  return o.length > 0 ? o[0] : void 0;
1258
1262
  }
1259
- }, we = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((t) => t.label) : [e.label], ae = (e, t, a) => {
1263
+ }, Te = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((t) => t.label) : [e.label], ae = (e, t, a) => {
1260
1264
  const s = t.split(".");
1261
1265
  let n = e;
1262
1266
  for (let o = 0; o < s.length - 1; o++) {
@@ -1264,7 +1268,7 @@ const q = new at(), Z = (e, t, a) => {
1264
1268
  n[r] || (n[r] = {}), n = n[r];
1265
1269
  }
1266
1270
  n[s[s.length - 1]] = a;
1267
- }, fa = (e, t, a) => {
1271
+ }, ua = (e, t, a) => {
1268
1272
  if (a == null) {
1269
1273
  Object.entries(t).forEach(([s]) => {
1270
1274
  ae(e, s, a);
@@ -1277,7 +1281,7 @@ const q = new at(), Z = (e, t, a) => {
1277
1281
  try {
1278
1282
  const l = parseInt(((r = n.match(/\$\{(\d+)\}/)) == null ? void 0 : r[1]) ?? "0"), u = a[l], i = n.replace(/\$\{\d+\}\./, "");
1279
1283
  if (i && u) {
1280
- const c = be(i, u);
1284
+ const c = ye(i, u);
1281
1285
  ae(e, s, c);
1282
1286
  } else
1283
1287
  ae(e, s, u);
@@ -1288,31 +1292,31 @@ const q = new at(), Z = (e, t, a) => {
1288
1292
  console.error("outFields 格式错误:" + n, "必须是 ${index} 或者 ${index}.${key}");
1289
1293
  }) : Object.entries(t).forEach(([s, n]) => {
1290
1294
  if (n.includes("${")) {
1291
- const o = be(n, a);
1295
+ const o = ye(n, a);
1292
1296
  ae(e, s, o);
1293
1297
  } else
1294
1298
  ae(e, s, a[n]);
1295
1299
  });
1296
- }, Pe = (e, t, a) => {
1300
+ }, we = (e, t, a) => {
1297
1301
  var o, r;
1298
1302
  const s = (o = e.inputFactory) == null ? void 0 : o.value;
1299
- s != null && s.editorCtrl && ((r = s.errInfo) != null && r.value.errClass) && pe(s.editorCtrl), e.selected.value = a;
1300
- const n = nt(a, e.options.value);
1301
- if (e.selectedOptions.value = n, t.formData && t.outFields && fa(t.formData, t.outFields, n), t.changeEvent) {
1303
+ s != null && s.editorCtrl && ((r = s.errInfo) != null && r.value.errClass) && fe(s.editorCtrl), e.selected.value = a;
1304
+ const n = tt(a, e.options.value);
1305
+ if (e.selectedOptions.value = n, t.formData && t.outFields && ua(t.formData, t.outFields, n), t.changeEvent) {
1302
1306
  const [l, u] = t.changeEvent;
1303
1307
  if (u)
1304
1308
  if (Array.isArray(l))
1305
1309
  l.every((i) => {
1306
- const c = be(u, { selectedValues: a });
1310
+ const c = ye(u, { selectedValues: a });
1307
1311
  try {
1308
- const p = JSON.parse(c);
1309
- q.emit(i, p, a, n);
1310
- } catch (p) {
1311
- console.error("eventParamsValue: ", c, p);
1312
+ const d = JSON.parse(c);
1313
+ q.emit(i, d, a, n);
1314
+ } catch (d) {
1315
+ console.error("eventParamsValue: ", c, d);
1312
1316
  }
1313
1317
  });
1314
1318
  else {
1315
- const i = be(u, { selectedValues: a });
1319
+ const i = ye(u, { selectedValues: a });
1316
1320
  try {
1317
1321
  const c = JSON.parse(i);
1318
1322
  q.emit(l, c, a, n);
@@ -1364,7 +1368,7 @@ const q = new at(), Z = (e, t, a) => {
1364
1368
  value: "Id"
1365
1369
  }
1366
1370
  }
1367
- }, Bt = (e) => {
1371
+ }, Wt = (e) => {
1368
1372
  S.PageOption = {
1369
1373
  ...S.PageOption,
1370
1374
  ...e.pageOption
@@ -1378,10 +1382,10 @@ const q = new at(), Z = (e, t, a) => {
1378
1382
  ...S.TreeOption,
1379
1383
  ...e.treeOption
1380
1384
  };
1381
- }, ke = (e) => {
1385
+ }, Pe = (e) => {
1382
1386
  for (let t in e.urls)
1383
1387
  e.urls[t].api || (e.urls[t].api = e.api), e.urls[t].authorize === void 0 && (e.urls[t].authorize = e.authorize);
1384
- }, rt = (e, t, a, s) => (ke(e), {
1388
+ }, st = (e, t, a, s) => (Pe(e), {
1385
1389
  editorCtrl: {
1386
1390
  ...S.EditorOption,
1387
1391
  name: "",
@@ -1397,8 +1401,8 @@ const q = new at(), Z = (e, t, a) => {
1397
1401
  isFormSaving: f(!1),
1398
1402
  isFormLoading: f(!1)
1399
1403
  }
1400
- }), ot = (e, t, a) => {
1401
- ke(e);
1404
+ }), nt = (e, t, a) => {
1405
+ Pe(e);
1402
1406
  const s = {
1403
1407
  ...S.GridOption,
1404
1408
  tableSize: f(S.GridOption.tableSize.value),
@@ -1431,13 +1435,13 @@ const q = new at(), Z = (e, t, a) => {
1431
1435
  (n) => {
1432
1436
  n && (setTimeout(() => {
1433
1437
  s.reload.value = !1;
1434
- }, 1), s.remotePage ? la(s) : Za(s));
1438
+ }, 1), s.remotePage ? oa(s) : Ya(s));
1435
1439
  }
1436
1440
  ), {
1437
1441
  gridCtrl: s
1438
1442
  };
1439
- }, zt = (e, t) => {
1440
- ke(e);
1443
+ }, qt = (e, t) => {
1444
+ Pe(e);
1441
1445
  const a = {
1442
1446
  ...S.TreeOption,
1443
1447
  reload: f(!1),
@@ -1452,12 +1456,12 @@ const q = new at(), Z = (e, t, a) => {
1452
1456
  (s) => {
1453
1457
  s && (setTimeout(() => {
1454
1458
  a.reload.value = !1;
1455
- }, 1), Ua(a));
1459
+ }, 1), Ba(a));
1456
1460
  }
1457
1461
  ), {
1458
1462
  treeCtrl: a
1459
1463
  };
1460
- }, he = (e, t) => {
1464
+ }, pe = (e, t) => {
1461
1465
  const a = {
1462
1466
  ...S.OptionOption,
1463
1467
  url: e,
@@ -1479,24 +1483,24 @@ const q = new at(), Z = (e, t, a) => {
1479
1483
  ), {
1480
1484
  optionCtrl: a
1481
1485
  };
1482
- }, Ct = (e, t, a) => {
1483
- ke(e);
1486
+ }, Bt = (e, t, a) => {
1487
+ Pe(e);
1484
1488
  const s = {
1485
1489
  ...S.PageOption,
1486
1490
  ...e
1487
- }, { editorCtrl: n } = rt(e, s, t, a), { gridCtrl: o } = ot(e, s);
1491
+ }, { editorCtrl: n } = st(e, s, t, a), { gridCtrl: o } = nt(e, s);
1488
1492
  return s.editor = n, s.grid = o, o.editor = n, o.tools = ["Reload", "RowHeight", "TableHeadset", "Fullscreen"], n.grid = o, {
1489
1493
  pageCtrl: s,
1490
1494
  editorCtrl: n,
1491
1495
  gridCtrl: o
1492
1496
  };
1493
- }, it = 7 * 24 * 60 * 60 * 1e3, _e = /* @__PURE__ */ new Map(), Ye = /* @__PURE__ */ new Set(), J = f({}), Yt = J, Xt = (e) => {
1497
+ }, rt = 7 * 24 * 60 * 60 * 1e3, Fe = /* @__PURE__ */ new Map(), Ce = /* @__PURE__ */ new Set(), J = f({}), zt = J, Ct = (e) => {
1494
1498
  var n;
1495
- if (!e.iconUrl) return De;
1499
+ if (!e.iconUrl) return Ne;
1496
1500
  const t = f(!0), a = f("");
1497
1501
  let s = !0;
1498
- return (n = e.icons) != null && n.length && (s = e.icons.every((o) => J.value[o] !== void 0)), (e.icon && !J.value[e.icon] || !s) && lt(e, t).then(() => {
1499
- ft(e.iconUrl, e.monoColor || !1), t.value = !0;
1502
+ return (n = e.icons) != null && n.length && (s = e.icons.every((o) => J.value[o] !== void 0)), (e.icon && !J.value[e.icon] || !s) && ot(e, t).then(() => {
1503
+ ut(e.iconUrl, e.monoColor || !1), t.value = !0;
1500
1504
  }), X({
1501
1505
  props: {
1502
1506
  icon: {
@@ -1536,54 +1540,54 @@ const q = new at(), Z = (e, t, a) => {
1536
1540
  ), g(
1537
1541
  () => u.value,
1538
1542
  (c) => {
1539
- o.icons && (c >= o.icons.length && (u.value = 0), l.value = o.icons[u.value], ve(a, l, l.value), r("update:iconIndex", u.value));
1543
+ o.icons && (c >= o.icons.length && (u.value = 0), l.value = o.icons[u.value], me(a, l, l.value), r("update:iconIndex", u.value));
1540
1544
  },
1541
1545
  { immediate: !0 }
1542
1546
  ), g(
1543
1547
  () => J.value,
1544
1548
  () => {
1545
- ve(a, l, l.value);
1549
+ me(a, l, l.value);
1546
1550
  },
1547
1551
  { deep: !0 }
1548
1552
  ), g(
1549
1553
  () => o.icon,
1550
1554
  (c) => {
1551
- ve(a, l, c);
1555
+ me(a, l, c);
1552
1556
  }
1553
- ), ve(a, l, l.value), { isLoaded: t, Icon: a, handleClick: i };
1557
+ ), me(a, l, l.value), { isLoaded: t, Icon: a, handleClick: i };
1554
1558
  },
1555
1559
  render() {
1556
1560
  if (!t.value)
1557
- return De;
1561
+ return Ne;
1558
1562
  let o = this.class, r = "";
1559
1563
  Array.isArray(o) ? r = o.join(" ") : typeof o == "string" && (r = o);
1560
1564
  let l = [r];
1561
- return !/\bw-/.test(r) && !/$w-/.test(r) && l.push("w-4"), !/\bh-/.test(r) && !/$h-/.test(r) && l.push("h-4"), a.value ? U(Ze(a.value), {
1565
+ return !/\bw-/.test(r) && !/$w-/.test(r) && l.push("w-4"), !/\bh-/.test(r) && !/$h-/.test(r) && l.push("h-4"), a.value ? U(Xe(a.value), {
1562
1566
  onClick: this.$props.clickable ? this.handleClick : void 0,
1563
1567
  class: `${l.join(" ")}`,
1564
1568
  style: {
1565
1569
  fill: "currentColor",
1566
1570
  cursor: this.$props.clickable ? "pointer" : "default",
1567
- transform: dt(this.angle, this.flip)
1571
+ transform: ft(this.angle, this.flip)
1568
1572
  }
1569
1573
  }) : U("div", { class: "w-[14px] h-[14px]" });
1570
1574
  }
1571
1575
  });
1572
- }, lt = (e, t) => {
1576
+ }, ot = (e, t) => {
1573
1577
  let a = e.iconUrl;
1574
1578
  if (!a)
1575
1579
  return console.error("图标库地址不能为空"), Promise.resolve();
1576
- if (_e.has(a))
1580
+ if (Fe.has(a))
1577
1581
  return Promise.resolve();
1578
- const s = da(a);
1582
+ const s = fa(a);
1579
1583
  if (s)
1580
- return new Promise(async (o) => (pa(s.scriptContent), o()));
1584
+ return new Promise(async (o) => (ca(s.scriptContent), o()));
1581
1585
  t.value = !1;
1582
1586
  const n = new Promise(async (o) => {
1583
- await ut(a, e.monoColor || !1), o(), _e.delete(a);
1587
+ await it(a, e.monoColor || !1), o(), Fe.delete(a);
1584
1588
  });
1585
- return _e.set(a, n), n;
1586
- }, ut = async (e, t) => {
1589
+ return Fe.set(a, n), n;
1590
+ }, it = async (e, t) => {
1587
1591
  try {
1588
1592
  const a = await fetch(e);
1589
1593
  if (!a.ok) {
@@ -1596,27 +1600,27 @@ const q = new at(), Z = (e, t, a) => {
1596
1600
  const o = s.match(n);
1597
1601
  if (o && o.length > 1) {
1598
1602
  let r = o[1];
1599
- ct(e, r, t, s);
1603
+ lt(e, r, t, s);
1600
1604
  }
1601
- pa(s);
1605
+ ca(s);
1602
1606
  return;
1603
1607
  } catch (a) {
1604
1608
  return console.error("网络异常,无法加载图标库:", a), null;
1605
1609
  }
1606
- }, pa = (e) => {
1610
+ }, ca = (e) => {
1607
1611
  const t = document.createElement("script");
1608
1612
  t.textContent = e, document.head.appendChild(t);
1609
- }, ct = (e, t, a, s) => {
1613
+ }, lt = (e, t, a, s) => {
1610
1614
  let n = `icon_cache:${e}`;
1611
1615
  const o = {
1612
1616
  windowKey: t,
1613
1617
  monoColor: a,
1614
1618
  scriptContent: s,
1615
- expireTime: Date.now() + it
1619
+ expireTime: Date.now() + rt
1616
1620
  // 缓存时间:7天
1617
1621
  };
1618
1622
  localStorage.setItem(n, JSON.stringify(o));
1619
- }, da = (e) => {
1623
+ }, fa = (e) => {
1620
1624
  let t = `icon_cache:${e}`;
1621
1625
  const a = localStorage.getItem(t);
1622
1626
  if (!a) return null;
@@ -1627,18 +1631,18 @@ const q = new at(), Z = (e, t, a) => {
1627
1631
  return console.error("解析缓存失败:", n), null;
1628
1632
  }
1629
1633
  return s.expireTime < Date.now() ? (localStorage.removeItem(e), null) : s;
1630
- }, Zt = () => {
1634
+ }, Yt = () => {
1631
1635
  const e = Date.now();
1632
1636
  for (const t in localStorage)
1633
1637
  if (t.startsWith("icon_cache:")) {
1634
1638
  const a = localStorage.getItem(t);
1635
1639
  a && JSON.parse(a).expireTime < e && localStorage.removeItem(t);
1636
1640
  }
1637
- }, ve = (e, t, a) => {
1641
+ }, me = (e, t, a) => {
1638
1642
  setTimeout(() => {
1639
1643
  t.value = a, t.value && (e.value = J.value[t.value]);
1640
1644
  }, 1);
1641
- }, De = U(
1645
+ }, Ne = U(
1642
1646
  "svg",
1643
1647
  { class: "w-4 h-4", viewBox: "0 0 50 50", style: { animation: "rotate 2s linear infinite" } },
1644
1648
  [
@@ -1658,12 +1662,12 @@ const q = new at(), Z = (e, t, a) => {
1658
1662
  fill: "currentColor"
1659
1663
  })
1660
1664
  ]
1661
- ), ft = (e, t) => {
1662
- const a = da(e);
1665
+ ), ut = (e, t) => {
1666
+ const a = fa(e);
1663
1667
  Object.keys(window).forEach((s) => {
1664
- s.startsWith("_iconfont_svg_string_") && (a == null ? void 0 : a.windowKey) === s && !Ye.has(s) && (Ye.add(s), pt(s, t));
1668
+ s.startsWith("_iconfont_svg_string_") && (a == null ? void 0 : a.windowKey) === s && !Ce.has(s) && (Ce.add(s), ct(s, t));
1665
1669
  });
1666
- }, pt = (e, t) => {
1670
+ }, ct = (e, t) => {
1667
1671
  const a = window[e], o = new DOMParser().parseFromString(a, "image/svg+xml").getElementsByTagName("symbol"), r = document.querySelectorAll("symbol");
1668
1672
  for (const l of o) {
1669
1673
  const u = l.id, i = Array.from(r).find((c) => c.id === u);
@@ -1671,33 +1675,33 @@ const q = new at(), Z = (e, t, a) => {
1671
1675
  c.hasAttribute("fill") && c.removeAttribute("fill");
1672
1676
  })), J.value[u] || (J.value[u] = U("svg", { fill: "currentColor" }, [U("use", { "xlink:href": `#${u}` })]));
1673
1677
  }
1674
- }, dt = (e, t) => {
1678
+ }, ft = (e, t) => {
1675
1679
  let a = "";
1676
1680
  return e && (a += `rotate(${e}deg)`), t && (a += " scaleX(-1)"), a;
1677
- }, es = (e, t, a, s) => {
1678
- ha(e, [], a, s).forEach((o) => t.push(o));
1679
- }, ha = (e, t, a, s) => {
1681
+ }, Xt = (e, t, a, s) => {
1682
+ da(e, [], a, s).forEach((o) => t.push(o));
1683
+ }, da = (e, t, a, s) => {
1680
1684
  var r, l, u, i, c;
1681
- const n = [], o = j();
1682
- for (const p of e) {
1683
- if (p.redirect || p.path.includes("/login") || p.path.includes("/error") || p.path.includes("/:page(.*)") || (l = (r = p.meta) == null ? void 0 : r.roles) != null && l.length && !o.hasRole(p.meta.roles) && (u = p.meta) != null && u.permission && !o.hasPermit(p.meta.permission, ":page"))
1685
+ const n = [], o = M();
1686
+ for (const d of e) {
1687
+ if (d.redirect || d.path.includes("/login") || d.path.includes("/error") || d.path.includes("/:page(.*)") || (l = (r = d.meta) == null ? void 0 : r.roles) != null && l.length && !o.hasRole(d.meta.roles) && (u = d.meta) != null && u.permission && !o.hasPermit(d.meta.permission, ":page"))
1684
1688
  continue;
1685
- const v = p.path.split("/");
1689
+ const v = d.path.split("/");
1686
1690
  v.unshift(...t);
1687
- const d = ha(p.children || [], v, a, s), O = {
1691
+ const p = da(d.children || [], v, a, s), O = {
1688
1692
  key: v.join("/"),
1689
- label: ((i = p.name) == null ? void 0 : i.toString()) ?? "",
1690
- title: ((c = p.name) == null ? void 0 : c.toString()) ?? "",
1691
- icon: p.icon ? U(a, { ...s, icon: p.icon }) : void 0,
1692
- children: d.length > 0 ? d : void 0
1693
+ label: ((i = d.name) == null ? void 0 : i.toString()) ?? "",
1694
+ title: ((c = d.name) == null ? void 0 : c.toString()) ?? "",
1695
+ icon: d.icon ? U(a, { ...s, icon: d.icon }) : void 0,
1696
+ children: p.length > 0 ? p : void 0
1693
1697
  };
1694
- (d.length > 0 || !p.children) && n.push(O);
1698
+ (p.length > 0 || !d.children) && n.push(O);
1695
1699
  }
1696
1700
  return n;
1697
- }, Xe = ya([]), as = () => {
1698
- Xe.length = 0;
1701
+ }, Ye = va([]), Zt = () => {
1702
+ Ye.length = 0;
1699
1703
  const e = H();
1700
- let a = Je().TabActive;
1704
+ let a = He().TabActive;
1701
1705
  e.matchedRoutes(a).forEach((n, o) => {
1702
1706
  var l;
1703
1707
  const r = {
@@ -1705,9 +1709,9 @@ const q = new at(), Z = (e, t, a) => {
1705
1709
  path: n.path,
1706
1710
  breadcrumbName: ((l = n.name) == null ? void 0 : l.toString()) ?? ""
1707
1711
  };
1708
- Xe.push(r);
1712
+ Ye.push(r);
1709
1713
  });
1710
- }, ht = {
1714
+ }, dt = {
1711
1715
  host: {
1712
1716
  api: "SITEHOST_API",
1713
1717
  url: "/openapi/RCSiteHostSrv/get",
@@ -1719,7 +1723,7 @@ const q = new at(), Z = (e, t, a) => {
1719
1723
  // 不显示错误
1720
1724
  hideErrorToast: !0
1721
1725
  }
1722
- }, ts = ue("hostInfo", {
1726
+ }, es = le("hostInfo", {
1723
1727
  state: () => ({
1724
1728
  hostInfo: {
1725
1729
  Host: "",
@@ -1750,9 +1754,9 @@ const q = new at(), Z = (e, t, a) => {
1750
1754
  }
1751
1755
  let s = (e || this.getSiteHostApi()).trim();
1752
1756
  return (!s || s === "/") && (s = window.location.origin), s.endsWith("/") && (s = s.slice(0, -1)), new Promise((n) => {
1753
- $e.SITEHOST_API || ($e.SITEHOST_API = s);
1757
+ Le.SITEHOST_API || (Le.SITEHOST_API = s);
1754
1758
  const o = t || window.location.origin;
1755
- G(ht.host, {
1759
+ j(dt.host, {
1756
1760
  Query: {
1757
1761
  Host: o
1758
1762
  }
@@ -1790,12 +1794,12 @@ const q = new at(), Z = (e, t, a) => {
1790
1794
  }, this.hostInfo.API_HOST)
1791
1795
  for (const t in this.hostInfo.API_HOST) {
1792
1796
  let a = this.hostInfo.API_HOST[t];
1793
- a = a.startsWith("http://") || a.startsWith("https://") || a.startsWith("//") ? a : window.location.origin + a, a.endsWith("/") && (a = a.slice(0, -1)), this.hostInfo.API_HOST[t] = a, $e[t] = a;
1797
+ a = a.startsWith("http://") || a.startsWith("https://") || a.startsWith("//") ? a : window.location.origin + a, a.endsWith("/") && (a = a.slice(0, -1)), this.hostInfo.API_HOST[t] = a, Le[t] = a;
1794
1798
  }
1795
1799
  if (this.hostInfo.SERVER_HOST)
1796
1800
  for (const t in this.hostInfo.SERVER_HOST) {
1797
1801
  let a = this.hostInfo.SERVER_HOST[t];
1798
- a = a.startsWith("http://") || a.startsWith("https://") || a.startsWith("//") ? a : window.location.origin + a, a.endsWith("/") && (a = a.slice(0, -1)), this.hostInfo.SERVER_HOST[t] = a, Fa[t] = a;
1802
+ a = a.startsWith("http://") || a.startsWith("https://") || a.startsWith("//") ? a : window.location.origin + a, a.endsWith("/") && (a = a.slice(0, -1)), this.hostInfo.SERVER_HOST[t] = a, La[t] = a;
1799
1803
  }
1800
1804
  },
1801
1805
  getHostInfo() {
@@ -1809,7 +1813,7 @@ const q = new at(), Z = (e, t, a) => {
1809
1813
  // storage: localStorage,
1810
1814
  // pick: ['hostInfo'],
1811
1815
  // },
1812
- }), ss = ue("settingInfo", {
1816
+ }), as = le("settingInfo", {
1813
1817
  state: () => ({
1814
1818
  fullscreen: !1,
1815
1819
  menuCollapse: !1,
@@ -1851,10 +1855,10 @@ const q = new at(), Z = (e, t, a) => {
1851
1855
  }
1852
1856
  },
1853
1857
  persist: !1
1854
- }), ns = /* @__PURE__ */ X({
1858
+ }), ts = /* @__PURE__ */ X({
1855
1859
  __name: "index",
1856
1860
  props: {
1857
- ...fe,
1861
+ ...ce,
1858
1862
  /**
1859
1863
  * 选择项数据
1860
1864
  */
@@ -1865,33 +1869,33 @@ const q = new at(), Z = (e, t, a) => {
1865
1869
  },
1866
1870
  emits: ["change"],
1867
1871
  setup(e, { emit: t }) {
1868
- const a = e, s = Y(), n = he(a.url, a), o = a.optionCtrl ?? n.optionCtrl;
1872
+ const a = e, s = Y(), n = pe(a.url, a), o = a.optionCtrl ?? n.optionCtrl;
1869
1873
  o.inputFactory = K(s);
1870
1874
  const r = f([]);
1871
1875
  o && g(
1872
1876
  () => o.options.value,
1873
- (p) => {
1874
- r.value = p || [];
1877
+ (d) => {
1878
+ r.value = d || [];
1875
1879
  },
1876
1880
  { immediate: !0, deep: !0 }
1877
1881
  );
1878
- const l = t, { editorCtrl: u, errInfo: i } = Y(), c = (p) => {
1879
- i != null && i.value.errClass && u && pe(u), l("change", p);
1882
+ const l = t, { editorCtrl: u, errInfo: i } = Y(), c = (d) => {
1883
+ i != null && i.value.errClass && u && fe(u), l("change", d);
1880
1884
  };
1881
- return xe(() => {
1885
+ return Se(() => {
1882
1886
  if (!a.data || a.data.length != 2) {
1883
1887
  console.error("Switch组件: ", a.data), x.error("Switch组件必须有且只有两个选项");
1884
1888
  return;
1885
1889
  }
1886
1890
  o && Z(o.autoload, o, a);
1887
- }), ie(() => {
1891
+ }), oe(() => {
1888
1892
  o && de(o, a);
1889
- }), (p, v) => {
1890
- var d;
1891
- return r.value.length === 2 ? (E(), Ae(b(ba), le({
1893
+ }), (d, v) => {
1894
+ var p;
1895
+ return r.value.length === 2 ? (A(), be(b(ya), ie({
1892
1896
  key: 0,
1893
1897
  class: [
1894
- ((d = b(i)) == null ? void 0 : d.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : "",
1898
+ ((p = b(i)) == null ? void 0 : p.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : "",
1895
1899
  "bg-blue-300",
1896
1900
  "w-[58px]"
1897
1901
  ],
@@ -1900,14 +1904,14 @@ const q = new at(), Z = (e, t, a) => {
1900
1904
  unCheckedChildren: r.value[1].label,
1901
1905
  unCheckedValue: r.value[1].value,
1902
1906
  onChange: c
1903
- }, p.$attrs), null, 16, ["class", "checkedChildren", "checkedValue", "unCheckedChildren", "unCheckedValue"])) : B("", !0);
1907
+ }, d.$attrs), null, 16, ["class", "checkedChildren", "checkedValue", "unCheckedChildren", "unCheckedValue"])) : B("", !0);
1904
1908
  };
1905
1909
  }
1906
- }), rs = /* @__PURE__ */ X({
1910
+ }), ss = /* @__PURE__ */ X({
1907
1911
  inheritAttrs: !1,
1908
1912
  __name: "index",
1909
1913
  props: {
1910
- ...fe,
1914
+ ...ce,
1911
1915
  value: {
1912
1916
  type: [String, Number, Array, null],
1913
1917
  default: void 0
@@ -1924,7 +1928,7 @@ const q = new at(), Z = (e, t, a) => {
1924
1928
  },
1925
1929
  emits: ["update:value", "select", "change", "update:labels"],
1926
1930
  setup(e, { emit: t }) {
1927
- const a = e, s = Ee(), n = Y(), o = he(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
1931
+ const a = e, s = Ie(), n = Y(), o = pe(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
1928
1932
  r.inputFactory = K(n), r.fieldMap = {
1929
1933
  label: "Name",
1930
1934
  value: "Id",
@@ -1940,11 +1944,11 @@ const q = new at(), Z = (e, t, a) => {
1940
1944
  ), g(
1941
1945
  () => l.value,
1942
1946
  (y) => {
1943
- a.autoClean && a.formData && a.outFields && y !== a.value && fa(a.formData, a.outFields, null);
1947
+ a.autoClean && a.formData && a.outFields && y !== a.value && ua(a.formData, a.outFields, null);
1944
1948
  }
1945
1949
  );
1946
- const { editorCtrl: u, errInfo: i, labelText: c } = n, p = t;
1947
- n.inputEmit = p;
1950
+ const { editorCtrl: u, errInfo: i, labelText: c } = n, d = t;
1951
+ n.inputEmit = d;
1948
1952
  const v = f((r == null ? void 0 : r.options.value) || []);
1949
1953
  r && g(
1950
1954
  () => r.options.value,
@@ -1953,38 +1957,38 @@ const q = new at(), Z = (e, t, a) => {
1953
1957
  },
1954
1958
  { immediate: !0, deep: !0 }
1955
1959
  );
1956
- const d = (y) => {
1960
+ const p = (y) => {
1957
1961
  if (v.value = [], y === "") return;
1958
1962
  let h = {
1959
1963
  Query: {
1960
1964
  SearchField: "%" + y.trim() + "%"
1961
1965
  }
1962
1966
  };
1963
- r.params = ce(r.params, h), r && Z(!0, r, a);
1967
+ r.params = ue(r.params, h), r && Z(!0, r, a);
1964
1968
  }, O = (y) => {
1965
- const A = Pe(r, a, y);
1966
- p("update:value", y), p("select", y);
1967
- const h = we(A);
1968
- p("update:labels", h), i != null && i.value.errClass && u && pe(u);
1969
+ const E = we(r, a, y);
1970
+ d("update:value", y), d("select", y);
1971
+ const h = Te(E);
1972
+ d("update:labels", h), i != null && i.value.errClass && u && fe(u);
1969
1973
  };
1970
- return ie(() => {
1974
+ return oe(() => {
1971
1975
  r && de(r, a);
1972
- }), (y, A) => {
1976
+ }), (y, E) => {
1973
1977
  var h;
1974
- return E(), L("div", null, [
1975
- z(b(Ia), le({
1978
+ return A(), L("div", null, [
1979
+ z(b(Sa), ie({
1976
1980
  value: l.value,
1977
- "onUpdate:value": A[0] || (A[0] = (I) => l.value = I),
1981
+ "onUpdate:value": E[0] || (E[0] = (I) => l.value = I),
1978
1982
  class: ["w-full", (h = b(i)) == null ? void 0 : h.errClass],
1979
1983
  options: v.value,
1980
- onSearch: d,
1984
+ onSearch: p,
1981
1985
  onSelect: O
1982
1986
  }, b(s), { "allow-clear": !1 }), {
1983
1987
  option: V(({ label: I }) => [
1984
- Oe(C(I), 1)
1988
+ xe(C(I), 1)
1985
1989
  ]),
1986
1990
  default: V(() => [
1987
- z(b(xa), {
1991
+ z(b(ba), {
1988
1992
  "allow-clear": "",
1989
1993
  placeholder: "请输入并选择" + b(c)
1990
1994
  }, null, 8, ["placeholder"])
@@ -1994,14 +1998,14 @@ const q = new at(), Z = (e, t, a) => {
1994
1998
  ]);
1995
1999
  };
1996
2000
  }
1997
- }), mt = { class: "min-h-[32px] pt-[5px]" }, vt = {
2001
+ }), pt = { class: "min-h-[32px] pt-[5px]" }, ht = {
1998
2002
  key: 1,
1999
2003
  class: "text-center text-gray-500"
2000
- }, os = /* @__PURE__ */ X({
2004
+ }, ns = /* @__PURE__ */ X({
2001
2005
  inheritAttrs: !1,
2002
2006
  __name: "index",
2003
2007
  props: {
2004
- ...fe,
2008
+ ...ce,
2005
2009
  nodata: {
2006
2010
  type: String,
2007
2011
  default: ""
@@ -2018,13 +2022,13 @@ const q = new at(), Z = (e, t, a) => {
2018
2022
  },
2019
2023
  emits: ["change", "update:labels"],
2020
2024
  setup(e, { emit: t }) {
2021
- var v, d, O;
2022
- const a = e, s = Ee(), n = Y(), o = he(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
2025
+ var v, p, O;
2026
+ const a = e, s = Ie(), n = Y(), o = pe(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
2023
2027
  r.inputFactory = K(n);
2024
2028
  const l = f({
2025
2029
  ...r == null ? void 0 : r.url,
2026
2030
  url: ((v = r == null ? void 0 : r.url) == null ? void 0 : v.url) || "",
2027
- fieldMap: (r == null ? void 0 : r.fieldMap) || ((d = r == null ? void 0 : r.url) == null ? void 0 : d.fieldMap),
2031
+ fieldMap: (r == null ? void 0 : r.fieldMap) || ((p = r == null ? void 0 : r.url) == null ? void 0 : p.fieldMap),
2028
2032
  params: (r == null ? void 0 : r.params) || ((O = r == null ? void 0 : r.url) == null ? void 0 : O.params),
2029
2033
  loadingText: !1
2030
2034
  }), { errInfo: u } = n, i = t;
@@ -2037,32 +2041,32 @@ const q = new at(), Z = (e, t, a) => {
2037
2041
  },
2038
2042
  { immediate: !0, deep: !0 }
2039
2043
  );
2040
- const p = (y) => {
2041
- const h = Pe(r, a, y), I = we(h);
2044
+ const d = (y) => {
2045
+ const h = we(r, a, y), I = Te(h);
2042
2046
  i("update:labels", I);
2043
2047
  };
2044
- return xe(() => {
2048
+ return Se(() => {
2045
2049
  l.value && !l.value.fieldMap && (l.value.fieldMap = {
2046
2050
  title: "Name",
2047
2051
  label: "Name",
2048
2052
  value: "Id",
2049
2053
  key: "Id"
2050
2054
  }), r && Z(r.autoload, r, a);
2051
- }), ie(() => {
2055
+ }), oe(() => {
2052
2056
  r && de(r, a);
2053
- }), (y, A) => (E(), L("div", mt, [
2054
- z(b(Aa), le({
2055
- onChange: p,
2057
+ }), (y, E) => (A(), L("div", pt, [
2058
+ z(b(Ia), ie({
2059
+ onChange: d,
2056
2060
  class: "w-full mb-[-3px]"
2057
2061
  }, b(s)), {
2058
2062
  default: V(() => [
2059
- c.value.length > 0 ? (E(!0), L(ne, { key: 0 }, Ue(c.value, (h) => {
2063
+ c.value.length > 0 ? (A(!0), L(ne, { key: 0 }, De(c.value, (h) => {
2060
2064
  var I;
2061
- return E(), Ae(b(Ea), {
2065
+ return A(), be(b(xa), {
2062
2066
  key: h.value,
2063
2067
  value: h.value,
2064
2068
  disabled: h.disabled || h.value && e.disabledItems && e.disabledItems.indexOf(h.value.toString()) > -1,
2065
- class: ea([
2069
+ class: Ze([
2066
2070
  ((I = b(u)) == null ? void 0 : I.errClass) === "error" ? "error !text-red-400" : "",
2067
2071
  "text-nowrap",
2068
2072
  "pb-1",
@@ -2070,24 +2074,24 @@ const q = new at(), Z = (e, t, a) => {
2070
2074
  ])
2071
2075
  }, {
2072
2076
  default: V(() => [
2073
- Oe(C(h.label), 1)
2077
+ xe(C(h.label), 1)
2074
2078
  ]),
2075
2079
  _: 2
2076
2080
  }, 1032, ["value", "disabled", "class"]);
2077
- }), 128)) : e.nodata ? (E(), L("div", vt, C(e.nodata), 1)) : B("", !0)
2081
+ }), 128)) : e.nodata ? (A(), L("div", ht, C(e.nodata), 1)) : B("", !0)
2078
2082
  ]),
2079
2083
  _: 1
2080
2084
  }, 16)
2081
2085
  ]));
2082
2086
  }
2083
- }), gt = { class: "min-h-[32px] pt-1" }, yt = {
2087
+ }), mt = { class: "min-h-[32px] pt-1" }, vt = {
2084
2088
  key: 1,
2085
2089
  class: "text-center text-gray-500"
2086
- }, is = /* @__PURE__ */ X({
2090
+ }, rs = /* @__PURE__ */ X({
2087
2091
  inheritAttrs: !1,
2088
2092
  __name: "index",
2089
2093
  props: {
2090
- ...fe,
2094
+ ...ce,
2091
2095
  value: {
2092
2096
  type: [String, Number, null, Array],
2093
2097
  default: void 0
@@ -2105,17 +2109,17 @@ const q = new at(), Z = (e, t, a) => {
2105
2109
  },
2106
2110
  emits: ["change", "update:value", "update:labels"],
2107
2111
  setup(e, { emit: t }) {
2108
- var O, y, A;
2109
- const a = e, s = Ee(), n = Y(), o = he(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
2112
+ var O, y, E;
2113
+ const a = e, s = Ie(), n = Y(), o = pe(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
2110
2114
  r.inputFactory = K(n);
2111
2115
  const l = f({
2112
2116
  ...r == null ? void 0 : r.url,
2113
2117
  url: ((O = r == null ? void 0 : r.url) == null ? void 0 : O.url) || "",
2114
2118
  fieldMap: (r == null ? void 0 : r.fieldMap) || ((y = r == null ? void 0 : r.url) == null ? void 0 : y.fieldMap),
2115
- params: (r == null ? void 0 : r.params) || ((A = r == null ? void 0 : r.url) == null ? void 0 : A.params),
2119
+ params: (r == null ? void 0 : r.params) || ((E = r == null ? void 0 : r.url) == null ? void 0 : E.params),
2116
2120
  loadingText: !1
2117
- }), u = f(a.value), { errInfo: i } = n, c = f((r == null ? void 0 : r.options.value) || []), p = t;
2118
- n.inputEmit = p, r && g(
2121
+ }), u = f(a.value), { errInfo: i } = n, c = f((r == null ? void 0 : r.options.value) || []), d = t;
2122
+ n.inputEmit = d, r && g(
2119
2123
  () => r.options.value,
2120
2124
  (h) => {
2121
2125
  c.value = h || [];
@@ -2129,7 +2133,7 @@ const q = new at(), Z = (e, t, a) => {
2129
2133
  ), g(
2130
2134
  () => u.value,
2131
2135
  (h) => {
2132
- p("update:value", h);
2136
+ d("update:value", h);
2133
2137
  }
2134
2138
  );
2135
2139
  const v = (h, I) => {
@@ -2138,37 +2142,37 @@ const q = new at(), Z = (e, t, a) => {
2138
2142
  return R && (u.value = h), R;
2139
2143
  }
2140
2144
  return h === I;
2141
- }, d = (h) => {
2142
- const I = h.target.value, R = Pe(r, a, I), Q = we(R);
2143
- p("update:labels", Q);
2145
+ }, p = (h) => {
2146
+ const I = h.target.value, R = we(r, a, I), Q = Te(R);
2147
+ d("update:labels", Q);
2144
2148
  };
2145
- return xe(() => {
2149
+ return Se(() => {
2146
2150
  l.value && !l.value.fieldMap && (l.value.fieldMap = {
2147
2151
  label: "Name",
2148
2152
  value: "Id",
2149
2153
  key: "Id"
2150
2154
  }), r && Z(r.autoload, r, a);
2151
- }), ie(() => {
2155
+ }), oe(() => {
2152
2156
  r && de(r, a);
2153
- }), (h, I) => (E(), L("div", gt, [
2154
- z(b(Oa), le({
2157
+ }), (h, I) => (A(), L("div", mt, [
2158
+ z(b(Ea), ie({
2155
2159
  value: u.value,
2156
2160
  "onUpdate:value": I[0] || (I[0] = (R) => u.value = R),
2157
2161
  autocheck: !1,
2158
- onChange: d,
2162
+ onChange: p,
2159
2163
  class: "w-full flex align-items flex-wrap mb-[-3px]"
2160
2164
  }, b(s)), {
2161
2165
  default: V(() => [
2162
- c.value.length > 0 ? (E(!0), L(ne, { key: 0 }, Ue(c.value, (R) => {
2166
+ c.value.length > 0 ? (A(!0), L(ne, { key: 0 }, De(c.value, (R) => {
2163
2167
  var Q;
2164
- return E(), L(ne, {
2168
+ return A(), L(ne, {
2165
2169
  key: R.value
2166
2170
  }, [
2167
- R.visible !== !1 ? (E(), Ae(b(Ra), {
2171
+ R.visible !== !1 ? (A(), be(b(Aa), {
2168
2172
  key: 0,
2169
2173
  checked: v(R.value, a.value),
2170
2174
  value: R.value,
2171
- class: ea([
2175
+ class: Ze([
2172
2176
  ((Q = b(i)) == null ? void 0 : Q.errClass) === "error" ? "error !text-red-400" : "",
2173
2177
  "text-nowrap",
2174
2178
  "pb-1",
@@ -2176,25 +2180,25 @@ const q = new at(), Z = (e, t, a) => {
2176
2180
  ])
2177
2181
  }, {
2178
2182
  default: V(() => [
2179
- Oe(C(R.label), 1)
2183
+ xe(C(R.label), 1)
2180
2184
  ]),
2181
2185
  _: 2
2182
2186
  }, 1032, ["checked", "value", "class"])) : B("", !0)
2183
2187
  ], 64);
2184
- }), 128)) : e.nodata ? (E(), L("div", yt, C(e.nodata), 1)) : B("", !0)
2188
+ }), 128)) : e.nodata ? (A(), L("div", vt, C(e.nodata), 1)) : B("", !0)
2185
2189
  ]),
2186
2190
  _: 1
2187
2191
  }, 16, ["value"])
2188
2192
  ]));
2189
2193
  }
2190
- }), St = {
2194
+ }), gt = {
2191
2195
  key: 0,
2192
2196
  class: "absolute z-10 mt-[5px] mr-[10px] text-[#999] flex items-center"
2193
- }, ls = /* @__PURE__ */ X({
2197
+ }, os = /* @__PURE__ */ X({
2194
2198
  inheritAttrs: !1,
2195
2199
  __name: "index",
2196
2200
  props: {
2197
- ...fe,
2201
+ ...ce,
2198
2202
  value: {
2199
2203
  type: [String, Number, Array, null],
2200
2204
  default: void 0
@@ -2226,49 +2230,49 @@ const q = new at(), Z = (e, t, a) => {
2226
2230
  emits: ["change", "update:value", "update:label", "update:labels"],
2227
2231
  setup(e, { emit: t }) {
2228
2232
  var I, R, Q;
2229
- const a = e, s = a.value === void 0 ? !0 : a.undefValue, n = Y(), { editorCtrl: o, errInfo: r, labelText: l } = n, u = he(a.url, a), i = a.optionCtrl ?? u.optionCtrl;
2233
+ const a = e, s = a.value === void 0 ? !0 : a.undefValue, n = Y(), { editorCtrl: o, errInfo: r, labelText: l } = n, u = pe(a.url, a), i = a.optionCtrl ?? u.optionCtrl;
2230
2234
  i.inputFactory = K(n);
2231
- const c = Ee(), p = f({
2235
+ const c = Ie(), d = f({
2232
2236
  ...i == null ? void 0 : i.url,
2233
2237
  url: ((I = i == null ? void 0 : i.url) == null ? void 0 : I.url) || "",
2234
2238
  fieldMap: (i == null ? void 0 : i.fieldMap) || ((R = i == null ? void 0 : i.url) == null ? void 0 : R.fieldMap),
2235
2239
  params: (i == null ? void 0 : i.params) || ((Q = i == null ? void 0 : i.url) == null ? void 0 : Q.params),
2236
2240
  loadingText: !1
2237
- }), v = f(c.placeholder), d = f(i == null ? void 0 : i.selected.value), O = t;
2241
+ }), v = f(c.placeholder), p = f(i == null ? void 0 : i.selected.value), O = t;
2238
2242
  n.inputEmit = O;
2239
2243
  const y = (m) => {
2240
- const P = Pe(i, a, m), _ = we(P);
2241
- d.value = m, O("update:labels", _), O("update:label", _.join(";")), O("change", m), r != null && r.value.errClass && o && pe(o);
2242
- }, A = f((i == null ? void 0 : i.options.value) || []), h = (m) => {
2244
+ const P = we(i, a, m), N = Te(P);
2245
+ p.value = m, O("update:labels", N), O("update:label", N.join(";")), O("change", m), r != null && r.value.errClass && o && fe(o);
2246
+ }, E = f((i == null ? void 0 : i.options.value) || []), h = (m) => {
2243
2247
  if (m.length > 0 && F(a.value) && a.selectFirst)
2244
2248
  for (let P = 0; P < m.length; P++) {
2245
- const _ = m[P];
2246
- if (_.disabled === void 0 || _.disabled === !1) {
2247
- d.value = _.value;
2249
+ const N = m[P];
2250
+ if (N.disabled === void 0 || N.disabled === !1) {
2251
+ p.value = N.value;
2248
2252
  break;
2249
2253
  }
2250
2254
  }
2251
- else m.length > 0 && (d.value = a.value === null ? void 0 : a.value);
2252
- m.length > 0 && d.value !== void 0 && y(d.value);
2255
+ else m.length > 0 && (p.value = a.value === null ? void 0 : a.value);
2256
+ m.length > 0 && p.value !== void 0 && y(p.value);
2253
2257
  };
2254
2258
  return i && (g(
2255
2259
  () => i.options.value,
2256
2260
  (m) => {
2257
- A.value = m || [];
2261
+ E.value = m || [];
2258
2262
  },
2259
2263
  { immediate: !0, deep: !0 }
2260
2264
  ), g(
2261
2265
  () => i.selected.value,
2262
2266
  (m) => {
2263
- d.value = m;
2267
+ p.value = m;
2264
2268
  }
2265
2269
  )), g(
2266
- () => A.value,
2270
+ () => E.value,
2267
2271
  (m) => {
2268
2272
  h(m);
2269
2273
  }
2270
2274
  ), g(
2271
- () => p.value.loading,
2275
+ () => d.value.loading,
2272
2276
  (m) => {
2273
2277
  m ? v.value = "" : v.value || (v.value = "请选择" + l.value);
2274
2278
  },
@@ -2276,55 +2280,55 @@ const q = new at(), Z = (e, t, a) => {
2276
2280
  ), g(
2277
2281
  () => a.value,
2278
2282
  (m) => {
2279
- d.value = m;
2283
+ p.value = m;
2280
2284
  },
2281
2285
  { immediate: !0 }
2282
2286
  ), g(
2283
- () => d.value,
2287
+ () => p.value,
2284
2288
  (m) => {
2285
2289
  const P = m === void 0 ? s ? void 0 : null : m;
2286
2290
  i && (i.selected.value = P), O("update:value", P);
2287
2291
  }
2288
- ), xe(() => {
2289
- if (p.value && !p.value.fieldMap && (p.value.fieldMap = {
2292
+ ), Se(() => {
2293
+ if (d.value && !d.value.fieldMap && (d.value.fieldMap = {
2290
2294
  label: "Name",
2291
2295
  value: "Id",
2292
2296
  key: "Id"
2293
2297
  }), a.dataKey) {
2294
- const m = JSON.parse(JSON.stringify(M.getOptions(a.dataKey)));
2295
- A.value = m, h(m);
2298
+ const m = JSON.parse(JSON.stringify(_.getOptions(a.dataKey)));
2299
+ E.value = m, h(m);
2296
2300
  } else if (i) {
2297
2301
  const m = i.options.value || [];
2298
- m.length > 0 ? (A.value = m, h(m)) : Z(i.autoload, i, a);
2302
+ m.length > 0 ? (E.value = m, h(m)) : Z(i.autoload, i, a);
2299
2303
  }
2300
- }), ie(() => {
2304
+ }), oe(() => {
2301
2305
  i && de(i, a);
2302
2306
  }), (m, P) => {
2303
- var _, We, qe;
2304
- return E(), L("div", null, [
2305
- (We = (_ = b(i)) == null ? void 0 : _.url) != null && We.loading ? (E(), L("div", St, [
2306
- z(b(De), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
2307
- P[1] || (P[1] = Sa("span", null, "数据加载中...", -1))
2307
+ var N, Ge, We;
2308
+ return A(), L("div", null, [
2309
+ (Ge = (N = b(i)) == null ? void 0 : N.url) != null && Ge.loading ? (A(), L("div", gt, [
2310
+ z(b(Ne), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
2311
+ P[1] || (P[1] = ga("span", null, "数据加载中...", -1))
2308
2312
  ])) : B("", !0),
2309
- z(b(Ta), le({
2310
- class: [(qe = b(r)) == null ? void 0 : qe.errClass, "w-full"],
2311
- value: d.value,
2312
- "onUpdate:value": P[0] || (P[0] = (W) => d.value = W),
2313
+ z(b(Oa), ie({
2314
+ class: [(We = b(r)) == null ? void 0 : We.errClass, "w-full"],
2315
+ value: p.value,
2316
+ "onUpdate:value": P[0] || (P[0] = (G) => p.value = G),
2313
2317
  "allow-clear": !0,
2314
2318
  onChange: y,
2315
2319
  placeholder: v.value,
2316
2320
  "label-in-value": !1
2317
2321
  }, b(c)), {
2318
2322
  default: V(() => [
2319
- (E(!0), L(ne, null, Ue(A.value, (W) => (E(), L(ne, {
2320
- key: W.value
2323
+ (A(!0), L(ne, null, De(E.value, (G) => (A(), L(ne, {
2324
+ key: G.value
2321
2325
  }, [
2322
- W.visible !== !1 ? (E(), Ae(b(wa), {
2326
+ G.visible !== !1 ? (A(), be(b(Ra), {
2323
2327
  key: 0,
2324
- value: W.value
2328
+ value: G.value
2325
2329
  }, {
2326
2330
  default: V(() => [
2327
- Oe(C(W.label), 1)
2331
+ xe(C(G.label), 1)
2328
2332
  ]),
2329
2333
  _: 2
2330
2334
  }, 1032, ["value"])) : B("", !0)
@@ -2337,75 +2341,76 @@ const q = new at(), Z = (e, t, a) => {
2337
2341
  }
2338
2342
  });
2339
2343
  export {
2340
- _t as $,
2341
- pe as A,
2342
- os as B,
2343
- is as C,
2344
- ls as D,
2345
- Ve as E,
2346
- Na as F,
2347
- Bt as G,
2348
- rt as H,
2349
- ot as I,
2350
- zt as J,
2351
- Ct as K,
2352
- nt as L,
2353
- fa as M,
2354
- Yt as N,
2355
- M as O,
2344
+ Lt as $,
2345
+ fe as A,
2346
+ ns as B,
2347
+ rs as C,
2348
+ os as D,
2349
+ Ke as E,
2350
+ Ma as F,
2351
+ Wt as G,
2352
+ st as H,
2353
+ nt as I,
2354
+ qt as J,
2355
+ Bt as K,
2356
+ Ae as L,
2357
+ tt as M,
2358
+ ua as N,
2359
+ _ as O,
2356
2360
  D as P,
2357
- Zt as Q,
2358
- pt as R,
2359
- dt as S,
2360
- es as T,
2361
- Xe as U,
2362
- as as V,
2363
- ta as W,
2364
- Vt as X,
2365
- sa as Y,
2366
- Ft as Z,
2367
- ns as _,
2368
- ss as a,
2369
- Ke as a0,
2370
- Mt as a1,
2371
- Jt as a2,
2372
- et as a3,
2373
- ua as a4,
2374
- Gt as a5,
2375
- $t as a6,
2376
- aa as a7,
2377
- Da as a8,
2378
- Ne as a9,
2379
- q as aa,
2380
- se as ab,
2381
- ge as ac,
2382
- H as ad,
2383
- ts as ae,
2384
- Je as af,
2385
- re as ag,
2386
- Ut as b,
2387
- Xt as c,
2388
- Ht as d,
2389
- Nt as e,
2390
- Wt as f,
2391
- qt as g,
2392
- Qt as h,
2361
+ zt as Q,
2362
+ Yt as R,
2363
+ ct as S,
2364
+ ft as T,
2365
+ Xt as U,
2366
+ Ye as V,
2367
+ Zt as W,
2368
+ na as X,
2369
+ Ut as Y,
2370
+ ra as Z,
2371
+ ts as _,
2372
+ as as a,
2373
+ Ft as a0,
2374
+ Qe as a1,
2375
+ $t as a2,
2376
+ Kt as a3,
2377
+ Xa as a4,
2378
+ ia as a5,
2379
+ Jt as a6,
2380
+ kt as a7,
2381
+ sa as a8,
2382
+ qa as a9,
2383
+ _e as aa,
2384
+ q as ab,
2385
+ se as ac,
2386
+ ve as ad,
2387
+ H as ae,
2388
+ es as af,
2389
+ He as ag,
2390
+ re as ah,
2391
+ Nt as b,
2392
+ Ct as c,
2393
+ Dt as d,
2394
+ Mt as e,
2395
+ jt as f,
2396
+ Gt as g,
2397
+ Vt as h,
2393
2398
  F as i,
2394
- Kt as j,
2395
- la as k,
2396
- Za as l,
2397
- jt as m,
2398
- rs as n,
2399
- Dt as o,
2400
- fe as p,
2401
- Ua as q,
2402
- oe as r,
2399
+ Ht as j,
2400
+ oa as k,
2401
+ Ya as l,
2402
+ Qt as m,
2403
+ ss as n,
2404
+ _t as o,
2405
+ ce as p,
2406
+ Ba as q,
2407
+ Ee as r,
2403
2408
  Y as s,
2404
- he as t,
2405
- j as u,
2409
+ pe as t,
2410
+ M as u,
2406
2411
  Z as v,
2407
2412
  de as w,
2408
- De as x,
2409
- Pe as y,
2410
- we as z
2413
+ Ne as x,
2414
+ we as y,
2415
+ Te as z
2411
2416
  };