xto-fronted 0.4.84 → 0.4.86

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