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