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