@skyfox2000/webui 1.3.4 → 1.3.5
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-BBlFaIXB.js → file-upload-C0twqMV5.js} +1 -1
- package/lib/assets/modules/{index-BG1SqSVl.js → index-C4CryM-R.js} +1 -1
- package/lib/assets/modules/{index-4kDAt8nS.js → index-CKJIxasX.js} +2 -2
- package/lib/assets/modules/{index-m5rogIyM.js → index-D1XAa1Uo.js} +2 -2
- package/lib/assets/modules/{menuTabs-tPIz4a89.js → menuTabs-BrYQa4UO.js} +2 -2
- package/lib/assets/modules/{toolIcon-DwWoD9TN.js → toolIcon-B-g9pyE4.js} +1 -1
- package/lib/assets/modules/{uploadList-D_Z-Y2tw.js → uploadList-0f2FA_5s.js} +489 -454
- package/lib/assets/modules/{uploadList-Da7mQUNK.js → uploadList-DCWRIxPJ.js} +4 -4
- package/lib/components/content/table/index.vue.d.ts +95 -4
- 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 +28 -21
- package/lib/es/UploadForm/index.js +4 -4
- package/lib/typings/option.d.ts +2 -2
- package/lib/utils/options.d.ts +2 -2
- package/lib/webui.css +1 -1
- package/lib/webui.es.js +371 -374
- package/package.json +1 -1
- package/src/components/common/loading/index.vue +1 -1
- package/src/components/content/dialog/excelForm.vue +9 -8
- package/src/components/content/table/index.vue +9 -6
- package/src/components/form/autoComplete/index.vue +9 -3
- package/src/components/form/cascader/index.vue +8 -6
- package/src/typings/option.d.ts +2 -2
- package/src/utils/options.ts +80 -22
- package/src/utils/table.ts +15 -2
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
var da = Object.defineProperty;
|
|
2
2
|
var ha = (e, t, a) => t in e ? da(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
|
-
var
|
|
4
|
-
import { inject as
|
|
5
|
-
import { Switch as ya, AutoComplete as Sa, CheckboxGroup as
|
|
6
|
-
import { createPinia as
|
|
7
|
-
import
|
|
8
|
-
import { combineParams as
|
|
9
|
-
import { ResStatus as R, httpPost as Q, setToken as
|
|
3
|
+
var $ = (e, t, a) => ha(e, typeof t != "symbol" ? t + "" : t, a);
|
|
4
|
+
import { inject as ee, ref as f, provide as Pe, watch as I, toRaw as Ye, h as _, nextTick as ma, shallowRef as H, defineComponent as W, reactive as va, onMounted as Se, onUnmounted as re, createBlock as Ie, createCommentVNode as q, openBlock as A, unref as b, mergeProps as oe, useAttrs as xe, createElementBlock as L, createVNode as B, withCtx as D, createTextVNode as Ae, toDisplayString as z, Fragment as te, renderList as _e, normalizeClass as Xe, createElementVNode as ga } from "vue";
|
|
5
|
+
import { Switch as ya, AutoComplete as ba, Input as Sa, CheckboxGroup as Ia, Checkbox as xa, RadioGroup as Aa, Radio as Ea, Select as Oa, SelectOption as Ra } from "ant-design-vue";
|
|
6
|
+
import { createPinia as Ta, defineStore as ie } from "pinia";
|
|
7
|
+
import wa from "pinia-plugin-persistedstate";
|
|
8
|
+
import { combineParams as Ee, EnvConfig as ve, AppAction as qe, AppSource as Be, isMicroApp as ge, mainAppApis as M, isBaseMicroApp as Pa } from "@skyfox2000/microbase";
|
|
9
|
+
import { ResStatus as R, httpPost as Q, setToken as de, fieldMapping as ka, parseFieldTemplate as ye, API_HOST as ke, SERVER_HOST as La } from "@skyfox2000/fapi";
|
|
10
10
|
import x from "vue-m-message";
|
|
11
|
-
import
|
|
12
|
-
import { createRouter as
|
|
11
|
+
import Ue from "async-validator";
|
|
12
|
+
import { createRouter as $a, createWebHashHistory as Fa } from "vue-router";
|
|
13
13
|
import "dayjs";
|
|
14
14
|
import "vue-draggable-next";
|
|
15
|
-
const Ma =
|
|
16
|
-
Ma.use(
|
|
15
|
+
const Ma = Ta();
|
|
16
|
+
Ma.use(wa);
|
|
17
17
|
var N = /* @__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))(N || {});
|
|
18
18
|
const T = class T {
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
$(T, "dict", {}), $(T, "Keys", {
|
|
21
21
|
EnableDisable: "EnableDisable",
|
|
22
22
|
SuccessResult: "SuccessResult",
|
|
23
23
|
YesNo: "YesNo",
|
|
@@ -27,25 +27,25 @@ F(T, "dict", {}), F(T, "Keys", {
|
|
|
27
27
|
* @param key 名称
|
|
28
28
|
* @returns
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
$(T, "getOptions", (t) => T.dict[t]), /**
|
|
31
31
|
* 静态选择项对象
|
|
32
32
|
* @param key 名称
|
|
33
33
|
* @param value 值
|
|
34
34
|
* @returns
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
$(T, "getOptionItem", (t, a) => T.dict[t].find((s) => s.value === a)), /**
|
|
37
37
|
* 设置静态选择项
|
|
38
38
|
* @param key 名称
|
|
39
39
|
* @param list 列表
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
$(T, "setOptions", (t, a) => {
|
|
42
42
|
T.dict[t] = a;
|
|
43
43
|
}), /**
|
|
44
44
|
* 启用/停用选项
|
|
45
45
|
* - 启用 1
|
|
46
46
|
* - 停用 0
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
$(T, "EnableDisable", [
|
|
49
49
|
{
|
|
50
50
|
label: "启用",
|
|
51
51
|
text: "✅ 启用",
|
|
@@ -61,7 +61,7 @@ F(T, "EnableDisable", [
|
|
|
61
61
|
* - 成功 1
|
|
62
62
|
* - 失败 0
|
|
63
63
|
*/
|
|
64
|
-
|
|
64
|
+
$(T, "SuccessResult", [
|
|
65
65
|
{
|
|
66
66
|
label: "成功",
|
|
67
67
|
text: "✅ 成功",
|
|
@@ -77,7 +77,7 @@ F(T, "SuccessResult", [
|
|
|
77
77
|
* - 是 1
|
|
78
78
|
* - 否 0
|
|
79
79
|
*/
|
|
80
|
-
|
|
80
|
+
$(T, "YesNo", [
|
|
81
81
|
{
|
|
82
82
|
label: "是",
|
|
83
83
|
text: "✅ 是",
|
|
@@ -93,7 +93,7 @@ F(T, "YesNo", [
|
|
|
93
93
|
* - 男 M
|
|
94
94
|
* - 女 F
|
|
95
95
|
*/
|
|
96
|
-
|
|
96
|
+
$(T, "MaleFemale", [
|
|
97
97
|
{
|
|
98
98
|
label: "男",
|
|
99
99
|
text: "男 👨",
|
|
@@ -105,12 +105,12 @@ F(T, "MaleFemale", [
|
|
|
105
105
|
value: "F"
|
|
106
106
|
}
|
|
107
107
|
]);
|
|
108
|
-
let
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const
|
|
108
|
+
let F = T;
|
|
109
|
+
F.setOptions("EnableDisable", F.EnableDisable);
|
|
110
|
+
F.setOptions("SuccessResult", F.SuccessResult);
|
|
111
|
+
F.setOptions("YesNo", F.YesNo);
|
|
112
|
+
F.setOptions("MaleFemale", F.MaleFemale);
|
|
113
|
+
const le = {
|
|
114
114
|
/**
|
|
115
115
|
* 选项数据接口
|
|
116
116
|
*/
|
|
@@ -141,8 +141,8 @@ const ie = {
|
|
|
141
141
|
},
|
|
142
142
|
/**
|
|
143
143
|
* 输出字段转换控制
|
|
144
|
-
* - Key
|
|
145
|
-
* - Value:源字段,支持模板 ${}
|
|
144
|
+
* - Key:目的字段,支持 "." 嵌套
|
|
145
|
+
* - Value:源字段,支持模板 ${} 或者 ${index} 或者 ${index}.${key}
|
|
146
146
|
*/
|
|
147
147
|
outFields: {
|
|
148
148
|
type: Object,
|
|
@@ -173,7 +173,7 @@ const ie = {
|
|
|
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,
|
|
176
|
+
}, P = (e) => e == null || e === "" ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1, Oe = (e, t) => {
|
|
177
177
|
var n;
|
|
178
178
|
return {
|
|
179
179
|
url: "",
|
|
@@ -182,7 +182,7 @@ const ie = {
|
|
|
182
182
|
...t.url,
|
|
183
183
|
loadingText: t.loadingText
|
|
184
184
|
};
|
|
185
|
-
},
|
|
185
|
+
}, Re = (e, t) => {
|
|
186
186
|
const a = e.page, s = t.url;
|
|
187
187
|
if (!s || !s.url) {
|
|
188
188
|
const o = `URL未设置: ${t.urlKey}`;
|
|
@@ -191,11 +191,11 @@ const ie = {
|
|
|
191
191
|
s.api || (s.api = a.api), s.authorize === void 0 && (s.authorize = a.authorize);
|
|
192
192
|
let n = JSON.parse(JSON.stringify(t.params));
|
|
193
193
|
return t.processParams && (n = t.processParams(n)), t.loadingState && (t.loadingState.value = !0), t.hideErrorToast && (s.hideErrorToast = !0), Q(s, n).then((o) => (t.loadingState && (t.loadingState.value = !1), o)).catch((o) => (t.loadingState && (t.loadingState.value = !1), null));
|
|
194
|
-
},
|
|
194
|
+
}, De = (e, t) => {
|
|
195
195
|
t.params || (t.params = {}), t.params.Query || (t.params.Query = {});
|
|
196
|
-
const a =
|
|
197
|
-
return t.url = a,
|
|
198
|
-
},
|
|
196
|
+
const a = Oe(e, t);
|
|
197
|
+
return t.url = a, Re(e, t);
|
|
198
|
+
}, kt = (e, t) => (t.params || (t.params = {}), t.params.Query || (t.params.Query = {}), t.loadingText = t.loadingText === !1 ? !1 : t.loadingText || "开始执行...", t.url = Oe(e, t), Re(e, t).then((a) => ((a == null ? void 0 : a.status) === R.SUCCESS && (t.hideErrorToast || x.success("执行成功!")), a))), Ze = (e, t = {}) => {
|
|
199
199
|
const a = t.primaryKey || "Id";
|
|
200
200
|
if (t.params || (t.params = {}), t.params.Query || (t.params.Query = {}), !t.params.Data)
|
|
201
201
|
return x.error("错误!无保存数据!"), Promise.resolve(null);
|
|
@@ -205,9 +205,9 @@ const ie = {
|
|
|
205
205
|
loadingText: t.loadingText === !1 ? !1 : t.loadingText || "数据保存中..."
|
|
206
206
|
};
|
|
207
207
|
s.params.Query[a] = s.params.Data[a];
|
|
208
|
-
const n =
|
|
209
|
-
return s.url = n,
|
|
210
|
-
},
|
|
208
|
+
const n = Oe(e, s);
|
|
209
|
+
return s.url = n, Re(e, s).then((o) => ((o == null ? void 0 : o.status) === R.SUCCESS && (t.hideErrorToast || x.success("保存成功!")), o));
|
|
210
|
+
}, Na = (e, t, a = {}) => {
|
|
211
211
|
const s = a.primaryKey || "Id";
|
|
212
212
|
a.params || (a.params = {}), a.params.Query || (a.params.Query = {});
|
|
213
213
|
const n = {
|
|
@@ -217,18 +217,18 @@ const ie = {
|
|
|
217
217
|
};
|
|
218
218
|
if (Array.isArray(t) ? n.params.Query[s] = t : n.params.Query[s] = t[s], P(n.params.Query) || P(n.params.Query[s]))
|
|
219
219
|
return x.error("错误!禁止无条件删除数据!"), Promise.resolve(null);
|
|
220
|
-
const o =
|
|
221
|
-
return n.url = o,
|
|
222
|
-
},
|
|
220
|
+
const o = Oe(e, n);
|
|
221
|
+
return n.url = o, Re(e, n).then((r) => ((r == null ? void 0 : r.status) === R.SUCCESS && (a.hideErrorToast || x.success("删除成功!")), r));
|
|
222
|
+
}, _a = (e, t) => De(e, {
|
|
223
223
|
urlKey: "tree",
|
|
224
224
|
params: {},
|
|
225
225
|
loadingState: e.isTreeLoading,
|
|
226
226
|
loadingText: !1,
|
|
227
|
-
processParams: () =>
|
|
227
|
+
processParams: () => Ee(e.treeQuery, t)
|
|
228
228
|
}).then((a) => (a == null ? void 0 : a.status) === R.SUCCESS ? (e.data.value = a.data, e.data.value) : []);
|
|
229
|
-
let
|
|
230
|
-
const
|
|
231
|
-
|
|
229
|
+
let se;
|
|
230
|
+
const Lt = (e) => {
|
|
231
|
+
se = new Ue({}), se.messages({
|
|
232
232
|
required: "${label}不能为空",
|
|
233
233
|
types: {
|
|
234
234
|
number: "${label}必须是数字"
|
|
@@ -254,39 +254,39 @@ const kt = (e) => {
|
|
|
254
254
|
},
|
|
255
255
|
...e
|
|
256
256
|
});
|
|
257
|
-
},
|
|
257
|
+
}, $t = (e) => {
|
|
258
258
|
if (!e || P(e))
|
|
259
259
|
return [];
|
|
260
|
-
const t = [], a =
|
|
260
|
+
const t = [], a = se.messages(), s = (o, r, l) => {
|
|
261
261
|
const i = r.type;
|
|
262
262
|
if (i && a.types && i in a.types) {
|
|
263
|
-
const
|
|
264
|
-
n(
|
|
263
|
+
const c = a.types[i];
|
|
264
|
+
n(c, o, { type: i }, l);
|
|
265
265
|
}
|
|
266
266
|
const u = ["string", "number", "array"];
|
|
267
|
-
for (const
|
|
268
|
-
if (i ===
|
|
269
|
-
const p = a[
|
|
267
|
+
for (const c of u)
|
|
268
|
+
if (i === c && a[c]) {
|
|
269
|
+
const p = a[c], m = ["len", "min", "max", "range"];
|
|
270
270
|
for (const d of m)
|
|
271
271
|
d === "range" && r.min != null && r.max != null && p.range ? n(p.range, o, { min: r.min, max: r.max }, l) : d !== "range" && r[d] != null && p[d] && n(p[d], o, { [d]: r[d] }, l);
|
|
272
272
|
}
|
|
273
273
|
if (r.required && a.required && n(a.required, o, {}, l), r.pattern && a.pattern && n(r.message, o, {}, l), r.enum && Array.isArray(r.enum) && a.enum) {
|
|
274
|
-
const
|
|
275
|
-
n(a.enum, o, { enum:
|
|
274
|
+
const c = r.enum.join(", ");
|
|
275
|
+
n(a.enum, o, { enum: c }, l);
|
|
276
276
|
}
|
|
277
277
|
}, n = (o, r, l, i) => {
|
|
278
278
|
if (o)
|
|
279
279
|
try {
|
|
280
280
|
let u;
|
|
281
281
|
if (typeof o == "function") {
|
|
282
|
-
const
|
|
282
|
+
const c = [r];
|
|
283
283
|
for (const p in l)
|
|
284
|
-
|
|
285
|
-
u = o.apply(null,
|
|
284
|
+
c.push(l[p]);
|
|
285
|
+
u = o.apply(null, c), u && i.push(u);
|
|
286
286
|
} else {
|
|
287
287
|
u = String(o);
|
|
288
|
-
for (const
|
|
289
|
-
u = u.replace(new RegExp(`\\$\\{${
|
|
288
|
+
for (const c in l)
|
|
289
|
+
u = u.replace(new RegExp(`\\$\\{${c}\\}`, "g"), l[c]);
|
|
290
290
|
u = u.replace(/\$\{label\}/g, ""), u && i.push(u);
|
|
291
291
|
}
|
|
292
292
|
} catch (u) {
|
|
@@ -308,23 +308,23 @@ const kt = (e) => {
|
|
|
308
308
|
rules: i
|
|
309
309
|
});
|
|
310
310
|
}), t;
|
|
311
|
-
},
|
|
311
|
+
}, ue = async (e) => {
|
|
312
312
|
const t = e.formData.value, a = e.formRules.value;
|
|
313
|
-
P(a) || (
|
|
313
|
+
P(a) || (He(e), e.ruleValidator || (e.ruleValidator = new Ue({}), e.ruleValidator.messages(se.messages()), e.ruleValidator.define(a)), e.ruleResults.value = await e.ruleValidator.validate(t).then(() => {
|
|
314
314
|
}).catch(({ fields: s }) => s));
|
|
315
|
-
}, Ft = async (e, t, a) => (a || (a = new
|
|
316
|
-
}).catch(({ fields: s }) => s)),
|
|
315
|
+
}, Ft = async (e, t, a) => (a || (a = new Ue({}), a.messages(se.messages()), a.define(t)), a.validate(e).then(() => {
|
|
316
|
+
}).catch(({ fields: s }) => s)), He = (e) => {
|
|
317
317
|
e.ruleResults.value = void 0;
|
|
318
|
-
},
|
|
319
|
-
const e =
|
|
318
|
+
}, C = () => {
|
|
319
|
+
const e = ee(N.EditorControl, void 0), t = f(ee(N.LabelText, "")), a = f(ee(N.RuleKey, "")), s = ee(N.ErrInfo, void 0);
|
|
320
320
|
return {
|
|
321
321
|
editorCtrl: e,
|
|
322
322
|
labelText: t,
|
|
323
323
|
ruleKey: a,
|
|
324
324
|
errInfo: s
|
|
325
325
|
};
|
|
326
|
-
},
|
|
327
|
-
let a =
|
|
326
|
+
}, Ua = (e, t) => {
|
|
327
|
+
let a = f({
|
|
328
328
|
msg: "",
|
|
329
329
|
errClass: ""
|
|
330
330
|
});
|
|
@@ -349,7 +349,7 @@ const kt = (e) => {
|
|
|
349
349
|
{ deep: !0 }
|
|
350
350
|
), a;
|
|
351
351
|
}, Da = (e, t, a) => {
|
|
352
|
-
const s =
|
|
352
|
+
const s = f([]), n = f(""), o = f("");
|
|
353
353
|
if (!e.rule || !t || !a)
|
|
354
354
|
return { msg: n, ruleErrors: s, errClass: o };
|
|
355
355
|
e.rule.split("|").forEach((i) => {
|
|
@@ -358,8 +358,8 @@ const kt = (e) => {
|
|
|
358
358
|
s.value.push(...a[i]);
|
|
359
359
|
else {
|
|
360
360
|
const u = [];
|
|
361
|
-
for (let
|
|
362
|
-
|
|
361
|
+
for (let c in a)
|
|
362
|
+
c !== i && c.startsWith(i + ".") && u.push(...a[c]);
|
|
363
363
|
u.length > 0 && s.value.push(...u);
|
|
364
364
|
}
|
|
365
365
|
});
|
|
@@ -368,30 +368,30 @@ const kt = (e) => {
|
|
|
368
368
|
n.value && (n.value += " / "), n.value += i.message.replace("${label}", e.label ?? "");
|
|
369
369
|
const u = t[i.field];
|
|
370
370
|
if (u) {
|
|
371
|
-
const
|
|
372
|
-
|
|
371
|
+
const c = n.value.match(l);
|
|
372
|
+
c && c.forEach((p) => {
|
|
373
373
|
const m = p.replace("${", "").replace("}", "");
|
|
374
374
|
n.value = n.value.replace(p, u[m] ?? "");
|
|
375
375
|
});
|
|
376
376
|
}
|
|
377
377
|
}), s.value.length > 0 && (o.value = "error"), { msg: n, ruleErrors: s, errClass: o };
|
|
378
378
|
}, Mt = (e, t) => {
|
|
379
|
-
|
|
380
|
-
const a =
|
|
381
|
-
return
|
|
382
|
-
}, $t = (e) => {
|
|
383
|
-
ea(e);
|
|
379
|
+
Pe(N.LabelText, e.label || ""), Pe(N.RuleKey, e.rule || "");
|
|
380
|
+
const a = Ua(e, t);
|
|
381
|
+
return Pe(N.ErrInfo, a), a;
|
|
384
382
|
}, Nt = (e) => {
|
|
383
|
+
ea(e);
|
|
384
|
+
}, _t = (e) => {
|
|
385
385
|
const t = e.page, a = e.formData.value;
|
|
386
386
|
a[e.primaryKey ?? t.primaryKey] = null, ea(e);
|
|
387
|
-
},
|
|
388
|
-
|
|
387
|
+
}, Ut = (e) => {
|
|
388
|
+
Ve(e), e.visible.value = !1;
|
|
389
389
|
}, ea = async (e) => {
|
|
390
390
|
var s;
|
|
391
391
|
const t = e.page;
|
|
392
|
-
if (e.isFormSaving.value = !0,
|
|
392
|
+
if (e.isFormSaving.value = !0, He(e), e.beforeSave && e.beforeSave() === !1)
|
|
393
393
|
return e.isFormSaving.value = !1, Promise.resolve();
|
|
394
|
-
if (e.formRules.value && await
|
|
394
|
+
if (e.formRules.value && await ue(e), e.ruleResults.value)
|
|
395
395
|
return x.error("提交表单时,验证失败!"), console.error("表单验证失败!", e.ruleResults.value), e.isFormSaving.value = !1, Promise.resolve();
|
|
396
396
|
const a = e.formData.value;
|
|
397
397
|
return Ze(
|
|
@@ -418,11 +418,11 @@ const kt = (e) => {
|
|
|
418
418
|
else if (n != null && n.msg && ((o = n == null ? void 0 : n.msg) == null ? void 0 : o.indexOf("Duplicate entry")) > -1) {
|
|
419
419
|
const l = (r = n == null ? void 0 : n.msg) == null ? void 0 : r.match(/Duplicate entry '([^']+)' for key '([^']+)'/);
|
|
420
420
|
if (l && l.length > 2 && l[1] && l[2]) {
|
|
421
|
-
const i = l[1], u = l[2].replace(/Idx_/g, "").split("_"),
|
|
422
|
-
if (
|
|
421
|
+
const i = l[1], u = l[2].replace(/Idx_/g, "").split("_"), c = e.formRules.value;
|
|
422
|
+
if (c && u.length > 0) {
|
|
423
423
|
const p = {};
|
|
424
424
|
u.forEach((m) => {
|
|
425
|
-
|
|
425
|
+
c[m] && (p[m] = [
|
|
426
426
|
{
|
|
427
427
|
field: m,
|
|
428
428
|
fieldValue: i,
|
|
@@ -443,28 +443,28 @@ const kt = (e) => {
|
|
|
443
443
|
return ia(a, { [n]: s[n] }, e.detailUrl).then((o) => {
|
|
444
444
|
e.isFormLoading.value = !1, o && aa(e, o);
|
|
445
445
|
});
|
|
446
|
-
},
|
|
446
|
+
}, Ht = (e) => {
|
|
447
447
|
const t = e.grid;
|
|
448
|
-
t && (t.rowData.value = void 0), e && (
|
|
448
|
+
t && (t.rowData.value = void 0), e && (Ve(e), e.visible && (e.visible.value = !1), setTimeout(() => {
|
|
449
449
|
e.visible.value = !0;
|
|
450
450
|
}, 1));
|
|
451
451
|
}, aa = (e, t) => {
|
|
452
|
-
|
|
452
|
+
Ve(e);
|
|
453
453
|
const a = { ...e.formData.value, ...t };
|
|
454
454
|
e.formData.value = JSON.parse(JSON.stringify(a));
|
|
455
|
-
},
|
|
456
|
-
e.formData.value = e.default ? JSON.parse(JSON.stringify(e.default)) : {},
|
|
457
|
-
},
|
|
455
|
+
}, Ve = (e) => {
|
|
456
|
+
e.formData.value = e.default ? JSON.parse(JSON.stringify(e.default)) : {}, He(e);
|
|
457
|
+
}, be = "/login/", me = [], Ha = (e) => {
|
|
458
458
|
for (const t of e) {
|
|
459
|
-
const a =
|
|
460
|
-
a !== -1 &&
|
|
459
|
+
const a = me.findIndex((s) => s.path === t.path);
|
|
460
|
+
a !== -1 && me.splice(a, 1), me.push(t), ne.addRoute(t);
|
|
461
461
|
}
|
|
462
462
|
}, ta = (e, t, a, s = "") => {
|
|
463
463
|
const n = s + (s ? "/" : "") + e.path;
|
|
464
464
|
t[n] = { ...e, parent: a }, e.children && e.children.forEach((o) => ta(o, t, e, n));
|
|
465
|
-
},
|
|
465
|
+
}, ne = $a({
|
|
466
466
|
history: Fa("/"),
|
|
467
|
-
routes:
|
|
467
|
+
routes: me
|
|
468
468
|
}), Va = (e, t) => {
|
|
469
469
|
var n, o;
|
|
470
470
|
const a = ((n = e.meta) == null ? void 0 : n.roles) ?? [], s = (o = e.meta) == null ? void 0 : o.permission;
|
|
@@ -472,9 +472,9 @@ const kt = (e) => {
|
|
|
472
472
|
return a.length === 0 && !s;
|
|
473
473
|
if (t) {
|
|
474
474
|
const r = K();
|
|
475
|
-
if (
|
|
475
|
+
if (ve.VITE_PERMISSION_MODE === "role")
|
|
476
476
|
return a.length === 0 ? !0 : r.hasRole(a);
|
|
477
|
-
if (
|
|
477
|
+
if (ve.VITE_PERMISSION_MODE === "permit") {
|
|
478
478
|
if (a.length === 0 && !s)
|
|
479
479
|
return !0;
|
|
480
480
|
let l = !1, i = !1;
|
|
@@ -482,17 +482,17 @@ const kt = (e) => {
|
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
484
|
return !1;
|
|
485
|
-
},
|
|
486
|
-
|
|
485
|
+
}, ae = f(null);
|
|
486
|
+
ne.beforeEach((e, t, a) => {
|
|
487
487
|
var l;
|
|
488
488
|
const s = e;
|
|
489
|
-
if (e.path.startsWith("/error/") || e.path.startsWith(
|
|
489
|
+
if (e.path.startsWith("/error/") || e.path.startsWith(be))
|
|
490
490
|
return a();
|
|
491
491
|
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);
|
|
492
492
|
if (e.path === "/") {
|
|
493
|
-
const i =
|
|
493
|
+
const i = U();
|
|
494
494
|
if (!i.menuLoaded) {
|
|
495
|
-
|
|
495
|
+
ae.value = {
|
|
496
496
|
to: e,
|
|
497
497
|
next: (u) => {
|
|
498
498
|
a({ path: u });
|
|
@@ -508,33 +508,33 @@ se.beforeEach((e, t, a) => {
|
|
|
508
508
|
else {
|
|
509
509
|
const i = K();
|
|
510
510
|
if (!i.isLogin)
|
|
511
|
-
a({ path:
|
|
511
|
+
a({ path: be });
|
|
512
512
|
else {
|
|
513
|
-
if (!
|
|
514
|
-
|
|
513
|
+
if (!U().menuLoaded) {
|
|
514
|
+
ae.value = {
|
|
515
515
|
to: e,
|
|
516
516
|
next: a
|
|
517
517
|
};
|
|
518
518
|
return;
|
|
519
519
|
}
|
|
520
|
-
const
|
|
520
|
+
const c = Va(s, i.isLogin);
|
|
521
521
|
a();
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
524
|
});
|
|
525
|
-
const
|
|
526
|
-
if (
|
|
527
|
-
const { to: t, next: a } =
|
|
528
|
-
|
|
525
|
+
const Ka = (e) => {
|
|
526
|
+
if (ae.value) {
|
|
527
|
+
const { to: t, next: a } = ae.value;
|
|
528
|
+
ae.value = null, t.path === "/" ? a(e) : a(t.path);
|
|
529
529
|
}
|
|
530
|
-
},
|
|
530
|
+
}, Qa = (e) => {
|
|
531
531
|
const t = Ke();
|
|
532
532
|
if (t.TabEnabled) {
|
|
533
|
-
if (
|
|
533
|
+
if (Ja(e.key, t.TabPanes))
|
|
534
534
|
return;
|
|
535
535
|
t.TabPanes.push(e);
|
|
536
536
|
}
|
|
537
|
-
},
|
|
537
|
+
}, Ja = (e, t) => t.find((a) => a.key === e), Ke = ie("pageInfo", {
|
|
538
538
|
state: () => ({
|
|
539
539
|
TabActive: "",
|
|
540
540
|
TabPanes: [],
|
|
@@ -547,7 +547,7 @@ const Ha = (e) => {
|
|
|
547
547
|
*/
|
|
548
548
|
removeTabPane(e) {
|
|
549
549
|
if (this.TabEnabled) {
|
|
550
|
-
|
|
550
|
+
U().excludeComponent(e);
|
|
551
551
|
let a = 0, s = [...this.TabPanes];
|
|
552
552
|
for (let n = 0; n < s.length; n++)
|
|
553
553
|
if (s[n].key === e) {
|
|
@@ -568,7 +568,7 @@ const Ha = (e) => {
|
|
|
568
568
|
* @returns
|
|
569
569
|
*/
|
|
570
570
|
async setTabActive(e) {
|
|
571
|
-
let a =
|
|
571
|
+
let a = U().findRoute(e);
|
|
572
572
|
if (!a) return;
|
|
573
573
|
const s = {
|
|
574
574
|
key: e,
|
|
@@ -579,31 +579,31 @@ const Ha = (e) => {
|
|
|
579
579
|
// 默认为true
|
|
580
580
|
keepAlive: !(a.meta && !a.meta.keepAlive)
|
|
581
581
|
};
|
|
582
|
-
|
|
582
|
+
Qa(s), this.TabActive = e;
|
|
583
583
|
}
|
|
584
584
|
},
|
|
585
585
|
persist: !1
|
|
586
|
-
}),
|
|
586
|
+
}), Ga = {
|
|
587
587
|
appList: {
|
|
588
588
|
api: "PLATFORM_API",
|
|
589
589
|
authorize: !0,
|
|
590
590
|
url: "/api/RCTenanetOpSrv/getApps",
|
|
591
591
|
loadingText: !1
|
|
592
592
|
}
|
|
593
|
-
},
|
|
593
|
+
}, Le = /* @__PURE__ */ new Map(), ja = (e) => {
|
|
594
594
|
const t = K(), { roles: a, permission: s } = e.meta || {};
|
|
595
595
|
if (P(a) && P(s))
|
|
596
596
|
return !0;
|
|
597
|
-
if (
|
|
597
|
+
if (ve.VITE_PERMISSION_MODE === "role")
|
|
598
598
|
return P(a) ? !0 : t.hasRole(a);
|
|
599
|
-
if (
|
|
599
|
+
if (ve.VITE_PERMISSION_MODE === "permit") {
|
|
600
600
|
let n = !1, o = !1;
|
|
601
601
|
return P(a) || (n = t.hasRole(a)), t.isAdmin() ? n : (P(s) || (o = t.hasPermit(e.path, s)), n || o);
|
|
602
602
|
}
|
|
603
603
|
return !1;
|
|
604
604
|
}, sa = (e) => e.map((t) => {
|
|
605
605
|
const a = { ...t };
|
|
606
|
-
return
|
|
606
|
+
return ja(a) ? (a.children && (a.children = sa(a.children)), a) : null;
|
|
607
607
|
}).filter(Boolean), na = (e, t = "") => {
|
|
608
608
|
for (const a of e) {
|
|
609
609
|
if (!a.children && !a.redirect) {
|
|
@@ -616,7 +616,7 @@ const Ha = (e) => {
|
|
|
616
616
|
return s;
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
|
-
},
|
|
619
|
+
}, U = ie("appInfo", {
|
|
620
620
|
state: () => ({
|
|
621
621
|
appInfo: {
|
|
622
622
|
Id: "",
|
|
@@ -650,7 +650,7 @@ const Ha = (e) => {
|
|
|
650
650
|
});
|
|
651
651
|
},
|
|
652
652
|
async getRemoteAppList() {
|
|
653
|
-
return Q(
|
|
653
|
+
return Q(Ga.appList, {
|
|
654
654
|
Query: {
|
|
655
655
|
AppCode: this.appInfo.AppCode,
|
|
656
656
|
Enabled: 1
|
|
@@ -689,7 +689,7 @@ const Ha = (e) => {
|
|
|
689
689
|
flattenRoutes: {},
|
|
690
690
|
Routes: t ?? [],
|
|
691
691
|
defaultPage: ""
|
|
692
|
-
}), (!
|
|
692
|
+
}), (!ge() || !Pa()) && (await K().getRolePermits(a.Id), this.appInfo.Routes.length && this.setAppRoutes(this.appInfo.Routes)));
|
|
693
693
|
},
|
|
694
694
|
/**
|
|
695
695
|
* 设置当前应用路由信息
|
|
@@ -710,12 +710,12 @@ const Ha = (e) => {
|
|
|
710
710
|
s.children || !s.component || (s.meta && s.meta.keepAlive === !1 ? this.ExcludeComponents.push(a) : this.CachedComponents.push(a));
|
|
711
711
|
}), K().isLogin) {
|
|
712
712
|
const a = sa(this.appInfo.Routes);
|
|
713
|
-
if (
|
|
714
|
-
if (this.menuLoaded = !0,
|
|
713
|
+
if (Ha(a), this.appInfo.defaultPage = na(a) || "", this.appInfo.defaultPage) {
|
|
714
|
+
if (this.menuLoaded = !0, M.value && M.value.mainAppPush) {
|
|
715
715
|
const s = this.formatRoute(this.appInfo.defaultPage);
|
|
716
|
-
|
|
716
|
+
M.value.mainAppPush(s);
|
|
717
717
|
}
|
|
718
|
-
|
|
718
|
+
Ka(this.appInfo.defaultPage);
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
721
|
},
|
|
@@ -734,9 +734,9 @@ const Ha = (e) => {
|
|
|
734
734
|
*/
|
|
735
735
|
push(e) {
|
|
736
736
|
this.findRoute(e) && Ke().setTabActive(e), ma(() => {
|
|
737
|
-
if (
|
|
737
|
+
if (ne.push({ path: e }), M.value && M.value.mainAppPush) {
|
|
738
738
|
const a = this.formatRoute(e);
|
|
739
|
-
|
|
739
|
+
M.value.mainAppPush(a);
|
|
740
740
|
}
|
|
741
741
|
});
|
|
742
742
|
},
|
|
@@ -755,7 +755,7 @@ const Ha = (e) => {
|
|
|
755
755
|
* @returns 组件实例
|
|
756
756
|
*/
|
|
757
757
|
cacheComponent(e, t) {
|
|
758
|
-
let a =
|
|
758
|
+
let a = Le.get(t.path);
|
|
759
759
|
if (!a)
|
|
760
760
|
if (this.CachedComponents.includes(t.path))
|
|
761
761
|
a = {
|
|
@@ -764,7 +764,7 @@ const Ha = (e) => {
|
|
|
764
764
|
render() {
|
|
765
765
|
return _(e);
|
|
766
766
|
}
|
|
767
|
-
},
|
|
767
|
+
}, Le.set(t.path, a);
|
|
768
768
|
else return e;
|
|
769
769
|
return a;
|
|
770
770
|
},
|
|
@@ -773,7 +773,7 @@ const Ha = (e) => {
|
|
|
773
773
|
* @param path 路由地址
|
|
774
774
|
*/
|
|
775
775
|
excludeComponent(e) {
|
|
776
|
-
this.ExcludeComponents.includes(e) || this.ExcludeComponents.push(e), this.CachedComponents.splice(this.CachedComponents.indexOf(e), 1),
|
|
776
|
+
this.ExcludeComponents.includes(e) || this.ExcludeComponents.push(e), this.CachedComponents.splice(this.CachedComponents.indexOf(e), 1), Le.delete(e);
|
|
777
777
|
},
|
|
778
778
|
/**
|
|
779
779
|
* 路由路径层级查询,返回面包屑
|
|
@@ -804,7 +804,7 @@ const Ha = (e) => {
|
|
|
804
804
|
}, this.CachedComponents.splice(0, this.CachedComponents.length), this.ExcludeComponents.splice(0, this.ExcludeComponents.length), this.appList.splice(0, this.appList.length), this.menuLoaded = !1;
|
|
805
805
|
},
|
|
806
806
|
logout() {
|
|
807
|
-
this.clean(),
|
|
807
|
+
this.clean(), ne.push({ path: be + "#/" }), ge() && M.value && M.value.mainAppPush && M.value.mainAppPush(be + "#/");
|
|
808
808
|
}
|
|
809
809
|
},
|
|
810
810
|
persist: !1
|
|
@@ -826,7 +826,7 @@ const Ha = (e) => {
|
|
|
826
826
|
url: "/api/LoginSrv/logout",
|
|
827
827
|
loadingText: "正在退出..."
|
|
828
828
|
}
|
|
829
|
-
},
|
|
829
|
+
}, qa = (e) => {
|
|
830
830
|
let t = {
|
|
831
831
|
Option: {
|
|
832
832
|
Mode: "MicroApp"
|
|
@@ -834,40 +834,40 @@ const Ha = (e) => {
|
|
|
834
834
|
Query: e
|
|
835
835
|
};
|
|
836
836
|
return Q(Qe.login, t).then((a) => (a == null ? void 0 : a.status) === R.SUCCESS ? a : null);
|
|
837
|
-
},
|
|
837
|
+
}, Ba = (e) => {
|
|
838
838
|
let t = {
|
|
839
839
|
Query: {
|
|
840
840
|
AppId: e
|
|
841
841
|
}
|
|
842
842
|
};
|
|
843
843
|
return Q(Qe.auth, t).then((a) => (a == null ? void 0 : a.status) === R.SUCCESS ? a.data : (x.error("获取授权信息失败," + (a == null ? void 0 : a.msg)), null));
|
|
844
|
-
},
|
|
844
|
+
}, za = () => {
|
|
845
845
|
let e = {
|
|
846
846
|
Option: {},
|
|
847
847
|
Query: {}
|
|
848
848
|
};
|
|
849
849
|
return Q(Qe.logout, e).then((t) => (t == null ? void 0 : t.status) === R.SUCCESS ? t.data : null);
|
|
850
|
-
},
|
|
850
|
+
}, Ca = (e) => {
|
|
851
851
|
try {
|
|
852
852
|
const a = JSON.parse(atob(e.split(".")[1])).exp;
|
|
853
853
|
return Date.now() / 1e3 > a;
|
|
854
854
|
} catch (t) {
|
|
855
855
|
return console.error(ra, t), !0;
|
|
856
856
|
}
|
|
857
|
-
},
|
|
857
|
+
}, $e = (e, t) => e == "" ? (x.error(ze, {
|
|
858
858
|
duration: 3e3,
|
|
859
859
|
onClose: t
|
|
860
|
-
}), !1) :
|
|
860
|
+
}), !1) : Ca(e) ? (x.error(ze, {
|
|
861
861
|
duration: 3e3,
|
|
862
862
|
onClose: t
|
|
863
|
-
}), !1) : !0,
|
|
863
|
+
}), !1) : !0, Wa = (e) => {
|
|
864
864
|
try {
|
|
865
865
|
const t = JSON.parse(atob(e.token.split(".")[1]));
|
|
866
866
|
return t.user = JSON.parse(t.user), e.UserInfo = t.user, !0;
|
|
867
867
|
} catch (t) {
|
|
868
868
|
return console.error(ra, t), !1;
|
|
869
869
|
}
|
|
870
|
-
}, k =
|
|
870
|
+
}, k = f(""), X = f(null), K = ie("userInfo", {
|
|
871
871
|
state: () => ({
|
|
872
872
|
isLogin: !1,
|
|
873
873
|
userInfo: {
|
|
@@ -885,7 +885,7 @@ const Ha = (e) => {
|
|
|
885
885
|
* 启动时初始化用户信息
|
|
886
886
|
*/
|
|
887
887
|
init() {
|
|
888
|
-
|
|
888
|
+
ge() || (this.token ? ($e(this.token, () => this.clean()), de(this.token), k.value = this.userInfo.UserLevel, this.isLogin = !0) : this.clean());
|
|
889
889
|
},
|
|
890
890
|
/**
|
|
891
891
|
* 登录操作
|
|
@@ -893,14 +893,14 @@ const Ha = (e) => {
|
|
|
893
893
|
* @returns
|
|
894
894
|
*/
|
|
895
895
|
async login(e, t) {
|
|
896
|
-
const a = await
|
|
896
|
+
const a = await qa(e);
|
|
897
897
|
if (a) {
|
|
898
898
|
const s = a;
|
|
899
899
|
if (s.errno)
|
|
900
900
|
return s;
|
|
901
901
|
{
|
|
902
902
|
const n = a.data;
|
|
903
|
-
if (this.token = n.token,
|
|
903
|
+
if (this.token = n.token, de(this.token), this.isLogin = !0, Wa(n))
|
|
904
904
|
this.userInfo = {
|
|
905
905
|
...this.userInfo,
|
|
906
906
|
...n.UserInfo
|
|
@@ -909,7 +909,7 @@ const Ha = (e) => {
|
|
|
909
909
|
x.error("用户信息解析失败");
|
|
910
910
|
return;
|
|
911
911
|
}
|
|
912
|
-
t &&
|
|
912
|
+
t && U().toDefaultApp();
|
|
913
913
|
}
|
|
914
914
|
}
|
|
915
915
|
},
|
|
@@ -921,11 +921,11 @@ const Ha = (e) => {
|
|
|
921
921
|
async getRolePermits(e) {
|
|
922
922
|
if (!this.isLogin || !this.token)
|
|
923
923
|
return !1;
|
|
924
|
-
if (
|
|
924
|
+
if (X.value && X.value.appId === e)
|
|
925
925
|
return !0;
|
|
926
926
|
try {
|
|
927
|
-
const t = await
|
|
928
|
-
return t ? (
|
|
927
|
+
const t = await Ba(e);
|
|
928
|
+
return t ? (X.value = {
|
|
929
929
|
appId: e,
|
|
930
930
|
permits: t.permits || [],
|
|
931
931
|
lastTime: t.lastTime
|
|
@@ -950,7 +950,7 @@ const Ha = (e) => {
|
|
|
950
950
|
*/
|
|
951
951
|
hasPermit(e, t) {
|
|
952
952
|
var s;
|
|
953
|
-
const a =
|
|
953
|
+
const a = X.value;
|
|
954
954
|
return !a || !a.permits ? !1 : ((s = a.permits[e]) == null ? void 0 : s.includes(t)) ?? !1;
|
|
955
955
|
},
|
|
956
956
|
/**
|
|
@@ -967,21 +967,21 @@ const Ha = (e) => {
|
|
|
967
967
|
* @param token 用户Token
|
|
968
968
|
*/
|
|
969
969
|
setUserInfo(e, t) {
|
|
970
|
-
if (
|
|
970
|
+
if (!$e(t)) {
|
|
971
971
|
this.clean();
|
|
972
972
|
return;
|
|
973
973
|
}
|
|
974
974
|
k.value || (k.value = e.UserLevel, this.userInfo = {
|
|
975
975
|
...this.userInfo,
|
|
976
976
|
...e
|
|
977
|
-
}, this.token = t,
|
|
977
|
+
}, this.token = t, de(this.token), this.isLogin = !0);
|
|
978
978
|
},
|
|
979
979
|
/**
|
|
980
980
|
* 获取用户Token
|
|
981
981
|
* @returns 用户Token
|
|
982
982
|
*/
|
|
983
983
|
getToken() {
|
|
984
|
-
return
|
|
984
|
+
return $e(this.token, () => {
|
|
985
985
|
this.clean(), this.logout();
|
|
986
986
|
}) ? this.token : "";
|
|
987
987
|
},
|
|
@@ -1014,7 +1014,7 @@ const Ha = (e) => {
|
|
|
1014
1014
|
Code: "",
|
|
1015
1015
|
TenantId: "",
|
|
1016
1016
|
UserLevel: ""
|
|
1017
|
-
}, this.token = "",
|
|
1017
|
+
}, this.token = "", de(this.token), this.isLogin = !1, X.value = null, k.value = "", U().clean(), Promise.resolve();
|
|
1018
1018
|
},
|
|
1019
1019
|
/**
|
|
1020
1020
|
* 登出操作
|
|
@@ -1022,20 +1022,20 @@ const Ha = (e) => {
|
|
|
1022
1022
|
*/
|
|
1023
1023
|
async logout() {
|
|
1024
1024
|
try {
|
|
1025
|
-
await
|
|
1025
|
+
await za();
|
|
1026
1026
|
} catch (e) {
|
|
1027
1027
|
console.error("调用登出接口失败", e);
|
|
1028
1028
|
} finally {
|
|
1029
1029
|
await this.clean(), setTimeout(async () => {
|
|
1030
1030
|
x.success("已退出登录");
|
|
1031
1031
|
}, 1e3), setTimeout(async () => {
|
|
1032
|
-
|
|
1032
|
+
U().logout();
|
|
1033
1033
|
}, 2e3);
|
|
1034
1034
|
}
|
|
1035
1035
|
return Promise.resolve();
|
|
1036
1036
|
}
|
|
1037
1037
|
},
|
|
1038
|
-
persist:
|
|
1038
|
+
persist: ge() ? !1 : {
|
|
1039
1039
|
key: "MICROAPP_USER_INFO",
|
|
1040
1040
|
storage: localStorage,
|
|
1041
1041
|
pick: ["token", "userInfo"],
|
|
@@ -1046,18 +1046,16 @@ const Ha = (e) => {
|
|
|
1046
1046
|
}
|
|
1047
1047
|
}), Vt = (e, t) => {
|
|
1048
1048
|
const a = K();
|
|
1049
|
-
return e.filter((
|
|
1050
|
-
if (s.role && !a.hasRole(s.role) || s.permit && !a.hasPermit(se.currentRoute.value.path, s.permit))
|
|
1051
|
-
return !1;
|
|
1049
|
+
return e.filter((n) => n.role && !a.hasRole(n.role) || n.permit && !a.hasPermit(ne.currentRoute.value.path, n.permit) || n.enabled === !1 ? !1 : typeof n.enabled == "function" ? n.enabled() : !0).filter((n) => {
|
|
1052
1050
|
if (!t) {
|
|
1053
|
-
if (
|
|
1051
|
+
if (n.visible === !1)
|
|
1054
1052
|
return !1;
|
|
1055
|
-
if (typeof
|
|
1056
|
-
return
|
|
1053
|
+
if (typeof n.visible == "function")
|
|
1054
|
+
return n.visible();
|
|
1057
1055
|
}
|
|
1058
1056
|
return !0;
|
|
1059
1057
|
});
|
|
1060
|
-
},
|
|
1058
|
+
}, Kt = (e, t) => {
|
|
1061
1059
|
const a = t == null ? void 0 : t.filter((s) => {
|
|
1062
1060
|
const n = e.find(
|
|
1063
1061
|
(o) => o.dataIndex === s.dataIndex || o.key === s.key || o.title === s.title
|
|
@@ -1065,17 +1063,17 @@ const Ha = (e) => {
|
|
|
1065
1063
|
return n ? { ...s, ...n } : !1;
|
|
1066
1064
|
});
|
|
1067
1065
|
return [...a || [], ...e.filter((s) => !(a != null && a.includes(s)))];
|
|
1068
|
-
},
|
|
1066
|
+
}, Ya = (e) => (e.remotePage = !1, oa(e).then((t) => t.rows)), oa = (e) => {
|
|
1069
1067
|
e.gridQuery || (e.gridQuery = {});
|
|
1070
1068
|
const t = e.remotePage ? "find" : "list";
|
|
1071
|
-
return
|
|
1069
|
+
return De(e, {
|
|
1072
1070
|
urlKey: t,
|
|
1073
1071
|
url: e.gridUrl,
|
|
1074
1072
|
params: e.gridQuery,
|
|
1075
1073
|
loadingState: e.isGridLoading,
|
|
1076
1074
|
processParams: (a) => {
|
|
1077
1075
|
var n;
|
|
1078
|
-
return e.remotePage && (a.Query.$limit = [(e.pageNo.value - 1) * e.pageSize.value, e.pageSize.value]),
|
|
1076
|
+
return e.remotePage && (a.Query.$limit = [(e.pageNo.value - 1) * e.pageSize.value, e.pageSize.value]), Ee((n = e.gridUrl) == null ? void 0 : n.params, a, e.gridQuery);
|
|
1079
1077
|
}
|
|
1080
1078
|
}).then((a) => {
|
|
1081
1079
|
if ((a == null ? void 0 : a.status) === R.SUCCESS) {
|
|
@@ -1090,7 +1088,7 @@ const Ha = (e) => {
|
|
|
1090
1088
|
rows: []
|
|
1091
1089
|
};
|
|
1092
1090
|
});
|
|
1093
|
-
},
|
|
1091
|
+
}, Xa = (e, t, a = {}) => Ze(e, {
|
|
1094
1092
|
urlKey: "update",
|
|
1095
1093
|
url: e.updateUrl,
|
|
1096
1094
|
params: {
|
|
@@ -1101,37 +1099,37 @@ const Ha = (e) => {
|
|
|
1101
1099
|
...a
|
|
1102
1100
|
}).then((s) => ((s == null ? void 0 : s.status) === R.SUCCESS && setTimeout(() => {
|
|
1103
1101
|
e.reload.value = !0, e.afterUpdate && e.afterUpdate(t);
|
|
1104
|
-
}, 50), s)),
|
|
1102
|
+
}, 50), s)), Qt = (e, t) => {
|
|
1105
1103
|
const a = {};
|
|
1106
|
-
return a[e.primaryKey] = t[e.primaryKey], a[e.statusKey] = t[e.statusKey],
|
|
1104
|
+
return a[e.primaryKey] = t[e.primaryKey], a[e.statusKey] = t[e.statusKey], Xa(e, a, {
|
|
1107
1105
|
loadingText: !1,
|
|
1108
1106
|
hideErrorToast: !0
|
|
1109
1107
|
});
|
|
1110
|
-
}, ia = async (e, t, a) => await
|
|
1108
|
+
}, ia = async (e, t, a) => await De(e, {
|
|
1111
1109
|
urlKey: "detail",
|
|
1112
1110
|
url: a,
|
|
1113
1111
|
params: t,
|
|
1114
1112
|
loadingState: e.isGridLoading
|
|
1115
|
-
}),
|
|
1113
|
+
}), Jt = (e, t) => {
|
|
1116
1114
|
const a = t;
|
|
1117
1115
|
return ia(e, { [e.primaryKey]: a[e.primaryKey] }).then((s) => ((s == null ? void 0 : s.status) === R.SUCCESS && s.data && (e.expandRows.value[a[e.primaryKey]] = s), s));
|
|
1118
|
-
},
|
|
1116
|
+
}, Gt = (e, t) => {
|
|
1119
1117
|
let a = e.editor;
|
|
1120
1118
|
e.rowData.value = t, a && (aa(a, t), a.visible.value = !0);
|
|
1121
|
-
},
|
|
1119
|
+
}, jt = (e, t) => Na(e, t, {
|
|
1122
1120
|
url: e.deleteUrl,
|
|
1123
1121
|
primaryKey: e.primaryKey
|
|
1124
1122
|
}).then((a) => ((a == null ? void 0 : a.status) === R.SUCCESS && setTimeout(() => {
|
|
1125
1123
|
e.reload.value = !0, e.afterDelete && !Array.isArray(t) && e.afterDelete(t);
|
|
1126
1124
|
}, 50), a));
|
|
1127
|
-
var
|
|
1128
|
-
class
|
|
1125
|
+
var Me = /* @__PURE__ */ ((e) => (e.SelectReload = "Select.Reload", e.RadioReload = "Radio.Reload", e.CheckboxReload = "Checkbox.Reload", e.TreeSelectReload = "TreeSelect.Reload", e.TreeCheckReload = "TreeCheck.Reload", e))(Me || {});
|
|
1126
|
+
class Za {
|
|
1129
1127
|
constructor() {
|
|
1130
|
-
|
|
1128
|
+
$(this, "listeners", {});
|
|
1131
1129
|
}
|
|
1132
1130
|
// 检查事件名是否符合前缀
|
|
1133
1131
|
isValidPrefix(t) {
|
|
1134
|
-
return Object.values(
|
|
1132
|
+
return Object.values(Me).some((a) => t.startsWith(a + "."));
|
|
1135
1133
|
}
|
|
1136
1134
|
/**
|
|
1137
1135
|
* 事件订阅
|
|
@@ -1140,7 +1138,7 @@ class Xa {
|
|
|
1140
1138
|
*/
|
|
1141
1139
|
on(t, a) {
|
|
1142
1140
|
if (!this.isValidPrefix(t)) {
|
|
1143
|
-
console.error(`事件前缀不正确: ${t}, 事件名必须以 ${Object.values(
|
|
1141
|
+
console.error(`事件前缀不正确: ${t}, 事件名必须以 ${Object.values(Me).join(", ")} 开头`);
|
|
1144
1142
|
return;
|
|
1145
1143
|
}
|
|
1146
1144
|
this.listeners[t] || (this.listeners[t] = []), this.listeners[t].push(a);
|
|
@@ -1171,11 +1169,11 @@ class Xa {
|
|
|
1171
1169
|
this.listeners[t] && this.listeners[t].forEach((s) => s(t, ...a));
|
|
1172
1170
|
}
|
|
1173
1171
|
}
|
|
1174
|
-
const j = new
|
|
1172
|
+
const j = new Za(), Y = (e, t, a) => {
|
|
1175
1173
|
if (t.inputFactory && (a != null && a.reloadEvent)) {
|
|
1176
1174
|
const s = t.inputFactory.value;
|
|
1177
1175
|
s.reloadHandler = (n, o) => {
|
|
1178
|
-
|
|
1176
|
+
et(t.url, t, o);
|
|
1179
1177
|
}, j.on(a.reloadEvent, s.reloadHandler);
|
|
1180
1178
|
}
|
|
1181
1179
|
if (a != null && a.data)
|
|
@@ -1189,7 +1187,7 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1189
1187
|
else if (t.url && t.url.url)
|
|
1190
1188
|
e && la(t.url, t, t.params ?? {});
|
|
1191
1189
|
else {
|
|
1192
|
-
const s =
|
|
1190
|
+
const s = f(ee(N.LabelText, ""));
|
|
1193
1191
|
x.error("`" + s.value + "` 未配置选项数据!", {
|
|
1194
1192
|
duration: 5e3
|
|
1195
1193
|
});
|
|
@@ -1199,23 +1197,23 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1199
1197
|
const s = {
|
|
1200
1198
|
...e.fieldMap
|
|
1201
1199
|
};
|
|
1202
|
-
t =
|
|
1200
|
+
t = ka(s, t);
|
|
1203
1201
|
}
|
|
1204
1202
|
t = JSON.parse(JSON.stringify(t ?? [])), e.all && t.unshift({
|
|
1205
1203
|
label: "全部",
|
|
1206
1204
|
value: e.allValue ?? void 0
|
|
1207
1205
|
}), e.options.value = t;
|
|
1208
|
-
},
|
|
1206
|
+
}, et = (e, t, a) => {
|
|
1209
1207
|
Array.isArray(a) ? Je(t, a, !0) : la(e, t, a);
|
|
1210
|
-
},
|
|
1208
|
+
}, ce = (e, t) => {
|
|
1211
1209
|
var a;
|
|
1212
1210
|
(a = e.inputFactory) != null && a.value && t.reloadEvent && e.inputFactory.value.reloadHandler && j.off(t.reloadEvent, e.inputFactory.value.reloadHandler);
|
|
1213
1211
|
}, la = (e, t, a) => {
|
|
1214
|
-
const s = JSON.parse(JSON.stringify(e.params ?? {})), n = JSON.parse(JSON.stringify(t.params ?? {})), o =
|
|
1215
|
-
|
|
1212
|
+
const s = JSON.parse(JSON.stringify(e.params ?? {})), n = JSON.parse(JSON.stringify(t.params ?? {})), o = Ee(s, n, a);
|
|
1213
|
+
at(e, t, t.fieldMap, o).then((r) => {
|
|
1216
1214
|
Je(t, r, !1);
|
|
1217
1215
|
});
|
|
1218
|
-
},
|
|
1216
|
+
}, at = (e, t, a, s) => {
|
|
1219
1217
|
const { fieldMap: n, ...o } = e, l = {
|
|
1220
1218
|
...{
|
|
1221
1219
|
url: "",
|
|
@@ -1230,10 +1228,27 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1230
1228
|
return l.loadingText = !1, s || (s = {}), s.Query || (s.Query = {}), t.optionQuery = s, t.isOptionLoading.value = !0, Q(l, s).then((i) => (i == null ? void 0 : i.status) === R.SUCCESS && i.data ? i.data : []).finally(() => {
|
|
1231
1229
|
t.isOptionLoading.value = !1;
|
|
1232
1230
|
});
|
|
1233
|
-
},
|
|
1234
|
-
if (e
|
|
1235
|
-
|
|
1236
|
-
|
|
1231
|
+
}, tt = (e, t, a) => {
|
|
1232
|
+
if (e === void 0) return;
|
|
1233
|
+
const s = (o) => {
|
|
1234
|
+
const r = { ...o };
|
|
1235
|
+
return a && o.children && o.children.length > 0 ? r.children = o.children.map((l) => s(l)) : delete r.children, r;
|
|
1236
|
+
}, n = (o, r) => {
|
|
1237
|
+
const l = [];
|
|
1238
|
+
for (const i of r)
|
|
1239
|
+
if (o.includes(i.value) && l.push(s(i)), i.children && i.children.length > 0) {
|
|
1240
|
+
const u = n(o, i.children);
|
|
1241
|
+
l.push(...u);
|
|
1242
|
+
}
|
|
1243
|
+
return l;
|
|
1244
|
+
};
|
|
1245
|
+
if (Array.isArray(e))
|
|
1246
|
+
return n(e, t);
|
|
1247
|
+
{
|
|
1248
|
+
const o = n([e], t);
|
|
1249
|
+
return o.length > 0 ? o[0] : void 0;
|
|
1250
|
+
}
|
|
1251
|
+
}, Te = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((t) => t.label) : [e.label], Z = (e, t, a) => {
|
|
1237
1252
|
const s = t.split(".");
|
|
1238
1253
|
let n = e;
|
|
1239
1254
|
for (let o = 0; o < s.length - 1; o++) {
|
|
@@ -1244,42 +1259,57 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1244
1259
|
}, ua = (e, t, a) => {
|
|
1245
1260
|
if (a == null) {
|
|
1246
1261
|
Object.entries(t).forEach(([s]) => {
|
|
1247
|
-
|
|
1262
|
+
Z(e, s, a);
|
|
1248
1263
|
});
|
|
1249
1264
|
return;
|
|
1250
1265
|
}
|
|
1251
|
-
Array.isArray(a)
|
|
1266
|
+
Array.isArray(a) ? Object.entries(t).forEach(([s, n]) => {
|
|
1267
|
+
var r;
|
|
1268
|
+
if (/^\$\{\d+\}/.test(n))
|
|
1269
|
+
try {
|
|
1270
|
+
const l = parseInt(((r = n.match(/\$\{(\d+)\}/)) == null ? void 0 : r[1]) ?? "0"), i = a[l], u = n.replace(/\$\{\d+\}\./, "");
|
|
1271
|
+
if (u && i) {
|
|
1272
|
+
const c = ye(u, i);
|
|
1273
|
+
Z(e, s, c);
|
|
1274
|
+
} else
|
|
1275
|
+
Z(e, s, i);
|
|
1276
|
+
} catch {
|
|
1277
|
+
console.error("outFields 格式错误:" + n, "必须是 ${index} 或者 ${index}.${key}");
|
|
1278
|
+
}
|
|
1279
|
+
else
|
|
1280
|
+
console.error("outFields 格式错误:" + n, "必须是 ${index} 或者 ${index}.${key}");
|
|
1281
|
+
}) : Object.entries(t).forEach(([s, n]) => {
|
|
1252
1282
|
if (n.includes("${")) {
|
|
1253
|
-
const o =
|
|
1254
|
-
|
|
1283
|
+
const o = ye(n, a);
|
|
1284
|
+
Z(e, s, o);
|
|
1255
1285
|
} else
|
|
1256
|
-
|
|
1286
|
+
Z(e, s, a[n]);
|
|
1257
1287
|
});
|
|
1258
|
-
},
|
|
1288
|
+
}, we = (e, t, a) => {
|
|
1259
1289
|
var o, r;
|
|
1260
1290
|
const s = (o = e.inputFactory) == null ? void 0 : o.value;
|
|
1261
|
-
s != null && s.editorCtrl && ((r = s.errInfo) != null && r.value.errClass) &&
|
|
1262
|
-
const n =
|
|
1291
|
+
s != null && s.editorCtrl && ((r = s.errInfo) != null && r.value.errClass) && ue(s.editorCtrl), e.selected.value = a;
|
|
1292
|
+
const n = tt(a, e.options.value);
|
|
1263
1293
|
if (e.selectedOptions.value = n, t.formData && t.outFields && ua(t.formData, t.outFields, n), t.changeEvent) {
|
|
1264
1294
|
const [l, i] = t.changeEvent;
|
|
1265
1295
|
if (i)
|
|
1266
1296
|
if (Array.isArray(l))
|
|
1267
1297
|
l.every((u) => {
|
|
1268
|
-
const
|
|
1298
|
+
const c = ye(i, { selectedValues: a });
|
|
1269
1299
|
try {
|
|
1270
|
-
const p = JSON.parse(
|
|
1300
|
+
const p = JSON.parse(c);
|
|
1271
1301
|
j.emit(u, p, a, n);
|
|
1272
1302
|
} catch (p) {
|
|
1273
|
-
console.error("eventParamsValue: ",
|
|
1303
|
+
console.error("eventParamsValue: ", c, p);
|
|
1274
1304
|
}
|
|
1275
1305
|
});
|
|
1276
1306
|
else {
|
|
1277
|
-
const u =
|
|
1307
|
+
const u = ye(i, { selectedValues: a });
|
|
1278
1308
|
try {
|
|
1279
|
-
const
|
|
1280
|
-
j.emit(l,
|
|
1281
|
-
} catch (
|
|
1282
|
-
console.error("eventParamsValue: ", u,
|
|
1309
|
+
const c = JSON.parse(u);
|
|
1310
|
+
j.emit(l, c, a, n);
|
|
1311
|
+
} catch (c) {
|
|
1312
|
+
console.error("eventParamsValue: ", u, c);
|
|
1283
1313
|
}
|
|
1284
1314
|
}
|
|
1285
1315
|
else
|
|
@@ -1288,7 +1318,7 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1288
1318
|
}) : j.emit(l, n, a);
|
|
1289
1319
|
}
|
|
1290
1320
|
return s != null && s.inputEmit && s.inputEmit("change", a, n), n;
|
|
1291
|
-
},
|
|
1321
|
+
}, y = {
|
|
1292
1322
|
PageOption: {
|
|
1293
1323
|
primaryKey: "Id",
|
|
1294
1324
|
statusKey: "Enabled"
|
|
@@ -1298,12 +1328,12 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1298
1328
|
primaryKey: "Id",
|
|
1299
1329
|
statusKey: "Enabled",
|
|
1300
1330
|
remotePage: !0,
|
|
1301
|
-
tableSize:
|
|
1302
|
-
selectable:
|
|
1303
|
-
searchBar:
|
|
1304
|
-
pageSize:
|
|
1305
|
-
rowExpand:
|
|
1306
|
-
buttons:
|
|
1331
|
+
tableSize: f("small"),
|
|
1332
|
+
selectable: f(!1),
|
|
1333
|
+
searchBar: f(!0),
|
|
1334
|
+
pageSize: f(10),
|
|
1335
|
+
rowExpand: f(!1),
|
|
1336
|
+
buttons: f(["New"]),
|
|
1307
1337
|
tools: ["Reload", "RowHeight", "TableHeadset"],
|
|
1308
1338
|
operates: ["Edit", "Delete"]
|
|
1309
1339
|
},
|
|
@@ -1326,7 +1356,7 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1326
1356
|
value: "Id"
|
|
1327
1357
|
}
|
|
1328
1358
|
}
|
|
1329
|
-
},
|
|
1359
|
+
}, qt = (e) => {
|
|
1330
1360
|
y.PageOption = {
|
|
1331
1361
|
...y.PageOption,
|
|
1332
1362
|
...e.pageOption
|
|
@@ -1340,46 +1370,46 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1340
1370
|
...y.TreeOption,
|
|
1341
1371
|
...e.treeOption
|
|
1342
1372
|
};
|
|
1343
|
-
},
|
|
1373
|
+
}, st = (e, t, a, s) => ({
|
|
1344
1374
|
editorCtrl: {
|
|
1345
1375
|
...y.EditorOption,
|
|
1346
1376
|
name: "",
|
|
1347
1377
|
default: a ? JSON.parse(JSON.stringify(a)) : void 0,
|
|
1348
|
-
visible:
|
|
1378
|
+
visible: f(!1),
|
|
1349
1379
|
page: t,
|
|
1350
|
-
formData:
|
|
1351
|
-
formRules:
|
|
1352
|
-
ruleResults:
|
|
1353
|
-
updateData:
|
|
1380
|
+
formData: f(a ? JSON.parse(JSON.stringify(a)) : void 0),
|
|
1381
|
+
formRules: f(s),
|
|
1382
|
+
ruleResults: f({}),
|
|
1383
|
+
updateData: f(void 0),
|
|
1354
1384
|
saveUrl: e.urls.save,
|
|
1355
1385
|
detailUrl: e.urls.detail,
|
|
1356
|
-
isFormSaving:
|
|
1357
|
-
isFormLoading:
|
|
1386
|
+
isFormSaving: f(!1),
|
|
1387
|
+
isFormLoading: f(!1)
|
|
1358
1388
|
}
|
|
1359
|
-
}),
|
|
1389
|
+
}), nt = (e, t, a) => {
|
|
1360
1390
|
const s = {
|
|
1361
1391
|
...y.GridOption,
|
|
1362
|
-
tableSize:
|
|
1363
|
-
selectable:
|
|
1364
|
-
searchBar:
|
|
1365
|
-
pageSize:
|
|
1366
|
-
rowExpand:
|
|
1367
|
-
buttons:
|
|
1392
|
+
tableSize: f(y.GridOption.tableSize.value),
|
|
1393
|
+
selectable: f(y.GridOption.selectable.value),
|
|
1394
|
+
searchBar: f(y.GridOption.searchBar.value),
|
|
1395
|
+
pageSize: f(y.GridOption.pageSize.value),
|
|
1396
|
+
rowExpand: f(y.GridOption.rowExpand.value),
|
|
1397
|
+
buttons: f([...y.GridOption.buttons.value]),
|
|
1368
1398
|
tools: [...y.GridOption.tools],
|
|
1369
1399
|
operates: [...y.GridOption.operates],
|
|
1370
|
-
columns:
|
|
1371
|
-
reload:
|
|
1372
|
-
pageNo:
|
|
1373
|
-
total:
|
|
1400
|
+
columns: f(a || []),
|
|
1401
|
+
reload: f(!1),
|
|
1402
|
+
pageNo: f(1),
|
|
1403
|
+
total: f(0),
|
|
1374
1404
|
page: t,
|
|
1375
|
-
selectKeys:
|
|
1376
|
-
selectRows:
|
|
1377
|
-
rowData:
|
|
1405
|
+
selectKeys: f([]),
|
|
1406
|
+
selectRows: f([]),
|
|
1407
|
+
rowData: f(void 0),
|
|
1378
1408
|
gridQuery: {},
|
|
1379
|
-
tableData:
|
|
1380
|
-
expandRows:
|
|
1381
|
-
isGridLoading:
|
|
1382
|
-
isGridSaving:
|
|
1409
|
+
tableData: H(void 0),
|
|
1410
|
+
expandRows: f({}),
|
|
1411
|
+
isGridLoading: f(!1),
|
|
1412
|
+
isGridSaving: f(!1),
|
|
1383
1413
|
gridUrl: e.urls.list || e.urls.find,
|
|
1384
1414
|
updateUrl: e.urls.update,
|
|
1385
1415
|
deleteUrl: e.urls.delete
|
|
@@ -1389,73 +1419,73 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1389
1419
|
(n) => {
|
|
1390
1420
|
n && (setTimeout(() => {
|
|
1391
1421
|
s.reload.value = !1;
|
|
1392
|
-
}, 1), s.remotePage ? oa(s) :
|
|
1422
|
+
}, 1), s.remotePage ? oa(s) : Ya(s));
|
|
1393
1423
|
}
|
|
1394
1424
|
), {
|
|
1395
1425
|
gridCtrl: s
|
|
1396
1426
|
};
|
|
1397
|
-
},
|
|
1427
|
+
}, Bt = (e, t) => {
|
|
1398
1428
|
const a = {
|
|
1399
1429
|
...y.TreeOption,
|
|
1400
|
-
reload:
|
|
1430
|
+
reload: f(!1),
|
|
1401
1431
|
page: t,
|
|
1402
|
-
node:
|
|
1432
|
+
node: f(void 0),
|
|
1403
1433
|
url: e.urls.tree,
|
|
1404
|
-
data:
|
|
1405
|
-
isTreeLoading:
|
|
1434
|
+
data: H(void 0),
|
|
1435
|
+
isTreeLoading: f(!1)
|
|
1406
1436
|
};
|
|
1407
1437
|
return I(
|
|
1408
1438
|
() => a.reload.value,
|
|
1409
1439
|
(s) => {
|
|
1410
1440
|
s && (setTimeout(() => {
|
|
1411
1441
|
a.reload.value = !1;
|
|
1412
|
-
}, 1),
|
|
1442
|
+
}, 1), _a(a));
|
|
1413
1443
|
}
|
|
1414
1444
|
), {
|
|
1415
1445
|
treeCtrl: a
|
|
1416
1446
|
};
|
|
1417
|
-
},
|
|
1447
|
+
}, fe = (e, t) => {
|
|
1418
1448
|
const a = {
|
|
1419
1449
|
...y.OptionOption,
|
|
1420
1450
|
url: e,
|
|
1421
|
-
reload:
|
|
1451
|
+
reload: f(!1),
|
|
1422
1452
|
optionQuery: {},
|
|
1423
|
-
data:
|
|
1424
|
-
selected:
|
|
1425
|
-
selectedOptions:
|
|
1426
|
-
options:
|
|
1427
|
-
isOptionLoading:
|
|
1453
|
+
data: H([]),
|
|
1454
|
+
selected: f([]),
|
|
1455
|
+
selectedOptions: f([]),
|
|
1456
|
+
options: f([]),
|
|
1457
|
+
isOptionLoading: f(!1)
|
|
1428
1458
|
};
|
|
1429
1459
|
return I(
|
|
1430
1460
|
() => a.reload.value,
|
|
1431
1461
|
(s) => {
|
|
1432
1462
|
s && (setTimeout(() => {
|
|
1433
1463
|
a.reload.value = !1;
|
|
1434
|
-
}, 1),
|
|
1464
|
+
}, 1), Y(!0, a, t));
|
|
1435
1465
|
}
|
|
1436
1466
|
), {
|
|
1437
1467
|
optionCtrl: a
|
|
1438
1468
|
};
|
|
1439
|
-
},
|
|
1469
|
+
}, zt = (e, t, a) => {
|
|
1440
1470
|
for (const r in e.urls)
|
|
1441
1471
|
e.urls[r] && (e.urls[r].api || (e.urls[r].api = e.api), e.urls[r].authorize === void 0 && (e.urls[r].authorize = e.authorize));
|
|
1442
1472
|
const s = {
|
|
1443
1473
|
...y.PageOption,
|
|
1444
1474
|
...e
|
|
1445
|
-
}, { editorCtrl: n } =
|
|
1475
|
+
}, { editorCtrl: n } = st(e, s, t, a), { gridCtrl: o } = nt(e, s);
|
|
1446
1476
|
return s.editor = n, s.grid = o, o.editor = n, o.tools = ["Reload", "RowHeight", "TableHeadset", "Fullscreen"], n.grid = o, {
|
|
1447
1477
|
pageCtrl: s,
|
|
1448
1478
|
editorCtrl: n,
|
|
1449
1479
|
gridCtrl: o
|
|
1450
1480
|
};
|
|
1451
|
-
},
|
|
1481
|
+
}, rt = 7 * 24 * 60 * 60 * 1e3, Fe = /* @__PURE__ */ new Map(), Ce = /* @__PURE__ */ new Set(), V = f({}), Ct = V, Wt = (e) => {
|
|
1452
1482
|
var n;
|
|
1453
1483
|
if (!e.iconUrl) return Ne;
|
|
1454
|
-
const t =
|
|
1484
|
+
const t = f(!0), a = f("");
|
|
1455
1485
|
let s = !0;
|
|
1456
|
-
return (n = e.icons) != null && n.length && (s = e.icons.every((o) => V.value[o] !== void 0)), (e.icon && !V.value[e.icon] || !s) &&
|
|
1457
|
-
|
|
1458
|
-
}),
|
|
1486
|
+
return (n = e.icons) != null && n.length && (s = e.icons.every((o) => V.value[o] !== void 0)), (e.icon && !V.value[e.icon] || !s) && ot(e, t).then(() => {
|
|
1487
|
+
ut(e.iconUrl, e.monoColor || !1), t.value = !0;
|
|
1488
|
+
}), W({
|
|
1459
1489
|
props: {
|
|
1460
1490
|
icon: {
|
|
1461
1491
|
type: String
|
|
@@ -1482,33 +1512,33 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1482
1512
|
},
|
|
1483
1513
|
emits: ["update:iconIndex"],
|
|
1484
1514
|
setup(o, { emit: r }) {
|
|
1485
|
-
const l =
|
|
1515
|
+
const l = f(o.icon), i = f(0), u = () => {
|
|
1486
1516
|
o.icons && i.value++;
|
|
1487
1517
|
};
|
|
1488
1518
|
return I(
|
|
1489
1519
|
() => o.iconIndex,
|
|
1490
|
-
(
|
|
1491
|
-
|
|
1520
|
+
(c) => {
|
|
1521
|
+
c !== void 0 && (i.value = c);
|
|
1492
1522
|
},
|
|
1493
1523
|
{ immediate: !0 }
|
|
1494
1524
|
), I(
|
|
1495
1525
|
() => i.value,
|
|
1496
|
-
(
|
|
1497
|
-
o.icons && (
|
|
1526
|
+
(c) => {
|
|
1527
|
+
o.icons && (c >= o.icons.length && (i.value = 0), l.value = o.icons[i.value], he(a, l, l.value), r("update:iconIndex", i.value));
|
|
1498
1528
|
},
|
|
1499
1529
|
{ immediate: !0 }
|
|
1500
1530
|
), I(
|
|
1501
1531
|
() => V.value,
|
|
1502
1532
|
() => {
|
|
1503
|
-
|
|
1533
|
+
he(a, l, l.value);
|
|
1504
1534
|
},
|
|
1505
1535
|
{ deep: !0 }
|
|
1506
1536
|
), I(
|
|
1507
1537
|
() => o.icon,
|
|
1508
|
-
(
|
|
1509
|
-
|
|
1538
|
+
(c) => {
|
|
1539
|
+
he(a, l, c);
|
|
1510
1540
|
}
|
|
1511
|
-
),
|
|
1541
|
+
), he(a, l, l.value), { isLoaded: t, Icon: a, handleClick: u };
|
|
1512
1542
|
},
|
|
1513
1543
|
render() {
|
|
1514
1544
|
if (!t.value)
|
|
@@ -1522,12 +1552,12 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1522
1552
|
style: {
|
|
1523
1553
|
fill: "currentColor",
|
|
1524
1554
|
cursor: this.$props.clickable ? "pointer" : "default",
|
|
1525
|
-
transform:
|
|
1555
|
+
transform: ft(this.angle, this.flip)
|
|
1526
1556
|
}
|
|
1527
1557
|
}) : _("div", { class: "w-[14px] h-[14px]" });
|
|
1528
1558
|
}
|
|
1529
1559
|
});
|
|
1530
|
-
},
|
|
1560
|
+
}, ot = (e, t) => {
|
|
1531
1561
|
let a = e.iconUrl;
|
|
1532
1562
|
if (!a)
|
|
1533
1563
|
return console.error("图标库地址不能为空"), Promise.resolve();
|
|
@@ -1538,10 +1568,10 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1538
1568
|
return new Promise(async (o) => (ca(s.scriptContent), o()));
|
|
1539
1569
|
t.value = !1;
|
|
1540
1570
|
const n = new Promise(async (o) => {
|
|
1541
|
-
await
|
|
1571
|
+
await it(a, e.monoColor || !1), o(), Fe.delete(a);
|
|
1542
1572
|
});
|
|
1543
1573
|
return Fe.set(a, n), n;
|
|
1544
|
-
},
|
|
1574
|
+
}, it = async (e, t) => {
|
|
1545
1575
|
try {
|
|
1546
1576
|
const a = await fetch(e);
|
|
1547
1577
|
if (!a.ok) {
|
|
@@ -1554,7 +1584,7 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1554
1584
|
const o = s.match(n);
|
|
1555
1585
|
if (o && o.length > 1) {
|
|
1556
1586
|
let r = o[1];
|
|
1557
|
-
|
|
1587
|
+
lt(e, r, t, s);
|
|
1558
1588
|
}
|
|
1559
1589
|
ca(s);
|
|
1560
1590
|
return;
|
|
@@ -1564,13 +1594,13 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1564
1594
|
}, ca = (e) => {
|
|
1565
1595
|
const t = document.createElement("script");
|
|
1566
1596
|
t.textContent = e, document.head.appendChild(t);
|
|
1567
|
-
},
|
|
1597
|
+
}, lt = (e, t, a, s) => {
|
|
1568
1598
|
let n = `icon_cache:${e}`;
|
|
1569
1599
|
const o = {
|
|
1570
1600
|
windowKey: t,
|
|
1571
1601
|
monoColor: a,
|
|
1572
1602
|
scriptContent: s,
|
|
1573
|
-
expireTime: Date.now() +
|
|
1603
|
+
expireTime: Date.now() + rt
|
|
1574
1604
|
// 缓存时间:7天
|
|
1575
1605
|
};
|
|
1576
1606
|
localStorage.setItem(n, JSON.stringify(o));
|
|
@@ -1585,14 +1615,14 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1585
1615
|
return console.error("解析缓存失败:", n), null;
|
|
1586
1616
|
}
|
|
1587
1617
|
return s.expireTime < Date.now() ? (localStorage.removeItem(e), null) : s;
|
|
1588
|
-
},
|
|
1618
|
+
}, Yt = () => {
|
|
1589
1619
|
const e = Date.now();
|
|
1590
1620
|
for (const t in localStorage)
|
|
1591
1621
|
if (t.startsWith("icon_cache:")) {
|
|
1592
1622
|
const a = localStorage.getItem(t);
|
|
1593
1623
|
a && JSON.parse(a).expireTime < e && localStorage.removeItem(t);
|
|
1594
1624
|
}
|
|
1595
|
-
},
|
|
1625
|
+
}, he = (e, t, a) => {
|
|
1596
1626
|
setTimeout(() => {
|
|
1597
1627
|
t.value = a, t.value && (e.value = V.value[t.value]);
|
|
1598
1628
|
}, 1);
|
|
@@ -1616,26 +1646,26 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1616
1646
|
fill: "currentColor"
|
|
1617
1647
|
})
|
|
1618
1648
|
]
|
|
1619
|
-
),
|
|
1649
|
+
), ut = (e, t) => {
|
|
1620
1650
|
const a = fa(e);
|
|
1621
1651
|
Object.keys(window).forEach((s) => {
|
|
1622
|
-
s.startsWith("_iconfont_svg_string_") && (a == null ? void 0 : a.windowKey) === s && !Ce.has(s) && (Ce.add(s),
|
|
1652
|
+
s.startsWith("_iconfont_svg_string_") && (a == null ? void 0 : a.windowKey) === s && !Ce.has(s) && (Ce.add(s), ct(s, t));
|
|
1623
1653
|
});
|
|
1624
|
-
},
|
|
1654
|
+
}, ct = (e, t) => {
|
|
1625
1655
|
const a = window[e], o = new DOMParser().parseFromString(a, "image/svg+xml").getElementsByTagName("symbol"), r = document.querySelectorAll("symbol");
|
|
1626
1656
|
for (const l of o) {
|
|
1627
|
-
const i = l.id, u = Array.from(r).find((
|
|
1628
|
-
u && t && (u.innerHTML = l.innerHTML, u.querySelectorAll("*").forEach((
|
|
1629
|
-
|
|
1657
|
+
const i = l.id, u = Array.from(r).find((c) => c.id === i);
|
|
1658
|
+
u && t && (u.innerHTML = l.innerHTML, u.querySelectorAll("*").forEach((c) => {
|
|
1659
|
+
c.hasAttribute("fill") && c.removeAttribute("fill");
|
|
1630
1660
|
})), V.value[i] || (V.value[i] = _("svg", { fill: "currentColor" }, [_("use", { "xlink:href": `#${i}` })]));
|
|
1631
1661
|
}
|
|
1632
|
-
},
|
|
1662
|
+
}, ft = (e, t) => {
|
|
1633
1663
|
let a = "";
|
|
1634
1664
|
return e && (a += `rotate(${e}deg)`), t && (a += " scaleX(-1)"), a;
|
|
1635
|
-
},
|
|
1665
|
+
}, Xt = (e, t, a, s) => {
|
|
1636
1666
|
pa(e, [], a, s).forEach((o) => t.push(o));
|
|
1637
1667
|
}, pa = (e, t, a, s) => {
|
|
1638
|
-
var r, l, i, u,
|
|
1668
|
+
var r, l, i, u, c;
|
|
1639
1669
|
const n = [], o = K();
|
|
1640
1670
|
for (const p of e) {
|
|
1641
1671
|
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"))
|
|
@@ -1645,16 +1675,16 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1645
1675
|
const d = pa(p.children || [], m, a, s), E = {
|
|
1646
1676
|
key: m.join("/"),
|
|
1647
1677
|
label: ((u = p.name) == null ? void 0 : u.toString()) ?? "",
|
|
1648
|
-
title: ((
|
|
1678
|
+
title: ((c = p.name) == null ? void 0 : c.toString()) ?? "",
|
|
1649
1679
|
icon: p.icon ? _(a, { ...s, icon: p.icon }) : void 0,
|
|
1650
1680
|
children: d.length > 0 ? d : void 0
|
|
1651
1681
|
};
|
|
1652
1682
|
(d.length > 0 || !p.children) && n.push(E);
|
|
1653
1683
|
}
|
|
1654
1684
|
return n;
|
|
1655
|
-
}, We = va([]),
|
|
1685
|
+
}, We = va([]), Zt = () => {
|
|
1656
1686
|
We.length = 0;
|
|
1657
|
-
const e =
|
|
1687
|
+
const e = U();
|
|
1658
1688
|
let a = Ke().TabActive;
|
|
1659
1689
|
e.matchedRoutes(a).forEach((n, o) => {
|
|
1660
1690
|
var l;
|
|
@@ -1665,7 +1695,7 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1665
1695
|
};
|
|
1666
1696
|
We.push(r);
|
|
1667
1697
|
});
|
|
1668
|
-
},
|
|
1698
|
+
}, pt = {
|
|
1669
1699
|
host: {
|
|
1670
1700
|
api: "SITEHOST_API",
|
|
1671
1701
|
url: "/openapi/RCSiteHostSrv/get",
|
|
@@ -1677,7 +1707,7 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1677
1707
|
// 不显示错误
|
|
1678
1708
|
hideErrorToast: !0
|
|
1679
1709
|
}
|
|
1680
|
-
},
|
|
1710
|
+
}, es = ie("hostInfo", {
|
|
1681
1711
|
state: () => ({
|
|
1682
1712
|
hostInfo: {
|
|
1683
1713
|
Host: "",
|
|
@@ -1701,9 +1731,9 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1701
1731
|
return;
|
|
1702
1732
|
}
|
|
1703
1733
|
return new Promise((s) => {
|
|
1704
|
-
|
|
1734
|
+
ke.SITEHOST_API || (ke.SITEHOST_API = e);
|
|
1705
1735
|
const n = t || window.location.origin;
|
|
1706
|
-
Q(
|
|
1736
|
+
Q(pt.host, {
|
|
1707
1737
|
Query: {
|
|
1708
1738
|
Host: n
|
|
1709
1739
|
}
|
|
@@ -1724,9 +1754,9 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1724
1754
|
...this.hostInfo,
|
|
1725
1755
|
...e
|
|
1726
1756
|
}, this.hostInfo.API_HOST)
|
|
1727
|
-
for (const t in this.hostInfo.API_HOST)
|
|
1757
|
+
for (const t in this.hostInfo.API_HOST) ke[t] = this.hostInfo.API_HOST[t];
|
|
1728
1758
|
if (this.hostInfo.SERVER_HOST)
|
|
1729
|
-
for (const t in this.hostInfo.SERVER_HOST)
|
|
1759
|
+
for (const t in this.hostInfo.SERVER_HOST) La[t] = this.hostInfo.SERVER_HOST[t];
|
|
1730
1760
|
},
|
|
1731
1761
|
getHostInfo() {
|
|
1732
1762
|
return this.hostInfo;
|
|
@@ -1739,7 +1769,7 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1739
1769
|
// storage: localStorage,
|
|
1740
1770
|
// pick: ['hostInfo'],
|
|
1741
1771
|
// },
|
|
1742
|
-
}),
|
|
1772
|
+
}), as = ie("settingInfo", {
|
|
1743
1773
|
state: () => ({
|
|
1744
1774
|
fullscreen: !1,
|
|
1745
1775
|
menuCollapse: !1,
|
|
@@ -1781,10 +1811,10 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1781
1811
|
}
|
|
1782
1812
|
},
|
|
1783
1813
|
persist: !1
|
|
1784
|
-
}),
|
|
1814
|
+
}), ts = /* @__PURE__ */ W({
|
|
1785
1815
|
__name: "index",
|
|
1786
1816
|
props: {
|
|
1787
|
-
...
|
|
1817
|
+
...le,
|
|
1788
1818
|
/**
|
|
1789
1819
|
* 选择项数据
|
|
1790
1820
|
*/
|
|
@@ -1795,9 +1825,9 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1795
1825
|
},
|
|
1796
1826
|
emits: ["change"],
|
|
1797
1827
|
setup(e, { emit: t }) {
|
|
1798
|
-
const a = e, s =
|
|
1799
|
-
o.inputFactory =
|
|
1800
|
-
const r =
|
|
1828
|
+
const a = e, s = C(), n = fe(a.url, a), o = a.optionCtrl ?? n.optionCtrl;
|
|
1829
|
+
o.inputFactory = H(s);
|
|
1830
|
+
const r = f([]);
|
|
1801
1831
|
o && I(
|
|
1802
1832
|
() => o.options.value,
|
|
1803
1833
|
(p) => {
|
|
@@ -1805,20 +1835,20 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1805
1835
|
},
|
|
1806
1836
|
{ immediate: !0, deep: !0 }
|
|
1807
1837
|
);
|
|
1808
|
-
const l = t, { editorCtrl: i, errInfo: u } =
|
|
1809
|
-
u != null && u.value.errClass && i &&
|
|
1838
|
+
const l = t, { editorCtrl: i, errInfo: u } = C(), c = (p) => {
|
|
1839
|
+
u != null && u.value.errClass && i && ue(i), l("change", p);
|
|
1810
1840
|
};
|
|
1811
|
-
return
|
|
1841
|
+
return Se(() => {
|
|
1812
1842
|
if (!a.data || a.data.length != 2) {
|
|
1813
1843
|
console.error("Switch组件: ", a.data), x.error("Switch组件必须有且只有两个选项");
|
|
1814
1844
|
return;
|
|
1815
1845
|
}
|
|
1816
|
-
o &&
|
|
1817
|
-
}),
|
|
1818
|
-
o &&
|
|
1846
|
+
o && Y(o.autoload, o, a);
|
|
1847
|
+
}), re(() => {
|
|
1848
|
+
o && ce(o, a);
|
|
1819
1849
|
}), (p, m) => {
|
|
1820
1850
|
var d;
|
|
1821
|
-
return r.value.length === 2 ? (A(),
|
|
1851
|
+
return r.value.length === 2 ? (A(), Ie(b(ya), oe({
|
|
1822
1852
|
key: 0,
|
|
1823
1853
|
class: [
|
|
1824
1854
|
((d = b(u)) == null ? void 0 : d.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : "",
|
|
@@ -1829,15 +1859,15 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1829
1859
|
checkedValue: r.value[0].value,
|
|
1830
1860
|
unCheckedChildren: r.value[1].label,
|
|
1831
1861
|
unCheckedValue: r.value[1].value,
|
|
1832
|
-
onChange:
|
|
1862
|
+
onChange: c
|
|
1833
1863
|
}, p.$attrs), null, 16, ["class", "checkedChildren", "checkedValue", "unCheckedChildren", "unCheckedValue"])) : q("", !0);
|
|
1834
1864
|
};
|
|
1835
1865
|
}
|
|
1836
|
-
}),
|
|
1866
|
+
}), ss = /* @__PURE__ */ W({
|
|
1837
1867
|
inheritAttrs: !1,
|
|
1838
1868
|
__name: "index",
|
|
1839
1869
|
props: {
|
|
1840
|
-
...
|
|
1870
|
+
...le,
|
|
1841
1871
|
value: {
|
|
1842
1872
|
type: [String, Number, Array, null],
|
|
1843
1873
|
default: void 0
|
|
@@ -1854,13 +1884,13 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1854
1884
|
},
|
|
1855
1885
|
emits: ["update:value", "select", "change", "update:labels"],
|
|
1856
1886
|
setup(e, { emit: t }) {
|
|
1857
|
-
const a = e, s =
|
|
1858
|
-
r.inputFactory =
|
|
1887
|
+
const a = e, s = xe(), n = C(), o = fe(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
|
|
1888
|
+
r.inputFactory = H(n), r.fieldMap = {
|
|
1859
1889
|
label: "Name",
|
|
1860
1890
|
value: "Id",
|
|
1861
1891
|
...r == null ? void 0 : r.fieldMap
|
|
1862
1892
|
};
|
|
1863
|
-
const l =
|
|
1893
|
+
const l = f((r == null ? void 0 : r.selected.value) || void 0);
|
|
1864
1894
|
I(
|
|
1865
1895
|
() => a.value,
|
|
1866
1896
|
() => {
|
|
@@ -1873,9 +1903,9 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1873
1903
|
a.autoClean && a.formData && a.outFields && v !== a.value && ua(a.formData, a.outFields, null);
|
|
1874
1904
|
}
|
|
1875
1905
|
);
|
|
1876
|
-
const { editorCtrl: i, errInfo: u, labelText:
|
|
1906
|
+
const { editorCtrl: i, errInfo: u, labelText: c } = n, p = t;
|
|
1877
1907
|
n.inputEmit = p;
|
|
1878
|
-
const m =
|
|
1908
|
+
const m = f((r == null ? void 0 : r.options.value) || []);
|
|
1879
1909
|
r && I(
|
|
1880
1910
|
() => r.options.value,
|
|
1881
1911
|
(v) => {
|
|
@@ -1890,43 +1920,48 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1890
1920
|
SearchField: "%" + v.trim() + "%"
|
|
1891
1921
|
}
|
|
1892
1922
|
};
|
|
1893
|
-
r.params =
|
|
1923
|
+
r.params = Ee(r.params, h), r && Y(!0, r, a);
|
|
1894
1924
|
}, E = (v) => {
|
|
1895
|
-
const w =
|
|
1925
|
+
const w = we(r, a, v);
|
|
1896
1926
|
p("update:value", v), p("select", v);
|
|
1897
|
-
const h =
|
|
1898
|
-
p("update:labels", h), u != null && u.value.errClass && i &&
|
|
1927
|
+
const h = Te(w);
|
|
1928
|
+
p("update:labels", h), u != null && u.value.errClass && i && ue(i);
|
|
1899
1929
|
};
|
|
1900
|
-
return
|
|
1901
|
-
r &&
|
|
1930
|
+
return re(() => {
|
|
1931
|
+
r && ce(r, a);
|
|
1902
1932
|
}), (v, w) => {
|
|
1903
1933
|
var h;
|
|
1904
1934
|
return A(), L("div", null, [
|
|
1905
|
-
|
|
1935
|
+
B(b(ba), oe({
|
|
1906
1936
|
value: l.value,
|
|
1907
1937
|
"onUpdate:value": w[0] || (w[0] = (S) => l.value = S),
|
|
1908
1938
|
class: ["w-full", (h = b(u)) == null ? void 0 : h.errClass],
|
|
1909
1939
|
options: m.value,
|
|
1910
|
-
placeholder: "请输入并选择" + b(f),
|
|
1911
1940
|
onSearch: d,
|
|
1912
1941
|
onSelect: E
|
|
1913
|
-
}, b(s)), {
|
|
1914
|
-
option:
|
|
1915
|
-
|
|
1942
|
+
}, b(s), { "allow-clear": !1 }), {
|
|
1943
|
+
option: D(({ label: S }) => [
|
|
1944
|
+
Ae(z(S), 1)
|
|
1945
|
+
]),
|
|
1946
|
+
default: D(() => [
|
|
1947
|
+
B(b(Sa), {
|
|
1948
|
+
"allow-clear": "",
|
|
1949
|
+
placeholder: "请输入并选择" + b(c)
|
|
1950
|
+
}, null, 8, ["placeholder"])
|
|
1916
1951
|
]),
|
|
1917
1952
|
_: 1
|
|
1918
|
-
}, 16, ["value", "class", "options"
|
|
1953
|
+
}, 16, ["value", "class", "options"])
|
|
1919
1954
|
]);
|
|
1920
1955
|
};
|
|
1921
1956
|
}
|
|
1922
|
-
}),
|
|
1957
|
+
}), dt = { class: "min-h-[32px] pt-[5px]" }, ht = {
|
|
1923
1958
|
key: 1,
|
|
1924
1959
|
class: "text-center text-gray-500"
|
|
1925
|
-
},
|
|
1960
|
+
}, ns = /* @__PURE__ */ W({
|
|
1926
1961
|
inheritAttrs: !1,
|
|
1927
1962
|
__name: "index",
|
|
1928
1963
|
props: {
|
|
1929
|
-
...
|
|
1964
|
+
...le,
|
|
1930
1965
|
nodata: {
|
|
1931
1966
|
type: String,
|
|
1932
1967
|
default: ""
|
|
@@ -1944,9 +1979,9 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1944
1979
|
emits: ["change", "update:labels"],
|
|
1945
1980
|
setup(e, { emit: t }) {
|
|
1946
1981
|
var m, d, E;
|
|
1947
|
-
const a = e, s =
|
|
1948
|
-
r.inputFactory =
|
|
1949
|
-
const l =
|
|
1982
|
+
const a = e, s = xe(), n = C(), o = fe(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
|
|
1983
|
+
r.inputFactory = H(n);
|
|
1984
|
+
const l = f({
|
|
1950
1985
|
...r == null ? void 0 : r.url,
|
|
1951
1986
|
url: ((m = r == null ? void 0 : r.url) == null ? void 0 : m.url) || "",
|
|
1952
1987
|
fieldMap: (r == null ? void 0 : r.fieldMap) || ((d = r == null ? void 0 : r.url) == null ? void 0 : d.fieldMap),
|
|
@@ -1954,36 +1989,36 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1954
1989
|
loadingText: !1
|
|
1955
1990
|
}), { errInfo: i } = n, u = t;
|
|
1956
1991
|
n.inputEmit = u;
|
|
1957
|
-
const
|
|
1992
|
+
const c = f((r == null ? void 0 : r.options.value) || []);
|
|
1958
1993
|
r && I(
|
|
1959
1994
|
() => r.options.value,
|
|
1960
1995
|
(v) => {
|
|
1961
|
-
|
|
1996
|
+
c.value = v || [];
|
|
1962
1997
|
},
|
|
1963
1998
|
{ immediate: !0, deep: !0 }
|
|
1964
1999
|
);
|
|
1965
2000
|
const p = (v) => {
|
|
1966
|
-
const h =
|
|
2001
|
+
const h = we(r, a, v), S = Te(h);
|
|
1967
2002
|
u("update:labels", S);
|
|
1968
2003
|
};
|
|
1969
|
-
return
|
|
2004
|
+
return Se(() => {
|
|
1970
2005
|
l.value && !l.value.fieldMap && (l.value.fieldMap = {
|
|
1971
2006
|
title: "Name",
|
|
1972
2007
|
label: "Name",
|
|
1973
2008
|
value: "Id",
|
|
1974
2009
|
key: "Id"
|
|
1975
|
-
}), r &&
|
|
1976
|
-
}),
|
|
1977
|
-
r &&
|
|
1978
|
-
}), (v, w) => (A(), L("div",
|
|
1979
|
-
|
|
2010
|
+
}), r && Y(r.autoload, r, a);
|
|
2011
|
+
}), re(() => {
|
|
2012
|
+
r && ce(r, a);
|
|
2013
|
+
}), (v, w) => (A(), L("div", dt, [
|
|
2014
|
+
B(b(Ia), oe({
|
|
1980
2015
|
onChange: p,
|
|
1981
2016
|
class: "w-full mb-[-3px]"
|
|
1982
2017
|
}, b(s)), {
|
|
1983
|
-
default:
|
|
1984
|
-
|
|
2018
|
+
default: D(() => [
|
|
2019
|
+
c.value.length > 0 ? (A(!0), L(te, { key: 0 }, _e(c.value, (h) => {
|
|
1985
2020
|
var S;
|
|
1986
|
-
return A(),
|
|
2021
|
+
return A(), Ie(b(xa), {
|
|
1987
2022
|
key: h.value,
|
|
1988
2023
|
value: h.value,
|
|
1989
2024
|
disabled: h.disabled || h.value && e.disabledItems && e.disabledItems.indexOf(h.value.toString()) > -1,
|
|
@@ -1994,25 +2029,25 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
1994
2029
|
e.wrap ? `w-1/${a.wrap}` : ""
|
|
1995
2030
|
])
|
|
1996
2031
|
}, {
|
|
1997
|
-
default:
|
|
1998
|
-
|
|
2032
|
+
default: D(() => [
|
|
2033
|
+
Ae(z(h.label), 1)
|
|
1999
2034
|
]),
|
|
2000
2035
|
_: 2
|
|
2001
2036
|
}, 1032, ["value", "disabled", "class"]);
|
|
2002
|
-
}), 128)) : e.nodata ? (A(), L("div",
|
|
2037
|
+
}), 128)) : e.nodata ? (A(), L("div", ht, z(e.nodata), 1)) : q("", !0)
|
|
2003
2038
|
]),
|
|
2004
2039
|
_: 1
|
|
2005
2040
|
}, 16)
|
|
2006
2041
|
]));
|
|
2007
2042
|
}
|
|
2008
|
-
}),
|
|
2043
|
+
}), mt = { class: "min-h-[32px] pt-1" }, vt = {
|
|
2009
2044
|
key: 1,
|
|
2010
2045
|
class: "text-center text-gray-500"
|
|
2011
|
-
},
|
|
2046
|
+
}, rs = /* @__PURE__ */ W({
|
|
2012
2047
|
inheritAttrs: !1,
|
|
2013
2048
|
__name: "index",
|
|
2014
2049
|
props: {
|
|
2015
|
-
...
|
|
2050
|
+
...le,
|
|
2016
2051
|
value: {
|
|
2017
2052
|
type: [String, Number, null, Array],
|
|
2018
2053
|
default: void 0
|
|
@@ -2031,19 +2066,19 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
2031
2066
|
emits: ["change", "update:value", "update:labels"],
|
|
2032
2067
|
setup(e, { emit: t }) {
|
|
2033
2068
|
var E, v, w;
|
|
2034
|
-
const a = e, s =
|
|
2035
|
-
r.inputFactory =
|
|
2036
|
-
const l =
|
|
2069
|
+
const a = e, s = xe(), n = C(), o = fe(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
|
|
2070
|
+
r.inputFactory = H(n);
|
|
2071
|
+
const l = f({
|
|
2037
2072
|
...r == null ? void 0 : r.url,
|
|
2038
2073
|
url: ((E = r == null ? void 0 : r.url) == null ? void 0 : E.url) || "",
|
|
2039
2074
|
fieldMap: (r == null ? void 0 : r.fieldMap) || ((v = r == null ? void 0 : r.url) == null ? void 0 : v.fieldMap),
|
|
2040
2075
|
params: (r == null ? void 0 : r.params) || ((w = r == null ? void 0 : r.url) == null ? void 0 : w.params),
|
|
2041
2076
|
loadingText: !1
|
|
2042
|
-
}), i =
|
|
2077
|
+
}), i = f(a.value), { errInfo: u } = n, c = f((r == null ? void 0 : r.options.value) || []), p = t;
|
|
2043
2078
|
n.inputEmit = p, r && I(
|
|
2044
2079
|
() => r.options.value,
|
|
2045
2080
|
(h) => {
|
|
2046
|
-
|
|
2081
|
+
c.value = h || [];
|
|
2047
2082
|
},
|
|
2048
2083
|
{ immediate: !0, deep: !0 }
|
|
2049
2084
|
), I(
|
|
@@ -2059,32 +2094,32 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
2059
2094
|
}
|
|
2060
2095
|
return h === S;
|
|
2061
2096
|
}, d = (h) => {
|
|
2062
|
-
const S = h.target.value, O =
|
|
2097
|
+
const S = h.target.value, O = we(r, a, S), g = Te(O);
|
|
2063
2098
|
p("update:labels", g);
|
|
2064
2099
|
};
|
|
2065
|
-
return
|
|
2100
|
+
return Se(() => {
|
|
2066
2101
|
l.value && !l.value.fieldMap && (l.value.fieldMap = {
|
|
2067
2102
|
label: "Name",
|
|
2068
2103
|
value: "Id",
|
|
2069
2104
|
key: "Id"
|
|
2070
|
-
}), r &&
|
|
2071
|
-
}),
|
|
2072
|
-
r &&
|
|
2073
|
-
}), (h, S) => (A(), L("div",
|
|
2074
|
-
|
|
2105
|
+
}), r && Y(r.autoload, r, a);
|
|
2106
|
+
}), re(() => {
|
|
2107
|
+
r && ce(r, a);
|
|
2108
|
+
}), (h, S) => (A(), L("div", mt, [
|
|
2109
|
+
B(b(Aa), oe({
|
|
2075
2110
|
value: i.value,
|
|
2076
2111
|
"onUpdate:value": S[0] || (S[0] = (O) => i.value = O),
|
|
2077
2112
|
autocheck: !1,
|
|
2078
2113
|
onChange: d,
|
|
2079
2114
|
class: "w-full flex align-items flex-wrap mb-[-3px]"
|
|
2080
2115
|
}, b(s)), {
|
|
2081
|
-
default:
|
|
2082
|
-
|
|
2116
|
+
default: D(() => [
|
|
2117
|
+
c.value.length > 0 ? (A(!0), L(te, { key: 0 }, _e(c.value, (O) => {
|
|
2083
2118
|
var g;
|
|
2084
|
-
return A(), L(
|
|
2119
|
+
return A(), L(te, {
|
|
2085
2120
|
key: O.value
|
|
2086
2121
|
}, [
|
|
2087
|
-
O.visible !== !1 ? (A(),
|
|
2122
|
+
O.visible !== !1 ? (A(), Ie(b(Ea), {
|
|
2088
2123
|
key: 0,
|
|
2089
2124
|
checked: m(O.value, a.value),
|
|
2090
2125
|
value: O.value,
|
|
@@ -2095,26 +2130,26 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
2095
2130
|
e.wrap ? `w-1/${a.wrap}` : ""
|
|
2096
2131
|
])
|
|
2097
2132
|
}, {
|
|
2098
|
-
default:
|
|
2099
|
-
|
|
2133
|
+
default: D(() => [
|
|
2134
|
+
Ae(z(O.label), 1)
|
|
2100
2135
|
]),
|
|
2101
2136
|
_: 2
|
|
2102
2137
|
}, 1032, ["checked", "value", "class"])) : q("", !0)
|
|
2103
2138
|
], 64);
|
|
2104
|
-
}), 128)) : e.nodata ? (A(), L("div",
|
|
2139
|
+
}), 128)) : e.nodata ? (A(), L("div", vt, z(e.nodata), 1)) : q("", !0)
|
|
2105
2140
|
]),
|
|
2106
2141
|
_: 1
|
|
2107
2142
|
}, 16, ["value"])
|
|
2108
2143
|
]));
|
|
2109
2144
|
}
|
|
2110
|
-
}),
|
|
2145
|
+
}), gt = {
|
|
2111
2146
|
key: 0,
|
|
2112
2147
|
class: "absolute z-10 mt-[5px] mr-[10px] text-[#999] flex items-center"
|
|
2113
|
-
},
|
|
2148
|
+
}, os = /* @__PURE__ */ W({
|
|
2114
2149
|
inheritAttrs: !1,
|
|
2115
2150
|
__name: "index",
|
|
2116
2151
|
props: {
|
|
2117
|
-
...
|
|
2152
|
+
...le,
|
|
2118
2153
|
value: {
|
|
2119
2154
|
type: [String, Number, Array, null],
|
|
2120
2155
|
default: void 0
|
|
@@ -2137,17 +2172,17 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
2137
2172
|
emits: ["change", "update:value", "update:labels"],
|
|
2138
2173
|
setup(e, { emit: t }) {
|
|
2139
2174
|
var h, S, O;
|
|
2140
|
-
const a = e, s =
|
|
2141
|
-
i.inputFactory =
|
|
2142
|
-
const u =
|
|
2175
|
+
const a = e, s = C(), { editorCtrl: n, errInfo: o, labelText: r } = s, l = fe(a.url, a), i = a.optionCtrl ?? l.optionCtrl;
|
|
2176
|
+
i.inputFactory = H(s);
|
|
2177
|
+
const u = xe(), c = f({
|
|
2143
2178
|
...i == null ? void 0 : i.url,
|
|
2144
2179
|
url: ((h = i == null ? void 0 : i.url) == null ? void 0 : h.url) || "",
|
|
2145
2180
|
fieldMap: (i == null ? void 0 : i.fieldMap) || ((S = i == null ? void 0 : i.url) == null ? void 0 : S.fieldMap),
|
|
2146
2181
|
params: (i == null ? void 0 : i.params) || ((O = i == null ? void 0 : i.url) == null ? void 0 : O.params),
|
|
2147
2182
|
loadingText: !1
|
|
2148
|
-
}), p =
|
|
2183
|
+
}), p = f(a.value), m = f(u.placeholder), d = f((i == null ? void 0 : i.selected.value) || void 0), E = t;
|
|
2149
2184
|
s.inputEmit = E;
|
|
2150
|
-
const v =
|
|
2185
|
+
const v = f((i == null ? void 0 : i.options.value) || []);
|
|
2151
2186
|
i && I(
|
|
2152
2187
|
() => i.options.value,
|
|
2153
2188
|
(g) => {
|
|
@@ -2156,8 +2191,8 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
2156
2191
|
{ immediate: !0, deep: !0 }
|
|
2157
2192
|
);
|
|
2158
2193
|
const w = (g) => {
|
|
2159
|
-
const J =
|
|
2160
|
-
d.value = g, E("update:labels",
|
|
2194
|
+
const J = we(i, a, g), pe = Te(J);
|
|
2195
|
+
d.value = g, E("update:labels", pe), E("change", g), o != null && o.value.errClass && n && ue(n);
|
|
2161
2196
|
};
|
|
2162
2197
|
return I(
|
|
2163
2198
|
() => v.value,
|
|
@@ -2165,7 +2200,7 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
2165
2200
|
g.length && P(a.value) && a.selectFirst ? d.value = g[0].value : d.value = a.value === null ? void 0 : a.value, g.length > 0 && d.value && w(d.value);
|
|
2166
2201
|
}
|
|
2167
2202
|
), I(
|
|
2168
|
-
() =>
|
|
2203
|
+
() => c.value.loading,
|
|
2169
2204
|
(g) => {
|
|
2170
2205
|
g ? m.value = "" : m.value || (m.value = "请选择" + r.value);
|
|
2171
2206
|
},
|
|
@@ -2179,25 +2214,25 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
2179
2214
|
}
|
|
2180
2215
|
E("update:value", g);
|
|
2181
2216
|
}
|
|
2182
|
-
),
|
|
2183
|
-
if (
|
|
2217
|
+
), Se(() => {
|
|
2218
|
+
if (c.value && !c.value.fieldMap && (c.value.fieldMap = {
|
|
2184
2219
|
label: "Name",
|
|
2185
2220
|
value: "Id",
|
|
2186
2221
|
key: "Id"
|
|
2187
2222
|
}), a.dataKey) {
|
|
2188
|
-
const g = JSON.parse(JSON.stringify(
|
|
2223
|
+
const g = JSON.parse(JSON.stringify(F.getOptions(a.dataKey)));
|
|
2189
2224
|
v.value = g;
|
|
2190
|
-
} else i &&
|
|
2191
|
-
}),
|
|
2192
|
-
i &&
|
|
2225
|
+
} else i && Y(i.autoload, i, a);
|
|
2226
|
+
}), re(() => {
|
|
2227
|
+
i && ce(i, a);
|
|
2193
2228
|
}), (g, J) => {
|
|
2194
|
-
var
|
|
2229
|
+
var pe, Ge, je;
|
|
2195
2230
|
return A(), L("div", null, [
|
|
2196
|
-
(Ge = (
|
|
2197
|
-
|
|
2231
|
+
(Ge = (pe = b(i)) == null ? void 0 : pe.url) != null && Ge.loading ? (A(), L("div", gt, [
|
|
2232
|
+
B(b(Ne), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
|
|
2198
2233
|
J[1] || (J[1] = ga("span", null, "数据加载中...", -1))
|
|
2199
2234
|
])) : q("", !0),
|
|
2200
|
-
|
|
2235
|
+
B(b(Oa), oe({
|
|
2201
2236
|
class: [(je = b(o)) == null ? void 0 : je.errClass, "w-full"],
|
|
2202
2237
|
value: d.value,
|
|
2203
2238
|
"onUpdate:value": J[0] || (J[0] = (G) => d.value = G),
|
|
@@ -2206,16 +2241,16 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
2206
2241
|
placeholder: m.value,
|
|
2207
2242
|
"label-in-value": !1
|
|
2208
2243
|
}, b(u)), {
|
|
2209
|
-
default:
|
|
2210
|
-
(A(!0), L(
|
|
2244
|
+
default: D(() => [
|
|
2245
|
+
(A(!0), L(te, null, _e(v.value, (G) => (A(), L(te, {
|
|
2211
2246
|
key: G.value
|
|
2212
2247
|
}, [
|
|
2213
|
-
G.visible !== !1 ? (A(),
|
|
2248
|
+
G.visible !== !1 ? (A(), Ie(b(Ra), {
|
|
2214
2249
|
key: 0,
|
|
2215
2250
|
value: G.value
|
|
2216
2251
|
}, {
|
|
2217
|
-
default:
|
|
2218
|
-
|
|
2252
|
+
default: D(() => [
|
|
2253
|
+
Ae(z(G.label), 1)
|
|
2219
2254
|
]),
|
|
2220
2255
|
_: 2
|
|
2221
2256
|
}, 1032, ["value"])) : q("", !0)
|
|
@@ -2229,74 +2264,74 @@ const j = new Xa(), W = (e, t, a) => {
|
|
|
2229
2264
|
});
|
|
2230
2265
|
export {
|
|
2231
2266
|
Ft as $,
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2267
|
+
ue as A,
|
|
2268
|
+
ns as B,
|
|
2269
|
+
rs as C,
|
|
2270
|
+
os as D,
|
|
2271
|
+
De as E,
|
|
2272
|
+
Ma as F,
|
|
2273
|
+
qt as G,
|
|
2274
|
+
st as H,
|
|
2275
|
+
nt as I,
|
|
2276
|
+
Bt as J,
|
|
2277
|
+
zt as K,
|
|
2278
|
+
tt as L,
|
|
2279
|
+
ua as M,
|
|
2280
|
+
Ct as N,
|
|
2281
|
+
F as O,
|
|
2247
2282
|
N as P,
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2283
|
+
Yt as Q,
|
|
2284
|
+
ct as R,
|
|
2285
|
+
ft as S,
|
|
2286
|
+
Xt as T,
|
|
2252
2287
|
We as U,
|
|
2253
|
-
|
|
2288
|
+
Zt as V,
|
|
2254
2289
|
ea as W,
|
|
2255
2290
|
Dt as X,
|
|
2256
2291
|
aa as Y,
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2292
|
+
Lt as Z,
|
|
2293
|
+
ts as _,
|
|
2294
|
+
as as a,
|
|
2295
|
+
He as a0,
|
|
2296
|
+
$t as a1,
|
|
2297
|
+
Kt as a2,
|
|
2298
|
+
Xa as a3,
|
|
2264
2299
|
ia as a4,
|
|
2265
|
-
|
|
2266
|
-
|
|
2300
|
+
Jt as a5,
|
|
2301
|
+
kt as a6,
|
|
2267
2302
|
Ze as a7,
|
|
2268
|
-
|
|
2269
|
-
|
|
2303
|
+
Na as a8,
|
|
2304
|
+
Me as a9,
|
|
2270
2305
|
j as aa,
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2306
|
+
ae as ab,
|
|
2307
|
+
me as ac,
|
|
2308
|
+
U as ad,
|
|
2309
|
+
es as ae,
|
|
2275
2310
|
Ke as af,
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2311
|
+
se as ag,
|
|
2312
|
+
_t as b,
|
|
2313
|
+
Wt as c,
|
|
2314
|
+
Ut as d,
|
|
2280
2315
|
Mt as e,
|
|
2281
|
-
|
|
2282
|
-
|
|
2316
|
+
Gt as f,
|
|
2317
|
+
jt as g,
|
|
2283
2318
|
Vt as h,
|
|
2284
2319
|
P as i,
|
|
2285
|
-
|
|
2320
|
+
Ht as j,
|
|
2286
2321
|
oa as k,
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2322
|
+
Ya as l,
|
|
2323
|
+
Qt as m,
|
|
2324
|
+
ss as n,
|
|
2325
|
+
Nt as o,
|
|
2326
|
+
le as p,
|
|
2327
|
+
_a as q,
|
|
2328
|
+
ne as r,
|
|
2329
|
+
C as s,
|
|
2330
|
+
fe as t,
|
|
2296
2331
|
K as u,
|
|
2297
|
-
|
|
2298
|
-
|
|
2332
|
+
Y as v,
|
|
2333
|
+
ce as w,
|
|
2299
2334
|
Ne as x,
|
|
2300
|
-
|
|
2301
|
-
|
|
2335
|
+
we as y,
|
|
2336
|
+
Te as z
|
|
2302
2337
|
};
|