@skyfox2000/webui 1.2.12 → 1.3.0

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-C4GVmWjB.js} +1 -1
  2. package/lib/assets/modules/{form-excel-DWirWVPA.js → form-excel-Cr2hcL1s.js} +3 -3
  3. package/lib/assets/modules/{index-Czk7DDWM.js → index-D5onbqkl.js} +2 -2
  4. package/lib/assets/modules/{index-C1zkNPmi.js → index-DjBruVH-.js} +1 -1
  5. package/lib/assets/modules/{menuTabs-BOax-dro.js → menuTabs-B9fCWfN1.js} +36 -36
  6. package/lib/assets/modules/{toolIcon-vJF7OgP6.js → toolIcon-DKTf30Tq.js} +1 -1
  7. package/lib/assets/modules/{uploadList-DaUjVXLU.js → uploadList-CY57np42.js} +980 -923
  8. package/lib/assets/modules/uploadList-D2lisNHt.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 +41 -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,287 @@ 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
+ }
1325
+ }, jt = (e) => {
1326
+ y.PageOption = {
1327
+ ...y.PageOption,
1328
+ ...e.pageOption
1329
+ }, y.GridOption = {
1330
+ ...y.GridOption,
1331
+ ...e.gridOption
1332
+ }, y.EditorOption = {
1333
+ ...y.EditorOption,
1334
+ ...e.editorOptions
1335
+ }, y.TreeOption = {
1336
+ ...y.TreeOption,
1337
+ ...e.treeOption
1338
+ };
1339
+ }, tt = (e, t, a, s) => ({
1340
+ editorCtrl: {
1341
+ ...y.EditorOption,
1342
+ name: "",
1343
+ default: a ? JSON.parse(JSON.stringify(a)) : void 0,
1344
+ visible: f(!1),
1345
+ page: t,
1346
+ formData: f(a ? JSON.parse(JSON.stringify(a)) : void 0),
1347
+ formRules: f(s),
1348
+ ruleResults: f({}),
1349
+ updateData: f(void 0),
1350
+ saveUrl: e.urls.save,
1351
+ detailUrl: e.urls.detail,
1352
+ isFormSaving: f(!1),
1353
+ isFormLoading: f(!1)
1354
+ }
1355
+ }), st = (e, t, a) => {
1356
+ const s = {
1357
+ ...y.GridOption,
1358
+ tableSize: f(y.GridOption.tableSize.value),
1359
+ selectable: f(y.GridOption.selectable.value),
1360
+ searchBar: f(y.GridOption.searchBar.value),
1361
+ pageSize: f(y.GridOption.pageSize.value),
1362
+ rowExpand: f(y.GridOption.rowExpand.value),
1363
+ buttons: f([...y.GridOption.buttons.value]),
1364
+ tools: [...y.GridOption.tools],
1365
+ operates: [...y.GridOption.operates],
1366
+ columns: f(a || []),
1367
+ reload: f(!1),
1368
+ pageNo: f(1),
1369
+ total: f(0),
1370
+ page: t,
1371
+ selectKeys: f([]),
1372
+ selectRows: f([]),
1373
+ rowData: f(void 0),
1374
+ gridQuery: {},
1375
+ tableData: H(void 0),
1376
+ expandRows: f({}),
1377
+ isGridLoading: f(!1),
1378
+ isGridSaving: f(!1),
1379
+ gridUrl: e.urls.list || e.urls.find,
1380
+ updateUrl: e.urls.update,
1381
+ deleteUrl: e.urls.delete
1382
+ };
1383
+ return b(
1384
+ () => s.reload.value,
1385
+ (r) => {
1386
+ r && (setTimeout(() => {
1387
+ s.reload.value = !1;
1388
+ }, 1), s.remotePage ? ia(s) : Ca(s));
1389
+ }
1390
+ ), {
1391
+ gridCtrl: s
1392
+ };
1393
+ }, qt = (e, t) => {
1394
+ const a = {
1395
+ ...y.TreeOption,
1396
+ reload: f(!1),
1397
+ page: t,
1398
+ node: f(void 0),
1399
+ url: e.urls.tree,
1400
+ data: H(void 0),
1401
+ isTreeLoading: f(!1)
1402
+ };
1403
+ return b(
1404
+ () => a.reload.value,
1405
+ (s) => {
1406
+ s && (setTimeout(() => {
1407
+ a.reload.value = !1;
1408
+ }, 1), Na(a));
1409
+ }
1410
+ ), {
1411
+ treeCtrl: a
1412
+ };
1413
+ }, de = (e, t) => {
1414
+ const a = {
1415
+ ...y.OptionOption,
1416
+ url: e,
1417
+ options: f([]),
1418
+ reload: f(!1),
1419
+ data: H([]),
1420
+ selected: f([]),
1421
+ selectedOptions: f([]),
1422
+ optionQuery: {},
1423
+ isOptionLoading: f(!1)
1424
+ };
1425
+ return b(
1426
+ () => a.reload.value,
1427
+ (s) => {
1428
+ s && (setTimeout(() => {
1429
+ a.reload.value = !1;
1430
+ }, 1), Y(a, t));
1431
+ }
1432
+ ), {
1433
+ optionCtrl: a
1434
+ };
1435
+ }, Bt = (e, t, a) => {
1436
+ for (const n in e.urls)
1437
+ 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));
1438
+ const s = {
1439
+ ...y.PageOption,
1440
+ ...e
1441
+ }, { editorCtrl: r } = tt(e, s, t, a), { gridCtrl: i } = st(e, s);
1442
+ return s.editor = r, s.grid = i, i.editor = r, i.tools = ["Reload", "RowHeight", "TableHeadset", "Fullscreen"], r.grid = i, {
1443
+ pageCtrl: s,
1444
+ editorCtrl: r,
1445
+ gridCtrl: i
1446
+ };
1447
+ }, rt = 7 * 24 * 60 * 60 * 1e3, Fe = /* @__PURE__ */ new Map(), We = /* @__PURE__ */ new Set(), Q = f({}), zt = Q, Wt = (e) => {
1455
1448
  var r;
1456
- if (!e.iconUrl) return we;
1457
- const t = c(!0), a = c("");
1449
+ if (!e.iconUrl) return Ne;
1450
+ const t = f(!0), a = f("");
1458
1451
  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({
1452
+ 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(() => {
1453
+ lt(e.iconUrl, e.monoColor || !1), t.value = !0;
1454
+ }), C({
1462
1455
  props: {
1463
1456
  icon: {
1464
1457
  type: String
@@ -1484,100 +1477,100 @@ const V = new Ba(), Z = (e, t, a, s, r, n) => {
1484
1477
  }
1485
1478
  },
1486
1479
  emits: ["update:iconIndex"],
1487
- setup(n, { emit: o }) {
1488
- const l = c(n.icon), i = c(0), u = () => {
1489
- n.icons && i.value++;
1480
+ setup(i, { emit: n }) {
1481
+ const l = f(i.icon), o = f(0), c = () => {
1482
+ i.icons && o.value++;
1490
1483
  };
1491
- return E(
1492
- () => n.iconIndex,
1493
- (f) => {
1494
- f !== void 0 && (i.value = f);
1484
+ return b(
1485
+ () => i.iconIndex,
1486
+ (u) => {
1487
+ u !== void 0 && (o.value = u);
1495
1488
  },
1496
1489
  { 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));
1490
+ ), b(
1491
+ () => o.value,
1492
+ (u) => {
1493
+ 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
1494
  },
1502
1495
  { immediate: !0 }
1503
- ), E(
1504
- () => _.value,
1496
+ ), b(
1497
+ () => Q.value,
1505
1498
  () => {
1506
- se(a, l, l.value);
1499
+ ve(a, l, l.value);
1507
1500
  },
1508
1501
  { deep: !0 }
1509
- ), E(
1510
- () => n.icon,
1511
- (f) => {
1512
- se(a, l, f);
1502
+ ), b(
1503
+ () => i.icon,
1504
+ (u) => {
1505
+ ve(a, l, u);
1513
1506
  }
1514
- ), se(a, l, l.value), { isLoaded: t, Icon: a, handleClick: u };
1507
+ ), ve(a, l, l.value), { isLoaded: t, Icon: a, handleClick: c };
1515
1508
  },
1516
1509
  render() {
1517
1510
  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), {
1511
+ return Ne;
1512
+ let i = this.class, n = "";
1513
+ Array.isArray(i) ? n = i.join(" ") : typeof i == "string" && (n = i);
1514
+ let l = [n];
1515
+ 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
1516
  onClick: this.$props.clickable ? this.handleClick : void 0,
1524
1517
  class: `${l.join(" ")}`,
1525
1518
  style: {
1526
1519
  fill: "currentColor",
1527
1520
  cursor: this.$props.clickable ? "pointer" : "default",
1528
- transform: rt(this.angle, this.flip)
1521
+ transform: ct(this.angle, this.flip)
1529
1522
  }
1530
- }) : F("div", { class: "w-[14px] h-[14px]" });
1523
+ }) : _("div", { class: "w-[14px] h-[14px]" });
1531
1524
  }
1532
1525
  });
1533
- }, Za = (e, t) => {
1526
+ }, nt = (e, t) => {
1534
1527
  let a = e.iconUrl;
1535
1528
  if (!a)
1536
1529
  return console.error("图标库地址不能为空"), Promise.resolve();
1537
- if (Re.has(a))
1530
+ if (Fe.has(a))
1538
1531
  return Promise.resolve();
1539
- const s = oa(a);
1532
+ const s = fa(a);
1540
1533
  if (s)
1541
- return new Promise(async (n) => (na(s.scriptContent), n()));
1534
+ return new Promise(async (i) => (ca(s.scriptContent), i()));
1542
1535
  t.value = !1;
1543
- const r = new Promise(async (n) => {
1544
- await et(a, e.monoColor || !1), n(), Re.delete(a);
1536
+ const r = new Promise(async (i) => {
1537
+ await it(a, e.monoColor || !1), i(), Fe.delete(a);
1545
1538
  });
1546
- return Re.set(a, r), r;
1547
- }, et = async (e, t) => {
1539
+ return Fe.set(a, r), r;
1540
+ }, it = async (e, t) => {
1548
1541
  try {
1549
1542
  const a = await fetch(e);
1550
1543
  if (!a.ok) {
1551
- I.error("网络异常,无法加载图标库!");
1544
+ x.error("网络异常,无法加载图标库!");
1552
1545
  return;
1553
1546
  }
1554
1547
  let s = await a.text();
1555
1548
  s = t ? s.replace(/fill=\"[^\"]*\"/gi, "") : s;
1556
1549
  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);
1550
+ const i = s.match(r);
1551
+ if (i && i.length > 1) {
1552
+ let n = i[1];
1553
+ ot(e, n, t, s);
1561
1554
  }
1562
- na(s);
1555
+ ca(s);
1563
1556
  return;
1564
1557
  } catch (a) {
1565
1558
  return console.error("网络异常,无法加载图标库:", a), null;
1566
1559
  }
1567
- }, na = (e) => {
1560
+ }, ca = (e) => {
1568
1561
  const t = document.createElement("script");
1569
1562
  t.textContent = e, document.head.appendChild(t);
1570
- }, at = (e, t, a, s) => {
1563
+ }, ot = (e, t, a, s) => {
1571
1564
  let r = `icon_cache:${e}`;
1572
- const n = {
1565
+ const i = {
1573
1566
  windowKey: t,
1574
1567
  monoColor: a,
1575
1568
  scriptContent: s,
1576
- expireTime: Date.now() + Xa
1569
+ expireTime: Date.now() + rt
1577
1570
  // 缓存时间:7天
1578
1571
  };
1579
- localStorage.setItem(r, JSON.stringify(n));
1580
- }, oa = (e) => {
1572
+ localStorage.setItem(r, JSON.stringify(i));
1573
+ }, fa = (e) => {
1581
1574
  let t = `icon_cache:${e}`;
1582
1575
  const a = localStorage.getItem(t);
1583
1576
  if (!a) return null;
@@ -1588,22 +1581,22 @@ const V = new Ba(), Z = (e, t, a, s, r, n) => {
1588
1581
  return console.error("解析缓存失败:", r), null;
1589
1582
  }
1590
1583
  return s.expireTime < Date.now() ? (localStorage.removeItem(e), null) : s;
1591
- }, Gt = () => {
1584
+ }, Ct = () => {
1592
1585
  const e = Date.now();
1593
1586
  for (const t in localStorage)
1594
1587
  if (t.startsWith("icon_cache:")) {
1595
1588
  const a = localStorage.getItem(t);
1596
1589
  a && JSON.parse(a).expireTime < e && localStorage.removeItem(t);
1597
1590
  }
1598
- }, se = (e, t, a) => {
1591
+ }, ve = (e, t, a) => {
1599
1592
  setTimeout(() => {
1600
- t.value = a, t.value && (e.value = _.value[t.value]);
1593
+ t.value = a, t.value && (e.value = Q.value[t.value]);
1601
1594
  }, 1);
1602
- }, we = F(
1595
+ }, Ne = _(
1603
1596
  "svg",
1604
1597
  { class: "w-4 h-4", viewBox: "0 0 50 50", style: { animation: "rotate 2s linear infinite" } },
1605
1598
  [
1606
- F("circle", {
1599
+ _("circle", {
1607
1600
  cx: "25",
1608
1601
  cy: "25",
1609
1602
  r: "20",
@@ -1612,63 +1605,63 @@ const V = new Ba(), Z = (e, t, a, s, r, n) => {
1612
1605
  style: { strokeWidth: "3 !important" }
1613
1606
  // 强制应用线宽
1614
1607
  }),
1615
- F("circle", {
1608
+ _("circle", {
1616
1609
  cx: "25",
1617
1610
  cy: "6",
1618
1611
  r: "6",
1619
1612
  fill: "currentColor"
1620
1613
  })
1621
1614
  ]
1622
- ), tt = (e, t) => {
1623
- const a = oa(e);
1615
+ ), lt = (e, t) => {
1616
+ const a = fa(e);
1624
1617
  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));
1618
+ s.startsWith("_iconfont_svg_string_") && (a == null ? void 0 : a.windowKey) === s && !We.has(s) && (We.add(s), ut(s, t));
1626
1619
  });
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}` })]));
1620
+ }, ut = (e, t) => {
1621
+ const a = window[e], i = new DOMParser().parseFromString(a, "image/svg+xml").getElementsByTagName("symbol"), n = document.querySelectorAll("symbol");
1622
+ for (const l of i) {
1623
+ const o = l.id, c = Array.from(n).find((u) => u.id === o);
1624
+ c && t && (c.innerHTML = l.innerHTML, c.querySelectorAll("*").forEach((u) => {
1625
+ u.hasAttribute("fill") && u.removeAttribute("fill");
1626
+ })), Q.value[o] || (Q.value[o] = _("svg", { fill: "currentColor" }, [_("use", { "xlink:href": `#${o}` })]));
1634
1627
  }
1635
- }, rt = (e, t) => {
1628
+ }, ct = (e, t) => {
1636
1629
  let a = "";
1637
1630
  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();
1631
+ }, Yt = (e, t, a, s) => {
1632
+ pa(e, [], a, s).forEach((i) => t.push(i));
1633
+ }, pa = (e, t, a, s) => {
1634
+ var n, l, o, c, u;
1635
+ const r = [], i = J();
1643
1636
  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"))
1637
+ 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
1638
  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
1639
+ const m = p.path.split("/");
1640
+ m.unshift(...t);
1641
+ const d = pa(p.children || [], m, a, s), E = {
1642
+ key: m.join("/"),
1643
+ label: ((c = p.name) == null ? void 0 : c.toString()) ?? "",
1644
+ title: ((u = p.name) == null ? void 0 : u.toString()) ?? "",
1645
+ icon: p.icon ? _(a, { ...s, icon: p.icon }) : void 0,
1646
+ children: d.length > 0 ? d : void 0
1654
1647
  };
1655
- (h.length > 0 || !p.children) && r.push(w);
1648
+ (d.length > 0 || !p.children) && r.push(E);
1656
1649
  }
1657
1650
  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) => {
1651
+ }, Ce = va([]), Xt = () => {
1652
+ Ce.length = 0;
1653
+ const e = V();
1654
+ let a = Je().TabActive;
1655
+ e.matchedRoutes(a).forEach((r, i) => {
1663
1656
  var l;
1664
- const o = {
1665
- index: n,
1657
+ const n = {
1658
+ index: i,
1666
1659
  path: r.path,
1667
1660
  breadcrumbName: ((l = r.name) == null ? void 0 : l.toString()) ?? ""
1668
1661
  };
1669
- Ge.push(o);
1662
+ Ce.push(n);
1670
1663
  });
1671
- }, nt = {
1664
+ }, ft = {
1672
1665
  host: {
1673
1666
  api: "SITEHOST_API",
1674
1667
  url: "/openapi/RCSiteHostSrv/get",
@@ -1680,7 +1673,7 @@ const V = new Ba(), Z = (e, t, a, s, r, n) => {
1680
1673
  // 不显示错误
1681
1674
  hideErrorToast: !0
1682
1675
  }
1683
- }, Jt = ae("hostInfo", {
1676
+ }, Zt = ue("hostInfo", {
1684
1677
  state: () => ({
1685
1678
  hostInfo: {
1686
1679
  Host: "",
@@ -1704,16 +1697,16 @@ const V = new Ba(), Z = (e, t, a, s, r, n) => {
1704
1697
  return;
1705
1698
  }
1706
1699
  return new Promise((s) => {
1707
- Ie.SITEHOST_API || (Ie.SITEHOST_API = e);
1700
+ we.SITEHOST_API || (we.SITEHOST_API = e);
1708
1701
  const r = t || window.location.origin;
1709
- K(nt.host, {
1702
+ G(ft.host, {
1710
1703
  Query: {
1711
1704
  Host: r
1712
1705
  }
1713
- }).then((n) => {
1714
- if ((n == null ? void 0 : n.status) === R.SUCCESS && n.data) {
1715
- const o = n.data;
1716
- this._setHostInfo(o);
1706
+ }).then((i) => {
1707
+ if ((i == null ? void 0 : i.status) === T.SUCCESS && i.data) {
1708
+ const n = i.data;
1709
+ this._setHostInfo(n);
1717
1710
  }
1718
1711
  s();
1719
1712
  });
@@ -1727,9 +1720,9 @@ const V = new Ba(), Z = (e, t, a, s, r, n) => {
1727
1720
  ...this.hostInfo,
1728
1721
  ...e
1729
1722
  }, this.hostInfo.API_HOST)
1730
- for (const t in this.hostInfo.API_HOST) Ie[t] = this.hostInfo.API_HOST[t];
1723
+ for (const t in this.hostInfo.API_HOST) we[t] = this.hostInfo.API_HOST[t];
1731
1724
  if (this.hostInfo.SERVER_HOST)
1732
- for (const t in this.hostInfo.SERVER_HOST) Ea[t] = this.hostInfo.SERVER_HOST[t];
1725
+ for (const t in this.hostInfo.SERVER_HOST) ka[t] = this.hostInfo.SERVER_HOST[t];
1733
1726
  },
1734
1727
  getHostInfo() {
1735
1728
  return this.hostInfo;
@@ -1742,7 +1735,7 @@ const V = new Ba(), Z = (e, t, a, s, r, n) => {
1742
1735
  // storage: localStorage,
1743
1736
  // pick: ['hostInfo'],
1744
1737
  // },
1745
- }), Bt = ae("settingInfo", {
1738
+ }), es = ue("settingInfo", {
1746
1739
  state: () => ({
1747
1740
  fullscreen: !1,
1748
1741
  menuCollapse: !1,
@@ -1784,15 +1777,63 @@ const V = new Ba(), Z = (e, t, a, s, r, n) => {
1784
1777
  }
1785
1778
  },
1786
1779
  persist: !1
1787
- }), zt = /* @__PURE__ */ ee({
1780
+ }), as = /* @__PURE__ */ C({
1781
+ __name: "index",
1782
+ props: {
1783
+ ...ce,
1784
+ /**
1785
+ * 选择项数据
1786
+ */
1787
+ data: {
1788
+ type: Array,
1789
+ required: !0
1790
+ }
1791
+ },
1792
+ emits: ["change"],
1793
+ setup(e, { emit: t }) {
1794
+ const a = e, s = W(), r = de(a.url, a), i = a.optionCtrl ?? r.optionCtrl;
1795
+ i.inputFactory = H(s);
1796
+ const n = f([]);
1797
+ i && b(
1798
+ () => i.options.value,
1799
+ (p) => {
1800
+ n.value = p || [];
1801
+ },
1802
+ { immediate: !0, deep: !0 }
1803
+ );
1804
+ const l = t, { editorCtrl: o, errInfo: c } = W(), u = (p) => {
1805
+ c != null && c.value.errClass && o && fe(o), l("change", p);
1806
+ };
1807
+ return ie(() => {
1808
+ if (!a.data || a.data.length != 2) {
1809
+ console.error("Switch组件: ", a.data), x.error("Switch组件必须有且只有两个选项");
1810
+ return;
1811
+ }
1812
+ i && Y(i, a);
1813
+ }), oe(() => {
1814
+ i && pe(i, a);
1815
+ }), (p, m) => {
1816
+ var d;
1817
+ return n.value.length === 2 ? (A(), Ie(S(ya), le({
1818
+ key: 0,
1819
+ class: [
1820
+ ((d = S(c)) == null ? void 0 : d.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : "",
1821
+ "bg-blue-300",
1822
+ "w-[58px]"
1823
+ ],
1824
+ checkedChildren: n.value[0].label,
1825
+ checkedValue: n.value[0].value,
1826
+ unCheckedChildren: n.value[1].label,
1827
+ unCheckedValue: n.value[1].value,
1828
+ onChange: u
1829
+ }, p.$attrs), null, 16, ["class", "checkedChildren", "checkedValue", "unCheckedChildren", "unCheckedValue"])) : B("", !0);
1830
+ };
1831
+ }
1832
+ }), ts = /* @__PURE__ */ C({
1788
1833
  inheritAttrs: !1,
1789
1834
  __name: "index",
1790
1835
  props: {
1791
- ...pe,
1792
- autoload: {
1793
- type: Boolean,
1794
- default: !1
1795
- },
1836
+ ...ce,
1796
1837
  value: {
1797
1838
  type: [String, Number, null, Array],
1798
1839
  default: void 0
@@ -1822,82 +1863,92 @@ const V = new Ba(), Z = (e, t, a, s, r, n) => {
1822
1863
  },
1823
1864
  emits: ["update:value", "select", "change", "update:labels"],
1824
1865
  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),
1866
+ var $, g, I;
1867
+ const a = e, s = xe(), r = W(), i = de(a.url, a), n = a.optionCtrl ?? i.optionCtrl;
1868
+ n.inputFactory = H(r);
1869
+ const l = f({
1870
+ ...n == null ? void 0 : n.url,
1871
+ url: (($ = n == null ? void 0 : n.url) == null ? void 0 : $.url) || "",
1872
+ fieldMap: (n == null ? void 0 : n.fieldMap) || ((g = n == null ? void 0 : n.url) == null ? void 0 : g.fieldMap),
1873
+ params: (n == null ? void 0 : n.params) || ((I = n == null ? void 0 : n.url) == null ? void 0 : I.params),
1831
1874
  loadingText: !1
1832
- }), n = c(void 0);
1833
- E(
1875
+ }), o = f((n == null ? void 0 : n.selected.value) || void 0);
1876
+ b(
1834
1877
  () => a.value,
1835
1878
  () => {
1836
- n.value = a.value;
1879
+ o.value = a.value;
1837
1880
  },
1838
1881
  { 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);
1882
+ ), b(
1883
+ () => o.value,
1884
+ (v) => {
1885
+ a.autoClean && a.formData && a.outFields && v !== a.value && ua(a.formData, a.outFields, null);
1843
1886
  }
1844
1887
  );
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,
1888
+ const { editorCtrl: c, errInfo: u, labelText: p } = r, m = t;
1889
+ r.inputEmit = m;
1890
+ const d = f((n == null ? void 0 : n.options.value) || []);
1891
+ n && b(
1892
+ () => n.options.value,
1893
+ (v) => {
1894
+ d.value = v || [];
1895
+ },
1896
+ { immediate: !0, deep: !0 }
1897
+ );
1898
+ const E = (v) => {
1899
+ var N;
1900
+ if (d.value = [], v === "") return;
1901
+ let h = v.trim(), R = {
1902
+ ...l.value.params,
1852
1903
  Query: {
1853
- ...($ = r.value.params) == null ? void 0 : $.Query
1904
+ ...(N = l.value.params) == null ? void 0 : N.Query
1854
1905
  }
1855
1906
  };
1856
- a.searchField && (Array.isArray(a.searchField) ? a.searchField.forEach((U) => {
1857
- S.Query[U] = {
1858
- $like: "%" + d + "%"
1907
+ a.searchField && (Array.isArray(a.searchField) ? a.searchField.forEach((K) => {
1908
+ R.Query[K] = {
1909
+ $like: "%" + h + "%"
1859
1910
  };
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);
1911
+ }) : R.Query[a.searchField] = {
1912
+ $like: "%" + h + "%"
1913
+ }), a.onsearch && a.onsearch(h, R), n && Y(n, a);
1914
+ }, O = (v) => {
1915
+ const h = Re(n, a, v);
1916
+ m("update:value", v), m("select", v);
1917
+ const R = Te(h);
1918
+ m("update:labels", R), u != null && u.value.errClass && c && fe(c);
1868
1919
  };
1869
- return ue(() => {
1870
- r.value && !r.value.fieldMap && (r.value.fieldMap = {
1920
+ return ie(() => {
1921
+ l.value && !l.value.fieldMap && (l.value.fieldMap = {
1871
1922
  title: "Name",
1872
1923
  label: "Name",
1873
1924
  value: "Name",
1874
1925
  key: "Id"
1875
1926
  });
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"])
1927
+ }), oe(() => {
1928
+ n && pe(n, a);
1929
+ }), (v, h) => {
1930
+ var R, N, K;
1931
+ return A(), L("div", null, [
1932
+ ae(S(Sa), le({
1933
+ value: o.value,
1934
+ "onUpdate:value": h[0] || (h[0] = (he) => o.value = he),
1935
+ class: [(R = S(u)) == null ? void 0 : R.errClass, "error w-full"],
1936
+ options: d.value,
1937
+ onSearch: E,
1938
+ onSelect: O,
1939
+ placeholder: (K = (N = S(n)) == null ? void 0 : N.url) != null && K.loading ? "请输入并选择" + S(p) : ""
1940
+ }, S(s)), null, 16, ["value", "class", "options", "placeholder"])
1890
1941
  ]);
1891
1942
  };
1892
1943
  }
1893
- }), ot = { class: "min-h-[32px] pt-[5px]" }, lt = {
1944
+ }), pt = { class: "min-h-[32px] pt-[5px]" }, dt = {
1894
1945
  key: 1,
1895
1946
  class: "text-center text-gray-500"
1896
- }, Wt = /* @__PURE__ */ ee({
1947
+ }, ss = /* @__PURE__ */ C({
1897
1948
  inheritAttrs: !1,
1898
1949
  __name: "index",
1899
1950
  props: {
1900
- ...pe,
1951
+ ...ce,
1901
1952
  nodata: {
1902
1953
  type: String,
1903
1954
  default: ""
@@ -1914,66 +1965,76 @@ const V = new Ba(), Z = (e, t, a, s, r, n) => {
1914
1965
  },
1915
1966
  emits: ["change", "update:labels"],
1916
1967
  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),
1968
+ var m, d, E;
1969
+ const a = e, s = xe(), r = W(), i = de(a.url, a), n = a.optionCtrl ?? i.optionCtrl;
1970
+ n.inputFactory = H(r);
1971
+ const l = f({
1972
+ ...n == null ? void 0 : n.url,
1973
+ url: ((m = n == null ? void 0 : n.url) == null ? void 0 : m.url) || "",
1974
+ fieldMap: (n == null ? void 0 : n.fieldMap) || ((d = n == null ? void 0 : n.url) == null ? void 0 : d.fieldMap),
1975
+ params: (n == null ? void 0 : n.params) || ((E = n == null ? void 0 : n.url) == null ? void 0 : E.params),
1923
1976
  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);
1977
+ }), { errInfo: o } = r, c = t;
1978
+ r.inputEmit = c;
1979
+ const u = f((n == null ? void 0 : n.options.value) || []);
1980
+ n && b(
1981
+ () => n.options.value,
1982
+ (O) => {
1983
+ u.value = O || [];
1984
+ },
1985
+ { immediate: !0, deep: !0 }
1986
+ );
1987
+ const p = (O) => {
1988
+ const g = Re(n, a, O), I = Te(g);
1989
+ c("update:labels", I);
1929
1990
  };
1930
- return ue(() => {
1931
- r.value && !r.value.fieldMap && (r.value.fieldMap = {
1991
+ return ie(() => {
1992
+ l.value && !l.value.fieldMap && (l.value.fieldMap = {
1932
1993
  title: "Name",
1933
1994
  label: "Name",
1934
1995
  value: "Id",
1935
1996
  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,
1997
+ }), n && Y(n, a);
1998
+ }), oe(() => {
1999
+ n && pe(n, a);
2000
+ }), (O, $) => (A(), L("div", pt, [
2001
+ ae(S(ba), le({
2002
+ onChange: p,
1942
2003
  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" : "",
2004
+ }, S(s)), {
2005
+ default: z(() => [
2006
+ u.value.length > 0 ? (A(!0), L(te, { key: 0 }, De(u.value, (g) => {
2007
+ var I;
2008
+ return A(), Ie(S(Ia), {
2009
+ key: g.value,
2010
+ value: g.value,
2011
+ disabled: g.disabled || g.value && e.disabledItems && e.disabledItems.indexOf(g.value.toString()) > -1,
2012
+ class: Xe([
2013
+ ((I = S(o)) == null ? void 0 : I.errClass) === "error" ? "error !text-red-400" : "",
1953
2014
  "text-nowrap",
1954
2015
  "pb-1",
1955
2016
  e.wrap ? `w-1/${a.wrap}` : ""
1956
2017
  ])
1957
2018
  }, {
1958
- default: Q(() => [
1959
- Le(W(m.label), 1)
2019
+ default: z(() => [
2020
+ Ue(se(g.label), 1)
1960
2021
  ]),
1961
2022
  _: 2
1962
2023
  }, 1032, ["value", "disabled", "class"]);
1963
- }), 128)) : e.nodata ? (x(), k("div", lt, W(e.nodata), 1)) : B("", !0)
2024
+ }), 128)) : e.nodata ? (A(), L("div", dt, se(e.nodata), 1)) : B("", !0)
1964
2025
  ]),
1965
2026
  _: 1
1966
2027
  }, 16)
1967
2028
  ]));
1968
2029
  }
1969
- }), it = { class: "min-h-[32px] pt-1" }, ut = {
2030
+ }), ht = { class: "min-h-[32px] pt-1" }, mt = {
1970
2031
  key: 1,
1971
2032
  class: "text-center text-gray-500"
1972
- }, Yt = /* @__PURE__ */ ee({
2033
+ }, rs = /* @__PURE__ */ C({
1973
2034
  inheritAttrs: !1,
1974
2035
  __name: "index",
1975
2036
  props: {
1976
- ...pe,
2037
+ ...ce,
1977
2038
  value: {
1978
2039
  type: [String, Number, null, Array],
1979
2040
  default: void 0
@@ -1991,84 +2052,91 @@ const V = new Ba(), Z = (e, t, a, s, r, n) => {
1991
2052
  },
1992
2053
  emits: ["change", "update:value", "update:labels"],
1993
2054
  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),
2055
+ var E, O, $;
2056
+ const a = e, s = xe(), r = W(), i = de(a.url, a), n = a.optionCtrl ?? i.optionCtrl;
2057
+ n.inputFactory = H(r);
2058
+ const l = f({
2059
+ ...n == null ? void 0 : n.url,
2060
+ url: ((E = n == null ? void 0 : n.url) == null ? void 0 : E.url) || "",
2061
+ fieldMap: (n == null ? void 0 : n.fieldMap) || ((O = n == null ? void 0 : n.url) == null ? void 0 : O.fieldMap),
2062
+ params: (n == null ? void 0 : n.params) || (($ = n == null ? void 0 : n.url) == null ? void 0 : $.params),
2000
2063
  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);
2064
+ }), o = f(a.value), { errInfo: c } = r, u = f((n == null ? void 0 : n.options.value) || []), p = t;
2065
+ r.inputEmit = p, n && b(
2066
+ () => n.options.value,
2067
+ (g) => {
2068
+ u.value = g || [];
2069
+ },
2070
+ { immediate: !0, deep: !0 }
2071
+ ), b(
2072
+ () => o.value,
2073
+ (g) => {
2074
+ p("update:value", g);
2006
2075
  }
2007
2076
  );
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;
2077
+ const m = (g, I) => {
2078
+ if (typeof g == "object" && typeof I == "object") {
2079
+ const v = JSON.stringify(g) === JSON.stringify(I);
2080
+ return v && (o.value = g), v;
2012
2081
  }
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);
2082
+ return g === I;
2083
+ }, d = (g) => {
2084
+ const I = g.target.value, v = Re(n, a, I), h = Te(v);
2085
+ p("update:labels", h);
2017
2086
  };
2018
- return ue(() => {
2019
- var m;
2020
- r.value && !r.value.fieldMap && (r.value.fieldMap = {
2087
+ return ie(() => {
2088
+ l.value && !l.value.fieldMap && (l.value.fieldMap = {
2021
2089
  label: "Name",
2022
2090
  value: "Id",
2023
2091
  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),
2092
+ }), n && Y(n, a);
2093
+ }), oe(() => {
2094
+ n && pe(n, a);
2095
+ }), (g, I) => (A(), L("div", ht, [
2096
+ ae(S(xa), le({
2097
+ value: o.value,
2098
+ "onUpdate:value": I[0] || (I[0] = (v) => o.value = v),
2031
2099
  autocheck: !1,
2032
- onChange: p,
2100
+ onChange: d,
2033
2101
  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
2102
+ }, S(s)), {
2103
+ default: z(() => [
2104
+ u.value.length > 0 ? (A(!0), L(te, { key: 0 }, De(u.value, (v) => {
2105
+ var h;
2106
+ return A(), L(te, {
2107
+ key: v.value
2040
2108
  }, [
2041
- g.visible !== !1 ? (x(), ke(A(ga), {
2109
+ v.visible !== !1 ? (A(), Ie(S(Aa), {
2042
2110
  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" : "",
2111
+ checked: m(v.value, a.value),
2112
+ value: v.value,
2113
+ class: Xe([
2114
+ ((h = S(c)) == null ? void 0 : h.errClass) === "error" ? "error !text-red-400" : "",
2047
2115
  "text-nowrap",
2048
2116
  "pb-1",
2049
2117
  e.wrap ? `w-1/${a.wrap}` : ""
2050
2118
  ])
2051
2119
  }, {
2052
- default: Q(() => [
2053
- Le(W(g.label), 1)
2120
+ default: z(() => [
2121
+ Ue(se(v.label), 1)
2054
2122
  ]),
2055
2123
  _: 2
2056
2124
  }, 1032, ["checked", "value", "class"])) : B("", !0)
2057
2125
  ], 64);
2058
- }), 128)) : e.nodata ? (x(), k("div", ut, W(e.nodata), 1)) : B("", !0)
2126
+ }), 128)) : e.nodata ? (A(), L("div", mt, se(e.nodata), 1)) : B("", !0)
2059
2127
  ]),
2060
2128
  _: 1
2061
2129
  }, 16, ["value"])
2062
2130
  ]));
2063
2131
  }
2064
- }), ct = {
2132
+ }), vt = {
2065
2133
  key: 0,
2066
2134
  class: "absolute z-10 mt-[5px] mr-[10px] text-[#999] flex items-center"
2067
- }, Xt = /* @__PURE__ */ ee({
2135
+ }, ns = /* @__PURE__ */ C({
2068
2136
  inheritAttrs: !1,
2069
2137
  __name: "index",
2070
2138
  props: {
2071
- ...pe,
2139
+ ...ce,
2072
2140
  value: {
2073
2141
  type: [String, Number, Array, null],
2074
2142
  default: void 0
@@ -2086,103 +2154,90 @@ const V = new Ba(), Z = (e, t, a, s, r, n) => {
2086
2154
  dataKey: {
2087
2155
  type: String,
2088
2156
  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
2157
  }
2106
2158
  },
2107
2159
  emits: ["change", "update:value", "update:labels"],
2108
2160
  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),
2161
+ var g, I, v;
2162
+ const a = e, s = W(), { editorCtrl: r, errInfo: i, labelText: n } = s, l = de(a.url, a), o = a.optionCtrl ?? l.optionCtrl;
2163
+ o.inputFactory = H(s);
2164
+ const c = xe(), u = f({
2165
+ ...o == null ? void 0 : o.url,
2166
+ url: ((g = o == null ? void 0 : o.url) == null ? void 0 : g.url) || "",
2167
+ fieldMap: (o == null ? void 0 : o.fieldMap) || ((I = o == null ? void 0 : o.url) == null ? void 0 : I.fieldMap),
2168
+ params: (o == null ? void 0 : o.params) || ((v = o == null ? void 0 : o.url) == null ? void 0 : v.params),
2115
2169
  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);
2170
+ }), p = f(a.value), m = f(c.placeholder), d = f((o == null ? void 0 : o.selected.value) || void 0), E = t;
2171
+ s.inputEmit = E;
2172
+ const O = f((o == null ? void 0 : o.options.value) || []);
2173
+ o && b(
2174
+ () => o.options.value,
2175
+ (h) => {
2176
+ O.value = h || [];
2177
+ },
2178
+ { immediate: !0, deep: !0 }
2179
+ );
2180
+ const $ = (h) => {
2181
+ const R = Re(o, a, h), N = Te(R);
2182
+ d.value = h, E("update:labels", N), E("change", h), i != null && i.value.errClass && r && fe(r);
2121
2183
  };
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);
2184
+ return b(
2185
+ () => O.value,
2186
+ (h) => {
2187
+ 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
2188
  }
2127
- ), E(
2128
- () => r.value.loading,
2129
- (d) => {
2130
- d ? f.value = "" : f.value || (f.value = "请选择" + i.value);
2189
+ ), b(
2190
+ () => u.value.loading,
2191
+ (h) => {
2192
+ h ? m.value = "" : m.value || (m.value = "请选择" + n.value);
2131
2193
  },
2132
2194
  { 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);
2195
+ ), b(
2196
+ () => d.value,
2197
+ (h) => {
2198
+ if (c.mode === "multiple" && P(h) && P(p.value)) {
2199
+ E("update:value", p.value);
2138
2200
  return;
2139
2201
  }
2140
- v("update:value", d);
2202
+ E("update:value", h);
2141
2203
  }
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 = {
2204
+ ), ie(() => {
2205
+ if (u.value && !u.value.fieldMap && (u.value.fieldMap = {
2151
2206
  label: "Name",
2152
2207
  value: "Id",
2153
2208
  key: "Id"
2154
2209
  }), 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))
2210
+ const h = JSON.parse(JSON.stringify(M.getOptions(a.dataKey)));
2211
+ O.value = h;
2212
+ } else o && Y(o, a);
2213
+ }), oe(() => {
2214
+ o && pe(o, a);
2215
+ }), (h, R) => {
2216
+ var N, K, he;
2217
+ return A(), L("div", null, [
2218
+ (K = (N = S(o)) == null ? void 0 : N.url) != null && K.loading ? (A(), L("div", vt, [
2219
+ ae(S(Ne), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
2220
+ R[1] || (R[1] = ga("span", null, "数据加载中...", -1))
2166
2221
  ])) : 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),
2222
+ ae(S(Ea), le({
2223
+ class: [(he = S(i)) == null ? void 0 : he.errClass, "w-full"],
2224
+ value: d.value,
2225
+ "onUpdate:value": R[0] || (R[0] = (j) => d.value = j),
2171
2226
  "allow-clear": !0,
2172
- onChange: w,
2173
- placeholder: f.value,
2227
+ onChange: $,
2228
+ placeholder: m.value,
2174
2229
  "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
2230
+ }, S(c)), {
2231
+ default: z(() => [
2232
+ (A(!0), L(te, null, De(O.value, (j) => (A(), L(te, {
2233
+ key: j.value
2179
2234
  }, [
2180
- U.visible !== !1 ? (x(), ke(A(ba), {
2235
+ j.visible !== !1 ? (A(), Ie(S(Ra), {
2181
2236
  key: 0,
2182
- value: U.value
2237
+ value: j.value
2183
2238
  }, {
2184
- default: Q(() => [
2185
- Le(W(U.label), 1)
2239
+ default: z(() => [
2240
+ Ue(se(j.label), 1)
2186
2241
  ]),
2187
2242
  _: 2
2188
2243
  }, 1032, ["value"])) : B("", !0)
@@ -2195,73 +2250,75 @@ const V = new Ba(), Z = (e, t, a, s, r, n) => {
2195
2250
  }
2196
2251
  });
2197
2252
  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,
2253
+ Ft as $,
2254
+ rs as A,
2255
+ ns as B,
2256
+ He as C,
2257
+ Ma as D,
2258
+ jt as E,
2259
+ tt as F,
2260
+ st as G,
2261
+ qt as H,
2262
+ Bt as I,
2263
+ at as J,
2264
+ ua as K,
2265
+ Re as L,
2266
+ Te as M,
2267
+ zt as N,
2213
2268
  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,
2269
+ U as P,
2270
+ Ct as Q,
2271
+ ut as R,
2272
+ ct as S,
2273
+ Yt as T,
2274
+ Ce as U,
2275
+ Xt as V,
2276
+ ea as W,
2277
+ Ut as X,
2278
+ aa as Y,
2279
+ kt as Z,
2280
+ as as _,
2281
+ es as a,
2282
+ Ke as a0,
2283
+ Lt as a1,
2284
+ Ht as a2,
2285
+ Ya as a3,
2286
+ oa as a4,
2287
+ Qt as a5,
2288
+ Pt as a6,
2289
+ Ze as a7,
2290
+ $a as a8,
2291
+ $e as a9,
2292
+ q as aa,
2293
+ ee as ab,
2294
+ ge as ac,
2295
+ V as ad,
2296
+ Zt as ae,
2297
+ Je as af,
2298
+ re as ag,
2299
+ Nt as b,
2300
+ Wt as c,
2301
+ Dt as d,
2302
+ Mt as e,
2303
+ Jt as f,
2304
+ Gt as g,
2305
+ Vt as h,
2249
2306
  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
2307
+ _t as j,
2308
+ ia as k,
2309
+ Ca as l,
2310
+ Kt as m,
2311
+ ts as n,
2312
+ $t as o,
2313
+ ce as p,
2314
+ Na as q,
2315
+ ne as r,
2316
+ W as s,
2317
+ de as t,
2318
+ J as u,
2319
+ Y as v,
2320
+ pe as w,
2321
+ Ne as x,
2322
+ fe as y,
2323
+ ss as z
2267
2324
  };