xto-fronted 0.1.10 → 0.2.1

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