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