xto-fronted 0.4.84 → 0.4.86

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.
Files changed (303) hide show
  1. package/dist/assets/404-BNfk6aVM.js +1 -0
  2. package/dist/assets/404-ByYjFnhI.js +1 -0
  3. package/dist/assets/404-CH5_LdtS.css +1 -0
  4. package/dist/assets/404-sqW80Hc-.css +1 -0
  5. package/dist/assets/_plugin-vue_export-helper-DlAUqK2U.js +1 -0
  6. package/dist/assets/index-BBhC8PX4.js +1 -0
  7. package/dist/assets/index-BOEFG4lP.css +1 -0
  8. package/dist/assets/index-BRR97dc6.js +1 -0
  9. package/dist/assets/index-BSa4SMHI.js +1 -0
  10. package/dist/assets/index-BihVoviB.js +1 -0
  11. package/dist/assets/index-Bmux4tGG.js +1 -0
  12. package/dist/assets/index-BrvR0Fn_.css +1 -0
  13. package/dist/assets/index-C4ZCZoPp.js +1 -0
  14. package/dist/assets/index-CMgRqiaT.js +1 -0
  15. package/dist/assets/index-CUh_s55Z.css +1 -0
  16. package/dist/assets/index-CV768Wu1.js +1 -0
  17. package/dist/assets/index-D0OnMilp.js +1 -0
  18. package/dist/assets/index-D9wlAuR_.js +1 -0
  19. package/dist/assets/index-DPkO-STg.js +1 -0
  20. package/dist/assets/index-DawJb02s.css +1 -0
  21. package/dist/assets/index-DcFOybjo.js +1 -0
  22. package/dist/assets/index-DiHSZ6SJ.js +2 -0
  23. package/dist/assets/index-GDP-IkXE.css +1 -0
  24. package/dist/assets/index-Gx75raue.js +2 -0
  25. package/dist/assets/index-JsZ6rkQj.js +1 -0
  26. package/dist/assets/index-PfV8pzQz.css +1 -0
  27. package/dist/assets/index-Swfu6yvD.css +1 -0
  28. package/dist/assets/index-eQ-JQMk3.css +1 -0
  29. package/dist/assets/vendor-42ANG6Sg.js +6 -0
  30. package/dist/assets/vite-Dw-pgLOX.js +1 -0
  31. package/dist/assets/vue-vendor-05sbU7Th.js +29 -0
  32. package/dist/assets/vue-vendor-Br-l7wbK.js +29 -0
  33. package/dist/assets/xto-base-BSTP-Yn2.js +1 -0
  34. package/dist/assets/xto-base-C-IBqjVs.js +1 -0
  35. package/dist/assets/xto-base-C6eqMPdO.css +1 -0
  36. package/dist/assets/xto-base-CL2NKZJJ.css +1 -0
  37. package/dist/assets/xto-business--V1F5Gwb.css +1 -0
  38. package/dist/assets/xto-core-DZK7Cyg0.js +1 -0
  39. package/dist/assets/xto-core-cL8BAdce.js +1 -0
  40. package/dist/assets/xto-data-BFpiDgJi.js +1 -0
  41. package/dist/assets/xto-data-CnAQAQH2.css +1 -0
  42. package/dist/assets/xto-data-Cw0dv5K5.js +1 -0
  43. package/dist/assets/xto-data-MxZsiJgi.css +1 -0
  44. package/dist/assets/xto-feedback-B2M02fn3.js +1 -0
  45. package/dist/assets/xto-feedback-Bxx38c3P.css +1 -0
  46. package/dist/assets/xto-feedback-ByaS-C7_.css +1 -0
  47. package/dist/assets/xto-feedback-CTk0sMCW.js +1 -0
  48. package/dist/assets/xto-form-C5i2lk3C.js +1 -0
  49. package/dist/assets/xto-form-CrsyAjyr.css +1 -0
  50. package/dist/assets/xto-form-Cu6q3VLG.css +1 -0
  51. package/dist/assets/xto-form-NRjKKNcY.js +1 -0
  52. package/dist/assets/xto-layout-BDD6sSlM.css +1 -0
  53. package/dist/assets/xto-layout-D1stVnJI.css +1 -0
  54. package/dist/assets/xto-navigation-BuRQVoD8.css +1 -0
  55. package/dist/assets/xto-navigation-DHsTg0WG.js +1 -0
  56. package/dist/assets/xto-navigation-XfpyMpEo.css +1 -0
  57. package/dist/assets/xto-navigation-qLRTxo68.js +1 -0
  58. package/dist/index-0h_oG71z.js +345 -0
  59. package/dist/index-1EEezXR3.js +142 -0
  60. package/dist/index-1EkaJDoD.js +142 -0
  61. package/dist/index-1VN-SSaj.js +2873 -0
  62. package/dist/index-23nX2t9j.js +142 -0
  63. package/dist/index-2RwL0s53.js +142 -0
  64. package/dist/index-2tvOdd6w.js +372 -0
  65. package/dist/index-3zeoNaqT.js +345 -0
  66. package/dist/index-8oCLh51t.js +475 -0
  67. package/dist/index-AF5JN8Up.js +142 -0
  68. package/dist/index-B02xiP9g.js +372 -0
  69. package/dist/index-B05xso4D.js +345 -0
  70. package/dist/index-B1VS4tRU.js +475 -0
  71. package/dist/index-B3_VQZ-d.js +372 -0
  72. package/dist/index-B3kL6i_g.js +345 -0
  73. package/dist/index-B4Wny0vt.js +345 -0
  74. package/dist/index-B5RdBQ-f.js +475 -0
  75. package/dist/index-B5rbuoWS.js +2835 -0
  76. package/dist/index-BAFpPlnI.js +475 -0
  77. package/dist/index-BAJakzRz.js +142 -0
  78. package/dist/index-BAOHlfVd.js +142 -0
  79. package/dist/index-BAzJWzWG.js +2852 -0
  80. package/dist/index-BEIxh_R3.js +2982 -0
  81. package/dist/index-BEWrRNps.js +475 -0
  82. package/dist/index-BFtKVmzo.js +142 -0
  83. package/dist/index-BHPrW1wN.js +142 -0
  84. package/dist/index-BHQIqN1E.js +372 -0
  85. package/dist/index-BHZ_y8lp.js +2067 -0
  86. package/dist/index-BHvnTk5Z.js +475 -0
  87. package/dist/index-BIf7CYCW.js +475 -0
  88. package/dist/index-BK1Y1z9_.js +142 -0
  89. package/dist/index-BK8qDl14.js +372 -0
  90. package/dist/index-BKnta6nv.js +372 -0
  91. package/dist/index-BLIem13z.js +345 -0
  92. package/dist/index-BNBv_FCu.js +142 -0
  93. package/dist/index-BNwtCm83.js +345 -0
  94. package/dist/index-BOEMA7WH.js +345 -0
  95. package/dist/index-BOwDukt-.js +2346 -0
  96. package/dist/index-BR9WVjrV.js +2851 -0
  97. package/dist/index-BRMkw154.js +475 -0
  98. package/dist/index-BRQBannD.js +345 -0
  99. package/dist/index-BShKtLTm.js +475 -0
  100. package/dist/index-BVpqTdd2.js +3132 -0
  101. package/dist/index-BWGQANAN.js +2851 -0
  102. package/dist/index-BZKw7U60.js +475 -0
  103. package/dist/index-BadGWG4q.js +475 -0
  104. package/dist/index-BbeWpCd3.js +345 -0
  105. package/dist/index-BeUYNx5P.js +475 -0
  106. package/dist/index-BgiGtxRr.js +142 -0
  107. package/dist/index-BhKJLk9M.js +2824 -0
  108. package/dist/index-BijsKQ3r.js +475 -0
  109. package/dist/index-BjEfspqP.js +475 -0
  110. package/dist/index-BjEnT8WQ.js +372 -0
  111. package/dist/index-BpOcz1m4.js +142 -0
  112. package/dist/index-BrRdLbLB.js +142 -0
  113. package/dist/index-BsHOXfCq.js +372 -0
  114. package/dist/index-Bt5ocakb.js +475 -0
  115. package/dist/index-BtE24Mt4.js +142 -0
  116. package/dist/index-BvcBQjw6.js +2836 -0
  117. package/dist/index-C0krZRWf.js +2859 -0
  118. package/dist/index-C1cKUqmA.js +372 -0
  119. package/dist/index-C3ANmIDM.js +475 -0
  120. package/dist/index-C5JrEkwD.js +345 -0
  121. package/dist/index-C5m4qNMQ.js +2851 -0
  122. package/dist/index-C69vu_ot.js +3147 -0
  123. package/dist/index-C6Um6eFy.js +475 -0
  124. package/dist/index-C75ePQYC.js +372 -0
  125. package/dist/index-C7wKLGhC.js +142 -0
  126. package/dist/index-C8DBDnxx.js +2836 -0
  127. package/dist/index-CAnqlIjX.js +475 -0
  128. package/dist/index-CB36fztK.js +345 -0
  129. package/dist/index-CBKo6Enz.js +345 -0
  130. package/dist/index-CBcuyFIa.js +2326 -0
  131. package/dist/index-CCxIu4ex.js +372 -0
  132. package/dist/index-CD1ZEMzL.js +2836 -0
  133. package/dist/index-CDx-6tvY.js +345 -0
  134. package/dist/index-CGrvOpdb.js +372 -0
  135. package/dist/index-CHJWNf3f.js +475 -0
  136. package/dist/index-CIb06BxE.js +372 -0
  137. package/dist/index-CLiJcB9v.js +142 -0
  138. package/dist/index-CNS6Ohfw.js +2853 -0
  139. package/dist/index-COkjB5Jm.js +142 -0
  140. package/dist/index-CS5h1O5W.js +345 -0
  141. package/dist/index-CT0deRSL.js +372 -0
  142. package/dist/index-CTQQBaf4.js +345 -0
  143. package/dist/index-CUAC0ZFB.js +475 -0
  144. package/dist/index-CVMV9Tfg.js +142 -0
  145. package/dist/index-CWOx59Vc.js +142 -0
  146. package/dist/index-CWdSR99B.js +372 -0
  147. package/dist/index-CWvOcS8Y.js +345 -0
  148. package/dist/index-C_8yJlf1.js +475 -0
  149. package/dist/index-C_MzXmh2.js +2830 -0
  150. package/dist/index-Cb7HXiBR.js +372 -0
  151. package/dist/index-CbA8oUvZ.js +142 -0
  152. package/dist/index-CbEIzXG9.js +475 -0
  153. package/dist/index-Cb_m0zz1.js +475 -0
  154. package/dist/index-Cc6HgGzc.js +142 -0
  155. package/dist/index-CcWdW9Mj.js +372 -0
  156. package/dist/index-CdAqkP8L.js +345 -0
  157. package/dist/index-CeVUHSt9.js +2847 -0
  158. package/dist/index-CejRpy0a.js +475 -0
  159. package/dist/index-Cg5wO_jJ.js +372 -0
  160. package/dist/index-CgZM1vHq.js +372 -0
  161. package/dist/index-CgofFg1D.js +372 -0
  162. package/dist/index-ChheXGDK.js +372 -0
  163. package/dist/index-ChuFHoI0.js +372 -0
  164. package/dist/index-CiOJZ6_b.js +372 -0
  165. package/dist/index-ClCWmz_7.js +2844 -0
  166. package/dist/index-CmajGrKA.js +142 -0
  167. package/dist/index-Cn_4o3fi.js +345 -0
  168. package/dist/index-CoJBI1vE.js +345 -0
  169. package/dist/index-CqLLaQ-P.js +372 -0
  170. package/dist/index-CsRhLwmR.js +475 -0
  171. package/dist/index-CttJvDTG.js +475 -0
  172. package/dist/index-Cu3m9UeX.js +345 -0
  173. package/dist/index-CyQbOMHa.js +2859 -0
  174. package/dist/index-D-NcbLKL.js +345 -0
  175. package/dist/index-D0gstkiI.js +2836 -0
  176. package/dist/index-D0krzDtx.js +475 -0
  177. package/dist/index-D1moFd4V.js +372 -0
  178. package/dist/index-D2Hs4bZj.js +345 -0
  179. package/dist/index-D4QhrTZs.js +475 -0
  180. package/dist/index-D6CC02F-.js +372 -0
  181. package/dist/index-D6s7Za5s.js +142 -0
  182. package/dist/index-D7i5bck2.js +3132 -0
  183. package/dist/index-D8YBeNfn.js +345 -0
  184. package/dist/index-D93bv6lU.js +372 -0
  185. package/dist/index-DAX_bFj5.js +142 -0
  186. package/dist/index-DBii9cjr.js +475 -0
  187. package/dist/index-DBzpSkNi.js +345 -0
  188. package/dist/index-DCuKNBck.js +3153 -0
  189. package/dist/index-DE3uKf0K.js +142 -0
  190. package/dist/index-DGAqp0QX.js +372 -0
  191. package/dist/index-DGh_w_v1.js +475 -0
  192. package/dist/index-DItKvJyI.js +475 -0
  193. package/dist/index-DKAyB0fv.js +345 -0
  194. package/dist/index-DKN4xsXi.js +2851 -0
  195. package/dist/index-DN_iIn8V.js +345 -0
  196. package/dist/index-DONIBpuJ.js +345 -0
  197. package/dist/index-DPDK8Ht4.js +2851 -0
  198. package/dist/index-DPr3ldST.js +2354 -0
  199. package/dist/index-DS1wfdxM.js +142 -0
  200. package/dist/index-DUW5cCh8.js +372 -0
  201. package/dist/index-DUv28uVd.js +142 -0
  202. package/dist/index-DVS-5SZn.js +475 -0
  203. package/dist/index-DWI51JAp.js +372 -0
  204. package/dist/index-DWVmEexu.js +475 -0
  205. package/dist/index-DXf9wUqQ.js +142 -0
  206. package/dist/index-DXmB-sjP.js +345 -0
  207. package/dist/index-DY_e_Dxv.js +372 -0
  208. package/dist/index-DZar-us7.js +142 -0
  209. package/dist/index-D_nwqVrw.js +2847 -0
  210. package/dist/index-DbEeir7h.js +2834 -0
  211. package/dist/index-Dbf5ypbh.js +142 -0
  212. package/dist/index-DcSK-2pt.js +345 -0
  213. package/dist/index-DclK-Mc7.js +2864 -0
  214. package/dist/index-DcnzaxVi.js +142 -0
  215. package/dist/index-Dd8PlF0M.js +2857 -0
  216. package/dist/index-DdkVT39s.js +345 -0
  217. package/dist/index-DeLbU1t-.js +345 -0
  218. package/dist/index-DfV_J8Te.js +345 -0
  219. package/dist/index-DgPnNd8U.js +475 -0
  220. package/dist/index-Dg_JLa7s.js +345 -0
  221. package/dist/index-Di2VPQjn.js +345 -0
  222. package/dist/index-DibHUbqc.js +372 -0
  223. package/dist/index-DjCVSrpw.js +475 -0
  224. package/dist/index-Djdb936p.js +142 -0
  225. package/dist/index-DmFL_GSt.js +142 -0
  226. package/dist/index-DmP4X2k0.js +372 -0
  227. package/dist/index-DmtmRd1r.js +372 -0
  228. package/dist/index-Dn8MA3kh.js +475 -0
  229. package/dist/index-Do7uXDSi.js +2071 -0
  230. package/dist/index-Dpv1M9Hu.js +372 -0
  231. package/dist/index-DqUuZC8f.js +372 -0
  232. package/dist/index-DtEXQIjn.js +372 -0
  233. package/dist/index-Dtw-qZ0V.js +372 -0
  234. package/dist/index-Dv3hIz8H.js +345 -0
  235. package/dist/index-Dv9jnaWp.js +345 -0
  236. package/dist/index-Dw8KZwGJ.js +2354 -0
  237. package/dist/index-DwJILh-Q.js +3149 -0
  238. package/dist/index-DwzGV3B9.js +142 -0
  239. package/dist/index-DyybaRkK.js +345 -0
  240. package/dist/index-DzerABZq.js +372 -0
  241. package/dist/index-F53NVkhc.js +142 -0
  242. package/dist/index-Fl0_k4XF.js +475 -0
  243. package/dist/index-HMYRCPrs.js +2326 -0
  244. package/dist/index-I49wpmT-.js +372 -0
  245. package/dist/index-IPv1O8Zq.js +345 -0
  246. package/dist/index-JLqnaery.js +372 -0
  247. package/dist/index-JRCQ1CYj.js +142 -0
  248. package/dist/index-L86-iO8O.js +345 -0
  249. package/dist/index-Q56EoFor.js +142 -0
  250. package/dist/index-QxKMr6p0.js +2829 -0
  251. package/dist/index-THRvW9Xm.js +2856 -0
  252. package/dist/index-WIUmTlfL.js +345 -0
  253. package/dist/index-WRrsK0pR.js +475 -0
  254. package/dist/index-Wq652QGf.js +2836 -0
  255. package/dist/index-YnSLCdjP.js +475 -0
  256. package/dist/index-Ynf0lvBE.js +142 -0
  257. package/dist/index-_OtTmb9i.js +142 -0
  258. package/dist/index-_oqoy_3D.js +142 -0
  259. package/dist/index-cl4Y-BWw.js +475 -0
  260. package/dist/index-d_eHJkDW.js +475 -0
  261. package/dist/index-dnmEyUWB.js +372 -0
  262. package/dist/index-dz6CwD6A.js +142 -0
  263. package/dist/index-g4rkaRry.js +475 -0
  264. package/dist/index-g9bRMdAX.js +142 -0
  265. package/dist/index-h4z4-a2p.js +2852 -0
  266. package/dist/index-h7BhcQYM.js +475 -0
  267. package/dist/index-hI3qofTF.js +345 -0
  268. package/dist/index-iyQQumAA.js +372 -0
  269. package/dist/index-js_OhKON.js +345 -0
  270. package/dist/index-kgb4MdHr.js +475 -0
  271. package/dist/index-logKl0VM.js +3144 -0
  272. package/dist/index-lrFMrOlR.js +3132 -0
  273. package/dist/index-mEHxtQWj.js +372 -0
  274. package/dist/index-mNm1BV3n.js +2857 -0
  275. package/dist/index-oOzAFXfr.js +142 -0
  276. package/dist/index-s3vGq0ro.js +345 -0
  277. package/dist/index-wt7AbUqc.js +2342 -0
  278. package/dist/index.es.js +1 -1
  279. package/dist/index.html +28 -0
  280. package/dist/index.umd.js +1 -8
  281. package/dist/style.css +1 -1
  282. package/package.json +87 -91
  283. package/src/App.vue +1 -30
  284. package/src/assets/styles/_root.scss +97 -141
  285. package/src/assets/styles/_variables.scss +19 -44
  286. package/src/assets/styles/index.scss +42 -267
  287. package/src/components/Layout/Sidebar.vue +2 -43
  288. package/src/components/Layout/TopMenu.vue +12 -37
  289. package/src/components/Layout/index.vue +0 -1
  290. package/src/utils/request.ts +1 -18
  291. package/src/views/dashboard/index.vue +155 -417
  292. package/src/views/error/403.vue +56 -251
  293. package/src/views/error/404.vue +56 -253
  294. package/src/views/login/index.vue +194 -586
  295. package/src/views/system/menu/index.vue +94 -403
  296. package/src/views/system/role/index.vue +69 -348
  297. package/src/views/system/user/index.vue +73 -402
  298. package/dist/index-BZaqYObA.js +0 -479
  299. package/dist/index-CbwOysFI.js +0 -641
  300. package/dist/index-Jynxhhda.js +0 -189
  301. package/dist/index-XgzSS-fV.js +0 -515
  302. package/dist/index-_iZKFlCa.js +0 -4178
  303. package/src/types/json-bigint.d.ts +0 -18
