xto-fronted 0.4.86 → 0.4.88

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