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