@skyfox2000/webui 1.2.3 → 1.2.4
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-D5dPRmq8.js → file-upload-CoDWKNFQ.js} +5 -5
- package/lib/assets/modules/{form-excel-DITF2FoK.js → form-excel-DitXm4uj.js} +1 -1
- package/lib/assets/modules/{index-XIk9IJH2.js → index-B5NckHoK.js} +5 -5
- package/lib/assets/modules/{pinia-8iujwf8y.js → index-C4515EtU.js} +1140 -1127
- package/lib/assets/modules/{index-CRKPVlgC.js → index-DG2jNBuv.js} +1 -1
- package/lib/assets/modules/{menuTabs-D2OgHmBc.js → menuTabs-BwX6S1WN.js} +11 -11
- package/lib/assets/modules/{toolIcon-Cwggvppx.js → toolIcon-B5Qojob9.js} +1 -1
- package/lib/assets/modules/{download-D6JcG5ZR.js → uploadList-BdeV2JlK.js} +45 -45
- package/lib/components/common/icon/index.vue.d.ts +7 -7
- package/lib/components/form/autoComplete/index.vue.d.ts +4 -4
- package/lib/components/form/radio/index.vue.d.ts +2 -2
- package/lib/es/AceEditor/index.js +3 -3
- package/lib/es/BasicLayout/index.js +18 -18
- package/lib/es/Error403/index.js +5 -5
- package/lib/es/Error404/index.js +5 -5
- package/lib/es/ExcelForm/index.js +22 -22
- package/lib/es/UploadForm/index.js +10 -10
- package/lib/index.d.ts +2 -2
- package/lib/router/index.d.ts +0 -1
- package/lib/stores/userInfo.d.ts +1 -0
- package/lib/webui.es.js +663 -663
- package/package.json +1 -1
- package/src/index.ts +50 -50
- package/src/router/index.ts +1 -2
- package/src/stores/appInfo.ts +4 -1
- package/src/stores/userInfo.ts +16 -1
|
@@ -1,653 +1,19 @@
|
|
|
1
1
|
var ia = Object.defineProperty;
|
|
2
2
|
var la = (e, t, a) => t in e ? ia(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
3
|
var P = (e, t, a) => la(e, typeof t != "symbol" ? t + "" : t, a);
|
|
4
|
-
import { ref as f,
|
|
4
|
+
import { inject as G, ref as f, provide as me, watch as T, toRaw as Qe, h as C, nextTick as ua, shallowRef as Ge, defineComponent as W, reactive as ca, useAttrs as te, onMounted as se, onUnmounted as ne, createElementBlock as O, openBlock as x, createVNode as q, unref as E, mergeProps as re, withCtx as H, createCommentVNode as j, Fragment as B, renderList as Ae, createBlock as Re, normalizeClass as Ve, createTextVNode as Te, toDisplayString as J, createElementVNode as fa } from "vue";
|
|
5
5
|
import { AutoComplete as pa, CheckboxGroup as da, Checkbox as ha, RadioGroup as ma, Radio as va, Select as ga, SelectOption as ya } from "ant-design-vue";
|
|
6
|
-
import {
|
|
6
|
+
import { createPinia as ba, defineStore as Y } from "pinia";
|
|
7
|
+
import Sa from "pinia-plugin-persistedstate";
|
|
8
|
+
import { combineParams as we, isMicroApp as qe, mainAppApis as Ce, EnvConfig as De, AppAction as Fe, AppSource as Ne, isBaseMicroApp as Ue } from "@skyfox2000/microbase";
|
|
9
|
+
import { ResStatus as A, httpPost as _, setToken as X, fieldMapping as Ia, parseFieldTemplate as Ea, API_HOST as ve, SERVER_HOST as xa } from "@skyfox2000/fapi";
|
|
7
10
|
import S from "vue-m-message";
|
|
8
|
-
import
|
|
9
|
-
import "vue-draggable-next";
|
|
10
|
-
import "dayjs";
|
|
11
|
-
import { combineParams as Te, isMicroApp as qe, mainAppApis as $e, EnvConfig as De, AppAction as Fe, AppSource as Ne, isBaseMicroApp as Ce } from "@skyfox2000/microbase";
|
|
12
|
-
import we from "async-validator";
|
|
13
|
-
import Ea from "pinia-plugin-persistedstate";
|
|
11
|
+
import Oe from "async-validator";
|
|
14
12
|
import { createRouter as Aa, createWebHashHistory as Ra } from "vue-router";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
let s = !0;
|
|
20
|
-
return (r = e.icons) != null && r.length && (s = e.icons.every((n) => C.value[n] !== void 0)), (e.icon && !C.value[e.icon] || !s) && wa(e, t).then(() => {
|
|
21
|
-
ka(e.iconUrl, e.monoColor || !1), t.value = !0;
|
|
22
|
-
}), W({
|
|
23
|
-
props: {
|
|
24
|
-
icon: {
|
|
25
|
-
type: String
|
|
26
|
-
},
|
|
27
|
-
icons: {
|
|
28
|
-
type: Array
|
|
29
|
-
},
|
|
30
|
-
iconIndex: {
|
|
31
|
-
type: Number
|
|
32
|
-
},
|
|
33
|
-
clickable: {
|
|
34
|
-
type: Boolean
|
|
35
|
-
},
|
|
36
|
-
angle: {
|
|
37
|
-
type: Number
|
|
38
|
-
},
|
|
39
|
-
flip: {
|
|
40
|
-
type: Boolean
|
|
41
|
-
},
|
|
42
|
-
class: {
|
|
43
|
-
type: [String, Array],
|
|
44
|
-
default: ""
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
emits: ["update:iconIndex"],
|
|
48
|
-
setup(n, { emit: o }) {
|
|
49
|
-
const i = f(n.icon), l = f(0), u = () => {
|
|
50
|
-
n.icons && l.value++;
|
|
51
|
-
};
|
|
52
|
-
return T(
|
|
53
|
-
() => n.iconIndex,
|
|
54
|
-
(c) => {
|
|
55
|
-
c !== void 0 && (l.value = c);
|
|
56
|
-
},
|
|
57
|
-
{ immediate: !0 }
|
|
58
|
-
), T(
|
|
59
|
-
() => l.value,
|
|
60
|
-
(c) => {
|
|
61
|
-
n.icons && (c >= n.icons.length && (l.value = 0), i.value = n.icons[l.value], X(a, i, i.value), o("update:iconIndex", l.value));
|
|
62
|
-
},
|
|
63
|
-
{ immediate: !0 }
|
|
64
|
-
), T(
|
|
65
|
-
() => C.value,
|
|
66
|
-
() => {
|
|
67
|
-
X(a, i, i.value);
|
|
68
|
-
},
|
|
69
|
-
{ deep: !0 }
|
|
70
|
-
), T(
|
|
71
|
-
() => n.icon,
|
|
72
|
-
(c) => {
|
|
73
|
-
X(a, i, c);
|
|
74
|
-
}
|
|
75
|
-
), X(a, i, i.value), { isLoaded: t, Icon: a, handleClick: u };
|
|
76
|
-
},
|
|
77
|
-
render() {
|
|
78
|
-
if (!t.value)
|
|
79
|
-
return Se;
|
|
80
|
-
let n = this.class, o = "";
|
|
81
|
-
Array.isArray(n) ? o = n.join(" ") : typeof n == "string" && (o = n);
|
|
82
|
-
let i = [o];
|
|
83
|
-
return !/\bw-/.test(o) && !/$w-/.test(o) && i.push("w-4"), !/\bh-/.test(o) && !/$h-/.test(o) && i.push("h-4"), a.value ? D(Qe(a.value), {
|
|
84
|
-
onClick: this.$props.clickable ? this.handleClick : void 0,
|
|
85
|
-
class: `${i.join(" ")}`,
|
|
86
|
-
style: {
|
|
87
|
-
fill: "currentColor",
|
|
88
|
-
cursor: this.$props.clickable ? "pointer" : "default",
|
|
89
|
-
transform: Ma(this.angle, this.flip)
|
|
90
|
-
}
|
|
91
|
-
}) : D("div", { class: "w-[14px] h-[14px]" });
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
}, wa = (e, t) => {
|
|
95
|
-
let a = e.iconUrl;
|
|
96
|
-
if (!a)
|
|
97
|
-
return console.error("图标库地址不能为空"), Promise.resolve();
|
|
98
|
-
if (ge.has(a))
|
|
99
|
-
return Promise.resolve();
|
|
100
|
-
const s = Be(a);
|
|
101
|
-
if (s)
|
|
102
|
-
return new Promise(async (n) => (je(s.scriptContent), n()));
|
|
103
|
-
t.value = !1;
|
|
104
|
-
const r = new Promise(async (n) => {
|
|
105
|
-
await Oa(a, e.monoColor || !1), n(), ge.delete(a);
|
|
106
|
-
});
|
|
107
|
-
return ge.set(a, r), r;
|
|
108
|
-
}, Oa = async (e, t) => {
|
|
109
|
-
try {
|
|
110
|
-
const a = await fetch(e);
|
|
111
|
-
if (!a.ok) {
|
|
112
|
-
S.error("网络异常,无法加载图标库!");
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
let s = await a.text();
|
|
116
|
-
s = t ? s.replace(/fill=\"[^\"]*\"/gi, "") : s;
|
|
117
|
-
let r = /^window\.(\w+)\s*=/;
|
|
118
|
-
const n = s.match(r);
|
|
119
|
-
if (n && n.length > 1) {
|
|
120
|
-
let o = n[1];
|
|
121
|
-
Pa(e, o, t, s);
|
|
122
|
-
}
|
|
123
|
-
je(s);
|
|
124
|
-
return;
|
|
125
|
-
} catch (a) {
|
|
126
|
-
return console.error("网络异常,无法加载图标库:", a), null;
|
|
127
|
-
}
|
|
128
|
-
}, je = (e) => {
|
|
129
|
-
const t = document.createElement("script");
|
|
130
|
-
t.textContent = e, document.head.appendChild(t);
|
|
131
|
-
}, Pa = (e, t, a, s) => {
|
|
132
|
-
let r = `icon_cache:${e}`;
|
|
133
|
-
const n = {
|
|
134
|
-
windowKey: t,
|
|
135
|
-
monoColor: a,
|
|
136
|
-
scriptContent: s,
|
|
137
|
-
expireTime: Date.now() + Ta
|
|
138
|
-
// 缓存时间:7天
|
|
139
|
-
};
|
|
140
|
-
localStorage.setItem(r, JSON.stringify(n));
|
|
141
|
-
}, Be = (e) => {
|
|
142
|
-
let t = `icon_cache:${e}`;
|
|
143
|
-
const a = localStorage.getItem(t);
|
|
144
|
-
if (!a) return null;
|
|
145
|
-
let s;
|
|
146
|
-
try {
|
|
147
|
-
s = JSON.parse(a);
|
|
148
|
-
} catch (r) {
|
|
149
|
-
return console.error("解析缓存失败:", r), null;
|
|
150
|
-
}
|
|
151
|
-
return s.expireTime < Date.now() ? (localStorage.removeItem(e), null) : s;
|
|
152
|
-
}, Tt = () => {
|
|
153
|
-
const e = Date.now();
|
|
154
|
-
for (const t in localStorage)
|
|
155
|
-
if (t.startsWith("icon_cache:")) {
|
|
156
|
-
const a = localStorage.getItem(t);
|
|
157
|
-
a && JSON.parse(a).expireTime < e && localStorage.removeItem(t);
|
|
158
|
-
}
|
|
159
|
-
}, X = (e, t, a) => {
|
|
160
|
-
setTimeout(() => {
|
|
161
|
-
t.value = a, t.value && (e.value = C.value[t.value]);
|
|
162
|
-
}, 1);
|
|
163
|
-
}, Se = D(
|
|
164
|
-
"svg",
|
|
165
|
-
{ class: "w-4 h-4", viewBox: "0 0 50 50", style: { animation: "rotate 2s linear infinite" } },
|
|
166
|
-
[
|
|
167
|
-
D("circle", {
|
|
168
|
-
cx: "25",
|
|
169
|
-
cy: "25",
|
|
170
|
-
r: "20",
|
|
171
|
-
stroke: "currentColor",
|
|
172
|
-
fill: "none",
|
|
173
|
-
style: { strokeWidth: "3 !important" }
|
|
174
|
-
// 强制应用线宽
|
|
175
|
-
}),
|
|
176
|
-
D("circle", {
|
|
177
|
-
cx: "25",
|
|
178
|
-
cy: "6",
|
|
179
|
-
r: "6",
|
|
180
|
-
fill: "currentColor"
|
|
181
|
-
})
|
|
182
|
-
]
|
|
183
|
-
), ka = (e, t) => {
|
|
184
|
-
const a = Be(e);
|
|
185
|
-
Object.keys(window).forEach((s) => {
|
|
186
|
-
s.startsWith("_iconfont_svg_string_") && (a == null ? void 0 : a.windowKey) === s && !Ue.has(s) && (Ue.add(s), La(s, t));
|
|
187
|
-
});
|
|
188
|
-
}, La = (e, t) => {
|
|
189
|
-
const a = window[e], n = new DOMParser().parseFromString(a, "image/svg+xml").getElementsByTagName("symbol"), o = document.querySelectorAll("symbol");
|
|
190
|
-
for (const i of n) {
|
|
191
|
-
const l = i.id, u = Array.from(o).find((c) => c.id === l);
|
|
192
|
-
u && t && (u.innerHTML = i.innerHTML, u.querySelectorAll("*").forEach((c) => {
|
|
193
|
-
c.hasAttribute("fill") && c.removeAttribute("fill");
|
|
194
|
-
})), C.value[l] || (C.value[l] = D("svg", { fill: "currentColor" }, [D("use", { "xlink:href": `#${l}` })]));
|
|
195
|
-
}
|
|
196
|
-
}, Ma = (e, t) => {
|
|
197
|
-
let a = "";
|
|
198
|
-
return e && (a += `rotate(${e}deg)`), t && (a += " scaleX(-1)"), a;
|
|
199
|
-
}, $a = "settingInfoStore", wt = Y("settingInfo", {
|
|
200
|
-
state: () => ({
|
|
201
|
-
fullscreen: !1,
|
|
202
|
-
menuCollapse: !1,
|
|
203
|
-
tableColumns: {}
|
|
204
|
-
}),
|
|
205
|
-
actions: {
|
|
206
|
-
/**
|
|
207
|
-
* 设置全屏
|
|
208
|
-
*/
|
|
209
|
-
setFullscreen(e) {
|
|
210
|
-
this.$patch({
|
|
211
|
-
fullscreen: e
|
|
212
|
-
});
|
|
213
|
-
},
|
|
214
|
-
/**
|
|
215
|
-
* 设置主菜单区折叠
|
|
216
|
-
*/
|
|
217
|
-
setMenuCollapse(e) {
|
|
218
|
-
this.$patch({
|
|
219
|
-
menuCollapse: e
|
|
220
|
-
});
|
|
221
|
-
},
|
|
222
|
-
/**
|
|
223
|
-
* 获取表格头配置
|
|
224
|
-
*/
|
|
225
|
-
getTableColumns(e) {
|
|
226
|
-
return this.tableColumns[e];
|
|
227
|
-
},
|
|
228
|
-
/**
|
|
229
|
-
* 设置表格头配置
|
|
230
|
-
*/
|
|
231
|
-
setTableColumns(e, t) {
|
|
232
|
-
this.$patch({
|
|
233
|
-
tableColumns: {
|
|
234
|
-
...this.tableColumns,
|
|
235
|
-
[e]: t
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
persist: {
|
|
241
|
-
key: $a,
|
|
242
|
-
storage: localStorage,
|
|
243
|
-
pick: ["fullscreen", "menuCollapse", "tableColumns"]
|
|
244
|
-
}
|
|
245
|
-
}), Ot = /* @__PURE__ */ W({
|
|
246
|
-
inheritAttrs: !1,
|
|
247
|
-
__name: "index",
|
|
248
|
-
props: {
|
|
249
|
-
...ne,
|
|
250
|
-
autoload: {
|
|
251
|
-
type: Boolean,
|
|
252
|
-
default: !1
|
|
253
|
-
},
|
|
254
|
-
value: {
|
|
255
|
-
type: [String, Number, null, Array],
|
|
256
|
-
default: void 0
|
|
257
|
-
},
|
|
258
|
-
/**
|
|
259
|
-
* 查询字段
|
|
260
|
-
* - 模糊查询
|
|
261
|
-
*/
|
|
262
|
-
searchField: {
|
|
263
|
-
type: String
|
|
264
|
-
},
|
|
265
|
-
/**
|
|
266
|
-
* 自定义查询参数
|
|
267
|
-
* - 查询参数
|
|
268
|
-
* - query参数
|
|
269
|
-
*/
|
|
270
|
-
onsearch: {
|
|
271
|
-
type: Function
|
|
272
|
-
},
|
|
273
|
-
/**
|
|
274
|
-
* 修改输入数据则自动清空关联数据
|
|
275
|
-
*/
|
|
276
|
-
autoClean: {
|
|
277
|
-
type: Boolean,
|
|
278
|
-
default: !0
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
emits: ["update:value", "select", "change", "update:labels"],
|
|
282
|
-
setup(e, { emit: t }) {
|
|
283
|
-
var w, m, b;
|
|
284
|
-
const a = e, s = ae(), r = f({
|
|
285
|
-
...a.url,
|
|
286
|
-
url: ((w = a.url) == null ? void 0 : w.url) || "",
|
|
287
|
-
fieldMap: a.fieldMap || ((m = a.url) == null ? void 0 : m.fieldMap),
|
|
288
|
-
params: a.params || ((b = a.url) == null ? void 0 : b.params),
|
|
289
|
-
loadingText: !1
|
|
290
|
-
}), n = f(void 0);
|
|
291
|
-
T(
|
|
292
|
-
() => a.value,
|
|
293
|
-
() => {
|
|
294
|
-
n.value = a.value;
|
|
295
|
-
},
|
|
296
|
-
{ immediate: !0 }
|
|
297
|
-
), T(
|
|
298
|
-
() => n.value,
|
|
299
|
-
(g) => {
|
|
300
|
-
a.autoClean && a.formData && a.outFields && g !== a.value && na(a.formData, a.outFields, null);
|
|
301
|
-
}
|
|
302
|
-
);
|
|
303
|
-
const o = ue(), { editorCtrl: i, errInfo: l, labelText: u } = o, c = t;
|
|
304
|
-
o.inputEmit = c;
|
|
305
|
-
const p = f([]), h = (g) => {
|
|
306
|
-
var M;
|
|
307
|
-
if (p.value = [], g === "") return;
|
|
308
|
-
let d = g.trim(), I = {
|
|
309
|
-
...r.value.params,
|
|
310
|
-
Query: {
|
|
311
|
-
...(M = r.value.params) == null ? void 0 : M.Query
|
|
312
|
-
}
|
|
313
|
-
};
|
|
314
|
-
a.searchField && (I.Query[a.searchField] = {
|
|
315
|
-
$like: "%" + d + "%"
|
|
316
|
-
}), a.onsearch && a.onsearch(d, I), ce(!0, a, p, o, r.value, I);
|
|
317
|
-
}, v = (g) => {
|
|
318
|
-
const d = pe(a, g, p, o);
|
|
319
|
-
c("update:value", g), c("select", g);
|
|
320
|
-
const I = de(d);
|
|
321
|
-
c("update:labels", I), l != null && l.value.errClass && i && le(i);
|
|
322
|
-
};
|
|
323
|
-
return te(() => {
|
|
324
|
-
r.value && !r.value.fieldMap && (r.value.fieldMap = {
|
|
325
|
-
title: "Name",
|
|
326
|
-
label: "Name",
|
|
327
|
-
value: "Name",
|
|
328
|
-
key: "Id"
|
|
329
|
-
});
|
|
330
|
-
}), se(() => {
|
|
331
|
-
fe(a, o);
|
|
332
|
-
}), (g, d) => {
|
|
333
|
-
var I;
|
|
334
|
-
return E(), O("div", null, [
|
|
335
|
-
q(x(pa), re({
|
|
336
|
-
value: n.value,
|
|
337
|
-
"onUpdate:value": d[0] || (d[0] = (M) => n.value = M),
|
|
338
|
-
class: [(I = x(l)) == null ? void 0 : I.errClass, "error w-full"],
|
|
339
|
-
options: p.value,
|
|
340
|
-
onSearch: h,
|
|
341
|
-
onSelect: v,
|
|
342
|
-
placeholder: a.url && !a.url.loading ? "请输入并选择" + x(u) : ""
|
|
343
|
-
}, x(s)), null, 16, ["value", "class", "options", "placeholder"])
|
|
344
|
-
]);
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
}), Da = { class: "min-h-[32px] pt-[5px]" }, Fa = {
|
|
348
|
-
key: 1,
|
|
349
|
-
class: "text-center text-gray-500"
|
|
350
|
-
}, Pt = /* @__PURE__ */ W({
|
|
351
|
-
inheritAttrs: !1,
|
|
352
|
-
__name: "index",
|
|
353
|
-
props: {
|
|
354
|
-
...ne,
|
|
355
|
-
nodata: {
|
|
356
|
-
type: String,
|
|
357
|
-
default: ""
|
|
358
|
-
},
|
|
359
|
-
/**
|
|
360
|
-
* 换行数量
|
|
361
|
-
*/
|
|
362
|
-
wrap: {
|
|
363
|
-
type: Number
|
|
364
|
-
},
|
|
365
|
-
disabledItems: {
|
|
366
|
-
type: Array
|
|
367
|
-
}
|
|
368
|
-
},
|
|
369
|
-
emits: ["change", "update:labels"],
|
|
370
|
-
setup(e, { emit: t }) {
|
|
371
|
-
var c, p, h;
|
|
372
|
-
const a = e, s = ae(), r = f({
|
|
373
|
-
...a.url,
|
|
374
|
-
url: ((c = a.url) == null ? void 0 : c.url) || "",
|
|
375
|
-
fieldMap: a.fieldMap || ((p = a.url) == null ? void 0 : p.fieldMap),
|
|
376
|
-
params: a.params || ((h = a.url) == null ? void 0 : h.params),
|
|
377
|
-
loadingText: !1
|
|
378
|
-
}), n = ue(), { errInfo: o } = n, i = t;
|
|
379
|
-
n.inputEmit = i;
|
|
380
|
-
const l = f([]), u = (v) => {
|
|
381
|
-
const m = pe(a, v, l, n), b = de(m);
|
|
382
|
-
i("update:labels", b);
|
|
383
|
-
};
|
|
384
|
-
return te(() => {
|
|
385
|
-
r.value && !r.value.fieldMap && (r.value.fieldMap = {
|
|
386
|
-
title: "Name",
|
|
387
|
-
label: "Name",
|
|
388
|
-
value: "Id",
|
|
389
|
-
key: "Id"
|
|
390
|
-
}), ce(a.autoload, a, l, n, r.value, r.value.params);
|
|
391
|
-
}), se(() => {
|
|
392
|
-
fe(a, n);
|
|
393
|
-
}), (v, w) => (E(), O("div", Da, [
|
|
394
|
-
q(x(da), re({
|
|
395
|
-
onChange: u,
|
|
396
|
-
class: "w-full mb-[-3px]"
|
|
397
|
-
}, x(s)), {
|
|
398
|
-
default: H(() => [
|
|
399
|
-
l.value.length > 0 ? (E(!0), O(B, { key: 0 }, Ee(l.value, (m) => {
|
|
400
|
-
var b;
|
|
401
|
-
return E(), Ae(x(ha), {
|
|
402
|
-
key: m.value,
|
|
403
|
-
value: m.value,
|
|
404
|
-
disabled: m.disabled || m.value && e.disabledItems && e.disabledItems.indexOf(m.value.toString()) > -1,
|
|
405
|
-
class: Ge([
|
|
406
|
-
((b = x(o)) == null ? void 0 : b.errClass) === "error" ? "error !text-red-400" : "",
|
|
407
|
-
"text-nowrap",
|
|
408
|
-
"pb-1",
|
|
409
|
-
e.wrap ? `w-1/${a.wrap}` : ""
|
|
410
|
-
])
|
|
411
|
-
}, {
|
|
412
|
-
default: H(() => [
|
|
413
|
-
Re(J(m.label), 1)
|
|
414
|
-
]),
|
|
415
|
-
_: 2
|
|
416
|
-
}, 1032, ["value", "disabled", "class"]);
|
|
417
|
-
}), 128)) : e.nodata ? (E(), O("div", Fa, J(e.nodata), 1)) : j("", !0)
|
|
418
|
-
]),
|
|
419
|
-
_: 1
|
|
420
|
-
}, 16)
|
|
421
|
-
]));
|
|
422
|
-
}
|
|
423
|
-
}), Na = { class: "min-h-[32px] pt-1" }, Ca = {
|
|
424
|
-
key: 1,
|
|
425
|
-
class: "text-center text-gray-500"
|
|
426
|
-
}, kt = /* @__PURE__ */ W({
|
|
427
|
-
inheritAttrs: !1,
|
|
428
|
-
__name: "index",
|
|
429
|
-
props: {
|
|
430
|
-
...ne,
|
|
431
|
-
value: {
|
|
432
|
-
type: [String, Number, null, Array],
|
|
433
|
-
default: void 0
|
|
434
|
-
},
|
|
435
|
-
nodata: {
|
|
436
|
-
type: String,
|
|
437
|
-
default: "无数据"
|
|
438
|
-
},
|
|
439
|
-
/**
|
|
440
|
-
* 换行数量
|
|
441
|
-
*/
|
|
442
|
-
wrap: {
|
|
443
|
-
type: Number
|
|
444
|
-
}
|
|
445
|
-
},
|
|
446
|
-
emits: ["change", "update:value", "update:labels"],
|
|
447
|
-
setup(e, { emit: t }) {
|
|
448
|
-
var h, v, w;
|
|
449
|
-
const a = e, s = ae(), r = f({
|
|
450
|
-
...a.url,
|
|
451
|
-
url: ((h = a.url) == null ? void 0 : h.url) || "",
|
|
452
|
-
fieldMap: a.fieldMap || ((v = a.url) == null ? void 0 : v.fieldMap),
|
|
453
|
-
params: a.params || ((w = a.url) == null ? void 0 : w.params),
|
|
454
|
-
loadingText: !1
|
|
455
|
-
}), n = f(a.value), o = ue(), { errInfo: i } = o, l = f([]), u = t;
|
|
456
|
-
o.inputEmit = u, T(
|
|
457
|
-
() => n.value,
|
|
458
|
-
(m) => {
|
|
459
|
-
u("update:value", m);
|
|
460
|
-
}
|
|
461
|
-
);
|
|
462
|
-
const c = (m, b) => {
|
|
463
|
-
if (typeof m == "object" && typeof b == "object") {
|
|
464
|
-
const g = JSON.stringify(m) === JSON.stringify(b);
|
|
465
|
-
return g && (n.value = m), g;
|
|
466
|
-
}
|
|
467
|
-
return m === b;
|
|
468
|
-
}, p = (m) => {
|
|
469
|
-
const b = m.target.value, g = pe(a, b, l, o), d = de(g);
|
|
470
|
-
u("update:labels", d);
|
|
471
|
-
};
|
|
472
|
-
return te(() => {
|
|
473
|
-
var m;
|
|
474
|
-
r.value && !r.value.fieldMap && (r.value.fieldMap = {
|
|
475
|
-
label: "Name",
|
|
476
|
-
value: "Id",
|
|
477
|
-
key: "Id"
|
|
478
|
-
}), ce(a.autoload, a, l, o, r.value, (m = r.value) == null ? void 0 : m.params);
|
|
479
|
-
}), se(() => {
|
|
480
|
-
fe(a, o);
|
|
481
|
-
}), (m, b) => (E(), O("div", Na, [
|
|
482
|
-
q(x(ma), re({
|
|
483
|
-
value: n.value,
|
|
484
|
-
"onUpdate:value": b[0] || (b[0] = (g) => n.value = g),
|
|
485
|
-
autocheck: !1,
|
|
486
|
-
onChange: p,
|
|
487
|
-
class: "w-full flex align-items flex-wrap mb-[-3px]"
|
|
488
|
-
}, x(s)), {
|
|
489
|
-
default: H(() => [
|
|
490
|
-
l.value.length > 0 ? (E(!0), O(B, { key: 0 }, Ee(l.value, (g) => {
|
|
491
|
-
var d;
|
|
492
|
-
return E(), O(B, {
|
|
493
|
-
key: g.value
|
|
494
|
-
}, [
|
|
495
|
-
g.visible !== !1 ? (E(), Ae(x(va), {
|
|
496
|
-
key: 0,
|
|
497
|
-
checked: c(g.value, a.value),
|
|
498
|
-
value: g.value,
|
|
499
|
-
class: Ge([
|
|
500
|
-
((d = x(i)) == null ? void 0 : d.errClass) === "error" ? "error !text-red-400" : "",
|
|
501
|
-
"text-nowrap",
|
|
502
|
-
"pb-1",
|
|
503
|
-
e.wrap ? `w-1/${a.wrap}` : ""
|
|
504
|
-
])
|
|
505
|
-
}, {
|
|
506
|
-
default: H(() => [
|
|
507
|
-
Re(J(g.label), 1)
|
|
508
|
-
]),
|
|
509
|
-
_: 2
|
|
510
|
-
}, 1032, ["checked", "value", "class"])) : j("", !0)
|
|
511
|
-
], 64);
|
|
512
|
-
}), 128)) : e.nodata ? (E(), O("div", Ca, J(e.nodata), 1)) : j("", !0)
|
|
513
|
-
]),
|
|
514
|
-
_: 1
|
|
515
|
-
}, 16, ["value"])
|
|
516
|
-
]));
|
|
517
|
-
}
|
|
518
|
-
}), Ua = {
|
|
519
|
-
key: 0,
|
|
520
|
-
class: "absolute z-10 mt-[5px] mr-[10px] text-[#999] flex items-center"
|
|
521
|
-
}, Lt = /* @__PURE__ */ W({
|
|
522
|
-
inheritAttrs: !1,
|
|
523
|
-
__name: "index",
|
|
524
|
-
props: {
|
|
525
|
-
...ne,
|
|
526
|
-
value: {
|
|
527
|
-
type: [String, Number, Array, null],
|
|
528
|
-
default: void 0
|
|
529
|
-
},
|
|
530
|
-
/**
|
|
531
|
-
* 自动选择第一个选项
|
|
532
|
-
*/
|
|
533
|
-
selectFirst: {
|
|
534
|
-
type: Boolean,
|
|
535
|
-
default: !1
|
|
536
|
-
},
|
|
537
|
-
/**
|
|
538
|
-
* 数据源OPTIONS的key
|
|
539
|
-
*/
|
|
540
|
-
dataKey: {
|
|
541
|
-
type: String,
|
|
542
|
-
required: !1
|
|
543
|
-
},
|
|
544
|
-
/**
|
|
545
|
-
* 是否显示全部选项
|
|
546
|
-
*/
|
|
547
|
-
all: {
|
|
548
|
-
type: Boolean,
|
|
549
|
-
default: !1
|
|
550
|
-
},
|
|
551
|
-
/**
|
|
552
|
-
* 自定义全部选项的值
|
|
553
|
-
* 如果all为true,则显示全部选项
|
|
554
|
-
* 未设置allValue,则默认[0, 1]
|
|
555
|
-
*/
|
|
556
|
-
allValue: {
|
|
557
|
-
type: [String, Number, Array],
|
|
558
|
-
required: !1
|
|
559
|
-
}
|
|
560
|
-
},
|
|
561
|
-
emits: ["change", "update:value", "update:labels"],
|
|
562
|
-
setup(e, { emit: t }) {
|
|
563
|
-
var m, b, g;
|
|
564
|
-
const a = e, s = ae(), r = f({
|
|
565
|
-
...a.url,
|
|
566
|
-
url: ((m = a.url) == null ? void 0 : m.url) || "",
|
|
567
|
-
fieldMap: a.fieldMap || ((b = a.url) == null ? void 0 : b.fieldMap),
|
|
568
|
-
params: a.params || ((g = a.url) == null ? void 0 : g.params),
|
|
569
|
-
loadingText: !1
|
|
570
|
-
}), n = ue(), { editorCtrl: o, errInfo: i, labelText: l } = n, u = f(void 0), c = t;
|
|
571
|
-
n.inputEmit = c;
|
|
572
|
-
const p = f([]);
|
|
573
|
-
T(
|
|
574
|
-
() => p.value,
|
|
575
|
-
(d) => {
|
|
576
|
-
d.length > 0 && F(a.value) && a.selectFirst ? (u.value = d[0].value, w(d[0].value)) : u.value = a.value === null ? void 0 : a.value;
|
|
577
|
-
}
|
|
578
|
-
);
|
|
579
|
-
const h = f(s.placeholder);
|
|
580
|
-
T(
|
|
581
|
-
() => r.value.loading,
|
|
582
|
-
(d) => {
|
|
583
|
-
d ? h.value = "" : h.value || (h.value = "请选择" + l.value);
|
|
584
|
-
},
|
|
585
|
-
{ immediate: !0 }
|
|
586
|
-
);
|
|
587
|
-
const v = f(a.value);
|
|
588
|
-
T(
|
|
589
|
-
() => u.value,
|
|
590
|
-
(d) => {
|
|
591
|
-
if (s.mode === "multiple" && F(d) && F(v.value)) {
|
|
592
|
-
c("update:value", v.value);
|
|
593
|
-
return;
|
|
594
|
-
}
|
|
595
|
-
c("update:value", d);
|
|
596
|
-
}
|
|
597
|
-
);
|
|
598
|
-
const w = (d) => {
|
|
599
|
-
const I = pe(a, d, p, n), M = de(I);
|
|
600
|
-
u.value = d, c("update:labels", M), c("change", d), i != null && i.value.errClass && o && le(o);
|
|
601
|
-
};
|
|
602
|
-
return te(() => {
|
|
603
|
-
var d;
|
|
604
|
-
if (r.value && !r.value.fieldMap && (r.value.fieldMap = {
|
|
605
|
-
label: "Name",
|
|
606
|
-
value: "Id",
|
|
607
|
-
key: "Id"
|
|
608
|
-
}), a.dataKey) {
|
|
609
|
-
const I = JSON.parse(JSON.stringify(L.getOptions(a.dataKey)));
|
|
610
|
-
p.value = I;
|
|
611
|
-
} else ce(a.autoload, a, p, n, r.value, (d = r.value) == null ? void 0 : d.params);
|
|
612
|
-
}), se(() => {
|
|
613
|
-
fe(a, n);
|
|
614
|
-
}), (d, I) => {
|
|
615
|
-
var M;
|
|
616
|
-
return E(), O("div", null, [
|
|
617
|
-
a.url && a.url.loading === !0 ? (E(), O("div", Ua, [
|
|
618
|
-
q(x(Se), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
|
|
619
|
-
I[1] || (I[1] = ua("span", null, "数据加载中...", -1))
|
|
620
|
-
])) : j("", !0),
|
|
621
|
-
q(x(ga), re({
|
|
622
|
-
class: [(M = x(i)) == null ? void 0 : M.errClass, "w-full"],
|
|
623
|
-
value: u.value,
|
|
624
|
-
"onUpdate:value": I[0] || (I[0] = (K) => u.value = K),
|
|
625
|
-
"allow-clear": !0,
|
|
626
|
-
onChange: w,
|
|
627
|
-
placeholder: h.value,
|
|
628
|
-
"label-in-value": !1
|
|
629
|
-
}, x(s)), {
|
|
630
|
-
default: H(() => [
|
|
631
|
-
(E(!0), O(B, null, Ee(p.value, (K) => (E(), O(B, {
|
|
632
|
-
key: K.value
|
|
633
|
-
}, [
|
|
634
|
-
K.visible !== !1 ? (E(), Ae(x(ya), {
|
|
635
|
-
key: 0,
|
|
636
|
-
value: K.value
|
|
637
|
-
}, {
|
|
638
|
-
default: H(() => [
|
|
639
|
-
Re(J(K.label), 1)
|
|
640
|
-
]),
|
|
641
|
-
_: 2
|
|
642
|
-
}, 1032, ["value"])) : j("", !0)
|
|
643
|
-
], 64))), 128))
|
|
644
|
-
]),
|
|
645
|
-
_: 1
|
|
646
|
-
}, 16, ["class", "value", "placeholder"])
|
|
647
|
-
]);
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
});
|
|
13
|
+
import "dayjs";
|
|
14
|
+
import "vue-draggable-next";
|
|
15
|
+
const Ta = ba();
|
|
16
|
+
Ta.use(Sa);
|
|
651
17
|
var $ = /* @__PURE__ */ ((e) => (e.PageControl = "Page.PageControl", e.EditorControl = "Page.EditorControl", e.GridControl = "Page.GridControl", e.LabelText = "FormItem.LabelText", e.RuleKey = "FormItem.RuleKey", e.ErrInfo = "FormItem.ErrInfo", e))($ || {});
|
|
652
18
|
const R = class R {
|
|
653
19
|
};
|
|
@@ -744,7 +110,7 @@ L.setOptions("EnableDisable", L.EnableDisable);
|
|
|
744
110
|
L.setOptions("SuccessResult", L.SuccessResult);
|
|
745
111
|
L.setOptions("YesNo", L.YesNo);
|
|
746
112
|
L.setOptions("MaleFemale", L.MaleFemale);
|
|
747
|
-
const
|
|
113
|
+
const oe = {
|
|
748
114
|
/**
|
|
749
115
|
* 自动接口加载数据
|
|
750
116
|
* - 默认为true
|
|
@@ -836,29 +202,29 @@ const ne = {
|
|
|
836
202
|
type: [String, Array],
|
|
837
203
|
required: !1
|
|
838
204
|
}
|
|
839
|
-
},
|
|
840
|
-
var
|
|
205
|
+
}, D = (e) => e == null || e === "" ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1, ie = (e, t) => {
|
|
206
|
+
var n;
|
|
841
207
|
return {
|
|
842
208
|
url: "",
|
|
843
|
-
...(
|
|
209
|
+
...(n = e.page.urls) == null ? void 0 : n[t.urlKey],
|
|
844
210
|
...e.url,
|
|
845
211
|
...t.url,
|
|
846
212
|
loadingText: t.loadingText
|
|
847
213
|
};
|
|
848
|
-
},
|
|
214
|
+
}, le = (e, t) => {
|
|
849
215
|
const a = e.page, s = t.url;
|
|
850
216
|
if (!s || !s.url) {
|
|
851
|
-
const
|
|
852
|
-
return console.warn(
|
|
217
|
+
const r = `URL未设置: ${t.urlKey}`;
|
|
218
|
+
return console.warn(r), Promise.reject(new Error(r));
|
|
853
219
|
}
|
|
854
220
|
s.api || (s.api = a.api), s.authorize === void 0 && (s.authorize = a.authorize);
|
|
855
|
-
let
|
|
856
|
-
return t.processParams && (
|
|
857
|
-
},
|
|
221
|
+
let n = JSON.parse(JSON.stringify(t.params));
|
|
222
|
+
return t.processParams && (n = t.processParams(n)), t.loadingState && (t.loadingState.value = !0), t.hideErrorToast && (s.hideErrorToast = !0), _(s, n).then((r) => (t.loadingState && (t.loadingState.value = !1), r)).catch((r) => (t.loadingState && (t.loadingState.value = !1), null));
|
|
223
|
+
}, Pe = (e, t) => {
|
|
858
224
|
t.params || (t.params = {}), t.params.Query || (t.params.Query = {});
|
|
859
|
-
const a =
|
|
860
|
-
return t.url = a,
|
|
861
|
-
},
|
|
225
|
+
const a = ie(e, t);
|
|
226
|
+
return t.url = a, le(e, t);
|
|
227
|
+
}, At = (e, t) => (t.params || (t.params = {}), t.params.Query || (t.params.Query = {}), t.loadingText = t.loadingText === !1 ? !1 : t.loadingText || "开始执行...", t.url = ie(e, t), le(e, t).then((a) => ((a == null ? void 0 : a.status) === A.SUCCESS && (t.hideErrorToast || S.success("执行成功!")), a))), je = (e, t = {}) => {
|
|
862
228
|
const a = t.primaryKey || "Id";
|
|
863
229
|
if (t.params || (t.params = {}), t.params.Query || (t.params.Query = {}), !t.params.Data)
|
|
864
230
|
return S.error("错误!无保存数据!"), Promise.resolve(null);
|
|
@@ -868,30 +234,30 @@ const ne = {
|
|
|
868
234
|
loadingText: t.loadingText === !1 ? !1 : t.loadingText || "数据保存中..."
|
|
869
235
|
};
|
|
870
236
|
s.params.Query[a] = s.params.Data[a];
|
|
871
|
-
const
|
|
872
|
-
return s.url =
|
|
873
|
-
},
|
|
237
|
+
const n = ie(e, s);
|
|
238
|
+
return s.url = n, le(e, s).then((r) => ((r == null ? void 0 : r.status) === A.SUCCESS && (t.hideErrorToast || S.success("保存成功!")), r));
|
|
239
|
+
}, wa = (e, t, a = {}) => {
|
|
874
240
|
const s = a.primaryKey || "Id";
|
|
875
241
|
a.params || (a.params = {}), a.params.Query || (a.params.Query = {});
|
|
876
|
-
const
|
|
242
|
+
const n = {
|
|
877
243
|
...a,
|
|
878
244
|
urlKey: "delete",
|
|
879
245
|
loadingText: a.loadingText === !1 ? !1 : a.loadingText || "数据删除中..."
|
|
880
246
|
};
|
|
881
|
-
if (Array.isArray(t) ?
|
|
247
|
+
if (Array.isArray(t) ? n.params.Query[s] = t : n.params.Query[s] = t[s], D(n.params.Query) || D(n.params.Query[s]))
|
|
882
248
|
return S.error("错误!禁止无条件删除数据!"), Promise.resolve(null);
|
|
883
|
-
const
|
|
884
|
-
return
|
|
885
|
-
},
|
|
249
|
+
const r = ie(e, n);
|
|
250
|
+
return n.url = r, le(e, n).then((o) => ((o == null ? void 0 : o.status) === A.SUCCESS && (a.hideErrorToast || S.success("删除成功!")), o));
|
|
251
|
+
}, Oa = (e, t) => Pe(e, {
|
|
886
252
|
urlKey: "tree",
|
|
887
253
|
params: {},
|
|
888
254
|
loadingState: e.isTreeLoading,
|
|
889
255
|
loadingText: !1,
|
|
890
|
-
processParams: () =>
|
|
256
|
+
processParams: () => we(e.treeQuery, t)
|
|
891
257
|
}).then((a) => (a == null ? void 0 : a.status) === A.SUCCESS ? (e.data.value = a.data, e.data.value) : []);
|
|
892
258
|
let z;
|
|
893
|
-
const
|
|
894
|
-
z = new
|
|
259
|
+
const Rt = (e) => {
|
|
260
|
+
z = new Oe({}), z.messages({
|
|
895
261
|
required: "${label}不能为空",
|
|
896
262
|
types: {
|
|
897
263
|
number: "${label}必须是数字"
|
|
@@ -917,37 +283,37 @@ const $t = (e) => {
|
|
|
917
283
|
},
|
|
918
284
|
...e
|
|
919
285
|
});
|
|
920
|
-
},
|
|
921
|
-
if (!e ||
|
|
286
|
+
}, Tt = (e) => {
|
|
287
|
+
if (!e || D(e))
|
|
922
288
|
return [];
|
|
923
|
-
const t = [], a = z.messages(), s = (
|
|
289
|
+
const t = [], a = z.messages(), s = (r, o, i) => {
|
|
924
290
|
const l = o.type;
|
|
925
291
|
if (l && a.types && l in a.types) {
|
|
926
292
|
const c = a.types[l];
|
|
927
|
-
|
|
293
|
+
n(c, r, { type: l }, i);
|
|
928
294
|
}
|
|
929
295
|
const u = ["string", "number", "array"];
|
|
930
296
|
for (const c of u)
|
|
931
297
|
if (l === c && a[c]) {
|
|
932
298
|
const p = a[c], h = ["len", "min", "max", "range"];
|
|
933
299
|
for (const v of h)
|
|
934
|
-
v === "range" && o.min != null && o.max != null && p.range ?
|
|
300
|
+
v === "range" && o.min != null && o.max != null && p.range ? n(p.range, r, { min: o.min, max: o.max }, i) : v !== "range" && o[v] != null && p[v] && n(p[v], r, { [v]: o[v] }, i);
|
|
935
301
|
}
|
|
936
|
-
if (o.required && a.required &&
|
|
302
|
+
if (o.required && a.required && n(a.required, r, {}, i), o.pattern && a.pattern && n(o.message, r, {}, i), o.enum && Array.isArray(o.enum) && a.enum) {
|
|
937
303
|
const c = o.enum.join(", ");
|
|
938
|
-
|
|
304
|
+
n(a.enum, r, { enum: c }, i);
|
|
939
305
|
}
|
|
940
|
-
},
|
|
941
|
-
if (
|
|
306
|
+
}, n = (r, o, i, l) => {
|
|
307
|
+
if (r)
|
|
942
308
|
try {
|
|
943
309
|
let u;
|
|
944
|
-
if (typeof
|
|
310
|
+
if (typeof r == "function") {
|
|
945
311
|
const c = [o];
|
|
946
312
|
for (const p in i)
|
|
947
313
|
c.push(i[p]);
|
|
948
|
-
u =
|
|
314
|
+
u = r.apply(null, c), u && l.push(u);
|
|
949
315
|
} else {
|
|
950
|
-
u = String(
|
|
316
|
+
u = String(r);
|
|
951
317
|
for (const c in i)
|
|
952
318
|
u = u.replace(new RegExp(`\\$\\{${c}\\}`, "g"), i[c]);
|
|
953
319
|
u = u.replace(/\$\{label\}/g, ""), u && l.push(u);
|
|
@@ -956,29 +322,29 @@ const $t = (e) => {
|
|
|
956
322
|
console.error("格式化验证消息出错:", u);
|
|
957
323
|
}
|
|
958
324
|
};
|
|
959
|
-
return Object.keys(e).forEach((
|
|
960
|
-
const o = e[
|
|
325
|
+
return Object.keys(e).forEach((r) => {
|
|
326
|
+
const o = e[r], i = [];
|
|
961
327
|
try {
|
|
962
|
-
s(
|
|
963
|
-
u && typeof u == "object" && s(
|
|
328
|
+
s(r, o, i), Array.isArray(o) && o.forEach((u) => {
|
|
329
|
+
u && typeof u == "object" && s(r, u, i);
|
|
964
330
|
}), o && typeof o == "object" && "fields" in o;
|
|
965
331
|
} catch (u) {
|
|
966
332
|
console.error("处理验证规则出错:", u);
|
|
967
333
|
}
|
|
968
334
|
const l = Array.from(new Set(i));
|
|
969
|
-
|
|
970
|
-
field:
|
|
335
|
+
r && l.length > 0 && t.push({
|
|
336
|
+
field: r,
|
|
971
337
|
rules: l
|
|
972
338
|
});
|
|
973
339
|
}), t;
|
|
974
|
-
},
|
|
340
|
+
}, ue = async (e) => {
|
|
975
341
|
const t = e.formData.value, a = e.formRules.value;
|
|
976
|
-
|
|
342
|
+
D(a) || (ke(e), e.ruleValidator || (e.ruleValidator = new Oe({}), e.ruleValidator.messages(z.messages()), e.ruleValidator.define(a)), e.ruleResults.value = await e.ruleValidator.validate(t).then(() => {
|
|
977
343
|
}).catch(({ fields: s }) => s));
|
|
978
|
-
},
|
|
979
|
-
}).catch(({ fields: s }) => s)),
|
|
344
|
+
}, wt = async (e, t, a) => (a || (a = new Oe({}), a.messages(z.messages()), a.define(t)), a.validate(e).then(() => {
|
|
345
|
+
}).catch(({ fields: s }) => s)), ke = (e) => {
|
|
980
346
|
e.ruleResults.value = void 0;
|
|
981
|
-
},
|
|
347
|
+
}, ce = () => {
|
|
982
348
|
const e = G($.EditorControl, void 0), t = f(G($.LabelText, "")), a = f(G($.RuleKey, "")), s = G($.ErrInfo, void 0);
|
|
983
349
|
return {
|
|
984
350
|
editorCtrl: e,
|
|
@@ -986,7 +352,7 @@ const $t = (e) => {
|
|
|
986
352
|
ruleKey: a,
|
|
987
353
|
errInfo: s
|
|
988
354
|
};
|
|
989
|
-
},
|
|
355
|
+
}, Pa = (e, t) => {
|
|
990
356
|
let a = f({
|
|
991
357
|
msg: "",
|
|
992
358
|
errClass: ""
|
|
@@ -996,25 +362,25 @@ const $t = (e) => {
|
|
|
996
362
|
const s = t == null ? void 0 : t.ruleResults;
|
|
997
363
|
return T(
|
|
998
364
|
() => s == null ? void 0 : s.value,
|
|
999
|
-
(
|
|
1000
|
-
if (a.value.errClass = "", a.value.msg = "", !
|
|
1001
|
-
const
|
|
365
|
+
(n) => {
|
|
366
|
+
if (a.value.errClass = "", a.value.msg = "", !D(n)) {
|
|
367
|
+
const r = ka(
|
|
1002
368
|
{
|
|
1003
369
|
label: e.label,
|
|
1004
370
|
rule: e.rule
|
|
1005
371
|
},
|
|
1006
372
|
t == null ? void 0 : t.formRules.value,
|
|
1007
|
-
Qe(
|
|
373
|
+
Qe(n)
|
|
1008
374
|
);
|
|
1009
|
-
a.value.errClass =
|
|
375
|
+
a.value.errClass = r.errClass.value, a.value.msg = r.msg.value;
|
|
1010
376
|
}
|
|
1011
377
|
},
|
|
1012
378
|
{ deep: !0 }
|
|
1013
379
|
), a;
|
|
1014
|
-
},
|
|
1015
|
-
const s = f([]),
|
|
380
|
+
}, ka = (e, t, a) => {
|
|
381
|
+
const s = f([]), n = f(""), r = f("");
|
|
1016
382
|
if (!e.rule || !t || !a)
|
|
1017
|
-
return { msg:
|
|
383
|
+
return { msg: n, ruleErrors: s, errClass: r };
|
|
1018
384
|
e.rule.split("|").forEach((l) => {
|
|
1019
385
|
if (l = l.trim(), l)
|
|
1020
386
|
if (a[l])
|
|
@@ -1028,36 +394,36 @@ const $t = (e) => {
|
|
|
1028
394
|
});
|
|
1029
395
|
const i = /\${\w+}/g;
|
|
1030
396
|
return s.value.forEach((l) => {
|
|
1031
|
-
|
|
397
|
+
n.value && (n.value += " / "), n.value += l.message.replace("${label}", e.label ?? "");
|
|
1032
398
|
const u = t[l.field];
|
|
1033
399
|
if (u) {
|
|
1034
|
-
const c =
|
|
400
|
+
const c = n.value.match(i);
|
|
1035
401
|
c && c.forEach((p) => {
|
|
1036
402
|
const h = p.replace("${", "").replace("}", "");
|
|
1037
|
-
|
|
403
|
+
n.value = n.value.replace(p, u[h] ?? "");
|
|
1038
404
|
});
|
|
1039
405
|
}
|
|
1040
|
-
}), s.value.length > 0 && (
|
|
1041
|
-
},
|
|
1042
|
-
|
|
1043
|
-
const a =
|
|
1044
|
-
return
|
|
1045
|
-
},
|
|
1046
|
-
|
|
1047
|
-
},
|
|
406
|
+
}), s.value.length > 0 && (r.value = "error"), { msg: n, ruleErrors: s, errClass: r };
|
|
407
|
+
}, Ot = (e, t) => {
|
|
408
|
+
me($.LabelText, e.label || ""), me($.RuleKey, e.rule || "");
|
|
409
|
+
const a = Pa(e, t);
|
|
410
|
+
return me($.ErrInfo, a), a;
|
|
411
|
+
}, Pt = (e) => {
|
|
412
|
+
Be(e);
|
|
413
|
+
}, kt = (e) => {
|
|
1048
414
|
const t = e.page, a = e.formData.value;
|
|
1049
|
-
a[e.primaryKey ?? t.primaryKey] = null,
|
|
1050
|
-
},
|
|
415
|
+
a[e.primaryKey ?? t.primaryKey] = null, Be(e);
|
|
416
|
+
}, Lt = (e) => {
|
|
1051
417
|
e.visible.value = !1;
|
|
1052
|
-
},
|
|
418
|
+
}, Be = async (e) => {
|
|
1053
419
|
var s;
|
|
1054
420
|
const t = e.page;
|
|
1055
|
-
if (e.isFormSaving.value = !0,
|
|
421
|
+
if (e.isFormSaving.value = !0, ke(e), e.beforeSave && e.beforeSave() === !1)
|
|
1056
422
|
return e.isFormSaving.value = !1, Promise.resolve();
|
|
1057
|
-
if (e.formRules.value && await
|
|
423
|
+
if (e.formRules.value && await ue(e), e.ruleResults.value)
|
|
1058
424
|
return S.error("提交表单时,验证失败!"), console.error("表单验证失败!", e.ruleResults.value), e.isFormSaving.value = !1, Promise.resolve();
|
|
1059
425
|
const a = e.formData.value;
|
|
1060
|
-
return
|
|
426
|
+
return je(
|
|
1061
427
|
{
|
|
1062
428
|
page: t,
|
|
1063
429
|
// 转换为AnyControl接口
|
|
@@ -1074,12 +440,12 @@ const $t = (e) => {
|
|
|
1074
440
|
// 隐藏自动错误提示,特殊判断控制
|
|
1075
441
|
loadingState: e.isFormSaving
|
|
1076
442
|
}
|
|
1077
|
-
).then((
|
|
1078
|
-
var
|
|
1079
|
-
if ((
|
|
443
|
+
).then((n) => {
|
|
444
|
+
var r, o;
|
|
445
|
+
if ((n == null ? void 0 : n.status) === A.SUCCESS)
|
|
1080
446
|
S.success("保存成功!"), e.grid && (e.grid.reload.value = !0), e.afterSave && e.afterSave(), e.autoClose !== !1 && (e.visible.value = !1);
|
|
1081
|
-
else if (
|
|
1082
|
-
const i = (o =
|
|
447
|
+
else if (n != null && n.msg && ((r = n == null ? void 0 : n.msg) == null ? void 0 : r.indexOf("Duplicate entry")) > -1) {
|
|
448
|
+
const i = (o = n == null ? void 0 : n.msg) == null ? void 0 : o.match(/Duplicate entry '([^']+)' for key '([^']+)'/);
|
|
1083
449
|
if (i && i.length > 2 && i[1] && i[2]) {
|
|
1084
450
|
const l = i[1], u = i[2].replace(/Idx_/g, "").split("_"), c = e.formRules.value;
|
|
1085
451
|
if (c && u.length > 0) {
|
|
@@ -1095,40 +461,40 @@ const $t = (e) => {
|
|
|
1095
461
|
}), Object.keys(p).length > 0 && (console.error("保存失败!", p), e.ruleResults.value = p);
|
|
1096
462
|
}
|
|
1097
463
|
S.error(`保存失败!数据 \`${l}\` 已存在!`);
|
|
1098
|
-
} else S.error((
|
|
464
|
+
} else S.error((n == null ? void 0 : n.msg) ?? "保存失败!");
|
|
1099
465
|
} else
|
|
1100
|
-
S.error((
|
|
466
|
+
S.error((n == null ? void 0 : n.msg) ?? "保存失败!");
|
|
1101
467
|
});
|
|
1102
|
-
},
|
|
468
|
+
}, Mt = async (e) => {
|
|
1103
469
|
const t = e.page, a = e.grid;
|
|
1104
470
|
e.isFormLoading.value = !0;
|
|
1105
|
-
const s = e.formData.value,
|
|
1106
|
-
return
|
|
1107
|
-
e.isFormLoading.value = !1,
|
|
471
|
+
const s = e.formData.value, n = e.primaryKey ?? t.primaryKey;
|
|
472
|
+
return ea(a, { [n]: s[n] }, e.detailUrl).then((r) => {
|
|
473
|
+
e.isFormLoading.value = !1, r && Je(e, r);
|
|
1108
474
|
});
|
|
1109
|
-
},
|
|
475
|
+
}, $t = (e) => {
|
|
1110
476
|
const t = e.grid;
|
|
1111
|
-
t && (t.rowData.value = void 0), e && (
|
|
477
|
+
t && (t.rowData.value = void 0), e && (ze(e), e.visible && (e.visible.value = !1), setTimeout(() => {
|
|
1112
478
|
e.visible.value = !0;
|
|
1113
479
|
}, 1));
|
|
1114
|
-
},
|
|
1115
|
-
|
|
1116
|
-
},
|
|
1117
|
-
e.formData.value = e.default ? JSON.parse(JSON.stringify(e.default)) : {},
|
|
1118
|
-
}, Ie = "/login/",
|
|
480
|
+
}, Je = (e, t) => {
|
|
481
|
+
ze(e), e.formData.value = { ...e.formData.value, ...t };
|
|
482
|
+
}, ze = (e) => {
|
|
483
|
+
e.formData.value = e.default ? JSON.parse(JSON.stringify(e.default)) : {}, ke(e);
|
|
484
|
+
}, Ie = "/login/", ee = [], La = (e) => {
|
|
1119
485
|
for (const t of e) {
|
|
1120
|
-
const a =
|
|
1121
|
-
a !== -1 &&
|
|
486
|
+
const a = ee.findIndex((s) => s.path === t.path);
|
|
487
|
+
a !== -1 && ee.splice(a, 1), ee.push(t), N.addRoute(t);
|
|
1122
488
|
}
|
|
1123
|
-
},
|
|
1124
|
-
const
|
|
1125
|
-
t[
|
|
1126
|
-
},
|
|
489
|
+
}, We = (e, t, a, s = "") => {
|
|
490
|
+
const n = s + (s ? "/" : "") + e.path;
|
|
491
|
+
t[n] = { ...e, parent: a }, e.children && e.children.forEach((r) => We(r, t, e, n));
|
|
492
|
+
}, N = Aa({
|
|
1127
493
|
history: Ra("/"),
|
|
1128
|
-
routes:
|
|
1129
|
-
}),
|
|
1130
|
-
var
|
|
1131
|
-
const a = ((
|
|
494
|
+
routes: ee
|
|
495
|
+
}), Ma = (e, t) => {
|
|
496
|
+
var n, r;
|
|
497
|
+
const a = ((n = e.meta) == null ? void 0 : n.roles) ?? [], s = (r = e.meta) == null ? void 0 : r.permission;
|
|
1132
498
|
if (!t)
|
|
1133
499
|
return a.length === 0 && !s;
|
|
1134
500
|
if (t) {
|
|
@@ -1144,14 +510,14 @@ const $t = (e) => {
|
|
|
1144
510
|
}
|
|
1145
511
|
return !1;
|
|
1146
512
|
}, V = f(null);
|
|
1147
|
-
|
|
513
|
+
N.beforeEach((e, t, a) => {
|
|
1148
514
|
var i;
|
|
1149
515
|
const s = e;
|
|
1150
516
|
if (e.path.startsWith("/error/") || e.path.startsWith(Ie))
|
|
1151
517
|
return a();
|
|
1152
|
-
const
|
|
518
|
+
const n = s.meta, o = ((n == null ? void 0 : n.roles) ?? []).length > 0 || ((i = n == null ? void 0 : n.permission) == null ? void 0 : i.length);
|
|
1153
519
|
if (e.path === "/") {
|
|
1154
|
-
const l =
|
|
520
|
+
const l = F();
|
|
1155
521
|
if (!l.menuLoaded) {
|
|
1156
522
|
V.value = {
|
|
1157
523
|
to: e,
|
|
@@ -1171,37 +537,37 @@ U.beforeEach((e, t, a) => {
|
|
|
1171
537
|
if (!l.isLogin)
|
|
1172
538
|
a({ path: Ie });
|
|
1173
539
|
else {
|
|
1174
|
-
if (!
|
|
540
|
+
if (!F().menuLoaded) {
|
|
1175
541
|
V.value = {
|
|
1176
542
|
to: e,
|
|
1177
543
|
next: a
|
|
1178
544
|
};
|
|
1179
545
|
return;
|
|
1180
546
|
}
|
|
1181
|
-
const c =
|
|
547
|
+
const c = Ma(s, l.isLogin);
|
|
1182
548
|
a();
|
|
1183
549
|
}
|
|
1184
550
|
}
|
|
1185
551
|
});
|
|
1186
|
-
|
|
1187
|
-
if (qe() &&
|
|
1188
|
-
const { mainAppPush: t } =
|
|
552
|
+
N.afterEach((e) => {
|
|
553
|
+
if (qe() && Ce.value) {
|
|
554
|
+
const { mainAppPush: t } = Ce.value;
|
|
1189
555
|
t && t(e.hash);
|
|
1190
556
|
}
|
|
1191
557
|
});
|
|
1192
|
-
const
|
|
558
|
+
const $a = (e) => {
|
|
1193
559
|
if (V.value) {
|
|
1194
560
|
const { to: t, next: a } = V.value;
|
|
1195
561
|
V.value = null, t.path === "/" ? a(e) : a(t.path);
|
|
1196
562
|
}
|
|
1197
|
-
},
|
|
1198
|
-
const t =
|
|
563
|
+
}, Ca = (e) => {
|
|
564
|
+
const t = Le();
|
|
1199
565
|
if (t.TabEnabled) {
|
|
1200
|
-
if (
|
|
566
|
+
if (Da(e.key, t.TabPanes))
|
|
1201
567
|
return;
|
|
1202
568
|
t.TabPanes.push(e);
|
|
1203
569
|
}
|
|
1204
|
-
},
|
|
570
|
+
}, Da = (e, t) => t.find((a) => a.key === e), Le = Y("pageInfo", {
|
|
1205
571
|
state: () => ({
|
|
1206
572
|
TabActive: "",
|
|
1207
573
|
TabPanes: [],
|
|
@@ -1214,16 +580,16 @@ const qa = (e) => {
|
|
|
1214
580
|
*/
|
|
1215
581
|
removeTabPane(e) {
|
|
1216
582
|
if (this.TabEnabled) {
|
|
1217
|
-
|
|
583
|
+
F().excludeComponent(e);
|
|
1218
584
|
let a = 0, s = [...this.TabPanes];
|
|
1219
|
-
for (let
|
|
1220
|
-
if (s[
|
|
1221
|
-
s.splice(
|
|
585
|
+
for (let n = 0; n < s.length; n++)
|
|
586
|
+
if (s[n].key === e) {
|
|
587
|
+
s.splice(n, 1), a = n - 1 < 0 ? 0 : n - 1;
|
|
1222
588
|
break;
|
|
1223
589
|
}
|
|
1224
|
-
for (let
|
|
1225
|
-
if (s[
|
|
1226
|
-
a =
|
|
590
|
+
for (let n = 0; n < s.length; n++)
|
|
591
|
+
if (s[n].key === this.TabActive) {
|
|
592
|
+
a = n;
|
|
1227
593
|
break;
|
|
1228
594
|
}
|
|
1229
595
|
this.TabPanes = s, this.setTabActive(s[a].key);
|
|
@@ -1235,7 +601,7 @@ const qa = (e) => {
|
|
|
1235
601
|
* @returns
|
|
1236
602
|
*/
|
|
1237
603
|
async setTabActive(e) {
|
|
1238
|
-
let a =
|
|
604
|
+
let a = F().findRoute(e);
|
|
1239
605
|
if (!a) return;
|
|
1240
606
|
const s = {
|
|
1241
607
|
key: e,
|
|
@@ -1246,36 +612,36 @@ const qa = (e) => {
|
|
|
1246
612
|
// 默认为true
|
|
1247
613
|
keepAlive: !(a.meta && !a.meta.keepAlive)
|
|
1248
614
|
};
|
|
1249
|
-
|
|
615
|
+
Ca(s), this.TabActive = e;
|
|
1250
616
|
}
|
|
1251
617
|
}
|
|
1252
|
-
}),
|
|
618
|
+
}), Fa = "appInfoStore", Na = {
|
|
1253
619
|
appList: {
|
|
1254
620
|
api: "PLATFORM_API",
|
|
1255
621
|
authorize: !0,
|
|
1256
622
|
url: "/api/RCTenanetOpSrv/getApps",
|
|
1257
623
|
loadingText: !1
|
|
1258
624
|
}
|
|
1259
|
-
},
|
|
625
|
+
}, ge = /* @__PURE__ */ new Map(), Ee = (e, t) => e.map((a) => {
|
|
1260
626
|
var o, i, l, u, c, p, h, v;
|
|
1261
627
|
const s = { ...a };
|
|
1262
628
|
if (!((i = (o = s.meta) == null ? void 0 : o.roles) != null && i.length) && !((u = (l = s.meta) == null ? void 0 : l.permission) != null && u.length))
|
|
1263
|
-
return s.children && (s.children =
|
|
1264
|
-
const
|
|
1265
|
-
return
|
|
1266
|
-
}).filter(Boolean),
|
|
629
|
+
return s.children && (s.children = Ee(s.children, t)), s;
|
|
630
|
+
const n = (p = (c = s.meta) == null ? void 0 : c.roles) != null && p.length ? t.hasRole(s.meta.roles) : !1, r = (v = (h = s.meta) == null ? void 0 : h.permission) != null && v.length ? t.hasPermit(s.meta.permission, ":page") : !1;
|
|
631
|
+
return n || r ? (s.children && (s.children = Ee(s.children, t)), s) : null;
|
|
632
|
+
}).filter(Boolean), Ye = (e, t = "") => {
|
|
1267
633
|
for (const a of e) {
|
|
1268
634
|
if (!a.children && !a.redirect) {
|
|
1269
635
|
let s = t + a.path;
|
|
1270
636
|
return s.startsWith("/") || (s = "/" + s), s;
|
|
1271
637
|
}
|
|
1272
638
|
if (a.children && a.children.length > 0 && a.path !== "/error" && a.path !== "/login" && a.path !== "/:page(.*)") {
|
|
1273
|
-
const s =
|
|
639
|
+
const s = Ye(a.children, t + a.path + "/");
|
|
1274
640
|
if (s)
|
|
1275
641
|
return s;
|
|
1276
642
|
}
|
|
1277
643
|
}
|
|
1278
|
-
},
|
|
644
|
+
}, F = Y("appInfo", {
|
|
1279
645
|
state: () => ({
|
|
1280
646
|
microRouter: null,
|
|
1281
647
|
microActions: {},
|
|
@@ -1314,8 +680,11 @@ const qa = (e) => {
|
|
|
1314
680
|
});
|
|
1315
681
|
},
|
|
1316
682
|
async getRemoteAppList() {
|
|
1317
|
-
return _(
|
|
1318
|
-
Query: {
|
|
683
|
+
return _(Na.appList, {
|
|
684
|
+
Query: {
|
|
685
|
+
AppCode: this.appInfo.AppCode,
|
|
686
|
+
Enabled: 1
|
|
687
|
+
}
|
|
1319
688
|
}).then((e) => {
|
|
1320
689
|
(e == null ? void 0 : e.status) === A.SUCCESS && e.data && (this.appList.length = 0, this.appList.push(...e.data));
|
|
1321
690
|
});
|
|
@@ -1328,14 +697,14 @@ const qa = (e) => {
|
|
|
1328
697
|
let t = "";
|
|
1329
698
|
const a = window.location.pathname.split("/");
|
|
1330
699
|
if (a.length > 1) {
|
|
1331
|
-
for (let
|
|
1332
|
-
if (a[
|
|
1333
|
-
t = a[
|
|
700
|
+
for (let n = a.length - 1; n >= 0; n--)
|
|
701
|
+
if (a[n] !== "") {
|
|
702
|
+
t = a[n];
|
|
1334
703
|
break;
|
|
1335
704
|
}
|
|
1336
705
|
}
|
|
1337
706
|
let s = null;
|
|
1338
|
-
t && t != "login" ? s = this.appList.find((
|
|
707
|
+
t && t != "login" ? s = this.appList.find((n) => n.AppCode === t) : s = this.appList.find((n) => n.Default), t = s ? s.AppCode : this.appList[0].AppCode, await this.setActiveApp(t), (!e || e.startsWith("/#/") || e.includes("/error/") || window.location.hash.includes("/error/")) && this.push(this.appInfo.defaultPage);
|
|
1339
708
|
},
|
|
1340
709
|
/**
|
|
1341
710
|
* 设置当前应用
|
|
@@ -1350,7 +719,7 @@ const qa = (e) => {
|
|
|
1350
719
|
flattenRoutes: {},
|
|
1351
720
|
Routes: t ?? [],
|
|
1352
721
|
defaultPage: ""
|
|
1353
|
-
}), (!qe() || !
|
|
722
|
+
}), (!qe() || !Ue()) && (await (await Q()).getRolePermits(a.Id), this.appInfo.Routes.length && this.setAppRoutes(this.appInfo.Routes)));
|
|
1354
723
|
},
|
|
1355
724
|
/**
|
|
1356
725
|
* 设置当前应用路由信息
|
|
@@ -1365,15 +734,15 @@ const qa = (e) => {
|
|
|
1365
734
|
};
|
|
1366
735
|
const t = this.appInfo.flattenRoutes;
|
|
1367
736
|
for (const s of e)
|
|
1368
|
-
|
|
737
|
+
We(s, t, void 0);
|
|
1369
738
|
Object.keys(t).forEach((s) => {
|
|
1370
|
-
const
|
|
1371
|
-
|
|
739
|
+
const n = t[s];
|
|
740
|
+
n.children || !n.component || (n.meta && n.meta.keepAlive === !1 ? this.ExcludeComponents.push(s) : this.CachedComponents.push(s));
|
|
1372
741
|
});
|
|
1373
742
|
const a = Q();
|
|
1374
743
|
if (a.isLogin) {
|
|
1375
|
-
const s =
|
|
1376
|
-
|
|
744
|
+
const s = Ee(this.appInfo.Routes, a);
|
|
745
|
+
La(s), this.appInfo.defaultPage = Ye(s) || "", this.appInfo.defaultPage && (this.menuLoaded = !0, $a(this.appInfo.defaultPage));
|
|
1377
746
|
}
|
|
1378
747
|
},
|
|
1379
748
|
/**
|
|
@@ -1390,8 +759,8 @@ const qa = (e) => {
|
|
|
1390
759
|
* @param path 路由地址
|
|
1391
760
|
*/
|
|
1392
761
|
push(e) {
|
|
1393
|
-
this.findRoute(e) &&
|
|
1394
|
-
|
|
762
|
+
this.findRoute(e) && Le().setTabActive(e), ua(() => {
|
|
763
|
+
Ue() ? (e = this.formatRoute(e), this.microRouter ? this.microRouter.push({ path: e }) : N.push({ path: e })) : N.push({ path: e });
|
|
1395
764
|
});
|
|
1396
765
|
},
|
|
1397
766
|
/**
|
|
@@ -1409,16 +778,16 @@ const qa = (e) => {
|
|
|
1409
778
|
* @returns 组件实例
|
|
1410
779
|
*/
|
|
1411
780
|
cacheComponent(e, t) {
|
|
1412
|
-
let a =
|
|
781
|
+
let a = ge.get(t.path);
|
|
1413
782
|
if (!a)
|
|
1414
783
|
if (this.CachedComponents.includes(t.path))
|
|
1415
784
|
a = {
|
|
1416
785
|
// 设置组件包装器的名称为路由路径
|
|
1417
786
|
name: t.path,
|
|
1418
787
|
render() {
|
|
1419
|
-
return
|
|
788
|
+
return C(e);
|
|
1420
789
|
}
|
|
1421
|
-
},
|
|
790
|
+
}, ge.set(t.path, a);
|
|
1422
791
|
else return e;
|
|
1423
792
|
return a;
|
|
1424
793
|
},
|
|
@@ -1427,7 +796,7 @@ const qa = (e) => {
|
|
|
1427
796
|
* @param path 路由地址
|
|
1428
797
|
*/
|
|
1429
798
|
excludeComponent(e) {
|
|
1430
|
-
this.ExcludeComponents.includes(e) || this.ExcludeComponents.push(e), this.CachedComponents.splice(this.CachedComponents.indexOf(e), 1),
|
|
799
|
+
this.ExcludeComponents.includes(e) || this.ExcludeComponents.push(e), this.CachedComponents.splice(this.CachedComponents.indexOf(e), 1), ge.delete(e);
|
|
1431
800
|
},
|
|
1432
801
|
/**
|
|
1433
802
|
* 路由路径层级查询,返回面包屑
|
|
@@ -1458,15 +827,15 @@ const qa = (e) => {
|
|
|
1458
827
|
}, this.CachedComponents.splice(0, this.CachedComponents.length), this.ExcludeComponents.splice(0, this.ExcludeComponents.length), this.appList.splice(0, this.appList.length), this.menuLoaded = !1;
|
|
1459
828
|
},
|
|
1460
829
|
logout() {
|
|
1461
|
-
this.microRouter ? this.microActions && typeof this.microActions.login == "function" && this.microActions.login() :
|
|
830
|
+
this.microRouter ? this.microActions && typeof this.microActions.login == "function" && this.microActions.login() : N.push({ path: Ie + "#/" });
|
|
1462
831
|
}
|
|
1463
832
|
},
|
|
1464
833
|
persist: {
|
|
1465
|
-
key:
|
|
834
|
+
key: Fa,
|
|
1466
835
|
storage: localStorage,
|
|
1467
836
|
pick: ["appList"]
|
|
1468
837
|
}
|
|
1469
|
-
}),
|
|
838
|
+
}), Ua = "userInfoStore", Xe = "Token解析失败", _e = "登录过期,请重新登录", Me = {
|
|
1470
839
|
login: {
|
|
1471
840
|
api: "PLATFORM_API",
|
|
1472
841
|
url: "/openapi/LoginSrv/login",
|
|
@@ -1484,44 +853,44 @@ const qa = (e) => {
|
|
|
1484
853
|
url: "/api/LoginSrv/logout",
|
|
1485
854
|
loadingText: "正在退出..."
|
|
1486
855
|
}
|
|
1487
|
-
},
|
|
856
|
+
}, _a = (e) => {
|
|
1488
857
|
let t = {
|
|
1489
858
|
Option: {},
|
|
1490
859
|
Query: e
|
|
1491
860
|
};
|
|
1492
|
-
return _(
|
|
1493
|
-
},
|
|
861
|
+
return _(Me.login, t).then((a) => (a == null ? void 0 : a.status) === A.SUCCESS ? a : null);
|
|
862
|
+
}, Ka = (e) => {
|
|
1494
863
|
let t = {
|
|
1495
864
|
Query: {
|
|
1496
865
|
AppId: e
|
|
1497
866
|
}
|
|
1498
867
|
};
|
|
1499
|
-
return _(
|
|
1500
|
-
},
|
|
868
|
+
return _(Me.auth, t).then((a) => (a == null ? void 0 : a.status) === A.SUCCESS ? a.data : (S.error("获取授权信息失败," + (a == null ? void 0 : a.msg)), null));
|
|
869
|
+
}, Ha = () => {
|
|
1501
870
|
let e = {
|
|
1502
871
|
Option: {},
|
|
1503
872
|
Query: {}
|
|
1504
873
|
};
|
|
1505
|
-
return _(
|
|
1506
|
-
},
|
|
874
|
+
return _(Me.logout, e).then((t) => (t == null ? void 0 : t.status) === A.SUCCESS ? t.data : null);
|
|
875
|
+
}, Qa = (e) => {
|
|
1507
876
|
try {
|
|
1508
877
|
const a = JSON.parse(atob(e.split(".")[1])).exp;
|
|
1509
878
|
return Date.now() / 1e3 > a;
|
|
1510
879
|
} catch (t) {
|
|
1511
|
-
return console.error(
|
|
880
|
+
return console.error(Xe, t), !0;
|
|
1512
881
|
}
|
|
1513
|
-
},
|
|
882
|
+
}, ye = (e, t) => e == "" ? (S.error(_e, {
|
|
1514
883
|
duration: 3e3,
|
|
1515
884
|
onClose: t
|
|
1516
|
-
}), !1) :
|
|
885
|
+
}), !1) : Qa(e) ? (S.error(_e, {
|
|
1517
886
|
duration: 3e3,
|
|
1518
887
|
onClose: t
|
|
1519
|
-
}), !1) : !0,
|
|
888
|
+
}), !1) : !0, Ga = (e) => {
|
|
1520
889
|
try {
|
|
1521
890
|
const t = JSON.parse(atob(e.token.split(".")[1]));
|
|
1522
891
|
return t.user = JSON.parse(t.user), e.UserInfo = t.user, !0;
|
|
1523
892
|
} catch (t) {
|
|
1524
|
-
return console.error(
|
|
893
|
+
return console.error(Xe, t), !1;
|
|
1525
894
|
}
|
|
1526
895
|
}, k = f(null), Q = Y("userInfo", {
|
|
1527
896
|
state: () => ({
|
|
@@ -1541,7 +910,7 @@ const qa = (e) => {
|
|
|
1541
910
|
* 启动时初始化用户信息
|
|
1542
911
|
*/
|
|
1543
912
|
init() {
|
|
1544
|
-
this.token && this.isLogin ? (
|
|
913
|
+
this.token && this.isLogin ? (ye(this.token, () => this.clean()), X(this.token)) : this.clean();
|
|
1545
914
|
},
|
|
1546
915
|
/**
|
|
1547
916
|
* 登录操作
|
|
@@ -1549,23 +918,23 @@ const qa = (e) => {
|
|
|
1549
918
|
* @returns
|
|
1550
919
|
*/
|
|
1551
920
|
async login(e, t) {
|
|
1552
|
-
const a = await
|
|
921
|
+
const a = await _a(e);
|
|
1553
922
|
if (a) {
|
|
1554
923
|
const s = a;
|
|
1555
924
|
if (s.errno)
|
|
1556
925
|
return s;
|
|
1557
926
|
{
|
|
1558
|
-
const
|
|
1559
|
-
if (this.token =
|
|
927
|
+
const n = a.data;
|
|
928
|
+
if (this.token = n.token, X(this.token), this.isLogin = !0, Ga(n))
|
|
1560
929
|
this.userInfo = {
|
|
1561
930
|
...this.userInfo,
|
|
1562
|
-
...
|
|
931
|
+
...n.UserInfo
|
|
1563
932
|
};
|
|
1564
933
|
else {
|
|
1565
934
|
S.error("用户信息解析失败");
|
|
1566
935
|
return;
|
|
1567
936
|
}
|
|
1568
|
-
t && (await
|
|
937
|
+
t && (await F()).toDefaultApp();
|
|
1569
938
|
}
|
|
1570
939
|
}
|
|
1571
940
|
},
|
|
@@ -1580,7 +949,7 @@ const qa = (e) => {
|
|
|
1580
949
|
if (k.value && k.value.appId === e)
|
|
1581
950
|
return !0;
|
|
1582
951
|
try {
|
|
1583
|
-
const t = await
|
|
952
|
+
const t = await Ka(e);
|
|
1584
953
|
return t ? (k.value = {
|
|
1585
954
|
appId: e,
|
|
1586
955
|
level: this.userInfo.UserLevel,
|
|
@@ -1615,12 +984,22 @@ const qa = (e) => {
|
|
|
1615
984
|
getUserInfo() {
|
|
1616
985
|
return this.userInfo;
|
|
1617
986
|
},
|
|
987
|
+
setUserInfo(e, t) {
|
|
988
|
+
if (!ye(t)) {
|
|
989
|
+
this.clean();
|
|
990
|
+
return;
|
|
991
|
+
}
|
|
992
|
+
this.userInfo = {
|
|
993
|
+
...this.userInfo,
|
|
994
|
+
...e
|
|
995
|
+
}, this.token = t, X(this.token), this.isLogin = !0;
|
|
996
|
+
},
|
|
1618
997
|
/**
|
|
1619
998
|
* 获取用户Token
|
|
1620
999
|
* @returns 用户Token
|
|
1621
1000
|
*/
|
|
1622
1001
|
getToken() {
|
|
1623
|
-
return
|
|
1002
|
+
return ye(this.token, () => {
|
|
1624
1003
|
this.clean(), this.logout();
|
|
1625
1004
|
}) ? this.token : "";
|
|
1626
1005
|
},
|
|
@@ -1634,7 +1013,7 @@ const qa = (e) => {
|
|
|
1634
1013
|
Code: "",
|
|
1635
1014
|
TenantId: "",
|
|
1636
1015
|
UserLevel: ""
|
|
1637
|
-
}, this.token = "",
|
|
1016
|
+
}, this.token = "", X(this.token), this.isLogin = !1, k.value = null, (await F()).clear(), Promise.resolve();
|
|
1638
1017
|
},
|
|
1639
1018
|
/**
|
|
1640
1019
|
* 登出操作
|
|
@@ -1642,28 +1021,28 @@ const qa = (e) => {
|
|
|
1642
1021
|
*/
|
|
1643
1022
|
async logout() {
|
|
1644
1023
|
try {
|
|
1645
|
-
await
|
|
1024
|
+
await Ha();
|
|
1646
1025
|
} catch (e) {
|
|
1647
1026
|
console.error("调用登出接口失败", e);
|
|
1648
1027
|
} finally {
|
|
1649
1028
|
await this.clean(), setTimeout(async () => {
|
|
1650
1029
|
S.success("已退出登录");
|
|
1651
1030
|
}, 1e3), setTimeout(async () => {
|
|
1652
|
-
(await
|
|
1031
|
+
(await F()).logout();
|
|
1653
1032
|
}, 2e3);
|
|
1654
1033
|
}
|
|
1655
1034
|
return Promise.resolve();
|
|
1656
1035
|
}
|
|
1657
1036
|
},
|
|
1658
1037
|
persist: {
|
|
1659
|
-
key:
|
|
1038
|
+
key: Ua,
|
|
1660
1039
|
storage: localStorage,
|
|
1661
1040
|
pick: ["isLogin", "userInfo", "token", "refreshToken"]
|
|
1662
1041
|
}
|
|
1663
|
-
}),
|
|
1042
|
+
}), Ct = (e, t) => {
|
|
1664
1043
|
const a = Q();
|
|
1665
1044
|
return e.filter((s) => {
|
|
1666
|
-
if (s.role && !a.hasRole(s.role) || s.permit && !a.hasPermit(
|
|
1045
|
+
if (s.role && !a.hasRole(s.role) || s.permit && !a.hasPermit(N.currentRoute.value.path, s.permit))
|
|
1667
1046
|
return !1;
|
|
1668
1047
|
if (!t) {
|
|
1669
1048
|
if (s.visible === !1)
|
|
@@ -1673,25 +1052,25 @@ const qa = (e) => {
|
|
|
1673
1052
|
}
|
|
1674
1053
|
return !0;
|
|
1675
1054
|
});
|
|
1676
|
-
},
|
|
1055
|
+
}, Dt = (e, t) => {
|
|
1677
1056
|
const a = t == null ? void 0 : t.filter((s) => {
|
|
1678
|
-
const
|
|
1679
|
-
(
|
|
1057
|
+
const n = e.find(
|
|
1058
|
+
(r) => r.dataIndex === s.dataIndex || r.key === s.key || r.title === s.title
|
|
1680
1059
|
);
|
|
1681
|
-
return
|
|
1060
|
+
return n ? { ...s, ...n } : !1;
|
|
1682
1061
|
});
|
|
1683
1062
|
return [...a || [], ...e.filter((s) => !(a != null && a.includes(s)))];
|
|
1684
|
-
},
|
|
1063
|
+
}, Va = (e) => (e.remotePage = !1, Ze(e).then((t) => t.rows)), Ze = (e) => {
|
|
1685
1064
|
e.gridQuery || (e.gridQuery = {});
|
|
1686
1065
|
const t = e.remotePage ? "find" : "list";
|
|
1687
|
-
return
|
|
1066
|
+
return Pe(e, {
|
|
1688
1067
|
urlKey: t,
|
|
1689
1068
|
url: e.gridUrl,
|
|
1690
1069
|
params: e.gridQuery,
|
|
1691
1070
|
loadingState: e.isGridLoading,
|
|
1692
1071
|
processParams: (a) => {
|
|
1693
|
-
var
|
|
1694
|
-
return e.remotePage && (a.Query.$limit = [(e.pageNo.value - 1) * e.pageSize.value, e.pageSize.value]),
|
|
1072
|
+
var n;
|
|
1073
|
+
return e.remotePage && (a.Query.$limit = [(e.pageNo.value - 1) * e.pageSize.value, e.pageSize.value]), we((n = e.gridUrl) == null ? void 0 : n.params, a, e.gridQuery);
|
|
1695
1074
|
}
|
|
1696
1075
|
}).then((a) => {
|
|
1697
1076
|
if ((a == null ? void 0 : a.status) === A.SUCCESS) {
|
|
@@ -1706,7 +1085,7 @@ const qa = (e) => {
|
|
|
1706
1085
|
rows: []
|
|
1707
1086
|
};
|
|
1708
1087
|
});
|
|
1709
|
-
},
|
|
1088
|
+
}, qa = (e, t, a = {}) => je(e, {
|
|
1710
1089
|
urlKey: "update",
|
|
1711
1090
|
url: e.updateUrl,
|
|
1712
1091
|
params: {
|
|
@@ -1717,24 +1096,24 @@ const qa = (e) => {
|
|
|
1717
1096
|
...a
|
|
1718
1097
|
}).then((s) => ((s == null ? void 0 : s.status) === A.SUCCESS && setTimeout(() => {
|
|
1719
1098
|
e.reload.value = !0, e.afterUpdate && e.afterUpdate(t);
|
|
1720
|
-
}, 50), s)),
|
|
1099
|
+
}, 50), s)), Ft = (e, t) => {
|
|
1721
1100
|
const a = {};
|
|
1722
|
-
return a[e.primaryKey] = t[e.primaryKey], a[e.statusKey] = t[e.statusKey],
|
|
1101
|
+
return a[e.primaryKey] = t[e.primaryKey], a[e.statusKey] = t[e.statusKey], qa(e, a, {
|
|
1723
1102
|
loadingText: !1,
|
|
1724
1103
|
hideErrorToast: !0
|
|
1725
1104
|
});
|
|
1726
|
-
},
|
|
1105
|
+
}, ea = async (e, t, a) => await Pe(e, {
|
|
1727
1106
|
urlKey: "detail",
|
|
1728
1107
|
url: a,
|
|
1729
1108
|
params: t,
|
|
1730
1109
|
loadingState: e.isGridLoading
|
|
1731
|
-
}),
|
|
1110
|
+
}), Nt = (e, t) => {
|
|
1732
1111
|
const a = t;
|
|
1733
|
-
return
|
|
1734
|
-
},
|
|
1112
|
+
return ea(e, { [e.primaryKey]: a[e.primaryKey] }).then((s) => ((s == null ? void 0 : s.status) === A.SUCCESS && s.data && (e.expandRows.value[a[e.primaryKey]] = s), s));
|
|
1113
|
+
}, Ut = (e, t) => {
|
|
1735
1114
|
let a = e.editor;
|
|
1736
|
-
e.rowData.value = t, a && (
|
|
1737
|
-
},
|
|
1115
|
+
e.rowData.value = t, a && (Je(a, t), a.visible.value = !0);
|
|
1116
|
+
}, _t = (e, t) => wa(e, t, {
|
|
1738
1117
|
url: e.deleteUrl,
|
|
1739
1118
|
primaryKey: e.primaryKey
|
|
1740
1119
|
}).then((a) => ((a == null ? void 0 : a.status) === A.SUCCESS && setTimeout(() => {
|
|
@@ -1768,7 +1147,7 @@ const qa = (e) => {
|
|
|
1768
1147
|
TreeOption: {
|
|
1769
1148
|
autoload: !0
|
|
1770
1149
|
}
|
|
1771
|
-
},
|
|
1150
|
+
}, Kt = (e) => {
|
|
1772
1151
|
y.PageOption = {
|
|
1773
1152
|
...y.PageOption,
|
|
1774
1153
|
...e.pageOption
|
|
@@ -1782,7 +1161,7 @@ const qa = (e) => {
|
|
|
1782
1161
|
...y.TreeOption,
|
|
1783
1162
|
...e.treeOption
|
|
1784
1163
|
};
|
|
1785
|
-
},
|
|
1164
|
+
}, ja = (e, t, a, s) => ({
|
|
1786
1165
|
editorCtrl: {
|
|
1787
1166
|
...y.EditorOption,
|
|
1788
1167
|
name: "",
|
|
@@ -1798,7 +1177,7 @@ const qa = (e) => {
|
|
|
1798
1177
|
isFormSaving: f(!1),
|
|
1799
1178
|
isFormLoading: f(!1)
|
|
1800
1179
|
}
|
|
1801
|
-
}),
|
|
1180
|
+
}), Ba = (e, t, a) => {
|
|
1802
1181
|
const s = {
|
|
1803
1182
|
...y.GridOption,
|
|
1804
1183
|
tableSize: f(y.GridOption.tableSize.value),
|
|
@@ -1818,7 +1197,7 @@ const qa = (e) => {
|
|
|
1818
1197
|
selectRows: f([]),
|
|
1819
1198
|
rowData: f(void 0),
|
|
1820
1199
|
gridQuery: {},
|
|
1821
|
-
tableData:
|
|
1200
|
+
tableData: Ge(void 0),
|
|
1822
1201
|
expandRows: f({}),
|
|
1823
1202
|
isGridLoading: f(!1),
|
|
1824
1203
|
isGridSaving: f(!1),
|
|
@@ -1828,22 +1207,22 @@ const qa = (e) => {
|
|
|
1828
1207
|
};
|
|
1829
1208
|
return T(
|
|
1830
1209
|
() => s.reload.value,
|
|
1831
|
-
(
|
|
1832
|
-
|
|
1210
|
+
(n) => {
|
|
1211
|
+
n && (setTimeout(() => {
|
|
1833
1212
|
s.reload.value = !1;
|
|
1834
|
-
}, 1), s.remotePage ?
|
|
1213
|
+
}, 1), s.remotePage ? Ze(s) : Va(s));
|
|
1835
1214
|
}
|
|
1836
1215
|
), {
|
|
1837
1216
|
gridCtrl: s
|
|
1838
1217
|
};
|
|
1839
|
-
},
|
|
1218
|
+
}, Ht = (e, t) => {
|
|
1840
1219
|
const a = {
|
|
1841
1220
|
...y.TreeOption,
|
|
1842
1221
|
reload: f(!1),
|
|
1843
1222
|
page: t,
|
|
1844
1223
|
node: f(void 0),
|
|
1845
1224
|
url: e.urls.tree,
|
|
1846
|
-
data:
|
|
1225
|
+
data: Ge(void 0),
|
|
1847
1226
|
isTreeLoading: f(!1)
|
|
1848
1227
|
};
|
|
1849
1228
|
return T(
|
|
@@ -1851,32 +1230,32 @@ const qa = (e) => {
|
|
|
1851
1230
|
(s) => {
|
|
1852
1231
|
s && (setTimeout(() => {
|
|
1853
1232
|
a.reload.value = !1;
|
|
1854
|
-
}, 1),
|
|
1233
|
+
}, 1), Oa(a));
|
|
1855
1234
|
}
|
|
1856
1235
|
), {
|
|
1857
1236
|
treeCtrl: a
|
|
1858
1237
|
};
|
|
1859
|
-
},
|
|
1238
|
+
}, Qt = (e, t, a) => {
|
|
1860
1239
|
for (const o in e.urls)
|
|
1861
1240
|
e.urls[o] && (e.urls[o].api || (e.urls[o].api = e.api), e.urls[o].authorize === void 0 && (e.urls[o].authorize = e.authorize));
|
|
1862
1241
|
const s = {
|
|
1863
1242
|
...y.PageOption,
|
|
1864
1243
|
...e
|
|
1865
|
-
}, { editorCtrl:
|
|
1866
|
-
return s.editor =
|
|
1244
|
+
}, { editorCtrl: n } = ja(e, s, t, a), { gridCtrl: r } = Ba(e, s);
|
|
1245
|
+
return s.editor = n, s.grid = r, r.editor = n, r.tools = ["Reload", "RowHeight", "TableHeadset", "Fullscreen"], n.grid = r, {
|
|
1867
1246
|
pageCtrl: s,
|
|
1868
|
-
editorCtrl:
|
|
1869
|
-
gridCtrl:
|
|
1247
|
+
editorCtrl: n,
|
|
1248
|
+
gridCtrl: r
|
|
1870
1249
|
};
|
|
1871
1250
|
};
|
|
1872
|
-
var
|
|
1873
|
-
class
|
|
1251
|
+
var aa = /* @__PURE__ */ ((e) => (e.SelectReload = "Select.Reload", e.RadioReload = "Radio.Reload", e.CheckboxReload = "Checkbox.Reload", e.TreeSelectReload = "TreeSelect.Reload", e.TreeCheckReload = "TreeCheck.Reload", e))(aa || {});
|
|
1252
|
+
class Ja {
|
|
1874
1253
|
constructor() {
|
|
1875
1254
|
P(this, "listeners", {});
|
|
1876
1255
|
}
|
|
1877
1256
|
// 检查事件名是否符合前缀
|
|
1878
1257
|
isValidPrefix(t) {
|
|
1879
|
-
return Object.values(
|
|
1258
|
+
return Object.values(aa).some((a) => t.startsWith(a + "."));
|
|
1880
1259
|
}
|
|
1881
1260
|
/**
|
|
1882
1261
|
* 事件订阅
|
|
@@ -1888,299 +1267,933 @@ class ot {
|
|
|
1888
1267
|
console.error(`事件前缀不正确: ${t}`);
|
|
1889
1268
|
return;
|
|
1890
1269
|
}
|
|
1891
|
-
this.listeners[t] || (this.listeners[t] = []), this.listeners[t].push(a);
|
|
1892
|
-
}
|
|
1893
|
-
/**
|
|
1894
|
-
* 取消订阅事件
|
|
1895
|
-
* @param event 事件名
|
|
1896
|
-
* @param listener 处理器
|
|
1897
|
-
*/
|
|
1898
|
-
off(t, a) {
|
|
1899
|
-
if (!this.isValidPrefix(t)) {
|
|
1900
|
-
console.error(`事件前缀不正确: ${t}`);
|
|
1901
|
-
return;
|
|
1270
|
+
this.listeners[t] || (this.listeners[t] = []), this.listeners[t].push(a);
|
|
1271
|
+
}
|
|
1272
|
+
/**
|
|
1273
|
+
* 取消订阅事件
|
|
1274
|
+
* @param event 事件名
|
|
1275
|
+
* @param listener 处理器
|
|
1276
|
+
*/
|
|
1277
|
+
off(t, a) {
|
|
1278
|
+
if (!this.isValidPrefix(t)) {
|
|
1279
|
+
console.error(`事件前缀不正确: ${t}`);
|
|
1280
|
+
return;
|
|
1281
|
+
}
|
|
1282
|
+
this.listeners[t] && (this.listeners[t] = this.listeners[t].filter((s) => s !== a));
|
|
1283
|
+
}
|
|
1284
|
+
//
|
|
1285
|
+
/**
|
|
1286
|
+
* 触发事件
|
|
1287
|
+
* @param event 事件名
|
|
1288
|
+
* @param args 参数
|
|
1289
|
+
*/
|
|
1290
|
+
emit(t, ...a) {
|
|
1291
|
+
if (!this.isValidPrefix(t)) {
|
|
1292
|
+
console.error(`事件前缀不正确: ${t}`);
|
|
1293
|
+
return;
|
|
1294
|
+
}
|
|
1295
|
+
this.listeners[t] && this.listeners[t].forEach((s) => s(t, ...a));
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
const ae = new Ja(), fe = (e, t, a, s, n, r) => {
|
|
1299
|
+
if (s && t.reloadEvent && (s.reloadHandler = (o, i) => {
|
|
1300
|
+
za(n, t, i, a);
|
|
1301
|
+
}, ae.on(t.reloadEvent, s.reloadHandler)), t.data)
|
|
1302
|
+
T(
|
|
1303
|
+
() => t.data,
|
|
1304
|
+
() => {
|
|
1305
|
+
$e(t, t.data, a, !0);
|
|
1306
|
+
},
|
|
1307
|
+
{ deep: !0, immediate: !0 }
|
|
1308
|
+
);
|
|
1309
|
+
else if (n && n.url)
|
|
1310
|
+
e !== !1 && ta(n, t, r ?? {}, a);
|
|
1311
|
+
else {
|
|
1312
|
+
const o = f(G($.LabelText, ""));
|
|
1313
|
+
S.error("`" + o.value + "` 未配置选项数据!", {
|
|
1314
|
+
duration: 5e3
|
|
1315
|
+
});
|
|
1316
|
+
}
|
|
1317
|
+
}, $e = (e, t, a, s) => {
|
|
1318
|
+
if (!t || t.length === 0) {
|
|
1319
|
+
a.value = [];
|
|
1320
|
+
return;
|
|
1321
|
+
}
|
|
1322
|
+
if (s) {
|
|
1323
|
+
const n = {
|
|
1324
|
+
...e.fieldMap
|
|
1325
|
+
};
|
|
1326
|
+
t = Ia(n, t);
|
|
1327
|
+
}
|
|
1328
|
+
t = JSON.parse(JSON.stringify(t)), e.all && t.unshift({
|
|
1329
|
+
label: "全部",
|
|
1330
|
+
value: void 0
|
|
1331
|
+
}), a.value = t;
|
|
1332
|
+
}, za = (e, t, a, s) => {
|
|
1333
|
+
Array.isArray(a) ? $e(t, a, s, !0) : ta(e, t, { Query: a }, s);
|
|
1334
|
+
}, pe = (e, t) => {
|
|
1335
|
+
t && e.reloadEvent && t.reloadHandler && ae.off(e.reloadEvent, t.reloadHandler);
|
|
1336
|
+
}, ta = (e, t, a, s) => {
|
|
1337
|
+
const n = we(e.params, a, t.params);
|
|
1338
|
+
Wa(e, t.fieldMap, n).then((r) => {
|
|
1339
|
+
$e(t, r, s, !1);
|
|
1340
|
+
});
|
|
1341
|
+
}, Wa = (e, t, a) => {
|
|
1342
|
+
const { fieldMap: s, ...n } = e, o = {
|
|
1343
|
+
...{
|
|
1344
|
+
url: "",
|
|
1345
|
+
cacheTime: 6e4,
|
|
1346
|
+
fieldMap: {
|
|
1347
|
+
...t,
|
|
1348
|
+
...e.fieldMap
|
|
1349
|
+
}
|
|
1350
|
+
},
|
|
1351
|
+
...n
|
|
1352
|
+
};
|
|
1353
|
+
return o.loadingText = !1, a || (a = {}), a.Query || (a.Query = {}), _(o, a).then((i) => (i == null ? void 0 : i.status) === A.SUCCESS && i.data ? i.data : []);
|
|
1354
|
+
}, Ya = (e, t) => {
|
|
1355
|
+
if (e !== void 0)
|
|
1356
|
+
return Array.isArray(e) ? t.filter((a) => e.includes(a.value)) : t.find((a) => a.value === e);
|
|
1357
|
+
}, be = (e, t, a) => {
|
|
1358
|
+
const s = t.split(".");
|
|
1359
|
+
let n = e;
|
|
1360
|
+
for (let r = 0; r < s.length - 1; r++) {
|
|
1361
|
+
const o = s[r];
|
|
1362
|
+
n[o] || (n[o] = {}), n = n[o];
|
|
1363
|
+
}
|
|
1364
|
+
n[s[s.length - 1]] = a;
|
|
1365
|
+
}, sa = (e, t, a) => {
|
|
1366
|
+
if (a == null) {
|
|
1367
|
+
Object.entries(t).forEach(([s]) => {
|
|
1368
|
+
be(e, s, a);
|
|
1369
|
+
});
|
|
1370
|
+
return;
|
|
1371
|
+
}
|
|
1372
|
+
Array.isArray(a) || Object.entries(t).forEach(([s, n]) => {
|
|
1373
|
+
if (n.includes("${")) {
|
|
1374
|
+
const r = Ea(n, a);
|
|
1375
|
+
be(e, s, r);
|
|
1376
|
+
} else
|
|
1377
|
+
be(e, s, a[n]);
|
|
1378
|
+
});
|
|
1379
|
+
}, de = (e, t, a, s) => {
|
|
1380
|
+
var r;
|
|
1381
|
+
s.editorCtrl && ((r = s.errInfo) != null && r.value.errClass) && ue(s.editorCtrl);
|
|
1382
|
+
const n = Ya(t, a.value);
|
|
1383
|
+
return e.formData && e.outFields && sa(e.formData, e.outFields, n), e.changeEvent && (Array.isArray(e.changeEvent) ? e.changeEvent.every((o) => {
|
|
1384
|
+
ae.emit(o, t, n);
|
|
1385
|
+
}) : ae.emit(e.changeEvent, t, n)), s.inputEmit && s.inputEmit("change", t, n), n;
|
|
1386
|
+
}, he = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((t) => t.label) : [e.label], Xa = 7 * 24 * 60 * 60 * 1e3, Se = /* @__PURE__ */ new Map(), Ke = /* @__PURE__ */ new Set(), U = f({}), Gt = U, Vt = (e) => {
|
|
1387
|
+
var n;
|
|
1388
|
+
if (!e.iconUrl) return xe;
|
|
1389
|
+
const t = f(!0), a = f("");
|
|
1390
|
+
let s = !0;
|
|
1391
|
+
return (n = e.icons) != null && n.length && (s = e.icons.every((r) => U.value[r] !== void 0)), (e.icon && !U.value[e.icon] || !s) && Za(e, t).then(() => {
|
|
1392
|
+
tt(e.iconUrl, e.monoColor || !1), t.value = !0;
|
|
1393
|
+
}), W({
|
|
1394
|
+
props: {
|
|
1395
|
+
icon: {
|
|
1396
|
+
type: String
|
|
1397
|
+
},
|
|
1398
|
+
icons: {
|
|
1399
|
+
type: Array
|
|
1400
|
+
},
|
|
1401
|
+
iconIndex: {
|
|
1402
|
+
type: Number
|
|
1403
|
+
},
|
|
1404
|
+
clickable: {
|
|
1405
|
+
type: Boolean
|
|
1406
|
+
},
|
|
1407
|
+
angle: {
|
|
1408
|
+
type: Number
|
|
1409
|
+
},
|
|
1410
|
+
flip: {
|
|
1411
|
+
type: Boolean
|
|
1412
|
+
},
|
|
1413
|
+
class: {
|
|
1414
|
+
type: [String, Array],
|
|
1415
|
+
default: ""
|
|
1416
|
+
}
|
|
1417
|
+
},
|
|
1418
|
+
emits: ["update:iconIndex"],
|
|
1419
|
+
setup(r, { emit: o }) {
|
|
1420
|
+
const i = f(r.icon), l = f(0), u = () => {
|
|
1421
|
+
r.icons && l.value++;
|
|
1422
|
+
};
|
|
1423
|
+
return T(
|
|
1424
|
+
() => r.iconIndex,
|
|
1425
|
+
(c) => {
|
|
1426
|
+
c !== void 0 && (l.value = c);
|
|
1427
|
+
},
|
|
1428
|
+
{ immediate: !0 }
|
|
1429
|
+
), T(
|
|
1430
|
+
() => l.value,
|
|
1431
|
+
(c) => {
|
|
1432
|
+
r.icons && (c >= r.icons.length && (l.value = 0), i.value = r.icons[l.value], Z(a, i, i.value), o("update:iconIndex", l.value));
|
|
1433
|
+
},
|
|
1434
|
+
{ immediate: !0 }
|
|
1435
|
+
), T(
|
|
1436
|
+
() => U.value,
|
|
1437
|
+
() => {
|
|
1438
|
+
Z(a, i, i.value);
|
|
1439
|
+
},
|
|
1440
|
+
{ deep: !0 }
|
|
1441
|
+
), T(
|
|
1442
|
+
() => r.icon,
|
|
1443
|
+
(c) => {
|
|
1444
|
+
Z(a, i, c);
|
|
1445
|
+
}
|
|
1446
|
+
), Z(a, i, i.value), { isLoaded: t, Icon: a, handleClick: u };
|
|
1447
|
+
},
|
|
1448
|
+
render() {
|
|
1449
|
+
if (!t.value)
|
|
1450
|
+
return xe;
|
|
1451
|
+
let r = this.class, o = "";
|
|
1452
|
+
Array.isArray(r) ? o = r.join(" ") : typeof r == "string" && (o = r);
|
|
1453
|
+
let i = [o];
|
|
1454
|
+
return !/\bw-/.test(o) && !/$w-/.test(o) && i.push("w-4"), !/\bh-/.test(o) && !/$h-/.test(o) && i.push("h-4"), a.value ? C(Qe(a.value), {
|
|
1455
|
+
onClick: this.$props.clickable ? this.handleClick : void 0,
|
|
1456
|
+
class: `${i.join(" ")}`,
|
|
1457
|
+
style: {
|
|
1458
|
+
fill: "currentColor",
|
|
1459
|
+
cursor: this.$props.clickable ? "pointer" : "default",
|
|
1460
|
+
transform: nt(this.angle, this.flip)
|
|
1461
|
+
}
|
|
1462
|
+
}) : C("div", { class: "w-[14px] h-[14px]" });
|
|
1463
|
+
}
|
|
1464
|
+
});
|
|
1465
|
+
}, Za = (e, t) => {
|
|
1466
|
+
let a = e.iconUrl;
|
|
1467
|
+
if (!a)
|
|
1468
|
+
return console.error("图标库地址不能为空"), Promise.resolve();
|
|
1469
|
+
if (Se.has(a))
|
|
1470
|
+
return Promise.resolve();
|
|
1471
|
+
const s = ra(a);
|
|
1472
|
+
if (s)
|
|
1473
|
+
return new Promise(async (r) => (na(s.scriptContent), r()));
|
|
1474
|
+
t.value = !1;
|
|
1475
|
+
const n = new Promise(async (r) => {
|
|
1476
|
+
await et(a, e.monoColor || !1), r(), Se.delete(a);
|
|
1477
|
+
});
|
|
1478
|
+
return Se.set(a, n), n;
|
|
1479
|
+
}, et = async (e, t) => {
|
|
1480
|
+
try {
|
|
1481
|
+
const a = await fetch(e);
|
|
1482
|
+
if (!a.ok) {
|
|
1483
|
+
S.error("网络异常,无法加载图标库!");
|
|
1484
|
+
return;
|
|
1485
|
+
}
|
|
1486
|
+
let s = await a.text();
|
|
1487
|
+
s = t ? s.replace(/fill=\"[^\"]*\"/gi, "") : s;
|
|
1488
|
+
let n = /^window\.(\w+)\s*=/;
|
|
1489
|
+
const r = s.match(n);
|
|
1490
|
+
if (r && r.length > 1) {
|
|
1491
|
+
let o = r[1];
|
|
1492
|
+
at(e, o, t, s);
|
|
1493
|
+
}
|
|
1494
|
+
na(s);
|
|
1495
|
+
return;
|
|
1496
|
+
} catch (a) {
|
|
1497
|
+
return console.error("网络异常,无法加载图标库:", a), null;
|
|
1498
|
+
}
|
|
1499
|
+
}, na = (e) => {
|
|
1500
|
+
const t = document.createElement("script");
|
|
1501
|
+
t.textContent = e, document.head.appendChild(t);
|
|
1502
|
+
}, at = (e, t, a, s) => {
|
|
1503
|
+
let n = `icon_cache:${e}`;
|
|
1504
|
+
const r = {
|
|
1505
|
+
windowKey: t,
|
|
1506
|
+
monoColor: a,
|
|
1507
|
+
scriptContent: s,
|
|
1508
|
+
expireTime: Date.now() + Xa
|
|
1509
|
+
// 缓存时间:7天
|
|
1510
|
+
};
|
|
1511
|
+
localStorage.setItem(n, JSON.stringify(r));
|
|
1512
|
+
}, ra = (e) => {
|
|
1513
|
+
let t = `icon_cache:${e}`;
|
|
1514
|
+
const a = localStorage.getItem(t);
|
|
1515
|
+
if (!a) return null;
|
|
1516
|
+
let s;
|
|
1517
|
+
try {
|
|
1518
|
+
s = JSON.parse(a);
|
|
1519
|
+
} catch (n) {
|
|
1520
|
+
return console.error("解析缓存失败:", n), null;
|
|
1521
|
+
}
|
|
1522
|
+
return s.expireTime < Date.now() ? (localStorage.removeItem(e), null) : s;
|
|
1523
|
+
}, qt = () => {
|
|
1524
|
+
const e = Date.now();
|
|
1525
|
+
for (const t in localStorage)
|
|
1526
|
+
if (t.startsWith("icon_cache:")) {
|
|
1527
|
+
const a = localStorage.getItem(t);
|
|
1528
|
+
a && JSON.parse(a).expireTime < e && localStorage.removeItem(t);
|
|
1529
|
+
}
|
|
1530
|
+
}, Z = (e, t, a) => {
|
|
1531
|
+
setTimeout(() => {
|
|
1532
|
+
t.value = a, t.value && (e.value = U.value[t.value]);
|
|
1533
|
+
}, 1);
|
|
1534
|
+
}, xe = C(
|
|
1535
|
+
"svg",
|
|
1536
|
+
{ class: "w-4 h-4", viewBox: "0 0 50 50", style: { animation: "rotate 2s linear infinite" } },
|
|
1537
|
+
[
|
|
1538
|
+
C("circle", {
|
|
1539
|
+
cx: "25",
|
|
1540
|
+
cy: "25",
|
|
1541
|
+
r: "20",
|
|
1542
|
+
stroke: "currentColor",
|
|
1543
|
+
fill: "none",
|
|
1544
|
+
style: { strokeWidth: "3 !important" }
|
|
1545
|
+
// 强制应用线宽
|
|
1546
|
+
}),
|
|
1547
|
+
C("circle", {
|
|
1548
|
+
cx: "25",
|
|
1549
|
+
cy: "6",
|
|
1550
|
+
r: "6",
|
|
1551
|
+
fill: "currentColor"
|
|
1552
|
+
})
|
|
1553
|
+
]
|
|
1554
|
+
), tt = (e, t) => {
|
|
1555
|
+
const a = ra(e);
|
|
1556
|
+
Object.keys(window).forEach((s) => {
|
|
1557
|
+
s.startsWith("_iconfont_svg_string_") && (a == null ? void 0 : a.windowKey) === s && !Ke.has(s) && (Ke.add(s), st(s, t));
|
|
1558
|
+
});
|
|
1559
|
+
}, st = (e, t) => {
|
|
1560
|
+
const a = window[e], r = new DOMParser().parseFromString(a, "image/svg+xml").getElementsByTagName("symbol"), o = document.querySelectorAll("symbol");
|
|
1561
|
+
for (const i of r) {
|
|
1562
|
+
const l = i.id, u = Array.from(o).find((c) => c.id === l);
|
|
1563
|
+
u && t && (u.innerHTML = i.innerHTML, u.querySelectorAll("*").forEach((c) => {
|
|
1564
|
+
c.hasAttribute("fill") && c.removeAttribute("fill");
|
|
1565
|
+
})), U.value[l] || (U.value[l] = C("svg", { fill: "currentColor" }, [C("use", { "xlink:href": `#${l}` })]));
|
|
1566
|
+
}
|
|
1567
|
+
}, nt = (e, t) => {
|
|
1568
|
+
let a = "";
|
|
1569
|
+
return e && (a += `rotate(${e}deg)`), t && (a += " scaleX(-1)"), a;
|
|
1570
|
+
}, jt = (e, t, a, s) => {
|
|
1571
|
+
oa(e, [], a, s).forEach((r) => t.push(r));
|
|
1572
|
+
}, oa = (e, t, a, s) => {
|
|
1573
|
+
var o, i, l, u, c;
|
|
1574
|
+
const n = [], r = Q();
|
|
1575
|
+
for (const p of e) {
|
|
1576
|
+
if (p.redirect || p.path.includes("/login") || p.path.includes("/error") || p.path.includes("/:page(.*)") || (i = (o = p.meta) == null ? void 0 : o.roles) != null && i.length && !r.hasRole(p.meta.roles) && (l = p.meta) != null && l.permission && !r.hasPermit(p.meta.permission, ":page"))
|
|
1577
|
+
continue;
|
|
1578
|
+
const h = p.path.split("/");
|
|
1579
|
+
h.unshift(...t);
|
|
1580
|
+
const v = oa(p.children || [], h, a, s), w = {
|
|
1581
|
+
key: h.join("/"),
|
|
1582
|
+
label: ((u = p.name) == null ? void 0 : u.toString()) ?? "",
|
|
1583
|
+
title: ((c = p.name) == null ? void 0 : c.toString()) ?? "",
|
|
1584
|
+
icon: p.icon ? C(a, { ...s, icon: p.icon }) : void 0,
|
|
1585
|
+
children: v.length > 0 ? v : void 0
|
|
1586
|
+
};
|
|
1587
|
+
(v.length > 0 || !p.children) && n.push(w);
|
|
1588
|
+
}
|
|
1589
|
+
return n;
|
|
1590
|
+
}, He = ca([]), Bt = () => {
|
|
1591
|
+
He.length = 0;
|
|
1592
|
+
const e = F();
|
|
1593
|
+
let a = Le().TabActive;
|
|
1594
|
+
e.matchedRoutes(a).forEach((n, r) => {
|
|
1595
|
+
var i;
|
|
1596
|
+
const o = {
|
|
1597
|
+
index: r,
|
|
1598
|
+
path: n.path,
|
|
1599
|
+
breadcrumbName: ((i = n.name) == null ? void 0 : i.toString()) ?? ""
|
|
1600
|
+
};
|
|
1601
|
+
He.push(o);
|
|
1602
|
+
});
|
|
1603
|
+
}, rt = {
|
|
1604
|
+
host: {
|
|
1605
|
+
api: "SITEHOST_API",
|
|
1606
|
+
url: "/openapi/RCSiteHostSrv/get",
|
|
1607
|
+
fieldMap: {
|
|
1608
|
+
hostId: "Id",
|
|
1609
|
+
hostName: "Title"
|
|
1610
|
+
},
|
|
1611
|
+
loadingText: "站点配置加载中……",
|
|
1612
|
+
// 不显示错误
|
|
1613
|
+
hideErrorToast: !0
|
|
1614
|
+
}
|
|
1615
|
+
}, Jt = Y("hostInfo", {
|
|
1616
|
+
state: () => ({
|
|
1617
|
+
hostInfo: {
|
|
1618
|
+
Host: "",
|
|
1619
|
+
Title: "",
|
|
1620
|
+
API_HOST: {},
|
|
1621
|
+
SERVER_HOST: {},
|
|
1622
|
+
ExtraProps: {},
|
|
1623
|
+
ExtraPropLines: []
|
|
1624
|
+
}
|
|
1625
|
+
}),
|
|
1626
|
+
actions: {
|
|
1627
|
+
/**
|
|
1628
|
+
* 加载站点信息,如加载失败,则使用本地缓存或默认参数
|
|
1629
|
+
* @param hostApi 启动配置主机地址
|
|
1630
|
+
* @param hostKey 站点信息,默认为当前主域名
|
|
1631
|
+
* @param mainOpenApis 宿主机开放接口
|
|
1632
|
+
*/
|
|
1633
|
+
async loadHostInfo(e, t, a) {
|
|
1634
|
+
if (a) {
|
|
1635
|
+
this._setHostInfo(a.getHostInfo());
|
|
1636
|
+
return;
|
|
1637
|
+
}
|
|
1638
|
+
return new Promise((s) => {
|
|
1639
|
+
ve.SITEHOST_API || (ve.SITEHOST_API = e);
|
|
1640
|
+
const n = t || window.location.origin;
|
|
1641
|
+
_(rt.host, {
|
|
1642
|
+
Query: {
|
|
1643
|
+
Host: n
|
|
1644
|
+
}
|
|
1645
|
+
}).then((r) => {
|
|
1646
|
+
if ((r == null ? void 0 : r.status) === A.SUCCESS && r.data) {
|
|
1647
|
+
const o = r.data;
|
|
1648
|
+
this._setHostInfo(o);
|
|
1649
|
+
}
|
|
1650
|
+
s();
|
|
1651
|
+
});
|
|
1652
|
+
});
|
|
1653
|
+
},
|
|
1654
|
+
/**
|
|
1655
|
+
* 设置主机信息(私有方法)
|
|
1656
|
+
*/
|
|
1657
|
+
_setHostInfo(e) {
|
|
1658
|
+
if (this.hostInfo = {
|
|
1659
|
+
...this.hostInfo,
|
|
1660
|
+
...e
|
|
1661
|
+
}, this.hostInfo.API_HOST)
|
|
1662
|
+
for (const t in this.hostInfo.API_HOST) ve[t] = this.hostInfo.API_HOST[t];
|
|
1663
|
+
if (this.hostInfo.SERVER_HOST)
|
|
1664
|
+
for (const t in this.hostInfo.SERVER_HOST) xa[t] = this.hostInfo.SERVER_HOST[t];
|
|
1665
|
+
},
|
|
1666
|
+
getHostInfo() {
|
|
1667
|
+
return this.hostInfo;
|
|
1668
|
+
}
|
|
1669
|
+
},
|
|
1670
|
+
// 使用自定义数据缓存
|
|
1671
|
+
persist: !1
|
|
1672
|
+
// persist: {
|
|
1673
|
+
// key: HOSTINFO_STORE_KEY,
|
|
1674
|
+
// storage: localStorage,
|
|
1675
|
+
// pick: ['hostInfo'],
|
|
1676
|
+
// },
|
|
1677
|
+
}), ot = "settingInfoStore", zt = Y("settingInfo", {
|
|
1678
|
+
state: () => ({
|
|
1679
|
+
fullscreen: !1,
|
|
1680
|
+
menuCollapse: !1,
|
|
1681
|
+
tableColumns: {}
|
|
1682
|
+
}),
|
|
1683
|
+
actions: {
|
|
1684
|
+
/**
|
|
1685
|
+
* 设置全屏
|
|
1686
|
+
*/
|
|
1687
|
+
setFullscreen(e) {
|
|
1688
|
+
this.$patch({
|
|
1689
|
+
fullscreen: e
|
|
1690
|
+
});
|
|
1691
|
+
},
|
|
1692
|
+
/**
|
|
1693
|
+
* 设置主菜单区折叠
|
|
1694
|
+
*/
|
|
1695
|
+
setMenuCollapse(e) {
|
|
1696
|
+
this.$patch({
|
|
1697
|
+
menuCollapse: e
|
|
1698
|
+
});
|
|
1699
|
+
},
|
|
1700
|
+
/**
|
|
1701
|
+
* 获取表格头配置
|
|
1702
|
+
*/
|
|
1703
|
+
getTableColumns(e) {
|
|
1704
|
+
return this.tableColumns[e];
|
|
1705
|
+
},
|
|
1706
|
+
/**
|
|
1707
|
+
* 设置表格头配置
|
|
1708
|
+
*/
|
|
1709
|
+
setTableColumns(e, t) {
|
|
1710
|
+
this.$patch({
|
|
1711
|
+
tableColumns: {
|
|
1712
|
+
...this.tableColumns,
|
|
1713
|
+
[e]: t
|
|
1714
|
+
}
|
|
1715
|
+
});
|
|
1902
1716
|
}
|
|
1903
|
-
|
|
1717
|
+
},
|
|
1718
|
+
persist: {
|
|
1719
|
+
key: ot,
|
|
1720
|
+
storage: localStorage,
|
|
1721
|
+
pick: ["fullscreen", "menuCollapse", "tableColumns"]
|
|
1904
1722
|
}
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1723
|
+
}), Wt = /* @__PURE__ */ W({
|
|
1724
|
+
inheritAttrs: !1,
|
|
1725
|
+
__name: "index",
|
|
1726
|
+
props: {
|
|
1727
|
+
...oe,
|
|
1728
|
+
autoload: {
|
|
1729
|
+
type: Boolean,
|
|
1730
|
+
default: !1
|
|
1731
|
+
},
|
|
1732
|
+
value: {
|
|
1733
|
+
type: [String, Number, null, Array],
|
|
1734
|
+
default: void 0
|
|
1735
|
+
},
|
|
1736
|
+
/**
|
|
1737
|
+
* 查询字段
|
|
1738
|
+
* - 模糊查询
|
|
1739
|
+
*/
|
|
1740
|
+
searchField: {
|
|
1741
|
+
type: String
|
|
1742
|
+
},
|
|
1743
|
+
/**
|
|
1744
|
+
* 自定义查询参数
|
|
1745
|
+
* - 查询参数
|
|
1746
|
+
* - query参数
|
|
1747
|
+
*/
|
|
1748
|
+
onsearch: {
|
|
1749
|
+
type: Function
|
|
1750
|
+
},
|
|
1751
|
+
/**
|
|
1752
|
+
* 修改输入数据则自动清空关联数据
|
|
1753
|
+
*/
|
|
1754
|
+
autoClean: {
|
|
1755
|
+
type: Boolean,
|
|
1756
|
+
default: !0
|
|
1915
1757
|
}
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
}
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1758
|
+
},
|
|
1759
|
+
emits: ["update:value", "select", "change", "update:labels"],
|
|
1760
|
+
setup(e, { emit: t }) {
|
|
1761
|
+
var w, m, b;
|
|
1762
|
+
const a = e, s = te(), n = f({
|
|
1763
|
+
...a.url,
|
|
1764
|
+
url: ((w = a.url) == null ? void 0 : w.url) || "",
|
|
1765
|
+
fieldMap: a.fieldMap || ((m = a.url) == null ? void 0 : m.fieldMap),
|
|
1766
|
+
params: a.params || ((b = a.url) == null ? void 0 : b.params),
|
|
1767
|
+
loadingText: !1
|
|
1768
|
+
}), r = f(void 0);
|
|
1923
1769
|
T(
|
|
1924
|
-
() =>
|
|
1770
|
+
() => a.value,
|
|
1925
1771
|
() => {
|
|
1926
|
-
|
|
1772
|
+
r.value = a.value;
|
|
1927
1773
|
},
|
|
1928
|
-
{
|
|
1774
|
+
{ immediate: !0 }
|
|
1775
|
+
), T(
|
|
1776
|
+
() => r.value,
|
|
1777
|
+
(g) => {
|
|
1778
|
+
a.autoClean && a.formData && a.outFields && g !== a.value && sa(a.formData, a.outFields, null);
|
|
1779
|
+
}
|
|
1780
|
+
);
|
|
1781
|
+
const o = ce(), { editorCtrl: i, errInfo: l, labelText: u } = o, c = t;
|
|
1782
|
+
o.inputEmit = c;
|
|
1783
|
+
const p = f([]), h = (g) => {
|
|
1784
|
+
var M;
|
|
1785
|
+
if (p.value = [], g === "") return;
|
|
1786
|
+
let d = g.trim(), I = {
|
|
1787
|
+
...n.value.params,
|
|
1788
|
+
Query: {
|
|
1789
|
+
...(M = n.value.params) == null ? void 0 : M.Query
|
|
1790
|
+
}
|
|
1791
|
+
};
|
|
1792
|
+
a.searchField && (I.Query[a.searchField] = {
|
|
1793
|
+
$like: "%" + d + "%"
|
|
1794
|
+
}), a.onsearch && a.onsearch(d, I), fe(!0, a, p, o, n.value, I);
|
|
1795
|
+
}, v = (g) => {
|
|
1796
|
+
const d = de(a, g, p, o);
|
|
1797
|
+
c("update:value", g), c("select", g);
|
|
1798
|
+
const I = he(d);
|
|
1799
|
+
c("update:labels", I), l != null && l.value.errClass && i && ue(i);
|
|
1800
|
+
};
|
|
1801
|
+
return se(() => {
|
|
1802
|
+
n.value && !n.value.fieldMap && (n.value.fieldMap = {
|
|
1803
|
+
title: "Name",
|
|
1804
|
+
label: "Name",
|
|
1805
|
+
value: "Name",
|
|
1806
|
+
key: "Id"
|
|
1807
|
+
});
|
|
1808
|
+
}), ne(() => {
|
|
1809
|
+
pe(a, o);
|
|
1810
|
+
}), (g, d) => {
|
|
1811
|
+
var I;
|
|
1812
|
+
return x(), O("div", null, [
|
|
1813
|
+
q(E(pa), re({
|
|
1814
|
+
value: r.value,
|
|
1815
|
+
"onUpdate:value": d[0] || (d[0] = (M) => r.value = M),
|
|
1816
|
+
class: [(I = E(l)) == null ? void 0 : I.errClass, "error w-full"],
|
|
1817
|
+
options: p.value,
|
|
1818
|
+
onSearch: h,
|
|
1819
|
+
onSelect: v,
|
|
1820
|
+
placeholder: a.url && !a.url.loading ? "请输入并选择" + E(u) : ""
|
|
1821
|
+
}, E(s)), null, 16, ["value", "class", "options", "placeholder"])
|
|
1822
|
+
]);
|
|
1823
|
+
};
|
|
1824
|
+
}
|
|
1825
|
+
}), it = { class: "min-h-[32px] pt-[5px]" }, lt = {
|
|
1826
|
+
key: 1,
|
|
1827
|
+
class: "text-center text-gray-500"
|
|
1828
|
+
}, Yt = /* @__PURE__ */ W({
|
|
1829
|
+
inheritAttrs: !1,
|
|
1830
|
+
__name: "index",
|
|
1831
|
+
props: {
|
|
1832
|
+
...oe,
|
|
1833
|
+
nodata: {
|
|
1834
|
+
type: String,
|
|
1835
|
+
default: ""
|
|
1836
|
+
},
|
|
1837
|
+
/**
|
|
1838
|
+
* 换行数量
|
|
1839
|
+
*/
|
|
1840
|
+
wrap: {
|
|
1841
|
+
type: Number
|
|
1842
|
+
},
|
|
1843
|
+
disabledItems: {
|
|
1844
|
+
type: Array
|
|
1845
|
+
}
|
|
1846
|
+
},
|
|
1847
|
+
emits: ["change", "update:labels"],
|
|
1848
|
+
setup(e, { emit: t }) {
|
|
1849
|
+
var c, p, h;
|
|
1850
|
+
const a = e, s = te(), n = f({
|
|
1851
|
+
...a.url,
|
|
1852
|
+
url: ((c = a.url) == null ? void 0 : c.url) || "",
|
|
1853
|
+
fieldMap: a.fieldMap || ((p = a.url) == null ? void 0 : p.fieldMap),
|
|
1854
|
+
params: a.params || ((h = a.url) == null ? void 0 : h.params),
|
|
1855
|
+
loadingText: !1
|
|
1856
|
+
}), r = ce(), { errInfo: o } = r, i = t;
|
|
1857
|
+
r.inputEmit = i;
|
|
1858
|
+
const l = f([]), u = (v) => {
|
|
1859
|
+
const m = de(a, v, l, r), b = he(m);
|
|
1860
|
+
i("update:labels", b);
|
|
1861
|
+
};
|
|
1862
|
+
return se(() => {
|
|
1863
|
+
n.value && !n.value.fieldMap && (n.value.fieldMap = {
|
|
1864
|
+
title: "Name",
|
|
1865
|
+
label: "Name",
|
|
1866
|
+
value: "Id",
|
|
1867
|
+
key: "Id"
|
|
1868
|
+
}), fe(a.autoload, a, l, r, n.value, n.value.params);
|
|
1869
|
+
}), ne(() => {
|
|
1870
|
+
pe(a, r);
|
|
1871
|
+
}), (v, w) => (x(), O("div", it, [
|
|
1872
|
+
q(E(da), re({
|
|
1873
|
+
onChange: u,
|
|
1874
|
+
class: "w-full mb-[-3px]"
|
|
1875
|
+
}, E(s)), {
|
|
1876
|
+
default: H(() => [
|
|
1877
|
+
l.value.length > 0 ? (x(!0), O(B, { key: 0 }, Ae(l.value, (m) => {
|
|
1878
|
+
var b;
|
|
1879
|
+
return x(), Re(E(ha), {
|
|
1880
|
+
key: m.value,
|
|
1881
|
+
value: m.value,
|
|
1882
|
+
disabled: m.disabled || m.value && e.disabledItems && e.disabledItems.indexOf(m.value.toString()) > -1,
|
|
1883
|
+
class: Ve([
|
|
1884
|
+
((b = E(o)) == null ? void 0 : b.errClass) === "error" ? "error !text-red-400" : "",
|
|
1885
|
+
"text-nowrap",
|
|
1886
|
+
"pb-1",
|
|
1887
|
+
e.wrap ? `w-1/${a.wrap}` : ""
|
|
1888
|
+
])
|
|
1889
|
+
}, {
|
|
1890
|
+
default: H(() => [
|
|
1891
|
+
Te(J(m.label), 1)
|
|
1892
|
+
]),
|
|
1893
|
+
_: 2
|
|
1894
|
+
}, 1032, ["value", "disabled", "class"]);
|
|
1895
|
+
}), 128)) : e.nodata ? (x(), O("div", lt, J(e.nodata), 1)) : j("", !0)
|
|
1896
|
+
]),
|
|
1897
|
+
_: 1
|
|
1898
|
+
}, 16)
|
|
1899
|
+
]));
|
|
1900
|
+
}
|
|
1901
|
+
}), ut = { class: "min-h-[32px] pt-1" }, ct = {
|
|
1902
|
+
key: 1,
|
|
1903
|
+
class: "text-center text-gray-500"
|
|
1904
|
+
}, Xt = /* @__PURE__ */ W({
|
|
1905
|
+
inheritAttrs: !1,
|
|
1906
|
+
__name: "index",
|
|
1907
|
+
props: {
|
|
1908
|
+
...oe,
|
|
1909
|
+
value: {
|
|
1910
|
+
type: [String, Number, null, Array],
|
|
1911
|
+
default: void 0
|
|
1912
|
+
},
|
|
1913
|
+
nodata: {
|
|
1914
|
+
type: String,
|
|
1915
|
+
default: "无数据"
|
|
1916
|
+
},
|
|
1917
|
+
/**
|
|
1918
|
+
* 换行数量
|
|
1919
|
+
*/
|
|
1920
|
+
wrap: {
|
|
1921
|
+
type: Number
|
|
1922
|
+
}
|
|
1923
|
+
},
|
|
1924
|
+
emits: ["change", "update:value", "update:labels"],
|
|
1925
|
+
setup(e, { emit: t }) {
|
|
1926
|
+
var h, v, w;
|
|
1927
|
+
const a = e, s = te(), n = f({
|
|
1928
|
+
...a.url,
|
|
1929
|
+
url: ((h = a.url) == null ? void 0 : h.url) || "",
|
|
1930
|
+
fieldMap: a.fieldMap || ((v = a.url) == null ? void 0 : v.fieldMap),
|
|
1931
|
+
params: a.params || ((w = a.url) == null ? void 0 : w.params),
|
|
1932
|
+
loadingText: !1
|
|
1933
|
+
}), r = f(a.value), o = ce(), { errInfo: i } = o, l = f([]), u = t;
|
|
1934
|
+
o.inputEmit = u, T(
|
|
1935
|
+
() => r.value,
|
|
1936
|
+
(m) => {
|
|
1937
|
+
u("update:value", m);
|
|
1938
|
+
}
|
|
1929
1939
|
);
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
S.error("`" + o.value + "` 未配置选项数据!", {
|
|
1935
|
-
duration: 5e3
|
|
1936
|
-
});
|
|
1937
|
-
}
|
|
1938
|
-
}, Me = (e, t, a, s) => {
|
|
1939
|
-
if (!t || t.length === 0) {
|
|
1940
|
-
a.value = [];
|
|
1941
|
-
return;
|
|
1942
|
-
}
|
|
1943
|
-
if (s) {
|
|
1944
|
-
const r = {
|
|
1945
|
-
...e.fieldMap
|
|
1946
|
-
};
|
|
1947
|
-
t = ba(r, t);
|
|
1948
|
-
}
|
|
1949
|
-
t = JSON.parse(JSON.stringify(t)), e.all && t.unshift({
|
|
1950
|
-
label: "全部",
|
|
1951
|
-
value: void 0
|
|
1952
|
-
}), a.value = t;
|
|
1953
|
-
}, it = (e, t, a, s) => {
|
|
1954
|
-
Array.isArray(a) ? Me(t, a, s, !0) : ra(e, t, { Query: a }, s);
|
|
1955
|
-
}, fe = (e, t) => {
|
|
1956
|
-
t && e.reloadEvent && t.reloadHandler && ee.off(e.reloadEvent, t.reloadHandler);
|
|
1957
|
-
}, ra = (e, t, a, s) => {
|
|
1958
|
-
const r = Te(e.params, a, t.params);
|
|
1959
|
-
lt(e, t.fieldMap, r).then((n) => {
|
|
1960
|
-
Me(t, n, s, !1);
|
|
1961
|
-
});
|
|
1962
|
-
}, lt = (e, t, a) => {
|
|
1963
|
-
const { fieldMap: s, ...r } = e, o = {
|
|
1964
|
-
...{
|
|
1965
|
-
url: "",
|
|
1966
|
-
cacheTime: 6e4,
|
|
1967
|
-
fieldMap: {
|
|
1968
|
-
...t,
|
|
1969
|
-
...e.fieldMap
|
|
1940
|
+
const c = (m, b) => {
|
|
1941
|
+
if (typeof m == "object" && typeof b == "object") {
|
|
1942
|
+
const g = JSON.stringify(m) === JSON.stringify(b);
|
|
1943
|
+
return g && (r.value = m), g;
|
|
1970
1944
|
}
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
}, ut = (e, t) => {
|
|
1976
|
-
if (e !== void 0)
|
|
1977
|
-
return Array.isArray(e) ? t.filter((a) => e.includes(a.value)) : t.find((a) => a.value === e);
|
|
1978
|
-
}, be = (e, t, a) => {
|
|
1979
|
-
const s = t.split(".");
|
|
1980
|
-
let r = e;
|
|
1981
|
-
for (let n = 0; n < s.length - 1; n++) {
|
|
1982
|
-
const o = s[n];
|
|
1983
|
-
r[o] || (r[o] = {}), r = r[o];
|
|
1984
|
-
}
|
|
1985
|
-
r[s[s.length - 1]] = a;
|
|
1986
|
-
}, na = (e, t, a) => {
|
|
1987
|
-
if (a == null) {
|
|
1988
|
-
Object.entries(t).forEach(([s]) => {
|
|
1989
|
-
be(e, s, a);
|
|
1990
|
-
});
|
|
1991
|
-
return;
|
|
1992
|
-
}
|
|
1993
|
-
Array.isArray(a) || Object.entries(t).forEach(([s, r]) => {
|
|
1994
|
-
if (r.includes("${")) {
|
|
1995
|
-
const n = Sa(r, a);
|
|
1996
|
-
be(e, s, n);
|
|
1997
|
-
} else
|
|
1998
|
-
be(e, s, a[r]);
|
|
1999
|
-
});
|
|
2000
|
-
}, pe = (e, t, a, s) => {
|
|
2001
|
-
var n;
|
|
2002
|
-
s.editorCtrl && ((n = s.errInfo) != null && n.value.errClass) && le(s.editorCtrl);
|
|
2003
|
-
const r = ut(t, a.value);
|
|
2004
|
-
return e.formData && e.outFields && na(e.formData, e.outFields, r), e.changeEvent && (Array.isArray(e.changeEvent) ? e.changeEvent.every((o) => {
|
|
2005
|
-
ee.emit(o, t, r);
|
|
2006
|
-
}) : ee.emit(e.changeEvent, t, r)), s.inputEmit && s.inputEmit("change", t, r), r;
|
|
2007
|
-
}, de = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((t) => t.label) : [e.label], Yt = (e, t, a, s) => {
|
|
2008
|
-
oa(e, [], a, s).forEach((n) => t.push(n));
|
|
2009
|
-
}, oa = (e, t, a, s) => {
|
|
2010
|
-
var o, i, l, u, c;
|
|
2011
|
-
const r = [], n = Q();
|
|
2012
|
-
for (const p of e) {
|
|
2013
|
-
if (p.redirect || p.path.includes("/login") || p.path.includes("/error") || p.path.includes("/:page(.*)") || (i = (o = p.meta) == null ? void 0 : o.roles) != null && i.length && !n.hasRole(p.meta.roles) && (l = p.meta) != null && l.permission && !n.hasPermit(p.meta.permission, ":page"))
|
|
2014
|
-
continue;
|
|
2015
|
-
const h = p.path.split("/");
|
|
2016
|
-
h.unshift(...t);
|
|
2017
|
-
const v = oa(p.children || [], h, a, s), w = {
|
|
2018
|
-
key: h.join("/"),
|
|
2019
|
-
label: ((u = p.name) == null ? void 0 : u.toString()) ?? "",
|
|
2020
|
-
title: ((c = p.name) == null ? void 0 : c.toString()) ?? "",
|
|
2021
|
-
icon: p.icon ? D(a, { ...s, icon: p.icon }) : void 0,
|
|
2022
|
-
children: v.length > 0 ? v : void 0
|
|
1945
|
+
return m === b;
|
|
1946
|
+
}, p = (m) => {
|
|
1947
|
+
const b = m.target.value, g = de(a, b, l, o), d = he(g);
|
|
1948
|
+
u("update:labels", d);
|
|
2023
1949
|
};
|
|
2024
|
-
(
|
|
1950
|
+
return se(() => {
|
|
1951
|
+
var m;
|
|
1952
|
+
n.value && !n.value.fieldMap && (n.value.fieldMap = {
|
|
1953
|
+
label: "Name",
|
|
1954
|
+
value: "Id",
|
|
1955
|
+
key: "Id"
|
|
1956
|
+
}), fe(a.autoload, a, l, o, n.value, (m = n.value) == null ? void 0 : m.params);
|
|
1957
|
+
}), ne(() => {
|
|
1958
|
+
pe(a, o);
|
|
1959
|
+
}), (m, b) => (x(), O("div", ut, [
|
|
1960
|
+
q(E(ma), re({
|
|
1961
|
+
value: r.value,
|
|
1962
|
+
"onUpdate:value": b[0] || (b[0] = (g) => r.value = g),
|
|
1963
|
+
autocheck: !1,
|
|
1964
|
+
onChange: p,
|
|
1965
|
+
class: "w-full flex align-items flex-wrap mb-[-3px]"
|
|
1966
|
+
}, E(s)), {
|
|
1967
|
+
default: H(() => [
|
|
1968
|
+
l.value.length > 0 ? (x(!0), O(B, { key: 0 }, Ae(l.value, (g) => {
|
|
1969
|
+
var d;
|
|
1970
|
+
return x(), O(B, {
|
|
1971
|
+
key: g.value
|
|
1972
|
+
}, [
|
|
1973
|
+
g.visible !== !1 ? (x(), Re(E(va), {
|
|
1974
|
+
key: 0,
|
|
1975
|
+
checked: c(g.value, a.value),
|
|
1976
|
+
value: g.value,
|
|
1977
|
+
class: Ve([
|
|
1978
|
+
((d = E(i)) == null ? void 0 : d.errClass) === "error" ? "error !text-red-400" : "",
|
|
1979
|
+
"text-nowrap",
|
|
1980
|
+
"pb-1",
|
|
1981
|
+
e.wrap ? `w-1/${a.wrap}` : ""
|
|
1982
|
+
])
|
|
1983
|
+
}, {
|
|
1984
|
+
default: H(() => [
|
|
1985
|
+
Te(J(g.label), 1)
|
|
1986
|
+
]),
|
|
1987
|
+
_: 2
|
|
1988
|
+
}, 1032, ["checked", "value", "class"])) : j("", !0)
|
|
1989
|
+
], 64);
|
|
1990
|
+
}), 128)) : e.nodata ? (x(), O("div", ct, J(e.nodata), 1)) : j("", !0)
|
|
1991
|
+
]),
|
|
1992
|
+
_: 1
|
|
1993
|
+
}, 16, ["value"])
|
|
1994
|
+
]));
|
|
2025
1995
|
}
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
};
|
|
2038
|
-
He.push(o);
|
|
2039
|
-
});
|
|
2040
|
-
}, ct = {
|
|
2041
|
-
host: {
|
|
2042
|
-
api: "SITEHOST_API",
|
|
2043
|
-
url: "/openapi/RCSiteHostSrv/get",
|
|
2044
|
-
fieldMap: {
|
|
2045
|
-
hostId: "Id",
|
|
2046
|
-
hostName: "Title"
|
|
1996
|
+
}), ft = {
|
|
1997
|
+
key: 0,
|
|
1998
|
+
class: "absolute z-10 mt-[5px] mr-[10px] text-[#999] flex items-center"
|
|
1999
|
+
}, Zt = /* @__PURE__ */ W({
|
|
2000
|
+
inheritAttrs: !1,
|
|
2001
|
+
__name: "index",
|
|
2002
|
+
props: {
|
|
2003
|
+
...oe,
|
|
2004
|
+
value: {
|
|
2005
|
+
type: [String, Number, Array, null],
|
|
2006
|
+
default: void 0
|
|
2047
2007
|
},
|
|
2048
|
-
loadingText: "站点配置加载中……",
|
|
2049
|
-
// 不显示错误
|
|
2050
|
-
hideErrorToast: !0
|
|
2051
|
-
}
|
|
2052
|
-
}, Zt = Y("hostInfo", {
|
|
2053
|
-
state: () => ({
|
|
2054
|
-
hostInfo: {
|
|
2055
|
-
Host: "",
|
|
2056
|
-
Title: "",
|
|
2057
|
-
API_HOST: {},
|
|
2058
|
-
SERVER_HOST: {},
|
|
2059
|
-
ExtraProps: {},
|
|
2060
|
-
ExtraPropLines: []
|
|
2061
|
-
}
|
|
2062
|
-
}),
|
|
2063
|
-
actions: {
|
|
2064
2008
|
/**
|
|
2065
|
-
*
|
|
2066
|
-
* @param hostApi 启动配置主机地址
|
|
2067
|
-
* @param hostKey 站点信息,默认为当前主域名
|
|
2068
|
-
* @param mainOpenApis 宿主机开放接口
|
|
2009
|
+
* 自动选择第一个选项
|
|
2069
2010
|
*/
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
return;
|
|
2074
|
-
}
|
|
2075
|
-
return new Promise((s) => {
|
|
2076
|
-
ve.SITEHOST_API || (ve.SITEHOST_API = e);
|
|
2077
|
-
const r = t || window.location.origin;
|
|
2078
|
-
_(ct.host, {
|
|
2079
|
-
Query: {
|
|
2080
|
-
Host: r
|
|
2081
|
-
}
|
|
2082
|
-
}).then((n) => {
|
|
2083
|
-
if ((n == null ? void 0 : n.status) === A.SUCCESS && n.data) {
|
|
2084
|
-
const o = n.data;
|
|
2085
|
-
this._setHostInfo(o);
|
|
2086
|
-
}
|
|
2087
|
-
s();
|
|
2088
|
-
});
|
|
2089
|
-
});
|
|
2011
|
+
selectFirst: {
|
|
2012
|
+
type: Boolean,
|
|
2013
|
+
default: !1
|
|
2090
2014
|
},
|
|
2091
2015
|
/**
|
|
2092
|
-
*
|
|
2016
|
+
* 数据源OPTIONS的key
|
|
2093
2017
|
*/
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
...e
|
|
2098
|
-
}, this.hostInfo.API_HOST)
|
|
2099
|
-
for (const t in this.hostInfo.API_HOST) ve[t] = this.hostInfo.API_HOST[t];
|
|
2100
|
-
if (this.hostInfo.SERVER_HOST)
|
|
2101
|
-
for (const t in this.hostInfo.SERVER_HOST) Ia[t] = this.hostInfo.SERVER_HOST[t];
|
|
2018
|
+
dataKey: {
|
|
2019
|
+
type: String,
|
|
2020
|
+
required: !1
|
|
2102
2021
|
},
|
|
2103
|
-
|
|
2104
|
-
|
|
2022
|
+
/**
|
|
2023
|
+
* 是否显示全部选项
|
|
2024
|
+
*/
|
|
2025
|
+
all: {
|
|
2026
|
+
type: Boolean,
|
|
2027
|
+
default: !1
|
|
2028
|
+
},
|
|
2029
|
+
/**
|
|
2030
|
+
* 自定义全部选项的值
|
|
2031
|
+
* 如果all为true,则显示全部选项
|
|
2032
|
+
* 未设置allValue,则默认[0, 1]
|
|
2033
|
+
*/
|
|
2034
|
+
allValue: {
|
|
2035
|
+
type: [String, Number, Array],
|
|
2036
|
+
required: !1
|
|
2105
2037
|
}
|
|
2106
2038
|
},
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2039
|
+
emits: ["change", "update:value", "update:labels"],
|
|
2040
|
+
setup(e, { emit: t }) {
|
|
2041
|
+
var m, b, g;
|
|
2042
|
+
const a = e, s = te(), n = f({
|
|
2043
|
+
...a.url,
|
|
2044
|
+
url: ((m = a.url) == null ? void 0 : m.url) || "",
|
|
2045
|
+
fieldMap: a.fieldMap || ((b = a.url) == null ? void 0 : b.fieldMap),
|
|
2046
|
+
params: a.params || ((g = a.url) == null ? void 0 : g.params),
|
|
2047
|
+
loadingText: !1
|
|
2048
|
+
}), r = ce(), { editorCtrl: o, errInfo: i, labelText: l } = r, u = f(void 0), c = t;
|
|
2049
|
+
r.inputEmit = c;
|
|
2050
|
+
const p = f([]);
|
|
2051
|
+
T(
|
|
2052
|
+
() => p.value,
|
|
2053
|
+
(d) => {
|
|
2054
|
+
d.length > 0 && D(a.value) && a.selectFirst ? (u.value = d[0].value, w(d[0].value)) : u.value = a.value === null ? void 0 : a.value;
|
|
2055
|
+
}
|
|
2056
|
+
);
|
|
2057
|
+
const h = f(s.placeholder);
|
|
2058
|
+
T(
|
|
2059
|
+
() => n.value.loading,
|
|
2060
|
+
(d) => {
|
|
2061
|
+
d ? h.value = "" : h.value || (h.value = "请选择" + l.value);
|
|
2062
|
+
},
|
|
2063
|
+
{ immediate: !0 }
|
|
2064
|
+
);
|
|
2065
|
+
const v = f(a.value);
|
|
2066
|
+
T(
|
|
2067
|
+
() => u.value,
|
|
2068
|
+
(d) => {
|
|
2069
|
+
if (s.mode === "multiple" && D(d) && D(v.value)) {
|
|
2070
|
+
c("update:value", v.value);
|
|
2071
|
+
return;
|
|
2072
|
+
}
|
|
2073
|
+
c("update:value", d);
|
|
2074
|
+
}
|
|
2075
|
+
);
|
|
2076
|
+
const w = (d) => {
|
|
2077
|
+
const I = de(a, d, p, r), M = he(I);
|
|
2078
|
+
u.value = d, c("update:labels", M), c("change", d), i != null && i.value.errClass && o && ue(o);
|
|
2079
|
+
};
|
|
2080
|
+
return se(() => {
|
|
2081
|
+
var d;
|
|
2082
|
+
if (n.value && !n.value.fieldMap && (n.value.fieldMap = {
|
|
2083
|
+
label: "Name",
|
|
2084
|
+
value: "Id",
|
|
2085
|
+
key: "Id"
|
|
2086
|
+
}), a.dataKey) {
|
|
2087
|
+
const I = JSON.parse(JSON.stringify(L.getOptions(a.dataKey)));
|
|
2088
|
+
p.value = I;
|
|
2089
|
+
} else fe(a.autoload, a, p, r, n.value, (d = n.value) == null ? void 0 : d.params);
|
|
2090
|
+
}), ne(() => {
|
|
2091
|
+
pe(a, r);
|
|
2092
|
+
}), (d, I) => {
|
|
2093
|
+
var M;
|
|
2094
|
+
return x(), O("div", null, [
|
|
2095
|
+
a.url && a.url.loading === !0 ? (x(), O("div", ft, [
|
|
2096
|
+
q(E(xe), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
|
|
2097
|
+
I[1] || (I[1] = fa("span", null, "数据加载中...", -1))
|
|
2098
|
+
])) : j("", !0),
|
|
2099
|
+
q(E(ga), re({
|
|
2100
|
+
class: [(M = E(i)) == null ? void 0 : M.errClass, "w-full"],
|
|
2101
|
+
value: u.value,
|
|
2102
|
+
"onUpdate:value": I[0] || (I[0] = (K) => u.value = K),
|
|
2103
|
+
"allow-clear": !0,
|
|
2104
|
+
onChange: w,
|
|
2105
|
+
placeholder: h.value,
|
|
2106
|
+
"label-in-value": !1
|
|
2107
|
+
}, E(s)), {
|
|
2108
|
+
default: H(() => [
|
|
2109
|
+
(x(!0), O(B, null, Ae(p.value, (K) => (x(), O(B, {
|
|
2110
|
+
key: K.value
|
|
2111
|
+
}, [
|
|
2112
|
+
K.visible !== !1 ? (x(), Re(E(ya), {
|
|
2113
|
+
key: 0,
|
|
2114
|
+
value: K.value
|
|
2115
|
+
}, {
|
|
2116
|
+
default: H(() => [
|
|
2117
|
+
Te(J(K.label), 1)
|
|
2118
|
+
]),
|
|
2119
|
+
_: 2
|
|
2120
|
+
}, 1032, ["value"])) : j("", !0)
|
|
2121
|
+
], 64))), 128))
|
|
2122
|
+
]),
|
|
2123
|
+
_: 1
|
|
2124
|
+
}, 16, ["class", "value", "placeholder"])
|
|
2125
|
+
]);
|
|
2126
|
+
};
|
|
2127
|
+
}
|
|
2128
|
+
});
|
|
2116
2129
|
export {
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2130
|
+
Tt as $,
|
|
2131
|
+
Pe as A,
|
|
2132
|
+
Ta as B,
|
|
2133
|
+
Kt as C,
|
|
2134
|
+
ja as D,
|
|
2135
|
+
Ba as E,
|
|
2136
|
+
Ht as F,
|
|
2137
|
+
Qt as G,
|
|
2138
|
+
Ya as H,
|
|
2139
|
+
sa as I,
|
|
2127
2140
|
de as J,
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2141
|
+
he as K,
|
|
2142
|
+
Gt as L,
|
|
2143
|
+
qt as M,
|
|
2144
|
+
st as N,
|
|
2132
2145
|
L as O,
|
|
2133
2146
|
$ as P,
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2147
|
+
nt as Q,
|
|
2148
|
+
jt as R,
|
|
2149
|
+
He as S,
|
|
2150
|
+
Bt as T,
|
|
2151
|
+
Be as U,
|
|
2152
|
+
Mt as V,
|
|
2153
|
+
Je as W,
|
|
2154
|
+
Rt as X,
|
|
2155
|
+
wt as Y,
|
|
2156
|
+
ke as Z,
|
|
2157
|
+
Wt as _,
|
|
2158
|
+
zt as a,
|
|
2159
|
+
Dt as a0,
|
|
2160
|
+
qa as a1,
|
|
2161
|
+
ea as a2,
|
|
2162
|
+
Nt as a3,
|
|
2163
|
+
At as a4,
|
|
2164
|
+
je as a5,
|
|
2165
|
+
wa as a6,
|
|
2166
|
+
aa as a7,
|
|
2167
|
+
ae as a8,
|
|
2155
2168
|
V as a9,
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2169
|
+
ee as aa,
|
|
2170
|
+
F as ab,
|
|
2171
|
+
Jt as ac,
|
|
2172
|
+
Le as ad,
|
|
2160
2173
|
z as ae,
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2174
|
+
kt as b,
|
|
2175
|
+
Vt as c,
|
|
2176
|
+
Pt as d,
|
|
2177
|
+
Ot as e,
|
|
2178
|
+
Ut as f,
|
|
2179
|
+
_t as g,
|
|
2180
|
+
Ct as h,
|
|
2181
|
+
D as i,
|
|
2182
|
+
$t as j,
|
|
2183
|
+
ce as k,
|
|
2184
|
+
fe as l,
|
|
2185
|
+
pe as m,
|
|
2186
|
+
ue as n,
|
|
2187
|
+
Lt as o,
|
|
2188
|
+
Ze as p,
|
|
2189
|
+
Va as q,
|
|
2190
|
+
N as r,
|
|
2191
|
+
Ft as s,
|
|
2192
|
+
Oa as t,
|
|
2193
|
+
Q as u,
|
|
2194
|
+
oe as v,
|
|
2195
|
+
xe as w,
|
|
2196
|
+
Yt as x,
|
|
2197
|
+
Xt as y,
|
|
2198
|
+
Zt as z
|
|
2186
2199
|
};
|