@skyfox2000/webui 1.4.1 → 1.4.2
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.
- package/lib/assets/modules/{baseLayout-BLUY_tDF.js → baseLayout-CeyN__cz.js} +6 -6
- package/lib/assets/modules/file-upload-DiUcAspb.js +198 -0
- package/lib/assets/modules/{index-Bb4qTaRC.js → index-C5X-1A4m.js} +2 -2
- package/lib/assets/modules/{index-BuP8i92E.js → index-DbgSOuIs.js} +1 -1
- package/lib/assets/modules/{index-DLY7idvQ.js → index-YIIA7qm8.js} +2 -2
- package/lib/assets/modules/{menuTabs-DzoBrCZE.js → menuTabs-hVwE4xrx.js} +2 -2
- package/lib/assets/modules/{toolIcon-FTelEQwg.js → toolIcon-BHWHHyOp.js} +1 -1
- package/lib/assets/modules/{uploadList-DTAFNhow.js → uploadList-1qFfdb6_.js} +4 -4
- package/lib/assets/modules/{uploadList-DIfhRlbh.js → uploadList-EbG8acej.js} +621 -527
- package/lib/es/AceEditor/index.js +3 -3
- package/lib/es/BasicLayout/index.js +2 -2
- package/lib/es/Error403/index.js +1 -1
- package/lib/es/Error404/index.js +1 -1
- package/lib/es/ExcelForm/index.js +5 -5
- package/lib/es/MenuLayout/index.js +2 -2
- package/lib/es/UploadForm/index.js +4 -4
- package/lib/index.d.ts +1 -1
- package/lib/utils/micro-openapis.d.ts +4 -28
- package/lib/webui.es.js +104 -109
- package/package.json +2 -2
- package/src/index.ts +1 -1
- package/src/utils/micro-openapis.ts +124 -125
- package/lib/assets/modules/file-upload-Dk4VFMgz.js +0 -204
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var $ = (e, t, a) =>
|
|
4
|
-
import { ref as f, h as
|
|
5
|
-
import { Switch as
|
|
6
|
-
import { createPinia as Ta, defineStore as
|
|
7
|
-
import
|
|
8
|
-
import { EnvConfig as
|
|
9
|
-
import { httpPost as
|
|
10
|
-
import
|
|
1
|
+
var ha = Object.defineProperty;
|
|
2
|
+
var ma = (e, t, a) => t in e ? ha(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
|
+
var $ = (e, t, a) => ma(e, typeof t != "symbol" ? t + "" : t, a);
|
|
4
|
+
import { ref as f, h as H, nextTick as va, inject as se, provide as Le, watch as g, toRaw as Ze, shallowRef as Q, defineComponent as Z, reactive as ga, onMounted as be, onUnmounted as ie, createBlock as Ie, createCommentVNode as z, openBlock as w, unref as b, mergeProps as le, useAttrs as Ae, createElementBlock as M, createVNode as C, withCtx as K, createTextVNode as Ee, toDisplayString as Y, Fragment as re, renderList as Ue, normalizeClass as ea, createElementVNode as ya } from "vue";
|
|
5
|
+
import { Switch as Sa, AutoComplete as ba, Input as Ia, CheckboxGroup as Aa, Checkbox as Ea, RadioGroup as xa, Radio as wa, Select as Oa, SelectOption as Ra } from "ant-design-vue";
|
|
6
|
+
import { createPinia as Ta, defineStore as ue } from "pinia";
|
|
7
|
+
import Pa from "pinia-plugin-persistedstate";
|
|
8
|
+
import { EnvConfig as ye, AppAction as Be, AppSource as ze, mainAppApis as q, isMicroApp as _e, isBaseMicroApp as ka, combineParams as ce } from "@skyfox2000/microbase";
|
|
9
|
+
import { httpPost as G, ResStatus as T, setToken as me, fieldMapping as La, parseFieldTemplate as Se, API_HOST as Me, SERVER_HOST as Ma } from "@skyfox2000/fapi";
|
|
10
|
+
import A from "vue-m-message";
|
|
11
11
|
import { createRouter as $a, createWebHashHistory as Fa } from "vue-router";
|
|
12
|
-
import
|
|
12
|
+
import He from "async-validator";
|
|
13
13
|
import "dayjs";
|
|
14
14
|
import "vue-draggable-next";
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
const
|
|
15
|
+
const _a = Ta();
|
|
16
|
+
_a.use(Pa);
|
|
17
|
+
var U = /* @__PURE__ */ ((e) => (e.PageControl = "Page.PageControl", e.EditorControl = "Page.EditorControl", e.GridControl = "Page.GridControl", e.LabelText = "FormItem.LabelText", e.LabelWidth = "FormItem.LabelWidth", e.RuleKey = "FormItem.RuleKey", e.ErrInfo = "FormItem.ErrInfo", e))(U || {});
|
|
18
|
+
const P = class P {
|
|
19
19
|
};
|
|
20
|
-
$(
|
|
20
|
+
$(P, "dict", {}), $(P, "Keys", {
|
|
21
21
|
EnableDisable: "EnableDisable",
|
|
22
22
|
SuccessResult: "SuccessResult",
|
|
23
23
|
YesNo: "YesNo",
|
|
@@ -27,25 +27,25 @@ $(w, "dict", {}), $(w, "Keys", {
|
|
|
27
27
|
* @param key 名称
|
|
28
28
|
* @returns
|
|
29
29
|
*/
|
|
30
|
-
$(
|
|
30
|
+
$(P, "getOptions", (t) => P.dict[t]), /**
|
|
31
31
|
* 静态选择项对象
|
|
32
32
|
* @param key 名称
|
|
33
33
|
* @param value 值
|
|
34
34
|
* @returns
|
|
35
35
|
*/
|
|
36
|
-
$(
|
|
36
|
+
$(P, "getOptionItem", (t, a) => P.dict[t].find((s) => s.value === a)), /**
|
|
37
37
|
* 设置静态选择项
|
|
38
38
|
* @param key 名称
|
|
39
39
|
* @param list 列表
|
|
40
40
|
*/
|
|
41
|
-
$(
|
|
42
|
-
|
|
41
|
+
$(P, "setOptions", (t, a) => {
|
|
42
|
+
P.dict[t] = a;
|
|
43
43
|
}), /**
|
|
44
44
|
* 启用/停用选项
|
|
45
45
|
* - 启用 1
|
|
46
46
|
* - 停用 0
|
|
47
47
|
*/
|
|
48
|
-
$(
|
|
48
|
+
$(P, "EnableDisable", [
|
|
49
49
|
{
|
|
50
50
|
label: "启用",
|
|
51
51
|
text: "✅ 启用",
|
|
@@ -61,7 +61,7 @@ $(w, "EnableDisable", [
|
|
|
61
61
|
* - 成功 1
|
|
62
62
|
* - 失败 0
|
|
63
63
|
*/
|
|
64
|
-
$(
|
|
64
|
+
$(P, "SuccessResult", [
|
|
65
65
|
{
|
|
66
66
|
label: "成功",
|
|
67
67
|
text: "✅ 成功",
|
|
@@ -77,7 +77,7 @@ $(w, "SuccessResult", [
|
|
|
77
77
|
* - 是 1
|
|
78
78
|
* - 否 0
|
|
79
79
|
*/
|
|
80
|
-
$(
|
|
80
|
+
$(P, "YesNo", [
|
|
81
81
|
{
|
|
82
82
|
label: "是",
|
|
83
83
|
text: "✅ 是",
|
|
@@ -93,7 +93,7 @@ $(w, "YesNo", [
|
|
|
93
93
|
* - 男 M
|
|
94
94
|
* - 女 F
|
|
95
95
|
*/
|
|
96
|
-
$(
|
|
96
|
+
$(P, "MaleFemale", [
|
|
97
97
|
{
|
|
98
98
|
label: "男",
|
|
99
99
|
text: "男 👨",
|
|
@@ -105,12 +105,12 @@ $(w, "MaleFemale", [
|
|
|
105
105
|
value: "F"
|
|
106
106
|
}
|
|
107
107
|
]);
|
|
108
|
-
let
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const
|
|
108
|
+
let D = P;
|
|
109
|
+
D.setOptions("EnableDisable", D.EnableDisable);
|
|
110
|
+
D.setOptions("SuccessResult", D.SuccessResult);
|
|
111
|
+
D.setOptions("YesNo", D.YesNo);
|
|
112
|
+
D.setOptions("MaleFemale", D.MaleFemale);
|
|
113
|
+
const fe = {
|
|
114
114
|
/**
|
|
115
115
|
* 选项数据接口
|
|
116
116
|
*/
|
|
@@ -173,27 +173,27 @@ const ce = {
|
|
|
173
173
|
type: Object,
|
|
174
174
|
required: !1
|
|
175
175
|
}
|
|
176
|
-
}, F = (e) => e == null || e === "" ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1,
|
|
176
|
+
}, F = (e) => e == null || e === "" ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1, Ce = "/login/", ge = [], Da = (e) => {
|
|
177
177
|
for (const t of e) {
|
|
178
|
-
const a =
|
|
179
|
-
a !== -1 &&
|
|
178
|
+
const a = ge.findIndex((s) => s.path === t.path);
|
|
179
|
+
a !== -1 && ge.splice(a, 1), ge.push(t), xe.addRoute(t);
|
|
180
180
|
}
|
|
181
|
-
},
|
|
181
|
+
}, aa = (e, t, a, s = "") => {
|
|
182
182
|
const n = s + (s ? "/" : "") + e.path;
|
|
183
|
-
t[n] = { ...e, parent: a }, e.children && e.children.forEach((o) =>
|
|
184
|
-
},
|
|
183
|
+
t[n] = { ...e, parent: a }, e.children && e.children.forEach((o) => aa(o, t, e, n));
|
|
184
|
+
}, xe = $a({
|
|
185
185
|
history: Fa("/"),
|
|
186
|
-
routes:
|
|
186
|
+
routes: ge
|
|
187
187
|
}), Na = (e, t) => {
|
|
188
188
|
var n, o;
|
|
189
189
|
const a = ((n = e.meta) == null ? void 0 : n.roles) ?? [], s = (o = e.meta) == null ? void 0 : o.permission;
|
|
190
190
|
if (!t)
|
|
191
191
|
return a.length === 0 && !s;
|
|
192
192
|
if (t) {
|
|
193
|
-
const r =
|
|
194
|
-
if (
|
|
193
|
+
const r = _();
|
|
194
|
+
if (ye.VITE_PERMISSION_MODE === "role")
|
|
195
195
|
return a.length === 0 ? !0 : r.hasRole(a);
|
|
196
|
-
if (
|
|
196
|
+
if (ye.VITE_PERMISSION_MODE === "permit") {
|
|
197
197
|
if (a.length === 0 && !s)
|
|
198
198
|
return !0;
|
|
199
199
|
let l = !1, u = !1;
|
|
@@ -201,17 +201,17 @@ const ce = {
|
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
return !1;
|
|
204
|
-
},
|
|
205
|
-
|
|
204
|
+
}, ne = f(null);
|
|
205
|
+
xe.beforeEach((e, t, a) => {
|
|
206
206
|
var l;
|
|
207
207
|
const s = e;
|
|
208
|
-
if (e.path.startsWith("/error/") || e.path.startsWith(
|
|
208
|
+
if (e.path.startsWith("/error/") || e.path.startsWith(Ce))
|
|
209
209
|
return a();
|
|
210
210
|
const n = s.meta, r = ((n == null ? void 0 : n.roles) ?? []).length > 0 || ((l = n == null ? void 0 : n.permission) == null ? void 0 : l.length);
|
|
211
211
|
if (e.path === "/") {
|
|
212
|
-
const u =
|
|
212
|
+
const u = V();
|
|
213
213
|
if (!u.menuLoaded) {
|
|
214
|
-
|
|
214
|
+
ne.value = {
|
|
215
215
|
to: e,
|
|
216
216
|
next: (i) => {
|
|
217
217
|
a({ path: i });
|
|
@@ -225,12 +225,12 @@ Ee.beforeEach((e, t, a) => {
|
|
|
225
225
|
if (!r)
|
|
226
226
|
a();
|
|
227
227
|
else {
|
|
228
|
-
const u =
|
|
228
|
+
const u = _();
|
|
229
229
|
if (!u.isLogin)
|
|
230
|
-
a({ path:
|
|
230
|
+
a({ path: Ce });
|
|
231
231
|
else {
|
|
232
|
-
if (!
|
|
233
|
-
|
|
232
|
+
if (!V().menuLoaded) {
|
|
233
|
+
ne.value = {
|
|
234
234
|
to: e,
|
|
235
235
|
next: a
|
|
236
236
|
};
|
|
@@ -241,19 +241,19 @@ Ee.beforeEach((e, t, a) => {
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
});
|
|
244
|
-
const
|
|
245
|
-
if (
|
|
246
|
-
const { to: t, next: a } =
|
|
247
|
-
|
|
244
|
+
const Ua = (e) => {
|
|
245
|
+
if (ne.value) {
|
|
246
|
+
const { to: t, next: a } = ne.value;
|
|
247
|
+
ne.value = null, t.path === "/" ? a(e) : a(t.path);
|
|
248
248
|
}
|
|
249
|
-
},
|
|
250
|
-
const t =
|
|
249
|
+
}, Ha = (e) => {
|
|
250
|
+
const t = Ve();
|
|
251
251
|
if (t.TabEnabled) {
|
|
252
|
-
if (
|
|
252
|
+
if (Va(e.key, t.TabPanes))
|
|
253
253
|
return;
|
|
254
254
|
t.TabPanes.push(e);
|
|
255
255
|
}
|
|
256
|
-
},
|
|
256
|
+
}, Va = (e, t) => t.find((a) => a.key === e), Ve = ue("pageInfo", {
|
|
257
257
|
state: () => ({
|
|
258
258
|
TabActive: "",
|
|
259
259
|
TabPanes: [],
|
|
@@ -266,7 +266,7 @@ const Da = (e) => {
|
|
|
266
266
|
*/
|
|
267
267
|
removeTabPane(e) {
|
|
268
268
|
if (this.TabEnabled) {
|
|
269
|
-
|
|
269
|
+
V().excludeComponent(e);
|
|
270
270
|
let a = 0, s = [...this.TabPanes];
|
|
271
271
|
for (let n = 0; n < s.length; n++)
|
|
272
272
|
if (s[n].key === e) {
|
|
@@ -287,7 +287,7 @@ const Da = (e) => {
|
|
|
287
287
|
* @returns
|
|
288
288
|
*/
|
|
289
289
|
async setTabActive(e) {
|
|
290
|
-
let a =
|
|
290
|
+
let a = V().findRoute(e);
|
|
291
291
|
if (!a) return;
|
|
292
292
|
const s = {
|
|
293
293
|
key: e,
|
|
@@ -298,44 +298,44 @@ const Da = (e) => {
|
|
|
298
298
|
// 默认为true
|
|
299
299
|
keepAlive: !(a.meta && !a.meta.keepAlive)
|
|
300
300
|
};
|
|
301
|
-
|
|
301
|
+
Ha(s), this.TabActive = e;
|
|
302
302
|
}
|
|
303
303
|
},
|
|
304
304
|
persist: !1
|
|
305
|
-
}),
|
|
305
|
+
}), Ka = {
|
|
306
306
|
appList: {
|
|
307
307
|
api: "PLATFORM_API",
|
|
308
308
|
authorize: !0,
|
|
309
309
|
url: "/api/RCTenanetOpSrv/getApps",
|
|
310
310
|
loadingText: !1
|
|
311
311
|
}
|
|
312
|
-
}, $e = /* @__PURE__ */ new Map(),
|
|
313
|
-
const t =
|
|
312
|
+
}, $e = /* @__PURE__ */ new Map(), Qa = (e) => {
|
|
313
|
+
const t = _(), { roles: a, permission: s } = e.meta || {};
|
|
314
314
|
if (F(a) && F(s))
|
|
315
315
|
return !0;
|
|
316
|
-
if (
|
|
316
|
+
if (ye.VITE_PERMISSION_MODE === "role")
|
|
317
317
|
return F(a) ? !0 : t.hasRole(a);
|
|
318
|
-
if (
|
|
318
|
+
if (ye.VITE_PERMISSION_MODE === "permit") {
|
|
319
319
|
let n = !1, o = !1;
|
|
320
320
|
return F(a) || (n = t.hasRole(a)), t.isAdmin() ? n : (F(s) || (o = t.hasPermit(e.path, s)), n || o);
|
|
321
321
|
}
|
|
322
322
|
return !1;
|
|
323
|
-
},
|
|
323
|
+
}, ta = (e) => e.map((t) => {
|
|
324
324
|
const a = { ...t };
|
|
325
|
-
return
|
|
326
|
-
}).filter(Boolean),
|
|
325
|
+
return Qa(a) ? (a.children && (a.children = ta(a.children)), a) : null;
|
|
326
|
+
}).filter(Boolean), sa = (e, t = "") => {
|
|
327
327
|
for (const a of e) {
|
|
328
328
|
if (!a.children && !a.redirect) {
|
|
329
329
|
let s = t + a.path;
|
|
330
330
|
return s.startsWith("/") || (s = "/" + s), s;
|
|
331
331
|
}
|
|
332
332
|
if (a.children && a.children.length > 0 && a.path !== "/error" && a.path !== "/login" && a.path !== "/:page(.*)") {
|
|
333
|
-
const s =
|
|
333
|
+
const s = sa(a.children, t + a.path + "/");
|
|
334
334
|
if (s)
|
|
335
335
|
return s;
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
},
|
|
338
|
+
}, V = ue("appInfo", {
|
|
339
339
|
state: () => ({
|
|
340
340
|
appInfo: {
|
|
341
341
|
Id: "",
|
|
@@ -343,8 +343,8 @@ const Da = (e) => {
|
|
|
343
343
|
AppCode: "",
|
|
344
344
|
Version: "",
|
|
345
345
|
Host: "",
|
|
346
|
-
Source:
|
|
347
|
-
Action:
|
|
346
|
+
Source: ze.Manual,
|
|
347
|
+
Action: Be.App,
|
|
348
348
|
Path: "",
|
|
349
349
|
Icon: "",
|
|
350
350
|
Routes: [],
|
|
@@ -369,7 +369,7 @@ const Da = (e) => {
|
|
|
369
369
|
});
|
|
370
370
|
},
|
|
371
371
|
async getRemoteAppList() {
|
|
372
|
-
return
|
|
372
|
+
return G(Ka.appList, {
|
|
373
373
|
Query: {
|
|
374
374
|
AppCode: this.appInfo.AppCode,
|
|
375
375
|
Enabled: 1
|
|
@@ -377,15 +377,15 @@ const Da = (e) => {
|
|
|
377
377
|
}).then((e) => {
|
|
378
378
|
if ((e == null ? void 0 : e.status) === T.SUCCESS && e.data)
|
|
379
379
|
this.appList.length = 0, this.appList.push(...e.data);
|
|
380
|
-
else if ((e == null ? void 0 : e.errno) ==
|
|
381
|
-
|
|
380
|
+
else if ((e == null ? void 0 : e.errno) == we) {
|
|
381
|
+
_().logout(!1);
|
|
382
382
|
return;
|
|
383
383
|
}
|
|
384
384
|
});
|
|
385
385
|
},
|
|
386
386
|
async toDefaultApp(e) {
|
|
387
387
|
if (this.appList.length === 0 && await this.loadAppList(), this.appList.length === 0) {
|
|
388
|
-
|
|
388
|
+
A.error("加载应用列表失败");
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
391
|
let t = "";
|
|
@@ -413,7 +413,7 @@ const Da = (e) => {
|
|
|
413
413
|
flattenRoutes: {},
|
|
414
414
|
Routes: t ?? [],
|
|
415
415
|
defaultPage: ""
|
|
416
|
-
}), (!
|
|
416
|
+
}), (!_e() || !ka()) && (await _().getRolePermits(a.Id), this.appInfo.Routes.length && this.setAppRoutes(this.appInfo.Routes)));
|
|
417
417
|
},
|
|
418
418
|
/**
|
|
419
419
|
* 设置当前应用路由信息
|
|
@@ -428,18 +428,18 @@ const Da = (e) => {
|
|
|
428
428
|
};
|
|
429
429
|
const t = this.appInfo.flattenRoutes;
|
|
430
430
|
for (const a of e)
|
|
431
|
-
|
|
431
|
+
aa(a, t, void 0);
|
|
432
432
|
if (Object.keys(t).forEach((a) => {
|
|
433
433
|
const s = t[a];
|
|
434
434
|
s.children || !s.component || (s.meta && s.meta.keepAlive === !1 ? this.ExcludeComponents.push(a) : this.CachedComponents.push(a));
|
|
435
|
-
}),
|
|
436
|
-
const a =
|
|
437
|
-
if (
|
|
438
|
-
if (this.menuLoaded = !0,
|
|
435
|
+
}), _().isLogin) {
|
|
436
|
+
const a = ta(this.appInfo.Routes);
|
|
437
|
+
if (Da(a), this.appInfo.defaultPage = sa(a) || "", this.appInfo.defaultPage) {
|
|
438
|
+
if (this.menuLoaded = !0, q.value && q.value.mainAppPush) {
|
|
439
439
|
const s = this.formatRoute(this.appInfo.defaultPage);
|
|
440
|
-
|
|
440
|
+
q.value.mainAppPush(s);
|
|
441
441
|
}
|
|
442
|
-
|
|
442
|
+
Ua(this.appInfo.defaultPage);
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
},
|
|
@@ -457,10 +457,10 @@ const Da = (e) => {
|
|
|
457
457
|
* @param path 路由地址
|
|
458
458
|
*/
|
|
459
459
|
push(e) {
|
|
460
|
-
this.findRoute(e) &&
|
|
461
|
-
if (
|
|
460
|
+
this.findRoute(e) && Ve().setTabActive(e), va(() => {
|
|
461
|
+
if (xe.push({ path: e }), q.value && q.value.mainAppPush) {
|
|
462
462
|
const a = this.formatRoute(e);
|
|
463
|
-
|
|
463
|
+
q.value.mainAppPush(a);
|
|
464
464
|
}
|
|
465
465
|
});
|
|
466
466
|
},
|
|
@@ -486,7 +486,7 @@ const Da = (e) => {
|
|
|
486
486
|
// 设置组件包装器的名称为路由路径
|
|
487
487
|
name: t.path,
|
|
488
488
|
render() {
|
|
489
|
-
return
|
|
489
|
+
return H(e);
|
|
490
490
|
}
|
|
491
491
|
}, $e.set(t.path, a);
|
|
492
492
|
else return e;
|
|
@@ -517,8 +517,8 @@ const Da = (e) => {
|
|
|
517
517
|
AppCode: "",
|
|
518
518
|
Version: "",
|
|
519
519
|
Host: "",
|
|
520
|
-
Source:
|
|
521
|
-
Action:
|
|
520
|
+
Source: ze.Manual,
|
|
521
|
+
Action: Be.App,
|
|
522
522
|
Path: "",
|
|
523
523
|
Icon: "",
|
|
524
524
|
Routes: [],
|
|
@@ -532,7 +532,7 @@ const Da = (e) => {
|
|
|
532
532
|
}
|
|
533
533
|
},
|
|
534
534
|
persist: !1
|
|
535
|
-
}),
|
|
535
|
+
}), Ja = "Token解析失败", we = 1400, Ke = {
|
|
536
536
|
login: {
|
|
537
537
|
api: "PLATFORM_API",
|
|
538
538
|
url: "/openapi/LoginSrv/login",
|
|
@@ -550,43 +550,43 @@ const Da = (e) => {
|
|
|
550
550
|
url: "/api/LoginSrv/logout",
|
|
551
551
|
loadingText: "正在退出..."
|
|
552
552
|
}
|
|
553
|
-
},
|
|
553
|
+
}, ja = (e) => {
|
|
554
554
|
let t = {
|
|
555
555
|
Option: {
|
|
556
556
|
Mode: "MicroApp"
|
|
557
557
|
},
|
|
558
558
|
Query: e
|
|
559
559
|
};
|
|
560
|
-
return
|
|
561
|
-
},
|
|
560
|
+
return G(Ke.login, t).then((a) => (a == null ? void 0 : a.status) === T.SUCCESS ? a : null);
|
|
561
|
+
}, Ga = (e) => {
|
|
562
562
|
let t = {
|
|
563
563
|
Query: {
|
|
564
564
|
AppId: e
|
|
565
565
|
}
|
|
566
566
|
};
|
|
567
|
-
return
|
|
567
|
+
return G(Ke.auth, t).then((a) => {
|
|
568
568
|
if ((a == null ? void 0 : a.status) === T.SUCCESS)
|
|
569
569
|
return a.data;
|
|
570
|
-
if ((a == null ? void 0 : a.errno) ==
|
|
571
|
-
|
|
570
|
+
if ((a == null ? void 0 : a.errno) == we) {
|
|
571
|
+
_().logout(!1);
|
|
572
572
|
return;
|
|
573
573
|
}
|
|
574
|
-
return
|
|
574
|
+
return A.error("获取授权信息失败," + (a == null ? void 0 : a.msg)), null;
|
|
575
575
|
});
|
|
576
|
-
},
|
|
576
|
+
}, Wa = () => {
|
|
577
577
|
let e = {
|
|
578
578
|
Option: {},
|
|
579
579
|
Query: {}
|
|
580
580
|
};
|
|
581
|
-
return
|
|
582
|
-
},
|
|
581
|
+
return G(Ke.logout, e).then((t) => (t == null ? void 0 : t.status) === T.SUCCESS ? t.data : null);
|
|
582
|
+
}, qa = (e) => {
|
|
583
583
|
try {
|
|
584
584
|
const t = JSON.parse(atob(e.token.split(".")[1]));
|
|
585
585
|
return t.user = JSON.parse(t.user), e.UserInfo = t.user, !0;
|
|
586
586
|
} catch (t) {
|
|
587
|
-
return console.error(
|
|
587
|
+
return console.error(Ja, t), !1;
|
|
588
588
|
}
|
|
589
|
-
},
|
|
589
|
+
}, L = f(""), ae = f(null), _ = ue("userInfo", {
|
|
590
590
|
state: () => ({
|
|
591
591
|
isLogin: !1,
|
|
592
592
|
userInfo: {
|
|
@@ -604,7 +604,7 @@ const Da = (e) => {
|
|
|
604
604
|
* 启动时初始化用户信息
|
|
605
605
|
*/
|
|
606
606
|
init() {
|
|
607
|
-
|
|
607
|
+
_e() || (this.token ? (me(this.token), L.value = this.userInfo.UserLevel, this.isLogin = !0) : this.clean());
|
|
608
608
|
},
|
|
609
609
|
/**
|
|
610
610
|
* 登录操作
|
|
@@ -612,23 +612,23 @@ const Da = (e) => {
|
|
|
612
612
|
* @returns
|
|
613
613
|
*/
|
|
614
614
|
async login(e, t) {
|
|
615
|
-
const a = await
|
|
615
|
+
const a = await ja(e);
|
|
616
616
|
if (a) {
|
|
617
617
|
const s = a;
|
|
618
618
|
if (s.errno)
|
|
619
619
|
return s;
|
|
620
620
|
{
|
|
621
621
|
const n = a.data;
|
|
622
|
-
if (this.token = n.token,
|
|
622
|
+
if (this.token = n.token, me(this.token), this.isLogin = !0, qa(n))
|
|
623
623
|
this.userInfo = {
|
|
624
624
|
...this.userInfo,
|
|
625
625
|
...n.UserInfo
|
|
626
|
-
},
|
|
626
|
+
}, L.value = n.UserInfo.UserLevel;
|
|
627
627
|
else {
|
|
628
|
-
|
|
628
|
+
A.error("用户信息解析失败");
|
|
629
629
|
return;
|
|
630
630
|
}
|
|
631
|
-
t &&
|
|
631
|
+
t && V().toDefaultApp();
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
634
|
},
|
|
@@ -640,11 +640,11 @@ const Da = (e) => {
|
|
|
640
640
|
async getRolePermits(e) {
|
|
641
641
|
if (!this.isLogin || !this.token)
|
|
642
642
|
return !1;
|
|
643
|
-
if (
|
|
643
|
+
if (ae.value && ae.value.appId === e)
|
|
644
644
|
return !0;
|
|
645
645
|
try {
|
|
646
|
-
const t = await
|
|
647
|
-
return t ? (
|
|
646
|
+
const t = await Ga(e);
|
|
647
|
+
return t ? (ae.value = {
|
|
648
648
|
appId: e,
|
|
649
649
|
permits: t.permits || [],
|
|
650
650
|
lastTime: t.lastTime
|
|
@@ -659,7 +659,7 @@ const Da = (e) => {
|
|
|
659
659
|
* @returns 是否有角色权限
|
|
660
660
|
*/
|
|
661
661
|
hasRole(e) {
|
|
662
|
-
return
|
|
662
|
+
return L.value ? Array.isArray(e) ? e.includes(L.value) : L.value === e : !1;
|
|
663
663
|
},
|
|
664
664
|
/**
|
|
665
665
|
* 检查功能权限
|
|
@@ -669,7 +669,7 @@ const Da = (e) => {
|
|
|
669
669
|
*/
|
|
670
670
|
hasPermit(e, t) {
|
|
671
671
|
var s;
|
|
672
|
-
const a =
|
|
672
|
+
const a = ae.value;
|
|
673
673
|
return !a || !a.permits ? !1 : ((s = a.permits[e]) == null ? void 0 : s.includes(t)) ?? !1;
|
|
674
674
|
},
|
|
675
675
|
/**
|
|
@@ -686,10 +686,10 @@ const Da = (e) => {
|
|
|
686
686
|
* @param token 用户Token
|
|
687
687
|
*/
|
|
688
688
|
setUserInfo(e, t) {
|
|
689
|
-
|
|
689
|
+
L.value || (L.value = e.UserLevel, this.userInfo = {
|
|
690
690
|
...this.userInfo,
|
|
691
691
|
...e
|
|
692
|
-
}, this.token = t,
|
|
692
|
+
}, this.token = t, me(this.token), this.isLogin = !0);
|
|
693
693
|
},
|
|
694
694
|
/**
|
|
695
695
|
* 获取用户Token
|
|
@@ -702,20 +702,20 @@ const Da = (e) => {
|
|
|
702
702
|
* 是否超级管理员
|
|
703
703
|
*/
|
|
704
704
|
isSuperAdmin() {
|
|
705
|
-
return
|
|
705
|
+
return L.value === "Super";
|
|
706
706
|
},
|
|
707
707
|
/**
|
|
708
708
|
* 是否管理员
|
|
709
709
|
*/
|
|
710
710
|
isAdmin() {
|
|
711
|
-
return
|
|
711
|
+
return L.value === "Super" || L.value === "Admin";
|
|
712
712
|
},
|
|
713
713
|
/**
|
|
714
714
|
* 获取用户级别
|
|
715
715
|
* @returns 用户级别
|
|
716
716
|
*/
|
|
717
717
|
getUserLevel() {
|
|
718
|
-
return
|
|
718
|
+
return L.value;
|
|
719
719
|
},
|
|
720
720
|
/*
|
|
721
721
|
* 清理登录信息
|
|
@@ -727,7 +727,7 @@ const Da = (e) => {
|
|
|
727
727
|
Code: "",
|
|
728
728
|
TenantId: "",
|
|
729
729
|
UserLevel: ""
|
|
730
|
-
}, this.token = "",
|
|
730
|
+
}, this.token = "", me(this.token), this.isLogin = !1, ae.value = null, L.value = "", V().clean(), Promise.resolve();
|
|
731
731
|
},
|
|
732
732
|
/**
|
|
733
733
|
* 登出操作
|
|
@@ -736,20 +736,20 @@ const Da = (e) => {
|
|
|
736
736
|
*/
|
|
737
737
|
async logout(e) {
|
|
738
738
|
try {
|
|
739
|
-
e && await
|
|
739
|
+
e && await Wa();
|
|
740
740
|
} catch (t) {
|
|
741
741
|
console.error("调用登出接口失败", t);
|
|
742
742
|
} finally {
|
|
743
743
|
await this.clean(), e && setTimeout(async () => {
|
|
744
|
-
|
|
744
|
+
A.success("已退出登录");
|
|
745
745
|
}, 1e3), setTimeout(async () => {
|
|
746
|
-
|
|
746
|
+
V().logout();
|
|
747
747
|
}, 2e3);
|
|
748
748
|
}
|
|
749
749
|
return Promise.resolve();
|
|
750
750
|
}
|
|
751
751
|
},
|
|
752
|
-
persist:
|
|
752
|
+
persist: _e() ? !1 : {
|
|
753
753
|
key: "MICROAPP_USER_INFO",
|
|
754
754
|
storage: localStorage,
|
|
755
755
|
pick: ["token", "userInfo"],
|
|
@@ -775,19 +775,19 @@ const Da = (e) => {
|
|
|
775
775
|
return console.warn(o), Promise.reject(new Error(o));
|
|
776
776
|
}
|
|
777
777
|
s.api || (s.api = a.api), s.authorize === void 0 && (s.authorize = a.authorize);
|
|
778
|
-
let n =
|
|
778
|
+
let n = ce(
|
|
779
779
|
JSON.parse(JSON.stringify(s.params ?? {})),
|
|
780
780
|
JSON.parse(JSON.stringify(t.params ?? {}))
|
|
781
781
|
);
|
|
782
|
-
return t.processParams && (n = t.processParams(n)), t.loadingState && (t.loadingState.value = !0), t.hideErrorToast && (s.hideErrorToast = !0),
|
|
783
|
-
},
|
|
782
|
+
return t.processParams && (n = t.processParams(n)), t.loadingState && (t.loadingState.value = !0), t.hideErrorToast && (s.hideErrorToast = !0), G(s, n).then((o) => (t.loadingState && (t.loadingState.value = !1), (o == null ? void 0 : o.errno) == we ? (_().logout(!1), null) : o)).catch((o) => (t.loadingState && (t.loadingState.value = !1), null));
|
|
783
|
+
}, Qe = (e, t) => {
|
|
784
784
|
t.params || (t.params = {}), t.params.Query || (t.params.Query = {});
|
|
785
785
|
const a = Oe(e, t);
|
|
786
786
|
return t.url = a, Re(e, t);
|
|
787
|
-
},
|
|
787
|
+
}, Mt = (e, t) => (t.params || (t.params = {}), t.params.Query || (t.params.Query = {}), t.loadingText = t.loadingText === !1 ? !1 : t.loadingText || "开始执行...", t.url = Oe(e, t), Re(e, t).then((a) => ((a == null ? void 0 : a.status) === T.SUCCESS && (t.hideErrorToast || A.success("执行成功!")), a))), na = (e, t = {}) => {
|
|
788
788
|
const a = t.primaryKey || "Id";
|
|
789
789
|
if (t.params || (t.params = {}), t.params.Query || (t.params.Query = {}), !t.params.Data)
|
|
790
|
-
return
|
|
790
|
+
return A.error("错误!无保存数据!"), Promise.resolve(null);
|
|
791
791
|
const s = {
|
|
792
792
|
...t,
|
|
793
793
|
urlKey: t.urlKey || "save",
|
|
@@ -795,8 +795,8 @@ const Da = (e) => {
|
|
|
795
795
|
};
|
|
796
796
|
s.params.Query[a] = s.params.Data[a];
|
|
797
797
|
const n = Oe(e, s);
|
|
798
|
-
return s.url = n, Re(e, s).then((o) => ((o == null ? void 0 : o.status) === T.SUCCESS && (t.hideErrorToast ||
|
|
799
|
-
},
|
|
798
|
+
return s.url = n, Re(e, s).then((o) => ((o == null ? void 0 : o.status) === T.SUCCESS && (t.hideErrorToast || A.success("保存成功!")), o));
|
|
799
|
+
}, Ba = (e, t, a = {}) => {
|
|
800
800
|
const s = a.primaryKey || "Id";
|
|
801
801
|
a.params || (a.params = {}), a.params.Query || (a.params.Query = {});
|
|
802
802
|
const n = {
|
|
@@ -805,19 +805,19 @@ const Da = (e) => {
|
|
|
805
805
|
loadingText: a.loadingText === !1 ? !1 : a.loadingText || "数据删除中..."
|
|
806
806
|
};
|
|
807
807
|
if (Array.isArray(t) ? n.params.Query[s] = t : n.params.Query[s] = t[s], F(n.params.Query) || F(n.params.Query[s]))
|
|
808
|
-
return
|
|
808
|
+
return A.error("错误!禁止无条件删除数据!"), Promise.resolve(null);
|
|
809
809
|
const o = Oe(e, n);
|
|
810
|
-
return n.url = o, Re(e, n).then((r) => ((r == null ? void 0 : r.status) === T.SUCCESS && (a.hideErrorToast ||
|
|
811
|
-
},
|
|
810
|
+
return n.url = o, Re(e, n).then((r) => ((r == null ? void 0 : r.status) === T.SUCCESS && (a.hideErrorToast || A.success("删除成功!")), r));
|
|
811
|
+
}, za = (e, t) => Qe(e, {
|
|
812
812
|
urlKey: "tree",
|
|
813
813
|
params: {},
|
|
814
814
|
loadingState: e.isTreeLoading,
|
|
815
815
|
loadingText: !1,
|
|
816
|
-
processParams: () =>
|
|
816
|
+
processParams: () => ce(e.treeQuery, t)
|
|
817
817
|
}).then((a) => (a == null ? void 0 : a.status) === T.SUCCESS ? (e.data.value = a.data || [], e.afterLoad && e.afterLoad(e.data.value), e.data.value) : (e.afterLoad && e.afterLoad((a == null ? void 0 : a.data) || []), []));
|
|
818
|
-
let
|
|
819
|
-
const
|
|
820
|
-
|
|
818
|
+
let oe;
|
|
819
|
+
const $t = (e) => {
|
|
820
|
+
oe = new He({}), oe.messages({
|
|
821
821
|
required: "${label}不能为空",
|
|
822
822
|
types: {
|
|
823
823
|
number: "${label}必须是数字"
|
|
@@ -843,10 +843,10 @@ const Lt = (e) => {
|
|
|
843
843
|
},
|
|
844
844
|
...e
|
|
845
845
|
});
|
|
846
|
-
},
|
|
846
|
+
}, Ft = (e) => {
|
|
847
847
|
if (!e || F(e))
|
|
848
848
|
return [];
|
|
849
|
-
const t = [], a =
|
|
849
|
+
const t = [], a = oe.messages(), s = (o, r, l) => {
|
|
850
850
|
const u = r.type;
|
|
851
851
|
if (u && a.types && u in a.types) {
|
|
852
852
|
const c = a.types[u];
|
|
@@ -855,9 +855,9 @@ const Lt = (e) => {
|
|
|
855
855
|
const i = ["string", "number", "array"];
|
|
856
856
|
for (const c of i)
|
|
857
857
|
if (u === c && a[c]) {
|
|
858
|
-
const
|
|
859
|
-
for (const
|
|
860
|
-
|
|
858
|
+
const p = a[c], v = ["len", "min", "max", "range"];
|
|
859
|
+
for (const d of v)
|
|
860
|
+
d === "range" && r.min != null && r.max != null && p.range ? n(p.range, o, { min: r.min, max: r.max }, l) : d !== "range" && r[d] != null && p[d] && n(p[d], o, { [d]: r[d] }, l);
|
|
861
861
|
}
|
|
862
862
|
if (r.required && a.required && n(a.required, o, {}, l), r.pattern && a.pattern && n(r.message, o, {}, l), r.enum && Array.isArray(r.enum) && a.enum) {
|
|
863
863
|
const c = r.enum.join(", ");
|
|
@@ -869,8 +869,8 @@ const Lt = (e) => {
|
|
|
869
869
|
let i;
|
|
870
870
|
if (typeof o == "function") {
|
|
871
871
|
const c = [r];
|
|
872
|
-
for (const
|
|
873
|
-
c.push(l[
|
|
872
|
+
for (const p in l)
|
|
873
|
+
c.push(l[p]);
|
|
874
874
|
i = o.apply(null, c), i && u.push(i);
|
|
875
875
|
} else {
|
|
876
876
|
i = String(o);
|
|
@@ -897,22 +897,22 @@ const Lt = (e) => {
|
|
|
897
897
|
rules: u
|
|
898
898
|
});
|
|
899
899
|
}), t;
|
|
900
|
-
},
|
|
900
|
+
}, pe = async (e) => {
|
|
901
901
|
const t = e.formData.value, a = e.formRules.value;
|
|
902
|
-
F(a) || (
|
|
902
|
+
F(a) || (Je(e), e.ruleValidator || (e.ruleValidator = new He({}), e.ruleValidator.messages(oe.messages()), e.ruleValidator.define(a)), e.ruleResults.value = await e.ruleValidator.validate(t).then(() => {
|
|
903
903
|
}).catch(({ fields: s }) => s));
|
|
904
|
-
},
|
|
905
|
-
}).catch(({ fields: s }) => s)),
|
|
904
|
+
}, _t = async (e, t, a) => (a || (a = new He({}), a.messages(oe.messages()), a.define(t)), a.validate(e).then(() => {
|
|
905
|
+
}).catch(({ fields: s }) => s)), Je = (e) => {
|
|
906
906
|
e.ruleResults.value = void 0;
|
|
907
|
-
},
|
|
908
|
-
const e =
|
|
907
|
+
}, X = () => {
|
|
908
|
+
const e = se(U.EditorControl, void 0), t = f(se(U.LabelText, "")), a = f(se(U.RuleKey, "")), s = se(U.ErrInfo, void 0);
|
|
909
909
|
return {
|
|
910
910
|
editorCtrl: e,
|
|
911
911
|
labelText: t,
|
|
912
912
|
ruleKey: a,
|
|
913
913
|
errInfo: s
|
|
914
914
|
};
|
|
915
|
-
},
|
|
915
|
+
}, Ca = (e, t) => {
|
|
916
916
|
let a = f({
|
|
917
917
|
msg: "",
|
|
918
918
|
errClass: ""
|
|
@@ -924,20 +924,20 @@ const Lt = (e) => {
|
|
|
924
924
|
() => s == null ? void 0 : s.value,
|
|
925
925
|
(n) => {
|
|
926
926
|
if (a.value.errClass = "", a.value.msg = "", !F(n)) {
|
|
927
|
-
const o =
|
|
927
|
+
const o = Ya(
|
|
928
928
|
{
|
|
929
929
|
label: e.label,
|
|
930
930
|
rule: e.rule
|
|
931
931
|
},
|
|
932
932
|
t == null ? void 0 : t.formRules.value,
|
|
933
|
-
|
|
933
|
+
Ze(n)
|
|
934
934
|
);
|
|
935
935
|
a.value.errClass = o.errClass.value, a.value.msg = o.msg.value;
|
|
936
936
|
}
|
|
937
937
|
},
|
|
938
938
|
{ deep: !0 }
|
|
939
939
|
), a;
|
|
940
|
-
},
|
|
940
|
+
}, Ya = (e, t, a) => {
|
|
941
941
|
const s = f([]), n = f(""), o = f("");
|
|
942
942
|
if (!e.rule || !t || !a)
|
|
943
943
|
return { msg: n, ruleErrors: s, errClass: o };
|
|
@@ -958,32 +958,32 @@ const Lt = (e) => {
|
|
|
958
958
|
const i = t[u.field];
|
|
959
959
|
if (i) {
|
|
960
960
|
const c = n.value.match(l);
|
|
961
|
-
c && c.forEach((
|
|
962
|
-
const v =
|
|
963
|
-
n.value = n.value.replace(
|
|
961
|
+
c && c.forEach((p) => {
|
|
962
|
+
const v = p.replace("${", "").replace("}", "");
|
|
963
|
+
n.value = n.value.replace(p, i[v] ?? "");
|
|
964
964
|
});
|
|
965
965
|
}
|
|
966
966
|
}), s.value.length > 0 && (o.value = "error"), { msg: n, ruleErrors: s, errClass: o };
|
|
967
|
-
},
|
|
968
|
-
|
|
969
|
-
const a =
|
|
970
|
-
return
|
|
971
|
-
}, _t = (e) => {
|
|
972
|
-
na(e);
|
|
967
|
+
}, Dt = (e, t) => {
|
|
968
|
+
Le(U.LabelText, e.label || ""), Le(U.RuleKey, e.rule || "");
|
|
969
|
+
const a = Ca(e, t);
|
|
970
|
+
return Le(U.ErrInfo, a), a;
|
|
973
971
|
}, Nt = (e) => {
|
|
972
|
+
ra(e);
|
|
973
|
+
}, Ut = (e) => {
|
|
974
974
|
const t = e.page, a = e.formData.value;
|
|
975
|
-
a[e.primaryKey ?? t.primaryKey] = null,
|
|
976
|
-
},
|
|
977
|
-
|
|
978
|
-
},
|
|
975
|
+
a[e.primaryKey ?? t.primaryKey] = null, ra(e);
|
|
976
|
+
}, Ht = (e) => {
|
|
977
|
+
je(e), e.visible.value = !1;
|
|
978
|
+
}, ra = async (e) => {
|
|
979
979
|
var s;
|
|
980
980
|
const t = e.page;
|
|
981
|
-
if (e.isFormSaving.value = !0,
|
|
981
|
+
if (e.isFormSaving.value = !0, Je(e), e.beforeSave && e.beforeSave() === !1)
|
|
982
982
|
return e.isFormSaving.value = !1, Promise.resolve();
|
|
983
|
-
if (e.formRules.value && await
|
|
984
|
-
return
|
|
983
|
+
if (e.formRules.value && await pe(e), e.ruleResults.value)
|
|
984
|
+
return A.error("提交表单时,验证失败!"), console.error("表单验证失败!", e.ruleResults.value), e.isFormSaving.value = !1, Promise.resolve();
|
|
985
985
|
const a = e.formData.value;
|
|
986
|
-
return
|
|
986
|
+
return na(
|
|
987
987
|
{
|
|
988
988
|
page: t,
|
|
989
989
|
// 转换为AnyControl接口
|
|
@@ -1003,50 +1003,50 @@ const Lt = (e) => {
|
|
|
1003
1003
|
).then((n) => {
|
|
1004
1004
|
var o, r;
|
|
1005
1005
|
if ((n == null ? void 0 : n.status) === T.SUCCESS)
|
|
1006
|
-
|
|
1006
|
+
A.success("保存成功!"), e.grid && (e.grid.reload.value = !0), e.afterSave && e.afterSave(n), e.autoClose !== !1 && (e.visible.value = !1);
|
|
1007
1007
|
else if (n != null && n.msg && ((o = n == null ? void 0 : n.msg) == null ? void 0 : o.indexOf("Duplicate entry")) > -1) {
|
|
1008
1008
|
const l = (r = n == null ? void 0 : n.msg) == null ? void 0 : r.match(/Duplicate entry '([^']+)' for key '([^']+)'/);
|
|
1009
1009
|
if (l && l.length > 2 && l[1] && l[2]) {
|
|
1010
1010
|
const u = l[1], i = l[2].replace(/Idx_/g, "").split("_"), c = e.formRules.value;
|
|
1011
1011
|
if (c && i.length > 0) {
|
|
1012
|
-
const
|
|
1012
|
+
const p = {};
|
|
1013
1013
|
i.forEach((v) => {
|
|
1014
|
-
c[v] && (
|
|
1014
|
+
c[v] && (p[v] = [
|
|
1015
1015
|
{
|
|
1016
1016
|
field: v,
|
|
1017
1017
|
fieldValue: u,
|
|
1018
1018
|
message: "数据重复"
|
|
1019
1019
|
}
|
|
1020
1020
|
]);
|
|
1021
|
-
}), Object.keys(
|
|
1021
|
+
}), Object.keys(p).length > 0 && (console.error("保存失败!", p), e.ruleResults.value = p);
|
|
1022
1022
|
}
|
|
1023
|
-
|
|
1024
|
-
} else
|
|
1023
|
+
A.error(`保存失败!数据 \`${u}\` 已存在!`);
|
|
1024
|
+
} else A.error((n == null ? void 0 : n.msg) ?? "保存失败!");
|
|
1025
1025
|
e.afterSave && e.afterSave(n);
|
|
1026
1026
|
} else
|
|
1027
|
-
|
|
1027
|
+
A.error((n == null ? void 0 : n.msg) ?? "保存失败!"), e.afterSave && e.afterSave(n);
|
|
1028
1028
|
});
|
|
1029
|
-
},
|
|
1029
|
+
}, Vt = async (e) => {
|
|
1030
1030
|
const t = e.page, a = e.grid;
|
|
1031
1031
|
e.isFormLoading.value = !0;
|
|
1032
1032
|
const s = e.formData.value, n = e.primaryKey ?? t.primaryKey;
|
|
1033
|
-
return
|
|
1034
|
-
e.isFormLoading.value = !1, o &&
|
|
1033
|
+
return la(a, { [n]: s[n] }, e.detailUrl).then((o) => {
|
|
1034
|
+
e.isFormLoading.value = !1, o && oa(e, o);
|
|
1035
1035
|
});
|
|
1036
|
-
},
|
|
1036
|
+
}, Kt = (e) => {
|
|
1037
1037
|
const t = e.grid;
|
|
1038
|
-
t && (t.rowData.value = void 0), e && (
|
|
1038
|
+
t && (t.rowData.value = void 0), e && (je(e), e.visible && (e.visible.value = !1), setTimeout(() => {
|
|
1039
1039
|
e.visible.value = !0;
|
|
1040
1040
|
}, 1));
|
|
1041
|
-
},
|
|
1042
|
-
|
|
1041
|
+
}, oa = (e, t) => {
|
|
1042
|
+
je(e);
|
|
1043
1043
|
const a = { ...e.formData.value, ...t };
|
|
1044
1044
|
e.formData.value = JSON.parse(JSON.stringify(a));
|
|
1045
|
-
},
|
|
1046
|
-
e.formData.value = e.default ? JSON.parse(JSON.stringify(e.default)) : {},
|
|
1047
|
-
},
|
|
1048
|
-
const a =
|
|
1049
|
-
return e.filter((n) => n.role && !a.hasRole(n.role) || n.permit && !a.hasPermit(
|
|
1045
|
+
}, je = (e) => {
|
|
1046
|
+
e.formData.value = e.default ? JSON.parse(JSON.stringify(e.default)) : {}, Je(e);
|
|
1047
|
+
}, Qt = (e, t) => {
|
|
1048
|
+
const a = _();
|
|
1049
|
+
return e.filter((n) => n.role && !a.hasRole(n.role) || n.permit && !a.hasPermit(xe.currentRoute.value.path, n.permit) || n.enabled === !1 ? !1 : typeof n.enabled == "function" ? n.enabled() : !0).filter((n) => {
|
|
1050
1050
|
if (!t) {
|
|
1051
1051
|
if (n.visible === !1)
|
|
1052
1052
|
return !1;
|
|
@@ -1055,7 +1055,7 @@ const Lt = (e) => {
|
|
|
1055
1055
|
}
|
|
1056
1056
|
return !0;
|
|
1057
1057
|
});
|
|
1058
|
-
},
|
|
1058
|
+
}, Jt = (e, t) => {
|
|
1059
1059
|
const a = t == null ? void 0 : t.filter((s) => {
|
|
1060
1060
|
const n = e.find(
|
|
1061
1061
|
(o) => o.dataIndex === s.dataIndex || o.key === s.key || o.title === s.title
|
|
@@ -1063,17 +1063,17 @@ const Lt = (e) => {
|
|
|
1063
1063
|
return n ? { ...s, ...n } : !1;
|
|
1064
1064
|
});
|
|
1065
1065
|
return [...a || [], ...e.filter((s) => !(a != null && a.includes(s)))];
|
|
1066
|
-
},
|
|
1066
|
+
}, Xa = (e) => (e.remotePage = !1, ia(e).then((t) => t.rows)), ia = (e) => {
|
|
1067
1067
|
e.gridQuery || (e.gridQuery = {});
|
|
1068
1068
|
const t = e.remotePage ? "find" : "list";
|
|
1069
|
-
return
|
|
1069
|
+
return Qe(e, {
|
|
1070
1070
|
urlKey: t,
|
|
1071
1071
|
url: e.gridUrl,
|
|
1072
1072
|
params: e.gridQuery,
|
|
1073
1073
|
loadingState: e.isGridLoading,
|
|
1074
1074
|
processParams: (a) => {
|
|
1075
1075
|
var n;
|
|
1076
|
-
return e.remotePage && (a.Query.$limit = [(e.pageNo.value - 1) * e.pageSize.value, e.pageSize.value]),
|
|
1076
|
+
return e.remotePage && (a.Query.$limit = [(e.pageNo.value - 1) * e.pageSize.value, e.pageSize.value]), ce((n = e.gridUrl) == null ? void 0 : n.params, a, e.gridQuery);
|
|
1077
1077
|
}
|
|
1078
1078
|
}).then((a) => {
|
|
1079
1079
|
if ((a == null ? void 0 : a.status) === T.SUCCESS) {
|
|
@@ -1091,7 +1091,7 @@ const Lt = (e) => {
|
|
|
1091
1091
|
rows: []
|
|
1092
1092
|
};
|
|
1093
1093
|
});
|
|
1094
|
-
},
|
|
1094
|
+
}, Za = (e, t, a = {}) => na(e, {
|
|
1095
1095
|
urlKey: "update",
|
|
1096
1096
|
url: e.updateUrl,
|
|
1097
1097
|
params: {
|
|
@@ -1102,37 +1102,37 @@ const Lt = (e) => {
|
|
|
1102
1102
|
...a
|
|
1103
1103
|
}).then((s) => ((s == null ? void 0 : s.status) === T.SUCCESS && setTimeout(() => {
|
|
1104
1104
|
e.reload.value = !0, e.afterUpdate && e.afterUpdate(t);
|
|
1105
|
-
}, 50), s)),
|
|
1105
|
+
}, 50), s)), jt = (e, t) => {
|
|
1106
1106
|
const a = {};
|
|
1107
|
-
return a[e.primaryKey] = t[e.primaryKey], a[e.statusKey] = t[e.statusKey],
|
|
1107
|
+
return a[e.primaryKey] = t[e.primaryKey], a[e.statusKey] = t[e.statusKey], Za(e, a, {
|
|
1108
1108
|
loadingText: !1,
|
|
1109
1109
|
hideErrorToast: !0
|
|
1110
1110
|
});
|
|
1111
|
-
},
|
|
1111
|
+
}, la = async (e, t, a) => await Qe(e, {
|
|
1112
1112
|
urlKey: "detail",
|
|
1113
1113
|
url: a,
|
|
1114
1114
|
params: t,
|
|
1115
1115
|
loadingState: e.isGridLoading
|
|
1116
|
-
}),
|
|
1116
|
+
}), Gt = (e, t) => {
|
|
1117
1117
|
const a = t;
|
|
1118
|
-
return
|
|
1119
|
-
},
|
|
1118
|
+
return la(e, { [e.primaryKey]: a[e.primaryKey] }).then((s) => ((s == null ? void 0 : s.status) === T.SUCCESS && s.data && (e.expandRows.value[a[e.primaryKey]] = s), s));
|
|
1119
|
+
}, Wt = (e, t) => {
|
|
1120
1120
|
let a = e.editor;
|
|
1121
|
-
e.rowData.value = t, a && (
|
|
1122
|
-
},
|
|
1121
|
+
e.rowData.value = t, a && (oa(a, t), a.visible.value = !0);
|
|
1122
|
+
}, qt = (e, t) => Ba(e, t, {
|
|
1123
1123
|
url: e.deleteUrl,
|
|
1124
1124
|
primaryKey: e.primaryKey
|
|
1125
1125
|
}).then((a) => ((a == null ? void 0 : a.status) === T.SUCCESS && setTimeout(() => {
|
|
1126
1126
|
e.reload.value = !0, e.afterDelete && !Array.isArray(t) && e.afterDelete(t);
|
|
1127
1127
|
}, 50), a));
|
|
1128
|
-
var
|
|
1129
|
-
class
|
|
1128
|
+
var De = /* @__PURE__ */ ((e) => (e.SelectReload = "Select.Reload", e.RadioReload = "Radio.Reload", e.CheckboxReload = "Checkbox.Reload", e.TreeSelectReload = "TreeSelect.Reload", e.TreeCheckReload = "TreeCheck.Reload", e))(De || {});
|
|
1129
|
+
class et {
|
|
1130
1130
|
constructor() {
|
|
1131
1131
|
$(this, "listeners", {});
|
|
1132
1132
|
}
|
|
1133
1133
|
// 检查事件名是否符合前缀
|
|
1134
1134
|
isValidPrefix(t) {
|
|
1135
|
-
return Object.values(
|
|
1135
|
+
return Object.values(De).some((a) => t.startsWith(a + "."));
|
|
1136
1136
|
}
|
|
1137
1137
|
/**
|
|
1138
1138
|
* 事件订阅
|
|
@@ -1141,7 +1141,7 @@ class Za {
|
|
|
1141
1141
|
*/
|
|
1142
1142
|
on(t, a) {
|
|
1143
1143
|
if (!this.isValidPrefix(t)) {
|
|
1144
|
-
console.error(`事件前缀不正确: ${t}, 事件名必须以 ${Object.values(
|
|
1144
|
+
console.error(`事件前缀不正确: ${t}, 事件名必须以 ${Object.values(De).join(", ")} 开头`);
|
|
1145
1145
|
return;
|
|
1146
1146
|
}
|
|
1147
1147
|
this.listeners[t] || (this.listeners[t] = []), this.listeners[t].push(a);
|
|
@@ -1172,51 +1172,51 @@ class Za {
|
|
|
1172
1172
|
this.listeners[t] && this.listeners[t].forEach((s) => s(t, ...a));
|
|
1173
1173
|
}
|
|
1174
1174
|
}
|
|
1175
|
-
const
|
|
1175
|
+
const B = new et(), ee = (e, t, a) => {
|
|
1176
1176
|
if (t.inputFactory && (a != null && a.reloadEvent)) {
|
|
1177
1177
|
const s = t.inputFactory.value;
|
|
1178
1178
|
s.reloadHandler = (n, o) => {
|
|
1179
|
-
|
|
1180
|
-
},
|
|
1179
|
+
at(t.url, t, o);
|
|
1180
|
+
}, B.on(a.reloadEvent, s.reloadHandler);
|
|
1181
1181
|
}
|
|
1182
1182
|
if (a != null && a.data)
|
|
1183
1183
|
g(
|
|
1184
1184
|
() => a.data,
|
|
1185
1185
|
() => {
|
|
1186
|
-
|
|
1186
|
+
Ge(t, a.data, !0);
|
|
1187
1187
|
},
|
|
1188
1188
|
{ deep: !0, immediate: !0 }
|
|
1189
1189
|
);
|
|
1190
1190
|
else if (t.url && t.url.url)
|
|
1191
|
-
e &&
|
|
1191
|
+
e && ua(t.url, t, t.params ?? {});
|
|
1192
1192
|
else {
|
|
1193
|
-
const s = f(
|
|
1194
|
-
|
|
1193
|
+
const s = f(se(U.LabelText, ""));
|
|
1194
|
+
A.error("`" + s.value + "` 未配置选项数据!", {
|
|
1195
1195
|
duration: 5e3
|
|
1196
1196
|
});
|
|
1197
1197
|
}
|
|
1198
|
-
},
|
|
1198
|
+
}, Ge = (e, t, a) => {
|
|
1199
1199
|
if (a) {
|
|
1200
1200
|
const s = {
|
|
1201
1201
|
...e.fieldMap
|
|
1202
1202
|
};
|
|
1203
|
-
t =
|
|
1203
|
+
t = La(s, t);
|
|
1204
1204
|
}
|
|
1205
1205
|
t = JSON.parse(JSON.stringify(t ?? [])), e.all && t.unshift({
|
|
1206
1206
|
label: "全部",
|
|
1207
1207
|
value: e.allValue ?? void 0
|
|
1208
1208
|
}), e.options.value = t;
|
|
1209
|
-
},
|
|
1210
|
-
Array.isArray(a) ?
|
|
1209
|
+
}, at = (e, t, a) => {
|
|
1210
|
+
Array.isArray(a) ? Ge(t, a, !0) : ua(e, t, a);
|
|
1211
1211
|
}, de = (e, t) => {
|
|
1212
1212
|
var a;
|
|
1213
|
-
(a = e.inputFactory) != null && a.value && t.reloadEvent && e.inputFactory.value.reloadHandler &&
|
|
1214
|
-
},
|
|
1215
|
-
const s = JSON.parse(JSON.stringify(e.params ?? {})), n = JSON.parse(JSON.stringify(t.params ?? {})), o =
|
|
1216
|
-
|
|
1217
|
-
|
|
1213
|
+
(a = e.inputFactory) != null && a.value && t.reloadEvent && e.inputFactory.value.reloadHandler && B.off(t.reloadEvent, e.inputFactory.value.reloadHandler);
|
|
1214
|
+
}, ua = (e, t, a) => {
|
|
1215
|
+
const s = JSON.parse(JSON.stringify(e.params ?? {})), n = JSON.parse(JSON.stringify(t.params ?? {})), o = ce(s, n, a);
|
|
1216
|
+
tt(e, t, t.fieldMap, o).then((r) => {
|
|
1217
|
+
Ge(t, r, !1);
|
|
1218
1218
|
});
|
|
1219
|
-
},
|
|
1219
|
+
}, tt = (e, t, a, s) => {
|
|
1220
1220
|
const { fieldMap: n, ...o } = e, l = {
|
|
1221
1221
|
...{
|
|
1222
1222
|
url: "",
|
|
@@ -1228,19 +1228,19 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1228
1228
|
},
|
|
1229
1229
|
...o
|
|
1230
1230
|
};
|
|
1231
|
-
return l.loadingText = !1, s || (s = {}), s.Query || (s.Query = {}), t.optionQuery = s, t.isOptionLoading.value = !0,
|
|
1231
|
+
return l.loadingText = !1, s || (s = {}), s.Query || (s.Query = {}), t.optionQuery = s, t.isOptionLoading.value = !0, G(l, s).then((u) => {
|
|
1232
1232
|
if ((u == null ? void 0 : u.status) === T.SUCCESS) {
|
|
1233
1233
|
if (u.data)
|
|
1234
1234
|
return u.data;
|
|
1235
|
-
} else if ((u == null ? void 0 : u.errno) ==
|
|
1236
|
-
|
|
1235
|
+
} else if ((u == null ? void 0 : u.errno) == we) {
|
|
1236
|
+
_().logout(!1);
|
|
1237
1237
|
return;
|
|
1238
1238
|
}
|
|
1239
1239
|
return [];
|
|
1240
1240
|
}).finally(() => {
|
|
1241
1241
|
t.isOptionLoading.value = !1;
|
|
1242
1242
|
});
|
|
1243
|
-
},
|
|
1243
|
+
}, st = (e, t, a) => {
|
|
1244
1244
|
if (e === void 0) return;
|
|
1245
1245
|
const s = (o) => {
|
|
1246
1246
|
const r = { ...o };
|
|
@@ -1260,7 +1260,7 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1260
1260
|
const o = n([e], t);
|
|
1261
1261
|
return o.length > 0 ? o[0] : void 0;
|
|
1262
1262
|
}
|
|
1263
|
-
}, Te = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((t) => t.label) : [e.label],
|
|
1263
|
+
}, Te = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((t) => t.label) : [e.label], te = (e, t, a) => {
|
|
1264
1264
|
const s = t.split(".");
|
|
1265
1265
|
let n = e;
|
|
1266
1266
|
for (let o = 0; o < s.length - 1; o++) {
|
|
@@ -1268,10 +1268,10 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1268
1268
|
n[r] || (n[r] = {}), n = n[r];
|
|
1269
1269
|
}
|
|
1270
1270
|
n[s[s.length - 1]] = a;
|
|
1271
|
-
},
|
|
1271
|
+
}, ca = (e, t, a) => {
|
|
1272
1272
|
if (a == null) {
|
|
1273
1273
|
Object.entries(t).forEach(([s]) => {
|
|
1274
|
-
|
|
1274
|
+
te(e, s, a);
|
|
1275
1275
|
});
|
|
1276
1276
|
return;
|
|
1277
1277
|
}
|
|
@@ -1281,10 +1281,10 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1281
1281
|
try {
|
|
1282
1282
|
const l = parseInt(((r = n.match(/\$\{(\d+)\}/)) == null ? void 0 : r[1]) ?? "0"), u = a[l], i = n.replace(/\$\{\d+\}\./, "");
|
|
1283
1283
|
if (i && u) {
|
|
1284
|
-
const c =
|
|
1285
|
-
|
|
1284
|
+
const c = Se(i, u);
|
|
1285
|
+
te(e, s, c);
|
|
1286
1286
|
} else
|
|
1287
|
-
|
|
1287
|
+
te(e, s, u);
|
|
1288
1288
|
} catch {
|
|
1289
1289
|
console.error("outFields 格式错误:" + n, "必须是 ${index} 或者 ${index}.${key}");
|
|
1290
1290
|
}
|
|
@@ -1292,42 +1292,42 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1292
1292
|
console.error("outFields 格式错误:" + n, "必须是 ${index} 或者 ${index}.${key}");
|
|
1293
1293
|
}) : Object.entries(t).forEach(([s, n]) => {
|
|
1294
1294
|
if (n.includes("${")) {
|
|
1295
|
-
const o =
|
|
1296
|
-
|
|
1295
|
+
const o = Se(n, a);
|
|
1296
|
+
te(e, s, o);
|
|
1297
1297
|
} else
|
|
1298
|
-
|
|
1298
|
+
te(e, s, a[n]);
|
|
1299
1299
|
});
|
|
1300
|
-
},
|
|
1300
|
+
}, Pe = (e, t, a) => {
|
|
1301
1301
|
var o, r;
|
|
1302
1302
|
const s = (o = e.inputFactory) == null ? void 0 : o.value;
|
|
1303
|
-
s != null && s.editorCtrl && ((r = s.errInfo) != null && r.value.errClass) &&
|
|
1304
|
-
const n =
|
|
1305
|
-
if (e.selectedOptions.value = n, t.formData && t.outFields &&
|
|
1303
|
+
s != null && s.editorCtrl && ((r = s.errInfo) != null && r.value.errClass) && pe(s.editorCtrl), e.selected.value = a;
|
|
1304
|
+
const n = st(a, e.options.value);
|
|
1305
|
+
if (e.selectedOptions.value = n, t.formData && t.outFields && ca(t.formData, t.outFields, n), t.changeEvent) {
|
|
1306
1306
|
const [l, u] = t.changeEvent;
|
|
1307
1307
|
if (u)
|
|
1308
1308
|
if (Array.isArray(l))
|
|
1309
1309
|
l.every((i) => {
|
|
1310
|
-
const c =
|
|
1310
|
+
const c = Se(u, { selectedValues: a });
|
|
1311
1311
|
try {
|
|
1312
|
-
const
|
|
1313
|
-
|
|
1314
|
-
} catch (
|
|
1315
|
-
console.error("eventParamsValue: ", c,
|
|
1312
|
+
const p = JSON.parse(c);
|
|
1313
|
+
B.emit(i, p, a, n);
|
|
1314
|
+
} catch (p) {
|
|
1315
|
+
console.error("eventParamsValue: ", c, p);
|
|
1316
1316
|
}
|
|
1317
1317
|
});
|
|
1318
1318
|
else {
|
|
1319
|
-
const i =
|
|
1319
|
+
const i = Se(u, { selectedValues: a });
|
|
1320
1320
|
try {
|
|
1321
1321
|
const c = JSON.parse(i);
|
|
1322
|
-
|
|
1322
|
+
B.emit(l, c, a, n);
|
|
1323
1323
|
} catch (c) {
|
|
1324
1324
|
console.error("eventParamsValue: ", i, c);
|
|
1325
1325
|
}
|
|
1326
1326
|
}
|
|
1327
1327
|
else
|
|
1328
1328
|
Array.isArray(l) ? l.every((i) => {
|
|
1329
|
-
|
|
1330
|
-
}) :
|
|
1329
|
+
B.emit(i, n, a);
|
|
1330
|
+
}) : B.emit(l, n, a);
|
|
1331
1331
|
}
|
|
1332
1332
|
return s != null && s.inputEmit && s.inputEmit("change", a, n), n;
|
|
1333
1333
|
}, S = {
|
|
@@ -1368,7 +1368,7 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1368
1368
|
value: "Id"
|
|
1369
1369
|
}
|
|
1370
1370
|
}
|
|
1371
|
-
},
|
|
1371
|
+
}, Bt = (e) => {
|
|
1372
1372
|
S.PageOption = {
|
|
1373
1373
|
...S.PageOption,
|
|
1374
1374
|
...e.pageOption
|
|
@@ -1382,10 +1382,10 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1382
1382
|
...S.TreeOption,
|
|
1383
1383
|
...e.treeOption
|
|
1384
1384
|
};
|
|
1385
|
-
},
|
|
1385
|
+
}, ke = (e) => {
|
|
1386
1386
|
for (let t in e.urls)
|
|
1387
1387
|
e.urls[t].api || (e.urls[t].api = e.api), e.urls[t].authorize === void 0 && (e.urls[t].authorize = e.authorize);
|
|
1388
|
-
},
|
|
1388
|
+
}, nt = (e, t, a, s) => (ke(e), {
|
|
1389
1389
|
editorCtrl: {
|
|
1390
1390
|
...S.EditorOption,
|
|
1391
1391
|
name: "",
|
|
@@ -1401,8 +1401,8 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1401
1401
|
isFormSaving: f(!1),
|
|
1402
1402
|
isFormLoading: f(!1)
|
|
1403
1403
|
}
|
|
1404
|
-
}),
|
|
1405
|
-
|
|
1404
|
+
}), rt = (e, t, a) => {
|
|
1405
|
+
ke(e);
|
|
1406
1406
|
const s = {
|
|
1407
1407
|
...S.GridOption,
|
|
1408
1408
|
tableSize: f(S.GridOption.tableSize.value),
|
|
@@ -1422,7 +1422,7 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1422
1422
|
selectRows: f([]),
|
|
1423
1423
|
rowData: f(void 0),
|
|
1424
1424
|
gridQuery: {},
|
|
1425
|
-
tableData:
|
|
1425
|
+
tableData: Q(void 0),
|
|
1426
1426
|
expandRows: f({}),
|
|
1427
1427
|
isGridLoading: f(!1),
|
|
1428
1428
|
isGridSaving: f(!1),
|
|
@@ -1435,20 +1435,20 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1435
1435
|
(n) => {
|
|
1436
1436
|
n && (setTimeout(() => {
|
|
1437
1437
|
s.reload.value = !1;
|
|
1438
|
-
}, 1), s.remotePage ?
|
|
1438
|
+
}, 1), s.remotePage ? ia(s) : Xa(s));
|
|
1439
1439
|
}
|
|
1440
1440
|
), {
|
|
1441
1441
|
gridCtrl: s
|
|
1442
1442
|
};
|
|
1443
|
-
},
|
|
1444
|
-
|
|
1443
|
+
}, zt = (e, t) => {
|
|
1444
|
+
ke(e);
|
|
1445
1445
|
const a = {
|
|
1446
1446
|
...S.TreeOption,
|
|
1447
1447
|
reload: f(!1),
|
|
1448
1448
|
page: t,
|
|
1449
1449
|
node: f(void 0),
|
|
1450
1450
|
url: e.urls.tree,
|
|
1451
|
-
data:
|
|
1451
|
+
data: Q(void 0),
|
|
1452
1452
|
isTreeLoading: f(!1)
|
|
1453
1453
|
};
|
|
1454
1454
|
return g(
|
|
@@ -1456,18 +1456,18 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1456
1456
|
(s) => {
|
|
1457
1457
|
s && (setTimeout(() => {
|
|
1458
1458
|
a.reload.value = !1;
|
|
1459
|
-
}, 1),
|
|
1459
|
+
}, 1), za(a));
|
|
1460
1460
|
}
|
|
1461
1461
|
), {
|
|
1462
1462
|
treeCtrl: a
|
|
1463
1463
|
};
|
|
1464
|
-
},
|
|
1464
|
+
}, he = (e, t) => {
|
|
1465
1465
|
const a = {
|
|
1466
1466
|
...S.OptionOption,
|
|
1467
1467
|
url: e,
|
|
1468
1468
|
reload: f(!1),
|
|
1469
1469
|
optionQuery: {},
|
|
1470
|
-
data:
|
|
1470
|
+
data: Q([]),
|
|
1471
1471
|
selected: f([]),
|
|
1472
1472
|
selectedOptions: f([]),
|
|
1473
1473
|
options: f([]),
|
|
@@ -1478,30 +1478,30 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1478
1478
|
(s) => {
|
|
1479
1479
|
s && (setTimeout(() => {
|
|
1480
1480
|
a.reload.value = !1;
|
|
1481
|
-
}, 1),
|
|
1481
|
+
}, 1), ee(!0, a, t));
|
|
1482
1482
|
}
|
|
1483
1483
|
), {
|
|
1484
1484
|
optionCtrl: a
|
|
1485
1485
|
};
|
|
1486
|
-
},
|
|
1487
|
-
|
|
1486
|
+
}, Ct = (e, t, a) => {
|
|
1487
|
+
ke(e);
|
|
1488
1488
|
const s = {
|
|
1489
1489
|
...S.PageOption,
|
|
1490
1490
|
...e
|
|
1491
|
-
}, { editorCtrl: n } =
|
|
1491
|
+
}, { editorCtrl: n } = nt(e, s, t, a), { gridCtrl: o } = rt(e, s);
|
|
1492
1492
|
return s.editor = n, s.grid = o, o.editor = n, o.tools = ["Reload", "RowHeight", "TableHeadset", "Fullscreen"], n.grid = o, {
|
|
1493
1493
|
pageCtrl: s,
|
|
1494
1494
|
editorCtrl: n,
|
|
1495
1495
|
gridCtrl: o
|
|
1496
1496
|
};
|
|
1497
|
-
},
|
|
1497
|
+
}, ot = 7 * 24 * 60 * 60 * 1e3, Fe = /* @__PURE__ */ new Map(), Ye = /* @__PURE__ */ new Set(), j = f({}), Yt = j, Xt = (e) => {
|
|
1498
1498
|
var n;
|
|
1499
1499
|
if (!e.iconUrl) return Ne;
|
|
1500
1500
|
const t = f(!0), a = f("");
|
|
1501
1501
|
let s = !0;
|
|
1502
|
-
return (n = e.icons) != null && n.length && (s = e.icons.every((o) =>
|
|
1503
|
-
|
|
1504
|
-
}),
|
|
1502
|
+
return (n = e.icons) != null && n.length && (s = e.icons.every((o) => j.value[o] !== void 0)), (e.icon && !j.value[e.icon] || !s) && it(e, t).then(() => {
|
|
1503
|
+
ct(e.iconUrl, e.monoColor || !1), t.value = !0;
|
|
1504
|
+
}), Z({
|
|
1505
1505
|
props: {
|
|
1506
1506
|
icon: {
|
|
1507
1507
|
type: String
|
|
@@ -1540,21 +1540,21 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1540
1540
|
), g(
|
|
1541
1541
|
() => u.value,
|
|
1542
1542
|
(c) => {
|
|
1543
|
-
o.icons && (c >= o.icons.length && (u.value = 0), l.value = o.icons[u.value],
|
|
1543
|
+
o.icons && (c >= o.icons.length && (u.value = 0), l.value = o.icons[u.value], ve(a, l, l.value), r("update:iconIndex", u.value));
|
|
1544
1544
|
},
|
|
1545
1545
|
{ immediate: !0 }
|
|
1546
1546
|
), g(
|
|
1547
|
-
() =>
|
|
1547
|
+
() => j.value,
|
|
1548
1548
|
() => {
|
|
1549
|
-
|
|
1549
|
+
ve(a, l, l.value);
|
|
1550
1550
|
},
|
|
1551
1551
|
{ deep: !0 }
|
|
1552
1552
|
), g(
|
|
1553
1553
|
() => o.icon,
|
|
1554
1554
|
(c) => {
|
|
1555
|
-
|
|
1555
|
+
ve(a, l, c);
|
|
1556
1556
|
}
|
|
1557
|
-
),
|
|
1557
|
+
), ve(a, l, l.value), { isLoaded: t, Icon: a, handleClick: i };
|
|
1558
1558
|
},
|
|
1559
1559
|
render() {
|
|
1560
1560
|
if (!t.value)
|
|
@@ -1562,36 +1562,36 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1562
1562
|
let o = this.class, r = "";
|
|
1563
1563
|
Array.isArray(o) ? r = o.join(" ") : typeof o == "string" && (r = o);
|
|
1564
1564
|
let l = [r];
|
|
1565
|
-
return !/\bw-/.test(r) && !/$w-/.test(r) && l.push("w-4"), !/\bh-/.test(r) && !/$h-/.test(r) && l.push("h-4"), a.value ?
|
|
1565
|
+
return !/\bw-/.test(r) && !/$w-/.test(r) && l.push("w-4"), !/\bh-/.test(r) && !/$h-/.test(r) && l.push("h-4"), a.value ? H(Ze(a.value), {
|
|
1566
1566
|
onClick: this.$props.clickable ? this.handleClick : void 0,
|
|
1567
1567
|
class: `${l.join(" ")}`,
|
|
1568
1568
|
style: {
|
|
1569
1569
|
fill: "currentColor",
|
|
1570
1570
|
cursor: this.$props.clickable ? "pointer" : "default",
|
|
1571
|
-
transform:
|
|
1571
|
+
transform: pt(this.angle, this.flip)
|
|
1572
1572
|
}
|
|
1573
|
-
}) :
|
|
1573
|
+
}) : H("div", { class: "w-[14px] h-[14px]" });
|
|
1574
1574
|
}
|
|
1575
1575
|
});
|
|
1576
|
-
},
|
|
1576
|
+
}, it = (e, t) => {
|
|
1577
1577
|
let a = e.iconUrl;
|
|
1578
1578
|
if (!a)
|
|
1579
1579
|
return console.error("图标库地址不能为空"), Promise.resolve();
|
|
1580
1580
|
if (Fe.has(a))
|
|
1581
1581
|
return Promise.resolve();
|
|
1582
|
-
const s =
|
|
1582
|
+
const s = pa(a);
|
|
1583
1583
|
if (s)
|
|
1584
|
-
return new Promise(async (o) => (
|
|
1584
|
+
return new Promise(async (o) => (fa(s.scriptContent), o()));
|
|
1585
1585
|
t.value = !1;
|
|
1586
1586
|
const n = new Promise(async (o) => {
|
|
1587
|
-
await
|
|
1587
|
+
await lt(a, e.monoColor || !1), o(), Fe.delete(a);
|
|
1588
1588
|
});
|
|
1589
1589
|
return Fe.set(a, n), n;
|
|
1590
|
-
},
|
|
1590
|
+
}, lt = async (e, t) => {
|
|
1591
1591
|
try {
|
|
1592
1592
|
const a = await fetch(e);
|
|
1593
1593
|
if (!a.ok) {
|
|
1594
|
-
|
|
1594
|
+
A.error("网络异常,无法加载图标库!");
|
|
1595
1595
|
return;
|
|
1596
1596
|
}
|
|
1597
1597
|
let s = await a.text();
|
|
@@ -1600,27 +1600,27 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1600
1600
|
const o = s.match(n);
|
|
1601
1601
|
if (o && o.length > 1) {
|
|
1602
1602
|
let r = o[1];
|
|
1603
|
-
|
|
1603
|
+
ut(e, r, t, s);
|
|
1604
1604
|
}
|
|
1605
|
-
|
|
1605
|
+
fa(s);
|
|
1606
1606
|
return;
|
|
1607
1607
|
} catch (a) {
|
|
1608
1608
|
return console.error("网络异常,无法加载图标库:", a), null;
|
|
1609
1609
|
}
|
|
1610
|
-
},
|
|
1610
|
+
}, fa = (e) => {
|
|
1611
1611
|
const t = document.createElement("script");
|
|
1612
1612
|
t.textContent = e, document.head.appendChild(t);
|
|
1613
|
-
},
|
|
1613
|
+
}, ut = (e, t, a, s) => {
|
|
1614
1614
|
let n = `icon_cache:${e}`;
|
|
1615
1615
|
const o = {
|
|
1616
1616
|
windowKey: t,
|
|
1617
1617
|
monoColor: a,
|
|
1618
1618
|
scriptContent: s,
|
|
1619
|
-
expireTime: Date.now() +
|
|
1619
|
+
expireTime: Date.now() + ot
|
|
1620
1620
|
// 缓存时间:7天
|
|
1621
1621
|
};
|
|
1622
1622
|
localStorage.setItem(n, JSON.stringify(o));
|
|
1623
|
-
},
|
|
1623
|
+
}, pa = (e) => {
|
|
1624
1624
|
let t = `icon_cache:${e}`;
|
|
1625
1625
|
const a = localStorage.getItem(t);
|
|
1626
1626
|
if (!a) return null;
|
|
@@ -1631,22 +1631,22 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1631
1631
|
return console.error("解析缓存失败:", n), null;
|
|
1632
1632
|
}
|
|
1633
1633
|
return s.expireTime < Date.now() ? (localStorage.removeItem(e), null) : s;
|
|
1634
|
-
},
|
|
1634
|
+
}, Zt = () => {
|
|
1635
1635
|
const e = Date.now();
|
|
1636
1636
|
for (const t in localStorage)
|
|
1637
1637
|
if (t.startsWith("icon_cache:")) {
|
|
1638
1638
|
const a = localStorage.getItem(t);
|
|
1639
1639
|
a && JSON.parse(a).expireTime < e && localStorage.removeItem(t);
|
|
1640
1640
|
}
|
|
1641
|
-
},
|
|
1641
|
+
}, ve = (e, t, a) => {
|
|
1642
1642
|
setTimeout(() => {
|
|
1643
|
-
t.value = a, t.value && (e.value =
|
|
1643
|
+
t.value = a, t.value && (e.value = j.value[t.value]);
|
|
1644
1644
|
}, 1);
|
|
1645
|
-
}, Ne =
|
|
1645
|
+
}, Ne = H(
|
|
1646
1646
|
"svg",
|
|
1647
1647
|
{ class: "w-4 h-4", viewBox: "0 0 50 50", style: { animation: "rotate 2s linear infinite" } },
|
|
1648
1648
|
[
|
|
1649
|
-
|
|
1649
|
+
H("circle", {
|
|
1650
1650
|
cx: "25",
|
|
1651
1651
|
cy: "25",
|
|
1652
1652
|
r: "20",
|
|
@@ -1655,53 +1655,53 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1655
1655
|
style: { strokeWidth: "3 !important" }
|
|
1656
1656
|
// 强制应用线宽
|
|
1657
1657
|
}),
|
|
1658
|
-
|
|
1658
|
+
H("circle", {
|
|
1659
1659
|
cx: "25",
|
|
1660
1660
|
cy: "6",
|
|
1661
1661
|
r: "6",
|
|
1662
1662
|
fill: "currentColor"
|
|
1663
1663
|
})
|
|
1664
1664
|
]
|
|
1665
|
-
),
|
|
1666
|
-
const a =
|
|
1665
|
+
), ct = (e, t) => {
|
|
1666
|
+
const a = pa(e);
|
|
1667
1667
|
Object.keys(window).forEach((s) => {
|
|
1668
|
-
s.startsWith("_iconfont_svg_string_") && (a == null ? void 0 : a.windowKey) === s && !
|
|
1668
|
+
s.startsWith("_iconfont_svg_string_") && (a == null ? void 0 : a.windowKey) === s && !Ye.has(s) && (Ye.add(s), ft(s, t));
|
|
1669
1669
|
});
|
|
1670
|
-
},
|
|
1670
|
+
}, ft = (e, t) => {
|
|
1671
1671
|
const a = window[e], o = new DOMParser().parseFromString(a, "image/svg+xml").getElementsByTagName("symbol"), r = document.querySelectorAll("symbol");
|
|
1672
1672
|
for (const l of o) {
|
|
1673
1673
|
const u = l.id, i = Array.from(r).find((c) => c.id === u);
|
|
1674
1674
|
i && t && (i.innerHTML = l.innerHTML, i.querySelectorAll("*").forEach((c) => {
|
|
1675
1675
|
c.hasAttribute("fill") && c.removeAttribute("fill");
|
|
1676
|
-
})),
|
|
1676
|
+
})), j.value[u] || (j.value[u] = H("svg", { fill: "currentColor" }, [H("use", { "xlink:href": `#${u}` })]));
|
|
1677
1677
|
}
|
|
1678
|
-
},
|
|
1678
|
+
}, pt = (e, t) => {
|
|
1679
1679
|
let a = "";
|
|
1680
1680
|
return e && (a += `rotate(${e}deg)`), t && (a += " scaleX(-1)"), a;
|
|
1681
|
-
},
|
|
1681
|
+
}, es = (e, t, a, s) => {
|
|
1682
1682
|
da(e, [], a, s).forEach((o) => t.push(o));
|
|
1683
1683
|
}, da = (e, t, a, s) => {
|
|
1684
1684
|
var r, l, u, i, c;
|
|
1685
|
-
const n = [], o =
|
|
1686
|
-
for (const
|
|
1687
|
-
if (
|
|
1685
|
+
const n = [], o = _();
|
|
1686
|
+
for (const p of e) {
|
|
1687
|
+
if (p.redirect || p.path.includes("/login") || p.path.includes("/error") || p.path.includes("/:page(.*)") || (l = (r = p.meta) == null ? void 0 : r.roles) != null && l.length && !o.hasRole(p.meta.roles) && (u = p.meta) != null && u.permission && !o.hasPermit(p.meta.permission, ":page"))
|
|
1688
1688
|
continue;
|
|
1689
|
-
const v =
|
|
1689
|
+
const v = p.path.split("/");
|
|
1690
1690
|
v.unshift(...t);
|
|
1691
|
-
const
|
|
1691
|
+
const d = da(p.children || [], v, a, s), O = {
|
|
1692
1692
|
key: v.join("/"),
|
|
1693
|
-
label: ((i =
|
|
1694
|
-
title: ((c =
|
|
1695
|
-
icon:
|
|
1696
|
-
children:
|
|
1693
|
+
label: ((i = p.name) == null ? void 0 : i.toString()) ?? "",
|
|
1694
|
+
title: ((c = p.name) == null ? void 0 : c.toString()) ?? "",
|
|
1695
|
+
icon: p.icon ? H(a, { ...s, icon: p.icon }) : void 0,
|
|
1696
|
+
children: d.length > 0 ? d : void 0
|
|
1697
1697
|
};
|
|
1698
|
-
(
|
|
1698
|
+
(d.length > 0 || !p.children) && n.push(O);
|
|
1699
1699
|
}
|
|
1700
1700
|
return n;
|
|
1701
|
-
},
|
|
1702
|
-
|
|
1703
|
-
const e =
|
|
1704
|
-
let a =
|
|
1701
|
+
}, Xe = ga([]), as = () => {
|
|
1702
|
+
Xe.length = 0;
|
|
1703
|
+
const e = V();
|
|
1704
|
+
let a = Ve().TabActive;
|
|
1705
1705
|
e.matchedRoutes(a).forEach((n, o) => {
|
|
1706
1706
|
var l;
|
|
1707
1707
|
const r = {
|
|
@@ -1709,7 +1709,7 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1709
1709
|
path: n.path,
|
|
1710
1710
|
breadcrumbName: ((l = n.name) == null ? void 0 : l.toString()) ?? ""
|
|
1711
1711
|
};
|
|
1712
|
-
|
|
1712
|
+
Xe.push(r);
|
|
1713
1713
|
});
|
|
1714
1714
|
}, dt = {
|
|
1715
1715
|
host: {
|
|
@@ -1723,7 +1723,7 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1723
1723
|
// 不显示错误
|
|
1724
1724
|
hideErrorToast: !0
|
|
1725
1725
|
}
|
|
1726
|
-
},
|
|
1726
|
+
}, ts = ue("hostInfo", {
|
|
1727
1727
|
state: () => ({
|
|
1728
1728
|
hostInfo: {
|
|
1729
1729
|
Host: "",
|
|
@@ -1754,9 +1754,9 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1754
1754
|
}
|
|
1755
1755
|
let s = (e || this.getSiteHostApi()).trim();
|
|
1756
1756
|
return (!s || s === "/") && (s = window.location.origin), s.endsWith("/") && (s = s.slice(0, -1)), new Promise((n) => {
|
|
1757
|
-
|
|
1757
|
+
Me.SITEHOST_API || (Me.SITEHOST_API = s);
|
|
1758
1758
|
const o = t || window.location.origin;
|
|
1759
|
-
|
|
1759
|
+
G(dt.host, {
|
|
1760
1760
|
Query: {
|
|
1761
1761
|
Host: o
|
|
1762
1762
|
}
|
|
@@ -1794,12 +1794,12 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1794
1794
|
}, this.hostInfo.API_HOST)
|
|
1795
1795
|
for (const t in this.hostInfo.API_HOST) {
|
|
1796
1796
|
let a = this.hostInfo.API_HOST[t];
|
|
1797
|
-
a = a.startsWith("http://") || a.startsWith("https://") || a.startsWith("//") ? a : window.location.origin + a, a.endsWith("/") && (a = a.slice(0, -1)), this.hostInfo.API_HOST[t] = a,
|
|
1797
|
+
a = a.startsWith("http://") || a.startsWith("https://") || a.startsWith("//") ? a : window.location.origin + a, a.endsWith("/") && (a = a.slice(0, -1)), this.hostInfo.API_HOST[t] = a, Me[t] = a;
|
|
1798
1798
|
}
|
|
1799
1799
|
if (this.hostInfo.SERVER_HOST)
|
|
1800
1800
|
for (const t in this.hostInfo.SERVER_HOST) {
|
|
1801
1801
|
let a = this.hostInfo.SERVER_HOST[t];
|
|
1802
|
-
a = a.startsWith("http://") || a.startsWith("https://") || a.startsWith("//") ? a : window.location.origin + a, a.endsWith("/") && (a = a.slice(0, -1)), this.hostInfo.SERVER_HOST[t] = a,
|
|
1802
|
+
a = a.startsWith("http://") || a.startsWith("https://") || a.startsWith("//") ? a : window.location.origin + a, a.endsWith("/") && (a = a.slice(0, -1)), this.hostInfo.SERVER_HOST[t] = a, Ma[t] = a;
|
|
1803
1803
|
}
|
|
1804
1804
|
},
|
|
1805
1805
|
getHostInfo() {
|
|
@@ -1813,7 +1813,100 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1813
1813
|
// storage: localStorage,
|
|
1814
1814
|
// pick: ['hostInfo'],
|
|
1815
1815
|
// },
|
|
1816
|
-
})
|
|
1816
|
+
});
|
|
1817
|
+
class ht {
|
|
1818
|
+
constructor() {
|
|
1819
|
+
this.ensureMicroAppReady();
|
|
1820
|
+
}
|
|
1821
|
+
/**
|
|
1822
|
+
* 确保micro-app环境就绪
|
|
1823
|
+
*/
|
|
1824
|
+
ensureMicroAppReady() {
|
|
1825
|
+
if (typeof window > "u")
|
|
1826
|
+
throw new Error("MicroAppSDK can only be used in browser environment");
|
|
1827
|
+
}
|
|
1828
|
+
/**
|
|
1829
|
+
* 获取基座API
|
|
1830
|
+
*/
|
|
1831
|
+
getMainApis() {
|
|
1832
|
+
if (this.isInMicroApp() && window.microApp && window.microApp.getData) {
|
|
1833
|
+
const t = window.microApp.getData();
|
|
1834
|
+
return (t == null ? void 0 : t.MainApis) || {};
|
|
1835
|
+
}
|
|
1836
|
+
return {};
|
|
1837
|
+
}
|
|
1838
|
+
/**
|
|
1839
|
+
* 检查是否在微前端环境中
|
|
1840
|
+
*/
|
|
1841
|
+
isInMicroApp() {
|
|
1842
|
+
return !!window.microApp;
|
|
1843
|
+
}
|
|
1844
|
+
/**
|
|
1845
|
+
* API调用包装器
|
|
1846
|
+
*/
|
|
1847
|
+
async callMainApi(t, a) {
|
|
1848
|
+
const n = this.getMainApis()[t];
|
|
1849
|
+
if (!n)
|
|
1850
|
+
throw new Error(`Main API method '${t}' is not available`);
|
|
1851
|
+
try {
|
|
1852
|
+
return a !== void 0 ? await n(a) : await n();
|
|
1853
|
+
} catch (o) {
|
|
1854
|
+
throw console.error(`Failed to call main API '${t}':`, o), o;
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
/**
|
|
1858
|
+
* 获取应用信息
|
|
1859
|
+
*/
|
|
1860
|
+
async getAppInfo() {
|
|
1861
|
+
return this.callMainApi("getAppInfo");
|
|
1862
|
+
}
|
|
1863
|
+
/**
|
|
1864
|
+
* 获取主机信息
|
|
1865
|
+
*/
|
|
1866
|
+
async getHostInfo() {
|
|
1867
|
+
return this.callMainApi("getHostInfo");
|
|
1868
|
+
}
|
|
1869
|
+
/**
|
|
1870
|
+
* 获取用户信息
|
|
1871
|
+
*/
|
|
1872
|
+
async getUserInfo() {
|
|
1873
|
+
return this.callMainApi("getUserInfo");
|
|
1874
|
+
}
|
|
1875
|
+
/**
|
|
1876
|
+
* 获取授权令牌
|
|
1877
|
+
*/
|
|
1878
|
+
async getToken() {
|
|
1879
|
+
return this.callMainApi("getToken");
|
|
1880
|
+
}
|
|
1881
|
+
/**
|
|
1882
|
+
* 用户登录
|
|
1883
|
+
*/
|
|
1884
|
+
async userLogin(t) {
|
|
1885
|
+
return this.callMainApi("userLogin", t);
|
|
1886
|
+
}
|
|
1887
|
+
/**
|
|
1888
|
+
* 用户登出
|
|
1889
|
+
*/
|
|
1890
|
+
async userLogout() {
|
|
1891
|
+
return this.callMainApi("userLogout");
|
|
1892
|
+
}
|
|
1893
|
+
/**
|
|
1894
|
+
* 主应用推送
|
|
1895
|
+
*/
|
|
1896
|
+
async mainAppPush(t) {
|
|
1897
|
+
return this.callMainApi("mainAppPush", t);
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
const x = new ht(), ss = {
|
|
1901
|
+
getAppInfo: x.getAppInfo.bind(x),
|
|
1902
|
+
getHostInfo: x.getHostInfo.bind(x),
|
|
1903
|
+
getUserInfo: x.getUserInfo.bind(x),
|
|
1904
|
+
getToken: x.getToken.bind(x),
|
|
1905
|
+
userLogin: x.userLogin.bind(x),
|
|
1906
|
+
userLogout: x.userLogout.bind(x),
|
|
1907
|
+
mainAppPush: x.mainAppPush.bind(x),
|
|
1908
|
+
isInMicroApp: x.isInMicroApp.bind(x)
|
|
1909
|
+
}, ns = ue("settingInfo", {
|
|
1817
1910
|
state: () => ({
|
|
1818
1911
|
fullscreen: !1,
|
|
1819
1912
|
menuCollapse: !1,
|
|
@@ -1855,10 +1948,10 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1855
1948
|
}
|
|
1856
1949
|
},
|
|
1857
1950
|
persist: !1
|
|
1858
|
-
}),
|
|
1951
|
+
}), rs = /* @__PURE__ */ Z({
|
|
1859
1952
|
__name: "index",
|
|
1860
1953
|
props: {
|
|
1861
|
-
...
|
|
1954
|
+
...fe,
|
|
1862
1955
|
/**
|
|
1863
1956
|
* 选择项数据
|
|
1864
1957
|
*/
|
|
@@ -1869,33 +1962,33 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1869
1962
|
},
|
|
1870
1963
|
emits: ["change"],
|
|
1871
1964
|
setup(e, { emit: t }) {
|
|
1872
|
-
const a = e, s =
|
|
1873
|
-
o.inputFactory =
|
|
1965
|
+
const a = e, s = X(), n = he(a.url, a), o = a.optionCtrl ?? n.optionCtrl;
|
|
1966
|
+
o.inputFactory = Q(s);
|
|
1874
1967
|
const r = f([]);
|
|
1875
1968
|
o && g(
|
|
1876
1969
|
() => o.options.value,
|
|
1877
|
-
(
|
|
1878
|
-
r.value =
|
|
1970
|
+
(p) => {
|
|
1971
|
+
r.value = p || [];
|
|
1879
1972
|
},
|
|
1880
1973
|
{ immediate: !0, deep: !0 }
|
|
1881
1974
|
);
|
|
1882
|
-
const l = t, { editorCtrl: u, errInfo: i } =
|
|
1883
|
-
i != null && i.value.errClass && u &&
|
|
1975
|
+
const l = t, { editorCtrl: u, errInfo: i } = X(), c = (p) => {
|
|
1976
|
+
i != null && i.value.errClass && u && pe(u), l("change", p);
|
|
1884
1977
|
};
|
|
1885
|
-
return
|
|
1978
|
+
return be(() => {
|
|
1886
1979
|
if (!a.data || a.data.length != 2) {
|
|
1887
|
-
console.error("Switch组件: ", a.data),
|
|
1980
|
+
console.error("Switch组件: ", a.data), A.error("Switch组件必须有且只有两个选项");
|
|
1888
1981
|
return;
|
|
1889
1982
|
}
|
|
1890
|
-
o &&
|
|
1891
|
-
}),
|
|
1983
|
+
o && ee(o.autoload, o, a);
|
|
1984
|
+
}), ie(() => {
|
|
1892
1985
|
o && de(o, a);
|
|
1893
|
-
}), (
|
|
1894
|
-
var
|
|
1895
|
-
return r.value.length === 2 ? (
|
|
1986
|
+
}), (p, v) => {
|
|
1987
|
+
var d;
|
|
1988
|
+
return r.value.length === 2 ? (w(), Ie(b(Sa), le({
|
|
1896
1989
|
key: 0,
|
|
1897
1990
|
class: [
|
|
1898
|
-
((
|
|
1991
|
+
((d = b(i)) == null ? void 0 : d.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : "",
|
|
1899
1992
|
"bg-blue-300",
|
|
1900
1993
|
"w-[58px]"
|
|
1901
1994
|
],
|
|
@@ -1904,14 +1997,14 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1904
1997
|
unCheckedChildren: r.value[1].label,
|
|
1905
1998
|
unCheckedValue: r.value[1].value,
|
|
1906
1999
|
onChange: c
|
|
1907
|
-
},
|
|
2000
|
+
}, p.$attrs), null, 16, ["class", "checkedChildren", "checkedValue", "unCheckedChildren", "unCheckedValue"])) : z("", !0);
|
|
1908
2001
|
};
|
|
1909
2002
|
}
|
|
1910
|
-
}),
|
|
2003
|
+
}), os = /* @__PURE__ */ Z({
|
|
1911
2004
|
inheritAttrs: !1,
|
|
1912
2005
|
__name: "index",
|
|
1913
2006
|
props: {
|
|
1914
|
-
...
|
|
2007
|
+
...fe,
|
|
1915
2008
|
value: {
|
|
1916
2009
|
type: [String, Number, Array, null],
|
|
1917
2010
|
default: void 0
|
|
@@ -1928,8 +2021,8 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1928
2021
|
},
|
|
1929
2022
|
emits: ["update:value", "select", "change", "update:labels"],
|
|
1930
2023
|
setup(e, { emit: t }) {
|
|
1931
|
-
const a = e, s =
|
|
1932
|
-
r.inputFactory =
|
|
2024
|
+
const a = e, s = Ae(), n = X(), o = he(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
|
|
2025
|
+
r.inputFactory = Q(n), r.fieldMap = {
|
|
1933
2026
|
label: "Name",
|
|
1934
2027
|
value: "Id",
|
|
1935
2028
|
...r == null ? void 0 : r.fieldMap
|
|
@@ -1944,11 +2037,11 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1944
2037
|
), g(
|
|
1945
2038
|
() => l.value,
|
|
1946
2039
|
(y) => {
|
|
1947
|
-
a.autoClean && a.formData && a.outFields && y !== a.value &&
|
|
2040
|
+
a.autoClean && a.formData && a.outFields && y !== a.value && ca(a.formData, a.outFields, null);
|
|
1948
2041
|
}
|
|
1949
2042
|
);
|
|
1950
|
-
const { editorCtrl: u, errInfo: i, labelText: c } = n,
|
|
1951
|
-
n.inputEmit =
|
|
2043
|
+
const { editorCtrl: u, errInfo: i, labelText: c } = n, p = t;
|
|
2044
|
+
n.inputEmit = p;
|
|
1952
2045
|
const v = f((r == null ? void 0 : r.options.value) || []);
|
|
1953
2046
|
r && g(
|
|
1954
2047
|
() => r.options.value,
|
|
@@ -1957,38 +2050,38 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1957
2050
|
},
|
|
1958
2051
|
{ immediate: !0, deep: !0 }
|
|
1959
2052
|
);
|
|
1960
|
-
const
|
|
2053
|
+
const d = (y) => {
|
|
1961
2054
|
if (v.value = [], y === "") return;
|
|
1962
2055
|
let h = {
|
|
1963
2056
|
Query: {
|
|
1964
2057
|
SearchField: "%" + y.trim() + "%"
|
|
1965
2058
|
}
|
|
1966
2059
|
};
|
|
1967
|
-
r.params =
|
|
2060
|
+
r.params = ce(r.params, h), r && ee(!0, r, a);
|
|
1968
2061
|
}, O = (y) => {
|
|
1969
|
-
const E =
|
|
1970
|
-
|
|
2062
|
+
const E = Pe(r, a, y);
|
|
2063
|
+
p("update:value", y), p("select", y);
|
|
1971
2064
|
const h = Te(E);
|
|
1972
|
-
|
|
2065
|
+
p("update:labels", h), i != null && i.value.errClass && u && pe(u);
|
|
1973
2066
|
};
|
|
1974
|
-
return
|
|
2067
|
+
return ie(() => {
|
|
1975
2068
|
r && de(r, a);
|
|
1976
2069
|
}), (y, E) => {
|
|
1977
2070
|
var h;
|
|
1978
|
-
return
|
|
1979
|
-
|
|
2071
|
+
return w(), M("div", null, [
|
|
2072
|
+
C(b(ba), le({
|
|
1980
2073
|
value: l.value,
|
|
1981
2074
|
"onUpdate:value": E[0] || (E[0] = (I) => l.value = I),
|
|
1982
2075
|
class: ["w-full", (h = b(i)) == null ? void 0 : h.errClass],
|
|
1983
2076
|
options: v.value,
|
|
1984
|
-
onSearch:
|
|
2077
|
+
onSearch: d,
|
|
1985
2078
|
onSelect: O
|
|
1986
2079
|
}, b(s), { "allow-clear": !1 }), {
|
|
1987
|
-
option:
|
|
1988
|
-
|
|
2080
|
+
option: K(({ label: I }) => [
|
|
2081
|
+
Ee(Y(I), 1)
|
|
1989
2082
|
]),
|
|
1990
|
-
default:
|
|
1991
|
-
|
|
2083
|
+
default: K(() => [
|
|
2084
|
+
C(b(Ia), {
|
|
1992
2085
|
"allow-clear": "",
|
|
1993
2086
|
placeholder: "请输入并选择" + b(c)
|
|
1994
2087
|
}, null, 8, ["placeholder"])
|
|
@@ -1998,14 +2091,14 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1998
2091
|
]);
|
|
1999
2092
|
};
|
|
2000
2093
|
}
|
|
2001
|
-
}),
|
|
2094
|
+
}), mt = { class: "min-h-[32px] pt-[5px]" }, vt = {
|
|
2002
2095
|
key: 1,
|
|
2003
2096
|
class: "text-center text-gray-500"
|
|
2004
|
-
},
|
|
2097
|
+
}, is = /* @__PURE__ */ Z({
|
|
2005
2098
|
inheritAttrs: !1,
|
|
2006
2099
|
__name: "index",
|
|
2007
2100
|
props: {
|
|
2008
|
-
...
|
|
2101
|
+
...fe,
|
|
2009
2102
|
nodata: {
|
|
2010
2103
|
type: String,
|
|
2011
2104
|
default: ""
|
|
@@ -2022,13 +2115,13 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
2022
2115
|
},
|
|
2023
2116
|
emits: ["change", "update:labels"],
|
|
2024
2117
|
setup(e, { emit: t }) {
|
|
2025
|
-
var v,
|
|
2026
|
-
const a = e, s =
|
|
2027
|
-
r.inputFactory =
|
|
2118
|
+
var v, d, O;
|
|
2119
|
+
const a = e, s = Ae(), n = X(), o = he(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
|
|
2120
|
+
r.inputFactory = Q(n);
|
|
2028
2121
|
const l = f({
|
|
2029
2122
|
...r == null ? void 0 : r.url,
|
|
2030
2123
|
url: ((v = r == null ? void 0 : r.url) == null ? void 0 : v.url) || "",
|
|
2031
|
-
fieldMap: (r == null ? void 0 : r.fieldMap) || ((
|
|
2124
|
+
fieldMap: (r == null ? void 0 : r.fieldMap) || ((d = r == null ? void 0 : r.url) == null ? void 0 : d.fieldMap),
|
|
2032
2125
|
params: (r == null ? void 0 : r.params) || ((O = r == null ? void 0 : r.url) == null ? void 0 : O.params),
|
|
2033
2126
|
loadingText: !1
|
|
2034
2127
|
}), { errInfo: u } = n, i = t;
|
|
@@ -2041,57 +2134,57 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
2041
2134
|
},
|
|
2042
2135
|
{ immediate: !0, deep: !0 }
|
|
2043
2136
|
);
|
|
2044
|
-
const
|
|
2045
|
-
const h =
|
|
2137
|
+
const p = (y) => {
|
|
2138
|
+
const h = Pe(r, a, y), I = Te(h);
|
|
2046
2139
|
i("update:labels", I);
|
|
2047
2140
|
};
|
|
2048
|
-
return
|
|
2141
|
+
return be(() => {
|
|
2049
2142
|
l.value && !l.value.fieldMap && (l.value.fieldMap = {
|
|
2050
2143
|
title: "Name",
|
|
2051
2144
|
label: "Name",
|
|
2052
2145
|
value: "Id",
|
|
2053
2146
|
key: "Id"
|
|
2054
|
-
}), r &&
|
|
2055
|
-
}),
|
|
2147
|
+
}), r && ee(r.autoload, r, a);
|
|
2148
|
+
}), ie(() => {
|
|
2056
2149
|
r && de(r, a);
|
|
2057
|
-
}), (y, E) => (
|
|
2058
|
-
|
|
2059
|
-
onChange:
|
|
2150
|
+
}), (y, E) => (w(), M("div", mt, [
|
|
2151
|
+
C(b(Aa), le({
|
|
2152
|
+
onChange: p,
|
|
2060
2153
|
class: "w-full mb-[-3px]"
|
|
2061
2154
|
}, b(s)), {
|
|
2062
|
-
default:
|
|
2063
|
-
c.value.length > 0 ? (
|
|
2155
|
+
default: K(() => [
|
|
2156
|
+
c.value.length > 0 ? (w(!0), M(re, { key: 0 }, Ue(c.value, (h) => {
|
|
2064
2157
|
var I;
|
|
2065
|
-
return
|
|
2158
|
+
return w(), Ie(b(Ea), {
|
|
2066
2159
|
key: h.value,
|
|
2067
2160
|
value: h.value,
|
|
2068
2161
|
disabled: h.disabled || h.value && e.disabledItems && e.disabledItems.indexOf(h.value.toString()) > -1,
|
|
2069
|
-
class:
|
|
2162
|
+
class: ea([
|
|
2070
2163
|
((I = b(u)) == null ? void 0 : I.errClass) === "error" ? "error !text-red-400" : "",
|
|
2071
2164
|
"text-nowrap",
|
|
2072
2165
|
"pb-1",
|
|
2073
2166
|
e.wrap ? `w-1/${a.wrap}` : ""
|
|
2074
2167
|
])
|
|
2075
2168
|
}, {
|
|
2076
|
-
default:
|
|
2077
|
-
|
|
2169
|
+
default: K(() => [
|
|
2170
|
+
Ee(Y(h.label), 1)
|
|
2078
2171
|
]),
|
|
2079
2172
|
_: 2
|
|
2080
2173
|
}, 1032, ["value", "disabled", "class"]);
|
|
2081
|
-
}), 128)) : e.nodata ? (
|
|
2174
|
+
}), 128)) : e.nodata ? (w(), M("div", vt, Y(e.nodata), 1)) : z("", !0)
|
|
2082
2175
|
]),
|
|
2083
2176
|
_: 1
|
|
2084
2177
|
}, 16)
|
|
2085
2178
|
]));
|
|
2086
2179
|
}
|
|
2087
|
-
}),
|
|
2180
|
+
}), gt = { class: "min-h-[32px] pt-1" }, yt = {
|
|
2088
2181
|
key: 1,
|
|
2089
2182
|
class: "text-center text-gray-500"
|
|
2090
|
-
},
|
|
2183
|
+
}, ls = /* @__PURE__ */ Z({
|
|
2091
2184
|
inheritAttrs: !1,
|
|
2092
2185
|
__name: "index",
|
|
2093
2186
|
props: {
|
|
2094
|
-
...
|
|
2187
|
+
...fe,
|
|
2095
2188
|
value: {
|
|
2096
2189
|
type: [String, Number, null, Array],
|
|
2097
2190
|
default: void 0
|
|
@@ -2110,16 +2203,16 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
2110
2203
|
emits: ["change", "update:value", "update:labels"],
|
|
2111
2204
|
setup(e, { emit: t }) {
|
|
2112
2205
|
var O, y, E;
|
|
2113
|
-
const a = e, s =
|
|
2114
|
-
r.inputFactory =
|
|
2206
|
+
const a = e, s = Ae(), n = X(), o = he(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
|
|
2207
|
+
r.inputFactory = Q(n);
|
|
2115
2208
|
const l = f({
|
|
2116
2209
|
...r == null ? void 0 : r.url,
|
|
2117
2210
|
url: ((O = r == null ? void 0 : r.url) == null ? void 0 : O.url) || "",
|
|
2118
2211
|
fieldMap: (r == null ? void 0 : r.fieldMap) || ((y = r == null ? void 0 : r.url) == null ? void 0 : y.fieldMap),
|
|
2119
2212
|
params: (r == null ? void 0 : r.params) || ((E = r == null ? void 0 : r.url) == null ? void 0 : E.params),
|
|
2120
2213
|
loadingText: !1
|
|
2121
|
-
}), u = f(a.value), { errInfo: i } = n, c = f((r == null ? void 0 : r.options.value) || []),
|
|
2122
|
-
n.inputEmit =
|
|
2214
|
+
}), u = f(a.value), { errInfo: i } = n, c = f((r == null ? void 0 : r.options.value) || []), p = t;
|
|
2215
|
+
n.inputEmit = p, r && g(
|
|
2123
2216
|
() => r.options.value,
|
|
2124
2217
|
(h) => {
|
|
2125
2218
|
c.value = h || [];
|
|
@@ -2133,7 +2226,7 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
2133
2226
|
), g(
|
|
2134
2227
|
() => u.value,
|
|
2135
2228
|
(h) => {
|
|
2136
|
-
|
|
2229
|
+
p("update:value", h);
|
|
2137
2230
|
}
|
|
2138
2231
|
);
|
|
2139
2232
|
const v = (h, I) => {
|
|
@@ -2142,63 +2235,63 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
2142
2235
|
return R && (u.value = h), R;
|
|
2143
2236
|
}
|
|
2144
2237
|
return h === I;
|
|
2145
|
-
},
|
|
2146
|
-
const I = h.target.value, R =
|
|
2147
|
-
|
|
2238
|
+
}, d = (h) => {
|
|
2239
|
+
const I = h.target.value, R = Pe(r, a, I), J = Te(R);
|
|
2240
|
+
p("update:labels", J);
|
|
2148
2241
|
};
|
|
2149
|
-
return
|
|
2242
|
+
return be(() => {
|
|
2150
2243
|
l.value && !l.value.fieldMap && (l.value.fieldMap = {
|
|
2151
2244
|
label: "Name",
|
|
2152
2245
|
value: "Id",
|
|
2153
2246
|
key: "Id"
|
|
2154
|
-
}), r &&
|
|
2155
|
-
}),
|
|
2247
|
+
}), r && ee(r.autoload, r, a);
|
|
2248
|
+
}), ie(() => {
|
|
2156
2249
|
r && de(r, a);
|
|
2157
|
-
}), (h, I) => (
|
|
2158
|
-
|
|
2250
|
+
}), (h, I) => (w(), M("div", gt, [
|
|
2251
|
+
C(b(xa), le({
|
|
2159
2252
|
value: u.value,
|
|
2160
2253
|
"onUpdate:value": I[0] || (I[0] = (R) => u.value = R),
|
|
2161
2254
|
autocheck: !1,
|
|
2162
|
-
onChange:
|
|
2255
|
+
onChange: d,
|
|
2163
2256
|
class: "w-full flex align-items flex-wrap mb-[-3px]"
|
|
2164
2257
|
}, b(s)), {
|
|
2165
|
-
default:
|
|
2166
|
-
c.value.length > 0 ? (
|
|
2167
|
-
var
|
|
2168
|
-
return
|
|
2258
|
+
default: K(() => [
|
|
2259
|
+
c.value.length > 0 ? (w(!0), M(re, { key: 0 }, Ue(c.value, (R) => {
|
|
2260
|
+
var J;
|
|
2261
|
+
return w(), M(re, {
|
|
2169
2262
|
key: R.value
|
|
2170
2263
|
}, [
|
|
2171
|
-
R.visible !== !1 ? (
|
|
2264
|
+
R.visible !== !1 ? (w(), Ie(b(wa), {
|
|
2172
2265
|
key: 0,
|
|
2173
2266
|
checked: v(R.value, a.value),
|
|
2174
2267
|
value: R.value,
|
|
2175
|
-
class:
|
|
2176
|
-
((
|
|
2268
|
+
class: ea([
|
|
2269
|
+
((J = b(i)) == null ? void 0 : J.errClass) === "error" ? "error !text-red-400" : "",
|
|
2177
2270
|
"text-nowrap",
|
|
2178
2271
|
"pb-1",
|
|
2179
2272
|
e.wrap ? `w-1/${a.wrap}` : ""
|
|
2180
2273
|
])
|
|
2181
2274
|
}, {
|
|
2182
|
-
default:
|
|
2183
|
-
|
|
2275
|
+
default: K(() => [
|
|
2276
|
+
Ee(Y(R.label), 1)
|
|
2184
2277
|
]),
|
|
2185
2278
|
_: 2
|
|
2186
|
-
}, 1032, ["checked", "value", "class"])) :
|
|
2279
|
+
}, 1032, ["checked", "value", "class"])) : z("", !0)
|
|
2187
2280
|
], 64);
|
|
2188
|
-
}), 128)) : e.nodata ? (
|
|
2281
|
+
}), 128)) : e.nodata ? (w(), M("div", yt, Y(e.nodata), 1)) : z("", !0)
|
|
2189
2282
|
]),
|
|
2190
2283
|
_: 1
|
|
2191
2284
|
}, 16, ["value"])
|
|
2192
2285
|
]));
|
|
2193
2286
|
}
|
|
2194
|
-
}),
|
|
2287
|
+
}), St = {
|
|
2195
2288
|
key: 0,
|
|
2196
2289
|
class: "absolute z-10 mt-[5px] mr-[10px] text-[#999] flex items-center"
|
|
2197
|
-
},
|
|
2290
|
+
}, us = /* @__PURE__ */ Z({
|
|
2198
2291
|
inheritAttrs: !1,
|
|
2199
2292
|
__name: "index",
|
|
2200
2293
|
props: {
|
|
2201
|
-
...
|
|
2294
|
+
...fe,
|
|
2202
2295
|
value: {
|
|
2203
2296
|
type: [String, Number, Array, null],
|
|
2204
2297
|
default: void 0
|
|
@@ -2229,31 +2322,31 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
2229
2322
|
},
|
|
2230
2323
|
emits: ["change", "update:value", "update:label", "update:labels"],
|
|
2231
2324
|
setup(e, { emit: t }) {
|
|
2232
|
-
var I, R,
|
|
2233
|
-
const a = e, s = a.value === void 0 ? !0 : a.undefValue, n =
|
|
2234
|
-
i.inputFactory =
|
|
2235
|
-
const c =
|
|
2325
|
+
var I, R, J;
|
|
2326
|
+
const a = e, s = a.value === void 0 ? !0 : a.undefValue, n = X(), { editorCtrl: o, errInfo: r, labelText: l } = n, u = he(a.url, a), i = a.optionCtrl ?? u.optionCtrl;
|
|
2327
|
+
i.inputFactory = Q(n);
|
|
2328
|
+
const c = Ae(), p = f({
|
|
2236
2329
|
...i == null ? void 0 : i.url,
|
|
2237
2330
|
url: ((I = i == null ? void 0 : i.url) == null ? void 0 : I.url) || "",
|
|
2238
2331
|
fieldMap: (i == null ? void 0 : i.fieldMap) || ((R = i == null ? void 0 : i.url) == null ? void 0 : R.fieldMap),
|
|
2239
|
-
params: (i == null ? void 0 : i.params) || ((
|
|
2332
|
+
params: (i == null ? void 0 : i.params) || ((J = i == null ? void 0 : i.url) == null ? void 0 : J.params),
|
|
2240
2333
|
loadingText: !1
|
|
2241
|
-
}), v = f(c.placeholder),
|
|
2334
|
+
}), v = f(c.placeholder), d = f(i == null ? void 0 : i.selected.value), O = t;
|
|
2242
2335
|
n.inputEmit = O;
|
|
2243
2336
|
const y = (m) => {
|
|
2244
|
-
const
|
|
2245
|
-
|
|
2337
|
+
const k = Pe(i, a, m), N = Te(k);
|
|
2338
|
+
d.value = m, O("update:labels", N), O("update:label", N.join(";")), O("change", m), r != null && r.value.errClass && o && pe(o);
|
|
2246
2339
|
}, E = f((i == null ? void 0 : i.options.value) || []), h = (m) => {
|
|
2247
2340
|
if (m.length > 0 && F(a.value) && a.selectFirst)
|
|
2248
|
-
for (let
|
|
2249
|
-
const N = m[
|
|
2341
|
+
for (let k = 0; k < m.length; k++) {
|
|
2342
|
+
const N = m[k];
|
|
2250
2343
|
if (N.disabled === void 0 || N.disabled === !1) {
|
|
2251
|
-
|
|
2344
|
+
d.value = N.value;
|
|
2252
2345
|
break;
|
|
2253
2346
|
}
|
|
2254
2347
|
}
|
|
2255
|
-
else m.length > 0 && (
|
|
2256
|
-
m.length > 0 &&
|
|
2348
|
+
else m.length > 0 && (d.value = a.value === null ? void 0 : a.value);
|
|
2349
|
+
m.length > 0 && d.value !== void 0 && y(d.value);
|
|
2257
2350
|
};
|
|
2258
2351
|
return i && (g(
|
|
2259
2352
|
() => i.options.value,
|
|
@@ -2264,7 +2357,7 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
2264
2357
|
), g(
|
|
2265
2358
|
() => i.selected.value,
|
|
2266
2359
|
(m) => {
|
|
2267
|
-
|
|
2360
|
+
d.value = m;
|
|
2268
2361
|
}
|
|
2269
2362
|
)), g(
|
|
2270
2363
|
() => E.value,
|
|
@@ -2272,7 +2365,7 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
2272
2365
|
h(m);
|
|
2273
2366
|
}
|
|
2274
2367
|
), g(
|
|
2275
|
-
() =>
|
|
2368
|
+
() => p.value.loading,
|
|
2276
2369
|
(m) => {
|
|
2277
2370
|
m ? v.value = "" : v.value || (v.value = "请选择" + l.value);
|
|
2278
2371
|
},
|
|
@@ -2280,58 +2373,58 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
2280
2373
|
), g(
|
|
2281
2374
|
() => a.value,
|
|
2282
2375
|
(m) => {
|
|
2283
|
-
|
|
2376
|
+
d.value = m;
|
|
2284
2377
|
},
|
|
2285
2378
|
{ immediate: !0 }
|
|
2286
2379
|
), g(
|
|
2287
|
-
() =>
|
|
2380
|
+
() => d.value,
|
|
2288
2381
|
(m) => {
|
|
2289
|
-
const
|
|
2290
|
-
i && (i.selected.value =
|
|
2382
|
+
const k = m === void 0 ? s ? void 0 : null : m;
|
|
2383
|
+
i && (i.selected.value = k), O("update:value", k);
|
|
2291
2384
|
}
|
|
2292
|
-
),
|
|
2293
|
-
if (
|
|
2385
|
+
), be(() => {
|
|
2386
|
+
if (p.value && !p.value.fieldMap && (p.value.fieldMap = {
|
|
2294
2387
|
label: "Name",
|
|
2295
2388
|
value: "Id",
|
|
2296
2389
|
key: "Id"
|
|
2297
2390
|
}), a.dataKey) {
|
|
2298
|
-
const m = JSON.parse(JSON.stringify(
|
|
2391
|
+
const m = JSON.parse(JSON.stringify(D.getOptions(a.dataKey)));
|
|
2299
2392
|
E.value = m, h(m);
|
|
2300
2393
|
} else if (i) {
|
|
2301
2394
|
const m = i.options.value || [];
|
|
2302
|
-
m.length > 0 ? (E.value = m, h(m)) :
|
|
2395
|
+
m.length > 0 ? (E.value = m, h(m)) : ee(i.autoload, i, a);
|
|
2303
2396
|
}
|
|
2304
|
-
}),
|
|
2397
|
+
}), ie(() => {
|
|
2305
2398
|
i && de(i, a);
|
|
2306
|
-
}), (m,
|
|
2307
|
-
var N,
|
|
2308
|
-
return
|
|
2309
|
-
(
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
])) :
|
|
2313
|
-
|
|
2314
|
-
class: [(
|
|
2315
|
-
value:
|
|
2316
|
-
"onUpdate:value":
|
|
2399
|
+
}), (m, k) => {
|
|
2400
|
+
var N, We, qe;
|
|
2401
|
+
return w(), M("div", null, [
|
|
2402
|
+
(We = (N = b(i)) == null ? void 0 : N.url) != null && We.loading ? (w(), M("div", St, [
|
|
2403
|
+
C(b(Ne), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
|
|
2404
|
+
k[1] || (k[1] = ya("span", null, "数据加载中...", -1))
|
|
2405
|
+
])) : z("", !0),
|
|
2406
|
+
C(b(Oa), le({
|
|
2407
|
+
class: [(qe = b(r)) == null ? void 0 : qe.errClass, "w-full"],
|
|
2408
|
+
value: d.value,
|
|
2409
|
+
"onUpdate:value": k[0] || (k[0] = (W) => d.value = W),
|
|
2317
2410
|
"allow-clear": !0,
|
|
2318
2411
|
onChange: y,
|
|
2319
2412
|
placeholder: v.value,
|
|
2320
2413
|
"label-in-value": !1
|
|
2321
2414
|
}, b(c)), {
|
|
2322
|
-
default:
|
|
2323
|
-
(
|
|
2324
|
-
key:
|
|
2415
|
+
default: K(() => [
|
|
2416
|
+
(w(!0), M(re, null, Ue(E.value, (W) => (w(), M(re, {
|
|
2417
|
+
key: W.value
|
|
2325
2418
|
}, [
|
|
2326
|
-
|
|
2419
|
+
W.visible !== !1 ? (w(), Ie(b(Ra), {
|
|
2327
2420
|
key: 0,
|
|
2328
|
-
value:
|
|
2421
|
+
value: W.value
|
|
2329
2422
|
}, {
|
|
2330
|
-
default:
|
|
2331
|
-
|
|
2423
|
+
default: K(() => [
|
|
2424
|
+
Ee(Y(W.label), 1)
|
|
2332
2425
|
]),
|
|
2333
2426
|
_: 2
|
|
2334
|
-
}, 1032, ["value"])) :
|
|
2427
|
+
}, 1032, ["value"])) : z("", !0)
|
|
2335
2428
|
], 64))), 128))
|
|
2336
2429
|
]),
|
|
2337
2430
|
_: 1
|
|
@@ -2341,76 +2434,77 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
2341
2434
|
}
|
|
2342
2435
|
});
|
|
2343
2436
|
export {
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2437
|
+
$t as $,
|
|
2438
|
+
pe as A,
|
|
2439
|
+
is as B,
|
|
2440
|
+
ls as C,
|
|
2441
|
+
us as D,
|
|
2442
|
+
Qe as E,
|
|
2443
|
+
_a as F,
|
|
2444
|
+
Bt as G,
|
|
2445
|
+
nt as H,
|
|
2446
|
+
rt as I,
|
|
2447
|
+
zt as J,
|
|
2448
|
+
Ct as K,
|
|
2449
|
+
we as L,
|
|
2450
|
+
st as M,
|
|
2451
|
+
ca as N,
|
|
2452
|
+
D as O,
|
|
2453
|
+
U as P,
|
|
2454
|
+
Yt as Q,
|
|
2455
|
+
Zt as R,
|
|
2456
|
+
ft as S,
|
|
2457
|
+
pt as T,
|
|
2458
|
+
es as U,
|
|
2459
|
+
Xe as V,
|
|
2460
|
+
as as W,
|
|
2461
|
+
ra as X,
|
|
2462
|
+
Vt as Y,
|
|
2463
|
+
oa as Z,
|
|
2464
|
+
rs as _,
|
|
2465
|
+
ns as a,
|
|
2466
|
+
_t as a0,
|
|
2467
|
+
Je as a1,
|
|
2468
|
+
Ft as a2,
|
|
2469
|
+
Jt as a3,
|
|
2470
|
+
Za as a4,
|
|
2471
|
+
la as a5,
|
|
2472
|
+
Gt as a6,
|
|
2473
|
+
Mt as a7,
|
|
2474
|
+
na as a8,
|
|
2475
|
+
Ba as a9,
|
|
2476
|
+
De as aa,
|
|
2477
|
+
B as ab,
|
|
2478
|
+
ss as ac,
|
|
2479
|
+
ne as ad,
|
|
2480
|
+
ge as ae,
|
|
2481
|
+
V as af,
|
|
2482
|
+
ts as ag,
|
|
2483
|
+
Ve as ah,
|
|
2484
|
+
oe as ai,
|
|
2485
|
+
Ut as b,
|
|
2486
|
+
Xt as c,
|
|
2487
|
+
Ht as d,
|
|
2488
|
+
Dt as e,
|
|
2489
|
+
Wt as f,
|
|
2490
|
+
qt as g,
|
|
2491
|
+
Qt as h,
|
|
2398
2492
|
F as i,
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2493
|
+
Kt as j,
|
|
2494
|
+
ia as k,
|
|
2495
|
+
Xa as l,
|
|
2496
|
+
jt as m,
|
|
2497
|
+
os as n,
|
|
2498
|
+
Nt as o,
|
|
2499
|
+
fe as p,
|
|
2500
|
+
za as q,
|
|
2501
|
+
xe as r,
|
|
2502
|
+
X as s,
|
|
2503
|
+
he as t,
|
|
2504
|
+
_ as u,
|
|
2505
|
+
ee as v,
|
|
2412
2506
|
de as w,
|
|
2413
2507
|
Ne as x,
|
|
2414
|
-
|
|
2508
|
+
Pe as y,
|
|
2415
2509
|
Te as z
|
|
2416
2510
|
};
|