@skyfox2000/webui 1.3.11 → 1.3.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/{file-upload-CwyUkWwi.js → file-upload-CUZwipDq.js} +1 -1
- package/lib/assets/modules/{index-Dd8HdGOL.js → index-CRI5J3tC.js} +2 -2
- package/lib/assets/modules/{index-DHWlaZL2.js → index-CiPOV7eS.js} +2 -2
- package/lib/assets/modules/{index-BRWQ6SRp.js → index-VW3ychQv.js} +1 -1
- package/lib/assets/modules/{menuTabs-NoNLt_B5.js → menuTabs-CX8-KAho.js} +2 -2
- package/lib/assets/modules/{toolIcon-BSjgzw0G.js → toolIcon-0Ar6hd78.js} +1 -1
- package/lib/assets/modules/{uploadList-1Zmhwr0q.js → uploadList-Bj9RG8dw.js} +4 -4
- package/lib/assets/modules/{uploadList-B4wb8I9a.js → uploadList-Ce4hn5ZE.js} +794 -754
- package/lib/es/AceEditor/index.js +3 -3
- package/lib/es/BasicLayout/index.js +3 -3
- 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/UploadForm/index.js +4 -4
- package/lib/stores/hostInfo.d.ts +3 -1
- package/lib/webui.css +1 -1
- package/lib/webui.es.js +16 -16
- package/package.json +2 -2
- package/src/components/content/dialog/index.vue +6 -17
- package/src/components/content/table/index.vue +10 -28
- package/src/components/form/radio/index.vue +8 -0
- package/src/components/form/select/index.vue +17 -1
- package/src/stores/hostInfo.ts +72 -22
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { inject as
|
|
5
|
-
import { Switch as
|
|
6
|
-
import { createPinia as
|
|
7
|
-
import
|
|
8
|
-
import { combineParams as Oe, EnvConfig as ge, AppAction as
|
|
9
|
-
import { ResStatus as T, httpPost as G, setToken as he, fieldMapping as $
|
|
1
|
+
var mt = Object.defineProperty;
|
|
2
|
+
var vt = (e, a, t) => a in e ? mt(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t;
|
|
3
|
+
var F = (e, a, t) => vt(e, typeof a != "symbol" ? a + "" : a, t);
|
|
4
|
+
import { inject as ae, ref as f, provide as Le, watch as y, toRaw as Ze, h as U, nextTick as gt, shallowRef as K, defineComponent as X, reactive as yt, onMounted as Ie, onUnmounted as ie, createBlock as xe, createCommentVNode as B, openBlock as O, unref as S, mergeProps as le, useAttrs as Ae, createElementBlock as $, createVNode as C, withCtx as V, createTextVNode as Ee, toDisplayString as z, Fragment as ne, renderList as Ue, normalizeClass as et, createElementVNode as bt } from "vue";
|
|
5
|
+
import { Switch as St, AutoComplete as It, Input as xt, CheckboxGroup as At, Checkbox as Et, RadioGroup as Ot, Radio as Rt, Select as Tt, SelectOption as wt } from "ant-design-vue";
|
|
6
|
+
import { createPinia as Pt, defineStore as ue } from "pinia";
|
|
7
|
+
import kt from "pinia-plugin-persistedstate";
|
|
8
|
+
import { combineParams as Oe, EnvConfig as ge, AppAction as Be, AppSource as Ce, isMicroApp as ye, mainAppApis as N, isBaseMicroApp as Lt } from "@skyfox2000/microbase";
|
|
9
|
+
import { ResStatus as T, httpPost as G, setToken as he, fieldMapping as $t, parseFieldTemplate as be, API_HOST as $e, SERVER_HOST as Ft } from "@skyfox2000/fapi";
|
|
10
10
|
import x from "vue-m-message";
|
|
11
11
|
import He from "async-validator";
|
|
12
|
-
import { createRouter as
|
|
12
|
+
import { createRouter as Mt, createWebHashHistory as _t } from "vue-router";
|
|
13
13
|
import "dayjs";
|
|
14
14
|
import "vue-draggable-next";
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const Nt = Pt();
|
|
16
|
+
Nt.use(kt);
|
|
17
17
|
var D = /* @__PURE__ */ ((e) => (e.PageControl = "Page.PageControl", e.EditorControl = "Page.EditorControl", e.GridControl = "Page.GridControl", e.LabelText = "FormItem.LabelText", e.LabelWidth = "FormItem.LabelWidth", e.RuleKey = "FormItem.RuleKey", e.ErrInfo = "FormItem.ErrInfo", e))(D || {});
|
|
18
18
|
const w = class w {
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
F(w, "dict", {}), F(w, "Keys", {
|
|
21
21
|
EnableDisable: "EnableDisable",
|
|
22
22
|
SuccessResult: "SuccessResult",
|
|
23
23
|
YesNo: "YesNo",
|
|
@@ -27,25 +27,25 @@ $(w, "dict", {}), $(w, "Keys", {
|
|
|
27
27
|
* @param key 名称
|
|
28
28
|
* @returns
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
F(w, "getOptions", (a) => w.dict[a]), /**
|
|
31
31
|
* 静态选择项对象
|
|
32
32
|
* @param key 名称
|
|
33
33
|
* @param value 值
|
|
34
34
|
* @returns
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
F(w, "getOptionItem", (a, t) => w.dict[a].find((s) => s.value === t)), /**
|
|
37
37
|
* 设置静态选择项
|
|
38
38
|
* @param key 名称
|
|
39
39
|
* @param list 列表
|
|
40
40
|
*/
|
|
41
|
-
|
|
42
|
-
w.dict[
|
|
41
|
+
F(w, "setOptions", (a, t) => {
|
|
42
|
+
w.dict[a] = t;
|
|
43
43
|
}), /**
|
|
44
44
|
* 启用/停用选项
|
|
45
45
|
* - 启用 1
|
|
46
46
|
* - 停用 0
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
F(w, "EnableDisable", [
|
|
49
49
|
{
|
|
50
50
|
label: "启用",
|
|
51
51
|
text: "✅ 启用",
|
|
@@ -61,7 +61,7 @@ $(w, "EnableDisable", [
|
|
|
61
61
|
* - 成功 1
|
|
62
62
|
* - 失败 0
|
|
63
63
|
*/
|
|
64
|
-
|
|
64
|
+
F(w, "SuccessResult", [
|
|
65
65
|
{
|
|
66
66
|
label: "成功",
|
|
67
67
|
text: "✅ 成功",
|
|
@@ -77,7 +77,7 @@ $(w, "SuccessResult", [
|
|
|
77
77
|
* - 是 1
|
|
78
78
|
* - 否 0
|
|
79
79
|
*/
|
|
80
|
-
|
|
80
|
+
F(w, "YesNo", [
|
|
81
81
|
{
|
|
82
82
|
label: "是",
|
|
83
83
|
text: "✅ 是",
|
|
@@ -93,7 +93,7 @@ $(w, "YesNo", [
|
|
|
93
93
|
* - 男 M
|
|
94
94
|
* - 女 F
|
|
95
95
|
*/
|
|
96
|
-
|
|
96
|
+
F(w, "MaleFemale", [
|
|
97
97
|
{
|
|
98
98
|
label: "男",
|
|
99
99
|
text: "男 👨",
|
|
@@ -105,11 +105,11 @@ $(w, "MaleFemale", [
|
|
|
105
105
|
value: "F"
|
|
106
106
|
}
|
|
107
107
|
]);
|
|
108
|
-
let
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
108
|
+
let M = w;
|
|
109
|
+
M.setOptions("EnableDisable", M.EnableDisable);
|
|
110
|
+
M.setOptions("SuccessResult", M.SuccessResult);
|
|
111
|
+
M.setOptions("YesNo", M.YesNo);
|
|
112
|
+
M.setOptions("MaleFemale", M.MaleFemale);
|
|
113
113
|
const ce = {
|
|
114
114
|
/**
|
|
115
115
|
* 选项数据接口
|
|
@@ -173,62 +173,62 @@ const ce = {
|
|
|
173
173
|
type: Object,
|
|
174
174
|
required: !1
|
|
175
175
|
}
|
|
176
|
-
}, P = (e) => e == null || e === "" ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1, Re = (e,
|
|
176
|
+
}, P = (e) => e == null || e === "" ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1, Re = (e, a) => {
|
|
177
177
|
var n;
|
|
178
|
-
const
|
|
178
|
+
const t = e.page;
|
|
179
179
|
return {
|
|
180
180
|
url: "",
|
|
181
181
|
...e.url,
|
|
182
|
-
...(n =
|
|
183
|
-
...
|
|
184
|
-
loadingText:
|
|
182
|
+
...(n = t.urls) == null ? void 0 : n[a.urlKey],
|
|
183
|
+
...a.url,
|
|
184
|
+
loadingText: a.loadingText
|
|
185
185
|
};
|
|
186
|
-
}, Te = (e,
|
|
187
|
-
const
|
|
186
|
+
}, Te = (e, a) => {
|
|
187
|
+
const t = e.page, s = a.url;
|
|
188
188
|
if (!s || !s.url) {
|
|
189
|
-
const o = `URL未设置: ${
|
|
189
|
+
const o = `URL未设置: ${a.urlKey}`;
|
|
190
190
|
return console.warn(o), Promise.reject(new Error(o));
|
|
191
191
|
}
|
|
192
|
-
s.api || (s.api =
|
|
193
|
-
let n = JSON.parse(JSON.stringify(
|
|
194
|
-
return
|
|
195
|
-
}, Ve = (e,
|
|
196
|
-
|
|
197
|
-
const
|
|
198
|
-
return
|
|
199
|
-
}, $
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
192
|
+
s.api || (s.api = t.api), s.authorize === void 0 && (s.authorize = t.authorize);
|
|
193
|
+
let n = JSON.parse(JSON.stringify(a.params));
|
|
194
|
+
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)).catch((o) => (a.loadingState && (a.loadingState.value = !1), null));
|
|
195
|
+
}, Ve = (e, a) => {
|
|
196
|
+
a.params || (a.params = {}), a.params.Query || (a.params.Query = {});
|
|
197
|
+
const t = Re(e, a);
|
|
198
|
+
return a.url = t, Te(e, a);
|
|
199
|
+
}, $a = (e, a) => (a.params || (a.params = {}), a.params.Query || (a.params.Query = {}), a.loadingText = a.loadingText === !1 ? !1 : a.loadingText || "开始执行...", a.url = Re(e, a), Te(e, a).then((t) => ((t == null ? void 0 : t.status) === T.SUCCESS && (a.hideErrorToast || x.success("执行成功!")), t))), tt = (e, a = {}) => {
|
|
200
|
+
const t = a.primaryKey || "Id";
|
|
201
|
+
if (a.params || (a.params = {}), a.params.Query || (a.params.Query = {}), !a.params.Data)
|
|
202
202
|
return x.error("错误!无保存数据!"), Promise.resolve(null);
|
|
203
203
|
const s = {
|
|
204
|
-
...
|
|
205
|
-
urlKey:
|
|
206
|
-
loadingText:
|
|
204
|
+
...a,
|
|
205
|
+
urlKey: a.urlKey || "save",
|
|
206
|
+
loadingText: a.loadingText === !1 ? !1 : a.loadingText || "数据保存中..."
|
|
207
207
|
};
|
|
208
|
-
s.params.Query[
|
|
208
|
+
s.params.Query[t] = s.params.Data[t];
|
|
209
209
|
const n = Re(e, s);
|
|
210
|
-
return s.url = n, Te(e, s).then((o) => ((o == null ? void 0 : o.status) === T.SUCCESS && (
|
|
211
|
-
},
|
|
212
|
-
const s =
|
|
213
|
-
|
|
210
|
+
return s.url = n, Te(e, s).then((o) => ((o == null ? void 0 : o.status) === T.SUCCESS && (a.hideErrorToast || x.success("保存成功!")), o));
|
|
211
|
+
}, Dt = (e, a, t = {}) => {
|
|
212
|
+
const s = t.primaryKey || "Id";
|
|
213
|
+
t.params || (t.params = {}), t.params.Query || (t.params.Query = {});
|
|
214
214
|
const n = {
|
|
215
|
-
...
|
|
215
|
+
...t,
|
|
216
216
|
urlKey: "delete",
|
|
217
|
-
loadingText:
|
|
217
|
+
loadingText: t.loadingText === !1 ? !1 : t.loadingText || "数据删除中..."
|
|
218
218
|
};
|
|
219
|
-
if (Array.isArray(
|
|
219
|
+
if (Array.isArray(a) ? n.params.Query[s] = a : n.params.Query[s] = a[s], P(n.params.Query) || P(n.params.Query[s]))
|
|
220
220
|
return x.error("错误!禁止无条件删除数据!"), Promise.resolve(null);
|
|
221
221
|
const o = Re(e, n);
|
|
222
|
-
return n.url = o, Te(e, n).then((r) => ((r == null ? void 0 : r.status) === T.SUCCESS && (
|
|
223
|
-
},
|
|
222
|
+
return n.url = o, Te(e, n).then((r) => ((r == null ? void 0 : r.status) === T.SUCCESS && (t.hideErrorToast || x.success("删除成功!")), r));
|
|
223
|
+
}, Ut = (e, a) => Ve(e, {
|
|
224
224
|
urlKey: "tree",
|
|
225
225
|
params: {},
|
|
226
226
|
loadingState: e.isTreeLoading,
|
|
227
227
|
loadingText: !1,
|
|
228
|
-
processParams: () => Oe(e.treeQuery,
|
|
229
|
-
}).then((
|
|
228
|
+
processParams: () => Oe(e.treeQuery, a)
|
|
229
|
+
}).then((t) => (t == null ? void 0 : t.status) === T.SUCCESS ? (e.data.value = t.data, e.data.value) : []);
|
|
230
230
|
let re;
|
|
231
|
-
const
|
|
231
|
+
const Fa = (e) => {
|
|
232
232
|
re = new He({}), re.messages({
|
|
233
233
|
required: "${label}不能为空",
|
|
234
234
|
types: {
|
|
@@ -255,25 +255,25 @@ const Ft = (e) => {
|
|
|
255
255
|
},
|
|
256
256
|
...e
|
|
257
257
|
});
|
|
258
|
-
},
|
|
258
|
+
}, Ma = (e) => {
|
|
259
259
|
if (!e || P(e))
|
|
260
260
|
return [];
|
|
261
|
-
const
|
|
261
|
+
const a = [], t = re.messages(), s = (o, r, l) => {
|
|
262
262
|
const i = r.type;
|
|
263
|
-
if (i &&
|
|
264
|
-
const c =
|
|
263
|
+
if (i && t.types && i in t.types) {
|
|
264
|
+
const c = t.types[i];
|
|
265
265
|
n(c, o, { type: i }, l);
|
|
266
266
|
}
|
|
267
267
|
const u = ["string", "number", "array"];
|
|
268
268
|
for (const c of u)
|
|
269
|
-
if (i === c &&
|
|
270
|
-
const p =
|
|
271
|
-
for (const
|
|
272
|
-
|
|
269
|
+
if (i === c && t[c]) {
|
|
270
|
+
const p = t[c], v = ["len", "min", "max", "range"];
|
|
271
|
+
for (const h of v)
|
|
272
|
+
h === "range" && r.min != null && r.max != null && p.range ? n(p.range, o, { min: r.min, max: r.max }, l) : h !== "range" && r[h] != null && p[h] && n(p[h], o, { [h]: r[h] }, l);
|
|
273
273
|
}
|
|
274
|
-
if (r.required &&
|
|
274
|
+
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) {
|
|
275
275
|
const c = r.enum.join(", ");
|
|
276
|
-
n(
|
|
276
|
+
n(t.enum, o, { enum: c }, l);
|
|
277
277
|
}
|
|
278
278
|
}, n = (o, r, l, i) => {
|
|
279
279
|
if (o)
|
|
@@ -304,108 +304,108 @@ const Ft = (e) => {
|
|
|
304
304
|
console.error("处理验证规则出错:", u);
|
|
305
305
|
}
|
|
306
306
|
const i = Array.from(new Set(l));
|
|
307
|
-
o && i.length > 0 &&
|
|
307
|
+
o && i.length > 0 && a.push({
|
|
308
308
|
field: o,
|
|
309
309
|
rules: i
|
|
310
310
|
});
|
|
311
|
-
}),
|
|
311
|
+
}), a;
|
|
312
312
|
}, fe = async (e) => {
|
|
313
|
-
const
|
|
314
|
-
P(
|
|
313
|
+
const a = e.formData.value, t = e.formRules.value;
|
|
314
|
+
P(t) || (Ke(e), e.ruleValidator || (e.ruleValidator = new He({}), e.ruleValidator.messages(re.messages()), e.ruleValidator.define(t)), e.ruleResults.value = await e.ruleValidator.validate(a).then(() => {
|
|
315
315
|
}).catch(({ fields: s }) => s));
|
|
316
|
-
},
|
|
316
|
+
}, _a = async (e, a, t) => (t || (t = new He({}), t.messages(re.messages()), t.define(a)), t.validate(e).then(() => {
|
|
317
317
|
}).catch(({ fields: s }) => s)), Ke = (e) => {
|
|
318
318
|
e.ruleResults.value = void 0;
|
|
319
319
|
}, Y = () => {
|
|
320
|
-
const e =
|
|
320
|
+
const e = ae(D.EditorControl, void 0), a = f(ae(D.LabelText, "")), t = f(ae(D.RuleKey, "")), s = ae(D.ErrInfo, void 0);
|
|
321
321
|
return {
|
|
322
322
|
editorCtrl: e,
|
|
323
|
-
labelText:
|
|
324
|
-
ruleKey:
|
|
323
|
+
labelText: a,
|
|
324
|
+
ruleKey: t,
|
|
325
325
|
errInfo: s
|
|
326
326
|
};
|
|
327
|
-
},
|
|
328
|
-
let
|
|
327
|
+
}, Ht = (e, a) => {
|
|
328
|
+
let t = f({
|
|
329
329
|
msg: "",
|
|
330
330
|
errClass: ""
|
|
331
331
|
});
|
|
332
332
|
if (!e.label || !e.rule)
|
|
333
|
-
return
|
|
334
|
-
const s =
|
|
335
|
-
return
|
|
333
|
+
return t;
|
|
334
|
+
const s = a == null ? void 0 : a.ruleResults;
|
|
335
|
+
return y(
|
|
336
336
|
() => s == null ? void 0 : s.value,
|
|
337
337
|
(n) => {
|
|
338
|
-
if (
|
|
339
|
-
const o =
|
|
338
|
+
if (t.value.errClass = "", t.value.msg = "", !P(n)) {
|
|
339
|
+
const o = Vt(
|
|
340
340
|
{
|
|
341
341
|
label: e.label,
|
|
342
342
|
rule: e.rule
|
|
343
343
|
},
|
|
344
|
-
|
|
344
|
+
a == null ? void 0 : a.formRules.value,
|
|
345
345
|
Ze(n)
|
|
346
346
|
);
|
|
347
|
-
|
|
347
|
+
t.value.errClass = o.errClass.value, t.value.msg = o.msg.value;
|
|
348
348
|
}
|
|
349
349
|
},
|
|
350
350
|
{ deep: !0 }
|
|
351
|
-
),
|
|
352
|
-
},
|
|
351
|
+
), t;
|
|
352
|
+
}, Vt = (e, a, t) => {
|
|
353
353
|
const s = f([]), n = f(""), o = f("");
|
|
354
|
-
if (!e.rule || !
|
|
354
|
+
if (!e.rule || !a || !t)
|
|
355
355
|
return { msg: n, ruleErrors: s, errClass: o };
|
|
356
356
|
e.rule.split("|").forEach((i) => {
|
|
357
357
|
if (i = i.trim(), i)
|
|
358
|
-
if (
|
|
359
|
-
s.value.push(...
|
|
358
|
+
if (t[i])
|
|
359
|
+
s.value.push(...t[i]);
|
|
360
360
|
else {
|
|
361
361
|
const u = [];
|
|
362
|
-
for (let c in
|
|
363
|
-
c !== i && c.startsWith(i + ".") && u.push(...
|
|
362
|
+
for (let c in t)
|
|
363
|
+
c !== i && c.startsWith(i + ".") && u.push(...t[c]);
|
|
364
364
|
u.length > 0 && s.value.push(...u);
|
|
365
365
|
}
|
|
366
366
|
});
|
|
367
367
|
const l = /\${\w+}/g;
|
|
368
368
|
return s.value.forEach((i) => {
|
|
369
369
|
n.value && (n.value += " / "), n.value += i.message.replace("${label}", e.label ?? "");
|
|
370
|
-
const u =
|
|
370
|
+
const u = a[i.field];
|
|
371
371
|
if (u) {
|
|
372
372
|
const c = n.value.match(l);
|
|
373
373
|
c && c.forEach((p) => {
|
|
374
|
-
const
|
|
375
|
-
n.value = n.value.replace(p, u[
|
|
374
|
+
const v = p.replace("${", "").replace("}", "");
|
|
375
|
+
n.value = n.value.replace(p, u[v] ?? "");
|
|
376
376
|
});
|
|
377
377
|
}
|
|
378
378
|
}), s.value.length > 0 && (o.value = "error"), { msg: n, ruleErrors: s, errClass: o };
|
|
379
|
-
},
|
|
379
|
+
}, Na = (e, a) => {
|
|
380
380
|
Le(D.LabelText, e.label || ""), Le(D.RuleKey, e.rule || "");
|
|
381
|
-
const
|
|
382
|
-
return Le(D.ErrInfo,
|
|
383
|
-
},
|
|
384
|
-
|
|
385
|
-
},
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
},
|
|
381
|
+
const t = Ht(e, a);
|
|
382
|
+
return Le(D.ErrInfo, t), t;
|
|
383
|
+
}, Da = (e) => {
|
|
384
|
+
at(e);
|
|
385
|
+
}, Ua = (e) => {
|
|
386
|
+
const a = e.page, t = e.formData.value;
|
|
387
|
+
t[e.primaryKey ?? a.primaryKey] = null, at(e);
|
|
388
|
+
}, Ha = (e) => {
|
|
389
389
|
Qe(e), e.visible.value = !1;
|
|
390
|
-
},
|
|
390
|
+
}, at = async (e) => {
|
|
391
391
|
var s;
|
|
392
|
-
const
|
|
392
|
+
const a = e.page;
|
|
393
393
|
if (e.isFormSaving.value = !0, Ke(e), e.beforeSave && e.beforeSave() === !1)
|
|
394
394
|
return e.isFormSaving.value = !1, Promise.resolve();
|
|
395
395
|
if (e.formRules.value && await fe(e), e.ruleResults.value)
|
|
396
396
|
return x.error("提交表单时,验证失败!"), console.error("表单验证失败!", e.ruleResults.value), e.isFormSaving.value = !1, Promise.resolve();
|
|
397
|
-
const
|
|
398
|
-
return
|
|
397
|
+
const t = e.formData.value;
|
|
398
|
+
return tt(
|
|
399
399
|
{
|
|
400
|
-
page:
|
|
400
|
+
page: a,
|
|
401
401
|
// 转换为AnyControl接口
|
|
402
402
|
reload: (s = e.grid) == null ? void 0 : s.reload
|
|
403
403
|
},
|
|
404
404
|
{
|
|
405
405
|
url: e.saveUrl,
|
|
406
|
-
primaryKey: e.primaryKey ??
|
|
406
|
+
primaryKey: e.primaryKey ?? a.primaryKey,
|
|
407
407
|
params: {
|
|
408
|
-
Data:
|
|
408
|
+
Data: t,
|
|
409
409
|
Query: {}
|
|
410
410
|
},
|
|
411
411
|
hideErrorToast: !0,
|
|
@@ -422,10 +422,10 @@ const Ft = (e) => {
|
|
|
422
422
|
const i = l[1], u = l[2].replace(/Idx_/g, "").split("_"), c = e.formRules.value;
|
|
423
423
|
if (c && u.length > 0) {
|
|
424
424
|
const p = {};
|
|
425
|
-
u.forEach((
|
|
426
|
-
c[
|
|
425
|
+
u.forEach((v) => {
|
|
426
|
+
c[v] && (p[v] = [
|
|
427
427
|
{
|
|
428
|
-
field:
|
|
428
|
+
field: v,
|
|
429
429
|
fieldValue: i,
|
|
430
430
|
message: "数据重复"
|
|
431
431
|
}
|
|
@@ -437,58 +437,58 @@ const Ft = (e) => {
|
|
|
437
437
|
} else
|
|
438
438
|
x.error((n == null ? void 0 : n.msg) ?? "保存失败!");
|
|
439
439
|
});
|
|
440
|
-
},
|
|
441
|
-
const
|
|
440
|
+
}, Va = async (e) => {
|
|
441
|
+
const a = e.page, t = e.grid;
|
|
442
442
|
e.isFormLoading.value = !0;
|
|
443
|
-
const s = e.formData.value, n = e.primaryKey ??
|
|
444
|
-
return
|
|
445
|
-
e.isFormLoading.value = !1, o &&
|
|
443
|
+
const s = e.formData.value, n = e.primaryKey ?? a.primaryKey;
|
|
444
|
+
return ut(t, { [n]: s[n] }, e.detailUrl).then((o) => {
|
|
445
|
+
e.isFormLoading.value = !1, o && st(e, o);
|
|
446
446
|
});
|
|
447
|
-
},
|
|
448
|
-
const
|
|
449
|
-
|
|
447
|
+
}, Ka = (e) => {
|
|
448
|
+
const a = e.grid;
|
|
449
|
+
a && (a.rowData.value = void 0), e && (Qe(e), e.visible && (e.visible.value = !1), setTimeout(() => {
|
|
450
450
|
e.visible.value = !0;
|
|
451
451
|
}, 1));
|
|
452
|
-
},
|
|
452
|
+
}, st = (e, a) => {
|
|
453
453
|
Qe(e);
|
|
454
|
-
const
|
|
455
|
-
e.formData.value = JSON.parse(JSON.stringify(
|
|
454
|
+
const t = { ...e.formData.value, ...a };
|
|
455
|
+
e.formData.value = JSON.parse(JSON.stringify(t));
|
|
456
456
|
}, Qe = (e) => {
|
|
457
457
|
e.formData.value = e.default ? JSON.parse(JSON.stringify(e.default)) : {}, Ke(e);
|
|
458
|
-
}, Se = "/login/", ve = [],
|
|
459
|
-
for (const
|
|
460
|
-
const
|
|
461
|
-
|
|
458
|
+
}, Se = "/login/", ve = [], Kt = (e) => {
|
|
459
|
+
for (const a of e) {
|
|
460
|
+
const t = ve.findIndex((s) => s.path === a.path);
|
|
461
|
+
t !== -1 && ve.splice(t, 1), ve.push(a), oe.addRoute(a);
|
|
462
462
|
}
|
|
463
|
-
},
|
|
463
|
+
}, nt = (e, a, t, s = "") => {
|
|
464
464
|
const n = s + (s ? "/" : "") + e.path;
|
|
465
|
-
|
|
466
|
-
}, oe =
|
|
467
|
-
history:
|
|
465
|
+
a[n] = { ...e, parent: t }, e.children && e.children.forEach((o) => nt(o, a, e, n));
|
|
466
|
+
}, oe = Mt({
|
|
467
|
+
history: _t("/"),
|
|
468
468
|
routes: ve
|
|
469
|
-
}),
|
|
469
|
+
}), Qt = (e, a) => {
|
|
470
470
|
var n, o;
|
|
471
|
-
const
|
|
472
|
-
if (!
|
|
473
|
-
return
|
|
474
|
-
if (
|
|
471
|
+
const t = ((n = e.meta) == null ? void 0 : n.roles) ?? [], s = (o = e.meta) == null ? void 0 : o.permission;
|
|
472
|
+
if (!a)
|
|
473
|
+
return t.length === 0 && !s;
|
|
474
|
+
if (a) {
|
|
475
475
|
const r = j();
|
|
476
476
|
if (ge.VITE_PERMISSION_MODE === "role")
|
|
477
|
-
return
|
|
477
|
+
return t.length === 0 ? !0 : r.hasRole(t);
|
|
478
478
|
if (ge.VITE_PERMISSION_MODE === "permit") {
|
|
479
|
-
if (
|
|
479
|
+
if (t.length === 0 && !s)
|
|
480
480
|
return !0;
|
|
481
481
|
let l = !1, i = !1;
|
|
482
|
-
return
|
|
482
|
+
return t.length > 0 && (l = r.hasRole(t)), s && (i = r.hasPermit(e.path, ":page")), l || i;
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
485
|
return !1;
|
|
486
486
|
}, se = f(null);
|
|
487
|
-
oe.beforeEach((e,
|
|
487
|
+
oe.beforeEach((e, a, t) => {
|
|
488
488
|
var l;
|
|
489
489
|
const s = e;
|
|
490
490
|
if (e.path.startsWith("/error/") || e.path.startsWith(Se))
|
|
491
|
-
return
|
|
491
|
+
return t();
|
|
492
492
|
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);
|
|
493
493
|
if (e.path === "/") {
|
|
494
494
|
const i = H();
|
|
@@ -496,7 +496,7 @@ oe.beforeEach((e, t, a) => {
|
|
|
496
496
|
se.value = {
|
|
497
497
|
to: e,
|
|
498
498
|
next: (u) => {
|
|
499
|
-
|
|
499
|
+
t({ path: u });
|
|
500
500
|
}
|
|
501
501
|
};
|
|
502
502
|
return;
|
|
@@ -505,37 +505,37 @@ oe.beforeEach((e, t, a) => {
|
|
|
505
505
|
return;
|
|
506
506
|
}
|
|
507
507
|
if (!r)
|
|
508
|
-
|
|
508
|
+
t();
|
|
509
509
|
else {
|
|
510
510
|
const i = j();
|
|
511
511
|
if (!i.isLogin)
|
|
512
|
-
|
|
512
|
+
t({ path: Se });
|
|
513
513
|
else {
|
|
514
514
|
if (!H().menuLoaded) {
|
|
515
515
|
se.value = {
|
|
516
516
|
to: e,
|
|
517
|
-
next:
|
|
517
|
+
next: t
|
|
518
518
|
};
|
|
519
519
|
return;
|
|
520
520
|
}
|
|
521
|
-
const c =
|
|
522
|
-
|
|
521
|
+
const c = Qt(s, i.isLogin);
|
|
522
|
+
t();
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
525
|
});
|
|
526
|
-
const
|
|
526
|
+
const Jt = (e) => {
|
|
527
527
|
if (se.value) {
|
|
528
|
-
const { to:
|
|
529
|
-
se.value = null,
|
|
528
|
+
const { to: a, next: t } = se.value;
|
|
529
|
+
se.value = null, a.path === "/" ? t(e) : t(a.path);
|
|
530
530
|
}
|
|
531
|
-
},
|
|
532
|
-
const
|
|
533
|
-
if (
|
|
534
|
-
if (
|
|
531
|
+
}, jt = (e) => {
|
|
532
|
+
const a = Je();
|
|
533
|
+
if (a.TabEnabled) {
|
|
534
|
+
if (Gt(e.key, a.TabPanes))
|
|
535
535
|
return;
|
|
536
|
-
|
|
536
|
+
a.TabPanes.push(e);
|
|
537
537
|
}
|
|
538
|
-
},
|
|
538
|
+
}, Gt = (e, a) => a.find((t) => t.key === e), Je = ue("pageInfo", {
|
|
539
539
|
state: () => ({
|
|
540
540
|
TabActive: "",
|
|
541
541
|
TabPanes: [],
|
|
@@ -549,18 +549,18 @@ const Ja = (e) => {
|
|
|
549
549
|
removeTabPane(e) {
|
|
550
550
|
if (this.TabEnabled) {
|
|
551
551
|
H().excludeComponent(e);
|
|
552
|
-
let
|
|
552
|
+
let t = 0, s = [...this.TabPanes];
|
|
553
553
|
for (let n = 0; n < s.length; n++)
|
|
554
554
|
if (s[n].key === e) {
|
|
555
|
-
s.splice(n, 1),
|
|
555
|
+
s.splice(n, 1), t = n - 1 < 0 ? 0 : n - 1;
|
|
556
556
|
break;
|
|
557
557
|
}
|
|
558
558
|
for (let n = 0; n < s.length; n++)
|
|
559
559
|
if (s[n].key === this.TabActive) {
|
|
560
|
-
|
|
560
|
+
t = n;
|
|
561
561
|
break;
|
|
562
562
|
}
|
|
563
|
-
this.TabPanes = s, this.setTabActive(s[
|
|
563
|
+
this.TabPanes = s, this.setTabActive(s[t].key);
|
|
564
564
|
}
|
|
565
565
|
},
|
|
566
566
|
/**
|
|
@@ -569,50 +569,50 @@ const Ja = (e) => {
|
|
|
569
569
|
* @returns
|
|
570
570
|
*/
|
|
571
571
|
async setTabActive(e) {
|
|
572
|
-
let
|
|
573
|
-
if (!
|
|
572
|
+
let t = H().findRoute(e);
|
|
573
|
+
if (!t) return;
|
|
574
574
|
const s = {
|
|
575
575
|
key: e,
|
|
576
|
-
title:
|
|
576
|
+
title: t.name.toString(),
|
|
577
577
|
content: "",
|
|
578
578
|
closable: !0,
|
|
579
579
|
// 根据路由的meta.keepAlive确定是否加入对应缓存
|
|
580
580
|
// 默认为true
|
|
581
|
-
keepAlive: !(
|
|
581
|
+
keepAlive: !(t.meta && !t.meta.keepAlive)
|
|
582
582
|
};
|
|
583
|
-
|
|
583
|
+
jt(s), this.TabActive = e;
|
|
584
584
|
}
|
|
585
585
|
},
|
|
586
586
|
persist: !1
|
|
587
|
-
}),
|
|
587
|
+
}), Wt = {
|
|
588
588
|
appList: {
|
|
589
589
|
api: "PLATFORM_API",
|
|
590
590
|
authorize: !0,
|
|
591
591
|
url: "/api/RCTenanetOpSrv/getApps",
|
|
592
592
|
loadingText: !1
|
|
593
593
|
}
|
|
594
|
-
}, Fe = /* @__PURE__ */ new Map(),
|
|
595
|
-
const
|
|
596
|
-
if (P(
|
|
594
|
+
}, Fe = /* @__PURE__ */ new Map(), qt = (e) => {
|
|
595
|
+
const a = j(), { roles: t, permission: s } = e.meta || {};
|
|
596
|
+
if (P(t) && P(s))
|
|
597
597
|
return !0;
|
|
598
598
|
if (ge.VITE_PERMISSION_MODE === "role")
|
|
599
|
-
return P(
|
|
599
|
+
return P(t) ? !0 : a.hasRole(t);
|
|
600
600
|
if (ge.VITE_PERMISSION_MODE === "permit") {
|
|
601
601
|
let n = !1, o = !1;
|
|
602
|
-
return P(
|
|
602
|
+
return P(t) || (n = a.hasRole(t)), a.isAdmin() ? n : (P(s) || (o = a.hasPermit(e.path, s)), n || o);
|
|
603
603
|
}
|
|
604
604
|
return !1;
|
|
605
|
-
},
|
|
606
|
-
const
|
|
607
|
-
return
|
|
608
|
-
}).filter(Boolean),
|
|
609
|
-
for (const
|
|
610
|
-
if (!
|
|
611
|
-
let s =
|
|
605
|
+
}, rt = (e) => e.map((a) => {
|
|
606
|
+
const t = { ...a };
|
|
607
|
+
return qt(t) ? (t.children && (t.children = rt(t.children)), t) : null;
|
|
608
|
+
}).filter(Boolean), ot = (e, a = "") => {
|
|
609
|
+
for (const t of e) {
|
|
610
|
+
if (!t.children && !t.redirect) {
|
|
611
|
+
let s = a + t.path;
|
|
612
612
|
return s.startsWith("/") || (s = "/" + s), s;
|
|
613
613
|
}
|
|
614
|
-
if (
|
|
615
|
-
const s =
|
|
614
|
+
if (t.children && t.children.length > 0 && t.path !== "/error" && t.path !== "/login" && t.path !== "/:page(.*)") {
|
|
615
|
+
const s = ot(t.children, a + t.path + "/");
|
|
616
616
|
if (s)
|
|
617
617
|
return s;
|
|
618
618
|
}
|
|
@@ -625,8 +625,8 @@ const Ja = (e) => {
|
|
|
625
625
|
AppCode: "",
|
|
626
626
|
Version: "",
|
|
627
627
|
Host: "",
|
|
628
|
-
Source:
|
|
629
|
-
Action:
|
|
628
|
+
Source: Ce.Manual,
|
|
629
|
+
Action: Be.App,
|
|
630
630
|
Path: "",
|
|
631
631
|
Icon: "",
|
|
632
632
|
Routes: [],
|
|
@@ -644,14 +644,14 @@ const Ja = (e) => {
|
|
|
644
644
|
* 加载授权应用列表
|
|
645
645
|
*/
|
|
646
646
|
async loadAppList(e) {
|
|
647
|
-
return new Promise(async (
|
|
647
|
+
return new Promise(async (a) => {
|
|
648
648
|
e && e.length > 0 ? (this.appList.length = 0, setTimeout(async () => {
|
|
649
|
-
this.appList.push(...e),
|
|
650
|
-
}, 1e3)) : (this.appList.length === 0 && await this.getRemoteAppList(),
|
|
649
|
+
this.appList.push(...e), a();
|
|
650
|
+
}, 1e3)) : (this.appList.length === 0 && await this.getRemoteAppList(), a());
|
|
651
651
|
});
|
|
652
652
|
},
|
|
653
653
|
async getRemoteAppList() {
|
|
654
|
-
return G(
|
|
654
|
+
return G(Wt.appList, {
|
|
655
655
|
Query: {
|
|
656
656
|
AppCode: this.appInfo.AppCode,
|
|
657
657
|
Enabled: 1
|
|
@@ -665,32 +665,32 @@ const Ja = (e) => {
|
|
|
665
665
|
x.error("加载应用列表失败");
|
|
666
666
|
return;
|
|
667
667
|
}
|
|
668
|
-
let
|
|
669
|
-
const
|
|
670
|
-
if (
|
|
671
|
-
for (let n =
|
|
672
|
-
if (
|
|
673
|
-
|
|
668
|
+
let a = "";
|
|
669
|
+
const t = window.location.pathname.split("/");
|
|
670
|
+
if (t.length > 1) {
|
|
671
|
+
for (let n = t.length - 1; n >= 0; n--)
|
|
672
|
+
if (t[n] !== "") {
|
|
673
|
+
a = t[n];
|
|
674
674
|
break;
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
677
|
let s = null;
|
|
678
|
-
|
|
678
|
+
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);
|
|
679
679
|
},
|
|
680
680
|
/**
|
|
681
681
|
* 设置当前应用
|
|
682
682
|
* @param key 应用码
|
|
683
683
|
* @returns
|
|
684
684
|
*/
|
|
685
|
-
async setActiveApp(e,
|
|
685
|
+
async setActiveApp(e, a) {
|
|
686
686
|
this.menuLoaded = !1;
|
|
687
|
-
const
|
|
688
|
-
|
|
689
|
-
...
|
|
687
|
+
const t = this.appList.find((s) => s.AppCode === e);
|
|
688
|
+
t && (t.AppCode !== this.appInfo.AppCode && (this.appInfo = {
|
|
689
|
+
...t,
|
|
690
690
|
flattenRoutes: {},
|
|
691
|
-
Routes:
|
|
691
|
+
Routes: a ?? [],
|
|
692
692
|
defaultPage: ""
|
|
693
|
-
}), (!ye() || !
|
|
693
|
+
}), (!ye() || !Lt()) && (await j().getRolePermits(t.Id), this.appInfo.Routes.length && this.setAppRoutes(this.appInfo.Routes)));
|
|
694
694
|
},
|
|
695
695
|
/**
|
|
696
696
|
* 设置当前应用路由信息
|
|
@@ -703,20 +703,20 @@ const Ja = (e) => {
|
|
|
703
703
|
Routes: e,
|
|
704
704
|
defaultPage: ""
|
|
705
705
|
};
|
|
706
|
-
const
|
|
707
|
-
for (const
|
|
708
|
-
|
|
709
|
-
if (Object.keys(
|
|
710
|
-
const s = t
|
|
711
|
-
s.children || !s.component || (s.meta && s.meta.keepAlive === !1 ? this.ExcludeComponents.push(
|
|
706
|
+
const a = this.appInfo.flattenRoutes;
|
|
707
|
+
for (const t of e)
|
|
708
|
+
nt(t, a, void 0);
|
|
709
|
+
if (Object.keys(a).forEach((t) => {
|
|
710
|
+
const s = a[t];
|
|
711
|
+
s.children || !s.component || (s.meta && s.meta.keepAlive === !1 ? this.ExcludeComponents.push(t) : this.CachedComponents.push(t));
|
|
712
712
|
}), j().isLogin) {
|
|
713
|
-
const
|
|
714
|
-
if (
|
|
715
|
-
if (this.menuLoaded = !0,
|
|
713
|
+
const t = rt(this.appInfo.Routes);
|
|
714
|
+
if (Kt(t), this.appInfo.defaultPage = ot(t) || "", this.appInfo.defaultPage) {
|
|
715
|
+
if (this.menuLoaded = !0, N.value && N.value.mainAppPush) {
|
|
716
716
|
const s = this.formatRoute(this.appInfo.defaultPage);
|
|
717
|
-
|
|
717
|
+
N.value.mainAppPush(s);
|
|
718
718
|
}
|
|
719
|
-
|
|
719
|
+
Jt(this.appInfo.defaultPage);
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
722
|
},
|
|
@@ -726,18 +726,18 @@ const Ja = (e) => {
|
|
|
726
726
|
* @returns
|
|
727
727
|
*/
|
|
728
728
|
formatRoute(e) {
|
|
729
|
-
let
|
|
730
|
-
return e.includes("#") ? e.startsWith("#") && (
|
|
729
|
+
let a = e;
|
|
730
|
+
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;
|
|
731
731
|
},
|
|
732
732
|
/**
|
|
733
733
|
* 应用导航,菜单路由,都使用此处导航
|
|
734
734
|
* @param path 路由地址
|
|
735
735
|
*/
|
|
736
736
|
push(e) {
|
|
737
|
-
this.findRoute(e) && Je().setTabActive(e),
|
|
738
|
-
if (oe.push({ path: e }),
|
|
739
|
-
const
|
|
740
|
-
|
|
737
|
+
this.findRoute(e) && Je().setTabActive(e), gt(() => {
|
|
738
|
+
if (oe.push({ path: e }), N.value && N.value.mainAppPush) {
|
|
739
|
+
const t = this.formatRoute(e);
|
|
740
|
+
N.value.mainAppPush(t);
|
|
741
741
|
}
|
|
742
742
|
});
|
|
743
743
|
},
|
|
@@ -755,19 +755,19 @@ const Ja = (e) => {
|
|
|
755
755
|
* @param route 路由
|
|
756
756
|
* @returns 组件实例
|
|
757
757
|
*/
|
|
758
|
-
cacheComponent(e,
|
|
759
|
-
let
|
|
760
|
-
if (!
|
|
761
|
-
if (this.CachedComponents.includes(
|
|
762
|
-
|
|
758
|
+
cacheComponent(e, a) {
|
|
759
|
+
let t = Fe.get(a.path);
|
|
760
|
+
if (!t)
|
|
761
|
+
if (this.CachedComponents.includes(a.path))
|
|
762
|
+
t = {
|
|
763
763
|
// 设置组件包装器的名称为路由路径
|
|
764
|
-
name:
|
|
764
|
+
name: a.path,
|
|
765
765
|
render() {
|
|
766
766
|
return U(e);
|
|
767
767
|
}
|
|
768
|
-
}, Fe.set(
|
|
768
|
+
}, Fe.set(a.path, t);
|
|
769
769
|
else return e;
|
|
770
|
-
return
|
|
770
|
+
return t;
|
|
771
771
|
},
|
|
772
772
|
/**
|
|
773
773
|
* 删除缓存组件
|
|
@@ -780,12 +780,12 @@ const Ja = (e) => {
|
|
|
780
780
|
* 路由路径层级查询,返回面包屑
|
|
781
781
|
*/
|
|
782
782
|
matchedRoutes(e) {
|
|
783
|
-
const
|
|
784
|
-
if (
|
|
785
|
-
const s = this.matchedRoutes(
|
|
786
|
-
|
|
783
|
+
const a = [], t = this.findRoute(e);
|
|
784
|
+
if (t && (a.push(t), t.parent)) {
|
|
785
|
+
const s = this.matchedRoutes(t.parent.path);
|
|
786
|
+
a.push(...s);
|
|
787
787
|
}
|
|
788
|
-
return
|
|
788
|
+
return a.reverse();
|
|
789
789
|
},
|
|
790
790
|
clean() {
|
|
791
791
|
this.appInfo = {
|
|
@@ -794,8 +794,8 @@ const Ja = (e) => {
|
|
|
794
794
|
AppCode: "",
|
|
795
795
|
Version: "",
|
|
796
796
|
Host: "",
|
|
797
|
-
Source:
|
|
798
|
-
Action:
|
|
797
|
+
Source: Ce.Manual,
|
|
798
|
+
Action: Be.App,
|
|
799
799
|
Path: "",
|
|
800
800
|
Icon: "",
|
|
801
801
|
Routes: [],
|
|
@@ -805,11 +805,11 @@ const Ja = (e) => {
|
|
|
805
805
|
}, this.CachedComponents.splice(0, this.CachedComponents.length), this.ExcludeComponents.splice(0, this.ExcludeComponents.length), this.appList.splice(0, this.appList.length), this.menuLoaded = !1;
|
|
806
806
|
},
|
|
807
807
|
logout() {
|
|
808
|
-
this.clean(), oe.push({ path: Se + "#/" }), ye() &&
|
|
808
|
+
this.clean(), oe.push({ path: Se + "#/" }), ye() && N.value && N.value.mainAppPush && N.value.mainAppPush(Se + "#/");
|
|
809
809
|
}
|
|
810
810
|
},
|
|
811
811
|
persist: !1
|
|
812
|
-
}),
|
|
812
|
+
}), it = "Token解析失败", ze = "登录过期,请重新登录", je = {
|
|
813
813
|
login: {
|
|
814
814
|
api: "PLATFORM_API",
|
|
815
815
|
url: "/openapi/LoginSrv/login",
|
|
@@ -827,48 +827,48 @@ const Ja = (e) => {
|
|
|
827
827
|
url: "/api/LoginSrv/logout",
|
|
828
828
|
loadingText: "正在退出..."
|
|
829
829
|
}
|
|
830
|
-
},
|
|
831
|
-
let
|
|
830
|
+
}, Bt = (e) => {
|
|
831
|
+
let a = {
|
|
832
832
|
Option: {
|
|
833
833
|
Mode: "MicroApp"
|
|
834
834
|
},
|
|
835
835
|
Query: e
|
|
836
836
|
};
|
|
837
|
-
return G(je.login,
|
|
838
|
-
},
|
|
839
|
-
let
|
|
837
|
+
return G(je.login, a).then((t) => (t == null ? void 0 : t.status) === T.SUCCESS ? t : null);
|
|
838
|
+
}, Ct = (e) => {
|
|
839
|
+
let a = {
|
|
840
840
|
Query: {
|
|
841
841
|
AppId: e
|
|
842
842
|
}
|
|
843
843
|
};
|
|
844
|
-
return G(je.auth,
|
|
845
|
-
},
|
|
844
|
+
return G(je.auth, a).then((t) => (t == null ? void 0 : t.status) === T.SUCCESS ? t.data : (x.error("获取授权信息失败," + (t == null ? void 0 : t.msg)), null));
|
|
845
|
+
}, zt = () => {
|
|
846
846
|
let e = {
|
|
847
847
|
Option: {},
|
|
848
848
|
Query: {}
|
|
849
849
|
};
|
|
850
|
-
return G(je.logout, e).then((
|
|
851
|
-
},
|
|
850
|
+
return G(je.logout, e).then((a) => (a == null ? void 0 : a.status) === T.SUCCESS ? a.data : null);
|
|
851
|
+
}, Yt = (e) => {
|
|
852
852
|
try {
|
|
853
|
-
const
|
|
854
|
-
return Date.now() / 1e3 >
|
|
855
|
-
} catch (
|
|
856
|
-
return console.error(
|
|
853
|
+
const t = JSON.parse(atob(e.split(".")[1])).exp;
|
|
854
|
+
return Date.now() / 1e3 > t;
|
|
855
|
+
} catch (a) {
|
|
856
|
+
return console.error(it, a), !0;
|
|
857
857
|
}
|
|
858
|
-
}, Me = (e,
|
|
858
|
+
}, Me = (e, a) => e == "" ? (x.error(ze, {
|
|
859
859
|
duration: 3e3,
|
|
860
|
-
onClose:
|
|
861
|
-
}), !1) :
|
|
860
|
+
onClose: a
|
|
861
|
+
}), !1) : Yt(e) ? (x.error(ze, {
|
|
862
862
|
duration: 3e3,
|
|
863
|
-
onClose:
|
|
864
|
-
}), !1) : !0,
|
|
863
|
+
onClose: a
|
|
864
|
+
}), !1) : !0, Xt = (e) => {
|
|
865
865
|
try {
|
|
866
|
-
const
|
|
867
|
-
return
|
|
868
|
-
} catch (
|
|
869
|
-
return console.error(
|
|
866
|
+
const a = JSON.parse(atob(e.token.split(".")[1]));
|
|
867
|
+
return a.user = JSON.parse(a.user), e.UserInfo = a.user, !0;
|
|
868
|
+
} catch (a) {
|
|
869
|
+
return console.error(it, a), !1;
|
|
870
870
|
}
|
|
871
|
-
},
|
|
871
|
+
}, L = f(""), ee = f(null), j = ue("userInfo", {
|
|
872
872
|
state: () => ({
|
|
873
873
|
isLogin: !1,
|
|
874
874
|
userInfo: {
|
|
@@ -886,31 +886,31 @@ const Ja = (e) => {
|
|
|
886
886
|
* 启动时初始化用户信息
|
|
887
887
|
*/
|
|
888
888
|
init() {
|
|
889
|
-
ye() || (this.token ? (Me(this.token, () => this.clean()), he(this.token),
|
|
889
|
+
ye() || (this.token ? (Me(this.token, () => this.clean()), he(this.token), L.value = this.userInfo.UserLevel, this.isLogin = !0) : this.clean());
|
|
890
890
|
},
|
|
891
891
|
/**
|
|
892
892
|
* 登录操作
|
|
893
893
|
* @param loginInfo 登录信息
|
|
894
894
|
* @returns
|
|
895
895
|
*/
|
|
896
|
-
async login(e,
|
|
897
|
-
const
|
|
898
|
-
if (
|
|
899
|
-
const s =
|
|
896
|
+
async login(e, a) {
|
|
897
|
+
const t = await Bt(e);
|
|
898
|
+
if (t) {
|
|
899
|
+
const s = t;
|
|
900
900
|
if (s.errno)
|
|
901
901
|
return s;
|
|
902
902
|
{
|
|
903
|
-
const n =
|
|
904
|
-
if (this.token = n.token, he(this.token), this.isLogin = !0,
|
|
903
|
+
const n = t.data;
|
|
904
|
+
if (this.token = n.token, he(this.token), this.isLogin = !0, Xt(n))
|
|
905
905
|
this.userInfo = {
|
|
906
906
|
...this.userInfo,
|
|
907
907
|
...n.UserInfo
|
|
908
|
-
},
|
|
908
|
+
}, L.value = n.UserInfo.UserLevel;
|
|
909
909
|
else {
|
|
910
910
|
x.error("用户信息解析失败");
|
|
911
911
|
return;
|
|
912
912
|
}
|
|
913
|
-
|
|
913
|
+
a && H().toDefaultApp();
|
|
914
914
|
}
|
|
915
915
|
}
|
|
916
916
|
},
|
|
@@ -925,14 +925,14 @@ const Ja = (e) => {
|
|
|
925
925
|
if (ee.value && ee.value.appId === e)
|
|
926
926
|
return !0;
|
|
927
927
|
try {
|
|
928
|
-
const
|
|
929
|
-
return
|
|
928
|
+
const a = await Ct(e);
|
|
929
|
+
return a ? (ee.value = {
|
|
930
930
|
appId: e,
|
|
931
|
-
permits:
|
|
932
|
-
lastTime:
|
|
931
|
+
permits: a.permits || [],
|
|
932
|
+
lastTime: a.lastTime
|
|
933
933
|
}, !0) : !1;
|
|
934
|
-
} catch (
|
|
935
|
-
return console.error("获取授权信息出错",
|
|
934
|
+
} catch (a) {
|
|
935
|
+
return console.error("获取授权信息出错", a), !1;
|
|
936
936
|
}
|
|
937
937
|
},
|
|
938
938
|
/**
|
|
@@ -941,7 +941,7 @@ const Ja = (e) => {
|
|
|
941
941
|
* @returns 是否有角色权限
|
|
942
942
|
*/
|
|
943
943
|
hasRole(e) {
|
|
944
|
-
return
|
|
944
|
+
return L.value ? Array.isArray(e) ? e.includes(L.value) : L.value === e : !1;
|
|
945
945
|
},
|
|
946
946
|
/**
|
|
947
947
|
* 检查功能权限
|
|
@@ -949,10 +949,10 @@ const Ja = (e) => {
|
|
|
949
949
|
* @param permitCode 资源权限编码
|
|
950
950
|
* @returns 是否有功能权限
|
|
951
951
|
*/
|
|
952
|
-
hasPermit(e,
|
|
952
|
+
hasPermit(e, a) {
|
|
953
953
|
var s;
|
|
954
|
-
const
|
|
955
|
-
return !
|
|
954
|
+
const t = ee.value;
|
|
955
|
+
return !t || !t.permits ? !1 : ((s = t.permits[e]) == null ? void 0 : s.includes(a)) ?? !1;
|
|
956
956
|
},
|
|
957
957
|
/**
|
|
958
958
|
* 获取用户信息
|
|
@@ -967,15 +967,15 @@ const Ja = (e) => {
|
|
|
967
967
|
* @param userInfo 用户信息
|
|
968
968
|
* @param token 用户Token
|
|
969
969
|
*/
|
|
970
|
-
setUserInfo(e,
|
|
971
|
-
if (!Me(
|
|
970
|
+
setUserInfo(e, a) {
|
|
971
|
+
if (!Me(a)) {
|
|
972
972
|
this.clean();
|
|
973
973
|
return;
|
|
974
974
|
}
|
|
975
|
-
|
|
975
|
+
L.value || (L.value = e.UserLevel, this.userInfo = {
|
|
976
976
|
...this.userInfo,
|
|
977
977
|
...e
|
|
978
|
-
}, this.token =
|
|
978
|
+
}, this.token = a, he(this.token), this.isLogin = !0);
|
|
979
979
|
},
|
|
980
980
|
/**
|
|
981
981
|
* 获取用户Token
|
|
@@ -990,20 +990,20 @@ const Ja = (e) => {
|
|
|
990
990
|
* 是否超级管理员
|
|
991
991
|
*/
|
|
992
992
|
isSuperAdmin() {
|
|
993
|
-
return
|
|
993
|
+
return L.value === "Super";
|
|
994
994
|
},
|
|
995
995
|
/**
|
|
996
996
|
* 是否管理员
|
|
997
997
|
*/
|
|
998
998
|
isAdmin() {
|
|
999
|
-
return
|
|
999
|
+
return L.value === "Super" || L.value === "Admin";
|
|
1000
1000
|
},
|
|
1001
1001
|
/**
|
|
1002
1002
|
* 获取用户级别
|
|
1003
1003
|
* @returns 用户级别
|
|
1004
1004
|
*/
|
|
1005
1005
|
getUserLevel() {
|
|
1006
|
-
return
|
|
1006
|
+
return L.value;
|
|
1007
1007
|
},
|
|
1008
1008
|
/*
|
|
1009
1009
|
* 清理登录信息
|
|
@@ -1015,7 +1015,7 @@ const Ja = (e) => {
|
|
|
1015
1015
|
Code: "",
|
|
1016
1016
|
TenantId: "",
|
|
1017
1017
|
UserLevel: ""
|
|
1018
|
-
}, this.token = "", he(this.token), this.isLogin = !1, ee.value = null,
|
|
1018
|
+
}, this.token = "", he(this.token), this.isLogin = !1, ee.value = null, L.value = "", H().clean(), Promise.resolve();
|
|
1019
1019
|
},
|
|
1020
1020
|
/**
|
|
1021
1021
|
* 登出操作
|
|
@@ -1023,7 +1023,7 @@ const Ja = (e) => {
|
|
|
1023
1023
|
*/
|
|
1024
1024
|
async logout() {
|
|
1025
1025
|
try {
|
|
1026
|
-
await
|
|
1026
|
+
await zt();
|
|
1027
1027
|
} catch (e) {
|
|
1028
1028
|
console.error("调用登出接口失败", e);
|
|
1029
1029
|
} finally {
|
|
@@ -1045,10 +1045,10 @@ const Ja = (e) => {
|
|
|
1045
1045
|
e.store.init();
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
|
-
}),
|
|
1049
|
-
const
|
|
1050
|
-
return e.filter((n) => n.role && !
|
|
1051
|
-
if (!
|
|
1048
|
+
}), Qa = (e, a) => {
|
|
1049
|
+
const t = j();
|
|
1050
|
+
return e.filter((n) => n.role && !t.hasRole(n.role) || n.permit && !t.hasPermit(oe.currentRoute.value.path, n.permit) || n.enabled === !1 ? !1 : typeof n.enabled == "function" ? n.enabled() : !0).filter((n) => {
|
|
1051
|
+
if (!a) {
|
|
1052
1052
|
if (n.visible === !1)
|
|
1053
1053
|
return !1;
|
|
1054
1054
|
if (typeof n.visible == "function")
|
|
@@ -1056,32 +1056,32 @@ const Ja = (e) => {
|
|
|
1056
1056
|
}
|
|
1057
1057
|
return !0;
|
|
1058
1058
|
});
|
|
1059
|
-
},
|
|
1060
|
-
const
|
|
1059
|
+
}, Ja = (e, a) => {
|
|
1060
|
+
const t = a == null ? void 0 : a.filter((s) => {
|
|
1061
1061
|
const n = e.find(
|
|
1062
1062
|
(o) => o.dataIndex === s.dataIndex || o.key === s.key || o.title === s.title
|
|
1063
1063
|
);
|
|
1064
1064
|
return n ? { ...s, ...n } : !1;
|
|
1065
1065
|
});
|
|
1066
|
-
return [...
|
|
1067
|
-
},
|
|
1066
|
+
return [...t || [], ...e.filter((s) => !(t != null && t.includes(s)))];
|
|
1067
|
+
}, Zt = (e) => (e.remotePage = !1, lt(e).then((a) => a.rows)), lt = (e) => {
|
|
1068
1068
|
e.gridQuery || (e.gridQuery = {});
|
|
1069
|
-
const
|
|
1069
|
+
const a = e.remotePage ? "find" : "list";
|
|
1070
1070
|
return Ve(e, {
|
|
1071
|
-
urlKey:
|
|
1071
|
+
urlKey: a,
|
|
1072
1072
|
url: e.gridUrl,
|
|
1073
1073
|
params: e.gridQuery,
|
|
1074
1074
|
loadingState: e.isGridLoading,
|
|
1075
|
-
processParams: (
|
|
1075
|
+
processParams: (t) => {
|
|
1076
1076
|
var n;
|
|
1077
|
-
return e.remotePage && (
|
|
1077
|
+
return e.remotePage && (t.Query.$limit = [(e.pageNo.value - 1) * e.pageSize.value, e.pageSize.value]), Oe((n = e.gridUrl) == null ? void 0 : n.params, t, e.gridQuery);
|
|
1078
1078
|
}
|
|
1079
|
-
}).then((
|
|
1080
|
-
if ((
|
|
1081
|
-
let s =
|
|
1082
|
-
return s.rows ? (e.tableData.value = s.rows, e.total.value = s.total) : (e.tableData.value =
|
|
1079
|
+
}).then((t) => {
|
|
1080
|
+
if ((t == null ? void 0 : t.status) === T.SUCCESS) {
|
|
1081
|
+
let s = t.data;
|
|
1082
|
+
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 = {
|
|
1083
1083
|
total: e.total.value,
|
|
1084
|
-
rows:
|
|
1084
|
+
rows: t.data
|
|
1085
1085
|
}, e.afterLoad && e.afterLoad(s)), s;
|
|
1086
1086
|
}
|
|
1087
1087
|
return e.tableData.value = [], e.total.value = 0, {
|
|
@@ -1089,72 +1089,72 @@ const Ja = (e) => {
|
|
|
1089
1089
|
rows: []
|
|
1090
1090
|
};
|
|
1091
1091
|
});
|
|
1092
|
-
},
|
|
1092
|
+
}, ea = (e, a, t = {}) => tt(e, {
|
|
1093
1093
|
urlKey: "update",
|
|
1094
1094
|
url: e.updateUrl,
|
|
1095
1095
|
params: {
|
|
1096
|
-
Query: { [e.primaryKey]:
|
|
1097
|
-
Data:
|
|
1096
|
+
Query: { [e.primaryKey]: a[e.primaryKey] },
|
|
1097
|
+
Data: a
|
|
1098
1098
|
},
|
|
1099
1099
|
loadingState: e.isGridSaving,
|
|
1100
|
-
...
|
|
1100
|
+
...t
|
|
1101
1101
|
}).then((s) => ((s == null ? void 0 : s.status) === T.SUCCESS && setTimeout(() => {
|
|
1102
|
-
e.reload.value = !0, e.afterUpdate && e.afterUpdate(
|
|
1103
|
-
}, 50), s)),
|
|
1104
|
-
const
|
|
1105
|
-
return
|
|
1102
|
+
e.reload.value = !0, e.afterUpdate && e.afterUpdate(a);
|
|
1103
|
+
}, 50), s)), ja = (e, a) => {
|
|
1104
|
+
const t = {};
|
|
1105
|
+
return t[e.primaryKey] = a[e.primaryKey], t[e.statusKey] = a[e.statusKey], ea(e, t, {
|
|
1106
1106
|
loadingText: !1,
|
|
1107
1107
|
hideErrorToast: !0
|
|
1108
1108
|
});
|
|
1109
|
-
},
|
|
1109
|
+
}, ut = async (e, a, t) => await Ve(e, {
|
|
1110
1110
|
urlKey: "detail",
|
|
1111
|
-
url:
|
|
1112
|
-
params:
|
|
1111
|
+
url: t,
|
|
1112
|
+
params: a,
|
|
1113
1113
|
loadingState: e.isGridLoading
|
|
1114
|
-
}),
|
|
1115
|
-
const
|
|
1116
|
-
return
|
|
1117
|
-
},
|
|
1118
|
-
let
|
|
1119
|
-
e.rowData.value =
|
|
1120
|
-
},
|
|
1114
|
+
}), Ga = (e, a) => {
|
|
1115
|
+
const t = a;
|
|
1116
|
+
return ut(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));
|
|
1117
|
+
}, Wa = (e, a) => {
|
|
1118
|
+
let t = e.editor;
|
|
1119
|
+
e.rowData.value = a, t && (st(t, a), t.visible.value = !0);
|
|
1120
|
+
}, qa = (e, a) => Dt(e, a, {
|
|
1121
1121
|
url: e.deleteUrl,
|
|
1122
1122
|
primaryKey: e.primaryKey
|
|
1123
|
-
}).then((
|
|
1124
|
-
e.reload.value = !0, e.afterDelete && !Array.isArray(
|
|
1125
|
-
}, 50),
|
|
1126
|
-
var
|
|
1127
|
-
class
|
|
1123
|
+
}).then((t) => ((t == null ? void 0 : t.status) === T.SUCCESS && setTimeout(() => {
|
|
1124
|
+
e.reload.value = !0, e.afterDelete && !Array.isArray(a) && e.afterDelete(a);
|
|
1125
|
+
}, 50), t));
|
|
1126
|
+
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 || {});
|
|
1127
|
+
class ta {
|
|
1128
1128
|
constructor() {
|
|
1129
|
-
|
|
1129
|
+
F(this, "listeners", {});
|
|
1130
1130
|
}
|
|
1131
1131
|
// 检查事件名是否符合前缀
|
|
1132
|
-
isValidPrefix(
|
|
1133
|
-
return Object.values(
|
|
1132
|
+
isValidPrefix(a) {
|
|
1133
|
+
return Object.values(Ne).some((t) => a.startsWith(t + "."));
|
|
1134
1134
|
}
|
|
1135
1135
|
/**
|
|
1136
1136
|
* 事件订阅
|
|
1137
1137
|
* @param event 事件名
|
|
1138
1138
|
* @param listener 处理器
|
|
1139
1139
|
*/
|
|
1140
|
-
on(
|
|
1141
|
-
if (!this.isValidPrefix(
|
|
1142
|
-
console.error(`事件前缀不正确: ${
|
|
1140
|
+
on(a, t) {
|
|
1141
|
+
if (!this.isValidPrefix(a)) {
|
|
1142
|
+
console.error(`事件前缀不正确: ${a}, 事件名必须以 ${Object.values(Ne).join(", ")} 开头`);
|
|
1143
1143
|
return;
|
|
1144
1144
|
}
|
|
1145
|
-
this.listeners[
|
|
1145
|
+
this.listeners[a] || (this.listeners[a] = []), this.listeners[a].push(t);
|
|
1146
1146
|
}
|
|
1147
1147
|
/**
|
|
1148
1148
|
* 取消订阅事件
|
|
1149
1149
|
* @param event 事件名
|
|
1150
1150
|
* @param listener 处理器
|
|
1151
1151
|
*/
|
|
1152
|
-
off(
|
|
1153
|
-
if (!this.isValidPrefix(
|
|
1154
|
-
console.error(`事件前缀不正确: ${
|
|
1152
|
+
off(a, t) {
|
|
1153
|
+
if (!this.isValidPrefix(a)) {
|
|
1154
|
+
console.error(`事件前缀不正确: ${a}`);
|
|
1155
1155
|
return;
|
|
1156
1156
|
}
|
|
1157
|
-
this.listeners[
|
|
1157
|
+
this.listeners[a] && (this.listeners[a] = this.listeners[a].filter((s) => s !== t));
|
|
1158
1158
|
}
|
|
1159
1159
|
//
|
|
1160
1160
|
/**
|
|
@@ -1162,78 +1162,78 @@ class at {
|
|
|
1162
1162
|
* @param event 事件名
|
|
1163
1163
|
* @param args 参数
|
|
1164
1164
|
*/
|
|
1165
|
-
emit(
|
|
1166
|
-
if (!this.isValidPrefix(
|
|
1167
|
-
console.error(`事件前缀不正确: ${
|
|
1165
|
+
emit(a, ...t) {
|
|
1166
|
+
if (!this.isValidPrefix(a)) {
|
|
1167
|
+
console.error(`事件前缀不正确: ${a}`);
|
|
1168
1168
|
return;
|
|
1169
1169
|
}
|
|
1170
|
-
this.listeners[
|
|
1170
|
+
this.listeners[a] && this.listeners[a].forEach((s) => s(a, ...t));
|
|
1171
1171
|
}
|
|
1172
1172
|
}
|
|
1173
|
-
const
|
|
1174
|
-
if (
|
|
1175
|
-
const s =
|
|
1173
|
+
const q = new ta(), Z = (e, a, t) => {
|
|
1174
|
+
if (a.inputFactory && (t != null && t.reloadEvent)) {
|
|
1175
|
+
const s = a.inputFactory.value;
|
|
1176
1176
|
s.reloadHandler = (n, o) => {
|
|
1177
|
-
|
|
1178
|
-
},
|
|
1177
|
+
aa(a.url, a, o);
|
|
1178
|
+
}, q.on(t.reloadEvent, s.reloadHandler);
|
|
1179
1179
|
}
|
|
1180
|
-
if (
|
|
1181
|
-
|
|
1182
|
-
() =>
|
|
1180
|
+
if (t != null && t.data)
|
|
1181
|
+
y(
|
|
1182
|
+
() => t.data,
|
|
1183
1183
|
() => {
|
|
1184
|
-
Ge(
|
|
1184
|
+
Ge(a, t.data, !0);
|
|
1185
1185
|
},
|
|
1186
1186
|
{ deep: !0, immediate: !0 }
|
|
1187
1187
|
);
|
|
1188
|
-
else if (
|
|
1189
|
-
e &&
|
|
1188
|
+
else if (a.url && a.url.url)
|
|
1189
|
+
e && ct(a.url, a, a.params ?? {});
|
|
1190
1190
|
else {
|
|
1191
|
-
const s = f(
|
|
1191
|
+
const s = f(ae(D.LabelText, ""));
|
|
1192
1192
|
x.error("`" + s.value + "` 未配置选项数据!", {
|
|
1193
1193
|
duration: 5e3
|
|
1194
1194
|
});
|
|
1195
1195
|
}
|
|
1196
|
-
}, Ge = (e,
|
|
1197
|
-
if (
|
|
1196
|
+
}, Ge = (e, a, t) => {
|
|
1197
|
+
if (t) {
|
|
1198
1198
|
const s = {
|
|
1199
1199
|
...e.fieldMap
|
|
1200
1200
|
};
|
|
1201
|
-
|
|
1201
|
+
a = $t(s, a);
|
|
1202
1202
|
}
|
|
1203
|
-
|
|
1203
|
+
a = JSON.parse(JSON.stringify(a ?? [])), e.all && a.unshift({
|
|
1204
1204
|
label: "全部",
|
|
1205
1205
|
value: e.allValue ?? void 0
|
|
1206
|
-
}), e.options.value =
|
|
1207
|
-
},
|
|
1208
|
-
Array.isArray(
|
|
1209
|
-
}, pe = (e,
|
|
1210
|
-
var
|
|
1211
|
-
(
|
|
1212
|
-
},
|
|
1213
|
-
const s = JSON.parse(JSON.stringify(e.params ?? {})), n = JSON.parse(JSON.stringify(
|
|
1214
|
-
|
|
1215
|
-
Ge(
|
|
1206
|
+
}), e.options.value = a;
|
|
1207
|
+
}, aa = (e, a, t) => {
|
|
1208
|
+
Array.isArray(t) ? Ge(a, t, !0) : ct(e, a, t);
|
|
1209
|
+
}, pe = (e, a) => {
|
|
1210
|
+
var t;
|
|
1211
|
+
(t = e.inputFactory) != null && t.value && a.reloadEvent && e.inputFactory.value.reloadHandler && q.off(a.reloadEvent, e.inputFactory.value.reloadHandler);
|
|
1212
|
+
}, ct = (e, a, t) => {
|
|
1213
|
+
const s = JSON.parse(JSON.stringify(e.params ?? {})), n = JSON.parse(JSON.stringify(a.params ?? {})), o = Oe(s, n, t);
|
|
1214
|
+
sa(e, a, a.fieldMap, o).then((r) => {
|
|
1215
|
+
Ge(a, r, !1);
|
|
1216
1216
|
});
|
|
1217
|
-
},
|
|
1217
|
+
}, sa = (e, a, t, s) => {
|
|
1218
1218
|
const { fieldMap: n, ...o } = e, l = {
|
|
1219
1219
|
...{
|
|
1220
1220
|
url: "",
|
|
1221
1221
|
cacheTime: 6e4,
|
|
1222
1222
|
fieldMap: {
|
|
1223
1223
|
...e.fieldMap,
|
|
1224
|
-
...
|
|
1224
|
+
...t
|
|
1225
1225
|
}
|
|
1226
1226
|
},
|
|
1227
1227
|
...o
|
|
1228
1228
|
};
|
|
1229
|
-
return l.loadingText = !1, s || (s = {}), s.Query || (s.Query = {}),
|
|
1230
|
-
|
|
1229
|
+
return l.loadingText = !1, s || (s = {}), s.Query || (s.Query = {}), a.optionQuery = s, a.isOptionLoading.value = !0, G(l, s).then((i) => (i == null ? void 0 : i.status) === T.SUCCESS && i.data ? i.data : []).finally(() => {
|
|
1230
|
+
a.isOptionLoading.value = !1;
|
|
1231
1231
|
});
|
|
1232
|
-
},
|
|
1232
|
+
}, na = (e, a, t) => {
|
|
1233
1233
|
if (e === void 0) return;
|
|
1234
1234
|
const s = (o) => {
|
|
1235
1235
|
const r = { ...o };
|
|
1236
|
-
return
|
|
1236
|
+
return t && o.children && o.children.length > 0 ? r.children = o.children.map((l) => s(l)) : delete r.children, r;
|
|
1237
1237
|
}, n = (o, r) => {
|
|
1238
1238
|
const l = [];
|
|
1239
1239
|
for (const i of r)
|
|
@@ -1244,82 +1244,82 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
1244
1244
|
return l;
|
|
1245
1245
|
};
|
|
1246
1246
|
if (Array.isArray(e))
|
|
1247
|
-
return n(e,
|
|
1247
|
+
return n(e, a);
|
|
1248
1248
|
{
|
|
1249
|
-
const o = n([e],
|
|
1249
|
+
const o = n([e], a);
|
|
1250
1250
|
return o.length > 0 ? o[0] : void 0;
|
|
1251
1251
|
}
|
|
1252
|
-
}, we = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((
|
|
1253
|
-
const s =
|
|
1252
|
+
}, we = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((a) => a.label) : [e.label], te = (e, a, t) => {
|
|
1253
|
+
const s = a.split(".");
|
|
1254
1254
|
let n = e;
|
|
1255
1255
|
for (let o = 0; o < s.length - 1; o++) {
|
|
1256
1256
|
const r = s[o];
|
|
1257
1257
|
n[r] || (n[r] = {}), n = n[r];
|
|
1258
1258
|
}
|
|
1259
|
-
n[s[s.length - 1]] =
|
|
1260
|
-
},
|
|
1261
|
-
if (
|
|
1262
|
-
Object.entries(
|
|
1263
|
-
|
|
1259
|
+
n[s[s.length - 1]] = t;
|
|
1260
|
+
}, ft = (e, a, t) => {
|
|
1261
|
+
if (t == null) {
|
|
1262
|
+
Object.entries(a).forEach(([s]) => {
|
|
1263
|
+
te(e, s, t);
|
|
1264
1264
|
});
|
|
1265
1265
|
return;
|
|
1266
1266
|
}
|
|
1267
|
-
Array.isArray(
|
|
1267
|
+
Array.isArray(t) ? Object.entries(a).forEach(([s, n]) => {
|
|
1268
1268
|
var r;
|
|
1269
1269
|
if (/^\$\{\d+\}/.test(n))
|
|
1270
1270
|
try {
|
|
1271
|
-
const l = parseInt(((r = n.match(/\$\{(\d+)\}/)) == null ? void 0 : r[1]) ?? "0"), i =
|
|
1271
|
+
const l = parseInt(((r = n.match(/\$\{(\d+)\}/)) == null ? void 0 : r[1]) ?? "0"), i = t[l], u = n.replace(/\$\{\d+\}\./, "");
|
|
1272
1272
|
if (u && i) {
|
|
1273
1273
|
const c = be(u, i);
|
|
1274
|
-
|
|
1274
|
+
te(e, s, c);
|
|
1275
1275
|
} else
|
|
1276
|
-
|
|
1276
|
+
te(e, s, i);
|
|
1277
1277
|
} catch {
|
|
1278
1278
|
console.error("outFields 格式错误:" + n, "必须是 ${index} 或者 ${index}.${key}");
|
|
1279
1279
|
}
|
|
1280
1280
|
else
|
|
1281
1281
|
console.error("outFields 格式错误:" + n, "必须是 ${index} 或者 ${index}.${key}");
|
|
1282
|
-
}) : Object.entries(
|
|
1282
|
+
}) : Object.entries(a).forEach(([s, n]) => {
|
|
1283
1283
|
if (n.includes("${")) {
|
|
1284
|
-
const o = be(n,
|
|
1285
|
-
|
|
1284
|
+
const o = be(n, t);
|
|
1285
|
+
te(e, s, o);
|
|
1286
1286
|
} else
|
|
1287
|
-
|
|
1287
|
+
te(e, s, t[n]);
|
|
1288
1288
|
});
|
|
1289
|
-
}, Pe = (e,
|
|
1289
|
+
}, Pe = (e, a, t) => {
|
|
1290
1290
|
var o, r;
|
|
1291
1291
|
const s = (o = e.inputFactory) == null ? void 0 : o.value;
|
|
1292
|
-
s != null && s.editorCtrl && ((r = s.errInfo) != null && r.value.errClass) && fe(s.editorCtrl), e.selected.value =
|
|
1293
|
-
const n =
|
|
1294
|
-
if (e.selectedOptions.value = n,
|
|
1295
|
-
const [l, i] =
|
|
1292
|
+
s != null && s.editorCtrl && ((r = s.errInfo) != null && r.value.errClass) && fe(s.editorCtrl), e.selected.value = t;
|
|
1293
|
+
const n = na(t, e.options.value);
|
|
1294
|
+
if (e.selectedOptions.value = n, a.formData && a.outFields && ft(a.formData, a.outFields, n), a.changeEvent) {
|
|
1295
|
+
const [l, i] = a.changeEvent;
|
|
1296
1296
|
if (i)
|
|
1297
1297
|
if (Array.isArray(l))
|
|
1298
1298
|
l.every((u) => {
|
|
1299
|
-
const c = be(i, { selectedValues:
|
|
1299
|
+
const c = be(i, { selectedValues: t });
|
|
1300
1300
|
try {
|
|
1301
1301
|
const p = JSON.parse(c);
|
|
1302
|
-
|
|
1302
|
+
q.emit(u, p, t, n);
|
|
1303
1303
|
} catch (p) {
|
|
1304
1304
|
console.error("eventParamsValue: ", c, p);
|
|
1305
1305
|
}
|
|
1306
1306
|
});
|
|
1307
1307
|
else {
|
|
1308
|
-
const u = be(i, { selectedValues:
|
|
1308
|
+
const u = be(i, { selectedValues: t });
|
|
1309
1309
|
try {
|
|
1310
1310
|
const c = JSON.parse(u);
|
|
1311
|
-
|
|
1311
|
+
q.emit(l, c, t, n);
|
|
1312
1312
|
} catch (c) {
|
|
1313
1313
|
console.error("eventParamsValue: ", u, c);
|
|
1314
1314
|
}
|
|
1315
1315
|
}
|
|
1316
1316
|
else
|
|
1317
1317
|
Array.isArray(l) ? l.every((u) => {
|
|
1318
|
-
|
|
1319
|
-
}) :
|
|
1318
|
+
q.emit(u, n, t);
|
|
1319
|
+
}) : q.emit(l, n, t);
|
|
1320
1320
|
}
|
|
1321
|
-
return s != null && s.inputEmit && s.inputEmit("change",
|
|
1322
|
-
},
|
|
1321
|
+
return s != null && s.inputEmit && s.inputEmit("change", t, n), n;
|
|
1322
|
+
}, b = {
|
|
1323
1323
|
PageOption: {
|
|
1324
1324
|
primaryKey: "Id",
|
|
1325
1325
|
statusKey: "Enabled"
|
|
@@ -1357,31 +1357,31 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
1357
1357
|
value: "Id"
|
|
1358
1358
|
}
|
|
1359
1359
|
}
|
|
1360
|
-
},
|
|
1361
|
-
|
|
1362
|
-
...
|
|
1360
|
+
}, Ba = (e) => {
|
|
1361
|
+
b.PageOption = {
|
|
1362
|
+
...b.PageOption,
|
|
1363
1363
|
...e.pageOption
|
|
1364
|
-
},
|
|
1365
|
-
...
|
|
1364
|
+
}, b.GridOption = {
|
|
1365
|
+
...b.GridOption,
|
|
1366
1366
|
...e.gridOption
|
|
1367
|
-
},
|
|
1368
|
-
...
|
|
1367
|
+
}, b.EditorOption = {
|
|
1368
|
+
...b.EditorOption,
|
|
1369
1369
|
...e.editorOptions
|
|
1370
|
-
},
|
|
1371
|
-
...
|
|
1370
|
+
}, b.TreeOption = {
|
|
1371
|
+
...b.TreeOption,
|
|
1372
1372
|
...e.treeOption
|
|
1373
1373
|
};
|
|
1374
1374
|
}, ke = (e) => {
|
|
1375
|
-
for (let
|
|
1376
|
-
e.urls[
|
|
1377
|
-
},
|
|
1375
|
+
for (let a in e.urls)
|
|
1376
|
+
e.urls[a].api || (e.urls[a].api = e.api), e.urls[a].authorize || (e.urls[a].authorize = e.authorize);
|
|
1377
|
+
}, ra = (e, a, t, s) => (ke(e), {
|
|
1378
1378
|
editorCtrl: {
|
|
1379
|
-
...
|
|
1379
|
+
...b.EditorOption,
|
|
1380
1380
|
name: "",
|
|
1381
|
-
default:
|
|
1381
|
+
default: t ? JSON.parse(JSON.stringify(t)) : void 0,
|
|
1382
1382
|
visible: f(!1),
|
|
1383
|
-
page:
|
|
1384
|
-
formData: f(
|
|
1383
|
+
page: a,
|
|
1384
|
+
formData: f(t ? JSON.parse(JSON.stringify(t)) : void 0),
|
|
1385
1385
|
formRules: f(s),
|
|
1386
1386
|
ruleResults: f({}),
|
|
1387
1387
|
updateData: f(void 0),
|
|
@@ -1390,23 +1390,23 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
1390
1390
|
isFormSaving: f(!1),
|
|
1391
1391
|
isFormLoading: f(!1)
|
|
1392
1392
|
}
|
|
1393
|
-
}),
|
|
1393
|
+
}), oa = (e, a, t) => {
|
|
1394
1394
|
ke(e);
|
|
1395
1395
|
const s = {
|
|
1396
|
-
...
|
|
1397
|
-
tableSize: f(
|
|
1398
|
-
selectable: f(
|
|
1399
|
-
searchBar: f(
|
|
1400
|
-
pageSize: f(
|
|
1401
|
-
rowExpand: f(
|
|
1402
|
-
buttons: f([...
|
|
1403
|
-
tools: [...
|
|
1404
|
-
operates: [...
|
|
1405
|
-
columns: f(
|
|
1396
|
+
...b.GridOption,
|
|
1397
|
+
tableSize: f(b.GridOption.tableSize.value),
|
|
1398
|
+
selectable: f(b.GridOption.selectable.value),
|
|
1399
|
+
searchBar: f(b.GridOption.searchBar.value),
|
|
1400
|
+
pageSize: f(b.GridOption.pageSize.value),
|
|
1401
|
+
rowExpand: f(b.GridOption.rowExpand.value),
|
|
1402
|
+
buttons: f([...b.GridOption.buttons.value]),
|
|
1403
|
+
tools: [...b.GridOption.tools],
|
|
1404
|
+
operates: [...b.GridOption.operates],
|
|
1405
|
+
columns: f(t || []),
|
|
1406
1406
|
reload: f(!1),
|
|
1407
1407
|
pageNo: f(1),
|
|
1408
1408
|
total: f(0),
|
|
1409
|
-
page:
|
|
1409
|
+
page: a,
|
|
1410
1410
|
selectKeys: f([]),
|
|
1411
1411
|
selectRows: f([]),
|
|
1412
1412
|
rowData: f(void 0),
|
|
@@ -1419,40 +1419,40 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
1419
1419
|
updateUrl: e.urls.update,
|
|
1420
1420
|
deleteUrl: e.urls.delete
|
|
1421
1421
|
};
|
|
1422
|
-
return
|
|
1422
|
+
return y(
|
|
1423
1423
|
() => s.reload.value,
|
|
1424
1424
|
(n) => {
|
|
1425
1425
|
n && (setTimeout(() => {
|
|
1426
1426
|
s.reload.value = !1;
|
|
1427
|
-
}, 1), s.remotePage ?
|
|
1427
|
+
}, 1), s.remotePage ? lt(s) : Zt(s));
|
|
1428
1428
|
}
|
|
1429
1429
|
), {
|
|
1430
1430
|
gridCtrl: s
|
|
1431
1431
|
};
|
|
1432
|
-
},
|
|
1432
|
+
}, Ca = (e, a) => {
|
|
1433
1433
|
ke(e);
|
|
1434
|
-
const
|
|
1435
|
-
...
|
|
1434
|
+
const t = {
|
|
1435
|
+
...b.TreeOption,
|
|
1436
1436
|
reload: f(!1),
|
|
1437
|
-
page:
|
|
1437
|
+
page: a,
|
|
1438
1438
|
node: f(void 0),
|
|
1439
1439
|
url: e.urls.tree,
|
|
1440
1440
|
data: K(void 0),
|
|
1441
1441
|
isTreeLoading: f(!1)
|
|
1442
1442
|
};
|
|
1443
|
-
return
|
|
1444
|
-
() =>
|
|
1443
|
+
return y(
|
|
1444
|
+
() => t.reload.value,
|
|
1445
1445
|
(s) => {
|
|
1446
1446
|
s && (setTimeout(() => {
|
|
1447
|
-
|
|
1448
|
-
}, 1),
|
|
1447
|
+
t.reload.value = !1;
|
|
1448
|
+
}, 1), Ut(t));
|
|
1449
1449
|
}
|
|
1450
1450
|
), {
|
|
1451
|
-
treeCtrl:
|
|
1451
|
+
treeCtrl: t
|
|
1452
1452
|
};
|
|
1453
|
-
}, de = (e,
|
|
1454
|
-
const
|
|
1455
|
-
...
|
|
1453
|
+
}, de = (e, a) => {
|
|
1454
|
+
const t = {
|
|
1455
|
+
...b.OptionOption,
|
|
1456
1456
|
url: e,
|
|
1457
1457
|
reload: f(!1),
|
|
1458
1458
|
optionQuery: {},
|
|
@@ -1462,34 +1462,34 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
1462
1462
|
options: f([]),
|
|
1463
1463
|
isOptionLoading: f(!1)
|
|
1464
1464
|
};
|
|
1465
|
-
return
|
|
1466
|
-
() =>
|
|
1465
|
+
return y(
|
|
1466
|
+
() => t.reload.value,
|
|
1467
1467
|
(s) => {
|
|
1468
1468
|
s && (setTimeout(() => {
|
|
1469
|
-
|
|
1470
|
-
}, 1), Z(!0,
|
|
1469
|
+
t.reload.value = !1;
|
|
1470
|
+
}, 1), Z(!0, t, a));
|
|
1471
1471
|
}
|
|
1472
1472
|
), {
|
|
1473
|
-
optionCtrl:
|
|
1473
|
+
optionCtrl: t
|
|
1474
1474
|
};
|
|
1475
|
-
},
|
|
1475
|
+
}, za = (e, a, t) => {
|
|
1476
1476
|
ke(e);
|
|
1477
1477
|
const s = {
|
|
1478
|
-
...
|
|
1478
|
+
...b.PageOption,
|
|
1479
1479
|
...e
|
|
1480
|
-
}, { editorCtrl: n } =
|
|
1480
|
+
}, { editorCtrl: n } = ra(e, s, a, t), { gridCtrl: o } = oa(e, s);
|
|
1481
1481
|
return s.editor = n, s.grid = o, o.editor = n, o.tools = ["Reload", "RowHeight", "TableHeadset", "Fullscreen"], n.grid = o, {
|
|
1482
1482
|
pageCtrl: s,
|
|
1483
1483
|
editorCtrl: n,
|
|
1484
1484
|
gridCtrl: o
|
|
1485
1485
|
};
|
|
1486
|
-
},
|
|
1486
|
+
}, ia = 7 * 24 * 60 * 60 * 1e3, _e = /* @__PURE__ */ new Map(), Ye = /* @__PURE__ */ new Set(), J = f({}), Ya = J, Xa = (e) => {
|
|
1487
1487
|
var n;
|
|
1488
1488
|
if (!e.iconUrl) return De;
|
|
1489
|
-
const
|
|
1489
|
+
const a = f(!0), t = f("");
|
|
1490
1490
|
let s = !0;
|
|
1491
|
-
return (n = e.icons) != null && n.length && (s = e.icons.every((o) => J.value[o] !== void 0)), (e.icon && !J.value[e.icon] || !s) &&
|
|
1492
|
-
|
|
1491
|
+
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(() => {
|
|
1492
|
+
fa(e.iconUrl, e.monoColor || !1), a.value = !0;
|
|
1493
1493
|
}), X({
|
|
1494
1494
|
props: {
|
|
1495
1495
|
icon: {
|
|
@@ -1520,116 +1520,116 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
1520
1520
|
const l = f(o.icon), i = f(0), u = () => {
|
|
1521
1521
|
o.icons && i.value++;
|
|
1522
1522
|
};
|
|
1523
|
-
return
|
|
1523
|
+
return y(
|
|
1524
1524
|
() => o.iconIndex,
|
|
1525
1525
|
(c) => {
|
|
1526
1526
|
c !== void 0 && (i.value = c);
|
|
1527
1527
|
},
|
|
1528
1528
|
{ immediate: !0 }
|
|
1529
|
-
),
|
|
1529
|
+
), y(
|
|
1530
1530
|
() => i.value,
|
|
1531
1531
|
(c) => {
|
|
1532
|
-
o.icons && (c >= o.icons.length && (i.value = 0), l.value = o.icons[i.value], me(
|
|
1532
|
+
o.icons && (c >= o.icons.length && (i.value = 0), l.value = o.icons[i.value], me(t, l, l.value), r("update:iconIndex", i.value));
|
|
1533
1533
|
},
|
|
1534
1534
|
{ immediate: !0 }
|
|
1535
|
-
),
|
|
1535
|
+
), y(
|
|
1536
1536
|
() => J.value,
|
|
1537
1537
|
() => {
|
|
1538
|
-
me(
|
|
1538
|
+
me(t, l, l.value);
|
|
1539
1539
|
},
|
|
1540
1540
|
{ deep: !0 }
|
|
1541
|
-
),
|
|
1541
|
+
), y(
|
|
1542
1542
|
() => o.icon,
|
|
1543
1543
|
(c) => {
|
|
1544
|
-
me(
|
|
1544
|
+
me(t, l, c);
|
|
1545
1545
|
}
|
|
1546
|
-
), me(
|
|
1546
|
+
), me(t, l, l.value), { isLoaded: a, Icon: t, handleClick: u };
|
|
1547
1547
|
},
|
|
1548
1548
|
render() {
|
|
1549
|
-
if (!
|
|
1549
|
+
if (!a.value)
|
|
1550
1550
|
return De;
|
|
1551
1551
|
let o = this.class, r = "";
|
|
1552
1552
|
Array.isArray(o) ? r = o.join(" ") : typeof o == "string" && (r = o);
|
|
1553
1553
|
let l = [r];
|
|
1554
|
-
return !/\bw-/.test(r) && !/$w-/.test(r) && l.push("w-4"), !/\bh-/.test(r) && !/$h-/.test(r) && l.push("h-4"),
|
|
1554
|
+
return !/\bw-/.test(r) && !/$w-/.test(r) && l.push("w-4"), !/\bh-/.test(r) && !/$h-/.test(r) && l.push("h-4"), t.value ? U(Ze(t.value), {
|
|
1555
1555
|
onClick: this.$props.clickable ? this.handleClick : void 0,
|
|
1556
1556
|
class: `${l.join(" ")}`,
|
|
1557
1557
|
style: {
|
|
1558
1558
|
fill: "currentColor",
|
|
1559
1559
|
cursor: this.$props.clickable ? "pointer" : "default",
|
|
1560
|
-
transform:
|
|
1560
|
+
transform: da(this.angle, this.flip)
|
|
1561
1561
|
}
|
|
1562
1562
|
}) : U("div", { class: "w-[14px] h-[14px]" });
|
|
1563
1563
|
}
|
|
1564
1564
|
});
|
|
1565
|
-
},
|
|
1566
|
-
let
|
|
1567
|
-
if (!
|
|
1565
|
+
}, la = (e, a) => {
|
|
1566
|
+
let t = e.iconUrl;
|
|
1567
|
+
if (!t)
|
|
1568
1568
|
return console.error("图标库地址不能为空"), Promise.resolve();
|
|
1569
|
-
if (
|
|
1569
|
+
if (_e.has(t))
|
|
1570
1570
|
return Promise.resolve();
|
|
1571
|
-
const s =
|
|
1571
|
+
const s = dt(t);
|
|
1572
1572
|
if (s)
|
|
1573
|
-
return new Promise(async (o) => (
|
|
1574
|
-
|
|
1573
|
+
return new Promise(async (o) => (pt(s.scriptContent), o()));
|
|
1574
|
+
a.value = !1;
|
|
1575
1575
|
const n = new Promise(async (o) => {
|
|
1576
|
-
await
|
|
1576
|
+
await ua(t, e.monoColor || !1), o(), _e.delete(t);
|
|
1577
1577
|
});
|
|
1578
|
-
return
|
|
1579
|
-
},
|
|
1578
|
+
return _e.set(t, n), n;
|
|
1579
|
+
}, ua = async (e, a) => {
|
|
1580
1580
|
try {
|
|
1581
|
-
const
|
|
1582
|
-
if (!
|
|
1581
|
+
const t = await fetch(e);
|
|
1582
|
+
if (!t.ok) {
|
|
1583
1583
|
x.error("网络异常,无法加载图标库!");
|
|
1584
1584
|
return;
|
|
1585
1585
|
}
|
|
1586
|
-
let s = await
|
|
1587
|
-
s =
|
|
1586
|
+
let s = await t.text();
|
|
1587
|
+
s = a ? s.replace(/fill=\"[^\"]*\"/gi, "") : s;
|
|
1588
1588
|
let n = /^window\.(\w+)\s*=/;
|
|
1589
1589
|
const o = s.match(n);
|
|
1590
1590
|
if (o && o.length > 1) {
|
|
1591
1591
|
let r = o[1];
|
|
1592
|
-
|
|
1592
|
+
ca(e, r, a, s);
|
|
1593
1593
|
}
|
|
1594
|
-
|
|
1594
|
+
pt(s);
|
|
1595
1595
|
return;
|
|
1596
|
-
} catch (
|
|
1597
|
-
return console.error("网络异常,无法加载图标库:",
|
|
1596
|
+
} catch (t) {
|
|
1597
|
+
return console.error("网络异常,无法加载图标库:", t), null;
|
|
1598
1598
|
}
|
|
1599
|
-
},
|
|
1600
|
-
const
|
|
1601
|
-
|
|
1602
|
-
},
|
|
1599
|
+
}, pt = (e) => {
|
|
1600
|
+
const a = document.createElement("script");
|
|
1601
|
+
a.textContent = e, document.head.appendChild(a);
|
|
1602
|
+
}, ca = (e, a, t, s) => {
|
|
1603
1603
|
let n = `icon_cache:${e}`;
|
|
1604
1604
|
const o = {
|
|
1605
|
-
windowKey:
|
|
1606
|
-
monoColor:
|
|
1605
|
+
windowKey: a,
|
|
1606
|
+
monoColor: t,
|
|
1607
1607
|
scriptContent: s,
|
|
1608
|
-
expireTime: Date.now() +
|
|
1608
|
+
expireTime: Date.now() + ia
|
|
1609
1609
|
// 缓存时间:7天
|
|
1610
1610
|
};
|
|
1611
1611
|
localStorage.setItem(n, JSON.stringify(o));
|
|
1612
|
-
},
|
|
1613
|
-
let
|
|
1614
|
-
const
|
|
1615
|
-
if (!
|
|
1612
|
+
}, dt = (e) => {
|
|
1613
|
+
let a = `icon_cache:${e}`;
|
|
1614
|
+
const t = localStorage.getItem(a);
|
|
1615
|
+
if (!t) return null;
|
|
1616
1616
|
let s;
|
|
1617
1617
|
try {
|
|
1618
|
-
s = JSON.parse(
|
|
1618
|
+
s = JSON.parse(t);
|
|
1619
1619
|
} catch (n) {
|
|
1620
1620
|
return console.error("解析缓存失败:", n), null;
|
|
1621
1621
|
}
|
|
1622
1622
|
return s.expireTime < Date.now() ? (localStorage.removeItem(e), null) : s;
|
|
1623
|
-
},
|
|
1623
|
+
}, Za = () => {
|
|
1624
1624
|
const e = Date.now();
|
|
1625
|
-
for (const
|
|
1626
|
-
if (
|
|
1627
|
-
const
|
|
1628
|
-
|
|
1625
|
+
for (const a in localStorage)
|
|
1626
|
+
if (a.startsWith("icon_cache:")) {
|
|
1627
|
+
const t = localStorage.getItem(a);
|
|
1628
|
+
t && JSON.parse(t).expireTime < e && localStorage.removeItem(a);
|
|
1629
1629
|
}
|
|
1630
|
-
}, me = (e,
|
|
1630
|
+
}, me = (e, a, t) => {
|
|
1631
1631
|
setTimeout(() => {
|
|
1632
|
-
|
|
1632
|
+
a.value = t, a.value && (e.value = J.value[a.value]);
|
|
1633
1633
|
}, 1);
|
|
1634
1634
|
}, De = U(
|
|
1635
1635
|
"svg",
|
|
@@ -1651,47 +1651,47 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
1651
1651
|
fill: "currentColor"
|
|
1652
1652
|
})
|
|
1653
1653
|
]
|
|
1654
|
-
),
|
|
1655
|
-
const
|
|
1654
|
+
), fa = (e, a) => {
|
|
1655
|
+
const t = dt(e);
|
|
1656
1656
|
Object.keys(window).forEach((s) => {
|
|
1657
|
-
s.startsWith("_iconfont_svg_string_") && (
|
|
1657
|
+
s.startsWith("_iconfont_svg_string_") && (t == null ? void 0 : t.windowKey) === s && !Ye.has(s) && (Ye.add(s), pa(s, a));
|
|
1658
1658
|
});
|
|
1659
|
-
},
|
|
1660
|
-
const
|
|
1659
|
+
}, pa = (e, a) => {
|
|
1660
|
+
const t = window[e], o = new DOMParser().parseFromString(t, "image/svg+xml").getElementsByTagName("symbol"), r = document.querySelectorAll("symbol");
|
|
1661
1661
|
for (const l of o) {
|
|
1662
1662
|
const i = l.id, u = Array.from(r).find((c) => c.id === i);
|
|
1663
|
-
u &&
|
|
1663
|
+
u && a && (u.innerHTML = l.innerHTML, u.querySelectorAll("*").forEach((c) => {
|
|
1664
1664
|
c.hasAttribute("fill") && c.removeAttribute("fill");
|
|
1665
1665
|
})), J.value[i] || (J.value[i] = U("svg", { fill: "currentColor" }, [U("use", { "xlink:href": `#${i}` })]));
|
|
1666
1666
|
}
|
|
1667
|
-
},
|
|
1668
|
-
let
|
|
1669
|
-
return e && (
|
|
1670
|
-
}, es = (e,
|
|
1671
|
-
|
|
1672
|
-
},
|
|
1667
|
+
}, da = (e, a) => {
|
|
1668
|
+
let t = "";
|
|
1669
|
+
return e && (t += `rotate(${e}deg)`), a && (t += " scaleX(-1)"), t;
|
|
1670
|
+
}, es = (e, a, t, s) => {
|
|
1671
|
+
ht(e, [], t, s).forEach((o) => a.push(o));
|
|
1672
|
+
}, ht = (e, a, t, s) => {
|
|
1673
1673
|
var r, l, i, u, c;
|
|
1674
1674
|
const n = [], o = j();
|
|
1675
1675
|
for (const p of e) {
|
|
1676
1676
|
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) && (i = p.meta) != null && i.permission && !o.hasPermit(p.meta.permission, ":page"))
|
|
1677
1677
|
continue;
|
|
1678
|
-
const
|
|
1679
|
-
|
|
1680
|
-
const
|
|
1681
|
-
key:
|
|
1678
|
+
const v = p.path.split("/");
|
|
1679
|
+
v.unshift(...a);
|
|
1680
|
+
const h = ht(p.children || [], v, t, s), A = {
|
|
1681
|
+
key: v.join("/"),
|
|
1682
1682
|
label: ((u = p.name) == null ? void 0 : u.toString()) ?? "",
|
|
1683
1683
|
title: ((c = p.name) == null ? void 0 : c.toString()) ?? "",
|
|
1684
|
-
icon: p.icon ? U(
|
|
1685
|
-
children:
|
|
1684
|
+
icon: p.icon ? U(t, { ...s, icon: p.icon }) : void 0,
|
|
1685
|
+
children: h.length > 0 ? h : void 0
|
|
1686
1686
|
};
|
|
1687
|
-
(
|
|
1687
|
+
(h.length > 0 || !p.children) && n.push(A);
|
|
1688
1688
|
}
|
|
1689
1689
|
return n;
|
|
1690
|
-
}, Xe =
|
|
1690
|
+
}, Xe = yt([]), ts = () => {
|
|
1691
1691
|
Xe.length = 0;
|
|
1692
1692
|
const e = H();
|
|
1693
|
-
let
|
|
1694
|
-
e.matchedRoutes(
|
|
1693
|
+
let t = Je().TabActive;
|
|
1694
|
+
e.matchedRoutes(t).forEach((n, o) => {
|
|
1695
1695
|
var l;
|
|
1696
1696
|
const r = {
|
|
1697
1697
|
index: o,
|
|
@@ -1700,7 +1700,7 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
1700
1700
|
};
|
|
1701
1701
|
Xe.push(r);
|
|
1702
1702
|
});
|
|
1703
|
-
},
|
|
1703
|
+
}, ha = {
|
|
1704
1704
|
host: {
|
|
1705
1705
|
api: "SITEHOST_API",
|
|
1706
1706
|
url: "/openapi/RCSiteHostSrv/get",
|
|
@@ -1712,7 +1712,7 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
1712
1712
|
// 不显示错误
|
|
1713
1713
|
hideErrorToast: !0
|
|
1714
1714
|
}
|
|
1715
|
-
},
|
|
1715
|
+
}, as = ue("hostInfo", {
|
|
1716
1716
|
state: () => ({
|
|
1717
1717
|
hostInfo: {
|
|
1718
1718
|
Host: "",
|
|
@@ -1725,43 +1725,71 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
1725
1725
|
}),
|
|
1726
1726
|
actions: {
|
|
1727
1727
|
/**
|
|
1728
|
-
*
|
|
1728
|
+
* 获取站点API地址
|
|
1729
|
+
*/
|
|
1730
|
+
getSiteHostApi() {
|
|
1731
|
+
return "";
|
|
1732
|
+
},
|
|
1733
|
+
/**
|
|
1734
|
+
* 加载站点信息
|
|
1729
1735
|
* @param hostApi 启动配置主机地址
|
|
1730
1736
|
* @param hostKey 站点信息,默认为当前主域名
|
|
1731
1737
|
* @param mainOpenApis 宿主机开放接口
|
|
1732
1738
|
*/
|
|
1733
|
-
async loadHostInfo(e,
|
|
1734
|
-
if (
|
|
1735
|
-
this._setHostInfo(
|
|
1739
|
+
async loadHostInfo(e, a, t) {
|
|
1740
|
+
if (t) {
|
|
1741
|
+
this._setHostInfo(t.getHostInfo());
|
|
1736
1742
|
return;
|
|
1737
1743
|
}
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1744
|
+
let s = (e || this.getSiteHostApi()).trim();
|
|
1745
|
+
return (!s || s === "/") && (s = window.location.origin), s.endsWith("/") && (s = s.slice(0, -1)), new Promise((n) => {
|
|
1746
|
+
$e.SITEHOST_API || ($e.SITEHOST_API = s);
|
|
1747
|
+
const o = a || window.location.origin;
|
|
1748
|
+
G(ha.host, {
|
|
1742
1749
|
Query: {
|
|
1743
|
-
Host:
|
|
1744
|
-
}
|
|
1745
|
-
}).then((o) => {
|
|
1746
|
-
if ((o == null ? void 0 : o.status) === T.SUCCESS && o.data) {
|
|
1747
|
-
const r = o.data;
|
|
1748
|
-
this._setHostInfo(r);
|
|
1750
|
+
Host: o
|
|
1749
1751
|
}
|
|
1750
|
-
|
|
1752
|
+
}).then((r) => {
|
|
1753
|
+
if ((r == null ? void 0 : r.status) === T.SUCCESS && r.data) {
|
|
1754
|
+
const l = r.data;
|
|
1755
|
+
this._setHostInfo(l);
|
|
1756
|
+
} else
|
|
1757
|
+
this._setHostInfo(null);
|
|
1758
|
+
n();
|
|
1751
1759
|
});
|
|
1752
1760
|
});
|
|
1753
1761
|
},
|
|
1754
1762
|
/**
|
|
1755
|
-
*
|
|
1763
|
+
* 清除主机信息
|
|
1764
|
+
*/
|
|
1765
|
+
clear() {
|
|
1766
|
+
this.hostInfo = {
|
|
1767
|
+
Host: "",
|
|
1768
|
+
Title: "",
|
|
1769
|
+
API_HOST: {},
|
|
1770
|
+
SERVER_HOST: {},
|
|
1771
|
+
MIDDLEWARES: {},
|
|
1772
|
+
ExtraProps: {},
|
|
1773
|
+
ExtraPropLines: []
|
|
1774
|
+
};
|
|
1775
|
+
},
|
|
1776
|
+
/**
|
|
1777
|
+
* 设置主机信息
|
|
1756
1778
|
*/
|
|
1757
1779
|
_setHostInfo(e) {
|
|
1758
1780
|
if (this.hostInfo = {
|
|
1759
1781
|
...this.hostInfo,
|
|
1760
1782
|
...e
|
|
1761
1783
|
}, this.hostInfo.API_HOST)
|
|
1762
|
-
for (const
|
|
1784
|
+
for (const a in this.hostInfo.API_HOST) {
|
|
1785
|
+
let t = this.hostInfo.API_HOST[a];
|
|
1786
|
+
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;
|
|
1787
|
+
}
|
|
1763
1788
|
if (this.hostInfo.SERVER_HOST)
|
|
1764
|
-
for (const
|
|
1789
|
+
for (const a in this.hostInfo.SERVER_HOST) {
|
|
1790
|
+
let t = this.hostInfo.SERVER_HOST[a];
|
|
1791
|
+
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, Ft[a] = t;
|
|
1792
|
+
}
|
|
1765
1793
|
},
|
|
1766
1794
|
getHostInfo() {
|
|
1767
1795
|
return this.hostInfo;
|
|
@@ -1806,11 +1834,11 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
1806
1834
|
/**
|
|
1807
1835
|
* 设置表格头配置
|
|
1808
1836
|
*/
|
|
1809
|
-
setTableColumns(e,
|
|
1837
|
+
setTableColumns(e, a) {
|
|
1810
1838
|
this.$patch({
|
|
1811
1839
|
tableColumns: {
|
|
1812
1840
|
...this.tableColumns,
|
|
1813
|
-
[e]:
|
|
1841
|
+
[e]: a
|
|
1814
1842
|
}
|
|
1815
1843
|
});
|
|
1816
1844
|
}
|
|
@@ -1829,34 +1857,34 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
1829
1857
|
}
|
|
1830
1858
|
},
|
|
1831
1859
|
emits: ["change"],
|
|
1832
|
-
setup(e, { emit:
|
|
1833
|
-
const
|
|
1860
|
+
setup(e, { emit: a }) {
|
|
1861
|
+
const t = e, s = Y(), n = de(t.url, t), o = t.optionCtrl ?? n.optionCtrl;
|
|
1834
1862
|
o.inputFactory = K(s);
|
|
1835
1863
|
const r = f([]);
|
|
1836
|
-
o &&
|
|
1864
|
+
o && y(
|
|
1837
1865
|
() => o.options.value,
|
|
1838
1866
|
(p) => {
|
|
1839
1867
|
r.value = p || [];
|
|
1840
1868
|
},
|
|
1841
1869
|
{ immediate: !0, deep: !0 }
|
|
1842
1870
|
);
|
|
1843
|
-
const l =
|
|
1871
|
+
const l = a, { editorCtrl: i, errInfo: u } = Y(), c = (p) => {
|
|
1844
1872
|
u != null && u.value.errClass && i && fe(i), l("change", p);
|
|
1845
1873
|
};
|
|
1846
1874
|
return Ie(() => {
|
|
1847
|
-
if (!
|
|
1848
|
-
console.error("Switch组件: ",
|
|
1875
|
+
if (!t.data || t.data.length != 2) {
|
|
1876
|
+
console.error("Switch组件: ", t.data), x.error("Switch组件必须有且只有两个选项");
|
|
1849
1877
|
return;
|
|
1850
1878
|
}
|
|
1851
|
-
o && Z(o.autoload, o,
|
|
1879
|
+
o && Z(o.autoload, o, t);
|
|
1852
1880
|
}), ie(() => {
|
|
1853
|
-
o && pe(o,
|
|
1854
|
-
}), (p,
|
|
1855
|
-
var
|
|
1856
|
-
return r.value.length === 2 ? (O(), xe(
|
|
1881
|
+
o && pe(o, t);
|
|
1882
|
+
}), (p, v) => {
|
|
1883
|
+
var h;
|
|
1884
|
+
return r.value.length === 2 ? (O(), xe(S(St), le({
|
|
1857
1885
|
key: 0,
|
|
1858
1886
|
class: [
|
|
1859
|
-
((
|
|
1887
|
+
((h = S(u)) == null ? void 0 : h.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : "",
|
|
1860
1888
|
"bg-blue-300",
|
|
1861
1889
|
"w-[58px]"
|
|
1862
1890
|
],
|
|
@@ -1865,7 +1893,7 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
1865
1893
|
unCheckedChildren: r.value[1].label,
|
|
1866
1894
|
unCheckedValue: r.value[1].value,
|
|
1867
1895
|
onChange: c
|
|
1868
|
-
}, p.$attrs), null, 16, ["class", "checkedChildren", "checkedValue", "unCheckedChildren", "unCheckedValue"])) :
|
|
1896
|
+
}, p.$attrs), null, 16, ["class", "checkedChildren", "checkedValue", "unCheckedChildren", "unCheckedValue"])) : B("", !0);
|
|
1869
1897
|
};
|
|
1870
1898
|
}
|
|
1871
1899
|
}), rs = /* @__PURE__ */ X({
|
|
@@ -1888,70 +1916,70 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
1888
1916
|
}
|
|
1889
1917
|
},
|
|
1890
1918
|
emits: ["update:value", "select", "change", "update:labels"],
|
|
1891
|
-
setup(e, { emit:
|
|
1892
|
-
const
|
|
1919
|
+
setup(e, { emit: a }) {
|
|
1920
|
+
const t = e, s = Ae(), n = Y(), o = de(t.url, t), r = t.optionCtrl ?? o.optionCtrl;
|
|
1893
1921
|
r.inputFactory = K(n), r.fieldMap = {
|
|
1894
1922
|
label: "Name",
|
|
1895
1923
|
value: "Id",
|
|
1896
1924
|
...r == null ? void 0 : r.fieldMap
|
|
1897
1925
|
};
|
|
1898
1926
|
const l = f(void 0);
|
|
1899
|
-
|
|
1900
|
-
() =>
|
|
1927
|
+
y(
|
|
1928
|
+
() => t.value,
|
|
1901
1929
|
() => {
|
|
1902
|
-
l.value =
|
|
1930
|
+
l.value = t.value;
|
|
1903
1931
|
},
|
|
1904
1932
|
{ immediate: !0 }
|
|
1905
|
-
),
|
|
1933
|
+
), y(
|
|
1906
1934
|
() => l.value,
|
|
1907
1935
|
(g) => {
|
|
1908
|
-
|
|
1936
|
+
t.autoClean && t.formData && t.outFields && g !== t.value && ft(t.formData, t.outFields, null);
|
|
1909
1937
|
}
|
|
1910
1938
|
);
|
|
1911
|
-
const { editorCtrl: i, errInfo: u, labelText: c } = n, p =
|
|
1939
|
+
const { editorCtrl: i, errInfo: u, labelText: c } = n, p = a;
|
|
1912
1940
|
n.inputEmit = p;
|
|
1913
|
-
const
|
|
1914
|
-
r &&
|
|
1941
|
+
const v = f((r == null ? void 0 : r.options.value) || []);
|
|
1942
|
+
r && y(
|
|
1915
1943
|
() => r.options.value,
|
|
1916
1944
|
(g) => {
|
|
1917
|
-
|
|
1945
|
+
v.value = g || [];
|
|
1918
1946
|
},
|
|
1919
1947
|
{ immediate: !0, deep: !0 }
|
|
1920
1948
|
);
|
|
1921
|
-
const
|
|
1922
|
-
if (
|
|
1923
|
-
let
|
|
1949
|
+
const h = (g) => {
|
|
1950
|
+
if (v.value = [], g === "") return;
|
|
1951
|
+
let d = {
|
|
1924
1952
|
Query: {
|
|
1925
1953
|
SearchField: "%" + g.trim() + "%"
|
|
1926
1954
|
}
|
|
1927
1955
|
};
|
|
1928
|
-
r.params = Oe(r.params,
|
|
1956
|
+
r.params = Oe(r.params, d), r && Z(!0, r, t);
|
|
1929
1957
|
}, A = (g) => {
|
|
1930
|
-
const E = Pe(r,
|
|
1958
|
+
const E = Pe(r, t, g);
|
|
1931
1959
|
p("update:value", g), p("select", g);
|
|
1932
|
-
const
|
|
1933
|
-
p("update:labels",
|
|
1960
|
+
const d = we(E);
|
|
1961
|
+
p("update:labels", d), u != null && u.value.errClass && i && fe(i);
|
|
1934
1962
|
};
|
|
1935
1963
|
return ie(() => {
|
|
1936
|
-
r && pe(r,
|
|
1964
|
+
r && pe(r, t);
|
|
1937
1965
|
}), (g, E) => {
|
|
1938
|
-
var
|
|
1939
|
-
return O(),
|
|
1940
|
-
|
|
1966
|
+
var d;
|
|
1967
|
+
return O(), $("div", null, [
|
|
1968
|
+
C(S(It), le({
|
|
1941
1969
|
value: l.value,
|
|
1942
|
-
"onUpdate:value": E[0] || (E[0] = (
|
|
1943
|
-
class: ["w-full", (
|
|
1944
|
-
options:
|
|
1945
|
-
onSearch:
|
|
1970
|
+
"onUpdate:value": E[0] || (E[0] = (I) => l.value = I),
|
|
1971
|
+
class: ["w-full", (d = S(u)) == null ? void 0 : d.errClass],
|
|
1972
|
+
options: v.value,
|
|
1973
|
+
onSearch: h,
|
|
1946
1974
|
onSelect: A
|
|
1947
|
-
},
|
|
1948
|
-
option: V(({ label:
|
|
1949
|
-
Ee(
|
|
1975
|
+
}, S(s), { "allow-clear": !1 }), {
|
|
1976
|
+
option: V(({ label: I }) => [
|
|
1977
|
+
Ee(z(I), 1)
|
|
1950
1978
|
]),
|
|
1951
1979
|
default: V(() => [
|
|
1952
|
-
|
|
1980
|
+
C(S(xt), {
|
|
1953
1981
|
"allow-clear": "",
|
|
1954
|
-
placeholder: "请输入并选择" +
|
|
1982
|
+
placeholder: "请输入并选择" + S(c)
|
|
1955
1983
|
}, null, 8, ["placeholder"])
|
|
1956
1984
|
]),
|
|
1957
1985
|
_: 1
|
|
@@ -1959,7 +1987,7 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
1959
1987
|
]);
|
|
1960
1988
|
};
|
|
1961
1989
|
}
|
|
1962
|
-
}),
|
|
1990
|
+
}), ma = { class: "min-h-[32px] pt-[5px]" }, va = {
|
|
1963
1991
|
key: 1,
|
|
1964
1992
|
class: "text-center text-gray-500"
|
|
1965
1993
|
}, os = /* @__PURE__ */ X({
|
|
@@ -1982,20 +2010,20 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
1982
2010
|
}
|
|
1983
2011
|
},
|
|
1984
2012
|
emits: ["change", "update:labels"],
|
|
1985
|
-
setup(e, { emit:
|
|
1986
|
-
var
|
|
1987
|
-
const
|
|
2013
|
+
setup(e, { emit: a }) {
|
|
2014
|
+
var v, h, A;
|
|
2015
|
+
const t = e, s = Ae(), n = Y(), o = de(t.url, t), r = t.optionCtrl ?? o.optionCtrl;
|
|
1988
2016
|
r.inputFactory = K(n);
|
|
1989
2017
|
const l = f({
|
|
1990
2018
|
...r == null ? void 0 : r.url,
|
|
1991
|
-
url: ((
|
|
1992
|
-
fieldMap: (r == null ? void 0 : r.fieldMap) || ((
|
|
2019
|
+
url: ((v = r == null ? void 0 : r.url) == null ? void 0 : v.url) || "",
|
|
2020
|
+
fieldMap: (r == null ? void 0 : r.fieldMap) || ((h = r == null ? void 0 : r.url) == null ? void 0 : h.fieldMap),
|
|
1993
2021
|
params: (r == null ? void 0 : r.params) || ((A = r == null ? void 0 : r.url) == null ? void 0 : A.params),
|
|
1994
2022
|
loadingText: !1
|
|
1995
|
-
}), { errInfo: i } = n, u =
|
|
2023
|
+
}), { errInfo: i } = n, u = a;
|
|
1996
2024
|
n.inputEmit = u;
|
|
1997
2025
|
const c = f((r == null ? void 0 : r.options.value) || []);
|
|
1998
|
-
r &&
|
|
2026
|
+
r && y(
|
|
1999
2027
|
() => r.options.value,
|
|
2000
2028
|
(g) => {
|
|
2001
2029
|
c.value = g || [];
|
|
@@ -2003,8 +2031,8 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
2003
2031
|
{ immediate: !0, deep: !0 }
|
|
2004
2032
|
);
|
|
2005
2033
|
const p = (g) => {
|
|
2006
|
-
const
|
|
2007
|
-
u("update:labels",
|
|
2034
|
+
const d = Pe(r, t, g), I = we(d);
|
|
2035
|
+
u("update:labels", I);
|
|
2008
2036
|
};
|
|
2009
2037
|
return Ie(() => {
|
|
2010
2038
|
l.value && !l.value.fieldMap && (l.value.fieldMap = {
|
|
@@ -2012,40 +2040,40 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
2012
2040
|
label: "Name",
|
|
2013
2041
|
value: "Id",
|
|
2014
2042
|
key: "Id"
|
|
2015
|
-
}), r && Z(r.autoload, r,
|
|
2043
|
+
}), r && Z(r.autoload, r, t);
|
|
2016
2044
|
}), ie(() => {
|
|
2017
|
-
r && pe(r,
|
|
2018
|
-
}), (g, E) => (O(),
|
|
2019
|
-
|
|
2045
|
+
r && pe(r, t);
|
|
2046
|
+
}), (g, E) => (O(), $("div", ma, [
|
|
2047
|
+
C(S(At), le({
|
|
2020
2048
|
onChange: p,
|
|
2021
2049
|
class: "w-full mb-[-3px]"
|
|
2022
|
-
},
|
|
2050
|
+
}, S(s)), {
|
|
2023
2051
|
default: V(() => [
|
|
2024
|
-
c.value.length > 0 ? (O(!0),
|
|
2025
|
-
var
|
|
2026
|
-
return O(), xe(
|
|
2027
|
-
key:
|
|
2028
|
-
value:
|
|
2029
|
-
disabled:
|
|
2030
|
-
class:
|
|
2031
|
-
((
|
|
2052
|
+
c.value.length > 0 ? (O(!0), $(ne, { key: 0 }, Ue(c.value, (d) => {
|
|
2053
|
+
var I;
|
|
2054
|
+
return O(), xe(S(Et), {
|
|
2055
|
+
key: d.value,
|
|
2056
|
+
value: d.value,
|
|
2057
|
+
disabled: d.disabled || d.value && e.disabledItems && e.disabledItems.indexOf(d.value.toString()) > -1,
|
|
2058
|
+
class: et([
|
|
2059
|
+
((I = S(i)) == null ? void 0 : I.errClass) === "error" ? "error !text-red-400" : "",
|
|
2032
2060
|
"text-nowrap",
|
|
2033
2061
|
"pb-1",
|
|
2034
|
-
e.wrap ? `w-1/${
|
|
2062
|
+
e.wrap ? `w-1/${t.wrap}` : ""
|
|
2035
2063
|
])
|
|
2036
2064
|
}, {
|
|
2037
2065
|
default: V(() => [
|
|
2038
|
-
Ee(
|
|
2066
|
+
Ee(z(d.label), 1)
|
|
2039
2067
|
]),
|
|
2040
2068
|
_: 2
|
|
2041
2069
|
}, 1032, ["value", "disabled", "class"]);
|
|
2042
|
-
}), 128)) : e.nodata ? (O(),
|
|
2070
|
+
}), 128)) : e.nodata ? (O(), $("div", va, z(e.nodata), 1)) : B("", !0)
|
|
2043
2071
|
]),
|
|
2044
2072
|
_: 1
|
|
2045
2073
|
}, 16)
|
|
2046
2074
|
]));
|
|
2047
2075
|
}
|
|
2048
|
-
}),
|
|
2076
|
+
}), ga = { class: "min-h-[32px] pt-1" }, ya = {
|
|
2049
2077
|
key: 1,
|
|
2050
2078
|
class: "text-center text-gray-500"
|
|
2051
2079
|
}, is = /* @__PURE__ */ X({
|
|
@@ -2069,9 +2097,9 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
2069
2097
|
}
|
|
2070
2098
|
},
|
|
2071
2099
|
emits: ["change", "update:value", "update:labels"],
|
|
2072
|
-
setup(e, { emit:
|
|
2100
|
+
setup(e, { emit: a }) {
|
|
2073
2101
|
var A, g, E;
|
|
2074
|
-
const
|
|
2102
|
+
const t = e, s = Ae(), n = Y(), o = de(t.url, t), r = t.optionCtrl ?? o.optionCtrl;
|
|
2075
2103
|
r.inputFactory = K(n);
|
|
2076
2104
|
const l = f({
|
|
2077
2105
|
...r == null ? void 0 : r.url,
|
|
@@ -2079,27 +2107,32 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
2079
2107
|
fieldMap: (r == null ? void 0 : r.fieldMap) || ((g = r == null ? void 0 : r.url) == null ? void 0 : g.fieldMap),
|
|
2080
2108
|
params: (r == null ? void 0 : r.params) || ((E = r == null ? void 0 : r.url) == null ? void 0 : E.params),
|
|
2081
2109
|
loadingText: !1
|
|
2082
|
-
}), i = f(
|
|
2083
|
-
n.inputEmit = p, r &&
|
|
2110
|
+
}), i = f(t.value), { errInfo: u } = n, c = f((r == null ? void 0 : r.options.value) || []), p = a;
|
|
2111
|
+
n.inputEmit = p, r && y(
|
|
2084
2112
|
() => r.options.value,
|
|
2085
|
-
(
|
|
2086
|
-
c.value =
|
|
2113
|
+
(d) => {
|
|
2114
|
+
c.value = d || [];
|
|
2087
2115
|
},
|
|
2088
2116
|
{ immediate: !0, deep: !0 }
|
|
2089
|
-
),
|
|
2117
|
+
), y(
|
|
2118
|
+
() => t.value,
|
|
2119
|
+
(d) => {
|
|
2120
|
+
i.value = d;
|
|
2121
|
+
}
|
|
2122
|
+
), y(
|
|
2090
2123
|
() => i.value,
|
|
2091
|
-
(
|
|
2092
|
-
p("update:value",
|
|
2124
|
+
(d) => {
|
|
2125
|
+
p("update:value", d);
|
|
2093
2126
|
}
|
|
2094
2127
|
);
|
|
2095
|
-
const
|
|
2096
|
-
if (typeof
|
|
2097
|
-
const R = JSON.stringify(
|
|
2098
|
-
return R && (i.value =
|
|
2128
|
+
const v = (d, I) => {
|
|
2129
|
+
if (typeof d == "object" && typeof I == "object") {
|
|
2130
|
+
const R = JSON.stringify(d) === JSON.stringify(I);
|
|
2131
|
+
return R && (i.value = d), R;
|
|
2099
2132
|
}
|
|
2100
|
-
return
|
|
2101
|
-
},
|
|
2102
|
-
const
|
|
2133
|
+
return d === I;
|
|
2134
|
+
}, h = (d) => {
|
|
2135
|
+
const I = d.target.value, R = Pe(r, t, I), Q = we(R);
|
|
2103
2136
|
p("update:labels", Q);
|
|
2104
2137
|
};
|
|
2105
2138
|
return Ie(() => {
|
|
@@ -2107,47 +2140,47 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
2107
2140
|
label: "Name",
|
|
2108
2141
|
value: "Id",
|
|
2109
2142
|
key: "Id"
|
|
2110
|
-
}), r && Z(r.autoload, r,
|
|
2143
|
+
}), r && Z(r.autoload, r, t);
|
|
2111
2144
|
}), ie(() => {
|
|
2112
|
-
r && pe(r,
|
|
2113
|
-
}), (
|
|
2114
|
-
|
|
2145
|
+
r && pe(r, t);
|
|
2146
|
+
}), (d, I) => (O(), $("div", ga, [
|
|
2147
|
+
C(S(Ot), le({
|
|
2115
2148
|
value: i.value,
|
|
2116
|
-
"onUpdate:value":
|
|
2149
|
+
"onUpdate:value": I[0] || (I[0] = (R) => i.value = R),
|
|
2117
2150
|
autocheck: !1,
|
|
2118
|
-
onChange:
|
|
2151
|
+
onChange: h,
|
|
2119
2152
|
class: "w-full flex align-items flex-wrap mb-[-3px]"
|
|
2120
|
-
},
|
|
2153
|
+
}, S(s)), {
|
|
2121
2154
|
default: V(() => [
|
|
2122
|
-
c.value.length > 0 ? (O(!0),
|
|
2155
|
+
c.value.length > 0 ? (O(!0), $(ne, { key: 0 }, Ue(c.value, (R) => {
|
|
2123
2156
|
var Q;
|
|
2124
|
-
return O(),
|
|
2157
|
+
return O(), $(ne, {
|
|
2125
2158
|
key: R.value
|
|
2126
2159
|
}, [
|
|
2127
|
-
R.visible !== !1 ? (O(), xe(
|
|
2160
|
+
R.visible !== !1 ? (O(), xe(S(Rt), {
|
|
2128
2161
|
key: 0,
|
|
2129
|
-
checked:
|
|
2162
|
+
checked: v(R.value, t.value),
|
|
2130
2163
|
value: R.value,
|
|
2131
|
-
class:
|
|
2132
|
-
((Q =
|
|
2164
|
+
class: et([
|
|
2165
|
+
((Q = S(u)) == null ? void 0 : Q.errClass) === "error" ? "error !text-red-400" : "",
|
|
2133
2166
|
"text-nowrap",
|
|
2134
2167
|
"pb-1",
|
|
2135
|
-
e.wrap ? `w-1/${
|
|
2168
|
+
e.wrap ? `w-1/${t.wrap}` : ""
|
|
2136
2169
|
])
|
|
2137
2170
|
}, {
|
|
2138
2171
|
default: V(() => [
|
|
2139
|
-
Ee(
|
|
2172
|
+
Ee(z(R.label), 1)
|
|
2140
2173
|
]),
|
|
2141
2174
|
_: 2
|
|
2142
|
-
}, 1032, ["checked", "value", "class"])) :
|
|
2175
|
+
}, 1032, ["checked", "value", "class"])) : B("", !0)
|
|
2143
2176
|
], 64);
|
|
2144
|
-
}), 128)) : e.nodata ? (O(),
|
|
2177
|
+
}), 128)) : e.nodata ? (O(), $("div", ya, z(e.nodata), 1)) : B("", !0)
|
|
2145
2178
|
]),
|
|
2146
2179
|
_: 1
|
|
2147
2180
|
}, 16, ["value"])
|
|
2148
2181
|
]));
|
|
2149
2182
|
}
|
|
2150
|
-
}),
|
|
2183
|
+
}), ba = {
|
|
2151
2184
|
key: 0,
|
|
2152
2185
|
class: "absolute z-10 mt-[5px] mr-[10px] text-[#999] flex items-center"
|
|
2153
2186
|
}, ls = /* @__PURE__ */ X({
|
|
@@ -2175,102 +2208,109 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
2175
2208
|
}
|
|
2176
2209
|
},
|
|
2177
2210
|
emits: ["change", "update:value", "update:label", "update:labels"],
|
|
2178
|
-
setup(e, { emit:
|
|
2179
|
-
var
|
|
2180
|
-
const
|
|
2211
|
+
setup(e, { emit: a }) {
|
|
2212
|
+
var I, R, Q;
|
|
2213
|
+
const t = e, s = Y(), { editorCtrl: n, errInfo: o, labelText: r } = s, l = de(t.url, t), i = t.optionCtrl ?? l.optionCtrl;
|
|
2181
2214
|
i.inputFactory = K(s);
|
|
2182
2215
|
const u = Ae(), c = f({
|
|
2183
2216
|
...i == null ? void 0 : i.url,
|
|
2184
|
-
url: ((
|
|
2217
|
+
url: ((I = i == null ? void 0 : i.url) == null ? void 0 : I.url) || "",
|
|
2185
2218
|
fieldMap: (i == null ? void 0 : i.fieldMap) || ((R = i == null ? void 0 : i.url) == null ? void 0 : R.fieldMap),
|
|
2186
2219
|
params: (i == null ? void 0 : i.params) || ((Q = i == null ? void 0 : i.url) == null ? void 0 : Q.params),
|
|
2187
2220
|
loadingText: !1
|
|
2188
|
-
}), p = f(
|
|
2221
|
+
}), p = f(t.value), v = f(u.placeholder), h = f((i == null ? void 0 : i.selected.value) || void 0), A = a;
|
|
2189
2222
|
s.inputEmit = A;
|
|
2190
|
-
const g = (
|
|
2191
|
-
const
|
|
2192
|
-
|
|
2193
|
-
}, E = f((i == null ? void 0 : i.options.value) || []),
|
|
2194
|
-
if (
|
|
2195
|
-
for (let
|
|
2196
|
-
const
|
|
2197
|
-
if (
|
|
2198
|
-
|
|
2223
|
+
const g = (m) => {
|
|
2224
|
+
const k = Pe(i, t, m), _ = we(k);
|
|
2225
|
+
h.value = m, A("update:labels", _), A("update:label", _.join(";")), A("change", m), o != null && o.value.errClass && n && fe(n);
|
|
2226
|
+
}, E = f((i == null ? void 0 : i.options.value) || []), d = (m) => {
|
|
2227
|
+
if (m.length > 0 && P(t.value) && t.selectFirst)
|
|
2228
|
+
for (let k = 0; k < m.length; k++) {
|
|
2229
|
+
const _ = m[k];
|
|
2230
|
+
if (_.disabled === void 0 || _.disabled === !1) {
|
|
2231
|
+
h.value = _.value;
|
|
2199
2232
|
break;
|
|
2200
2233
|
}
|
|
2201
2234
|
}
|
|
2202
|
-
else
|
|
2203
|
-
|
|
2235
|
+
else m.length > 0 && (h.value = t.value === null ? void 0 : t.value);
|
|
2236
|
+
m.length > 0 && h.value !== void 0 && g(h.value);
|
|
2204
2237
|
};
|
|
2205
|
-
return i &&
|
|
2238
|
+
return i && (y(
|
|
2206
2239
|
() => i.options.value,
|
|
2207
|
-
(
|
|
2208
|
-
E.value =
|
|
2240
|
+
(m) => {
|
|
2241
|
+
E.value = m || [];
|
|
2209
2242
|
},
|
|
2210
2243
|
{ immediate: !0, deep: !0 }
|
|
2211
|
-
),
|
|
2244
|
+
), y(
|
|
2245
|
+
() => i.selected.value,
|
|
2246
|
+
(m) => {
|
|
2247
|
+
h.value = m;
|
|
2248
|
+
}
|
|
2249
|
+
)), y(
|
|
2212
2250
|
() => E.value,
|
|
2213
|
-
(
|
|
2214
|
-
|
|
2251
|
+
(m) => {
|
|
2252
|
+
d(m);
|
|
2215
2253
|
}
|
|
2216
|
-
),
|
|
2254
|
+
), y(
|
|
2217
2255
|
() => c.value.loading,
|
|
2218
|
-
(
|
|
2219
|
-
|
|
2256
|
+
(m) => {
|
|
2257
|
+
m ? v.value = "" : v.value || (v.value = "请选择" + r.value);
|
|
2220
2258
|
},
|
|
2221
2259
|
{ immediate: !0 }
|
|
2222
|
-
),
|
|
2223
|
-
() =>
|
|
2224
|
-
(
|
|
2225
|
-
|
|
2260
|
+
), y(
|
|
2261
|
+
() => h.value,
|
|
2262
|
+
(m) => {
|
|
2263
|
+
i && (i.selected.value = m);
|
|
2264
|
+
const k = m === void 0 ? null : m;
|
|
2265
|
+
if (u.mode === "multiple" && P(m) && P(p.value)) {
|
|
2226
2266
|
A("update:value", p.value);
|
|
2227
2267
|
return;
|
|
2228
2268
|
}
|
|
2229
|
-
A("update:value",
|
|
2269
|
+
A("update:value", k);
|
|
2230
2270
|
}
|
|
2231
2271
|
), Ie(() => {
|
|
2232
2272
|
if (c.value && !c.value.fieldMap && (c.value.fieldMap = {
|
|
2233
2273
|
label: "Name",
|
|
2234
2274
|
value: "Id",
|
|
2235
2275
|
key: "Id"
|
|
2236
|
-
}),
|
|
2237
|
-
const
|
|
2238
|
-
E.value =
|
|
2276
|
+
}), t.dataKey) {
|
|
2277
|
+
const m = JSON.parse(JSON.stringify(M.getOptions(t.dataKey)));
|
|
2278
|
+
E.value = m, d(m);
|
|
2239
2279
|
} else if (i) {
|
|
2240
|
-
const
|
|
2241
|
-
|
|
2280
|
+
const m = i.options.value || [];
|
|
2281
|
+
m.length > 0 ? (E.value = m, d(m)) : Z(i.autoload, i, t);
|
|
2242
2282
|
}
|
|
2243
2283
|
}), ie(() => {
|
|
2244
|
-
i && pe(i,
|
|
2245
|
-
}), (
|
|
2246
|
-
var
|
|
2247
|
-
return O(),
|
|
2248
|
-
(
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
])) :
|
|
2252
|
-
|
|
2253
|
-
class: [(
|
|
2254
|
-
value:
|
|
2255
|
-
"onUpdate:value":
|
|
2284
|
+
i && pe(i, t);
|
|
2285
|
+
}), (m, k) => {
|
|
2286
|
+
var _, We, qe;
|
|
2287
|
+
return O(), $("div", null, [
|
|
2288
|
+
(We = (_ = S(i)) == null ? void 0 : _.url) != null && We.loading ? (O(), $("div", ba, [
|
|
2289
|
+
C(S(De), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
|
|
2290
|
+
k[1] || (k[1] = bt("span", null, "数据加载中...", -1))
|
|
2291
|
+
])) : B("", !0),
|
|
2292
|
+
C(S(Tt), le({
|
|
2293
|
+
class: [(qe = S(o)) == null ? void 0 : qe.errClass, "w-full"],
|
|
2294
|
+
value: h.value,
|
|
2295
|
+
"onUpdate:value": k[0] || (k[0] = (W) => h.value = W),
|
|
2256
2296
|
"allow-clear": !0,
|
|
2257
2297
|
onChange: g,
|
|
2258
|
-
placeholder:
|
|
2298
|
+
placeholder: v.value,
|
|
2259
2299
|
"label-in-value": !1
|
|
2260
|
-
},
|
|
2300
|
+
}, S(u)), {
|
|
2261
2301
|
default: V(() => [
|
|
2262
|
-
(O(!0),
|
|
2263
|
-
key:
|
|
2302
|
+
(O(!0), $(ne, null, Ue(E.value, (W) => (O(), $(ne, {
|
|
2303
|
+
key: W.value
|
|
2264
2304
|
}, [
|
|
2265
|
-
|
|
2305
|
+
W.visible !== !1 ? (O(), xe(S(wt), {
|
|
2266
2306
|
key: 0,
|
|
2267
|
-
value:
|
|
2307
|
+
value: W.value
|
|
2268
2308
|
}, {
|
|
2269
2309
|
default: V(() => [
|
|
2270
|
-
Ee(W
|
|
2310
|
+
Ee(z(W.label), 1)
|
|
2271
2311
|
]),
|
|
2272
2312
|
_: 2
|
|
2273
|
-
}, 1032, ["value"])) :
|
|
2313
|
+
}, 1032, ["value"])) : B("", !0)
|
|
2274
2314
|
], 64))), 128))
|
|
2275
2315
|
]),
|
|
2276
2316
|
_: 1
|
|
@@ -2280,68 +2320,68 @@ const B = new at(), Z = (e, t, a) => {
|
|
|
2280
2320
|
}
|
|
2281
2321
|
});
|
|
2282
2322
|
export {
|
|
2283
|
-
|
|
2323
|
+
_a as $,
|
|
2284
2324
|
fe as A,
|
|
2285
2325
|
os as B,
|
|
2286
2326
|
is as C,
|
|
2287
2327
|
ls as D,
|
|
2288
2328
|
Ve as E,
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2329
|
+
Nt as F,
|
|
2330
|
+
Ba as G,
|
|
2331
|
+
ra as H,
|
|
2332
|
+
oa as I,
|
|
2333
|
+
Ca as J,
|
|
2334
|
+
za as K,
|
|
2335
|
+
na as L,
|
|
2336
|
+
ft as M,
|
|
2337
|
+
Ya as N,
|
|
2338
|
+
M as O,
|
|
2299
2339
|
D as P,
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2340
|
+
Za as Q,
|
|
2341
|
+
pa as R,
|
|
2342
|
+
da as S,
|
|
2303
2343
|
es as T,
|
|
2304
2344
|
Xe as U,
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2345
|
+
ts as V,
|
|
2346
|
+
at as W,
|
|
2347
|
+
Va as X,
|
|
2348
|
+
st as Y,
|
|
2349
|
+
Fa as Z,
|
|
2310
2350
|
ns as _,
|
|
2311
2351
|
ss as a,
|
|
2312
2352
|
Ke as a0,
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
$
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2353
|
+
Ma as a1,
|
|
2354
|
+
Ja as a2,
|
|
2355
|
+
ea as a3,
|
|
2356
|
+
ut as a4,
|
|
2357
|
+
Ga as a5,
|
|
2358
|
+
$a as a6,
|
|
2359
|
+
tt as a7,
|
|
2360
|
+
Dt as a8,
|
|
2361
|
+
Ne as a9,
|
|
2362
|
+
q as aa,
|
|
2323
2363
|
se as ab,
|
|
2324
2364
|
ve as ac,
|
|
2325
2365
|
H as ad,
|
|
2326
|
-
|
|
2366
|
+
as as ae,
|
|
2327
2367
|
Je as af,
|
|
2328
2368
|
re as ag,
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2369
|
+
Ua as b,
|
|
2370
|
+
Xa as c,
|
|
2371
|
+
Ha as d,
|
|
2372
|
+
Na as e,
|
|
2373
|
+
Wa as f,
|
|
2374
|
+
qa as g,
|
|
2375
|
+
Qa as h,
|
|
2336
2376
|
P as i,
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2377
|
+
Ka as j,
|
|
2378
|
+
lt as k,
|
|
2379
|
+
Zt as l,
|
|
2380
|
+
ja as m,
|
|
2341
2381
|
rs as n,
|
|
2342
|
-
|
|
2382
|
+
Da as o,
|
|
2343
2383
|
ce as p,
|
|
2344
|
-
|
|
2384
|
+
Ut as q,
|
|
2345
2385
|
oe as r,
|
|
2346
2386
|
Y as s,
|
|
2347
2387
|
de as t,
|