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