@chewel611/naive-ui-plus 0.0.16 → 0.0.18
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/dist/index.js +294 -290
- package/dist/index.umd.cjs +1 -1
- package/es/modal/PModal.d.ts +10 -2
- package/es/modal/PModal.vue.js +55 -53
- package/es/modal/index.d.ts +23 -6
- package/es/modal/typing.d.ts +2 -0
- package/es/table/PTable.vue.js +2 -0
- package/lib/modal/PModal.d.ts +10 -2
- package/lib/modal/PModal.vue.cjs +1 -1
- package/lib/modal/index.d.ts +23 -6
- package/lib/modal/typing.d.ts +2 -0
- package/lib/table/PTable.vue.cjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useDialog as $e, useMessage as ce, NCard as Ke, NDataTable as Ye, NModal as Oe, NSpace as Me, NButton as q, NTooltip as Ne, NIcon as N, NDropdown as G, NAvatar as Ee, NBreadcrumb as Xe, NBreadcrumbItem as Ge, NDivider as Je, useThemeVars as Ze, NMenu as Qe, NLayout as Le, NLayoutSider as et, NFlex as tt, NLayoutHeader as at, NLayoutContent as ot, NBackTop as lt, NConfigProvider as nt, dateZhCN as st, zhCN as
|
|
2
|
-
import { defineComponent as I, ref as
|
|
1
|
+
import { useDialog as $e, useMessage as ce, NCard as Ke, NDataTable as Ye, NModal as Oe, NSpace as Me, NButton as q, NTooltip as Ne, NIcon as N, NDropdown as G, NAvatar as Ee, NBreadcrumb as Xe, NBreadcrumbItem as Ge, NDivider as Je, useThemeVars as Ze, NMenu as Qe, NLayout as Le, NLayoutSider as et, NFlex as tt, NLayoutHeader as at, NLayoutContent as ot, NBackTop as lt, NConfigProvider as nt, dateZhCN as st, zhCN as it, NDialogProvider as rt, NNotificationProvider as ct, NMessageProvider as dt, NText as ut } from "naive-ui";
|
|
2
|
+
import { defineComponent as I, ref as M, computed as H, unref as a, onMounted as ee, createBlock as $, openBlock as y, withCtx as s, createElementVNode as b, createElementBlock as B, createCommentVNode as A, createVNode as i, renderSlot as U, normalizeStyle as ie, createTextVNode as V, h as z, toRaw as X, reactive as Re, withDirectives as ft, normalizeClass as Q, toDisplayString as F, vShow as pt, nextTick as re, inject as De, Fragment as Te, renderList as gt, resolveDynamicComponent as be, withModifiers as ye, resolveComponent as ht, KeepAlive as mt, useCssVars as vt, watch as ze, provide as _t, mergeProps as bt } from "vue";
|
|
3
3
|
import { PlusSquareOutlined as yt, DeleteOutlined as wt, ReloadOutlined as we, MoreOutlined as kt, MenuUnfoldOutlined as Ct, MenuFoldOutlined as Pt, FullscreenOutlined as St, FullscreenExitOutlined as Lt, CloseOutlined as xe, ColumnWidthOutlined as Tt, MinusOutlined as xt, LeftOutlined as $t, RightOutlined as Ot, DownOutlined as Mt } from "@vicons/antd";
|
|
4
4
|
import { cloneDeep as Nt } from "lodash";
|
|
5
5
|
import { defineStore as Ae } from "pinia";
|
|
@@ -8,8 +8,8 @@ import Et from "element-resize-detector";
|
|
|
8
8
|
import Rt from "vuedraggable";
|
|
9
9
|
const Be = (t) => {
|
|
10
10
|
Object.keys(t).forEach((d) => {
|
|
11
|
-
const
|
|
12
|
-
Array.isArray(
|
|
11
|
+
const h = t[d];
|
|
12
|
+
Array.isArray(h) ? t[d] = [] : h !== null && typeof h == "object" ? Be(h) : t[d] = void 0;
|
|
13
13
|
});
|
|
14
14
|
}, Dt = { id: "data-content" }, zt = {
|
|
15
15
|
key: 0,
|
|
@@ -32,7 +32,7 @@ const Be = (t) => {
|
|
|
32
32
|
onDelete: {}
|
|
33
33
|
},
|
|
34
34
|
setup(t, { expose: d }) {
|
|
35
|
-
const
|
|
35
|
+
const h = M(null), v = $e(), w = ce(), p = M(!1), L = M([]), k = M([]), T = M(null), x = M(!1), u = M(!1), f = M(!1), r = M({}), P = M({
|
|
36
36
|
page: 1,
|
|
37
37
|
itemCount: 0,
|
|
38
38
|
pageSize: 10,
|
|
@@ -47,11 +47,11 @@ const Be = (t) => {
|
|
|
47
47
|
}), o = t, m = (c) => {
|
|
48
48
|
const e = (l) => {
|
|
49
49
|
const n = [];
|
|
50
|
-
return c && c.forEach((
|
|
51
|
-
|
|
52
|
-
label:
|
|
53
|
-
key:
|
|
54
|
-
props: { onClick: () =>
|
|
50
|
+
return c && c.forEach((C) => {
|
|
51
|
+
C.key !== "edit" && C.key !== "delete" && n.push({
|
|
52
|
+
label: C.name,
|
|
53
|
+
key: C.key,
|
|
54
|
+
props: { onClick: () => C.action(l) }
|
|
55
55
|
});
|
|
56
56
|
}), n;
|
|
57
57
|
};
|
|
@@ -87,7 +87,7 @@ const Be = (t) => {
|
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
|
-
},
|
|
90
|
+
}, g = H(() => {
|
|
91
91
|
const c = o.columns.filter((l) => l.key != "action").map((l) => ({
|
|
92
92
|
title: l.title,
|
|
93
93
|
key: l.key,
|
|
@@ -108,11 +108,11 @@ const Be = (t) => {
|
|
|
108
108
|
await W();
|
|
109
109
|
}, D = (c) => {
|
|
110
110
|
S([c]);
|
|
111
|
-
},
|
|
111
|
+
}, O = () => {
|
|
112
112
|
const c = Y();
|
|
113
113
|
S(c);
|
|
114
114
|
}, S = (c) => {
|
|
115
|
-
c && c.length > 0 &&
|
|
115
|
+
c && c.length > 0 && v.warning({
|
|
116
116
|
title: "警告",
|
|
117
117
|
content: "删除数据不可恢复, 确认删除吗?",
|
|
118
118
|
positiveText: "确定",
|
|
@@ -120,9 +120,9 @@ const Be = (t) => {
|
|
|
120
120
|
onPositiveClick: async () => {
|
|
121
121
|
if (o.onDelete)
|
|
122
122
|
try {
|
|
123
|
-
await o.onDelete(c) ? (W(),
|
|
123
|
+
await o.onDelete(c) ? (W(), w.success("删除成功")) : w.error("删除失败");
|
|
124
124
|
} catch (e) {
|
|
125
|
-
|
|
125
|
+
w.error(e.message);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
});
|
|
@@ -137,35 +137,35 @@ const Be = (t) => {
|
|
|
137
137
|
try {
|
|
138
138
|
f.value = !0, (x.value ? await o.onSave(void 0, X(o.item)) : await o.onSave(T.value[o.idField], X(o.item))) && (K(), await W());
|
|
139
139
|
} catch (c) {
|
|
140
|
-
|
|
140
|
+
w.error(c.message);
|
|
141
141
|
} finally {
|
|
142
142
|
f.value = !1;
|
|
143
143
|
}
|
|
144
144
|
}, le = async (c, e) => {
|
|
145
145
|
o.onOpenModal?.(c), await e?.(), c ? (x.value = !1, u.value = !0) : (u.value = !1, x.value = !0);
|
|
146
146
|
}, K = () => {
|
|
147
|
-
T.value = null, Be(o.item), Object.assign(o.item, { ...X(
|
|
148
|
-
}, Y = () => L.value ?
|
|
149
|
-
if (!
|
|
150
|
-
|
|
147
|
+
T.value = null, Be(o.item), Object.assign(o.item, { ...X(r.value) }), o.onCloseModal?.(o.item), x.value = !1, u.value = !1;
|
|
148
|
+
}, Y = () => L.value ? k.value.filter((e) => L.value.includes(e.id)).map((e) => X(e)) : [], fe = () => Y()[0], pe = () => X(k.value), W = async () => {
|
|
149
|
+
if (!p.value) {
|
|
150
|
+
p.value = !0;
|
|
151
151
|
try {
|
|
152
152
|
if (o.onLoad) {
|
|
153
153
|
var { data: c, total: e } = await o.onLoad(
|
|
154
154
|
P.value.page,
|
|
155
155
|
P.value.pageSize
|
|
156
156
|
);
|
|
157
|
-
|
|
157
|
+
k.value = c, P.value.itemCount = e;
|
|
158
158
|
}
|
|
159
159
|
} catch (l) {
|
|
160
|
-
|
|
160
|
+
w.error(l.message);
|
|
161
161
|
} finally {
|
|
162
|
-
|
|
162
|
+
p.value = !1;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
}, ge = H(() => {
|
|
166
|
-
const c = a(
|
|
166
|
+
const c = a(h);
|
|
167
167
|
if (!c) return;
|
|
168
|
-
const e = c?.$el, l = e.querySelector(".n-data-table-thead "), { bottomIncludeBody: n } = Z(l),
|
|
168
|
+
const e = c?.$el, l = e.querySelector(".n-data-table-thead "), { bottomIncludeBody: n } = Z(l), C = 64;
|
|
169
169
|
let E = 2, R = 24;
|
|
170
170
|
const j = e.querySelector(
|
|
171
171
|
".n-data-table__pagination"
|
|
@@ -175,14 +175,14 @@ const Be = (t) => {
|
|
|
175
175
|
E += me || 0;
|
|
176
176
|
} else
|
|
177
177
|
E += 28;
|
|
178
|
-
return n - (
|
|
178
|
+
return n - (C + E + R);
|
|
179
179
|
}), ne = (c) => !c || !c.getBoundingClientRect ? 0 : c.getBoundingClientRect(), Z = (c) => {
|
|
180
|
-
const e = document.documentElement, l = e.scrollLeft, n = e.scrollTop,
|
|
180
|
+
const e = document.documentElement, l = e.scrollLeft, n = e.scrollTop, C = e.clientLeft, E = e.clientTop, R = window.pageXOffset, j = window.pageYOffset, se = ne(c), {
|
|
181
181
|
left: me,
|
|
182
182
|
top: We,
|
|
183
183
|
width: He,
|
|
184
184
|
height: Ue
|
|
185
|
-
} = se, Fe = (R || l) - (
|
|
185
|
+
} = se, Fe = (R || l) - (C || 0), je = (j || n) - (E || 0), qe = me + R, Ve = We + j, ve = qe - Fe, _e = Ve - je, Pe = window.document.documentElement.clientWidth, Se = window.document.documentElement.clientHeight;
|
|
186
186
|
return {
|
|
187
187
|
left: ve,
|
|
188
188
|
top: _e,
|
|
@@ -192,7 +192,7 @@ const Be = (t) => {
|
|
|
192
192
|
bottomIncludeBody: Se - _e
|
|
193
193
|
};
|
|
194
194
|
}, he = () => {
|
|
195
|
-
|
|
195
|
+
r.value = { ...X(o.item) };
|
|
196
196
|
};
|
|
197
197
|
return ee(async () => {
|
|
198
198
|
he(), await W();
|
|
@@ -206,7 +206,7 @@ const Be = (t) => {
|
|
|
206
206
|
P.value.page = 1;
|
|
207
207
|
}
|
|
208
208
|
}), (c, e) => {
|
|
209
|
-
const l = Ne, n = Ye,
|
|
209
|
+
const l = Ne, n = Ye, C = Me, E = Oe;
|
|
210
210
|
return y(), $(a(Ke), {
|
|
211
211
|
title: " ",
|
|
212
212
|
"header-class": "p-4",
|
|
@@ -219,13 +219,13 @@ const Be = (t) => {
|
|
|
219
219
|
trigger: "hover"
|
|
220
220
|
}, {
|
|
221
221
|
trigger: s(() => [
|
|
222
|
-
|
|
222
|
+
i(a(N), {
|
|
223
223
|
size: "18",
|
|
224
224
|
class: "mr-1 cursor-pointer hover:text-blue-600",
|
|
225
225
|
onClick: J
|
|
226
226
|
}, {
|
|
227
227
|
default: s(() => [
|
|
228
|
-
|
|
228
|
+
i(a(yt))
|
|
229
229
|
]),
|
|
230
230
|
_: 1
|
|
231
231
|
})
|
|
@@ -241,13 +241,13 @@ const Be = (t) => {
|
|
|
241
241
|
trigger: "hover"
|
|
242
242
|
}, {
|
|
243
243
|
trigger: s(() => [
|
|
244
|
-
|
|
244
|
+
i(a(N), {
|
|
245
245
|
size: "18",
|
|
246
246
|
class: "mr-1 cursor-pointer hover:text-blue-600",
|
|
247
|
-
onClick:
|
|
247
|
+
onClick: O
|
|
248
248
|
}, {
|
|
249
249
|
default: s(() => [
|
|
250
|
-
|
|
250
|
+
i(a(wt))
|
|
251
251
|
]),
|
|
252
252
|
_: 1
|
|
253
253
|
})
|
|
@@ -258,15 +258,15 @@ const Be = (t) => {
|
|
|
258
258
|
_: 1,
|
|
259
259
|
__: [4]
|
|
260
260
|
})),
|
|
261
|
-
|
|
261
|
+
i(l, { trigger: "hover" }, {
|
|
262
262
|
trigger: s(() => [
|
|
263
|
-
|
|
263
|
+
i(a(N), {
|
|
264
264
|
size: "18",
|
|
265
265
|
class: "cursor-pointer hover:text-blue-600",
|
|
266
266
|
onClick: _
|
|
267
267
|
}, {
|
|
268
268
|
default: s(() => [
|
|
269
|
-
|
|
269
|
+
i(a(we))
|
|
270
270
|
]),
|
|
271
271
|
_: 1
|
|
272
272
|
})
|
|
@@ -283,23 +283,23 @@ const Be = (t) => {
|
|
|
283
283
|
c.$slots.toolbar ? (y(), B("div", zt, [
|
|
284
284
|
U(c.$slots, "toolbar")
|
|
285
285
|
])) : A("", !0),
|
|
286
|
-
|
|
286
|
+
i(n, {
|
|
287
287
|
remote: "",
|
|
288
288
|
ref_key: "$table",
|
|
289
|
-
ref:
|
|
289
|
+
ref: h,
|
|
290
290
|
"checked-row-keys": L.value,
|
|
291
291
|
"onUpdate:checkedRowKeys": e[0] || (e[0] = (R) => L.value = R),
|
|
292
292
|
"max-height": ge.value,
|
|
293
|
-
loading:
|
|
293
|
+
loading: p.value,
|
|
294
294
|
bordered: !1,
|
|
295
295
|
"single-line": !1,
|
|
296
|
-
columns:
|
|
297
|
-
data:
|
|
296
|
+
columns: g.value,
|
|
297
|
+
data: k.value,
|
|
298
298
|
pagination: P.value,
|
|
299
299
|
"row-key": (R) => R[c.idField]
|
|
300
300
|
}, null, 8, ["checked-row-keys", "max-height", "loading", "columns", "data", "pagination", "row-key"]),
|
|
301
301
|
c.$slots.addModal ? (y(), B("div", At, [
|
|
302
|
-
|
|
302
|
+
i(E, {
|
|
303
303
|
title: "新增",
|
|
304
304
|
preset: "card",
|
|
305
305
|
show: x.value,
|
|
@@ -308,12 +308,13 @@ const Be = (t) => {
|
|
|
308
308
|
closable: !1,
|
|
309
309
|
"close-on-esc": !1,
|
|
310
310
|
"mask-closable": !1,
|
|
311
|
-
|
|
311
|
+
draggable: !0,
|
|
312
|
+
style: ie({ width: `${c.modalWidth}px` })
|
|
312
313
|
}, {
|
|
313
314
|
action: s(() => [
|
|
314
|
-
|
|
315
|
+
i(C, { justify: "end" }, {
|
|
315
316
|
default: s(() => [
|
|
316
|
-
|
|
317
|
+
i(a(q), {
|
|
317
318
|
type: "primary",
|
|
318
319
|
loading: f.value,
|
|
319
320
|
onClick: oe
|
|
@@ -324,7 +325,7 @@ const Be = (t) => {
|
|
|
324
325
|
_: 1,
|
|
325
326
|
__: [6]
|
|
326
327
|
}, 8, ["loading"]),
|
|
327
|
-
|
|
328
|
+
i(a(q), { onClick: K }, {
|
|
328
329
|
default: s(() => e[7] || (e[7] = [
|
|
329
330
|
V("取消", -1)
|
|
330
331
|
])),
|
|
@@ -342,7 +343,7 @@ const Be = (t) => {
|
|
|
342
343
|
}, 8, ["show", "style"])
|
|
343
344
|
])) : A("", !0),
|
|
344
345
|
c.$slots.editModal ? (y(), B("div", Bt, [
|
|
345
|
-
|
|
346
|
+
i(E, {
|
|
346
347
|
title: "编辑",
|
|
347
348
|
show: u.value,
|
|
348
349
|
"onUpdate:show": e[2] || (e[2] = (R) => u.value = R),
|
|
@@ -351,12 +352,13 @@ const Be = (t) => {
|
|
|
351
352
|
closable: !1,
|
|
352
353
|
"close-on-esc": !1,
|
|
353
354
|
"mask-closable": !1,
|
|
354
|
-
|
|
355
|
+
draggable: !0,
|
|
356
|
+
style: ie({ width: `${c.modalWidth}px` })
|
|
355
357
|
}, {
|
|
356
358
|
action: s(() => [
|
|
357
|
-
|
|
359
|
+
i(C, { justify: "end" }, {
|
|
358
360
|
default: s(() => [
|
|
359
|
-
|
|
361
|
+
i(a(q), {
|
|
360
362
|
type: "primary",
|
|
361
363
|
loading: f.value,
|
|
362
364
|
onClick: oe
|
|
@@ -367,7 +369,7 @@ const Be = (t) => {
|
|
|
367
369
|
_: 1,
|
|
368
370
|
__: [8]
|
|
369
371
|
}, 8, ["loading"]),
|
|
370
|
-
|
|
372
|
+
i(a(q), { onClick: K }, {
|
|
371
373
|
default: s(() => e[9] || (e[9] = [
|
|
372
374
|
V("取消", -1)
|
|
373
375
|
])),
|
|
@@ -392,8 +394,8 @@ const Be = (t) => {
|
|
|
392
394
|
}
|
|
393
395
|
}), te = (t) => {
|
|
394
396
|
const d = t;
|
|
395
|
-
return d.install = function(
|
|
396
|
-
|
|
397
|
+
return d.install = function(h) {
|
|
398
|
+
h.component(d.__name, t);
|
|
397
399
|
}, t;
|
|
398
400
|
}, Wt = te(It), Ht = ["Redirect", "RedirectSon", "login"], ae = Ae("p-layout", () => {
|
|
399
401
|
const t = Re({
|
|
@@ -409,14 +411,14 @@ const Be = (t) => {
|
|
|
409
411
|
return {
|
|
410
412
|
state: t,
|
|
411
413
|
initTabs: (o) => {
|
|
412
|
-
o.sort((m,
|
|
414
|
+
o.sort((m, g) => (g.meta.affix ? 1 : 0) - (m.meta.affix ? 1 : 0)), t.tabs = o;
|
|
413
415
|
},
|
|
414
416
|
addTab: (o) => Ht.includes(o.name) ? !1 : (t.tabs?.some(
|
|
415
|
-
(
|
|
417
|
+
(g) => g.fullPath == o.fullPath
|
|
416
418
|
) || t.tabs?.push(o), !0),
|
|
417
419
|
closeCurrentTab: (o) => {
|
|
418
420
|
const m = t.tabs.findIndex(
|
|
419
|
-
(
|
|
421
|
+
(g) => g.fullPath == o.fullPath
|
|
420
422
|
);
|
|
421
423
|
t.tabs.splice(m, 1);
|
|
422
424
|
},
|
|
@@ -430,18 +432,18 @@ const Be = (t) => {
|
|
|
430
432
|
},
|
|
431
433
|
closeLeftTabs: (o) => {
|
|
432
434
|
const m = t.tabs.findIndex(
|
|
433
|
-
(
|
|
435
|
+
(g) => g.fullPath == o.fullPath
|
|
434
436
|
);
|
|
435
437
|
t.tabs = t.tabs.filter(
|
|
436
|
-
(
|
|
438
|
+
(g, _) => _ >= m || (g?.meta?.affix ?? !1)
|
|
437
439
|
);
|
|
438
440
|
},
|
|
439
441
|
closeRightTabs: (o) => {
|
|
440
442
|
const m = t.tabs.findIndex(
|
|
441
|
-
(
|
|
443
|
+
(g) => g.fullPath == o.fullPath
|
|
442
444
|
);
|
|
443
445
|
t.tabs = t.tabs.filter(
|
|
444
|
-
(
|
|
446
|
+
(g, _) => _ <= m || (g?.meta?.affix ?? !1)
|
|
445
447
|
);
|
|
446
448
|
},
|
|
447
449
|
collapse: () => {
|
|
@@ -467,8 +469,8 @@ const Be = (t) => {
|
|
|
467
469
|
__name: "PLogo",
|
|
468
470
|
setup(t) {
|
|
469
471
|
const d = ae();
|
|
470
|
-
return (
|
|
471
|
-
|
|
472
|
+
return (h, v) => (y(), B("div", Ut, [
|
|
473
|
+
i(a(Ee), {
|
|
472
474
|
color: "var(--color-logo)",
|
|
473
475
|
size: 32,
|
|
474
476
|
src: a(d).state.logo,
|
|
@@ -480,10 +482,10 @@ const Be = (t) => {
|
|
|
480
482
|
]));
|
|
481
483
|
}
|
|
482
484
|
}), de = (t, d) => {
|
|
483
|
-
const
|
|
484
|
-
for (const [
|
|
485
|
-
|
|
486
|
-
return
|
|
485
|
+
const h = t.__vccOpts || t;
|
|
486
|
+
for (const [v, w] of d)
|
|
487
|
+
h[v] = w;
|
|
488
|
+
return h;
|
|
487
489
|
}, jt = /* @__PURE__ */ de(Ft, [["__scopeId", "data-v-c9496d2e"]]), qt = {
|
|
488
490
|
translationApiUrl: "https://translate.zvo.cn/api",
|
|
489
491
|
defaultLanguage: "chinese",
|
|
@@ -494,25 +496,25 @@ const Be = (t) => {
|
|
|
494
496
|
initLanguage: (t) => {
|
|
495
497
|
}
|
|
496
498
|
}, Vt = Ae("language", () => {
|
|
497
|
-
const t =
|
|
499
|
+
const t = M(qt), d = (u) => {
|
|
498
500
|
u.forEach((f) => {
|
|
499
501
|
(f.key === "Chinese" || f.key === "chinese") && (f.key = "chinese_simplified");
|
|
500
502
|
}), t.value.options = [...u];
|
|
501
|
-
},
|
|
503
|
+
}, h = () => t.value.options, v = (u) => {
|
|
502
504
|
if (t.value.currentLanguage === u)
|
|
503
505
|
return;
|
|
504
506
|
const f = t.value.options.find(
|
|
505
|
-
(
|
|
507
|
+
(r) => r.key === u
|
|
506
508
|
);
|
|
507
509
|
f && (t.value.currentLanguage = f.key, t.value.selectCallback(f));
|
|
508
|
-
},
|
|
510
|
+
}, w = () => {
|
|
509
511
|
if (t.value.currentLanguage)
|
|
510
512
|
return t.value.options.find(
|
|
511
513
|
(u) => u.key === t.value.currentLanguage
|
|
512
514
|
);
|
|
513
|
-
},
|
|
515
|
+
}, p = (u) => {
|
|
514
516
|
t.value.selectCallback = u;
|
|
515
|
-
}, L = () => t.value.translationApiUrl,
|
|
517
|
+
}, L = () => t.value.translationApiUrl, k = (u) => {
|
|
516
518
|
t.value.translationApiUrl = u;
|
|
517
519
|
}, T = (u) => {
|
|
518
520
|
(u === "Chinese" || u === "chinese") && (u = "chinese_simplified"), t.value.defaultLanguage = u;
|
|
@@ -521,12 +523,12 @@ const Be = (t) => {
|
|
|
521
523
|
t.value.initLanguage(t.value);
|
|
522
524
|
}), {
|
|
523
525
|
state: t,
|
|
524
|
-
select:
|
|
526
|
+
select: v,
|
|
525
527
|
setLanguages: d,
|
|
526
|
-
getLanguages:
|
|
527
|
-
getCurrentLanguage:
|
|
528
|
-
setSelectCallback:
|
|
529
|
-
setTranslationApiUrl:
|
|
528
|
+
getLanguages: h,
|
|
529
|
+
getCurrentLanguage: w,
|
|
530
|
+
setSelectCallback: p,
|
|
531
|
+
setTranslationApiUrl: k,
|
|
530
532
|
getTranslationApiUrl: L,
|
|
531
533
|
setDefaultLanguage: T,
|
|
532
534
|
getDefaultLanguage: x
|
|
@@ -536,31 +538,31 @@ const Be = (t) => {
|
|
|
536
538
|
setup(t) {
|
|
537
539
|
const {
|
|
538
540
|
select: d,
|
|
539
|
-
getLanguages:
|
|
540
|
-
getCurrentLanguage:
|
|
541
|
-
getDefaultLanguage:
|
|
542
|
-
getTranslationApiUrl:
|
|
543
|
-
} = Vt(), L = (T) => d(T),
|
|
544
|
-
window.translate && (window.translate.selectLanguageTag.show = !1, window.translate.selectLanguageTag.languages =
|
|
541
|
+
getLanguages: h,
|
|
542
|
+
getCurrentLanguage: v,
|
|
543
|
+
getDefaultLanguage: w,
|
|
544
|
+
getTranslationApiUrl: p
|
|
545
|
+
} = Vt(), L = (T) => d(T), k = () => {
|
|
546
|
+
window.translate && (window.translate.selectLanguageTag.show = !1, window.translate.selectLanguageTag.languages = h().map((T) => T.key).join(","), window.translate.ignore.class.push("ignore-translate-flag"), window.translate.ignore.id.push("ignore-translation"), window.translate.language.setLocal(w()), window.translate.request.api.translate = "api/v1/translation", window.translate.request.api.connectTest = "api/v1/translation/connect-test", window.translate.request.api.init = "api/v1/translation/init", window.translate.request.api.language = "api/v1/translation/language", window.translate.request.setHost(p()), window.translate.request.listener.start(), window.translate.listener.start(), window.translate.whole.enableAll(), window.translate.execute());
|
|
545
547
|
};
|
|
546
|
-
return ee(async () => await
|
|
548
|
+
return ee(async () => await re(() => k())), (T, x) => {
|
|
547
549
|
const u = N, f = q;
|
|
548
|
-
return a(
|
|
550
|
+
return a(h)().length > 0 ? (y(), $(a(G), {
|
|
549
551
|
key: 0,
|
|
550
552
|
id: "ignore-translation",
|
|
551
553
|
placement: "bottom-start",
|
|
552
554
|
trigger: "hover",
|
|
553
555
|
class: "flex flex-col justify-center h-full ignore",
|
|
554
556
|
onSelect: L,
|
|
555
|
-
options: a(
|
|
557
|
+
options: a(h)()
|
|
556
558
|
}, {
|
|
557
559
|
default: s(() => [
|
|
558
|
-
|
|
560
|
+
i(f, {
|
|
559
561
|
quaternary: "",
|
|
560
562
|
type: "info"
|
|
561
563
|
}, {
|
|
562
564
|
default: s(() => [
|
|
563
|
-
a(
|
|
565
|
+
a(v)() ? (y(), B("label", Kt, F(a(v)()?.label), 1)) : (y(), $(u, {
|
|
564
566
|
key: 0,
|
|
565
567
|
size: "18"
|
|
566
568
|
}, {
|
|
@@ -597,29 +599,29 @@ const Be = (t) => {
|
|
|
597
599
|
}, Zt = { class: "layout-header-right" }, Qt = { class: "layout-header-trigger-min" }, ea = { class: "layout-header-trigger layout-header-trigger-min" }, ta = { class: "layout-header-trigger layout-header-trigger-min" }, aa = { class: "avatar" }, oa = /* @__PURE__ */ I({
|
|
598
600
|
__name: "PHeader",
|
|
599
601
|
setup(t) {
|
|
600
|
-
const d = ce(),
|
|
602
|
+
const d = ce(), h = $e(), v = ae(), w = ke(), p = Ce(), L = De("reloadPage"), k = (m) => w.push({ name: m }), T = H(() => x(p.matched)), x = (m) => m.map((g) => {
|
|
601
603
|
const _ = {
|
|
602
|
-
key:
|
|
603
|
-
label:
|
|
604
|
-
icon:
|
|
605
|
-
meta:
|
|
606
|
-
disabled:
|
|
604
|
+
key: g.name,
|
|
605
|
+
label: g.meta.title,
|
|
606
|
+
icon: g.meta.icon,
|
|
607
|
+
meta: g.meta,
|
|
608
|
+
disabled: g.path === "/",
|
|
607
609
|
children: void 0
|
|
608
610
|
};
|
|
609
|
-
return
|
|
610
|
-
|
|
611
|
+
return g.children && g.children.length > 0 && (_.children = x(
|
|
612
|
+
g.children
|
|
611
613
|
)), _;
|
|
612
|
-
}), u =
|
|
614
|
+
}), u = M(!1), f = () => {
|
|
613
615
|
document.fullscreenElement ? document.exitFullscreen && (document.exitFullscreen(), u.value = !1) : (document.documentElement.requestFullscreen(), u.value = !0);
|
|
614
|
-
},
|
|
616
|
+
}, r = H(() => {
|
|
615
617
|
const m = [];
|
|
616
618
|
return m.push({
|
|
617
619
|
label: "退出登录",
|
|
618
620
|
key: "logout"
|
|
619
|
-
}),
|
|
621
|
+
}), v.state.settingPages && v.state.settingPages.length > 0 && v.state.settingPages.forEach((g) => {
|
|
620
622
|
m.push({
|
|
621
|
-
label:
|
|
622
|
-
key:
|
|
623
|
+
label: g.title,
|
|
624
|
+
key: g.route
|
|
623
625
|
});
|
|
624
626
|
}), m;
|
|
625
627
|
}), P = (m) => {
|
|
@@ -628,18 +630,18 @@ const Be = (t) => {
|
|
|
628
630
|
o();
|
|
629
631
|
break;
|
|
630
632
|
default:
|
|
631
|
-
|
|
633
|
+
w.push({ name: m });
|
|
632
634
|
}
|
|
633
635
|
}, o = () => {
|
|
634
|
-
|
|
636
|
+
h.info({
|
|
635
637
|
title: "提示",
|
|
636
638
|
content: "您确定要退出登录吗",
|
|
637
639
|
positiveText: "确定",
|
|
638
640
|
negativeText: "取消",
|
|
639
641
|
onPositiveClick: async () => {
|
|
640
|
-
if (
|
|
642
|
+
if (v.state.logout)
|
|
641
643
|
try {
|
|
642
|
-
await
|
|
644
|
+
await v.state.logout(), localStorage.removeItem("TABS-ROUTES"), d.error("退出成功");
|
|
643
645
|
} catch (m) {
|
|
644
646
|
console.error(m), d.error("退出登录失败");
|
|
645
647
|
} finally {
|
|
@@ -652,21 +654,21 @@ const Be = (t) => {
|
|
|
652
654
|
}
|
|
653
655
|
});
|
|
654
656
|
};
|
|
655
|
-
return (m,
|
|
656
|
-
const _ = Ne, D = Je,
|
|
657
|
+
return (m, g) => {
|
|
658
|
+
const _ = Ne, D = Je, O = Ee;
|
|
657
659
|
return y(), B("div", Yt, [
|
|
658
660
|
b("div", Xt, [
|
|
659
661
|
b("div", {
|
|
660
662
|
class: "ml-1 layout-header-trigger layout-header-trigger-min",
|
|
661
|
-
onClick:
|
|
662
|
-
(...S) => a(
|
|
663
|
+
onClick: g[0] || (g[0] = //@ts-ignore
|
|
664
|
+
(...S) => a(v).collapse && a(v).collapse(...S))
|
|
663
665
|
}, [
|
|
664
|
-
a(
|
|
666
|
+
a(v).state.collapsed ? (y(), $(a(N), {
|
|
665
667
|
key: 0,
|
|
666
668
|
size: "18"
|
|
667
669
|
}, {
|
|
668
670
|
default: s(() => [
|
|
669
|
-
|
|
671
|
+
i(a(Ct))
|
|
670
672
|
]),
|
|
671
673
|
_: 1
|
|
672
674
|
})) : (y(), $(a(N), {
|
|
@@ -674,24 +676,24 @@ const Be = (t) => {
|
|
|
674
676
|
size: "18"
|
|
675
677
|
}, {
|
|
676
678
|
default: s(() => [
|
|
677
|
-
|
|
679
|
+
i(a(Pt))
|
|
678
680
|
]),
|
|
679
681
|
_: 1
|
|
680
682
|
}))
|
|
681
683
|
]),
|
|
682
684
|
b("div", {
|
|
683
685
|
class: "mr-1 layout-header-trigger layout-header-trigger-min",
|
|
684
|
-
onClick:
|
|
686
|
+
onClick: g[1] || (g[1] = //@ts-ignore
|
|
685
687
|
(...S) => a(L) && a(L)(...S))
|
|
686
688
|
}, [
|
|
687
|
-
|
|
689
|
+
i(a(N), { size: "18" }, {
|
|
688
690
|
default: s(() => [
|
|
689
|
-
|
|
691
|
+
i(a(we))
|
|
690
692
|
]),
|
|
691
693
|
_: 1
|
|
692
694
|
})
|
|
693
695
|
]),
|
|
694
|
-
|
|
696
|
+
i(a(Xe), null, {
|
|
695
697
|
default: s(() => [
|
|
696
698
|
(y(!0), B(Te, null, gt(T.value, (S) => (y(), B(Te, {
|
|
697
699
|
key: S.label
|
|
@@ -701,7 +703,7 @@ const Be = (t) => {
|
|
|
701
703
|
S.children && S.children.length ? (y(), $(a(G), {
|
|
702
704
|
key: 0,
|
|
703
705
|
options: S.children,
|
|
704
|
-
onSelect:
|
|
706
|
+
onSelect: k
|
|
705
707
|
}, {
|
|
706
708
|
default: s(() => [
|
|
707
709
|
b("span", Gt, [
|
|
@@ -724,12 +726,12 @@ const Be = (t) => {
|
|
|
724
726
|
]),
|
|
725
727
|
b("div", Zt, [
|
|
726
728
|
b("div", Qt, [
|
|
727
|
-
|
|
729
|
+
i(Ie)
|
|
728
730
|
]),
|
|
729
731
|
b("div", ea, [
|
|
730
|
-
|
|
732
|
+
i(_, { placement: "bottom" }, {
|
|
731
733
|
trigger: s(() => [
|
|
732
|
-
|
|
734
|
+
i(a(N), {
|
|
733
735
|
size: "18",
|
|
734
736
|
onClick: ye(f, ["stop"])
|
|
735
737
|
}, {
|
|
@@ -740,25 +742,25 @@ const Be = (t) => {
|
|
|
740
742
|
})
|
|
741
743
|
]),
|
|
742
744
|
default: s(() => [
|
|
743
|
-
|
|
745
|
+
g[2] || (g[2] = b("span", null, "全屏", -1))
|
|
744
746
|
]),
|
|
745
747
|
_: 1,
|
|
746
748
|
__: [2]
|
|
747
749
|
})
|
|
748
750
|
]),
|
|
749
751
|
b("div", ta, [
|
|
750
|
-
|
|
752
|
+
i(a(G), {
|
|
751
753
|
trigger: "hover",
|
|
752
754
|
onSelect: P,
|
|
753
|
-
options:
|
|
755
|
+
options: r.value
|
|
754
756
|
}, {
|
|
755
757
|
default: s(() => [
|
|
756
758
|
b("div", aa, [
|
|
757
|
-
b("span", null, F(a(
|
|
758
|
-
|
|
759
|
-
|
|
759
|
+
b("span", null, F(a(v).state.uname), 1),
|
|
760
|
+
i(D, { vertical: "" }),
|
|
761
|
+
i(O, {
|
|
760
762
|
round: "",
|
|
761
|
-
src: a(
|
|
763
|
+
src: a(v).state.avatar
|
|
762
764
|
}, null, 8, ["src"])
|
|
763
765
|
])
|
|
764
766
|
]),
|
|
@@ -775,14 +777,14 @@ const Be = (t) => {
|
|
|
775
777
|
loading: { type: Boolean, default: !1 }
|
|
776
778
|
},
|
|
777
779
|
setup(t) {
|
|
778
|
-
return (d,
|
|
779
|
-
const
|
|
780
|
+
return (d, h) => {
|
|
781
|
+
const v = ht("RouterView");
|
|
780
782
|
return y(), B("div", na, [
|
|
781
|
-
d.loading ? A("", !0) : (y(), $(
|
|
782
|
-
default: s(({ Component:
|
|
783
|
+
d.loading ? A("", !0) : (y(), $(v, { key: 0 }, {
|
|
784
|
+
default: s(({ Component: w, route: p }) => [
|
|
783
785
|
(y(), $(mt, null, [
|
|
784
|
-
(y(), $(be(
|
|
785
|
-
key:
|
|
786
|
+
(y(), $(be(w), {
|
|
787
|
+
key: p.fullPath
|
|
786
788
|
}))
|
|
787
789
|
], 1024))
|
|
788
790
|
]),
|
|
@@ -791,15 +793,15 @@ const Be = (t) => {
|
|
|
791
793
|
]);
|
|
792
794
|
};
|
|
793
795
|
}
|
|
794
|
-
}),
|
|
796
|
+
}), ia = { class: "tabs-view-main" }, ra = ["id", "onClick", "onContextmenu"], ca = { class: "tabs-close" }, da = { class: "tabs-close-btn" }, ua = /* @__PURE__ */ I({
|
|
795
797
|
__name: "PTabs",
|
|
796
798
|
setup(t) {
|
|
797
799
|
vt((e) => ({
|
|
798
|
-
"4cb4fdc8":
|
|
799
|
-
"21e8bab2":
|
|
800
|
+
"4cb4fdc8": h.value,
|
|
801
|
+
"21e8bab2": v.value
|
|
800
802
|
}));
|
|
801
|
-
const d = Ze(),
|
|
802
|
-
activeKey:
|
|
803
|
+
const d = Ze(), h = H(() => d.value.cardColor), v = H(() => d.value.textColor1), w = ce(), p = Ce(), L = ke(), k = M(null), T = M(null), x = M(!1), u = ae(), f = H(() => u.state.tabs), r = Re({
|
|
804
|
+
activeKey: p.fullPath,
|
|
803
805
|
scrollable: !0,
|
|
804
806
|
dropdownX: 0,
|
|
805
807
|
dropdownY: 0,
|
|
@@ -807,15 +809,15 @@ const Be = (t) => {
|
|
|
807
809
|
isMultiHeaderFixed: !0,
|
|
808
810
|
multiTabsSetting: !0
|
|
809
811
|
}), P = ["Login", "Redirect", "ErrorPage"], o = (e) => {
|
|
810
|
-
const { fullPath: l, hash: n, meta:
|
|
811
|
-
return { fullPath: l, hash: n, meta:
|
|
812
|
+
const { fullPath: l, hash: n, meta: C, name: E, params: R, path: j, query: se } = e;
|
|
813
|
+
return { fullPath: l, hash: n, meta: C, name: E, params: R, path: j, query: se };
|
|
812
814
|
}, m = H(() => {
|
|
813
815
|
const n = u.state.collapsed ? "64px" : "272px";
|
|
814
816
|
return {
|
|
815
817
|
left: n,
|
|
816
818
|
width: `calc(100% - ${n})`
|
|
817
819
|
};
|
|
818
|
-
}),
|
|
820
|
+
}), g = H(() => {
|
|
819
821
|
const e = f.value.length <= 1;
|
|
820
822
|
return [
|
|
821
823
|
{
|
|
@@ -844,7 +846,7 @@ const Be = (t) => {
|
|
|
844
846
|
];
|
|
845
847
|
}), _ = () => {
|
|
846
848
|
let e = [];
|
|
847
|
-
const l = o(
|
|
849
|
+
const l = o(p);
|
|
848
850
|
try {
|
|
849
851
|
if (u.state.cacheTabs) {
|
|
850
852
|
const n = localStorage.getItem("TABS_ROUTES");
|
|
@@ -858,48 +860,48 @@ const Be = (t) => {
|
|
|
858
860
|
}, D = (e) => {
|
|
859
861
|
const l = L.getRoutes();
|
|
860
862
|
e.forEach((n) => {
|
|
861
|
-
const
|
|
862
|
-
|
|
863
|
+
const C = l.find((E) => E.path === n.path);
|
|
864
|
+
C && (n.meta = C.meta || n.meta, n.name = C.name || n.name);
|
|
863
865
|
}), u.state.cacheTabs && localStorage.setItem("TABS_ROUTES", JSON.stringify(e));
|
|
864
|
-
},
|
|
866
|
+
}, O = () => {
|
|
865
867
|
const e = _();
|
|
866
868
|
D(e), u.initTabs(e);
|
|
867
869
|
}, S = async (e) => {
|
|
868
|
-
if (await
|
|
869
|
-
const l =
|
|
870
|
-
l < n ? (
|
|
871
|
-
E.id === `tag${
|
|
872
|
-
})) :
|
|
870
|
+
if (await re(), !k.value) return;
|
|
871
|
+
const l = k.value.offsetWidth, n = k.value.scrollWidth;
|
|
872
|
+
l < n ? (r.scrollable = !0, e && [...k.value.querySelectorAll(".tabs-card-scroll-item") || []].forEach((E) => {
|
|
873
|
+
E.id === `tag${r.activeKey.split("/").join("/")}` && E.scrollIntoView && E.scrollIntoView();
|
|
874
|
+
})) : r.scrollable = !1;
|
|
873
875
|
}, J = (e) => !(e.draggedContext.element.meta.affix || e.relatedContext.element.meta.affix), ue = () => {
|
|
874
876
|
let e;
|
|
875
877
|
e = Et(), e.listenTo(T.value, () => S(!0));
|
|
876
878
|
}, oe = (e) => {
|
|
877
879
|
const { fullPath: l } = e;
|
|
878
|
-
if (l ===
|
|
880
|
+
if (l === p.fullPath || (r.activeKey = l, !e))
|
|
879
881
|
return;
|
|
880
882
|
const { replace: n } = L;
|
|
881
883
|
toString.call(e), n(e).catch(console.error);
|
|
882
884
|
}, le = (e, l) => {
|
|
883
|
-
e.preventDefault(), x.value = l.path === "/home",
|
|
884
|
-
|
|
885
|
+
e.preventDefault(), x.value = l.path === "/home", r.showDropdown = !1, re().then(() => {
|
|
886
|
+
r.showDropdown = !0, r.dropdownX = e.clientX, r.dropdownY = e.clientY;
|
|
885
887
|
});
|
|
886
888
|
}, K = () => {
|
|
887
|
-
|
|
888
|
-
(e) => e.name ==
|
|
889
|
+
p.meta.keepAlive && L.currentRoute.value.matched.find(
|
|
890
|
+
(e) => e.name == p.name
|
|
889
891
|
)?.components?.default.name;
|
|
890
892
|
}, Y = (e) => {
|
|
891
893
|
if (f.value.length === 1)
|
|
892
|
-
return
|
|
893
|
-
if (K(), u.closeCurrentTab(e),
|
|
894
|
+
return w.warning("这已经是最后一页,不能再关闭了!");
|
|
895
|
+
if (K(), u.closeCurrentTab(e), r.activeKey === e.fullPath) {
|
|
894
896
|
const l = f.value[Math.max(0, f.value.length - 1)];
|
|
895
|
-
|
|
897
|
+
r.activeKey = l.fullPath, L.push(l);
|
|
896
898
|
}
|
|
897
899
|
S();
|
|
898
900
|
}, fe = (e) => {
|
|
899
|
-
const { fullPath: l } = e, n = f.value.find((
|
|
901
|
+
const { fullPath: l } = e, n = f.value.find((C) => C.fullPath == l);
|
|
900
902
|
Y(n);
|
|
901
903
|
}, pe = (e) => {
|
|
902
|
-
u.closeOtherTabs(e),
|
|
904
|
+
u.closeOtherTabs(e), r.activeKey = e.fullPath, L.replace(e.fullPath), S();
|
|
903
905
|
}, W = () => {
|
|
904
906
|
u.closeAllTabs(), S();
|
|
905
907
|
}, ge = De("reloadPage"), ne = (e) => {
|
|
@@ -910,32 +912,32 @@ const Be = (t) => {
|
|
|
910
912
|
break;
|
|
911
913
|
//关闭
|
|
912
914
|
case "2":
|
|
913
|
-
Y(
|
|
915
|
+
Y(p);
|
|
914
916
|
break;
|
|
915
917
|
//关闭其他
|
|
916
918
|
case "3":
|
|
917
|
-
pe(
|
|
919
|
+
pe(p);
|
|
918
920
|
break;
|
|
919
921
|
//关闭所有
|
|
920
922
|
case "4":
|
|
921
923
|
W();
|
|
922
924
|
break;
|
|
923
925
|
}
|
|
924
|
-
S(),
|
|
926
|
+
S(), r.showDropdown = !1;
|
|
925
927
|
}, Z = (e, l) => {
|
|
926
|
-
const n =
|
|
927
|
-
if (
|
|
928
|
+
const n = k.value.scrollLeft, C = l > 0 && n + l >= e || l < 0 && n + l <= e ? e : n + l;
|
|
929
|
+
if (k.value && k.value.scrollTo(C, 0), C !== e)
|
|
928
930
|
return window.requestAnimationFrame(() => Z(e, l));
|
|
929
931
|
}, he = () => {
|
|
930
|
-
const e =
|
|
932
|
+
const e = k.value.offsetWidth, l = k.value.scrollLeft;
|
|
931
933
|
if (!l) return;
|
|
932
934
|
const n = l > e ? l - e : 0;
|
|
933
935
|
Z(n, (n - l) / 20);
|
|
934
936
|
}, c = () => {
|
|
935
|
-
const e =
|
|
937
|
+
const e = k.value.offsetWidth, l = k.value.scrollWidth, n = k.value.scrollLeft;
|
|
936
938
|
if (l - n <= e) return;
|
|
937
|
-
const
|
|
938
|
-
Z(
|
|
939
|
+
const C = l - n > e * 2 ? n + e : l - e;
|
|
940
|
+
Z(C, (C - n) / 20);
|
|
939
941
|
};
|
|
940
942
|
return window.addEventListener("beforeunload", () => {
|
|
941
943
|
localStorage.setItem("TABS_ROUTES", JSON.stringify(f.value));
|
|
@@ -943,59 +945,59 @@ const Be = (t) => {
|
|
|
943
945
|
"scroll",
|
|
944
946
|
(e) => {
|
|
945
947
|
let l = e.target.scrollTop || document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
|
|
946
|
-
|
|
948
|
+
r.isMultiHeaderFixed = l >= 64;
|
|
947
949
|
},
|
|
948
950
|
!0
|
|
949
951
|
), ze(
|
|
950
|
-
() =>
|
|
952
|
+
() => p.fullPath,
|
|
951
953
|
(e) => {
|
|
952
|
-
P.includes(
|
|
954
|
+
P.includes(p.name) || (r.activeKey = e, u.addTab(o(p)), S(!0));
|
|
953
955
|
},
|
|
954
956
|
{ immediate: !0 }
|
|
955
|
-
),
|
|
957
|
+
), O(), ee(() => ue()), (e, l) => (y(), B("div", {
|
|
956
958
|
class: "box-border tabs-view tabs-view-fix tabs-view-default-background",
|
|
957
|
-
style:
|
|
959
|
+
style: ie(m.value)
|
|
958
960
|
}, [
|
|
959
|
-
b("div",
|
|
961
|
+
b("div", ia, [
|
|
960
962
|
b("div", {
|
|
961
963
|
ref_key: "navWrap",
|
|
962
964
|
ref: T,
|
|
963
|
-
class: Q(["tabs-card", { "tabs-card-scrollable":
|
|
965
|
+
class: Q(["tabs-card", { "tabs-card-scrollable": r.scrollable }])
|
|
964
966
|
}, [
|
|
965
967
|
b("span", {
|
|
966
|
-
class: Q(["tabs-card-prev", { "tabs-card-prev-hide": !
|
|
968
|
+
class: Q(["tabs-card-prev", { "tabs-card-prev-hide": !r.scrollable }]),
|
|
967
969
|
onClick: he
|
|
968
970
|
}, [
|
|
969
|
-
|
|
971
|
+
i(a(N), {
|
|
970
972
|
size: "16",
|
|
971
973
|
color: "#515a6e"
|
|
972
974
|
}, {
|
|
973
975
|
default: s(() => [
|
|
974
|
-
|
|
976
|
+
i(a($t))
|
|
975
977
|
]),
|
|
976
978
|
_: 1
|
|
977
979
|
})
|
|
978
980
|
], 2),
|
|
979
981
|
b("span", {
|
|
980
|
-
class: Q(["tabs-card-next", { "tabs-card-next-hide": !
|
|
982
|
+
class: Q(["tabs-card-next", { "tabs-card-next-hide": !r.scrollable }]),
|
|
981
983
|
onClick: c
|
|
982
984
|
}, [
|
|
983
|
-
|
|
985
|
+
i(a(N), {
|
|
984
986
|
size: "16",
|
|
985
987
|
color: "#515a6e"
|
|
986
988
|
}, {
|
|
987
989
|
default: s(() => [
|
|
988
|
-
|
|
990
|
+
i(a(Ot))
|
|
989
991
|
]),
|
|
990
992
|
_: 1
|
|
991
993
|
})
|
|
992
994
|
], 2),
|
|
993
995
|
b("div", {
|
|
994
996
|
ref_key: "navScroll",
|
|
995
|
-
ref:
|
|
997
|
+
ref: k,
|
|
996
998
|
class: "tabs-card-scroll"
|
|
997
999
|
}, [
|
|
998
|
-
|
|
1000
|
+
i(a(Rt), {
|
|
999
1001
|
list: f.value,
|
|
1000
1002
|
animation: "300",
|
|
1001
1003
|
"item-key": "fullPath",
|
|
@@ -1005,42 +1007,42 @@ const Be = (t) => {
|
|
|
1005
1007
|
item: s(({ element: n }) => [
|
|
1006
1008
|
b("div", {
|
|
1007
1009
|
id: `tag${n.fullPath.split("/").join("/")}`,
|
|
1008
|
-
class: Q(["tabs-card-scroll-item", { "active-item":
|
|
1009
|
-
onClick: ye((
|
|
1010
|
-
onContextmenu: (
|
|
1010
|
+
class: Q(["tabs-card-scroll-item", { "active-item": r.activeKey === n.fullPath }]),
|
|
1011
|
+
onClick: ye((C) => oe(n), ["stop"]),
|
|
1012
|
+
onContextmenu: (C) => le(C, n)
|
|
1011
1013
|
}, [
|
|
1012
1014
|
b("span", null, F(n.meta.title), 1),
|
|
1013
1015
|
n.meta.affix ? A("", !0) : (y(), $(a(N), {
|
|
1014
1016
|
key: 0,
|
|
1015
1017
|
size: "14",
|
|
1016
|
-
onClick: ye((
|
|
1018
|
+
onClick: ye((C) => fe(n), ["stop"])
|
|
1017
1019
|
}, {
|
|
1018
1020
|
default: s(() => [
|
|
1019
|
-
|
|
1021
|
+
i(a(xe))
|
|
1020
1022
|
]),
|
|
1021
1023
|
_: 2
|
|
1022
1024
|
}, 1032, ["onClick"]))
|
|
1023
|
-
], 42,
|
|
1025
|
+
], 42, ra)
|
|
1024
1026
|
]),
|
|
1025
1027
|
_: 1
|
|
1026
1028
|
}, 8, ["list"])
|
|
1027
1029
|
], 512)
|
|
1028
1030
|
], 2),
|
|
1029
1031
|
b("div", ca, [
|
|
1030
|
-
|
|
1032
|
+
i(a(G), {
|
|
1031
1033
|
trigger: "hover",
|
|
1032
1034
|
onSelect: ne,
|
|
1033
1035
|
placement: "bottom-end",
|
|
1034
|
-
options:
|
|
1036
|
+
options: g.value
|
|
1035
1037
|
}, {
|
|
1036
1038
|
default: s(() => [
|
|
1037
1039
|
b("div", da, [
|
|
1038
|
-
|
|
1040
|
+
i(a(N), {
|
|
1039
1041
|
size: "16",
|
|
1040
1042
|
color: "#515a6e"
|
|
1041
1043
|
}, {
|
|
1042
1044
|
default: s(() => [
|
|
1043
|
-
|
|
1045
|
+
i(a(Mt))
|
|
1044
1046
|
]),
|
|
1045
1047
|
_: 1
|
|
1046
1048
|
})
|
|
@@ -1049,14 +1051,14 @@ const Be = (t) => {
|
|
|
1049
1051
|
_: 1
|
|
1050
1052
|
}, 8, ["options"])
|
|
1051
1053
|
]),
|
|
1052
|
-
|
|
1053
|
-
show:
|
|
1054
|
-
x:
|
|
1055
|
-
y:
|
|
1056
|
-
onClickoutside: l[0] || (l[0] = (n) =>
|
|
1054
|
+
i(a(G), {
|
|
1055
|
+
show: r.showDropdown,
|
|
1056
|
+
x: r.dropdownX,
|
|
1057
|
+
y: r.dropdownY,
|
|
1058
|
+
onClickoutside: l[0] || (l[0] = (n) => r.showDropdown = !1),
|
|
1057
1059
|
placement: "bottom-start",
|
|
1058
1060
|
onSelect: ne,
|
|
1059
|
-
options:
|
|
1061
|
+
options: g.value
|
|
1060
1062
|
}, null, 8, ["show", "x", "y", "options"])
|
|
1061
1063
|
])
|
|
1062
1064
|
], 4));
|
|
@@ -1064,48 +1066,48 @@ const Be = (t) => {
|
|
|
1064
1066
|
}), fa = /* @__PURE__ */ de(ua, [["__scopeId", "data-v-f0706f46"]]), pa = /* @__PURE__ */ I({
|
|
1065
1067
|
__name: "PMenus",
|
|
1066
1068
|
setup(t) {
|
|
1067
|
-
const d = Ce(),
|
|
1068
|
-
d.matched && d.matched.length ? d.matched.map((
|
|
1069
|
-
), L =
|
|
1070
|
-
/http(s)?:/.test(
|
|
1071
|
-
}, T = (
|
|
1072
|
-
if (!
|
|
1073
|
-
const P =
|
|
1074
|
-
|
|
1069
|
+
const d = Ce(), h = ke(), v = ae(), w = M(d.name), p = M(
|
|
1070
|
+
d.matched && d.matched.length ? d.matched.map((r) => r.name) : []
|
|
1071
|
+
), L = M([]), k = (r) => {
|
|
1072
|
+
/http(s)?:/.test(r) ? window.open(r) : h.push({ name: r });
|
|
1073
|
+
}, T = (r) => {
|
|
1074
|
+
if (!r) return;
|
|
1075
|
+
const P = r.find((o) => p.value.indexOf(o) === -1);
|
|
1076
|
+
p.value = P ? [P] : [];
|
|
1075
1077
|
}, x = () => {
|
|
1076
|
-
const
|
|
1077
|
-
|
|
1078
|
+
const r = d.matched;
|
|
1079
|
+
p.value = r.map((o) => o.name);
|
|
1078
1080
|
const P = d.meta?.activeMenu || "";
|
|
1079
|
-
|
|
1080
|
-
}, u = (
|
|
1081
|
-
const m = [],
|
|
1081
|
+
w.value = P || d.name;
|
|
1082
|
+
}, u = (r, P = [], o = !1) => {
|
|
1083
|
+
const m = [], g = [
|
|
1082
1084
|
"/:path(.*)*",
|
|
1083
1085
|
"/redirect",
|
|
1084
1086
|
"/redirect/:path(.*)",
|
|
1085
1087
|
"/login",
|
|
1086
1088
|
"/oidc-callback"
|
|
1087
1089
|
];
|
|
1088
|
-
if (!
|
|
1090
|
+
if (!r || r.length === 0)
|
|
1089
1091
|
return m;
|
|
1090
|
-
|
|
1091
|
-
let
|
|
1092
|
-
return
|
|
1092
|
+
r = r.sort((_, D) => {
|
|
1093
|
+
let O = (D.children?.length ? 1 : 0) - (_.children?.length ? 1 : 0);
|
|
1094
|
+
return O === 0 && (O = (_.meta?.sort ?? 0) - (D.meta?.sort ?? 0)), O;
|
|
1093
1095
|
});
|
|
1094
|
-
for (const _ of
|
|
1095
|
-
if (o || (_.meta?.hidden || !1) == !0 ||
|
|
1096
|
+
for (const _ of r) {
|
|
1097
|
+
if (o || (_.meta?.hidden || !1) == !0 || g.includes(_.path)) {
|
|
1096
1098
|
P.push(_.name), _.children && _.children.length > 0 && u(_.children, P, !0);
|
|
1097
1099
|
continue;
|
|
1098
1100
|
}
|
|
1099
|
-
const D = _.meta?.alwaysShow != !0 && _?.children?.filter((J) => !J?.meta?.hidden)?.length === 1,
|
|
1100
|
-
key:
|
|
1101
|
-
label:
|
|
1102
|
-
affix:
|
|
1103
|
-
sort:
|
|
1104
|
-
path:
|
|
1105
|
-
redirect:
|
|
1106
|
-
icon: D ? _.meta?.icon :
|
|
1107
|
-
permissions:
|
|
1108
|
-
meta:
|
|
1101
|
+
const D = _.meta?.alwaysShow != !0 && _?.children?.filter((J) => !J?.meta?.hidden)?.length === 1, O = D ? _.children[0] : _, S = {
|
|
1102
|
+
key: O.name,
|
|
1103
|
+
label: O.meta?.title,
|
|
1104
|
+
affix: O.meta?.affix,
|
|
1105
|
+
sort: O.meta?.sort,
|
|
1106
|
+
path: O.path,
|
|
1107
|
+
redirect: O.redirect,
|
|
1108
|
+
icon: D ? _.meta?.icon : O.meta?.icon,
|
|
1109
|
+
permissions: O.meta?.permissions,
|
|
1110
|
+
meta: O.meta,
|
|
1109
1111
|
children: void 0
|
|
1110
1112
|
};
|
|
1111
1113
|
if (!P.includes(_.name)) {
|
|
@@ -1118,8 +1120,8 @@ const Be = (t) => {
|
|
|
1118
1120
|
}
|
|
1119
1121
|
return m;
|
|
1120
1122
|
}, f = () => {
|
|
1121
|
-
const
|
|
1122
|
-
L.value = u(
|
|
1123
|
+
const r = h.getRoutes();
|
|
1124
|
+
L.value = u(r);
|
|
1123
1125
|
};
|
|
1124
1126
|
return ze(
|
|
1125
1127
|
() => d.fullPath,
|
|
@@ -1128,28 +1130,28 @@ const Be = (t) => {
|
|
|
1128
1130
|
}
|
|
1129
1131
|
), ee(() => {
|
|
1130
1132
|
f(), x();
|
|
1131
|
-
}), (
|
|
1133
|
+
}), (r, P) => (y(), $(a(Qe), {
|
|
1132
1134
|
class: "h-full",
|
|
1133
1135
|
inverted: "",
|
|
1134
1136
|
mode: "vertical",
|
|
1135
1137
|
options: L.value,
|
|
1136
|
-
collapsed: a(
|
|
1138
|
+
collapsed: a(v).state.collapsed,
|
|
1137
1139
|
"collapsed-width": 64,
|
|
1138
1140
|
"collapsed-icon-size": 20,
|
|
1139
1141
|
indent: 24,
|
|
1140
|
-
"expanded-keys":
|
|
1141
|
-
value:
|
|
1142
|
-
"onUpdate:value":
|
|
1142
|
+
"expanded-keys": p.value,
|
|
1143
|
+
value: w.value,
|
|
1144
|
+
"onUpdate:value": k,
|
|
1143
1145
|
"onUpdate:expandedKeys": T
|
|
1144
1146
|
}, null, 8, ["options", "collapsed", "expanded-keys", "value"]));
|
|
1145
1147
|
}
|
|
1146
1148
|
}), ga = { class: "layout-content-main layout-content-main-fix" }, ha = { class: "main-view main-view-fix" }, ma = /* @__PURE__ */ I({
|
|
1147
1149
|
__name: "PLayout",
|
|
1148
1150
|
setup(t) {
|
|
1149
|
-
const d = ae(),
|
|
1151
|
+
const d = ae(), h = M(!1);
|
|
1150
1152
|
return _t("reloadPage", () => {
|
|
1151
|
-
|
|
1152
|
-
}), (
|
|
1153
|
+
h.value = !0, re(() => h.value = !1);
|
|
1154
|
+
}), (w, p) => {
|
|
1153
1155
|
const L = lt;
|
|
1154
1156
|
return y(), $(a(Le), {
|
|
1155
1157
|
"has-sider": "",
|
|
@@ -1157,7 +1159,7 @@ const Be = (t) => {
|
|
|
1157
1159
|
position: "absolute"
|
|
1158
1160
|
}, {
|
|
1159
1161
|
default: s(() => [
|
|
1160
|
-
|
|
1162
|
+
i(a(et), {
|
|
1161
1163
|
class: "layout-sider",
|
|
1162
1164
|
inverted: "",
|
|
1163
1165
|
"show-trigger": "bar",
|
|
@@ -1170,36 +1172,36 @@ const Be = (t) => {
|
|
|
1170
1172
|
onExpand: a(d).collapse
|
|
1171
1173
|
}, {
|
|
1172
1174
|
default: s(() => [
|
|
1173
|
-
|
|
1175
|
+
i(a(tt), { vertical: "" }, {
|
|
1174
1176
|
default: s(() => [
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
+
i(jt),
|
|
1178
|
+
i(pa)
|
|
1177
1179
|
]),
|
|
1178
1180
|
_: 1
|
|
1179
1181
|
})
|
|
1180
1182
|
]),
|
|
1181
1183
|
_: 1
|
|
1182
1184
|
}, 8, ["collapsed", "onCollapse", "onExpand"]),
|
|
1183
|
-
|
|
1185
|
+
i(a(Le), null, {
|
|
1184
1186
|
default: s(() => [
|
|
1185
|
-
|
|
1187
|
+
i(a(at), { position: "absolute" }, {
|
|
1186
1188
|
default: s(() => [
|
|
1187
|
-
|
|
1189
|
+
i(la)
|
|
1188
1190
|
]),
|
|
1189
1191
|
_: 1
|
|
1190
1192
|
}),
|
|
1191
|
-
|
|
1193
|
+
i(a(ot), { class: "layout-content layout-default-background" }, {
|
|
1192
1194
|
default: s(() => [
|
|
1193
1195
|
b("div", ga, [
|
|
1194
|
-
|
|
1196
|
+
i(fa),
|
|
1195
1197
|
b("div", ha, [
|
|
1196
|
-
|
|
1198
|
+
i(sa, { loading: h.value }, null, 8, ["loading"])
|
|
1197
1199
|
])
|
|
1198
1200
|
])
|
|
1199
1201
|
]),
|
|
1200
1202
|
_: 1
|
|
1201
1203
|
}),
|
|
1202
|
-
|
|
1204
|
+
i(L, {
|
|
1203
1205
|
right: 20,
|
|
1204
1206
|
class: "z-50"
|
|
1205
1207
|
})
|
|
@@ -1228,20 +1230,20 @@ const Be = (t) => {
|
|
|
1228
1230
|
} }
|
|
1229
1231
|
},
|
|
1230
1232
|
setup(t) {
|
|
1231
|
-
return (d,
|
|
1232
|
-
const
|
|
1233
|
-
return y(), $(
|
|
1234
|
-
locale: a(
|
|
1233
|
+
return (d, h) => {
|
|
1234
|
+
const v = nt;
|
|
1235
|
+
return y(), $(v, {
|
|
1236
|
+
locale: a(it),
|
|
1235
1237
|
theme: d.theme,
|
|
1236
1238
|
"theme-overrides": d.themeOverrides,
|
|
1237
1239
|
"date-locale": a(st)
|
|
1238
1240
|
}, {
|
|
1239
1241
|
default: s(() => [
|
|
1240
|
-
|
|
1242
|
+
i(a(rt), null, {
|
|
1241
1243
|
default: s(() => [
|
|
1242
|
-
|
|
1244
|
+
i(a(ct), null, {
|
|
1243
1245
|
default: s(() => [
|
|
1244
|
-
|
|
1246
|
+
i(a(dt), null, {
|
|
1245
1247
|
default: s(() => [
|
|
1246
1248
|
U(d.$slots, "default")
|
|
1247
1249
|
]),
|
|
@@ -1261,59 +1263,61 @@ const Be = (t) => {
|
|
|
1261
1263
|
}), ya = te(ba), wa = /* @__PURE__ */ I({
|
|
1262
1264
|
__name: "PModal",
|
|
1263
1265
|
props: {
|
|
1264
|
-
saveBtnText: { default: "
|
|
1266
|
+
saveBtnText: { default: "保存" },
|
|
1265
1267
|
closable: { type: Boolean, default: !1 },
|
|
1266
1268
|
title: {},
|
|
1267
1269
|
width: { default: 800 },
|
|
1268
1270
|
height: { default: 500 },
|
|
1271
|
+
visible: { type: Boolean },
|
|
1272
|
+
loading: { type: Boolean },
|
|
1269
1273
|
onSave: {},
|
|
1270
1274
|
onClose: {}
|
|
1271
1275
|
},
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1276
|
+
emits: ["update:visible", "update:loading"],
|
|
1277
|
+
setup(t, { expose: d, emit: h }) {
|
|
1278
|
+
const v = ce(), w = t, p = h, L = async () => {
|
|
1279
|
+
p("update:loading", !0);
|
|
1275
1280
|
try {
|
|
1276
|
-
|
|
1281
|
+
w.onSave && await w.onSave() && k();
|
|
1277
1282
|
} catch (f) {
|
|
1278
|
-
|
|
1283
|
+
v.error(f.message);
|
|
1279
1284
|
} finally {
|
|
1280
|
-
|
|
1285
|
+
p("update:loading", !1);
|
|
1281
1286
|
}
|
|
1282
|
-
},
|
|
1283
|
-
|
|
1287
|
+
}, k = () => {
|
|
1288
|
+
p("update:visible", !1), p("update:loading", !1);
|
|
1284
1289
|
}, T = async () => {
|
|
1285
1290
|
try {
|
|
1286
|
-
|
|
1291
|
+
w.onClose ? await w.onClose() && k() : k();
|
|
1287
1292
|
} catch (f) {
|
|
1288
|
-
|
|
1293
|
+
v.error(f.message), p("update:loading", !1);
|
|
1289
1294
|
}
|
|
1290
1295
|
};
|
|
1291
1296
|
return d({
|
|
1292
1297
|
open: () => {
|
|
1293
|
-
|
|
1298
|
+
p("update:visible", !0), p("update:loading", !1);
|
|
1294
1299
|
},
|
|
1295
1300
|
close: () => {
|
|
1296
|
-
|
|
1301
|
+
p("update:visible", !1), p("update:loading", !1);
|
|
1297
1302
|
}
|
|
1298
|
-
}), (f,
|
|
1303
|
+
}), (f, r) => {
|
|
1299
1304
|
const P = ut, o = q, m = Me;
|
|
1300
1305
|
return y(), $(a(Oe), bt({
|
|
1301
1306
|
ref: "$modal",
|
|
1302
|
-
preset: "card"
|
|
1303
|
-
show: v.value,
|
|
1304
|
-
"onUpdate:show": i[0] || (i[0] = (p) => v.value = p)
|
|
1307
|
+
preset: "card"
|
|
1305
1308
|
}, f.$attrs, {
|
|
1306
1309
|
"header-class": "bg-gray-50",
|
|
1310
|
+
show: w.visible,
|
|
1307
1311
|
draggable: !0,
|
|
1308
1312
|
closable: !1,
|
|
1309
1313
|
"close-on-esc": !1,
|
|
1310
1314
|
"mask-closable": !1,
|
|
1311
1315
|
bordered: !1,
|
|
1312
|
-
style: { width: `${
|
|
1313
|
-
onClose:
|
|
1316
|
+
style: { width: `${w.width}px` },
|
|
1317
|
+
onClose: k
|
|
1314
1318
|
}), {
|
|
1315
1319
|
header: s(() => [
|
|
1316
|
-
f.$slots.header ? U(f.$slots, "header", { key: 0 }) :
|
|
1320
|
+
f.$slots.header ? U(f.$slots, "header", { key: 0 }) : w.title ? (y(), $(P, { key: 1 }, {
|
|
1317
1321
|
default: s(() => [
|
|
1318
1322
|
V(F(f.title), 1)
|
|
1319
1323
|
]),
|
|
@@ -1326,7 +1330,7 @@ const Be = (t) => {
|
|
|
1326
1330
|
default: s(() => [
|
|
1327
1331
|
b("div", {
|
|
1328
1332
|
class: "overflow-y-auto overflow-hidden mt-5",
|
|
1329
|
-
style:
|
|
1333
|
+
style: ie({ maxHeight: `${w.height}px` })
|
|
1330
1334
|
}, [
|
|
1331
1335
|
U(f.$slots, "default")
|
|
1332
1336
|
], 4)
|
|
@@ -1335,11 +1339,11 @@ const Be = (t) => {
|
|
|
1335
1339
|
U(f.$slots, "footer")
|
|
1336
1340
|
]),
|
|
1337
1341
|
action: s(() => [
|
|
1338
|
-
|
|
1342
|
+
i(m, { justify: "end" }, {
|
|
1339
1343
|
default: s(() => [
|
|
1340
|
-
|
|
1344
|
+
i(o, {
|
|
1341
1345
|
type: "primary",
|
|
1342
|
-
loading:
|
|
1346
|
+
loading: f.loading,
|
|
1343
1347
|
onClick: L
|
|
1344
1348
|
}, {
|
|
1345
1349
|
default: s(() => [
|
|
@@ -1347,13 +1351,13 @@ const Be = (t) => {
|
|
|
1347
1351
|
]),
|
|
1348
1352
|
_: 1
|
|
1349
1353
|
}, 8, ["loading"]),
|
|
1350
|
-
U(f.$slots, "action-extra"),
|
|
1351
|
-
|
|
1352
|
-
default: s(() =>
|
|
1353
|
-
V("
|
|
1354
|
+
U(f.$slots, "action-extra", { loading: f.loading }),
|
|
1355
|
+
i(o, { onClick: T }, {
|
|
1356
|
+
default: s(() => r[0] || (r[0] = [
|
|
1357
|
+
V("取消", -1)
|
|
1354
1358
|
])),
|
|
1355
1359
|
_: 1,
|
|
1356
|
-
__: [
|
|
1360
|
+
__: [0]
|
|
1357
1361
|
})
|
|
1358
1362
|
]),
|
|
1359
1363
|
_: 3
|
|
@@ -1370,8 +1374,8 @@ const Be = (t) => {
|
|
|
1370
1374
|
PLayout: _a,
|
|
1371
1375
|
PModal: ka,
|
|
1372
1376
|
PTable: Wt
|
|
1373
|
-
}, Symbol.toStringTag, { value: "Module" })), Sa = (t, d) => (Object.values(Pa).forEach((
|
|
1374
|
-
|
|
1377
|
+
}, Symbol.toStringTag, { value: "Module" })), Sa = (t, d) => (Object.values(Pa).forEach((h) => {
|
|
1378
|
+
h.install && t.use(h);
|
|
1375
1379
|
}), d?.(), t), Ra = {
|
|
1376
1380
|
install: Sa
|
|
1377
1381
|
};
|