xto-fronted 0.4.84 → 0.4.86

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