@chewel611/naive-ui-plus 0.0.5 → 0.0.6

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