xto-fronted 0.4.84 → 0.4.86

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