xto-fronted 0.4.86 → 0.4.87

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