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