@utogether/udp-core 1.0.0

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 (343) hide show
  1. package/build/index.ts +90 -0
  2. package/build/plugins.ts +26 -0
  3. package/dist/403-B1R-4vXw.js +64 -0
  4. package/dist/404-fXPl8csw.js +64 -0
  5. package/dist/500-eI5842YB.js +66 -0
  6. package/dist/AuthorityInfo-CfVH6PaB.js +4 -0
  7. package/dist/AuthorityInfo.vue_vue_type_style_index_0_lang-DbK-f8jH.js +102 -0
  8. package/dist/AuthorityPanel-BaLMwMgW.js +4 -0
  9. package/dist/AuthorityPanel.vue_vue_type_style_index_0_lang-C_bkqLD9.js +107 -0
  10. package/dist/Company-CYC9Avfz.js +25 -0
  11. package/dist/CompanyPanel-B4MzoqN_.js +206 -0
  12. package/dist/DataSet-DT-rGICv.js +147 -0
  13. package/dist/Department-B4BNSiYx.js +25 -0
  14. package/dist/DepartmentPanel-zJO89L2O.js +224 -0
  15. package/dist/DesignPanel-S8P0J97f.js +4 -0
  16. package/dist/DesignPanel.vue_vue_type_style_index_0_lang-DW-_Vqrr.js +1015 -0
  17. package/dist/DictView-bIS5-rK-.js +95 -0
  18. package/dist/InvOrganization-MuM2jtsG.js +66 -0
  19. package/dist/Org-kXHSjsgJ.js +35 -0
  20. package/dist/Preview-CRyiwUIR.js +48 -0
  21. package/dist/ReportDefine-WZYIx8Sm.js +10 -0
  22. package/dist/ReportDesign-D-7GKgpb.js +165 -0
  23. package/dist/ReportQuery-BIIJny6w.js +75 -0
  24. package/dist/ReportQueryFrom-OoUl7N2O.js +4 -0
  25. package/dist/ReportQueryFrom.vue_vue_type_style_index_0_lang-B878fgj8.js +177 -0
  26. package/dist/ReportTemplate-Cfeq9US-.js +161 -0
  27. package/dist/Role-BwTV2QMH.js +25 -0
  28. package/dist/RoleAssign-De1JjOun.js +26 -0
  29. package/dist/RolePanel-E3RcdByM.js +4 -0
  30. package/dist/RolePanel-pUBXsqCM.js +4 -0
  31. package/dist/RolePanel.vue_vue_type_script_setup_true_lang-B2pQwHb0.js +148 -0
  32. package/dist/RolePanel.vue_vue_type_script_setup_true_lang-CTIad9_Q.js +126 -0
  33. package/dist/ScrollPanel.vue_vue_type_style_index_0_lang-vMR1fBi0.js +100 -0
  34. package/dist/Staff-Czm7A8vI.js +25 -0
  35. package/dist/StaffInfo-DJzvBuxy.js +4 -0
  36. package/dist/StaffInfo.vue_vue_type_style_index_0_lang-DMTL7KCh.js +108 -0
  37. package/dist/StaffPanel-CHk60LEz.js +4 -0
  38. package/dist/StaffPanel.vue_vue_type_script_setup_true_lang-iPKLb5wG.js +114 -0
  39. package/dist/SysUser-BGwbttRn.js +15 -0
  40. package/dist/SysUserPanel-BCbKoLKt.js +4 -0
  41. package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-0QUjnhjF.js +289 -0
  42. package/dist/SystemMenu-BkqZSDKl.js +151 -0
  43. package/dist/UserInfo-BsyAcT2d.js +4 -0
  44. package/dist/UserInfo.vue_vue_type_style_index_0_lang-D0-KDxAh.js +158 -0
  45. package/dist/await-to-js.es5-BtRbN2QH.js +10 -0
  46. package/dist/childView-CF83nhxb.js +4 -0
  47. package/dist/childView-CyuLTUqC.js +4 -0
  48. package/dist/childView.vue_vue_type_style_index_0_lang-CNSgGda3.js +187 -0
  49. package/dist/childView.vue_vue_type_style_index_0_lang-Cch4lE-i.js +144 -0
  50. package/dist/code-rule-Bz-gnktN.js +147 -0
  51. package/dist/core.es.js +13 -0
  52. package/dist/core.umd.js +173 -0
  53. package/dist/cron-task-CIifSUdW.js +135 -0
  54. package/dist/frameView-_d2mqjjQ.js +43 -0
  55. package/dist/img/l_img.svg +1 -0
  56. package/dist/img/minicolors.png +0 -0
  57. package/dist/img/v_img.svg +1 -0
  58. package/dist/index-BKIw8tSn.js +9195 -0
  59. package/dist/layoutView-DLKVepB8.js +3317 -0
  60. package/dist/log-in-e7D5Ss1P.js +110 -0
  61. package/dist/log-out--RRncZhN.js +120 -0
  62. package/dist/login-LREiDfFU.js +251 -0
  63. package/dist/login-log-CvVnyGi3.js +68 -0
  64. package/dist/lov-view-DDrIVILB.js +97 -0
  65. package/dist/menuInfo-B1FUV-Sk.js +4 -0
  66. package/dist/menuInfo.vue_vue_type_style_index_0_lang-Cnk3vdtD.js +338 -0
  67. package/dist/pda-app-CRhVGijN.js +2209 -0
  68. package/dist/redirect-DiaNDu8F.js +15 -0
  69. package/dist/resource-BCwx9fEv.js +97 -0
  70. package/dist/su-welcome-189A7N4r.js +526 -0
  71. package/dist/sys-config-BZ3sejow.js +277 -0
  72. package/dist/udp-core.css +9 -0
  73. package/dist/utogether-r08LNiIZ.js +182 -0
  74. package/index.ts +36 -0
  75. package/package.json +16 -0
  76. package/public/img/l_img.svg +1 -0
  77. package/public/img/minicolors.png +0 -0
  78. package/public/img/v_img.svg +1 -0
  79. package/src/App.vue +70 -0
  80. package/src/api/http.ts +50 -0
  81. package/src/api/index.ts +31 -0
  82. package/src/api/mock.ts +20 -0
  83. package/src/api/user.ts +43 -0
  84. package/src/assets/images/avatars.jpg +0 -0
  85. package/src/assets/images/empty.png +0 -0
  86. package/src/assets/images/login.png +0 -0
  87. package/src/assets/images/logo.png +0 -0
  88. package/src/assets/images/mask-text.jpg +0 -0
  89. package/src/assets/images/minicolors.png +0 -0
  90. package/src/assets/images/utogether.png +0 -0
  91. package/src/assets/images/welcome.png +0 -0
  92. package/src/assets/status/403.svg +1 -0
  93. package/src/assets/status/404.svg +1 -0
  94. package/src/assets/status/500.svg +1 -0
  95. package/src/assets/svg/back_top.svg +1 -0
  96. package/src/assets/svg/bg.svg +1 -0
  97. package/src/assets/svg/close.svg +1 -0
  98. package/src/assets/svg/close_all.svg +1 -0
  99. package/src/assets/svg/close_left.svg +1 -0
  100. package/src/assets/svg/close_other.svg +1 -0
  101. package/src/assets/svg/close_right.svg +1 -0
  102. package/src/assets/svg/dark.svg +1 -0
  103. package/src/assets/svg/day.svg +1 -0
  104. package/src/assets/svg/enter_outlined.svg +1 -0
  105. package/src/assets/svg/exit_screen.svg +1 -0
  106. package/src/assets/svg/full_screen.svg +1 -0
  107. package/src/assets/svg/globalization.svg +1 -0
  108. package/src/assets/svg/loading.svg +17 -0
  109. package/src/assets/svg/mdi_keyboard_esc.svg +1 -0
  110. package/src/assets/svg/refresh.svg +1 -0
  111. package/src/assets/svg/system.svg +1 -0
  112. package/src/components/ReCountTo/README.md +2 -0
  113. package/src/components/ReCountTo/index.ts +18 -0
  114. package/src/components/ReCountTo/src/normal/index.tsx +165 -0
  115. package/src/components/ReCountTo/src/normal/props.ts +37 -0
  116. package/src/components/ReCountTo/src/rebound/index.tsx +67 -0
  117. package/src/components/ReCountTo/src/rebound/props.ts +14 -0
  118. package/src/components/ReCountTo/src/rebound/rebound.css +77 -0
  119. package/src/components/ReCropper/index.ts +14 -0
  120. package/src/components/ReCropper/src/index.tsx +141 -0
  121. package/src/components/ReFlicker/index.css +39 -0
  122. package/src/components/ReFlicker/index.ts +50 -0
  123. package/src/components/ReFlop/index.ts +14 -0
  124. package/src/components/ReFlop/src/Filpper.tsx +99 -0
  125. package/src/components/ReFlop/src/filpper.css +184 -0
  126. package/src/components/ReFlop/src/index.vue +126 -0
  127. package/src/components/ReFlowChart/index.ts +24 -0
  128. package/src/components/ReFlowChart/src/Control.vue +139 -0
  129. package/src/components/ReFlowChart/src/DataDialog.vue +12 -0
  130. package/src/components/ReFlowChart/src/NodePanel.vue +151 -0
  131. package/src/components/ReFlowChart/src/adpterForTurbo.ts +160 -0
  132. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.css +49 -0
  133. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.eot +0 -0
  134. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.js +61 -0
  135. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.json +58 -0
  136. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.svg +47 -0
  137. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.ttf +0 -0
  138. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff +0 -0
  139. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff2 +0 -0
  140. package/src/components/ReFlowChart/src/config.ts +62 -0
  141. package/src/components/ReIcon/index.ts +12 -0
  142. package/src/components/ReIcon/src/Icon.vue +81 -0
  143. package/src/components/ReIcon/src/hooks.ts +63 -0
  144. package/src/components/ReIcon/src/iconfont.ts +45 -0
  145. package/src/components/ReIcon/src/iconifyIconOffline.ts +36 -0
  146. package/src/components/ReIcon/src/iconifyIconOnline.ts +28 -0
  147. package/src/components/ReIcon/src/offlineIcon.ts +64 -0
  148. package/src/components/ReIcon/src/types.ts +20 -0
  149. package/src/components/ReSplitPane/index.css +49 -0
  150. package/src/components/ReSplitPane/index.tsx +119 -0
  151. package/src/components/ReSplitPane/resizer.css +45 -0
  152. package/src/components/ReSplitPane/resizer.tsx +30 -0
  153. package/src/components/SuCharts/index.ts +36 -0
  154. package/src/components/SuCharts/src/EchartBar.vue +134 -0
  155. package/src/components/SuCharts/src/UserInfo.vue +78 -0
  156. package/src/components/SuCharts/src/echart-line.vue +85 -0
  157. package/src/components/SuCharts/src/echart-pie.vue +95 -0
  158. package/src/components/SuCommon/card/components/Card.vue +148 -0
  159. package/src/components/SuCommon/card/components/DialogForm.vue +127 -0
  160. package/src/components/SuCommon/card/index.vue +142 -0
  161. package/src/components/SuCommon/icon-select/index.vue +241 -0
  162. package/src/components/SuCommon/table/index.vue +208 -0
  163. package/src/components/SuCommon/utils/index.ts +103 -0
  164. package/src/components/SuCommon/utils/slot.tsx +50 -0
  165. package/src/components/SuFloatButton/index.vue +159 -0
  166. package/src/components/SuQrcode/index.ts +14 -0
  167. package/src/components/SuQrcode/src/index.scss +9 -0
  168. package/src/components/SuQrcode/src/index.tsx +236 -0
  169. package/src/components/SuScrollTree/ScrollPanel.vue +175 -0
  170. package/src/components/SuTable/SuTable.vue +334 -0
  171. package/src/components/SuTypeit/index.ts +51 -0
  172. package/src/config/index.ts +35 -0
  173. package/src/contant/index.ts +20 -0
  174. package/src/directives/elResizeDetector/index.ts +33 -0
  175. package/src/directives/index.ts +11 -0
  176. package/src/directives/permission/index.ts +29 -0
  177. package/src/layout/components/lay-chrome/index.vue +30 -0
  178. package/src/layout/components/lay-content/index.vue +143 -0
  179. package/src/layout/components/lay-navbar/index.vue +237 -0
  180. package/src/layout/components/lay-notice/data.ts +59 -0
  181. package/src/layout/components/lay-notice/index.vue +83 -0
  182. package/src/layout/components/lay-notice/noticeItem.vue +160 -0
  183. package/src/layout/components/lay-notice/noticeList.vue +19 -0
  184. package/src/layout/components/lay-panel/index.vue +150 -0
  185. package/src/layout/components/lay-search/components/SearchFooter.vue +67 -0
  186. package/src/layout/components/lay-search/components/SearchModal.vue +189 -0
  187. package/src/layout/components/lay-search/components/SearchResult.vue +132 -0
  188. package/src/layout/components/lay-search/components/index.ts +10 -0
  189. package/src/layout/components/lay-search/index.vue +25 -0
  190. package/src/layout/components/lay-select-org/index.vue +69 -0
  191. package/src/layout/components/lay-setting/index.vue +510 -0
  192. package/src/layout/components/lay-sidebar/breadCrumb.vue +131 -0
  193. package/src/layout/components/lay-sidebar/extraIcon.vue +25 -0
  194. package/src/layout/components/lay-sidebar/hamBurger.vue +72 -0
  195. package/src/layout/components/lay-sidebar/horizontal.vue +191 -0
  196. package/src/layout/components/lay-sidebar/mixNav.vue +258 -0
  197. package/src/layout/components/lay-sidebar/sidebar-logo.vue +98 -0
  198. package/src/layout/components/lay-sidebar/sidebarItem.vue +205 -0
  199. package/src/layout/components/lay-sidebar/vertical.vue +94 -0
  200. package/src/layout/components/lay-tag/index.scss +375 -0
  201. package/src/layout/components/lay-tag/index.vue +625 -0
  202. package/src/layout/frameView.vue +71 -0
  203. package/src/layout/hooks/useBoolean.ts +33 -0
  204. package/src/layout/hooks/useDataThemeChange.ts +142 -0
  205. package/src/layout/hooks/useLayout.ts +65 -0
  206. package/src/layout/hooks/useNav.ts +173 -0
  207. package/src/layout/hooks/useTag.ts +233 -0
  208. package/src/layout/hooks/useTranslationLang.ts +51 -0
  209. package/src/layout/layoutView.vue +215 -0
  210. package/src/layout/redirect.vue +30 -0
  211. package/src/layout/routerView/parent.vue +23 -0
  212. package/src/layout/types.ts +92 -0
  213. package/src/main.ts +108 -0
  214. package/src/plugins/echarts/index.ts +58 -0
  215. package/src/plugins/echarts/theme.json +394 -0
  216. package/src/plugins/i18n/en.ts +289 -0
  217. package/src/plugins/i18n/index.ts +76 -0
  218. package/src/plugins/i18n/module/u-report.ts +64 -0
  219. package/src/plugins/i18n/module/u-workflow.ts +71 -0
  220. package/src/plugins/i18n/module/umsg.ts +28 -0
  221. package/src/plugins/i18n/zh.ts +337 -0
  222. package/src/plugins/vxe-table/index.ts +46 -0
  223. package/src/plugins/vxe-table/render.tsx +397 -0
  224. package/src/router/createComponent.tsx +25 -0
  225. package/src/router/index.ts +183 -0
  226. package/src/router/modules/error.ts +32 -0
  227. package/src/router/modules/home.ts +32 -0
  228. package/src/router/modules/nested.ts +93 -0
  229. package/src/router/modules/remaining.ts +83 -0
  230. package/src/router/modules/tabs.ts +55 -0
  231. package/src/router/utils.ts +377 -0
  232. package/src/store/index.ts +9 -0
  233. package/src/store/modules/app.ts +69 -0
  234. package/src/store/modules/epTheme.ts +49 -0
  235. package/src/store/modules/multiTags.ts +109 -0
  236. package/src/store/modules/permission.ts +103 -0
  237. package/src/store/modules/settings.ts +40 -0
  238. package/src/store/modules/system.ts +180 -0
  239. package/src/store/modules/types.ts +49 -0
  240. package/src/style/button.scss +78 -0
  241. package/src/style/clear-mixin.scss +28 -0
  242. package/src/style/dark.scss +218 -0
  243. package/src/style/element-plus.scss +206 -0
  244. package/src/style/index.scss +76 -0
  245. package/src/style/login.css +336 -0
  246. package/src/style/login2.css +106 -0
  247. package/src/style/print-lock.css +375 -0
  248. package/src/style/reset.scss +272 -0
  249. package/src/style/sidebar.scss +770 -0
  250. package/src/style/suprint.css +985 -0
  251. package/src/style/tailwind.css +68 -0
  252. package/src/style/theme.scss +143 -0
  253. package/src/style/transition.scss +42 -0
  254. package/src/style/vxetable.scss +256 -0
  255. package/src/utils/authority/index.ts +29 -0
  256. package/src/utils/browers.ts +59 -0
  257. package/src/utils/dataFormat/index.ts +223 -0
  258. package/src/utils/http/index.ts +297 -0
  259. package/src/utils/http/types.d.ts +46 -0
  260. package/src/utils/index.ts +47 -0
  261. package/src/utils/lifecycle.ts +20 -0
  262. package/src/utils/mitt.ts +19 -0
  263. package/src/utils/propTypes.ts +47 -0
  264. package/src/utils/storage/index.ts +51 -0
  265. package/src/views/components/contextmenu/basic.vue +74 -0
  266. package/src/views/components/contextmenu/context-menu.vue +40 -0
  267. package/src/views/components/contextmenu/menuDynamic.vue +99 -0
  268. package/src/views/components/contextmenu/menuGroup.vue +71 -0
  269. package/src/views/components/count-to/index.vue +43 -0
  270. package/src/views/components/cropping/index.vue +59 -0
  271. package/src/views/components/cropping/picture.jpeg +0 -0
  272. package/src/views/components/split-pane/index.vue +82 -0
  273. package/src/views/components/video/index.vue +57 -0
  274. package/src/views/error/403.vue +50 -0
  275. package/src/views/error/404.vue +50 -0
  276. package/src/views/error/500.vue +52 -0
  277. package/src/views/login/login-view.vue +314 -0
  278. package/src/views/login/utils/motion.ts +47 -0
  279. package/src/views/login/utils/rule.ts +70 -0
  280. package/src/views/login/utils/verifyCode.ts +52 -0
  281. package/src/views/organization/company/Company.vue +56 -0
  282. package/src/views/organization/company/CompanyPanel.vue +259 -0
  283. package/src/views/organization/department/Department.vue +58 -0
  284. package/src/views/organization/department/DepartmentPanel.vue +283 -0
  285. package/src/views/organization/inv-org/InvOrganization.vue +53 -0
  286. package/src/views/organization/org/Org.vue +43 -0
  287. package/src/views/organization/staff/Staff.vue +58 -0
  288. package/src/views/organization/staff/StaffInfo.vue +163 -0
  289. package/src/views/organization/staff/StaffPanel.vue +144 -0
  290. package/src/views/system/cron/cron-task.vue +157 -0
  291. package/src/views/system/menu/AuthorityPanel.vue +140 -0
  292. package/src/views/system/menu/SystemMenu.vue +191 -0
  293. package/src/views/system/menu/menuInfo.vue +368 -0
  294. package/src/views/system/role/AuthorityInfo.vue +147 -0
  295. package/src/views/system/role/Role.vue +57 -0
  296. package/src/views/system/role/RolePanel.vue +191 -0
  297. package/src/views/system/role/UserInfo.vue +193 -0
  298. package/src/views/system/role-assign/RoleAssign.vue +57 -0
  299. package/src/views/system/role-assign/RolePanel.vue +136 -0
  300. package/src/views/system/sys/sys-config.vue +291 -0
  301. package/src/views/system/sysUser/SysUser.vue +45 -0
  302. package/src/views/system/sysUser/SysUserPanel.vue +278 -0
  303. package/src/views/uapp/pda/pda-app.vue +176 -0
  304. package/src/views/udev/coderule/code-rule.vue +121 -0
  305. package/src/views/udev/dict/DictView.vue +106 -0
  306. package/src/views/udev/dict/childView.vue +222 -0
  307. package/src/views/udev/lov/childView.vue +180 -0
  308. package/src/views/udev/lov/lov-view.vue +91 -0
  309. package/src/views/ufile/aggregation/File.vue +87 -0
  310. package/src/views/ufile/file/water-mark.vue +103 -0
  311. package/src/views/uhome/components/menu-favorite.vue +331 -0
  312. package/src/views/uhome/su-welcome.vue +339 -0
  313. package/src/views/ulogin/login.vue +316 -0
  314. package/src/views/umsg/monitor/msg-monitor.vue +36 -0
  315. package/src/views/umsg/msg/TemplateContent.vue +103 -0
  316. package/src/views/umsg/msg/msg-template.vue +66 -0
  317. package/src/views/umsg/send/childView.vue +142 -0
  318. package/src/views/umsg/send/msg-send.vue +95 -0
  319. package/src/views/upms/interface/log-in.vue +106 -0
  320. package/src/views/upms/interface/log-out.vue +107 -0
  321. package/src/views/upms/user/login-log.vue +60 -0
  322. package/src/views/urpt/dataSet/DataSet.vue +139 -0
  323. package/src/views/urpt/design/DesignPanel.vue +526 -0
  324. package/src/views/urpt/design/Preview.vue +65 -0
  325. package/src/views/urpt/design/ReportDesign.vue +249 -0
  326. package/src/views/urpt/design/bg.png +0 -0
  327. package/src/views/urpt/design/panel.ts +841 -0
  328. package/src/views/urpt/design/print-data.ts +59 -0
  329. package/src/views/urpt/query/ReportQuery.vue +122 -0
  330. package/src/views/urpt/query/ReportQueryFrom.vue +252 -0
  331. package/src/views/urpt/report-request/ReportDefine.vue +10 -0
  332. package/src/views/urpt/static-resource/resource.vue +116 -0
  333. package/src/views/urpt/template/ReportTemplate.vue +198 -0
  334. package/tsconfig.json +30 -0
  335. package/types/env.d.ts +1 -0
  336. package/types/global-components.d.ts +12 -0
  337. package/types/global.d.ts +236 -0
  338. package/types/image.d.ts +7 -0
  339. package/types/index.d.ts +73 -0
  340. package/types/router.d.ts +107 -0
  341. package/types/shims-tsx.d.ts +22 -0
  342. package/types/shims-vue.d.ts +20 -0
  343. package/vite.config.ts +73 -0
