xto-fronted 0.2.2 → 0.2.3

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.es.js CHANGED
@@ -1,11 +1,11 @@
1
- import Te from "axios";
2
- import { Message as B, Tooltip as Ee, Drawer as Ue } from "@xto/feedback";
3
- import { ref as C, computed as k, watch as Me, reactive as ue, defineComponent as D, openBlock as y, createElementBlock as L, createElementVNode as a, withDirectives as pe, toDisplayString as S, unref as i, vShow as ve, createVNode as x, withCtx as I, Fragment as R, renderList as K, createBlock as F, createTextVNode as oe, createCommentVNode as H, normalizeClass as de, onMounted as Pe, onUnmounted as Ne, isRef as Re, withModifiers as Ae, Transition as Be, resolveComponent as Fe, normalizeStyle as De, withKeys as Oe } from "vue";
4
- import { defineStore as ae } from "pinia";
5
- import { useRouter as G, useRoute as he, createRouter as ge, createWebHistory as me } from "vue-router";
6
- import { Menu as ye, SubMenu as we, MenuItem as se } from "@xto/navigation";
7
- import { Button as re, Icon as j } from "@xto/base";
8
- import { Switch as Ve, Input as ie, Form as ze, FormItem as ce } from "@xto/form";
1
+ import Ue from "axios";
2
+ import { Message as R, Tooltip as Pe, Drawer as Me } from "@xto/feedback";
3
+ import { ref as C, computed as w, watch as Ne, reactive as he, defineComponent as F, openBlock as y, createElementBlock as L, createElementVNode as a, withDirectives as _e, toDisplayString as T, unref as h, vShow as ve, createVNode as x, isRef as ge, withCtx as I, Fragment as M, renderList as j, createBlock as V, createTextVNode as oe, createCommentVNode as D, normalizeClass as ae, onMounted as Be, onUnmounted as Re, withModifiers as Ae, Transition as Ve, resolveComponent as De, normalizeStyle as Fe, withKeys as Oe } from "vue";
4
+ import { defineStore as re } from "pinia";
5
+ import { useRouter as W, useRoute as le, createRouter as ye, createWebHistory as we } from "vue-router";
6
+ import { Menu as be, SubMenu as ke, MenuItem as se } from "@xto/navigation";
7
+ import { Button as ce, Icon as q } from "@xto/base";
8
+ import { Switch as fe, Input as de, Form as ze, FormItem as ue } from "@xto/form";
9
9
  const He = {
10
10
  appName: "XTO App",
11
11
  baseUrl: "",
@@ -15,16 +15,16 @@ const He = {
15
15
  loginPath: "/login"
16
16
  };
17
17
  let ne = { ...He };
18
- function Ke(e) {
18
+ function je(e) {
19
19
  ne = { ...ne, ...e };
20
20
  }
21
- function P() {
21
+ function N() {
22
22
  return ne;
23
23
  }
24
- function Rs(e) {
24
+ function Fs(e) {
25
25
  return ne[e];
26
26
  }
27
- const Q = () => `tooyu-cloud:${P().appId}:`, be = (e) => ({
27
+ const Q = () => `tooyu-cloud:${N().appId}:`, Ce = (e) => ({
28
28
  get(s) {
29
29
  const t = Q(), n = e.getItem(t + s);
30
30
  if (!n) return null;
@@ -53,17 +53,17 @@ const Q = () => `tooyu-cloud:${P().appId}:`, be = (e) => ({
53
53
  n.startsWith(s) && e.removeItem(n);
54
54
  });
55
55
  }
56
- }), Z = be(window.localStorage), ee = be(window.sessionStorage), b = {
56
+ }), Z = Ce(window.localStorage), ee = Ce(window.sessionStorage), k = {
57
57
  get: Z.get,
58
58
  set: Z.set,
59
59
  remove: Z.remove,
60
60
  clear: Z.clear
61
- }, As = {
61
+ }, Os = {
62
62
  get: ee.get,
63
63
  set: ee.set,
64
64
  remove: ee.remove,
65
65
  clear: ee.clear
66
- }, _e = "login_info", qe = "user_info", Y = () => b.get(_e), We = (e) => {
66
+ }, pe = "login_info", Ke = "user_info", G = () => k.get(pe), qe = (e) => {
67
67
  const s = {
68
68
  accessToken: e.access_token,
69
69
  refreshToken: e.refresh_token,
@@ -72,20 +72,20 @@ const Q = () => `tooyu-cloud:${P().appId}:`, be = (e) => ({
72
72
  tokenType: e.token_type,
73
73
  code: e.code
74
74
  };
75
- b.set(_e, s);
76
- }, ke = () => {
77
- const e = Y();
75
+ k.set(pe, s);
76
+ }, Le = () => {
77
+ const e = G();
78
78
  return (e == null ? void 0 : e.accessToken) || null;
79
- }, je = () => {
80
- const e = Y();
79
+ }, We = () => {
80
+ const e = G();
81
81
  return (e == null ? void 0 : e.tokenType) || "Bearer";
82
- }, Bs = () => {
83
- const e = Y();
82
+ }, zs = () => {
83
+ const e = G();
84
84
  return (e == null ? void 0 : e.code) || null;
85
- }, Ce = () => {
86
- b.remove(_e), b.remove(qe);
87
- }, xe = () => !!ke(), Ye = () => {
88
- const e = P(), s = Te.create({
85
+ }, xe = () => {
86
+ k.remove(pe), k.remove(Ke);
87
+ }, Ie = () => !!Le(), Ye = () => {
88
+ const e = N(), s = Ue.create({
89
89
  baseURL: e.baseUrl,
90
90
  timeout: 15e3,
91
91
  headers: {
@@ -94,9 +94,9 @@ const Q = () => `tooyu-cloud:${P().appId}:`, be = (e) => ({
94
94
  });
95
95
  return s.interceptors.request.use(
96
96
  (t) => {
97
- const n = ke();
97
+ const n = Le();
98
98
  if (n) {
99
- const o = je();
99
+ const o = We();
100
100
  t.headers.Authorization = `${o} ${n}`;
101
101
  }
102
102
  return t;
@@ -104,8 +104,10 @@ const Q = () => `tooyu-cloud:${P().appId}:`, be = (e) => ({
104
104
  (t) => Promise.reject(t)
105
105
  ), s.interceptors.response.use(
106
106
  (t) => {
107
+ if (t.config.responseType === "blob")
108
+ return t;
107
109
  const { data: n } = t;
108
- return n.code === 200 || n.code === 0 ? t : (B.error(n.message || "请求失败"), Promise.reject(new Error(n.message || "请求失败")));
110
+ return n.code === 200 || n.code === 0 ? t : (R.error(n.message || "请求失败"), Promise.reject(new Error(n.message || "请求失败")));
109
111
  },
110
112
  (t) => {
111
113
  var o;
@@ -114,25 +116,25 @@ const Q = () => `tooyu-cloud:${P().appId}:`, be = (e) => ({
114
116
  switch (n.status) {
115
117
  case 401:
116
118
  case 403:
117
- B.error("登录已过期,请重新登录"), Ce(), window.location.href = "/login";
119
+ R.error("登录已过期,请重新登录"), xe(), window.location.href = "/login";
118
120
  break;
119
121
  case 404:
120
- B.error("请求资源不存在");
122
+ R.error("请求资源不存在");
121
123
  break;
122
124
  case 500:
123
- B.error("服务器错误");
125
+ R.error("服务器错误");
124
126
  break;
125
127
  default:
126
- B.error(((o = n.data) == null ? void 0 : o.message) || "请求失败");
128
+ R.error(((o = n.data) == null ? void 0 : o.message) || "请求失败");
127
129
  }
128
130
  else
129
- B.error("网络连接失败");
131
+ R.error("网络连接失败");
130
132
  return Promise.reject(t);
131
133
  }
132
134
  ), s;
133
135
  };
134
136
  let te = null;
135
- function z() {
137
+ function H() {
136
138
  return te || (te = Ye()), te;
137
139
  }
138
140
  function Ge() {
@@ -140,97 +142,111 @@ function Ge() {
140
142
  }
141
143
  new Proxy({}, {
142
144
  get(e, s) {
143
- return z()[s];
145
+ return H()[s];
144
146
  }
145
147
  });
146
- const X = {
148
+ const J = {
147
149
  get(e, s) {
148
- return z().get(e, s).then((t) => t.data);
150
+ return H().get(e, s).then((t) => t.data);
149
151
  },
150
152
  post(e, s, t) {
151
- return z().post(e, s, t).then((n) => n.data);
153
+ return H().post(e, s, t).then((n) => n.data);
152
154
  },
153
155
  put(e, s, t) {
154
- return z().put(e, s, t).then((n) => n.data);
156
+ return H().put(e, s, t).then((n) => n.data);
155
157
  },
156
158
  patch(e, s, t) {
157
- return z().patch(e, s, t).then((n) => n.data);
159
+ return H().patch(e, s, t).then((n) => n.data);
158
160
  },
159
161
  delete(e, s) {
160
- return z().delete(e, s).then((t) => t.data);
162
+ return H().delete(e, s).then((t) => t.data);
163
+ },
164
+ /**
165
+ * 下载文件(blob 响应)
166
+ * 直接返回 Blob 对象,绕过响应拦截器的业务错误处理
167
+ */
168
+ download(e, s) {
169
+ return H().get(e, { ...s, responseType: "blob" }).then((t) => (t.headers["content-type"] || "").includes("application/json") ? t.data.text().then((o) => {
170
+ try {
171
+ const d = JSON.parse(o);
172
+ return R.error(d.message || "请求失败"), Promise.reject(new Error(d.message || "请求失败"));
173
+ } catch {
174
+ return R.error("请求失败"), Promise.reject(new Error("请求失败"));
175
+ }
176
+ }) : t.data);
161
177
  }
162
- }, Le = "/vite.svg", J = ae("app", () => {
163
- const e = C(b.get("isDark") || !1), s = C(b.get("theme") || "light"), t = C(b.get("layout") || "sidebar"), n = C(b.get("isCollapsed") || !1), o = C(b.get("showTabs") ?? !0), _ = C(b.get("showFooter") ?? !0), l = C(b.get("showBreadcrumb") ?? !0), r = C(b.get("primaryColor") || "#409eff"), u = C(b.get("isGrayscale") || !1), d = C([]), p = k(() => e.value ? "dark" : "light"), f = () => {
164
- e.value = !e.value, s.value = e.value ? "dark" : "light", h();
178
+ }, $e = "/vite.svg", X = re("app", () => {
179
+ const e = C(k.get("isDark") || !1), s = C(k.get("theme") || "light"), t = C(k.get("layout") || "sidebar"), n = C(k.get("isCollapsed") || !1), o = C(k.get("showTabs") ?? !0), d = C(k.get("showFooter") ?? !0), l = C(k.get("showBreadcrumb") ?? !0), r = C(k.get("primaryColor") || "#409eff"), i = C(k.get("isGrayscale") || !1), u = C([]), p = w(() => e.value ? "dark" : "light"), f = () => {
180
+ e.value = !e.value, s.value = e.value ? "dark" : "light", _();
165
181
  }, v = ($) => {
166
- s.value = $, e.value = $ === "dark", h();
167
- }, h = () => {
182
+ s.value = $, e.value = $ === "dark", _();
183
+ }, _ = () => {
168
184
  const $ = document.documentElement;
169
- e.value ? $.classList.add("dark") : $.classList.remove("dark"), b.set("isDark", e.value), b.set("theme", s.value);
185
+ e.value ? $.classList.add("dark") : $.classList.remove("dark"), k.set("isDark", e.value), k.set("theme", s.value);
170
186
  }, c = () => {
171
- n.value = !n.value, b.set("isCollapsed", n.value);
172
- }, m = ($) => {
173
- t.value = $, b.set("layout", $);
174
- }, g = () => {
175
- o.value = !o.value, b.set("showTabs", o.value);
176
- }, w = () => {
177
- _.value = !_.value, b.set("showFooter", _.value);
187
+ n.value = !n.value, k.set("isCollapsed", n.value);
188
+ }, g = ($) => {
189
+ t.value = $, k.set("layout", $);
190
+ }, m = () => {
191
+ o.value = !o.value, k.set("showTabs", o.value);
192
+ }, b = () => {
193
+ d.value = !d.value, k.set("showFooter", d.value);
178
194
  }, E = () => {
179
- l.value = !l.value, b.set("showBreadcrumb", l.value);
180
- }, M = ($) => {
181
- r.value = $, document.documentElement.style.setProperty("--color-primary", $), b.set("primaryColor", $);
195
+ l.value = !l.value, k.set("showBreadcrumb", l.value);
196
+ }, P = ($) => {
197
+ r.value = $, document.documentElement.style.setProperty("--color-primary", $), k.set("primaryColor", $);
182
198
  }, O = ($) => {
183
- u.value = $;
184
- const W = document.documentElement;
185
- $ ? W.classList.add("grayscale") : W.classList.remove("grayscale"), b.set("isGrayscale", $);
186
- }, V = ($) => {
187
- d.value.includes($) || d.value.push($);
188
- }, N = ($) => {
189
- const W = d.value.indexOf($);
190
- W > -1 && d.value.splice(W, 1);
191
- }, T = () => {
192
- d.value = [];
199
+ i.value = $;
200
+ const Y = document.documentElement;
201
+ $ ? Y.classList.add("grayscale") : Y.classList.remove("grayscale"), k.set("isGrayscale", $);
202
+ }, z = ($) => {
203
+ u.value.includes($) || u.value.push($);
204
+ }, B = ($) => {
205
+ const Y = u.value.indexOf($);
206
+ Y > -1 && u.value.splice(Y, 1);
207
+ }, S = () => {
208
+ u.value = [];
193
209
  }, U = () => {
194
- h(), r.value !== "#409eff" && document.documentElement.style.setProperty("--color-primary", r.value), u.value && document.documentElement.classList.add("grayscale");
210
+ _(), r.value !== "#409eff" && document.documentElement.style.setProperty("--color-primary", r.value), i.value && document.documentElement.classList.add("grayscale");
195
211
  };
196
- return Me(e, h), {
212
+ return Ne(e, _), {
197
213
  isDark: e,
198
214
  theme: s,
199
215
  layout: t,
200
216
  isCollapsed: n,
201
217
  showTabs: o,
202
- showFooter: _,
218
+ showFooter: d,
203
219
  showBreadcrumb: l,
204
220
  primaryColor: r,
205
- isGrayscale: u,
206
- cachedViews: d,
221
+ isGrayscale: i,
222
+ cachedViews: u,
207
223
  themeClass: p,
208
224
  toggleTheme: f,
209
225
  toggleCollapse: c,
210
226
  setTheme: v,
211
- setLayout: m,
212
- toggleTabs: g,
213
- toggleFooter: w,
227
+ setLayout: g,
228
+ toggleTabs: m,
229
+ toggleFooter: b,
214
230
  toggleBreadcrumb: E,
215
- setPrimaryColor: M,
231
+ setPrimaryColor: P,
216
232
  setGrayscale: O,
217
- addCachedView: V,
218
- removeCachedView: N,
219
- clearCachedViews: T,
233
+ addCachedView: z,
234
+ removeCachedView: B,
235
+ clearCachedViews: S,
220
236
  initTheme: U
221
237
  };
222
- }), Ie = ae("auth", () => {
223
- const e = C(Y()), s = k(() => xe()), t = (r) => {
224
- We(r), e.value = Y();
238
+ }), Te = re("auth", () => {
239
+ const e = C(G()), s = w(() => Ie()), t = (r) => {
240
+ qe(r), e.value = G();
225
241
  }, n = () => {
226
- e.value = null, Ce();
227
- }, o = k(() => {
242
+ e.value = null, xe();
243
+ }, o = w(() => {
228
244
  var r;
229
245
  return ((r = e.value) == null ? void 0 : r.accessToken) || null;
230
- }), _ = k(() => {
246
+ }), d = w(() => {
231
247
  var r;
232
248
  return ((r = e.value) == null ? void 0 : r.tokenType) || "Bearer";
233
- }), l = k(() => {
249
+ }), l = w(() => {
234
250
  var r;
235
251
  return ((r = e.value) == null ? void 0 : r.code) || null;
236
252
  });
@@ -238,19 +254,19 @@ const X = {
238
254
  loginInfo: e,
239
255
  isLoggedIn: s,
240
256
  accessToken: o,
241
- tokenType: _,
257
+ tokenType: d,
242
258
  code: l,
243
259
  login: t,
244
260
  logout: n
245
261
  };
246
- }), $e = ae("user", () => {
247
- const e = C(b.get("user_info")), s = k(() => !!e.value), t = k(() => {
262
+ }), Se = re("user", () => {
263
+ const e = C(k.get("user_info")), s = w(() => !!e.value), t = w(() => {
248
264
  var r;
249
265
  return ((r = e.value) == null ? void 0 : r.userName) || "";
250
- }), n = k(() => {
266
+ }), n = w(() => {
251
267
  var r;
252
268
  return ((r = e.value) == null ? void 0 : r.avatar) || "";
253
- }), o = k(() => {
269
+ }), o = w(() => {
254
270
  var r;
255
271
  return (r = e.value) == null ? void 0 : r.userId;
256
272
  });
@@ -261,75 +277,75 @@ const X = {
261
277
  avatar: n,
262
278
  userId: o,
263
279
  setUserInfo: (r) => {
264
- e.value = r, b.set("user_info", r);
280
+ e.value = r, k.set("user_info", r);
265
281
  },
266
282
  clearUserInfo: () => {
267
- e.value = null, b.remove("user_info");
283
+ e.value = null, k.remove("user_info");
268
284
  }
269
285
  };
270
- }), q = ae("menu", () => {
271
- const e = "menu_list", s = "menu_btn_list", t = C(b.get(e) || []), n = C(b.get(s) || {}), o = k(() => t.value.length > 0), _ = k(() => {
272
- const f = P();
286
+ }), K = re("menu", () => {
287
+ const e = "menu_list", s = "menu_btn_list", t = C(k.get(e) || []), n = C(k.get(s) || {}), o = w(() => t.value.length > 0), d = w(() => {
288
+ const f = N();
273
289
  function v(c) {
274
290
  if (c && c.length > 0)
275
- for (let m = 0; m < c.length; m++) {
276
- const g = c[m];
277
- if (g.default)
278
- return g.path;
291
+ for (let g = 0; g < c.length; g++) {
292
+ const m = c[g];
293
+ if (m.default)
294
+ return m.path;
279
295
  {
280
- const w = v(g.children || []);
281
- if (w)
282
- return w;
296
+ const b = v(m.children || []);
297
+ if (b)
298
+ return b;
283
299
  }
284
300
  }
285
301
  return null;
286
302
  }
287
303
  return v(t.value) || f.indexPath || "/dashboard";
288
304
  }), l = (f, v) => {
289
- const h = [];
305
+ const _ = [];
290
306
  return !f || f.length <= 0 || f.forEach((c) => {
291
307
  if (c.type === 1) {
292
- const m = {
308
+ const g = {
293
309
  code: c.menuCode,
294
310
  name: c.menuName,
295
311
  path: "",
296
312
  title: c.menuName
297
- }, g = v || "";
298
- let w = n.value[g] || [];
299
- w.push(m), n.value[g] = w;
313
+ }, m = v || "";
314
+ let b = n.value[m] || [];
315
+ b.push(g), n.value[m] = b;
300
316
  } else {
301
- const m = [];
302
- let g = c.menuUrl, w = c.isOut || !1;
303
- !w && c.menuUrl && (c.menuUrl.startsWith("http") ? g = "/iframe/" + encodeURIComponent(g) : c.menuUrl.startsWith("keep-alive:") && (g = "/iframe/keep-alive/" + encodeURIComponent(g.split("keep-alive:")[1])));
317
+ const g = [];
318
+ let m = c.menuUrl, b = c.isOut || !1;
319
+ !b && c.menuUrl && (c.menuUrl.startsWith("http") ? m = "/iframe/" + encodeURIComponent(m) : c.menuUrl.startsWith("keep-alive:") && (m = "/iframe/keep-alive/" + encodeURIComponent(m.split("keep-alive:")[1])));
304
320
  const E = {
305
321
  code: c.menuCode,
306
322
  name: c.menuName,
307
- path: g,
323
+ path: m,
308
324
  icon: "grid",
309
325
  closable: c.closable,
310
326
  default: c.isDefault,
311
- out: w,
312
- children: m,
327
+ out: b,
328
+ children: g,
313
329
  title: c.menuName
314
330
  };
315
- if (h.push(E), c.children && c.children.length > 0) {
316
- const M = l(c.children, c.menuUrl);
317
- E.children = M;
331
+ if (_.push(E), c.children && c.children.length > 0) {
332
+ const P = l(c.children, c.menuUrl);
333
+ E.children = P;
318
334
  }
319
335
  }
320
- }), h;
336
+ }), _;
321
337
  }, r = (f) => {
322
- t.value = f, b.set(e, f);
323
- }, u = (f) => {
324
- const v = t.value.findIndex((h) => h.code === "home");
338
+ t.value = f, k.set(e, f);
339
+ }, i = (f) => {
340
+ const v = t.value.findIndex((_) => _.code === "home");
325
341
  v > -1 && t.value.splice(v, 1), t.value.unshift({
326
342
  ...f,
327
343
  code: "home",
328
344
  name: "首页"
329
- }), b.set(e, t.value);
330
- }, d = (f, v) => {
345
+ }), k.set(e, t.value);
346
+ }, u = (f, v) => {
331
347
  if (p(), !(v != null && v.skipIndexMenu)) {
332
- const c = P();
348
+ const c = N();
333
349
  t.value.push({
334
350
  code: "home",
335
351
  name: "首页",
@@ -341,25 +357,25 @@ const X = {
341
357
  title: "首页"
342
358
  });
343
359
  }
344
- const h = l(f);
345
- t.value.push(...h), b.set(e, t.value), b.set(s, n.value);
360
+ const _ = l(f);
361
+ t.value.push(..._), k.set(e, t.value), k.set(s, n.value);
346
362
  }, p = () => {
347
- t.value = [], n.value = {}, b.remove(e), b.remove(s);
363
+ t.value = [], n.value = {}, k.remove(e), k.remove(s);
348
364
  };
349
365
  return {
350
366
  menuList: t,
351
367
  menuBtnListMap: n,
352
368
  hasMenu: o,
353
- index: _,
369
+ index: d,
354
370
  setMenuList: r,
355
- setIndexMenu: u,
356
- setMenuFromRemote: d,
371
+ setIndexMenu: i,
372
+ setMenuFromRemote: u,
357
373
  clearMenu: p
358
374
  };
359
375
  });
360
- function Xe(e) {
361
- const s = P();
362
- return X.post("/user/v1.0/login/by-domain", {
376
+ function Je(e) {
377
+ const s = N();
378
+ return J.post("/user/v1.0/login/by-domain", {
363
379
  appId: s.appId,
364
380
  clientId: s.clientId,
365
381
  uid: e.uid,
@@ -367,95 +383,95 @@ function Xe(e) {
367
383
  code: !0
368
384
  });
369
385
  }
370
- function Je() {
371
- return X.put("/user/v1.0/user/logout");
386
+ function Xe() {
387
+ return J.put("/user/v1.0/user/logout");
372
388
  }
373
- function Fs(e, s) {
374
- return X.get(`/user/v1.0/login/by-code?appId=${e}&code=${s}`);
389
+ function Hs(e, s) {
390
+ return J.get(`/user/v1.0/login/by-code?appId=${e}&code=${s}`);
375
391
  }
376
392
  function Qe() {
377
- return X.get("/user/v1.0/user/get-me");
393
+ return J.get("/user/v1.0/user/get-me");
378
394
  }
379
395
  function Ze() {
380
- const e = P();
381
- return X.get(`/user/v1.0/menu/get-menu?appId=${e.appId}`);
396
+ const e = N();
397
+ return J.get(`/user/v1.0/menu/get-menu?appId=${e.appId}`);
382
398
  }
383
- function le() {
384
- const e = G(), s = he(), t = Ie(), n = $e(), o = q(), _ = C(!1), l = k(() => t.isLoggedIn), r = k(() => n.userInfo), u = k(() => n.userName || ""), d = k(() => o.menuList), p = k(() => o.index), f = async (w, E) => {
385
- _.value = !0;
399
+ function ie() {
400
+ const e = W(), s = le(), t = Te(), n = Se(), o = K(), d = C(!1), l = w(() => t.isLoggedIn), r = w(() => n.userInfo), i = w(() => n.userName || ""), u = w(() => o.menuList), p = w(() => o.index), f = async (b, E) => {
401
+ d.value = !0;
386
402
  try {
387
- g();
388
- const O = (await Xe({ uid: w, password: E })).data;
389
- t.login(O), await h(), await c();
390
- const V = s.query.redirectUrl;
391
- if (V) {
392
- const N = decodeURIComponent(V);
393
- if (N.startsWith("http")) {
394
- const T = O.code;
395
- location.href = N.includes("?") ? `${N}&code=${T}` : `${N}?code=${T}`;
403
+ m();
404
+ const O = (await Je({ uid: b, password: E })).data;
405
+ t.login(O), await _(), await c();
406
+ const z = s.query.redirectUrl;
407
+ if (z) {
408
+ const B = decodeURIComponent(z);
409
+ if (B.startsWith("http")) {
410
+ const S = O.code;
411
+ location.href = B.includes("?") ? `${B}&code=${S}` : `${B}?code=${S}`;
396
412
  } else
397
- await e.replace(N);
413
+ await e.replace(B);
398
414
  } else
399
415
  await e.replace(p.value || "/");
400
- return B.success("登录成功"), { success: !0, data: O };
401
- } catch (M) {
402
- return B.error((M == null ? void 0 : M.message) || "登录失败"), { success: !1, error: M };
416
+ return R.success("登录成功"), { success: !0, data: O };
417
+ } catch (P) {
418
+ return R.error((P == null ? void 0 : P.message) || "登录失败"), { success: !1, error: P };
403
419
  } finally {
404
- _.value = !1;
420
+ d.value = !1;
405
421
  }
406
- }, v = async (w = !0) => {
407
- const E = P();
422
+ }, v = async (b = !0) => {
423
+ const E = N();
408
424
  try {
409
- await Je();
410
- } catch (M) {
411
- console.error("退出登录接口失败", M);
425
+ await Xe();
426
+ } catch (P) {
427
+ console.error("退出登录接口失败", P);
412
428
  } finally {
413
- g(), e.push(E.loginPath || "/login"), w && B.success("退出登录成功");
429
+ m(), e.push(E.loginPath || "/login"), b && R.success("退出登录成功");
414
430
  }
415
- }, h = async () => {
416
- const w = await Qe();
417
- return n.setUserInfo(w.data), w.data;
431
+ }, _ = async () => {
432
+ const b = await Qe();
433
+ return n.setUserInfo(b.data), b.data;
418
434
  }, c = async () => {
419
- const w = await Ze();
420
- return o.setMenuFromRemote(w.data), o.menuList;
421
- }, m = async () => {
435
+ const b = await Ze();
436
+ return o.setMenuFromRemote(b.data), o.menuList;
437
+ }, g = async () => {
422
438
  if (!t.isLoggedIn)
423
439
  return !1;
424
440
  try {
425
- return n.userInfo || await h(), o.hasMenu || await c(), !0;
426
- } catch (w) {
427
- return console.error("初始化应用失败", w), g(), !1;
441
+ return n.userInfo || await _(), o.hasMenu || await c(), !0;
442
+ } catch (b) {
443
+ return console.error("初始化应用失败", b), m(), !1;
428
444
  }
429
- }, g = () => {
445
+ }, m = () => {
430
446
  t.logout(), n.clearUserInfo(), o.clearMenu();
431
447
  };
432
448
  return {
433
449
  // 状态
434
- loading: _,
450
+ loading: d,
435
451
  isLoggedIn: l,
436
452
  userInfo: r,
437
- userName: u,
438
- menuList: d,
453
+ userName: i,
454
+ menuList: u,
439
455
  indexPath: p,
440
456
  // 方法
441
457
  login: f,
442
458
  logout: v,
443
- loadUserInfo: h,
459
+ loadUserInfo: _,
444
460
  loadMenu: c,
445
- initApp: m,
446
- clearAllState: g
461
+ initApp: g,
462
+ clearAllState: m
447
463
  };
448
464
  }
449
- function Ds() {
450
- const e = q(), s = Ie(), t = $e(), n = k(() => s.isLoggedIn), o = k(() => t.userName), _ = k(() => t.userInfo), l = (p) => {
451
- const f = window.location.pathname, h = (e.menuBtnListMap[f] || []).map((c) => c.code);
452
- return Array.isArray(p) ? p.some((c) => h.includes(c)) : h.includes(p);
465
+ function js() {
466
+ const e = K(), s = Te(), t = Se(), n = w(() => s.isLoggedIn), o = w(() => t.userName), d = w(() => t.userInfo), l = (p) => {
467
+ const f = window.location.pathname, _ = (e.menuBtnListMap[f] || []).map((c) => c.code);
468
+ return Array.isArray(p) ? p.some((c) => _.includes(c)) : _.includes(p);
453
469
  };
454
470
  return {
455
471
  // 状态
456
472
  isLoggedIn: n,
457
473
  userName: o,
458
- userInfo: _,
474
+ userInfo: d,
459
475
  // 方法
460
476
  hasPermission: l,
461
477
  hasAnyPermission: (p) => p.some((f) => l(f)),
@@ -466,222 +482,223 @@ function Ds() {
466
482
  }
467
483
  };
468
484
  }
469
- function Se() {
470
- const e = he(), s = G(), t = q(), n = J(), o = C(""), _ = k(() => e.path), l = k(() => n.isCollapsed), r = k(() => t.menuList), u = k(() => t.hasMenu), d = (m, g = "") => {
471
- const w = [];
472
- return m.forEach((E) => {
473
- E.children && E.children.length > 0 ? w.push(...d(E.children, E.title)) : w.push({ ...E, parentTitle: g });
474
- }), w;
475
- }, p = k(() => o.value.trim() ? d(r.value).filter(
476
- (g) => g.title.toLowerCase().includes(o.value.toLowerCase())
477
- ) : []), f = k(() => o.value.trim() ? r.value.map((m) => {
478
- if (m.children && m.children.length > 0) {
479
- const g = m.children.filter(
480
- (w) => w.title.toLowerCase().includes(o.value.toLowerCase())
485
+ function Ee() {
486
+ const e = le(), s = W(), t = K(), n = X(), o = C(""), d = w(() => e.path), l = w(() => n.isCollapsed), r = w(() => t.menuList), i = w(() => t.hasMenu), u = (g, m = "") => {
487
+ const b = [];
488
+ return g.forEach((E) => {
489
+ E.children && E.children.length > 0 ? b.push(...u(E.children, E.title)) : b.push({ ...E, parentTitle: m });
490
+ }), b;
491
+ }, p = w(() => o.value.trim() ? u(r.value).filter(
492
+ (m) => m.title.toLowerCase().includes(o.value.toLowerCase())
493
+ ) : []), f = w(() => o.value.trim() ? r.value.map((g) => {
494
+ if (g.children && g.children.length > 0) {
495
+ const m = g.children.filter(
496
+ (b) => b.title.toLowerCase().includes(o.value.toLowerCase())
481
497
  );
482
- return g.length > 0 ? { ...m, children: g } : null;
498
+ return m.length > 0 ? { ...g, children: m } : null;
483
499
  }
484
- return m.title.toLowerCase().includes(o.value.toLowerCase()) ? m : null;
500
+ return g.title.toLowerCase().includes(o.value.toLowerCase()) ? g : null;
485
501
  }).filter(Boolean) : r.value);
486
502
  return {
487
503
  // 状态
488
504
  searchKeyword: o,
489
- activeMenu: _,
505
+ activeMenu: d,
490
506
  isCollapsed: l,
491
507
  menuList: r,
492
- hasMenu: u,
508
+ hasMenu: i,
493
509
  searchResults: p,
494
510
  filteredMenuList: f,
495
511
  // 方法
496
- flattenMenus: d,
497
- handleMenuSelect: (m) => {
498
- m && m !== e.path && (s.push(m), o.value = "");
512
+ flattenMenus: u,
513
+ handleMenuSelect: (g) => {
514
+ g && g !== e.path && (s.push(g), o.value = "");
499
515
  },
500
- handleSearchItemClick: (m) => {
501
- s.push(m), o.value = "";
516
+ handleSearchItemClick: (g) => {
517
+ s.push(g), o.value = "";
502
518
  },
503
519
  clearSearch: () => {
504
520
  o.value = "";
505
521
  }
506
522
  };
507
523
  }
508
- function Os(e, s = {}) {
509
- const { rules: t, onSubmit: n } = s, o = C(), _ = ue({ ...e }), l = C(!1), r = C(!1), u = C(!1), d = () => {
510
- v(), u.value = !1, r.value = !0;
524
+ function Ks(e, s = {}) {
525
+ const { rules: t, onSubmit: n } = s, o = C(), d = he({ ...e }), l = C(!1), r = C(!1), i = C(!1), u = () => {
526
+ v(), i.value = !1, r.value = !0;
511
527
  }, p = (c) => {
512
- Object.assign(_, c), u.value = !0, r.value = !0;
528
+ Object.assign(d, c), i.value = !0, r.value = !0;
513
529
  }, f = () => {
514
530
  r.value = !1, v();
515
531
  }, v = () => {
516
532
  var c;
517
- Object.keys(e).forEach((m) => {
518
- _[m] = e[m];
533
+ Object.keys(e).forEach((g) => {
534
+ d[g] = e[g];
519
535
  }), (c = o.value) == null || c.resetFields();
520
536
  };
521
537
  return {
522
538
  formRef: o,
523
- formData: _,
539
+ formData: d,
524
540
  rules: t,
525
541
  loading: l,
526
542
  visible: r,
527
- isEdit: u,
528
- openAdd: d,
543
+ isEdit: i,
544
+ openAdd: u,
529
545
  openEdit: p,
530
546
  close: f,
531
547
  resetForm: v,
532
548
  handleSubmit: async () => {
533
549
  var c;
534
550
  try {
535
- await ((c = o.value) == null ? void 0 : c.validate()), l.value = !0, await (n == null ? void 0 : n(_)), f();
536
- } catch (m) {
537
- console.error(m);
551
+ await ((c = o.value) == null ? void 0 : c.validate()), l.value = !0, await (n == null ? void 0 : n(d)), f();
552
+ } catch (g) {
553
+ console.error(g);
538
554
  } finally {
539
555
  l.value = !1;
540
556
  }
541
557
  }
542
558
  };
543
559
  }
544
- function Vs(e) {
545
- const { fetchData: s, defaultPageSize: t = 10 } = e, n = C(!1), o = C([]), _ = C(0), l = C(1), r = C(t), u = ue({}), d = async () => {
560
+ function qs(e) {
561
+ const { fetchData: s, defaultPageSize: t = 10 } = e, n = C(!1), o = C([]), d = C(0), l = C(1), r = C(t), i = he({}), u = async () => {
546
562
  n.value = !0;
547
563
  try {
548
- const g = {
549
- ...u,
564
+ const m = {
565
+ ...i,
550
566
  page: l.value,
551
567
  pageSize: r.value
552
- }, w = await s(g);
553
- o.value = w.list, _.value = w.total;
554
- } catch (g) {
555
- console.error(g);
568
+ }, b = await s(m);
569
+ o.value = b.list, d.value = b.total;
570
+ } catch (m) {
571
+ console.error(m);
556
572
  } finally {
557
573
  n.value = !1;
558
574
  }
559
575
  }, p = () => {
560
- l.value = 1, d();
576
+ l.value = 1, u();
561
577
  }, f = () => {
562
- Object.keys(u).forEach((g) => {
563
- u[g] = void 0;
564
- }), l.value = 1, d();
565
- }, v = (g) => {
566
- l.value = g, d();
567
- }, h = (g) => {
568
- r.value = g, l.value = 1, d();
578
+ Object.keys(i).forEach((m) => {
579
+ i[m] = void 0;
580
+ }), l.value = 1, u();
581
+ }, v = (m) => {
582
+ l.value = m, u();
583
+ }, _ = (m) => {
584
+ r.value = m, l.value = 1, u();
569
585
  }, c = () => {
570
- d();
571
- }, m = k(() => ({
586
+ u();
587
+ }, g = w(() => ({
572
588
  current: l.value,
573
589
  pageSize: r.value,
574
- total: _.value
590
+ total: d.value
575
591
  }));
576
592
  return {
577
593
  loading: n,
578
594
  data: o,
579
- total: _,
595
+ total: d,
580
596
  currentPage: l,
581
597
  pageSize: r,
582
- searchParams: u,
583
- pagination: m,
584
- getData: d,
598
+ searchParams: i,
599
+ pagination: g,
600
+ getData: u,
585
601
  handleSearch: p,
586
602
  handleReset: f,
587
603
  handlePageChange: v,
588
- handleSizeChange: h,
604
+ handleSizeChange: _,
589
605
  refresh: c
590
606
  };
591
607
  }
592
608
  const et = { class: "sidebar" }, tt = { class: "sidebar__logo" }, st = { key: 1 }, nt = {
593
609
  key: 0,
594
610
  class: "sidebar__user"
595
- }, ot = { class: "sidebar__user-info" }, at = { class: "sidebar__user-name" }, rt = { class: "sidebar__user-role" }, lt = /* @__PURE__ */ D({
611
+ }, ot = { class: "sidebar__user-info" }, at = { class: "sidebar__user-name" }, rt = { class: "sidebar__user-role" }, lt = /* @__PURE__ */ F({
596
612
  __name: "Sidebar",
597
613
  setup(e) {
598
- const { logout: s, userName: t, userInfo: n } = le(), o = P(), {
599
- activeMenu: _,
614
+ const { logout: s, userName: t, userInfo: n } = ie(), o = N(), {
615
+ activeMenu: d,
600
616
  isCollapsed: l,
601
617
  filteredMenuList: r,
602
- handleMenuSelect: u
603
- } = Se();
604
- return (d, p) => {
618
+ handleMenuSelect: i
619
+ } = Ee();
620
+ return (u, p) => {
605
621
  var f;
606
622
  return y(), L("div", et, [
607
623
  a("div", tt, [
608
- p[0] || (p[0] = a("img", {
609
- src: Le,
624
+ p[1] || (p[1] = a("img", {
625
+ src: $e,
610
626
  alt: "Logo",
611
627
  class: "sidebar__logo-img"
612
628
  }, null, -1)),
613
- pe(a("span", { class: "sidebar__logo-text" }, S(i(o).appName), 513), [
614
- [ve, !i(l)]
629
+ _e(a("span", { class: "sidebar__logo-text" }, T(h(o).appName), 513), [
630
+ [ve, !h(l)]
615
631
  ])
616
632
  ]),
617
- x(i(ye), {
618
- "default-active": i(_),
619
- collapse: i(l),
633
+ x(h(be), {
634
+ modelValue: h(d),
635
+ "onUpdate:modelValue": p[0] || (p[0] = (v) => ge(d) ? d.value = v : null),
636
+ collapse: h(l),
620
637
  "collapse-transition": !1,
621
638
  class: "sidebar__menu",
622
- onSelect: i(u)
639
+ onSelect: h(i)
623
640
  }, {
624
641
  default: I(() => [
625
- (y(!0), L(R, null, K(i(r), (v) => (y(), L(R, {
642
+ (y(!0), L(M, null, j(h(r), (v) => (y(), L(M, {
626
643
  key: v.path
627
644
  }, [
628
- v.children && v.children.length > 0 ? (y(), F(i(we), {
645
+ v.children && v.children.length > 0 ? (y(), V(h(ke), {
629
646
  key: 0,
630
647
  index: v.path,
631
648
  icon: "grid"
632
649
  }, {
633
650
  title: I(() => [
634
- pe(a("span", null, S(v.title), 513), [
635
- [ve, !i(l)]
651
+ _e(a("span", null, T(v.title), 513), [
652
+ [ve, !h(l)]
636
653
  ])
637
654
  ]),
638
655
  default: I(() => [
639
- (y(!0), L(R, null, K(v.children, (h) => (y(), F(i(se), {
640
- key: h.path,
641
- index: h.path,
656
+ (y(!0), L(M, null, j(v.children, (_) => (y(), V(h(se), {
657
+ key: _.path,
658
+ index: _.path,
642
659
  icon: "grid"
643
660
  }, {
644
661
  default: I(() => [
645
- a("span", null, S(h.title), 1)
662
+ a("span", null, T(_.title), 1)
646
663
  ]),
647
664
  _: 2
648
665
  }, 1032, ["index"]))), 128))
649
666
  ]),
650
667
  _: 2
651
- }, 1032, ["index"])) : (y(), F(i(se), {
668
+ }, 1032, ["index"])) : (y(), V(h(se), {
652
669
  key: 1,
653
670
  index: v.path,
654
671
  icon: "grid"
655
672
  }, {
656
673
  default: I(() => [
657
- i(l) ? (y(), F(i(Ee), {
674
+ h(l) ? (y(), V(h(Pe), {
658
675
  key: 0,
659
676
  content: v.title,
660
677
  placement: "right"
661
678
  }, {
662
- default: I(() => [...p[1] || (p[1] = [
679
+ default: I(() => [...p[2] || (p[2] = [
663
680
  a("span", null, null, -1)
664
681
  ])]),
665
682
  _: 1
666
- }, 8, ["content"])) : (y(), L("span", st, S(v.title), 1))
683
+ }, 8, ["content"])) : (y(), L("span", st, T(v.title), 1))
667
684
  ]),
668
685
  _: 2
669
686
  }, 1032, ["index"]))
670
687
  ], 64))), 128))
671
688
  ]),
672
689
  _: 1
673
- }, 8, ["default-active", "collapse", "onSelect"]),
674
- i(l) ? H("", !0) : (y(), L("div", nt, [
690
+ }, 8, ["modelValue", "collapse", "onSelect"]),
691
+ h(l) ? D("", !0) : (y(), L("div", nt, [
675
692
  a("div", ot, [
676
- a("span", at, S(i(t) || "用户"), 1),
677
- a("span", rt, S(((f = i(n)) == null ? void 0 : f.departmentName) || ""), 1)
693
+ a("span", at, T(h(t) || "用户"), 1),
694
+ a("span", rt, T(((f = h(n)) == null ? void 0 : f.departmentName) || ""), 1)
678
695
  ]),
679
- x(i(re), {
696
+ x(h(ce), {
680
697
  type: "text",
681
698
  size: "small",
682
- onClick: i(s)
699
+ onClick: h(s)
683
700
  }, {
684
- default: I(() => [...p[2] || (p[2] = [
701
+ default: I(() => [...p[3] || (p[3] = [
685
702
  oe("退出", -1)
686
703
  ])]),
687
704
  _: 1
@@ -695,14 +712,14 @@ const et = { class: "sidebar" }, tt = { class: "sidebar__logo" }, st = { key: 1
695
712
  for (const [n, o] of s)
696
713
  t[n] = o;
697
714
  return t;
698
- }, ct = /* @__PURE__ */ A(lt, [["__scopeId", "data-v-363654cb"]]), it = `<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
715
+ }, ct = /* @__PURE__ */ A(lt, [["__scopeId", "data-v-d6c5528d"]]), it = `<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
699
716
  <rect x="3" y="3" width="18" height="4" rx="1"/>
700
717
  <rect x="3" y="9" width="6" height="12" rx="1"/>
701
718
  <rect x="11" y="9" width="10" height="12" rx="1"/>
702
719
  </svg>`, ut = `<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
703
720
  <rect x="3" y="3" width="18" height="4" rx="1"/>
704
721
  <rect x="3" y="9" width="18" height="12" rx="1"/>
705
- </svg>`, dt = { class: "setting-drawer" }, ht = { class: "setting-section" }, _t = { class: "setting-section__content" }, pt = { class: "layout-options" }, vt = ["onClick"], ft = ["innerHTML"], gt = { class: "layout-option__label" }, mt = { class: "setting-section" }, yt = { class: "setting-section__content" }, wt = { class: "setting-item" }, bt = /* @__PURE__ */ D({
722
+ </svg>`, dt = { class: "setting-drawer" }, ht = { class: "setting-section" }, pt = { class: "setting-section__content" }, _t = { class: "layout-options" }, vt = ["onClick"], ft = ["innerHTML"], mt = { class: "layout-option__label" }, gt = { class: "setting-section" }, yt = { class: "setting-section__content" }, wt = { class: "setting-item" }, bt = { class: "setting-item" }, kt = /* @__PURE__ */ F({
706
723
  inheritAttrs: !1,
707
724
  __name: "index",
708
725
  props: {
@@ -710,19 +727,19 @@ const et = { class: "sidebar" }, tt = { class: "sidebar__logo" }, st = { key: 1
710
727
  },
711
728
  emits: ["update:visible"],
712
729
  setup(e, { emit: s }) {
713
- const t = J(), n = {
730
+ const t = X(), n = {
714
731
  navLeft: it,
715
732
  navTop: ut
716
733
  }, o = [
717
734
  { value: "sidebar", label: "左侧导航", icon: "navLeft" },
718
735
  { value: "top", label: "顶部导航", icon: "navTop" }
719
- ], _ = k({
736
+ ], d = w({
720
737
  get: () => t.layout,
721
- set: (u) => t.setLayout(u)
738
+ set: (i) => t.setLayout(i)
722
739
  }), l = s, r = () => {
723
740
  l("update:visible", !1);
724
741
  };
725
- return (u, d) => (y(), F(i(Ue), {
742
+ return (i, u) => (y(), V(h(Me), {
726
743
  "model-value": e.visible,
727
744
  title: "皮肤设置",
728
745
  direction: "rtl",
@@ -732,31 +749,38 @@ const et = { class: "sidebar" }, tt = { class: "sidebar__logo" }, st = { key: 1
732
749
  default: I(() => [
733
750
  a("div", dt, [
734
751
  a("div", ht, [
735
- d[0] || (d[0] = a("h4", { class: "setting-section__title" }, "导航模式", -1)),
736
- a("div", _t, [
737
- a("div", pt, [
738
- (y(), L(R, null, K(o, (p) => a("div", {
752
+ u[0] || (u[0] = a("h4", { class: "setting-section__title" }, "导航模式", -1)),
753
+ a("div", pt, [
754
+ a("div", _t, [
755
+ (y(), L(M, null, j(o, (p) => a("div", {
739
756
  key: p.value,
740
- class: de(["layout-option", { "is-active": _.value === p.value }]),
741
- onClick: (f) => _.value = p.value
757
+ class: ae(["layout-option", { "is-active": d.value === p.value }]),
758
+ onClick: (f) => d.value = p.value
742
759
  }, [
743
760
  a("div", {
744
761
  class: "layout-option__preview",
745
762
  innerHTML: n[p.icon]
746
763
  }, null, 8, ft),
747
- a("span", gt, S(p.label), 1)
764
+ a("span", mt, T(p.label), 1)
748
765
  ], 10, vt)), 64))
749
766
  ])
750
767
  ])
751
768
  ]),
752
- a("div", mt, [
753
- d[2] || (d[2] = a("h4", { class: "setting-section__title" }, "界面设置", -1)),
769
+ a("div", gt, [
770
+ u[3] || (u[3] = a("h4", { class: "setting-section__title" }, "界面设置", -1)),
754
771
  a("div", yt, [
755
772
  a("div", wt, [
756
- d[1] || (d[1] = a("span", { class: "setting-item__label" }, "灰度模式", -1)),
757
- x(i(Ve), {
758
- "model-value": i(t).isGrayscale,
759
- "onUpdate:modelValue": i(t).setGrayscale
773
+ u[1] || (u[1] = a("span", { class: "setting-item__label" }, "显示面包屑", -1)),
774
+ x(h(fe), {
775
+ "model-value": h(t).showBreadcrumb,
776
+ "onUpdate:modelValue": h(t).toggleBreadcrumb
777
+ }, null, 8, ["model-value", "onUpdate:modelValue"])
778
+ ]),
779
+ a("div", bt, [
780
+ u[2] || (u[2] = a("span", { class: "setting-item__label" }, "灰度模式", -1)),
781
+ x(h(fe), {
782
+ "model-value": h(t).isGrayscale,
783
+ "onUpdate:modelValue": h(t).setGrayscale
760
784
  }, null, 8, ["model-value", "onUpdate:modelValue"])
761
785
  ])
762
786
  ])
@@ -766,113 +790,160 @@ const et = { class: "sidebar" }, tt = { class: "sidebar__logo" }, st = { key: 1
766
790
  _: 1
767
791
  }, 8, ["model-value"]));
768
792
  }
769
- }), kt = /* @__PURE__ */ A(bt, [["__scopeId", "data-v-14d31c8c"]]), Ct = { class: "header" }, xt = { class: "header__left" }, Lt = { class: "header__right" }, It = {
793
+ }), Ct = /* @__PURE__ */ A(kt, [["__scopeId", "data-v-3a74bfd0"]]), Lt = {
794
+ key: 0,
795
+ class: "breadcrumb"
796
+ }, xt = ["onClick"], It = /* @__PURE__ */ F({
797
+ __name: "Breadcrumb",
798
+ setup(e) {
799
+ const s = le(), t = W(), n = K(), o = w(() => {
800
+ var p;
801
+ const l = s.path, r = n.menuList, i = (f, v, _ = []) => {
802
+ for (const c of f) {
803
+ const g = {
804
+ title: c.title,
805
+ path: c.path,
806
+ isLast: !1
807
+ };
808
+ if (c.path === v)
809
+ return g.isLast = !0, [..._, g];
810
+ if (c.children && c.children.length > 0) {
811
+ const m = i(c.children, v, [..._, g]);
812
+ if (m)
813
+ return m;
814
+ }
815
+ }
816
+ return null;
817
+ }, u = i(r, l);
818
+ return u && u.length > 0 ? u : (p = s.meta) != null && p.title ? [{ title: s.meta.title, path: l, isLast: !0 }] : [];
819
+ }), d = (l) => {
820
+ !l.isLast && l.path && t.push(l.path);
821
+ };
822
+ return (l, r) => o.value.length > 0 ? (y(), L("div", Lt, [
823
+ (y(!0), L(M, null, j(o.value, (i, u) => (y(), L(M, {
824
+ key: i.path
825
+ }, [
826
+ a("span", {
827
+ class: ae(["breadcrumb__item", { "breadcrumb__item--link": !i.isLast }]),
828
+ onClick: (p) => d(i)
829
+ }, T(i.title), 11, xt),
830
+ u < o.value.length - 1 ? (y(), V(h(q), {
831
+ key: 0,
832
+ name: "arrow-right",
833
+ size: 12,
834
+ class: "breadcrumb__separator"
835
+ })) : D("", !0)
836
+ ], 64))), 128))
837
+ ])) : D("", !0);
838
+ }
839
+ }), $t = /* @__PURE__ */ A(It, [["__scopeId", "data-v-31468670"]]), Tt = { class: "header" }, St = { class: "header__left" }, Et = { class: "header__right" }, Ut = {
770
840
  key: 0,
771
841
  class: "header__search-results"
772
- }, $t = ["onClick"], St = { class: "header__search-info" }, Tt = { class: "header__search-title" }, Et = {
842
+ }, Pt = ["onClick"], Mt = { class: "header__search-info" }, Nt = { class: "header__search-title" }, Bt = {
773
843
  key: 0,
774
844
  class: "header__search-parent"
775
- }, Ut = ["title"], Mt = { class: "header__avatar" }, Pt = { class: "header__user-name" }, Nt = {
845
+ }, Rt = ["title"], At = { class: "header__avatar" }, Vt = { class: "header__user-name" }, Dt = {
776
846
  key: 0,
777
847
  class: "header__dropdown"
778
- }, Rt = { class: "header__dropdown-header" }, At = { class: "header__dropdown-avatar" }, Bt = { class: "header__dropdown-info" }, Ft = { class: "header__dropdown-name" }, Dt = { class: "header__dropdown-role" }, Ot = { class: "header__dropdown-menu" }, Vt = /* @__PURE__ */ D({
848
+ }, Ft = { class: "header__dropdown-header" }, Ot = { class: "header__dropdown-avatar" }, zt = { class: "header__dropdown-info" }, Ht = { class: "header__dropdown-name" }, jt = { class: "header__dropdown-role" }, Kt = { class: "header__dropdown-menu" }, qt = /* @__PURE__ */ F({
779
849
  __name: "Header",
780
850
  props: {
781
851
  showCollapse: { type: Boolean }
782
852
  },
783
853
  setup(e) {
784
- const s = J(), { logout: t, userName: n, userInfo: o } = le(), {
785
- searchKeyword: _,
854
+ const s = X(), { logout: t, userName: n, userInfo: o } = ie(), {
855
+ searchKeyword: d,
786
856
  searchResults: l,
787
857
  handleSearchItemClick: r
788
- } = Se(), u = C(!1), d = C(null), p = C(null), f = C(!1), v = C(!1), h = k(() => n.value || "用户"), c = () => {
858
+ } = Ee(), i = C(!1), u = C(null), p = C(null), f = C(!1), v = C(!1), _ = w(() => n.value || "用户"), c = () => {
789
859
  s.toggleCollapse();
790
- }, m = () => {
791
- s.toggleTheme();
792
860
  }, g = () => {
861
+ s.toggleTheme();
862
+ }, m = () => {
793
863
  document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
794
- }, w = () => {
864
+ }, b = () => {
795
865
  f.value = !!document.fullscreenElement;
796
866
  }, E = () => {
797
- u.value = !u.value;
798
- }, M = () => {
799
- u.value = !1;
867
+ i.value = !i.value;
868
+ }, P = () => {
869
+ i.value = !1;
800
870
  }, O = async () => {
801
- M(), await t();
802
- }, V = (N) => {
803
- d.value && !d.value.contains(N.target) && M(), p.value && !p.value.contains(N.target) && (_.value = "");
871
+ P(), await t();
872
+ }, z = (B) => {
873
+ u.value && !u.value.contains(B.target) && P(), p.value && !p.value.contains(B.target) && (d.value = "");
804
874
  };
805
- return Pe(() => {
806
- document.addEventListener("click", V), document.addEventListener("fullscreenchange", w);
807
- }), Ne(() => {
808
- document.removeEventListener("click", V), document.removeEventListener("fullscreenchange", w);
809
- }), (N, T) => (y(), L("div", Ct, [
810
- a("div", xt, [
875
+ return Be(() => {
876
+ document.addEventListener("click", z), document.addEventListener("fullscreenchange", b);
877
+ }), Re(() => {
878
+ document.removeEventListener("click", z), document.removeEventListener("fullscreenchange", b);
879
+ }), (B, S) => (y(), L("div", Tt, [
880
+ a("div", St, [
811
881
  e.showCollapse ? (y(), L("div", {
812
882
  key: 0,
813
883
  class: "header__collapse",
814
884
  onClick: c
815
- }, [...T[3] || (T[3] = [
885
+ }, [...S[3] || (S[3] = [
816
886
  a("span", null, "☰", -1)
817
- ])])) : H("", !0)
887
+ ])])) : D("", !0),
888
+ h(s).showBreadcrumb ? (y(), V($t, { key: 1 })) : D("", !0)
818
889
  ]),
819
- a("div", Lt, [
890
+ a("div", Et, [
820
891
  a("div", {
821
892
  class: "header__search",
822
893
  ref_key: "searchRef",
823
894
  ref: p
824
895
  }, [
825
- x(i(ie), {
826
- modelValue: i(_),
827
- "onUpdate:modelValue": T[0] || (T[0] = (U) => Re(_) ? _.value = U : null),
896
+ x(h(de), {
897
+ modelValue: h(d),
898
+ "onUpdate:modelValue": S[0] || (S[0] = (U) => ge(d) ? d.value = U : null),
828
899
  placeholder: "搜索菜单...",
829
900
  size: "small",
830
901
  clearable: ""
831
902
  }, null, 8, ["modelValue"]),
832
- i(l).length > 0 ? (y(), L("div", It, [
833
- (y(!0), L(R, null, K(i(l), (U) => (y(), L("div", {
903
+ h(l).length > 0 ? (y(), L("div", Ut, [
904
+ (y(!0), L(M, null, j(h(l), (U) => (y(), L("div", {
834
905
  key: U.path,
835
906
  class: "header__search-item",
836
- onClick: ($) => i(r)(U.path)
907
+ onClick: ($) => h(r)(U.path)
837
908
  }, [
838
- x(i(j), {
909
+ x(h(q), {
839
910
  name: "grid",
840
911
  size: 16,
841
912
  class: "header__search-icon"
842
913
  }),
843
- a("div", St, [
844
- a("span", Tt, S(U.title), 1),
845
- U.parentTitle ? (y(), L("span", Et, S(U.parentTitle), 1)) : H("", !0)
914
+ a("div", Mt, [
915
+ a("span", Nt, T(U.title), 1),
916
+ U.parentTitle ? (y(), L("span", Bt, T(U.parentTitle), 1)) : D("", !0)
846
917
  ])
847
- ], 8, $t))), 128))
848
- ])) : H("", !0)
918
+ ], 8, Pt))), 128))
919
+ ])) : D("", !0)
849
920
  ], 512),
850
921
  a("div", {
851
922
  class: "header__action",
852
- onClick: g,
923
+ onClick: m,
853
924
  title: f.value ? "退出全屏" : "全屏"
854
925
  }, [
855
- x(i(j), {
926
+ x(h(q), {
856
927
  name: f.value ? "fullscreen-exit" : "fullscreen",
857
928
  size: 16
858
929
  }, null, 8, ["name"])
859
- ], 8, Ut),
930
+ ], 8, Rt),
860
931
  a("div", {
861
932
  class: "header__action",
862
- onClick: m,
933
+ onClick: g,
863
934
  title: "切换主题"
864
935
  }, [
865
- x(i(j), {
866
- name: i(s).isDark ? "sun" : "moon",
936
+ x(h(q), {
937
+ name: h(s).isDark ? "sun" : "moon",
867
938
  size: 16
868
939
  }, null, 8, ["name"])
869
940
  ]),
870
941
  a("div", {
871
942
  class: "header__action",
872
- onClick: T[1] || (T[1] = (U) => v.value = !0),
943
+ onClick: S[1] || (S[1] = (U) => v.value = !0),
873
944
  title: "皮肤设置"
874
945
  }, [
875
- x(i(j), {
946
+ x(h(q), {
876
947
  name: "skin",
877
948
  size: 16
878
949
  })
@@ -880,105 +951,105 @@ const et = { class: "sidebar" }, tt = { class: "sidebar__logo" }, st = { key: 1
880
951
  a("div", {
881
952
  class: "header__user",
882
953
  ref_key: "dropdownRef",
883
- ref: d
954
+ ref: u
884
955
  }, [
885
956
  a("div", {
886
957
  class: "header__user-trigger",
887
958
  onClick: Ae(E, ["stop"])
888
959
  }, [
889
- a("div", Mt, [
890
- a("span", null, S(h.value.charAt(0)), 1)
960
+ a("div", At, [
961
+ a("span", null, T(_.value.charAt(0)), 1)
891
962
  ]),
892
- a("span", Pt, S(h.value), 1),
963
+ a("span", Vt, T(_.value), 1),
893
964
  a("span", {
894
- class: de(["header__user-arrow", { "is-active": u.value }])
965
+ class: ae(["header__user-arrow", { "is-active": i.value }])
895
966
  }, "▼", 2)
896
967
  ]),
897
- x(Be, { name: "dropdown" }, {
968
+ x(Ve, { name: "dropdown" }, {
898
969
  default: I(() => {
899
970
  var U;
900
971
  return [
901
- u.value ? (y(), L("div", Nt, [
902
- a("div", Rt, [
903
- a("div", At, [
904
- a("span", null, S(h.value.charAt(0)), 1)
972
+ i.value ? (y(), L("div", Dt, [
973
+ a("div", Ft, [
974
+ a("div", Ot, [
975
+ a("span", null, T(_.value.charAt(0)), 1)
905
976
  ]),
906
- a("div", Bt, [
907
- a("div", Ft, S(h.value), 1),
908
- a("div", Dt, S(((U = i(o)) == null ? void 0 : U.departmentName) || ""), 1)
977
+ a("div", zt, [
978
+ a("div", Ht, T(_.value), 1),
979
+ a("div", jt, T(((U = h(o)) == null ? void 0 : U.departmentName) || ""), 1)
909
980
  ])
910
981
  ]),
911
- T[5] || (T[5] = a("div", { class: "header__dropdown-divider" }, null, -1)),
912
- a("div", Ot, [
982
+ S[5] || (S[5] = a("div", { class: "header__dropdown-divider" }, null, -1)),
983
+ a("div", Kt, [
913
984
  a("div", {
914
985
  class: "header__dropdown-item header__dropdown-item--danger",
915
986
  onClick: O
916
987
  }, [
917
- x(i(j), {
988
+ x(h(q), {
918
989
  name: "logout",
919
990
  size: 16
920
991
  }),
921
- T[4] || (T[4] = a("span", null, "退出登录", -1))
992
+ S[4] || (S[4] = a("span", null, "退出登录", -1))
922
993
  ])
923
994
  ])
924
- ])) : H("", !0)
995
+ ])) : D("", !0)
925
996
  ];
926
997
  }),
927
998
  _: 1
928
999
  })
929
1000
  ], 512)
930
1001
  ]),
931
- x(kt, {
1002
+ x(Ct, {
932
1003
  visible: v.value,
933
- "onUpdate:visible": T[2] || (T[2] = (U) => v.value = U)
1004
+ "onUpdate:visible": S[2] || (S[2] = (U) => v.value = U)
934
1005
  }, null, 8, ["visible"])
935
1006
  ]));
936
1007
  }
937
- }), fe = /* @__PURE__ */ A(Vt, [["__scopeId", "data-v-175c2432"]]), zt = { class: "top-menu" }, Ht = /* @__PURE__ */ D({
1008
+ }), me = /* @__PURE__ */ A(qt, [["__scopeId", "data-v-b15434d8"]]), Wt = { class: "top-menu" }, Yt = /* @__PURE__ */ F({
938
1009
  __name: "TopMenu",
939
1010
  setup(e) {
940
- const s = he(), t = G(), n = q(), o = k(() => s.path), _ = (l) => {
1011
+ const s = le(), t = W(), n = K(), o = w(() => s.path), d = (l) => {
941
1012
  t.push(l);
942
1013
  };
943
- return (l, r) => (y(), L("div", zt, [
944
- x(i(ye), {
1014
+ return (l, r) => (y(), L("div", Wt, [
1015
+ x(h(be), {
945
1016
  "default-active": o.value,
946
1017
  mode: "horizontal",
947
1018
  class: "top-menu__inner",
948
- onSelect: _
1019
+ onSelect: d
949
1020
  }, {
950
1021
  default: I(() => [
951
- (y(!0), L(R, null, K(i(n).menuList, (u) => (y(), L(R, {
952
- key: u.path
1022
+ (y(!0), L(M, null, j(h(n).menuList, (i) => (y(), L(M, {
1023
+ key: i.path
953
1024
  }, [
954
- u.children && u.children.length > 0 ? (y(), F(i(we), {
1025
+ i.children && i.children.length > 0 ? (y(), V(h(ke), {
955
1026
  key: 0,
956
- index: u.path,
1027
+ index: i.path,
957
1028
  icon: "grid"
958
1029
  }, {
959
1030
  title: I(() => [
960
- a("span", null, S(u.title), 1)
1031
+ a("span", null, T(i.title), 1)
961
1032
  ]),
962
1033
  default: I(() => [
963
- (y(!0), L(R, null, K(u.children, (d) => (y(), F(i(se), {
964
- key: d.path,
965
- index: d.path,
1034
+ (y(!0), L(M, null, j(i.children, (u) => (y(), V(h(se), {
1035
+ key: u.path,
1036
+ index: u.path,
966
1037
  icon: "grid"
967
1038
  }, {
968
1039
  default: I(() => [
969
- a("span", null, S(d.title), 1)
1040
+ a("span", null, T(u.title), 1)
970
1041
  ]),
971
1042
  _: 2
972
1043
  }, 1032, ["index"]))), 128))
973
1044
  ]),
974
1045
  _: 2
975
- }, 1032, ["index"])) : (y(), F(i(se), {
1046
+ }, 1032, ["index"])) : (y(), V(h(se), {
976
1047
  key: 1,
977
- index: u.path,
1048
+ index: i.path,
978
1049
  icon: "grid"
979
1050
  }, {
980
1051
  default: I(() => [
981
- a("span", null, S(u.title), 1)
1052
+ a("span", null, T(i.title), 1)
982
1053
  ]),
983
1054
  _: 2
984
1055
  }, 1032, ["index"]))
@@ -988,78 +1059,78 @@ const et = { class: "sidebar" }, tt = { class: "sidebar__logo" }, st = { key: 1
988
1059
  }, 8, ["default-active"])
989
1060
  ]));
990
1061
  }
991
- }), Kt = /* @__PURE__ */ A(Ht, [["__scopeId", "data-v-f9b502d8"]]), qt = { class: "layout__main" }, Wt = { class: "layout__content" }, jt = { class: "layout__top" }, Yt = { class: "layout__content" }, Gt = /* @__PURE__ */ D({
1062
+ }), Gt = /* @__PURE__ */ A(Yt, [["__scopeId", "data-v-f9b502d8"]]), Jt = { class: "layout__main" }, Xt = { class: "layout__content" }, Qt = { class: "layout__top" }, Zt = { class: "layout__content" }, es = /* @__PURE__ */ F({
992
1063
  __name: "index",
993
1064
  setup(e) {
994
- const s = J(), t = k(
1065
+ const s = X(), t = w(
995
1066
  () => s.isCollapsed ? "64px" : "210px"
996
- ), n = k(() => s.layout), o = k(() => n.value === "sidebar"), _ = k(() => n.value === "sidebar");
1067
+ ), n = w(() => s.layout), o = w(() => n.value === "sidebar"), d = w(() => n.value === "sidebar");
997
1068
  return (l, r) => {
998
- const u = Fe("router-view");
1069
+ const i = De("router-view");
999
1070
  return y(), L("div", {
1000
- class: de(["layout", `layout--${n.value}`])
1071
+ class: ae(["layout", `layout--${n.value}`])
1001
1072
  }, [
1002
- o.value ? (y(), L(R, { key: 0 }, [
1073
+ o.value ? (y(), L(M, { key: 0 }, [
1003
1074
  a("aside", {
1004
1075
  class: "layout__aside",
1005
- style: De({ width: t.value })
1076
+ style: Fe({ width: t.value })
1006
1077
  }, [
1007
1078
  x(ct)
1008
1079
  ], 4),
1009
- a("div", qt, [
1010
- x(fe, {
1080
+ a("div", Jt, [
1081
+ x(me, {
1011
1082
  class: "layout__header",
1012
- "show-collapse": _.value
1083
+ "show-collapse": d.value
1013
1084
  }, null, 8, ["show-collapse"]),
1014
- a("main", Wt, [
1015
- x(u)
1085
+ a("main", Xt, [
1086
+ x(i)
1016
1087
  ])
1017
1088
  ])
1018
- ], 64)) : n.value === "top" ? (y(), L(R, { key: 1 }, [
1019
- a("div", jt, [
1089
+ ], 64)) : n.value === "top" ? (y(), L(M, { key: 1 }, [
1090
+ a("div", Qt, [
1020
1091
  r[0] || (r[0] = a("div", { class: "layout__logo" }, [
1021
1092
  a("img", {
1022
- src: Le,
1093
+ src: $e,
1023
1094
  alt: "Logo",
1024
1095
  class: "layout__logo-img"
1025
1096
  })
1026
1097
  ], -1)),
1027
- x(Kt),
1028
- x(fe, {
1098
+ x(Gt),
1099
+ x(me, {
1029
1100
  class: "layout__header--top",
1030
1101
  "show-collapse": !1
1031
1102
  })
1032
1103
  ]),
1033
- a("main", Yt, [
1034
- x(u)
1104
+ a("main", Zt, [
1105
+ x(i)
1035
1106
  ])
1036
- ], 64)) : H("", !0)
1107
+ ], 64)) : D("", !0)
1037
1108
  ], 2);
1038
1109
  };
1039
1110
  }
1040
- }), Xt = /* @__PURE__ */ A(Gt, [["__scopeId", "data-v-a2789d75"]]), Jt = {}, Qt = { class: "tabs-wrapper" };
1041
- function Zt(e, s) {
1042
- return y(), L("div", Qt);
1111
+ }), ts = /* @__PURE__ */ A(es, [["__scopeId", "data-v-a2789d75"]]), ss = {}, ns = { class: "tabs-wrapper" };
1112
+ function os(e, s) {
1113
+ return y(), L("div", ns);
1043
1114
  }
1044
- const zs = /* @__PURE__ */ A(Jt, [["render", Zt], ["__scopeId", "data-v-3b1e382a"]]), es = {}, ts = { class: "footer" };
1045
- function ss(e, s) {
1046
- return y(), L("div", ts, [...s[0] || (s[0] = [
1115
+ const Ws = /* @__PURE__ */ A(ss, [["render", os], ["__scopeId", "data-v-3b1e382a"]]), as = {}, rs = { class: "footer" };
1116
+ function ls(e, s) {
1117
+ return y(), L("div", rs, [...s[0] || (s[0] = [
1047
1118
  a("span", null, "Copyright © 2024 Xto Demo. All Rights Reserved.", -1)
1048
1119
  ])]);
1049
1120
  }
1050
- const Hs = /* @__PURE__ */ A(es, [["render", ss], ["__scopeId", "data-v-317ae311"]]), ns = `<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
1121
+ const Ys = /* @__PURE__ */ A(as, [["render", ls], ["__scopeId", "data-v-317ae311"]]), cs = `<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
1051
1122
  <circle cx="12" cy="8" r="4"/>
1052
1123
  <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/>
1053
- </svg>`, os = `<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
1124
+ </svg>`, is = `<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
1054
1125
  <rect x="3" y="11" width="18" height="11" rx="2" ry="2"/>
1055
1126
  <path d="M7 11V7a5 5 0 0 1 10 0v4"/>
1056
- </svg>`, as = `<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
1127
+ </svg>`, us = `<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
1057
1128
  <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>
1058
1129
  <circle cx="12" cy="12" r="3"/>
1059
- </svg>`, rs = `<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
1130
+ </svg>`, ds = `<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
1060
1131
  <path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/>
1061
1132
  <line x1="1" y1="1" x2="23" y2="23"/>
1062
- </svg>`, ls = { class: "login" }, cs = { class: "login__container" }, is = { class: "login__header" }, us = ["src"], ds = { class: "login__title" }, hs = { class: "login__subtitle" }, _s = ["innerHTML"], ps = ["innerHTML"], vs = ["innerHTML"], fs = /* @__PURE__ */ D({
1133
+ </svg>`, hs = { class: "login" }, ps = { class: "login__container" }, _s = { class: "login__header" }, vs = ["src"], fs = { class: "login__title" }, ms = { class: "login__subtitle" }, gs = ["innerHTML"], ys = ["innerHTML"], ws = ["innerHTML"], bs = /* @__PURE__ */ F({
1063
1134
  __name: "index",
1064
1135
  props: {
1065
1136
  logo: {},
@@ -1068,56 +1139,56 @@ const Hs = /* @__PURE__ */ A(es, [["render", ss], ["__scopeId", "data-v-317ae311
1068
1139
  },
1069
1140
  emits: ["success", "error"],
1070
1141
  setup(e, { emit: s }) {
1071
- const t = s, { login: n, loading: o } = le(), _ = P(), l = ue({
1142
+ const t = s, { login: n, loading: o } = ie(), d = N(), l = he({
1072
1143
  uid: "",
1073
1144
  password: ""
1074
- }), r = C(!1), u = {
1145
+ }), r = C(!1), i = {
1075
1146
  uid: [
1076
1147
  { required: !0, message: "请输入账号", trigger: "blur" }
1077
1148
  ],
1078
1149
  password: [
1079
1150
  { required: !0, message: "请输入密码", trigger: "blur" }
1080
1151
  ]
1081
- }, d = C(), p = {
1082
- user: ns,
1083
- lock: os,
1084
- eye: as,
1085
- eyeOff: rs
1152
+ }, u = C(), p = {
1153
+ user: cs,
1154
+ lock: is,
1155
+ eye: us,
1156
+ eyeOff: ds
1086
1157
  }, f = async () => {
1087
1158
  var v;
1088
1159
  try {
1089
- await ((v = d.value) == null ? void 0 : v.validate());
1090
- const h = await n(l.uid, l.password);
1091
- h.success ? t("success", h.data) : t("error", h.error);
1092
- } catch (h) {
1093
- console.error("登录失败", h), t("error", h);
1160
+ await ((v = u.value) == null ? void 0 : v.validate());
1161
+ const _ = await n(l.uid, l.password);
1162
+ _.success ? t("success", _.data) : t("error", _.error);
1163
+ } catch (_) {
1164
+ console.error("登录失败", _), t("error", _);
1094
1165
  }
1095
1166
  };
1096
- return (v, h) => (y(), L("div", ls, [
1097
- a("div", cs, [
1098
- a("div", is, [
1167
+ return (v, _) => (y(), L("div", hs, [
1168
+ a("div", ps, [
1169
+ a("div", _s, [
1099
1170
  a("img", {
1100
1171
  src: e.logo || "/vite.svg",
1101
1172
  alt: "Logo",
1102
1173
  class: "login__logo"
1103
- }, null, 8, us),
1104
- a("h1", ds, S(e.title || i(_).appName), 1),
1105
- a("p", hs, S(e.subtitle || "后台管理系统"), 1)
1174
+ }, null, 8, vs),
1175
+ a("h1", fs, T(e.title || h(d).appName), 1),
1176
+ a("p", ms, T(e.subtitle || "后台管理系统"), 1)
1106
1177
  ]),
1107
- x(i(ze), {
1178
+ x(h(ze), {
1108
1179
  ref_key: "formRef",
1109
- ref: d,
1180
+ ref: u,
1110
1181
  model: l,
1111
- rules: u,
1182
+ rules: i,
1112
1183
  class: "login__form",
1113
1184
  "label-width": "0"
1114
1185
  }, {
1115
1186
  default: I(() => [
1116
- x(i(ce), { prop: "uid" }, {
1187
+ x(h(ue), { prop: "uid" }, {
1117
1188
  default: I(() => [
1118
- x(i(ie), {
1189
+ x(h(de), {
1119
1190
  modelValue: l.uid,
1120
- "onUpdate:modelValue": h[0] || (h[0] = (c) => l.uid = c),
1191
+ "onUpdate:modelValue": _[0] || (_[0] = (c) => l.uid = c),
1121
1192
  placeholder: "请输入账号",
1122
1193
  size: "large"
1123
1194
  }, {
@@ -1125,18 +1196,18 @@ const Hs = /* @__PURE__ */ A(es, [["render", ss], ["__scopeId", "data-v-317ae311
1125
1196
  a("span", {
1126
1197
  class: "login__input-icon",
1127
1198
  innerHTML: p.user
1128
- }, null, 8, _s)
1199
+ }, null, 8, gs)
1129
1200
  ]),
1130
1201
  _: 1
1131
1202
  }, 8, ["modelValue"])
1132
1203
  ]),
1133
1204
  _: 1
1134
1205
  }),
1135
- x(i(ce), { prop: "password" }, {
1206
+ x(h(ue), { prop: "password" }, {
1136
1207
  default: I(() => [
1137
- x(i(ie), {
1208
+ x(h(de), {
1138
1209
  modelValue: l.password,
1139
- "onUpdate:modelValue": h[2] || (h[2] = (c) => l.password = c),
1210
+ "onUpdate:modelValue": _[2] || (_[2] = (c) => l.password = c),
1140
1211
  type: r.value ? "text" : "password",
1141
1212
  placeholder: "请输入密码",
1142
1213
  size: "large",
@@ -1146,30 +1217,30 @@ const Hs = /* @__PURE__ */ A(es, [["render", ss], ["__scopeId", "data-v-317ae311
1146
1217
  a("span", {
1147
1218
  class: "login__input-icon",
1148
1219
  innerHTML: p.lock
1149
- }, null, 8, ps)
1220
+ }, null, 8, ys)
1150
1221
  ]),
1151
1222
  suffix: I(() => [
1152
1223
  a("span", {
1153
1224
  class: "login__input-icon login__input-icon--clickable",
1154
- onClick: h[1] || (h[1] = (c) => r.value = !r.value),
1225
+ onClick: _[1] || (_[1] = (c) => r.value = !r.value),
1155
1226
  innerHTML: r.value ? p.eyeOff : p.eye
1156
- }, null, 8, vs)
1227
+ }, null, 8, ws)
1157
1228
  ]),
1158
1229
  _: 1
1159
1230
  }, 8, ["modelValue", "type"])
1160
1231
  ]),
1161
1232
  _: 1
1162
1233
  }),
1163
- x(i(ce), null, {
1234
+ x(h(ue), null, {
1164
1235
  default: I(() => [
1165
- x(i(re), {
1236
+ x(h(ce), {
1166
1237
  type: "primary",
1167
1238
  size: "large",
1168
- loading: i(o),
1239
+ loading: h(o),
1169
1240
  class: "login__submit",
1170
1241
  onClick: f
1171
1242
  }, {
1172
- default: I(() => [...h[3] || (h[3] = [
1243
+ default: I(() => [..._[3] || (_[3] = [
1173
1244
  oe(" 登录 ", -1)
1174
1245
  ])]),
1175
1246
  _: 1
@@ -1183,18 +1254,18 @@ const Hs = /* @__PURE__ */ A(es, [["render", ss], ["__scopeId", "data-v-317ae311
1183
1254
  ])
1184
1255
  ]));
1185
1256
  }
1186
- }), Ks = /* @__PURE__ */ A(fs, [["__scopeId", "data-v-a48f4a52"]]), gs = { class: "error-page" }, ms = { class: "error-page__content" }, ys = /* @__PURE__ */ D({
1257
+ }), Gs = /* @__PURE__ */ A(bs, [["__scopeId", "data-v-a48f4a52"]]), ks = { class: "error-page" }, Cs = { class: "error-page__content" }, Ls = /* @__PURE__ */ F({
1187
1258
  __name: "404",
1188
1259
  setup(e) {
1189
- const s = G(), t = () => {
1260
+ const s = W(), t = () => {
1190
1261
  s.push("/");
1191
1262
  };
1192
- return (n, o) => (y(), L("div", gs, [
1193
- a("div", ms, [
1263
+ return (n, o) => (y(), L("div", ks, [
1264
+ a("div", Cs, [
1194
1265
  o[1] || (o[1] = a("div", { class: "error-page__code" }, "404", -1)),
1195
1266
  o[2] || (o[2] = a("div", { class: "error-page__title" }, "页面不存在", -1)),
1196
1267
  o[3] || (o[3] = a("div", { class: "error-page__desc" }, "抱歉,您访问的页面不存在或已被删除", -1)),
1197
- x(i(re), {
1268
+ x(h(ce), {
1198
1269
  type: "primary",
1199
1270
  onClick: t
1200
1271
  }, {
@@ -1206,18 +1277,18 @@ const Hs = /* @__PURE__ */ A(es, [["render", ss], ["__scopeId", "data-v-317ae311
1206
1277
  ])
1207
1278
  ]));
1208
1279
  }
1209
- }), qs = /* @__PURE__ */ A(ys, [["__scopeId", "data-v-6fc8a81b"]]), ws = { class: "error-page" }, bs = { class: "error-page__content" }, ks = /* @__PURE__ */ D({
1280
+ }), Js = /* @__PURE__ */ A(Ls, [["__scopeId", "data-v-25c06185"]]), xs = { class: "error-page" }, Is = { class: "error-page__content" }, $s = /* @__PURE__ */ F({
1210
1281
  __name: "403",
1211
1282
  setup(e) {
1212
- const s = G(), t = () => {
1283
+ const s = W(), t = () => {
1213
1284
  s.push("/");
1214
1285
  };
1215
- return (n, o) => (y(), L("div", ws, [
1216
- a("div", bs, [
1286
+ return (n, o) => (y(), L("div", xs, [
1287
+ a("div", Is, [
1217
1288
  o[1] || (o[1] = a("div", { class: "error-page__code" }, "403", -1)),
1218
1289
  o[2] || (o[2] = a("div", { class: "error-page__title" }, "无访问权限", -1)),
1219
1290
  o[3] || (o[3] = a("div", { class: "error-page__desc" }, "抱歉,您没有权限访问此页面", -1)),
1220
- x(i(re), {
1291
+ x(h(ce), {
1221
1292
  type: "primary",
1222
1293
  onClick: t
1223
1294
  }, {
@@ -1229,47 +1300,47 @@ const Hs = /* @__PURE__ */ A(es, [["render", ss], ["__scopeId", "data-v-317ae311
1229
1300
  ])
1230
1301
  ]));
1231
1302
  }
1232
- }), Ws = /* @__PURE__ */ A(ks, [["__scopeId", "data-v-f9466667"]]);
1233
- function js(e) {
1234
- const s = q(), t = window.location.pathname, o = (s.menuBtnListMap[t] || []).map((_) => _.code);
1235
- return Array.isArray(e) ? e.some((_) => o.includes(_)) : o.includes(e);
1303
+ }), Xs = /* @__PURE__ */ A($s, [["__scopeId", "data-v-42d7e36e"]]);
1304
+ function Qs(e) {
1305
+ const s = K(), t = window.location.pathname, o = (s.menuBtnListMap[t] || []).map((d) => d.code);
1306
+ return Array.isArray(e) ? e.some((d) => o.includes(d)) : o.includes(e);
1236
1307
  }
1237
- const Cs = ["/login", "/404", "/403"];
1238
- function Ys(e, s) {
1239
- const t = P(), n = ge({
1240
- history: me((s == null ? void 0 : s.base) || ""),
1308
+ const Ts = ["/login", "/404", "/403"];
1309
+ function Zs(e, s) {
1310
+ const t = N(), n = ye({
1311
+ history: we((s == null ? void 0 : s.base) || ""),
1241
1312
  routes: e,
1242
1313
  scrollBehavior: (s == null ? void 0 : s.scrollBehavior) || (() => ({ left: 0, top: 0 }))
1243
1314
  });
1244
- return n.beforeEach(async (o, _, l) => {
1245
- const r = J();
1246
- if (r.initTheme(), xe())
1315
+ return n.beforeEach(async (o, d, l) => {
1316
+ const r = X();
1317
+ if (r.initTheme(), Ie())
1247
1318
  if (o.path === t.loginPath)
1248
1319
  l({ path: t.indexPath || "/" });
1249
1320
  else {
1250
- const { initApp: u, isLoggedIn: d } = le();
1251
- if (!d.value && !await u()) {
1321
+ const { initApp: i, isLoggedIn: u } = ie();
1322
+ if (!u.value && !await i()) {
1252
1323
  l(t.loginPath || "/login");
1253
1324
  return;
1254
1325
  }
1255
1326
  o.name && o.meta.keepAlive && r.addCachedView(o.name), l();
1256
1327
  }
1257
1328
  else
1258
- Cs.includes(o.path) ? l() : l({
1329
+ Ts.includes(o.path) ? l() : l({
1259
1330
  path: t.loginPath || "/login",
1260
1331
  query: { redirectUrl: encodeURIComponent(o.fullPath) }
1261
1332
  });
1262
1333
  }), n;
1263
1334
  }
1264
- function Gs(e, s) {
1265
- const t = ge({
1266
- history: me(),
1335
+ function en(e, s) {
1336
+ const t = ye({
1337
+ history: we(),
1267
1338
  routes: s
1268
1339
  });
1269
1340
  e.matcher = t.matcher;
1270
1341
  }
1271
- function Xs(e) {
1272
- const s = P();
1342
+ function tn(e) {
1343
+ const s = N();
1273
1344
  return [
1274
1345
  {
1275
1346
  path: (e == null ? void 0 : e.loginPath) || s.loginPath || "/login",
@@ -1280,15 +1351,6 @@ function Xs(e) {
1280
1351
  hidden: !0
1281
1352
  }
1282
1353
  },
1283
- {
1284
- path: "/404",
1285
- name: "NotFound",
1286
- component: e == null ? void 0 : e.notFoundComponent,
1287
- meta: {
1288
- title: "404",
1289
- hidden: !0
1290
- }
1291
- },
1292
1354
  {
1293
1355
  path: "/403",
1294
1356
  name: "Forbidden",
@@ -1297,37 +1359,29 @@ function Xs(e) {
1297
1359
  title: "403",
1298
1360
  hidden: !0
1299
1361
  }
1300
- },
1301
- {
1302
- path: "/:pathMatch(.*)*",
1303
- redirect: "/404",
1304
- meta: {
1305
- hidden: !0
1306
- }
1307
1362
  }
1308
1363
  ];
1309
1364
  }
1310
- function Js(e, s = {}) {
1311
- const t = s.indexPath || "/dashboard";
1312
- return {
1365
+ function sn(e, s = {}) {
1366
+ const t = s.indexPath || "/dashboard", n = [...e];
1367
+ return s.notFoundComponent && n.push({
1368
+ path: "/:pathMatch(.*)*",
1369
+ name: "LayoutNotFound",
1370
+ component: s.notFoundComponent,
1371
+ meta: {
1372
+ title: "404",
1373
+ hidden: !0
1374
+ }
1375
+ }), {
1313
1376
  path: "/",
1314
1377
  name: "Layout",
1315
- component: s.layoutComponent || Xt,
1378
+ component: s.layoutComponent || ts,
1316
1379
  redirect: t,
1317
- children: e
1380
+ children: n
1318
1381
  };
1319
1382
  }
1320
- function Qs(e = {}) {
1383
+ function nn(e = {}) {
1321
1384
  return [
1322
- {
1323
- path: "/404",
1324
- name: "NotFound",
1325
- component: e.notFoundComponent,
1326
- meta: {
1327
- title: "404",
1328
- hidden: !0
1329
- }
1330
- },
1331
1385
  {
1332
1386
  path: "/403",
1333
1387
  name: "Forbidden",
@@ -1336,29 +1390,22 @@ function Qs(e = {}) {
1336
1390
  title: "403",
1337
1391
  hidden: !0
1338
1392
  }
1339
- },
1340
- {
1341
- path: "/:pathMatch(.*)*",
1342
- redirect: "/404",
1343
- meta: {
1344
- hidden: !0
1345
- }
1346
1393
  }
1347
1394
  ];
1348
1395
  }
1349
- var xs = /* @__PURE__ */ ((e) => (e[e.ENABLED = 1] = "ENABLED", e[e.DISABLED = 0] = "DISABLED", e))(xs || {}), Ls = /* @__PURE__ */ ((e) => (e[e.UNKNOWN = 0] = "UNKNOWN", e[e.MALE = 1] = "MALE", e[e.FEMALE = 2] = "FEMALE", e))(Ls || {}), Is = /* @__PURE__ */ ((e) => (e[e.DIRECTORY = 0] = "DIRECTORY", e[e.MENU = 1] = "MENU", e[e.BUTTON = 2] = "BUTTON", e))(Is || {});
1350
- const Zs = {
1396
+ var Ss = /* @__PURE__ */ ((e) => (e[e.ENABLED = 1] = "ENABLED", e[e.DISABLED = 0] = "DISABLED", e))(Ss || {}), Es = /* @__PURE__ */ ((e) => (e[e.UNKNOWN = 0] = "UNKNOWN", e[e.MALE = 1] = "MALE", e[e.FEMALE = 2] = "FEMALE", e))(Es || {}), Us = /* @__PURE__ */ ((e) => (e[e.DIRECTORY = 0] = "DIRECTORY", e[e.MENU = 1] = "MENU", e[e.BUTTON = 2] = "BUTTON", e))(Us || {});
1397
+ const on = {
1351
1398
  1: "启用",
1352
1399
  0: "禁用"
1353
- }, en = {
1400
+ }, an = {
1354
1401
  0: "未知",
1355
1402
  1: "男",
1356
1403
  2: "女"
1357
- }, tn = {
1404
+ }, rn = {
1358
1405
  0: "目录",
1359
1406
  1: "菜单",
1360
1407
  2: "按钮"
1361
- }, sn = [
1408
+ }, ln = [
1362
1409
  {
1363
1410
  label: "启用",
1364
1411
  value: 1
@@ -1369,7 +1416,7 @@ const Zs = {
1369
1416
  value: 0
1370
1417
  /* DISABLED */
1371
1418
  }
1372
- ], nn = [
1419
+ ], cn = [
1373
1420
  {
1374
1421
  label: "未知",
1375
1422
  value: 0
@@ -1385,7 +1432,7 @@ const Zs = {
1385
1432
  value: 2
1386
1433
  /* FEMALE */
1387
1434
  }
1388
- ], on = [
1435
+ ], un = [
1389
1436
  {
1390
1437
  label: "目录",
1391
1438
  value: 0
@@ -1401,77 +1448,77 @@ const Zs = {
1401
1448
  value: 2
1402
1449
  /* BUTTON */
1403
1450
  }
1404
- ], an = {
1451
+ ], dn = {
1405
1452
  mounted(e, s) {
1406
- var u;
1407
- const t = q(), { value: n } = s;
1453
+ var i;
1454
+ const t = K(), { value: n } = s;
1408
1455
  if (!n) return;
1409
- const o = window.location.pathname, l = (t.menuBtnListMap[o] || []).map((d) => d.code);
1456
+ const o = window.location.pathname, l = (t.menuBtnListMap[o] || []).map((u) => u.code);
1410
1457
  let r = !1;
1411
- Array.isArray(n) ? r = n.some((d) => l.includes(d)) : r = l.includes(n), r || (u = e.parentNode) == null || u.removeChild(e);
1458
+ Array.isArray(n) ? r = n.some((u) => l.includes(u)) : r = l.includes(n), r || (i = e.parentNode) == null || i.removeChild(e);
1412
1459
  }
1413
1460
  };
1414
- function rn(e) {
1415
- return Ke(e), Ge(), {
1416
- config: P()
1461
+ function hn(e) {
1462
+ return je(e), Ge(), {
1463
+ config: N()
1417
1464
  };
1418
1465
  }
1419
1466
  export {
1420
- Hs as Footer,
1421
- Ws as Forbidden,
1422
- Ls as Gender,
1423
- nn as GenderOptions,
1424
- en as GenderText,
1425
- fe as Header,
1426
- Xt as Layout,
1427
- Ks as Login,
1428
- Is as MenuType,
1429
- on as MenuTypeOptions,
1430
- tn as MenuTypeText,
1431
- qs as NotFound,
1432
- kt as SettingDrawer,
1467
+ Ys as Footer,
1468
+ Xs as Forbidden,
1469
+ Es as Gender,
1470
+ cn as GenderOptions,
1471
+ an as GenderText,
1472
+ me as Header,
1473
+ ts as Layout,
1474
+ Gs as Login,
1475
+ Us as MenuType,
1476
+ un as MenuTypeOptions,
1477
+ rn as MenuTypeText,
1478
+ Js as NotFound,
1479
+ Ct as SettingDrawer,
1433
1480
  ct as Sidebar,
1434
- xs as Status,
1435
- sn as StatusOptions,
1436
- Zs as StatusText,
1437
- zs as Tabs,
1438
- Ce as clearToken,
1439
- Qs as createErrorRoutes,
1440
- Js as createLayoutRoute,
1441
- Ys as createRouter,
1442
- Xs as createStaticRoutes,
1443
- rn as createXtoApp,
1444
- Bs as getCode,
1445
- P as getConfig,
1446
- Rs as getConfigValue,
1481
+ Ss as Status,
1482
+ ln as StatusOptions,
1483
+ on as StatusText,
1484
+ Ws as Tabs,
1485
+ xe as clearToken,
1486
+ nn as createErrorRoutes,
1487
+ sn as createLayoutRoute,
1488
+ Zs as createRouter,
1489
+ tn as createStaticRoutes,
1490
+ hn as createXtoApp,
1491
+ zs as getCode,
1492
+ N as getConfig,
1493
+ Fs as getConfigValue,
1447
1494
  Qe as getCurrentUser,
1448
- Y as getLoginInfo,
1449
- z as getRequest,
1450
- ke as getToken,
1451
- je as getTokenType,
1495
+ G as getLoginInfo,
1496
+ H as getRequest,
1497
+ Le as getToken,
1498
+ We as getTokenType,
1452
1499
  Ze as getUserMenu,
1453
- js as hasPermission,
1454
- xe as hasToken,
1455
- X as http,
1456
- b as local,
1500
+ Qs as hasPermission,
1501
+ Ie as hasToken,
1502
+ J as http,
1503
+ k as local,
1457
1504
  Z as localStorageUtil,
1458
- Xe as login,
1459
- Fs as loginByCode,
1460
- Je as logout,
1461
- an as permissionDirective,
1505
+ Je as login,
1506
+ Hs as loginByCode,
1507
+ Xe as logout,
1508
+ dn as permissionDirective,
1462
1509
  Ge as resetRequest,
1463
- Gs as resetRouter,
1464
- As as session,
1510
+ en as resetRouter,
1511
+ Os as session,
1465
1512
  ee as sessionStorageUtil,
1466
- Ke as setConfig,
1467
- We as setLoginInfo,
1468
- le as useApp,
1469
- J as useAppStore,
1470
- Ds as useAuth,
1471
- Ie as useAuthStore,
1472
- Os as useForm,
1473
- Se as useMenu,
1474
- q as useMenuStore,
1475
- Vs as useTable,
1476
- $e as useUserStore
1513
+ je as setConfig,
1514
+ qe as setLoginInfo,
1515
+ ie as useApp,
1516
+ X as useAppStore,
1517
+ js as useAuth,
1518
+ Te as useAuthStore,
1519
+ Ks as useForm,
1520
+ Ee as useMenu,
1521
+ K as useMenuStore,
1522
+ qs as useTable,
1523
+ Se as useUserStore
1477
1524
  };