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