@skyfox2000/webui 1.3.14 → 1.3.16

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.
@@ -1,23 +1,23 @@
1
- var mt = Object.defineProperty;
2
- var vt = (e, a, t) => a in e ? mt(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t;
3
- var F = (e, a, t) => vt(e, typeof a != "symbol" ? a + "" : a, t);
4
- import { inject as ae, ref as f, provide as Le, watch as y, toRaw as Ze, h as U, nextTick as gt, shallowRef as K, defineComponent as X, reactive as yt, onMounted as Ie, onUnmounted as ie, createBlock as xe, createCommentVNode as B, openBlock as O, unref as S, mergeProps as le, useAttrs as Ae, createElementBlock as $, createVNode as C, withCtx as V, createTextVNode as Ee, toDisplayString as z, Fragment as ne, renderList as Ue, normalizeClass as et, createElementVNode as bt } from "vue";
5
- import { Switch as St, AutoComplete as It, Input as xt, CheckboxGroup as At, Checkbox as Et, RadioGroup as Ot, Radio as Rt, Select as Tt, SelectOption as wt } from "ant-design-vue";
6
- import { createPinia as Pt, defineStore as ue } from "pinia";
7
- import kt from "pinia-plugin-persistedstate";
8
- import { combineParams as Oe, EnvConfig as ge, AppAction as Be, AppSource as Ce, isMicroApp as ye, mainAppApis as N, isBaseMicroApp as Lt } from "@skyfox2000/microbase";
9
- import { ResStatus as T, httpPost as G, setToken as he, fieldMapping as $t, parseFieldTemplate as be, API_HOST as $e, SERVER_HOST as Ft } from "@skyfox2000/fapi";
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 C, withCtx as V, createTextVNode as Oe, toDisplayString as z, 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 Ce, 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";
10
10
  import x from "vue-m-message";
11
11
  import He from "async-validator";
12
- import { createRouter as Mt, createWebHashHistory as _t } from "vue-router";
12
+ import { createRouter as Ma, createWebHashHistory as _a } from "vue-router";
13
13
  import "dayjs";
14
14
  import "vue-draggable-next";
15
- const Nt = Pt();
16
- Nt.use(kt);
15
+ const Na = Pa();
16
+ Na.use(ka);
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
  };
