@skyfox2000/webui 1.2.2 → 1.2.4

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