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,2853 @@
1
+ import { ref as k, computed as b, watch as Se, defineComponent as Q, openBlock as c, 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 Le, 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 Fe } from "vue-router";
3
+ import { defineStore as Ne } from "pinia";
4
+ import { Menu as Be, SubMenu as tt, MenuItem as we, Tabs as ht, TabPane as _t } from "@xto/navigation";
5
+ import { Icon as T, 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
+ }, Yn = {
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"), l = k(w.get("layout") || "sidebar"), d = k(w.get("isCollapsed") || !1), $ = k(w.get("showTabs") ?? !0), _ = k(w.get("showFooter") ?? !0), f = k(w.get("showBreadcrumb") ?? !0), v = k(w.get("primaryColor") || "#409eff"), m = k([]), r = k(w.get("activeTopMenuPath") || ""), p = b(() => o.value ? "dark" : "light"), U = (M) => {
47
+ t.value = M, w.set("appName", M);
48
+ }, L = (M) => {
49
+ n.value = M, w.set("indexPath", M);
50
+ }, D = () => {
51
+ o.value = !o.value, i.value = o.value ? "dark" : "light", z();
52
+ }, R = (M) => {
53
+ i.value = M, o.value = M === "dark", z();
54
+ }, z = () => {
55
+ const M = document.documentElement;
56
+ o.value ? M.classList.add("dark") : M.classList.remove("dark"), w.set("isDark", o.value), w.set("theme", i.value);
57
+ }, F = () => {
58
+ d.value = !d.value, w.set("isCollapsed", d.value);
59
+ }, q = (M) => {
60
+ l.value = M, w.set("layout", M), M !== "mix" && (r.value = "", w.remove("activeTopMenuPath"));
61
+ }, E = (M) => {
62
+ r.value = M, w.set("activeTopMenuPath", M);
63
+ }, Y = () => {
64
+ $.value = !$.value, w.set("showTabs", $.value);
65
+ }, N = () => {
66
+ _.value = !_.value, w.set("showFooter", _.value);
67
+ }, B = () => {
68
+ f.value = !f.value, w.set("showBreadcrumb", f.value);
69
+ }, oe = (M) => {
70
+ v.value = M, document.documentElement.style.setProperty("--color-primary", M), w.set("primaryColor", M);
71
+ }, J = (M) => {
72
+ m.value.includes(M) || m.value.push(M);
73
+ }, ne = (M) => {
74
+ const Z = m.value.indexOf(M);
75
+ Z > -1 && m.value.splice(Z, 1);
76
+ }, ae = () => {
77
+ m.value = [];
78
+ }, le = () => {
79
+ z(), v.value !== "#409eff" && document.documentElement.style.setProperty("--color-primary", v.value);
80
+ };
81
+ return Se(o, z), {
82
+ appName: t,
83
+ indexPath: n,
84
+ isDark: o,
85
+ theme: i,
86
+ layout: l,
87
+ isCollapsed: d,
88
+ showTabs: $,
89
+ showFooter: _,
90
+ showBreadcrumb: f,
91
+ primaryColor: v,
92
+ cachedViews: m,
93
+ activeTopMenuPath: r,
94
+ themeClass: p,
95
+ setAppName: U,
96
+ setIndexPath: L,
97
+ toggleTheme: D,
98
+ toggleCollapse: F,
99
+ setTheme: R,
100
+ setLayout: q,
101
+ setActiveTopMenuPath: E,
102
+ toggleTabs: Y,
103
+ toggleFooter: N,
104
+ toggleBreadcrumb: B,
105
+ setPrimaryColor: oe,
106
+ addCachedView: J,
107
+ removeCachedView: ne,
108
+ clearCachedViews: ae,
109
+ initTheme: le
110
+ };
111
+ }), De = "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(De) || []), n = b(() => t.value.length > 0);
121
+ return {
122
+ menuList: t,
123
+ hasMenu: n,
124
+ setMenuList: (l) => {
125
+ t.value = [kt, ...l], w.set(De, t.value);
126
+ },
127
+ clearMenu: () => {
128
+ t.value = [], w.remove(De);
129
+ }
130
+ };
131
+ }), ot = "/vite.svg", ze = "user_info", H = Ne("user", () => {
132
+ const t = k(w.get(ze)), n = b(() => !!t.value), o = b(() => {
133
+ var r;
134
+ return ((r = t.value) == null ? void 0 : r.userId) || "";
135
+ }), i = b(() => {
136
+ var r;
137
+ return ((r = t.value) == null ? void 0 : r.userName) || "";
138
+ }), l = b(() => {
139
+ var r;
140
+ return ((r = t.value) == null ? void 0 : r.departmentName) || "";
141
+ }), d = b(() => {
142
+ var r;
143
+ return ((r = t.value) == null ? void 0 : r.email) || "";
144
+ }), $ = b(() => {
145
+ var r;
146
+ return ((r = t.value) == null ? void 0 : r.mobilePhone) || "";
147
+ }), _ = b(() => {
148
+ var r;
149
+ return ((r = t.value) == null ? void 0 : r.positionName) || "";
150
+ }), f = b(() => {
151
+ var r;
152
+ return ((r = t.value) == null ? void 0 : r.avatar) || "";
153
+ });
154
+ return {
155
+ userInfo: t,
156
+ isLoggedIn: n,
157
+ userId: o,
158
+ userName: i,
159
+ departmentName: l,
160
+ email: d,
161
+ mobilePhone: $,
162
+ positionName: _,
163
+ avatar: f,
164
+ setUserInfo: (r) => {
165
+ t.value = r, w.set(ze, r);
166
+ },
167
+ clearUserInfo: () => {
168
+ t.value = null, w.remove(ze);
169
+ }
170
+ };
171
+ }), je = "token", qe = "token_type", We = "refresh_token", Ye = "expires_time", Je = "refresh_time", He = "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
+ }, Jn = () => w.get(We), Ct = (t) => {
176
+ w.set(We, t);
177
+ }, $t = () => w.get(Ye), St = (t) => {
178
+ w.set(Ye, t);
179
+ }, Hn = () => w.get(Je), Lt = (t) => {
180
+ w.set(Je, t);
181
+ }, Gn = () => w.get(He), Mt = (t) => {
182
+ w.set(He, t);
183
+ }, nt = (t) => {
184
+ wt(t.access_token), xt(t.token_type || "Bearer"), Ct(t.refresh_token), St(t.expires_time), Lt(t.refresh_time), t.code && Mt(t.code);
185
+ }, at = () => {
186
+ w.remove(je), w.remove(qe), w.remove(We), w.remove(Ye), w.remove(Je), w.remove(He);
187
+ }, Tt = () => {
188
+ const t = $t();
189
+ return t ? Date.now() > t : !0;
190
+ }, lt = () => !!Pe() && !Tt(), be = Ne("auth", () => {
191
+ const t = k(Pe()), n = b(() => lt()), o = k(""), i = k(""), l = k(""), d = k("/login");
192
+ return {
193
+ token: t,
194
+ isLoggedIn: n,
195
+ baseUrl: o,
196
+ appId: i,
197
+ clientId: l,
198
+ loginPath: d,
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
+ l.value = p;
213
+ },
214
+ setLoginPath: (p) => {
215
+ d.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
+ }, Dt = { class: "sidebar__menu-icon" }, zt = {
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" }, Ft = /* @__PURE__ */ Q({
231
+ __name: "Sidebar",
232
+ props: {
233
+ menuList: { default: () => [] }
234
+ },
235
+ setup(t) {
236
+ const n = t, o = ue(), i = te(), l = ce(), d = H(), $ = be(), _ = se(), f = b(() => n.menuList.length > 0 ? n.menuList : l.menuList), v = b(() => _.isCollapsed), m = b(() => o.path), r = b(() => _.isDark ? "#1d1e1f" : "#fff"), p = b(() => _.isDark ? "#cfd3dc" : "#303133"), U = b(() => "#409eff"), L = (E) => {
237
+ E && E !== o.path && i.push(E);
238
+ }, D = () => {
239
+ $.logout(), d.clearUserInfo(), l.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
+ ]), z = (E) => {
343
+ if (!E || E === "") return "";
344
+ if (E.startsWith("tineco-icon-")) {
345
+ const N = E.replace("tineco-icon-", "");
346
+ return {
347
+ home: "home",
348
+ dashboard: "dashboard",
349
+ system: "system",
350
+ user: "user",
351
+ role: "role",
352
+ menu: "list",
353
+ setting: "setting",
354
+ file: "file",
355
+ folder: "folder",
356
+ chart: "chart",
357
+ report: "report",
358
+ analytics: "analytics"
359
+ }[N] || N;
360
+ }
361
+ return {
362
+ dashboard: "dashboard",
363
+ system: "system",
364
+ user: "user",
365
+ role: "role",
366
+ menu: "list",
367
+ setting: "setting",
368
+ home: "home",
369
+ chart: "chart",
370
+ report: "report",
371
+ analytics: "analytics",
372
+ permission: "permission",
373
+ log: "log",
374
+ notification: "notification",
375
+ app: "app",
376
+ list: "list",
377
+ grid: "grid"
378
+ }[E] || E;
379
+ }, F = (E) => E ? E.charAt(0) : "", q = (E) => R.has(E);
380
+ return (E, Y) => (c(), h("div", {
381
+ class: 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(Be), {
394
+ "default-active": m.value,
395
+ mode: "vertical",
396
+ collapse: v.value,
397
+ "collapse-transition": !1,
398
+ "background-color": r.value,
399
+ "text-color": p.value,
400
+ "active-text-color": U.value,
401
+ class: "sidebar__menu",
402
+ onSelect: L
403
+ }, {
404
+ default: I(() => [
405
+ (c(!0), h(A, null, W(f.value, (N) => (c(), h(A, {
406
+ key: N.menuUrl
407
+ }, [
408
+ N.children && N.children.length > 0 ? (c(), V(a(tt), {
409
+ key: 0,
410
+ index: N.menuUrl
411
+ }, {
412
+ title: I(() => [
413
+ e("span", Et, [
414
+ q(z(N.icon)) ? (c(), V(a(T), {
415
+ key: 0,
416
+ name: z(N.icon),
417
+ size: 16
418
+ }, null, 8, ["name"])) : (c(), h("span", Nt, x(F(N.menuName)), 1))
419
+ ]),
420
+ e("span", null, x(N.menuName), 1)
421
+ ]),
422
+ default: I(() => [
423
+ (c(!0), h(A, null, W(N.children, (B) => (c(), V(a(we), {
424
+ key: B.menuUrl,
425
+ index: B.menuUrl
426
+ }, {
427
+ default: I(() => [
428
+ e("span", Ut, [
429
+ q(z(B.icon)) ? (c(), V(a(T), {
430
+ key: 0,
431
+ name: z(B.icon),
432
+ size: 16
433
+ }, null, 8, ["name"])) : (c(), h("span", Pt, x(F(B.menuName)), 1))
434
+ ]),
435
+ e("span", null, x(B.menuName), 1)
436
+ ]),
437
+ _: 2
438
+ }, 1032, ["index"]))), 128))
439
+ ]),
440
+ _: 2
441
+ }, 1032, ["index"])) : (c(), V(a(we), {
442
+ key: 1,
443
+ index: N.menuUrl
444
+ }, {
445
+ default: I(() => [
446
+ e("span", Dt, [
447
+ q(z(N.icon)) ? (c(), V(a(T), {
448
+ key: 0,
449
+ name: z(N.icon),
450
+ size: 16
451
+ }, null, 8, ["name"])) : (c(), h("span", zt, x(F(N.menuName)), 1))
452
+ ]),
453
+ e("span", null, x(N.menuName), 1)
454
+ ]),
455
+ _: 2
456
+ }, 1032, ["index"]))
457
+ ], 64))), 128))
458
+ ]),
459
+ _: 1
460
+ }, 8, ["default-active", "collapse", "background-color", "text-color", "active-text-color"]),
461
+ v.value ? j("", !0) : (c(), h("div", Rt, [
462
+ e("div", Ot, [
463
+ e("span", At, x(a(d).userName), 1),
464
+ e("span", Vt, x(a(d).departmentName), 1)
465
+ ]),
466
+ y(a(Ue), {
467
+ type: "text",
468
+ size: "small",
469
+ onClick: D
470
+ }, {
471
+ default: I(() => [...Y[1] || (Y[1] = [
472
+ ve("退出", -1)
473
+ ])]),
474
+ _: 1
475
+ })
476
+ ]))
477
+ ], 2));
478
+ }
479
+ }), G = (t, n) => {
480
+ const o = t.__vccOpts || t;
481
+ for (const [i, l] of n)
482
+ o[i] = l;
483
+ return o;
484
+ }, Qe = /* @__PURE__ */ G(Ft, [["__scopeId", "data-v-480fc818"]]), Bt = { class: "header" }, Kt = { class: "header__left" }, jt = {
485
+ key: 0,
486
+ class: "header__breadcrumb"
487
+ }, qt = {
488
+ key: 0,
489
+ class: "breadcrumb-separator"
490
+ }, Wt = { class: "header__right" }, Yt = ["title"], Jt = { class: "header__avatar" }, Ht = { class: "header__user-name" }, Gt = {
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" }, Ss = { class: "settings-switch-item" }, Ls = /* @__PURE__ */ Q({
512
+ __name: "Header",
513
+ setup(t) {
514
+ const n = ue(), o = te(), i = se(), l = H(), d = be(), $ = ce(), _ = k(!1), f = k(!1), v = k(null), m = k(!1), r = k(!1), p = k(""), U = k(null), L = k(!1), D = [
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
+ ], z = b(() => n.matched.filter((s) => s.meta && s.meta.title).map((s) => ({
526
+ title: s.meta.title,
527
+ path: s.path
528
+ }))), F = (C, s = "") => {
529
+ const K = [];
530
+ return C.forEach((S) => {
531
+ S.children && S.children.length > 0 ? K.push(...F(S.children, S.title)) : K.push({ ...S, parentTitle: s });
532
+ }), K;
533
+ }, q = b(() => p.value.trim() ? F($.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
+ }, B = () => {
540
+ f.value = !0;
541
+ }, oe = (C) => {
542
+ i.setLayout(C), f.value = !1;
543
+ }, J = (C) => {
544
+ L.value = C;
545
+ const s = document.documentElement;
546
+ C ? s.classList.add("grey-mode") : s.classList.remove("grey-mode");
547
+ }, ne = () => {
548
+ J(!L.value), f.value = !1;
549
+ }, ae = () => {
550
+ i.toggleTheme(), f.value = !1;
551
+ }, le = () => {
552
+ document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
553
+ }, M = () => {
554
+ m.value = !!document.fullscreenElement;
555
+ }, Z = () => {
556
+ _.value = !_.value;
557
+ }, X = () => {
558
+ _.value = !1;
559
+ }, de = () => {
560
+ r.value = !0;
561
+ }, re = () => {
562
+ r.value = !1, p.value = "";
563
+ }, me = (C) => {
564
+ o.push(C), re();
565
+ }, he = (C) => {
566
+ i.setPrimaryColor(C), f.value = !1;
567
+ }, _e = () => {
568
+ X(), o.push("/profile");
569
+ }, fe = () => {
570
+ X(), o.push("/change-password");
571
+ }, ie = () => {
572
+ X(), d.logout(), l.clearUserInfo(), $.clearMenu(), o.push("/login");
573
+ }, g = (C) => {
574
+ v.value && !v.value.contains(C.target) && X(), U.value && !U.value.contains(C.target) && re();
575
+ }, u = (C) => {
576
+ C.key === "Escape" && (re(), X()), (C.ctrlKey || C.metaKey) && C.key === "k" && (C.preventDefault(), de());
577
+ };
578
+ return Re(() => {
579
+ document.addEventListener("click", g), document.addEventListener("fullscreenchange", M), document.addEventListener("keydown", u), i.initTheme(), L.value = document.documentElement.classList.contains("grey-mode");
580
+ }), Oe(() => {
581
+ document.removeEventListener("click", g), document.removeEventListener("fullscreenchange", M), document.removeEventListener("keydown", u);
582
+ }), (C, s) => {
583
+ var K;
584
+ return c(), h("div", Bt, [
585
+ e("div", Kt, [
586
+ e("div", {
587
+ class: "header__collapse",
588
+ onClick: Y
589
+ }, [
590
+ y(a(T), {
591
+ name: a(i).isCollapsed ? "menu-unfold" : "menu-fold",
592
+ size: 18
593
+ }, null, 8, ["name"])
594
+ ]),
595
+ a(i).showBreadcrumb ? (c(), h("div", jt, [
596
+ (c(!0), h(A, null, W(z.value, (S, pe) => (c(), h("span", {
597
+ key: S.path
598
+ }, [
599
+ pe > 0 ? (c(), h("span", qt, "/")) : j("", !0),
600
+ e("span", {
601
+ class: O({ "is-current": pe === z.value.length - 1 })
602
+ }, x(S.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(T), {
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(T), {
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: B,
630
+ title: "换肤设置"
631
+ }, [
632
+ y(a(T), {
633
+ name: "skin",
634
+ size: 16
635
+ })
636
+ ]),
637
+ e("div", {
638
+ class: "header__action",
639
+ onClick: N,
640
+ title: "切换主题"
641
+ }, [
642
+ y(a(T), {
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(l).userName) == null ? void 0 : K.charAt(0)) || "U"), 1)
658
+ ]),
659
+ e("span", Ht, x(a(l).userName), 1),
660
+ e("span", {
661
+ class: O(["header__user-arrow", { "is-active": _.value }])
662
+ }, "▼", 2)
663
+ ]),
664
+ y(Le, { name: "dropdown" }, {
665
+ default: I(() => {
666
+ var S;
667
+ return [
668
+ _.value ? (c(), h("div", Gt, [
669
+ e("div", Xt, [
670
+ e("div", Qt, [
671
+ e("span", null, x(((S = a(l).userName) == null ? void 0 : S.charAt(0)) || "U"), 1)
672
+ ]),
673
+ e("div", Zt, [
674
+ e("div", es, x(a(l).userName), 1),
675
+ e("div", ts, x(a(l).departmentName), 1)
676
+ ])
677
+ ]),
678
+ s[7] || (s[7] = e("div", { class: "header__dropdown-divider" }, null, -1)),
679
+ e("div", ss, [
680
+ e("div", {
681
+ class: "header__dropdown-item",
682
+ onClick: _e
683
+ }, [
684
+ y(a(T), {
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(T), {
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(T), {
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(Le, { name: "search" }, {
720
+ default: I(() => [
721
+ r.value ? (c(), 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(T), {
730
+ class: "search-icon",
731
+ name: "search",
732
+ size: 20
733
+ }),
734
+ Ze(e("input", {
735
+ "onUpdate:modelValue": s[0] || (s[0] = (S) => p.value = S),
736
+ type: "text",
737
+ class: "search-input",
738
+ placeholder: "搜索菜单...",
739
+ autofocus: "",
740
+ onKeyup: s[1] || (s[1] = et((S) => 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 ? (c(), h("div", as, [
747
+ (c(!0), h(A, null, W(q.value, (S, pe) => (c(), h("div", {
748
+ key: S.path,
749
+ class: O(["search-result-item", { "is-first": pe === 0 }]),
750
+ onClick: (On) => me(S.path)
751
+ }, [
752
+ y(a(T), {
753
+ class: "search-result-icon",
754
+ name: S.icon || "file",
755
+ size: 20
756
+ }, null, 8, ["name"]),
757
+ e("div", rs, [
758
+ e("span", is, x(S.title), 1),
759
+ S.parentTitle ? (c(), h("span", us, x(S.parentTitle), 1)) : j("", !0)
760
+ ])
761
+ ], 10, ls))), 128))
762
+ ])) : p.value ? (c(), 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] = (S) => f.value = S),
771
+ title: "换肤设置",
772
+ direction: "rtl",
773
+ size: "320px"
774
+ }, {
775
+ default: I(() => [
776
+ e("div", ds, [
777
+ e("div", ms, [
778
+ s[12] || (s[12] = e("div", { class: "settings-title" }, "布局模式", -1)),
779
+ e("div", ps, [
780
+ (c(), h(A, null, W(D, (S) => e("div", {
781
+ key: S.value,
782
+ class: O(["layout-option", { "is-active": E.value === S.value }]),
783
+ onClick: (pe) => oe(S.value)
784
+ }, [
785
+ e("div", hs, [
786
+ S.value === "sidebar" ? (c(), h("div", _s, [...s[9] || (s[9] = [
787
+ e("div", { class: "preview-aside" }, null, -1),
788
+ e("div", { class: "preview-main" }, [
789
+ e("div", { class: "preview-header" }),
790
+ e("div", { class: "preview-content" })
791
+ ], -1)
792
+ ])])) : S.value === "top" ? (c(), h("div", fs, [...s[10] || (s[10] = [
793
+ e("div", { class: "preview-header-full" }, null, -1),
794
+ e("div", { class: "preview-content-full" }, null, -1)
795
+ ])])) : (c(), h("div", gs, [...s[11] || (s[11] = [
796
+ e("div", { class: "preview-header-mix" }, [
797
+ e("div", { class: "preview-mix-left" })
798
+ ], -1),
799
+ e("div", { class: "preview-mix-body" }, [
800
+ e("div", { class: "preview-mix-aside" }),
801
+ e("div", { class: "preview-mix-content" })
802
+ ], -1)
803
+ ])]))
804
+ ]),
805
+ e("span", ys, x(S.label), 1)
806
+ ], 10, vs)), 64))
807
+ ])
808
+ ]),
809
+ e("div", ks, [
810
+ s[13] || (s[13] = e("div", { class: "settings-title" }, "主题色", -1)),
811
+ e("div", ws, [
812
+ (c(), h(A, null, W(R, (S) => e("div", {
813
+ key: S.value,
814
+ class: O(["color-option", { "is-active": a(i).primaryColor === S.value }]),
815
+ style: ke({ backgroundColor: S.value }),
816
+ title: S.label,
817
+ onClick: (pe) => he(S.value)
818
+ }, [
819
+ a(i).primaryColor === S.value ? (c(), V(a(T), {
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": L.value }]),
835
+ onClick: ne
836
+ }, [...s[14] || (s[14] = [
837
+ e("span", { class: "switch-core" }, null, -1)
838
+ ])], 2)
839
+ ]),
840
+ e("div", Ss, [
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
+ }), Ms = /* @__PURE__ */ G(Ls, [["__scopeId", "data-v-702ab2d7"]]), Ts = { class: "top-menu" }, Is = { class: "top-menu__menu-icon" }, Es = {
859
+ key: 1,
860
+ class: "top-menu__menu-char"
861
+ }, Ns = { class: "top-menu__menu-icon" }, Us = {
862
+ key: 1,
863
+ class: "top-menu__menu-char"
864
+ }, Ps = { class: "top-menu__menu-icon" }, Ds = {
865
+ key: 1,
866
+ class: "top-menu__menu-char"
867
+ }, zs = { class: "top-menu__actions" }, Rs = ["title"], Os = { class: "top-menu__avatar" }, As = { class: "top-menu__user-name" }, Vs = {
868
+ key: 0,
869
+ class: "top-menu__dropdown"
870
+ }, Fs = { class: "top-menu__dropdown-header" }, Bs = { class: "top-menu__dropdown-avatar" }, Ks = { class: "top-menu__dropdown-info" }, js = { class: "top-menu__dropdown-name" }, qs = { class: "top-menu__dropdown-role" }, Ws = { class: "top-menu__dropdown-menu" }, Ys = { class: "settings-drawer" }, Js = { class: "settings-section" }, Hs = { class: "settings-layout-options" }, Gs = ["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(), l = se(), d = H(), $ = be(), _ = b(() => n.path), f = b(() => l.isDark ? "#1d1e1f" : "#fff"), v = b(() => l.isDark ? "#cfd3dc" : "#303133"), m = b(() => "#409eff"), r = k(!1), p = k(null), U = k(!1), L = k(!1), D = k(!1), R = (g) => {
883
+ g && g !== n.path && o.push(g);
884
+ }, z = /* @__PURE__ */ new Set([
885
+ "arrow-up",
886
+ "arrow-down",
887
+ "arrow-left",
888
+ "arrow-right",
889
+ "caret-down",
890
+ "caret-right",
891
+ "plus",
892
+ "minus",
893
+ "close",
894
+ "check",
895
+ "edit",
896
+ "delete",
897
+ "copy",
898
+ "download",
899
+ "upload",
900
+ "refresh",
901
+ "search",
902
+ "filter",
903
+ "more",
904
+ "setting",
905
+ "share",
906
+ "loading",
907
+ "info",
908
+ "success",
909
+ "warning",
910
+ "error",
911
+ "question",
912
+ "user",
913
+ "user-add",
914
+ "user-group",
915
+ "logout",
916
+ "login",
917
+ "file",
918
+ "folder",
919
+ "folder-open",
920
+ "document",
921
+ "image",
922
+ "video",
923
+ "music",
924
+ "camera",
925
+ "mail",
926
+ "phone",
927
+ "chat",
928
+ "bell",
929
+ "message",
930
+ "eye",
931
+ "eye-off",
932
+ "calendar",
933
+ "clock",
934
+ "history",
935
+ "timer",
936
+ "location",
937
+ "map",
938
+ "globe",
939
+ "star",
940
+ "heart",
941
+ "thumb-up",
942
+ "link",
943
+ "external-link",
944
+ "lock",
945
+ "unlock",
946
+ "key",
947
+ "home",
948
+ "menu",
949
+ "menu-fold",
950
+ "menu-unfold",
951
+ "sidebar-fold",
952
+ "sidebar-expand",
953
+ "sidebar-left",
954
+ "dashboard",
955
+ "chart",
956
+ "chart-pie",
957
+ "chart-line",
958
+ "report",
959
+ "analytics",
960
+ "system",
961
+ "permission",
962
+ "role",
963
+ "user-manage",
964
+ "log",
965
+ "notification",
966
+ "app",
967
+ "list",
968
+ "grid",
969
+ "fullscreen",
970
+ "fullscreen-exit",
971
+ "zoom-in",
972
+ "zoom-out",
973
+ "print",
974
+ "bookmark",
975
+ "tag",
976
+ "code",
977
+ "terminal",
978
+ "database",
979
+ "server",
980
+ "cloud",
981
+ "gift",
982
+ "moon",
983
+ "sun",
984
+ "theme",
985
+ "skin"
986
+ ]), F = (g) => {
987
+ if (!g || g === "") return "";
988
+ if (g.startsWith("tineco-icon-")) {
989
+ const C = 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
+ }[C] || C;
1004
+ }
1005
+ return {
1006
+ dashboard: "dashboard",
1007
+ system: "system",
1008
+ user: "user",
1009
+ role: "role",
1010
+ menu: "list",
1011
+ setting: "setting",
1012
+ home: "home",
1013
+ chart: "chart",
1014
+ report: "report",
1015
+ analytics: "analytics",
1016
+ permission: "permission",
1017
+ log: "log",
1018
+ notification: "notification",
1019
+ app: "app",
1020
+ list: "list",
1021
+ grid: "grid"
1022
+ }[g] || g;
1023
+ }, q = (g) => g ? g.charAt(0) : "", E = (g) => z.has(g), Y = () => {
1024
+ l.toggleTheme(), L.value = !1;
1025
+ }, N = () => {
1026
+ document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
1027
+ }, B = () => {
1028
+ U.value = !!document.fullscreenElement;
1029
+ }, oe = () => {
1030
+ r.value = !r.value;
1031
+ }, J = () => {
1032
+ r.value = !1;
1033
+ }, ne = () => {
1034
+ L.value = !0;
1035
+ }, ae = (g) => {
1036
+ D.value = g;
1037
+ const u = document.documentElement;
1038
+ g ? u.classList.add("grey-mode") : u.classList.remove("grey-mode");
1039
+ }, le = () => {
1040
+ ae(!D.value), L.value = !1;
1041
+ }, M = () => {
1042
+ l.toggleTheme(), L.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(() => l.layout), de = (g) => {
1048
+ l.setLayout(g), L.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
+ l.setPrimaryColor(g), L.value = !1;
1058
+ }, he = () => {
1059
+ J(), o.push("/profile");
1060
+ }, _e = () => {
1061
+ J(), o.push("/change-password");
1062
+ }, fe = () => {
1063
+ J(), $.logout(), d.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", B), D.value = document.documentElement.classList.contains("grey-mode");
1069
+ }), Oe(() => {
1070
+ document.removeEventListener("click", ie), document.removeEventListener("fullscreenchange", B);
1071
+ }), (g, u) => {
1072
+ var C;
1073
+ return c(), h("div", Ts, [
1074
+ y(a(Be), {
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
+ (c(!0), h(A, null, W(a(i).menuList, (s) => (c(), h(A, {
1085
+ key: s.menuUrl
1086
+ }, [
1087
+ s.children && s.children.length > 0 ? (c(), V(a(tt), {
1088
+ key: 0,
1089
+ index: s.menuUrl
1090
+ }, {
1091
+ title: I(() => [
1092
+ e("span", Is, [
1093
+ E(F(s.icon)) ? (c(), V(a(T), {
1094
+ key: 0,
1095
+ name: F(s.icon),
1096
+ size: 16
1097
+ }, null, 8, ["name"])) : (c(), h("span", Es, x(q(s.menuName)), 1))
1098
+ ]),
1099
+ e("span", null, x(s.menuName), 1)
1100
+ ]),
1101
+ default: I(() => [
1102
+ (c(!0), h(A, null, W(s.children, (K) => (c(), V(a(we), {
1103
+ key: K.menuUrl,
1104
+ index: K.menuUrl
1105
+ }, {
1106
+ default: I(() => [
1107
+ e("span", Ns, [
1108
+ E(F(K.icon)) ? (c(), V(a(T), {
1109
+ key: 0,
1110
+ name: F(K.icon),
1111
+ size: 16
1112
+ }, null, 8, ["name"])) : (c(), h("span", Us, x(q(K.menuName)), 1))
1113
+ ]),
1114
+ e("span", null, x(K.menuName), 1)
1115
+ ]),
1116
+ _: 2
1117
+ }, 1032, ["index"]))), 128))
1118
+ ]),
1119
+ _: 2
1120
+ }, 1032, ["index"])) : (c(), V(a(we), {
1121
+ key: 1,
1122
+ index: s.menuUrl
1123
+ }, {
1124
+ default: I(() => [
1125
+ e("span", Ps, [
1126
+ E(F(s.icon)) ? (c(), V(a(T), {
1127
+ key: 0,
1128
+ name: F(s.icon),
1129
+ size: 16
1130
+ }, null, 8, ["name"])) : (c(), h("span", Ds, x(q(s.menuName)), 1))
1131
+ ]),
1132
+ e("span", null, x(s.menuName), 1)
1133
+ ]),
1134
+ _: 2
1135
+ }, 1032, ["index"]))
1136
+ ], 64))), 128))
1137
+ ]),
1138
+ _: 1
1139
+ }, 8, ["default-active", "background-color", "text-color", "active-text-color"]),
1140
+ e("div", zs, [
1141
+ e("div", {
1142
+ class: "top-menu__action",
1143
+ onClick: N,
1144
+ title: U.value ? "退出全屏" : "全屏"
1145
+ }, [
1146
+ y(a(T), {
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(T), {
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(T), {
1167
+ name: a(l).isDark ? "sun" : "moon",
1168
+ size: 16
1169
+ }, null, 8, ["name"])
1170
+ ]),
1171
+ e("div", {
1172
+ class: "top-menu__user",
1173
+ ref_key: "dropdownRef",
1174
+ ref: 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(((C = a(d).userName) == null ? void 0 : C.charAt(0)) || "U"), 1)
1182
+ ]),
1183
+ e("span", As, x(a(d).userName), 1),
1184
+ e("span", {
1185
+ class: O(["top-menu__user-arrow", { "is-active": r.value }])
1186
+ }, "▼", 2)
1187
+ ]),
1188
+ y(Le, { name: "dropdown" }, {
1189
+ default: I(() => {
1190
+ var s;
1191
+ return [
1192
+ r.value ? (c(), h("div", Vs, [
1193
+ e("div", Fs, [
1194
+ e("div", Bs, [
1195
+ e("span", null, x(((s = a(d).userName) == null ? void 0 : s.charAt(0)) || "U"), 1)
1196
+ ]),
1197
+ e("div", Ks, [
1198
+ e("div", js, x(a(d).userName), 1),
1199
+ e("div", qs, x(a(d).departmentName), 1)
1200
+ ])
1201
+ ]),
1202
+ u[5] || (u[5] = e("div", { class: "top-menu__dropdown-divider" }, null, -1)),
1203
+ e("div", Ws, [
1204
+ e("div", {
1205
+ class: "top-menu__dropdown-item",
1206
+ onClick: he
1207
+ }, [
1208
+ y(a(T), {
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(T), {
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(T), {
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: L.value,
1245
+ "onUpdate:modelValue": u[0] || (u[0] = (s) => L.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", Hs, [
1255
+ (c(), 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" ? (c(), h("div", Qs, [...u[6] || (u[6] = [
1262
+ e("div", { class: "preview-aside" }, null, -1),
1263
+ e("div", { class: "preview-main" }, [
1264
+ e("div", { class: "preview-header" }),
1265
+ e("div", { class: "preview-content" })
1266
+ ], -1)
1267
+ ])])) : s.value === "top" ? (c(), h("div", Zs, [...u[7] || (u[7] = [
1268
+ e("div", { class: "preview-header-full" }, null, -1),
1269
+ e("div", { class: "preview-content-full" }, null, -1)
1270
+ ])])) : (c(), h("div", eo, [...u[8] || (u[8] = [
1271
+ e("div", { class: "preview-header-mix" }, [
1272
+ e("div", { class: "preview-mix-left" })
1273
+ ], -1),
1274
+ e("div", { class: "preview-mix-body" }, [
1275
+ e("div", { class: "preview-mix-aside" }),
1276
+ e("div", { class: "preview-mix-content" })
1277
+ ], -1)
1278
+ ])]))
1279
+ ]),
1280
+ e("span", to, x(s.label), 1)
1281
+ ], 10, Gs)), 64))
1282
+ ])
1283
+ ]),
1284
+ e("div", so, [
1285
+ u[10] || (u[10] = e("div", { class: "settings-title" }, "主题色", -1)),
1286
+ e("div", oo, [
1287
+ (c(), h(A, null, W(re, (s) => e("div", {
1288
+ key: s.value,
1289
+ class: O(["color-option", { "is-active": a(l).primaryColor === s.value }]),
1290
+ style: ke({ backgroundColor: s.value }),
1291
+ title: s.label,
1292
+ onClick: (K) => me(s.value)
1293
+ }, [
1294
+ a(l).primaryColor === s.value ? (c(), V(a(T), {
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": D.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(l).isDark }]),
1319
+ onClick: M
1320
+ }, [...u[13] || (u[13] = [
1321
+ e("span", { class: "switch-core" }, null, -1)
1322
+ ])], 2)
1323
+ ])
1324
+ ])
1325
+ ])
1326
+ ])
1327
+ ]),
1328
+ _: 1
1329
+ }, 8, ["modelValue"])
1330
+ ]);
1331
+ };
1332
+ }
1333
+ }), co = /* @__PURE__ */ G(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" }, So = { class: "mix-top-menu__dropdown-role" }, Lo = { class: "mix-top-menu__dropdown-menu" }, Mo = { class: "settings-drawer" }, To = { class: "settings-section" }, Io = { class: "settings-layout-options" }, Eo = ["onClick"], No = { class: "layout-option__preview" }, Uo = {
1340
+ key: 0,
1341
+ class: "layout-preview-sidebar"
1342
+ }, Po = {
1343
+ key: 1,
1344
+ class: "layout-preview-top"
1345
+ }, Do = {
1346
+ key: 2,
1347
+ class: "layout-preview-mix"
1348
+ }, zo = { class: "layout-option__label" }, Ro = { class: "settings-section" }, Oo = { class: "settings-color-options" }, Ao = ["title", "onClick"], Vo = { class: "settings-section" }, Fo = { class: "settings-switch-list" }, Bo = { class: "settings-switch-item" }, Ko = { class: "settings-switch-item" }, jo = /* @__PURE__ */ Q({
1349
+ __name: "MixTopMenu",
1350
+ setup(t) {
1351
+ const n = ue(), o = te(), i = ce(), l = se(), d = H(), $ = be(), _ = b(() => l.activeTopMenuPath), f = b(() => l.isDark ? "#1d1e1f" : "#fff"), v = b(() => l.isDark ? "#cfd3dc" : "#303133"), m = b(() => "#409eff"), r = k(!1), p = k(null), U = k(!1), L = k(!1), D = 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
+ ]), z = (g) => {
1454
+ if (!g || g === "") return "";
1455
+ if (g.startsWith("tineco-icon-")) {
1456
+ const C = 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
+ }[C] || C;
1471
+ }
1472
+ return {
1473
+ dashboard: "dashboard",
1474
+ system: "system",
1475
+ user: "user",
1476
+ role: "role",
1477
+ menu: "list",
1478
+ setting: "setting",
1479
+ home: "home",
1480
+ chart: "chart",
1481
+ report: "report",
1482
+ analytics: "analytics",
1483
+ permission: "permission",
1484
+ log: "log",
1485
+ notification: "notification",
1486
+ app: "app",
1487
+ list: "list",
1488
+ grid: "grid"
1489
+ }[g] || g;
1490
+ }, F = (g) => g ? g.charAt(0) : "", q = (g) => R.has(g), E = (g) => {
1491
+ l.setActiveTopMenuPath(g);
1492
+ const u = i.menuList.find((C) => C.menuUrl === g);
1493
+ if (u)
1494
+ if (u.children && u.children.length > 0) {
1495
+ const C = u.children[0];
1496
+ C.menuUrl !== n.path && o.push(C.menuUrl);
1497
+ } else
1498
+ g !== n.path && o.push(g);
1499
+ }, Y = () => {
1500
+ l.toggleTheme(), L.value = !1;
1501
+ }, N = () => {
1502
+ document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
1503
+ }, B = () => {
1504
+ U.value = !!document.fullscreenElement;
1505
+ }, oe = () => {
1506
+ r.value = !r.value;
1507
+ }, J = () => {
1508
+ r.value = !1;
1509
+ }, ne = () => {
1510
+ L.value = !0;
1511
+ }, ae = (g) => {
1512
+ D.value = g;
1513
+ const u = document.documentElement;
1514
+ g ? u.classList.add("grey-mode") : u.classList.remove("grey-mode");
1515
+ }, le = () => {
1516
+ ae(!D.value), L.value = !1;
1517
+ }, M = () => {
1518
+ l.toggleTheme(), L.value = !1;
1519
+ }, Z = [
1520
+ { value: "sidebar", label: "左侧菜单" },
1521
+ { value: "top", label: "顶部菜单" },
1522
+ { value: "mix", label: "混合菜单" }
1523
+ ], X = b(() => l.layout), de = (g) => {
1524
+ l.setLayout(g), L.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
+ l.setPrimaryColor(g), L.value = !1;
1534
+ }, he = () => {
1535
+ J(), o.push("/profile");
1536
+ }, _e = () => {
1537
+ J(), o.push("/change-password");
1538
+ }, fe = () => {
1539
+ J(), $.logout(), d.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", B), D.value = document.documentElement.classList.contains("grey-mode");
1545
+ }), Oe(() => {
1546
+ document.removeEventListener("click", ie), document.removeEventListener("fullscreenchange", B);
1547
+ }), (g, u) => {
1548
+ var C;
1549
+ return c(), h("div", mo, [
1550
+ e("div", po, [
1551
+ e("span", vo, x(a(l).appName), 1)
1552
+ ]),
1553
+ y(a(Be), {
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
+ (c(!0), h(A, null, W(a(i).menuList, (s) => (c(), V(a(we), {
1564
+ key: s.menuUrl,
1565
+ index: s.menuUrl
1566
+ }, {
1567
+ default: I(() => [
1568
+ e("span", ho, [
1569
+ q(z(s.icon)) ? (c(), V(a(T), {
1570
+ key: 0,
1571
+ name: z(s.icon),
1572
+ size: 16
1573
+ }, null, 8, ["name"])) : (c(), h("span", _o, x(F(s.menuName)), 1))
1574
+ ]),
1575
+ e("span", null, x(s.menuName), 1)
1576
+ ]),
1577
+ _: 2
1578
+ }, 1032, ["index"]))), 128))
1579
+ ]),
1580
+ _: 1
1581
+ }, 8, ["default-active", "background-color", "text-color", "active-text-color"]),
1582
+ e("div", fo, [
1583
+ e("div", {
1584
+ class: "mix-top-menu__action",
1585
+ onClick: N,
1586
+ title: U.value ? "退出全屏" : "全屏"
1587
+ }, [
1588
+ y(a(T), {
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(T), {
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(T), {
1609
+ name: a(l).isDark ? "sun" : "moon",
1610
+ size: 16
1611
+ }, null, 8, ["name"])
1612
+ ]),
1613
+ e("div", {
1614
+ class: "mix-top-menu__user",
1615
+ ref_key: "dropdownRef",
1616
+ ref: 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(((C = a(d).userName) == null ? void 0 : C.charAt(0)) || "U"), 1)
1624
+ ]),
1625
+ e("span", ko, x(a(d).userName), 1),
1626
+ e("span", {
1627
+ class: O(["mix-top-menu__user-arrow", { "is-active": r.value }])
1628
+ }, "▼", 2)
1629
+ ]),
1630
+ y(Le, { name: "dropdown" }, {
1631
+ default: I(() => {
1632
+ var s;
1633
+ return [
1634
+ r.value ? (c(), h("div", wo, [
1635
+ e("div", bo, [
1636
+ e("div", xo, [
1637
+ e("span", null, x(((s = a(d).userName) == null ? void 0 : s.charAt(0)) || "U"), 1)
1638
+ ]),
1639
+ e("div", Co, [
1640
+ e("div", $o, x(a(d).userName), 1),
1641
+ e("div", So, x(a(d).departmentName), 1)
1642
+ ])
1643
+ ]),
1644
+ u[5] || (u[5] = e("div", { class: "mix-top-menu__dropdown-divider" }, null, -1)),
1645
+ e("div", Lo, [
1646
+ e("div", {
1647
+ class: "mix-top-menu__dropdown-item",
1648
+ onClick: he
1649
+ }, [
1650
+ y(a(T), {
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(T), {
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(T), {
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: L.value,
1687
+ "onUpdate:modelValue": u[0] || (u[0] = (s) => L.value = s),
1688
+ title: "换肤设置",
1689
+ direction: "rtl",
1690
+ size: "320px"
1691
+ }, {
1692
+ default: I(() => [
1693
+ e("div", Mo, [
1694
+ e("div", To, [
1695
+ u[9] || (u[9] = e("div", { class: "settings-title" }, "布局模式", -1)),
1696
+ e("div", Io, [
1697
+ (c(), 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" ? (c(), h("div", Uo, [...u[6] || (u[6] = [
1704
+ e("div", { class: "preview-aside" }, null, -1),
1705
+ e("div", { class: "preview-main" }, [
1706
+ e("div", { class: "preview-header" }),
1707
+ e("div", { class: "preview-content" })
1708
+ ], -1)
1709
+ ])])) : s.value === "top" ? (c(), h("div", Po, [...u[7] || (u[7] = [
1710
+ e("div", { class: "preview-header-full" }, null, -1),
1711
+ e("div", { class: "preview-content-full" }, null, -1)
1712
+ ])])) : (c(), h("div", Do, [...u[8] || (u[8] = [
1713
+ e("div", { class: "preview-header-mix" }, [
1714
+ e("div", { class: "preview-mix-left" })
1715
+ ], -1),
1716
+ e("div", { class: "preview-mix-body" }, [
1717
+ e("div", { class: "preview-mix-aside" }),
1718
+ e("div", { class: "preview-mix-content" })
1719
+ ], -1)
1720
+ ])]))
1721
+ ]),
1722
+ e("span", zo, x(s.label), 1)
1723
+ ], 10, Eo)), 64))
1724
+ ])
1725
+ ]),
1726
+ e("div", Ro, [
1727
+ u[10] || (u[10] = e("div", { class: "settings-title" }, "主题色", -1)),
1728
+ e("div", Oo, [
1729
+ (c(), h(A, null, W(re, (s) => e("div", {
1730
+ key: s.value,
1731
+ class: O(["color-option", { "is-active": a(l).primaryColor === s.value }]),
1732
+ style: ke({ backgroundColor: s.value }),
1733
+ title: s.label,
1734
+ onClick: (K) => me(s.value)
1735
+ }, [
1736
+ a(l).primaryColor === s.value ? (c(), V(a(T), {
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", Fo, [
1748
+ e("div", Bo, [
1749
+ u[12] || (u[12] = e("span", null, "灰色模式", -1)),
1750
+ e("div", {
1751
+ class: O(["switch-wrapper", { "is-checked": D.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(l).isDark }]),
1761
+ onClick: M
1762
+ }, [...u[13] || (u[13] = [
1763
+ e("span", { class: "switch-core" }, null, -1)
1764
+ ])], 2)
1765
+ ])
1766
+ ])
1767
+ ])
1768
+ ])
1769
+ ]),
1770
+ _: 1
1771
+ }, 8, ["modelValue"])
1772
+ ]);
1773
+ };
1774
+ }
1775
+ }), qo = /* @__PURE__ */ G(jo, [["__scopeId", "data-v-01262417"]]), Wo = { class: "layout__main" }, Yo = { class: "layout__header" }, Jo = { class: "layout__content" }, Ho = { class: "layout__top-menu" }, Go = { class: "layout__main" }, Xo = { class: "layout__content" }, Qo = { class: "layout__mix-top" }, Zo = { class: "layout__mix-body" }, en = { class: "layout__main" }, tn = { class: "layout__content" }, sn = /* @__PURE__ */ Q({
1776
+ __name: "index",
1777
+ setup(t) {
1778
+ const n = ue(), o = se(), i = ce(), l = b(
1779
+ () => o.isCollapsed ? "64px" : "210px"
1780
+ ), d = b(() => o.layout), $ = b(() => {
1781
+ var p;
1782
+ if (d.value !== "mix") return [];
1783
+ const m = o.activeTopMenuPath;
1784
+ if (console.log("[mixSubMenus] layoutMode:", d.value), console.log("[mixSubMenus] activeTopMenuPath:", m), console.log("[mixSubMenus] menuList JSON:", JSON.stringify(i.menuList)), !m) return [];
1785
+ const r = i.menuList.find((U) => U.menuUrl === m);
1786
+ return console.log("[mixSubMenus] topMenu JSON:", JSON.stringify(r)), console.log("[mixSubMenus] children JSON:", JSON.stringify(r == null ? void 0 : r.children)), console.log("[mixSubMenus] children length:", (p = r == null ? void 0 : r.children) == null ? void 0 : p.length), (r == null ? void 0 : r.children) || [];
1787
+ }), _ = b(() => d.value === "mix" && $.value.length > 0), f = (m) => {
1788
+ if (d.value === "mix" && i.menuList.length > 0) {
1789
+ if (o.activeTopMenuPath) {
1790
+ let r = !1;
1791
+ for (const p of i.menuList) {
1792
+ if (p.menuUrl === m) {
1793
+ r = !0;
1794
+ break;
1795
+ }
1796
+ if (p.children && p.children.length > 0 && v(p.children, m)) {
1797
+ r = !0;
1798
+ break;
1799
+ }
1800
+ }
1801
+ if (!r)
1802
+ return;
1803
+ }
1804
+ for (const r of i.menuList) {
1805
+ if (r.menuUrl === m) {
1806
+ o.setActiveTopMenuPath(r.menuUrl);
1807
+ return;
1808
+ }
1809
+ if (r.children && r.children.length > 0 && v(r.children, m)) {
1810
+ o.setActiveTopMenuPath(r.menuUrl);
1811
+ return;
1812
+ }
1813
+ }
1814
+ if (!o.activeTopMenuPath) {
1815
+ const p = i.menuList.find((U) => U.children && U.children.length > 0) || i.menuList[0];
1816
+ p && o.setActiveTopMenuPath(p.menuUrl);
1817
+ }
1818
+ }
1819
+ }, v = (m, r) => {
1820
+ for (const p of m)
1821
+ if (p.menuUrl === r || p.children && p.children.length > 0 && v(p.children, r))
1822
+ return !0;
1823
+ return !1;
1824
+ };
1825
+ return Se(
1826
+ () => n.path,
1827
+ (m) => {
1828
+ f(m);
1829
+ },
1830
+ { immediate: !0 }
1831
+ ), Se(
1832
+ i.menuList,
1833
+ () => {
1834
+ d.value === "mix" && f(n.path);
1835
+ }
1836
+ ), Se(
1837
+ d,
1838
+ (m) => {
1839
+ m === "mix" && i.menuList.length > 0 && f(n.path);
1840
+ }
1841
+ ), (m, r) => {
1842
+ const p = vt("router-view");
1843
+ return c(), h("div", {
1844
+ class: O(["layout", `layout--${d.value}`])
1845
+ }, [
1846
+ d.value === "sidebar" ? (c(), h(A, { key: 0 }, [
1847
+ e("aside", {
1848
+ class: "layout__aside",
1849
+ style: ke({ width: l.value })
1850
+ }, [
1851
+ y(Qe, {
1852
+ "menu-list": a(i).menuList
1853
+ }, null, 8, ["menu-list"])
1854
+ ], 4),
1855
+ e("div", Wo, [
1856
+ e("header", Yo, [
1857
+ y(Ms)
1858
+ ]),
1859
+ e("main", Jo, [
1860
+ y(p)
1861
+ ])
1862
+ ])
1863
+ ], 64)) : j("", !0),
1864
+ d.value === "top" ? (c(), h(A, { key: 1 }, [
1865
+ e("div", Ho, [
1866
+ y(co)
1867
+ ]),
1868
+ e("div", Go, [
1869
+ e("main", Xo, [
1870
+ y(p)
1871
+ ])
1872
+ ])
1873
+ ], 64)) : j("", !0),
1874
+ d.value === "mix" ? (c(), h(A, { key: 2 }, [
1875
+ e("div", Qo, [
1876
+ y(qo)
1877
+ ]),
1878
+ e("div", Zo, [
1879
+ _.value ? (c(), h("aside", {
1880
+ key: 0,
1881
+ class: "layout__aside",
1882
+ style: ke({ width: l.value })
1883
+ }, [
1884
+ y(Qe, { "menu-list": $.value }, null, 8, ["menu-list"])
1885
+ ], 4)) : j("", !0),
1886
+ e("div", en, [
1887
+ e("main", tn, [
1888
+ y(p)
1889
+ ])
1890
+ ])
1891
+ ])
1892
+ ], 64)) : j("", !0)
1893
+ ], 2);
1894
+ };
1895
+ }
1896
+ }), rt = /* @__PURE__ */ G(sn, [["__scopeId", "data-v-7c27a20d"]]), on = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1897
+ __proto__: null,
1898
+ default: rt
1899
+ }, Symbol.toStringTag, { value: "Module" })), nn = { class: "tabs-wrapper" }, an = { class: "tab-label" }, ln = ["onClick"], rn = /* @__PURE__ */ Q({
1900
+ __name: "Tabs",
1901
+ setup(t) {
1902
+ const n = ue(), o = te(), i = b(() => {
1903
+ const _ = [];
1904
+ return n.matched.forEach((f) => {
1905
+ var v;
1906
+ (v = f.meta) != null && v.affix && _.push({
1907
+ name: f.name,
1908
+ title: f.meta.title,
1909
+ path: f.path,
1910
+ affix: !0
1911
+ });
1912
+ }), _;
1913
+ }), l = b(() => n.path), d = (_) => {
1914
+ o.push(_);
1915
+ }, $ = (_) => {
1916
+ const f = i.value.find((v) => v.path === _);
1917
+ if (!(f != null && f.affix) && _ === l.value) {
1918
+ const v = i.value.findIndex((r) => r.path === _), m = i.value[v - 1] || i.value[v + 1];
1919
+ m && o.push(m.path);
1920
+ }
1921
+ };
1922
+ return (_, f) => (c(), h("div", nn, [
1923
+ y(a(ht), {
1924
+ modelValue: l.value,
1925
+ "onUpdate:modelValue": f[0] || (f[0] = (v) => l.value = v),
1926
+ type: "card",
1927
+ onTabClick: d
1928
+ }, {
1929
+ default: I(() => [
1930
+ (c(!0), h(A, null, W(i.value, (v) => (c(), V(a(_t), {
1931
+ key: v.path,
1932
+ name: v.path,
1933
+ label: v.title,
1934
+ closable: !v.affix
1935
+ }, {
1936
+ label: I(() => [
1937
+ e("span", an, [
1938
+ ve(x(v.title) + " ", 1),
1939
+ v.affix ? j("", !0) : (c(), h("span", {
1940
+ key: 0,
1941
+ class: "tab-close",
1942
+ onClick: Ee((m) => $(v.path), ["stop"])
1943
+ }, " ✕ ", 8, ln))
1944
+ ])
1945
+ ]),
1946
+ _: 2
1947
+ }, 1032, ["name", "label", "closable"]))), 128))
1948
+ ]),
1949
+ _: 1
1950
+ }, 8, ["modelValue"])
1951
+ ]));
1952
+ }
1953
+ }), Xn = /* @__PURE__ */ G(rn, [["__scopeId", "data-v-9156d8cd"]]), un = {}, cn = { class: "footer" };
1954
+ function dn(t, n) {
1955
+ return c(), h("div", cn, [...n[0] || (n[0] = [
1956
+ e("span", null, "Copyright © 2024 Xto Demo. All Rights Reserved.", -1)
1957
+ ])]);
1958
+ }
1959
+ const Qn = /* @__PURE__ */ G(un, [["render", dn], ["__scopeId", "data-v-4852826a"]]), mn = () => {
1960
+ const t = yt.create({
1961
+ baseURL: void 0,
1962
+ timeout: 3e4,
1963
+ headers: {
1964
+ "Content-Type": "application/json"
1965
+ }
1966
+ });
1967
+ return t.interceptors.request.use(
1968
+ (n) => {
1969
+ const o = Pe(), i = bt() || "Bearer";
1970
+ return o && (n.headers.Authorization = `${i} ${o}`), n;
1971
+ },
1972
+ (n) => Promise.reject(n)
1973
+ ), t.interceptors.response.use(
1974
+ (n) => {
1975
+ const { data: o } = n;
1976
+ return o.code === 200 || o.code === 0 ? o.data : (ee.error(o.message || "请求失败"), Promise.reject(new Error(o.message || "请求失败")));
1977
+ },
1978
+ (n) => {
1979
+ var i;
1980
+ const { response: o } = n;
1981
+ if (o)
1982
+ switch (o.status) {
1983
+ case 401:
1984
+ ee.error("登录已过期,请重新登录"), at(), window.location.href = "/login";
1985
+ break;
1986
+ case 403:
1987
+ ee.error("没有权限访问");
1988
+ break;
1989
+ case 404:
1990
+ ee.error("请求资源不存在");
1991
+ break;
1992
+ case 500:
1993
+ ee.error("服务器错误");
1994
+ break;
1995
+ default:
1996
+ ee.error(((i = o.data) == null ? void 0 : i.message) || "请求失败");
1997
+ }
1998
+ else
1999
+ ee.error("网络连接失败");
2000
+ return Promise.reject(n);
2001
+ }
2002
+ ), t;
2003
+ }, ye = mn(), P = {
2004
+ get(t, n) {
2005
+ return ye.get(t, n);
2006
+ },
2007
+ post(t, n, o) {
2008
+ return ye.post(t, n, o);
2009
+ },
2010
+ put(t, n, o) {
2011
+ return ye.put(t, n, o);
2012
+ },
2013
+ patch(t, n, o) {
2014
+ return ye.patch(t, n, o);
2015
+ },
2016
+ delete(t, n) {
2017
+ return ye.delete(t, n);
2018
+ }
2019
+ };
2020
+ function pn(t) {
2021
+ return P.post("/user/v1.0/login/by-domain", t);
2022
+ }
2023
+ function Zn() {
2024
+ return P.put("/user/v1.0/user/logout");
2025
+ }
2026
+ function vn() {
2027
+ return P.get("/user/v1.0/user/get-me");
2028
+ }
2029
+ function ea(t) {
2030
+ return P.post("/user/v1.0/refresh", { refreshToken: t });
2031
+ }
2032
+ const Me = k(""), Te = k(""), Ie = k("");
2033
+ function ta(t) {
2034
+ t.appId && (Me.value = t.appId), t.clientId && (Te.value = t.clientId), t.apiBaseUrl && (Ie.value = t.apiBaseUrl);
2035
+ }
2036
+ function Ge() {
2037
+ if (Me.value)
2038
+ return Me.value;
2039
+ try {
2040
+ return "";
2041
+ } catch {
2042
+ return "";
2043
+ }
2044
+ }
2045
+ function hn() {
2046
+ if (Te.value)
2047
+ return Te.value;
2048
+ try {
2049
+ return "";
2050
+ } catch {
2051
+ return "";
2052
+ }
2053
+ }
2054
+ function sa() {
2055
+ if (Ie.value)
2056
+ return Ie.value;
2057
+ try {
2058
+ return "";
2059
+ } catch {
2060
+ return "";
2061
+ }
2062
+ }
2063
+ const oa = {
2064
+ appId: Me,
2065
+ clientId: Te,
2066
+ apiBaseUrl: Ie
2067
+ }, _n = { class: "login" }, fn = { class: "login__container" }, gn = /* @__PURE__ */ Q({
2068
+ __name: "index",
2069
+ setup(t) {
2070
+ const n = te(), o = ue(), i = k(!1), l = k(!1), d = Ae({
2071
+ uid: "",
2072
+ password: ""
2073
+ }), $ = {
2074
+ uid: [
2075
+ { required: !0, message: "请输入用户名", trigger: "blur" }
2076
+ ],
2077
+ password: [
2078
+ { required: !0, message: "请输入密码", trigger: "blur" },
2079
+ { min: 6, message: "密码长度至少6位", trigger: "blur" }
2080
+ ]
2081
+ }, _ = k(), f = async () => {
2082
+ var v;
2083
+ try {
2084
+ await ((v = _.value) == null ? void 0 : v.validate()), i.value = !0;
2085
+ const m = await pn({
2086
+ appId: Ge(),
2087
+ clientId: hn(),
2088
+ uid: d.uid,
2089
+ password: d.password,
2090
+ code: !0
2091
+ });
2092
+ nt(m), ee.success("登录成功");
2093
+ const r = o.query.redirect || "/";
2094
+ n.push(r);
2095
+ } catch (m) {
2096
+ console.error("登录失败:", m);
2097
+ } finally {
2098
+ i.value = !1;
2099
+ }
2100
+ };
2101
+ return (v, m) => (c(), h("div", _n, [
2102
+ e("div", fn, [
2103
+ m[5] || (m[5] = e("div", { class: "login__header" }, [
2104
+ e("img", {
2105
+ src: ot,
2106
+ alt: "Logo",
2107
+ class: "login__logo"
2108
+ }),
2109
+ e("h1", { class: "login__title" }, "Xto Demo"),
2110
+ e("p", { class: "login__subtitle" }, "后台管理系统")
2111
+ ], -1)),
2112
+ y(a(ft), {
2113
+ ref_key: "formRef",
2114
+ ref: _,
2115
+ model: d,
2116
+ rules: $,
2117
+ class: "login__form",
2118
+ "label-width": "0"
2119
+ }, {
2120
+ default: I(() => [
2121
+ y(a(xe), { prop: "uid" }, {
2122
+ default: I(() => [
2123
+ y(a(Xe), {
2124
+ modelValue: d.uid,
2125
+ "onUpdate:modelValue": m[0] || (m[0] = (r) => d.uid = r),
2126
+ placeholder: "用户名",
2127
+ size: "large"
2128
+ }, {
2129
+ prefix: I(() => [
2130
+ y(a(T), {
2131
+ name: "user",
2132
+ size: 18
2133
+ })
2134
+ ]),
2135
+ _: 1
2136
+ }, 8, ["modelValue"])
2137
+ ]),
2138
+ _: 1
2139
+ }),
2140
+ y(a(xe), { prop: "password" }, {
2141
+ default: I(() => [
2142
+ y(a(Xe), {
2143
+ modelValue: d.password,
2144
+ "onUpdate:modelValue": m[1] || (m[1] = (r) => d.password = r),
2145
+ type: "password",
2146
+ placeholder: "密码",
2147
+ size: "large",
2148
+ "show-password": "",
2149
+ onKeyup: et(f, ["enter"])
2150
+ }, {
2151
+ prefix: I(() => [
2152
+ y(a(T), {
2153
+ name: "lock",
2154
+ size: 18
2155
+ })
2156
+ ]),
2157
+ _: 1
2158
+ }, 8, ["modelValue"])
2159
+ ]),
2160
+ _: 1
2161
+ }),
2162
+ y(a(xe), null, {
2163
+ default: I(() => [
2164
+ y(a(gt), {
2165
+ modelValue: l.value,
2166
+ "onUpdate:modelValue": m[2] || (m[2] = (r) => l.value = r)
2167
+ }, {
2168
+ default: I(() => [...m[3] || (m[3] = [
2169
+ ve("记住我", -1)
2170
+ ])]),
2171
+ _: 1
2172
+ }, 8, ["modelValue"])
2173
+ ]),
2174
+ _: 1
2175
+ }),
2176
+ y(a(xe), null, {
2177
+ default: I(() => [
2178
+ y(a(Ue), {
2179
+ type: "primary",
2180
+ size: "large",
2181
+ loading: i.value,
2182
+ class: "login__submit",
2183
+ onClick: f
2184
+ }, {
2185
+ default: I(() => [...m[4] || (m[4] = [
2186
+ ve(" 登录 ", -1)
2187
+ ])]),
2188
+ _: 1
2189
+ }, 8, ["loading"])
2190
+ ]),
2191
+ _: 1
2192
+ })
2193
+ ]),
2194
+ _: 1
2195
+ }, 8, ["model"]),
2196
+ m[6] || (m[6] = e("div", { class: "login__footer" }, [
2197
+ e("p", null, "请输入您的用户名和密码")
2198
+ ], -1))
2199
+ ])
2200
+ ]));
2201
+ }
2202
+ }), yn = /* @__PURE__ */ G(gn, [["__scopeId", "data-v-f3e724b6"]]), kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2203
+ __proto__: null,
2204
+ default: yn
2205
+ }, Symbol.toStringTag, { value: "Module" })), wn = { class: "error-page" }, bn = { class: "error-page__content" }, xn = /* @__PURE__ */ Q({
2206
+ __name: "404",
2207
+ setup(t) {
2208
+ const n = te(), o = () => {
2209
+ n.push("/");
2210
+ };
2211
+ return (i, l) => (c(), h("div", wn, [
2212
+ e("div", bn, [
2213
+ l[1] || (l[1] = e("div", { class: "error-page__code" }, "404", -1)),
2214
+ l[2] || (l[2] = e("div", { class: "error-page__title" }, "页面不存在", -1)),
2215
+ l[3] || (l[3] = e("div", { class: "error-page__desc" }, "抱歉,您访问的页面不存在或已被删除", -1)),
2216
+ y(a(Ue), {
2217
+ type: "primary",
2218
+ onClick: o
2219
+ }, {
2220
+ default: I(() => [...l[0] || (l[0] = [
2221
+ ve("返回首页", -1)
2222
+ ])]),
2223
+ _: 1
2224
+ })
2225
+ ])
2226
+ ]));
2227
+ }
2228
+ }), Cn = /* @__PURE__ */ G(xn, [["__scopeId", "data-v-c3c12c24"]]), $n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2229
+ __proto__: null,
2230
+ default: Cn
2231
+ }, Symbol.toStringTag, { value: "Module" })), Sn = { class: "error-page" }, Ln = { class: "error-page__content" }, Mn = /* @__PURE__ */ Q({
2232
+ __name: "403",
2233
+ setup(t) {
2234
+ const n = te(), o = () => {
2235
+ n.push("/");
2236
+ };
2237
+ return (i, l) => (c(), h("div", Sn, [
2238
+ e("div", Ln, [
2239
+ l[1] || (l[1] = e("div", { class: "error-page__code" }, "403", -1)),
2240
+ l[2] || (l[2] = e("div", { class: "error-page__title" }, "无访问权限", -1)),
2241
+ l[3] || (l[3] = e("div", { class: "error-page__desc" }, "抱歉,您没有权限访问此页面", -1)),
2242
+ y(a(Ue), {
2243
+ type: "primary",
2244
+ onClick: o
2245
+ }, {
2246
+ default: I(() => [...l[0] || (l[0] = [
2247
+ ve("返回首页", -1)
2248
+ ])]),
2249
+ _: 1
2250
+ })
2251
+ ])
2252
+ ]));
2253
+ }
2254
+ }), Tn = /* @__PURE__ */ G(Mn, [["__scopeId", "data-v-dd5f2795"]]), In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2255
+ __proto__: null,
2256
+ default: Tn
2257
+ }, Symbol.toStringTag, { value: "Module" }));
2258
+ function na() {
2259
+ const t = se(), n = H(), o = be(), i = b(() => n.userName || ""), l = b(() => n.userInfo), d = b(() => t.appName), $ = b(() => o.isLoggedIn), _ = b(() => t.isDark), f = b(() => t.theme), v = b(() => t.isCollapsed), m = b(() => t.layout);
2260
+ return {
2261
+ userName: i,
2262
+ userInfo: l,
2263
+ appName: d,
2264
+ isLoggedIn: $,
2265
+ isDark: _,
2266
+ theme: f,
2267
+ isCollapsed: v,
2268
+ layout: m,
2269
+ toggleTheme: () => {
2270
+ t.toggleTheme();
2271
+ },
2272
+ toggleCollapse: () => {
2273
+ t.toggleCollapse();
2274
+ }
2275
+ };
2276
+ }
2277
+ function aa() {
2278
+ const t = H();
2279
+ return {
2280
+ isLoggedIn: b(() => t.isLoggedIn)
2281
+ };
2282
+ }
2283
+ function la(t, n = {}) {
2284
+ const { rules: o, onSubmit: i } = n, l = k(), d = Ae({ ...t }), $ = k(!1), _ = k(!1), f = k(!1), v = () => {
2285
+ p(), f.value = !1, _.value = !0;
2286
+ }, m = (L) => {
2287
+ Object.assign(d, L), f.value = !0, _.value = !0;
2288
+ }, r = () => {
2289
+ _.value = !1, p();
2290
+ }, p = () => {
2291
+ var L;
2292
+ Object.keys(t).forEach((D) => {
2293
+ d[D] = t[D];
2294
+ }), (L = l.value) == null || L.resetFields();
2295
+ };
2296
+ return {
2297
+ formRef: l,
2298
+ formData: d,
2299
+ rules: o,
2300
+ loading: $,
2301
+ visible: _,
2302
+ isEdit: f,
2303
+ openAdd: v,
2304
+ openEdit: m,
2305
+ close: r,
2306
+ resetForm: p,
2307
+ handleSubmit: async () => {
2308
+ var L;
2309
+ try {
2310
+ await ((L = l.value) == null ? void 0 : L.validate()), $.value = !0, await (i == null ? void 0 : i(d)), r();
2311
+ } catch (D) {
2312
+ console.error(D);
2313
+ } finally {
2314
+ $.value = !1;
2315
+ }
2316
+ }
2317
+ };
2318
+ }
2319
+ function ra(t) {
2320
+ const { fetchData: n, defaultPageSize: o = 10 } = t, i = k(!1), l = k([]), d = k(0), $ = k(1), _ = k(o), f = Ae({}), v = async () => {
2321
+ i.value = !0;
2322
+ try {
2323
+ const R = {
2324
+ ...f,
2325
+ page: $.value,
2326
+ pageSize: _.value
2327
+ }, z = await n(R);
2328
+ l.value = z.list, d.value = z.total;
2329
+ } catch (R) {
2330
+ console.error(R);
2331
+ } finally {
2332
+ i.value = !1;
2333
+ }
2334
+ }, m = () => {
2335
+ $.value = 1, v();
2336
+ }, r = () => {
2337
+ Object.keys(f).forEach((R) => {
2338
+ f[R] = void 0;
2339
+ }), $.value = 1, v();
2340
+ }, p = (R) => {
2341
+ $.value = R, v();
2342
+ }, U = (R) => {
2343
+ _.value = R, $.value = 1, v();
2344
+ }, L = () => {
2345
+ v();
2346
+ }, D = b(() => ({
2347
+ current: $.value,
2348
+ pageSize: _.value,
2349
+ total: d.value
2350
+ }));
2351
+ return {
2352
+ loading: i,
2353
+ data: l,
2354
+ total: d,
2355
+ currentPage: $,
2356
+ pageSize: _,
2357
+ searchParams: f,
2358
+ pagination: D,
2359
+ getData: v,
2360
+ handleSearch: m,
2361
+ handleReset: r,
2362
+ handlePageChange: p,
2363
+ handleSizeChange: U,
2364
+ refresh: L
2365
+ };
2366
+ }
2367
+ function ia(t) {
2368
+ return H().isLoggedIn;
2369
+ }
2370
+ function ua(t) {
2371
+ return H().isLoggedIn;
2372
+ }
2373
+ function ca() {
2374
+ return !0;
2375
+ }
2376
+ const it = [
2377
+ {
2378
+ path: "/login",
2379
+ name: "Login",
2380
+ component: () => Promise.resolve().then(() => kn),
2381
+ meta: {
2382
+ title: "登录",
2383
+ hidden: !0
2384
+ }
2385
+ },
2386
+ {
2387
+ path: "/404",
2388
+ name: "NotFound",
2389
+ component: () => Promise.resolve().then(() => $n),
2390
+ meta: {
2391
+ title: "404",
2392
+ hidden: !0
2393
+ }
2394
+ },
2395
+ {
2396
+ path: "/403",
2397
+ name: "Forbidden",
2398
+ component: () => Promise.resolve().then(() => In),
2399
+ meta: {
2400
+ title: "403",
2401
+ hidden: !0
2402
+ }
2403
+ }
2404
+ ], ut = {
2405
+ path: "/:pathMatch(.*)*",
2406
+ redirect: "/404",
2407
+ meta: {
2408
+ hidden: !0
2409
+ }
2410
+ }, ct = {
2411
+ path: "/",
2412
+ name: "Layout",
2413
+ component: () => Promise.resolve().then(() => on),
2414
+ redirect: "/dashboard",
2415
+ children: [
2416
+ {
2417
+ path: "/dashboard",
2418
+ name: "Dashboard",
2419
+ component: () => import("./index-DE3uKf0K.js"),
2420
+ meta: {
2421
+ title: "仪表盘",
2422
+ icon: "dashboard",
2423
+ keepAlive: !0,
2424
+ affix: !0
2425
+ }
2426
+ },
2427
+ {
2428
+ path: "/system/user",
2429
+ name: "SystemUser",
2430
+ component: () => import("./index-BKnta6nv.js"),
2431
+ meta: {
2432
+ title: "用户管理",
2433
+ icon: "user",
2434
+ keepAlive: !0
2435
+ }
2436
+ },
2437
+ {
2438
+ path: "/system/role",
2439
+ name: "SystemRole",
2440
+ component: () => import("./index-IPv1O8Zq.js"),
2441
+ meta: {
2442
+ title: "角色管理",
2443
+ icon: "role",
2444
+ keepAlive: !0
2445
+ }
2446
+ },
2447
+ {
2448
+ path: "/system/menu",
2449
+ name: "SystemMenu",
2450
+ component: () => import("./index-BjEfspqP.js"),
2451
+ meta: {
2452
+ title: "菜单管理",
2453
+ icon: "menu",
2454
+ keepAlive: !0
2455
+ }
2456
+ }
2457
+ ]
2458
+ }, da = [
2459
+ {
2460
+ path: "/dashboard",
2461
+ name: "Dashboard",
2462
+ component: () => import("./index-DE3uKf0K.js"),
2463
+ meta: {
2464
+ title: "仪表盘",
2465
+ icon: "dashboard",
2466
+ keepAlive: !0,
2467
+ affix: !0
2468
+ }
2469
+ },
2470
+ {
2471
+ path: "/system",
2472
+ name: "System",
2473
+ redirect: "/system/user",
2474
+ meta: {
2475
+ title: "系统管理",
2476
+ icon: "setting"
2477
+ },
2478
+ children: [
2479
+ {
2480
+ path: "user",
2481
+ name: "SystemUser",
2482
+ component: () => import("./index-BKnta6nv.js"),
2483
+ meta: {
2484
+ title: "用户管理",
2485
+ icon: "user",
2486
+ keepAlive: !0
2487
+ }
2488
+ },
2489
+ {
2490
+ path: "role",
2491
+ name: "SystemRole",
2492
+ component: () => import("./index-IPv1O8Zq.js"),
2493
+ meta: {
2494
+ title: "角色管理",
2495
+ icon: "role",
2496
+ keepAlive: !0
2497
+ }
2498
+ },
2499
+ {
2500
+ path: "menu",
2501
+ name: "SystemMenu",
2502
+ component: () => import("./index-BjEfspqP.js"),
2503
+ meta: {
2504
+ title: "菜单管理",
2505
+ icon: "menu",
2506
+ keepAlive: !0
2507
+ }
2508
+ }
2509
+ ]
2510
+ }
2511
+ ], En = [
2512
+ {
2513
+ menuCode: "dashboard",
2514
+ menuName: "仪表盘",
2515
+ menuUrl: "/dashboard",
2516
+ icon: "dashboard",
2517
+ closable: !0,
2518
+ isDefault: !0,
2519
+ isOut: !1
2520
+ },
2521
+ {
2522
+ menuCode: "system",
2523
+ menuName: "系统管理",
2524
+ menuUrl: "/system",
2525
+ icon: "setting",
2526
+ closable: !1,
2527
+ isDefault: !1,
2528
+ isOut: !1,
2529
+ children: [
2530
+ {
2531
+ menuCode: "system_user",
2532
+ menuName: "用户管理",
2533
+ menuUrl: "/system/user",
2534
+ icon: "user",
2535
+ closable: !0,
2536
+ isDefault: !1,
2537
+ isOut: !1
2538
+ },
2539
+ {
2540
+ menuCode: "system_role",
2541
+ menuName: "角色管理",
2542
+ menuUrl: "/system/role",
2543
+ icon: "role",
2544
+ closable: !0,
2545
+ isDefault: !1,
2546
+ isOut: !1
2547
+ },
2548
+ {
2549
+ menuCode: "system_menu",
2550
+ menuName: "菜单管理",
2551
+ menuUrl: "/system/menu",
2552
+ icon: "menu",
2553
+ closable: !0,
2554
+ isDefault: !1,
2555
+ isOut: !1
2556
+ }
2557
+ ]
2558
+ }
2559
+ ], dt = Ve({
2560
+ history: Fe(),
2561
+ routes: [...it, ct, ut],
2562
+ scrollBehavior: () => ({ left: 0, top: 0 })
2563
+ }), Nn = ["/login", "/404", "/403"];
2564
+ dt.beforeEach(async (t, n, o) => {
2565
+ const i = se();
2566
+ if (i.initTheme(), lt())
2567
+ if (t.path === "/login")
2568
+ o({ path: "/" });
2569
+ else {
2570
+ const l = H();
2571
+ l.isLoggedIn || (l.setUserInfo({
2572
+ appId: Ge(),
2573
+ userId: "1",
2574
+ userName: "管理员",
2575
+ departmentName: "技术部",
2576
+ email: "admin@example.com",
2577
+ mobilePhone: "13800138000",
2578
+ positionName: "管理员",
2579
+ avatar: ""
2580
+ }), ce().setMenuList(En)), t.name && t.meta.keepAlive && i.addCachedView(t.name), o();
2581
+ }
2582
+ else
2583
+ Nn.includes(t.path) ? o() : o("/login");
2584
+ });
2585
+ function ma() {
2586
+ const t = Ve({
2587
+ history: Fe(),
2588
+ routes: [...it, ct, ut]
2589
+ });
2590
+ dt.matcher = t.matcher;
2591
+ }
2592
+ function pa(t, n = {}) {
2593
+ const o = n.indexPath || "/dashboard";
2594
+ return {
2595
+ path: "/",
2596
+ name: "Layout",
2597
+ component: rt,
2598
+ redirect: o,
2599
+ children: t
2600
+ };
2601
+ }
2602
+ function va(t) {
2603
+ return Ve({
2604
+ history: Fe(),
2605
+ routes: t,
2606
+ scrollBehavior: () => ({ left: 0, top: 0 })
2607
+ });
2608
+ }
2609
+ function ha(t) {
2610
+ return P.get("/role/list", { params: t });
2611
+ }
2612
+ function _a(t) {
2613
+ return P.get(`/role/${t}`);
2614
+ }
2615
+ function fa(t) {
2616
+ return P.post("/role", t);
2617
+ }
2618
+ function ga(t, n) {
2619
+ return P.put(`/role/${t}`, n);
2620
+ }
2621
+ function ya(t) {
2622
+ return P.delete(`/role/${t}`);
2623
+ }
2624
+ function ka(t, n) {
2625
+ return P.patch(`/role/${t}/status`, { status: n });
2626
+ }
2627
+ function wa() {
2628
+ return P.get("/user/v1.0/menu/list");
2629
+ }
2630
+ function Un(t) {
2631
+ const n = t || Ge();
2632
+ return P.get(`/user/v1.0/menu/get-menu?appId=${n}`);
2633
+ }
2634
+ function ba(t) {
2635
+ return P.post("/menu", t);
2636
+ }
2637
+ function xa(t, n) {
2638
+ return P.put(`/menu/${t}`, n);
2639
+ }
2640
+ function Ca(t) {
2641
+ return P.delete(`/menu/${t}`);
2642
+ }
2643
+ const Pn = ["/login", "/404", "/403"];
2644
+ function $a(t, n = {}) {
2645
+ const o = n.whiteList || Pn, i = n.loginPath || "/login", l = n.homePath || "/";
2646
+ t.beforeEach(async (d, $, _) => {
2647
+ const f = se(), v = H(), m = ce();
2648
+ if (f.initTheme(), Pe())
2649
+ if (d.path === i)
2650
+ _({ path: l });
2651
+ else if (v.isLoggedIn)
2652
+ d.name && d.meta.keepAlive && f.addCachedView(d.name), _();
2653
+ else
2654
+ try {
2655
+ if (n.fetchUserInfo) {
2656
+ const p = await n.fetchUserInfo();
2657
+ v.setUserInfo(p);
2658
+ } else {
2659
+ const p = await vn();
2660
+ v.setUserInfo(p);
2661
+ }
2662
+ if (n.fetchMenu) {
2663
+ const p = await n.fetchMenu();
2664
+ m.setMenuList(p);
2665
+ } else {
2666
+ const p = await Un(n.appId);
2667
+ m.setMenuList(p);
2668
+ }
2669
+ n.onLoginSuccess && n.onLoginSuccess(), d.name && d.meta.keepAlive && f.addCachedView(d.name), _({ ...d, replace: !0 });
2670
+ } catch (p) {
2671
+ console.error("获取用户信息失败:", p), v.clearUserInfo(), m.clearMenu(), localStorage.removeItem("token"), localStorage.removeItem("token_type"), localStorage.removeItem("refresh_token"), _({ path: i, query: { redirect: d.fullPath } });
2672
+ }
2673
+ else
2674
+ o.includes(d.path) ? _() : _({ path: i, query: { redirect: d.fullPath } });
2675
+ }), t.afterEach(() => {
2676
+ });
2677
+ }
2678
+ function Sa(t) {
2679
+ return P.get("/user/list", { params: t });
2680
+ }
2681
+ function La(t) {
2682
+ return P.get(`/user/${t}`);
2683
+ }
2684
+ function Ma(t) {
2685
+ return P.post("/user", t);
2686
+ }
2687
+ function Ta(t, n) {
2688
+ return P.put(`/user/${t}`, n);
2689
+ }
2690
+ function Ia(t) {
2691
+ return P.delete(`/user/${t}`);
2692
+ }
2693
+ function Ea(t) {
2694
+ return P.post("/user/batch-delete", { ids: t });
2695
+ }
2696
+ function Na(t, n) {
2697
+ return P.patch(`/user/${t}/status`, { status: n });
2698
+ }
2699
+ function Ua(t) {
2700
+ return P.post(`/user/${t}/reset-password`);
2701
+ }
2702
+ var Dn = /* @__PURE__ */ ((t) => (t[t.ENABLED = 1] = "ENABLED", t[t.DISABLED = 0] = "DISABLED", t))(Dn || {}), zn = /* @__PURE__ */ ((t) => (t[t.UNKNOWN = 0] = "UNKNOWN", t[t.MALE = 1] = "MALE", t[t.FEMALE = 2] = "FEMALE", t))(zn || {}), Rn = /* @__PURE__ */ ((t) => (t[t.DIRECTORY = 0] = "DIRECTORY", t[t.MENU = 1] = "MENU", t[t.BUTTON = 2] = "BUTTON", t))(Rn || {});
2703
+ const Pa = {
2704
+ 1: "启用",
2705
+ 0: "禁用"
2706
+ }, Da = {
2707
+ 0: "未知",
2708
+ 1: "男",
2709
+ 2: "女"
2710
+ }, za = {
2711
+ 0: "目录",
2712
+ 1: "菜单",
2713
+ 2: "按钮"
2714
+ }, Ra = [
2715
+ {
2716
+ label: "启用",
2717
+ value: 1
2718
+ /* ENABLED */
2719
+ },
2720
+ {
2721
+ label: "禁用",
2722
+ value: 0
2723
+ /* DISABLED */
2724
+ }
2725
+ ], Oa = [
2726
+ {
2727
+ label: "未知",
2728
+ value: 0
2729
+ /* UNKNOWN */
2730
+ },
2731
+ {
2732
+ label: "男",
2733
+ value: 1
2734
+ /* MALE */
2735
+ },
2736
+ {
2737
+ label: "女",
2738
+ value: 2
2739
+ /* FEMALE */
2740
+ }
2741
+ ], Aa = [
2742
+ {
2743
+ label: "目录",
2744
+ value: 0
2745
+ /* DIRECTORY */
2746
+ },
2747
+ {
2748
+ label: "菜单",
2749
+ value: 1
2750
+ /* MENU */
2751
+ },
2752
+ {
2753
+ label: "按钮",
2754
+ value: 2
2755
+ /* BUTTON */
2756
+ }
2757
+ ], Va = {
2758
+ mounted(t, n) {
2759
+ var i;
2760
+ H().isLoggedIn || (i = t.parentNode) == null || i.removeChild(t);
2761
+ }
2762
+ };
2763
+ export {
2764
+ Tt as $,
2765
+ Gn as A,
2766
+ wa as B,
2767
+ Un as C,
2768
+ Hn as D,
2769
+ Jn as E,
2770
+ Qn as F,
2771
+ zn as G,
2772
+ Ms as H,
2773
+ _a as I,
2774
+ ha as J,
2775
+ Pe as K,
2776
+ rt as L,
2777
+ Rn as M,
2778
+ $t as N,
2779
+ bt as O,
2780
+ La as P,
2781
+ vn as Q,
2782
+ Sa as R,
2783
+ Dn as S,
2784
+ Xn as T,
2785
+ ia as U,
2786
+ ua as V,
2787
+ lt as W,
2788
+ P as X,
2789
+ ta as Y,
2790
+ ca as Z,
2791
+ G as _,
2792
+ Ra as a,
2793
+ ct as a0,
2794
+ w as a1,
2795
+ Ce as a2,
2796
+ pn as a3,
2797
+ Zn as a4,
2798
+ En as a5,
2799
+ Va as a6,
2800
+ ea as a7,
2801
+ Ua as a8,
2802
+ ma as a9,
2803
+ dt as aa,
2804
+ Yn as ab,
2805
+ $e as ac,
2806
+ Mt as ad,
2807
+ Lt as ae,
2808
+ Ct as af,
2809
+ wt as ag,
2810
+ St as ah,
2811
+ nt as ai,
2812
+ xt as aj,
2813
+ $a as ak,
2814
+ it as al,
2815
+ xa as am,
2816
+ ga as an,
2817
+ ka as ao,
2818
+ Ta as ap,
2819
+ Na as aq,
2820
+ na as ar,
2821
+ se as as,
2822
+ aa as at,
2823
+ be as au,
2824
+ la as av,
2825
+ ce as aw,
2826
+ ra as ax,
2827
+ H as ay,
2828
+ Aa as b,
2829
+ Tn as c,
2830
+ Oa as d,
2831
+ Da as e,
2832
+ za as f,
2833
+ Cn as g,
2834
+ Qe as h,
2835
+ yn as i,
2836
+ Pa as j,
2837
+ oa as k,
2838
+ Ea as l,
2839
+ at as m,
2840
+ pa as n,
2841
+ ba as o,
2842
+ fa as p,
2843
+ va as q,
2844
+ Ma as r,
2845
+ da as s,
2846
+ Ca as t,
2847
+ ya as u,
2848
+ Ia as v,
2849
+ ut as w,
2850
+ sa as x,
2851
+ Ge as y,
2852
+ hn as z
2853
+ };