@skyfox2000/webui 1.2.12 → 1.3.1

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