@skyfox2000/webui 1.4.1 → 1.4.3
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-C92mDmCL.js} +6 -6
- package/lib/assets/modules/file-upload-DGCoBLP3.js +198 -0
- package/lib/assets/modules/{index-BuP8i92E.js → index-BrDxf94o.js} +1 -1
- package/lib/assets/modules/{index-Bb4qTaRC.js → index-C_7galsG.js} +2 -2
- package/lib/assets/modules/{index-DLY7idvQ.js → index-ChjM1bSE.js} +2 -2
- package/lib/assets/modules/{menuTabs-DzoBrCZE.js → menuTabs-Boe_4pzK.js} +2 -2
- package/lib/assets/modules/{toolIcon-FTelEQwg.js → toolIcon-BddslNsJ.js} +1 -1
- package/lib/assets/modules/{uploadList-DTAFNhow.js → uploadList-3sClH7Na.js} +4 -4
- package/lib/assets/modules/{uploadList-DIfhRlbh.js → uploadList-ZGWKyite.js} +629 -533
- 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 +22 -33
- package/lib/webui.es.js +104 -109
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/utils/micro-openapis.ts +157 -136
- package/lib/assets/modules/file-upload-Dk4VFMgz.js +0 -204
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
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 L = (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 $, 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 W, 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 E 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
|
+
L(P, "dict", {}), L(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
|
+
L(P, "getOptions", (t) => P.dict[t]), /**
|
|
31
31
|
* 静态选择项对象
|
|
32
32
|
* @param key 名称
|
|
33
33
|
* @param value 值
|
|
34
34
|
* @returns
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
L(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
|
+
L(P, "setOptions", (t, a) => {
|
|
42
|
+
P.dict[t] = a;
|
|
43
43
|
}), /**
|
|
44
44
|
* 启用/停用选项
|
|
45
45
|
* - 启用 1
|
|
46
46
|
* - 停用 0
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
L(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
|
+
L(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
|
+
L(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
|
+
L(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 N = P;
|
|
109
|
+
N.setOptions("EnableDisable", N.EnableDisable);
|
|
110
|
+
N.setOptions("SuccessResult", N.SuccessResult);
|
|
111
|
+
N.setOptions("YesNo", N.YesNo);
|
|
112
|
+
N.setOptions("MaleFemale", N.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 = [], Na = (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:
|
|
187
|
-
}),
|
|
186
|
+
routes: ge
|
|
187
|
+
}), Da = (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,35 +225,35 @@ 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
|
};
|
|
237
237
|
return;
|
|
238
238
|
}
|
|
239
|
-
const c =
|
|
239
|
+
const c = Da(s, u.isLogin);
|
|
240
240
|
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
|
+
E.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 (
|
|
435
|
+
}), _().isLogin) {
|
|
436
|
+
const a = ta(this.appInfo.Routes);
|
|
437
|
+
if (Na(a), this.appInfo.defaultPage = sa(a) || "", this.appInfo.defaultPage) {
|
|
438
438
|
if (this.menuLoaded = !0, W.value && W.value.mainAppPush) {
|
|
439
439
|
const s = this.formatRoute(this.appInfo.defaultPage);
|
|
440
440
|
W.value.mainAppPush(s);
|
|
441
441
|
}
|
|
442
|
-
|
|
442
|
+
Ua(this.appInfo.defaultPage);
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
},
|
|
@@ -457,8 +457,8 @@ 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 }), W.value && W.value.mainAppPush) {
|
|
462
462
|
const a = this.formatRoute(e);
|
|
463
463
|
W.value.mainAppPush(a);
|
|
464
464
|
}
|
|
@@ -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 E.error("获取授权信息失败," + (a == null ? void 0 : a.msg)), null;
|
|
575
575
|
});
|
|
576
|
-
},
|
|
576
|
+
}, qa = () => {
|
|
577
577
|
let e = {
|
|
578
578
|
Option: {},
|
|
579
579
|
Query: {}
|
|
580
580
|
};
|
|
581
|
-
return
|
|
581
|
+
return G(Ke.logout, e).then((t) => (t == null ? void 0 : t.status) === T.SUCCESS ? t.data : null);
|
|
582
582
|
}, Wa = (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
|
+
}, M = 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), M.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, Wa(n))
|
|
623
623
|
this.userInfo = {
|
|
624
624
|
...this.userInfo,
|
|
625
625
|
...n.UserInfo
|
|
626
|
-
},
|
|
626
|
+
}, M.value = n.UserInfo.UserLevel;
|
|
627
627
|
else {
|
|
628
|
-
|
|
628
|
+
E.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 M.value ? Array.isArray(e) ? e.includes(M.value) : M.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
|
+
M.value || (M.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 M.value === "Super";
|
|
706
706
|
},
|
|
707
707
|
/**
|
|
708
708
|
* 是否管理员
|
|
709
709
|
*/
|
|
710
710
|
isAdmin() {
|
|
711
|
-
return
|
|
711
|
+
return M.value === "Super" || M.value === "Admin";
|
|
712
712
|
},
|
|
713
713
|
/**
|
|
714
714
|
* 获取用户级别
|
|
715
715
|
* @returns 用户级别
|
|
716
716
|
*/
|
|
717
717
|
getUserLevel() {
|
|
718
|
-
return
|
|
718
|
+
return M.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, M.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 qa();
|
|
740
740
|
} catch (t) {
|
|
741
741
|
console.error("调用登出接口失败", t);
|
|
742
742
|
} finally {
|
|
743
743
|
await this.clean(), e && setTimeout(async () => {
|
|
744
|
-
|
|
744
|
+
E.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
|
+
}, Lt = (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 || E.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 E.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 || E.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 E.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 || E.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 Mt = (e) => {
|
|
820
|
+
oe = new He({}), oe.messages({
|
|
821
821
|
required: "${label}不能为空",
|
|
822
822
|
types: {
|
|
823
823
|
number: "${label}必须是数字"
|
|
@@ -846,7 +846,7 @@ const Lt = (e) => {
|
|
|
846
846
|
}, $t = (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
|
-
}, Ft = async (e, t, a) => (a || (a = new
|
|
905
|
-
}).catch(({ fields: s }) => s)),
|
|
904
|
+
}, Ft = 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
|
+
}, _t = (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) => {
|
|
974
|
-
|
|
975
|
-
a[e.primaryKey ?? t.primaryKey] = null, na(e);
|
|
972
|
+
ra(e);
|
|
976
973
|
}, Dt = (e) => {
|
|
977
|
-
|
|
978
|
-
|
|
974
|
+
const t = e.page, a = e.formData.value;
|
|
975
|
+
a[e.primaryKey ?? t.primaryKey] = null, ra(e);
|
|
976
|
+
}, Ut = (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 E.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
|
+
E.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
|
+
E.error(`保存失败!数据 \`${u}\` 已存在!`);
|
|
1024
|
+
} else E.error((n == null ? void 0 : n.msg) ?? "保存失败!");
|
|
1025
1025
|
e.afterSave && e.afterSave(n);
|
|
1026
1026
|
} else
|
|
1027
|
-
|
|
1027
|
+
E.error((n == null ? void 0 : n.msg) ?? "保存失败!"), e.afterSave && e.afterSave(n);
|
|
1028
1028
|
});
|
|
1029
|
-
},
|
|
1029
|
+
}, Ht = 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
|
+
}, Vt = (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
|
+
}, Kt = (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
|
+
}, Qt = (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
|
+
}), jt = (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
|
+
}, Gt = (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 Ne = /* @__PURE__ */ ((e) => (e.SelectReload = "Select.Reload", e.RadioReload = "Radio.Reload", e.CheckboxReload = "Checkbox.Reload", e.TreeSelectReload = "TreeSelect.Reload", e.TreeCheckReload = "TreeCheck.Reload", e))(Ne || {});
|
|
1129
|
+
class et {
|
|
1130
1130
|
constructor() {
|
|
1131
|
-
|
|
1131
|
+
L(this, "listeners", {});
|
|
1132
1132
|
}
|
|
1133
1133
|
// 检查事件名是否符合前缀
|
|
1134
1134
|
isValidPrefix(t) {
|
|
1135
|
-
return Object.values(
|
|
1135
|
+
return Object.values(Ne).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(Ne).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
|
+
E.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 = {
|
|
@@ -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
|
+
}, Bt = (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
|
+
}, zt = (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({}), Ct = j, Yt = (e) => {
|
|
1498
1498
|
var n;
|
|
1499
|
-
if (!e.iconUrl) return
|
|
1499
|
+
if (!e.iconUrl) return De;
|
|
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,58 +1540,58 @@ 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)
|
|
1561
|
-
return
|
|
1561
|
+
return De;
|
|
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
|
+
E.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
|
+
}, Xt = () => {
|
|
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
|
-
},
|
|
1645
|
+
}, De = 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
|
+
}, Zt = (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([]), es = () => {
|
|
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
|
+
}, as = 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,102 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1813
1813
|
// storage: localStorage,
|
|
1814
1814
|
// pick: ['hostInfo'],
|
|
1815
1815
|
// },
|
|
1816
|
-
})
|
|
1816
|
+
});
|
|
1817
|
+
class A {
|
|
1818
|
+
/**
|
|
1819
|
+
* 检查是否在微前端环境中运行
|
|
1820
|
+
* @returns boolean
|
|
1821
|
+
*/
|
|
1822
|
+
static isInMicroApp() {
|
|
1823
|
+
return typeof window < "u" && !!window.microApp;
|
|
1824
|
+
}
|
|
1825
|
+
/**
|
|
1826
|
+
* 调用主应用方法的通用方法
|
|
1827
|
+
* @param method 方法名
|
|
1828
|
+
* @param params 参数
|
|
1829
|
+
* @returns Promise
|
|
1830
|
+
*/
|
|
1831
|
+
static async callMainAppMethod(t, a) {
|
|
1832
|
+
if (!this.isInMicroApp())
|
|
1833
|
+
throw new Error(`未配置${t}接口!`);
|
|
1834
|
+
const s = ++this.messageId, n = new Promise((r, l) => {
|
|
1835
|
+
this.callbacks.set(s, { resolve: r, reject: l }), setTimeout(() => {
|
|
1836
|
+
this.callbacks.has(s) && (this.callbacks.delete(s), l(new Error(`API调用超时: ${t}`)));
|
|
1837
|
+
}, 1e4);
|
|
1838
|
+
}), o = {
|
|
1839
|
+
type: "API_REQUEST",
|
|
1840
|
+
id: s,
|
|
1841
|
+
method: t,
|
|
1842
|
+
params: a
|
|
1843
|
+
};
|
|
1844
|
+
return window.microApp.dispatch(o), n;
|
|
1845
|
+
}
|
|
1846
|
+
/**
|
|
1847
|
+
* 处理来自主应用的响应数据
|
|
1848
|
+
* @param data 响应数据
|
|
1849
|
+
*/
|
|
1850
|
+
static handleResponseData(t) {
|
|
1851
|
+
if (t && t.type === "API_RESPONSE" && typeof t.id == "number") {
|
|
1852
|
+
const { id: a, success: s, result: n, error: o } = t, r = this.callbacks.get(a);
|
|
1853
|
+
r && (this.callbacks.delete(a), s ? r.resolve(n) : r.reject(new Error(o || "未知错误")));
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
/**
|
|
1857
|
+
* 初始化通信监听器
|
|
1858
|
+
*/
|
|
1859
|
+
static init() {
|
|
1860
|
+
this.isInMicroApp() && window.microApp.addDataListener((t) => {
|
|
1861
|
+
console.log("收到来自主应用的数据:", t), this.handleResponseData(t);
|
|
1862
|
+
});
|
|
1863
|
+
}
|
|
1864
|
+
/**
|
|
1865
|
+
* 获取应用信息
|
|
1866
|
+
*/
|
|
1867
|
+
static async getAppInfo() {
|
|
1868
|
+
return this.callMainAppMethod("getAppInfo");
|
|
1869
|
+
}
|
|
1870
|
+
/**
|
|
1871
|
+
* 获取主机信息
|
|
1872
|
+
*/
|
|
1873
|
+
static async getHostInfo() {
|
|
1874
|
+
return this.callMainAppMethod("getHostInfo");
|
|
1875
|
+
}
|
|
1876
|
+
/**
|
|
1877
|
+
* 获取用户信息
|
|
1878
|
+
*/
|
|
1879
|
+
static async getUserInfo() {
|
|
1880
|
+
return this.callMainAppMethod("getUserInfo");
|
|
1881
|
+
}
|
|
1882
|
+
/**
|
|
1883
|
+
* 获取授权令牌
|
|
1884
|
+
*/
|
|
1885
|
+
static async getToken() {
|
|
1886
|
+
return this.callMainAppMethod("getToken");
|
|
1887
|
+
}
|
|
1888
|
+
/**
|
|
1889
|
+
* 用户登出
|
|
1890
|
+
*/
|
|
1891
|
+
static async userLogout() {
|
|
1892
|
+
return this.callMainAppMethod("userLogout");
|
|
1893
|
+
}
|
|
1894
|
+
/**
|
|
1895
|
+
* 主应用推送
|
|
1896
|
+
*/
|
|
1897
|
+
static async mainAppPush(t) {
|
|
1898
|
+
return this.callMainAppMethod("mainAppPush", t);
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
L(A, "messageId", 0), L(A, "callbacks", /* @__PURE__ */ new Map());
|
|
1902
|
+
A.init();
|
|
1903
|
+
const ts = {
|
|
1904
|
+
getAppInfo: A.getAppInfo.bind(A),
|
|
1905
|
+
getHostInfo: A.getHostInfo.bind(A),
|
|
1906
|
+
getUserInfo: A.getUserInfo.bind(A),
|
|
1907
|
+
getToken: A.getToken.bind(A),
|
|
1908
|
+
userLogout: A.userLogout.bind(A),
|
|
1909
|
+
mainAppPush: A.mainAppPush.bind(A),
|
|
1910
|
+
isInMicroApp: A.isInMicroApp.bind(A)
|
|
1911
|
+
}, ss = ue("settingInfo", {
|
|
1817
1912
|
state: () => ({
|
|
1818
1913
|
fullscreen: !1,
|
|
1819
1914
|
menuCollapse: !1,
|
|
@@ -1855,10 +1950,10 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1855
1950
|
}
|
|
1856
1951
|
},
|
|
1857
1952
|
persist: !1
|
|
1858
|
-
}),
|
|
1953
|
+
}), ns = /* @__PURE__ */ Z({
|
|
1859
1954
|
__name: "index",
|
|
1860
1955
|
props: {
|
|
1861
|
-
...
|
|
1956
|
+
...fe,
|
|
1862
1957
|
/**
|
|
1863
1958
|
* 选择项数据
|
|
1864
1959
|
*/
|
|
@@ -1869,33 +1964,33 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1869
1964
|
},
|
|
1870
1965
|
emits: ["change"],
|
|
1871
1966
|
setup(e, { emit: t }) {
|
|
1872
|
-
const a = e, s =
|
|
1873
|
-
o.inputFactory =
|
|
1967
|
+
const a = e, s = X(), n = he(a.url, a), o = a.optionCtrl ?? n.optionCtrl;
|
|
1968
|
+
o.inputFactory = Q(s);
|
|
1874
1969
|
const r = f([]);
|
|
1875
1970
|
o && g(
|
|
1876
1971
|
() => o.options.value,
|
|
1877
|
-
(
|
|
1878
|
-
r.value =
|
|
1972
|
+
(p) => {
|
|
1973
|
+
r.value = p || [];
|
|
1879
1974
|
},
|
|
1880
1975
|
{ immediate: !0, deep: !0 }
|
|
1881
1976
|
);
|
|
1882
|
-
const l = t, { editorCtrl: u, errInfo: i } =
|
|
1883
|
-
i != null && i.value.errClass && u &&
|
|
1977
|
+
const l = t, { editorCtrl: u, errInfo: i } = X(), c = (p) => {
|
|
1978
|
+
i != null && i.value.errClass && u && pe(u), l("change", p);
|
|
1884
1979
|
};
|
|
1885
|
-
return
|
|
1980
|
+
return be(() => {
|
|
1886
1981
|
if (!a.data || a.data.length != 2) {
|
|
1887
|
-
console.error("Switch组件: ", a.data),
|
|
1982
|
+
console.error("Switch组件: ", a.data), E.error("Switch组件必须有且只有两个选项");
|
|
1888
1983
|
return;
|
|
1889
1984
|
}
|
|
1890
|
-
o &&
|
|
1891
|
-
}),
|
|
1985
|
+
o && ee(o.autoload, o, a);
|
|
1986
|
+
}), ie(() => {
|
|
1892
1987
|
o && de(o, a);
|
|
1893
|
-
}), (
|
|
1894
|
-
var
|
|
1895
|
-
return r.value.length === 2 ? (
|
|
1988
|
+
}), (p, v) => {
|
|
1989
|
+
var d;
|
|
1990
|
+
return r.value.length === 2 ? (w(), Ie(b(Sa), le({
|
|
1896
1991
|
key: 0,
|
|
1897
1992
|
class: [
|
|
1898
|
-
((
|
|
1993
|
+
((d = b(i)) == null ? void 0 : d.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : "",
|
|
1899
1994
|
"bg-blue-300",
|
|
1900
1995
|
"w-[58px]"
|
|
1901
1996
|
],
|
|
@@ -1904,14 +1999,14 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1904
1999
|
unCheckedChildren: r.value[1].label,
|
|
1905
2000
|
unCheckedValue: r.value[1].value,
|
|
1906
2001
|
onChange: c
|
|
1907
|
-
},
|
|
2002
|
+
}, p.$attrs), null, 16, ["class", "checkedChildren", "checkedValue", "unCheckedChildren", "unCheckedValue"])) : z("", !0);
|
|
1908
2003
|
};
|
|
1909
2004
|
}
|
|
1910
|
-
}),
|
|
2005
|
+
}), rs = /* @__PURE__ */ Z({
|
|
1911
2006
|
inheritAttrs: !1,
|
|
1912
2007
|
__name: "index",
|
|
1913
2008
|
props: {
|
|
1914
|
-
...
|
|
2009
|
+
...fe,
|
|
1915
2010
|
value: {
|
|
1916
2011
|
type: [String, Number, Array, null],
|
|
1917
2012
|
default: void 0
|
|
@@ -1928,8 +2023,8 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1928
2023
|
},
|
|
1929
2024
|
emits: ["update:value", "select", "change", "update:labels"],
|
|
1930
2025
|
setup(e, { emit: t }) {
|
|
1931
|
-
const a = e, s =
|
|
1932
|
-
r.inputFactory =
|
|
2026
|
+
const a = e, s = Ae(), n = X(), o = he(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
|
|
2027
|
+
r.inputFactory = Q(n), r.fieldMap = {
|
|
1933
2028
|
label: "Name",
|
|
1934
2029
|
value: "Id",
|
|
1935
2030
|
...r == null ? void 0 : r.fieldMap
|
|
@@ -1944,11 +2039,11 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1944
2039
|
), g(
|
|
1945
2040
|
() => l.value,
|
|
1946
2041
|
(y) => {
|
|
1947
|
-
a.autoClean && a.formData && a.outFields && y !== a.value &&
|
|
2042
|
+
a.autoClean && a.formData && a.outFields && y !== a.value && ca(a.formData, a.outFields, null);
|
|
1948
2043
|
}
|
|
1949
2044
|
);
|
|
1950
|
-
const { editorCtrl: u, errInfo: i, labelText: c } = n,
|
|
1951
|
-
n.inputEmit =
|
|
2045
|
+
const { editorCtrl: u, errInfo: i, labelText: c } = n, p = t;
|
|
2046
|
+
n.inputEmit = p;
|
|
1952
2047
|
const v = f((r == null ? void 0 : r.options.value) || []);
|
|
1953
2048
|
r && g(
|
|
1954
2049
|
() => r.options.value,
|
|
@@ -1957,38 +2052,38 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1957
2052
|
},
|
|
1958
2053
|
{ immediate: !0, deep: !0 }
|
|
1959
2054
|
);
|
|
1960
|
-
const
|
|
2055
|
+
const d = (y) => {
|
|
1961
2056
|
if (v.value = [], y === "") return;
|
|
1962
2057
|
let h = {
|
|
1963
2058
|
Query: {
|
|
1964
2059
|
SearchField: "%" + y.trim() + "%"
|
|
1965
2060
|
}
|
|
1966
2061
|
};
|
|
1967
|
-
r.params =
|
|
2062
|
+
r.params = ce(r.params, h), r && ee(!0, r, a);
|
|
1968
2063
|
}, O = (y) => {
|
|
1969
|
-
const
|
|
1970
|
-
|
|
1971
|
-
const h = Te(
|
|
1972
|
-
|
|
2064
|
+
const x = Pe(r, a, y);
|
|
2065
|
+
p("update:value", y), p("select", y);
|
|
2066
|
+
const h = Te(x);
|
|
2067
|
+
p("update:labels", h), i != null && i.value.errClass && u && pe(u);
|
|
1973
2068
|
};
|
|
1974
|
-
return
|
|
2069
|
+
return ie(() => {
|
|
1975
2070
|
r && de(r, a);
|
|
1976
|
-
}), (y,
|
|
2071
|
+
}), (y, x) => {
|
|
1977
2072
|
var h;
|
|
1978
|
-
return
|
|
1979
|
-
|
|
2073
|
+
return w(), $("div", null, [
|
|
2074
|
+
C(b(ba), le({
|
|
1980
2075
|
value: l.value,
|
|
1981
|
-
"onUpdate:value":
|
|
2076
|
+
"onUpdate:value": x[0] || (x[0] = (I) => l.value = I),
|
|
1982
2077
|
class: ["w-full", (h = b(i)) == null ? void 0 : h.errClass],
|
|
1983
2078
|
options: v.value,
|
|
1984
|
-
onSearch:
|
|
2079
|
+
onSearch: d,
|
|
1985
2080
|
onSelect: O
|
|
1986
2081
|
}, b(s), { "allow-clear": !1 }), {
|
|
1987
|
-
option:
|
|
1988
|
-
|
|
2082
|
+
option: K(({ label: I }) => [
|
|
2083
|
+
Ee(Y(I), 1)
|
|
1989
2084
|
]),
|
|
1990
|
-
default:
|
|
1991
|
-
|
|
2085
|
+
default: K(() => [
|
|
2086
|
+
C(b(Ia), {
|
|
1992
2087
|
"allow-clear": "",
|
|
1993
2088
|
placeholder: "请输入并选择" + b(c)
|
|
1994
2089
|
}, null, 8, ["placeholder"])
|
|
@@ -1998,14 +2093,14 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
1998
2093
|
]);
|
|
1999
2094
|
};
|
|
2000
2095
|
}
|
|
2001
|
-
}),
|
|
2096
|
+
}), ht = { class: "min-h-[32px] pt-[5px]" }, mt = {
|
|
2002
2097
|
key: 1,
|
|
2003
2098
|
class: "text-center text-gray-500"
|
|
2004
|
-
},
|
|
2099
|
+
}, os = /* @__PURE__ */ Z({
|
|
2005
2100
|
inheritAttrs: !1,
|
|
2006
2101
|
__name: "index",
|
|
2007
2102
|
props: {
|
|
2008
|
-
...
|
|
2103
|
+
...fe,
|
|
2009
2104
|
nodata: {
|
|
2010
2105
|
type: String,
|
|
2011
2106
|
default: ""
|
|
@@ -2022,13 +2117,13 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
2022
2117
|
},
|
|
2023
2118
|
emits: ["change", "update:labels"],
|
|
2024
2119
|
setup(e, { emit: t }) {
|
|
2025
|
-
var v,
|
|
2026
|
-
const a = e, s =
|
|
2027
|
-
r.inputFactory =
|
|
2120
|
+
var v, d, O;
|
|
2121
|
+
const a = e, s = Ae(), n = X(), o = he(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
|
|
2122
|
+
r.inputFactory = Q(n);
|
|
2028
2123
|
const l = f({
|
|
2029
2124
|
...r == null ? void 0 : r.url,
|
|
2030
2125
|
url: ((v = r == null ? void 0 : r.url) == null ? void 0 : v.url) || "",
|
|
2031
|
-
fieldMap: (r == null ? void 0 : r.fieldMap) || ((
|
|
2126
|
+
fieldMap: (r == null ? void 0 : r.fieldMap) || ((d = r == null ? void 0 : r.url) == null ? void 0 : d.fieldMap),
|
|
2032
2127
|
params: (r == null ? void 0 : r.params) || ((O = r == null ? void 0 : r.url) == null ? void 0 : O.params),
|
|
2033
2128
|
loadingText: !1
|
|
2034
2129
|
}), { errInfo: u } = n, i = t;
|
|
@@ -2041,57 +2136,57 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
2041
2136
|
},
|
|
2042
2137
|
{ immediate: !0, deep: !0 }
|
|
2043
2138
|
);
|
|
2044
|
-
const
|
|
2045
|
-
const h =
|
|
2139
|
+
const p = (y) => {
|
|
2140
|
+
const h = Pe(r, a, y), I = Te(h);
|
|
2046
2141
|
i("update:labels", I);
|
|
2047
2142
|
};
|
|
2048
|
-
return
|
|
2143
|
+
return be(() => {
|
|
2049
2144
|
l.value && !l.value.fieldMap && (l.value.fieldMap = {
|
|
2050
2145
|
title: "Name",
|
|
2051
2146
|
label: "Name",
|
|
2052
2147
|
value: "Id",
|
|
2053
2148
|
key: "Id"
|
|
2054
|
-
}), r &&
|
|
2055
|
-
}),
|
|
2149
|
+
}), r && ee(r.autoload, r, a);
|
|
2150
|
+
}), ie(() => {
|
|
2056
2151
|
r && de(r, a);
|
|
2057
|
-
}), (y,
|
|
2058
|
-
|
|
2059
|
-
onChange:
|
|
2152
|
+
}), (y, x) => (w(), $("div", ht, [
|
|
2153
|
+
C(b(Aa), le({
|
|
2154
|
+
onChange: p,
|
|
2060
2155
|
class: "w-full mb-[-3px]"
|
|
2061
2156
|
}, b(s)), {
|
|
2062
|
-
default:
|
|
2063
|
-
c.value.length > 0 ? (
|
|
2157
|
+
default: K(() => [
|
|
2158
|
+
c.value.length > 0 ? (w(!0), $(re, { key: 0 }, Ue(c.value, (h) => {
|
|
2064
2159
|
var I;
|
|
2065
|
-
return
|
|
2160
|
+
return w(), Ie(b(Ea), {
|
|
2066
2161
|
key: h.value,
|
|
2067
2162
|
value: h.value,
|
|
2068
2163
|
disabled: h.disabled || h.value && e.disabledItems && e.disabledItems.indexOf(h.value.toString()) > -1,
|
|
2069
|
-
class:
|
|
2164
|
+
class: ea([
|
|
2070
2165
|
((I = b(u)) == null ? void 0 : I.errClass) === "error" ? "error !text-red-400" : "",
|
|
2071
2166
|
"text-nowrap",
|
|
2072
2167
|
"pb-1",
|
|
2073
2168
|
e.wrap ? `w-1/${a.wrap}` : ""
|
|
2074
2169
|
])
|
|
2075
2170
|
}, {
|
|
2076
|
-
default:
|
|
2077
|
-
|
|
2171
|
+
default: K(() => [
|
|
2172
|
+
Ee(Y(h.label), 1)
|
|
2078
2173
|
]),
|
|
2079
2174
|
_: 2
|
|
2080
2175
|
}, 1032, ["value", "disabled", "class"]);
|
|
2081
|
-
}), 128)) : e.nodata ? (
|
|
2176
|
+
}), 128)) : e.nodata ? (w(), $("div", mt, Y(e.nodata), 1)) : z("", !0)
|
|
2082
2177
|
]),
|
|
2083
2178
|
_: 1
|
|
2084
2179
|
}, 16)
|
|
2085
2180
|
]));
|
|
2086
2181
|
}
|
|
2087
|
-
}),
|
|
2182
|
+
}), vt = { class: "min-h-[32px] pt-1" }, gt = {
|
|
2088
2183
|
key: 1,
|
|
2089
2184
|
class: "text-center text-gray-500"
|
|
2090
|
-
},
|
|
2185
|
+
}, is = /* @__PURE__ */ Z({
|
|
2091
2186
|
inheritAttrs: !1,
|
|
2092
2187
|
__name: "index",
|
|
2093
2188
|
props: {
|
|
2094
|
-
...
|
|
2189
|
+
...fe,
|
|
2095
2190
|
value: {
|
|
2096
2191
|
type: [String, Number, null, Array],
|
|
2097
2192
|
default: void 0
|
|
@@ -2109,17 +2204,17 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
2109
2204
|
},
|
|
2110
2205
|
emits: ["change", "update:value", "update:labels"],
|
|
2111
2206
|
setup(e, { emit: t }) {
|
|
2112
|
-
var O, y,
|
|
2113
|
-
const a = e, s =
|
|
2114
|
-
r.inputFactory =
|
|
2207
|
+
var O, y, x;
|
|
2208
|
+
const a = e, s = Ae(), n = X(), o = he(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
|
|
2209
|
+
r.inputFactory = Q(n);
|
|
2115
2210
|
const l = f({
|
|
2116
2211
|
...r == null ? void 0 : r.url,
|
|
2117
2212
|
url: ((O = r == null ? void 0 : r.url) == null ? void 0 : O.url) || "",
|
|
2118
2213
|
fieldMap: (r == null ? void 0 : r.fieldMap) || ((y = r == null ? void 0 : r.url) == null ? void 0 : y.fieldMap),
|
|
2119
|
-
params: (r == null ? void 0 : r.params) || ((
|
|
2214
|
+
params: (r == null ? void 0 : r.params) || ((x = r == null ? void 0 : r.url) == null ? void 0 : x.params),
|
|
2120
2215
|
loadingText: !1
|
|
2121
|
-
}), u = f(a.value), { errInfo: i } = n, c = f((r == null ? void 0 : r.options.value) || []),
|
|
2122
|
-
n.inputEmit =
|
|
2216
|
+
}), u = f(a.value), { errInfo: i } = n, c = f((r == null ? void 0 : r.options.value) || []), p = t;
|
|
2217
|
+
n.inputEmit = p, r && g(
|
|
2123
2218
|
() => r.options.value,
|
|
2124
2219
|
(h) => {
|
|
2125
2220
|
c.value = h || [];
|
|
@@ -2133,7 +2228,7 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
2133
2228
|
), g(
|
|
2134
2229
|
() => u.value,
|
|
2135
2230
|
(h) => {
|
|
2136
|
-
|
|
2231
|
+
p("update:value", h);
|
|
2137
2232
|
}
|
|
2138
2233
|
);
|
|
2139
2234
|
const v = (h, I) => {
|
|
@@ -2142,63 +2237,63 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
2142
2237
|
return R && (u.value = h), R;
|
|
2143
2238
|
}
|
|
2144
2239
|
return h === I;
|
|
2145
|
-
},
|
|
2146
|
-
const I = h.target.value, R =
|
|
2147
|
-
|
|
2240
|
+
}, d = (h) => {
|
|
2241
|
+
const I = h.target.value, R = Pe(r, a, I), J = Te(R);
|
|
2242
|
+
p("update:labels", J);
|
|
2148
2243
|
};
|
|
2149
|
-
return
|
|
2244
|
+
return be(() => {
|
|
2150
2245
|
l.value && !l.value.fieldMap && (l.value.fieldMap = {
|
|
2151
2246
|
label: "Name",
|
|
2152
2247
|
value: "Id",
|
|
2153
2248
|
key: "Id"
|
|
2154
|
-
}), r &&
|
|
2155
|
-
}),
|
|
2249
|
+
}), r && ee(r.autoload, r, a);
|
|
2250
|
+
}), ie(() => {
|
|
2156
2251
|
r && de(r, a);
|
|
2157
|
-
}), (h, I) => (
|
|
2158
|
-
|
|
2252
|
+
}), (h, I) => (w(), $("div", vt, [
|
|
2253
|
+
C(b(xa), le({
|
|
2159
2254
|
value: u.value,
|
|
2160
2255
|
"onUpdate:value": I[0] || (I[0] = (R) => u.value = R),
|
|
2161
2256
|
autocheck: !1,
|
|
2162
|
-
onChange:
|
|
2257
|
+
onChange: d,
|
|
2163
2258
|
class: "w-full flex align-items flex-wrap mb-[-3px]"
|
|
2164
2259
|
}, b(s)), {
|
|
2165
|
-
default:
|
|
2166
|
-
c.value.length > 0 ? (
|
|
2167
|
-
var
|
|
2168
|
-
return
|
|
2260
|
+
default: K(() => [
|
|
2261
|
+
c.value.length > 0 ? (w(!0), $(re, { key: 0 }, Ue(c.value, (R) => {
|
|
2262
|
+
var J;
|
|
2263
|
+
return w(), $(re, {
|
|
2169
2264
|
key: R.value
|
|
2170
2265
|
}, [
|
|
2171
|
-
R.visible !== !1 ? (
|
|
2266
|
+
R.visible !== !1 ? (w(), Ie(b(wa), {
|
|
2172
2267
|
key: 0,
|
|
2173
2268
|
checked: v(R.value, a.value),
|
|
2174
2269
|
value: R.value,
|
|
2175
|
-
class:
|
|
2176
|
-
((
|
|
2270
|
+
class: ea([
|
|
2271
|
+
((J = b(i)) == null ? void 0 : J.errClass) === "error" ? "error !text-red-400" : "",
|
|
2177
2272
|
"text-nowrap",
|
|
2178
2273
|
"pb-1",
|
|
2179
2274
|
e.wrap ? `w-1/${a.wrap}` : ""
|
|
2180
2275
|
])
|
|
2181
2276
|
}, {
|
|
2182
|
-
default:
|
|
2183
|
-
|
|
2277
|
+
default: K(() => [
|
|
2278
|
+
Ee(Y(R.label), 1)
|
|
2184
2279
|
]),
|
|
2185
2280
|
_: 2
|
|
2186
|
-
}, 1032, ["checked", "value", "class"])) :
|
|
2281
|
+
}, 1032, ["checked", "value", "class"])) : z("", !0)
|
|
2187
2282
|
], 64);
|
|
2188
|
-
}), 128)) : e.nodata ? (
|
|
2283
|
+
}), 128)) : e.nodata ? (w(), $("div", gt, Y(e.nodata), 1)) : z("", !0)
|
|
2189
2284
|
]),
|
|
2190
2285
|
_: 1
|
|
2191
2286
|
}, 16, ["value"])
|
|
2192
2287
|
]));
|
|
2193
2288
|
}
|
|
2194
|
-
}),
|
|
2289
|
+
}), yt = {
|
|
2195
2290
|
key: 0,
|
|
2196
2291
|
class: "absolute z-10 mt-[5px] mr-[10px] text-[#999] flex items-center"
|
|
2197
|
-
},
|
|
2292
|
+
}, ls = /* @__PURE__ */ Z({
|
|
2198
2293
|
inheritAttrs: !1,
|
|
2199
2294
|
__name: "index",
|
|
2200
2295
|
props: {
|
|
2201
|
-
...
|
|
2296
|
+
...fe,
|
|
2202
2297
|
value: {
|
|
2203
2298
|
type: [String, Number, Array, null],
|
|
2204
2299
|
default: void 0
|
|
@@ -2229,50 +2324,50 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
2229
2324
|
},
|
|
2230
2325
|
emits: ["change", "update:value", "update:label", "update:labels"],
|
|
2231
2326
|
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 =
|
|
2327
|
+
var I, R, J;
|
|
2328
|
+
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;
|
|
2329
|
+
i.inputFactory = Q(n);
|
|
2330
|
+
const c = Ae(), p = f({
|
|
2236
2331
|
...i == null ? void 0 : i.url,
|
|
2237
2332
|
url: ((I = i == null ? void 0 : i.url) == null ? void 0 : I.url) || "",
|
|
2238
2333
|
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) || ((
|
|
2334
|
+
params: (i == null ? void 0 : i.params) || ((J = i == null ? void 0 : i.url) == null ? void 0 : J.params),
|
|
2240
2335
|
loadingText: !1
|
|
2241
|
-
}), v = f(c.placeholder),
|
|
2336
|
+
}), v = f(c.placeholder), d = f(i == null ? void 0 : i.selected.value), O = t;
|
|
2242
2337
|
n.inputEmit = O;
|
|
2243
2338
|
const y = (m) => {
|
|
2244
|
-
const
|
|
2245
|
-
|
|
2246
|
-
},
|
|
2339
|
+
const k = Pe(i, a, m), D = Te(k);
|
|
2340
|
+
d.value = m, O("update:labels", D), O("update:label", D.join(";")), O("change", m), r != null && r.value.errClass && o && pe(o);
|
|
2341
|
+
}, x = f((i == null ? void 0 : i.options.value) || []), h = (m) => {
|
|
2247
2342
|
if (m.length > 0 && F(a.value) && a.selectFirst)
|
|
2248
|
-
for (let
|
|
2249
|
-
const
|
|
2250
|
-
if (
|
|
2251
|
-
|
|
2343
|
+
for (let k = 0; k < m.length; k++) {
|
|
2344
|
+
const D = m[k];
|
|
2345
|
+
if (D.disabled === void 0 || D.disabled === !1) {
|
|
2346
|
+
d.value = D.value;
|
|
2252
2347
|
break;
|
|
2253
2348
|
}
|
|
2254
2349
|
}
|
|
2255
|
-
else m.length > 0 && (
|
|
2256
|
-
m.length > 0 &&
|
|
2350
|
+
else m.length > 0 && (d.value = a.value === null ? void 0 : a.value);
|
|
2351
|
+
m.length > 0 && d.value !== void 0 && y(d.value);
|
|
2257
2352
|
};
|
|
2258
2353
|
return i && (g(
|
|
2259
2354
|
() => i.options.value,
|
|
2260
2355
|
(m) => {
|
|
2261
|
-
|
|
2356
|
+
x.value = m || [];
|
|
2262
2357
|
},
|
|
2263
2358
|
{ immediate: !0, deep: !0 }
|
|
2264
2359
|
), g(
|
|
2265
2360
|
() => i.selected.value,
|
|
2266
2361
|
(m) => {
|
|
2267
|
-
|
|
2362
|
+
d.value = m;
|
|
2268
2363
|
}
|
|
2269
2364
|
)), g(
|
|
2270
|
-
() =>
|
|
2365
|
+
() => x.value,
|
|
2271
2366
|
(m) => {
|
|
2272
2367
|
h(m);
|
|
2273
2368
|
}
|
|
2274
2369
|
), g(
|
|
2275
|
-
() =>
|
|
2370
|
+
() => p.value.loading,
|
|
2276
2371
|
(m) => {
|
|
2277
2372
|
m ? v.value = "" : v.value || (v.value = "请选择" + l.value);
|
|
2278
2373
|
},
|
|
@@ -2280,58 +2375,58 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
2280
2375
|
), g(
|
|
2281
2376
|
() => a.value,
|
|
2282
2377
|
(m) => {
|
|
2283
|
-
|
|
2378
|
+
d.value = m;
|
|
2284
2379
|
},
|
|
2285
2380
|
{ immediate: !0 }
|
|
2286
2381
|
), g(
|
|
2287
|
-
() =>
|
|
2382
|
+
() => d.value,
|
|
2288
2383
|
(m) => {
|
|
2289
|
-
const
|
|
2290
|
-
i && (i.selected.value =
|
|
2384
|
+
const k = m === void 0 ? s ? void 0 : null : m;
|
|
2385
|
+
i && (i.selected.value = k), O("update:value", k);
|
|
2291
2386
|
}
|
|
2292
|
-
),
|
|
2293
|
-
if (
|
|
2387
|
+
), be(() => {
|
|
2388
|
+
if (p.value && !p.value.fieldMap && (p.value.fieldMap = {
|
|
2294
2389
|
label: "Name",
|
|
2295
2390
|
value: "Id",
|
|
2296
2391
|
key: "Id"
|
|
2297
2392
|
}), a.dataKey) {
|
|
2298
|
-
const m = JSON.parse(JSON.stringify(
|
|
2299
|
-
|
|
2393
|
+
const m = JSON.parse(JSON.stringify(N.getOptions(a.dataKey)));
|
|
2394
|
+
x.value = m, h(m);
|
|
2300
2395
|
} else if (i) {
|
|
2301
2396
|
const m = i.options.value || [];
|
|
2302
|
-
m.length > 0 ? (
|
|
2397
|
+
m.length > 0 ? (x.value = m, h(m)) : ee(i.autoload, i, a);
|
|
2303
2398
|
}
|
|
2304
|
-
}),
|
|
2399
|
+
}), ie(() => {
|
|
2305
2400
|
i && de(i, a);
|
|
2306
|
-
}), (m,
|
|
2307
|
-
var
|
|
2308
|
-
return
|
|
2309
|
-
(
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
])) :
|
|
2313
|
-
|
|
2401
|
+
}), (m, k) => {
|
|
2402
|
+
var D, qe, We;
|
|
2403
|
+
return w(), $("div", null, [
|
|
2404
|
+
(qe = (D = b(i)) == null ? void 0 : D.url) != null && qe.loading ? (w(), $("div", yt, [
|
|
2405
|
+
C(b(De), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
|
|
2406
|
+
k[1] || (k[1] = ya("span", null, "数据加载中...", -1))
|
|
2407
|
+
])) : z("", !0),
|
|
2408
|
+
C(b(Oa), le({
|
|
2314
2409
|
class: [(We = b(r)) == null ? void 0 : We.errClass, "w-full"],
|
|
2315
|
-
value:
|
|
2316
|
-
"onUpdate:value":
|
|
2410
|
+
value: d.value,
|
|
2411
|
+
"onUpdate:value": k[0] || (k[0] = (q) => d.value = q),
|
|
2317
2412
|
"allow-clear": !0,
|
|
2318
2413
|
onChange: y,
|
|
2319
2414
|
placeholder: v.value,
|
|
2320
2415
|
"label-in-value": !1
|
|
2321
2416
|
}, b(c)), {
|
|
2322
|
-
default:
|
|
2323
|
-
(
|
|
2324
|
-
key:
|
|
2417
|
+
default: K(() => [
|
|
2418
|
+
(w(!0), $(re, null, Ue(x.value, (q) => (w(), $(re, {
|
|
2419
|
+
key: q.value
|
|
2325
2420
|
}, [
|
|
2326
|
-
|
|
2421
|
+
q.visible !== !1 ? (w(), Ie(b(Ra), {
|
|
2327
2422
|
key: 0,
|
|
2328
|
-
value:
|
|
2423
|
+
value: q.value
|
|
2329
2424
|
}, {
|
|
2330
|
-
default:
|
|
2331
|
-
|
|
2425
|
+
default: K(() => [
|
|
2426
|
+
Ee(Y(q.label), 1)
|
|
2332
2427
|
]),
|
|
2333
2428
|
_: 2
|
|
2334
|
-
}, 1032, ["value"])) :
|
|
2429
|
+
}, 1032, ["value"])) : z("", !0)
|
|
2335
2430
|
], 64))), 128))
|
|
2336
2431
|
]),
|
|
2337
2432
|
_: 1
|
|
@@ -2341,76 +2436,77 @@ const q = new Za(), Z = (e, t, a) => {
|
|
|
2341
2436
|
}
|
|
2342
2437
|
});
|
|
2343
2438
|
export {
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2439
|
+
Mt as $,
|
|
2440
|
+
pe as A,
|
|
2441
|
+
os as B,
|
|
2442
|
+
is as C,
|
|
2443
|
+
ls as D,
|
|
2444
|
+
Qe as E,
|
|
2445
|
+
_a as F,
|
|
2351
2446
|
Wt as G,
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2447
|
+
nt as H,
|
|
2448
|
+
rt as I,
|
|
2449
|
+
Bt as J,
|
|
2450
|
+
zt as K,
|
|
2451
|
+
we as L,
|
|
2452
|
+
st as M,
|
|
2453
|
+
ca as N,
|
|
2454
|
+
N as O,
|
|
2455
|
+
U as P,
|
|
2456
|
+
Ct as Q,
|
|
2457
|
+
Xt as R,
|
|
2458
|
+
ft as S,
|
|
2459
|
+
pt as T,
|
|
2460
|
+
Zt as U,
|
|
2461
|
+
Xe as V,
|
|
2462
|
+
es as W,
|
|
2463
|
+
ra as X,
|
|
2464
|
+
Ht as Y,
|
|
2465
|
+
oa as Z,
|
|
2466
|
+
ns as _,
|
|
2467
|
+
ss as a,
|
|
2373
2468
|
Ft as a0,
|
|
2374
|
-
|
|
2469
|
+
Je as a1,
|
|
2375
2470
|
$t as a2,
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
Gt as
|
|
2397
|
-
|
|
2471
|
+
Qt as a3,
|
|
2472
|
+
Za as a4,
|
|
2473
|
+
la as a5,
|
|
2474
|
+
jt as a6,
|
|
2475
|
+
Lt as a7,
|
|
2476
|
+
na as a8,
|
|
2477
|
+
Ba as a9,
|
|
2478
|
+
Ne as aa,
|
|
2479
|
+
B as ab,
|
|
2480
|
+
ts as ac,
|
|
2481
|
+
ne as ad,
|
|
2482
|
+
ge as ae,
|
|
2483
|
+
V as af,
|
|
2484
|
+
as as ag,
|
|
2485
|
+
Ve as ah,
|
|
2486
|
+
oe as ai,
|
|
2487
|
+
Dt as b,
|
|
2488
|
+
Yt as c,
|
|
2489
|
+
Ut as d,
|
|
2490
|
+
_t as e,
|
|
2491
|
+
Gt as f,
|
|
2492
|
+
qt as g,
|
|
2493
|
+
Kt as h,
|
|
2398
2494
|
F as i,
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2495
|
+
Vt as j,
|
|
2496
|
+
ia as k,
|
|
2497
|
+
Xa as l,
|
|
2498
|
+
Jt as m,
|
|
2499
|
+
rs as n,
|
|
2500
|
+
Nt as o,
|
|
2501
|
+
fe as p,
|
|
2502
|
+
za as q,
|
|
2503
|
+
xe as r,
|
|
2504
|
+
X as s,
|
|
2505
|
+
he as t,
|
|
2506
|
+
_ as u,
|
|
2507
|
+
ee as v,
|
|
2412
2508
|
de as w,
|
|
2413
|
-
|
|
2414
|
-
|
|
2509
|
+
De as x,
|
|
2510
|
+
Pe as y,
|
|
2415
2511
|
Te as z
|
|
2416
2512
|
};
|