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