@@ -0,0 +1,2342 @@
1
+ import { ref as h, computed as g, watch as ct, defineComponent as Q, openBlock as i, createElementBlock as _, normalizeClass as K, createElementVNode as t, withDirectives as He, toDisplayString as x, unref as l, vShow as dt, createVNode as k, withCtx as S, Fragment as q, renderList as W, createBlock as A, createTextVNode as ne, createCommentVNode as j, onMounted as Xe, onUnmounted as Ge, withModifiers as Re, Transition as De, withKeys as Je, vModelText as mt, normalizeStyle as ze, resolveComponent as pt, reactive as Pe } from "vue";
2
+ import { defineStore as Ce } from "pinia";
3
+ import { useRoute as de, useRouter as ee, createRouter as Oe, createWebHistory as Ae } from "vue-router";
4
+ import { Menu as Qe, SubMenu as Ze, MenuItem as ye, Tabs as vt, TabPane as _t } from "@xto/navigation";
5
+ import { Icon as E, Button as xe } from "@xto/base";
6
+ import { Drawer as et, Message as J } from "@xto/feedback";
7
+ import { Form as ht, FormItem as he, Input as We, Checkbox as ft } from "@xto/form";
8
+ import gt from "axios";
9
+ const ue = "xto_", tt = (e) => ({
10
+ get(s) {
11
+ const o = e.getItem(ue + s);
12
+ if (!o) return null;
13
+ try {
14
+ return JSON.parse(o);
15
+ } catch {
16
+ return o;
17
+ }
18
+ },
19
+ set(s, o) {
20
+ if (o == null) {
21
+ e.removeItem(ue + s);
22
+ return;
23
+ }
24
+ const r = typeof o == "string" ? o : JSON.stringify(o);
25
+ e.setItem(ue + s, r);
26
+ },
27
+ remove(s) {
28
+ e.removeItem(ue + s);
29
+ },
30
+ clear() {
31
+ Object.keys(e).forEach((o) => {
32
+ o.startsWith(ue) && e.removeItem(o);
33
+ });
34
+ }
35
+ }), fe = tt(window.localStorage), ge = tt(window.sessionStorage), f = {
36
+ get: fe.get,
37
+ set: fe.set,
38
+ remove: fe.remove,
39
+ clear: fe.clear
40
+ }, dn = {
41
+ get: ge.get,
42
+ set: ge.set,
43
+ remove: ge.remove,
44
+ clear: ge.clear
45
+ }, te = Ce("app", () => {
46
+ const e = h(f.get("appName") || "XTO App"), s = h(f.get("indexPath") || "/dashboard"), o = h(f.get("isDark") || !1), r = h(f.get("theme") || "light"), a = h(f.get("layout") || "sidebar"), u = h(f.get("isCollapsed") || !1), C = h(f.get("showTabs") ?? !0), m = h(f.get("showFooter") ?? !0), p = h(f.get("showBreadcrumb") ?? !0), d = h(f.get("primaryColor") || "#409eff"), v = h([]), c = g(() => o.value ? "dark" : "light"), y = (T) => {
47
+ e.value = T, f.set("appName", T);
48
+ }, V = (T) => {
49
+ s.value = T, f.set("indexPath", T);
50
+ }, L = () => {
51
+ o.value = !o.value, r.value = o.value ? "dark" : "light", D();
52
+ }, R = (T) => {
53
+ r.value = T, o.value = T === "dark", D();
54
+ }, D = () => {
55
+ const T = document.documentElement;
56
+ o.value ? T.classList.add("dark") : T.classList.remove("dark"), f.set("isDark", o.value), f.set("theme", r.value);
57
+ }, z = () => {
58
+ u.value = !u.value, f.set("isCollapsed", u.value);
59
+ }, P = (T) => {
60
+ a.value = T, f.set("layout", T);
61
+ }, F = () => {
62
+ C.value = !C.value, f.set("showTabs", C.value);
63
+ }, N = () => {
64
+ m.value = !m.value, f.set("showFooter", m.value);
65
+ }, Y = () => {
66
+ p.value = !p.value, f.set("showBreadcrumb", p.value);
67
+ }, M = (T) => {
68
+ d.value = T, document.documentElement.style.setProperty("--color-primary", T), f.set("primaryColor", T);
69
+ }, B = (T) => {
70
+ v.value.includes(T) || v.value.push(T);
71
+ }, le = (T) => {
72
+ const se = v.value.indexOf(T);
73
+ se > -1 && v.value.splice(se, 1);
74
+ }, G = () => {
75
+ v.value = [];
76
+ }, re = () => {
77
+ D(), d.value !== "#409eff" && document.documentElement.style.setProperty("--color-primary", d.value);
78
+ };
79
+ return ct(o, D), {
80
+ appName: e,
81
+ indexPath: s,
82
+ isDark: o,
83
+ theme: r,
84
+ layout: a,
85
+ isCollapsed: u,
86
+ showTabs: C,
87
+ showFooter: m,
88
+ showBreadcrumb: p,
89
+ primaryColor: d,
90
+ cachedViews: v,
91
+ themeClass: c,
92
+ setAppName: y,
93
+ setIndexPath: V,
94
+ toggleTheme: L,
95
+ toggleCollapse: z,
96
+ setTheme: R,
97
+ setLayout: P,
98
+ toggleTabs: F,
99
+ toggleFooter: N,
100
+ toggleBreadcrumb: Y,
101
+ setPrimaryColor: M,
102
+ addCachedView: B,
103
+ removeCachedView: le,
104
+ clearCachedViews: G,
105
+ initTheme: re
106
+ };
107
+ }), Me = "menu_list", yt = {
108
+ menuCode: "home",
109
+ menuName: "首页",
110
+ menuUrl: "/dashboard",
111
+ icon: "home",
112
+ closable: !1,
113
+ isDefault: !1,
114
+ isOut: !1
115
+ }, ae = Ce("menu", () => {
116
+ const e = h(f.get(Me) || []), s = g(() => e.value.length > 0);
117
+ return {
118
+ menuList: e,
119
+ hasMenu: s,
120
+ setMenuList: (a) => {
121
+ e.value = [yt, ...a], f.set(Me, e.value);
122
+ },
123
+ clearMenu: () => {
124
+ e.value = [], f.remove(Me);
125
+ }
126
+ };
127
+ }), Se = "/vite.svg", Ue = "user_info", H = Ce("user", () => {
128
+ const e = h(f.get(Ue)), s = g(() => !!e.value), o = g(() => {
129
+ var c;
130
+ return ((c = e.value) == null ? void 0 : c.userId) || "";
131
+ }), r = g(() => {
132
+ var c;
133
+ return ((c = e.value) == null ? void 0 : c.userName) || "";
134
+ }), a = g(() => {
135
+ var c;
136
+ return ((c = e.value) == null ? void 0 : c.departmentName) || "";
137
+ }), u = g(() => {
138
+ var c;
139
+ return ((c = e.value) == null ? void 0 : c.email) || "";
140
+ }), C = g(() => {
141
+ var c;
142
+ return ((c = e.value) == null ? void 0 : c.mobilePhone) || "";
143
+ }), m = g(() => {
144
+ var c;
145
+ return ((c = e.value) == null ? void 0 : c.positionName) || "";
146
+ }), p = g(() => {
147
+ var c;
148
+ return ((c = e.value) == null ? void 0 : c.avatar) || "";
149
+ });
150
+ return {
151
+ userInfo: e,
152
+ isLoggedIn: s,
153
+ userId: o,
154
+ userName: r,
155
+ departmentName: a,
156
+ email: u,
157
+ mobilePhone: C,
158
+ positionName: m,
159
+ avatar: p,
160
+ setUserInfo: (c) => {
161
+ e.value = c, f.set(Ue, c);
162
+ },
163
+ clearUserInfo: () => {
164
+ e.value = null, f.remove(Ue);
165
+ }
166
+ };
167
+ }), Ve = "token", Fe = "token_type", Be = "refresh_token", Ke = "expires_time", je = "refresh_time", qe = "code", $e = () => f.get(Ve), kt = (e) => {
168
+ f.set(Ve, e);
169
+ }, bt = () => f.get(Fe), wt = (e) => {
170
+ f.set(Fe, e);
171
+ }, mn = () => f.get(Be), Ct = (e) => {
172
+ f.set(Be, e);
173
+ }, xt = () => f.get(Ke), St = (e) => {
174
+ f.set(Ke, e);
175
+ }, pn = () => f.get(je), $t = (e) => {
176
+ f.set(je, e);
177
+ }, vn = () => f.get(qe), It = (e) => {
178
+ f.set(qe, e);
179
+ }, st = (e) => {
180
+ kt(e.access_token), wt(e.token_type || "Bearer"), Ct(e.refresh_token), St(e.expires_time), $t(e.refresh_time), e.code && It(e.code);
181
+ }, ot = () => {
182
+ f.remove(Ve), f.remove(Fe), f.remove(Be), f.remove(Ke), f.remove(je), f.remove(qe);
183
+ }, Lt = () => {
184
+ const e = xt();
185
+ return e ? Date.now() > e : !0;
186
+ }, nt = () => !!$e() && !Lt(), Ie = Ce("auth", () => {
187
+ const e = h($e()), s = g(() => nt()), o = h(""), r = h(""), a = h(""), u = h("/login");
188
+ return {
189
+ token: e,
190
+ isLoggedIn: s,
191
+ baseUrl: o,
192
+ appId: r,
193
+ clientId: a,
194
+ loginPath: u,
195
+ login: (y) => {
196
+ e.value = y.access_token, st(y);
197
+ },
198
+ logout: () => {
199
+ e.value = null, ot();
200
+ },
201
+ setBaseUrl: (y) => {
202
+ o.value = y;
203
+ },
204
+ setAppId: (y) => {
205
+ r.value = y;
206
+ },
207
+ setClientId: (y) => {
208
+ a.value = y;
209
+ },
210
+ setLoginPath: (y) => {
211
+ u.value = y;
212
+ }
213
+ };
214
+ }), Tt = { class: "sidebar__logo" }, Et = { class: "sidebar__menu-icon" }, Nt = {
215
+ key: 1,
216
+ class: "sidebar__menu-char"
217
+ }, Mt = { class: "sidebar__menu-icon" }, Ut = {
218
+ key: 1,
219
+ class: "sidebar__menu-char"
220
+ }, Dt = { class: "sidebar__menu-icon" }, Rt = {
221
+ key: 1,
222
+ class: "sidebar__menu-char"
223
+ }, zt = {
224
+ key: 0,
225
+ class: "sidebar__user"
226
+ }, Pt = { class: "sidebar__user-info" }, Ot = { class: "sidebar__user-name" }, At = { class: "sidebar__user-role" }, Vt = /* @__PURE__ */ Q({
227
+ __name: "Sidebar",
228
+ props: {
229
+ menuList: { default: () => [] }
230
+ },
231
+ setup(e) {
232
+ const s = e, o = de(), r = ee(), a = ae(), u = H(), C = Ie(), m = te(), p = g(() => s.menuList.length > 0 ? s.menuList : a.menuList), d = g(() => m.isCollapsed), v = g(() => o.path), c = g(() => m.isDark ? "#1d1e1f" : "#fff"), y = g(() => m.isDark ? "#cfd3dc" : "#303133"), V = g(() => "#409eff"), L = (N) => {
233
+ N && N !== o.path && r.push(N);
234
+ }, R = () => {
235
+ C.logout(), u.clearUserInfo(), a.clearMenu(), r.push("/login");
236
+ }, D = /* @__PURE__ */ new Set([
237
+ "arrow-up",
238
+ "arrow-down",
239
+ "arrow-left",
240
+ "arrow-right",
241
+ "caret-down",
242
+ "caret-right",
243
+ "plus",
244
+ "minus",
245
+ "close",
246
+ "check",
247
+ "edit",
248
+ "delete",
249
+ "copy",
250
+ "download",
251
+ "upload",
252
+ "refresh",
253
+ "search",
254
+ "filter",
255
+ "more",
256
+ "setting",
257
+ "share",
258
+ "loading",
259
+ "info",
260
+ "success",
261
+ "warning",
262
+ "error",
263
+ "question",
264
+ "user",
265
+ "user-add",
266
+ "user-group",
267
+ "logout",
268
+ "login",
269
+ "file",
270
+ "folder",
271
+ "folder-open",
272
+ "document",
273
+ "image",
274
+ "video",
275
+ "music",
276
+ "camera",
277
+ "mail",
278
+ "phone",
279
+ "chat",
280
+ "bell",
281
+ "message",
282
+ "eye",
283
+ "eye-off",
284
+ "calendar",
285
+ "clock",
286
+ "history",
287
+ "timer",
288
+ "location",
289
+ "map",
290
+ "globe",
291
+ "star",
292
+ "heart",
293
+ "thumb-up",
294
+ "link",
295
+ "external-link",
296
+ "lock",
297
+ "unlock",
298
+ "key",
299
+ "home",
300
+ "menu",
301
+ "menu-fold",
302
+ "menu-unfold",
303
+ "sidebar-fold",
304
+ "sidebar-expand",
305
+ "sidebar-left",
306
+ "dashboard",
307
+ "chart",
308
+ "chart-pie",
309
+ "chart-line",
310
+ "report",
311
+ "analytics",
312
+ "system",
313
+ "permission",
314
+ "role",
315
+ "user-manage",
316
+ "log",
317
+ "notification",
318
+ "app",
319
+ "list",
320
+ "grid",
321
+ "fullscreen",
322
+ "fullscreen-exit",
323
+ "zoom-in",
324
+ "zoom-out",
325
+ "print",
326
+ "bookmark",
327
+ "tag",
328
+ "code",
329
+ "terminal",
330
+ "database",
331
+ "server",
332
+ "cloud",
333
+ "gift",
334
+ "moon",
335
+ "sun",
336
+ "theme",
337
+ "skin"
338
+ ]), z = (N) => {
339
+ if (!N || N === "") return "";
340
+ if (N.startsWith("tineco-icon-")) {
341
+ const M = N.replace("tineco-icon-", "");
342
+ return {
343
+ home: "home",
344
+ dashboard: "dashboard",
345
+ system: "system",
346
+ user: "user",
347
+ role: "role",
348
+ menu: "list",
349
+ setting: "setting",
350
+ file: "file",
351
+ folder: "folder",
352
+ chart: "chart",
353
+ report: "report",
354
+ analytics: "analytics"
355
+ }[M] || M;
356
+ }
357
+ return {
358
+ dashboard: "dashboard",
359
+ system: "system",
360
+ user: "user",
361
+ role: "role",
362
+ menu: "list",
363
+ setting: "setting",
364
+ home: "home",
365
+ chart: "chart",
366
+ report: "report",
367
+ analytics: "analytics",
368
+ permission: "permission",
369
+ log: "log",
370
+ notification: "notification",
371
+ app: "app",
372
+ list: "list",
373
+ grid: "grid"
374
+ }[N] || N;
375
+ }, P = (N) => N ? N.charAt(0) : "", F = (N) => D.has(N);
376
+ return (N, Y) => (i(), _("div", {
377
+ class: K(["sidebar", { "sidebar--collapsed": d.value }])
378
+ }, [
379
+ t("div", Tt, [
380
+ Y[0] || (Y[0] = t("img", {
381
+ src: Se,
382
+ alt: "Logo",
383
+ class: "sidebar__logo-img"
384
+ }, null, -1)),
385
+ He(t("span", { class: "sidebar__logo-text" }, x(l(m).appName), 513), [
386
+ [dt, !d.value]
387
+ ])
388
+ ]),
389
+ k(l(Qe), {
390
+ "default-active": v.value,
391
+ mode: "vertical",
392
+ collapse: d.value,
393
+ "collapse-transition": !1,
394
+ "background-color": c.value,
395
+ "text-color": y.value,
396
+ "active-text-color": V.value,
397
+ class: "sidebar__menu",
398
+ onSelect: L
399
+ }, {
400
+ default: S(() => [
401
+ (i(!0), _(q, null, W(p.value, (M) => (i(), _(q, {
402
+ key: M.menuUrl
403
+ }, [
404
+ M.children && M.children.length > 0 ? (i(), A(l(Ze), {
405
+ key: 0,
406
+ index: M.menuUrl
407
+ }, {
408
+ title: S(() => [
409
+ t("span", Et, [
410
+ F(z(M.icon)) ? (i(), A(l(E), {
411
+ key: 0,
412
+ name: z(M.icon),
413
+ size: 16
414
+ }, null, 8, ["name"])) : (i(), _("span", Nt, x(P(M.menuName)), 1))
415
+ ]),
416
+ t("span", null, x(M.menuName), 1)
417
+ ]),
418
+ default: S(() => [
419
+ (i(!0), _(q, null, W(M.children, (B) => (i(), A(l(ye), {
420
+ key: B.menuUrl,
421
+ index: B.menuUrl
422
+ }, {
423
+ default: S(() => [
424
+ t("span", Mt, [
425
+ F(z(B.icon)) ? (i(), A(l(E), {
426
+ key: 0,
427
+ name: z(B.icon),
428
+ size: 16
429
+ }, null, 8, ["name"])) : (i(), _("span", Ut, x(P(B.menuName)), 1))
430
+ ]),
431
+ t("span", null, x(B.menuName), 1)
432
+ ]),
433
+ _: 2
434
+ }, 1032, ["index"]))), 128))
435
+ ]),
436
+ _: 2
437
+ }, 1032, ["index"])) : (i(), A(l(ye), {
438
+ key: 1,
439
+ index: M.menuUrl
440
+ }, {
441
+ default: S(() => [
442
+ t("span", Dt, [
443
+ F(z(M.icon)) ? (i(), A(l(E), {
444
+ key: 0,
445
+ name: z(M.icon),
446
+ size: 16
447
+ }, null, 8, ["name"])) : (i(), _("span", Rt, x(P(M.menuName)), 1))
448
+ ]),
449
+ t("span", null, x(M.menuName), 1)
450
+ ]),
451
+ _: 2
452
+ }, 1032, ["index"]))
453
+ ], 64))), 128))
454
+ ]),
455
+ _: 1
456
+ }, 8, ["default-active", "collapse", "background-color", "text-color", "active-text-color"]),
457
+ d.value ? j("", !0) : (i(), _("div", zt, [
458
+ t("div", Pt, [
459
+ t("span", Ot, x(l(u).userName), 1),
460
+ t("span", At, x(l(u).departmentName), 1)
461
+ ]),
462
+ k(l(xe), {
463
+ type: "text",
464
+ size: "small",
465
+ onClick: R
466
+ }, {
467
+ default: S(() => [...Y[1] || (Y[1] = [
468
+ ne("退出", -1)
469
+ ])]),
470
+ _: 1
471
+ })
472
+ ]))
473
+ ], 2));
474
+ }
475
+ }), X = (e, s) => {
476
+ const o = e.__vccOpts || e;
477
+ for (const [r, a] of s)
478
+ o[r] = a;
479
+ return o;
480
+ }, Ft = /* @__PURE__ */ X(Vt, [["__scopeId", "data-v-480fc818"]]), Bt = { class: "header" }, Kt = { class: "header__left" }, jt = { class: "header__logo" }, qt = { class: "header__logo-text" }, Yt = {
481
+ key: 0,
482
+ class: "header__breadcrumb"
483
+ }, Wt = {
484
+ key: 0,
485
+ class: "breadcrumb-separator"
486
+ }, Ht = { class: "header__right" }, Xt = ["title"], Gt = { class: "header__avatar" }, Jt = { class: "header__user-name" }, Qt = {
487
+ key: 0,
488
+ class: "header__dropdown"
489
+ }, Zt = { class: "header__dropdown-header" }, es = { class: "header__dropdown-avatar" }, ts = { class: "header__dropdown-info" }, ss = { class: "header__dropdown-name" }, os = { class: "header__dropdown-role" }, ns = { class: "header__dropdown-menu" }, as = { class: "search-container" }, ls = { class: "search-input-wrapper" }, rs = {
490
+ key: 0,
491
+ class: "search-results"
492
+ }, is = ["onClick"], us = { class: "search-result-info" }, cs = { class: "search-result-title" }, ds = {
493
+ key: 0,
494
+ class: "search-result-parent"
495
+ }, ms = {
496
+ key: 1,
497
+ class: "search-empty"
498
+ }, ps = { class: "settings-drawer" }, vs = { class: "settings-section" }, _s = { class: "settings-layout-options" }, hs = ["onClick"], fs = { class: "layout-option__preview" }, gs = {
499
+ key: 0,
500
+ class: "layout-preview-sidebar"
501
+ }, ys = {
502
+ key: 1,
503
+ class: "layout-preview-top"
504
+ }, ks = {
505
+ key: 2,
506
+ class: "layout-preview-mix"
507
+ }, bs = { class: "layout-option__label" }, ws = { class: "settings-section" }, Cs = { class: "settings-color-options" }, xs = ["title", "onClick"], Ss = { class: "settings-section" }, $s = { class: "settings-switch-list" }, Is = { class: "settings-switch-item" }, Ls = { class: "settings-switch-item" }, Ts = /* @__PURE__ */ Q({
508
+ __name: "Header",
509
+ setup(e) {
510
+ const s = de(), o = ee(), r = te(), a = H(), u = Ie(), C = ae(), m = h(!1), p = h(!1), d = h(null), v = h(!1), c = h(!1), y = h(""), V = h(null), L = h(!1), R = [
511
+ { value: "sidebar", label: "左侧菜单", icon: "sidebar-left" },
512
+ { value: "top", label: "顶部菜单", icon: "menu" },
513
+ { value: "mix", label: "混合菜单", icon: "grid" }
514
+ ], D = [
515
+ { value: "#409eff", label: "默认蓝" },
516
+ { value: "#1890ff", label: "科技蓝" },
517
+ { value: "#52c41a", label: "极光绿" },
518
+ { value: "#faad14", label: "日落橙" },
519
+ { value: "#f5222d", label: "薄暮红" },
520
+ { value: "#722ed1", label: "酱紫" }
521
+ ], z = g(() => s.matched.filter((n) => n.meta && n.meta.title).map((n) => ({
522
+ title: n.meta.title,
523
+ path: n.path
524
+ }))), P = (I, n = "") => {
525
+ const O = [];
526
+ return I.forEach((w) => {
527
+ w.children && w.children.length > 0 ? O.push(...P(w.children, w.title)) : O.push({ ...w, parentTitle: n });
528
+ }), O;
529
+ }, F = g(() => y.value.trim() ? P(C.menuList).filter(
530
+ (n) => n.title.toLowerCase().includes(y.value.toLowerCase())
531
+ ) : []), N = g(() => r.layout), Y = () => {
532
+ r.toggleCollapse();
533
+ }, M = () => {
534
+ r.toggleTheme();
535
+ }, B = () => {
536
+ p.value = !0;
537
+ }, le = (I) => {
538
+ r.setLayout(I), p.value = !1;
539
+ }, G = (I) => {
540
+ L.value = I;
541
+ const n = document.documentElement;
542
+ I ? n.classList.add("grey-mode") : n.classList.remove("grey-mode");
543
+ }, re = () => {
544
+ G(!L.value), p.value = !1;
545
+ }, T = () => {
546
+ r.toggleTheme(), p.value = !1;
547
+ }, se = () => {
548
+ document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
549
+ }, me = () => {
550
+ v.value = !!document.fullscreenElement;
551
+ }, Le = () => {
552
+ m.value = !m.value;
553
+ }, Z = () => {
554
+ m.value = !1;
555
+ }, pe = () => {
556
+ c.value = !0;
557
+ }, ie = () => {
558
+ c.value = !1, y.value = "";
559
+ }, ve = (I) => {
560
+ o.push(I), ie();
561
+ }, Te = (I) => {
562
+ r.setPrimaryColor(I), p.value = !1;
563
+ }, Ee = () => {
564
+ Z(), o.push("/profile");
565
+ }, Ne = () => {
566
+ Z(), o.push("/change-password");
567
+ }, _e = () => {
568
+ Z(), u.logout(), a.clearUserInfo(), C.clearMenu(), o.push("/login");
569
+ }, $ = (I) => {
570
+ d.value && !d.value.contains(I.target) && Z(), V.value && !V.value.contains(I.target) && ie();
571
+ }, b = (I) => {
572
+ I.key === "Escape" && (ie(), Z()), (I.ctrlKey || I.metaKey) && I.key === "k" && (I.preventDefault(), pe());
573
+ };
574
+ return Xe(() => {
575
+ document.addEventListener("click", $), document.addEventListener("fullscreenchange", me), document.addEventListener("keydown", b), r.initTheme(), L.value = document.documentElement.classList.contains("grey-mode");
576
+ }), Ge(() => {
577
+ document.removeEventListener("click", $), document.removeEventListener("fullscreenchange", me), document.removeEventListener("keydown", b);
578
+ }), (I, n) => {
579
+ var O;
580
+ return i(), _("div", Bt, [
581
+ t("div", Kt, [
582
+ t("div", jt, [
583
+ n[3] || (n[3] = t("img", {
584
+ src: Se,
585
+ alt: "Logo",
586
+ class: "header__logo-img"
587
+ }, null, -1)),
588
+ t("span", qt, x(l(r).appName), 1)
589
+ ]),
590
+ t("div", {
591
+ class: "header__collapse",
592
+ onClick: Y
593
+ }, [
594
+ k(l(E), {
595
+ name: l(r).isCollapsed ? "menu-unfold" : "menu-fold",
596
+ size: 18
597
+ }, null, 8, ["name"])
598
+ ]),
599
+ l(r).showBreadcrumb ? (i(), _("div", Yt, [
600
+ (i(!0), _(q, null, W(z.value, (w, oe) => (i(), _("span", {
601
+ key: w.path
602
+ }, [
603
+ oe > 0 ? (i(), _("span", Wt, "/")) : j("", !0),
604
+ t("span", {
605
+ class: K({ "is-current": oe === z.value.length - 1 })
606
+ }, x(w.title), 3)
607
+ ]))), 128))
608
+ ])) : j("", !0)
609
+ ]),
610
+ t("div", Ht, [
611
+ t("div", {
612
+ class: "header__action",
613
+ onClick: pe,
614
+ title: "搜索 (Ctrl+K)"
615
+ }, [
616
+ k(l(E), {
617
+ name: "search",
618
+ size: 16
619
+ })
620
+ ]),
621
+ t("div", {
622
+ class: "header__action",
623
+ onClick: se,
624
+ title: v.value ? "退出全屏" : "全屏"
625
+ }, [
626
+ k(l(E), {
627
+ name: v.value ? "fullscreen-exit" : "fullscreen",
628
+ size: 16
629
+ }, null, 8, ["name"])
630
+ ], 8, Xt),
631
+ t("div", {
632
+ class: "header__action",
633
+ onClick: B,
634
+ title: "换肤设置"
635
+ }, [
636
+ k(l(E), {
637
+ name: "skin",
638
+ size: 16
639
+ })
640
+ ]),
641
+ t("div", {
642
+ class: "header__action",
643
+ onClick: M,
644
+ title: "切换主题"
645
+ }, [
646
+ k(l(E), {
647
+ name: l(r).isDark ? "sun" : "moon",
648
+ size: 16
649
+ }, null, 8, ["name"])
650
+ ]),
651
+ t("div", {
652
+ class: "header__user",
653
+ ref_key: "dropdownRef",
654
+ ref: d
655
+ }, [
656
+ t("div", {
657
+ class: "header__user-trigger",
658
+ onClick: Re(Le, ["stop"])
659
+ }, [
660
+ t("div", Gt, [
661
+ t("span", null, x(((O = l(a).userName) == null ? void 0 : O.charAt(0)) || "U"), 1)
662
+ ]),
663
+ t("span", Jt, x(l(a).userName), 1),
664
+ t("span", {
665
+ class: K(["header__user-arrow", { "is-active": m.value }])
666
+ }, "▼", 2)
667
+ ]),
668
+ k(De, { name: "dropdown" }, {
669
+ default: S(() => {
670
+ var w;
671
+ return [
672
+ m.value ? (i(), _("div", Qt, [
673
+ t("div", Zt, [
674
+ t("div", es, [
675
+ t("span", null, x(((w = l(a).userName) == null ? void 0 : w.charAt(0)) || "U"), 1)
676
+ ]),
677
+ t("div", ts, [
678
+ t("div", ss, x(l(a).userName), 1),
679
+ t("div", os, x(l(a).departmentName), 1)
680
+ ])
681
+ ]),
682
+ n[8] || (n[8] = t("div", { class: "header__dropdown-divider" }, null, -1)),
683
+ t("div", ns, [
684
+ t("div", {
685
+ class: "header__dropdown-item",
686
+ onClick: Ee
687
+ }, [
688
+ k(l(E), {
689
+ name: "user",
690
+ size: 16
691
+ }),
692
+ n[4] || (n[4] = t("span", null, "个人信息", -1))
693
+ ]),
694
+ t("div", {
695
+ class: "header__dropdown-item",
696
+ onClick: Ne
697
+ }, [
698
+ k(l(E), {
699
+ name: "lock",
700
+ size: 16
701
+ }),
702
+ n[5] || (n[5] = t("span", null, "修改密码", -1))
703
+ ]),
704
+ n[7] || (n[7] = t("div", { class: "header__dropdown-divider" }, null, -1)),
705
+ t("div", {
706
+ class: "header__dropdown-item header__dropdown-item--danger",
707
+ onClick: _e
708
+ }, [
709
+ k(l(E), {
710
+ name: "logout",
711
+ size: 16
712
+ }),
713
+ n[6] || (n[6] = t("span", null, "退出登录", -1))
714
+ ])
715
+ ])
716
+ ])) : j("", !0)
717
+ ];
718
+ }),
719
+ _: 1
720
+ })
721
+ ], 512)
722
+ ]),
723
+ k(De, { name: "search" }, {
724
+ default: S(() => [
725
+ c.value ? (i(), _("div", {
726
+ key: 0,
727
+ class: "header__search-modal",
728
+ ref_key: "searchRef",
729
+ ref: V
730
+ }, [
731
+ t("div", as, [
732
+ t("div", ls, [
733
+ k(l(E), {
734
+ class: "search-icon",
735
+ name: "search",
736
+ size: 20
737
+ }),
738
+ He(t("input", {
739
+ "onUpdate:modelValue": n[0] || (n[0] = (w) => y.value = w),
740
+ type: "text",
741
+ class: "search-input",
742
+ placeholder: "搜索菜单...",
743
+ autofocus: "",
744
+ onKeyup: n[1] || (n[1] = Je((w) => F.value[0] && ve(F.value[0].path), ["enter"]))
745
+ }, null, 544), [
746
+ [mt, y.value]
747
+ ]),
748
+ n[9] || (n[9] = t("span", { class: "search-shortcut" }, "ESC 关闭", -1))
749
+ ]),
750
+ F.value.length > 0 ? (i(), _("div", rs, [
751
+ (i(!0), _(q, null, W(F.value, (w, oe) => (i(), _("div", {
752
+ key: w.path,
753
+ class: K(["search-result-item", { "is-first": oe === 0 }]),
754
+ onClick: (tn) => ve(w.path)
755
+ }, [
756
+ k(l(E), {
757
+ class: "search-result-icon",
758
+ name: w.icon || "file",
759
+ size: 20
760
+ }, null, 8, ["name"]),
761
+ t("div", us, [
762
+ t("span", cs, x(w.title), 1),
763
+ w.parentTitle ? (i(), _("span", ds, x(w.parentTitle), 1)) : j("", !0)
764
+ ])
765
+ ], 10, is))), 128))
766
+ ])) : y.value ? (i(), _("div", ms, " 未找到匹配的菜单 ")) : j("", !0)
767
+ ])
768
+ ], 512)) : j("", !0)
769
+ ]),
770
+ _: 1
771
+ }),
772
+ k(l(et), {
773
+ modelValue: p.value,
774
+ "onUpdate:modelValue": n[2] || (n[2] = (w) => p.value = w),
775
+ title: "换肤设置",
776
+ direction: "rtl",
777
+ size: "320px"
778
+ }, {
779
+ default: S(() => [
780
+ t("div", ps, [
781
+ t("div", vs, [
782
+ n[13] || (n[13] = t("div", { class: "settings-title" }, "布局模式", -1)),
783
+ t("div", _s, [
784
+ (i(), _(q, null, W(R, (w) => t("div", {
785
+ key: w.value,
786
+ class: K(["layout-option", { "is-active": N.value === w.value }]),
787
+ onClick: (oe) => le(w.value)
788
+ }, [
789
+ t("div", fs, [
790
+ w.value === "sidebar" ? (i(), _("div", gs, [...n[10] || (n[10] = [
791
+ t("div", { class: "preview-aside" }, null, -1),
792
+ t("div", { class: "preview-main" }, [
793
+ t("div", { class: "preview-header" }),
794
+ t("div", { class: "preview-content" })
795
+ ], -1)
796
+ ])])) : w.value === "top" ? (i(), _("div", ys, [...n[11] || (n[11] = [
797
+ t("div", { class: "preview-header-full" }, null, -1),
798
+ t("div", { class: "preview-content-full" }, null, -1)
799
+ ])])) : (i(), _("div", ks, [...n[12] || (n[12] = [
800
+ t("div", { class: "preview-header-mix" }, [
801
+ t("div", { class: "preview-mix-left" })
802
+ ], -1),
803
+ t("div", { class: "preview-mix-body" }, [
804
+ t("div", { class: "preview-mix-aside" }),
805
+ t("div", { class: "preview-mix-content" })
806
+ ], -1)
807
+ ])]))
808
+ ]),
809
+ t("span", bs, x(w.label), 1)
810
+ ], 10, hs)), 64))
811
+ ])
812
+ ]),
813
+ t("div", ws, [
814
+ n[14] || (n[14] = t("div", { class: "settings-title" }, "主题色", -1)),
815
+ t("div", Cs, [
816
+ (i(), _(q, null, W(D, (w) => t("div", {
817
+ key: w.value,
818
+ class: K(["color-option", { "is-active": l(r).primaryColor === w.value }]),
819
+ style: ze({ backgroundColor: w.value }),
820
+ title: w.label,
821
+ onClick: (oe) => Te(w.value)
822
+ }, [
823
+ l(r).primaryColor === w.value ? (i(), A(l(E), {
824
+ key: 0,
825
+ name: "check",
826
+ size: 12,
827
+ color: "#fff"
828
+ })) : j("", !0)
829
+ ], 14, xs)), 64))
830
+ ])
831
+ ]),
832
+ t("div", Ss, [
833
+ n[19] || (n[19] = t("div", { class: "settings-title" }, "功能设置", -1)),
834
+ t("div", $s, [
835
+ t("div", Is, [
836
+ n[16] || (n[16] = t("span", null, "灰色模式", -1)),
837
+ t("div", {
838
+ class: K(["switch-wrapper", { "is-checked": L.value }]),
839
+ onClick: re
840
+ }, [...n[15] || (n[15] = [
841
+ t("span", { class: "switch-core" }, null, -1)
842
+ ])], 2)
843
+ ]),
844
+ t("div", Ls, [
845
+ n[18] || (n[18] = t("span", null, "暗黑模式", -1)),
846
+ t("div", {
847
+ class: K(["switch-wrapper", { "is-checked": l(r).isDark }]),
848
+ onClick: T
849
+ }, [...n[17] || (n[17] = [
850
+ t("span", { class: "switch-core" }, null, -1)
851
+ ])], 2)
852
+ ])
853
+ ])
854
+ ])
855
+ ])
856
+ ]),
857
+ _: 1
858
+ }, 8, ["modelValue"])
859
+ ]);
860
+ };
861
+ }
862
+ }), Es = /* @__PURE__ */ X(Ts, [["__scopeId", "data-v-bf260d8d"]]), Ns = { class: "top-menu" }, Ms = { class: "top-menu__logo" }, Us = { class: "top-menu__logo-text" }, Ds = { class: "top-menu__menu-icon" }, Rs = {
863
+ key: 1,
864
+ class: "top-menu__menu-char"
865
+ }, zs = { class: "top-menu__menu-icon" }, Ps = {
866
+ key: 1,
867
+ class: "top-menu__menu-char"
868
+ }, Os = { class: "top-menu__menu-icon" }, As = {
869
+ key: 1,
870
+ class: "top-menu__menu-char"
871
+ }, Vs = { class: "top-menu__actions" }, Fs = ["title"], Bs = { class: "top-menu__avatar" }, Ks = { class: "top-menu__user-name" }, js = {
872
+ key: 0,
873
+ class: "top-menu__dropdown"
874
+ }, qs = { class: "top-menu__dropdown-header" }, Ys = { class: "top-menu__dropdown-avatar" }, Ws = { class: "top-menu__dropdown-info" }, Hs = { class: "top-menu__dropdown-name" }, Xs = { class: "top-menu__dropdown-role" }, Gs = { class: "top-menu__dropdown-menu" }, Js = { class: "settings-drawer" }, Qs = { class: "settings-section" }, Zs = { class: "settings-layout-options" }, eo = ["onClick"], to = { class: "layout-option__preview" }, so = {
875
+ key: 0,
876
+ class: "layout-preview-sidebar"
877
+ }, oo = {
878
+ key: 1,
879
+ class: "layout-preview-top"
880
+ }, no = {
881
+ key: 2,
882
+ class: "layout-preview-mix"
883
+ }, ao = { class: "layout-option__label" }, lo = { class: "settings-section" }, ro = { class: "settings-color-options" }, io = ["title", "onClick"], uo = { class: "settings-section" }, co = { class: "settings-switch-list" }, mo = { class: "settings-switch-item" }, po = { class: "settings-switch-item" }, vo = /* @__PURE__ */ Q({
884
+ __name: "TopMenu",
885
+ setup(e) {
886
+ const s = de(), o = ee(), r = ae(), a = te(), u = H(), C = Ie(), m = g(() => s.path), p = g(() => a.isDark ? "#1d1e1f" : "#fff"), d = g(() => a.isDark ? "#cfd3dc" : "#303133"), v = g(() => "#409eff"), c = h(!1), y = h(null), V = h(!1), L = h(!1), R = h(!1), D = ($) => {
887
+ $ && $ !== s.path && o.push($);
888
+ }, z = /* @__PURE__ */ new Set([
889
+ "arrow-up",
890
+ "arrow-down",
891
+ "arrow-left",
892
+ "arrow-right",
893
+ "caret-down",
894
+ "caret-right",
895
+ "plus",
896
+ "minus",
897
+ "close",
898
+ "check",
899
+ "edit",
900
+ "delete",
901
+ "copy",
902
+ "download",
903
+ "upload",
904
+ "refresh",
905
+ "search",
906
+ "filter",
907
+ "more",
908
+ "setting",
909
+ "share",
910
+ "loading",
911
+ "info",
912
+ "success",
913
+ "warning",
914
+ "error",
915
+ "question",
916
+ "user",
917
+ "user-add",
918
+ "user-group",
919
+ "logout",
920
+ "login",
921
+ "file",
922
+ "folder",
923
+ "folder-open",
924
+ "document",
925
+ "image",
926
+ "video",
927
+ "music",
928
+ "camera",
929
+ "mail",
930
+ "phone",
931
+ "chat",
932
+ "bell",
933
+ "message",
934
+ "eye",
935
+ "eye-off",
936
+ "calendar",
937
+ "clock",
938
+ "history",
939
+ "timer",
940
+ "location",
941
+ "map",
942
+ "globe",
943
+ "star",
944
+ "heart",
945
+ "thumb-up",
946
+ "link",
947
+ "external-link",
948
+ "lock",
949
+ "unlock",
950
+ "key",
951
+ "home",
952
+ "menu",
953
+ "menu-fold",
954
+ "menu-unfold",
955
+ "sidebar-fold",
956
+ "sidebar-expand",
957
+ "sidebar-left",
958
+ "dashboard",
959
+ "chart",
960
+ "chart-pie",
961
+ "chart-line",
962
+ "report",
963
+ "analytics",
964
+ "system",
965
+ "permission",
966
+ "role",
967
+ "user-manage",
968
+ "log",
969
+ "notification",
970
+ "app",
971
+ "list",
972
+ "grid",
973
+ "fullscreen",
974
+ "fullscreen-exit",
975
+ "zoom-in",
976
+ "zoom-out",
977
+ "print",
978
+ "bookmark",
979
+ "tag",
980
+ "code",
981
+ "terminal",
982
+ "database",
983
+ "server",
984
+ "cloud",
985
+ "gift",
986
+ "moon",
987
+ "sun",
988
+ "theme",
989
+ "skin"
990
+ ]), P = ($) => {
991
+ if (!$ || $ === "") return "";
992
+ if ($.startsWith("tineco-icon-")) {
993
+ const I = $.replace("tineco-icon-", "");
994
+ return {
995
+ home: "home",
996
+ dashboard: "dashboard",
997
+ system: "system",
998
+ user: "user",
999
+ role: "role",
1000
+ menu: "list",
1001
+ setting: "setting",
1002
+ file: "file",
1003
+ folder: "folder",
1004
+ chart: "chart",
1005
+ report: "report",
1006
+ analytics: "analytics"
1007
+ }[I] || I;
1008
+ }
1009
+ return {
1010
+ dashboard: "dashboard",
1011
+ system: "system",
1012
+ user: "user",
1013
+ role: "role",
1014
+ menu: "list",
1015
+ setting: "setting",
1016
+ home: "home",
1017
+ chart: "chart",
1018
+ report: "report",
1019
+ analytics: "analytics",
1020
+ permission: "permission",
1021
+ log: "log",
1022
+ notification: "notification",
1023
+ app: "app",
1024
+ list: "list",
1025
+ grid: "grid"
1026
+ }[$] || $;
1027
+ }, F = ($) => $ ? $.charAt(0) : "", N = ($) => z.has($), Y = () => {
1028
+ a.toggleTheme(), L.value = !1;
1029
+ }, M = () => {
1030
+ document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
1031
+ }, B = () => {
1032
+ V.value = !!document.fullscreenElement;
1033
+ }, le = () => {
1034
+ c.value = !c.value;
1035
+ }, G = () => {
1036
+ c.value = !1;
1037
+ }, re = () => {
1038
+ L.value = !0;
1039
+ }, T = ($) => {
1040
+ R.value = $;
1041
+ const b = document.documentElement;
1042
+ $ ? b.classList.add("grey-mode") : b.classList.remove("grey-mode");
1043
+ }, se = () => {
1044
+ T(!R.value), L.value = !1;
1045
+ }, me = () => {
1046
+ a.toggleTheme(), L.value = !1;
1047
+ }, Le = [
1048
+ { value: "sidebar", label: "左侧菜单", icon: "sidebar-left" },
1049
+ { value: "top", label: "顶部菜单", icon: "menu" },
1050
+ { value: "mix", label: "混合菜单", icon: "grid" }
1051
+ ], Z = g(() => a.layout), pe = ($) => {
1052
+ a.setLayout($), L.value = !1;
1053
+ }, ie = [
1054
+ { value: "#409eff", label: "默认蓝" },
1055
+ { value: "#1890ff", label: "科技蓝" },
1056
+ { value: "#52c41a", label: "极光绿" },
1057
+ { value: "#faad14", label: "日落橙" },
1058
+ { value: "#f5222d", label: "薄暮红" },
1059
+ { value: "#722ed1", label: "酱紫" }
1060
+ ], ve = ($) => {
1061
+ a.setPrimaryColor($), L.value = !1;
1062
+ }, Te = () => {
1063
+ G(), o.push("/profile");
1064
+ }, Ee = () => {
1065
+ G(), o.push("/change-password");
1066
+ }, Ne = () => {
1067
+ G(), C.logout(), u.clearUserInfo(), r.clearMenu(), o.push("/login");
1068
+ }, _e = ($) => {
1069
+ y.value && !y.value.contains($.target) && G();
1070
+ };
1071
+ return Xe(() => {
1072
+ document.addEventListener("click", _e), document.addEventListener("fullscreenchange", B), R.value = document.documentElement.classList.contains("grey-mode");
1073
+ }), Ge(() => {
1074
+ document.removeEventListener("click", _e), document.removeEventListener("fullscreenchange", B);
1075
+ }), ($, b) => {
1076
+ var I;
1077
+ return i(), _("div", Ns, [
1078
+ t("div", Ms, [
1079
+ b[1] || (b[1] = t("img", {
1080
+ src: Se,
1081
+ alt: "Logo",
1082
+ class: "top-menu__logo-img"
1083
+ }, null, -1)),
1084
+ t("span", Us, x(l(a).appName), 1)
1085
+ ]),
1086
+ k(l(Qe), {
1087
+ "default-active": m.value,
1088
+ mode: "horizontal",
1089
+ "background-color": p.value,
1090
+ "text-color": d.value,
1091
+ "active-text-color": v.value,
1092
+ class: "top-menu__menu",
1093
+ onSelect: D
1094
+ }, {
1095
+ default: S(() => [
1096
+ (i(!0), _(q, null, W(l(r).menuList, (n) => (i(), _(q, {
1097
+ key: n.menuUrl
1098
+ }, [
1099
+ n.children && n.children.length > 0 ? (i(), A(l(Ze), {
1100
+ key: 0,
1101
+ index: n.menuUrl
1102
+ }, {
1103
+ title: S(() => [
1104
+ t("span", Ds, [
1105
+ N(P(n.icon)) ? (i(), A(l(E), {
1106
+ key: 0,
1107
+ name: P(n.icon),
1108
+ size: 16
1109
+ }, null, 8, ["name"])) : (i(), _("span", Rs, x(F(n.menuName)), 1))
1110
+ ]),
1111
+ t("span", null, x(n.menuName), 1)
1112
+ ]),
1113
+ default: S(() => [
1114
+ (i(!0), _(q, null, W(n.children, (O) => (i(), A(l(ye), {
1115
+ key: O.menuUrl,
1116
+ index: O.menuUrl
1117
+ }, {
1118
+ default: S(() => [
1119
+ t("span", zs, [
1120
+ N(P(O.icon)) ? (i(), A(l(E), {
1121
+ key: 0,
1122
+ name: P(O.icon),
1123
+ size: 16
1124
+ }, null, 8, ["name"])) : (i(), _("span", Ps, x(F(O.menuName)), 1))
1125
+ ]),
1126
+ t("span", null, x(O.menuName), 1)
1127
+ ]),
1128
+ _: 2
1129
+ }, 1032, ["index"]))), 128))
1130
+ ]),
1131
+ _: 2
1132
+ }, 1032, ["index"])) : (i(), A(l(ye), {
1133
+ key: 1,
1134
+ index: n.menuUrl
1135
+ }, {
1136
+ default: S(() => [
1137
+ t("span", Os, [
1138
+ N(P(n.icon)) ? (i(), A(l(E), {
1139
+ key: 0,
1140
+ name: P(n.icon),
1141
+ size: 16
1142
+ }, null, 8, ["name"])) : (i(), _("span", As, x(F(n.menuName)), 1))
1143
+ ]),
1144
+ t("span", null, x(n.menuName), 1)
1145
+ ]),
1146
+ _: 2
1147
+ }, 1032, ["index"]))
1148
+ ], 64))), 128))
1149
+ ]),
1150
+ _: 1
1151
+ }, 8, ["default-active", "background-color", "text-color", "active-text-color"]),
1152
+ t("div", Vs, [
1153
+ t("div", {
1154
+ class: "top-menu__action",
1155
+ onClick: M,
1156
+ title: V.value ? "退出全屏" : "全屏"
1157
+ }, [
1158
+ k(l(E), {
1159
+ name: V.value ? "fullscreen-exit" : "fullscreen",
1160
+ size: 16
1161
+ }, null, 8, ["name"])
1162
+ ], 8, Fs),
1163
+ t("div", {
1164
+ class: "top-menu__action",
1165
+ onClick: re,
1166
+ title: "换肤设置"
1167
+ }, [
1168
+ k(l(E), {
1169
+ name: "skin",
1170
+ size: 16
1171
+ })
1172
+ ]),
1173
+ t("div", {
1174
+ class: "top-menu__action",
1175
+ onClick: Y,
1176
+ title: "切换主题"
1177
+ }, [
1178
+ k(l(E), {
1179
+ name: l(a).isDark ? "sun" : "moon",
1180
+ size: 16
1181
+ }, null, 8, ["name"])
1182
+ ]),
1183
+ t("div", {
1184
+ class: "top-menu__user",
1185
+ ref_key: "dropdownRef",
1186
+ ref: y
1187
+ }, [
1188
+ t("div", {
1189
+ class: "top-menu__user-trigger",
1190
+ onClick: Re(le, ["stop"])
1191
+ }, [
1192
+ t("div", Bs, [
1193
+ t("span", null, x(((I = l(u).userName) == null ? void 0 : I.charAt(0)) || "U"), 1)
1194
+ ]),
1195
+ t("span", Ks, x(l(u).userName), 1),
1196
+ t("span", {
1197
+ class: K(["top-menu__user-arrow", { "is-active": c.value }])
1198
+ }, "▼", 2)
1199
+ ]),
1200
+ k(De, { name: "dropdown" }, {
1201
+ default: S(() => {
1202
+ var n;
1203
+ return [
1204
+ c.value ? (i(), _("div", js, [
1205
+ t("div", qs, [
1206
+ t("div", Ys, [
1207
+ t("span", null, x(((n = l(u).userName) == null ? void 0 : n.charAt(0)) || "U"), 1)
1208
+ ]),
1209
+ t("div", Ws, [
1210
+ t("div", Hs, x(l(u).userName), 1),
1211
+ t("div", Xs, x(l(u).departmentName), 1)
1212
+ ])
1213
+ ]),
1214
+ b[6] || (b[6] = t("div", { class: "top-menu__dropdown-divider" }, null, -1)),
1215
+ t("div", Gs, [
1216
+ t("div", {
1217
+ class: "top-menu__dropdown-item",
1218
+ onClick: Te
1219
+ }, [
1220
+ k(l(E), {
1221
+ name: "user",
1222
+ size: 16
1223
+ }),
1224
+ b[2] || (b[2] = t("span", null, "个人信息", -1))
1225
+ ]),
1226
+ t("div", {
1227
+ class: "top-menu__dropdown-item",
1228
+ onClick: Ee
1229
+ }, [
1230
+ k(l(E), {
1231
+ name: "lock",
1232
+ size: 16
1233
+ }),
1234
+ b[3] || (b[3] = t("span", null, "修改密码", -1))
1235
+ ]),
1236
+ b[5] || (b[5] = t("div", { class: "top-menu__dropdown-divider" }, null, -1)),
1237
+ t("div", {
1238
+ class: "top-menu__dropdown-item top-menu__dropdown-item--danger",
1239
+ onClick: Ne
1240
+ }, [
1241
+ k(l(E), {
1242
+ name: "logout",
1243
+ size: 16
1244
+ }),
1245
+ b[4] || (b[4] = t("span", null, "退出登录", -1))
1246
+ ])
1247
+ ])
1248
+ ])) : j("", !0)
1249
+ ];
1250
+ }),
1251
+ _: 1
1252
+ })
1253
+ ], 512)
1254
+ ]),
1255
+ k(l(et), {
1256
+ modelValue: L.value,
1257
+ "onUpdate:modelValue": b[0] || (b[0] = (n) => L.value = n),
1258
+ title: "换肤设置",
1259
+ direction: "rtl",
1260
+ size: "320px"
1261
+ }, {
1262
+ default: S(() => [
1263
+ t("div", Js, [
1264
+ t("div", Qs, [
1265
+ b[10] || (b[10] = t("div", { class: "settings-title" }, "布局模式", -1)),
1266
+ t("div", Zs, [
1267
+ (i(), _(q, null, W(Le, (n) => t("div", {
1268
+ key: n.value,
1269
+ class: K(["layout-option", { "is-active": Z.value === n.value }]),
1270
+ onClick: (O) => pe(n.value)
1271
+ }, [
1272
+ t("div", to, [
1273
+ n.value === "sidebar" ? (i(), _("div", so, [...b[7] || (b[7] = [
1274
+ t("div", { class: "preview-aside" }, null, -1),
1275
+ t("div", { class: "preview-main" }, [
1276
+ t("div", { class: "preview-header" }),
1277
+ t("div", { class: "preview-content" })
1278
+ ], -1)
1279
+ ])])) : n.value === "top" ? (i(), _("div", oo, [...b[8] || (b[8] = [
1280
+ t("div", { class: "preview-header-full" }, null, -1),
1281
+ t("div", { class: "preview-content-full" }, null, -1)
1282
+ ])])) : (i(), _("div", no, [...b[9] || (b[9] = [
1283
+ t("div", { class: "preview-header-mix" }, [
1284
+ t("div", { class: "preview-mix-left" })
1285
+ ], -1),
1286
+ t("div", { class: "preview-mix-body" }, [
1287
+ t("div", { class: "preview-mix-aside" }),
1288
+ t("div", { class: "preview-mix-content" })
1289
+ ], -1)
1290
+ ])]))
1291
+ ]),
1292
+ t("span", ao, x(n.label), 1)
1293
+ ], 10, eo)), 64))
1294
+ ])
1295
+ ]),
1296
+ t("div", lo, [
1297
+ b[11] || (b[11] = t("div", { class: "settings-title" }, "主题色", -1)),
1298
+ t("div", ro, [
1299
+ (i(), _(q, null, W(ie, (n) => t("div", {
1300
+ key: n.value,
1301
+ class: K(["color-option", { "is-active": l(a).primaryColor === n.value }]),
1302
+ style: ze({ backgroundColor: n.value }),
1303
+ title: n.label,
1304
+ onClick: (O) => ve(n.value)
1305
+ }, [
1306
+ l(a).primaryColor === n.value ? (i(), A(l(E), {
1307
+ key: 0,
1308
+ name: "check",
1309
+ size: 12,
1310
+ color: "#fff"
1311
+ })) : j("", !0)
1312
+ ], 14, io)), 64))
1313
+ ])
1314
+ ]),
1315
+ t("div", uo, [
1316
+ b[16] || (b[16] = t("div", { class: "settings-title" }, "功能设置", -1)),
1317
+ t("div", co, [
1318
+ t("div", mo, [
1319
+ b[13] || (b[13] = t("span", null, "灰色模式", -1)),
1320
+ t("div", {
1321
+ class: K(["switch-wrapper", { "is-checked": R.value }]),
1322
+ onClick: se
1323
+ }, [...b[12] || (b[12] = [
1324
+ t("span", { class: "switch-core" }, null, -1)
1325
+ ])], 2)
1326
+ ]),
1327
+ t("div", po, [
1328
+ b[15] || (b[15] = t("span", null, "暗黑模式", -1)),
1329
+ t("div", {
1330
+ class: K(["switch-wrapper", { "is-checked": l(a).isDark }]),
1331
+ onClick: me
1332
+ }, [...b[14] || (b[14] = [
1333
+ t("span", { class: "switch-core" }, null, -1)
1334
+ ])], 2)
1335
+ ])
1336
+ ])
1337
+ ])
1338
+ ])
1339
+ ]),
1340
+ _: 1
1341
+ }, 8, ["modelValue"])
1342
+ ]);
1343
+ };
1344
+ }
1345
+ }), _o = /* @__PURE__ */ X(vo, [["__scopeId", "data-v-f0d83040"]]), ho = {
1346
+ key: 1,
1347
+ class: "layout__top-menu"
1348
+ }, fo = { class: "layout__main" }, go = {
1349
+ key: 0,
1350
+ class: "layout__header"
1351
+ }, yo = { class: "layout__content" }, ko = /* @__PURE__ */ Q({
1352
+ __name: "index",
1353
+ setup(e) {
1354
+ const s = te(), o = ae(), r = g(
1355
+ () => s.isCollapsed ? "64px" : "210px"
1356
+ ), a = g(() => s.layout), u = g(() => a.value === "sidebar" || a.value === "mix"), C = g(() => a.value === "top"), m = g(() => a.value !== "top"), p = g(() => (a.value !== "mix", o.menuList));
1357
+ return (d, v) => {
1358
+ const c = pt("router-view");
1359
+ return i(), _("div", {
1360
+ class: K(["layout", `layout--${a.value}`])
1361
+ }, [
1362
+ u.value ? (i(), _("aside", {
1363
+ key: 0,
1364
+ class: "layout__aside",
1365
+ style: ze({ width: r.value })
1366
+ }, [
1367
+ k(Ft, {
1368
+ "menu-list": a.value === "mix" ? p.value : l(o).menuList
1369
+ }, null, 8, ["menu-list"])
1370
+ ], 4)) : j("", !0),
1371
+ C.value ? (i(), _("div", ho, [
1372
+ k(_o)
1373
+ ])) : j("", !0),
1374
+ t("div", fo, [
1375
+ m.value ? (i(), _("header", go, [
1376
+ k(Es)
1377
+ ])) : j("", !0),
1378
+ t("main", yo, [
1379
+ k(c)
1380
+ ])
1381
+ ])
1382
+ ], 2);
1383
+ };
1384
+ }
1385
+ }), at = /* @__PURE__ */ X(ko, [["__scopeId", "data-v-7e8c7aeb"]]), bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1386
+ __proto__: null,
1387
+ default: at
1388
+ }, Symbol.toStringTag, { value: "Module" })), wo = { class: "tabs-wrapper" }, Co = { class: "tab-label" }, xo = ["onClick"], So = /* @__PURE__ */ Q({
1389
+ __name: "Tabs",
1390
+ setup(e) {
1391
+ const s = de(), o = ee(), r = g(() => {
1392
+ const m = [];
1393
+ return s.matched.forEach((p) => {
1394
+ var d;
1395
+ (d = p.meta) != null && d.affix && m.push({
1396
+ name: p.name,
1397
+ title: p.meta.title,
1398
+ path: p.path,
1399
+ affix: !0
1400
+ });
1401
+ }), m;
1402
+ }), a = g(() => s.path), u = (m) => {
1403
+ o.push(m);
1404
+ }, C = (m) => {
1405
+ const p = r.value.find((d) => d.path === m);
1406
+ if (!(p != null && p.affix) && m === a.value) {
1407
+ const d = r.value.findIndex((c) => c.path === m), v = r.value[d - 1] || r.value[d + 1];
1408
+ v && o.push(v.path);
1409
+ }
1410
+ };
1411
+ return (m, p) => (i(), _("div", wo, [
1412
+ k(l(vt), {
1413
+ modelValue: a.value,
1414
+ "onUpdate:modelValue": p[0] || (p[0] = (d) => a.value = d),
1415
+ type: "card",
1416
+ onTabClick: u
1417
+ }, {
1418
+ default: S(() => [
1419
+ (i(!0), _(q, null, W(r.value, (d) => (i(), A(l(_t), {
1420
+ key: d.path,
1421
+ name: d.path,
1422
+ label: d.title,
1423
+ closable: !d.affix
1424
+ }, {
1425
+ label: S(() => [
1426
+ t("span", Co, [
1427
+ ne(x(d.title) + " ", 1),
1428
+ d.affix ? j("", !0) : (i(), _("span", {
1429
+ key: 0,
1430
+ class: "tab-close",
1431
+ onClick: Re((v) => C(d.path), ["stop"])
1432
+ }, " ✕ ", 8, xo))
1433
+ ])
1434
+ ]),
1435
+ _: 2
1436
+ }, 1032, ["name", "label", "closable"]))), 128))
1437
+ ]),
1438
+ _: 1
1439
+ }, 8, ["modelValue"])
1440
+ ]));
1441
+ }
1442
+ }), _n = /* @__PURE__ */ X(So, [["__scopeId", "data-v-9156d8cd"]]), $o = {}, Io = { class: "footer" };
1443
+ function Lo(e, s) {
1444
+ return i(), _("div", Io, [...s[0] || (s[0] = [
1445
+ t("span", null, "Copyright © 2024 Xto Demo. All Rights Reserved.", -1)
1446
+ ])]);
1447
+ }
1448
+ const hn = /* @__PURE__ */ X($o, [["render", Lo], ["__scopeId", "data-v-4852826a"]]), To = () => {
1449
+ const e = gt.create({
1450
+ baseURL: void 0,
1451
+ timeout: 3e4,
1452
+ headers: {
1453
+ "Content-Type": "application/json"
1454
+ }
1455
+ });
1456
+ return e.interceptors.request.use(
1457
+ (s) => {
1458
+ const o = $e(), r = bt() || "Bearer";
1459
+ return o && (s.headers.Authorization = `${r} ${o}`), s;
1460
+ },
1461
+ (s) => Promise.reject(s)
1462
+ ), e.interceptors.response.use(
1463
+ (s) => {
1464
+ const { data: o } = s;
1465
+ return o.code === 200 || o.code === 0 ? o.data : (J.error(o.message || "请求失败"), Promise.reject(new Error(o.message || "请求失败")));
1466
+ },
1467
+ (s) => {
1468
+ var r;
1469
+ const { response: o } = s;
1470
+ if (o)
1471
+ switch (o.status) {
1472
+ case 401:
1473
+ J.error("登录已过期,请重新登录"), ot(), window.location.href = "/login";
1474
+ break;
1475
+ case 403:
1476
+ J.error("没有权限访问");
1477
+ break;
1478
+ case 404:
1479
+ J.error("请求资源不存在");
1480
+ break;
1481
+ case 500:
1482
+ J.error("服务器错误");
1483
+ break;
1484
+ default:
1485
+ J.error(((r = o.data) == null ? void 0 : r.message) || "请求失败");
1486
+ }
1487
+ else
1488
+ J.error("网络连接失败");
1489
+ return Promise.reject(s);
1490
+ }
1491
+ ), e;
1492
+ }, ce = To(), U = {
1493
+ get(e, s) {
1494
+ return ce.get(e, s);
1495
+ },
1496
+ post(e, s, o) {
1497
+ return ce.post(e, s, o);
1498
+ },
1499
+ put(e, s, o) {
1500
+ return ce.put(e, s, o);
1501
+ },
1502
+ patch(e, s, o) {
1503
+ return ce.patch(e, s, o);
1504
+ },
1505
+ delete(e, s) {
1506
+ return ce.delete(e, s);
1507
+ }
1508
+ };
1509
+ function Eo(e) {
1510
+ return U.post("/user/v1.0/login/by-domain", e);
1511
+ }
1512
+ function fn() {
1513
+ return U.put("/user/v1.0/user/logout");
1514
+ }
1515
+ function No() {
1516
+ return U.get("/user/v1.0/user/get-me");
1517
+ }
1518
+ function gn(e) {
1519
+ return U.post("/user/v1.0/refresh", { refreshToken: e });
1520
+ }
1521
+ const ke = h(""), be = h(""), we = h("");
1522
+ function yn(e) {
1523
+ e.appId && (ke.value = e.appId), e.clientId && (be.value = e.clientId), e.apiBaseUrl && (we.value = e.apiBaseUrl);
1524
+ }
1525
+ function Ye() {
1526
+ if (ke.value)
1527
+ return ke.value;
1528
+ try {
1529
+ return "";
1530
+ } catch {
1531
+ return "";
1532
+ }
1533
+ }
1534
+ function Mo() {
1535
+ if (be.value)
1536
+ return be.value;
1537
+ try {
1538
+ return "";
1539
+ } catch {
1540
+ return "";
1541
+ }
1542
+ }
1543
+ function kn() {
1544
+ if (we.value)
1545
+ return we.value;
1546
+ try {
1547
+ return "";
1548
+ } catch {
1549
+ return "";
1550
+ }
1551
+ }
1552
+ const bn = {
1553
+ appId: ke,
1554
+ clientId: be,
1555
+ apiBaseUrl: we
1556
+ }, Uo = { class: "login" }, Do = { class: "login__container" }, Ro = /* @__PURE__ */ Q({
1557
+ __name: "index",
1558
+ setup(e) {
1559
+ const s = ee(), o = de(), r = h(!1), a = h(!1), u = Pe({
1560
+ uid: "",
1561
+ password: ""
1562
+ }), C = {
1563
+ uid: [
1564
+ { required: !0, message: "请输入用户名", trigger: "blur" }
1565
+ ],
1566
+ password: [
1567
+ { required: !0, message: "请输入密码", trigger: "blur" },
1568
+ { min: 6, message: "密码长度至少6位", trigger: "blur" }
1569
+ ]
1570
+ }, m = h(), p = async () => {
1571
+ var d;
1572
+ try {
1573
+ await ((d = m.value) == null ? void 0 : d.validate()), r.value = !0;
1574
+ const v = await Eo({
1575
+ appId: Ye(),
1576
+ clientId: Mo(),
1577
+ uid: u.uid,
1578
+ password: u.password,
1579
+ code: !0
1580
+ });
1581
+ st(v), J.success("登录成功");
1582
+ const c = o.query.redirect || "/";
1583
+ s.push(c);
1584
+ } catch (v) {
1585
+ console.error("登录失败:", v);
1586
+ } finally {
1587
+ r.value = !1;
1588
+ }
1589
+ };
1590
+ return (d, v) => (i(), _("div", Uo, [
1591
+ t("div", Do, [
1592
+ v[5] || (v[5] = t("div", { class: "login__header" }, [
1593
+ t("img", {
1594
+ src: Se,
1595
+ alt: "Logo",
1596
+ class: "login__logo"
1597
+ }),
1598
+ t("h1", { class: "login__title" }, "Xto Demo"),
1599
+ t("p", { class: "login__subtitle" }, "后台管理系统")
1600
+ ], -1)),
1601
+ k(l(ht), {
1602
+ ref_key: "formRef",
1603
+ ref: m,
1604
+ model: u,
1605
+ rules: C,
1606
+ class: "login__form",
1607
+ "label-width": "0"
1608
+ }, {
1609
+ default: S(() => [
1610
+ k(l(he), { prop: "uid" }, {
1611
+ default: S(() => [
1612
+ k(l(We), {
1613
+ modelValue: u.uid,
1614
+ "onUpdate:modelValue": v[0] || (v[0] = (c) => u.uid = c),
1615
+ placeholder: "用户名",
1616
+ size: "large"
1617
+ }, {
1618
+ prefix: S(() => [
1619
+ k(l(E), {
1620
+ name: "user",
1621
+ size: 18
1622
+ })
1623
+ ]),
1624
+ _: 1
1625
+ }, 8, ["modelValue"])
1626
+ ]),
1627
+ _: 1
1628
+ }),
1629
+ k(l(he), { prop: "password" }, {
1630
+ default: S(() => [
1631
+ k(l(We), {
1632
+ modelValue: u.password,
1633
+ "onUpdate:modelValue": v[1] || (v[1] = (c) => u.password = c),
1634
+ type: "password",
1635
+ placeholder: "密码",
1636
+ size: "large",
1637
+ "show-password": "",
1638
+ onKeyup: Je(p, ["enter"])
1639
+ }, {
1640
+ prefix: S(() => [
1641
+ k(l(E), {
1642
+ name: "lock",
1643
+ size: 18
1644
+ })
1645
+ ]),
1646
+ _: 1
1647
+ }, 8, ["modelValue"])
1648
+ ]),
1649
+ _: 1
1650
+ }),
1651
+ k(l(he), null, {
1652
+ default: S(() => [
1653
+ k(l(ft), {
1654
+ modelValue: a.value,
1655
+ "onUpdate:modelValue": v[2] || (v[2] = (c) => a.value = c)
1656
+ }, {
1657
+ default: S(() => [...v[3] || (v[3] = [
1658
+ ne("记住我", -1)
1659
+ ])]),
1660
+ _: 1
1661
+ }, 8, ["modelValue"])
1662
+ ]),
1663
+ _: 1
1664
+ }),
1665
+ k(l(he), null, {
1666
+ default: S(() => [
1667
+ k(l(xe), {
1668
+ type: "primary",
1669
+ size: "large",
1670
+ loading: r.value,
1671
+ class: "login__submit",
1672
+ onClick: p
1673
+ }, {
1674
+ default: S(() => [...v[4] || (v[4] = [
1675
+ ne(" 登录 ", -1)
1676
+ ])]),
1677
+ _: 1
1678
+ }, 8, ["loading"])
1679
+ ]),
1680
+ _: 1
1681
+ })
1682
+ ]),
1683
+ _: 1
1684
+ }, 8, ["model"]),
1685
+ v[6] || (v[6] = t("div", { class: "login__footer" }, [
1686
+ t("p", null, "请输入您的用户名和密码")
1687
+ ], -1))
1688
+ ])
1689
+ ]));
1690
+ }
1691
+ }), zo = /* @__PURE__ */ X(Ro, [["__scopeId", "data-v-f3e724b6"]]), Po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1692
+ __proto__: null,
1693
+ default: zo
1694
+ }, Symbol.toStringTag, { value: "Module" })), Oo = { class: "error-page" }, Ao = { class: "error-page__content" }, Vo = /* @__PURE__ */ Q({
1695
+ __name: "404",
1696
+ setup(e) {
1697
+ const s = ee(), o = () => {
1698
+ s.push("/");
1699
+ };
1700
+ return (r, a) => (i(), _("div", Oo, [
1701
+ t("div", Ao, [
1702
+ a[1] || (a[1] = t("div", { class: "error-page__code" }, "404", -1)),
1703
+ a[2] || (a[2] = t("div", { class: "error-page__title" }, "页面不存在", -1)),
1704
+ a[3] || (a[3] = t("div", { class: "error-page__desc" }, "抱歉,您访问的页面不存在或已被删除", -1)),
1705
+ k(l(xe), {
1706
+ type: "primary",
1707
+ onClick: o
1708
+ }, {
1709
+ default: S(() => [...a[0] || (a[0] = [
1710
+ ne("返回首页", -1)
1711
+ ])]),
1712
+ _: 1
1713
+ })
1714
+ ])
1715
+ ]));
1716
+ }
1717
+ }), Fo = /* @__PURE__ */ X(Vo, [["__scopeId", "data-v-c3c12c24"]]), Bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1718
+ __proto__: null,
1719
+ default: Fo
1720
+ }, Symbol.toStringTag, { value: "Module" })), Ko = { class: "error-page" }, jo = { class: "error-page__content" }, qo = /* @__PURE__ */ Q({
1721
+ __name: "403",
1722
+ setup(e) {
1723
+ const s = ee(), o = () => {
1724
+ s.push("/");
1725
+ };
1726
+ return (r, a) => (i(), _("div", Ko, [
1727
+ t("div", jo, [
1728
+ a[1] || (a[1] = t("div", { class: "error-page__code" }, "403", -1)),
1729
+ a[2] || (a[2] = t("div", { class: "error-page__title" }, "无访问权限", -1)),
1730
+ a[3] || (a[3] = t("div", { class: "error-page__desc" }, "抱歉,您没有权限访问此页面", -1)),
1731
+ k(l(xe), {
1732
+ type: "primary",
1733
+ onClick: o
1734
+ }, {
1735
+ default: S(() => [...a[0] || (a[0] = [
1736
+ ne("返回首页", -1)
1737
+ ])]),
1738
+ _: 1
1739
+ })
1740
+ ])
1741
+ ]));
1742
+ }
1743
+ }), Yo = /* @__PURE__ */ X(qo, [["__scopeId", "data-v-dd5f2795"]]), Wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1744
+ __proto__: null,
1745
+ default: Yo
1746
+ }, Symbol.toStringTag, { value: "Module" }));
1747
+ function wn() {
1748
+ const e = te(), s = H(), o = Ie(), r = g(() => s.userName || ""), a = g(() => s.userInfo), u = g(() => e.appName), C = g(() => o.isLoggedIn), m = g(() => e.isDark), p = g(() => e.theme), d = g(() => e.isCollapsed), v = g(() => e.layout);
1749
+ return {
1750
+ userName: r,
1751
+ userInfo: a,
1752
+ appName: u,
1753
+ isLoggedIn: C,
1754
+ isDark: m,
1755
+ theme: p,
1756
+ isCollapsed: d,
1757
+ layout: v,
1758
+ toggleTheme: () => {
1759
+ e.toggleTheme();
1760
+ },
1761
+ toggleCollapse: () => {
1762
+ e.toggleCollapse();
1763
+ }
1764
+ };
1765
+ }
1766
+ function Cn() {
1767
+ const e = H();
1768
+ return {
1769
+ isLoggedIn: g(() => e.isLoggedIn)
1770
+ };
1771
+ }
1772
+ function xn(e, s = {}) {
1773
+ const { rules: o, onSubmit: r } = s, a = h(), u = Pe({ ...e }), C = h(!1), m = h(!1), p = h(!1), d = () => {
1774
+ y(), p.value = !1, m.value = !0;
1775
+ }, v = (L) => {
1776
+ Object.assign(u, L), p.value = !0, m.value = !0;
1777
+ }, c = () => {
1778
+ m.value = !1, y();
1779
+ }, y = () => {
1780
+ var L;
1781
+ Object.keys(e).forEach((R) => {
1782
+ u[R] = e[R];
1783
+ }), (L = a.value) == null || L.resetFields();
1784
+ };
1785
+ return {
1786
+ formRef: a,
1787
+ formData: u,
1788
+ rules: o,
1789
+ loading: C,
1790
+ visible: m,
1791
+ isEdit: p,
1792
+ openAdd: d,
1793
+ openEdit: v,
1794
+ close: c,
1795
+ resetForm: y,
1796
+ handleSubmit: async () => {
1797
+ var L;
1798
+ try {
1799
+ await ((L = a.value) == null ? void 0 : L.validate()), C.value = !0, await (r == null ? void 0 : r(u)), c();
1800
+ } catch (R) {
1801
+ console.error(R);
1802
+ } finally {
1803
+ C.value = !1;
1804
+ }
1805
+ }
1806
+ };
1807
+ }
1808
+ function Sn(e) {
1809
+ const { fetchData: s, defaultPageSize: o = 10 } = e, r = h(!1), a = h([]), u = h(0), C = h(1), m = h(o), p = Pe({}), d = async () => {
1810
+ r.value = !0;
1811
+ try {
1812
+ const D = {
1813
+ ...p,
1814
+ page: C.value,
1815
+ pageSize: m.value
1816
+ }, z = await s(D);
1817
+ a.value = z.list, u.value = z.total;
1818
+ } catch (D) {
1819
+ console.error(D);
1820
+ } finally {
1821
+ r.value = !1;
1822
+ }
1823
+ }, v = () => {
1824
+ C.value = 1, d();
1825
+ }, c = () => {
1826
+ Object.keys(p).forEach((D) => {
1827
+ p[D] = void 0;
1828
+ }), C.value = 1, d();
1829
+ }, y = (D) => {
1830
+ C.value = D, d();
1831
+ }, V = (D) => {
1832
+ m.value = D, C.value = 1, d();
1833
+ }, L = () => {
1834
+ d();
1835
+ }, R = g(() => ({
1836
+ current: C.value,
1837
+ pageSize: m.value,
1838
+ total: u.value
1839
+ }));
1840
+ return {
1841
+ loading: r,
1842
+ data: a,
1843
+ total: u,
1844
+ currentPage: C,
1845
+ pageSize: m,
1846
+ searchParams: p,
1847
+ pagination: R,
1848
+ getData: d,
1849
+ handleSearch: v,
1850
+ handleReset: c,
1851
+ handlePageChange: y,
1852
+ handleSizeChange: V,
1853
+ refresh: L
1854
+ };
1855
+ }
1856
+ function $n(e) {
1857
+ return H().isLoggedIn;
1858
+ }
1859
+ function In(e) {
1860
+ return H().isLoggedIn;
1861
+ }
1862
+ function Ln() {
1863
+ return !0;
1864
+ }
1865
+ const lt = [
1866
+ {
1867
+ path: "/login",
1868
+ name: "Login",
1869
+ component: () => Promise.resolve().then(() => Po),
1870
+ meta: {
1871
+ title: "登录",
1872
+ hidden: !0
1873
+ }
1874
+ },
1875
+ {
1876
+ path: "/404",
1877
+ name: "NotFound",
1878
+ component: () => Promise.resolve().then(() => Bo),
1879
+ meta: {
1880
+ title: "404",
1881
+ hidden: !0
1882
+ }
1883
+ },
1884
+ {
1885
+ path: "/403",
1886
+ name: "Forbidden",
1887
+ component: () => Promise.resolve().then(() => Wo),
1888
+ meta: {
1889
+ title: "403",
1890
+ hidden: !0
1891
+ }
1892
+ }
1893
+ ], rt = {
1894
+ path: "/:pathMatch(.*)*",
1895
+ redirect: "/404",
1896
+ meta: {
1897
+ hidden: !0
1898
+ }
1899
+ }, it = {
1900
+ path: "/",
1901
+ name: "Layout",
1902
+ component: () => Promise.resolve().then(() => bo),
1903
+ redirect: "/dashboard",
1904
+ children: [
1905
+ {
1906
+ path: "/dashboard",
1907
+ name: "Dashboard",
1908
+ component: () => import("./index-23nX2t9j.js"),
1909
+ meta: {
1910
+ title: "仪表盘",
1911
+ icon: "dashboard",
1912
+ keepAlive: !0,
1913
+ affix: !0
1914
+ }
1915
+ },
1916
+ {
1917
+ path: "/system/user",
1918
+ name: "SystemUser",
1919
+ component: () => import("./index-iyQQumAA.js"),
1920
+ meta: {
1921
+ title: "用户管理",
1922
+ icon: "user",
1923
+ keepAlive: !0
1924
+ }
1925
+ },
1926
+ {
1927
+ path: "/system/role",
1928
+ name: "SystemRole",
1929
+ component: () => import("./index-D8YBeNfn.js"),
1930
+ meta: {
1931
+ title: "角色管理",
1932
+ icon: "role",
1933
+ keepAlive: !0
1934
+ }
1935
+ },
1936
+ {
1937
+ path: "/system/menu",
1938
+ name: "SystemMenu",
1939
+ component: () => import("./index-8oCLh51t.js"),
1940
+ meta: {
1941
+ title: "菜单管理",
1942
+ icon: "menu",
1943
+ keepAlive: !0
1944
+ }
1945
+ }
1946
+ ]
1947
+ }, Tn = [
1948
+ {
1949
+ path: "/dashboard",
1950
+ name: "Dashboard",
1951
+ component: () => import("./index-23nX2t9j.js"),
1952
+ meta: {
1953
+ title: "仪表盘",
1954
+ icon: "dashboard",
1955
+ keepAlive: !0,
1956
+ affix: !0
1957
+ }
1958
+ },
1959
+ {
1960
+ path: "/system",
1961
+ name: "System",
1962
+ redirect: "/system/user",
1963
+ meta: {
1964
+ title: "系统管理",
1965
+ icon: "setting"
1966
+ },
1967
+ children: [
1968
+ {
1969
+ path: "user",
1970
+ name: "SystemUser",
1971
+ component: () => import("./index-iyQQumAA.js"),
1972
+ meta: {
1973
+ title: "用户管理",
1974
+ icon: "user",
1975
+ keepAlive: !0
1976
+ }
1977
+ },
1978
+ {
1979
+ path: "role",
1980
+ name: "SystemRole",
1981
+ component: () => import("./index-D8YBeNfn.js"),
1982
+ meta: {
1983
+ title: "角色管理",
1984
+ icon: "role",
1985
+ keepAlive: !0
1986
+ }
1987
+ },
1988
+ {
1989
+ path: "menu",
1990
+ name: "SystemMenu",
1991
+ component: () => import("./index-8oCLh51t.js"),
1992
+ meta: {
1993
+ title: "菜单管理",
1994
+ icon: "menu",
1995
+ keepAlive: !0
1996
+ }
1997
+ }
1998
+ ]
1999
+ }
2000
+ ], Ho = [
2001
+ {
2002
+ menuCode: "dashboard",
2003
+ menuName: "仪表盘",
2004
+ menuUrl: "/dashboard",
2005
+ icon: "dashboard",
2006
+ closable: !0,
2007
+ isDefault: !0,
2008
+ isOut: !1
2009
+ },
2010
+ {
2011
+ menuCode: "system",
2012
+ menuName: "系统管理",
2013
+ menuUrl: "/system",
2014
+ icon: "setting",
2015
+ closable: !1,
2016
+ isDefault: !1,
2017
+ isOut: !1,
2018
+ children: [
2019
+ {
2020
+ menuCode: "system_user",
2021
+ menuName: "用户管理",
2022
+ menuUrl: "/system/user",
2023
+ icon: "user",
2024
+ closable: !0,
2025
+ isDefault: !1,
2026
+ isOut: !1
2027
+ },
2028
+ {
2029
+ menuCode: "system_role",
2030
+ menuName: "角色管理",
2031
+ menuUrl: "/system/role",
2032
+ icon: "role",
2033
+ closable: !0,
2034
+ isDefault: !1,
2035
+ isOut: !1
2036
+ },
2037
+ {
2038
+ menuCode: "system_menu",
2039
+ menuName: "菜单管理",
2040
+ menuUrl: "/system/menu",
2041
+ icon: "menu",
2042
+ closable: !0,
2043
+ isDefault: !1,
2044
+ isOut: !1
2045
+ }
2046
+ ]
2047
+ }
2048
+ ], ut = Oe({
2049
+ history: Ae(),
2050
+ routes: [...lt, it, rt],
2051
+ scrollBehavior: () => ({ left: 0, top: 0 })
2052
+ }), Xo = ["/login", "/404", "/403"];
2053
+ ut.beforeEach(async (e, s, o) => {
2054
+ const r = te();
2055
+ if (r.initTheme(), nt())
2056
+ if (e.path === "/login")
2057
+ o({ path: "/" });
2058
+ else {
2059
+ const a = H();
2060
+ a.isLoggedIn || (a.setUserInfo({
2061
+ appId: Ye(),
2062
+ userId: "1",
2063
+ userName: "管理员",
2064
+ departmentName: "技术部",
2065
+ email: "admin@example.com",
2066
+ mobilePhone: "13800138000",
2067
+ positionName: "管理员",
2068
+ avatar: ""
2069
+ }), ae().setMenuList(Ho)), e.name && e.meta.keepAlive && r.addCachedView(e.name), o();
2070
+ }
2071
+ else
2072
+ Xo.includes(e.path) ? o() : o("/login");
2073
+ });
2074
+ function En() {
2075
+ const e = Oe({
2076
+ history: Ae(),
2077
+ routes: [...lt, it, rt]
2078
+ });
2079
+ ut.matcher = e.matcher;
2080
+ }
2081
+ function Nn(e, s = {}) {
2082
+ const o = s.indexPath || "/dashboard";
2083
+ return {
2084
+ path: "/",
2085
+ name: "Layout",
2086
+ component: at,
2087
+ redirect: o,
2088
+ children: e
2089
+ };
2090
+ }
2091
+ function Mn(e) {
2092
+ return Oe({
2093
+ history: Ae(),
2094
+ routes: e,
2095
+ scrollBehavior: () => ({ left: 0, top: 0 })
2096
+ });
2097
+ }
2098
+ function Un(e) {
2099
+ return U.get("/role/list", { params: e });
2100
+ }
2101
+ function Dn(e) {
2102
+ return U.get(`/role/${e}`);
2103
+ }
2104
+ function Rn(e) {
2105
+ return U.post("/role", e);
2106
+ }
2107
+ function zn(e, s) {
2108
+ return U.put(`/role/${e}`, s);
2109
+ }
2110
+ function Pn(e) {
2111
+ return U.delete(`/role/${e}`);
2112
+ }
2113
+ function On(e, s) {
2114
+ return U.patch(`/role/${e}/status`, { status: s });
2115
+ }
2116
+ function An() {
2117
+ return U.get("/user/v1.0/menu/list");
2118
+ }
2119
+ function Go(e) {
2120
+ const s = e || Ye();
2121
+ return U.get(`/user/v1.0/menu/get-menu?appId=${s}`);
2122
+ }
2123
+ function Vn(e) {
2124
+ return U.post("/menu", e);
2125
+ }
2126
+ function Fn(e, s) {
2127
+ return U.put(`/menu/${e}`, s);
2128
+ }
2129
+ function Bn(e) {
2130
+ return U.delete(`/menu/${e}`);
2131
+ }
2132
+ const Jo = ["/login", "/404", "/403"];
2133
+ function Kn(e, s = {}) {
2134
+ const o = s.whiteList || Jo, r = s.loginPath || "/login", a = s.homePath || "/";
2135
+ e.beforeEach(async (u, C, m) => {
2136
+ const p = te(), d = H(), v = ae();
2137
+ if (p.initTheme(), $e())
2138
+ if (u.path === r)
2139
+ m({ path: a });
2140
+ else if (d.isLoggedIn)
2141
+ u.name && u.meta.keepAlive && p.addCachedView(u.name), m();
2142
+ else
2143
+ try {
2144
+ if (s.fetchUserInfo) {
2145
+ const y = await s.fetchUserInfo();
2146
+ d.setUserInfo(y);
2147
+ } else {
2148
+ const y = await No();
2149
+ d.setUserInfo(y);
2150
+ }
2151
+ if (s.fetchMenu) {
2152
+ const y = await s.fetchMenu();
2153
+ v.setMenuList(y);
2154
+ } else {
2155
+ const y = await Go(s.appId);
2156
+ v.setMenuList(y);
2157
+ }
2158
+ s.onLoginSuccess && s.onLoginSuccess(), u.name && u.meta.keepAlive && p.addCachedView(u.name), m({ ...u, replace: !0 });
2159
+ } catch (y) {
2160
+ console.error("获取用户信息失败:", y), d.clearUserInfo(), v.clearMenu(), localStorage.removeItem("token"), localStorage.removeItem("token_type"), localStorage.removeItem("refresh_token"), m({ path: r, query: { redirect: u.fullPath } });
2161
+ }
2162
+ else
2163
+ o.includes(u.path) ? m() : m({ path: r, query: { redirect: u.fullPath } });
2164
+ }), e.afterEach(() => {
2165
+ });
2166
+ }
2167
+ function jn(e) {
2168
+ return U.get("/user/list", { params: e });
2169
+ }
2170
+ function qn(e) {
2171
+ return U.get(`/user/${e}`);
2172
+ }
2173
+ function Yn(e) {
2174
+ return U.post("/user", e);
2175
+ }
2176
+ function Wn(e, s) {
2177
+ return U.put(`/user/${e}`, s);
2178
+ }
2179
+ function Hn(e) {
2180
+ return U.delete(`/user/${e}`);
2181
+ }
2182
+ function Xn(e) {
2183
+ return U.post("/user/batch-delete", { ids: e });
2184
+ }
2185
+ function Gn(e, s) {
2186
+ return U.patch(`/user/${e}/status`, { status: s });
2187
+ }
2188
+ function Jn(e) {
2189
+ return U.post(`/user/${e}/reset-password`);
2190
+ }
2191
+ var Qo = /* @__PURE__ */ ((e) => (e[e.ENABLED = 1] = "ENABLED", e[e.DISABLED = 0] = "DISABLED", e))(Qo || {}), Zo = /* @__PURE__ */ ((e) => (e[e.UNKNOWN = 0] = "UNKNOWN", e[e.MALE = 1] = "MALE", e[e.FEMALE = 2] = "FEMALE", e))(Zo || {}), en = /* @__PURE__ */ ((e) => (e[e.DIRECTORY = 0] = "DIRECTORY", e[e.MENU = 1] = "MENU", e[e.BUTTON = 2] = "BUTTON", e))(en || {});
2192
+ const Qn = {
2193
+ 1: "启用",
2194
+ 0: "禁用"
2195
+ }, Zn = {
2196
+ 0: "未知",
2197
+ 1: "男",
2198
+ 2: "女"
2199
+ }, ea = {
2200
+ 0: "目录",
2201
+ 1: "菜单",
2202
+ 2: "按钮"
2203
+ }, ta = [
2204
+ {
2205
+ label: "启用",
2206
+ value: 1
2207
+ /* ENABLED */
2208
+ },
2209
+ {
2210
+ label: "禁用",
2211
+ value: 0
2212
+ /* DISABLED */
2213
+ }
2214
+ ], sa = [
2215
+ {
2216
+ label: "未知",
2217
+ value: 0
2218
+ /* UNKNOWN */
2219
+ },
2220
+ {
2221
+ label: "男",
2222
+ value: 1
2223
+ /* MALE */
2224
+ },
2225
+ {
2226
+ label: "女",
2227
+ value: 2
2228
+ /* FEMALE */
2229
+ }
2230
+ ], oa = [
2231
+ {
2232
+ label: "目录",
2233
+ value: 0
2234
+ /* DIRECTORY */
2235
+ },
2236
+ {
2237
+ label: "菜单",
2238
+ value: 1
2239
+ /* MENU */
2240
+ },
2241
+ {
2242
+ label: "按钮",
2243
+ value: 2
2244
+ /* BUTTON */
2245
+ }
2246
+ ], na = {
2247
+ mounted(e, s) {
2248
+ var r;
2249
+ H().isLoggedIn || (r = e.parentNode) == null || r.removeChild(e);
2250
+ }
2251
+ };
2252
+ export {
2253
+ Lt as $,
2254
+ vn as A,
2255
+ An as B,
2256
+ Go as C,
2257
+ pn as D,
2258
+ mn as E,
2259
+ hn as F,
2260
+ Zo as G,
2261
+ Es as H,
2262
+ Dn as I,
2263
+ Un as J,
2264
+ $e as K,
2265
+ at as L,
2266
+ en as M,
2267
+ xt as N,
2268
+ bt as O,
2269
+ qn as P,
2270
+ No as Q,
2271
+ jn as R,
2272
+ Qo as S,
2273
+ _n as T,
2274
+ $n as U,
2275
+ In as V,
2276
+ nt as W,
2277
+ U as X,
2278
+ yn as Y,
2279
+ Ln as Z,
2280
+ X as _,
2281
+ ta as a,
2282
+ it as a0,
2283
+ f as a1,
2284
+ fe as a2,
2285
+ Eo as a3,
2286
+ fn as a4,
2287
+ Ho as a5,
2288
+ na as a6,
2289
+ gn as a7,
2290
+ Jn as a8,
2291
+ En as a9,
2292
+ ut as aa,
2293
+ dn as ab,
2294
+ ge as ac,
2295
+ It as ad,
2296
+ $t as ae,
2297
+ Ct as af,
2298
+ kt as ag,
2299
+ St as ah,
2300
+ st as ai,
2301
+ wt as aj,
2302
+ Kn as ak,
2303
+ lt as al,
2304
+ Fn as am,
2305
+ zn as an,
2306
+ On as ao,
2307
+ Wn as ap,
2308
+ Gn as aq,
2309
+ wn as ar,
2310
+ te as as,
2311
+ Cn as at,
2312
+ Ie as au,
2313
+ xn as av,
2314
+ ae as aw,
2315
+ Sn as ax,
2316
+ H as ay,
2317
+ oa as b,
2318
+ Yo as c,
2319
+ sa as d,
2320
+ Zn as e,
2321
+ ea as f,
2322
+ Fo as g,
2323
+ Ft as h,
2324
+ zo as i,
2325
+ Qn as j,
2326
+ bn as k,
2327
+ Xn as l,
2328
+ ot as m,
2329
+ Nn as n,
2330
+ Vn as o,
2331
+ Rn as p,
2332
+ Mn as q,
2333
+ Yn as r,
2334
+ Tn as s,
2335
+ Bn as t,
2336
+ Pn as u,
2337
+ Hn as v,
2338
+ rt as w,
2339
+ kn as x,
2340
+ Ye as y,
2341
+ Mo as z
2342
+ };