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