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