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