xto-fronted 0.4.85 → 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,2851 @@
1
+ import { ref as g, computed as k, watch as Ae, defineComponent as ee, openBlock as i, createElementBlock as c, normalizeClass as B, createElementVNode as e, withDirectives as tt, toDisplayString as C, unref as n, vShow as pt, createCommentVNode as P, createVNode as h, withCtx as M, Fragment as j, renderList as H, createBlock as K, createTextVNode as pe, onMounted as Pe, onUnmounted as Oe, withModifiers as Te, Transition as Le, withKeys as st, vModelText as vt, normalizeStyle as ke, resolveComponent as _t, reactive as Ve } from "vue";
2
+ import { defineStore as Ee } from "pinia";
3
+ import { useRoute as ve, useRouter as ne, createRouter as Fe, createWebHistory as Be } from "vue-router";
4
+ import { Menu as Ke, SubMenu as ot, MenuItem as we, Tabs as ht, TabPane as ft } from "@xto/navigation";
5
+ import { Icon as S, Button as Ne } from "@xto/base";
6
+ import { Drawer as je, Message as oe } from "@xto/feedback";
7
+ import { Form as gt, FormItem as xe, Input as Ze, Checkbox as yt } from "@xto/form";
8
+ import kt from "axios";
9
+ const ge = "xto_", nt = (t) => ({
10
+ get(o) {
11
+ const a = t.getItem(ge + o);
12
+ if (!a) return null;
13
+ try {
14
+ return JSON.parse(a);
15
+ } catch {
16
+ return a;
17
+ }
18
+ },
19
+ set(o, a) {
20
+ if (a == null) {
21
+ t.removeItem(ge + o);
22
+ return;
23
+ }
24
+ const r = typeof a == "string" ? a : JSON.stringify(a);
25
+ t.setItem(ge + o, r);
26
+ },
27
+ remove(o) {
28
+ t.removeItem(ge + o);
29
+ },
30
+ clear() {
31
+ Object.keys(t).forEach((a) => {
32
+ a.startsWith(ge) && t.removeItem(a);
33
+ });
34
+ }
35
+ }), Ce = nt(window.localStorage), $e = nt(window.sessionStorage), b = {
36
+ get: Ce.get,
37
+ set: Ce.set,
38
+ remove: Ce.remove,
39
+ clear: Ce.clear
40
+ }, ia = {
41
+ get: $e.get,
42
+ set: $e.set,
43
+ remove: $e.remove,
44
+ clear: $e.clear
45
+ }, ae = Ee("app", () => {
46
+ const t = g(b.get("appName") || "XTO App"), o = g(b.get("indexPath") || "/dashboard"), a = g(b.get("isDark") || !1), r = g(b.get("theme") || "light"), l = g(b.get("layout") || "sidebar"), u = g(b.get("isCollapsed") || !1), $ = g(b.get("showTabs") ?? !0), m = g(b.get("showFooter") ?? !0), f = g(b.get("showBreadcrumb") ?? !0), p = g(b.get("primaryColor") || "#409eff"), _ = g([]), v = g([]), w = k(() => a.value ? "dark" : "light"), q = (I) => {
47
+ t.value = I, b.set("appName", I);
48
+ }, N = (I) => {
49
+ o.value = I, b.set("indexPath", I);
50
+ }, R = () => {
51
+ a.value = !a.value, r.value = a.value ? "dark" : "light", A();
52
+ }, V = (I) => {
53
+ r.value = I, a.value = I === "dark", A();
54
+ }, A = () => {
55
+ const I = document.documentElement;
56
+ a.value ? I.classList.add("dark") : I.classList.remove("dark"), b.set("isDark", a.value), b.set("theme", r.value);
57
+ }, z = () => {
58
+ u.value = !u.value, b.set("isCollapsed", u.value);
59
+ }, F = (I) => {
60
+ l.value = I, b.set("layout", I);
61
+ }, D = () => {
62
+ $.value = !$.value, b.set("showTabs", $.value);
63
+ }, W = () => {
64
+ m.value = !m.value, b.set("showFooter", m.value);
65
+ }, U = () => {
66
+ f.value = !f.value, b.set("showBreadcrumb", f.value);
67
+ }, Y = (I) => {
68
+ p.value = I, document.documentElement.style.setProperty("--color-primary", I), b.set("primaryColor", I);
69
+ }, le = (I) => {
70
+ _.value.includes(I) || _.value.push(I);
71
+ }, X = (I) => {
72
+ const se = _.value.indexOf(I);
73
+ se > -1 && _.value.splice(se, 1);
74
+ }, te = () => {
75
+ _.value = [];
76
+ }, re = (I) => {
77
+ v.value = I;
78
+ }, J = () => {
79
+ A(), p.value !== "#409eff" && document.documentElement.style.setProperty("--color-primary", p.value);
80
+ };
81
+ return Ae(a, A), {
82
+ appName: t,
83
+ indexPath: o,
84
+ isDark: a,
85
+ theme: r,
86
+ layout: l,
87
+ isCollapsed: u,
88
+ showTabs: $,
89
+ showFooter: m,
90
+ showBreadcrumb: f,
91
+ primaryColor: p,
92
+ cachedViews: _,
93
+ mixSubMenus: v,
94
+ themeClass: w,
95
+ setAppName: q,
96
+ setIndexPath: N,
97
+ toggleTheme: R,
98
+ toggleCollapse: z,
99
+ setTheme: V,
100
+ setLayout: F,
101
+ toggleTabs: D,
102
+ toggleFooter: W,
103
+ toggleBreadcrumb: U,
104
+ setPrimaryColor: Y,
105
+ addCachedView: le,
106
+ removeCachedView: X,
107
+ clearCachedViews: te,
108
+ setMixSubMenus: re,
109
+ initTheme: J
110
+ };
111
+ }), ze = "menu_list", wt = {
112
+ menuCode: "home",
113
+ menuName: "首页",
114
+ menuUrl: "/dashboard",
115
+ icon: "home",
116
+ closable: !1,
117
+ isDefault: !1,
118
+ isOut: !1
119
+ }, ue = Ee("menu", () => {
120
+ const t = g(b.get(ze) || []), o = k(() => t.value.length > 0);
121
+ return {
122
+ menuList: t,
123
+ hasMenu: o,
124
+ setMenuList: (l) => {
125
+ t.value = [wt, ...l], b.set(ze, t.value);
126
+ },
127
+ clearMenu: () => {
128
+ t.value = [], b.remove(ze);
129
+ }
130
+ };
131
+ }), Ue = "/vite.svg", Re = "user_info", G = Ee("user", () => {
132
+ const t = g(b.get(Re)), o = k(() => !!t.value), a = k(() => {
133
+ var v;
134
+ return ((v = t.value) == null ? void 0 : v.userId) || "";
135
+ }), r = k(() => {
136
+ var v;
137
+ return ((v = t.value) == null ? void 0 : v.userName) || "";
138
+ }), l = k(() => {
139
+ var v;
140
+ return ((v = t.value) == null ? void 0 : v.departmentName) || "";
141
+ }), u = k(() => {
142
+ var v;
143
+ return ((v = t.value) == null ? void 0 : v.email) || "";
144
+ }), $ = k(() => {
145
+ var v;
146
+ return ((v = t.value) == null ? void 0 : v.mobilePhone) || "";
147
+ }), m = k(() => {
148
+ var v;
149
+ return ((v = t.value) == null ? void 0 : v.positionName) || "";
150
+ }), f = k(() => {
151
+ var v;
152
+ return ((v = t.value) == null ? void 0 : v.avatar) || "";
153
+ });
154
+ return {
155
+ userInfo: t,
156
+ isLoggedIn: o,
157
+ userId: a,
158
+ userName: r,
159
+ departmentName: l,
160
+ email: u,
161
+ mobilePhone: $,
162
+ positionName: m,
163
+ avatar: f,
164
+ setUserInfo: (v) => {
165
+ t.value = v, b.set(Re, v);
166
+ },
167
+ clearUserInfo: () => {
168
+ t.value = null, b.remove(Re);
169
+ }
170
+ };
171
+ }), qe = "token", Ye = "token_type", We = "refresh_token", He = "expires_time", Ge = "refresh_time", Xe = "code", De = () => b.get(qe), bt = (t) => {
172
+ b.set(qe, t);
173
+ }, xt = () => b.get(Ye), Ct = (t) => {
174
+ b.set(Ye, t);
175
+ }, ua = () => b.get(We), $t = (t) => {
176
+ b.set(We, t);
177
+ }, Lt = () => b.get(He), St = (t) => {
178
+ b.set(He, t);
179
+ }, ca = () => b.get(Ge), Mt = (t) => {
180
+ b.set(Ge, t);
181
+ }, da = () => b.get(Xe), It = (t) => {
182
+ b.set(Xe, t);
183
+ }, at = (t) => {
184
+ bt(t.access_token), Ct(t.token_type || "Bearer"), $t(t.refresh_token), St(t.expires_time), Mt(t.refresh_time), t.code && It(t.code);
185
+ }, lt = () => {
186
+ b.remove(qe), b.remove(Ye), b.remove(We), b.remove(He), b.remove(Ge), b.remove(Xe);
187
+ }, Tt = () => {
188
+ const t = Lt();
189
+ return t ? Date.now() > t : !0;
190
+ }, rt = () => !!De() && !Tt(), be = Ee("auth", () => {
191
+ const t = g(De()), o = k(() => rt()), a = g(""), r = g(""), l = g(""), u = g("/login");
192
+ return {
193
+ token: t,
194
+ isLoggedIn: o,
195
+ baseUrl: a,
196
+ appId: r,
197
+ clientId: l,
198
+ loginPath: u,
199
+ login: (w) => {
200
+ t.value = w.access_token, at(w);
201
+ },
202
+ logout: () => {
203
+ t.value = null, lt();
204
+ },
205
+ setBaseUrl: (w) => {
206
+ a.value = w;
207
+ },
208
+ setAppId: (w) => {
209
+ r.value = w;
210
+ },
211
+ setClientId: (w) => {
212
+ l.value = w;
213
+ },
214
+ setLoginPath: (w) => {
215
+ u.value = w;
216
+ }
217
+ };
218
+ }), Et = {
219
+ key: 0,
220
+ class: "sidebar__logo"
221
+ }, Nt = { class: "sidebar__menu-content" }, Ut = {
222
+ key: 0,
223
+ class: "sidebar__menu-icon"
224
+ }, Dt = {
225
+ key: 1,
226
+ class: "sidebar__menu-char"
227
+ }, zt = { class: "sidebar__menu-text" }, Rt = { class: "sidebar__menu-content" }, At = { class: "sidebar__menu-icon" }, Pt = {
228
+ key: 1,
229
+ class: "sidebar__menu-char"
230
+ }, Ot = { class: "sidebar__menu-text" }, Vt = { class: "sidebar__menu-content" }, Ft = {
231
+ key: 0,
232
+ class: "sidebar__menu-icon"
233
+ }, Bt = {
234
+ key: 1,
235
+ class: "sidebar__menu-char"
236
+ }, Kt = { class: "sidebar__menu-text" }, jt = {
237
+ key: 1,
238
+ class: "sidebar__user"
239
+ }, qt = { class: "sidebar__user-info" }, Yt = { class: "sidebar__user-name" }, Wt = { class: "sidebar__user-role" }, Ht = /* @__PURE__ */ ee({
240
+ __name: "Sidebar",
241
+ props: {
242
+ menuList: { default: () => [] },
243
+ showLogo: { type: Boolean, default: !0 },
244
+ showUser: { type: Boolean, default: !0 }
245
+ },
246
+ setup(t) {
247
+ const o = t, a = ve(), r = ne(), l = ue(), u = G(), $ = be(), m = ae(), f = k(() => o.menuList.length > 0 ? o.menuList : l.menuList), p = k(() => m.isCollapsed), _ = k(() => a.path), v = k(() => m.isDark ? "#1d1e1f" : "#fff"), w = k(() => m.isDark ? "#cfd3dc" : "#303133"), q = k(() => "#409eff"), N = (D) => {
248
+ D && D !== a.path && r.push(D);
249
+ }, R = () => {
250
+ $.logout(), u.clearUserInfo(), l.clearMenu(), r.push("/login");
251
+ }, V = /* @__PURE__ */ new Set([
252
+ "arrow-up",
253
+ "arrow-down",
254
+ "arrow-left",
255
+ "arrow-right",
256
+ "caret-down",
257
+ "caret-right",
258
+ "plus",
259
+ "minus",
260
+ "close",
261
+ "check",
262
+ "edit",
263
+ "delete",
264
+ "copy",
265
+ "download",
266
+ "upload",
267
+ "refresh",
268
+ "search",
269
+ "filter",
270
+ "more",
271
+ "setting",
272
+ "share",
273
+ "loading",
274
+ "info",
275
+ "success",
276
+ "warning",
277
+ "error",
278
+ "question",
279
+ "user",
280
+ "user-add",
281
+ "user-group",
282
+ "logout",
283
+ "login",
284
+ "file",
285
+ "folder",
286
+ "folder-open",
287
+ "document",
288
+ "image",
289
+ "video",
290
+ "music",
291
+ "camera",
292
+ "mail",
293
+ "phone",
294
+ "chat",
295
+ "bell",
296
+ "message",
297
+ "eye",
298
+ "eye-off",
299
+ "calendar",
300
+ "clock",
301
+ "history",
302
+ "timer",
303
+ "location",
304
+ "map",
305
+ "globe",
306
+ "star",
307
+ "heart",
308
+ "thumb-up",
309
+ "link",
310
+ "external-link",
311
+ "lock",
312
+ "unlock",
313
+ "key",
314
+ "home",
315
+ "menu",
316
+ "menu-fold",
317
+ "menu-unfold",
318
+ "sidebar-fold",
319
+ "sidebar-expand",
320
+ "sidebar-left",
321
+ "dashboard",
322
+ "chart",
323
+ "chart-pie",
324
+ "chart-line",
325
+ "report",
326
+ "analytics",
327
+ "system",
328
+ "permission",
329
+ "role",
330
+ "user-manage",
331
+ "log",
332
+ "notification",
333
+ "app",
334
+ "list",
335
+ "grid",
336
+ "fullscreen",
337
+ "fullscreen-exit",
338
+ "zoom-in",
339
+ "zoom-out",
340
+ "print",
341
+ "bookmark",
342
+ "tag",
343
+ "code",
344
+ "terminal",
345
+ "database",
346
+ "server",
347
+ "cloud",
348
+ "gift",
349
+ "moon",
350
+ "sun",
351
+ "theme",
352
+ "skin"
353
+ ]), A = (D) => {
354
+ if (!D || D === "") return "";
355
+ if (D.startsWith("tineco-icon-")) {
356
+ const U = D.replace("tineco-icon-", "");
357
+ return {
358
+ home: "home",
359
+ dashboard: "dashboard",
360
+ system: "system",
361
+ user: "user",
362
+ role: "role",
363
+ menu: "list",
364
+ setting: "setting",
365
+ file: "file",
366
+ folder: "folder",
367
+ chart: "chart",
368
+ report: "report",
369
+ analytics: "analytics"
370
+ }[U] || U;
371
+ }
372
+ return {
373
+ dashboard: "dashboard",
374
+ system: "system",
375
+ user: "user",
376
+ role: "role",
377
+ menu: "list",
378
+ setting: "setting",
379
+ home: "home",
380
+ chart: "chart",
381
+ report: "report",
382
+ analytics: "analytics",
383
+ permission: "permission",
384
+ log: "log",
385
+ notification: "notification",
386
+ app: "app",
387
+ list: "list",
388
+ grid: "grid"
389
+ }[D] || D;
390
+ }, z = (D) => D ? D.charAt(0) : "", F = (D) => V.has(D);
391
+ return (D, W) => (i(), c("div", {
392
+ class: B(["sidebar", { "sidebar--collapsed": p.value }])
393
+ }, [
394
+ o.showLogo ? (i(), c("div", Et, [
395
+ W[0] || (W[0] = e("img", {
396
+ src: Ue,
397
+ alt: "Logo",
398
+ class: "sidebar__logo-img"
399
+ }, null, -1)),
400
+ tt(e("span", { class: "sidebar__logo-text" }, C(n(m).appName), 513), [
401
+ [pt, !p.value]
402
+ ])
403
+ ])) : P("", !0),
404
+ h(n(Ke), {
405
+ "default-active": _.value,
406
+ mode: "vertical",
407
+ collapse: p.value,
408
+ "collapse-transition": !1,
409
+ "background-color": v.value,
410
+ "text-color": w.value,
411
+ "active-text-color": q.value,
412
+ class: "sidebar__menu",
413
+ onSelect: N
414
+ }, {
415
+ default: M(() => [
416
+ (i(!0), c(j, null, H(f.value, (U) => (i(), c(j, {
417
+ key: U.menuUrl
418
+ }, [
419
+ U.children && U.children.length > 0 ? (i(), K(n(ot), {
420
+ key: 0,
421
+ index: U.menuUrl
422
+ }, {
423
+ title: M(() => [
424
+ e("span", Nt, [
425
+ U.menuName !== "首页" ? (i(), c("span", Ut, [
426
+ F(A(U.icon)) ? (i(), K(n(S), {
427
+ key: 0,
428
+ name: A(U.icon),
429
+ size: 16
430
+ }, null, 8, ["name"])) : (i(), c("span", Dt, C(z(U.menuName)), 1))
431
+ ])) : P("", !0),
432
+ e("span", zt, C(U.menuName), 1)
433
+ ])
434
+ ]),
435
+ default: M(() => [
436
+ (i(!0), c(j, null, H(U.children, (Y) => (i(), K(n(we), {
437
+ key: Y.menuUrl,
438
+ index: Y.menuUrl
439
+ }, {
440
+ default: M(() => [
441
+ e("span", Rt, [
442
+ e("span", At, [
443
+ F(A(Y.icon)) ? (i(), K(n(S), {
444
+ key: 0,
445
+ name: A(Y.icon),
446
+ size: 16
447
+ }, null, 8, ["name"])) : (i(), c("span", Pt, C(z(Y.menuName)), 1))
448
+ ]),
449
+ e("span", Ot, C(Y.menuName), 1)
450
+ ])
451
+ ]),
452
+ _: 2
453
+ }, 1032, ["index"]))), 128))
454
+ ]),
455
+ _: 2
456
+ }, 1032, ["index"])) : (i(), K(n(we), {
457
+ key: 1,
458
+ index: U.menuUrl
459
+ }, {
460
+ default: M(() => [
461
+ e("span", Vt, [
462
+ U.menuName !== "首页" ? (i(), c("span", Ft, [
463
+ F(A(U.icon)) ? (i(), K(n(S), {
464
+ key: 0,
465
+ name: A(U.icon),
466
+ size: 16
467
+ }, null, 8, ["name"])) : (i(), c("span", Bt, C(z(U.menuName)), 1))
468
+ ])) : P("", !0),
469
+ e("span", Kt, C(U.menuName), 1)
470
+ ])
471
+ ]),
472
+ _: 2
473
+ }, 1032, ["index"]))
474
+ ], 64))), 128))
475
+ ]),
476
+ _: 1
477
+ }, 8, ["default-active", "collapse", "background-color", "text-color", "active-text-color"]),
478
+ o.showUser && !p.value ? (i(), c("div", jt, [
479
+ e("div", qt, [
480
+ e("span", Yt, C(n(u).userName), 1),
481
+ e("span", Wt, C(n(u).departmentName), 1)
482
+ ]),
483
+ h(n(Ne), {
484
+ type: "text",
485
+ size: "small",
486
+ onClick: R
487
+ }, {
488
+ default: M(() => [...W[1] || (W[1] = [
489
+ pe("退出", -1)
490
+ ])]),
491
+ _: 1
492
+ })
493
+ ])) : P("", !0)
494
+ ], 2));
495
+ }
496
+ }), Q = (t, o) => {
497
+ const a = t.__vccOpts || t;
498
+ for (const [r, l] of o)
499
+ a[r] = l;
500
+ return a;
501
+ }, et = /* @__PURE__ */ Q(Ht, [["__scopeId", "data-v-356129ba"]]), Gt = { class: "header" }, Xt = { class: "header__left" }, Jt = {
502
+ key: 0,
503
+ class: "header__breadcrumb"
504
+ }, Qt = {
505
+ key: 0,
506
+ class: "breadcrumb-separator"
507
+ }, Zt = { class: "header__right" }, es = ["title"], ts = { class: "header__avatar" }, ss = { class: "header__user-name" }, os = {
508
+ key: 0,
509
+ class: "header__dropdown"
510
+ }, ns = { class: "header__dropdown-header" }, as = { class: "header__dropdown-avatar" }, ls = { class: "header__dropdown-info" }, rs = { class: "header__dropdown-name" }, is = { class: "header__dropdown-role" }, us = { class: "header__dropdown-menu" }, cs = { class: "search-container" }, ds = { class: "search-input-wrapper" }, ms = {
511
+ key: 0,
512
+ class: "search-results"
513
+ }, ps = ["onClick"], vs = { class: "search-result-info" }, _s = { class: "search-result-title" }, hs = {
514
+ key: 0,
515
+ class: "search-result-parent"
516
+ }, fs = {
517
+ key: 1,
518
+ class: "search-empty"
519
+ }, gs = { class: "settings-drawer" }, ys = { class: "settings-section" }, ks = { class: "settings-layout-options" }, ws = ["onClick"], bs = { class: "layout-option__preview" }, xs = {
520
+ key: 0,
521
+ class: "layout-preview-sidebar"
522
+ }, Cs = {
523
+ key: 1,
524
+ class: "layout-preview-top"
525
+ }, $s = {
526
+ key: 2,
527
+ class: "layout-preview-mix"
528
+ }, Ls = { class: "layout-option__label" }, Ss = { class: "settings-section" }, Ms = { class: "settings-color-options" }, Is = ["title", "onClick"], Ts = { class: "settings-section" }, Es = { class: "settings-switch-list" }, Ns = { class: "settings-switch-item" }, Us = { class: "settings-switch-item" }, Ds = /* @__PURE__ */ ee({
529
+ __name: "Header",
530
+ setup(t) {
531
+ const o = ve(), a = ne(), r = ae(), l = G(), u = be(), $ = ue(), m = g(!1), f = g(!1), p = g(null), _ = g(!1), v = g(!1), w = g(""), q = g(null), N = g(!1), R = [
532
+ { value: "sidebar", label: "左侧菜单", icon: "sidebar-left" },
533
+ { value: "top", label: "顶部菜单", icon: "menu" },
534
+ { value: "mix", label: "混合菜单", icon: "grid" }
535
+ ], V = [
536
+ { value: "#409eff", label: "默认蓝" },
537
+ { value: "#1890ff", label: "科技蓝" },
538
+ { value: "#52c41a", label: "极光绿" },
539
+ { value: "#faad14", label: "日落橙" },
540
+ { value: "#f5222d", label: "薄暮红" },
541
+ { value: "#722ed1", label: "酱紫" }
542
+ ], A = k(() => o.matched.filter((s) => s.meta && s.meta.title).map((s) => ({
543
+ title: s.meta.title,
544
+ path: s.path
545
+ }))), z = (T, s = "") => {
546
+ const d = [];
547
+ return T.forEach((y) => {
548
+ y.children && y.children.length > 0 ? d.push(...z(y.children, y.title)) : d.push({ ...y, parentTitle: s });
549
+ }), d;
550
+ }, F = k(() => w.value.trim() ? z($.menuList).filter(
551
+ (s) => s.title.toLowerCase().includes(w.value.toLowerCase())
552
+ ) : []), D = k(() => r.layout), W = () => {
553
+ r.toggleCollapse();
554
+ }, U = () => {
555
+ r.toggleTheme();
556
+ }, Y = () => {
557
+ f.value = !0;
558
+ }, le = (T) => {
559
+ r.setLayout(T), f.value = !1;
560
+ }, X = (T) => {
561
+ N.value = T;
562
+ const s = document.documentElement;
563
+ T ? s.classList.add("grey-mode") : s.classList.remove("grey-mode");
564
+ }, te = () => {
565
+ X(!N.value), f.value = !1;
566
+ }, re = () => {
567
+ r.toggleTheme(), f.value = !1;
568
+ }, J = () => {
569
+ document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
570
+ }, I = () => {
571
+ _.value = !!document.fullscreenElement;
572
+ }, se = () => {
573
+ m.value = !m.value;
574
+ }, Z = () => {
575
+ m.value = !1;
576
+ }, ce = () => {
577
+ v.value = !0;
578
+ }, ie = () => {
579
+ v.value = !1, w.value = "";
580
+ }, de = (T) => {
581
+ a.push(T), ie();
582
+ }, _e = (T) => {
583
+ r.setPrimaryColor(T), f.value = !1;
584
+ }, he = () => {
585
+ Z(), a.push("/profile");
586
+ }, fe = () => {
587
+ Z(), a.push("/change-password");
588
+ }, me = () => {
589
+ Z(), u.logout(), l.clearUserInfo(), $.clearMenu(), a.push("/login");
590
+ }, E = (T) => {
591
+ p.value && !p.value.contains(T.target) && Z(), q.value && !q.value.contains(T.target) && ie();
592
+ }, x = (T) => {
593
+ T.key === "Escape" && (ie(), Z()), (T.ctrlKey || T.metaKey) && T.key === "k" && (T.preventDefault(), ce());
594
+ };
595
+ return Pe(() => {
596
+ document.addEventListener("click", E), document.addEventListener("fullscreenchange", I), document.addEventListener("keydown", x), r.initTheme(), N.value = document.documentElement.classList.contains("grey-mode");
597
+ }), Oe(() => {
598
+ document.removeEventListener("click", E), document.removeEventListener("fullscreenchange", I), document.removeEventListener("keydown", x);
599
+ }), (T, s) => {
600
+ var d;
601
+ return i(), c("div", Gt, [
602
+ e("div", Xt, [
603
+ e("div", {
604
+ class: "header__collapse",
605
+ onClick: W
606
+ }, [
607
+ h(n(S), {
608
+ name: n(r).isCollapsed ? "menu-unfold" : "menu-fold",
609
+ size: 18
610
+ }, null, 8, ["name"])
611
+ ]),
612
+ n(r).showBreadcrumb ? (i(), c("div", Jt, [
613
+ (i(!0), c(j, null, H(A.value, (y, L) => (i(), c("span", {
614
+ key: y.path
615
+ }, [
616
+ L > 0 ? (i(), c("span", Qt, "/")) : P("", !0),
617
+ e("span", {
618
+ class: B({ "is-current": L === A.value.length - 1 })
619
+ }, C(y.title), 3)
620
+ ]))), 128))
621
+ ])) : P("", !0)
622
+ ]),
623
+ e("div", Zt, [
624
+ e("div", {
625
+ class: "header__action",
626
+ onClick: ce,
627
+ title: "搜索 (Ctrl+K)"
628
+ }, [
629
+ h(n(S), {
630
+ name: "search",
631
+ size: 16
632
+ })
633
+ ]),
634
+ e("div", {
635
+ class: "header__action",
636
+ onClick: J,
637
+ title: _.value ? "退出全屏" : "全屏"
638
+ }, [
639
+ h(n(S), {
640
+ name: _.value ? "fullscreen-exit" : "fullscreen",
641
+ size: 16
642
+ }, null, 8, ["name"])
643
+ ], 8, es),
644
+ e("div", {
645
+ class: "header__action",
646
+ onClick: Y,
647
+ title: "换肤设置"
648
+ }, [
649
+ h(n(S), {
650
+ name: "skin",
651
+ size: 16
652
+ })
653
+ ]),
654
+ e("div", {
655
+ class: "header__action",
656
+ onClick: U,
657
+ title: "切换主题"
658
+ }, [
659
+ h(n(S), {
660
+ name: n(r).isDark ? "sun" : "moon",
661
+ size: 16
662
+ }, null, 8, ["name"])
663
+ ]),
664
+ e("div", {
665
+ class: "header__user",
666
+ ref_key: "dropdownRef",
667
+ ref: p
668
+ }, [
669
+ e("div", {
670
+ class: "header__user-trigger",
671
+ onClick: Te(se, ["stop"])
672
+ }, [
673
+ e("div", ts, [
674
+ e("span", null, C(((d = n(l).userName) == null ? void 0 : d.charAt(0)) || "U"), 1)
675
+ ]),
676
+ e("span", ss, C(n(l).userName), 1),
677
+ e("span", {
678
+ class: B(["header__user-arrow", { "is-active": m.value }])
679
+ }, "▼", 2)
680
+ ]),
681
+ h(Le, { name: "dropdown" }, {
682
+ default: M(() => {
683
+ var y;
684
+ return [
685
+ m.value ? (i(), c("div", os, [
686
+ e("div", ns, [
687
+ e("div", as, [
688
+ e("span", null, C(((y = n(l).userName) == null ? void 0 : y.charAt(0)) || "U"), 1)
689
+ ]),
690
+ e("div", ls, [
691
+ e("div", rs, C(n(l).userName), 1),
692
+ e("div", is, C(n(l).departmentName), 1)
693
+ ])
694
+ ]),
695
+ s[7] || (s[7] = e("div", { class: "header__dropdown-divider" }, null, -1)),
696
+ e("div", us, [
697
+ e("div", {
698
+ class: "header__dropdown-item",
699
+ onClick: he
700
+ }, [
701
+ h(n(S), {
702
+ name: "user",
703
+ size: 16
704
+ }),
705
+ s[3] || (s[3] = e("span", null, "个人信息", -1))
706
+ ]),
707
+ e("div", {
708
+ class: "header__dropdown-item",
709
+ onClick: fe
710
+ }, [
711
+ h(n(S), {
712
+ name: "lock",
713
+ size: 16
714
+ }),
715
+ s[4] || (s[4] = e("span", null, "修改密码", -1))
716
+ ]),
717
+ s[6] || (s[6] = e("div", { class: "header__dropdown-divider" }, null, -1)),
718
+ e("div", {
719
+ class: "header__dropdown-item header__dropdown-item--danger",
720
+ onClick: me
721
+ }, [
722
+ h(n(S), {
723
+ name: "logout",
724
+ size: 16
725
+ }),
726
+ s[5] || (s[5] = e("span", null, "退出登录", -1))
727
+ ])
728
+ ])
729
+ ])) : P("", !0)
730
+ ];
731
+ }),
732
+ _: 1
733
+ })
734
+ ], 512)
735
+ ]),
736
+ h(Le, { name: "search" }, {
737
+ default: M(() => [
738
+ v.value ? (i(), c("div", {
739
+ key: 0,
740
+ class: "header__search-modal",
741
+ ref_key: "searchRef",
742
+ ref: q
743
+ }, [
744
+ e("div", cs, [
745
+ e("div", ds, [
746
+ h(n(S), {
747
+ class: "search-icon",
748
+ name: "search",
749
+ size: 20
750
+ }),
751
+ tt(e("input", {
752
+ "onUpdate:modelValue": s[0] || (s[0] = (y) => w.value = y),
753
+ type: "text",
754
+ class: "search-input",
755
+ placeholder: "搜索菜单...",
756
+ autofocus: "",
757
+ onKeyup: s[1] || (s[1] = st((y) => F.value[0] && de(F.value[0].path), ["enter"]))
758
+ }, null, 544), [
759
+ [vt, w.value]
760
+ ]),
761
+ s[8] || (s[8] = e("span", { class: "search-shortcut" }, "ESC 关闭", -1))
762
+ ]),
763
+ F.value.length > 0 ? (i(), c("div", ms, [
764
+ (i(!0), c(j, null, H(F.value, (y, L) => (i(), c("div", {
765
+ key: y.path,
766
+ class: B(["search-result-item", { "is-first": L === 0 }]),
767
+ onClick: (Qe) => de(y.path)
768
+ }, [
769
+ h(n(S), {
770
+ class: "search-result-icon",
771
+ name: y.icon || "file",
772
+ size: 20
773
+ }, null, 8, ["name"]),
774
+ e("div", vs, [
775
+ e("span", _s, C(y.title), 1),
776
+ y.parentTitle ? (i(), c("span", hs, C(y.parentTitle), 1)) : P("", !0)
777
+ ])
778
+ ], 10, ps))), 128))
779
+ ])) : w.value ? (i(), c("div", fs, " 未找到匹配的菜单 ")) : P("", !0)
780
+ ])
781
+ ], 512)) : P("", !0)
782
+ ]),
783
+ _: 1
784
+ }),
785
+ h(n(je), {
786
+ modelValue: f.value,
787
+ "onUpdate:modelValue": s[2] || (s[2] = (y) => f.value = y),
788
+ title: "换肤设置",
789
+ direction: "rtl",
790
+ size: "320px"
791
+ }, {
792
+ default: M(() => [
793
+ e("div", gs, [
794
+ e("div", ys, [
795
+ s[12] || (s[12] = e("div", { class: "settings-title" }, "布局模式", -1)),
796
+ e("div", ks, [
797
+ (i(), c(j, null, H(R, (y) => e("div", {
798
+ key: y.value,
799
+ class: B(["layout-option", { "is-active": D.value === y.value }]),
800
+ onClick: (L) => le(y.value)
801
+ }, [
802
+ e("div", bs, [
803
+ y.value === "sidebar" ? (i(), c("div", xs, [...s[9] || (s[9] = [
804
+ e("div", { class: "preview-aside" }, null, -1),
805
+ e("div", { class: "preview-main" }, [
806
+ e("div", { class: "preview-header" }),
807
+ e("div", { class: "preview-content" })
808
+ ], -1)
809
+ ])])) : y.value === "top" ? (i(), c("div", Cs, [...s[10] || (s[10] = [
810
+ e("div", { class: "preview-header-full" }, null, -1),
811
+ e("div", { class: "preview-content-full" }, null, -1)
812
+ ])])) : (i(), c("div", $s, [...s[11] || (s[11] = [
813
+ e("div", { class: "preview-header-mix" }, [
814
+ e("div", { class: "preview-mix-left" })
815
+ ], -1),
816
+ e("div", { class: "preview-mix-body" }, [
817
+ e("div", { class: "preview-mix-aside" }),
818
+ e("div", { class: "preview-mix-content" })
819
+ ], -1)
820
+ ])]))
821
+ ]),
822
+ e("span", Ls, C(y.label), 1)
823
+ ], 10, ws)), 64))
824
+ ])
825
+ ]),
826
+ e("div", Ss, [
827
+ s[13] || (s[13] = e("div", { class: "settings-title" }, "主题色", -1)),
828
+ e("div", Ms, [
829
+ (i(), c(j, null, H(V, (y) => e("div", {
830
+ key: y.value,
831
+ class: B(["color-option", { "is-active": n(r).primaryColor === y.value }]),
832
+ style: ke({ backgroundColor: y.value }),
833
+ title: y.label,
834
+ onClick: (L) => _e(y.value)
835
+ }, [
836
+ n(r).primaryColor === y.value ? (i(), K(n(S), {
837
+ key: 0,
838
+ name: "check",
839
+ size: 12,
840
+ color: "#fff"
841
+ })) : P("", !0)
842
+ ], 14, Is)), 64))
843
+ ])
844
+ ]),
845
+ e("div", Ts, [
846
+ s[18] || (s[18] = e("div", { class: "settings-title" }, "功能设置", -1)),
847
+ e("div", Es, [
848
+ e("div", Ns, [
849
+ s[15] || (s[15] = e("span", null, "灰色模式", -1)),
850
+ e("div", {
851
+ class: B(["switch-wrapper", { "is-checked": N.value }]),
852
+ onClick: te
853
+ }, [...s[14] || (s[14] = [
854
+ e("span", { class: "switch-core" }, null, -1)
855
+ ])], 2)
856
+ ]),
857
+ e("div", Us, [
858
+ s[17] || (s[17] = e("span", null, "暗黑模式", -1)),
859
+ e("div", {
860
+ class: B(["switch-wrapper", { "is-checked": n(r).isDark }]),
861
+ onClick: re
862
+ }, [...s[16] || (s[16] = [
863
+ e("span", { class: "switch-core" }, null, -1)
864
+ ])], 2)
865
+ ])
866
+ ])
867
+ ])
868
+ ])
869
+ ]),
870
+ _: 1
871
+ }, 8, ["modelValue"])
872
+ ]);
873
+ };
874
+ }
875
+ }), zs = /* @__PURE__ */ Q(Ds, [["__scopeId", "data-v-702ab2d7"]]), Rs = { class: "top-menu" }, As = { class: "top-menu__logo" }, Ps = { class: "top-menu__logo-text" }, Os = { class: "top-menu__menu-content" }, Vs = {
876
+ key: 0,
877
+ class: "top-menu__menu-icon"
878
+ }, Fs = {
879
+ key: 1,
880
+ class: "top-menu__menu-char"
881
+ }, Bs = { class: "top-menu__menu-text" }, Ks = { class: "top-menu__menu-content" }, js = { class: "top-menu__menu-icon" }, qs = {
882
+ key: 1,
883
+ class: "top-menu__menu-char"
884
+ }, Ys = { class: "top-menu__menu-text" }, Ws = { class: "top-menu__menu-content" }, Hs = {
885
+ key: 0,
886
+ class: "top-menu__menu-icon"
887
+ }, Gs = {
888
+ key: 1,
889
+ class: "top-menu__menu-char"
890
+ }, Xs = { class: "top-menu__menu-text" }, Js = { class: "top-menu__actions" }, Qs = ["title"], Zs = { class: "top-menu__avatar" }, eo = { class: "top-menu__user-name" }, to = {
891
+ key: 0,
892
+ class: "top-menu__dropdown"
893
+ }, so = { class: "top-menu__dropdown-header" }, oo = { class: "top-menu__dropdown-avatar" }, no = { class: "top-menu__dropdown-info" }, ao = { class: "top-menu__dropdown-name" }, lo = { class: "top-menu__dropdown-role" }, ro = { class: "top-menu__dropdown-menu" }, io = { class: "settings-drawer" }, uo = { class: "settings-section" }, co = { class: "settings-layout-options" }, mo = ["onClick"], po = { class: "layout-option__preview" }, vo = {
894
+ key: 0,
895
+ class: "layout-preview-sidebar"
896
+ }, _o = {
897
+ key: 1,
898
+ class: "layout-preview-top"
899
+ }, ho = {
900
+ key: 2,
901
+ class: "layout-preview-mix"
902
+ }, fo = { class: "layout-option__label" }, go = { class: "settings-section" }, yo = { class: "settings-color-options" }, ko = ["title", "onClick"], wo = { class: "settings-section" }, bo = { class: "settings-switch-list" }, xo = { class: "settings-switch-item" }, Co = { class: "settings-switch-item" }, $o = /* @__PURE__ */ ee({
903
+ __name: "TopMenu",
904
+ setup(t) {
905
+ const o = ve(), a = ne(), r = ue(), l = ae(), u = G(), $ = be(), m = k(() => o.path), f = k(() => l.isDark ? "#1d1e1f" : "#fff"), p = k(() => l.isDark ? "#cfd3dc" : "#303133"), _ = k(() => "#409eff"), v = g(!1), w = g(null), q = g(!1), N = g(!1), R = g(!1), V = (E) => {
906
+ E && E !== o.path && a.push(E);
907
+ }, A = /* @__PURE__ */ new Set([
908
+ "arrow-up",
909
+ "arrow-down",
910
+ "arrow-left",
911
+ "arrow-right",
912
+ "caret-down",
913
+ "caret-right",
914
+ "plus",
915
+ "minus",
916
+ "close",
917
+ "check",
918
+ "edit",
919
+ "delete",
920
+ "copy",
921
+ "download",
922
+ "upload",
923
+ "refresh",
924
+ "search",
925
+ "filter",
926
+ "more",
927
+ "setting",
928
+ "share",
929
+ "loading",
930
+ "info",
931
+ "success",
932
+ "warning",
933
+ "error",
934
+ "question",
935
+ "user",
936
+ "user-add",
937
+ "user-group",
938
+ "logout",
939
+ "login",
940
+ "file",
941
+ "folder",
942
+ "folder-open",
943
+ "document",
944
+ "image",
945
+ "video",
946
+ "music",
947
+ "camera",
948
+ "mail",
949
+ "phone",
950
+ "chat",
951
+ "bell",
952
+ "message",
953
+ "eye",
954
+ "eye-off",
955
+ "calendar",
956
+ "clock",
957
+ "history",
958
+ "timer",
959
+ "location",
960
+ "map",
961
+ "globe",
962
+ "star",
963
+ "heart",
964
+ "thumb-up",
965
+ "link",
966
+ "external-link",
967
+ "lock",
968
+ "unlock",
969
+ "key",
970
+ "home",
971
+ "menu",
972
+ "menu-fold",
973
+ "menu-unfold",
974
+ "sidebar-fold",
975
+ "sidebar-expand",
976
+ "sidebar-left",
977
+ "dashboard",
978
+ "chart",
979
+ "chart-pie",
980
+ "chart-line",
981
+ "report",
982
+ "analytics",
983
+ "system",
984
+ "permission",
985
+ "role",
986
+ "user-manage",
987
+ "log",
988
+ "notification",
989
+ "app",
990
+ "list",
991
+ "grid",
992
+ "fullscreen",
993
+ "fullscreen-exit",
994
+ "zoom-in",
995
+ "zoom-out",
996
+ "print",
997
+ "bookmark",
998
+ "tag",
999
+ "code",
1000
+ "terminal",
1001
+ "database",
1002
+ "server",
1003
+ "cloud",
1004
+ "gift",
1005
+ "moon",
1006
+ "sun",
1007
+ "theme",
1008
+ "skin"
1009
+ ]), z = (E) => {
1010
+ if (!E || E === "") return "";
1011
+ if (E.startsWith("tineco-icon-")) {
1012
+ const T = E.replace("tineco-icon-", "");
1013
+ return {
1014
+ home: "home",
1015
+ dashboard: "dashboard",
1016
+ system: "system",
1017
+ user: "user",
1018
+ role: "role",
1019
+ menu: "list",
1020
+ setting: "setting",
1021
+ file: "file",
1022
+ folder: "folder",
1023
+ chart: "chart",
1024
+ report: "report",
1025
+ analytics: "analytics"
1026
+ }[T] || T;
1027
+ }
1028
+ return {
1029
+ dashboard: "dashboard",
1030
+ system: "system",
1031
+ user: "user",
1032
+ role: "role",
1033
+ menu: "list",
1034
+ setting: "setting",
1035
+ home: "home",
1036
+ chart: "chart",
1037
+ report: "report",
1038
+ analytics: "analytics",
1039
+ permission: "permission",
1040
+ log: "log",
1041
+ notification: "notification",
1042
+ app: "app",
1043
+ list: "list",
1044
+ grid: "grid"
1045
+ }[E] || E;
1046
+ }, F = (E) => E ? E.charAt(0) : "", D = (E) => A.has(E), W = () => {
1047
+ l.toggleTheme(), N.value = !1;
1048
+ }, U = () => {
1049
+ document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
1050
+ }, Y = () => {
1051
+ q.value = !!document.fullscreenElement;
1052
+ }, le = () => {
1053
+ v.value = !v.value;
1054
+ }, X = () => {
1055
+ v.value = !1;
1056
+ }, te = () => {
1057
+ N.value = !0;
1058
+ }, re = (E) => {
1059
+ R.value = E;
1060
+ const x = document.documentElement;
1061
+ E ? x.classList.add("grey-mode") : x.classList.remove("grey-mode");
1062
+ }, J = () => {
1063
+ re(!R.value), N.value = !1;
1064
+ }, I = () => {
1065
+ l.toggleTheme(), N.value = !1;
1066
+ }, se = [
1067
+ { value: "sidebar", label: "左侧菜单", icon: "sidebar-left" },
1068
+ { value: "top", label: "顶部菜单", icon: "menu" },
1069
+ { value: "mix", label: "混合菜单", icon: "grid" }
1070
+ ], Z = k(() => l.layout), ce = (E) => {
1071
+ l.setLayout(E), N.value = !1;
1072
+ }, ie = [
1073
+ { value: "#409eff", label: "默认蓝" },
1074
+ { value: "#1890ff", label: "科技蓝" },
1075
+ { value: "#52c41a", label: "极光绿" },
1076
+ { value: "#faad14", label: "日落橙" },
1077
+ { value: "#f5222d", label: "薄暮红" },
1078
+ { value: "#722ed1", label: "酱紫" }
1079
+ ], de = (E) => {
1080
+ l.setPrimaryColor(E), N.value = !1;
1081
+ }, _e = () => {
1082
+ X(), a.push("/profile");
1083
+ }, he = () => {
1084
+ X(), a.push("/change-password");
1085
+ }, fe = () => {
1086
+ X(), $.logout(), u.clearUserInfo(), r.clearMenu(), a.push("/login");
1087
+ }, me = (E) => {
1088
+ w.value && !w.value.contains(E.target) && X();
1089
+ };
1090
+ return Pe(() => {
1091
+ document.addEventListener("click", me), document.addEventListener("fullscreenchange", Y), R.value = document.documentElement.classList.contains("grey-mode");
1092
+ }), Oe(() => {
1093
+ document.removeEventListener("click", me), document.removeEventListener("fullscreenchange", Y);
1094
+ }), (E, x) => {
1095
+ var T;
1096
+ return i(), c("div", Rs, [
1097
+ e("div", As, [
1098
+ x[1] || (x[1] = e("img", {
1099
+ src: Ue,
1100
+ alt: "Logo",
1101
+ class: "top-menu__logo-img"
1102
+ }, null, -1)),
1103
+ e("span", Ps, C(n(l).appName), 1)
1104
+ ]),
1105
+ h(n(Ke), {
1106
+ "default-active": m.value,
1107
+ mode: "horizontal",
1108
+ "background-color": f.value,
1109
+ "text-color": p.value,
1110
+ "active-text-color": _.value,
1111
+ class: "top-menu__menu",
1112
+ onSelect: V
1113
+ }, {
1114
+ default: M(() => [
1115
+ (i(!0), c(j, null, H(n(r).menuList, (s) => (i(), c(j, {
1116
+ key: s.menuUrl
1117
+ }, [
1118
+ s.children && s.children.length > 0 ? (i(), K(n(ot), {
1119
+ key: 0,
1120
+ index: s.menuUrl
1121
+ }, {
1122
+ title: M(() => [
1123
+ e("span", Os, [
1124
+ s.menuName !== "首页" ? (i(), c("span", Vs, [
1125
+ D(z(s.icon)) ? (i(), K(n(S), {
1126
+ key: 0,
1127
+ name: z(s.icon),
1128
+ size: 16
1129
+ }, null, 8, ["name"])) : (i(), c("span", Fs, C(F(s.menuName)), 1))
1130
+ ])) : P("", !0),
1131
+ e("span", Bs, C(s.menuName), 1)
1132
+ ])
1133
+ ]),
1134
+ default: M(() => [
1135
+ (i(!0), c(j, null, H(s.children, (d) => (i(), K(n(we), {
1136
+ key: d.menuUrl,
1137
+ index: d.menuUrl
1138
+ }, {
1139
+ default: M(() => [
1140
+ e("span", Ks, [
1141
+ e("span", js, [
1142
+ D(z(d.icon)) ? (i(), K(n(S), {
1143
+ key: 0,
1144
+ name: z(d.icon),
1145
+ size: 16
1146
+ }, null, 8, ["name"])) : (i(), c("span", qs, C(F(d.menuName)), 1))
1147
+ ]),
1148
+ e("span", Ys, C(d.menuName), 1)
1149
+ ])
1150
+ ]),
1151
+ _: 2
1152
+ }, 1032, ["index"]))), 128))
1153
+ ]),
1154
+ _: 2
1155
+ }, 1032, ["index"])) : (i(), K(n(we), {
1156
+ key: 1,
1157
+ index: s.menuUrl
1158
+ }, {
1159
+ default: M(() => [
1160
+ e("span", Ws, [
1161
+ s.menuName !== "首页" ? (i(), c("span", Hs, [
1162
+ D(z(s.icon)) ? (i(), K(n(S), {
1163
+ key: 0,
1164
+ name: z(s.icon),
1165
+ size: 16
1166
+ }, null, 8, ["name"])) : (i(), c("span", Gs, C(F(s.menuName)), 1))
1167
+ ])) : P("", !0),
1168
+ e("span", Xs, C(s.menuName), 1)
1169
+ ])
1170
+ ]),
1171
+ _: 2
1172
+ }, 1032, ["index"]))
1173
+ ], 64))), 128))
1174
+ ]),
1175
+ _: 1
1176
+ }, 8, ["default-active", "background-color", "text-color", "active-text-color"]),
1177
+ e("div", Js, [
1178
+ e("div", {
1179
+ class: "top-menu__action",
1180
+ onClick: U,
1181
+ title: q.value ? "退出全屏" : "全屏"
1182
+ }, [
1183
+ h(n(S), {
1184
+ name: q.value ? "fullscreen-exit" : "fullscreen",
1185
+ size: 16
1186
+ }, null, 8, ["name"])
1187
+ ], 8, Qs),
1188
+ e("div", {
1189
+ class: "top-menu__action",
1190
+ onClick: te,
1191
+ title: "换肤设置"
1192
+ }, [
1193
+ h(n(S), {
1194
+ name: "skin",
1195
+ size: 16
1196
+ })
1197
+ ]),
1198
+ e("div", {
1199
+ class: "top-menu__action",
1200
+ onClick: W,
1201
+ title: "切换主题"
1202
+ }, [
1203
+ h(n(S), {
1204
+ name: n(l).isDark ? "sun" : "moon",
1205
+ size: 16
1206
+ }, null, 8, ["name"])
1207
+ ]),
1208
+ e("div", {
1209
+ class: "top-menu__user",
1210
+ ref_key: "dropdownRef",
1211
+ ref: w
1212
+ }, [
1213
+ e("div", {
1214
+ class: "top-menu__user-trigger",
1215
+ onClick: Te(le, ["stop"])
1216
+ }, [
1217
+ e("div", Zs, [
1218
+ e("span", null, C(((T = n(u).userName) == null ? void 0 : T.charAt(0)) || "U"), 1)
1219
+ ]),
1220
+ e("span", eo, C(n(u).userName), 1),
1221
+ e("span", {
1222
+ class: B(["top-menu__user-arrow", { "is-active": v.value }])
1223
+ }, "▼", 2)
1224
+ ]),
1225
+ h(Le, { name: "dropdown" }, {
1226
+ default: M(() => {
1227
+ var s;
1228
+ return [
1229
+ v.value ? (i(), c("div", to, [
1230
+ e("div", so, [
1231
+ e("div", oo, [
1232
+ e("span", null, C(((s = n(u).userName) == null ? void 0 : s.charAt(0)) || "U"), 1)
1233
+ ]),
1234
+ e("div", no, [
1235
+ e("div", ao, C(n(u).userName), 1),
1236
+ e("div", lo, C(n(u).departmentName), 1)
1237
+ ])
1238
+ ]),
1239
+ x[6] || (x[6] = e("div", { class: "top-menu__dropdown-divider" }, null, -1)),
1240
+ e("div", ro, [
1241
+ e("div", {
1242
+ class: "top-menu__dropdown-item",
1243
+ onClick: _e
1244
+ }, [
1245
+ h(n(S), {
1246
+ name: "user",
1247
+ size: 16
1248
+ }),
1249
+ x[2] || (x[2] = e("span", null, "个人信息", -1))
1250
+ ]),
1251
+ e("div", {
1252
+ class: "top-menu__dropdown-item",
1253
+ onClick: he
1254
+ }, [
1255
+ h(n(S), {
1256
+ name: "lock",
1257
+ size: 16
1258
+ }),
1259
+ x[3] || (x[3] = e("span", null, "修改密码", -1))
1260
+ ]),
1261
+ x[5] || (x[5] = e("div", { class: "top-menu__dropdown-divider" }, null, -1)),
1262
+ e("div", {
1263
+ class: "top-menu__dropdown-item top-menu__dropdown-item--danger",
1264
+ onClick: fe
1265
+ }, [
1266
+ h(n(S), {
1267
+ name: "logout",
1268
+ size: 16
1269
+ }),
1270
+ x[4] || (x[4] = e("span", null, "退出登录", -1))
1271
+ ])
1272
+ ])
1273
+ ])) : P("", !0)
1274
+ ];
1275
+ }),
1276
+ _: 1
1277
+ })
1278
+ ], 512)
1279
+ ]),
1280
+ h(n(je), {
1281
+ modelValue: N.value,
1282
+ "onUpdate:modelValue": x[0] || (x[0] = (s) => N.value = s),
1283
+ title: "换肤设置",
1284
+ direction: "rtl",
1285
+ size: "320px"
1286
+ }, {
1287
+ default: M(() => [
1288
+ e("div", io, [
1289
+ e("div", uo, [
1290
+ x[10] || (x[10] = e("div", { class: "settings-title" }, "布局模式", -1)),
1291
+ e("div", co, [
1292
+ (i(), c(j, null, H(se, (s) => e("div", {
1293
+ key: s.value,
1294
+ class: B(["layout-option", { "is-active": Z.value === s.value }]),
1295
+ onClick: (d) => ce(s.value)
1296
+ }, [
1297
+ e("div", po, [
1298
+ s.value === "sidebar" ? (i(), c("div", vo, [...x[7] || (x[7] = [
1299
+ e("div", { class: "preview-aside" }, null, -1),
1300
+ e("div", { class: "preview-main" }, [
1301
+ e("div", { class: "preview-header" }),
1302
+ e("div", { class: "preview-content" })
1303
+ ], -1)
1304
+ ])])) : s.value === "top" ? (i(), c("div", _o, [...x[8] || (x[8] = [
1305
+ e("div", { class: "preview-header-full" }, null, -1),
1306
+ e("div", { class: "preview-content-full" }, null, -1)
1307
+ ])])) : (i(), c("div", ho, [...x[9] || (x[9] = [
1308
+ e("div", { class: "preview-header-mix" }, [
1309
+ e("div", { class: "preview-mix-left" })
1310
+ ], -1),
1311
+ e("div", { class: "preview-mix-body" }, [
1312
+ e("div", { class: "preview-mix-aside" }),
1313
+ e("div", { class: "preview-mix-content" })
1314
+ ], -1)
1315
+ ])]))
1316
+ ]),
1317
+ e("span", fo, C(s.label), 1)
1318
+ ], 10, mo)), 64))
1319
+ ])
1320
+ ]),
1321
+ e("div", go, [
1322
+ x[11] || (x[11] = e("div", { class: "settings-title" }, "主题色", -1)),
1323
+ e("div", yo, [
1324
+ (i(), c(j, null, H(ie, (s) => e("div", {
1325
+ key: s.value,
1326
+ class: B(["color-option", { "is-active": n(l).primaryColor === s.value }]),
1327
+ style: ke({ backgroundColor: s.value }),
1328
+ title: s.label,
1329
+ onClick: (d) => de(s.value)
1330
+ }, [
1331
+ n(l).primaryColor === s.value ? (i(), K(n(S), {
1332
+ key: 0,
1333
+ name: "check",
1334
+ size: 12,
1335
+ color: "#fff"
1336
+ })) : P("", !0)
1337
+ ], 14, ko)), 64))
1338
+ ])
1339
+ ]),
1340
+ e("div", wo, [
1341
+ x[16] || (x[16] = e("div", { class: "settings-title" }, "功能设置", -1)),
1342
+ e("div", bo, [
1343
+ e("div", xo, [
1344
+ x[13] || (x[13] = e("span", null, "灰色模式", -1)),
1345
+ e("div", {
1346
+ class: B(["switch-wrapper", { "is-checked": R.value }]),
1347
+ onClick: J
1348
+ }, [...x[12] || (x[12] = [
1349
+ e("span", { class: "switch-core" }, null, -1)
1350
+ ])], 2)
1351
+ ]),
1352
+ e("div", Co, [
1353
+ x[15] || (x[15] = e("span", null, "暗黑模式", -1)),
1354
+ e("div", {
1355
+ class: B(["switch-wrapper", { "is-checked": n(l).isDark }]),
1356
+ onClick: I
1357
+ }, [...x[14] || (x[14] = [
1358
+ e("span", { class: "switch-core" }, null, -1)
1359
+ ])], 2)
1360
+ ])
1361
+ ])
1362
+ ])
1363
+ ])
1364
+ ]),
1365
+ _: 1
1366
+ }, 8, ["modelValue"])
1367
+ ]);
1368
+ };
1369
+ }
1370
+ }), Lo = /* @__PURE__ */ Q($o, [["__scopeId", "data-v-fb0eff11"]]), So = { class: "mix-top-menu" }, Mo = { class: "mix-top-menu__logo" }, Io = { class: "mix-top-menu__logo-text" }, To = { class: "mix-top-menu__menu-content" }, Eo = {
1371
+ key: 0,
1372
+ class: "mix-top-menu__menu-icon"
1373
+ }, No = {
1374
+ key: 1,
1375
+ class: "mix-top-menu__menu-char"
1376
+ }, Uo = { class: "mix-top-menu__menu-text" }, Do = { class: "mix-top-menu__actions" }, zo = ["title"], Ro = { class: "mix-top-menu__avatar" }, Ao = { class: "mix-top-menu__user-name" }, Po = {
1377
+ key: 0,
1378
+ class: "mix-top-menu__dropdown"
1379
+ }, Oo = { class: "mix-top-menu__dropdown-header" }, Vo = { class: "mix-top-menu__dropdown-avatar" }, Fo = { class: "mix-top-menu__dropdown-info" }, Bo = { class: "mix-top-menu__dropdown-name" }, Ko = { class: "mix-top-menu__dropdown-role" }, jo = { class: "mix-top-menu__dropdown-menu" }, qo = { class: "settings-drawer" }, Yo = { class: "settings-section" }, Wo = { class: "settings-layout-options" }, Ho = ["onClick"], Go = { class: "layout-option__preview" }, Xo = {
1380
+ key: 0,
1381
+ class: "layout-preview-sidebar"
1382
+ }, Jo = {
1383
+ key: 1,
1384
+ class: "layout-preview-top"
1385
+ }, Qo = {
1386
+ key: 2,
1387
+ class: "layout-preview-mix"
1388
+ }, Zo = { class: "layout-option__label" }, en = { class: "settings-section" }, tn = { class: "settings-color-options" }, sn = ["title", "onClick"], on = { class: "settings-section" }, nn = { class: "settings-switch-list" }, an = { class: "settings-switch-item" }, ln = { class: "settings-switch-item" }, rn = /* @__PURE__ */ ee({
1389
+ __name: "MixTopMenu",
1390
+ setup(t) {
1391
+ const o = ve(), a = ne(), r = ue(), l = ae(), u = G(), $ = be(), m = g(""), f = k(() => {
1392
+ const s = r.menuList.find((d) => d.menuUrl === m.value);
1393
+ return (s == null ? void 0 : s.children) || [];
1394
+ }), p = k(() => r.menuList.find((s) => !!(o.path === s.menuUrl || s.children && s.children.some((d) => o.path.startsWith(d.menuUrl) || o.path === d.menuUrl)))), _ = () => {
1395
+ p.value ? m.value = p.value.menuUrl : r.menuList.length > 0 && (m.value = r.menuList[0].menuUrl);
1396
+ }, v = (s) => {
1397
+ m.value = s;
1398
+ const d = r.menuList.find((y) => y.menuUrl === s);
1399
+ if (d)
1400
+ if (d.children && d.children.length > 0) {
1401
+ const y = d.children[0].menuUrl;
1402
+ o.path !== y && a.push(y);
1403
+ } else
1404
+ o.path !== s && a.push(s);
1405
+ }, w = k(() => l.isDark ? "#1d1e1f" : "#fff"), q = k(() => l.isDark ? "#cfd3dc" : "#303133"), N = k(() => "#409eff"), R = g(!1), V = g(null), A = g(!1), z = g(!1), F = g(!1);
1406
+ Ae(() => o.path, () => {
1407
+ _(), l.setMixSubMenus(f.value);
1408
+ }), Ae(() => r.menuList, (s) => {
1409
+ s && s.length > 0 && (_(), l.setMixSubMenus(f.value));
1410
+ }, { immediate: !0 });
1411
+ const D = /* @__PURE__ */ new Set([
1412
+ "arrow-up",
1413
+ "arrow-down",
1414
+ "arrow-left",
1415
+ "arrow-right",
1416
+ "caret-down",
1417
+ "caret-right",
1418
+ "plus",
1419
+ "minus",
1420
+ "close",
1421
+ "check",
1422
+ "edit",
1423
+ "delete",
1424
+ "copy",
1425
+ "download",
1426
+ "upload",
1427
+ "refresh",
1428
+ "search",
1429
+ "filter",
1430
+ "more",
1431
+ "setting",
1432
+ "share",
1433
+ "loading",
1434
+ "info",
1435
+ "success",
1436
+ "warning",
1437
+ "error",
1438
+ "question",
1439
+ "user",
1440
+ "user-add",
1441
+ "user-group",
1442
+ "logout",
1443
+ "login",
1444
+ "file",
1445
+ "folder",
1446
+ "folder-open",
1447
+ "document",
1448
+ "image",
1449
+ "video",
1450
+ "music",
1451
+ "camera",
1452
+ "mail",
1453
+ "phone",
1454
+ "chat",
1455
+ "bell",
1456
+ "message",
1457
+ "eye",
1458
+ "eye-off",
1459
+ "calendar",
1460
+ "clock",
1461
+ "history",
1462
+ "timer",
1463
+ "location",
1464
+ "map",
1465
+ "globe",
1466
+ "star",
1467
+ "heart",
1468
+ "thumb-up",
1469
+ "link",
1470
+ "external-link",
1471
+ "lock",
1472
+ "unlock",
1473
+ "key",
1474
+ "home",
1475
+ "menu",
1476
+ "menu-fold",
1477
+ "menu-unfold",
1478
+ "sidebar-fold",
1479
+ "sidebar-expand",
1480
+ "sidebar-left",
1481
+ "dashboard",
1482
+ "chart",
1483
+ "chart-pie",
1484
+ "chart-line",
1485
+ "report",
1486
+ "analytics",
1487
+ "system",
1488
+ "permission",
1489
+ "role",
1490
+ "user-manage",
1491
+ "log",
1492
+ "notification",
1493
+ "app",
1494
+ "list",
1495
+ "grid",
1496
+ "fullscreen",
1497
+ "fullscreen-exit",
1498
+ "zoom-in",
1499
+ "zoom-out",
1500
+ "print",
1501
+ "bookmark",
1502
+ "tag",
1503
+ "code",
1504
+ "terminal",
1505
+ "database",
1506
+ "server",
1507
+ "cloud",
1508
+ "gift",
1509
+ "moon",
1510
+ "sun",
1511
+ "theme",
1512
+ "skin"
1513
+ ]), W = (s) => {
1514
+ if (!s || s === "") return "";
1515
+ if (s.startsWith("tineco-icon-")) {
1516
+ const y = s.replace("tineco-icon-", "");
1517
+ return {
1518
+ home: "home",
1519
+ dashboard: "dashboard",
1520
+ system: "system",
1521
+ user: "user",
1522
+ role: "role",
1523
+ menu: "list",
1524
+ setting: "setting",
1525
+ file: "file",
1526
+ folder: "folder",
1527
+ chart: "chart",
1528
+ report: "report",
1529
+ analytics: "analytics"
1530
+ }[y] || y;
1531
+ }
1532
+ return {
1533
+ dashboard: "dashboard",
1534
+ system: "system",
1535
+ user: "user",
1536
+ role: "role",
1537
+ menu: "list",
1538
+ setting: "setting",
1539
+ home: "home",
1540
+ chart: "chart",
1541
+ report: "report",
1542
+ analytics: "analytics",
1543
+ permission: "permission",
1544
+ log: "log",
1545
+ notification: "notification",
1546
+ app: "app",
1547
+ list: "list",
1548
+ grid: "grid"
1549
+ }[s] || s;
1550
+ }, U = (s) => s ? s.charAt(0) : "", Y = (s) => D.has(s), le = () => {
1551
+ l.toggleTheme(), z.value = !1;
1552
+ }, X = () => {
1553
+ document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
1554
+ }, te = () => {
1555
+ A.value = !!document.fullscreenElement;
1556
+ }, re = () => {
1557
+ R.value = !R.value;
1558
+ }, J = () => {
1559
+ R.value = !1;
1560
+ }, I = () => {
1561
+ z.value = !0;
1562
+ }, se = (s) => {
1563
+ F.value = s;
1564
+ const d = document.documentElement;
1565
+ s ? d.classList.add("grey-mode") : d.classList.remove("grey-mode");
1566
+ }, Z = () => {
1567
+ se(!F.value), z.value = !1;
1568
+ }, ce = () => {
1569
+ l.toggleTheme(), z.value = !1;
1570
+ }, ie = [
1571
+ { value: "sidebar", label: "左侧菜单", icon: "sidebar-left" },
1572
+ { value: "top", label: "顶部菜单", icon: "menu" },
1573
+ { value: "mix", label: "混合菜单", icon: "grid" }
1574
+ ], de = k(() => l.layout), _e = (s) => {
1575
+ l.setLayout(s), z.value = !1;
1576
+ }, he = [
1577
+ { value: "#409eff", label: "默认蓝" },
1578
+ { value: "#1890ff", label: "科技蓝" },
1579
+ { value: "#52c41a", label: "极光绿" },
1580
+ { value: "#faad14", label: "日落橙" },
1581
+ { value: "#f5222d", label: "薄暮红" },
1582
+ { value: "#722ed1", label: "酱紫" }
1583
+ ], fe = (s) => {
1584
+ l.setPrimaryColor(s), z.value = !1;
1585
+ }, me = () => {
1586
+ J(), a.push("/profile");
1587
+ }, E = () => {
1588
+ J(), a.push("/change-password");
1589
+ }, x = () => {
1590
+ J(), $.logout(), u.clearUserInfo(), r.clearMenu(), a.push("/login");
1591
+ }, T = (s) => {
1592
+ V.value && !V.value.contains(s.target) && J();
1593
+ };
1594
+ return Pe(() => {
1595
+ document.addEventListener("click", T), document.addEventListener("fullscreenchange", te), F.value = document.documentElement.classList.contains("grey-mode"), _();
1596
+ }), Oe(() => {
1597
+ document.removeEventListener("click", T), document.removeEventListener("fullscreenchange", te);
1598
+ }), (s, d) => {
1599
+ var y;
1600
+ return i(), c("div", So, [
1601
+ e("div", Mo, [
1602
+ d[1] || (d[1] = e("img", {
1603
+ src: Ue,
1604
+ alt: "Logo",
1605
+ class: "mix-top-menu__logo-img"
1606
+ }, null, -1)),
1607
+ e("span", Io, C(n(l).appName), 1)
1608
+ ]),
1609
+ h(n(Ke), {
1610
+ "default-active": m.value,
1611
+ mode: "horizontal",
1612
+ "background-color": w.value,
1613
+ "text-color": q.value,
1614
+ "active-text-color": N.value,
1615
+ class: "mix-top-menu__menu",
1616
+ onSelect: v
1617
+ }, {
1618
+ default: M(() => [
1619
+ (i(!0), c(j, null, H(n(r).menuList, (L) => (i(), K(n(we), {
1620
+ key: L.menuUrl,
1621
+ index: L.menuUrl
1622
+ }, {
1623
+ default: M(() => [
1624
+ e("span", To, [
1625
+ L.menuName !== "首页" ? (i(), c("span", Eo, [
1626
+ Y(W(L.icon)) ? (i(), K(n(S), {
1627
+ key: 0,
1628
+ name: W(L.icon),
1629
+ size: 16
1630
+ }, null, 8, ["name"])) : (i(), c("span", No, C(U(L.menuName)), 1))
1631
+ ])) : P("", !0),
1632
+ e("span", Uo, C(L.menuName), 1)
1633
+ ])
1634
+ ]),
1635
+ _: 2
1636
+ }, 1032, ["index"]))), 128))
1637
+ ]),
1638
+ _: 1
1639
+ }, 8, ["default-active", "background-color", "text-color", "active-text-color"]),
1640
+ e("div", Do, [
1641
+ e("div", {
1642
+ class: "mix-top-menu__action",
1643
+ onClick: X,
1644
+ title: A.value ? "退出全屏" : "全屏"
1645
+ }, [
1646
+ h(n(S), {
1647
+ name: A.value ? "fullscreen-exit" : "fullscreen",
1648
+ size: 16
1649
+ }, null, 8, ["name"])
1650
+ ], 8, zo),
1651
+ e("div", {
1652
+ class: "mix-top-menu__action",
1653
+ onClick: I,
1654
+ title: "换肤设置"
1655
+ }, [
1656
+ h(n(S), {
1657
+ name: "skin",
1658
+ size: 16
1659
+ })
1660
+ ]),
1661
+ e("div", {
1662
+ class: "mix-top-menu__action",
1663
+ onClick: le,
1664
+ title: "切换主题"
1665
+ }, [
1666
+ h(n(S), {
1667
+ name: n(l).isDark ? "sun" : "moon",
1668
+ size: 16
1669
+ }, null, 8, ["name"])
1670
+ ]),
1671
+ e("div", {
1672
+ class: "mix-top-menu__user",
1673
+ ref_key: "dropdownRef",
1674
+ ref: V
1675
+ }, [
1676
+ e("div", {
1677
+ class: "mix-top-menu__user-trigger",
1678
+ onClick: Te(re, ["stop"])
1679
+ }, [
1680
+ e("div", Ro, [
1681
+ e("span", null, C(((y = n(u).userName) == null ? void 0 : y.charAt(0)) || "U"), 1)
1682
+ ]),
1683
+ e("span", Ao, C(n(u).userName), 1),
1684
+ e("span", {
1685
+ class: B(["mix-top-menu__user-arrow", { "is-active": R.value }])
1686
+ }, "▼", 2)
1687
+ ]),
1688
+ h(Le, { name: "dropdown" }, {
1689
+ default: M(() => {
1690
+ var L;
1691
+ return [
1692
+ R.value ? (i(), c("div", Po, [
1693
+ e("div", Oo, [
1694
+ e("div", Vo, [
1695
+ e("span", null, C(((L = n(u).userName) == null ? void 0 : L.charAt(0)) || "U"), 1)
1696
+ ]),
1697
+ e("div", Fo, [
1698
+ e("div", Bo, C(n(u).userName), 1),
1699
+ e("div", Ko, C(n(u).departmentName), 1)
1700
+ ])
1701
+ ]),
1702
+ d[6] || (d[6] = e("div", { class: "mix-top-menu__dropdown-divider" }, null, -1)),
1703
+ e("div", jo, [
1704
+ e("div", {
1705
+ class: "mix-top-menu__dropdown-item",
1706
+ onClick: me
1707
+ }, [
1708
+ h(n(S), {
1709
+ name: "user",
1710
+ size: 16
1711
+ }),
1712
+ d[2] || (d[2] = e("span", null, "个人信息", -1))
1713
+ ]),
1714
+ e("div", {
1715
+ class: "mix-top-menu__dropdown-item",
1716
+ onClick: E
1717
+ }, [
1718
+ h(n(S), {
1719
+ name: "lock",
1720
+ size: 16
1721
+ }),
1722
+ d[3] || (d[3] = e("span", null, "修改密码", -1))
1723
+ ]),
1724
+ d[5] || (d[5] = e("div", { class: "mix-top-menu__dropdown-divider" }, null, -1)),
1725
+ e("div", {
1726
+ class: "mix-top-menu__dropdown-item mix-top-menu__dropdown-item--danger",
1727
+ onClick: x
1728
+ }, [
1729
+ h(n(S), {
1730
+ name: "logout",
1731
+ size: 16
1732
+ }),
1733
+ d[4] || (d[4] = e("span", null, "退出登录", -1))
1734
+ ])
1735
+ ])
1736
+ ])) : P("", !0)
1737
+ ];
1738
+ }),
1739
+ _: 1
1740
+ })
1741
+ ], 512)
1742
+ ]),
1743
+ h(n(je), {
1744
+ modelValue: z.value,
1745
+ "onUpdate:modelValue": d[0] || (d[0] = (L) => z.value = L),
1746
+ title: "换肤设置",
1747
+ direction: "rtl",
1748
+ size: "320px"
1749
+ }, {
1750
+ default: M(() => [
1751
+ e("div", qo, [
1752
+ e("div", Yo, [
1753
+ d[10] || (d[10] = e("div", { class: "settings-title" }, "布局模式", -1)),
1754
+ e("div", Wo, [
1755
+ (i(), c(j, null, H(ie, (L) => e("div", {
1756
+ key: L.value,
1757
+ class: B(["layout-option", { "is-active": de.value === L.value }]),
1758
+ onClick: (Qe) => _e(L.value)
1759
+ }, [
1760
+ e("div", Go, [
1761
+ L.value === "sidebar" ? (i(), c("div", Xo, [...d[7] || (d[7] = [
1762
+ e("div", { class: "preview-aside" }, null, -1),
1763
+ e("div", { class: "preview-main" }, [
1764
+ e("div", { class: "preview-header" }),
1765
+ e("div", { class: "preview-content" })
1766
+ ], -1)
1767
+ ])])) : L.value === "top" ? (i(), c("div", Jo, [...d[8] || (d[8] = [
1768
+ e("div", { class: "preview-header-full" }, null, -1),
1769
+ e("div", { class: "preview-content-full" }, null, -1)
1770
+ ])])) : (i(), c("div", Qo, [...d[9] || (d[9] = [
1771
+ e("div", { class: "preview-header-mix" }, [
1772
+ e("div", { class: "preview-mix-left" })
1773
+ ], -1),
1774
+ e("div", { class: "preview-mix-body" }, [
1775
+ e("div", { class: "preview-mix-aside" }),
1776
+ e("div", { class: "preview-mix-content" })
1777
+ ], -1)
1778
+ ])]))
1779
+ ]),
1780
+ e("span", Zo, C(L.label), 1)
1781
+ ], 10, Ho)), 64))
1782
+ ])
1783
+ ]),
1784
+ e("div", en, [
1785
+ d[11] || (d[11] = e("div", { class: "settings-title" }, "主题色", -1)),
1786
+ e("div", tn, [
1787
+ (i(), c(j, null, H(he, (L) => e("div", {
1788
+ key: L.value,
1789
+ class: B(["color-option", { "is-active": n(l).primaryColor === L.value }]),
1790
+ style: ke({ backgroundColor: L.value }),
1791
+ title: L.label,
1792
+ onClick: (Qe) => fe(L.value)
1793
+ }, [
1794
+ n(l).primaryColor === L.value ? (i(), K(n(S), {
1795
+ key: 0,
1796
+ name: "check",
1797
+ size: 12,
1798
+ color: "#fff"
1799
+ })) : P("", !0)
1800
+ ], 14, sn)), 64))
1801
+ ])
1802
+ ]),
1803
+ e("div", on, [
1804
+ d[16] || (d[16] = e("div", { class: "settings-title" }, "功能设置", -1)),
1805
+ e("div", nn, [
1806
+ e("div", an, [
1807
+ d[13] || (d[13] = e("span", null, "灰色模式", -1)),
1808
+ e("div", {
1809
+ class: B(["switch-wrapper", { "is-checked": F.value }]),
1810
+ onClick: Z
1811
+ }, [...d[12] || (d[12] = [
1812
+ e("span", { class: "switch-core" }, null, -1)
1813
+ ])], 2)
1814
+ ]),
1815
+ e("div", ln, [
1816
+ d[15] || (d[15] = e("span", null, "暗黑模式", -1)),
1817
+ e("div", {
1818
+ class: B(["switch-wrapper", { "is-checked": n(l).isDark }]),
1819
+ onClick: ce
1820
+ }, [...d[14] || (d[14] = [
1821
+ e("span", { class: "switch-core" }, null, -1)
1822
+ ])], 2)
1823
+ ])
1824
+ ])
1825
+ ])
1826
+ ])
1827
+ ]),
1828
+ _: 1
1829
+ }, 8, ["modelValue"])
1830
+ ]);
1831
+ };
1832
+ }
1833
+ }), un = /* @__PURE__ */ Q(rn, [["__scopeId", "data-v-0bcb4dc8"]]), cn = {
1834
+ key: 0,
1835
+ class: "layout layout--sidebar"
1836
+ }, dn = { class: "layout__main" }, mn = { class: "layout__header" }, pn = { class: "layout__content" }, vn = {
1837
+ key: 1,
1838
+ class: "layout layout--top"
1839
+ }, _n = { class: "layout__top-menu" }, hn = { class: "layout__main" }, fn = { class: "layout__content" }, gn = {
1840
+ key: 2,
1841
+ class: "layout layout--mix"
1842
+ }, yn = { class: "layout__mix-top-menu" }, kn = { class: "layout__mix-body" }, wn = { class: "layout__content" }, bn = /* @__PURE__ */ ee({
1843
+ __name: "index",
1844
+ setup(t) {
1845
+ const o = ae(), a = ue(), r = k(
1846
+ () => o.isCollapsed ? "64px" : "210px"
1847
+ ), l = k(() => o.layout), u = k(() => l.value === "mix"), $ = k(() => l.value === "sidebar" ? a.menuList : l.value === "mix" ? o.mixSubMenus : []), m = k(() => u.value ? $.value.length > 0 : !1);
1848
+ return (f, p) => {
1849
+ const _ = _t("router-view");
1850
+ return i(), c(j, null, [
1851
+ l.value === "sidebar" ? (i(), c("div", cn, [
1852
+ e("aside", {
1853
+ class: "layout__aside",
1854
+ style: ke({ width: r.value })
1855
+ }, [
1856
+ h(et, {
1857
+ "menu-list": $.value,
1858
+ "show-logo": !0,
1859
+ "show-user": !0
1860
+ }, null, 8, ["menu-list"])
1861
+ ], 4),
1862
+ e("div", dn, [
1863
+ e("header", mn, [
1864
+ h(zs)
1865
+ ]),
1866
+ e("main", pn, [
1867
+ h(_)
1868
+ ])
1869
+ ])
1870
+ ])) : P("", !0),
1871
+ l.value === "top" ? (i(), c("div", vn, [
1872
+ e("div", _n, [
1873
+ h(Lo)
1874
+ ]),
1875
+ e("div", hn, [
1876
+ e("main", fn, [
1877
+ h(_)
1878
+ ])
1879
+ ])
1880
+ ])) : P("", !0),
1881
+ l.value === "mix" ? (i(), c("div", gn, [
1882
+ e("div", yn, [
1883
+ h(un)
1884
+ ]),
1885
+ e("div", kn, [
1886
+ m.value ? (i(), c("aside", {
1887
+ key: 0,
1888
+ class: "layout__aside",
1889
+ style: ke({ width: r.value })
1890
+ }, [
1891
+ h(et, {
1892
+ "menu-list": $.value,
1893
+ "show-logo": !1,
1894
+ "show-user": !1
1895
+ }, null, 8, ["menu-list"])
1896
+ ], 4)) : P("", !0),
1897
+ e("main", wn, [
1898
+ h(_)
1899
+ ])
1900
+ ])
1901
+ ])) : P("", !0)
1902
+ ], 64);
1903
+ };
1904
+ }
1905
+ }), it = /* @__PURE__ */ Q(bn, [["__scopeId", "data-v-820ea22e"]]), xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1906
+ __proto__: null,
1907
+ default: it
1908
+ }, Symbol.toStringTag, { value: "Module" })), Cn = { class: "tabs-wrapper" }, $n = { class: "tab-label" }, Ln = ["onClick"], Sn = /* @__PURE__ */ ee({
1909
+ __name: "Tabs",
1910
+ setup(t) {
1911
+ const o = ve(), a = ne(), r = k(() => {
1912
+ const m = [];
1913
+ return o.matched.forEach((f) => {
1914
+ var p;
1915
+ (p = f.meta) != null && p.affix && m.push({
1916
+ name: f.name,
1917
+ title: f.meta.title,
1918
+ path: f.path,
1919
+ affix: !0
1920
+ });
1921
+ }), m;
1922
+ }), l = k(() => o.path), u = (m) => {
1923
+ a.push(m);
1924
+ }, $ = (m) => {
1925
+ const f = r.value.find((p) => p.path === m);
1926
+ if (!(f != null && f.affix) && m === l.value) {
1927
+ const p = r.value.findIndex((v) => v.path === m), _ = r.value[p - 1] || r.value[p + 1];
1928
+ _ && a.push(_.path);
1929
+ }
1930
+ };
1931
+ return (m, f) => (i(), c("div", Cn, [
1932
+ h(n(ht), {
1933
+ modelValue: l.value,
1934
+ "onUpdate:modelValue": f[0] || (f[0] = (p) => l.value = p),
1935
+ type: "card",
1936
+ onTabClick: u
1937
+ }, {
1938
+ default: M(() => [
1939
+ (i(!0), c(j, null, H(r.value, (p) => (i(), K(n(ft), {
1940
+ key: p.path,
1941
+ name: p.path,
1942
+ label: p.title,
1943
+ closable: !p.affix
1944
+ }, {
1945
+ label: M(() => [
1946
+ e("span", $n, [
1947
+ pe(C(p.title) + " ", 1),
1948
+ p.affix ? P("", !0) : (i(), c("span", {
1949
+ key: 0,
1950
+ class: "tab-close",
1951
+ onClick: Te((_) => $(p.path), ["stop"])
1952
+ }, " ✕ ", 8, Ln))
1953
+ ])
1954
+ ]),
1955
+ _: 2
1956
+ }, 1032, ["name", "label", "closable"]))), 128))
1957
+ ]),
1958
+ _: 1
1959
+ }, 8, ["modelValue"])
1960
+ ]));
1961
+ }
1962
+ }), ma = /* @__PURE__ */ Q(Sn, [["__scopeId", "data-v-9156d8cd"]]), Mn = {}, In = { class: "footer" };
1963
+ function Tn(t, o) {
1964
+ return i(), c("div", In, [...o[0] || (o[0] = [
1965
+ e("span", null, "Copyright © 2024 Xto Demo. All Rights Reserved.", -1)
1966
+ ])]);
1967
+ }
1968
+ const pa = /* @__PURE__ */ Q(Mn, [["render", Tn], ["__scopeId", "data-v-4852826a"]]), En = () => {
1969
+ const t = kt.create({
1970
+ baseURL: void 0,
1971
+ timeout: 3e4,
1972
+ headers: {
1973
+ "Content-Type": "application/json"
1974
+ }
1975
+ });
1976
+ return t.interceptors.request.use(
1977
+ (o) => {
1978
+ const a = De(), r = xt() || "Bearer";
1979
+ return a && (o.headers.Authorization = `${r} ${a}`), o;
1980
+ },
1981
+ (o) => Promise.reject(o)
1982
+ ), t.interceptors.response.use(
1983
+ (o) => {
1984
+ const { data: a } = o;
1985
+ return a.code === 200 || a.code === 0 ? a.data : (oe.error(a.message || "请求失败"), Promise.reject(new Error(a.message || "请求失败")));
1986
+ },
1987
+ (o) => {
1988
+ var r;
1989
+ const { response: a } = o;
1990
+ if (a)
1991
+ switch (a.status) {
1992
+ case 401:
1993
+ oe.error("登录已过期,请重新登录"), lt(), window.location.href = "/login";
1994
+ break;
1995
+ case 403:
1996
+ oe.error("没有权限访问");
1997
+ break;
1998
+ case 404:
1999
+ oe.error("请求资源不存在");
2000
+ break;
2001
+ case 500:
2002
+ oe.error("服务器错误");
2003
+ break;
2004
+ default:
2005
+ oe.error(((r = a.data) == null ? void 0 : r.message) || "请求失败");
2006
+ }
2007
+ else
2008
+ oe.error("网络连接失败");
2009
+ return Promise.reject(o);
2010
+ }
2011
+ ), t;
2012
+ }, ye = En(), O = {
2013
+ get(t, o) {
2014
+ return ye.get(t, o);
2015
+ },
2016
+ post(t, o, a) {
2017
+ return ye.post(t, o, a);
2018
+ },
2019
+ put(t, o, a) {
2020
+ return ye.put(t, o, a);
2021
+ },
2022
+ patch(t, o, a) {
2023
+ return ye.patch(t, o, a);
2024
+ },
2025
+ delete(t, o) {
2026
+ return ye.delete(t, o);
2027
+ }
2028
+ };
2029
+ function Nn(t) {
2030
+ return O.post("/user/v1.0/login/by-domain", t);
2031
+ }
2032
+ function va() {
2033
+ return O.put("/user/v1.0/user/logout");
2034
+ }
2035
+ function Un() {
2036
+ return O.get("/user/v1.0/user/get-me");
2037
+ }
2038
+ function _a(t) {
2039
+ return O.post("/user/v1.0/refresh", { refreshToken: t });
2040
+ }
2041
+ const Se = g(""), Me = g(""), Ie = g("");
2042
+ function ha(t) {
2043
+ t.appId && (Se.value = t.appId), t.clientId && (Me.value = t.clientId), t.apiBaseUrl && (Ie.value = t.apiBaseUrl);
2044
+ }
2045
+ function Je() {
2046
+ if (Se.value)
2047
+ return Se.value;
2048
+ try {
2049
+ return "";
2050
+ } catch {
2051
+ return "";
2052
+ }
2053
+ }
2054
+ function Dn() {
2055
+ if (Me.value)
2056
+ return Me.value;
2057
+ try {
2058
+ return "";
2059
+ } catch {
2060
+ return "";
2061
+ }
2062
+ }
2063
+ function fa() {
2064
+ if (Ie.value)
2065
+ return Ie.value;
2066
+ try {
2067
+ return "";
2068
+ } catch {
2069
+ return "";
2070
+ }
2071
+ }
2072
+ const ga = {
2073
+ appId: Se,
2074
+ clientId: Me,
2075
+ apiBaseUrl: Ie
2076
+ }, zn = { class: "login" }, Rn = { class: "login__container" }, An = /* @__PURE__ */ ee({
2077
+ __name: "index",
2078
+ setup(t) {
2079
+ const o = ne(), a = ve(), r = g(!1), l = g(!1), u = Ve({
2080
+ uid: "",
2081
+ password: ""
2082
+ }), $ = {
2083
+ uid: [
2084
+ { required: !0, message: "请输入用户名", trigger: "blur" }
2085
+ ],
2086
+ password: [
2087
+ { required: !0, message: "请输入密码", trigger: "blur" },
2088
+ { min: 6, message: "密码长度至少6位", trigger: "blur" }
2089
+ ]
2090
+ }, m = g(), f = async () => {
2091
+ var p;
2092
+ try {
2093
+ await ((p = m.value) == null ? void 0 : p.validate()), r.value = !0;
2094
+ const _ = await Nn({
2095
+ appId: Je(),
2096
+ clientId: Dn(),
2097
+ uid: u.uid,
2098
+ password: u.password,
2099
+ code: !0
2100
+ });
2101
+ at(_), oe.success("登录成功");
2102
+ const v = a.query.redirect || "/";
2103
+ o.push(v);
2104
+ } catch (_) {
2105
+ console.error("登录失败:", _);
2106
+ } finally {
2107
+ r.value = !1;
2108
+ }
2109
+ };
2110
+ return (p, _) => (i(), c("div", zn, [
2111
+ e("div", Rn, [
2112
+ _[5] || (_[5] = e("div", { class: "login__header" }, [
2113
+ e("img", {
2114
+ src: Ue,
2115
+ alt: "Logo",
2116
+ class: "login__logo"
2117
+ }),
2118
+ e("h1", { class: "login__title" }, "Xto Demo"),
2119
+ e("p", { class: "login__subtitle" }, "后台管理系统")
2120
+ ], -1)),
2121
+ h(n(gt), {
2122
+ ref_key: "formRef",
2123
+ ref: m,
2124
+ model: u,
2125
+ rules: $,
2126
+ class: "login__form",
2127
+ "label-width": "0"
2128
+ }, {
2129
+ default: M(() => [
2130
+ h(n(xe), { prop: "uid" }, {
2131
+ default: M(() => [
2132
+ h(n(Ze), {
2133
+ modelValue: u.uid,
2134
+ "onUpdate:modelValue": _[0] || (_[0] = (v) => u.uid = v),
2135
+ placeholder: "用户名",
2136
+ size: "large"
2137
+ }, {
2138
+ prefix: M(() => [
2139
+ h(n(S), {
2140
+ name: "user",
2141
+ size: 18
2142
+ })
2143
+ ]),
2144
+ _: 1
2145
+ }, 8, ["modelValue"])
2146
+ ]),
2147
+ _: 1
2148
+ }),
2149
+ h(n(xe), { prop: "password" }, {
2150
+ default: M(() => [
2151
+ h(n(Ze), {
2152
+ modelValue: u.password,
2153
+ "onUpdate:modelValue": _[1] || (_[1] = (v) => u.password = v),
2154
+ type: "password",
2155
+ placeholder: "密码",
2156
+ size: "large",
2157
+ "show-password": "",
2158
+ onKeyup: st(f, ["enter"])
2159
+ }, {
2160
+ prefix: M(() => [
2161
+ h(n(S), {
2162
+ name: "lock",
2163
+ size: 18
2164
+ })
2165
+ ]),
2166
+ _: 1
2167
+ }, 8, ["modelValue"])
2168
+ ]),
2169
+ _: 1
2170
+ }),
2171
+ h(n(xe), null, {
2172
+ default: M(() => [
2173
+ h(n(yt), {
2174
+ modelValue: l.value,
2175
+ "onUpdate:modelValue": _[2] || (_[2] = (v) => l.value = v)
2176
+ }, {
2177
+ default: M(() => [..._[3] || (_[3] = [
2178
+ pe("记住我", -1)
2179
+ ])]),
2180
+ _: 1
2181
+ }, 8, ["modelValue"])
2182
+ ]),
2183
+ _: 1
2184
+ }),
2185
+ h(n(xe), null, {
2186
+ default: M(() => [
2187
+ h(n(Ne), {
2188
+ type: "primary",
2189
+ size: "large",
2190
+ loading: r.value,
2191
+ class: "login__submit",
2192
+ onClick: f
2193
+ }, {
2194
+ default: M(() => [..._[4] || (_[4] = [
2195
+ pe(" 登录 ", -1)
2196
+ ])]),
2197
+ _: 1
2198
+ }, 8, ["loading"])
2199
+ ]),
2200
+ _: 1
2201
+ })
2202
+ ]),
2203
+ _: 1
2204
+ }, 8, ["model"]),
2205
+ _[6] || (_[6] = e("div", { class: "login__footer" }, [
2206
+ e("p", null, "请输入您的用户名和密码")
2207
+ ], -1))
2208
+ ])
2209
+ ]));
2210
+ }
2211
+ }), Pn = /* @__PURE__ */ Q(An, [["__scopeId", "data-v-f3e724b6"]]), On = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2212
+ __proto__: null,
2213
+ default: Pn
2214
+ }, Symbol.toStringTag, { value: "Module" })), Vn = { class: "error-page" }, Fn = { class: "error-page__content" }, Bn = /* @__PURE__ */ ee({
2215
+ __name: "404",
2216
+ setup(t) {
2217
+ const o = ne(), a = () => {
2218
+ o.push("/");
2219
+ };
2220
+ return (r, l) => (i(), c("div", Vn, [
2221
+ e("div", Fn, [
2222
+ l[1] || (l[1] = e("div", { class: "error-page__code" }, "404", -1)),
2223
+ l[2] || (l[2] = e("div", { class: "error-page__title" }, "页面不存在", -1)),
2224
+ l[3] || (l[3] = e("div", { class: "error-page__desc" }, "抱歉,您访问的页面不存在或已被删除", -1)),
2225
+ h(n(Ne), {
2226
+ type: "primary",
2227
+ onClick: a
2228
+ }, {
2229
+ default: M(() => [...l[0] || (l[0] = [
2230
+ pe("返回首页", -1)
2231
+ ])]),
2232
+ _: 1
2233
+ })
2234
+ ])
2235
+ ]));
2236
+ }
2237
+ }), Kn = /* @__PURE__ */ Q(Bn, [["__scopeId", "data-v-54fcac4c"]]), ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2238
+ __proto__: null,
2239
+ default: Kn
2240
+ }, Symbol.toStringTag, { value: "Module" })), jn = { class: "error-page" }, qn = { class: "error-page__content" }, Yn = /* @__PURE__ */ ee({
2241
+ __name: "403",
2242
+ setup(t) {
2243
+ const o = ne(), a = () => {
2244
+ o.push("/");
2245
+ };
2246
+ return (r, l) => (i(), c("div", jn, [
2247
+ e("div", qn, [
2248
+ l[1] || (l[1] = e("div", { class: "error-page__code" }, "403", -1)),
2249
+ l[2] || (l[2] = e("div", { class: "error-page__title" }, "无访问权限", -1)),
2250
+ l[3] || (l[3] = e("div", { class: "error-page__desc" }, "抱歉,您没有权限访问此页面", -1)),
2251
+ h(n(Ne), {
2252
+ type: "primary",
2253
+ onClick: a
2254
+ }, {
2255
+ default: M(() => [...l[0] || (l[0] = [
2256
+ pe("返回首页", -1)
2257
+ ])]),
2258
+ _: 1
2259
+ })
2260
+ ])
2261
+ ]));
2262
+ }
2263
+ }), ya = /* @__PURE__ */ Q(Yn, [["__scopeId", "data-v-b2ff9b3e"]]);
2264
+ function ka() {
2265
+ const t = ae(), o = G(), a = be(), r = k(() => o.userName || ""), l = k(() => o.userInfo), u = k(() => t.appName), $ = k(() => a.isLoggedIn), m = k(() => t.isDark), f = k(() => t.theme), p = k(() => t.isCollapsed), _ = k(() => t.layout);
2266
+ return {
2267
+ userName: r,
2268
+ userInfo: l,
2269
+ appName: u,
2270
+ isLoggedIn: $,
2271
+ isDark: m,
2272
+ theme: f,
2273
+ isCollapsed: p,
2274
+ layout: _,
2275
+ toggleTheme: () => {
2276
+ t.toggleTheme();
2277
+ },
2278
+ toggleCollapse: () => {
2279
+ t.toggleCollapse();
2280
+ }
2281
+ };
2282
+ }
2283
+ function wa() {
2284
+ const t = G();
2285
+ return {
2286
+ isLoggedIn: k(() => t.isLoggedIn)
2287
+ };
2288
+ }
2289
+ function ba(t, o = {}) {
2290
+ const { rules: a, onSubmit: r } = o, l = g(), u = Ve({ ...t }), $ = g(!1), m = g(!1), f = g(!1), p = () => {
2291
+ w(), f.value = !1, m.value = !0;
2292
+ }, _ = (N) => {
2293
+ Object.assign(u, N), f.value = !0, m.value = !0;
2294
+ }, v = () => {
2295
+ m.value = !1, w();
2296
+ }, w = () => {
2297
+ var N;
2298
+ Object.keys(t).forEach((R) => {
2299
+ u[R] = t[R];
2300
+ }), (N = l.value) == null || N.resetFields();
2301
+ };
2302
+ return {
2303
+ formRef: l,
2304
+ formData: u,
2305
+ rules: a,
2306
+ loading: $,
2307
+ visible: m,
2308
+ isEdit: f,
2309
+ openAdd: p,
2310
+ openEdit: _,
2311
+ close: v,
2312
+ resetForm: w,
2313
+ handleSubmit: async () => {
2314
+ var N;
2315
+ try {
2316
+ await ((N = l.value) == null ? void 0 : N.validate()), $.value = !0, await (r == null ? void 0 : r(u)), v();
2317
+ } catch (R) {
2318
+ console.error(R);
2319
+ } finally {
2320
+ $.value = !1;
2321
+ }
2322
+ }
2323
+ };
2324
+ }
2325
+ function xa(t) {
2326
+ const { fetchData: o, defaultPageSize: a = 10 } = t, r = g(!1), l = g([]), u = g(0), $ = g(1), m = g(a), f = Ve({}), p = async () => {
2327
+ r.value = !0;
2328
+ try {
2329
+ const V = {
2330
+ ...f,
2331
+ page: $.value,
2332
+ pageSize: m.value
2333
+ }, A = await o(V);
2334
+ l.value = A.list, u.value = A.total;
2335
+ } catch (V) {
2336
+ console.error(V);
2337
+ } finally {
2338
+ r.value = !1;
2339
+ }
2340
+ }, _ = () => {
2341
+ $.value = 1, p();
2342
+ }, v = () => {
2343
+ Object.keys(f).forEach((V) => {
2344
+ f[V] = void 0;
2345
+ }), $.value = 1, p();
2346
+ }, w = (V) => {
2347
+ $.value = V, p();
2348
+ }, q = (V) => {
2349
+ m.value = V, $.value = 1, p();
2350
+ }, N = () => {
2351
+ p();
2352
+ }, R = k(() => ({
2353
+ current: $.value,
2354
+ pageSize: m.value,
2355
+ total: u.value
2356
+ }));
2357
+ return {
2358
+ loading: r,
2359
+ data: l,
2360
+ total: u,
2361
+ currentPage: $,
2362
+ pageSize: m,
2363
+ searchParams: f,
2364
+ pagination: R,
2365
+ getData: p,
2366
+ handleSearch: _,
2367
+ handleReset: v,
2368
+ handlePageChange: w,
2369
+ handleSizeChange: q,
2370
+ refresh: N
2371
+ };
2372
+ }
2373
+ function Ca(t) {
2374
+ return G().isLoggedIn;
2375
+ }
2376
+ function $a(t) {
2377
+ return G().isLoggedIn;
2378
+ }
2379
+ function La() {
2380
+ return !0;
2381
+ }
2382
+ const ct = [
2383
+ {
2384
+ path: "/login",
2385
+ name: "Login",
2386
+ component: () => Promise.resolve().then(() => On),
2387
+ meta: {
2388
+ title: "登录",
2389
+ hidden: !0
2390
+ }
2391
+ }
2392
+ ], dt = {
2393
+ path: "/",
2394
+ name: "Layout",
2395
+ component: () => Promise.resolve().then(() => xn),
2396
+ redirect: "/dashboard",
2397
+ children: [
2398
+ {
2399
+ path: "/dashboard",
2400
+ name: "Dashboard",
2401
+ component: () => import("./index-F53NVkhc.js"),
2402
+ meta: {
2403
+ title: "仪表盘",
2404
+ icon: "dashboard",
2405
+ keepAlive: !0,
2406
+ affix: !0
2407
+ }
2408
+ },
2409
+ {
2410
+ path: "/system/user",
2411
+ name: "SystemUser",
2412
+ component: () => import("./index-CgZM1vHq.js"),
2413
+ meta: {
2414
+ title: "用户管理",
2415
+ icon: "user",
2416
+ keepAlive: !0
2417
+ }
2418
+ },
2419
+ {
2420
+ path: "/system/role",
2421
+ name: "SystemRole",
2422
+ component: () => import("./index-DfV_J8Te.js"),
2423
+ meta: {
2424
+ title: "角色管理",
2425
+ icon: "role",
2426
+ keepAlive: !0
2427
+ }
2428
+ },
2429
+ {
2430
+ path: "/system/menu",
2431
+ name: "SystemMenu",
2432
+ component: () => import("./index-BAFpPlnI.js"),
2433
+ meta: {
2434
+ title: "菜单管理",
2435
+ icon: "menu",
2436
+ keepAlive: !0
2437
+ }
2438
+ },
2439
+ // catch-all 路由:让 404 在 Layout 内部渲染,保持左侧菜单显示
2440
+ {
2441
+ path: "/:pathMatch(.*)*",
2442
+ name: "CatchAll",
2443
+ component: () => Promise.resolve().then(() => ut),
2444
+ meta: {
2445
+ title: "404",
2446
+ hidden: !0
2447
+ }
2448
+ }
2449
+ ]
2450
+ }, Sa = [
2451
+ {
2452
+ path: "/dashboard",
2453
+ name: "Dashboard",
2454
+ component: () => import("./index-F53NVkhc.js"),
2455
+ meta: {
2456
+ title: "仪表盘",
2457
+ icon: "dashboard",
2458
+ keepAlive: !0,
2459
+ affix: !0
2460
+ }
2461
+ },
2462
+ {
2463
+ path: "/system",
2464
+ name: "System",
2465
+ redirect: "/system/user",
2466
+ meta: {
2467
+ title: "系统管理",
2468
+ icon: "setting"
2469
+ },
2470
+ children: [
2471
+ {
2472
+ path: "user",
2473
+ name: "SystemUser",
2474
+ component: () => import("./index-CgZM1vHq.js"),
2475
+ meta: {
2476
+ title: "用户管理",
2477
+ icon: "user",
2478
+ keepAlive: !0
2479
+ }
2480
+ },
2481
+ {
2482
+ path: "role",
2483
+ name: "SystemRole",
2484
+ component: () => import("./index-DfV_J8Te.js"),
2485
+ meta: {
2486
+ title: "角色管理",
2487
+ icon: "role",
2488
+ keepAlive: !0
2489
+ }
2490
+ },
2491
+ {
2492
+ path: "menu",
2493
+ name: "SystemMenu",
2494
+ component: () => import("./index-BAFpPlnI.js"),
2495
+ meta: {
2496
+ title: "菜单管理",
2497
+ icon: "menu",
2498
+ keepAlive: !0
2499
+ }
2500
+ }
2501
+ ]
2502
+ }
2503
+ ], Wn = [
2504
+ {
2505
+ menuCode: "dashboard",
2506
+ menuName: "仪表盘",
2507
+ menuUrl: "/dashboard",
2508
+ icon: "dashboard",
2509
+ closable: !0,
2510
+ isDefault: !0,
2511
+ isOut: !1
2512
+ },
2513
+ {
2514
+ menuCode: "system",
2515
+ menuName: "系统管理",
2516
+ menuUrl: "/system",
2517
+ icon: "setting",
2518
+ closable: !1,
2519
+ isDefault: !1,
2520
+ isOut: !1,
2521
+ children: [
2522
+ {
2523
+ menuCode: "system_user",
2524
+ menuName: "用户管理",
2525
+ menuUrl: "/system/user",
2526
+ icon: "user",
2527
+ closable: !0,
2528
+ isDefault: !1,
2529
+ isOut: !1
2530
+ },
2531
+ {
2532
+ menuCode: "system_role",
2533
+ menuName: "角色管理",
2534
+ menuUrl: "/system/role",
2535
+ icon: "role",
2536
+ closable: !0,
2537
+ isDefault: !1,
2538
+ isOut: !1
2539
+ },
2540
+ {
2541
+ menuCode: "system_menu",
2542
+ menuName: "菜单管理",
2543
+ menuUrl: "/system/menu",
2544
+ icon: "menu",
2545
+ closable: !0,
2546
+ isDefault: !1,
2547
+ isOut: !1
2548
+ }
2549
+ ]
2550
+ }
2551
+ ], mt = Fe({
2552
+ history: Be(),
2553
+ routes: [...ct, dt],
2554
+ scrollBehavior: () => ({ left: 0, top: 0 })
2555
+ }), Hn = ["/login"];
2556
+ mt.beforeEach(async (t, o, a) => {
2557
+ const r = ae();
2558
+ if (r.initTheme(), rt())
2559
+ if (t.path === "/login")
2560
+ a({ path: "/" });
2561
+ else {
2562
+ const l = G();
2563
+ l.isLoggedIn || (l.setUserInfo({
2564
+ appId: Je(),
2565
+ userId: "1",
2566
+ userName: "管理员",
2567
+ departmentName: "技术部",
2568
+ email: "admin@example.com",
2569
+ mobilePhone: "13800138000",
2570
+ positionName: "管理员",
2571
+ avatar: ""
2572
+ }), ue().setMenuList(Wn)), t.name && t.meta.keepAlive && r.addCachedView(t.name), a();
2573
+ }
2574
+ else
2575
+ Hn.includes(t.path) ? a() : a("/login");
2576
+ });
2577
+ function Ma() {
2578
+ const t = Fe({
2579
+ history: Be(),
2580
+ routes: [...ct, dt]
2581
+ });
2582
+ mt.matcher = t.matcher;
2583
+ }
2584
+ function Ia(t, o = {}) {
2585
+ const a = o.indexPath || "/dashboard", r = {
2586
+ path: "/:pathMatch(.*)*",
2587
+ name: "CatchAll",
2588
+ component: () => Promise.resolve().then(() => ut),
2589
+ meta: {
2590
+ title: "404"
2591
+ }
2592
+ };
2593
+ return {
2594
+ path: "/",
2595
+ name: "Layout",
2596
+ component: it,
2597
+ redirect: a,
2598
+ children: [...t, r]
2599
+ };
2600
+ }
2601
+ function Ta(t) {
2602
+ return Fe({
2603
+ history: Be(),
2604
+ routes: t,
2605
+ scrollBehavior: () => ({ left: 0, top: 0 })
2606
+ });
2607
+ }
2608
+ function Ea(t) {
2609
+ return O.get("/role/list", { params: t });
2610
+ }
2611
+ function Na(t) {
2612
+ return O.get(`/role/${t}`);
2613
+ }
2614
+ function Ua(t) {
2615
+ return O.post("/role", t);
2616
+ }
2617
+ function Da(t, o) {
2618
+ return O.put(`/role/${t}`, o);
2619
+ }
2620
+ function za(t) {
2621
+ return O.delete(`/role/${t}`);
2622
+ }
2623
+ function Ra(t, o) {
2624
+ return O.patch(`/role/${t}/status`, { status: o });
2625
+ }
2626
+ function Aa() {
2627
+ return O.get("/user/v1.0/menu/list");
2628
+ }
2629
+ function Gn(t) {
2630
+ const o = t || Je();
2631
+ return O.get(`/user/v1.0/menu/get-menu?appId=${o}`);
2632
+ }
2633
+ function Pa(t) {
2634
+ return O.post("/menu", t);
2635
+ }
2636
+ function Oa(t, o) {
2637
+ return O.put(`/menu/${t}`, o);
2638
+ }
2639
+ function Va(t) {
2640
+ return O.delete(`/menu/${t}`);
2641
+ }
2642
+ const Xn = ["/login", "/404", "/403"];
2643
+ function Fa(t, o = {}) {
2644
+ const a = o.whiteList || Xn, r = o.loginPath || "/login", l = o.homePath || "/";
2645
+ t.beforeEach(async (u, $, m) => {
2646
+ const f = ae(), p = G(), _ = ue();
2647
+ if (f.initTheme(), De())
2648
+ if (u.path === r)
2649
+ m({ path: l });
2650
+ else if (p.isLoggedIn)
2651
+ u.name && u.meta.keepAlive && f.addCachedView(u.name), m();
2652
+ else
2653
+ try {
2654
+ if (o.fetchUserInfo) {
2655
+ const w = await o.fetchUserInfo();
2656
+ p.setUserInfo(w);
2657
+ } else {
2658
+ const w = await Un();
2659
+ p.setUserInfo(w);
2660
+ }
2661
+ if (o.fetchMenu) {
2662
+ const w = await o.fetchMenu();
2663
+ _.setMenuList(w);
2664
+ } else {
2665
+ const w = await Gn(o.appId);
2666
+ _.setMenuList(w);
2667
+ }
2668
+ o.onLoginSuccess && o.onLoginSuccess(), u.name && u.meta.keepAlive && f.addCachedView(u.name), m({ ...u, replace: !0 });
2669
+ } catch (w) {
2670
+ console.error("获取用户信息失败:", w), p.clearUserInfo(), _.clearMenu(), localStorage.removeItem("token"), localStorage.removeItem("token_type"), localStorage.removeItem("refresh_token"), m({ path: r, query: { redirect: u.fullPath } });
2671
+ }
2672
+ else
2673
+ a.includes(u.path) ? m() : m({ path: r, query: { redirect: u.fullPath } });
2674
+ }), t.afterEach(() => {
2675
+ });
2676
+ }
2677
+ function Ba(t) {
2678
+ return O.get("/user/list", { params: t });
2679
+ }
2680
+ function Ka(t) {
2681
+ return O.get(`/user/${t}`);
2682
+ }
2683
+ function ja(t) {
2684
+ return O.post("/user", t);
2685
+ }
2686
+ function qa(t, o) {
2687
+ return O.put(`/user/${t}`, o);
2688
+ }
2689
+ function Ya(t) {
2690
+ return O.delete(`/user/${t}`);
2691
+ }
2692
+ function Wa(t) {
2693
+ return O.post("/user/batch-delete", { ids: t });
2694
+ }
2695
+ function Ha(t, o) {
2696
+ return O.patch(`/user/${t}/status`, { status: o });
2697
+ }
2698
+ function Ga(t) {
2699
+ return O.post(`/user/${t}/reset-password`);
2700
+ }
2701
+ var Jn = /* @__PURE__ */ ((t) => (t[t.ENABLED = 1] = "ENABLED", t[t.DISABLED = 0] = "DISABLED", t))(Jn || {}), Qn = /* @__PURE__ */ ((t) => (t[t.UNKNOWN = 0] = "UNKNOWN", t[t.MALE = 1] = "MALE", t[t.FEMALE = 2] = "FEMALE", t))(Qn || {}), Zn = /* @__PURE__ */ ((t) => (t[t.DIRECTORY = 0] = "DIRECTORY", t[t.MENU = 1] = "MENU", t[t.BUTTON = 2] = "BUTTON", t))(Zn || {});
2702
+ const Xa = {
2703
+ 1: "启用",
2704
+ 0: "禁用"
2705
+ }, Ja = {
2706
+ 0: "未知",
2707
+ 1: "男",
2708
+ 2: "女"
2709
+ }, Qa = {
2710
+ 0: "目录",
2711
+ 1: "菜单",
2712
+ 2: "按钮"
2713
+ }, Za = [
2714
+ {
2715
+ label: "启用",
2716
+ value: 1
2717
+ /* ENABLED */
2718
+ },
2719
+ {
2720
+ label: "禁用",
2721
+ value: 0
2722
+ /* DISABLED */
2723
+ }
2724
+ ], el = [
2725
+ {
2726
+ label: "未知",
2727
+ value: 0
2728
+ /* UNKNOWN */
2729
+ },
2730
+ {
2731
+ label: "男",
2732
+ value: 1
2733
+ /* MALE */
2734
+ },
2735
+ {
2736
+ label: "女",
2737
+ value: 2
2738
+ /* FEMALE */
2739
+ }
2740
+ ], tl = [
2741
+ {
2742
+ label: "目录",
2743
+ value: 0
2744
+ /* DIRECTORY */
2745
+ },
2746
+ {
2747
+ label: "菜单",
2748
+ value: 1
2749
+ /* MENU */
2750
+ },
2751
+ {
2752
+ label: "按钮",
2753
+ value: 2
2754
+ /* BUTTON */
2755
+ }
2756
+ ], sl = {
2757
+ mounted(t, o) {
2758
+ var r;
2759
+ G().isLoggedIn || (r = t.parentNode) == null || r.removeChild(t);
2760
+ }
2761
+ };
2762
+ export {
2763
+ dt as $,
2764
+ Aa as A,
2765
+ Gn as B,
2766
+ ca as C,
2767
+ ua as D,
2768
+ Na as E,
2769
+ pa as F,
2770
+ Qn as G,
2771
+ zs as H,
2772
+ Ea as I,
2773
+ De as J,
2774
+ Lt as K,
2775
+ it as L,
2776
+ Zn as M,
2777
+ xt as N,
2778
+ Ka as O,
2779
+ Un as P,
2780
+ Ba as Q,
2781
+ Ca as R,
2782
+ Jn as S,
2783
+ ma as T,
2784
+ $a as U,
2785
+ rt as V,
2786
+ O as W,
2787
+ ha as X,
2788
+ La as Y,
2789
+ Tt as Z,
2790
+ Q as _,
2791
+ Za as a,
2792
+ b as a0,
2793
+ Ce as a1,
2794
+ Nn as a2,
2795
+ va as a3,
2796
+ Wn as a4,
2797
+ sl as a5,
2798
+ _a as a6,
2799
+ Ga as a7,
2800
+ Ma as a8,
2801
+ mt as a9,
2802
+ ia as aa,
2803
+ $e as ab,
2804
+ It as ac,
2805
+ Mt as ad,
2806
+ $t as ae,
2807
+ bt as af,
2808
+ St as ag,
2809
+ at as ah,
2810
+ Ct as ai,
2811
+ Fa as aj,
2812
+ ct as ak,
2813
+ Oa as al,
2814
+ Da as am,
2815
+ Ra as an,
2816
+ qa as ao,
2817
+ Ha as ap,
2818
+ ka as aq,
2819
+ ae as ar,
2820
+ wa as as,
2821
+ be as at,
2822
+ ba as au,
2823
+ ue as av,
2824
+ xa as aw,
2825
+ G as ax,
2826
+ tl as b,
2827
+ ya as c,
2828
+ el as d,
2829
+ Ja as e,
2830
+ Qa as f,
2831
+ Kn as g,
2832
+ et as h,
2833
+ Pn as i,
2834
+ Xa as j,
2835
+ ga as k,
2836
+ Wa as l,
2837
+ lt as m,
2838
+ Ia as n,
2839
+ Pa as o,
2840
+ Ua as p,
2841
+ Ta as q,
2842
+ ja as r,
2843
+ Sa as s,
2844
+ Va as t,
2845
+ za as u,
2846
+ Ya as v,
2847
+ fa as w,
2848
+ Je as x,
2849
+ Dn as y,
2850
+ da as z
2851
+ };