@skyfox2000/webui 1.3.0 → 1.3.2
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-C4GVmWjB.js → file-upload-BVB9c-eZ.js} +1 -1
- package/lib/assets/modules/{form-excel-Cr2hcL1s.js → form-excel-CsQBtfkA.js} +1 -1
- package/lib/assets/modules/{index-DjBruVH-.js → index-CaaMz5sz.js} +1 -1
- package/lib/assets/modules/{index-D5onbqkl.js → index-k_AnrbPY.js} +2 -2
- package/lib/assets/modules/{menuTabs-B9fCWfN1.js → menuTabs-_Ph7P8ES.js} +2 -2
- package/lib/assets/modules/{toolIcon-DKTf30Tq.js → toolIcon-QMXCkImG.js} +1 -1
- package/lib/assets/modules/{uploadList-D2lisNHt.js → uploadList-CXa3siDj.js} +4 -4
- package/lib/assets/modules/{uploadList-CY57np42.js → uploadList-D-FOtndj.js} +370 -366
- package/lib/es/AceEditor/index.js +3 -3
- package/lib/es/BasicLayout/index.js +3 -3
- package/lib/es/Error403/index.js +1 -1
- package/lib/es/Error404/index.js +1 -1
- package/lib/es/ExcelForm/index.js +4 -4
- package/lib/es/UploadForm/index.js +4 -4
- package/lib/typings/option.d.ts +9 -8
- package/lib/utils/options.d.ts +1 -1
- package/lib/webui.css +1 -1
- package/lib/webui.es.js +99 -99
- package/package.json +1 -1
- package/src/components/form/autoComplete/index.vue +1 -1
- package/src/components/form/cascader/index.vue +1 -1
- package/src/components/form/checkbox/index.vue +1 -1
- package/src/components/form/radio/index.vue +1 -1
- package/src/components/form/select/index.vue +1 -9
- package/src/components/form/switch/index.vue +1 -1
- package/src/typings/option.d.ts +9 -8
- package/src/utils/options.ts +16 -26
- package/src/utils/page.ts +43 -4
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
var da = Object.defineProperty;
|
|
2
2
|
var ha = (e, t, a) => t in e ? da(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
3
|
var F = (e, t, a) => ha(e, typeof t != "symbol" ? t + "" : t, a);
|
|
4
|
-
import { inject as Z, ref as f, provide as
|
|
5
|
-
import { Switch as ya, AutoComplete as Sa, CheckboxGroup as ba, Checkbox as Ia, RadioGroup as xa, Radio as Aa, Select as Ea, SelectOption as
|
|
6
|
-
import { createPinia as
|
|
7
|
-
import
|
|
4
|
+
import { inject as Z, ref as f, provide as Te, watch as b, toRaw as Ye, h as _, nextTick as ma, shallowRef as H, defineComponent as C, reactive as va, onMounted as oe, onUnmounted as ie, createBlock as Ie, createCommentVNode as B, openBlock as A, unref as S, mergeProps as le, useAttrs as xe, createElementBlock as L, createVNode as ae, withCtx as z, Fragment as te, renderList as De, normalizeClass as Xe, createTextVNode as Ue, toDisplayString as se, createElementVNode as ga } from "vue";
|
|
5
|
+
import { Switch as ya, AutoComplete as Sa, CheckboxGroup as ba, Checkbox as Ia, RadioGroup as xa, Radio as Aa, Select as Ea, SelectOption as Oa } from "ant-design-vue";
|
|
6
|
+
import { createPinia as Ra, defineStore as ue } from "pinia";
|
|
7
|
+
import Ta from "pinia-plugin-persistedstate";
|
|
8
8
|
import { combineParams as _e, EnvConfig as ye, AppAction as qe, AppSource as Be, isMicroApp as Se, mainAppApis as D, isBaseMicroApp as wa } from "@skyfox2000/microbase";
|
|
9
|
-
import { ResStatus as
|
|
9
|
+
import { ResStatus as R, httpPost as G, setToken as me, fieldMapping as Pa, parseFieldTemplate as Me, API_HOST as we, SERVER_HOST as ka } from "@skyfox2000/fapi";
|
|
10
10
|
import x from "vue-m-message";
|
|
11
11
|
import Ve from "async-validator";
|
|
12
12
|
import { createRouter as La, createWebHashHistory as Fa } from "vue-router";
|
|
13
13
|
import "dayjs";
|
|
14
14
|
import "vue-draggable-next";
|
|
15
|
-
const Ma =
|
|
16
|
-
Ma.use(
|
|
15
|
+
const Ma = Ra();
|
|
16
|
+
Ma.use(Ta);
|
|
17
17
|
var U = /* @__PURE__ */ ((e) => (e.PageControl = "Page.PageControl", e.EditorControl = "Page.EditorControl", e.GridControl = "Page.GridControl", e.LabelText = "FormItem.LabelText", e.LabelWidth = "FormItem.LabelWidth", e.RuleKey = "FormItem.RuleKey", e.ErrInfo = "FormItem.ErrInfo", e))(U || {});
|
|
18
18
|
const w = class w {
|
|
19
19
|
};
|
|
@@ -174,10 +174,10 @@ const ce = {
|
|
|
174
174
|
required: !1
|
|
175
175
|
}
|
|
176
176
|
}, P = (e) => e == null || e === "" ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1, Ae = (e, t) => {
|
|
177
|
-
var
|
|
177
|
+
var n;
|
|
178
178
|
return {
|
|
179
179
|
url: "",
|
|
180
|
-
...(
|
|
180
|
+
...(n = e.page.urls) == null ? void 0 : n[t.urlKey],
|
|
181
181
|
...e.url,
|
|
182
182
|
...t.url,
|
|
183
183
|
loadingText: t.loadingText
|
|
@@ -185,17 +185,17 @@ const ce = {
|
|
|
185
185
|
}, Ee = (e, t) => {
|
|
186
186
|
const a = e.page, s = t.url;
|
|
187
187
|
if (!s || !s.url) {
|
|
188
|
-
const
|
|
189
|
-
return console.warn(
|
|
188
|
+
const o = `URL未设置: ${t.urlKey}`;
|
|
189
|
+
return console.warn(o), Promise.reject(new Error(o));
|
|
190
190
|
}
|
|
191
191
|
s.api || (s.api = a.api), s.authorize === void 0 && (s.authorize = a.authorize);
|
|
192
|
-
let
|
|
193
|
-
return t.processParams && (
|
|
192
|
+
let n = JSON.parse(JSON.stringify(t.params));
|
|
193
|
+
return t.processParams && (n = t.processParams(n)), t.loadingState && (t.loadingState.value = !0), t.hideErrorToast && (s.hideErrorToast = !0), G(s, n).then((o) => (t.loadingState && (t.loadingState.value = !1), o)).catch((o) => (t.loadingState && (t.loadingState.value = !1), null));
|
|
194
194
|
}, He = (e, t) => {
|
|
195
195
|
t.params || (t.params = {}), t.params.Query || (t.params.Query = {});
|
|
196
196
|
const a = Ae(e, t);
|
|
197
197
|
return t.url = a, Ee(e, t);
|
|
198
|
-
}, Pt = (e, t) => (t.params || (t.params = {}), t.params.Query || (t.params.Query = {}), t.loadingText = t.loadingText === !1 ? !1 : t.loadingText || "开始执行...", t.url = Ae(e, t), Ee(e, t).then((a) => ((a == null ? void 0 : a.status) ===
|
|
198
|
+
}, Pt = (e, t) => (t.params || (t.params = {}), t.params.Query || (t.params.Query = {}), t.loadingText = t.loadingText === !1 ? !1 : t.loadingText || "开始执行...", t.url = Ae(e, t), Ee(e, t).then((a) => ((a == null ? void 0 : a.status) === R.SUCCESS && (t.hideErrorToast || x.success("执行成功!")), a))), Ze = (e, t = {}) => {
|
|
199
199
|
const a = t.primaryKey || "Id";
|
|
200
200
|
if (t.params || (t.params = {}), t.params.Query || (t.params.Query = {}), !t.params.Data)
|
|
201
201
|
return x.error("错误!无保存数据!"), Promise.resolve(null);
|
|
@@ -205,27 +205,27 @@ const ce = {
|
|
|
205
205
|
loadingText: t.loadingText === !1 ? !1 : t.loadingText || "数据保存中..."
|
|
206
206
|
};
|
|
207
207
|
s.params.Query[a] = s.params.Data[a];
|
|
208
|
-
const
|
|
209
|
-
return s.url =
|
|
208
|
+
const n = Ae(e, s);
|
|
209
|
+
return s.url = n, Ee(e, s).then((o) => ((o == null ? void 0 : o.status) === R.SUCCESS && (t.hideErrorToast || x.success("保存成功!")), o));
|
|
210
210
|
}, $a = (e, t, a = {}) => {
|
|
211
211
|
const s = a.primaryKey || "Id";
|
|
212
212
|
a.params || (a.params = {}), a.params.Query || (a.params.Query = {});
|
|
213
|
-
const
|
|
213
|
+
const n = {
|
|
214
214
|
...a,
|
|
215
215
|
urlKey: "delete",
|
|
216
216
|
loadingText: a.loadingText === !1 ? !1 : a.loadingText || "数据删除中..."
|
|
217
217
|
};
|
|
218
|
-
if (Array.isArray(t) ?
|
|
218
|
+
if (Array.isArray(t) ? n.params.Query[s] = t : n.params.Query[s] = t[s], P(n.params.Query) || P(n.params.Query[s]))
|
|
219
219
|
return x.error("错误!禁止无条件删除数据!"), Promise.resolve(null);
|
|
220
|
-
const
|
|
221
|
-
return
|
|
220
|
+
const o = Ae(e, n);
|
|
221
|
+
return n.url = o, Ee(e, n).then((r) => ((r == null ? void 0 : r.status) === R.SUCCESS && (a.hideErrorToast || x.success("删除成功!")), r));
|
|
222
222
|
}, Na = (e, t) => He(e, {
|
|
223
223
|
urlKey: "tree",
|
|
224
224
|
params: {},
|
|
225
225
|
loadingState: e.isTreeLoading,
|
|
226
226
|
loadingText: !1,
|
|
227
227
|
processParams: () => _e(e.treeQuery, t)
|
|
228
|
-
}).then((a) => (a == null ? void 0 : a.status) ===
|
|
228
|
+
}).then((a) => (a == null ? void 0 : a.status) === R.SUCCESS ? (e.data.value = a.data, e.data.value) : []);
|
|
229
229
|
let re;
|
|
230
230
|
const kt = (e) => {
|
|
231
231
|
re = new Ve({}), re.messages({
|
|
@@ -257,55 +257,55 @@ const kt = (e) => {
|
|
|
257
257
|
}, Lt = (e) => {
|
|
258
258
|
if (!e || P(e))
|
|
259
259
|
return [];
|
|
260
|
-
const t = [], a = re.messages(), s = (
|
|
261
|
-
const
|
|
262
|
-
if (
|
|
263
|
-
const u = a.types[
|
|
264
|
-
|
|
260
|
+
const t = [], a = re.messages(), s = (o, r, l) => {
|
|
261
|
+
const i = r.type;
|
|
262
|
+
if (i && a.types && i in a.types) {
|
|
263
|
+
const u = a.types[i];
|
|
264
|
+
n(u, o, { type: i }, l);
|
|
265
265
|
}
|
|
266
266
|
const c = ["string", "number", "array"];
|
|
267
267
|
for (const u of c)
|
|
268
|
-
if (
|
|
268
|
+
if (i === u && a[u]) {
|
|
269
269
|
const p = a[u], m = ["len", "min", "max", "range"];
|
|
270
270
|
for (const d of m)
|
|
271
|
-
d === "range" &&
|
|
271
|
+
d === "range" && r.min != null && r.max != null && p.range ? n(p.range, o, { min: r.min, max: r.max }, l) : d !== "range" && r[d] != null && p[d] && n(p[d], o, { [d]: r[d] }, l);
|
|
272
272
|
}
|
|
273
|
-
if (
|
|
274
|
-
const u =
|
|
275
|
-
|
|
273
|
+
if (r.required && a.required && n(a.required, o, {}, l), r.pattern && a.pattern && n(r.message, o, {}, l), r.enum && Array.isArray(r.enum) && a.enum) {
|
|
274
|
+
const u = r.enum.join(", ");
|
|
275
|
+
n(a.enum, o, { enum: u }, l);
|
|
276
276
|
}
|
|
277
|
-
},
|
|
278
|
-
if (
|
|
277
|
+
}, n = (o, r, l, i) => {
|
|
278
|
+
if (o)
|
|
279
279
|
try {
|
|
280
280
|
let c;
|
|
281
|
-
if (typeof
|
|
282
|
-
const u = [
|
|
281
|
+
if (typeof o == "function") {
|
|
282
|
+
const u = [r];
|
|
283
283
|
for (const p in l)
|
|
284
284
|
u.push(l[p]);
|
|
285
|
-
c =
|
|
285
|
+
c = o.apply(null, u), c && i.push(c);
|
|
286
286
|
} else {
|
|
287
|
-
c = String(
|
|
287
|
+
c = String(o);
|
|
288
288
|
for (const u in l)
|
|
289
289
|
c = c.replace(new RegExp(`\\$\\{${u}\\}`, "g"), l[u]);
|
|
290
|
-
c = c.replace(/\$\{label\}/g, ""), c &&
|
|
290
|
+
c = c.replace(/\$\{label\}/g, ""), c && i.push(c);
|
|
291
291
|
}
|
|
292
292
|
} catch (c) {
|
|
293
293
|
console.error("格式化验证消息出错:", c);
|
|
294
294
|
}
|
|
295
295
|
};
|
|
296
|
-
return Object.keys(e).forEach((
|
|
297
|
-
const
|
|
296
|
+
return Object.keys(e).forEach((o) => {
|
|
297
|
+
const r = e[o], l = [];
|
|
298
298
|
try {
|
|
299
|
-
s(
|
|
300
|
-
c && typeof c == "object" && s(
|
|
301
|
-
}),
|
|
299
|
+
s(o, r, l), Array.isArray(r) && r.forEach((c) => {
|
|
300
|
+
c && typeof c == "object" && s(o, c, l);
|
|
301
|
+
}), r && typeof r == "object" && "fields" in r;
|
|
302
302
|
} catch (c) {
|
|
303
303
|
console.error("处理验证规则出错:", c);
|
|
304
304
|
}
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
field:
|
|
308
|
-
rules:
|
|
305
|
+
const i = Array.from(new Set(l));
|
|
306
|
+
o && i.length > 0 && t.push({
|
|
307
|
+
field: o,
|
|
308
|
+
rules: i
|
|
309
309
|
});
|
|
310
310
|
}), t;
|
|
311
311
|
}, fe = async (e) => {
|
|
@@ -333,52 +333,52 @@ const kt = (e) => {
|
|
|
333
333
|
const s = t == null ? void 0 : t.ruleResults;
|
|
334
334
|
return b(
|
|
335
335
|
() => s == null ? void 0 : s.value,
|
|
336
|
-
(
|
|
337
|
-
if (a.value.errClass = "", a.value.msg = "", !P(
|
|
338
|
-
const
|
|
336
|
+
(n) => {
|
|
337
|
+
if (a.value.errClass = "", a.value.msg = "", !P(n)) {
|
|
338
|
+
const o = Ua(
|
|
339
339
|
{
|
|
340
340
|
label: e.label,
|
|
341
341
|
rule: e.rule
|
|
342
342
|
},
|
|
343
343
|
t == null ? void 0 : t.formRules.value,
|
|
344
|
-
Ye(
|
|
344
|
+
Ye(n)
|
|
345
345
|
);
|
|
346
|
-
a.value.errClass =
|
|
346
|
+
a.value.errClass = o.errClass.value, a.value.msg = o.msg.value;
|
|
347
347
|
}
|
|
348
348
|
},
|
|
349
349
|
{ deep: !0 }
|
|
350
350
|
), a;
|
|
351
351
|
}, Ua = (e, t, a) => {
|
|
352
|
-
const s = f([]),
|
|
352
|
+
const s = f([]), n = f(""), o = f("");
|
|
353
353
|
if (!e.rule || !t || !a)
|
|
354
|
-
return { msg:
|
|
355
|
-
e.rule.split("|").forEach((
|
|
356
|
-
if (
|
|
357
|
-
if (a[
|
|
358
|
-
s.value.push(...a[
|
|
354
|
+
return { msg: n, ruleErrors: s, errClass: o };
|
|
355
|
+
e.rule.split("|").forEach((i) => {
|
|
356
|
+
if (i = i.trim(), i)
|
|
357
|
+
if (a[i])
|
|
358
|
+
s.value.push(...a[i]);
|
|
359
359
|
else {
|
|
360
360
|
const c = [];
|
|
361
361
|
for (let u in a)
|
|
362
|
-
u !==
|
|
362
|
+
u !== i && u.startsWith(i + ".") && c.push(...a[u]);
|
|
363
363
|
c.length > 0 && s.value.push(...c);
|
|
364
364
|
}
|
|
365
365
|
});
|
|
366
366
|
const l = /\${\w+}/g;
|
|
367
|
-
return s.value.forEach((
|
|
368
|
-
|
|
369
|
-
const c = t[
|
|
367
|
+
return s.value.forEach((i) => {
|
|
368
|
+
n.value && (n.value += " / "), n.value += i.message.replace("${label}", e.label ?? "");
|
|
369
|
+
const c = t[i.field];
|
|
370
370
|
if (c) {
|
|
371
|
-
const u =
|
|
371
|
+
const u = n.value.match(l);
|
|
372
372
|
u && u.forEach((p) => {
|
|
373
373
|
const m = p.replace("${", "").replace("}", "");
|
|
374
|
-
|
|
374
|
+
n.value = n.value.replace(p, c[m] ?? "");
|
|
375
375
|
});
|
|
376
376
|
}
|
|
377
|
-
}), s.value.length > 0 && (
|
|
377
|
+
}), s.value.length > 0 && (o.value = "error"), { msg: n, ruleErrors: s, errClass: o };
|
|
378
378
|
}, Mt = (e, t) => {
|
|
379
|
-
|
|
379
|
+
Te(U.LabelText, e.label || ""), Te(U.RuleKey, e.rule || "");
|
|
380
380
|
const a = Da(e, t);
|
|
381
|
-
return
|
|
381
|
+
return Te(U.ErrInfo, a), a;
|
|
382
382
|
}, $t = (e) => {
|
|
383
383
|
ea(e);
|
|
384
384
|
}, Nt = (e) => {
|
|
@@ -411,37 +411,37 @@ const kt = (e) => {
|
|
|
411
411
|
// 隐藏自动错误提示,特殊判断控制
|
|
412
412
|
loadingState: e.isFormSaving
|
|
413
413
|
}
|
|
414
|
-
).then((
|
|
415
|
-
var
|
|
416
|
-
if ((
|
|
414
|
+
).then((n) => {
|
|
415
|
+
var o, r;
|
|
416
|
+
if ((n == null ? void 0 : n.status) === R.SUCCESS)
|
|
417
417
|
x.success("保存成功!"), e.grid && (e.grid.reload.value = !0), e.afterSave && e.afterSave(), e.autoClose !== !1 && (e.visible.value = !1);
|
|
418
|
-
else if (
|
|
419
|
-
const l = (
|
|
418
|
+
else if (n != null && n.msg && ((o = n == null ? void 0 : n.msg) == null ? void 0 : o.indexOf("Duplicate entry")) > -1) {
|
|
419
|
+
const l = (r = n == null ? void 0 : n.msg) == null ? void 0 : r.match(/Duplicate entry '([^']+)' for key '([^']+)'/);
|
|
420
420
|
if (l && l.length > 2 && l[1] && l[2]) {
|
|
421
|
-
const
|
|
421
|
+
const i = l[1], c = l[2].replace(/Idx_/g, "").split("_"), u = e.formRules.value;
|
|
422
422
|
if (u && c.length > 0) {
|
|
423
423
|
const p = {};
|
|
424
424
|
c.forEach((m) => {
|
|
425
425
|
u[m] && (p[m] = [
|
|
426
426
|
{
|
|
427
427
|
field: m,
|
|
428
|
-
fieldValue:
|
|
428
|
+
fieldValue: i,
|
|
429
429
|
message: "数据重复"
|
|
430
430
|
}
|
|
431
431
|
]);
|
|
432
432
|
}), Object.keys(p).length > 0 && (console.error("保存失败!", p), e.ruleResults.value = p);
|
|
433
433
|
}
|
|
434
|
-
x.error(`保存失败!数据 \`${
|
|
435
|
-
} else x.error((
|
|
434
|
+
x.error(`保存失败!数据 \`${i}\` 已存在!`);
|
|
435
|
+
} else x.error((n == null ? void 0 : n.msg) ?? "保存失败!");
|
|
436
436
|
} else
|
|
437
|
-
x.error((
|
|
437
|
+
x.error((n == null ? void 0 : n.msg) ?? "保存失败!");
|
|
438
438
|
});
|
|
439
439
|
}, Ut = async (e) => {
|
|
440
440
|
const t = e.page, a = e.grid;
|
|
441
441
|
e.isFormLoading.value = !0;
|
|
442
|
-
const s = e.formData.value,
|
|
443
|
-
return
|
|
444
|
-
e.isFormLoading.value = !1,
|
|
442
|
+
const s = e.formData.value, n = e.primaryKey ?? t.primaryKey;
|
|
443
|
+
return ia(a, { [n]: s[n] }, e.detailUrl).then((o) => {
|
|
444
|
+
e.isFormLoading.value = !1, o && aa(e, o);
|
|
445
445
|
});
|
|
446
446
|
}, _t = (e) => {
|
|
447
447
|
const t = e.grid;
|
|
@@ -460,25 +460,25 @@ const kt = (e) => {
|
|
|
460
460
|
a !== -1 && ge.splice(a, 1), ge.push(t), ne.addRoute(t);
|
|
461
461
|
}
|
|
462
462
|
}, ta = (e, t, a, s = "") => {
|
|
463
|
-
const
|
|
464
|
-
t[
|
|
463
|
+
const n = s + (s ? "/" : "") + e.path;
|
|
464
|
+
t[n] = { ...e, parent: a }, e.children && e.children.forEach((o) => ta(o, t, e, n));
|
|
465
465
|
}, ne = La({
|
|
466
466
|
history: Fa("/"),
|
|
467
467
|
routes: ge
|
|
468
468
|
}), Va = (e, t) => {
|
|
469
|
-
var
|
|
470
|
-
const a = ((
|
|
469
|
+
var n, o;
|
|
470
|
+
const a = ((n = e.meta) == null ? void 0 : n.roles) ?? [], s = (o = e.meta) == null ? void 0 : o.permission;
|
|
471
471
|
if (!t)
|
|
472
472
|
return a.length === 0 && !s;
|
|
473
473
|
if (t) {
|
|
474
|
-
const
|
|
474
|
+
const r = J();
|
|
475
475
|
if (ye.VITE_PERMISSION_MODE === "role")
|
|
476
|
-
return a.length === 0 ? !0 :
|
|
476
|
+
return a.length === 0 ? !0 : r.hasRole(a);
|
|
477
477
|
if (ye.VITE_PERMISSION_MODE === "permit") {
|
|
478
478
|
if (a.length === 0 && !s)
|
|
479
479
|
return !0;
|
|
480
|
-
let l = !1,
|
|
481
|
-
return a.length > 0 && (l =
|
|
480
|
+
let l = !1, i = !1;
|
|
481
|
+
return a.length > 0 && (l = r.hasRole(a)), s && (i = r.hasPermit(e.path, ":page")), l || i;
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
484
|
return !1;
|
|
@@ -488,10 +488,10 @@ ne.beforeEach((e, t, a) => {
|
|
|
488
488
|
const s = e;
|
|
489
489
|
if (e.path.startsWith("/error/") || e.path.startsWith(be))
|
|
490
490
|
return a();
|
|
491
|
-
const
|
|
491
|
+
const n = s.meta, r = ((n == null ? void 0 : n.roles) ?? []).length > 0 || ((l = n == null ? void 0 : n.permission) == null ? void 0 : l.length);
|
|
492
492
|
if (e.path === "/") {
|
|
493
|
-
const
|
|
494
|
-
if (!
|
|
493
|
+
const i = V();
|
|
494
|
+
if (!i.menuLoaded) {
|
|
495
495
|
ee.value = {
|
|
496
496
|
to: e,
|
|
497
497
|
next: (c) => {
|
|
@@ -500,14 +500,14 @@ ne.beforeEach((e, t, a) => {
|
|
|
500
500
|
};
|
|
501
501
|
return;
|
|
502
502
|
}
|
|
503
|
-
|
|
503
|
+
i.toDefaultApp();
|
|
504
504
|
return;
|
|
505
505
|
}
|
|
506
|
-
if (!
|
|
506
|
+
if (!r)
|
|
507
507
|
a();
|
|
508
508
|
else {
|
|
509
|
-
const
|
|
510
|
-
if (!
|
|
509
|
+
const i = J();
|
|
510
|
+
if (!i.isLogin)
|
|
511
511
|
a({ path: be });
|
|
512
512
|
else {
|
|
513
513
|
if (!V().menuLoaded) {
|
|
@@ -517,7 +517,7 @@ ne.beforeEach((e, t, a) => {
|
|
|
517
517
|
};
|
|
518
518
|
return;
|
|
519
519
|
}
|
|
520
|
-
const u = Va(s,
|
|
520
|
+
const u = Va(s, i.isLogin);
|
|
521
521
|
a();
|
|
522
522
|
}
|
|
523
523
|
}
|
|
@@ -549,14 +549,14 @@ const Ha = (e) => {
|
|
|
549
549
|
if (this.TabEnabled) {
|
|
550
550
|
V().excludeComponent(e);
|
|
551
551
|
let a = 0, s = [...this.TabPanes];
|
|
552
|
-
for (let
|
|
553
|
-
if (s[
|
|
554
|
-
s.splice(
|
|
552
|
+
for (let n = 0; n < s.length; n++)
|
|
553
|
+
if (s[n].key === e) {
|
|
554
|
+
s.splice(n, 1), a = n - 1 < 0 ? 0 : n - 1;
|
|
555
555
|
break;
|
|
556
556
|
}
|
|
557
|
-
for (let
|
|
558
|
-
if (s[
|
|
559
|
-
a =
|
|
557
|
+
for (let n = 0; n < s.length; n++)
|
|
558
|
+
if (s[n].key === this.TabActive) {
|
|
559
|
+
a = n;
|
|
560
560
|
break;
|
|
561
561
|
}
|
|
562
562
|
this.TabPanes = s, this.setTabActive(s[a].key);
|
|
@@ -597,8 +597,8 @@ const Ha = (e) => {
|
|
|
597
597
|
if (ye.VITE_PERMISSION_MODE === "role")
|
|
598
598
|
return P(a) ? !0 : t.hasRole(a);
|
|
599
599
|
if (ye.VITE_PERMISSION_MODE === "permit") {
|
|
600
|
-
let
|
|
601
|
-
return P(a) || (
|
|
600
|
+
let n = !1, o = !1;
|
|
601
|
+
return P(a) || (n = t.hasRole(a)), t.isAdmin() ? n : (P(s) || (o = t.hasPermit(e.path, s)), n || o);
|
|
602
602
|
}
|
|
603
603
|
return !1;
|
|
604
604
|
}, sa = (e) => e.map((t) => {
|
|
@@ -656,7 +656,7 @@ const Ha = (e) => {
|
|
|
656
656
|
Enabled: 1
|
|
657
657
|
}
|
|
658
658
|
}).then((e) => {
|
|
659
|
-
(e == null ? void 0 : e.status) ===
|
|
659
|
+
(e == null ? void 0 : e.status) === R.SUCCESS && e.data && (this.appList.length = 0, this.appList.push(...e.data));
|
|
660
660
|
});
|
|
661
661
|
},
|
|
662
662
|
async toDefaultApp(e) {
|
|
@@ -667,14 +667,14 @@ const Ha = (e) => {
|
|
|
667
667
|
let t = "";
|
|
668
668
|
const a = window.location.pathname.split("/");
|
|
669
669
|
if (a.length > 1) {
|
|
670
|
-
for (let
|
|
671
|
-
if (a[
|
|
672
|
-
t = a[
|
|
670
|
+
for (let n = a.length - 1; n >= 0; n--)
|
|
671
|
+
if (a[n] !== "") {
|
|
672
|
+
t = a[n];
|
|
673
673
|
break;
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
676
|
let s = null;
|
|
677
|
-
t && t != "login" ? s = this.appList.find((
|
|
677
|
+
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);
|
|
678
678
|
},
|
|
679
679
|
/**
|
|
680
680
|
* 设置当前应用
|
|
@@ -833,20 +833,20 @@ const Ha = (e) => {
|
|
|
833
833
|
},
|
|
834
834
|
Query: e
|
|
835
835
|
};
|
|
836
|
-
return G(Ge.login, t).then((a) => (a == null ? void 0 : a.status) ===
|
|
836
|
+
return G(Ge.login, t).then((a) => (a == null ? void 0 : a.status) === R.SUCCESS ? a : null);
|
|
837
837
|
}, qa = (e) => {
|
|
838
838
|
let t = {
|
|
839
839
|
Query: {
|
|
840
840
|
AppId: e
|
|
841
841
|
}
|
|
842
842
|
};
|
|
843
|
-
return G(Ge.auth, t).then((a) => (a == null ? void 0 : a.status) ===
|
|
843
|
+
return G(Ge.auth, t).then((a) => (a == null ? void 0 : a.status) === R.SUCCESS ? a.data : (x.error("获取授权信息失败," + (a == null ? void 0 : a.msg)), null));
|
|
844
844
|
}, Ba = () => {
|
|
845
845
|
let e = {
|
|
846
846
|
Option: {},
|
|
847
847
|
Query: {}
|
|
848
848
|
};
|
|
849
|
-
return G(Ge.logout, e).then((t) => (t == null ? void 0 : t.status) ===
|
|
849
|
+
return G(Ge.logout, e).then((t) => (t == null ? void 0 : t.status) === R.SUCCESS ? t.data : null);
|
|
850
850
|
}, za = (e) => {
|
|
851
851
|
try {
|
|
852
852
|
const a = JSON.parse(atob(e.split(".")[1])).exp;
|
|
@@ -899,12 +899,12 @@ const Ha = (e) => {
|
|
|
899
899
|
if (s.errno)
|
|
900
900
|
return s;
|
|
901
901
|
{
|
|
902
|
-
const
|
|
903
|
-
if (this.token =
|
|
902
|
+
const n = a.data;
|
|
903
|
+
if (this.token = n.token, me(this.token), this.isLogin = !0, Wa(n))
|
|
904
904
|
this.userInfo = {
|
|
905
905
|
...this.userInfo,
|
|
906
|
-
...
|
|
907
|
-
}, k.value =
|
|
906
|
+
...n.UserInfo
|
|
907
|
+
}, k.value = n.UserInfo.UserLevel;
|
|
908
908
|
else {
|
|
909
909
|
x.error("用户信息解析失败");
|
|
910
910
|
return;
|
|
@@ -1059,13 +1059,13 @@ const Ha = (e) => {
|
|
|
1059
1059
|
});
|
|
1060
1060
|
}, Ht = (e, t) => {
|
|
1061
1061
|
const a = t == null ? void 0 : t.filter((s) => {
|
|
1062
|
-
const
|
|
1063
|
-
(
|
|
1062
|
+
const n = e.find(
|
|
1063
|
+
(o) => o.dataIndex === s.dataIndex || o.key === s.key || o.title === s.title
|
|
1064
1064
|
);
|
|
1065
|
-
return
|
|
1065
|
+
return n ? { ...s, ...n } : !1;
|
|
1066
1066
|
});
|
|
1067
1067
|
return [...a || [], ...e.filter((s) => !(a != null && a.includes(s)))];
|
|
1068
|
-
}, Ca = (e) => (e.remotePage = !1,
|
|
1068
|
+
}, Ca = (e) => (e.remotePage = !1, oa(e).then((t) => t.rows)), oa = (e) => {
|
|
1069
1069
|
e.gridQuery || (e.gridQuery = {});
|
|
1070
1070
|
const t = e.remotePage ? "find" : "list";
|
|
1071
1071
|
return He(e, {
|
|
@@ -1074,11 +1074,11 @@ const Ha = (e) => {
|
|
|
1074
1074
|
params: e.gridQuery,
|
|
1075
1075
|
loadingState: e.isGridLoading,
|
|
1076
1076
|
processParams: (a) => {
|
|
1077
|
-
var
|
|
1078
|
-
return e.remotePage && (a.Query.$limit = [(e.pageNo.value - 1) * e.pageSize.value, e.pageSize.value]), _e((
|
|
1077
|
+
var n;
|
|
1078
|
+
return e.remotePage && (a.Query.$limit = [(e.pageNo.value - 1) * e.pageSize.value, e.pageSize.value]), _e((n = e.gridUrl) == null ? void 0 : n.params, a, e.gridQuery);
|
|
1079
1079
|
}
|
|
1080
1080
|
}).then((a) => {
|
|
1081
|
-
if ((a == null ? void 0 : a.status) ===
|
|
1081
|
+
if ((a == null ? void 0 : a.status) === R.SUCCESS) {
|
|
1082
1082
|
let s = a.data;
|
|
1083
1083
|
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 = {
|
|
1084
1084
|
total: e.total.value,
|
|
@@ -1099,7 +1099,7 @@ const Ha = (e) => {
|
|
|
1099
1099
|
},
|
|
1100
1100
|
loadingState: e.isGridSaving,
|
|
1101
1101
|
...a
|
|
1102
|
-
}).then((s) => ((s == null ? void 0 : s.status) ===
|
|
1102
|
+
}).then((s) => ((s == null ? void 0 : s.status) === R.SUCCESS && setTimeout(() => {
|
|
1103
1103
|
e.reload.value = !0, e.afterUpdate && e.afterUpdate(t);
|
|
1104
1104
|
}, 50), s)), Kt = (e, t) => {
|
|
1105
1105
|
const a = {};
|
|
@@ -1107,21 +1107,21 @@ const Ha = (e) => {
|
|
|
1107
1107
|
loadingText: !1,
|
|
1108
1108
|
hideErrorToast: !0
|
|
1109
1109
|
});
|
|
1110
|
-
},
|
|
1110
|
+
}, ia = async (e, t, a) => await He(e, {
|
|
1111
1111
|
urlKey: "detail",
|
|
1112
1112
|
url: a,
|
|
1113
1113
|
params: t,
|
|
1114
1114
|
loadingState: e.isGridLoading
|
|
1115
1115
|
}), Qt = (e, t) => {
|
|
1116
1116
|
const a = t;
|
|
1117
|
-
return
|
|
1117
|
+
return ia(e, { [e.primaryKey]: a[e.primaryKey] }).then((s) => ((s == null ? void 0 : s.status) === R.SUCCESS && s.data && (e.expandRows.value[a[e.primaryKey]] = s), s));
|
|
1118
1118
|
}, Jt = (e, t) => {
|
|
1119
1119
|
let a = e.editor;
|
|
1120
1120
|
e.rowData.value = t, a && (aa(a, t), a.visible.value = !0);
|
|
1121
1121
|
}, Gt = (e, t) => $a(e, t, {
|
|
1122
1122
|
url: e.deleteUrl,
|
|
1123
1123
|
primaryKey: e.primaryKey
|
|
1124
|
-
}).then((a) => ((a == null ? void 0 : a.status) ===
|
|
1124
|
+
}).then((a) => ((a == null ? void 0 : a.status) === R.SUCCESS && setTimeout(() => {
|
|
1125
1125
|
e.reload.value = !0, e.afterDelete && !Array.isArray(t) && e.afterDelete(t);
|
|
1126
1126
|
}, 50), a));
|
|
1127
1127
|
var $e = /* @__PURE__ */ ((e) => (e.SelectReload = "Select.Reload", e.RadioReload = "Radio.Reload", e.CheckboxReload = "Checkbox.Reload", e.TreeSelectReload = "TreeSelect.Reload", e.TreeCheckReload = "TreeCheck.Reload", e))($e || {});
|
|
@@ -1171,63 +1171,63 @@ class Xa {
|
|
|
1171
1171
|
this.listeners[t] && this.listeners[t].forEach((s) => s(t, ...a));
|
|
1172
1172
|
}
|
|
1173
1173
|
}
|
|
1174
|
-
const q = new Xa(), Y = (e, t) => {
|
|
1175
|
-
if (
|
|
1176
|
-
const
|
|
1177
|
-
|
|
1178
|
-
Za(
|
|
1179
|
-
}, q.on(
|
|
1174
|
+
const q = new Xa(), Y = (e, t, a) => {
|
|
1175
|
+
if (t.inputFactory && (a != null && a.reloadEvent)) {
|
|
1176
|
+
const s = t.inputFactory.value;
|
|
1177
|
+
s.reloadHandler = (n, o) => {
|
|
1178
|
+
Za(t.url, t, o);
|
|
1179
|
+
}, q.on(a.reloadEvent, s.reloadHandler);
|
|
1180
1180
|
}
|
|
1181
|
-
if (
|
|
1181
|
+
if (a != null && a.data)
|
|
1182
1182
|
b(
|
|
1183
|
-
() =>
|
|
1183
|
+
() => a.data,
|
|
1184
1184
|
() => {
|
|
1185
|
-
je(
|
|
1185
|
+
je(t, a.data, !0);
|
|
1186
1186
|
},
|
|
1187
1187
|
{ deep: !0, immediate: !0 }
|
|
1188
1188
|
);
|
|
1189
|
-
else if (
|
|
1190
|
-
e
|
|
1189
|
+
else if (t.url && t.url.url)
|
|
1190
|
+
e && la(t.url, t, t.params ?? {});
|
|
1191
1191
|
else {
|
|
1192
|
-
const
|
|
1193
|
-
x.error("`" +
|
|
1192
|
+
const s = f(Z(U.LabelText, ""));
|
|
1193
|
+
x.error("`" + s.value + "` 未配置选项数据!", {
|
|
1194
1194
|
duration: 5e3
|
|
1195
1195
|
});
|
|
1196
1196
|
}
|
|
1197
|
-
}, je = (e, t, a
|
|
1198
|
-
if (
|
|
1199
|
-
const
|
|
1197
|
+
}, je = (e, t, a) => {
|
|
1198
|
+
if (a) {
|
|
1199
|
+
const s = {
|
|
1200
1200
|
...e.fieldMap
|
|
1201
1201
|
};
|
|
1202
|
-
t = Pa(
|
|
1202
|
+
t = Pa(s, t);
|
|
1203
1203
|
}
|
|
1204
1204
|
t = JSON.parse(JSON.stringify(t ?? [])), e.all && t.unshift({
|
|
1205
1205
|
label: "全部",
|
|
1206
1206
|
value: e.allValue ?? void 0
|
|
1207
|
-
}),
|
|
1208
|
-
}, Za = (e, t, a
|
|
1209
|
-
Array.isArray(a) ? je(t, a,
|
|
1207
|
+
}), e.options.value = t;
|
|
1208
|
+
}, Za = (e, t, a) => {
|
|
1209
|
+
Array.isArray(a) ? je(t, a, !0) : la(e, t, a);
|
|
1210
1210
|
}, pe = (e, t) => {
|
|
1211
1211
|
var a;
|
|
1212
1212
|
(a = e.inputFactory) != null && a.value && t.reloadEvent && e.inputFactory.value.reloadHandler && q.off(t.reloadEvent, e.inputFactory.value.reloadHandler);
|
|
1213
|
-
}, la = (e, t, a
|
|
1214
|
-
const
|
|
1215
|
-
et(e, t, t.fieldMap,
|
|
1216
|
-
je(t,
|
|
1213
|
+
}, la = (e, t, a) => {
|
|
1214
|
+
const s = JSON.parse(JSON.stringify(e.params ?? {})), n = JSON.parse(JSON.stringify(t.params ?? {})), o = _e(s, n, a);
|
|
1215
|
+
et(e, t, t.fieldMap, o).then((r) => {
|
|
1216
|
+
je(t, r, !1);
|
|
1217
1217
|
});
|
|
1218
1218
|
}, et = (e, t, a, s) => {
|
|
1219
|
-
const { fieldMap:
|
|
1219
|
+
const { fieldMap: n, ...o } = e, l = {
|
|
1220
1220
|
...{
|
|
1221
1221
|
url: "",
|
|
1222
1222
|
cacheTime: 6e4,
|
|
1223
1223
|
fieldMap: {
|
|
1224
|
-
...
|
|
1225
|
-
...
|
|
1224
|
+
...e.fieldMap,
|
|
1225
|
+
...a
|
|
1226
1226
|
}
|
|
1227
1227
|
},
|
|
1228
|
-
...
|
|
1228
|
+
...o
|
|
1229
1229
|
};
|
|
1230
|
-
return l.loadingText = !1, s || (s = {}), s.Query || (s.Query = {}), t.isOptionLoading.value = !0, G(l, s).then((
|
|
1230
|
+
return l.loadingText = !1, console.log(l.fieldMap, s), s || (s = {}), s.Query || (s.Query = {}), t.optionQuery = s, t.isOptionLoading.value = !0, G(l, s).then((i) => (i == null ? void 0 : i.status) === R.SUCCESS && i.data ? i.data : []).finally(() => {
|
|
1231
1231
|
t.isOptionLoading.value = !1;
|
|
1232
1232
|
});
|
|
1233
1233
|
}, at = (e, t) => {
|
|
@@ -1235,12 +1235,12 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1235
1235
|
return Array.isArray(e) ? t.filter((a) => e.includes(a.value)) : t.find((a) => a.value === e);
|
|
1236
1236
|
}, Le = (e, t, a) => {
|
|
1237
1237
|
const s = t.split(".");
|
|
1238
|
-
let
|
|
1239
|
-
for (let
|
|
1240
|
-
const
|
|
1241
|
-
r
|
|
1238
|
+
let n = e;
|
|
1239
|
+
for (let o = 0; o < s.length - 1; o++) {
|
|
1240
|
+
const r = s[o];
|
|
1241
|
+
n[r] || (n[r] = {}), n = n[r];
|
|
1242
1242
|
}
|
|
1243
|
-
|
|
1243
|
+
n[s[s.length - 1]] = a;
|
|
1244
1244
|
}, ua = (e, t, a) => {
|
|
1245
1245
|
if (a == null) {
|
|
1246
1246
|
Object.entries(t).forEach(([s]) => {
|
|
@@ -1248,47 +1248,47 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1248
1248
|
});
|
|
1249
1249
|
return;
|
|
1250
1250
|
}
|
|
1251
|
-
Array.isArray(a) || Object.entries(t).forEach(([s,
|
|
1252
|
-
if (
|
|
1253
|
-
const
|
|
1254
|
-
Le(e, s,
|
|
1251
|
+
Array.isArray(a) || Object.entries(t).forEach(([s, n]) => {
|
|
1252
|
+
if (n.includes("${")) {
|
|
1253
|
+
const o = Me(n, a);
|
|
1254
|
+
Le(e, s, o);
|
|
1255
1255
|
} else
|
|
1256
|
-
Le(e, s, a[
|
|
1256
|
+
Le(e, s, a[n]);
|
|
1257
1257
|
});
|
|
1258
|
-
},
|
|
1259
|
-
var
|
|
1260
|
-
const s = (
|
|
1261
|
-
s != null && s.editorCtrl && ((
|
|
1262
|
-
const
|
|
1263
|
-
if (t.formData && t.outFields && ua(t.formData, t.outFields,
|
|
1264
|
-
const [l,
|
|
1265
|
-
if (
|
|
1258
|
+
}, Oe = (e, t, a) => {
|
|
1259
|
+
var o, r;
|
|
1260
|
+
const s = (o = e.inputFactory) == null ? void 0 : o.value;
|
|
1261
|
+
s != null && s.editorCtrl && ((r = s.errInfo) != null && r.value.errClass) && fe(s.editorCtrl), e.selected.value = a;
|
|
1262
|
+
const n = at(a, e.options.value);
|
|
1263
|
+
if (e.selectedOptions.value = n, t.formData && t.outFields && ua(t.formData, t.outFields, n), t.changeEvent) {
|
|
1264
|
+
const [l, i] = t.changeEvent;
|
|
1265
|
+
if (i)
|
|
1266
1266
|
if (Array.isArray(l))
|
|
1267
1267
|
l.every((c) => {
|
|
1268
|
-
const u = Me(
|
|
1268
|
+
const u = Me(i, { selectedValues: a });
|
|
1269
1269
|
try {
|
|
1270
1270
|
const p = JSON.parse(u);
|
|
1271
|
-
q.emit(c, p, a,
|
|
1271
|
+
q.emit(c, p, a, n);
|
|
1272
1272
|
} catch (p) {
|
|
1273
1273
|
console.error("eventParamsValue: ", u, p);
|
|
1274
1274
|
}
|
|
1275
1275
|
});
|
|
1276
1276
|
else {
|
|
1277
|
-
const c = Me(
|
|
1277
|
+
const c = Me(i, { selectedValues: a });
|
|
1278
1278
|
try {
|
|
1279
1279
|
const u = JSON.parse(c);
|
|
1280
|
-
q.emit(l, u, a,
|
|
1280
|
+
q.emit(l, u, a, n);
|
|
1281
1281
|
} catch (u) {
|
|
1282
1282
|
console.error("eventParamsValue: ", c, u);
|
|
1283
1283
|
}
|
|
1284
1284
|
}
|
|
1285
1285
|
else
|
|
1286
1286
|
Array.isArray(l) ? l.every((c) => {
|
|
1287
|
-
q.emit(c,
|
|
1288
|
-
}) : q.emit(l,
|
|
1287
|
+
q.emit(c, n, a);
|
|
1288
|
+
}) : q.emit(l, n, a);
|
|
1289
1289
|
}
|
|
1290
|
-
return s != null && s.inputEmit && s.inputEmit("change", a,
|
|
1291
|
-
},
|
|
1290
|
+
return s != null && s.inputEmit && s.inputEmit("change", a, n), n;
|
|
1291
|
+
}, Re = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((t) => t.label) : [e.label], y = {
|
|
1292
1292
|
PageOption: {
|
|
1293
1293
|
primaryKey: "Id",
|
|
1294
1294
|
statusKey: "Enabled"
|
|
@@ -1320,7 +1320,11 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1320
1320
|
OptionOption: {
|
|
1321
1321
|
all: !1,
|
|
1322
1322
|
allValue: [0, 1],
|
|
1323
|
-
autoload: !0
|
|
1323
|
+
autoload: !0,
|
|
1324
|
+
fieldMap: {
|
|
1325
|
+
label: "Name",
|
|
1326
|
+
value: "Id"
|
|
1327
|
+
}
|
|
1324
1328
|
}
|
|
1325
1329
|
}, jt = (e) => {
|
|
1326
1330
|
y.PageOption = {
|
|
@@ -1382,10 +1386,10 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1382
1386
|
};
|
|
1383
1387
|
return b(
|
|
1384
1388
|
() => s.reload.value,
|
|
1385
|
-
(
|
|
1386
|
-
|
|
1389
|
+
(n) => {
|
|
1390
|
+
n && (setTimeout(() => {
|
|
1387
1391
|
s.reload.value = !1;
|
|
1388
|
-
}, 1), s.remotePage ?
|
|
1392
|
+
}, 1), s.remotePage ? oa(s) : Ca(s));
|
|
1389
1393
|
}
|
|
1390
1394
|
), {
|
|
1391
1395
|
gridCtrl: s
|
|
@@ -1414,12 +1418,12 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1414
1418
|
const a = {
|
|
1415
1419
|
...y.OptionOption,
|
|
1416
1420
|
url: e,
|
|
1417
|
-
options: f([]),
|
|
1418
1421
|
reload: f(!1),
|
|
1422
|
+
optionQuery: {},
|
|
1419
1423
|
data: H([]),
|
|
1420
1424
|
selected: f([]),
|
|
1421
1425
|
selectedOptions: f([]),
|
|
1422
|
-
|
|
1426
|
+
options: f([]),
|
|
1423
1427
|
isOptionLoading: f(!1)
|
|
1424
1428
|
};
|
|
1425
1429
|
return b(
|
|
@@ -1427,29 +1431,29 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1427
1431
|
(s) => {
|
|
1428
1432
|
s && (setTimeout(() => {
|
|
1429
1433
|
a.reload.value = !1;
|
|
1430
|
-
}, 1), Y(a, t));
|
|
1434
|
+
}, 1), Y(!0, a, t));
|
|
1431
1435
|
}
|
|
1432
1436
|
), {
|
|
1433
1437
|
optionCtrl: a
|
|
1434
1438
|
};
|
|
1435
1439
|
}, Bt = (e, t, a) => {
|
|
1436
|
-
for (const
|
|
1437
|
-
e.urls[
|
|
1440
|
+
for (const r in e.urls)
|
|
1441
|
+
e.urls[r] && (e.urls[r].api || (e.urls[r].api = e.api), e.urls[r].authorize === void 0 && (e.urls[r].authorize = e.authorize));
|
|
1438
1442
|
const s = {
|
|
1439
1443
|
...y.PageOption,
|
|
1440
1444
|
...e
|
|
1441
|
-
}, { editorCtrl:
|
|
1442
|
-
return s.editor =
|
|
1445
|
+
}, { editorCtrl: n } = tt(e, s, t, a), { gridCtrl: o } = st(e, s);
|
|
1446
|
+
return s.editor = n, s.grid = o, o.editor = n, o.tools = ["Reload", "RowHeight", "TableHeadset", "Fullscreen"], n.grid = o, {
|
|
1443
1447
|
pageCtrl: s,
|
|
1444
|
-
editorCtrl:
|
|
1445
|
-
gridCtrl:
|
|
1448
|
+
editorCtrl: n,
|
|
1449
|
+
gridCtrl: o
|
|
1446
1450
|
};
|
|
1447
1451
|
}, rt = 7 * 24 * 60 * 60 * 1e3, Fe = /* @__PURE__ */ new Map(), We = /* @__PURE__ */ new Set(), Q = f({}), zt = Q, Wt = (e) => {
|
|
1448
|
-
var
|
|
1452
|
+
var n;
|
|
1449
1453
|
if (!e.iconUrl) return Ne;
|
|
1450
1454
|
const t = f(!0), a = f("");
|
|
1451
1455
|
let s = !0;
|
|
1452
|
-
return (
|
|
1456
|
+
return (n = e.icons) != null && n.length && (s = e.icons.every((o) => Q.value[o] !== void 0)), (e.icon && !Q.value[e.icon] || !s) && nt(e, t).then(() => {
|
|
1453
1457
|
lt(e.iconUrl, e.monoColor || !1), t.value = !0;
|
|
1454
1458
|
}), C({
|
|
1455
1459
|
props: {
|
|
@@ -1477,20 +1481,20 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1477
1481
|
}
|
|
1478
1482
|
},
|
|
1479
1483
|
emits: ["update:iconIndex"],
|
|
1480
|
-
setup(
|
|
1481
|
-
const l = f(
|
|
1482
|
-
|
|
1484
|
+
setup(o, { emit: r }) {
|
|
1485
|
+
const l = f(o.icon), i = f(0), c = () => {
|
|
1486
|
+
o.icons && i.value++;
|
|
1483
1487
|
};
|
|
1484
1488
|
return b(
|
|
1485
|
-
() =>
|
|
1489
|
+
() => o.iconIndex,
|
|
1486
1490
|
(u) => {
|
|
1487
|
-
u !== void 0 && (
|
|
1491
|
+
u !== void 0 && (i.value = u);
|
|
1488
1492
|
},
|
|
1489
1493
|
{ immediate: !0 }
|
|
1490
1494
|
), b(
|
|
1491
|
-
() =>
|
|
1495
|
+
() => i.value,
|
|
1492
1496
|
(u) => {
|
|
1493
|
-
|
|
1497
|
+
o.icons && (u >= o.icons.length && (i.value = 0), l.value = o.icons[i.value], ve(a, l, l.value), r("update:iconIndex", i.value));
|
|
1494
1498
|
},
|
|
1495
1499
|
{ immediate: !0 }
|
|
1496
1500
|
), b(
|
|
@@ -1500,7 +1504,7 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1500
1504
|
},
|
|
1501
1505
|
{ deep: !0 }
|
|
1502
1506
|
), b(
|
|
1503
|
-
() =>
|
|
1507
|
+
() => o.icon,
|
|
1504
1508
|
(u) => {
|
|
1505
1509
|
ve(a, l, u);
|
|
1506
1510
|
}
|
|
@@ -1509,10 +1513,10 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1509
1513
|
render() {
|
|
1510
1514
|
if (!t.value)
|
|
1511
1515
|
return Ne;
|
|
1512
|
-
let
|
|
1513
|
-
Array.isArray(
|
|
1514
|
-
let l = [
|
|
1515
|
-
return !/\bw-/.test(
|
|
1516
|
+
let o = this.class, r = "";
|
|
1517
|
+
Array.isArray(o) ? r = o.join(" ") : typeof o == "string" && (r = o);
|
|
1518
|
+
let l = [r];
|
|
1519
|
+
return !/\bw-/.test(r) && !/$w-/.test(r) && l.push("w-4"), !/\bh-/.test(r) && !/$h-/.test(r) && l.push("h-4"), a.value ? _(Ye(a.value), {
|
|
1516
1520
|
onClick: this.$props.clickable ? this.handleClick : void 0,
|
|
1517
1521
|
class: `${l.join(" ")}`,
|
|
1518
1522
|
style: {
|
|
@@ -1531,13 +1535,13 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1531
1535
|
return Promise.resolve();
|
|
1532
1536
|
const s = fa(a);
|
|
1533
1537
|
if (s)
|
|
1534
|
-
return new Promise(async (
|
|
1538
|
+
return new Promise(async (o) => (ca(s.scriptContent), o()));
|
|
1535
1539
|
t.value = !1;
|
|
1536
|
-
const
|
|
1537
|
-
await
|
|
1540
|
+
const n = new Promise(async (o) => {
|
|
1541
|
+
await ot(a, e.monoColor || !1), o(), Fe.delete(a);
|
|
1538
1542
|
});
|
|
1539
|
-
return Fe.set(a,
|
|
1540
|
-
},
|
|
1543
|
+
return Fe.set(a, n), n;
|
|
1544
|
+
}, ot = async (e, t) => {
|
|
1541
1545
|
try {
|
|
1542
1546
|
const a = await fetch(e);
|
|
1543
1547
|
if (!a.ok) {
|
|
@@ -1546,11 +1550,11 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1546
1550
|
}
|
|
1547
1551
|
let s = await a.text();
|
|
1548
1552
|
s = t ? s.replace(/fill=\"[^\"]*\"/gi, "") : s;
|
|
1549
|
-
let
|
|
1550
|
-
const
|
|
1551
|
-
if (
|
|
1552
|
-
let
|
|
1553
|
-
|
|
1553
|
+
let n = /^window\.(\w+)\s*=/;
|
|
1554
|
+
const o = s.match(n);
|
|
1555
|
+
if (o && o.length > 1) {
|
|
1556
|
+
let r = o[1];
|
|
1557
|
+
it(e, r, t, s);
|
|
1554
1558
|
}
|
|
1555
1559
|
ca(s);
|
|
1556
1560
|
return;
|
|
@@ -1560,16 +1564,16 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1560
1564
|
}, ca = (e) => {
|
|
1561
1565
|
const t = document.createElement("script");
|
|
1562
1566
|
t.textContent = e, document.head.appendChild(t);
|
|
1563
|
-
},
|
|
1564
|
-
let
|
|
1565
|
-
const
|
|
1567
|
+
}, it = (e, t, a, s) => {
|
|
1568
|
+
let n = `icon_cache:${e}`;
|
|
1569
|
+
const o = {
|
|
1566
1570
|
windowKey: t,
|
|
1567
1571
|
monoColor: a,
|
|
1568
1572
|
scriptContent: s,
|
|
1569
1573
|
expireTime: Date.now() + rt
|
|
1570
1574
|
// 缓存时间:7天
|
|
1571
1575
|
};
|
|
1572
|
-
localStorage.setItem(
|
|
1576
|
+
localStorage.setItem(n, JSON.stringify(o));
|
|
1573
1577
|
}, fa = (e) => {
|
|
1574
1578
|
let t = `icon_cache:${e}`;
|
|
1575
1579
|
const a = localStorage.getItem(t);
|
|
@@ -1577,8 +1581,8 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1577
1581
|
let s;
|
|
1578
1582
|
try {
|
|
1579
1583
|
s = JSON.parse(a);
|
|
1580
|
-
} catch (
|
|
1581
|
-
return console.error("解析缓存失败:",
|
|
1584
|
+
} catch (n) {
|
|
1585
|
+
return console.error("解析缓存失败:", n), null;
|
|
1582
1586
|
}
|
|
1583
1587
|
return s.expireTime < Date.now() ? (localStorage.removeItem(e), null) : s;
|
|
1584
1588
|
}, Ct = () => {
|
|
@@ -1618,23 +1622,23 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1618
1622
|
s.startsWith("_iconfont_svg_string_") && (a == null ? void 0 : a.windowKey) === s && !We.has(s) && (We.add(s), ut(s, t));
|
|
1619
1623
|
});
|
|
1620
1624
|
}, ut = (e, t) => {
|
|
1621
|
-
const a = window[e],
|
|
1622
|
-
for (const l of
|
|
1623
|
-
const
|
|
1625
|
+
const a = window[e], o = new DOMParser().parseFromString(a, "image/svg+xml").getElementsByTagName("symbol"), r = document.querySelectorAll("symbol");
|
|
1626
|
+
for (const l of o) {
|
|
1627
|
+
const i = l.id, c = Array.from(r).find((u) => u.id === i);
|
|
1624
1628
|
c && t && (c.innerHTML = l.innerHTML, c.querySelectorAll("*").forEach((u) => {
|
|
1625
1629
|
u.hasAttribute("fill") && u.removeAttribute("fill");
|
|
1626
|
-
})), Q.value[
|
|
1630
|
+
})), Q.value[i] || (Q.value[i] = _("svg", { fill: "currentColor" }, [_("use", { "xlink:href": `#${i}` })]));
|
|
1627
1631
|
}
|
|
1628
1632
|
}, ct = (e, t) => {
|
|
1629
1633
|
let a = "";
|
|
1630
1634
|
return e && (a += `rotate(${e}deg)`), t && (a += " scaleX(-1)"), a;
|
|
1631
1635
|
}, Yt = (e, t, a, s) => {
|
|
1632
|
-
pa(e, [], a, s).forEach((
|
|
1636
|
+
pa(e, [], a, s).forEach((o) => t.push(o));
|
|
1633
1637
|
}, pa = (e, t, a, s) => {
|
|
1634
|
-
var
|
|
1635
|
-
const
|
|
1638
|
+
var r, l, i, c, u;
|
|
1639
|
+
const n = [], o = J();
|
|
1636
1640
|
for (const p of e) {
|
|
1637
|
-
if (p.redirect || p.path.includes("/login") || p.path.includes("/error") || p.path.includes("/:page(.*)") || (l = (
|
|
1641
|
+
if (p.redirect || p.path.includes("/login") || p.path.includes("/error") || p.path.includes("/:page(.*)") || (l = (r = p.meta) == null ? void 0 : r.roles) != null && l.length && !o.hasRole(p.meta.roles) && (i = p.meta) != null && i.permission && !o.hasPermit(p.meta.permission, ":page"))
|
|
1638
1642
|
continue;
|
|
1639
1643
|
const m = p.path.split("/");
|
|
1640
1644
|
m.unshift(...t);
|
|
@@ -1645,21 +1649,21 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1645
1649
|
icon: p.icon ? _(a, { ...s, icon: p.icon }) : void 0,
|
|
1646
1650
|
children: d.length > 0 ? d : void 0
|
|
1647
1651
|
};
|
|
1648
|
-
(d.length > 0 || !p.children) &&
|
|
1652
|
+
(d.length > 0 || !p.children) && n.push(E);
|
|
1649
1653
|
}
|
|
1650
|
-
return
|
|
1654
|
+
return n;
|
|
1651
1655
|
}, Ce = va([]), Xt = () => {
|
|
1652
1656
|
Ce.length = 0;
|
|
1653
1657
|
const e = V();
|
|
1654
1658
|
let a = Je().TabActive;
|
|
1655
|
-
e.matchedRoutes(a).forEach((
|
|
1659
|
+
e.matchedRoutes(a).forEach((n, o) => {
|
|
1656
1660
|
var l;
|
|
1657
|
-
const
|
|
1658
|
-
index:
|
|
1659
|
-
path:
|
|
1660
|
-
breadcrumbName: ((l =
|
|
1661
|
+
const r = {
|
|
1662
|
+
index: o,
|
|
1663
|
+
path: n.path,
|
|
1664
|
+
breadcrumbName: ((l = n.name) == null ? void 0 : l.toString()) ?? ""
|
|
1661
1665
|
};
|
|
1662
|
-
Ce.push(
|
|
1666
|
+
Ce.push(r);
|
|
1663
1667
|
});
|
|
1664
1668
|
}, ft = {
|
|
1665
1669
|
host: {
|
|
@@ -1698,15 +1702,15 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1698
1702
|
}
|
|
1699
1703
|
return new Promise((s) => {
|
|
1700
1704
|
we.SITEHOST_API || (we.SITEHOST_API = e);
|
|
1701
|
-
const
|
|
1705
|
+
const n = t || window.location.origin;
|
|
1702
1706
|
G(ft.host, {
|
|
1703
1707
|
Query: {
|
|
1704
|
-
Host:
|
|
1708
|
+
Host: n
|
|
1705
1709
|
}
|
|
1706
|
-
}).then((
|
|
1707
|
-
if ((
|
|
1708
|
-
const
|
|
1709
|
-
this._setHostInfo(
|
|
1710
|
+
}).then((o) => {
|
|
1711
|
+
if ((o == null ? void 0 : o.status) === R.SUCCESS && o.data) {
|
|
1712
|
+
const r = o.data;
|
|
1713
|
+
this._setHostInfo(r);
|
|
1710
1714
|
}
|
|
1711
1715
|
s();
|
|
1712
1716
|
});
|
|
@@ -1791,40 +1795,40 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1791
1795
|
},
|
|
1792
1796
|
emits: ["change"],
|
|
1793
1797
|
setup(e, { emit: t }) {
|
|
1794
|
-
const a = e, s = W(),
|
|
1795
|
-
|
|
1796
|
-
const
|
|
1797
|
-
|
|
1798
|
-
() =>
|
|
1798
|
+
const a = e, s = W(), n = de(a.url, a), o = a.optionCtrl ?? n.optionCtrl;
|
|
1799
|
+
o.inputFactory = H(s);
|
|
1800
|
+
const r = f([]);
|
|
1801
|
+
o && b(
|
|
1802
|
+
() => o.options.value,
|
|
1799
1803
|
(p) => {
|
|
1800
|
-
|
|
1804
|
+
r.value = p || [];
|
|
1801
1805
|
},
|
|
1802
1806
|
{ immediate: !0, deep: !0 }
|
|
1803
1807
|
);
|
|
1804
|
-
const l = t, { editorCtrl:
|
|
1805
|
-
c != null && c.value.errClass &&
|
|
1808
|
+
const l = t, { editorCtrl: i, errInfo: c } = W(), u = (p) => {
|
|
1809
|
+
c != null && c.value.errClass && i && fe(i), l("change", p);
|
|
1806
1810
|
};
|
|
1807
|
-
return
|
|
1811
|
+
return oe(() => {
|
|
1808
1812
|
if (!a.data || a.data.length != 2) {
|
|
1809
1813
|
console.error("Switch组件: ", a.data), x.error("Switch组件必须有且只有两个选项");
|
|
1810
1814
|
return;
|
|
1811
1815
|
}
|
|
1812
|
-
|
|
1813
|
-
}),
|
|
1814
|
-
|
|
1816
|
+
o && Y(o.autoload, o, a);
|
|
1817
|
+
}), ie(() => {
|
|
1818
|
+
o && pe(o, a);
|
|
1815
1819
|
}), (p, m) => {
|
|
1816
1820
|
var d;
|
|
1817
|
-
return
|
|
1821
|
+
return r.value.length === 2 ? (A(), Ie(S(ya), le({
|
|
1818
1822
|
key: 0,
|
|
1819
1823
|
class: [
|
|
1820
1824
|
((d = S(c)) == null ? void 0 : d.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : "",
|
|
1821
1825
|
"bg-blue-300",
|
|
1822
1826
|
"w-[58px]"
|
|
1823
1827
|
],
|
|
1824
|
-
checkedChildren:
|
|
1825
|
-
checkedValue:
|
|
1826
|
-
unCheckedChildren:
|
|
1827
|
-
unCheckedValue:
|
|
1828
|
+
checkedChildren: r.value[0].label,
|
|
1829
|
+
checkedValue: r.value[0].value,
|
|
1830
|
+
unCheckedChildren: r.value[1].label,
|
|
1831
|
+
unCheckedValue: r.value[1].value,
|
|
1828
1832
|
onChange: u
|
|
1829
1833
|
}, p.$attrs), null, 16, ["class", "checkedChildren", "checkedValue", "unCheckedChildren", "unCheckedValue"])) : B("", !0);
|
|
1830
1834
|
};
|
|
@@ -1864,32 +1868,32 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1864
1868
|
emits: ["update:value", "select", "change", "update:labels"],
|
|
1865
1869
|
setup(e, { emit: t }) {
|
|
1866
1870
|
var $, g, I;
|
|
1867
|
-
const a = e, s = xe(),
|
|
1868
|
-
|
|
1871
|
+
const a = e, s = xe(), n = W(), o = de(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
|
|
1872
|
+
r.inputFactory = H(n);
|
|
1869
1873
|
const l = f({
|
|
1870
|
-
...
|
|
1871
|
-
url: (($ =
|
|
1872
|
-
fieldMap: (
|
|
1873
|
-
params: (
|
|
1874
|
+
...r == null ? void 0 : r.url,
|
|
1875
|
+
url: (($ = r == null ? void 0 : r.url) == null ? void 0 : $.url) || "",
|
|
1876
|
+
fieldMap: (r == null ? void 0 : r.fieldMap) || ((g = r == null ? void 0 : r.url) == null ? void 0 : g.fieldMap),
|
|
1877
|
+
params: (r == null ? void 0 : r.params) || ((I = r == null ? void 0 : r.url) == null ? void 0 : I.params),
|
|
1874
1878
|
loadingText: !1
|
|
1875
|
-
}),
|
|
1879
|
+
}), i = f((r == null ? void 0 : r.selected.value) || void 0);
|
|
1876
1880
|
b(
|
|
1877
1881
|
() => a.value,
|
|
1878
1882
|
() => {
|
|
1879
|
-
|
|
1883
|
+
i.value = a.value;
|
|
1880
1884
|
},
|
|
1881
1885
|
{ immediate: !0 }
|
|
1882
1886
|
), b(
|
|
1883
|
-
() =>
|
|
1887
|
+
() => i.value,
|
|
1884
1888
|
(v) => {
|
|
1885
1889
|
a.autoClean && a.formData && a.outFields && v !== a.value && ua(a.formData, a.outFields, null);
|
|
1886
1890
|
}
|
|
1887
1891
|
);
|
|
1888
|
-
const { editorCtrl: c, errInfo: u, labelText: p } =
|
|
1889
|
-
|
|
1890
|
-
const d = f((
|
|
1891
|
-
|
|
1892
|
-
() =>
|
|
1892
|
+
const { editorCtrl: c, errInfo: u, labelText: p } = n, m = t;
|
|
1893
|
+
n.inputEmit = m;
|
|
1894
|
+
const d = f((r == null ? void 0 : r.options.value) || []);
|
|
1895
|
+
r && b(
|
|
1896
|
+
() => r.options.value,
|
|
1893
1897
|
(v) => {
|
|
1894
1898
|
d.value = v || [];
|
|
1895
1899
|
},
|
|
@@ -1898,45 +1902,45 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1898
1902
|
const E = (v) => {
|
|
1899
1903
|
var N;
|
|
1900
1904
|
if (d.value = [], v === "") return;
|
|
1901
|
-
let h = v.trim(),
|
|
1905
|
+
let h = v.trim(), O = {
|
|
1902
1906
|
...l.value.params,
|
|
1903
1907
|
Query: {
|
|
1904
1908
|
...(N = l.value.params) == null ? void 0 : N.Query
|
|
1905
1909
|
}
|
|
1906
1910
|
};
|
|
1907
1911
|
a.searchField && (Array.isArray(a.searchField) ? a.searchField.forEach((K) => {
|
|
1908
|
-
|
|
1912
|
+
O.Query[K] = {
|
|
1909
1913
|
$like: "%" + h + "%"
|
|
1910
1914
|
};
|
|
1911
|
-
}) :
|
|
1915
|
+
}) : O.Query[a.searchField] = {
|
|
1912
1916
|
$like: "%" + h + "%"
|
|
1913
|
-
}), a.onsearch && a.onsearch(h,
|
|
1914
|
-
},
|
|
1915
|
-
const h =
|
|
1917
|
+
}), a.onsearch && a.onsearch(h, O), r && Y(r.autoload, r, a);
|
|
1918
|
+
}, T = (v) => {
|
|
1919
|
+
const h = Oe(r, a, v);
|
|
1916
1920
|
m("update:value", v), m("select", v);
|
|
1917
|
-
const
|
|
1918
|
-
m("update:labels",
|
|
1921
|
+
const O = Re(h);
|
|
1922
|
+
m("update:labels", O), u != null && u.value.errClass && c && fe(c);
|
|
1919
1923
|
};
|
|
1920
|
-
return
|
|
1924
|
+
return oe(() => {
|
|
1921
1925
|
l.value && !l.value.fieldMap && (l.value.fieldMap = {
|
|
1922
1926
|
title: "Name",
|
|
1923
1927
|
label: "Name",
|
|
1924
1928
|
value: "Name",
|
|
1925
1929
|
key: "Id"
|
|
1926
1930
|
});
|
|
1927
|
-
}),
|
|
1928
|
-
|
|
1931
|
+
}), ie(() => {
|
|
1932
|
+
r && pe(r, a);
|
|
1929
1933
|
}), (v, h) => {
|
|
1930
|
-
var
|
|
1934
|
+
var O, N, K;
|
|
1931
1935
|
return A(), L("div", null, [
|
|
1932
1936
|
ae(S(Sa), le({
|
|
1933
|
-
value:
|
|
1934
|
-
"onUpdate:value": h[0] || (h[0] = (he) =>
|
|
1935
|
-
class: [(
|
|
1937
|
+
value: i.value,
|
|
1938
|
+
"onUpdate:value": h[0] || (h[0] = (he) => i.value = he),
|
|
1939
|
+
class: [(O = S(u)) == null ? void 0 : O.errClass, "error w-full"],
|
|
1936
1940
|
options: d.value,
|
|
1937
1941
|
onSearch: E,
|
|
1938
|
-
onSelect:
|
|
1939
|
-
placeholder: (K = (N = S(
|
|
1942
|
+
onSelect: T,
|
|
1943
|
+
placeholder: (K = (N = S(r)) == null ? void 0 : N.url) != null && K.loading ? "请输入并选择" + S(p) : ""
|
|
1940
1944
|
}, S(s)), null, 16, ["value", "class", "options", "placeholder"])
|
|
1941
1945
|
]);
|
|
1942
1946
|
};
|
|
@@ -1966,38 +1970,38 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1966
1970
|
emits: ["change", "update:labels"],
|
|
1967
1971
|
setup(e, { emit: t }) {
|
|
1968
1972
|
var m, d, E;
|
|
1969
|
-
const a = e, s = xe(),
|
|
1970
|
-
|
|
1973
|
+
const a = e, s = xe(), n = W(), o = de(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
|
|
1974
|
+
r.inputFactory = H(n);
|
|
1971
1975
|
const l = f({
|
|
1972
|
-
...
|
|
1973
|
-
url: ((m =
|
|
1974
|
-
fieldMap: (
|
|
1975
|
-
params: (
|
|
1976
|
+
...r == null ? void 0 : r.url,
|
|
1977
|
+
url: ((m = r == null ? void 0 : r.url) == null ? void 0 : m.url) || "",
|
|
1978
|
+
fieldMap: (r == null ? void 0 : r.fieldMap) || ((d = r == null ? void 0 : r.url) == null ? void 0 : d.fieldMap),
|
|
1979
|
+
params: (r == null ? void 0 : r.params) || ((E = r == null ? void 0 : r.url) == null ? void 0 : E.params),
|
|
1976
1980
|
loadingText: !1
|
|
1977
|
-
}), { errInfo:
|
|
1978
|
-
|
|
1979
|
-
const u = f((
|
|
1980
|
-
|
|
1981
|
-
() =>
|
|
1982
|
-
(
|
|
1983
|
-
u.value =
|
|
1981
|
+
}), { errInfo: i } = n, c = t;
|
|
1982
|
+
n.inputEmit = c;
|
|
1983
|
+
const u = f((r == null ? void 0 : r.options.value) || []);
|
|
1984
|
+
r && b(
|
|
1985
|
+
() => r.options.value,
|
|
1986
|
+
(T) => {
|
|
1987
|
+
u.value = T || [];
|
|
1984
1988
|
},
|
|
1985
1989
|
{ immediate: !0, deep: !0 }
|
|
1986
1990
|
);
|
|
1987
|
-
const p = (
|
|
1988
|
-
const g =
|
|
1991
|
+
const p = (T) => {
|
|
1992
|
+
const g = Oe(r, a, T), I = Re(g);
|
|
1989
1993
|
c("update:labels", I);
|
|
1990
1994
|
};
|
|
1991
|
-
return
|
|
1995
|
+
return oe(() => {
|
|
1992
1996
|
l.value && !l.value.fieldMap && (l.value.fieldMap = {
|
|
1993
1997
|
title: "Name",
|
|
1994
1998
|
label: "Name",
|
|
1995
1999
|
value: "Id",
|
|
1996
2000
|
key: "Id"
|
|
1997
|
-
}),
|
|
1998
|
-
}),
|
|
1999
|
-
|
|
2000
|
-
}), (
|
|
2001
|
+
}), r && Y(r.autoload, r, a);
|
|
2002
|
+
}), ie(() => {
|
|
2003
|
+
r && pe(r, a);
|
|
2004
|
+
}), (T, $) => (A(), L("div", pt, [
|
|
2001
2005
|
ae(S(ba), le({
|
|
2002
2006
|
onChange: p,
|
|
2003
2007
|
class: "w-full mb-[-3px]"
|
|
@@ -2010,7 +2014,7 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
2010
2014
|
value: g.value,
|
|
2011
2015
|
disabled: g.disabled || g.value && e.disabledItems && e.disabledItems.indexOf(g.value.toString()) > -1,
|
|
2012
2016
|
class: Xe([
|
|
2013
|
-
((I = S(
|
|
2017
|
+
((I = S(i)) == null ? void 0 : I.errClass) === "error" ? "error !text-red-400" : "",
|
|
2014
2018
|
"text-nowrap",
|
|
2015
2019
|
"pb-1",
|
|
2016
2020
|
e.wrap ? `w-1/${a.wrap}` : ""
|
|
@@ -2052,24 +2056,24 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
2052
2056
|
},
|
|
2053
2057
|
emits: ["change", "update:value", "update:labels"],
|
|
2054
2058
|
setup(e, { emit: t }) {
|
|
2055
|
-
var E,
|
|
2056
|
-
const a = e, s = xe(),
|
|
2057
|
-
|
|
2059
|
+
var E, T, $;
|
|
2060
|
+
const a = e, s = xe(), n = W(), o = de(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
|
|
2061
|
+
r.inputFactory = H(n);
|
|
2058
2062
|
const l = f({
|
|
2059
|
-
...
|
|
2060
|
-
url: ((E =
|
|
2061
|
-
fieldMap: (
|
|
2062
|
-
params: (
|
|
2063
|
+
...r == null ? void 0 : r.url,
|
|
2064
|
+
url: ((E = r == null ? void 0 : r.url) == null ? void 0 : E.url) || "",
|
|
2065
|
+
fieldMap: (r == null ? void 0 : r.fieldMap) || ((T = r == null ? void 0 : r.url) == null ? void 0 : T.fieldMap),
|
|
2066
|
+
params: (r == null ? void 0 : r.params) || (($ = r == null ? void 0 : r.url) == null ? void 0 : $.params),
|
|
2063
2067
|
loadingText: !1
|
|
2064
|
-
}),
|
|
2065
|
-
|
|
2066
|
-
() =>
|
|
2068
|
+
}), i = f(a.value), { errInfo: c } = n, u = f((r == null ? void 0 : r.options.value) || []), p = t;
|
|
2069
|
+
n.inputEmit = p, r && b(
|
|
2070
|
+
() => r.options.value,
|
|
2067
2071
|
(g) => {
|
|
2068
2072
|
u.value = g || [];
|
|
2069
2073
|
},
|
|
2070
2074
|
{ immediate: !0, deep: !0 }
|
|
2071
2075
|
), b(
|
|
2072
|
-
() =>
|
|
2076
|
+
() => i.value,
|
|
2073
2077
|
(g) => {
|
|
2074
2078
|
p("update:value", g);
|
|
2075
2079
|
}
|
|
@@ -2077,25 +2081,25 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
2077
2081
|
const m = (g, I) => {
|
|
2078
2082
|
if (typeof g == "object" && typeof I == "object") {
|
|
2079
2083
|
const v = JSON.stringify(g) === JSON.stringify(I);
|
|
2080
|
-
return v && (
|
|
2084
|
+
return v && (i.value = g), v;
|
|
2081
2085
|
}
|
|
2082
2086
|
return g === I;
|
|
2083
2087
|
}, d = (g) => {
|
|
2084
|
-
const I = g.target.value, v =
|
|
2088
|
+
const I = g.target.value, v = Oe(r, a, I), h = Re(v);
|
|
2085
2089
|
p("update:labels", h);
|
|
2086
2090
|
};
|
|
2087
|
-
return
|
|
2091
|
+
return oe(() => {
|
|
2088
2092
|
l.value && !l.value.fieldMap && (l.value.fieldMap = {
|
|
2089
2093
|
label: "Name",
|
|
2090
2094
|
value: "Id",
|
|
2091
2095
|
key: "Id"
|
|
2092
|
-
}),
|
|
2093
|
-
}),
|
|
2094
|
-
|
|
2096
|
+
}), r && Y(r.autoload, r, a);
|
|
2097
|
+
}), ie(() => {
|
|
2098
|
+
r && pe(r, a);
|
|
2095
2099
|
}), (g, I) => (A(), L("div", ht, [
|
|
2096
2100
|
ae(S(xa), le({
|
|
2097
|
-
value:
|
|
2098
|
-
"onUpdate:value": I[0] || (I[0] = (v) =>
|
|
2101
|
+
value: i.value,
|
|
2102
|
+
"onUpdate:value": I[0] || (I[0] = (v) => i.value = v),
|
|
2099
2103
|
autocheck: !1,
|
|
2100
2104
|
onChange: d,
|
|
2101
2105
|
class: "w-full flex align-items flex-wrap mb-[-3px]"
|
|
@@ -2159,37 +2163,37 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
2159
2163
|
emits: ["change", "update:value", "update:labels"],
|
|
2160
2164
|
setup(e, { emit: t }) {
|
|
2161
2165
|
var g, I, v;
|
|
2162
|
-
const a = e, s = W(), { editorCtrl:
|
|
2163
|
-
|
|
2166
|
+
const a = e, s = W(), { editorCtrl: n, errInfo: o, labelText: r } = s, l = de(a.url, a), i = a.optionCtrl ?? l.optionCtrl;
|
|
2167
|
+
i.inputFactory = H(s);
|
|
2164
2168
|
const c = xe(), u = f({
|
|
2165
|
-
...
|
|
2166
|
-
url: ((g =
|
|
2167
|
-
fieldMap: (
|
|
2168
|
-
params: (
|
|
2169
|
+
...i == null ? void 0 : i.url,
|
|
2170
|
+
url: ((g = i == null ? void 0 : i.url) == null ? void 0 : g.url) || "",
|
|
2171
|
+
fieldMap: (i == null ? void 0 : i.fieldMap) || ((I = i == null ? void 0 : i.url) == null ? void 0 : I.fieldMap),
|
|
2172
|
+
params: (i == null ? void 0 : i.params) || ((v = i == null ? void 0 : i.url) == null ? void 0 : v.params),
|
|
2169
2173
|
loadingText: !1
|
|
2170
|
-
}), p = f(a.value), m = f(c.placeholder), d = f((
|
|
2174
|
+
}), p = f(a.value), m = f(c.placeholder), d = f((i == null ? void 0 : i.selected.value) || void 0), E = t;
|
|
2171
2175
|
s.inputEmit = E;
|
|
2172
|
-
const
|
|
2173
|
-
|
|
2174
|
-
() =>
|
|
2176
|
+
const T = f((i == null ? void 0 : i.options.value) || []);
|
|
2177
|
+
i && b(
|
|
2178
|
+
() => i.options.value,
|
|
2175
2179
|
(h) => {
|
|
2176
|
-
|
|
2180
|
+
T.value = h || [];
|
|
2177
2181
|
},
|
|
2178
2182
|
{ immediate: !0, deep: !0 }
|
|
2179
2183
|
);
|
|
2180
2184
|
const $ = (h) => {
|
|
2181
|
-
const
|
|
2182
|
-
d.value = h, E("update:labels", N), E("change", h),
|
|
2185
|
+
const O = Oe(i, a, h), N = Re(O);
|
|
2186
|
+
d.value = h, E("update:labels", N), E("change", h), o != null && o.value.errClass && n && fe(n);
|
|
2183
2187
|
};
|
|
2184
2188
|
return b(
|
|
2185
|
-
() =>
|
|
2189
|
+
() => T.value,
|
|
2186
2190
|
(h) => {
|
|
2187
2191
|
h.length && P(a.value) && a.selectFirst ? d.value = h[0].value : d.value = a.value === null ? void 0 : a.value, h.length > 0 && d.value && $(d.value);
|
|
2188
2192
|
}
|
|
2189
2193
|
), b(
|
|
2190
2194
|
() => u.value.loading,
|
|
2191
2195
|
(h) => {
|
|
2192
|
-
h ? m.value = "" : m.value || (m.value = "请选择" +
|
|
2196
|
+
h ? m.value = "" : m.value || (m.value = "请选择" + r.value);
|
|
2193
2197
|
},
|
|
2194
2198
|
{ immediate: !0 }
|
|
2195
2199
|
), b(
|
|
@@ -2201,38 +2205,38 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
2201
2205
|
}
|
|
2202
2206
|
E("update:value", h);
|
|
2203
2207
|
}
|
|
2204
|
-
),
|
|
2208
|
+
), oe(() => {
|
|
2205
2209
|
if (u.value && !u.value.fieldMap && (u.value.fieldMap = {
|
|
2206
2210
|
label: "Name",
|
|
2207
2211
|
value: "Id",
|
|
2208
2212
|
key: "Id"
|
|
2209
2213
|
}), a.dataKey) {
|
|
2210
2214
|
const h = JSON.parse(JSON.stringify(M.getOptions(a.dataKey)));
|
|
2211
|
-
|
|
2212
|
-
} else
|
|
2213
|
-
}),
|
|
2214
|
-
|
|
2215
|
-
}), (h,
|
|
2215
|
+
T.value = h;
|
|
2216
|
+
} else i && Y(i.autoload, i, a);
|
|
2217
|
+
}), ie(() => {
|
|
2218
|
+
i && pe(i, a);
|
|
2219
|
+
}), (h, O) => {
|
|
2216
2220
|
var N, K, he;
|
|
2217
2221
|
return A(), L("div", null, [
|
|
2218
|
-
(K = (N = S(
|
|
2222
|
+
(K = (N = S(i)) == null ? void 0 : N.url) != null && K.loading ? (A(), L("div", vt, [
|
|
2219
2223
|
ae(S(Ne), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
|
|
2220
|
-
|
|
2224
|
+
O[1] || (O[1] = ga("span", null, "数据加载中...", -1))
|
|
2221
2225
|
])) : B("", !0),
|
|
2222
2226
|
ae(S(Ea), le({
|
|
2223
|
-
class: [(he = S(
|
|
2227
|
+
class: [(he = S(o)) == null ? void 0 : he.errClass, "w-full"],
|
|
2224
2228
|
value: d.value,
|
|
2225
|
-
"onUpdate:value":
|
|
2229
|
+
"onUpdate:value": O[0] || (O[0] = (j) => d.value = j),
|
|
2226
2230
|
"allow-clear": !0,
|
|
2227
2231
|
onChange: $,
|
|
2228
2232
|
placeholder: m.value,
|
|
2229
2233
|
"label-in-value": !1
|
|
2230
2234
|
}, S(c)), {
|
|
2231
2235
|
default: z(() => [
|
|
2232
|
-
(A(!0), L(te, null, De(
|
|
2236
|
+
(A(!0), L(te, null, De(T.value, (j) => (A(), L(te, {
|
|
2233
2237
|
key: j.value
|
|
2234
2238
|
}, [
|
|
2235
|
-
j.visible !== !1 ? (A(), Ie(S(
|
|
2239
|
+
j.visible !== !1 ? (A(), Ie(S(Oa), {
|
|
2236
2240
|
key: 0,
|
|
2237
2241
|
value: j.value
|
|
2238
2242
|
}, {
|
|
@@ -2262,8 +2266,8 @@ export {
|
|
|
2262
2266
|
Bt as I,
|
|
2263
2267
|
at as J,
|
|
2264
2268
|
ua as K,
|
|
2265
|
-
|
|
2266
|
-
|
|
2269
|
+
Oe as L,
|
|
2270
|
+
Re as M,
|
|
2267
2271
|
zt as N,
|
|
2268
2272
|
M as O,
|
|
2269
2273
|
U as P,
|
|
@@ -2283,7 +2287,7 @@ export {
|
|
|
2283
2287
|
Lt as a1,
|
|
2284
2288
|
Ht as a2,
|
|
2285
2289
|
Ya as a3,
|
|
2286
|
-
|
|
2290
|
+
ia as a4,
|
|
2287
2291
|
Qt as a5,
|
|
2288
2292
|
Pt as a6,
|
|
2289
2293
|
Ze as a7,
|
|
@@ -2305,7 +2309,7 @@ export {
|
|
|
2305
2309
|
Vt as h,
|
|
2306
2310
|
P as i,
|
|
2307
2311
|
_t as j,
|
|
2308
|
-
|
|
2312
|
+
oa as k,
|
|
2309
2313
|
Ca as l,
|
|
2310
2314
|
Kt as m,
|
|
2311
2315
|
ts as n,
|