@skyfox2000/webui 1.4.11 → 1.4.13
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-DSVT_hCt.js → baseLayout-BtJNPMBy.js} +3 -3
- package/lib/assets/modules/{file-upload-T2kmeyGd.js → file-upload-CYNi1NsW.js} +1 -1
- package/lib/assets/modules/{index-C6BAsERS.js → index-BOOirPG2.js} +1 -1
- package/lib/assets/modules/{index-DkMjvF98.js → index-Cj6QnoC7.js} +2 -2
- package/lib/assets/modules/{index-Cwr2EDEI.js → index-DWnhNqJu.js} +2 -2
- package/lib/assets/modules/{menuTabs-D99nhxm_.js → menuTabs-DDGkYuvg.js} +2 -2
- package/lib/assets/modules/{toolIcon-DDp0EFRE.js → toolIcon-DXQt60Ya.js} +1 -1
- package/lib/assets/modules/{upload-template-BK8iQQYz.js → upload-template-CaeUt6VI.js} +657 -646
- package/lib/assets/modules/{uploadList-B8p45yS2.js → uploadList-D0jw6jNr.js} +4 -4
- 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/TemplateFile/index.js +4 -4
- package/lib/es/UploadForm/index.js +4 -4
- package/lib/utils/micro-openapis.d.ts +1 -0
- package/lib/webui.es.js +373 -372
- package/package.json +1 -1
- package/src/components/content/table/index.vue +8 -0
- package/src/utils/micro-openapis.ts +23 -2
- package/src/utils/table.ts +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { ref as c, h as H, nextTick as
|
|
5
|
-
import { Switch as
|
|
6
|
-
import { createPinia as
|
|
7
|
-
import
|
|
8
|
-
import { EnvConfig as be, AppAction as We, AppSource as ze, isMicroApp as V, isBaseMicroApp as
|
|
9
|
-
import { httpPost as
|
|
1
|
+
var ht = Object.defineProperty;
|
|
2
|
+
var mt = (e, a, t) => a in e ? ht(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t;
|
|
3
|
+
var k = (e, a, t) => mt(e, typeof a != "symbol" ? a + "" : a, t);
|
|
4
|
+
import { ref as c, h as H, nextTick as vt, inject as se, provide as Me, watch as g, toRaw as Ze, shallowRef as J, defineComponent as Z, reactive as gt, onMounted as Ie, onUnmounted as le, createBlock as Ae, createCommentVNode as z, openBlock as w, unref as S, mergeProps as ue, useAttrs as Ee, createElementBlock as $, createVNode as C, withCtx as Q, createTextVNode as xe, toDisplayString as Y, Fragment as oe, renderList as Ue, normalizeClass as et, createElementVNode as yt } from "vue";
|
|
5
|
+
import { Switch as bt, AutoComplete as St, Input as It, CheckboxGroup as At, Checkbox as Et, RadioGroup as xt, Radio as wt, Select as Rt, SelectOption as Ot } from "ant-design-vue";
|
|
6
|
+
import { createPinia as Tt, defineStore as ce } from "pinia";
|
|
7
|
+
import Pt from "pinia-plugin-persistedstate";
|
|
8
|
+
import { EnvConfig as be, AppAction as We, AppSource as ze, isMicroApp as V, isBaseMicroApp as kt, combineParams as fe } from "@skyfox2000/microbase";
|
|
9
|
+
import { httpPost as G, ResStatus as T, setToken as ve, fieldMapping as Lt, parseFieldTemplate as Se, API_HOST as $e, SERVER_HOST as Mt } from "@skyfox2000/fapi";
|
|
10
10
|
import E from "vue-m-message";
|
|
11
|
-
import { createRouter as $
|
|
11
|
+
import { createRouter as $t, createWebHashHistory as Ft } from "vue-router";
|
|
12
12
|
import He from "async-validator";
|
|
13
13
|
import "dayjs";
|
|
14
14
|
import "vue-draggable-next";
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const _t = Tt();
|
|
16
|
+
_t.use(Pt);
|
|
17
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
|
|
18
|
+
const L = class L {
|
|
19
19
|
};
|
|
20
|
-
L
|
|
20
|
+
k(L, "dict", {}), k(L, "Keys", {
|
|
21
21
|
EnableDisable: "EnableDisable",
|
|
22
22
|
SuccessResult: "SuccessResult",
|
|
23
23
|
YesNo: "YesNo",
|
|
@@ -27,25 +27,25 @@ L(k, "dict", {}), L(k, "Keys", {
|
|
|
27
27
|
* @param key 名称
|
|
28
28
|
* @returns
|
|
29
29
|
*/
|
|
30
|
-
L
|
|
30
|
+
k(L, "getOptions", (a) => L.dict[a]), /**
|
|
31
31
|
* 静态选择项对象
|
|
32
32
|
* @param key 名称
|
|
33
33
|
* @param value 值
|
|
34
34
|
* @returns
|
|
35
35
|
*/
|
|
36
|
-
L
|
|
36
|
+
k(L, "getOptionItem", (a, t) => L.dict[a].find((s) => s.value === t)), /**
|
|
37
37
|
* 设置静态选择项
|
|
38
38
|
* @param key 名称
|
|
39
39
|
* @param list 列表
|
|
40
40
|
*/
|
|
41
|
-
L
|
|
42
|
-
|
|
41
|
+
k(L, "setOptions", (a, t) => {
|
|
42
|
+
L.dict[a] = t;
|
|
43
43
|
}), /**
|
|
44
44
|
* 启用/停用选项
|
|
45
45
|
* - 启用 1
|
|
46
46
|
* - 停用 0
|
|
47
47
|
*/
|
|
48
|
-
L
|
|
48
|
+
k(L, "EnableDisable", [
|
|
49
49
|
{
|
|
50
50
|
label: "启用",
|
|
51
51
|
text: "✅ 启用",
|
|
@@ -61,7 +61,7 @@ L(k, "EnableDisable", [
|
|
|
61
61
|
* - 成功 1
|
|
62
62
|
* - 失败 0
|
|
63
63
|
*/
|
|
64
|
-
L
|
|
64
|
+
k(L, "SuccessResult", [
|
|
65
65
|
{
|
|
66
66
|
label: "成功",
|
|
67
67
|
text: "✅ 成功",
|
|
@@ -77,7 +77,7 @@ L(k, "SuccessResult", [
|
|
|
77
77
|
* - 是 1
|
|
78
78
|
* - 否 0
|
|
79
79
|
*/
|
|
80
|
-
L
|
|
80
|
+
k(L, "YesNo", [
|
|
81
81
|
{
|
|
82
82
|
label: "是",
|
|
83
83
|
text: "✅ 是",
|
|
@@ -93,7 +93,7 @@ L(k, "YesNo", [
|
|
|
93
93
|
* - 男 M
|
|
94
94
|
* - 女 F
|
|
95
95
|
*/
|
|
96
|
-
L
|
|
96
|
+
k(L, "MaleFemale", [
|
|
97
97
|
{
|
|
98
98
|
label: "男",
|
|
99
99
|
text: "男 👨",
|
|
@@ -105,7 +105,7 @@ L(k, "MaleFemale", [
|
|
|
105
105
|
value: "F"
|
|
106
106
|
}
|
|
107
107
|
]);
|
|
108
|
-
let N =
|
|
108
|
+
let N = L;
|
|
109
109
|
N.setOptions("EnableDisable", N.EnableDisable);
|
|
110
110
|
N.setOptions("SuccessResult", N.SuccessResult);
|
|
111
111
|
N.setOptions("YesNo", N.YesNo);
|
|
@@ -173,40 +173,40 @@ const pe = {
|
|
|
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, Ce = "/login/", ye = [],
|
|
177
|
-
for (const
|
|
178
|
-
const
|
|
179
|
-
|
|
176
|
+
}, F = (e) => e == null || e === "" ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1, Ce = "/login/", ye = [], Nt = (e) => {
|
|
177
|
+
for (const a of e) {
|
|
178
|
+
const t = ye.findIndex((s) => s.path === a.path);
|
|
179
|
+
t !== -1 && ye.splice(t, 1), ye.push(a), we.addRoute(a);
|
|
180
180
|
}
|
|
181
|
-
},
|
|
181
|
+
}, tt = (e, a, t, s = "") => {
|
|
182
182
|
const n = s + (s ? "/" : "") + e.path;
|
|
183
|
-
|
|
184
|
-
}, we = $
|
|
185
|
-
history:
|
|
183
|
+
a[n] = { ...e, parent: t }, e.children && e.children.forEach((o) => tt(o, a, e, n));
|
|
184
|
+
}, we = $t({
|
|
185
|
+
history: Ft("/"),
|
|
186
186
|
routes: ye
|
|
187
|
-
}),
|
|
187
|
+
}), Dt = (e, a) => {
|
|
188
188
|
var n, o;
|
|
189
|
-
const
|
|
190
|
-
if (!
|
|
191
|
-
return
|
|
192
|
-
if (
|
|
189
|
+
const t = ((n = e.meta) == null ? void 0 : n.roles) ?? [], s = (o = e.meta) == null ? void 0 : o.permission;
|
|
190
|
+
if (!a)
|
|
191
|
+
return t.length === 0 && !s;
|
|
192
|
+
if (a) {
|
|
193
193
|
const r = _();
|
|
194
194
|
if (be.VITE_PERMISSION_MODE === "role")
|
|
195
|
-
return
|
|
195
|
+
return t.length === 0 ? !0 : r.hasRole(t);
|
|
196
196
|
if (be.VITE_PERMISSION_MODE === "permit") {
|
|
197
|
-
if (
|
|
197
|
+
if (t.length === 0 && !s)
|
|
198
198
|
return !0;
|
|
199
199
|
let l = !1, u = !1;
|
|
200
|
-
return
|
|
200
|
+
return t.length > 0 && (l = r.hasRole(t)), s && (u = r.hasPermit(e.path, ":page")), l || u;
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
return !1;
|
|
204
204
|
}, ne = c(null);
|
|
205
|
-
we.beforeEach((e,
|
|
205
|
+
we.beforeEach((e, a, t) => {
|
|
206
206
|
var l;
|
|
207
207
|
const s = e;
|
|
208
208
|
if (e.path.startsWith("/error/") || e.path.startsWith(Ce))
|
|
209
|
-
return
|
|
209
|
+
return t();
|
|
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
212
|
const u = K();
|
|
@@ -214,7 +214,7 @@ we.beforeEach((e, t, a) => {
|
|
|
214
214
|
ne.value = {
|
|
215
215
|
to: e,
|
|
216
216
|
next: (i) => {
|
|
217
|
-
|
|
217
|
+
t({ path: i });
|
|
218
218
|
}
|
|
219
219
|
};
|
|
220
220
|
return;
|
|
@@ -223,37 +223,37 @@ we.beforeEach((e, t, a) => {
|
|
|
223
223
|
return;
|
|
224
224
|
}
|
|
225
225
|
if (!r)
|
|
226
|
-
|
|
226
|
+
t();
|
|
227
227
|
else {
|
|
228
228
|
const u = _();
|
|
229
229
|
if (!u.isLogin)
|
|
230
|
-
|
|
230
|
+
t({ path: Ce });
|
|
231
231
|
else {
|
|
232
232
|
if (!K().menuLoaded) {
|
|
233
233
|
ne.value = {
|
|
234
234
|
to: e,
|
|
235
|
-
next:
|
|
235
|
+
next: t
|
|
236
236
|
};
|
|
237
237
|
return;
|
|
238
238
|
}
|
|
239
|
-
const f =
|
|
240
|
-
|
|
239
|
+
const f = Dt(s, u.isLogin);
|
|
240
|
+
t();
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
});
|
|
244
|
-
const
|
|
244
|
+
const Ut = (e) => {
|
|
245
245
|
if (ne.value) {
|
|
246
|
-
const { to:
|
|
247
|
-
ne.value = null,
|
|
246
|
+
const { to: a, next: t } = ne.value;
|
|
247
|
+
ne.value = null, a.path === "/" ? t(e) : t(a.path);
|
|
248
248
|
}
|
|
249
|
-
},
|
|
250
|
-
const
|
|
251
|
-
if (
|
|
252
|
-
if (
|
|
249
|
+
}, Ht = (e) => {
|
|
250
|
+
const a = Ve();
|
|
251
|
+
if (a.TabEnabled) {
|
|
252
|
+
if (Vt(e.key, a.TabPanes))
|
|
253
253
|
return;
|
|
254
|
-
|
|
254
|
+
a.TabPanes.push(e);
|
|
255
255
|
}
|
|
256
|
-
},
|
|
256
|
+
}, Vt = (e, a) => a.find((t) => t.key === e), Ve = ce("pageInfo", {
|
|
257
257
|
state: () => ({
|
|
258
258
|
TabActive: "",
|
|
259
259
|
TabPanes: [],
|
|
@@ -267,18 +267,18 @@ const Ua = (e) => {
|
|
|
267
267
|
removeTabPane(e) {
|
|
268
268
|
if (this.TabEnabled) {
|
|
269
269
|
K().excludeComponent(e);
|
|
270
|
-
let
|
|
270
|
+
let t = 0, s = [...this.TabPanes];
|
|
271
271
|
for (let n = 0; n < s.length; n++)
|
|
272
272
|
if (s[n].key === e) {
|
|
273
|
-
s.splice(n, 1),
|
|
273
|
+
s.splice(n, 1), t = n - 1 < 0 ? 0 : n - 1;
|
|
274
274
|
break;
|
|
275
275
|
}
|
|
276
276
|
for (let n = 0; n < s.length; n++)
|
|
277
277
|
if (s[n].key === this.TabActive) {
|
|
278
|
-
|
|
278
|
+
t = n;
|
|
279
279
|
break;
|
|
280
280
|
}
|
|
281
|
-
this.TabPanes = s, this.setTabActive(s[
|
|
281
|
+
this.TabPanes = s, this.setTabActive(s[t].key);
|
|
282
282
|
}
|
|
283
283
|
},
|
|
284
284
|
/**
|
|
@@ -287,18 +287,18 @@ const Ua = (e) => {
|
|
|
287
287
|
* @returns
|
|
288
288
|
*/
|
|
289
289
|
async setTabActive(e) {
|
|
290
|
-
let
|
|
291
|
-
if (!
|
|
290
|
+
let t = K().findRoute(e);
|
|
291
|
+
if (!t) return;
|
|
292
292
|
const s = {
|
|
293
293
|
key: e,
|
|
294
|
-
title:
|
|
294
|
+
title: t.name.toString(),
|
|
295
295
|
content: "",
|
|
296
296
|
closable: !0,
|
|
297
297
|
// 根据路由的meta.keepAlive确定是否加入对应缓存
|
|
298
298
|
// 默认为true
|
|
299
|
-
keepAlive: !(
|
|
299
|
+
keepAlive: !(t.meta && !t.meta.keepAlive)
|
|
300
300
|
};
|
|
301
|
-
|
|
301
|
+
Ht(s), this.TabActive = e;
|
|
302
302
|
}
|
|
303
303
|
},
|
|
304
304
|
persist: !1
|
|
@@ -317,37 +317,48 @@ class A {
|
|
|
317
317
|
* @param params 参数
|
|
318
318
|
* @returns Promise
|
|
319
319
|
*/
|
|
320
|
-
static async callMainAppMethod(
|
|
320
|
+
static async callMainAppMethod(a, t) {
|
|
321
321
|
if (!this.isInMicroApp())
|
|
322
|
-
throw new Error(`未配置${
|
|
323
|
-
const s =
|
|
324
|
-
|
|
325
|
-
|
|
322
|
+
throw new Error(`未配置${a}接口!`);
|
|
323
|
+
const s = `${a}_${JSON.stringify(t)}`;
|
|
324
|
+
if (this.pendingRequests.has(s))
|
|
325
|
+
return this.pendingRequests.get(s);
|
|
326
|
+
const n = ++this.messageId, o = new Promise((l, u) => {
|
|
327
|
+
this.callbacks.set(n, { resolve: l, reject: u }), setTimeout(() => {
|
|
328
|
+
this.callbacks.has(n) && (this.callbacks.delete(n), this.pendingRequests.delete(s), u(new Error(`API调用超时: ${a}`)));
|
|
326
329
|
}, 1e4);
|
|
327
|
-
})
|
|
330
|
+
});
|
|
331
|
+
this.pendingRequests.set(s, o);
|
|
332
|
+
const r = {
|
|
328
333
|
type: "API_REQUEST",
|
|
329
|
-
id:
|
|
330
|
-
method:
|
|
331
|
-
params:
|
|
334
|
+
id: n,
|
|
335
|
+
method: a,
|
|
336
|
+
params: t
|
|
332
337
|
};
|
|
333
|
-
|
|
338
|
+
window.microApp.dispatch(r);
|
|
339
|
+
try {
|
|
340
|
+
const l = await o;
|
|
341
|
+
return this.pendingRequests.delete(s), l;
|
|
342
|
+
} catch (l) {
|
|
343
|
+
throw this.pendingRequests.delete(s), l;
|
|
344
|
+
}
|
|
334
345
|
}
|
|
335
346
|
/**
|
|
336
347
|
* 处理来自主应用的响应数据
|
|
337
348
|
* @param data 响应数据
|
|
338
349
|
*/
|
|
339
|
-
static handleResponseData(
|
|
340
|
-
if (
|
|
341
|
-
const { id:
|
|
342
|
-
r && (this.callbacks.delete(
|
|
350
|
+
static handleResponseData(a) {
|
|
351
|
+
if (a && a.type === "API_RESPONSE" && typeof a.id == "number") {
|
|
352
|
+
const { id: t, success: s, result: n, error: o } = a, r = this.callbacks.get(t);
|
|
353
|
+
r && (this.callbacks.delete(t), s ? r.resolve(n) : r.reject(new Error(o || "未知错误")));
|
|
343
354
|
}
|
|
344
355
|
}
|
|
345
356
|
/**
|
|
346
357
|
* 初始化通信监听器
|
|
347
358
|
*/
|
|
348
359
|
static init() {
|
|
349
|
-
this.isInMicroApp() && window.microApp.addDataListener((
|
|
350
|
-
this.handleResponseData(
|
|
360
|
+
this.isInMicroApp() && window.microApp.addDataListener((a) => {
|
|
361
|
+
this.handleResponseData(a);
|
|
351
362
|
});
|
|
352
363
|
}
|
|
353
364
|
/**
|
|
@@ -383,11 +394,11 @@ class A {
|
|
|
383
394
|
/**
|
|
384
395
|
* 主应用推送
|
|
385
396
|
*/
|
|
386
|
-
static async mainAppPush(
|
|
387
|
-
return this.callMainAppMethod("mainAppPush",
|
|
397
|
+
static async mainAppPush(a) {
|
|
398
|
+
return this.callMainAppMethod("mainAppPush", a);
|
|
388
399
|
}
|
|
389
400
|
}
|
|
390
|
-
|
|
401
|
+
k(A, "messageId", 0), k(A, "callbacks", /* @__PURE__ */ new Map()), k(A, "pendingRequests", /* @__PURE__ */ new Map());
|
|
391
402
|
A.init();
|
|
392
403
|
const re = {
|
|
393
404
|
getAppInfo: A.getAppInfo.bind(A),
|
|
@@ -397,35 +408,35 @@ const re = {
|
|
|
397
408
|
userLogout: A.userLogout.bind(A),
|
|
398
409
|
mainAppPush: A.mainAppPush.bind(A),
|
|
399
410
|
isInMicroApp: A.isInMicroApp.bind(A)
|
|
400
|
-
},
|
|
411
|
+
}, Kt = {
|
|
401
412
|
appList: {
|
|
402
413
|
api: "PLATFORM_API",
|
|
403
414
|
authorize: !0,
|
|
404
415
|
url: "/api/RCTenanetOpSrv/getApps",
|
|
405
416
|
loadingText: !1
|
|
406
417
|
}
|
|
407
|
-
}, Fe = /* @__PURE__ */ new Map(),
|
|
408
|
-
const
|
|
409
|
-
if (F(
|
|
418
|
+
}, Fe = /* @__PURE__ */ new Map(), Qt = (e) => {
|
|
419
|
+
const a = _(), { roles: t, permission: s } = e.meta || {};
|
|
420
|
+
if (F(t) && F(s))
|
|
410
421
|
return !0;
|
|
411
422
|
if (be.VITE_PERMISSION_MODE === "role")
|
|
412
|
-
return F(
|
|
423
|
+
return F(t) ? !0 : a.hasRole(t);
|
|
413
424
|
if (be.VITE_PERMISSION_MODE === "permit") {
|
|
414
425
|
let n = !1, o = !1;
|
|
415
|
-
return F(
|
|
426
|
+
return F(t) || (n = a.hasRole(t)), a.isAdmin() ? n : (F(s) || (o = a.hasPermit(e.path, s)), n || o);
|
|
416
427
|
}
|
|
417
428
|
return !1;
|
|
418
|
-
},
|
|
419
|
-
const
|
|
420
|
-
return
|
|
421
|
-
}).filter(Boolean),
|
|
422
|
-
for (const
|
|
423
|
-
if (!
|
|
424
|
-
let s =
|
|
429
|
+
}, at = (e) => e.map((a) => {
|
|
430
|
+
const t = { ...a };
|
|
431
|
+
return Qt(t) ? (t.children && (t.children = at(t.children)), t) : null;
|
|
432
|
+
}).filter(Boolean), st = (e, a = "") => {
|
|
433
|
+
for (const t of e) {
|
|
434
|
+
if (!t.children && !t.redirect) {
|
|
435
|
+
let s = a + t.path;
|
|
425
436
|
return s.startsWith("/") || (s = "/" + s), s;
|
|
426
437
|
}
|
|
427
|
-
if (
|
|
428
|
-
const s =
|
|
438
|
+
if (t.children && t.children.length > 0 && t.path !== "/error" && t.path !== "/login" && t.path !== "/:page(.*)") {
|
|
439
|
+
const s = st(t.children, a + t.path + "/");
|
|
429
440
|
if (s)
|
|
430
441
|
return s;
|
|
431
442
|
}
|
|
@@ -457,22 +468,22 @@ const re = {
|
|
|
457
468
|
* 加载授权应用列表
|
|
458
469
|
*/
|
|
459
470
|
async loadAppList(e) {
|
|
460
|
-
return new Promise(async (
|
|
471
|
+
return new Promise(async (a) => {
|
|
461
472
|
e && e.length > 0 ? (this.appList.length = 0, setTimeout(async () => {
|
|
462
|
-
this.appList.push(...e),
|
|
463
|
-
}, 1e3)) : (this.appList.length === 0 && await this.getRemoteAppList(),
|
|
473
|
+
this.appList.push(...e), a();
|
|
474
|
+
}, 1e3)) : (this.appList.length === 0 && await this.getRemoteAppList(), a());
|
|
464
475
|
});
|
|
465
476
|
},
|
|
466
477
|
async getRemoteAppList() {
|
|
467
|
-
return
|
|
478
|
+
return G(Kt.appList, {
|
|
468
479
|
Query: {
|
|
469
480
|
AppCode: this.appInfo.AppCode,
|
|
470
481
|
Enabled: 1
|
|
471
482
|
}
|
|
472
483
|
}).then((e) => {
|
|
473
|
-
if ((e == null ? void 0 : e.status) ===
|
|
484
|
+
if ((e == null ? void 0 : e.status) === T.SUCCESS && e.data)
|
|
474
485
|
this.appList.length = 0, this.appList.push(...e.data);
|
|
475
|
-
else if ((e == null ? void 0 : e.errno) ==
|
|
486
|
+
else if ((e == null ? void 0 : e.errno) == Re) {
|
|
476
487
|
_().logout(!1);
|
|
477
488
|
return;
|
|
478
489
|
}
|
|
@@ -483,32 +494,32 @@ const re = {
|
|
|
483
494
|
E.error("加载应用列表失败");
|
|
484
495
|
return;
|
|
485
496
|
}
|
|
486
|
-
let
|
|
487
|
-
const
|
|
488
|
-
if (
|
|
489
|
-
for (let n =
|
|
490
|
-
if (
|
|
491
|
-
|
|
497
|
+
let a = "";
|
|
498
|
+
const t = window.location.pathname.split("/");
|
|
499
|
+
if (t.length > 1) {
|
|
500
|
+
for (let n = t.length - 1; n >= 0; n--)
|
|
501
|
+
if (t[n] !== "") {
|
|
502
|
+
a = t[n];
|
|
492
503
|
break;
|
|
493
504
|
}
|
|
494
505
|
}
|
|
495
506
|
let s = null;
|
|
496
|
-
|
|
507
|
+
a && a != "login" ? s = this.appList.find((n) => n.AppCode === a) : s = this.appList.find((n) => n.Default), a = s ? s.AppCode : this.appList[0].AppCode, await this.setActiveApp(a), (!e || e.startsWith("/#/") || e.includes("/error/") || window.location.hash.includes("/error/")) && this.push(this.appInfo.defaultPage);
|
|
497
508
|
},
|
|
498
509
|
/**
|
|
499
510
|
* 设置当前应用
|
|
500
511
|
* @param key 应用码
|
|
501
512
|
* @returns
|
|
502
513
|
*/
|
|
503
|
-
async setActiveApp(e,
|
|
514
|
+
async setActiveApp(e, a) {
|
|
504
515
|
this.menuLoaded = !1;
|
|
505
|
-
const
|
|
506
|
-
|
|
507
|
-
...
|
|
516
|
+
const t = this.appList.find((s) => s.AppCode === e);
|
|
517
|
+
t && (t.AppCode !== this.appInfo.AppCode && (this.appInfo = {
|
|
518
|
+
...t,
|
|
508
519
|
flattenRoutes: {},
|
|
509
|
-
Routes:
|
|
520
|
+
Routes: a ?? [],
|
|
510
521
|
defaultPage: ""
|
|
511
|
-
}), (!V() || !
|
|
522
|
+
}), (!V() || !kt()) && (await _().getRolePermits(t.Id), this.appInfo.Routes.length && this.setAppRoutes(this.appInfo.Routes)));
|
|
512
523
|
},
|
|
513
524
|
/**
|
|
514
525
|
* 设置当前应用路由信息
|
|
@@ -521,20 +532,20 @@ const re = {
|
|
|
521
532
|
Routes: e,
|
|
522
533
|
defaultPage: ""
|
|
523
534
|
};
|
|
524
|
-
const
|
|
525
|
-
for (const
|
|
526
|
-
|
|
527
|
-
if (Object.keys(
|
|
528
|
-
const s = t
|
|
529
|
-
s.children || !s.component || (s.meta && s.meta.keepAlive === !1 ? this.ExcludeComponents.push(
|
|
535
|
+
const a = this.appInfo.flattenRoutes;
|
|
536
|
+
for (const t of e)
|
|
537
|
+
tt(t, a, void 0);
|
|
538
|
+
if (Object.keys(a).forEach((t) => {
|
|
539
|
+
const s = a[t];
|
|
540
|
+
s.children || !s.component || (s.meta && s.meta.keepAlive === !1 ? this.ExcludeComponents.push(t) : this.CachedComponents.push(t));
|
|
530
541
|
}), _().isLogin) {
|
|
531
|
-
const
|
|
532
|
-
if (
|
|
542
|
+
const t = at(this.appInfo.Routes);
|
|
543
|
+
if (Nt(t), this.appInfo.defaultPage = st(t) || "", this.appInfo.defaultPage) {
|
|
533
544
|
if (this.menuLoaded = !0, V()) {
|
|
534
545
|
const s = this.formatRoute(this.appInfo.defaultPage);
|
|
535
546
|
re.mainAppPush(s);
|
|
536
547
|
}
|
|
537
|
-
|
|
548
|
+
Ut(this.appInfo.defaultPage);
|
|
538
549
|
}
|
|
539
550
|
}
|
|
540
551
|
},
|
|
@@ -544,18 +555,18 @@ const re = {
|
|
|
544
555
|
* @returns
|
|
545
556
|
*/
|
|
546
557
|
formatRoute(e) {
|
|
547
|
-
let
|
|
548
|
-
return e.includes("#") ? e.startsWith("#") && (
|
|
558
|
+
let a = e;
|
|
559
|
+
return e.includes("#") ? e.startsWith("#") && (a = "/" + this.appInfo.Action.toLowerCase() + "/" + this.appInfo.AppCode + "/" + e) : this.appInfo.AppCode ? a = "/" + this.appInfo.Action.toLowerCase() + "/" + this.appInfo.AppCode + "/#" + e : a = "/#" + e, a;
|
|
549
560
|
},
|
|
550
561
|
/**
|
|
551
562
|
* 应用导航,菜单路由,都使用此处导航
|
|
552
563
|
* @param path 路由地址
|
|
553
564
|
*/
|
|
554
565
|
push(e) {
|
|
555
|
-
this.findRoute(e) && Ve().setTabActive(e),
|
|
566
|
+
this.findRoute(e) && Ve().setTabActive(e), vt(() => {
|
|
556
567
|
if (we.push({ path: e }), V()) {
|
|
557
|
-
const
|
|
558
|
-
re.mainAppPush(
|
|
568
|
+
const t = this.formatRoute(e);
|
|
569
|
+
re.mainAppPush(t);
|
|
559
570
|
}
|
|
560
571
|
});
|
|
561
572
|
},
|
|
@@ -573,19 +584,19 @@ const re = {
|
|
|
573
584
|
* @param route 路由
|
|
574
585
|
* @returns 组件实例
|
|
575
586
|
*/
|
|
576
|
-
cacheComponent(e,
|
|
577
|
-
let
|
|
578
|
-
if (!
|
|
579
|
-
if (this.CachedComponents.includes(
|
|
580
|
-
|
|
587
|
+
cacheComponent(e, a) {
|
|
588
|
+
let t = Fe.get(a.path);
|
|
589
|
+
if (!t)
|
|
590
|
+
if (this.CachedComponents.includes(a.path))
|
|
591
|
+
t = {
|
|
581
592
|
// 设置组件包装器的名称为路由路径
|
|
582
|
-
name:
|
|
593
|
+
name: a.path,
|
|
583
594
|
render() {
|
|
584
595
|
return H(e);
|
|
585
596
|
}
|
|
586
|
-
}, Fe.set(
|
|
597
|
+
}, Fe.set(a.path, t);
|
|
587
598
|
else return e;
|
|
588
|
-
return
|
|
599
|
+
return t;
|
|
589
600
|
},
|
|
590
601
|
/**
|
|
591
602
|
* 删除缓存组件
|
|
@@ -598,12 +609,12 @@ const re = {
|
|
|
598
609
|
* 路由路径层级查询,返回面包屑
|
|
599
610
|
*/
|
|
600
611
|
matchedRoutes(e) {
|
|
601
|
-
const
|
|
602
|
-
if (
|
|
603
|
-
const s = this.matchedRoutes(
|
|
604
|
-
|
|
612
|
+
const a = [], t = this.findRoute(e);
|
|
613
|
+
if (t && (a.push(t), t.parent)) {
|
|
614
|
+
const s = this.matchedRoutes(t.parent.path);
|
|
615
|
+
a.push(...s);
|
|
605
616
|
}
|
|
606
|
-
return
|
|
617
|
+
return a.reverse();
|
|
607
618
|
},
|
|
608
619
|
clean() {
|
|
609
620
|
this.appInfo = {
|
|
@@ -627,7 +638,7 @@ const re = {
|
|
|
627
638
|
}
|
|
628
639
|
},
|
|
629
640
|
persist: !1
|
|
630
|
-
}),
|
|
641
|
+
}), Jt = "Token解析失败", Re = 1400, Ke = {
|
|
631
642
|
login: {
|
|
632
643
|
api: "PLATFORM_API",
|
|
633
644
|
url: "/openapi/LoginSrv/login",
|
|
@@ -645,43 +656,43 @@ const re = {
|
|
|
645
656
|
url: "/api/LoginSrv/logout",
|
|
646
657
|
loadingText: "正在退出..."
|
|
647
658
|
}
|
|
648
|
-
},
|
|
649
|
-
let
|
|
659
|
+
}, qt = (e) => {
|
|
660
|
+
let a = {
|
|
650
661
|
Option: {
|
|
651
662
|
Mode: "MicroApp"
|
|
652
663
|
},
|
|
653
664
|
Query: e
|
|
654
665
|
};
|
|
655
|
-
return
|
|
656
|
-
},
|
|
657
|
-
let
|
|
666
|
+
return G(Ke.login, a).then((t) => (t == null ? void 0 : t.status) === T.SUCCESS ? t : null);
|
|
667
|
+
}, jt = (e) => {
|
|
668
|
+
let a = {
|
|
658
669
|
Query: {
|
|
659
670
|
AppId: e
|
|
660
671
|
}
|
|
661
672
|
};
|
|
662
|
-
return
|
|
663
|
-
if ((
|
|
664
|
-
return
|
|
665
|
-
if ((
|
|
673
|
+
return G(Ke.auth, a).then((t) => {
|
|
674
|
+
if ((t == null ? void 0 : t.status) === T.SUCCESS)
|
|
675
|
+
return t.data;
|
|
676
|
+
if ((t == null ? void 0 : t.errno) == Re) {
|
|
666
677
|
_().logout(!1);
|
|
667
678
|
return;
|
|
668
679
|
}
|
|
669
|
-
return E.error("获取授权信息失败," + (
|
|
680
|
+
return E.error("获取授权信息失败," + (t == null ? void 0 : t.msg)), null;
|
|
670
681
|
});
|
|
671
|
-
},
|
|
682
|
+
}, Gt = () => {
|
|
672
683
|
let e = {
|
|
673
684
|
Option: {},
|
|
674
685
|
Query: {}
|
|
675
686
|
};
|
|
676
|
-
return
|
|
677
|
-
},
|
|
687
|
+
return G(Ke.logout, e).then((a) => (a == null ? void 0 : a.status) === T.SUCCESS ? a.data : null);
|
|
688
|
+
}, Bt = (e) => {
|
|
678
689
|
try {
|
|
679
|
-
const
|
|
680
|
-
return
|
|
681
|
-
} catch (
|
|
682
|
-
return console.error(
|
|
690
|
+
const a = JSON.parse(atob(e.token.split(".")[1]));
|
|
691
|
+
return a.user = JSON.parse(a.user), e.UserInfo = a.user, !0;
|
|
692
|
+
} catch (a) {
|
|
693
|
+
return console.error(Jt, a), !1;
|
|
683
694
|
}
|
|
684
|
-
}, M = c(""),
|
|
695
|
+
}, M = c(""), te = c(null), _ = ce("userInfo", {
|
|
685
696
|
state: () => ({
|
|
686
697
|
isLogin: !1,
|
|
687
698
|
userInfo: {
|
|
@@ -706,15 +717,15 @@ const re = {
|
|
|
706
717
|
* @param loginInfo 登录信息
|
|
707
718
|
* @returns
|
|
708
719
|
*/
|
|
709
|
-
async login(e,
|
|
710
|
-
const
|
|
711
|
-
if (
|
|
712
|
-
const s =
|
|
720
|
+
async login(e, a) {
|
|
721
|
+
const t = await qt(e);
|
|
722
|
+
if (t) {
|
|
723
|
+
const s = t;
|
|
713
724
|
if (s.errno)
|
|
714
725
|
return s;
|
|
715
726
|
{
|
|
716
|
-
const n =
|
|
717
|
-
if (this.token = n.token, ve(this.token), this.isLogin = !0,
|
|
727
|
+
const n = t.data;
|
|
728
|
+
if (this.token = n.token, ve(this.token), this.isLogin = !0, Bt(n))
|
|
718
729
|
this.userInfo = {
|
|
719
730
|
...this.userInfo,
|
|
720
731
|
...n.UserInfo
|
|
@@ -723,7 +734,7 @@ const re = {
|
|
|
723
734
|
E.error("用户信息解析失败");
|
|
724
735
|
return;
|
|
725
736
|
}
|
|
726
|
-
|
|
737
|
+
a && K().toDefaultApp();
|
|
727
738
|
}
|
|
728
739
|
}
|
|
729
740
|
},
|
|
@@ -735,17 +746,17 @@ const re = {
|
|
|
735
746
|
async getRolePermits(e) {
|
|
736
747
|
if (!this.isLogin || !this.token)
|
|
737
748
|
return !1;
|
|
738
|
-
if (
|
|
749
|
+
if (te.value && te.value.appId === e)
|
|
739
750
|
return !0;
|
|
740
751
|
try {
|
|
741
|
-
const
|
|
742
|
-
return
|
|
752
|
+
const a = await jt(e);
|
|
753
|
+
return a ? (te.value = {
|
|
743
754
|
appId: e,
|
|
744
|
-
permits:
|
|
745
|
-
lastTime:
|
|
755
|
+
permits: a.permits || [],
|
|
756
|
+
lastTime: a.lastTime
|
|
746
757
|
}, !0) : !1;
|
|
747
|
-
} catch (
|
|
748
|
-
return console.error("获取授权信息出错",
|
|
758
|
+
} catch (a) {
|
|
759
|
+
return console.error("获取授权信息出错", a), !1;
|
|
749
760
|
}
|
|
750
761
|
},
|
|
751
762
|
/**
|
|
@@ -762,10 +773,10 @@ const re = {
|
|
|
762
773
|
* @param permitCode 资源权限编码
|
|
763
774
|
* @returns 是否有功能权限
|
|
764
775
|
*/
|
|
765
|
-
hasPermit(e,
|
|
776
|
+
hasPermit(e, a) {
|
|
766
777
|
var s;
|
|
767
|
-
const
|
|
768
|
-
return !
|
|
778
|
+
const t = te.value;
|
|
779
|
+
return !t || !t.permits ? !1 : ((s = t.permits[e]) == null ? void 0 : s.includes(a)) ?? !1;
|
|
769
780
|
},
|
|
770
781
|
/**
|
|
771
782
|
* 获取用户信息
|
|
@@ -780,11 +791,11 @@ const re = {
|
|
|
780
791
|
* @param userInfo 用户信息
|
|
781
792
|
* @param token 用户Token
|
|
782
793
|
*/
|
|
783
|
-
setUserInfo(e,
|
|
794
|
+
setUserInfo(e, a) {
|
|
784
795
|
M.value || (M.value = e.UserLevel, this.userInfo = {
|
|
785
796
|
...this.userInfo,
|
|
786
797
|
...e
|
|
787
|
-
}, this.token =
|
|
798
|
+
}, this.token = a, ve(this.token), this.isLogin = !0);
|
|
788
799
|
},
|
|
789
800
|
/**
|
|
790
801
|
* 获取用户Token
|
|
@@ -822,7 +833,7 @@ const re = {
|
|
|
822
833
|
Code: "",
|
|
823
834
|
TenantId: "",
|
|
824
835
|
UserLevel: ""
|
|
825
|
-
}, this.token = "", ve(this.token), this.isLogin = !1,
|
|
836
|
+
}, this.token = "", ve(this.token), this.isLogin = !1, te.value = null, M.value = "", K().clean(), Promise.resolve();
|
|
826
837
|
},
|
|
827
838
|
/**
|
|
828
839
|
* 登出操作
|
|
@@ -833,9 +844,9 @@ const re = {
|
|
|
833
844
|
if (V())
|
|
834
845
|
return re.userLogout(), Promise.resolve();
|
|
835
846
|
try {
|
|
836
|
-
e && await
|
|
837
|
-
} catch (
|
|
838
|
-
console.error("调用登出接口失败",
|
|
847
|
+
e && await Gt();
|
|
848
|
+
} catch (a) {
|
|
849
|
+
console.error("调用登出接口失败", a);
|
|
839
850
|
} finally {
|
|
840
851
|
await this.clean(), e && setTimeout(async () => {
|
|
841
852
|
E.success("已退出登录");
|
|
@@ -855,74 +866,74 @@ const re = {
|
|
|
855
866
|
e.store.init();
|
|
856
867
|
}
|
|
857
868
|
}
|
|
858
|
-
}),
|
|
869
|
+
}), Oe = (e, a) => {
|
|
859
870
|
var n;
|
|
860
|
-
const
|
|
871
|
+
const t = e.page;
|
|
861
872
|
return {
|
|
862
873
|
url: "",
|
|
863
874
|
...e.url,
|
|
864
|
-
...(n =
|
|
865
|
-
...
|
|
866
|
-
loadingText:
|
|
875
|
+
...(n = t.urls) == null ? void 0 : n[a.urlKey],
|
|
876
|
+
...a.url,
|
|
877
|
+
loadingText: a.loadingText
|
|
867
878
|
};
|
|
868
|
-
},
|
|
869
|
-
const
|
|
879
|
+
}, Te = (e, a) => {
|
|
880
|
+
const t = e.page, s = a.url;
|
|
870
881
|
if (!s || !s.url) {
|
|
871
|
-
const o = `URL未设置: ${
|
|
882
|
+
const o = `URL未设置: ${a.urlKey}`;
|
|
872
883
|
return console.warn(o), Promise.reject(new Error(o));
|
|
873
884
|
}
|
|
874
|
-
s.api || (s.api =
|
|
885
|
+
s.api || (s.api = t.api), s.authorize === void 0 && (s.authorize = t.authorize);
|
|
875
886
|
let n = fe(
|
|
876
887
|
JSON.parse(JSON.stringify(s.params ?? {})),
|
|
877
|
-
JSON.parse(JSON.stringify(
|
|
888
|
+
JSON.parse(JSON.stringify(a.params ?? {}))
|
|
878
889
|
);
|
|
879
|
-
return
|
|
880
|
-
}, Qe = (e,
|
|
881
|
-
|
|
882
|
-
const
|
|
883
|
-
return
|
|
884
|
-
}, $
|
|
885
|
-
const
|
|
886
|
-
if (
|
|
890
|
+
return a.processParams && (n = a.processParams(n)), a.loadingState && (a.loadingState.value = !0), a.hideErrorToast && (s.hideErrorToast = !0), G(s, n).then((o) => (a.loadingState && (a.loadingState.value = !1), (o == null ? void 0 : o.errno) == Re ? (_().logout(!1), null) : o)).catch((o) => (a.loadingState && (a.loadingState.value = !1), null));
|
|
891
|
+
}, Qe = (e, a) => {
|
|
892
|
+
a.params || (a.params = {}), a.params.Query || (a.params.Query = {});
|
|
893
|
+
const t = Oe(e, a);
|
|
894
|
+
return a.url = t, Te(e, a);
|
|
895
|
+
}, $a = (e, a) => (a.params || (a.params = {}), a.params.Query || (a.params.Query = {}), a.loadingText = a.loadingText === !1 ? !1 : a.loadingText || "开始执行...", a.url = Oe(e, a), Te(e, a).then((t) => ((t == null ? void 0 : t.status) === T.SUCCESS && (a.hideErrorToast || E.success("执行成功!")), t))), nt = (e, a = {}) => {
|
|
896
|
+
const t = a.primaryKey || "Id";
|
|
897
|
+
if (a.params || (a.params = {}), a.params.Query || (a.params.Query = {}), !a.params.Data)
|
|
887
898
|
return E.error("错误!无保存数据!"), Promise.resolve(null);
|
|
888
899
|
const s = {
|
|
889
|
-
...
|
|
890
|
-
urlKey:
|
|
891
|
-
loadingText:
|
|
900
|
+
...a,
|
|
901
|
+
urlKey: a.urlKey || "save",
|
|
902
|
+
loadingText: a.loadingText === !1 ? !1 : a.loadingText || "数据保存中..."
|
|
892
903
|
};
|
|
893
|
-
s.params.Query[
|
|
894
|
-
const n =
|
|
895
|
-
return s.url = n,
|
|
896
|
-
},
|
|
897
|
-
const s =
|
|
898
|
-
|
|
904
|
+
s.params.Query[t] = s.params.Data[t];
|
|
905
|
+
const n = Oe(e, s);
|
|
906
|
+
return s.url = n, Te(e, s).then((o) => ((o == null ? void 0 : o.status) === T.SUCCESS && (a.hideErrorToast || E.success("保存成功!")), o));
|
|
907
|
+
}, Wt = (e, a, t = {}) => {
|
|
908
|
+
const s = t.primaryKey || "Id";
|
|
909
|
+
t.params || (t.params = {}), t.params.Query || (t.params.Query = {});
|
|
899
910
|
const n = {
|
|
900
|
-
...
|
|
911
|
+
...t,
|
|
901
912
|
urlKey: "delete",
|
|
902
|
-
loadingText:
|
|
913
|
+
loadingText: t.loadingText === !1 ? !1 : t.loadingText || "数据删除中..."
|
|
903
914
|
};
|
|
904
|
-
if (Array.isArray(
|
|
915
|
+
if (Array.isArray(a) ? n.params.Query[s] = a : n.params.Query[s] = a[s], F(n.params.Query) || F(n.params.Query[s]))
|
|
905
916
|
return E.error("错误!禁止无条件删除数据!"), Promise.resolve(null);
|
|
906
|
-
const o =
|
|
907
|
-
return n.url = o,
|
|
908
|
-
},
|
|
917
|
+
const o = Oe(e, n);
|
|
918
|
+
return n.url = o, Te(e, n).then((r) => ((r == null ? void 0 : r.status) === T.SUCCESS && (t.hideErrorToast || E.success("删除成功!")), r));
|
|
919
|
+
}, zt = (e, a) => Qe(e, {
|
|
909
920
|
urlKey: "tree",
|
|
910
921
|
params: {},
|
|
911
922
|
loadingState: e.isTreeLoading,
|
|
912
923
|
loadingText: !1,
|
|
913
|
-
processParams: () => fe(e.treeQuery,
|
|
914
|
-
}).then((
|
|
915
|
-
for (const
|
|
916
|
-
if (
|
|
917
|
-
if (
|
|
918
|
-
const s =
|
|
924
|
+
processParams: () => fe(e.treeQuery, a)
|
|
925
|
+
}).then((t) => (t == null ? void 0 : t.status) === T.SUCCESS ? (e.data.value = t.data || [], e.afterLoad && e.afterLoad(e.data.value), e.data.value) : (e.afterLoad && e.afterLoad((t == null ? void 0 : t.data) || []), [])), Ct = (e, a) => {
|
|
926
|
+
for (const t of e) {
|
|
927
|
+
if (t.key === a) return t;
|
|
928
|
+
if (t.children) {
|
|
929
|
+
const s = Ct(t.children, a);
|
|
919
930
|
if (s) return s;
|
|
920
931
|
}
|
|
921
932
|
}
|
|
922
933
|
return null;
|
|
923
934
|
};
|
|
924
935
|
let ie;
|
|
925
|
-
const
|
|
936
|
+
const Fa = (e) => {
|
|
926
937
|
ie = new He({}), ie.messages({
|
|
927
938
|
required: "${label}不能为空",
|
|
928
939
|
types: {
|
|
@@ -949,25 +960,25 @@ const Ft = (e) => {
|
|
|
949
960
|
},
|
|
950
961
|
...e
|
|
951
962
|
});
|
|
952
|
-
},
|
|
963
|
+
}, _a = (e) => {
|
|
953
964
|
if (!e || F(e))
|
|
954
965
|
return [];
|
|
955
|
-
const
|
|
966
|
+
const a = [], t = ie.messages(), s = (o, r, l) => {
|
|
956
967
|
const u = r.type;
|
|
957
|
-
if (u &&
|
|
958
|
-
const f =
|
|
968
|
+
if (u && t.types && u in t.types) {
|
|
969
|
+
const f = t.types[u];
|
|
959
970
|
n(f, o, { type: u }, l);
|
|
960
971
|
}
|
|
961
972
|
const i = ["string", "number", "array"];
|
|
962
973
|
for (const f of i)
|
|
963
|
-
if (u === f &&
|
|
964
|
-
const p =
|
|
974
|
+
if (u === f && t[f]) {
|
|
975
|
+
const p = t[f], v = ["len", "min", "max", "range"];
|
|
965
976
|
for (const d of v)
|
|
966
977
|
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);
|
|
967
978
|
}
|
|
968
|
-
if (r.required &&
|
|
979
|
+
if (r.required && t.required && n(t.required, o, {}, l), r.pattern && t.pattern && n(r.message, o, {}, l), r.enum && Array.isArray(r.enum) && t.enum) {
|
|
969
980
|
const f = r.enum.join(", ");
|
|
970
|
-
n(
|
|
981
|
+
n(t.enum, o, { enum: f }, l);
|
|
971
982
|
}
|
|
972
983
|
}, n = (o, r, l, u) => {
|
|
973
984
|
if (o)
|
|
@@ -998,70 +1009,70 @@ const Ft = (e) => {
|
|
|
998
1009
|
console.error("处理验证规则出错:", i);
|
|
999
1010
|
}
|
|
1000
1011
|
const u = Array.from(new Set(l));
|
|
1001
|
-
o && u.length > 0 &&
|
|
1012
|
+
o && u.length > 0 && a.push({
|
|
1002
1013
|
field: o,
|
|
1003
1014
|
rules: u
|
|
1004
1015
|
});
|
|
1005
|
-
}),
|
|
1016
|
+
}), a;
|
|
1006
1017
|
}, de = async (e) => {
|
|
1007
|
-
const
|
|
1008
|
-
F(
|
|
1018
|
+
const a = e.formData.value, t = e.formRules.value;
|
|
1019
|
+
F(t) || (Je(e), e.ruleValidator || (e.ruleValidator = new He({}), e.ruleValidator.messages(ie.messages()), e.ruleValidator.define(t)), e.ruleResults.value = await e.ruleValidator.validate(a).then(() => {
|
|
1009
1020
|
}).catch(({ fields: s }) => s));
|
|
1010
|
-
},
|
|
1021
|
+
}, Na = async (e, a, t) => (t || (t = new He({}), t.messages(ie.messages()), t.define(a)), t.validate(e).then(() => {
|
|
1011
1022
|
}).catch(({ fields: s }) => s)), Je = (e) => {
|
|
1012
1023
|
e.ruleResults.value = void 0;
|
|
1013
1024
|
}, X = () => {
|
|
1014
|
-
const e = se(U.EditorControl, void 0),
|
|
1025
|
+
const e = se(U.EditorControl, void 0), a = c(se(U.LabelText, "")), t = c(se(U.RuleKey, "")), s = se(U.ErrInfo, void 0);
|
|
1015
1026
|
return {
|
|
1016
1027
|
editorCtrl: e,
|
|
1017
|
-
labelText:
|
|
1018
|
-
ruleKey:
|
|
1028
|
+
labelText: a,
|
|
1029
|
+
ruleKey: t,
|
|
1019
1030
|
errInfo: s
|
|
1020
1031
|
};
|
|
1021
|
-
},
|
|
1022
|
-
let
|
|
1032
|
+
}, Yt = (e, a) => {
|
|
1033
|
+
let t = c({
|
|
1023
1034
|
msg: "",
|
|
1024
1035
|
errClass: ""
|
|
1025
1036
|
});
|
|
1026
1037
|
if (!e.label || !e.rule)
|
|
1027
|
-
return
|
|
1028
|
-
const s =
|
|
1038
|
+
return t;
|
|
1039
|
+
const s = a == null ? void 0 : a.ruleResults;
|
|
1029
1040
|
return g(
|
|
1030
1041
|
() => s == null ? void 0 : s.value,
|
|
1031
1042
|
(n) => {
|
|
1032
|
-
if (
|
|
1033
|
-
const o =
|
|
1043
|
+
if (t.value.errClass = "", t.value.msg = "", !F(n)) {
|
|
1044
|
+
const o = Xt(
|
|
1034
1045
|
{
|
|
1035
1046
|
label: e.label,
|
|
1036
1047
|
rule: e.rule
|
|
1037
1048
|
},
|
|
1038
|
-
|
|
1049
|
+
a == null ? void 0 : a.formRules.value,
|
|
1039
1050
|
Ze(n)
|
|
1040
1051
|
);
|
|
1041
|
-
|
|
1052
|
+
t.value.errClass = o.errClass.value, t.value.msg = o.msg.value;
|
|
1042
1053
|
}
|
|
1043
1054
|
},
|
|
1044
1055
|
{ deep: !0 }
|
|
1045
|
-
),
|
|
1046
|
-
},
|
|
1056
|
+
), t;
|
|
1057
|
+
}, Xt = (e, a, t) => {
|
|
1047
1058
|
const s = c([]), n = c(""), o = c("");
|
|
1048
|
-
if (!e.rule || !
|
|
1059
|
+
if (!e.rule || !a || !t)
|
|
1049
1060
|
return { msg: n, ruleErrors: s, errClass: o };
|
|
1050
1061
|
e.rule.split("|").forEach((u) => {
|
|
1051
1062
|
if (u = u.trim(), u)
|
|
1052
|
-
if (
|
|
1053
|
-
s.value.push(...
|
|
1063
|
+
if (t[u])
|
|
1064
|
+
s.value.push(...t[u]);
|
|
1054
1065
|
else {
|
|
1055
1066
|
const i = [];
|
|
1056
|
-
for (let f in
|
|
1057
|
-
f !== u && f.startsWith(u + ".") && i.push(...
|
|
1067
|
+
for (let f in t)
|
|
1068
|
+
f !== u && f.startsWith(u + ".") && i.push(...t[f]);
|
|
1058
1069
|
i.length > 0 && s.value.push(...i);
|
|
1059
1070
|
}
|
|
1060
1071
|
});
|
|
1061
1072
|
const l = /\${\w+}/g;
|
|
1062
1073
|
return s.value.forEach((u) => {
|
|
1063
1074
|
n.value && (n.value += " / "), n.value += u.message.replace("${label}", e.label ?? "");
|
|
1064
|
-
const i =
|
|
1075
|
+
const i = a[u.field];
|
|
1065
1076
|
if (i) {
|
|
1066
1077
|
const f = n.value.match(l);
|
|
1067
1078
|
f && f.forEach((p) => {
|
|
@@ -1070,36 +1081,36 @@ const Ft = (e) => {
|
|
|
1070
1081
|
});
|
|
1071
1082
|
}
|
|
1072
1083
|
}), s.value.length > 0 && (o.value = "error"), { msg: n, ruleErrors: s, errClass: o };
|
|
1073
|
-
},
|
|
1084
|
+
}, Da = (e, a) => {
|
|
1074
1085
|
Me(U.LabelText, e.label || ""), Me(U.RuleKey, e.rule || "");
|
|
1075
|
-
const
|
|
1076
|
-
return Me(U.ErrInfo,
|
|
1077
|
-
},
|
|
1078
|
-
|
|
1079
|
-
},
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1082
|
-
},
|
|
1083
|
-
|
|
1084
|
-
},
|
|
1086
|
+
const t = Yt(e, a);
|
|
1087
|
+
return Me(U.ErrInfo, t), t;
|
|
1088
|
+
}, Ua = (e) => {
|
|
1089
|
+
rt(e);
|
|
1090
|
+
}, Ha = (e) => {
|
|
1091
|
+
const a = e.page, t = e.formData.value;
|
|
1092
|
+
t[e.primaryKey ?? a.primaryKey] = null, rt(e);
|
|
1093
|
+
}, Va = (e) => {
|
|
1094
|
+
qe(e), e.visible.value = !1;
|
|
1095
|
+
}, rt = async (e) => {
|
|
1085
1096
|
var s;
|
|
1086
|
-
const
|
|
1097
|
+
const a = e.page;
|
|
1087
1098
|
if (e.isFormSaving.value = !0, Je(e), e.beforeSave && e.beforeSave() === !1)
|
|
1088
1099
|
return e.isFormSaving.value = !1, Promise.resolve();
|
|
1089
1100
|
if (e.formRules.value && await de(e), e.ruleResults.value)
|
|
1090
1101
|
return E.error("提交表单时,验证失败!"), console.error("表单验证失败!", e.ruleResults.value), e.isFormSaving.value = !1, Promise.resolve();
|
|
1091
|
-
const
|
|
1092
|
-
return
|
|
1102
|
+
const t = e.formData.value;
|
|
1103
|
+
return nt(
|
|
1093
1104
|
{
|
|
1094
|
-
page:
|
|
1105
|
+
page: a,
|
|
1095
1106
|
// 转换为AnyControl接口
|
|
1096
1107
|
reload: (s = e.grid) == null ? void 0 : s.reload
|
|
1097
1108
|
},
|
|
1098
1109
|
{
|
|
1099
1110
|
url: e.saveUrl,
|
|
1100
|
-
primaryKey: e.primaryKey ??
|
|
1111
|
+
primaryKey: e.primaryKey ?? a.primaryKey,
|
|
1101
1112
|
params: {
|
|
1102
|
-
Data:
|
|
1113
|
+
Data: t,
|
|
1103
1114
|
Query: {}
|
|
1104
1115
|
},
|
|
1105
1116
|
hideErrorToast: !0,
|
|
@@ -1108,7 +1119,7 @@ const Ft = (e) => {
|
|
|
1108
1119
|
}
|
|
1109
1120
|
).then((n) => {
|
|
1110
1121
|
var o, r;
|
|
1111
|
-
if ((n == null ? void 0 : n.status) ===
|
|
1122
|
+
if ((n == null ? void 0 : n.status) === T.SUCCESS)
|
|
1112
1123
|
E.success("保存成功!"), e.grid && (e.grid.reload.value = !0), e.afterSave && e.afterSave(n), e.autoClose !== !1 && (e.visible.value = !1);
|
|
1113
1124
|
else if (n != null && n.msg && ((o = n == null ? void 0 : n.msg) == null ? void 0 : o.indexOf("Duplicate entry")) > -1) {
|
|
1114
1125
|
const l = (r = n == null ? void 0 : n.msg) == null ? void 0 : r.match(/Duplicate entry '([^']+)' for key '([^']+)'/);
|
|
@@ -1132,28 +1143,28 @@ const Ft = (e) => {
|
|
|
1132
1143
|
} else
|
|
1133
1144
|
E.error((n == null ? void 0 : n.msg) ?? "保存失败!"), e.afterSave && e.afterSave(n);
|
|
1134
1145
|
});
|
|
1135
|
-
},
|
|
1136
|
-
const
|
|
1146
|
+
}, Ka = async (e) => {
|
|
1147
|
+
const a = e.page, t = e.grid;
|
|
1137
1148
|
e.isFormLoading.value = !0;
|
|
1138
|
-
const s = e.formData.value, n = e.primaryKey ??
|
|
1139
|
-
return
|
|
1140
|
-
e.isFormLoading.value = !1, o &&
|
|
1149
|
+
const s = e.formData.value, n = e.primaryKey ?? a.primaryKey;
|
|
1150
|
+
return lt(t, { [n]: s[n] }, e.detailUrl).then((o) => {
|
|
1151
|
+
e.isFormLoading.value = !1, o && ot(e, o);
|
|
1141
1152
|
});
|
|
1142
|
-
},
|
|
1143
|
-
const
|
|
1144
|
-
|
|
1153
|
+
}, Qa = (e) => {
|
|
1154
|
+
const a = e.grid;
|
|
1155
|
+
a && (a.rowData.value = void 0), e && (qe(e), e.visible && (e.visible.value = !1), setTimeout(() => {
|
|
1145
1156
|
e.visible.value = !0;
|
|
1146
1157
|
}, 1));
|
|
1147
|
-
},
|
|
1148
|
-
|
|
1149
|
-
const
|
|
1150
|
-
e.formData.value = JSON.parse(JSON.stringify(
|
|
1151
|
-
},
|
|
1158
|
+
}, ot = (e, a) => {
|
|
1159
|
+
qe(e);
|
|
1160
|
+
const t = { ...e.formData.value, ...a };
|
|
1161
|
+
e.formData.value = JSON.parse(JSON.stringify(t));
|
|
1162
|
+
}, qe = (e) => {
|
|
1152
1163
|
e.formData.value = e.default ? JSON.parse(JSON.stringify(e.default)) : {}, Je(e);
|
|
1153
|
-
},
|
|
1154
|
-
const
|
|
1155
|
-
return e.filter((n) => n.role && !
|
|
1156
|
-
if (!
|
|
1164
|
+
}, Ja = (e, a) => {
|
|
1165
|
+
const t = _();
|
|
1166
|
+
return e.filter((n) => n.role && !t.hasRole(n.role) || n.permit && !t.hasPermit(we.currentRoute.value.path, n.permit) || n.enabled === !1 ? !1 : typeof n.enabled == "function" ? n.enabled() : !0).filter((n) => {
|
|
1167
|
+
if (!a) {
|
|
1157
1168
|
if (n.visible === !1)
|
|
1158
1169
|
return !1;
|
|
1159
1170
|
if (typeof n.visible == "function")
|
|
@@ -1161,32 +1172,32 @@ const Ft = (e) => {
|
|
|
1161
1172
|
}
|
|
1162
1173
|
return !0;
|
|
1163
1174
|
});
|
|
1164
|
-
},
|
|
1165
|
-
const
|
|
1175
|
+
}, qa = (e, a) => {
|
|
1176
|
+
const t = a == null ? void 0 : a.filter((s) => {
|
|
1166
1177
|
const n = e.find(
|
|
1167
1178
|
(o) => o.dataIndex === s.dataIndex || o.key === s.key || o.title === s.title
|
|
1168
1179
|
);
|
|
1169
1180
|
return n ? { ...s, ...n } : !1;
|
|
1170
1181
|
});
|
|
1171
|
-
return [...
|
|
1172
|
-
},
|
|
1182
|
+
return [...t || [], ...e.filter((s) => !(t != null && t.includes(s)))];
|
|
1183
|
+
}, Zt = (e) => it(e).then((a) => a.rows), it = (e) => {
|
|
1173
1184
|
e.gridQuery || (e.gridQuery = {});
|
|
1174
|
-
const
|
|
1185
|
+
const a = e.remotePage ? "find" : "list";
|
|
1175
1186
|
return Qe(e, {
|
|
1176
|
-
urlKey:
|
|
1187
|
+
urlKey: a,
|
|
1177
1188
|
url: e.gridUrl,
|
|
1178
1189
|
params: e.gridQuery,
|
|
1179
1190
|
loadingState: e.isGridLoading,
|
|
1180
|
-
processParams: (
|
|
1191
|
+
processParams: (t) => {
|
|
1181
1192
|
var n;
|
|
1182
|
-
return e.remotePage && (
|
|
1193
|
+
return e.remotePage && (t.Query.$limit = [(e.pageNo.value - 1) * e.pageSize.value, e.pageSize.value]), fe((n = e.gridUrl) == null ? void 0 : n.params, t, e.gridQuery);
|
|
1183
1194
|
}
|
|
1184
|
-
}).then((
|
|
1185
|
-
if ((
|
|
1186
|
-
let s =
|
|
1187
|
-
return s.rows ? (e.tableData.value = s.rows, e.total.value = s.total) : (e.tableData.value =
|
|
1195
|
+
}).then((t) => {
|
|
1196
|
+
if ((t == null ? void 0 : t.status) === T.SUCCESS) {
|
|
1197
|
+
let s = t.data;
|
|
1198
|
+
return s.rows ? (e.tableData.value = s.rows, e.total.value = s.total) : (e.tableData.value = t.data, e.total.value = t.data.length, s = {
|
|
1188
1199
|
total: e.total.value,
|
|
1189
|
-
rows:
|
|
1200
|
+
rows: t.data
|
|
1190
1201
|
}), e.afterLoad && e.afterLoad(s), s;
|
|
1191
1202
|
}
|
|
1192
1203
|
return e.tableData.value = [], e.total.value = 0, e.afterLoad && e.afterLoad({
|
|
@@ -1197,72 +1208,72 @@ const Ft = (e) => {
|
|
|
1197
1208
|
rows: []
|
|
1198
1209
|
};
|
|
1199
1210
|
});
|
|
1200
|
-
},
|
|
1211
|
+
}, ea = (e, a, t = {}) => nt(e, {
|
|
1201
1212
|
urlKey: "update",
|
|
1202
1213
|
url: e.updateUrl,
|
|
1203
1214
|
params: {
|
|
1204
|
-
Query: { [e.primaryKey]:
|
|
1205
|
-
Data:
|
|
1215
|
+
Query: { [e.primaryKey]: a[e.primaryKey] },
|
|
1216
|
+
Data: a
|
|
1206
1217
|
},
|
|
1207
1218
|
loadingState: e.isGridSaving,
|
|
1208
|
-
...
|
|
1209
|
-
}).then((s) => ((s == null ? void 0 : s.status) ===
|
|
1210
|
-
e.reload.value = !0, e.afterUpdate && e.afterUpdate(
|
|
1211
|
-
}, 50), s)),
|
|
1212
|
-
const
|
|
1213
|
-
return
|
|
1219
|
+
...t
|
|
1220
|
+
}).then((s) => ((s == null ? void 0 : s.status) === T.SUCCESS && setTimeout(() => {
|
|
1221
|
+
e.reload.value = !0, e.afterUpdate && e.afterUpdate(a);
|
|
1222
|
+
}, 50), s)), ja = (e, a) => {
|
|
1223
|
+
const t = {};
|
|
1224
|
+
return t[e.primaryKey] = a[e.primaryKey], t[e.statusKey] = a[e.statusKey], ea(e, t, {
|
|
1214
1225
|
loadingText: !1,
|
|
1215
1226
|
hideErrorToast: !0
|
|
1216
1227
|
});
|
|
1217
|
-
},
|
|
1228
|
+
}, lt = async (e, a, t) => await Qe(e, {
|
|
1218
1229
|
urlKey: "detail",
|
|
1219
|
-
url:
|
|
1220
|
-
params:
|
|
1230
|
+
url: t,
|
|
1231
|
+
params: a,
|
|
1221
1232
|
loadingState: e.isGridLoading
|
|
1222
|
-
}),
|
|
1223
|
-
const
|
|
1224
|
-
return
|
|
1225
|
-
},
|
|
1226
|
-
let
|
|
1227
|
-
e.rowData.value =
|
|
1228
|
-
},
|
|
1233
|
+
}), Ga = (e, a) => {
|
|
1234
|
+
const t = a;
|
|
1235
|
+
return lt(e, { [e.primaryKey]: t[e.primaryKey] }).then((s) => ((s == null ? void 0 : s.status) === T.SUCCESS && s.data && (e.expandRows.value[t[e.primaryKey]] = s), s));
|
|
1236
|
+
}, Ba = (e, a) => {
|
|
1237
|
+
let t = e.editor;
|
|
1238
|
+
e.rowData.value = a, t && (ot(t, a), t.visible.value = !0);
|
|
1239
|
+
}, Wa = (e, a) => Wt(e, a, {
|
|
1229
1240
|
url: e.deleteUrl,
|
|
1230
1241
|
primaryKey: e.primaryKey
|
|
1231
|
-
}).then((
|
|
1232
|
-
e.reload.value = !0, e.afterDelete && !Array.isArray(
|
|
1233
|
-
}, 50),
|
|
1242
|
+
}).then((t) => ((t == null ? void 0 : t.status) === T.SUCCESS && setTimeout(() => {
|
|
1243
|
+
e.reload.value = !0, e.afterDelete && !Array.isArray(a) && e.afterDelete(a);
|
|
1244
|
+
}, 50), t));
|
|
1234
1245
|
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 || {});
|
|
1235
|
-
class
|
|
1246
|
+
class ta {
|
|
1236
1247
|
constructor() {
|
|
1237
|
-
|
|
1248
|
+
k(this, "listeners", {});
|
|
1238
1249
|
}
|
|
1239
1250
|
// 检查事件名是否符合前缀
|
|
1240
|
-
isValidPrefix(
|
|
1241
|
-
return Object.values(Ne).some((
|
|
1251
|
+
isValidPrefix(a) {
|
|
1252
|
+
return Object.values(Ne).some((t) => a.startsWith(t + "."));
|
|
1242
1253
|
}
|
|
1243
1254
|
/**
|
|
1244
1255
|
* 事件订阅
|
|
1245
1256
|
* @param event 事件名
|
|
1246
1257
|
* @param listener 处理器
|
|
1247
1258
|
*/
|
|
1248
|
-
on(
|
|
1249
|
-
if (!this.isValidPrefix(
|
|
1250
|
-
console.error(`事件前缀不正确: ${
|
|
1259
|
+
on(a, t) {
|
|
1260
|
+
if (!this.isValidPrefix(a)) {
|
|
1261
|
+
console.error(`事件前缀不正确: ${a}, 事件名必须以 ${Object.values(Ne).join(", ")} 开头`);
|
|
1251
1262
|
return;
|
|
1252
1263
|
}
|
|
1253
|
-
this.listeners[
|
|
1264
|
+
this.listeners[a] || (this.listeners[a] = []), this.listeners[a].push(t);
|
|
1254
1265
|
}
|
|
1255
1266
|
/**
|
|
1256
1267
|
* 取消订阅事件
|
|
1257
1268
|
* @param event 事件名
|
|
1258
1269
|
* @param listener 处理器
|
|
1259
1270
|
*/
|
|
1260
|
-
off(
|
|
1261
|
-
if (!this.isValidPrefix(
|
|
1262
|
-
console.error(`事件前缀不正确: ${
|
|
1271
|
+
off(a, t) {
|
|
1272
|
+
if (!this.isValidPrefix(a)) {
|
|
1273
|
+
console.error(`事件前缀不正确: ${a}`);
|
|
1263
1274
|
return;
|
|
1264
1275
|
}
|
|
1265
|
-
this.listeners[
|
|
1276
|
+
this.listeners[a] && (this.listeners[a] = this.listeners[a].filter((s) => s !== t));
|
|
1266
1277
|
}
|
|
1267
1278
|
//
|
|
1268
1279
|
/**
|
|
@@ -1270,87 +1281,87 @@ class at {
|
|
|
1270
1281
|
* @param event 事件名
|
|
1271
1282
|
* @param args 参数
|
|
1272
1283
|
*/
|
|
1273
|
-
emit(
|
|
1274
|
-
if (!this.isValidPrefix(
|
|
1275
|
-
console.error(`事件前缀不正确: ${
|
|
1284
|
+
emit(a, ...t) {
|
|
1285
|
+
if (!this.isValidPrefix(a)) {
|
|
1286
|
+
console.error(`事件前缀不正确: ${a}`);
|
|
1276
1287
|
return;
|
|
1277
1288
|
}
|
|
1278
|
-
this.listeners[
|
|
1289
|
+
this.listeners[a] && this.listeners[a].forEach((s) => s(a, ...t));
|
|
1279
1290
|
}
|
|
1280
1291
|
}
|
|
1281
|
-
const W = new
|
|
1282
|
-
if (
|
|
1283
|
-
const s =
|
|
1292
|
+
const W = new ta(), ee = (e, a, t) => {
|
|
1293
|
+
if (a.inputFactory && (t != null && t.reloadEvent)) {
|
|
1294
|
+
const s = a.inputFactory.value;
|
|
1284
1295
|
s.reloadHandler = (n, o) => {
|
|
1285
|
-
|
|
1286
|
-
}, W.on(
|
|
1296
|
+
aa(a.url, a, o);
|
|
1297
|
+
}, W.on(t.reloadEvent, s.reloadHandler);
|
|
1287
1298
|
}
|
|
1288
|
-
if (
|
|
1299
|
+
if (t != null && t.data)
|
|
1289
1300
|
g(
|
|
1290
|
-
() =>
|
|
1301
|
+
() => t.data,
|
|
1291
1302
|
() => {
|
|
1292
|
-
|
|
1303
|
+
je(a, t.data, !0);
|
|
1293
1304
|
},
|
|
1294
1305
|
{ deep: !0, immediate: !0 }
|
|
1295
1306
|
);
|
|
1296
|
-
else if (
|
|
1297
|
-
e &&
|
|
1307
|
+
else if (a.url && a.url.url)
|
|
1308
|
+
e && ut(a.url, a, a.params ?? {});
|
|
1298
1309
|
else {
|
|
1299
1310
|
const s = c(se(U.LabelText, ""));
|
|
1300
1311
|
E.error("`" + s.value + "` 未配置选项数据!", {
|
|
1301
1312
|
duration: 5e3
|
|
1302
1313
|
});
|
|
1303
1314
|
}
|
|
1304
|
-
},
|
|
1305
|
-
if (
|
|
1315
|
+
}, je = (e, a, t) => {
|
|
1316
|
+
if (t) {
|
|
1306
1317
|
const s = {
|
|
1307
1318
|
...e.fieldMap
|
|
1308
1319
|
};
|
|
1309
|
-
|
|
1320
|
+
a = Lt(s, a);
|
|
1310
1321
|
}
|
|
1311
|
-
|
|
1322
|
+
a = JSON.parse(JSON.stringify(a ?? [])), e.all && a.unshift({
|
|
1312
1323
|
label: "全部",
|
|
1313
1324
|
value: e.allValue ?? void 0
|
|
1314
|
-
}), e.options.value =
|
|
1315
|
-
},
|
|
1316
|
-
Array.isArray(
|
|
1317
|
-
}, he = (e,
|
|
1318
|
-
var
|
|
1319
|
-
(
|
|
1320
|
-
},
|
|
1321
|
-
const s = JSON.parse(JSON.stringify(e.params ?? {})), n = JSON.parse(JSON.stringify(
|
|
1322
|
-
|
|
1323
|
-
|
|
1325
|
+
}), e.options.value = a;
|
|
1326
|
+
}, aa = (e, a, t) => {
|
|
1327
|
+
Array.isArray(t) ? je(a, t, !0) : ut(e, a, t);
|
|
1328
|
+
}, he = (e, a) => {
|
|
1329
|
+
var t;
|
|
1330
|
+
(t = e.inputFactory) != null && t.value && a.reloadEvent && e.inputFactory.value.reloadHandler && W.off(a.reloadEvent, e.inputFactory.value.reloadHandler);
|
|
1331
|
+
}, ut = (e, a, t) => {
|
|
1332
|
+
const s = JSON.parse(JSON.stringify(e.params ?? {})), n = JSON.parse(JSON.stringify(a.params ?? {})), o = fe(s, n, t);
|
|
1333
|
+
sa(e, a, a.fieldMap, o).then((r) => {
|
|
1334
|
+
je(a, r, !1);
|
|
1324
1335
|
});
|
|
1325
|
-
},
|
|
1336
|
+
}, sa = (e, a, t, s) => {
|
|
1326
1337
|
const { fieldMap: n, ...o } = e, l = {
|
|
1327
1338
|
...{
|
|
1328
1339
|
url: "",
|
|
1329
1340
|
cacheTime: 6e4,
|
|
1330
1341
|
fieldMap: {
|
|
1331
1342
|
...e.fieldMap,
|
|
1332
|
-
...
|
|
1343
|
+
...t
|
|
1333
1344
|
}
|
|
1334
1345
|
},
|
|
1335
1346
|
...o
|
|
1336
1347
|
};
|
|
1337
|
-
return l.loadingText = !1, s || (s = {}), s.Query || (s.Query = {}),
|
|
1338
|
-
if ((u == null ? void 0 : u.status) ===
|
|
1348
|
+
return l.loadingText = !1, s || (s = {}), s.Query || (s.Query = {}), a.optionQuery = s, a.isOptionLoading.value = !0, G(l, s).then((u) => {
|
|
1349
|
+
if ((u == null ? void 0 : u.status) === T.SUCCESS) {
|
|
1339
1350
|
if (u.data)
|
|
1340
1351
|
return u.data;
|
|
1341
|
-
} else if ((u == null ? void 0 : u.errno) ==
|
|
1352
|
+
} else if ((u == null ? void 0 : u.errno) == Re) {
|
|
1342
1353
|
_().logout(!1);
|
|
1343
1354
|
return;
|
|
1344
1355
|
}
|
|
1345
1356
|
return [];
|
|
1346
1357
|
}).finally(() => {
|
|
1347
|
-
|
|
1358
|
+
a.isOptionLoading.value = !1;
|
|
1348
1359
|
});
|
|
1349
|
-
},
|
|
1360
|
+
}, na = (e, a, t) => {
|
|
1350
1361
|
if (e === void 0) return;
|
|
1351
1362
|
const s = (o) => {
|
|
1352
1363
|
const r = { ...o };
|
|
1353
|
-
return
|
|
1364
|
+
return t && o.children && o.children.length > 0 ? r.children = o.children.map((l) => s(l)) : delete r.children, r;
|
|
1354
1365
|
}, n = (o, r) => {
|
|
1355
1366
|
const l = [];
|
|
1356
1367
|
for (const u of r)
|
|
@@ -1361,81 +1372,81 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
1361
1372
|
return l;
|
|
1362
1373
|
};
|
|
1363
1374
|
if (Array.isArray(e))
|
|
1364
|
-
return n(e,
|
|
1375
|
+
return n(e, a);
|
|
1365
1376
|
{
|
|
1366
|
-
const o = n([e],
|
|
1377
|
+
const o = n([e], a);
|
|
1367
1378
|
return o.length > 0 ? o[0] : void 0;
|
|
1368
1379
|
}
|
|
1369
|
-
}, Pe = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((
|
|
1370
|
-
const s =
|
|
1380
|
+
}, Pe = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((a) => a.label) : [e.label], ae = (e, a, t) => {
|
|
1381
|
+
const s = a.split(".");
|
|
1371
1382
|
let n = e;
|
|
1372
1383
|
for (let o = 0; o < s.length - 1; o++) {
|
|
1373
1384
|
const r = s[o];
|
|
1374
1385
|
n[r] || (n[r] = {}), n = n[r];
|
|
1375
1386
|
}
|
|
1376
|
-
n[s[s.length - 1]] =
|
|
1377
|
-
},
|
|
1378
|
-
if (
|
|
1379
|
-
Object.entries(
|
|
1380
|
-
|
|
1387
|
+
n[s[s.length - 1]] = t;
|
|
1388
|
+
}, ct = (e, a, t) => {
|
|
1389
|
+
if (t == null) {
|
|
1390
|
+
Object.entries(a).forEach(([s]) => {
|
|
1391
|
+
ae(e, s, t);
|
|
1381
1392
|
});
|
|
1382
1393
|
return;
|
|
1383
1394
|
}
|
|
1384
|
-
Array.isArray(
|
|
1395
|
+
Array.isArray(t) ? Object.entries(a).forEach(([s, n]) => {
|
|
1385
1396
|
var r;
|
|
1386
1397
|
if (/^\$\{\d+\}/.test(n))
|
|
1387
1398
|
try {
|
|
1388
|
-
const l = parseInt(((r = n.match(/\$\{(\d+)\}/)) == null ? void 0 : r[1]) ?? "0"), u =
|
|
1399
|
+
const l = parseInt(((r = n.match(/\$\{(\d+)\}/)) == null ? void 0 : r[1]) ?? "0"), u = t[l], i = n.replace(/\$\{\d+\}\./, "");
|
|
1389
1400
|
if (i && u) {
|
|
1390
1401
|
const f = Se(i, u);
|
|
1391
|
-
|
|
1402
|
+
ae(e, s, f);
|
|
1392
1403
|
} else
|
|
1393
|
-
|
|
1404
|
+
ae(e, s, u);
|
|
1394
1405
|
} catch {
|
|
1395
1406
|
console.error("outFields 格式错误:" + n, "必须是 ${index} 或者 ${index}.${key}");
|
|
1396
1407
|
}
|
|
1397
1408
|
else
|
|
1398
1409
|
console.error("outFields 格式错误:" + n, "必须是 ${index} 或者 ${index}.${key}");
|
|
1399
|
-
}) : Object.entries(
|
|
1410
|
+
}) : Object.entries(a).forEach(([s, n]) => {
|
|
1400
1411
|
if (n.includes("${")) {
|
|
1401
|
-
const o = Se(n,
|
|
1402
|
-
|
|
1412
|
+
const o = Se(n, t);
|
|
1413
|
+
ae(e, s, o);
|
|
1403
1414
|
} else
|
|
1404
|
-
|
|
1415
|
+
ae(e, s, t[n]);
|
|
1405
1416
|
});
|
|
1406
|
-
}, ke = (e,
|
|
1417
|
+
}, ke = (e, a, t) => {
|
|
1407
1418
|
var o, r;
|
|
1408
1419
|
const s = (o = e.inputFactory) == null ? void 0 : o.value;
|
|
1409
|
-
s != null && s.editorCtrl && ((r = s.errInfo) != null && r.value.errClass) && de(s.editorCtrl), e.selected.value =
|
|
1410
|
-
const n =
|
|
1411
|
-
if (e.selectedOptions.value = n,
|
|
1412
|
-
const [l, u] =
|
|
1420
|
+
s != null && s.editorCtrl && ((r = s.errInfo) != null && r.value.errClass) && de(s.editorCtrl), e.selected.value = t;
|
|
1421
|
+
const n = na(t, e.options.value);
|
|
1422
|
+
if (e.selectedOptions.value = n, a.formData && a.outFields && ct(a.formData, a.outFields, n), a.changeEvent) {
|
|
1423
|
+
const [l, u] = a.changeEvent;
|
|
1413
1424
|
if (u)
|
|
1414
1425
|
if (Array.isArray(l))
|
|
1415
1426
|
l.every((i) => {
|
|
1416
|
-
const f = Se(u, { selectedValues:
|
|
1427
|
+
const f = Se(u, { selectedValues: t });
|
|
1417
1428
|
try {
|
|
1418
1429
|
const p = JSON.parse(f);
|
|
1419
|
-
W.emit(i, p,
|
|
1430
|
+
W.emit(i, p, t, n);
|
|
1420
1431
|
} catch (p) {
|
|
1421
1432
|
console.error("eventParamsValue: ", f, p);
|
|
1422
1433
|
}
|
|
1423
1434
|
});
|
|
1424
1435
|
else {
|
|
1425
|
-
const i = Se(u, { selectedValues:
|
|
1436
|
+
const i = Se(u, { selectedValues: t });
|
|
1426
1437
|
try {
|
|
1427
1438
|
const f = JSON.parse(i);
|
|
1428
|
-
W.emit(l, f,
|
|
1439
|
+
W.emit(l, f, t, n);
|
|
1429
1440
|
} catch (f) {
|
|
1430
1441
|
console.error("eventParamsValue: ", i, f);
|
|
1431
1442
|
}
|
|
1432
1443
|
}
|
|
1433
1444
|
else
|
|
1434
1445
|
Array.isArray(l) ? l.every((i) => {
|
|
1435
|
-
W.emit(i, n,
|
|
1436
|
-
}) : W.emit(l, n,
|
|
1446
|
+
W.emit(i, n, t);
|
|
1447
|
+
}) : W.emit(l, n, t);
|
|
1437
1448
|
}
|
|
1438
|
-
return s != null && s.inputEmit && s.inputEmit("change",
|
|
1449
|
+
return s != null && s.inputEmit && s.inputEmit("change", t, n), n;
|
|
1439
1450
|
}, b = {
|
|
1440
1451
|
PageOption: {
|
|
1441
1452
|
primaryKey: "Id",
|
|
@@ -1474,7 +1485,7 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
1474
1485
|
value: "Id"
|
|
1475
1486
|
}
|
|
1476
1487
|
}
|
|
1477
|
-
},
|
|
1488
|
+
}, za = (e) => {
|
|
1478
1489
|
b.PageOption = {
|
|
1479
1490
|
...b.PageOption,
|
|
1480
1491
|
...e.pageOption
|
|
@@ -1489,16 +1500,16 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
1489
1500
|
...e.treeOption
|
|
1490
1501
|
};
|
|
1491
1502
|
}, Le = (e) => {
|
|
1492
|
-
for (let
|
|
1493
|
-
e.urls[
|
|
1494
|
-
},
|
|
1503
|
+
for (let a in e.urls)
|
|
1504
|
+
e.urls[a].api || (e.urls[a].api = e.api), e.urls[a].authorize === void 0 && (e.urls[a].authorize = e.authorize);
|
|
1505
|
+
}, ra = (e, a, t, s) => (Le(e), {
|
|
1495
1506
|
editorCtrl: {
|
|
1496
1507
|
...b.EditorOption,
|
|
1497
1508
|
name: "",
|
|
1498
|
-
default:
|
|
1509
|
+
default: t ? JSON.parse(JSON.stringify(t)) : void 0,
|
|
1499
1510
|
visible: c(!1),
|
|
1500
|
-
page:
|
|
1501
|
-
formData: c(
|
|
1511
|
+
page: a,
|
|
1512
|
+
formData: c(t ? JSON.parse(JSON.stringify(t)) : void 0),
|
|
1502
1513
|
formRules: c(s),
|
|
1503
1514
|
ruleResults: c({}),
|
|
1504
1515
|
updateData: c(void 0),
|
|
@@ -1507,7 +1518,7 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
1507
1518
|
isFormSaving: c(!1),
|
|
1508
1519
|
isFormLoading: c(!1)
|
|
1509
1520
|
}
|
|
1510
|
-
}),
|
|
1521
|
+
}), oa = (e, a, t) => {
|
|
1511
1522
|
Le(e);
|
|
1512
1523
|
const s = {
|
|
1513
1524
|
...b.GridOption,
|
|
@@ -1519,11 +1530,11 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
1519
1530
|
buttons: c([...b.GridOption.buttons.value]),
|
|
1520
1531
|
tools: [...b.GridOption.tools],
|
|
1521
1532
|
operates: [...b.GridOption.operates],
|
|
1522
|
-
columns: c(
|
|
1533
|
+
columns: c(t || []),
|
|
1523
1534
|
reload: c(!1),
|
|
1524
1535
|
pageNo: c(1),
|
|
1525
1536
|
total: c(0),
|
|
1526
|
-
page:
|
|
1537
|
+
page: a,
|
|
1527
1538
|
selectKeys: c([]),
|
|
1528
1539
|
selectRows: c([]),
|
|
1529
1540
|
rowData: c(void 0),
|
|
@@ -1541,34 +1552,34 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
1541
1552
|
(n) => {
|
|
1542
1553
|
n && (setTimeout(() => {
|
|
1543
1554
|
s.reload.value = !1;
|
|
1544
|
-
}, 1), s.remotePage ?
|
|
1555
|
+
}, 1), s.remotePage ? it(s) : Zt(s));
|
|
1545
1556
|
}
|
|
1546
1557
|
), {
|
|
1547
1558
|
gridCtrl: s
|
|
1548
1559
|
};
|
|
1549
|
-
},
|
|
1560
|
+
}, Ca = (e, a) => {
|
|
1550
1561
|
Le(e);
|
|
1551
|
-
const
|
|
1562
|
+
const t = {
|
|
1552
1563
|
...b.TreeOption,
|
|
1553
1564
|
reload: c(!1),
|
|
1554
|
-
page:
|
|
1565
|
+
page: a,
|
|
1555
1566
|
node: c(void 0),
|
|
1556
1567
|
url: e.urls.tree,
|
|
1557
1568
|
data: J(void 0),
|
|
1558
1569
|
isTreeLoading: c(!1)
|
|
1559
1570
|
};
|
|
1560
1571
|
return g(
|
|
1561
|
-
() =>
|
|
1572
|
+
() => t.reload.value,
|
|
1562
1573
|
(s) => {
|
|
1563
1574
|
s && (setTimeout(() => {
|
|
1564
|
-
|
|
1565
|
-
}, 1),
|
|
1575
|
+
t.reload.value = !1;
|
|
1576
|
+
}, 1), zt(t));
|
|
1566
1577
|
}
|
|
1567
1578
|
), {
|
|
1568
|
-
treeCtrl:
|
|
1579
|
+
treeCtrl: t
|
|
1569
1580
|
};
|
|
1570
|
-
}, me = (e,
|
|
1571
|
-
const
|
|
1581
|
+
}, me = (e, a) => {
|
|
1582
|
+
const t = {
|
|
1572
1583
|
...b.OptionOption,
|
|
1573
1584
|
url: e,
|
|
1574
1585
|
reload: c(!1),
|
|
@@ -1580,33 +1591,33 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
1580
1591
|
isOptionLoading: c(!1)
|
|
1581
1592
|
};
|
|
1582
1593
|
return g(
|
|
1583
|
-
() =>
|
|
1594
|
+
() => t.reload.value,
|
|
1584
1595
|
(s) => {
|
|
1585
1596
|
s && (setTimeout(() => {
|
|
1586
|
-
|
|
1587
|
-
}, 1), ee(!0,
|
|
1597
|
+
t.reload.value = !1;
|
|
1598
|
+
}, 1), ee(!0, t, a));
|
|
1588
1599
|
}
|
|
1589
1600
|
), {
|
|
1590
|
-
optionCtrl:
|
|
1601
|
+
optionCtrl: t
|
|
1591
1602
|
};
|
|
1592
|
-
},
|
|
1603
|
+
}, Ya = (e, a, t) => {
|
|
1593
1604
|
Le(e);
|
|
1594
1605
|
const s = {
|
|
1595
1606
|
...b.PageOption,
|
|
1596
1607
|
...e
|
|
1597
|
-
}, { editorCtrl: n } =
|
|
1608
|
+
}, { editorCtrl: n } = ra(e, s, a, t), { gridCtrl: o } = oa(e, s);
|
|
1598
1609
|
return s.editor = n, s.grid = o, o.editor = n, o.tools = ["Reload", "RowHeight", "TableHeadset", "Fullscreen"], n.grid = o, {
|
|
1599
1610
|
pageCtrl: s,
|
|
1600
1611
|
editorCtrl: n,
|
|
1601
1612
|
gridCtrl: o
|
|
1602
1613
|
};
|
|
1603
|
-
},
|
|
1614
|
+
}, ia = 7 * 24 * 60 * 60 * 1e3, _e = /* @__PURE__ */ new Map(), Ye = /* @__PURE__ */ new Set(), j = c({}), Xa = j, Za = (e) => {
|
|
1604
1615
|
var n;
|
|
1605
1616
|
if (!e.iconUrl) return De;
|
|
1606
|
-
const
|
|
1617
|
+
const a = c(!0), t = c("");
|
|
1607
1618
|
let s = !0;
|
|
1608
|
-
return (n = e.icons) != null && n.length && (s = e.icons.every((o) =>
|
|
1609
|
-
|
|
1619
|
+
return (n = e.icons) != null && n.length && (s = e.icons.every((o) => j.value[o] !== void 0)), (e.icon && !j.value[e.icon] || !s) && la(e, a).then(() => {
|
|
1620
|
+
fa(e.iconUrl, e.monoColor || !1), a.value = !0;
|
|
1610
1621
|
}), Z({
|
|
1611
1622
|
props: {
|
|
1612
1623
|
icon: {
|
|
@@ -1646,107 +1657,107 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
1646
1657
|
), g(
|
|
1647
1658
|
() => u.value,
|
|
1648
1659
|
(f) => {
|
|
1649
|
-
o.icons && (f >= o.icons.length && (u.value = 0), l.value = o.icons[u.value], ge(
|
|
1660
|
+
o.icons && (f >= o.icons.length && (u.value = 0), l.value = o.icons[u.value], ge(t, l, l.value), r("update:iconIndex", u.value));
|
|
1650
1661
|
},
|
|
1651
1662
|
{ immediate: !0 }
|
|
1652
1663
|
), g(
|
|
1653
|
-
() =>
|
|
1664
|
+
() => j.value,
|
|
1654
1665
|
() => {
|
|
1655
|
-
ge(
|
|
1666
|
+
ge(t, l, l.value);
|
|
1656
1667
|
},
|
|
1657
1668
|
{ deep: !0 }
|
|
1658
1669
|
), g(
|
|
1659
1670
|
() => o.icon,
|
|
1660
1671
|
(f) => {
|
|
1661
|
-
ge(
|
|
1672
|
+
ge(t, l, f);
|
|
1662
1673
|
}
|
|
1663
|
-
), ge(
|
|
1674
|
+
), ge(t, l, l.value), { isLoaded: a, Icon: t, handleClick: i };
|
|
1664
1675
|
},
|
|
1665
1676
|
render() {
|
|
1666
|
-
if (!
|
|
1677
|
+
if (!a.value)
|
|
1667
1678
|
return De;
|
|
1668
1679
|
let o = this.class, r = "";
|
|
1669
1680
|
Array.isArray(o) ? r = o.join(" ") : typeof o == "string" && (r = o);
|
|
1670
1681
|
let l = [r];
|
|
1671
|
-
return !/\bw-/.test(r) && !/$w-/.test(r) && l.push("w-4"), !/\bh-/.test(r) && !/$h-/.test(r) && l.push("h-4"),
|
|
1682
|
+
return !/\bw-/.test(r) && !/$w-/.test(r) && l.push("w-4"), !/\bh-/.test(r) && !/$h-/.test(r) && l.push("h-4"), t.value ? H(Ze(t.value), {
|
|
1672
1683
|
onClick: this.$props.clickable ? this.handleClick : void 0,
|
|
1673
1684
|
class: `${l.join(" ")}`,
|
|
1674
1685
|
style: {
|
|
1675
1686
|
fill: "currentColor",
|
|
1676
1687
|
cursor: this.$props.clickable ? "pointer" : "default",
|
|
1677
|
-
transform:
|
|
1688
|
+
transform: da(this.angle, this.flip)
|
|
1678
1689
|
}
|
|
1679
1690
|
}) : H("div", { class: "w-[14px] h-[14px]" });
|
|
1680
1691
|
}
|
|
1681
1692
|
});
|
|
1682
|
-
},
|
|
1683
|
-
let
|
|
1684
|
-
if (!
|
|
1693
|
+
}, la = (e, a) => {
|
|
1694
|
+
let t = e.iconUrl;
|
|
1695
|
+
if (!t)
|
|
1685
1696
|
return console.error("图标库地址不能为空"), Promise.resolve();
|
|
1686
|
-
if (_e.has(
|
|
1697
|
+
if (_e.has(t))
|
|
1687
1698
|
return Promise.resolve();
|
|
1688
|
-
const s =
|
|
1699
|
+
const s = pt(t);
|
|
1689
1700
|
if (s)
|
|
1690
|
-
return new Promise(async (o) => (
|
|
1691
|
-
|
|
1701
|
+
return new Promise(async (o) => (ft(s.scriptContent), o()));
|
|
1702
|
+
a.value = !1;
|
|
1692
1703
|
const n = new Promise(async (o) => {
|
|
1693
|
-
await
|
|
1704
|
+
await ua(t, e.monoColor || !1), o(), _e.delete(t);
|
|
1694
1705
|
});
|
|
1695
|
-
return _e.set(
|
|
1696
|
-
},
|
|
1706
|
+
return _e.set(t, n), n;
|
|
1707
|
+
}, ua = async (e, a) => {
|
|
1697
1708
|
try {
|
|
1698
|
-
const
|
|
1699
|
-
if (!
|
|
1709
|
+
const t = await fetch(e);
|
|
1710
|
+
if (!t.ok) {
|
|
1700
1711
|
E.error("网络异常,无法加载图标库!");
|
|
1701
1712
|
return;
|
|
1702
1713
|
}
|
|
1703
|
-
let s = await
|
|
1704
|
-
s =
|
|
1714
|
+
let s = await t.text();
|
|
1715
|
+
s = a ? s.replace(/fill=\"[^\"]*\"/gi, "") : s;
|
|
1705
1716
|
let n = /^window\.(\w+)\s*=/;
|
|
1706
1717
|
const o = s.match(n);
|
|
1707
1718
|
if (o && o.length > 1) {
|
|
1708
1719
|
let r = o[1];
|
|
1709
|
-
|
|
1720
|
+
ca(e, r, a, s);
|
|
1710
1721
|
}
|
|
1711
|
-
|
|
1722
|
+
ft(s);
|
|
1712
1723
|
return;
|
|
1713
|
-
} catch (
|
|
1714
|
-
return console.error("网络异常,无法加载图标库:",
|
|
1724
|
+
} catch (t) {
|
|
1725
|
+
return console.error("网络异常,无法加载图标库:", t), null;
|
|
1715
1726
|
}
|
|
1716
|
-
},
|
|
1717
|
-
const
|
|
1718
|
-
|
|
1719
|
-
},
|
|
1727
|
+
}, ft = (e) => {
|
|
1728
|
+
const a = document.createElement("script");
|
|
1729
|
+
a.textContent = e, document.head.appendChild(a);
|
|
1730
|
+
}, ca = (e, a, t, s) => {
|
|
1720
1731
|
let n = `icon_cache:${e}`;
|
|
1721
1732
|
const o = {
|
|
1722
|
-
windowKey:
|
|
1723
|
-
monoColor:
|
|
1733
|
+
windowKey: a,
|
|
1734
|
+
monoColor: t,
|
|
1724
1735
|
scriptContent: s,
|
|
1725
|
-
expireTime: Date.now() +
|
|
1736
|
+
expireTime: Date.now() + ia
|
|
1726
1737
|
// 缓存时间:7天
|
|
1727
1738
|
};
|
|
1728
1739
|
localStorage.setItem(n, JSON.stringify(o));
|
|
1729
|
-
},
|
|
1730
|
-
let
|
|
1731
|
-
const
|
|
1732
|
-
if (!
|
|
1740
|
+
}, pt = (e) => {
|
|
1741
|
+
let a = `icon_cache:${e}`;
|
|
1742
|
+
const t = localStorage.getItem(a);
|
|
1743
|
+
if (!t) return null;
|
|
1733
1744
|
let s;
|
|
1734
1745
|
try {
|
|
1735
|
-
s = JSON.parse(
|
|
1746
|
+
s = JSON.parse(t);
|
|
1736
1747
|
} catch (n) {
|
|
1737
1748
|
return console.error("解析缓存失败:", n), null;
|
|
1738
1749
|
}
|
|
1739
1750
|
return s.expireTime < Date.now() ? (localStorage.removeItem(e), null) : s;
|
|
1740
1751
|
}, es = () => {
|
|
1741
1752
|
const e = Date.now();
|
|
1742
|
-
for (const
|
|
1743
|
-
if (
|
|
1744
|
-
const
|
|
1745
|
-
|
|
1753
|
+
for (const a in localStorage)
|
|
1754
|
+
if (a.startsWith("icon_cache:")) {
|
|
1755
|
+
const t = localStorage.getItem(a);
|
|
1756
|
+
t && JSON.parse(t).expireTime < e && localStorage.removeItem(a);
|
|
1746
1757
|
}
|
|
1747
|
-
}, ge = (e,
|
|
1758
|
+
}, ge = (e, a, t) => {
|
|
1748
1759
|
setTimeout(() => {
|
|
1749
|
-
|
|
1760
|
+
a.value = t, a.value && (e.value = j.value[a.value]);
|
|
1750
1761
|
}, 1);
|
|
1751
1762
|
}, De = H(
|
|
1752
1763
|
"svg",
|
|
@@ -1768,47 +1779,47 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
1768
1779
|
fill: "currentColor"
|
|
1769
1780
|
})
|
|
1770
1781
|
]
|
|
1771
|
-
),
|
|
1772
|
-
const
|
|
1782
|
+
), fa = (e, a) => {
|
|
1783
|
+
const t = pt(e);
|
|
1773
1784
|
Object.keys(window).forEach((s) => {
|
|
1774
|
-
s.startsWith("_iconfont_svg_string_") && (
|
|
1785
|
+
s.startsWith("_iconfont_svg_string_") && (t == null ? void 0 : t.windowKey) === s && !Ye.has(s) && (Ye.add(s), pa(s, a));
|
|
1775
1786
|
});
|
|
1776
|
-
},
|
|
1777
|
-
const
|
|
1787
|
+
}, pa = (e, a) => {
|
|
1788
|
+
const t = window[e], o = new DOMParser().parseFromString(t, "image/svg+xml").getElementsByTagName("symbol"), r = document.querySelectorAll("symbol");
|
|
1778
1789
|
for (const l of o) {
|
|
1779
1790
|
const u = l.id, i = Array.from(r).find((f) => f.id === u);
|
|
1780
|
-
i &&
|
|
1791
|
+
i && a && (i.innerHTML = l.innerHTML, i.querySelectorAll("*").forEach((f) => {
|
|
1781
1792
|
f.hasAttribute("fill") && f.removeAttribute("fill");
|
|
1782
|
-
})),
|
|
1793
|
+
})), j.value[u] || (j.value[u] = H("svg", { fill: "currentColor" }, [H("use", { "xlink:href": `#${u}` })]));
|
|
1783
1794
|
}
|
|
1784
|
-
},
|
|
1785
|
-
let
|
|
1786
|
-
return e && (
|
|
1787
|
-
},
|
|
1788
|
-
|
|
1789
|
-
},
|
|
1795
|
+
}, da = (e, a) => {
|
|
1796
|
+
let t = "";
|
|
1797
|
+
return e && (t += `rotate(${e}deg)`), a && (t += " scaleX(-1)"), t;
|
|
1798
|
+
}, ts = (e, a, t, s) => {
|
|
1799
|
+
dt(e, [], t, s).forEach((o) => a.push(o));
|
|
1800
|
+
}, dt = (e, a, t, s) => {
|
|
1790
1801
|
var r, l, u, i, f;
|
|
1791
1802
|
const n = [], o = _();
|
|
1792
1803
|
for (const p of e) {
|
|
1793
1804
|
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"))
|
|
1794
1805
|
continue;
|
|
1795
1806
|
const v = p.path.split("/");
|
|
1796
|
-
v.unshift(...
|
|
1797
|
-
const d =
|
|
1807
|
+
v.unshift(...a);
|
|
1808
|
+
const d = dt(p.children || [], v, t, s), R = {
|
|
1798
1809
|
key: v.join("/"),
|
|
1799
1810
|
label: ((i = p.name) == null ? void 0 : i.toString()) ?? "",
|
|
1800
1811
|
title: ((f = p.name) == null ? void 0 : f.toString()) ?? "",
|
|
1801
|
-
icon: p.icon ? H(
|
|
1812
|
+
icon: p.icon ? H(t, { ...s, icon: p.icon }) : void 0,
|
|
1802
1813
|
children: d.length > 0 ? d : void 0
|
|
1803
1814
|
};
|
|
1804
|
-
(d.length > 0 || !p.children) && n.push(
|
|
1815
|
+
(d.length > 0 || !p.children) && n.push(R);
|
|
1805
1816
|
}
|
|
1806
1817
|
return n;
|
|
1807
|
-
}, Xe =
|
|
1818
|
+
}, Xe = gt([]), as = () => {
|
|
1808
1819
|
Xe.length = 0;
|
|
1809
1820
|
const e = K();
|
|
1810
|
-
let
|
|
1811
|
-
e.matchedRoutes(
|
|
1821
|
+
let t = Ve().TabActive;
|
|
1822
|
+
e.matchedRoutes(t).forEach((n, o) => {
|
|
1812
1823
|
var l;
|
|
1813
1824
|
const r = {
|
|
1814
1825
|
index: o,
|
|
@@ -1817,7 +1828,7 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
1817
1828
|
};
|
|
1818
1829
|
Xe.push(r);
|
|
1819
1830
|
});
|
|
1820
|
-
},
|
|
1831
|
+
}, ha = {
|
|
1821
1832
|
host: {
|
|
1822
1833
|
api: "SITEHOST_API",
|
|
1823
1834
|
url: "/openapi/RCSiteHostSrv/get",
|
|
@@ -1852,22 +1863,22 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
1852
1863
|
* @param hostApi 启动配置主机地址
|
|
1853
1864
|
* @param hostKey 站点信息,默认为当前主域名
|
|
1854
1865
|
*/
|
|
1855
|
-
async loadHostInfo(e,
|
|
1866
|
+
async loadHostInfo(e, a) {
|
|
1856
1867
|
if (V()) {
|
|
1857
1868
|
const s = await re.getHostInfo();
|
|
1858
1869
|
this._setHostInfo(s);
|
|
1859
1870
|
return;
|
|
1860
1871
|
}
|
|
1861
|
-
let
|
|
1862
|
-
return (!
|
|
1863
|
-
$e.SITEHOST_API || ($e.SITEHOST_API =
|
|
1864
|
-
const n =
|
|
1865
|
-
|
|
1872
|
+
let t = (e || this.getSiteHostApi()).trim();
|
|
1873
|
+
return (!t || t === "/") && (t = window.location.origin), t.endsWith("/") && (t = t.slice(0, -1)), new Promise((s) => {
|
|
1874
|
+
$e.SITEHOST_API || ($e.SITEHOST_API = t);
|
|
1875
|
+
const n = a || window.location.origin;
|
|
1876
|
+
G(ha.host, {
|
|
1866
1877
|
Query: {
|
|
1867
1878
|
Host: n
|
|
1868
1879
|
}
|
|
1869
1880
|
}).then((o) => {
|
|
1870
|
-
if ((o == null ? void 0 : o.status) ===
|
|
1881
|
+
if ((o == null ? void 0 : o.status) === T.SUCCESS && o.data) {
|
|
1871
1882
|
const r = o.data;
|
|
1872
1883
|
this._setHostInfo(r);
|
|
1873
1884
|
} else
|
|
@@ -1898,14 +1909,14 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
1898
1909
|
...this.hostInfo,
|
|
1899
1910
|
...e
|
|
1900
1911
|
}, this.hostInfo.API_HOST)
|
|
1901
|
-
for (const
|
|
1902
|
-
let
|
|
1903
|
-
|
|
1912
|
+
for (const a in this.hostInfo.API_HOST) {
|
|
1913
|
+
let t = this.hostInfo.API_HOST[a];
|
|
1914
|
+
t = t.startsWith("http://") || t.startsWith("https://") || t.startsWith("//") ? t : window.location.origin + t, t.endsWith("/") && (t = t.slice(0, -1)), this.hostInfo.API_HOST[a] = t, $e[a] = t;
|
|
1904
1915
|
}
|
|
1905
1916
|
if (this.hostInfo.SERVER_HOST)
|
|
1906
|
-
for (const
|
|
1907
|
-
let
|
|
1908
|
-
|
|
1917
|
+
for (const a in this.hostInfo.SERVER_HOST) {
|
|
1918
|
+
let t = this.hostInfo.SERVER_HOST[a];
|
|
1919
|
+
t = t.startsWith("http://") || t.startsWith("https://") || t.startsWith("//") ? t : window.location.origin + t, t.endsWith("/") && (t = t.slice(0, -1)), this.hostInfo.SERVER_HOST[a] = t, Mt[a] = t;
|
|
1909
1920
|
}
|
|
1910
1921
|
},
|
|
1911
1922
|
getHostInfo() {
|
|
@@ -1951,11 +1962,11 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
1951
1962
|
/**
|
|
1952
1963
|
* 设置表格头配置
|
|
1953
1964
|
*/
|
|
1954
|
-
setTableColumns(e,
|
|
1965
|
+
setTableColumns(e, a) {
|
|
1955
1966
|
this.$patch({
|
|
1956
1967
|
tableColumns: {
|
|
1957
1968
|
...this.tableColumns,
|
|
1958
|
-
[e]:
|
|
1969
|
+
[e]: a
|
|
1959
1970
|
}
|
|
1960
1971
|
});
|
|
1961
1972
|
}
|
|
@@ -1974,8 +1985,8 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
1974
1985
|
}
|
|
1975
1986
|
},
|
|
1976
1987
|
emits: ["change"],
|
|
1977
|
-
setup(e, { emit:
|
|
1978
|
-
const
|
|
1988
|
+
setup(e, { emit: a }) {
|
|
1989
|
+
const t = e, s = X(), n = me(t.url, t), o = t.optionCtrl ?? n.optionCtrl;
|
|
1979
1990
|
o.inputFactory = J(s);
|
|
1980
1991
|
const r = c([]);
|
|
1981
1992
|
o && g(
|
|
@@ -1985,20 +1996,20 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
1985
1996
|
},
|
|
1986
1997
|
{ immediate: !0, deep: !0 }
|
|
1987
1998
|
);
|
|
1988
|
-
const l =
|
|
1999
|
+
const l = a, { editorCtrl: u, errInfo: i } = X(), f = (p) => {
|
|
1989
2000
|
i != null && i.value.errClass && u && de(u), l("change", p);
|
|
1990
2001
|
};
|
|
1991
2002
|
return Ie(() => {
|
|
1992
|
-
if (!
|
|
1993
|
-
console.error("Switch组件: ",
|
|
2003
|
+
if (!t.data || t.data.length != 2) {
|
|
2004
|
+
console.error("Switch组件: ", t.data), E.error("Switch组件必须有且只有两个选项");
|
|
1994
2005
|
return;
|
|
1995
2006
|
}
|
|
1996
|
-
o && ee(o.autoload, o,
|
|
2007
|
+
o && ee(o.autoload, o, t);
|
|
1997
2008
|
}), le(() => {
|
|
1998
|
-
o && he(o,
|
|
2009
|
+
o && he(o, t);
|
|
1999
2010
|
}), (p, v) => {
|
|
2000
2011
|
var d;
|
|
2001
|
-
return r.value.length === 2 ? (w(), Ae(S(
|
|
2012
|
+
return r.value.length === 2 ? (w(), Ae(S(bt), ue({
|
|
2002
2013
|
key: 0,
|
|
2003
2014
|
class: [
|
|
2004
2015
|
((d = S(i)) == null ? void 0 : d.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : "",
|
|
@@ -2033,8 +2044,8 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
2033
2044
|
}
|
|
2034
2045
|
},
|
|
2035
2046
|
emits: ["update:value", "select", "change", "update:labels"],
|
|
2036
|
-
setup(e, { emit:
|
|
2037
|
-
const
|
|
2047
|
+
setup(e, { emit: a }) {
|
|
2048
|
+
const t = e, s = Ee(), n = X(), o = me(t.url, t), r = t.optionCtrl ?? o.optionCtrl;
|
|
2038
2049
|
r.inputFactory = J(n), r.fieldMap = {
|
|
2039
2050
|
label: "Name",
|
|
2040
2051
|
value: "Id",
|
|
@@ -2042,18 +2053,18 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
2042
2053
|
};
|
|
2043
2054
|
const l = c(void 0);
|
|
2044
2055
|
g(
|
|
2045
|
-
() =>
|
|
2056
|
+
() => t.value,
|
|
2046
2057
|
() => {
|
|
2047
|
-
l.value =
|
|
2058
|
+
l.value = t.value;
|
|
2048
2059
|
},
|
|
2049
2060
|
{ immediate: !0 }
|
|
2050
2061
|
), g(
|
|
2051
2062
|
() => l.value,
|
|
2052
2063
|
(y) => {
|
|
2053
|
-
|
|
2064
|
+
t.autoClean && t.formData && t.outFields && y !== t.value && ct(t.formData, t.outFields, null);
|
|
2054
2065
|
}
|
|
2055
2066
|
);
|
|
2056
|
-
const { editorCtrl: u, errInfo: i, labelText: f } = n, p =
|
|
2067
|
+
const { editorCtrl: u, errInfo: i, labelText: f } = n, p = a;
|
|
2057
2068
|
n.inputEmit = p;
|
|
2058
2069
|
const v = c((r == null ? void 0 : r.options.value) || []);
|
|
2059
2070
|
r && g(
|
|
@@ -2070,31 +2081,31 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
2070
2081
|
SearchField: "%" + y.trim() + "%"
|
|
2071
2082
|
}
|
|
2072
2083
|
};
|
|
2073
|
-
r.params = fe(r.params, h), r && ee(!0, r,
|
|
2074
|
-
},
|
|
2075
|
-
const x = ke(r,
|
|
2084
|
+
r.params = fe(r.params, h), r && ee(!0, r, t);
|
|
2085
|
+
}, R = (y) => {
|
|
2086
|
+
const x = ke(r, t, y);
|
|
2076
2087
|
p("update:value", y), p("select", y);
|
|
2077
2088
|
const h = Pe(x);
|
|
2078
2089
|
p("update:labels", h), i != null && i.value.errClass && u && de(u);
|
|
2079
2090
|
};
|
|
2080
2091
|
return le(() => {
|
|
2081
|
-
r && he(r,
|
|
2092
|
+
r && he(r, t);
|
|
2082
2093
|
}), (y, x) => {
|
|
2083
2094
|
var h;
|
|
2084
2095
|
return w(), $("div", null, [
|
|
2085
|
-
C(S(
|
|
2096
|
+
C(S(St), ue({
|
|
2086
2097
|
value: l.value,
|
|
2087
2098
|
"onUpdate:value": x[0] || (x[0] = (I) => l.value = I),
|
|
2088
2099
|
class: ["w-full", (h = S(i)) == null ? void 0 : h.errClass],
|
|
2089
2100
|
options: v.value,
|
|
2090
2101
|
onSearch: d,
|
|
2091
|
-
onSelect:
|
|
2102
|
+
onSelect: R
|
|
2092
2103
|
}, S(s), { "allow-clear": !1 }), {
|
|
2093
2104
|
option: Q(({ label: I }) => [
|
|
2094
2105
|
xe(Y(I), 1)
|
|
2095
2106
|
]),
|
|
2096
2107
|
default: Q(() => [
|
|
2097
|
-
C(S(
|
|
2108
|
+
C(S(It), {
|
|
2098
2109
|
"allow-clear": "",
|
|
2099
2110
|
placeholder: "请输入并选择" + S(f)
|
|
2100
2111
|
}, null, 8, ["placeholder"])
|
|
@@ -2104,7 +2115,7 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
2104
2115
|
]);
|
|
2105
2116
|
};
|
|
2106
2117
|
}
|
|
2107
|
-
}),
|
|
2118
|
+
}), ma = { class: "min-h-[32px] pt-[5px]" }, va = {
|
|
2108
2119
|
key: 1,
|
|
2109
2120
|
class: "text-center text-gray-500"
|
|
2110
2121
|
}, is = /* @__PURE__ */ Z({
|
|
@@ -2127,17 +2138,17 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
2127
2138
|
}
|
|
2128
2139
|
},
|
|
2129
2140
|
emits: ["change", "update:labels"],
|
|
2130
|
-
setup(e, { emit:
|
|
2131
|
-
var v, d,
|
|
2132
|
-
const
|
|
2141
|
+
setup(e, { emit: a }) {
|
|
2142
|
+
var v, d, R;
|
|
2143
|
+
const t = e, s = Ee(), n = X(), o = me(t.url, t), r = t.optionCtrl ?? o.optionCtrl;
|
|
2133
2144
|
r.inputFactory = J(n);
|
|
2134
2145
|
const l = c({
|
|
2135
2146
|
...r == null ? void 0 : r.url,
|
|
2136
2147
|
url: ((v = r == null ? void 0 : r.url) == null ? void 0 : v.url) || "",
|
|
2137
2148
|
fieldMap: (r == null ? void 0 : r.fieldMap) || ((d = r == null ? void 0 : r.url) == null ? void 0 : d.fieldMap),
|
|
2138
|
-
params: (r == null ? void 0 : r.params) || ((
|
|
2149
|
+
params: (r == null ? void 0 : r.params) || ((R = r == null ? void 0 : r.url) == null ? void 0 : R.params),
|
|
2139
2150
|
loadingText: !1
|
|
2140
|
-
}), { errInfo: u } = n, i =
|
|
2151
|
+
}), { errInfo: u } = n, i = a;
|
|
2141
2152
|
n.inputEmit = i;
|
|
2142
2153
|
const f = c((r == null ? void 0 : r.options.value) || []);
|
|
2143
2154
|
r && g(
|
|
@@ -2148,7 +2159,7 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
2148
2159
|
{ immediate: !0, deep: !0 }
|
|
2149
2160
|
);
|
|
2150
2161
|
const p = (y) => {
|
|
2151
|
-
const h = ke(r,
|
|
2162
|
+
const h = ke(r, t, y), I = Pe(h);
|
|
2152
2163
|
i("update:labels", I);
|
|
2153
2164
|
};
|
|
2154
2165
|
return Ie(() => {
|
|
@@ -2157,26 +2168,26 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
2157
2168
|
label: "Name",
|
|
2158
2169
|
value: "Id",
|
|
2159
2170
|
key: "Id"
|
|
2160
|
-
}), r && ee(r.autoload, r,
|
|
2171
|
+
}), r && ee(r.autoload, r, t);
|
|
2161
2172
|
}), le(() => {
|
|
2162
|
-
r && he(r,
|
|
2163
|
-
}), (y, x) => (w(), $("div",
|
|
2164
|
-
C(S(
|
|
2173
|
+
r && he(r, t);
|
|
2174
|
+
}), (y, x) => (w(), $("div", ma, [
|
|
2175
|
+
C(S(At), ue({
|
|
2165
2176
|
onChange: p,
|
|
2166
2177
|
class: "w-full mb-[-3px]"
|
|
2167
2178
|
}, S(s)), {
|
|
2168
2179
|
default: Q(() => [
|
|
2169
2180
|
f.value.length > 0 ? (w(!0), $(oe, { key: 0 }, Ue(f.value, (h) => {
|
|
2170
2181
|
var I;
|
|
2171
|
-
return w(), Ae(S(
|
|
2182
|
+
return w(), Ae(S(Et), {
|
|
2172
2183
|
key: h.value,
|
|
2173
2184
|
value: h.value,
|
|
2174
2185
|
disabled: h.disabled || h.value && e.disabledItems && e.disabledItems.indexOf(h.value.toString()) > -1,
|
|
2175
|
-
class:
|
|
2186
|
+
class: et([
|
|
2176
2187
|
((I = S(u)) == null ? void 0 : I.errClass) === "error" ? "error !text-red-400" : "",
|
|
2177
2188
|
"text-nowrap",
|
|
2178
2189
|
"pb-1",
|
|
2179
|
-
e.wrap ? `w-1/${
|
|
2190
|
+
e.wrap ? `w-1/${t.wrap}` : ""
|
|
2180
2191
|
])
|
|
2181
2192
|
}, {
|
|
2182
2193
|
default: Q(() => [
|
|
@@ -2184,13 +2195,13 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
2184
2195
|
]),
|
|
2185
2196
|
_: 2
|
|
2186
2197
|
}, 1032, ["value", "disabled", "class"]);
|
|
2187
|
-
}), 128)) : e.nodata ? (w(), $("div",
|
|
2198
|
+
}), 128)) : e.nodata ? (w(), $("div", va, Y(e.nodata), 1)) : z("", !0)
|
|
2188
2199
|
]),
|
|
2189
2200
|
_: 1
|
|
2190
2201
|
}, 16)
|
|
2191
2202
|
]));
|
|
2192
2203
|
}
|
|
2193
|
-
}),
|
|
2204
|
+
}), ga = { class: "min-h-[32px] pt-1" }, ya = {
|
|
2194
2205
|
key: 1,
|
|
2195
2206
|
class: "text-center text-gray-500"
|
|
2196
2207
|
}, ls = /* @__PURE__ */ Z({
|
|
@@ -2214,17 +2225,17 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
2214
2225
|
}
|
|
2215
2226
|
},
|
|
2216
2227
|
emits: ["change", "update:value", "update:labels"],
|
|
2217
|
-
setup(e, { emit:
|
|
2218
|
-
var
|
|
2219
|
-
const
|
|
2228
|
+
setup(e, { emit: a }) {
|
|
2229
|
+
var R, y, x;
|
|
2230
|
+
const t = e, s = Ee(), n = X(), o = me(t.url, t), r = t.optionCtrl ?? o.optionCtrl;
|
|
2220
2231
|
r.inputFactory = J(n);
|
|
2221
2232
|
const l = c({
|
|
2222
2233
|
...r == null ? void 0 : r.url,
|
|
2223
|
-
url: ((
|
|
2234
|
+
url: ((R = r == null ? void 0 : r.url) == null ? void 0 : R.url) || "",
|
|
2224
2235
|
fieldMap: (r == null ? void 0 : r.fieldMap) || ((y = r == null ? void 0 : r.url) == null ? void 0 : y.fieldMap),
|
|
2225
2236
|
params: (r == null ? void 0 : r.params) || ((x = r == null ? void 0 : r.url) == null ? void 0 : x.params),
|
|
2226
2237
|
loadingText: !1
|
|
2227
|
-
}), u = c(
|
|
2238
|
+
}), u = c(t.value), { errInfo: i } = n, f = c((r == null ? void 0 : r.options.value) || []), p = a;
|
|
2228
2239
|
n.inputEmit = p, r && g(
|
|
2229
2240
|
() => r.options.value,
|
|
2230
2241
|
(h) => {
|
|
@@ -2232,7 +2243,7 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
2232
2243
|
},
|
|
2233
2244
|
{ immediate: !0, deep: !0 }
|
|
2234
2245
|
), g(
|
|
2235
|
-
() =>
|
|
2246
|
+
() => t.value,
|
|
2236
2247
|
(h) => {
|
|
2237
2248
|
u.value = h;
|
|
2238
2249
|
}
|
|
@@ -2244,60 +2255,60 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
2244
2255
|
);
|
|
2245
2256
|
const v = (h, I) => {
|
|
2246
2257
|
if (typeof h == "object" && typeof I == "object") {
|
|
2247
|
-
const
|
|
2248
|
-
return
|
|
2258
|
+
const O = JSON.stringify(h) === JSON.stringify(I);
|
|
2259
|
+
return O && (u.value = h), O;
|
|
2249
2260
|
}
|
|
2250
2261
|
return h === I;
|
|
2251
2262
|
}, d = (h) => {
|
|
2252
|
-
const I = h.target.value,
|
|
2253
|
-
p("update:labels",
|
|
2263
|
+
const I = h.target.value, O = ke(r, t, I), q = Pe(O);
|
|
2264
|
+
p("update:labels", q);
|
|
2254
2265
|
};
|
|
2255
2266
|
return Ie(() => {
|
|
2256
2267
|
l.value && !l.value.fieldMap && (l.value.fieldMap = {
|
|
2257
2268
|
label: "Name",
|
|
2258
2269
|
value: "Id",
|
|
2259
2270
|
key: "Id"
|
|
2260
|
-
}), r && ee(r.autoload, r,
|
|
2271
|
+
}), r && ee(r.autoload, r, t);
|
|
2261
2272
|
}), le(() => {
|
|
2262
|
-
r && he(r,
|
|
2263
|
-
}), (h, I) => (w(), $("div",
|
|
2264
|
-
C(S(
|
|
2273
|
+
r && he(r, t);
|
|
2274
|
+
}), (h, I) => (w(), $("div", ga, [
|
|
2275
|
+
C(S(xt), ue({
|
|
2265
2276
|
value: u.value,
|
|
2266
|
-
"onUpdate:value": I[0] || (I[0] = (
|
|
2277
|
+
"onUpdate:value": I[0] || (I[0] = (O) => u.value = O),
|
|
2267
2278
|
autocheck: !1,
|
|
2268
2279
|
onChange: d,
|
|
2269
2280
|
class: "w-full flex align-items flex-wrap mb-[-3px]"
|
|
2270
2281
|
}, S(s)), {
|
|
2271
2282
|
default: Q(() => [
|
|
2272
|
-
f.value.length > 0 ? (w(!0), $(oe, { key: 0 }, Ue(f.value, (
|
|
2273
|
-
var
|
|
2283
|
+
f.value.length > 0 ? (w(!0), $(oe, { key: 0 }, Ue(f.value, (O) => {
|
|
2284
|
+
var q;
|
|
2274
2285
|
return w(), $(oe, {
|
|
2275
|
-
key:
|
|
2286
|
+
key: O.value
|
|
2276
2287
|
}, [
|
|
2277
|
-
|
|
2288
|
+
O.visible !== !1 ? (w(), Ae(S(wt), {
|
|
2278
2289
|
key: 0,
|
|
2279
|
-
checked: v(
|
|
2280
|
-
value:
|
|
2281
|
-
class:
|
|
2282
|
-
((
|
|
2290
|
+
checked: v(O.value, t.value),
|
|
2291
|
+
value: O.value,
|
|
2292
|
+
class: et([
|
|
2293
|
+
((q = S(i)) == null ? void 0 : q.errClass) === "error" ? "error !text-red-400" : "",
|
|
2283
2294
|
"text-nowrap",
|
|
2284
2295
|
"pb-1",
|
|
2285
|
-
e.wrap ? `w-1/${
|
|
2296
|
+
e.wrap ? `w-1/${t.wrap}` : ""
|
|
2286
2297
|
])
|
|
2287
2298
|
}, {
|
|
2288
2299
|
default: Q(() => [
|
|
2289
|
-
xe(Y(
|
|
2300
|
+
xe(Y(O.label), 1)
|
|
2290
2301
|
]),
|
|
2291
2302
|
_: 2
|
|
2292
2303
|
}, 1032, ["checked", "value", "class"])) : z("", !0)
|
|
2293
2304
|
], 64);
|
|
2294
|
-
}), 128)) : e.nodata ? (w(), $("div",
|
|
2305
|
+
}), 128)) : e.nodata ? (w(), $("div", ya, Y(e.nodata), 1)) : z("", !0)
|
|
2295
2306
|
]),
|
|
2296
2307
|
_: 1
|
|
2297
2308
|
}, 16, ["value"])
|
|
2298
2309
|
]));
|
|
2299
2310
|
}
|
|
2300
|
-
}),
|
|
2311
|
+
}), ba = {
|
|
2301
2312
|
key: 0,
|
|
2302
2313
|
class: "absolute z-10 mt-[5px] mr-[10px] text-[#999] flex items-center"
|
|
2303
2314
|
}, us = /* @__PURE__ */ Z({
|
|
@@ -2334,23 +2345,23 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
2334
2345
|
}
|
|
2335
2346
|
},
|
|
2336
2347
|
emits: ["change", "update:value", "update:label", "update:labels"],
|
|
2337
|
-
setup(e, { emit:
|
|
2338
|
-
var I,
|
|
2339
|
-
const
|
|
2348
|
+
setup(e, { emit: a }) {
|
|
2349
|
+
var I, O, q;
|
|
2350
|
+
const t = e, s = t.value === void 0 ? !0 : t.undefValue, n = X(), { editorCtrl: o, errInfo: r, labelText: l } = n, u = me(t.url, t), i = t.optionCtrl ?? u.optionCtrl;
|
|
2340
2351
|
i.inputFactory = J(n);
|
|
2341
2352
|
const f = Ee(), p = c({
|
|
2342
2353
|
...i == null ? void 0 : i.url,
|
|
2343
2354
|
url: ((I = i == null ? void 0 : i.url) == null ? void 0 : I.url) || "",
|
|
2344
|
-
fieldMap: (i == null ? void 0 : i.fieldMap) || ((
|
|
2345
|
-
params: (i == null ? void 0 : i.params) || ((
|
|
2355
|
+
fieldMap: (i == null ? void 0 : i.fieldMap) || ((O = i == null ? void 0 : i.url) == null ? void 0 : O.fieldMap),
|
|
2356
|
+
params: (i == null ? void 0 : i.params) || ((q = i == null ? void 0 : i.url) == null ? void 0 : q.params),
|
|
2346
2357
|
loadingText: !1
|
|
2347
|
-
}), v = c(f.placeholder), d = c(i == null ? void 0 : i.selected.value),
|
|
2348
|
-
n.inputEmit =
|
|
2358
|
+
}), v = c(f.placeholder), d = c(i == null ? void 0 : i.selected.value), R = a;
|
|
2359
|
+
n.inputEmit = R;
|
|
2349
2360
|
const y = (m) => {
|
|
2350
|
-
const P = ke(i,
|
|
2351
|
-
d.value = m,
|
|
2361
|
+
const P = ke(i, t, m), D = Pe(P);
|
|
2362
|
+
d.value = m, R("update:labels", D), R("update:label", D.join(";")), R("change", m, P), r != null && r.value.errClass && o && de(o);
|
|
2352
2363
|
}, x = c((i == null ? void 0 : i.options.value) || []), h = (m) => {
|
|
2353
|
-
if (m.length > 0 && F(
|
|
2364
|
+
if (m.length > 0 && F(t.value) && t.selectFirst)
|
|
2354
2365
|
for (let P = 0; P < m.length; P++) {
|
|
2355
2366
|
const D = m[P];
|
|
2356
2367
|
if (D.disabled === void 0 || D.disabled === !1) {
|
|
@@ -2358,7 +2369,7 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
2358
2369
|
break;
|
|
2359
2370
|
}
|
|
2360
2371
|
}
|
|
2361
|
-
else m.length > 0 && (d.value =
|
|
2372
|
+
else m.length > 0 && (d.value = t.value === null ? void 0 : t.value);
|
|
2362
2373
|
m.length > 0 && d.value !== void 0 && y(d.value);
|
|
2363
2374
|
};
|
|
2364
2375
|
return i && (g(
|
|
@@ -2384,7 +2395,7 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
2384
2395
|
},
|
|
2385
2396
|
{ immediate: !0 }
|
|
2386
2397
|
), g(
|
|
2387
|
-
() =>
|
|
2398
|
+
() => t.value,
|
|
2388
2399
|
(m) => {
|
|
2389
2400
|
d.value = m;
|
|
2390
2401
|
},
|
|
@@ -2393,30 +2404,30 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
2393
2404
|
() => d.value,
|
|
2394
2405
|
(m) => {
|
|
2395
2406
|
const P = m === void 0 ? s ? void 0 : null : m;
|
|
2396
|
-
i && (i.selected.value = P),
|
|
2407
|
+
i && (i.selected.value = P), R("update:value", P);
|
|
2397
2408
|
}
|
|
2398
2409
|
), Ie(() => {
|
|
2399
2410
|
if (p.value && !p.value.fieldMap && (p.value.fieldMap = {
|
|
2400
2411
|
label: "Name",
|
|
2401
2412
|
value: "Id",
|
|
2402
2413
|
key: "Id"
|
|
2403
|
-
}),
|
|
2404
|
-
const m = JSON.parse(JSON.stringify(N.getOptions(
|
|
2414
|
+
}), t.dataKey) {
|
|
2415
|
+
const m = JSON.parse(JSON.stringify(N.getOptions(t.dataKey)));
|
|
2405
2416
|
x.value = m, h(m);
|
|
2406
2417
|
} else if (i) {
|
|
2407
2418
|
const m = i.options.value || [];
|
|
2408
|
-
m.length > 0 ? (x.value = m, h(m)) : ee(i.autoload, i,
|
|
2419
|
+
m.length > 0 ? (x.value = m, h(m)) : ee(i.autoload, i, t);
|
|
2409
2420
|
}
|
|
2410
2421
|
}), le(() => {
|
|
2411
|
-
i && he(i,
|
|
2422
|
+
i && he(i, t);
|
|
2412
2423
|
}), (m, P) => {
|
|
2413
|
-
var D,
|
|
2424
|
+
var D, Ge, Be;
|
|
2414
2425
|
return w(), $("div", null, [
|
|
2415
|
-
(
|
|
2426
|
+
(Ge = (D = S(i)) == null ? void 0 : D.url) != null && Ge.loading ? (w(), $("div", ba, [
|
|
2416
2427
|
C(S(De), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
|
|
2417
|
-
P[1] || (P[1] =
|
|
2428
|
+
P[1] || (P[1] = yt("span", null, "数据加载中...", -1))
|
|
2418
2429
|
])) : z("", !0),
|
|
2419
|
-
C(S(
|
|
2430
|
+
C(S(Rt), ue({
|
|
2420
2431
|
class: [(Be = S(r)) == null ? void 0 : Be.errClass, "w-full"],
|
|
2421
2432
|
value: d.value,
|
|
2422
2433
|
"onUpdate:value": P[0] || (P[0] = (B) => d.value = B),
|
|
@@ -2429,7 +2440,7 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
2429
2440
|
(w(!0), $(oe, null, Ue(x.value, (B) => (w(), $(oe, {
|
|
2430
2441
|
key: B.value
|
|
2431
2442
|
}, [
|
|
2432
|
-
B.visible !== !1 ? (w(), Ae(S(
|
|
2443
|
+
B.visible !== !1 ? (w(), Ae(S(Ot), {
|
|
2433
2444
|
key: 0,
|
|
2434
2445
|
value: B.value
|
|
2435
2446
|
}, {
|
|
@@ -2445,56 +2456,56 @@ const W = new at(), ee = (e, t, a) => {
|
|
|
2445
2456
|
]);
|
|
2446
2457
|
};
|
|
2447
2458
|
}
|
|
2448
|
-
}),
|
|
2459
|
+
}), Sa = c(!1), cs = {
|
|
2449
2460
|
label: "模板管理",
|
|
2450
2461
|
key: "uploadTemp",
|
|
2451
2462
|
type: "primary",
|
|
2452
2463
|
icon: "icon-download",
|
|
2453
2464
|
click: () => {
|
|
2454
|
-
|
|
2465
|
+
Sa.value = !0;
|
|
2455
2466
|
}
|
|
2456
2467
|
};
|
|
2457
2468
|
export {
|
|
2458
|
-
|
|
2469
|
+
ot as $,
|
|
2459
2470
|
Pe as A,
|
|
2460
2471
|
de as B,
|
|
2461
2472
|
is as C,
|
|
2462
2473
|
ls as D,
|
|
2463
2474
|
us as E,
|
|
2464
2475
|
Qe as F,
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2476
|
+
_t as G,
|
|
2477
|
+
za as H,
|
|
2478
|
+
ra as I,
|
|
2479
|
+
oa as J,
|
|
2480
|
+
Ca as K,
|
|
2481
|
+
Re as L,
|
|
2482
|
+
Ya as M,
|
|
2483
|
+
na as N,
|
|
2473
2484
|
N as O,
|
|
2474
2485
|
U as P,
|
|
2475
|
-
|
|
2476
|
-
|
|
2486
|
+
ct as Q,
|
|
2487
|
+
Xa as R,
|
|
2477
2488
|
es as S,
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2489
|
+
pa as T,
|
|
2490
|
+
da as U,
|
|
2491
|
+
ts as V,
|
|
2481
2492
|
Xe as W,
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2493
|
+
as as X,
|
|
2494
|
+
rt as Y,
|
|
2495
|
+
Ka as Z,
|
|
2485
2496
|
rs as _,
|
|
2486
2497
|
ns as a,
|
|
2487
|
-
|
|
2488
|
-
|
|
2498
|
+
Fa as a0,
|
|
2499
|
+
Na as a1,
|
|
2489
2500
|
Je as a2,
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
$
|
|
2496
|
-
|
|
2497
|
-
|
|
2501
|
+
_a as a3,
|
|
2502
|
+
qa as a4,
|
|
2503
|
+
ea as a5,
|
|
2504
|
+
lt as a6,
|
|
2505
|
+
Ga as a7,
|
|
2506
|
+
$a as a8,
|
|
2507
|
+
nt as a9,
|
|
2508
|
+
Wt as aa,
|
|
2498
2509
|
Ne as ab,
|
|
2499
2510
|
W as ac,
|
|
2500
2511
|
re as ad,
|
|
@@ -2503,25 +2514,25 @@ export {
|
|
|
2503
2514
|
K as ag,
|
|
2504
2515
|
ss as ah,
|
|
2505
2516
|
Ve as ai,
|
|
2506
|
-
|
|
2517
|
+
Sa as aj,
|
|
2507
2518
|
cs as ak,
|
|
2508
2519
|
ie as al,
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2520
|
+
Ha as b,
|
|
2521
|
+
Za as c,
|
|
2522
|
+
Va as d,
|
|
2523
|
+
Da as e,
|
|
2524
|
+
Ba as f,
|
|
2525
|
+
Wa as g,
|
|
2526
|
+
Ja as h,
|
|
2516
2527
|
F as i,
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2528
|
+
Qa as j,
|
|
2529
|
+
it as k,
|
|
2530
|
+
Zt as l,
|
|
2531
|
+
ja as m,
|
|
2532
|
+
Ct as n,
|
|
2533
|
+
Ua as o,
|
|
2523
2534
|
os as p,
|
|
2524
|
-
|
|
2535
|
+
zt as q,
|
|
2525
2536
|
we as r,
|
|
2526
2537
|
pe as s,
|
|
2527
2538
|
X as t,
|