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