@skyfox2000/webui 1.3.1 → 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-Ce5MFm6o.js → file-upload-BVB9c-eZ.js} +1 -1
- package/lib/assets/modules/{form-excel-Bq-9rkHa.js → form-excel-CsQBtfkA.js} +1 -1
- package/lib/assets/modules/{index-CrAJ72MK.js → index-CaaMz5sz.js} +1 -1
- package/lib/assets/modules/{index-B8uZAVPS.js → index-k_AnrbPY.js} +2 -2
- package/lib/assets/modules/{menuTabs-DEq88ENK.js → menuTabs-_Ph7P8ES.js} +2 -2
- package/lib/assets/modules/{toolIcon-OGhmNg0x.js → toolIcon-QMXCkImG.js} +1 -1
- package/lib/assets/modules/{uploadList-DzK2YNwb.js → uploadList-CXa3siDj.js} +4 -4
- package/lib/assets/modules/{uploadList-BzBJXttS.js → uploadList-D-FOtndj.js} +365 -365
- 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 +3 -2
- 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 +3 -2
- package/src/utils/options.ts +16 -26
- package/src/utils/page.ts +39 -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"
|
|
@@ -1386,10 +1386,10 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1386
1386
|
};
|
|
1387
1387
|
return b(
|
|
1388
1388
|
() => s.reload.value,
|
|
1389
|
-
(
|
|
1390
|
-
|
|
1389
|
+
(n) => {
|
|
1390
|
+
n && (setTimeout(() => {
|
|
1391
1391
|
s.reload.value = !1;
|
|
1392
|
-
}, 1), s.remotePage ?
|
|
1392
|
+
}, 1), s.remotePage ? oa(s) : Ca(s));
|
|
1393
1393
|
}
|
|
1394
1394
|
), {
|
|
1395
1395
|
gridCtrl: s
|
|
@@ -1418,12 +1418,12 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1418
1418
|
const a = {
|
|
1419
1419
|
...y.OptionOption,
|
|
1420
1420
|
url: e,
|
|
1421
|
-
options: f([]),
|
|
1422
1421
|
reload: f(!1),
|
|
1422
|
+
optionQuery: {},
|
|
1423
1423
|
data: H([]),
|
|
1424
1424
|
selected: f([]),
|
|
1425
1425
|
selectedOptions: f([]),
|
|
1426
|
-
|
|
1426
|
+
options: f([]),
|
|
1427
1427
|
isOptionLoading: f(!1)
|
|
1428
1428
|
};
|
|
1429
1429
|
return b(
|
|
@@ -1431,29 +1431,29 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1431
1431
|
(s) => {
|
|
1432
1432
|
s && (setTimeout(() => {
|
|
1433
1433
|
a.reload.value = !1;
|
|
1434
|
-
}, 1), Y(a, t));
|
|
1434
|
+
}, 1), Y(!0, a, t));
|
|
1435
1435
|
}
|
|
1436
1436
|
), {
|
|
1437
1437
|
optionCtrl: a
|
|
1438
1438
|
};
|
|
1439
1439
|
}, Bt = (e, t, a) => {
|
|
1440
|
-
for (const
|
|
1441
|
-
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));
|
|
1442
1442
|
const s = {
|
|
1443
1443
|
...y.PageOption,
|
|
1444
1444
|
...e
|
|
1445
|
-
}, { editorCtrl:
|
|
1446
|
-
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, {
|
|
1447
1447
|
pageCtrl: s,
|
|
1448
|
-
editorCtrl:
|
|
1449
|
-
gridCtrl:
|
|
1448
|
+
editorCtrl: n,
|
|
1449
|
+
gridCtrl: o
|
|
1450
1450
|
};
|
|
1451
1451
|
}, rt = 7 * 24 * 60 * 60 * 1e3, Fe = /* @__PURE__ */ new Map(), We = /* @__PURE__ */ new Set(), Q = f({}), zt = Q, Wt = (e) => {
|
|
1452
|
-
var
|
|
1452
|
+
var n;
|
|
1453
1453
|
if (!e.iconUrl) return Ne;
|
|
1454
1454
|
const t = f(!0), a = f("");
|
|
1455
1455
|
let s = !0;
|
|
1456
|
-
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(() => {
|
|
1457
1457
|
lt(e.iconUrl, e.monoColor || !1), t.value = !0;
|
|
1458
1458
|
}), C({
|
|
1459
1459
|
props: {
|
|
@@ -1481,20 +1481,20 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1481
1481
|
}
|
|
1482
1482
|
},
|
|
1483
1483
|
emits: ["update:iconIndex"],
|
|
1484
|
-
setup(
|
|
1485
|
-
const l = f(
|
|
1486
|
-
|
|
1484
|
+
setup(o, { emit: r }) {
|
|
1485
|
+
const l = f(o.icon), i = f(0), c = () => {
|
|
1486
|
+
o.icons && i.value++;
|
|
1487
1487
|
};
|
|
1488
1488
|
return b(
|
|
1489
|
-
() =>
|
|
1489
|
+
() => o.iconIndex,
|
|
1490
1490
|
(u) => {
|
|
1491
|
-
u !== void 0 && (
|
|
1491
|
+
u !== void 0 && (i.value = u);
|
|
1492
1492
|
},
|
|
1493
1493
|
{ immediate: !0 }
|
|
1494
1494
|
), b(
|
|
1495
|
-
() =>
|
|
1495
|
+
() => i.value,
|
|
1496
1496
|
(u) => {
|
|
1497
|
-
|
|
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));
|
|
1498
1498
|
},
|
|
1499
1499
|
{ immediate: !0 }
|
|
1500
1500
|
), b(
|
|
@@ -1504,7 +1504,7 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1504
1504
|
},
|
|
1505
1505
|
{ deep: !0 }
|
|
1506
1506
|
), b(
|
|
1507
|
-
() =>
|
|
1507
|
+
() => o.icon,
|
|
1508
1508
|
(u) => {
|
|
1509
1509
|
ve(a, l, u);
|
|
1510
1510
|
}
|
|
@@ -1513,10 +1513,10 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1513
1513
|
render() {
|
|
1514
1514
|
if (!t.value)
|
|
1515
1515
|
return Ne;
|
|
1516
|
-
let
|
|
1517
|
-
Array.isArray(
|
|
1518
|
-
let l = [
|
|
1519
|
-
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), {
|
|
1520
1520
|
onClick: this.$props.clickable ? this.handleClick : void 0,
|
|
1521
1521
|
class: `${l.join(" ")}`,
|
|
1522
1522
|
style: {
|
|
@@ -1535,13 +1535,13 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1535
1535
|
return Promise.resolve();
|
|
1536
1536
|
const s = fa(a);
|
|
1537
1537
|
if (s)
|
|
1538
|
-
return new Promise(async (
|
|
1538
|
+
return new Promise(async (o) => (ca(s.scriptContent), o()));
|
|
1539
1539
|
t.value = !1;
|
|
1540
|
-
const
|
|
1541
|
-
await
|
|
1540
|
+
const n = new Promise(async (o) => {
|
|
1541
|
+
await ot(a, e.monoColor || !1), o(), Fe.delete(a);
|
|
1542
1542
|
});
|
|
1543
|
-
return Fe.set(a,
|
|
1544
|
-
},
|
|
1543
|
+
return Fe.set(a, n), n;
|
|
1544
|
+
}, ot = async (e, t) => {
|
|
1545
1545
|
try {
|
|
1546
1546
|
const a = await fetch(e);
|
|
1547
1547
|
if (!a.ok) {
|
|
@@ -1550,11 +1550,11 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1550
1550
|
}
|
|
1551
1551
|
let s = await a.text();
|
|
1552
1552
|
s = t ? s.replace(/fill=\"[^\"]*\"/gi, "") : s;
|
|
1553
|
-
let
|
|
1554
|
-
const
|
|
1555
|
-
if (
|
|
1556
|
-
let
|
|
1557
|
-
|
|
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);
|
|
1558
1558
|
}
|
|
1559
1559
|
ca(s);
|
|
1560
1560
|
return;
|
|
@@ -1564,16 +1564,16 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1564
1564
|
}, ca = (e) => {
|
|
1565
1565
|
const t = document.createElement("script");
|
|
1566
1566
|
t.textContent = e, document.head.appendChild(t);
|
|
1567
|
-
},
|
|
1568
|
-
let
|
|
1569
|
-
const
|
|
1567
|
+
}, it = (e, t, a, s) => {
|
|
1568
|
+
let n = `icon_cache:${e}`;
|
|
1569
|
+
const o = {
|
|
1570
1570
|
windowKey: t,
|
|
1571
1571
|
monoColor: a,
|
|
1572
1572
|
scriptContent: s,
|
|
1573
1573
|
expireTime: Date.now() + rt
|
|
1574
1574
|
// 缓存时间:7天
|
|
1575
1575
|
};
|
|
1576
|
-
localStorage.setItem(
|
|
1576
|
+
localStorage.setItem(n, JSON.stringify(o));
|
|
1577
1577
|
}, fa = (e) => {
|
|
1578
1578
|
let t = `icon_cache:${e}`;
|
|
1579
1579
|
const a = localStorage.getItem(t);
|
|
@@ -1581,8 +1581,8 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1581
1581
|
let s;
|
|
1582
1582
|
try {
|
|
1583
1583
|
s = JSON.parse(a);
|
|
1584
|
-
} catch (
|
|
1585
|
-
return console.error("解析缓存失败:",
|
|
1584
|
+
} catch (n) {
|
|
1585
|
+
return console.error("解析缓存失败:", n), null;
|
|
1586
1586
|
}
|
|
1587
1587
|
return s.expireTime < Date.now() ? (localStorage.removeItem(e), null) : s;
|
|
1588
1588
|
}, Ct = () => {
|
|
@@ -1622,23 +1622,23 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1622
1622
|
s.startsWith("_iconfont_svg_string_") && (a == null ? void 0 : a.windowKey) === s && !We.has(s) && (We.add(s), ut(s, t));
|
|
1623
1623
|
});
|
|
1624
1624
|
}, ut = (e, t) => {
|
|
1625
|
-
const a = window[e],
|
|
1626
|
-
for (const l of
|
|
1627
|
-
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);
|
|
1628
1628
|
c && t && (c.innerHTML = l.innerHTML, c.querySelectorAll("*").forEach((u) => {
|
|
1629
1629
|
u.hasAttribute("fill") && u.removeAttribute("fill");
|
|
1630
|
-
})), Q.value[
|
|
1630
|
+
})), Q.value[i] || (Q.value[i] = _("svg", { fill: "currentColor" }, [_("use", { "xlink:href": `#${i}` })]));
|
|
1631
1631
|
}
|
|
1632
1632
|
}, ct = (e, t) => {
|
|
1633
1633
|
let a = "";
|
|
1634
1634
|
return e && (a += `rotate(${e}deg)`), t && (a += " scaleX(-1)"), a;
|
|
1635
1635
|
}, Yt = (e, t, a, s) => {
|
|
1636
|
-
pa(e, [], a, s).forEach((
|
|
1636
|
+
pa(e, [], a, s).forEach((o) => t.push(o));
|
|
1637
1637
|
}, pa = (e, t, a, s) => {
|
|
1638
|
-
var
|
|
1639
|
-
const
|
|
1638
|
+
var r, l, i, c, u;
|
|
1639
|
+
const n = [], o = J();
|
|
1640
1640
|
for (const p of e) {
|
|
1641
|
-
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"))
|
|
1642
1642
|
continue;
|
|
1643
1643
|
const m = p.path.split("/");
|
|
1644
1644
|
m.unshift(...t);
|
|
@@ -1649,21 +1649,21 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1649
1649
|
icon: p.icon ? _(a, { ...s, icon: p.icon }) : void 0,
|
|
1650
1650
|
children: d.length > 0 ? d : void 0
|
|
1651
1651
|
};
|
|
1652
|
-
(d.length > 0 || !p.children) &&
|
|
1652
|
+
(d.length > 0 || !p.children) && n.push(E);
|
|
1653
1653
|
}
|
|
1654
|
-
return
|
|
1654
|
+
return n;
|
|
1655
1655
|
}, Ce = va([]), Xt = () => {
|
|
1656
1656
|
Ce.length = 0;
|
|
1657
1657
|
const e = V();
|
|
1658
1658
|
let a = Je().TabActive;
|
|
1659
|
-
e.matchedRoutes(a).forEach((
|
|
1659
|
+
e.matchedRoutes(a).forEach((n, o) => {
|
|
1660
1660
|
var l;
|
|
1661
|
-
const
|
|
1662
|
-
index:
|
|
1663
|
-
path:
|
|
1664
|
-
breadcrumbName: ((l =
|
|
1661
|
+
const r = {
|
|
1662
|
+
index: o,
|
|
1663
|
+
path: n.path,
|
|
1664
|
+
breadcrumbName: ((l = n.name) == null ? void 0 : l.toString()) ?? ""
|
|
1665
1665
|
};
|
|
1666
|
-
Ce.push(
|
|
1666
|
+
Ce.push(r);
|
|
1667
1667
|
});
|
|
1668
1668
|
}, ft = {
|
|
1669
1669
|
host: {
|
|
@@ -1702,15 +1702,15 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1702
1702
|
}
|
|
1703
1703
|
return new Promise((s) => {
|
|
1704
1704
|
we.SITEHOST_API || (we.SITEHOST_API = e);
|
|
1705
|
-
const
|
|
1705
|
+
const n = t || window.location.origin;
|
|
1706
1706
|
G(ft.host, {
|
|
1707
1707
|
Query: {
|
|
1708
|
-
Host:
|
|
1708
|
+
Host: n
|
|
1709
1709
|
}
|
|
1710
|
-
}).then((
|
|
1711
|
-
if ((
|
|
1712
|
-
const
|
|
1713
|
-
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);
|
|
1714
1714
|
}
|
|
1715
1715
|
s();
|
|
1716
1716
|
});
|
|
@@ -1795,40 +1795,40 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1795
1795
|
},
|
|
1796
1796
|
emits: ["change"],
|
|
1797
1797
|
setup(e, { emit: t }) {
|
|
1798
|
-
const a = e, s = W(),
|
|
1799
|
-
|
|
1800
|
-
const
|
|
1801
|
-
|
|
1802
|
-
() =>
|
|
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,
|
|
1803
1803
|
(p) => {
|
|
1804
|
-
|
|
1804
|
+
r.value = p || [];
|
|
1805
1805
|
},
|
|
1806
1806
|
{ immediate: !0, deep: !0 }
|
|
1807
1807
|
);
|
|
1808
|
-
const l = t, { editorCtrl:
|
|
1809
|
-
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);
|
|
1810
1810
|
};
|
|
1811
|
-
return
|
|
1811
|
+
return oe(() => {
|
|
1812
1812
|
if (!a.data || a.data.length != 2) {
|
|
1813
1813
|
console.error("Switch组件: ", a.data), x.error("Switch组件必须有且只有两个选项");
|
|
1814
1814
|
return;
|
|
1815
1815
|
}
|
|
1816
|
-
|
|
1817
|
-
}),
|
|
1818
|
-
|
|
1816
|
+
o && Y(o.autoload, o, a);
|
|
1817
|
+
}), ie(() => {
|
|
1818
|
+
o && pe(o, a);
|
|
1819
1819
|
}), (p, m) => {
|
|
1820
1820
|
var d;
|
|
1821
|
-
return
|
|
1821
|
+
return r.value.length === 2 ? (A(), Ie(S(ya), le({
|
|
1822
1822
|
key: 0,
|
|
1823
1823
|
class: [
|
|
1824
1824
|
((d = S(c)) == null ? void 0 : d.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : "",
|
|
1825
1825
|
"bg-blue-300",
|
|
1826
1826
|
"w-[58px]"
|
|
1827
1827
|
],
|
|
1828
|
-
checkedChildren:
|
|
1829
|
-
checkedValue:
|
|
1830
|
-
unCheckedChildren:
|
|
1831
|
-
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,
|
|
1832
1832
|
onChange: u
|
|
1833
1833
|
}, p.$attrs), null, 16, ["class", "checkedChildren", "checkedValue", "unCheckedChildren", "unCheckedValue"])) : B("", !0);
|
|
1834
1834
|
};
|
|
@@ -1868,32 +1868,32 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1868
1868
|
emits: ["update:value", "select", "change", "update:labels"],
|
|
1869
1869
|
setup(e, { emit: t }) {
|
|
1870
1870
|
var $, g, I;
|
|
1871
|
-
const a = e, s = xe(),
|
|
1872
|
-
|
|
1871
|
+
const a = e, s = xe(), n = W(), o = de(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
|
|
1872
|
+
r.inputFactory = H(n);
|
|
1873
1873
|
const l = f({
|
|
1874
|
-
...
|
|
1875
|
-
url: (($ =
|
|
1876
|
-
fieldMap: (
|
|
1877
|
-
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),
|
|
1878
1878
|
loadingText: !1
|
|
1879
|
-
}),
|
|
1879
|
+
}), i = f((r == null ? void 0 : r.selected.value) || void 0);
|
|
1880
1880
|
b(
|
|
1881
1881
|
() => a.value,
|
|
1882
1882
|
() => {
|
|
1883
|
-
|
|
1883
|
+
i.value = a.value;
|
|
1884
1884
|
},
|
|
1885
1885
|
{ immediate: !0 }
|
|
1886
1886
|
), b(
|
|
1887
|
-
() =>
|
|
1887
|
+
() => i.value,
|
|
1888
1888
|
(v) => {
|
|
1889
1889
|
a.autoClean && a.formData && a.outFields && v !== a.value && ua(a.formData, a.outFields, null);
|
|
1890
1890
|
}
|
|
1891
1891
|
);
|
|
1892
|
-
const { editorCtrl: c, errInfo: u, labelText: p } =
|
|
1893
|
-
|
|
1894
|
-
const d = f((
|
|
1895
|
-
|
|
1896
|
-
() =>
|
|
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,
|
|
1897
1897
|
(v) => {
|
|
1898
1898
|
d.value = v || [];
|
|
1899
1899
|
},
|
|
@@ -1902,45 +1902,45 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1902
1902
|
const E = (v) => {
|
|
1903
1903
|
var N;
|
|
1904
1904
|
if (d.value = [], v === "") return;
|
|
1905
|
-
let h = v.trim(),
|
|
1905
|
+
let h = v.trim(), O = {
|
|
1906
1906
|
...l.value.params,
|
|
1907
1907
|
Query: {
|
|
1908
1908
|
...(N = l.value.params) == null ? void 0 : N.Query
|
|
1909
1909
|
}
|
|
1910
1910
|
};
|
|
1911
1911
|
a.searchField && (Array.isArray(a.searchField) ? a.searchField.forEach((K) => {
|
|
1912
|
-
|
|
1912
|
+
O.Query[K] = {
|
|
1913
1913
|
$like: "%" + h + "%"
|
|
1914
1914
|
};
|
|
1915
|
-
}) :
|
|
1915
|
+
}) : O.Query[a.searchField] = {
|
|
1916
1916
|
$like: "%" + h + "%"
|
|
1917
|
-
}), a.onsearch && a.onsearch(h,
|
|
1918
|
-
},
|
|
1919
|
-
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);
|
|
1920
1920
|
m("update:value", v), m("select", v);
|
|
1921
|
-
const
|
|
1922
|
-
m("update:labels",
|
|
1921
|
+
const O = Re(h);
|
|
1922
|
+
m("update:labels", O), u != null && u.value.errClass && c && fe(c);
|
|
1923
1923
|
};
|
|
1924
|
-
return
|
|
1924
|
+
return oe(() => {
|
|
1925
1925
|
l.value && !l.value.fieldMap && (l.value.fieldMap = {
|
|
1926
1926
|
title: "Name",
|
|
1927
1927
|
label: "Name",
|
|
1928
1928
|
value: "Name",
|
|
1929
1929
|
key: "Id"
|
|
1930
1930
|
});
|
|
1931
|
-
}),
|
|
1932
|
-
|
|
1931
|
+
}), ie(() => {
|
|
1932
|
+
r && pe(r, a);
|
|
1933
1933
|
}), (v, h) => {
|
|
1934
|
-
var
|
|
1934
|
+
var O, N, K;
|
|
1935
1935
|
return A(), L("div", null, [
|
|
1936
1936
|
ae(S(Sa), le({
|
|
1937
|
-
value:
|
|
1938
|
-
"onUpdate:value": h[0] || (h[0] = (he) =>
|
|
1939
|
-
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"],
|
|
1940
1940
|
options: d.value,
|
|
1941
1941
|
onSearch: E,
|
|
1942
|
-
onSelect:
|
|
1943
|
-
placeholder: (K = (N = S(
|
|
1942
|
+
onSelect: T,
|
|
1943
|
+
placeholder: (K = (N = S(r)) == null ? void 0 : N.url) != null && K.loading ? "请输入并选择" + S(p) : ""
|
|
1944
1944
|
}, S(s)), null, 16, ["value", "class", "options", "placeholder"])
|
|
1945
1945
|
]);
|
|
1946
1946
|
};
|
|
@@ -1970,38 +1970,38 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
1970
1970
|
emits: ["change", "update:labels"],
|
|
1971
1971
|
setup(e, { emit: t }) {
|
|
1972
1972
|
var m, d, E;
|
|
1973
|
-
const a = e, s = xe(),
|
|
1974
|
-
|
|
1973
|
+
const a = e, s = xe(), n = W(), o = de(a.url, a), r = a.optionCtrl ?? o.optionCtrl;
|
|
1974
|
+
r.inputFactory = H(n);
|
|
1975
1975
|
const l = f({
|
|
1976
|
-
...
|
|
1977
|
-
url: ((m =
|
|
1978
|
-
fieldMap: (
|
|
1979
|
-
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),
|
|
1980
1980
|
loadingText: !1
|
|
1981
|
-
}), { errInfo:
|
|
1982
|
-
|
|
1983
|
-
const u = f((
|
|
1984
|
-
|
|
1985
|
-
() =>
|
|
1986
|
-
(
|
|
1987
|
-
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 || [];
|
|
1988
1988
|
},
|
|
1989
1989
|
{ immediate: !0, deep: !0 }
|
|
1990
1990
|
);
|
|
1991
|
-
const p = (
|
|
1992
|
-
const g =
|
|
1991
|
+
const p = (T) => {
|
|
1992
|
+
const g = Oe(r, a, T), I = Re(g);
|
|
1993
1993
|
c("update:labels", I);
|
|
1994
1994
|
};
|
|
1995
|
-
return
|
|
1995
|
+
return oe(() => {
|
|
1996
1996
|
l.value && !l.value.fieldMap && (l.value.fieldMap = {
|
|
1997
1997
|
title: "Name",
|
|
1998
1998
|
label: "Name",
|
|
1999
1999
|
value: "Id",
|
|
2000
2000
|
key: "Id"
|
|
2001
|
-
}),
|
|
2002
|
-
}),
|
|
2003
|
-
|
|
2004
|
-
}), (
|
|
2001
|
+
}), r && Y(r.autoload, r, a);
|
|
2002
|
+
}), ie(() => {
|
|
2003
|
+
r && pe(r, a);
|
|
2004
|
+
}), (T, $) => (A(), L("div", pt, [
|
|
2005
2005
|
ae(S(ba), le({
|
|
2006
2006
|
onChange: p,
|
|
2007
2007
|
class: "w-full mb-[-3px]"
|
|
@@ -2014,7 +2014,7 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
2014
2014
|
value: g.value,
|
|
2015
2015
|
disabled: g.disabled || g.value && e.disabledItems && e.disabledItems.indexOf(g.value.toString()) > -1,
|
|
2016
2016
|
class: Xe([
|
|
2017
|
-
((I = S(
|
|
2017
|
+
((I = S(i)) == null ? void 0 : I.errClass) === "error" ? "error !text-red-400" : "",
|
|
2018
2018
|
"text-nowrap",
|
|
2019
2019
|
"pb-1",
|
|
2020
2020
|
e.wrap ? `w-1/${a.wrap}` : ""
|
|
@@ -2056,24 +2056,24 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
2056
2056
|
},
|
|
2057
2057
|
emits: ["change", "update:value", "update:labels"],
|
|
2058
2058
|
setup(e, { emit: t }) {
|
|
2059
|
-
var E,
|
|
2060
|
-
const a = e, s = xe(),
|
|
2061
|
-
|
|
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);
|
|
2062
2062
|
const l = f({
|
|
2063
|
-
...
|
|
2064
|
-
url: ((E =
|
|
2065
|
-
fieldMap: (
|
|
2066
|
-
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),
|
|
2067
2067
|
loadingText: !1
|
|
2068
|
-
}),
|
|
2069
|
-
|
|
2070
|
-
() =>
|
|
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,
|
|
2071
2071
|
(g) => {
|
|
2072
2072
|
u.value = g || [];
|
|
2073
2073
|
},
|
|
2074
2074
|
{ immediate: !0, deep: !0 }
|
|
2075
2075
|
), b(
|
|
2076
|
-
() =>
|
|
2076
|
+
() => i.value,
|
|
2077
2077
|
(g) => {
|
|
2078
2078
|
p("update:value", g);
|
|
2079
2079
|
}
|
|
@@ -2081,25 +2081,25 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
2081
2081
|
const m = (g, I) => {
|
|
2082
2082
|
if (typeof g == "object" && typeof I == "object") {
|
|
2083
2083
|
const v = JSON.stringify(g) === JSON.stringify(I);
|
|
2084
|
-
return v && (
|
|
2084
|
+
return v && (i.value = g), v;
|
|
2085
2085
|
}
|
|
2086
2086
|
return g === I;
|
|
2087
2087
|
}, d = (g) => {
|
|
2088
|
-
const I = g.target.value, v =
|
|
2088
|
+
const I = g.target.value, v = Oe(r, a, I), h = Re(v);
|
|
2089
2089
|
p("update:labels", h);
|
|
2090
2090
|
};
|
|
2091
|
-
return
|
|
2091
|
+
return oe(() => {
|
|
2092
2092
|
l.value && !l.value.fieldMap && (l.value.fieldMap = {
|
|
2093
2093
|
label: "Name",
|
|
2094
2094
|
value: "Id",
|
|
2095
2095
|
key: "Id"
|
|
2096
|
-
}),
|
|
2097
|
-
}),
|
|
2098
|
-
|
|
2096
|
+
}), r && Y(r.autoload, r, a);
|
|
2097
|
+
}), ie(() => {
|
|
2098
|
+
r && pe(r, a);
|
|
2099
2099
|
}), (g, I) => (A(), L("div", ht, [
|
|
2100
2100
|
ae(S(xa), le({
|
|
2101
|
-
value:
|
|
2102
|
-
"onUpdate:value": I[0] || (I[0] = (v) =>
|
|
2101
|
+
value: i.value,
|
|
2102
|
+
"onUpdate:value": I[0] || (I[0] = (v) => i.value = v),
|
|
2103
2103
|
autocheck: !1,
|
|
2104
2104
|
onChange: d,
|
|
2105
2105
|
class: "w-full flex align-items flex-wrap mb-[-3px]"
|
|
@@ -2163,37 +2163,37 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
2163
2163
|
emits: ["change", "update:value", "update:labels"],
|
|
2164
2164
|
setup(e, { emit: t }) {
|
|
2165
2165
|
var g, I, v;
|
|
2166
|
-
const a = e, s = W(), { editorCtrl:
|
|
2167
|
-
|
|
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);
|
|
2168
2168
|
const c = xe(), u = f({
|
|
2169
|
-
...
|
|
2170
|
-
url: ((g =
|
|
2171
|
-
fieldMap: (
|
|
2172
|
-
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),
|
|
2173
2173
|
loadingText: !1
|
|
2174
|
-
}), 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;
|
|
2175
2175
|
s.inputEmit = E;
|
|
2176
|
-
const
|
|
2177
|
-
|
|
2178
|
-
() =>
|
|
2176
|
+
const T = f((i == null ? void 0 : i.options.value) || []);
|
|
2177
|
+
i && b(
|
|
2178
|
+
() => i.options.value,
|
|
2179
2179
|
(h) => {
|
|
2180
|
-
|
|
2180
|
+
T.value = h || [];
|
|
2181
2181
|
},
|
|
2182
2182
|
{ immediate: !0, deep: !0 }
|
|
2183
2183
|
);
|
|
2184
2184
|
const $ = (h) => {
|
|
2185
|
-
const
|
|
2186
|
-
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);
|
|
2187
2187
|
};
|
|
2188
2188
|
return b(
|
|
2189
|
-
() =>
|
|
2189
|
+
() => T.value,
|
|
2190
2190
|
(h) => {
|
|
2191
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);
|
|
2192
2192
|
}
|
|
2193
2193
|
), b(
|
|
2194
2194
|
() => u.value.loading,
|
|
2195
2195
|
(h) => {
|
|
2196
|
-
h ? m.value = "" : m.value || (m.value = "请选择" +
|
|
2196
|
+
h ? m.value = "" : m.value || (m.value = "请选择" + r.value);
|
|
2197
2197
|
},
|
|
2198
2198
|
{ immediate: !0 }
|
|
2199
2199
|
), b(
|
|
@@ -2205,38 +2205,38 @@ const q = new Xa(), Y = (e, t) => {
|
|
|
2205
2205
|
}
|
|
2206
2206
|
E("update:value", h);
|
|
2207
2207
|
}
|
|
2208
|
-
),
|
|
2208
|
+
), oe(() => {
|
|
2209
2209
|
if (u.value && !u.value.fieldMap && (u.value.fieldMap = {
|
|
2210
2210
|
label: "Name",
|
|
2211
2211
|
value: "Id",
|
|
2212
2212
|
key: "Id"
|
|
2213
2213
|
}), a.dataKey) {
|
|
2214
2214
|
const h = JSON.parse(JSON.stringify(M.getOptions(a.dataKey)));
|
|
2215
|
-
|
|
2216
|
-
} else
|
|
2217
|
-
}),
|
|
2218
|
-
|
|
2219
|
-
}), (h,
|
|
2215
|
+
T.value = h;
|
|
2216
|
+
} else i && Y(i.autoload, i, a);
|
|
2217
|
+
}), ie(() => {
|
|
2218
|
+
i && pe(i, a);
|
|
2219
|
+
}), (h, O) => {
|
|
2220
2220
|
var N, K, he;
|
|
2221
2221
|
return A(), L("div", null, [
|
|
2222
|
-
(K = (N = S(
|
|
2222
|
+
(K = (N = S(i)) == null ? void 0 : N.url) != null && K.loading ? (A(), L("div", vt, [
|
|
2223
2223
|
ae(S(Ne), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
|
|
2224
|
-
|
|
2224
|
+
O[1] || (O[1] = ga("span", null, "数据加载中...", -1))
|
|
2225
2225
|
])) : B("", !0),
|
|
2226
2226
|
ae(S(Ea), le({
|
|
2227
|
-
class: [(he = S(
|
|
2227
|
+
class: [(he = S(o)) == null ? void 0 : he.errClass, "w-full"],
|
|
2228
2228
|
value: d.value,
|
|
2229
|
-
"onUpdate:value":
|
|
2229
|
+
"onUpdate:value": O[0] || (O[0] = (j) => d.value = j),
|
|
2230
2230
|
"allow-clear": !0,
|
|
2231
2231
|
onChange: $,
|
|
2232
2232
|
placeholder: m.value,
|
|
2233
2233
|
"label-in-value": !1
|
|
2234
2234
|
}, S(c)), {
|
|
2235
2235
|
default: z(() => [
|
|
2236
|
-
(A(!0), L(te, null, De(
|
|
2236
|
+
(A(!0), L(te, null, De(T.value, (j) => (A(), L(te, {
|
|
2237
2237
|
key: j.value
|
|
2238
2238
|
}, [
|
|
2239
|
-
j.visible !== !1 ? (A(), Ie(S(
|
|
2239
|
+
j.visible !== !1 ? (A(), Ie(S(Oa), {
|
|
2240
2240
|
key: 0,
|
|
2241
2241
|
value: j.value
|
|
2242
2242
|
}, {
|
|
@@ -2266,8 +2266,8 @@ export {
|
|
|
2266
2266
|
Bt as I,
|
|
2267
2267
|
at as J,
|
|
2268
2268
|
ua as K,
|
|
2269
|
-
|
|
2270
|
-
|
|
2269
|
+
Oe as L,
|
|
2270
|
+
Re as M,
|
|
2271
2271
|
zt as N,
|
|
2272
2272
|
M as O,
|
|
2273
2273
|
U as P,
|
|
@@ -2287,7 +2287,7 @@ export {
|
|
|
2287
2287
|
Lt as a1,
|
|
2288
2288
|
Ht as a2,
|
|
2289
2289
|
Ya as a3,
|
|
2290
|
-
|
|
2290
|
+
ia as a4,
|
|
2291
2291
|
Qt as a5,
|
|
2292
2292
|
Pt as a6,
|
|
2293
2293
|
Ze as a7,
|
|
@@ -2309,7 +2309,7 @@ export {
|
|
|
2309
2309
|
Vt as h,
|
|
2310
2310
|
P as i,
|
|
2311
2311
|
_t as j,
|
|
2312
|
-
|
|
2312
|
+
oa as k,
|
|
2313
2313
|
Ca as l,
|
|
2314
2314
|
Kt as m,
|
|
2315
2315
|
ts as n,
|