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