20
- F(w, "dict", {}), F(w, "Keys", {
20
+ $(w, "dict", {}), $(w, "Keys", {
21
21
  EnableDisable: "EnableDisable",
22
22
  SuccessResult: "SuccessResult",
23
23
  YesNo: "YesNo",
@@ -27,25 +27,25 @@ F(w, "dict", {}), F(w, "Keys", {
27
27
  * @param key 名称
28
28
  * @returns
29
29
  */
30
- F(w, "getOptions", (a) => w.dict[a]), /**
30
+ $(w, "getOptions", (t) => w.dict[t]), /**
31
31
  * 静态选择项对象
32
32
  * @param key 名称
33
33
  * @param value 值
34
34
  * @returns
35
35
  */
36
- F(w, "getOptionItem", (a, t) => w.dict[a].find((s) => s.value === t)), /**
36
+ $(w, "getOptionItem", (t, a) => w.dict[t].find((s) => s.value === a)), /**
37
37
  * 设置静态选择项
38
38
  * @param key 名称
39
39
  * @param list 列表
40
40
  */
41
- F(w, "setOptions", (a, t) => {
42
- w.dict[a] = t;
41
+ $(w, "setOptions", (t, a) => {
42
+ w.dict[t] = a;
43
43
  }), /**
44
44
  * 启用/停用选项
45
45
  * - 启用 1
46
46
  * - 停用 0
47
47
  */
48
- F(w, "EnableDisable", [
48
+ $(w, "EnableDisable", [
49
49
  {
50
50
  label: "启用",
51
51
  text: "✅ 启用",
@@ -61,7 +61,7 @@ F(w, "EnableDisable", [
61
61
  * - 成功 1
62
62
  * - 失败 0
63
63
  */
64
- F(w, "SuccessResult", [
64
+ $(w, "SuccessResult", [
65
65
  {
66
66
  label: "成功",
67
67
  text: "✅ 成功",
@@ -77,7 +77,7 @@ F(w, "SuccessResult", [
77
77
  * - 是 1
78
78
  * - 否 0
79
79
  */
80
- F(w, "YesNo", [
80
+ $(w, "YesNo", [
81
81
  {
82
82
  label: "是",
83
83
  text: "✅ 是",
@@ -93,7 +93,7 @@ F(w, "YesNo", [
93
93
  * - 男 M
94
94
  * - 女 F
95
95
  */
96
- F(w, "MaleFemale", [
96
+ $(w, "MaleFemale", [
97
97
  {
98
98
  label: "男",
99
99
  text: "男 👨",
@@ -110,7 +110,7 @@ M.setOptions("EnableDisable", M.EnableDisable);
110
110
  M.setOptions("SuccessResult", M.SuccessResult);
111
111
  M.setOptions("YesNo", M.YesNo);
112
112
  M.setOptions("MaleFemale", M.MaleFemale);
113
- const ce = {
113
+ const fe = {
114
114
  /**
115
115
  * 选项数据接口
116
116
  */
@@ -173,62 +173,65 @@ const ce = {
173
173
  type: Object,
174
174
  required: !1
175
175
  }
176
- }, P = (e) => e == null || e === "" ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1, Re = (e, a) => {
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
177
  var n;
178
- const t = e.page;
178
+ const a = e.page;
179
179
  return {
180
180
  url: "",
181
181
  ...e.url,
182
- ...(n = t.urls) == null ? void 0 : n[a.urlKey],
183
- ...a.url,
184
- loadingText: a.loadingText
182
+ ...(n = a.urls) == null ? void 0 : n[t.urlKey],
183
+ ...t.url,
184
+ loadingText: t.loadingText
185
185
  };
186
- }, Te = (e, a) => {
187
- const t = e.page, s = a.url;
186
+ }, Te = (e, t) => {
187
+ const a = e.page, s = t.url;
188
188
  if (!s || !s.url) {
189
- const o = `URL未设置: ${a.urlKey}`;
189
+ const o = `URL未设置: ${t.urlKey}`;
190
190
  return console.warn(o), Promise.reject(new Error(o));
191
191
  }
192
- s.api || (s.api = t.api), s.authorize === void 0 && (s.authorize = t.authorize);
193
- let n = JSON.parse(JSON.stringify(a.params));
194
- return a.processParams && (n = a.processParams(n)), a.loadingState && (a.loadingState.value = !0), a.hideErrorToast && (s.hideErrorToast = !0), G(s, n).then((o) => (a.loadingState && (a.loadingState.value = !1), o)).catch((o) => (a.loadingState && (a.loadingState.value = !1), null));
195
- }, Ve = (e, a) => {
196
- a.params || (a.params = {}), a.params.Query || (a.params.Query = {});
197
- const t = Re(e, a);
198
- return a.url = t, Te(e, a);
199
- }, $a = (e, a) => (a.params || (a.params = {}), a.params.Query || (a.params.Query = {}), a.loadingText = a.loadingText === !1 ? !1 : a.loadingText || "开始执行...", a.url = Re(e, a), Te(e, a).then((t) => ((t == null ? void 0 : t.status) === T.SUCCESS && (a.hideErrorToast || x.success("执行成功!")), t))), tt = (e, a = {}) => {
200
- const t = a.primaryKey || "Id";
201
- if (a.params || (a.params = {}), a.params.Query || (a.params.Query = {}), !a.params.Data)
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)
202
205
  return x.error("错误!无保存数据!"), Promise.resolve(null);
203
206
  const s = {
204
- ...a,
205
- urlKey: a.urlKey || "save",
206
- loadingText: a.loadingText === !1 ? !1 : a.loadingText || "数据保存中..."
207
+ ...t,
208
+ urlKey: t.urlKey || "save",
209
+ loadingText: t.loadingText === !1 ? !1 : t.loadingText || "数据保存中..."
207
210
  };
208
- s.params.Query[t] = s.params.Data[t];
211
+ s.params.Query[a] = s.params.Data[a];
209
212
  const n = Re(e, s);
210
- return s.url = n, Te(e, s).then((o) => ((o == null ? void 0 : o.status) === T.SUCCESS && (a.hideErrorToast || x.success("保存成功!")), o));
211
- }, Dt = (e, a, t = {}) => {
212
- const s = t.primaryKey || "Id";
213
- t.params || (t.params = {}), t.params.Query || (t.params.Query = {});
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 = {});
214
217
  const n = {
215
- ...t,
218
+ ...a,
216
219
  urlKey: "delete",
217
- loadingText: t.loadingText === !1 ? !1 : t.loadingText || "数据删除中..."
220
+ loadingText: a.loadingText === !1 ? !1 : a.loadingText || "数据删除中..."
218
221
  };
219
- if (Array.isArray(a) ? n.params.Query[s] = a : n.params.Query[s] = a[s], P(n.params.Query) || P(n.params.Query[s]))
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]))
220
223
  return x.error("错误!禁止无条件删除数据!"), Promise.resolve(null);
221
224
  const o = Re(e, n);
222
- return n.url = o, Te(e, n).then((r) => ((r == null ? void 0 : r.status) === T.SUCCESS && (t.hideErrorToast || x.success("删除成功!")), r));
223
- }, Ut = (e, a) => Ve(e, {
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, {
224
227
  urlKey: "tree",
225
228
  params: {},
226
229
  loadingState: e.isTreeLoading,
227
230
  loadingText: !1,
228
- processParams: () => Oe(e.treeQuery, a)
229
- }).then((t) => (t == null ? void 0 : t.status) === T.SUCCESS ? (e.data.value = t.data, e.data.value) : []);
231
+ processParams: () => ce(e.treeQuery, t)
232
+ }).then((a) => (a == null ? void 0 : a.status) === T.SUCCESS ? (e.data.value = a.data, e.data.value) : []);
230
233
  let re;
231
- const Fa = (e) => {
234
+ const Ft = (e) => {
232
235
  re = new He({}), re.messages({
233
236
  required: "${label}不能为空",
234
237
  types: {
@@ -255,157 +258,157 @@ const Fa = (e) => {
255
258
  },
256
259
  ...e
257
260
  });
258
- }, Ma = (e) => {
259
- if (!e || P(e))
261
+ }, Mt = (e) => {
262
+ if (!e || F(e))
260
263
  return [];
261
- const a = [], t = re.messages(), s = (o, r, l) => {
262
- const i = r.type;
263
- if (i && t.types && i in t.types) {
264
- const c = t.types[i];
265
- n(c, o, { type: i }, l);
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);
266
269
  }
267
- const u = ["string", "number", "array"];
268
- for (const c of u)
269
- if (i === c && t[c]) {
270
- const p = t[c], v = ["len", "min", "max", "range"];
271
- for (const h of v)
272
- h === "range" && r.min != null && r.max != null && p.range ? n(p.range, o, { min: r.min, max: r.max }, l) : h !== "range" && r[h] != null && p[h] && n(p[h], o, { [h]: r[h] }, l);
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);
273
276
  }
274
- if (r.required && t.required && n(t.required, o, {}, l), r.pattern && t.pattern && n(r.message, o, {}, l), r.enum && Array.isArray(r.enum) && t.enum) {
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) {
275
278
  const c = r.enum.join(", ");
276
- n(t.enum, o, { enum: c }, l);
279
+ n(a.enum, o, { enum: c }, l);
277
280
  }
278
- }, n = (o, r, l, i) => {
281
+ }, n = (o, r, l, u) => {
279
282
  if (o)
280
283
  try {
281
- let u;
284
+ let i;
282
285
  if (typeof o == "function") {
283
286
  const c = [r];
284
287
  for (const p in l)
285
288
  c.push(l[p]);
286
- u = o.apply(null, c), u && i.push(u);
289
+ i = o.apply(null, c), i && u.push(i);
287
290
  } else {
288
- u = String(o);
291
+ i = String(o);
289
292
  for (const c in l)
290
- u = u.replace(new RegExp(`\\$\\{${c}\\}`, "g"), l[c]);
291
- u = u.replace(/\$\{label\}/g, ""), u && i.push(u);
293
+ i = i.replace(new RegExp(`\\$\\{${c}\\}`, "g"), l[c]);
294
+ i = i.replace(/\$\{label\}/g, ""), i && u.push(i);
292
295
  }
293
- } catch (u) {
294
- console.error("格式化验证消息出错:", u);
296
+ } catch (i) {
297
+ console.error("格式化验证消息出错:", i);
295
298
  }
296
299
  };
297
300
  return Object.keys(e).forEach((o) => {
298
301
  const r = e[o], l = [];
299
302
  try {
300
- s(o, r, l), Array.isArray(r) && r.forEach((u) => {
301
- u && typeof u == "object" && s(o, u, l);
303
+ s(o, r, l), Array.isArray(r) && r.forEach((i) => {
304
+ i && typeof i == "object" && s(o, i, l);
302
305
  }), r && typeof r == "object" && "fields" in r;
303
- } catch (u) {
304
- console.error("处理验证规则出错:", u);
306
+ } catch (i) {
307
+ console.error("处理验证规则出错:", i);
305
308
  }
306
- const i = Array.from(new Set(l));
307
- o && i.length > 0 && a.push({
309
+ const u = Array.from(new Set(l));
310
+ o && u.length > 0 && t.push({
308
311
  field: o,
309
- rules: i
312
+ rules: u
310
313
  });
311
- }), a;
312
- }, fe = async (e) => {
313
- const a = e.formData.value, t = e.formRules.value;
314
- P(t) || (Ke(e), e.ruleValidator || (e.ruleValidator = new He({}), e.ruleValidator.messages(re.messages()), e.ruleValidator.define(t)), e.ruleResults.value = await e.ruleValidator.validate(a).then(() => {
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(() => {
315
318
  }).catch(({ fields: s }) => s));
316
- }, _a = async (e, a, t) => (t || (t = new He({}), t.messages(re.messages()), t.define(a)), t.validate(e).then(() => {
319
+ }, _t = async (e, t, a) => (a || (a = new He({}), a.messages(re.messages()), a.define(t)), a.validate(e).then(() => {
317
320
  }).catch(({ fields: s }) => s)), Ke = (e) => {
318
321
  e.ruleResults.value = void 0;
319
322
  }, Y = () => {
320
- const e = ae(D.EditorControl, void 0), a = f(ae(D.LabelText, "")), t = f(ae(D.RuleKey, "")), s = ae(D.ErrInfo, void 0);
323
+ const e = te(D.EditorControl, void 0), t = f(te(D.LabelText, "")), a = f(te(D.RuleKey, "")), s = te(D.ErrInfo, void 0);
321
324
  return {
322
325
  editorCtrl: e,
323
- labelText: a,
324
- ruleKey: t,
326
+ labelText: t,
327
+ ruleKey: a,
325
328
  errInfo: s
326
329
  };
327
- }, Ht = (e, a) => {
328
- let t = f({
330
+ }, Ha = (e, t) => {
331
+ let a = f({
329
332
  msg: "",
330
333
  errClass: ""
331
334
  });
332
335
  if (!e.label || !e.rule)
333
- return t;
334
- const s = a == null ? void 0 : a.ruleResults;
335
- return y(
336
+ return a;
337
+ const s = t == null ? void 0 : t.ruleResults;
338
+ return g(
336
339
  () => s == null ? void 0 : s.value,
337
340
  (n) => {
338
- if (t.value.errClass = "", t.value.msg = "", !P(n)) {
339
- const o = Vt(
341
+ if (a.value.errClass = "", a.value.msg = "", !F(n)) {
342
+ const o = Va(
340
343
  {
341
344
  label: e.label,
342
345
  rule: e.rule
343
346
  },
344
- a == null ? void 0 : a.formRules.value,
347
+ t == null ? void 0 : t.formRules.value,
345
348
  Ze(n)
346
349
  );
347
- t.value.errClass = o.errClass.value, t.value.msg = o.msg.value;
350
+ a.value.errClass = o.errClass.value, a.value.msg = o.msg.value;
348
351
  }
349
352
  },
350
353
  { deep: !0 }
351
- ), t;
352
- }, Vt = (e, a, t) => {
354
+ ), a;
355
+ }, Va = (e, t, a) => {
353
356
  const s = f([]), n = f(""), o = f("");
354
- if (!e.rule || !a || !t)
357
+ if (!e.rule || !t || !a)
355
358
  return { msg: n, ruleErrors: s, errClass: o };
356
- e.rule.split("|").forEach((i) => {
357
- if (i = i.trim(), i)
358
- if (t[i])
359
- s.value.push(...t[i]);
359
+ e.rule.split("|").forEach((u) => {
360
+ if (u = u.trim(), u)
361
+ if (a[u])
362
+ s.value.push(...a[u]);
360
363
  else {
361
- const u = [];
362
- for (let c in t)
363
- c !== i && c.startsWith(i + ".") && u.push(...t[c]);
364
- u.length > 0 && s.value.push(...u);
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);
365
368
  }
366
369
  });
367
370
  const l = /\${\w+}/g;
368
- return s.value.forEach((i) => {
369
- n.value && (n.value += " / "), n.value += i.message.replace("${label}", e.label ?? "");
370
- const u = a[i.field];
371
- if (u) {
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) {
372
375
  const c = n.value.match(l);
373
376
  c && c.forEach((p) => {
374
377
  const v = p.replace("${", "").replace("}", "");
375
- n.value = n.value.replace(p, u[v] ?? "");
378
+ n.value = n.value.replace(p, i[v] ?? "");
376
379
  });
377
380
  }
378
381
  }), s.value.length > 0 && (o.value = "error"), { msg: n, ruleErrors: s, errClass: o };
379
- }, Na = (e, a) => {
382
+ }, Nt = (e, t) => {
380
383
  Le(D.LabelText, e.label || ""), Le(D.RuleKey, e.rule || "");
381
- const t = Ht(e, a);
382
- return Le(D.ErrInfo, t), t;
383
- }, Da = (e) => {
384
- at(e);
385
- }, Ua = (e) => {
386
- const a = e.page, t = e.formData.value;
387
- t[e.primaryKey ?? a.primaryKey] = null, at(e);
388
- }, Ha = (e) => {
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) => {
389
392
  Qe(e), e.visible.value = !1;
390
- }, at = async (e) => {
393
+ }, ta = async (e) => {
391
394
  var s;
392
- const a = e.page;
395
+ const t = e.page;
393
396
  if (e.isFormSaving.value = !0, Ke(e), e.beforeSave && e.beforeSave() === !1)
394
397
  return e.isFormSaving.value = !1, Promise.resolve();
395
- if (e.formRules.value && await fe(e), e.ruleResults.value)
398
+ if (e.formRules.value && await pe(e), e.ruleResults.value)
396
399
  return x.error("提交表单时,验证失败!"), console.error("表单验证失败!", e.ruleResults.value), e.isFormSaving.value = !1, Promise.resolve();
397
- const t = e.formData.value;
398
- return tt(
400
+ const a = e.formData.value;
401
+ return aa(
399
402
  {
400
- page: a,
403
+ page: t,
401
404
  // 转换为AnyControl接口
402
405
  reload: (s = e.grid) == null ? void 0 : s.reload
403
406
  },
404
407
  {
405
408
  url: e.saveUrl,
406
- primaryKey: e.primaryKey ?? a.primaryKey,
409
+ primaryKey: e.primaryKey ?? t.primaryKey,
407
410
  params: {
408
- Data: t,
411
+ Data: a,
409
412
  Query: {}
410
413
  },
411
414
  hideErrorToast: !0,
@@ -419,123 +422,123 @@ const Fa = (e) => {
419
422
  else if (n != null && n.msg && ((o = n == null ? void 0 : n.msg) == null ? void 0 : o.indexOf("Duplicate entry")) > -1) {
420
423
  const l = (r = n == null ? void 0 : n.msg) == null ? void 0 : r.match(/Duplicate entry '([^']+)' for key '([^']+)'/);
421
424
  if (l && l.length > 2 && l[1] && l[2]) {
422
- const i = l[1], u = l[2].replace(/Idx_/g, "").split("_"), c = e.formRules.value;
423
- if (c && u.length > 0) {
425
+ const u = l[1], i = l[2].replace(/Idx_/g, "").split("_"), c = e.formRules.value;
426
+ if (c && i.length > 0) {
424
427
  const p = {};
425
- u.forEach((v) => {
428
+ i.forEach((v) => {
426
429
  c[v] && (p[v] = [
427
430
  {
428
431
  field: v,
429
- fieldValue: i,
432
+ fieldValue: u,
430
433
  message: "数据重复"
431
434
  }
432
435
  ]);
433
436
  }), Object.keys(p).length > 0 && (console.error("保存失败!", p), e.ruleResults.value = p);
434
437
  }
435
- x.error(`保存失败!数据 \`${i}\` 已存在!`);
438
+ x.error(`保存失败!数据 \`${u}\` 已存在!`);
436
439
  } else x.error((n == null ? void 0 : n.msg) ?? "保存失败!");
437
440
  } else
438
441
  x.error((n == null ? void 0 : n.msg) ?? "保存失败!");
439
442
  });
440
- }, Va = async (e) => {
441
- const a = e.page, t = e.grid;
443
+ }, Vt = async (e) => {
444
+ const t = e.page, a = e.grid;
442
445
  e.isFormLoading.value = !0;
443
- const s = e.formData.value, n = e.primaryKey ?? a.primaryKey;
444
- return ut(t, { [n]: s[n] }, e.detailUrl).then((o) => {
445
- e.isFormLoading.value = !1, o && st(e, o);
446
+ const s = e.formData.value, n = e.primaryKey ?? t.primaryKey;
447
+ return ua(a, { [n]: s[n] }, e.detailUrl).then((o) => {
448
+ e.isFormLoading.value = !1, o && sa(e, o);
446
449
  });
447
- }, Ka = (e) => {
448
- const a = e.grid;
449
- a && (a.rowData.value = void 0), e && (Qe(e), e.visible && (e.visible.value = !1), setTimeout(() => {
450
+ }, Kt = (e) => {
451
+ const t = e.grid;
452
+ t && (t.rowData.value = void 0), e && (Qe(e), e.visible && (e.visible.value = !1), setTimeout(() => {
450
453
  e.visible.value = !0;
451
454
  }, 1));
452
- }, st = (e, a) => {
455
+ }, sa = (e, t) => {
453
456
  Qe(e);
454
- const t = { ...e.formData.value, ...a };
455
- e.formData.value = JSON.parse(JSON.stringify(t));
457
+ const a = { ...e.formData.value, ...t };
458
+ e.formData.value = JSON.parse(JSON.stringify(a));
456
459
  }, Qe = (e) => {
457
460
  e.formData.value = e.default ? JSON.parse(JSON.stringify(e.default)) : {}, Ke(e);
458
- }, Se = "/login/", ve = [], Kt = (e) => {
459
- for (const a of e) {
460
- const t = ve.findIndex((s) => s.path === a.path);
461
- t !== -1 && ve.splice(t, 1), ve.push(a), oe.addRoute(a);
461
+ }, Ie = "/login/", ge = [], Ka = (e) => {
462
+ for (const t of e) {
463
+ const a = ge.findIndex((s) => s.path === t.path);
464
+ a !== -1 && ge.splice(a, 1), ge.push(t), oe.addRoute(t);
462
465
  }
463
- }, nt = (e, a, t, s = "") => {
466
+ }, na = (e, t, a, s = "") => {
464
467
  const n = s + (s ? "/" : "") + e.path;
465
- a[n] = { ...e, parent: t }, e.children && e.children.forEach((o) => nt(o, a, e, n));
466
- }, oe = Mt({
467
- history: _t("/"),
468
- routes: ve
469
- }), Qt = (e, a) => {
468
+ t[n] = { ...e, parent: a }, e.children && e.children.forEach((o) => na(o, t, e, n));
469
+ }, oe = Ma({
470
+ history: _a("/"),
471
+ routes: ge
472
+ }), Qa = (e, t) => {
470
473
  var n, o;
471
- const t = ((n = e.meta) == null ? void 0 : n.roles) ?? [], s = (o = e.meta) == null ? void 0 : o.permission;
472
- if (!a)
473
- return t.length === 0 && !s;
474
- if (a) {
474
+ const a = ((n = e.meta) == null ? void 0 : n.roles) ?? [], s = (o = e.meta) == null ? void 0 : o.permission;
475
+ if (!t)
476
+ return a.length === 0 && !s;
477
+ if (t) {
475
478
  const r = j();
476
- if (ge.VITE_PERMISSION_MODE === "role")
477
- return t.length === 0 ? !0 : r.hasRole(t);
478
- if (ge.VITE_PERMISSION_MODE === "permit") {
479
- if (t.length === 0 && !s)
479
+ if (ye.VITE_PERMISSION_MODE === "role")
480
+ return a.length === 0 ? !0 : r.hasRole(a);
481
+ if (ye.VITE_PERMISSION_MODE === "permit") {
482
+ if (a.length === 0 && !s)
480
483
  return !0;
481
- let l = !1, i = !1;
482
- return t.length > 0 && (l = r.hasRole(t)), s && (i = r.hasPermit(e.path, ":page")), l || i;
484
+ let l = !1, u = !1;
485
+ return a.length > 0 && (l = r.hasRole(a)), s && (u = r.hasPermit(e.path, ":page")), l || u;
483
486
  }
484
487
  }
485
488
  return !1;
486
489
  }, se = f(null);
487
- oe.beforeEach((e, a, t) => {
490
+ oe.beforeEach((e, t, a) => {
488
491
  var l;
489
492
  const s = e;
490
- if (e.path.startsWith("/error/") || e.path.startsWith(Se))
491
- return t();
493
+ if (e.path.startsWith("/error/") || e.path.startsWith(Ie))
494
+ return a();
492
495
  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);
493
496
  if (e.path === "/") {
494
- const i = H();
495
- if (!i.menuLoaded) {
497
+ const u = H();
498
+ if (!u.menuLoaded) {
496
499
  se.value = {
497
500
  to: e,
498
- next: (u) => {
499
- t({ path: u });
501
+ next: (i) => {
502
+ a({ path: i });
500
503
  }
501
504
  };
502
505
  return;
503
506
  }
504
- i.toDefaultApp();
507
+ u.toDefaultApp();
505
508
  return;
506
509
  }
507
510
  if (!r)
508
- t();
511
+ a();
509
512
  else {
510
- const i = j();
511
- if (!i.isLogin)
512
- t({ path: Se });
513
+ const u = j();
514
+ if (!u.isLogin)
515
+ a({ path: Ie });
513
516
  else {
514
517
  if (!H().menuLoaded) {
515
518
  se.value = {
516
519
  to: e,
517
- next: t
520
+ next: a
518
521
  };
519
522
  return;
520
523
  }
521
- const c = Qt(s, i.isLogin);
522
- t();
524
+ const c = Qa(s, u.isLogin);
525
+ a();
523
526
  }
524
527
  }
525
528
  });
526
- const Jt = (e) => {
529
+ const Ja = (e) => {
527
530
  if (se.value) {
528
- const { to: a, next: t } = se.value;
529
- se.value = null, a.path === "/" ? t(e) : t(a.path);
531
+ const { to: t, next: a } = se.value;
532
+ se.value = null, t.path === "/" ? a(e) : a(t.path);
530
533
  }
531
- }, jt = (e) => {
532
- const a = Je();
533
- if (a.TabEnabled) {
534
- if (Gt(e.key, a.TabPanes))
534
+ }, ja = (e) => {
535
+ const t = Je();
536
+ if (t.TabEnabled) {
537
+ if (Ga(e.key, t.TabPanes))
535
538
  return;
536
- a.TabPanes.push(e);
539
+ t.TabPanes.push(e);
537
540
  }
538
- }, Gt = (e, a) => a.find((t) => t.key === e), Je = ue("pageInfo", {
541
+ }, Ga = (e, t) => t.find((a) => a.key === e), Je = ue("pageInfo", {
539
542
  state: () => ({
540
543
  TabActive: "",
541
544
  TabPanes: [],
@@ -549,18 +552,18 @@ const Jt = (e) => {
549
552
  removeTabPane(e) {
550
553
  if (this.TabEnabled) {
551
554
  H().excludeComponent(e);
552
- let t = 0, s = [...this.TabPanes];
555
+ let a = 0, s = [...this.TabPanes];
553
556
  for (let n = 0; n < s.length; n++)
554
557
  if (s[n].key === e) {
555
- s.splice(n, 1), t = n - 1 < 0 ? 0 : n - 1;
558
+ s.splice(n, 1), a = n - 1 < 0 ? 0 : n - 1;
556
559
  break;
557
560
  }
558
561
  for (let n = 0; n < s.length; n++)
559
562
  if (s[n].key === this.TabActive) {
560
- t = n;
563
+ a = n;
561
564
  break;
562
565
  }
563
- this.TabPanes = s, this.setTabActive(s[t].key);
566
+ this.TabPanes = s, this.setTabActive(s[a].key);
564
567
  }
565
568
  },
566
569
  /**
@@ -569,50 +572,50 @@ const Jt = (e) => {
569
572
  * @returns
570
573
  */
571
574
  async setTabActive(e) {
572
- let t = H().findRoute(e);
573
- if (!t) return;
575
+ let a = H().findRoute(e);
576
+ if (!a) return;
574
577
  const s = {
575
578
  key: e,
576
- title: t.name.toString(),
579
+ title: a.name.toString(),
577
580
  content: "",
578
581
  closable: !0,
579
582
  // 根据路由的meta.keepAlive确定是否加入对应缓存
580
583
  // 默认为true
581
- keepAlive: !(t.meta && !t.meta.keepAlive)
584
+ keepAlive: !(a.meta && !a.meta.keepAlive)
582
585
  };
583
- jt(s), this.TabActive = e;
586
+ ja(s), this.TabActive = e;
584
587
  }
585
588
  },
586
589
  persist: !1
587
- }), Wt = {
590
+ }), Wa = {
588
591
  appList: {
589
592
  api: "PLATFORM_API",
590
593
  authorize: !0,
591
594
  url: "/api/RCTenanetOpSrv/getApps",
592
595
  loadingText: !1
593
596
  }
594
- }, Fe = /* @__PURE__ */ new Map(), qt = (e) => {
595
- const a = j(), { roles: t, permission: s } = e.meta || {};
596
- if (P(t) && P(s))
597
+ }, Fe = /* @__PURE__ */ new Map(), qa = (e) => {
598
+ const t = j(), { roles: a, permission: s } = e.meta || {};
599
+ if (F(a) && F(s))
597
600
  return !0;
598
- if (ge.VITE_PERMISSION_MODE === "role")
599
- return P(t) ? !0 : a.hasRole(t);
600
- if (ge.VITE_PERMISSION_MODE === "permit") {
601
+ if (ye.VITE_PERMISSION_MODE === "role")
602
+ return F(a) ? !0 : t.hasRole(a);
603
+ if (ye.VITE_PERMISSION_MODE === "permit") {
601
604
  let n = !1, o = !1;
602
- return P(t) || (n = a.hasRole(t)), a.isAdmin() ? n : (P(s) || (o = a.hasPermit(e.path, s)), n || o);
605
+ return F(a) || (n = t.hasRole(a)), t.isAdmin() ? n : (F(s) || (o = t.hasPermit(e.path, s)), n || o);
603
606
  }
604
607
  return !1;
605
- }, rt = (e) => e.map((a) => {
606
- const t = { ...a };
607
- return qt(t) ? (t.children && (t.children = rt(t.children)), t) : null;
608
- }).filter(Boolean), ot = (e, a = "") => {
609
- for (const t of e) {
610
- if (!t.children && !t.redirect) {
611
- let s = a + t.path;
608
+ }, ra = (e) => e.map((t) => {
609
+ const a = { ...t };
610
+ return qa(a) ? (a.children && (a.children = ra(a.children)), a) : null;
611
+ }).filter(Boolean), oa = (e, t = "") => {
612
+ for (const a of e) {
613
+ if (!a.children && !a.redirect) {
614
+ let s = t + a.path;
612
615
  return s.startsWith("/") || (s = "/" + s), s;
613
616
  }
614
- if (t.children && t.children.length > 0 && t.path !== "/error" && t.path !== "/login" && t.path !== "/:page(.*)") {
615
- const s = ot(t.children, a + t.path + "/");
617
+ if (a.children && a.children.length > 0 && a.path !== "/error" && a.path !== "/login" && a.path !== "/:page(.*)") {
618
+ const s = oa(a.children, t + a.path + "/");
616
619
  if (s)
617
620
  return s;
618
621
  }
@@ -644,14 +647,14 @@ const Jt = (e) => {
644
647
  * 加载授权应用列表
645
648
  */
646
649
  async loadAppList(e) {
647
- return new Promise(async (a) => {
650
+ return new Promise(async (t) => {
648
651
  e && e.length > 0 ? (this.appList.length = 0, setTimeout(async () => {
649
- this.appList.push(...e), a();
650
- }, 1e3)) : (this.appList.length === 0 && await this.getRemoteAppList(), a());
652
+ this.appList.push(...e), t();
653
+ }, 1e3)) : (this.appList.length === 0 && await this.getRemoteAppList(), t());
651
654
  });
652
655
  },
653
656
  async getRemoteAppList() {
654
- return G(Wt.appList, {
657
+ return G(Wa.appList, {
655
658
  Query: {
656
659
  AppCode: this.appInfo.AppCode,
657
660
  Enabled: 1
@@ -665,32 +668,32 @@ const Jt = (e) => {
665
668
  x.error("加载应用列表失败");
666
669
  return;
667
670
  }
668
- let a = "";
669
- const t = window.location.pathname.split("/");
670
- if (t.length > 1) {
671
- for (let n = t.length - 1; n >= 0; n--)
672
- if (t[n] !== "") {
673
- a = t[n];
671
+ let t = "";
672
+ const a = window.location.pathname.split("/");
673
+ if (a.length > 1) {
674
+ for (let n = a.length - 1; n >= 0; n--)
675
+ if (a[n] !== "") {
676
+ t = a[n];
674
677
  break;
675
678
  }
676
679
  }
677
680
  let s = null;
678
- a && a != "login" ? s = this.appList.find((n) => n.AppCode === a) : s = this.appList.find((n) => n.Default), a = s ? s.AppCode : this.appList[0].AppCode, await this.setActiveApp(a), (!e || e.startsWith("/#/") || e.includes("/error/") || window.location.hash.includes("/error/")) && this.push(this.appInfo.defaultPage);
681
+ t && t != "login" ? s = this.appList.find((n) => n.AppCode === t) : s = this.appList.find((n) => n.Default), t = s ? s.AppCode : this.appList[0].AppCode, await this.setActiveApp(t), (!e || e.startsWith("/#/") || e.includes("/error/") || window.location.hash.includes("/error/")) && this.push(this.appInfo.defaultPage);
679
682
  },
680
683
  /**
681
684
  * 设置当前应用
682
685
  * @param key 应用码
683
686
  * @returns
684
687
  */
685
- async setActiveApp(e, a) {
688
+ async setActiveApp(e, t) {
686
689
  this.menuLoaded = !1;
687
- const t = this.appList.find((s) => s.AppCode === e);
688
- t && (t.AppCode !== this.appInfo.AppCode && (this.appInfo = {
689
- ...t,
690
+ const a = this.appList.find((s) => s.AppCode === e);
691
+ a && (a.AppCode !== this.appInfo.AppCode && (this.appInfo = {
692
+ ...a,
690
693
  flattenRoutes: {},
691
- Routes: a ?? [],
694
+ Routes: t ?? [],
692
695
  defaultPage: ""
693
- }), (!ye() || !Lt()) && (await j().getRolePermits(t.Id), this.appInfo.Routes.length && this.setAppRoutes(this.appInfo.Routes)));
696
+ }), (!Se() || !La()) && (await j().getRolePermits(a.Id), this.appInfo.Routes.length && this.setAppRoutes(this.appInfo.Routes)));
694
697
  },
695
698
  /**
696
699
  * 设置当前应用路由信息
@@ -703,20 +706,20 @@ const Jt = (e) => {
703
706
  Routes: e,
704
707
  defaultPage: ""
705
708
  };
706
- const a = this.appInfo.flattenRoutes;
707
- for (const t of e)
708
- nt(t, a, void 0);
709
- if (Object.keys(a).forEach((t) => {
710
- const s = a[t];
711
- s.children || !s.component || (s.meta && s.meta.keepAlive === !1 ? this.ExcludeComponents.push(t) : this.CachedComponents.push(t));
709
+ const t = this.appInfo.flattenRoutes;
710
+ for (const a of e)
711
+ na(a, t, void 0);
712
+ if (Object.keys(t).forEach((a) => {
713
+ const s = t[a];
714
+ s.children || !s.component || (s.meta && s.meta.keepAlive === !1 ? this.ExcludeComponents.push(a) : this.CachedComponents.push(a));
712
715
  }), j().isLogin) {
713
- const t = rt(this.appInfo.Routes);
714
- if (Kt(t), this.appInfo.defaultPage = ot(t) || "", this.appInfo.defaultPage) {
716
+ const a = ra(this.appInfo.Routes);
717
+ if (Ka(a), this.appInfo.defaultPage = oa(a) || "", this.appInfo.defaultPage) {
715
718
  if (this.menuLoaded = !0, N.value && N.value.mainAppPush) {
716
719
  const s = this.formatRoute(this.appInfo.defaultPage);
717
720
  N.value.mainAppPush(s);
718
721
  }
719
- Jt(this.appInfo.defaultPage);
722
+ Ja(this.appInfo.defaultPage);
720
723
  }
721
724
  }
722
725
  },
@@ -726,18 +729,18 @@ const Jt = (e) => {
726
729
  * @returns
727
730
  */
728
731
  formatRoute(e) {
729
- let a = e;
730
- return e.includes("#") ? e.startsWith("#") && (a = "/" + this.appInfo.Action.toLowerCase() + "/" + this.appInfo.AppCode + "/" + e) : this.appInfo.AppCode ? a = "/" + this.appInfo.Action.toLowerCase() + "/" + this.appInfo.AppCode + "/#" + e : a = "/#" + e, a;
732
+ let t = e;
733
+ return e.includes("#") ? e.startsWith("#") && (t = "/" + this.appInfo.Action.toLowerCase() + "/" + this.appInfo.AppCode + "/" + e) : this.appInfo.AppCode ? t = "/" + this.appInfo.Action.toLowerCase() + "/" + this.appInfo.AppCode + "/#" + e : t = "/#" + e, t;
731
734
  },
732
735
  /**
733
736
  * 应用导航,菜单路由,都使用此处导航
734
737
  * @param path 路由地址
735
738
  */
736
739
  push(e) {
737
- this.findRoute(e) && Je().setTabActive(e), gt(() => {
740
+ this.findRoute(e) && Je().setTabActive(e), ga(() => {
738
741
  if (oe.push({ path: e }), N.value && N.value.mainAppPush) {
739
- const t = this.formatRoute(e);
740
- N.value.mainAppPush(t);
742
+ const a = this.formatRoute(e);
743
+ N.value.mainAppPush(a);
741
744
  }
742
745
  });
743
746
  },
@@ -755,19 +758,19 @@ const Jt = (e) => {
755
758
  * @param route 路由
756
759
  * @returns 组件实例
757
760
  */
758
- cacheComponent(e, a) {
759
- let t = Fe.get(a.path);
760
- if (!t)
761
- if (this.CachedComponents.includes(a.path))
762
- t = {
761
+ cacheComponent(e, t) {
762
+ let a = Fe.get(t.path);
763
+ if (!a)
764
+ if (this.CachedComponents.includes(t.path))
765
+ a = {
763
766
  // 设置组件包装器的名称为路由路径
764
- name: a.path,
767
+ name: t.path,
765
768
  render() {
766
769
  return U(e);
767
770
  }
768
- }, Fe.set(a.path, t);
771
+ }, Fe.set(t.path, a);
769
772
  else return e;
770
- return t;
773
+ return a;
771
774
  },
772
775
  /**
773
776
  * 删除缓存组件
@@ -780,12 +783,12 @@ const Jt = (e) => {
780
783
  * 路由路径层级查询,返回面包屑
781
784
  */
782
785
  matchedRoutes(e) {
783
- const a = [], t = this.findRoute(e);
784
- if (t && (a.push(t), t.parent)) {
785
- const s = this.matchedRoutes(t.parent.path);
786
- a.push(...s);
786
+ const t = [], a = this.findRoute(e);
787
+ if (a && (t.push(a), a.parent)) {
788
+ const s = this.matchedRoutes(a.parent.path);
789
+ t.push(...s);
787
790
  }
788
- return a.reverse();
791
+ return t.reverse();
789
792
  },
790
793
  clean() {
791
794
  this.appInfo = {
@@ -805,11 +808,11 @@ const Jt = (e) => {
805
808
  }, this.CachedComponents.splice(0, this.CachedComponents.length), this.ExcludeComponents.splice(0, this.ExcludeComponents.length), this.appList.splice(0, this.appList.length), this.menuLoaded = !1;
806
809
  },
807
810
  logout() {
808
- this.clean(), oe.push({ path: Se + "#/" }), ye() && N.value && N.value.mainAppPush && N.value.mainAppPush(Se + "#/");
811
+ this.clean(), oe.push({ path: Ie + "#/" }), Se() && N.value && N.value.mainAppPush && N.value.mainAppPush(Ie + "#/");
809
812
  }
810
813
  },
811
814
  persist: !1
812
- }), it = "Token解析失败", ze = "登录过期,请重新登录", je = {
815
+ }), ia = "Token解析失败", ze = "登录过期,请重新登录", je = {
813
816
  login: {
814
817
  api: "PLATFORM_API",
815
818
  url: "/openapi/LoginSrv/login",
@@ -827,48 +830,48 @@ const Jt = (e) => {
827
830
  url: "/api/LoginSrv/logout",
828
831
  loadingText: "正在退出..."
829
832
  }
830
- }, Bt = (e) => {
831
- let a = {
833
+ }, Ba = (e) => {
834
+ let t = {
832
835
  Option: {
833
836
  Mode: "MicroApp"
834
837
  },
835
838
  Query: e
836
839
  };
837
- return G(je.login, a).then((t) => (t == null ? void 0 : t.status) === T.SUCCESS ? t : null);
838
- }, Ct = (e) => {
839
- let a = {
840
+ return G(je.login, t).then((a) => (a == null ? void 0 : a.status) === T.SUCCESS ? a : null);
841
+ }, Ca = (e) => {
842
+ let t = {
840
843
  Query: {
841
844
  AppId: e
842
845
  }
843
846
  };
844
- return G(je.auth, a).then((t) => (t == null ? void 0 : t.status) === T.SUCCESS ? t.data : (x.error("获取授权信息失败," + (t == null ? void 0 : t.msg)), null));
845
- }, zt = () => {
847
+ 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));
848
+ }, za = () => {
846
849
  let e = {
847
850
  Option: {},
848
851
  Query: {}
849
852
  };
850
- return G(je.logout, e).then((a) => (a == null ? void 0 : a.status) === T.SUCCESS ? a.data : null);
851
- }, Yt = (e) => {
853
+ return G(je.logout, e).then((t) => (t == null ? void 0 : t.status) === T.SUCCESS ? t.data : null);
854
+ }, Ya = (e) => {
852
855
  try {
853
- const t = JSON.parse(atob(e.split(".")[1])).exp;
854
- return Date.now() / 1e3 > t;
855
- } catch (a) {
856
- return console.error(it, a), !0;
856
+ const a = JSON.parse(atob(e.split(".")[1])).exp;
857
+ return Date.now() / 1e3 > a;
858
+ } catch (t) {
859
+ return console.error(ia, t), !0;
857
860
  }
858
- }, Me = (e, a) => e == "" ? (x.error(ze, {
861
+ }, Me = (e, t) => e == "" ? (x.error(ze, {
859
862
  duration: 3e3,
860
- onClose: a
861
- }), !1) : Yt(e) ? (x.error(ze, {
863
+ onClose: t
864
+ }), !1) : Ya(e) ? (x.error(ze, {
862
865
  duration: 3e3,
863
- onClose: a
864
- }), !1) : !0, Xt = (e) => {
866
+ onClose: t
867
+ }), !1) : !0, Xa = (e) => {
865
868
  try {
866
- const a = JSON.parse(atob(e.token.split(".")[1]));
867
- return a.user = JSON.parse(a.user), e.UserInfo = a.user, !0;
868
- } catch (a) {
869
- return console.error(it, a), !1;
869
+ const t = JSON.parse(atob(e.token.split(".")[1]));
870
+ return t.user = JSON.parse(t.user), e.UserInfo = t.user, !0;
871
+ } catch (t) {
872
+ return console.error(ia, t), !1;
870
873
  }
871
- }, L = f(""), ee = f(null), j = ue("userInfo", {
874
+ }, k = f(""), ee = f(null), j = ue("userInfo", {
872
875
  state: () => ({
873
876
  isLogin: !1,
874
877
  userInfo: {
@@ -886,31 +889,31 @@ const Jt = (e) => {
886
889
  * 启动时初始化用户信息
887
890
  */
888
891
  init() {
889
- ye() || (this.token ? (Me(this.token, () => this.clean()), he(this.token), L.value = this.userInfo.UserLevel, this.isLogin = !0) : this.clean());
892
+ Se() || (this.token ? (Me(this.token, () => this.clean()), me(this.token), k.value = this.userInfo.UserLevel, this.isLogin = !0) : this.clean());
890
893
  },
891
894
  /**
892
895
  * 登录操作
893
896
  * @param loginInfo 登录信息
894
897
  * @returns
895
898
  */
896
- async login(e, a) {
897
- const t = await Bt(e);
898
- if (t) {
899
- const s = t;
899
+ async login(e, t) {
900
+ const a = await Ba(e);
901
+ if (a) {
902
+ const s = a;
900
903
  if (s.errno)
901
904
  return s;
902
905
  {
903
- const n = t.data;
904
- if (this.token = n.token, he(this.token), this.isLogin = !0, Xt(n))
906
+ const n = a.data;
907
+ if (this.token = n.token, me(this.token), this.isLogin = !0, Xa(n))
905
908
  this.userInfo = {
906
909
  ...this.userInfo,
907
910
  ...n.UserInfo
908
- }, L.value = n.UserInfo.UserLevel;
911
+ }, k.value = n.UserInfo.UserLevel;
909
912
  else {
910
913
  x.error("用户信息解析失败");
911
914
  return;
912
915
  }
913
- a && H().toDefaultApp();
916
+ t && H().toDefaultApp();
914
917
  }
915
918
  }
916
919
  },
@@ -925,14 +928,14 @@ const Jt = (e) => {
925
928
  if (ee.value && ee.value.appId === e)
926
929
  return !0;
927
930
  try {
928
- const a = await Ct(e);
929
- return a ? (ee.value = {
931
+ const t = await Ca(e);
932
+ return t ? (ee.value = {
930
933
  appId: e,
931
- permits: a.permits || [],
932
- lastTime: a.lastTime
934
+ permits: t.permits || [],
935
+ lastTime: t.lastTime
933
936
  }, !0) : !1;
934
- } catch (a) {
935
- return console.error("获取授权信息出错", a), !1;
937
+ } catch (t) {
938
+ return console.error("获取授权信息出错", t), !1;
936
939
  }
937
940
  },
938
941
  /**
@@ -941,7 +944,7 @@ const Jt = (e) => {
941
944
  * @returns 是否有角色权限
942
945
  */
943
946
  hasRole(e) {
944
- return L.value ? Array.isArray(e) ? e.includes(L.value) : L.value === e : !1;
947
+ return k.value ? Array.isArray(e) ? e.includes(k.value) : k.value === e : !1;
945
948
  },
946
949
  /**
947
950
  * 检查功能权限
@@ -949,10 +952,10 @@ const Jt = (e) => {
949
952
  * @param permitCode 资源权限编码
950
953
  * @returns 是否有功能权限
951
954
  */
952
- hasPermit(e, a) {
955
+ hasPermit(e, t) {
953
956
  var s;
954
- const t = ee.value;
955
- return !t || !t.permits ? !1 : ((s = t.permits[e]) == null ? void 0 : s.includes(a)) ?? !1;
957
+ const a = ee.value;
958
+ return !a || !a.permits ? !1 : ((s = a.permits[e]) == null ? void 0 : s.includes(t)) ?? !1;
956
959
  },
957
960
  /**
958
961
  * 获取用户信息
@@ -967,15 +970,15 @@ const Jt = (e) => {
967
970
  * @param userInfo 用户信息
968
971
  * @param token 用户Token
969
972
  */
970
- setUserInfo(e, a) {
971
- if (!Me(a)) {
973
+ setUserInfo(e, t) {
974
+ if (!Me(t)) {
972
975
  this.clean();
973
976
  return;
974
977
  }
975
- L.value || (L.value = e.UserLevel, this.userInfo = {
978
+ k.value || (k.value = e.UserLevel, this.userInfo = {
976
979
  ...this.userInfo,
977
980
  ...e
978
- }, this.token = a, he(this.token), this.isLogin = !0);
981
+ }, this.token = t, me(this.token), this.isLogin = !0);
979
982
  },
980
983
  /**
981
984
  * 获取用户Token
@@ -990,20 +993,20 @@ const Jt = (e) => {
990
993
  * 是否超级管理员
991
994
  */
992
995
  isSuperAdmin() {
993
- return L.value === "Super";
996
+ return k.value === "Super";
994
997
  },
995
998
  /**
996
999
  * 是否管理员
997
1000
  */
998
1001
  isAdmin() {
999
- return L.value === "Super" || L.value === "Admin";
1002
+ return k.value === "Super" || k.value === "Admin";
1000
1003
  },
1001
1004
  /**
1002
1005
  * 获取用户级别
1003
1006
  * @returns 用户级别
1004
1007
  */
1005
1008
  getUserLevel() {
1006
- return L.value;
1009
+ return k.value;
1007
1010
  },
1008
1011
  /*
1009
1012
  * 清理登录信息
@@ -1015,7 +1018,7 @@ const Jt = (e) => {
1015
1018
  Code: "",
1016
1019
  TenantId: "",
1017
1020
  UserLevel: ""
1018
- }, this.token = "", he(this.token), this.isLogin = !1, ee.value = null, L.value = "", H().clean(), Promise.resolve();
1021
+ }, this.token = "", me(this.token), this.isLogin = !1, ee.value = null, k.value = "", H().clean(), Promise.resolve();
1019
1022
  },
1020
1023
  /**
1021
1024
  * 登出操作
@@ -1023,7 +1026,7 @@ const Jt = (e) => {
1023
1026
  */
1024
1027
  async logout() {
1025
1028
  try {
1026
- await zt();
1029
+ await za();
1027
1030
  } catch (e) {
1028
1031
  console.error("调用登出接口失败", e);
1029
1032
  } finally {
@@ -1036,7 +1039,7 @@ const Jt = (e) => {
1036
1039
  return Promise.resolve();
1037
1040
  }
1038
1041
  },
1039
- persist: ye() ? !1 : {
1042
+ persist: Se() ? !1 : {
1040
1043
  key: "MICROAPP_USER_INFO",
1041
1044
  storage: localStorage,
1042
1045
  pick: ["token", "userInfo"],
@@ -1045,10 +1048,10 @@ const Jt = (e) => {
1045
1048
  e.store.init();
1046
1049
  }
1047
1050
  }
1048
- }), Qa = (e, a) => {
1049
- const t = j();
1050
- return e.filter((n) => n.role && !t.hasRole(n.role) || n.permit && !t.hasPermit(oe.currentRoute.value.path, n.permit) || n.enabled === !1 ? !1 : typeof n.enabled == "function" ? n.enabled() : !0).filter((n) => {
1051
- if (!a) {
1051
+ }), Qt = (e, t) => {
1052
+ const a = j();
1053
+ 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) => {
1054
+ if (!t) {
1052
1055
  if (n.visible === !1)
1053
1056
  return !1;
1054
1057
  if (typeof n.visible == "function")
@@ -1056,32 +1059,32 @@ const Jt = (e) => {
1056
1059
  }
1057
1060
  return !0;
1058
1061
  });
1059
- }, Ja = (e, a) => {
1060
- const t = a == null ? void 0 : a.filter((s) => {
1062
+ }, Jt = (e, t) => {
1063
+ const a = t == null ? void 0 : t.filter((s) => {
1061
1064
  const n = e.find(
1062
1065
  (o) => o.dataIndex === s.dataIndex || o.key === s.key || o.title === s.title
1063
1066
  );
1064
1067
  return n ? { ...s, ...n } : !1;
1065
1068
  });
1066
- return [...t || [], ...e.filter((s) => !(t != null && t.includes(s)))];
1067
- }, Zt = (e) => (e.remotePage = !1, lt(e).then((a) => a.rows)), lt = (e) => {
1069
+ return [...a || [], ...e.filter((s) => !(a != null && a.includes(s)))];
1070
+ }, Za = (e) => (e.remotePage = !1, la(e).then((t) => t.rows)), la = (e) => {
1068
1071
  e.gridQuery || (e.gridQuery = {});
1069
- const a = e.remotePage ? "find" : "list";
1072
+ const t = e.remotePage ? "find" : "list";
1070
1073
  return Ve(e, {
1071
- urlKey: a,
1074
+ urlKey: t,
1072
1075
  url: e.gridUrl,
1073
1076
  params: e.gridQuery,
1074
1077
  loadingState: e.isGridLoading,
1075
- processParams: (t) => {
1078
+ processParams: (a) => {
1076
1079
  var n;
1077
- return e.remotePage && (t.Query.$limit = [(e.pageNo.value - 1) * e.pageSize.value, e.pageSize.value]), Oe((n = e.gridUrl) == null ? void 0 : n.params, t, e.gridQuery);
1080
+ 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);
1078
1081
  }
1079
- }).then((t) => {
1080
- if ((t == null ? void 0 : t.status) === T.SUCCESS) {
1081
- let s = t.data;
1082
- return s.rows ? (e.tableData.value = s.rows, e.total.value = s.total) : (e.tableData.value = t.data, e.total.value = t.data.length, s = {
1082
+ }).then((a) => {
1083
+ if ((a == null ? void 0 : a.status) === T.SUCCESS) {
1084
+ let s = a.data;
1085
+ return s.rows ? (e.tableData.value = s.rows, e.total.value = s.total) : (e.tableData.value = a.data, e.total.value = a.data.length, s = {
1083
1086
  total: e.total.value,
1084
- rows: t.data
1087
+ rows: a.data
1085
1088
  }, e.afterLoad && e.afterLoad(s)), s;
1086
1089
  }
1087
1090
  return e.tableData.value = [], e.total.value = 0, {
@@ -1089,72 +1092,72 @@ const Jt = (e) => {
1089
1092
  rows: []
1090
1093
  };
1091
1094
  });
1092
- }, ea = (e, a, t = {}) => tt(e, {
1095
+ }, et = (e, t, a = {}) => aa(e, {
1093
1096
  urlKey: "update",
1094
1097
  url: e.updateUrl,
1095
1098
  params: {
1096
- Query: { [e.primaryKey]: a[e.primaryKey] },
1097
- Data: a
1099
+ Query: { [e.primaryKey]: t[e.primaryKey] },
1100
+ Data: t
1098
1101
  },
1099
1102
  loadingState: e.isGridSaving,
1100
- ...t
1103
+ ...a
1101
1104
  }).then((s) => ((s == null ? void 0 : s.status) === T.SUCCESS && setTimeout(() => {
1102
- e.reload.value = !0, e.afterUpdate && e.afterUpdate(a);
1103
- }, 50), s)), ja = (e, a) => {
1104
- const t = {};
1105
- return t[e.primaryKey] = a[e.primaryKey], t[e.statusKey] = a[e.statusKey], ea(e, t, {
1105
+ e.reload.value = !0, e.afterUpdate && e.afterUpdate(t);
1106
+ }, 50), s)), jt = (e, t) => {
1107
+ const a = {};
1108
+ return a[e.primaryKey] = t[e.primaryKey], a[e.statusKey] = t[e.statusKey], et(e, a, {
1106
1109
  loadingText: !1,
1107
1110
  hideErrorToast: !0
1108
1111
  });
1109
- }, ut = async (e, a, t) => await Ve(e, {
1112
+ }, ua = async (e, t, a) => await Ve(e, {
1110
1113
  urlKey: "detail",
1111
- url: t,
1112
- params: a,
1114
+ url: a,
1115
+ params: t,
1113
1116
  loadingState: e.isGridLoading
1114
- }), Ga = (e, a) => {
1115
- const t = a;
1116
- return ut(e, { [e.primaryKey]: t[e.primaryKey] }).then((s) => ((s == null ? void 0 : s.status) === T.SUCCESS && s.data && (e.expandRows.value[t[e.primaryKey]] = s), s));
1117
- }, Wa = (e, a) => {
1118
- let t = e.editor;
1119
- e.rowData.value = a, t && (st(t, a), t.visible.value = !0);
1120
- }, qa = (e, a) => Dt(e, a, {
1117
+ }), Gt = (e, t) => {
1118
+ const a = t;
1119
+ 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));
1120
+ }, Wt = (e, t) => {
1121
+ let a = e.editor;
1122
+ e.rowData.value = t, a && (sa(a, t), a.visible.value = !0);
1123
+ }, qt = (e, t) => Da(e, t, {
1121
1124
  url: e.deleteUrl,
1122
1125
  primaryKey: e.primaryKey
1123
- }).then((t) => ((t == null ? void 0 : t.status) === T.SUCCESS && setTimeout(() => {
1124
- e.reload.value = !0, e.afterDelete && !Array.isArray(a) && e.afterDelete(a);
1125
- }, 50), t));
1126
+ }).then((a) => ((a == null ? void 0 : a.status) === T.SUCCESS && setTimeout(() => {
1127
+ e.reload.value = !0, e.afterDelete && !Array.isArray(t) && e.afterDelete(t);
1128
+ }, 50), a));
1126
1129
  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 || {});
1127
- class ta {
1130
+ class at {
1128
1131
  constructor() {
1129
- F(this, "listeners", {});
1132
+ $(this, "listeners", {});
1130
1133
  }
1131
1134
  // 检查事件名是否符合前缀
1132
- isValidPrefix(a) {
1133
- return Object.values(Ne).some((t) => a.startsWith(t + "."));
1135
+ isValidPrefix(t) {
1136
+ return Object.values(Ne).some((a) => t.startsWith(a + "."));
1134
1137
  }
1135
1138
  /**
1136
1139
  * 事件订阅
1137
1140
  * @param event 事件名
1138
1141
  * @param listener 处理器
1139
1142
  */
1140
- on(a, t) {
1141
- if (!this.isValidPrefix(a)) {
1142
- console.error(`事件前缀不正确: ${a}, 事件名必须以 ${Object.values(Ne).join(", ")} 开头`);
1143
+ on(t, a) {
1144
+ if (!this.isValidPrefix(t)) {
1145
+ console.error(`事件前缀不正确: ${t}, 事件名必须以 ${Object.values(Ne).join(", ")} 开头`);
1143
1146
  return;
1144
1147
  }
1145
- this.listeners[a] || (this.listeners[a] = []), this.listeners[a].push(t);
1148
+ this.listeners[t] || (this.listeners[t] = []), this.listeners[t].push(a);
1146
1149
  }
1147
1150
  /**
1148
1151
  * 取消订阅事件
1149
1152
  * @param event 事件名
1150
1153
  * @param listener 处理器
1151
1154
  */
1152
- off(a, t) {
1153
- if (!this.isValidPrefix(a)) {
1154
- console.error(`事件前缀不正确: ${a}`);
1155
+ off(t, a) {
1156
+ if (!this.isValidPrefix(t)) {
1157
+ console.error(`事件前缀不正确: ${t}`);
1155
1158
  return;
1156
1159
  }
1157
- this.listeners[a] && (this.listeners[a] = this.listeners[a].filter((s) => s !== t));
1160
+ this.listeners[t] && (this.listeners[t] = this.listeners[t].filter((s) => s !== a));
1158
1161
  }
1159
1162
  //
1160
1163
  /**
@@ -1162,164 +1165,164 @@ class ta {
1162
1165
  * @param event 事件名
1163
1166
  * @param args 参数
1164
1167
  */
1165
- emit(a, ...t) {
1166
- if (!this.isValidPrefix(a)) {
1167
- console.error(`事件前缀不正确: ${a}`);
1168
+ emit(t, ...a) {
1169
+ if (!this.isValidPrefix(t)) {
1170
+ console.error(`事件前缀不正确: ${t}`);
1168
1171
  return;
1169
1172
  }
1170
- this.listeners[a] && this.listeners[a].forEach((s) => s(a, ...t));
1173
+ this.listeners[t] && this.listeners[t].forEach((s) => s(t, ...a));
1171
1174
  }
1172
1175
  }
1173
- const q = new ta(), Z = (e, a, t) => {
1174
- if (a.inputFactory && (t != null && t.reloadEvent)) {
1175
- const s = a.inputFactory.value;
1176
+ const q = new at(), Z = (e, t, a) => {
1177
+ if (t.inputFactory && (a != null && a.reloadEvent)) {
1178
+ const s = t.inputFactory.value;
1176
1179
  s.reloadHandler = (n, o) => {
1177
- aa(a.url, a, o);
1178
- }, q.on(t.reloadEvent, s.reloadHandler);
1180
+ tt(t.url, t, o);
1181
+ }, q.on(a.reloadEvent, s.reloadHandler);
1179
1182
  }
1180
- if (t != null && t.data)
1181
- y(
1182
- () => t.data,
1183
+ if (a != null && a.data)
1184
+ g(
1185
+ () => a.data,
1183
1186
  () => {
1184
- Ge(a, t.data, !0);
1187
+ Ge(t, a.data, !0);
1185
1188
  },
1186
1189
  { deep: !0, immediate: !0 }
1187
1190
  );
1188
- else if (a.url && a.url.url)
1189
- e && ct(a.url, a, a.params ?? {});
1191
+ else if (t.url && t.url.url)
1192
+ e && ca(t.url, t, t.params ?? {});
1190
1193
  else {
1191
- const s = f(ae(D.LabelText, ""));
1194
+ const s = f(te(D.LabelText, ""));
1192
1195
  x.error("`" + s.value + "` 未配置选项数据!", {
1193
1196
  duration: 5e3
1194
1197
  });
1195
1198
  }
1196
- }, Ge = (e, a, t) => {
1197
- if (t) {
1199
+ }, Ge = (e, t, a) => {
1200
+ if (a) {
1198
1201
  const s = {
1199
1202
  ...e.fieldMap
1200
1203
  };
1201
- a = $t(s, a);
1204
+ t = $a(s, t);
1202
1205
  }
1203
- a = JSON.parse(JSON.stringify(a ?? [])), e.all && a.unshift({
1206
+ t = JSON.parse(JSON.stringify(t ?? [])), e.all && t.unshift({
1204
1207
  label: "全部",
1205
1208
  value: e.allValue ?? void 0
1206
- }), e.options.value = a;
1207
- }, aa = (e, a, t) => {
1208
- Array.isArray(t) ? Ge(a, t, !0) : ct(e, a, t);
1209
- }, pe = (e, a) => {
1210
- var t;
1211
- (t = e.inputFactory) != null && t.value && a.reloadEvent && e.inputFactory.value.reloadHandler && q.off(a.reloadEvent, e.inputFactory.value.reloadHandler);
1212
- }, ct = (e, a, t) => {
1213
- const s = JSON.parse(JSON.stringify(e.params ?? {})), n = JSON.parse(JSON.stringify(a.params ?? {})), o = Oe(s, n, t);
1214
- sa(e, a, a.fieldMap, o).then((r) => {
1215
- Ge(a, r, !1);
1209
+ }), e.options.value = t;
1210
+ }, tt = (e, t, a) => {
1211
+ Array.isArray(a) ? Ge(t, a, !0) : ca(e, t, a);
1212
+ }, de = (e, t) => {
1213
+ var a;
1214
+ (a = e.inputFactory) != null && a.value && t.reloadEvent && e.inputFactory.value.reloadHandler && q.off(t.reloadEvent, e.inputFactory.value.reloadHandler);
1215
+ }, ca = (e, t, a) => {
1216
+ const s = JSON.parse(JSON.stringify(e.params ?? {})), n = JSON.parse(JSON.stringify(t.params ?? {})), o = ce(s, n, a);
1217
+ st(e, t, t.fieldMap, o).then((r) => {
1218
+ Ge(t, r, !1);
1216
1219
  });
1217
- }, sa = (e, a, t, s) => {
1220
+ }, st = (e, t, a, s) => {
1218
1221
  const { fieldMap: n, ...o } = e, l = {
1219
1222
  ...{
1220
1223
  url: "",
1221
1224
  cacheTime: 6e4,
1222
1225
  fieldMap: {
1223
1226
  ...e.fieldMap,
1224
- ...t
1227
+ ...a
1225
1228
  }
1226
1229
  },
1227
1230
  ...o
1228
1231
  };
1229
- return l.loadingText = !1, s || (s = {}), s.Query || (s.Query = {}), a.optionQuery = s, a.isOptionLoading.value = !0, G(l, s).then((i) => (i == null ? void 0 : i.status) === T.SUCCESS && i.data ? i.data : []).finally(() => {
1230
- a.isOptionLoading.value = !1;
1232
+ 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(() => {
1233
+ t.isOptionLoading.value = !1;
1231
1234
  });
1232
- }, na = (e, a, t) => {
1235
+ }, nt = (e, t, a) => {
1233
1236
  if (e === void 0) return;
1234
1237
  const s = (o) => {
1235
1238
  const r = { ...o };
1236
- return t && o.children && o.children.length > 0 ? r.children = o.children.map((l) => s(l)) : delete r.children, r;
1239
+ return a && o.children && o.children.length > 0 ? r.children = o.children.map((l) => s(l)) : delete r.children, r;
1237
1240
  }, n = (o, r) => {
1238
1241
  const l = [];
1239
- for (const i of r)
1240
- if (o.includes(i.value) && l.push(s(i)), i.children && i.children.length > 0) {
1241
- const u = n(o, i.children);
1242
- l.push(...u);
1242
+ for (const u of r)
1243
+ if (o.includes(u.value) && l.push(s(u)), u.children && u.children.length > 0) {
1244
+ const i = n(o, u.children);
1245
+ l.push(...i);
1243
1246
  }
1244
1247
  return l;
1245
1248
  };
1246
1249
  if (Array.isArray(e))
1247
- return n(e, a);
1250
+ return n(e, t);
1248
1251
  {
1249
- const o = n([e], a);
1252
+ const o = n([e], t);
1250
1253
  return o.length > 0 ? o[0] : void 0;
1251
1254
  }
1252
- }, we = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((a) => a.label) : [e.label], te = (e, a, t) => {
1253
- const s = a.split(".");
1255
+ }, we = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((t) => t.label) : [e.label], ae = (e, t, a) => {
1256
+ const s = t.split(".");
1254
1257
  let n = e;
1255
1258
  for (let o = 0; o < s.length - 1; o++) {
1256
1259
  const r = s[o];
1257
1260
  n[r] || (n[r] = {}), n = n[r];
1258
1261
  }
1259
- n[s[s.length - 1]] = t;
1260
- }, ft = (e, a, t) => {
1261
- if (t == null) {
1262
- Object.entries(a).forEach(([s]) => {
1263
- te(e, s, t);
1262
+ n[s[s.length - 1]] = a;
1263
+ }, fa = (e, t, a) => {
1264
+ if (a == null) {
1265
+ Object.entries(t).forEach(([s]) => {
1266
+ ae(e, s, a);
1264
1267
  });
1265
1268
  return;
1266
1269
  }
1267
- Array.isArray(t) ? Object.entries(a).forEach(([s, n]) => {
1270
+ Array.isArray(a) ? Object.entries(t).forEach(([s, n]) => {
1268
1271
  var r;
1269
1272
  if (/^\$\{\d+\}/.test(n))
1270
1273
  try {
1271
- const l = parseInt(((r = n.match(/\$\{(\d+)\}/)) == null ? void 0 : r[1]) ?? "0"), i = t[l], u = n.replace(/\$\{\d+\}\./, "");
1272
- if (u && i) {
1273
- const c = be(u, i);
1274
- te(e, s, c);
1274
+ const l = parseInt(((r = n.match(/\$\{(\d+)\}/)) == null ? void 0 : r[1]) ?? "0"), u = a[l], i = n.replace(/\$\{\d+\}\./, "");
1275
+ if (i && u) {
1276
+ const c = be(i, u);
1277
+ ae(e, s, c);
1275
1278
  } else
1276
- te(e, s, i);
1279
+ ae(e, s, u);
1277
1280
  } catch {
1278
1281
  console.error("outFields 格式错误:" + n, "必须是 ${index} 或者 ${index}.${key}");
1279
1282
  }
1280
1283
  else
1281
1284
  console.error("outFields 格式错误:" + n, "必须是 ${index} 或者 ${index}.${key}");
1282
- }) : Object.entries(a).forEach(([s, n]) => {
1285
+ }) : Object.entries(t).forEach(([s, n]) => {
1283
1286
  if (n.includes("${")) {
1284
- const o = be(n, t);
1285
- te(e, s, o);
1287
+ const o = be(n, a);
1288
+ ae(e, s, o);
1286
1289
  } else
1287
- te(e, s, t[n]);
1290
+ ae(e, s, a[n]);
1288
1291
  });
1289
- }, Pe = (e, a, t) => {
1292
+ }, Pe = (e, t, a) => {
1290
1293
  var o, r;
1291
1294
  const s = (o = e.inputFactory) == null ? void 0 : o.value;
1292
- s != null && s.editorCtrl && ((r = s.errInfo) != null && r.value.errClass) && fe(s.editorCtrl), e.selected.value = t;
1293
- const n = na(t, e.options.value);
1294
- if (e.selectedOptions.value = n, a.formData && a.outFields && ft(a.formData, a.outFields, n), a.changeEvent) {
1295
- const [l, i] = a.changeEvent;
1296
- if (i)
1295
+ s != null && s.editorCtrl && ((r = s.errInfo) != null && r.value.errClass) && pe(s.editorCtrl), e.selected.value = a;
1296
+ const n = nt(a, e.options.value);
1297
+ if (e.selectedOptions.value = n, t.formData && t.outFields && fa(t.formData, t.outFields, n), t.changeEvent) {
1298
+ const [l, u] = t.changeEvent;
1299
+ if (u)
1297
1300
  if (Array.isArray(l))
1298
- l.every((u) => {
1299
- const c = be(i, { selectedValues: t });
1301
+ l.every((i) => {
1302
+ const c = be(u, { selectedValues: a });
1300
1303
  try {
1301
1304
  const p = JSON.parse(c);
1302
- q.emit(u, p, t, n);
1305
+ q.emit(i, p, a, n);
1303
1306
  } catch (p) {
1304
1307
  console.error("eventParamsValue: ", c, p);
1305
1308
  }
1306
1309
  });
1307
1310
  else {
1308
- const u = be(i, { selectedValues: t });
1311
+ const i = be(u, { selectedValues: a });
1309
1312
  try {
1310
- const c = JSON.parse(u);
1311
- q.emit(l, c, t, n);
1313
+ const c = JSON.parse(i);
1314
+ q.emit(l, c, a, n);
1312
1315
  } catch (c) {
1313
- console.error("eventParamsValue: ", u, c);
1316
+ console.error("eventParamsValue: ", i, c);
1314
1317
  }
1315
1318
  }
1316
1319
  else
1317
- Array.isArray(l) ? l.every((u) => {
1318
- q.emit(u, n, t);
1319
- }) : q.emit(l, n, t);
1320
+ Array.isArray(l) ? l.every((i) => {
1321
+ q.emit(i, n, a);
1322
+ }) : q.emit(l, n, a);
1320
1323
  }
1321
- return s != null && s.inputEmit && s.inputEmit("change", t, n), n;
1322
- }, b = {
1324
+ return s != null && s.inputEmit && s.inputEmit("change", a, n), n;
1325
+ }, S = {
1323
1326
  PageOption: {
1324
1327
  primaryKey: "Id",
1325
1328
  statusKey: "Enabled"
@@ -1357,31 +1360,31 @@ const q = new ta(), Z = (e, a, t) => {
1357
1360
  value: "Id"
1358
1361
  }
1359
1362
  }
1360
- }, Ba = (e) => {
1361
- b.PageOption = {
1362
- ...b.PageOption,
1363
+ }, Bt = (e) => {
1364
+ S.PageOption = {
1365
+ ...S.PageOption,
1363
1366
  ...e.pageOption
1364
- }, b.GridOption = {
1365
- ...b.GridOption,
1367
+ }, S.GridOption = {
1368
+ ...S.GridOption,
1366
1369
  ...e.gridOption
1367
- }, b.EditorOption = {
1368
- ...b.EditorOption,
1370
+ }, S.EditorOption = {
1371
+ ...S.EditorOption,
1369
1372
  ...e.editorOptions
1370
- }, b.TreeOption = {
1371
- ...b.TreeOption,
1373
+ }, S.TreeOption = {
1374
+ ...S.TreeOption,
1372
1375
  ...e.treeOption
1373
1376
  };
1374
1377
  }, ke = (e) => {
1375
- for (let a in e.urls)
1376
- e.urls[a].api || (e.urls[a].api = e.api), e.urls[a].authorize === void 0 && (e.urls[a].authorize = e.authorize);
1377
- }, ra = (e, a, t, s) => (ke(e), {
1378
+ for (let t in e.urls)
1379
+ e.urls[t].api || (e.urls[t].api = e.api), e.urls[t].authorize === void 0 && (e.urls[t].authorize = e.authorize);
1380
+ }, rt = (e, t, a, s) => (ke(e), {
1378
1381
  editorCtrl: {
1379
- ...b.EditorOption,
1382
+ ...S.EditorOption,
1380
1383
  name: "",
1381
- default: t ? JSON.parse(JSON.stringify(t)) : void 0,
1384
+ default: a ? JSON.parse(JSON.stringify(a)) : void 0,
1382
1385
  visible: f(!1),
1383
- page: a,
1384
- formData: f(t ? JSON.parse(JSON.stringify(t)) : void 0),
1386
+ page: t,
1387
+ formData: f(a ? JSON.parse(JSON.stringify(a)) : void 0),
1385
1388
  formRules: f(s),
1386
1389
  ruleResults: f({}),
1387
1390
  updateData: f(void 0),
@@ -1390,23 +1393,23 @@ const q = new ta(), Z = (e, a, t) => {
1390
1393
  isFormSaving: f(!1),
1391
1394
  isFormLoading: f(!1)
1392
1395
  }
1393
- }), oa = (e, a, t) => {
1396
+ }), ot = (e, t, a) => {
1394
1397
  ke(e);
1395
1398
  const s = {
1396
- ...b.GridOption,
1397
- tableSize: f(b.GridOption.tableSize.value),
1398
- selectable: f(b.GridOption.selectable.value),
1399
- searchBar: f(b.GridOption.searchBar.value),
1400
- pageSize: f(b.GridOption.pageSize.value),
1401
- rowExpand: f(b.GridOption.rowExpand.value),
1402
- buttons: f([...b.GridOption.buttons.value]),
1403
- tools: [...b.GridOption.tools],
1404
- operates: [...b.GridOption.operates],
1405
- columns: f(t || []),
1399
+ ...S.GridOption,
1400
+ tableSize: f(S.GridOption.tableSize.value),
1401
+ selectable: f(S.GridOption.selectable.value),
1402
+ searchBar: f(S.GridOption.searchBar.value),
1403
+ pageSize: f(S.GridOption.pageSize.value),
1404
+ rowExpand: f(S.GridOption.rowExpand.value),
1405
+ buttons: f([...S.GridOption.buttons.value]),
1406
+ tools: [...S.GridOption.tools],
1407
+ operates: [...S.GridOption.operates],
1408
+ columns: f(a || []),
1406
1409
  reload: f(!1),
1407
1410
  pageNo: f(1),
1408
1411
  total: f(0),
1409
- page: a,
1412
+ page: t,
1410
1413
  selectKeys: f([]),
1411
1414
  selectRows: f([]),
1412
1415
  rowData: f(void 0),
@@ -1419,40 +1422,40 @@ const q = new ta(), Z = (e, a, t) => {
1419
1422
  updateUrl: e.urls.update,
1420
1423
  deleteUrl: e.urls.delete
1421
1424
  };
1422
- return y(
1425
+ return g(
1423
1426
  () => s.reload.value,
1424
1427
  (n) => {
1425
1428
  n && (setTimeout(() => {
1426
1429
  s.reload.value = !1;
1427
- }, 1), s.remotePage ? lt(s) : Zt(s));
1430
+ }, 1), s.remotePage ? la(s) : Za(s));
1428
1431
  }
1429
1432
  ), {
1430
1433
  gridCtrl: s
1431
1434
  };
1432
- }, Ca = (e, a) => {
1435
+ }, Ct = (e, t) => {
1433
1436
  ke(e);
1434
- const t = {
1435
- ...b.TreeOption,
1437
+ const a = {
1438
+ ...S.TreeOption,
1436
1439
  reload: f(!1),
1437
- page: a,
1440
+ page: t,
1438
1441
  node: f(void 0),
1439
1442
  url: e.urls.tree,
1440
1443
  data: K(void 0),
1441
1444
  isTreeLoading: f(!1)
1442
1445
  };
1443
- return y(
1444
- () => t.reload.value,
1446
+ return g(
1447
+ () => a.reload.value,
1445
1448
  (s) => {
1446
1449
  s && (setTimeout(() => {
1447
- t.reload.value = !1;
1448
- }, 1), Ut(t));
1450
+ a.reload.value = !1;
1451
+ }, 1), Ua(a));
1449
1452
  }
1450
1453
  ), {
1451
- treeCtrl: t
1454
+ treeCtrl: a
1452
1455
  };
1453
- }, de = (e, a) => {
1454
- const t = {
1455
- ...b.OptionOption,
1456
+ }, he = (e, t) => {
1457
+ const a = {
1458
+ ...S.OptionOption,
1456
1459
  url: e,
1457
1460
  reload: f(!1),
1458
1461
  optionQuery: {},
@@ -1462,34 +1465,34 @@ const q = new ta(), Z = (e, a, t) => {
1462
1465
  options: f([]),
1463
1466
  isOptionLoading: f(!1)
1464
1467
  };
1465
- return y(
1466
- () => t.reload.value,
1468
+ return g(
1469
+ () => a.reload.value,
1467
1470
  (s) => {
1468
1471
  s && (setTimeout(() => {
1469
- t.reload.value = !1;
1470
- }, 1), Z(!0, t, a));
1472
+ a.reload.value = !1;
1473
+ }, 1), Z(!0, a, t));
1471
1474
  }
1472
1475
  ), {
1473
- optionCtrl: t
1476
+ optionCtrl: a
1474
1477
  };
1475
- }, za = (e, a, t) => {
1478
+ }, zt = (e, t, a) => {
1476
1479
  ke(e);
1477
1480
  const s = {
1478
- ...b.PageOption,
1481
+ ...S.PageOption,
1479
1482
  ...e
1480
- }, { editorCtrl: n } = ra(e, s, a, t), { gridCtrl: o } = oa(e, s);
1483
+ }, { editorCtrl: n } = rt(e, s, t, a), { gridCtrl: o } = ot(e, s);
1481
1484
  return s.editor = n, s.grid = o, o.editor = n, o.tools = ["Reload", "RowHeight", "TableHeadset", "Fullscreen"], n.grid = o, {
1482
1485
  pageCtrl: s,
1483
1486
  editorCtrl: n,
1484
1487
  gridCtrl: o
1485
1488
  };
1486
- }, ia = 7 * 24 * 60 * 60 * 1e3, _e = /* @__PURE__ */ new Map(), Ye = /* @__PURE__ */ new Set(), J = f({}), Ya = J, Xa = (e) => {
1489
+ }, it = 7 * 24 * 60 * 60 * 1e3, _e = /* @__PURE__ */ new Map(), Ye = /* @__PURE__ */ new Set(), J = f({}), Yt = J, Xt = (e) => {
1487
1490
  var n;
1488
1491
  if (!e.iconUrl) return De;
1489
- const a = f(!0), t = f("");
1492
+ const t = f(!0), a = f("");
1490
1493
  let s = !0;
1491
- return (n = e.icons) != null && n.length && (s = e.icons.every((o) => J.value[o] !== void 0)), (e.icon && !J.value[e.icon] || !s) && la(e, a).then(() => {
1492
- fa(e.iconUrl, e.monoColor || !1), a.value = !0;
1494
+ 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(() => {
1495
+ ft(e.iconUrl, e.monoColor || !1), t.value = !0;
1493
1496
  }), X({
1494
1497
  props: {
1495
1498
  icon: {
@@ -1517,119 +1520,119 @@ const q = new ta(), Z = (e, a, t) => {
1517
1520
  },
1518
1521
  emits: ["update:iconIndex"],
1519
1522
  setup(o, { emit: r }) {
1520
- const l = f(o.icon), i = f(0), u = () => {
1521
- o.icons && i.value++;
1523
+ const l = f(o.icon), u = f(0), i = () => {
1524
+ o.icons && u.value++;
1522
1525
  };
1523
- return y(
1526
+ return g(
1524
1527
  () => o.iconIndex,
1525
1528
  (c) => {
1526
- c !== void 0 && (i.value = c);
1529
+ c !== void 0 && (u.value = c);
1527
1530
  },
1528
1531
  { immediate: !0 }
1529
- ), y(
1530
- () => i.value,
1532
+ ), g(
1533
+ () => u.value,
1531
1534
  (c) => {
1532
- o.icons && (c >= o.icons.length && (i.value = 0), l.value = o.icons[i.value], me(t, l, l.value), r("update:iconIndex", i.value));
1535
+ 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));
1533
1536
  },
1534
1537
  { immediate: !0 }
1535
- ), y(
1538
+ ), g(
1536
1539
  () => J.value,
1537
1540
  () => {
1538
- me(t, l, l.value);
1541
+ ve(a, l, l.value);
1539
1542
  },
1540
1543
  { deep: !0 }
1541
- ), y(
1544
+ ), g(
1542
1545
  () => o.icon,
1543
1546
  (c) => {
1544
- me(t, l, c);
1547
+ ve(a, l, c);
1545
1548
  }
1546
- ), me(t, l, l.value), { isLoaded: a, Icon: t, handleClick: u };
1549
+ ), ve(a, l, l.value), { isLoaded: t, Icon: a, handleClick: i };
1547
1550
  },
1548
1551
  render() {
1549
- if (!a.value)
1552
+ if (!t.value)
1550
1553
  return De;
1551
1554
  let o = this.class, r = "";
1552
1555
  Array.isArray(o) ? r = o.join(" ") : typeof o == "string" && (r = o);
1553
1556
  let l = [r];
1554
- return !/\bw-/.test(r) && !/$w-/.test(r) && l.push("w-4"), !/\bh-/.test(r) && !/$h-/.test(r) && l.push("h-4"), t.value ? U(Ze(t.value), {
1557
+ 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), {
1555
1558
  onClick: this.$props.clickable ? this.handleClick : void 0,
1556
1559
  class: `${l.join(" ")}`,
1557
1560
  style: {
1558
1561
  fill: "currentColor",
1559
1562
  cursor: this.$props.clickable ? "pointer" : "default",
1560
- transform: da(this.angle, this.flip)
1563
+ transform: dt(this.angle, this.flip)
1561
1564
  }
1562
1565
  }) : U("div", { class: "w-[14px] h-[14px]" });
1563
1566
  }
1564
1567
  });
1565
- }, la = (e, a) => {
1566
- let t = e.iconUrl;
1567
- if (!t)
1568
+ }, lt = (e, t) => {
1569
+ let a = e.iconUrl;
1570
+ if (!a)
1568
1571
  return console.error("图标库地址不能为空"), Promise.resolve();
1569
- if (_e.has(t))
1572
+ if (_e.has(a))
1570
1573
  return Promise.resolve();
1571
- const s = dt(t);
1574
+ const s = da(a);
1572
1575
  if (s)
1573
- return new Promise(async (o) => (pt(s.scriptContent), o()));
1574
- a.value = !1;
1576
+ return new Promise(async (o) => (pa(s.scriptContent), o()));
1577
+ t.value = !1;
1575
1578
  const n = new Promise(async (o) => {
1576
- await ua(t, e.monoColor || !1), o(), _e.delete(t);
1579
+ await ut(a, e.monoColor || !1), o(), _e.delete(a);
1577
1580
  });
1578
- return _e.set(t, n), n;
1579
- }, ua = async (e, a) => {
1581
+ return _e.set(a, n), n;
1582
+ }, ut = async (e, t) => {
1580
1583
  try {
1581
- const t = await fetch(e);
1582
- if (!t.ok) {
1584
+ const a = await fetch(e);
1585
+ if (!a.ok) {
1583
1586
  x.error("网络异常,无法加载图标库!");
1584
1587
  return;
1585
1588
  }
1586
- let s = await t.text();
1587
- s = a ? s.replace(/fill=\"[^\"]*\"/gi, "") : s;
1589
+ let s = await a.text();
1590
+ s = t ? s.replace(/fill=\"[^\"]*\"/gi, "") : s;
1588
1591
  let n = /^window\.(\w+)\s*=/;
1589
1592
  const o = s.match(n);
1590
1593
  if (o && o.length > 1) {
1591
1594
  let r = o[1];
1592
- ca(e, r, a, s);
1595
+ ct(e, r, t, s);
1593
1596
  }
1594
- pt(s);
1597
+ pa(s);
1595
1598
  return;
1596
- } catch (t) {
1597
- return console.error("网络异常,无法加载图标库:", t), null;
1599
+ } catch (a) {
1600
+ return console.error("网络异常,无法加载图标库:", a), null;
1598
1601
  }
1599
- }, pt = (e) => {
1600
- const a = document.createElement("script");
1601
- a.textContent = e, document.head.appendChild(a);
1602
- }, ca = (e, a, t, s) => {
1602
+ }, pa = (e) => {
1603
+ const t = document.createElement("script");
1604
+ t.textContent = e, document.head.appendChild(t);
1605
+ }, ct = (e, t, a, s) => {
1603
1606
  let n = `icon_cache:${e}`;
1604
1607
  const o = {
1605
- windowKey: a,
1606
- monoColor: t,
1608
+ windowKey: t,
1609
+ monoColor: a,
1607
1610
  scriptContent: s,
1608
- expireTime: Date.now() + ia
1611
+ expireTime: Date.now() + it
1609
1612
  // 缓存时间:7天
1610
1613
  };
1611
1614
  localStorage.setItem(n, JSON.stringify(o));
1612
- }, dt = (e) => {
1613
- let a = `icon_cache:${e}`;
1614
- const t = localStorage.getItem(a);
1615
- if (!t) return null;
1615
+ }, da = (e) => {
1616
+ let t = `icon_cache:${e}`;
1617
+ const a = localStorage.getItem(t);
1618
+ if (!a) return null;
1616
1619
  let s;
1617
1620
  try {
1618
- s = JSON.parse(t);
1621
+ s = JSON.parse(a);
1619
1622
  } catch (n) {
1620
1623
  return console.error("解析缓存失败:", n), null;
1621
1624
  }
1622
1625
  return s.expireTime < Date.now() ? (localStorage.removeItem(e), null) : s;
1623
- }, Za = () => {
1626
+ }, Zt = () => {
1624
1627
  const e = Date.now();
1625
- for (const a in localStorage)
1626
- if (a.startsWith("icon_cache:")) {
1627
- const t = localStorage.getItem(a);
1628
- t && JSON.parse(t).expireTime < e && localStorage.removeItem(a);
1628
+ for (const t in localStorage)
1629
+ if (t.startsWith("icon_cache:")) {
1630
+ const a = localStorage.getItem(t);
1631
+ a && JSON.parse(a).expireTime < e && localStorage.removeItem(t);
1629
1632
  }
1630
- }, me = (e, a, t) => {
1633
+ }, ve = (e, t, a) => {
1631
1634
  setTimeout(() => {
1632
- a.value = t, a.value && (e.value = J.value[a.value]);
1635
+ t.value = a, t.value && (e.value = J.value[t.value]);
1633
1636
  }, 1);
1634
1637
  }, De = U(
1635
1638
  "svg",
@@ -1651,47 +1654,47 @@ const q = new ta(), Z = (e, a, t) => {
1651
1654
  fill: "currentColor"
1652
1655
  })
1653
1656
  ]
1654
- ), fa = (e, a) => {
1655
- const t = dt(e);
1657
+ ), ft = (e, t) => {
1658
+ const a = da(e);
1656
1659
  Object.keys(window).forEach((s) => {
1657
- s.startsWith("_iconfont_svg_string_") && (t == null ? void 0 : t.windowKey) === s && !Ye.has(s) && (Ye.add(s), pa(s, a));
1660
+ s.startsWith("_iconfont_svg_string_") && (a == null ? void 0 : a.windowKey) === s && !Ye.has(s) && (Ye.add(s), pt(s, t));
1658
1661
  });
1659
- }, pa = (e, a) => {
1660
- const t = window[e], o = new DOMParser().parseFromString(t, "image/svg+xml").getElementsByTagName("symbol"), r = document.querySelectorAll("symbol");
1662
+ }, pt = (e, t) => {
1663
+ const a = window[e], o = new DOMParser().parseFromString(a, "image/svg+xml").getElementsByTagName("symbol"), r = document.querySelectorAll("symbol");
1661
1664
  for (const l of o) {
1662
- const i = l.id, u = Array.from(r).find((c) => c.id === i);
1663
- u && a && (u.innerHTML = l.innerHTML, u.querySelectorAll("*").forEach((c) => {
1665
+ const u = l.id, i = Array.from(r).find((c) => c.id === u);
1666
+ i && t && (i.innerHTML = l.innerHTML, i.querySelectorAll("*").forEach((c) => {
1664
1667
  c.hasAttribute("fill") && c.removeAttribute("fill");
1665
- })), J.value[i] || (J.value[i] = U("svg", { fill: "currentColor" }, [U("use", { "xlink:href": `#${i}` })]));
1668
+ })), J.value[u] || (J.value[u] = U("svg", { fill: "currentColor" }, [U("use", { "xlink:href": `#${u}` })]));
1666
1669
  }
1667
- }, da = (e, a) => {
1668
- let t = "";
1669
- return e && (t += `rotate(${e}deg)`), a && (t += " scaleX(-1)"), t;
1670
- }, es = (e, a, t, s) => {
1671
- ht(e, [], t, s).forEach((o) => a.push(o));
1672
- }, ht = (e, a, t, s) => {
1673
- var r, l, i, u, c;
1670
+ }, dt = (e, t) => {
1671
+ let a = "";
1672
+ return e && (a += `rotate(${e}deg)`), t && (a += " scaleX(-1)"), a;
1673
+ }, es = (e, t, a, s) => {
1674
+ ha(e, [], a, s).forEach((o) => t.push(o));
1675
+ }, ha = (e, t, a, s) => {
1676
+ var r, l, u, i, c;
1674
1677
  const n = [], o = j();
1675
1678
  for (const p of e) {
1676
- if (p.redirect || p.path.includes("/login") || p.path.includes("/error") || p.path.includes("/:page(.*)") || (l = (r = p.meta) == null ? void 0 : r.roles) != null && l.length && !o.hasRole(p.meta.roles) && (i = p.meta) != null && i.permission && !o.hasPermit(p.meta.permission, ":page"))
1679
+ 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"))
1677
1680
  continue;
1678
1681
  const v = p.path.split("/");
1679
- v.unshift(...a);
1680
- const h = ht(p.children || [], v, t, s), A = {
1682
+ v.unshift(...t);
1683
+ const d = ha(p.children || [], v, a, s), O = {
1681
1684
  key: v.join("/"),
1682
- label: ((u = p.name) == null ? void 0 : u.toString()) ?? "",
1685
+ label: ((i = p.name) == null ? void 0 : i.toString()) ?? "",
1683
1686
  title: ((c = p.name) == null ? void 0 : c.toString()) ?? "",
1684
- icon: p.icon ? U(t, { ...s, icon: p.icon }) : void 0,
1685
- children: h.length > 0 ? h : void 0
1687
+ icon: p.icon ? U(a, { ...s, icon: p.icon }) : void 0,
1688
+ children: d.length > 0 ? d : void 0
1686
1689
  };
1687
- (h.length > 0 || !p.children) && n.push(A);
1690
+ (d.length > 0 || !p.children) && n.push(O);
1688
1691
  }
1689
1692
  return n;
1690
- }, Xe = yt([]), ts = () => {
1693
+ }, Xe = ya([]), as = () => {
1691
1694
  Xe.length = 0;
1692
1695
  const e = H();
1693
- let t = Je().TabActive;
1694
- e.matchedRoutes(t).forEach((n, o) => {
1696
+ let a = Je().TabActive;
1697
+ e.matchedRoutes(a).forEach((n, o) => {
1695
1698
  var l;
1696
1699
  const r = {
1697
1700
  index: o,
@@ -1700,7 +1703,7 @@ const q = new ta(), Z = (e, a, t) => {
1700
1703
  };
1701
1704
  Xe.push(r);
1702
1705
  });
1703
- }, ha = {
1706
+ }, ht = {
1704
1707
  host: {
1705
1708
  api: "SITEHOST_API",
1706
1709
  url: "/openapi/RCSiteHostSrv/get",
@@ -1712,7 +1715,7 @@ const q = new ta(), Z = (e, a, t) => {
1712
1715
  // 不显示错误
1713
1716
  hideErrorToast: !0
1714
1717
  }
1715
- }, as = ue("hostInfo", {
1718
+ }, ts = ue("hostInfo", {
1716
1719
  state: () => ({
1717
1720
  hostInfo: {
1718
1721
  Host: "",
@@ -1736,16 +1739,16 @@ const q = new ta(), Z = (e, a, t) => {
1736
1739
  * @param hostKey 站点信息,默认为当前主域名
1737
1740
  * @param mainOpenApis 宿主机开放接口
1738
1741
  */
1739
- async loadHostInfo(e, a, t) {
1740
- if (t) {
1741
- this._setHostInfo(t.getHostInfo());
1742
+ async loadHostInfo(e, t, a) {
1743
+ if (a) {
1744
+ this._setHostInfo(a.getHostInfo());
1742
1745
  return;
1743
1746
  }
1744
1747
  let s = (e || this.getSiteHostApi()).trim();
1745
1748
  return (!s || s === "/") && (s = window.location.origin), s.endsWith("/") && (s = s.slice(0, -1)), new Promise((n) => {
1746
1749
  $e.SITEHOST_API || ($e.SITEHOST_API = s);
1747
- const o = a || window.location.origin;
1748
- G(ha.host, {
1750
+ const o = t || window.location.origin;
1751
+ G(ht.host, {
1749
1752
  Query: {
1750
1753
  Host: o
1751
1754
  }
@@ -1781,14 +1784,14 @@ const q = new ta(), Z = (e, a, t) => {
1781
1784
  ...this.hostInfo,
1782
1785
  ...e
1783
1786
  }, this.hostInfo.API_HOST)
1784
- for (const a in this.hostInfo.API_HOST) {
1785
- let t = this.hostInfo.API_HOST[a];
1786
- t = t.startsWith("http://") || t.startsWith("https://") || t.startsWith("//") ? t : window.location.origin + t, t.endsWith("/") && (t = t.slice(0, -1)), this.hostInfo.API_HOST[a] = t, $e[a] = t;
1787
+ for (const t in this.hostInfo.API_HOST) {
1788
+ let a = this.hostInfo.API_HOST[t];
1789
+ 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;
1787
1790
  }
1788
1791
  if (this.hostInfo.SERVER_HOST)
1789
- for (const a in this.hostInfo.SERVER_HOST) {
1790
- let t = this.hostInfo.SERVER_HOST[a];
1791
- t = t.startsWith("http://") || t.startsWith("https://") || t.startsWith("//") ? t : window.location.origin + t, t.endsWith("/") && (t = t.slice(0, -1)), this.hostInfo.SERVER_HOST[a] = t, Ft[a] = t;
1792
+ for (const t in this.hostInfo.SERVER_HOST) {
1793
+ let a = this.hostInfo.SERVER_HOST[t];
1794
+ 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;
1792
1795
  }
1793
1796
  },
1794
1797
  getHostInfo() {
@@ -1834,11 +1837,11 @@ const q = new ta(), Z = (e, a, t) => {
1834
1837
  /**
1835
1838
  * 设置表格头配置
1836
1839
  */
1837
- setTableColumns(e, a) {
1840
+ setTableColumns(e, t) {
1838
1841
  this.$patch({
1839
1842
  tableColumns: {
1840
1843
  ...this.tableColumns,
1841
- [e]: a
1844
+ [e]: t
1842
1845
  }
1843
1846
  });
1844
1847
  }
@@ -1847,7 +1850,7 @@ const q = new ta(), Z = (e, a, t) => {
1847
1850
  }), ns = /* @__PURE__ */ X({
1848
1851
  __name: "index",
1849
1852
  props: {
1850
- ...ce,
1853
+ ...fe,
1851
1854
  /**
1852
1855
  * 选择项数据
1853
1856
  */
@@ -1857,34 +1860,34 @@ const q = new ta(), Z = (e, a, t) => {
1857
1860
  }
1858
1861
  },
1859
1862
  emits: ["change"],
1860
- setup(e, { emit: a }) {
1861
- const t = e, s = Y(), n = de(t.url, t), o = t.optionCtrl ?? n.optionCtrl;
1863
+ setup(e, { emit: t }) {
1864
+ const a = e, s = Y(), n = he(a.url, a), o = a.optionCtrl ?? n.optionCtrl;
1862
1865
  o.inputFactory = K(s);
1863
1866
  const r = f([]);
1864
- o && y(
1867
+ o && g(
1865
1868
  () => o.options.value,
1866
1869
  (p) => {
1867
1870
  r.value = p || [];
1868
1871
  },
1869
1872
  { immediate: !0, deep: !0 }
1870
1873
  );
1871
- const l = a, { editorCtrl: i, errInfo: u } = Y(), c = (p) => {
1872
- u != null && u.value.errClass && i && fe(i), l("change", p);
1874
+ const l = t, { editorCtrl: u, errInfo: i } = Y(), c = (p) => {
1875
+ i != null && i.value.errClass && u && pe(u), l("change", p);
1873
1876
  };
1874
- return Ie(() => {
1875
- if (!t.data || t.data.length != 2) {
1876
- console.error("Switch组件: ", t.data), x.error("Switch组件必须有且只有两个选项");
1877
+ return xe(() => {
1878
+ if (!a.data || a.data.length != 2) {
1879
+ console.error("Switch组件: ", a.data), x.error("Switch组件必须有且只有两个选项");
1877
1880
  return;
1878
1881
  }
1879
- o && Z(o.autoload, o, t);
1882
+ o && Z(o.autoload, o, a);
1880
1883
  }), ie(() => {
1881
- o && pe(o, t);
1884
+ o && de(o, a);
1882
1885
  }), (p, v) => {
1883
- var h;
1884
- return r.value.length === 2 ? (O(), xe(S(St), le({
1886
+ var d;
1887
+ return r.value.length === 2 ? (E(), Ae(b(ba), le({
1885
1888
  key: 0,
1886
1889
  class: [
1887
- ((h = S(u)) == null ? void 0 : h.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : "",
1890
+ ((d = b(i)) == null ? void 0 : d.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : "",
1888
1891
  "bg-blue-300",
1889
1892
  "w-[58px]"
1890
1893
  ],
@@ -1900,7 +1903,7 @@ const q = new ta(), Z = (e, a, t) => {
1900
1903
  inheritAttrs: !1,
1901
1904
  __name: "index",
1902
1905
  props: {
1903
- ...ce,
1906
+ ...fe,
1904
1907
  value: {
1905
1908
  type: [String, Number, Array, null],
1906
1909
  default: void 0
@@ -1916,70 +1919,70 @@ const q = new ta(), Z = (e, a, t) => {
1916
1919
  }
1917
1920
  },
1918
1921
  emits: ["update:value", "select", "change", "update:labels"],
1919
- setup(e, { emit: a }) {
1920
- const t = e, s = Ae(), n = Y(), o = de(t.url, t), r = t.optionCtrl ?? o.optionCtrl;
1922
+ setup(e, { emit: t }) {
1923
+ const a = e, s = Ee(), n = Y(), o = he(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
1921
1924
  r.inputFactory = K(n), r.fieldMap = {
1922
1925
  label: "Name",
1923
1926
  value: "Id",
1924
1927
  ...r == null ? void 0 : r.fieldMap
1925
1928
  };
1926
1929
  const l = f(void 0);
1927
- y(
1928
- () => t.value,
1930
+ g(
1931
+ () => a.value,
1929
1932
  () => {
1930
- l.value = t.value;
1933
+ l.value = a.value;
1931
1934
  },
1932
1935
  { immediate: !0 }
1933
- ), y(
1936
+ ), g(
1934
1937
  () => l.value,
1935
- (g) => {
1936
- t.autoClean && t.formData && t.outFields && g !== t.value && ft(t.formData, t.outFields, null);
1938
+ (y) => {
1939
+ a.autoClean && a.formData && a.outFields && y !== a.value && fa(a.formData, a.outFields, null);
1937
1940
  }
1938
1941
  );
1939
- const { editorCtrl: i, errInfo: u, labelText: c } = n, p = a;
1942
+ const { editorCtrl: u, errInfo: i, labelText: c } = n, p = t;
1940
1943
  n.inputEmit = p;
1941
1944
  const v = f((r == null ? void 0 : r.options.value) || []);
1942
- r && y(
1945
+ r && g(
1943
1946
  () => r.options.value,
1944
- (g) => {
1945
- v.value = g || [];
1947
+ (y) => {
1948
+ v.value = y || [];
1946
1949
  },
1947
1950
  { immediate: !0, deep: !0 }
1948
1951
  );
1949
- const h = (g) => {
1950
- if (v.value = [], g === "") return;
1951
- let d = {
1952
+ const d = (y) => {
1953
+ if (v.value = [], y === "") return;
1954
+ let h = {
1952
1955
  Query: {
1953
- SearchField: "%" + g.trim() + "%"
1956
+ SearchField: "%" + y.trim() + "%"
1954
1957
  }
1955
1958
  };
1956
- r.params = Oe(r.params, d), r && Z(!0, r, t);
1957
- }, A = (g) => {
1958
- const E = Pe(r, t, g);
1959
- p("update:value", g), p("select", g);
1960
- const d = we(E);
1961
- p("update:labels", d), u != null && u.value.errClass && i && fe(i);
1959
+ r.params = ce(r.params, h), r && Z(!0, r, a);
1960
+ }, O = (y) => {
1961
+ const A = Pe(r, a, y);
1962
+ p("update:value", y), p("select", y);
1963
+ const h = we(A);
1964
+ p("update:labels", h), i != null && i.value.errClass && u && pe(u);
1962
1965
  };
1963
1966
  return ie(() => {
1964
- r && pe(r, t);
1965
- }), (g, E) => {
1966
- var d;
1967
- return O(), $("div", null, [
1968
- C(S(It), le({
1967
+ r && de(r, a);
1968
+ }), (y, A) => {
1969
+ var h;
1970
+ return E(), L("div", null, [
1971
+ C(b(Ia), le({
1969
1972
  value: l.value,
1970
- "onUpdate:value": E[0] || (E[0] = (I) => l.value = I),
1971
- class: ["w-full", (d = S(u)) == null ? void 0 : d.errClass],
1973
+ "onUpdate:value": A[0] || (A[0] = (I) => l.value = I),
1974
+ class: ["w-full", (h = b(i)) == null ? void 0 : h.errClass],
1972
1975
  options: v.value,
1973
- onSearch: h,
1974
- onSelect: A
1975
- }, S(s), { "allow-clear": !1 }), {
1976
+ onSearch: d,
1977
+ onSelect: O
1978
+ }, b(s), { "allow-clear": !1 }), {
1976
1979
  option: V(({ label: I }) => [
1977
- Ee(z(I), 1)
1980
+ Oe(z(I), 1)
1978
1981
  ]),
1979
1982
  default: V(() => [
1980
- C(S(xt), {
1983
+ C(b(xa), {
1981
1984
  "allow-clear": "",
1982
- placeholder: "请输入并选择" + S(c)
1985
+ placeholder: "请输入并选择" + b(c)
1983
1986
  }, null, 8, ["placeholder"])
1984
1987
  ]),
1985
1988
  _: 1
@@ -1987,14 +1990,14 @@ const q = new ta(), Z = (e, a, t) => {
1987
1990
  ]);
1988
1991
  };
1989
1992
  }
1990
- }), ma = { class: "min-h-[32px] pt-[5px]" }, va = {
1993
+ }), mt = { class: "min-h-[32px] pt-[5px]" }, vt = {
1991
1994
  key: 1,
1992
1995
  class: "text-center text-gray-500"
1993
1996
  }, os = /* @__PURE__ */ X({
1994
1997
  inheritAttrs: !1,
1995
1998
  __name: "index",
1996
1999
  props: {
1997
- ...ce,
2000
+ ...fe,
1998
2001
  nodata: {
1999
2002
  type: String,
2000
2003
  default: ""
@@ -2010,77 +2013,77 @@ const q = new ta(), Z = (e, a, t) => {
2010
2013
  }
2011
2014
  },
2012
2015
  emits: ["change", "update:labels"],
2013
- setup(e, { emit: a }) {
2014
- var v, h, A;
2015
- const t = e, s = Ae(), n = Y(), o = de(t.url, t), r = t.optionCtrl ?? o.optionCtrl;
2016
+ setup(e, { emit: t }) {
2017
+ var v, d, O;
2018
+ const a = e, s = Ee(), n = Y(), o = he(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
2016
2019
  r.inputFactory = K(n);
2017
2020
  const l = f({
2018
2021
  ...r == null ? void 0 : r.url,
2019
2022
  url: ((v = r == null ? void 0 : r.url) == null ? void 0 : v.url) || "",
2020
- fieldMap: (r == null ? void 0 : r.fieldMap) || ((h = r == null ? void 0 : r.url) == null ? void 0 : h.fieldMap),
2021
- params: (r == null ? void 0 : r.params) || ((A = r == null ? void 0 : r.url) == null ? void 0 : A.params),
2023
+ fieldMap: (r == null ? void 0 : r.fieldMap) || ((d = r == null ? void 0 : r.url) == null ? void 0 : d.fieldMap),
2024
+ params: (r == null ? void 0 : r.params) || ((O = r == null ? void 0 : r.url) == null ? void 0 : O.params),
2022
2025
  loadingText: !1
2023
- }), { errInfo: i } = n, u = a;
2024
- n.inputEmit = u;
2026
+ }), { errInfo: u } = n, i = t;
2027
+ n.inputEmit = i;
2025
2028
  const c = f((r == null ? void 0 : r.options.value) || []);
2026
- r && y(
2029
+ r && g(
2027
2030
  () => r.options.value,
2028
- (g) => {
2029
- c.value = g || [];
2031
+ (y) => {
2032
+ c.value = y || [];
2030
2033
  },
2031
2034
  { immediate: !0, deep: !0 }
2032
2035
  );
2033
- const p = (g) => {
2034
- const d = Pe(r, t, g), I = we(d);
2035
- u("update:labels", I);
2036
+ const p = (y) => {
2037
+ const h = Pe(r, a, y), I = we(h);
2038
+ i("update:labels", I);
2036
2039
  };
2037
- return Ie(() => {
2040
+ return xe(() => {
2038
2041
  l.value && !l.value.fieldMap && (l.value.fieldMap = {
2039
2042
  title: "Name",
2040
2043
  label: "Name",
2041
2044
  value: "Id",
2042
2045
  key: "Id"
2043
- }), r && Z(r.autoload, r, t);
2046
+ }), r && Z(r.autoload, r, a);
2044
2047
  }), ie(() => {
2045
- r && pe(r, t);
2046
- }), (g, E) => (O(), $("div", ma, [
2047
- C(S(At), le({
2048
+ r && de(r, a);
2049
+ }), (y, A) => (E(), L("div", mt, [
2050
+ C(b(Aa), le({
2048
2051
  onChange: p,
2049
2052
  class: "w-full mb-[-3px]"
2050
- }, S(s)), {
2053
+ }, b(s)), {
2051
2054
  default: V(() => [
2052
- c.value.length > 0 ? (O(!0), $(ne, { key: 0 }, Ue(c.value, (d) => {
2055
+ c.value.length > 0 ? (E(!0), L(ne, { key: 0 }, Ue(c.value, (h) => {
2053
2056
  var I;
2054
- return O(), xe(S(Et), {
2055
- key: d.value,
2056
- value: d.value,
2057
- disabled: d.disabled || d.value && e.disabledItems && e.disabledItems.indexOf(d.value.toString()) > -1,
2058
- class: et([
2059
- ((I = S(i)) == null ? void 0 : I.errClass) === "error" ? "error !text-red-400" : "",
2057
+ return E(), Ae(b(Ea), {
2058
+ key: h.value,
2059
+ value: h.value,
2060
+ disabled: h.disabled || h.value && e.disabledItems && e.disabledItems.indexOf(h.value.toString()) > -1,
2061
+ class: ea([
2062
+ ((I = b(u)) == null ? void 0 : I.errClass) === "error" ? "error !text-red-400" : "",
2060
2063
  "text-nowrap",
2061
2064
  "pb-1",
2062
- e.wrap ? `w-1/${t.wrap}` : ""
2065
+ e.wrap ? `w-1/${a.wrap}` : ""
2063
2066
  ])
2064
2067
  }, {
2065
2068
  default: V(() => [
2066
- Ee(z(d.label), 1)
2069
+ Oe(z(h.label), 1)
2067
2070
  ]),
2068
2071
  _: 2
2069
2072
  }, 1032, ["value", "disabled", "class"]);
2070
- }), 128)) : e.nodata ? (O(), $("div", va, z(e.nodata), 1)) : B("", !0)
2073
+ }), 128)) : e.nodata ? (E(), L("div", vt, z(e.nodata), 1)) : B("", !0)
2071
2074
  ]),
2072
2075
  _: 1
2073
2076
  }, 16)
2074
2077
  ]));
2075
2078
  }
2076
- }), ga = { class: "min-h-[32px] pt-1" }, ya = {
2079
+ }), gt = { class: "min-h-[32px] pt-1" }, yt = {
2077
2080
  key: 1,
2078
2081
  class: "text-center text-gray-500"
2079
2082
  }, is = /* @__PURE__ */ X({
2080
2083
  inheritAttrs: !1,
2081
2084
  __name: "index",
2082
2085
  props: {
2083
- ...ce,
2086
+ ...fe,
2084
2087
  value: {
2085
2088
  type: [String, Number, null, Array],
2086
2089
  default: void 0
@@ -2097,97 +2100,97 @@ const q = new ta(), Z = (e, a, t) => {
2097
2100
  }
2098
2101
  },
2099
2102
  emits: ["change", "update:value", "update:labels"],
2100
- setup(e, { emit: a }) {
2101
- var A, g, E;
2102
- const t = e, s = Ae(), n = Y(), o = de(t.url, t), r = t.optionCtrl ?? o.optionCtrl;
2103
+ setup(e, { emit: t }) {
2104
+ var O, y, A;
2105
+ const a = e, s = Ee(), n = Y(), o = he(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
2103
2106
  r.inputFactory = K(n);
2104
2107
  const l = f({
2105
2108
  ...r == null ? void 0 : r.url,
2106
- url: ((A = r == null ? void 0 : r.url) == null ? void 0 : A.url) || "",
2107
- fieldMap: (r == null ? void 0 : r.fieldMap) || ((g = r == null ? void 0 : r.url) == null ? void 0 : g.fieldMap),
2108
- params: (r == null ? void 0 : r.params) || ((E = r == null ? void 0 : r.url) == null ? void 0 : E.params),
2109
+ url: ((O = r == null ? void 0 : r.url) == null ? void 0 : O.url) || "",
2110
+ fieldMap: (r == null ? void 0 : r.fieldMap) || ((y = r == null ? void 0 : r.url) == null ? void 0 : y.fieldMap),
2111
+ params: (r == null ? void 0 : r.params) || ((A = r == null ? void 0 : r.url) == null ? void 0 : A.params),
2109
2112
  loadingText: !1
2110
- }), i = f(t.value), { errInfo: u } = n, c = f((r == null ? void 0 : r.options.value) || []), p = a;
2111
- n.inputEmit = p, r && y(
2113
+ }), u = f(a.value), { errInfo: i } = n, c = f((r == null ? void 0 : r.options.value) || []), p = t;
2114
+ n.inputEmit = p, r && g(
2112
2115
  () => r.options.value,
2113
- (d) => {
2114
- c.value = d || [];
2116
+ (h) => {
2117
+ c.value = h || [];
2115
2118
  },
2116
2119
  { immediate: !0, deep: !0 }
2117
- ), y(
2118
- () => t.value,
2119
- (d) => {
2120
- i.value = d;
2120
+ ), g(
2121
+ () => a.value,
2122
+ (h) => {
2123
+ u.value = h;
2121
2124
  }
2122
- ), y(
2123
- () => i.value,
2124
- (d) => {
2125
- p("update:value", d);
2125
+ ), g(
2126
+ () => u.value,
2127
+ (h) => {
2128
+ p("update:value", h);
2126
2129
  }
2127
2130
  );
2128
- const v = (d, I) => {
2129
- if (typeof d == "object" && typeof I == "object") {
2130
- const R = JSON.stringify(d) === JSON.stringify(I);
2131
- return R && (i.value = d), R;
2131
+ const v = (h, I) => {
2132
+ if (typeof h == "object" && typeof I == "object") {
2133
+ const R = JSON.stringify(h) === JSON.stringify(I);
2134
+ return R && (u.value = h), R;
2132
2135
  }
2133
- return d === I;
2134
- }, h = (d) => {
2135
- const I = d.target.value, R = Pe(r, t, I), Q = we(R);
2136
+ return h === I;
2137
+ }, d = (h) => {
2138
+ const I = h.target.value, R = Pe(r, a, I), Q = we(R);
2136
2139
  p("update:labels", Q);
2137
2140
  };
2138
- return Ie(() => {
2141
+ return xe(() => {
2139
2142
  l.value && !l.value.fieldMap && (l.value.fieldMap = {
2140
2143
  label: "Name",
2141
2144
  value: "Id",
2142
2145
  key: "Id"
2143
- }), r && Z(r.autoload, r, t);
2146
+ }), r && Z(r.autoload, r, a);
2144
2147
  }), ie(() => {
2145
- r && pe(r, t);
2146
- }), (d, I) => (O(), $("div", ga, [
2147
- C(S(Ot), le({
2148
- value: i.value,
2149
- "onUpdate:value": I[0] || (I[0] = (R) => i.value = R),
2148
+ r && de(r, a);
2149
+ }), (h, I) => (E(), L("div", gt, [
2150
+ C(b(Oa), le({
2151
+ value: u.value,
2152
+ "onUpdate:value": I[0] || (I[0] = (R) => u.value = R),
2150
2153
  autocheck: !1,
2151
- onChange: h,
2154
+ onChange: d,
2152
2155
  class: "w-full flex align-items flex-wrap mb-[-3px]"
2153
- }, S(s)), {
2156
+ }, b(s)), {
2154
2157
  default: V(() => [
2155
- c.value.length > 0 ? (O(!0), $(ne, { key: 0 }, Ue(c.value, (R) => {
2158
+ c.value.length > 0 ? (E(!0), L(ne, { key: 0 }, Ue(c.value, (R) => {
2156
2159
  var Q;
2157
- return O(), $(ne, {
2160
+ return E(), L(ne, {
2158
2161
  key: R.value
2159
2162
  }, [
2160
- R.visible !== !1 ? (O(), xe(S(Rt), {
2163
+ R.visible !== !1 ? (E(), Ae(b(Ra), {
2161
2164
  key: 0,
2162
- checked: v(R.value, t.value),
2165
+ checked: v(R.value, a.value),
2163
2166
  value: R.value,
2164
- class: et([
2165
- ((Q = S(u)) == null ? void 0 : Q.errClass) === "error" ? "error !text-red-400" : "",
2167
+ class: ea([
2168
+ ((Q = b(i)) == null ? void 0 : Q.errClass) === "error" ? "error !text-red-400" : "",
2166
2169
  "text-nowrap",
2167
2170
  "pb-1",
2168
- e.wrap ? `w-1/${t.wrap}` : ""
2171
+ e.wrap ? `w-1/${a.wrap}` : ""
2169
2172
  ])
2170
2173
  }, {
2171
2174
  default: V(() => [
2172
- Ee(z(R.label), 1)
2175
+ Oe(z(R.label), 1)
2173
2176
  ]),
2174
2177
  _: 2
2175
2178
  }, 1032, ["checked", "value", "class"])) : B("", !0)
2176
2179
  ], 64);
2177
- }), 128)) : e.nodata ? (O(), $("div", ya, z(e.nodata), 1)) : B("", !0)
2180
+ }), 128)) : e.nodata ? (E(), L("div", yt, z(e.nodata), 1)) : B("", !0)
2178
2181
  ]),
2179
2182
  _: 1
2180
2183
  }, 16, ["value"])
2181
2184
  ]));
2182
2185
  }
2183
- }), ba = {
2186
+ }), St = {
2184
2187
  key: 0,
2185
2188
  class: "absolute z-10 mt-[5px] mr-[10px] text-[#999] flex items-center"
2186
2189
  }, ls = /* @__PURE__ */ X({
2187
2190
  inheritAttrs: !1,
2188
2191
  __name: "index",
2189
2192
  props: {
2190
- ...ce,
2193
+ ...fe,
2191
2194
  value: {
2192
2195
  type: [String, Number, Array, null],
2193
2196
  default: void 0
@@ -2205,109 +2208,119 @@ const q = new ta(), Z = (e, a, t) => {
2205
2208
  dataKey: {
2206
2209
  type: String,
2207
2210
  required: !1
2211
+ },
2212
+ /**
2213
+ * 清空时设置的值
2214
+ * - false,则清空时设置为 null
2215
+ * - true,则清空时设置为 undefined
2216
+ */
2217
+ undefValue: {
2218
+ type: Boolean,
2219
+ default: !1
2208
2220
  }
2209
2221
  },
2210
2222
  emits: ["change", "update:value", "update:label", "update:labels"],
2211
- setup(e, { emit: a }) {
2223
+ setup(e, { emit: t }) {
2212
2224
  var I, R, Q;
2213
- const t = e, s = Y(), { editorCtrl: n, errInfo: o, labelText: r } = s, l = de(t.url, t), i = t.optionCtrl ?? l.optionCtrl;
2214
- i.inputFactory = K(s);
2215
- const u = Ae(), c = f({
2225
+ 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;
2226
+ i.inputFactory = K(n);
2227
+ const c = Ee(), p = f({
2216
2228
  ...i == null ? void 0 : i.url,
2217
2229
  url: ((I = i == null ? void 0 : i.url) == null ? void 0 : I.url) || "",
2218
2230
  fieldMap: (i == null ? void 0 : i.fieldMap) || ((R = i == null ? void 0 : i.url) == null ? void 0 : R.fieldMap),
2219
2231
  params: (i == null ? void 0 : i.params) || ((Q = i == null ? void 0 : i.url) == null ? void 0 : Q.params),
2220
2232
  loadingText: !1
2221
- }), p = f(t.value), v = f(u.placeholder), h = f((i == null ? void 0 : i.selected.value) || void 0), A = a;
2222
- s.inputEmit = A;
2223
- const g = (m) => {
2224
- const k = Pe(i, t, m), _ = we(k);
2225
- h.value = m, A("update:labels", _), A("update:label", _.join(";")), A("change", m), o != null && o.value.errClass && n && fe(n);
2226
- }, E = f((i == null ? void 0 : i.options.value) || []), d = (m) => {
2227
- if (m.length > 0 && P(t.value) && t.selectFirst)
2228
- for (let k = 0; k < m.length; k++) {
2229
- const _ = m[k];
2233
+ }), v = f(c.placeholder), d = f(i == null ? void 0 : i.selected.value), O = t;
2234
+ n.inputEmit = O;
2235
+ const y = (m) => {
2236
+ const P = Pe(i, a, m), _ = we(P);
2237
+ d.value = m, O("update:labels", _), O("update:label", _.join(";")), O("change", m), r != null && r.value.errClass && o && pe(o);
2238
+ }, A = f((i == null ? void 0 : i.options.value) || []), h = (m) => {
2239
+ if (m.length > 0 && F(a.value) && a.selectFirst)
2240
+ for (let P = 0; P < m.length; P++) {
2241
+ const _ = m[P];
2230
2242
  if (_.disabled === void 0 || _.disabled === !1) {
2231
- h.value = _.value;
2243
+ d.value = _.value;
2232
2244
  break;
2233
2245
  }
2234
2246
  }
2235
- else m.length > 0 && (h.value = t.value === null ? void 0 : t.value);
2236
- m.length > 0 && h.value !== void 0 && g(h.value);
2247
+ else m.length > 0 && (d.value = a.value === null ? void 0 : a.value);
2248
+ m.length > 0 && d.value !== void 0 && y(d.value);
2237
2249
  };
2238
- return i && (y(
2250
+ return i && (g(
2239
2251
  () => i.options.value,
2240
2252
  (m) => {
2241
- E.value = m || [];
2253
+ A.value = m || [];
2242
2254
  },
2243
2255
  { immediate: !0, deep: !0 }
2244
- ), y(
2256
+ ), g(
2245
2257
  () => i.selected.value,
2246
2258
  (m) => {
2247
- h.value = m;
2259
+ d.value = m;
2248
2260
  }
2249
- )), y(
2250
- () => E.value,
2261
+ )), g(
2262
+ () => A.value,
2251
2263
  (m) => {
2252
- d(m);
2264
+ h(m);
2253
2265
  }
2254
- ), y(
2255
- () => c.value.loading,
2266
+ ), g(
2267
+ () => p.value.loading,
2256
2268
  (m) => {
2257
- m ? v.value = "" : v.value || (v.value = "请选择" + r.value);
2269
+ m ? v.value = "" : v.value || (v.value = "请选择" + l.value);
2258
2270
  },
2259
2271
  { immediate: !0 }
2260
- ), y(
2261
- () => h.value,
2272
+ ), g(
2273
+ () => a.value,
2262
2274
  (m) => {
2263
- i && (i.selected.value = m);
2264
- const k = m === void 0 ? null : m;
2265
- if (u.mode === "multiple" && P(m) && P(p.value)) {
2266
- A("update:value", p.value);
2267
- return;
2268
- }
2269
- A("update:value", k);
2275
+ d.value = m;
2276
+ },
2277
+ { immediate: !0 }
2278
+ ), g(
2279
+ () => d.value,
2280
+ (m) => {
2281
+ const P = m === void 0 ? s ? void 0 : null : m;
2282
+ i && (i.selected.value = P), O("update:value", P);
2270
2283
  }
2271
- ), Ie(() => {
2272
- if (c.value && !c.value.fieldMap && (c.value.fieldMap = {
2284
+ ), xe(() => {
2285
+ if (p.value && !p.value.fieldMap && (p.value.fieldMap = {
2273
2286
  label: "Name",
2274
2287
  value: "Id",
2275
2288
  key: "Id"
2276
- }), t.dataKey) {
2277
- const m = JSON.parse(JSON.stringify(M.getOptions(t.dataKey)));
2278
- E.value = m, d(m);
2289
+ }), a.dataKey) {
2290
+ const m = JSON.parse(JSON.stringify(M.getOptions(a.dataKey)));
2291
+ A.value = m, h(m);
2279
2292
  } else if (i) {
2280
2293
  const m = i.options.value || [];
2281
- m.length > 0 ? (E.value = m, d(m)) : Z(i.autoload, i, t);
2294
+ m.length > 0 ? (A.value = m, h(m)) : Z(i.autoload, i, a);
2282
2295
  }
2283
2296
  }), ie(() => {
2284
- i && pe(i, t);
2285
- }), (m, k) => {
2297
+ i && de(i, a);
2298
+ }), (m, P) => {
2286
2299
  var _, We, qe;
2287
- return O(), $("div", null, [
2288
- (We = (_ = S(i)) == null ? void 0 : _.url) != null && We.loading ? (O(), $("div", ba, [
2289
- C(S(De), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
2290
- k[1] || (k[1] = bt("span", null, "数据加载中...", -1))
2300
+ return E(), L("div", null, [
2301
+ (We = (_ = b(i)) == null ? void 0 : _.url) != null && We.loading ? (E(), L("div", St, [
2302
+ C(b(De), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
2303
+ P[1] || (P[1] = Sa("span", null, "数据加载中...", -1))
2291
2304
  ])) : B("", !0),
2292
- C(S(Tt), le({
2293
- class: [(qe = S(o)) == null ? void 0 : qe.errClass, "w-full"],
2294
- value: h.value,
2295
- "onUpdate:value": k[0] || (k[0] = (W) => h.value = W),
2305
+ C(b(Ta), le({
2306
+ class: [(qe = b(r)) == null ? void 0 : qe.errClass, "w-full"],
2307
+ value: d.value,
2308
+ "onUpdate:value": P[0] || (P[0] = (W) => d.value = W),
2296
2309
  "allow-clear": !0,
2297
- onChange: g,
2310
+ onChange: y,
2298
2311
  placeholder: v.value,
2299
2312
  "label-in-value": !1
2300
- }, S(u)), {
2313
+ }, b(c)), {
2301
2314
  default: V(() => [
2302
- (O(!0), $(ne, null, Ue(E.value, (W) => (O(), $(ne, {
2315
+ (E(!0), L(ne, null, Ue(A.value, (W) => (E(), L(ne, {
2303
2316
  key: W.value
2304
2317
  }, [
2305
- W.visible !== !1 ? (O(), xe(S(wt), {
2318
+ W.visible !== !1 ? (E(), Ae(b(wa), {
2306
2319
  key: 0,
2307
2320
  value: W.value
2308
2321
  }, {
2309
2322
  default: V(() => [
2310
- Ee(z(W.label), 1)
2323
+ Oe(z(W.label), 1)
2311
2324
  ]),
2312
2325
  _: 2
2313
2326
  }, 1032, ["value"])) : B("", !0)
@@ -2320,74 +2333,74 @@ const q = new ta(), Z = (e, a, t) => {
2320
2333
  }
2321
2334
  });
2322
2335
  export {
2323
- _a as $,
2324
- fe as A,
2336
+ _t as $,
2337
+ pe as A,
2325
2338
  os as B,
2326
2339
  is as C,
2327
2340
  ls as D,
2328
2341
  Ve as E,
2329
- Nt as F,
2330
- Ba as G,
2331
- ra as H,
2332
- oa as I,
2333
- Ca as J,
2334
- za as K,
2335
- na as L,
2336
- ft as M,
2337
- Ya as N,
2342
+ Na as F,
2343
+ Bt as G,
2344
+ rt as H,
2345
+ ot as I,
2346
+ Ct as J,
2347
+ zt as K,
2348
+ nt as L,
2349
+ fa as M,
2350
+ Yt as N,
2338
2351
  M as O,
2339
2352
  D as P,
2340
- Za as Q,
2341
- pa as R,
2342
- da as S,
2353
+ Zt as Q,
2354
+ pt as R,
2355
+ dt as S,
2343
2356
  es as T,
2344
2357
  Xe as U,
2345
- ts as V,
2346
- at as W,
2347
- Va as X,
2348
- st as Y,
2349
- Fa as Z,
2358
+ as as V,
2359
+ ta as W,
2360
+ Vt as X,
2361
+ sa as Y,
2362
+ Ft as Z,
2350
2363
  ns as _,
2351
2364
  ss as a,
2352
2365
  Ke as a0,
2353
- Ma as a1,
2354
- Ja as a2,
2355
- ea as a3,
2356
- ut as a4,
2357
- Ga as a5,
2358
- $a as a6,
2359
- tt as a7,
2360
- Dt as a8,
2366
+ Mt as a1,
2367
+ Jt as a2,
2368
+ et as a3,
2369
+ ua as a4,
2370
+ Gt as a5,
2371
+ $t as a6,
2372
+ aa as a7,
2373
+ Da as a8,
2361
2374
  Ne as a9,
2362
2375
  q as aa,
2363
2376
  se as ab,
2364
- ve as ac,
2377
+ ge as ac,
2365
2378
  H as ad,
2366
- as as ae,
2379
+ ts as ae,
2367
2380
  Je as af,
2368
2381
  re as ag,
2369
- Ua as b,
2370
- Xa as c,
2371
- Ha as d,
2372
- Na as e,
2373
- Wa as f,
2374
- qa as g,
2375
- Qa as h,
2376
- P as i,
2377
- Ka as j,
2378
- lt as k,
2379
- Zt as l,
2380
- ja as m,
2382
+ Ut as b,
2383
+ Xt as c,
2384
+ Ht as d,
2385
+ Nt as e,
2386
+ Wt as f,
2387
+ qt as g,
2388
+ Qt as h,
2389
+ F as i,
2390
+ Kt as j,
2391
+ la as k,
2392
+ Za as l,
2393
+ jt as m,
2381
2394
  rs as n,
2382
- Da as o,
2383
- ce as p,
2384
- Ut as q,
2395
+ Dt as o,
2396
+ fe as p,
2397
+ Ua as q,
2385
2398
  oe as r,
2386
2399
  Y as s,
2387
- de as t,
2400
+ he as t,
2388
2401
  j as u,
2389
2402
  Z as v,
2390
- pe as w,
2403
+ de as w,
2391
2404
  De as x,
2392
2405
  Pe as y,
2393
2406
  we as z