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