@@ -0,0 +1,205 @@
1
+ <script setup lang="ts">
2
+ import { ref, toRaw, PropType, nextTick, computed, CSSProperties } from 'vue';
3
+ import path from 'path';
4
+ import extraIcon from './extraIcon.vue';
5
+ import { useNav } from '../../hooks/useNav';
6
+ import { childrenType } from '../../types';
7
+ import { transformI18n } from '../../../plugins/i18n';
8
+ import { useRenderIcon } from '../../../components/ReIcon/src/hooks';
9
+ // import Icon from '@/components/ReIcon/src/Icon.vue';
10
+
11
+ const { appHook, isCollapse, getDivStyle } = useNav();
12
+ const menuMode = ['vertical', 'mix'].includes(appHook.layout);
13
+
14
+ const props = defineProps({
15
+ item: {
16
+ type: Object as PropType<childrenType>
17
+ },
18
+ isNest: {
19
+ type: Boolean,
20
+ default: false
21
+ },
22
+ basePath: {
23
+ type: String,
24
+ default: ''
25
+ }
26
+ });
27
+
28
+ const getNoDropdownStyle = computed((): CSSProperties => {
29
+ return { display: 'flex', alignItems: 'center' };
30
+ });
31
+ // const getDivStyle = computed((): CSSProperties => {
32
+ // return {
33
+ // width: !isCollapse.value ? '' : '100%',
34
+ // display: 'flex',
35
+ // alignItems: 'center',
36
+ // justifyContent: 'space-between',
37
+ // overflow: 'hidden'
38
+ // };
39
+ // });
40
+
41
+ const getMenuTextStyle = computed(() => {
42
+ return {
43
+ width: !isCollapse.value ? '125px' : '',
44
+ overflow: 'hidden',
45
+ textOverflow: 'ellipsis',
46
+ outline: 'none'
47
+ };
48
+ });
49
+ const getSubTextStyle = computed((): CSSProperties => {
50
+ return {
51
+ width: !isCollapse.value ? '210px' : '',
52
+ display: 'inline-block',
53
+ overflow: 'hidden',
54
+ textOverflow: 'ellipsis'
55
+ };
56
+ });
57
+
58
+ const getSpanStyle = computed((): CSSProperties => {
59
+ return { overflow: 'hidden', textOverflow: 'ellipsis' };
60
+ });
61
+
62
+ const onlyOneChild: childrenType = ref(null);
63
+ // 存放菜单是否存在showTooltip属性标识
64
+ const hoverMenuMap = new WeakMap();
65
+ // 存储菜单文本dom元素
66
+ const menuTextRef = ref(null);
67
+
68
+ function hoverMenu(key) {
69
+ // 如果当前菜单showTooltip属性已存在,退出计算
70
+ if (hoverMenuMap.get(key)) return;
71
+
72
+ nextTick(() => {
73
+ // 如果文本内容的整体宽度大于其可视宽度,则文本溢出
74
+ menuTextRef.value?.scrollWidth > menuTextRef.value?.clientWidth
75
+ ? Object.assign(key, {
76
+ showTooltip: true
77
+ })
78
+ : Object.assign(key, {
79
+ showTooltip: false
80
+ });
81
+
82
+ hoverMenuMap.set(key, true);
83
+ });
84
+ }
85
+
86
+ // 左侧菜单折叠后,当菜单没有图标时只显示第一个文字并加上省略号
87
+ function overflowSlice(text, item?: any) {
88
+ const newText = (text?.length > 1 ? text.toString().slice(0, 1) : text) + '...';
89
+ if (item && !(isCollapse.value && item?.parentId === null)) {
90
+ return appHook.layout === 'mix' && item?.pathList?.length === 2 && isCollapse.value ? newText : text;
91
+ }
92
+ return newText;
93
+ }
94
+ function hasOneShowingChild(children: childrenType[] = [], parent: childrenType) {
95
+ const showingChildren = children.filter((item: any) => {
96
+ onlyOneChild.value = item;
97
+ return true;
98
+ });
99
+ if (showingChildren[0]?.meta?.showParent) {
100
+ return false;
101
+ }
102
+ if (showingChildren.length === 1) {
103
+ return true;
104
+ }
105
+
106
+ if (showingChildren.length === 0) {
107
+ onlyOneChild.value = { ...parent, path: '', noShowingChildren: true };
108
+ return true;
109
+ }
110
+ return false;
111
+ }
112
+
113
+ function resolvePath(routePath) {
114
+ const httpReg = /^http(s?):\/\//;
115
+ if (httpReg.test(routePath) || httpReg.test(props.basePath)) {
116
+ return routePath || props.basePath;
117
+ } else {
118
+ return path.resolve(props.basePath, routePath);
119
+ }
120
+ }
121
+ </script>
122
+
123
+ <template>
124
+ <template
125
+ v-if="
126
+ hasOneShowingChild(props.item.children, props.item) &&
127
+ (!onlyOneChild.children || onlyOneChild.noShowingChildren)
128
+ "
129
+ >
130
+ <el-menu-item
131
+ :index="resolvePath(onlyOneChild.path)"
132
+ :class="{
133
+ 'submenu-title-noDropdown': !isNest,
134
+ 'submenu-mix-fold': !appHook.sidebar.opened && appHook.layout === 'mix'
135
+ }"
136
+ :style="getNoDropdownStyle"
137
+ >
138
+ <div
139
+ v-if="toRaw(props.item.meta.icon)"
140
+ class="sub-menu-icon"
141
+ :class="onlyOneChild.meta.icon || props.item?.meta?.icon"
142
+ >
143
+ <component
144
+ :is="
145
+ useRenderIcon(
146
+ toRaw(onlyOneChild.meta.icon) || (props.item.meta && toRaw(props.item.meta.icon))
147
+ )
148
+ "
149
+ />
150
+ </div>
151
+ <div v-if="!appHook.sidebar.opened && appHook.layout === 'mix'" class="ut-mix-title">
152
+ <span>
153
+ {{ transformI18n(onlyOneChild.meta.title) }}
154
+ </span>
155
+ </div>
156
+ <template #title>
157
+ <div :style="getDivStyle">
158
+ <span v-if="!menuMode">{{ transformI18n(onlyOneChild.meta.title) }}</span>
159
+ <el-tooltip v-else placement="top" :offset="-10" :disabled="!onlyOneChild.showTooltip">
160
+ <template #content>
161
+ {{ transformI18n(onlyOneChild.meta.title) }}
162
+ </template>
163
+ <span ref="menuTextRef" :style="getMenuTextStyle" @mouseover="hoverMenu(onlyOneChild)">
164
+ {{ transformI18n(onlyOneChild.meta.title) }}
165
+ </span>
166
+ </el-tooltip>
167
+ <extraIcon :extra-icon="onlyOneChild.meta.extraIcon" />
168
+ </div>
169
+ </template>
170
+ </el-menu-item>
171
+ </template>
172
+
173
+ <el-sub-menu v-else ref="subMenu" :index="resolvePath(props.item.path)" teleported>
174
+ <template #title>
175
+ <div v-if="toRaw(props.item.meta.icon)" class="sub-menu-icon" :class="props.item.meta.icon">
176
+ <component :is="useRenderIcon(props.item.meta && props.item.meta.icon)" />
177
+ </div>
178
+ <span v-if="!menuMode">{{ transformI18n(props.item.meta.title) }}</span>
179
+ <el-tooltip
180
+ v-else
181
+ placement="top"
182
+ :offset="-10"
183
+ :disabled="!appHook.sidebar.opened || !props.item.showTooltip"
184
+ >
185
+ <template #content>
186
+ {{ transformI18n(props.item.meta.title) }}
187
+ </template>
188
+ <div ref="menuTextRef" :style="getSubTextStyle" @mouseover="hoverMenu(props.item)">
189
+ <span :style="getSpanStyle">
190
+ {{ overflowSlice(transformI18n(props.item.meta.title), props.item) }}
191
+ </span>
192
+ </div>
193
+ </el-tooltip>
194
+ <extraIcon v-if="!isCollapse" :extra-icon="props.item.meta.extraIcon" />
195
+ </template>
196
+ <sidebar-item
197
+ v-for="child in props.item.children"
198
+ :key="child.path"
199
+ :is-nest="true"
200
+ :item="child"
201
+ :base-path="resolvePath(child.path)"
202
+ class="nest-menu"
203
+ />
204
+ </el-sub-menu>
205
+ </template>
@@ -0,0 +1,94 @@
1
+ <!--
2
+ * @Author: wei.li
3
+ * @Date: 2021-11-17 16:02:30
4
+ * @LastEditors: levi7754 levi7754@163.com
5
+ * @LastEditTime: 2023-10-09 12:00:16
6
+ * @Description: 左侧边栏
7
+ -->
8
+
9
+ <script setup lang="ts">
10
+ import Logo from './sidebar-logo.vue';
11
+ import { emitter } from '../../../utils/mitt';
12
+ import { useNav } from '../..//hooks/useNav';
13
+ import SidebarItem from './sidebarItem.vue';
14
+ import { storageLocal } from '@utogether/utils';
15
+ import { useRoute } from 'vue-router';
16
+ import { ref, computed, watch, onMounted, onBeforeUnmount } from 'vue';
17
+ import { findRouteByPath, getParentPaths } from '../../../router/utils';
18
+ import { responsiveStorageNameSpace } from '../../../config';
19
+ import { usePermissionStoreHook } from '../../../store/modules/permission';
20
+
21
+ defineOptions({ name: 'LayoutVertical' });
22
+
23
+ const route = useRoute();
24
+ const showLogo = ref(storageLocal.getItem(`${responsiveStorageNameSpace()}configure`)?.showLogo ?? true);
25
+ const { device, appHook, isCollapse, menuSelect } = useNav();
26
+ const subMenuData = ref([]);
27
+
28
+ const menuData = computed(() => {
29
+ return appHook.layout === 'mix' && device.value !== 'mobile'
30
+ ? subMenuData.value
31
+ : usePermissionStoreHook().wholeMenus;
32
+ });
33
+
34
+ const loading = computed(() =>
35
+ appHook.layout === 'mix' ? false : menuData.value.length === 0 ? true : false
36
+ );
37
+
38
+ function getSubMenuData(path) {
39
+ subMenuData.value = [];
40
+ // path的上级路由组成的数组
41
+ const parentPathArr = getParentPaths(path, usePermissionStoreHook().wholeMenus);
42
+ // 当前路由的父级路由信息
43
+ const parenetRoute = findRouteByPath(parentPathArr[0] || path, usePermissionStoreHook().wholeMenus);
44
+ if (!parenetRoute?.children) return;
45
+ subMenuData.value = parenetRoute?.children;
46
+ }
47
+
48
+ getSubMenuData(route.path);
49
+
50
+ watch(
51
+ () => route.path,
52
+ () => {
53
+ if (route.path.includes('/redirect')) return;
54
+ getSubMenuData(route.path);
55
+ menuSelect(route.path);
56
+ }
57
+ );
58
+ onMounted(() => {
59
+ emitter.on('logoChange', key => {
60
+ showLogo.value = key;
61
+ });
62
+ });
63
+ onBeforeUnmount(() => {
64
+ // 解绑`logoChange`公共事件,防止多次触发
65
+ emitter.off('logoChange');
66
+ });
67
+ </script>
68
+
69
+ <template>
70
+ <div v-spinning="loading" :class="['sidebar-container', showLogo ? 'has-logo' : 'no-logo']">
71
+ <Logo v-if="showLogo" :collapse="isCollapse" />
72
+ <el-scrollbar wrap-class="scrollbar-wrapper" :class="[device === 'mobile' ? 'mobile' : 'pc']">
73
+ <template #default>
74
+ <el-menu
75
+ :default-active="route.path"
76
+ :collapse="isCollapse"
77
+ :collapse-transition="false"
78
+ router
79
+ mode="vertical"
80
+ popper-class="udp-scrollbar"
81
+ class="select-none outer-most"
82
+ >
83
+ <sidebar-item
84
+ v-for="routes in menuData"
85
+ :key="routes.path"
86
+ :item="routes"
87
+ class="select-none outer-most"
88
+ :base-path="routes.path"
89
+ />
90
+ </el-menu>
91
+ </template>
92
+ </el-scrollbar>
93
+ </div>
94
+ </template>
@@ -0,0 +1,375 @@
1
+ @keyframes schedule-in-width {
2
+ from {
3
+ width: 0;
4
+ }
5
+
6
+ to {
7
+ width: 100%;
8
+ }
9
+ }
10
+
11
+ @keyframes schedule-out-width {
12
+ from {
13
+ width: 100%;
14
+ }
15
+
16
+ to {
17
+ width: 0;
18
+ }
19
+ }
20
+
21
+ .tags-view {
22
+ position: relative;
23
+ display: flex;
24
+ align-items: center;
25
+ width: 100%;
26
+ font-size: 14px;
27
+ color: var(--el-text-color-primary);
28
+ background: #fff;
29
+ box-shadow: 0 0 1px #888;
30
+
31
+ .scroll-item {
32
+ position: relative;
33
+ display: inline-block;
34
+ height: 34px;
35
+ padding-left: 6px;
36
+ line-height: 34px;
37
+ cursor: pointer;
38
+ transition: all 0.4s;
39
+
40
+ &:not(:first-child) {
41
+ padding-right: 24px;
42
+ }
43
+
44
+ &.chrome-item {
45
+ padding-right: 0;
46
+ padding-left: 0;
47
+ margin-right: -18px;
48
+ box-shadow: none;
49
+ }
50
+
51
+ .el-icon-close {
52
+ position: absolute;
53
+ top: 50%;
54
+ display: inline-flex;
55
+ align-items: center;
56
+ justify-content: center;
57
+ width: 18px;
58
+ height: 18px;
59
+ color: var(--el-color-primary);
60
+ cursor: pointer;
61
+ border-radius: 4px;
62
+ transform: translate(0, -50%);
63
+ transition:
64
+ background-color 0.12s,
65
+ color 0.12s;
66
+
67
+ &:hover {
68
+ color: rgb(0 0 0 / 88%) !important;
69
+ background-color: rgb(0 0 0 / 6%);
70
+ }
71
+ }
72
+ }
73
+
74
+ .tag-title {
75
+ padding: 0 4px;
76
+ color: var(--el-text-color-primary);
77
+ text-decoration: none;
78
+ }
79
+
80
+ .scroll-container {
81
+ position: relative;
82
+ flex: 1;
83
+ overflow: hidden;
84
+
85
+ // padding: 5px 0;
86
+ white-space: nowrap;
87
+
88
+ &.chrome-scroll-container {
89
+ padding-top: 4px;
90
+
91
+ .fixed-tag {
92
+ padding: 0 !important;
93
+ }
94
+ }
95
+
96
+ .tab {
97
+ position: relative;
98
+ float: left;
99
+ overflow: visible;
100
+ white-space: nowrap;
101
+ list-style: none;
102
+ transition: transform 0.5s ease-in-out;
103
+
104
+ .scroll-item {
105
+ transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
106
+
107
+ &:nth-child(1) {
108
+ padding: 0 12px;
109
+ }
110
+
111
+ &.chrome-item {
112
+ &:nth-child(1) {
113
+ padding: 0;
114
+ }
115
+ }
116
+ }
117
+
118
+ .fixed-tag {
119
+ padding: 0 12px;
120
+ }
121
+ }
122
+ }
123
+
124
+ /* 右键菜单 */
125
+ .contextmenu {
126
+ position: absolute;
127
+ padding: 5px 0;
128
+ margin: 0;
129
+ font-size: 13px;
130
+ font-weight: normal;
131
+ color: var(--el-text-color-primary);
132
+ white-space: nowrap;
133
+ outline: 0;
134
+ list-style-type: none;
135
+ background: #fff;
136
+ border-radius: 4px;
137
+ box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
138
+
139
+ li {
140
+ display: flex;
141
+ align-items: center;
142
+ width: 100%;
143
+ padding: 7px 12px;
144
+ margin: 0;
145
+ cursor: pointer;
146
+
147
+ &:hover {
148
+ // background: var(--el-color-primary-light-9);
149
+ color: var(--el-color-primary);
150
+ }
151
+
152
+ svg {
153
+ display: block;
154
+ margin-right: 0.5em;
155
+ }
156
+ }
157
+ }
158
+ }
159
+
160
+ .el-dropdown-menu {
161
+ li {
162
+ display: flex;
163
+ align-items: center;
164
+ width: 100%;
165
+ margin: 0;
166
+ cursor: pointer;
167
+
168
+ svg {
169
+ display: block;
170
+ margin-right: 0.5em;
171
+ }
172
+ }
173
+ }
174
+
175
+ .el-dropdown-menu__item:not(.is-disabled):hover {
176
+ color: #606266;
177
+ background: #f0f0f0;
178
+ }
179
+
180
+ :deep(.el-dropdown-menu__item) i {
181
+ margin-right: 10px;
182
+ }
183
+
184
+ :deep(.el-dropdown-menu__item--divided) {
185
+ margin: 1px 0;
186
+ }
187
+
188
+ .el-dropdown-menu__item--divided::before {
189
+ margin: 0;
190
+ }
191
+
192
+ .el-dropdown-menu__item.is-disabled {
193
+ cursor: not-allowed;
194
+ }
195
+
196
+ .scroll-item.is-active {
197
+ position: relative;
198
+ color: #fff;
199
+ box-shadow: 0 0 0.7px #888;
200
+
201
+ .chrome-tab {
202
+ z-index: 10;
203
+ }
204
+
205
+ .chrome-tab__bg {
206
+ color: var(--el-color-primary-light-9) !important;
207
+ }
208
+
209
+ .tag-title {
210
+ color: var(--el-color-primary) !important;
211
+ }
212
+
213
+ .chrome-close-btn {
214
+ color: var(--el-color-primary);
215
+
216
+ &:hover {
217
+ background-color: var(--el-color-primary);
218
+ }
219
+ }
220
+
221
+ .chrome-tab-divider {
222
+ opacity: 0;
223
+ }
224
+ }
225
+
226
+ .arrow-left,
227
+ .arrow-right,
228
+ .arrow-down {
229
+ position: relative;
230
+ display: flex;
231
+ align-items: center;
232
+ justify-content: center;
233
+ width: 40px;
234
+ height: 34px;
235
+ color: var(--el-text-color-primary);
236
+
237
+ svg {
238
+ width: 20px;
239
+ height: 20px;
240
+ }
241
+ }
242
+
243
+ .arrow-left {
244
+ box-shadow: 5px 0 5px -6px #ccc;
245
+
246
+ &:hover {
247
+ cursor: w-resize;
248
+ }
249
+ }
250
+
251
+ .arrow-right {
252
+ border-right: 0.5px solid #ccc;
253
+ box-shadow: -5px 0 5px -6px #ccc;
254
+
255
+ &:hover {
256
+ cursor: e-resize;
257
+ }
258
+ }
259
+
260
+ /* 卡片模式下鼠标移入显示蓝色边框 */
261
+ .card-in {
262
+ color: var(--el-color-primary);
263
+
264
+ .tag-title {
265
+ color: var(--el-color-primary);
266
+ }
267
+ }
268
+
269
+ /* 卡片模式下鼠标移出隐藏蓝色边框 */
270
+ .card-out {
271
+ color: #666;
272
+ border: none;
273
+
274
+ .tag-title {
275
+ color: #666;
276
+ }
277
+ }
278
+
279
+ /* 灵动模式 */
280
+ .schedule-active {
281
+ position: absolute;
282
+ bottom: 0;
283
+ left: 0;
284
+ width: 100%;
285
+ height: 2px;
286
+ background: var(--el-color-primary);
287
+ }
288
+
289
+ /* 灵动模式下鼠标移入显示蓝色进度条 */
290
+ .schedule-in {
291
+ position: absolute;
292
+ bottom: 0;
293
+ left: 0;
294
+ width: 100%;
295
+ height: 2px;
296
+ background: var(--el-color-primary);
297
+ animation: schedule-in-width 400ms ease-in;
298
+ }
299
+
300
+ /* 灵动模式下鼠标移出隐藏蓝色进度条 */
301
+ .schedule-out {
302
+ position: absolute;
303
+ bottom: 0;
304
+ left: 0;
305
+ width: 0;
306
+ height: 2px;
307
+ background: var(--el-color-primary);
308
+ animation: schedule-out-width 400ms ease-in;
309
+ }
310
+
311
+ /* 谷歌风格的页签 */
312
+ .chrome-tab {
313
+ position: relative;
314
+ display: inline-flex;
315
+ gap: 16px;
316
+ align-items: center;
317
+ justify-content: center;
318
+ padding: 0 24px;
319
+ white-space: nowrap;
320
+ cursor: pointer;
321
+
322
+ .tag-title {
323
+ padding: 0;
324
+ }
325
+
326
+ .chrome-tab-divider {
327
+ position: absolute;
328
+ right: 7px;
329
+ width: 1px;
330
+ height: 14px;
331
+ background-color: #bdcbd9;
332
+ }
333
+
334
+ &:hover {
335
+ z-index: 10;
336
+
337
+ .chrome-tab__bg {
338
+ color: #dee1e6;
339
+ }
340
+
341
+ .tag-title {
342
+ color: #1f1f1f;
343
+ }
344
+
345
+ .chrome-tab-divider {
346
+ opacity: 0;
347
+ }
348
+ }
349
+
350
+ .chrome-tab__bg {
351
+ position: absolute;
352
+ top: 0;
353
+ left: 0;
354
+ z-index: -10;
355
+ width: 100%;
356
+ height: 100%;
357
+ color: transparent;
358
+ pointer-events: none;
359
+ }
360
+
361
+ .chrome-close-btn {
362
+ display: inline-flex;
363
+ align-items: center;
364
+ justify-content: center;
365
+ width: 16px;
366
+ height: 16px;
367
+ color: #666;
368
+ border-radius: 50%;
369
+
370
+ &:hover {
371
+ color: white;
372
+ background-color: #b1b3b8;
373
+ }
374
+ }
375
+ }