@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,331 @@
1
+ <template>
2
+ <vxe-modal
3
+ v-model="showModal"
4
+ :loading="loading"
5
+ width="75%"
6
+ height="80%"
7
+ title="常用菜单设置(拖动可改变菜单顺序)"
8
+ class-name="u-favorite-modal"
9
+ show-footer
10
+ @close="onClose"
11
+ >
12
+ <template #default>
13
+ <div class="">
14
+ <el-scrollbar heigth="100" class="w-full border-b border-slate-300">
15
+ <template #default>
16
+ <div class="w-full h-24">
17
+ <el-empty v-if="!favoriteMenus.length" :image-size="50" description="" class="p-0" />
18
+ <draggable
19
+ :list="favoriteMenus"
20
+ handle=".drag-item"
21
+ animation="300"
22
+ item-key="id"
23
+ class="flex"
24
+ @end="onMoveEnd"
25
+ >
26
+ <template #item="{ element, index }">
27
+ <div class="">
28
+ <div
29
+ class="h-24 w-24 flex justify-center items-center flex-col relative drag-item ut-menu-top-item"
30
+ >
31
+ <div
32
+ class="rounded-full w-10 h-10 flex items-center justify-center"
33
+ :style="{ backgroundColor: getColor(index) }"
34
+ >
35
+ <iconify-icon-offline
36
+ :icon="element.icon || `ri:${icons[index]}-line`"
37
+ class="text-2xl text-white"
38
+ />
39
+ </div>
40
+ <span
41
+ class="w-[90%] text-xs mt-2 text-ellipsis overflow-hidden whitespace-nowrap text-center"
42
+ >
43
+ {{ element.menuName }}
44
+ </span>
45
+ <i
46
+ class="ri-indeterminate-circle-line right-3 top-2 text-base hidden ut-menu-del"
47
+ @click="onRemoveFavorite(element, index)"
48
+ />
49
+ </div>
50
+ </div>
51
+ </template>
52
+ </draggable>
53
+ </div>
54
+ </template>
55
+ </el-scrollbar>
56
+ <el-scrollbar class="u-favorite-menu--contain">
57
+ <template #default>
58
+ <div class="p-3">
59
+ <div v-for="menu in menuList" :key="menu.id" class="grandparent-node">
60
+ <div class="flex items-center">
61
+ <div class="w-2 h-4 bg-green-400" />
62
+ <div class="ml-1 font-bold text-base">{{ menu.menuName }}</div>
63
+ </div>
64
+ <div class="pl-3 py-2">
65
+ <vxe-checkbox-group v-model="checkboxModel[menu.id]" @change="onChange(menu, $event)">
66
+ <vxe-checkbox
67
+ v-for="item in handleMenuCategoryGroup(menu).menus"
68
+ :key="item.id"
69
+ :label="item.id"
70
+ :content="item.menuName"
71
+ />
72
+ </vxe-checkbox-group>
73
+ </div>
74
+ <div
75
+ v-for="item in handleMenuCategoryGroup(menu).folder"
76
+ :key="item.id"
77
+ class="parent-node pl-3"
78
+ >
79
+ <div class="flex items-center">
80
+ <div class="w-2 h-4 bg-blue-400" />
81
+ <div class="ml-1 font-bold text-sm">{{ item.menuName }}</div>
82
+ </div>
83
+
84
+ <div class="pl-3 py-2">
85
+ <vxe-checkbox-group
86
+ v-model="checkboxModel[item.id]"
87
+ @change="onChange(item, $event)"
88
+ >
89
+ <vxe-checkbox
90
+ v-for="child in handleMenuCategoryGroup(item).menus"
91
+ :key="child.id"
92
+ :label="child.id"
93
+ :content="child.menuName"
94
+ />
95
+ </vxe-checkbox-group>
96
+ </div>
97
+ <div
98
+ v-for="child in handleMenuCategoryGroup(item).folder"
99
+ :key="child.id"
100
+ class="child-node pl-3"
101
+ >
102
+ <div class="flex items-center">
103
+ <div class="w-2 h-4 bg-red-400" />
104
+ <div class="ml-1 font-bold text-sm">{{ child.menuName }}</div>
105
+ </div>
106
+
107
+ <div class="py-2">
108
+ <vxe-checkbox-group
109
+ v-model="checkboxModel[child.id]"
110
+ @change="onChange(item, $event)"
111
+ >
112
+ <vxe-checkbox
113
+ v-for="subChild in handleMenuCategoryGroup(child).menus"
114
+ :key="subChild.id"
115
+ :label="subChild.id"
116
+ :content="subChild.menuName"
117
+ />
118
+ </vxe-checkbox-group>
119
+ </div>
120
+ </div>
121
+ </div>
122
+ </div>
123
+ </div>
124
+ </template>
125
+ </el-scrollbar>
126
+ </div>
127
+ </template>
128
+ <template #footer>
129
+ <div class="flex justify-end">
130
+ <ut-button content="cancel" status="warning" @tap="onClose" />
131
+ <ut-button content="confirm" @tap="onConfirm" />
132
+ </div>
133
+ </template>
134
+ </vxe-modal>
135
+ </template>
136
+ <script setup lang="ts">
137
+ import { ref, onMounted, nextTick } from 'vue';
138
+ import { clone, max } from 'xe-utils';
139
+ import { dbstorage, delay, warnMessage, successMessage } from '@utogether/utils';
140
+ import Draggable from 'vuedraggable';
141
+ import { getServiceApi } from '../../../api';
142
+
143
+ interface IProps {
144
+ dataSource: IRecord[];
145
+ icons: Array<String>;
146
+ userName: string;
147
+ }
148
+
149
+ const props = withDefaults(defineProps<IProps>(), {
150
+ dataSource: () => [],
151
+ icons: () => [],
152
+ userName: ''
153
+ });
154
+
155
+ // 用户菜单
156
+ const favoriteMenus = ref([]);
157
+ const menuList = ref([]);
158
+ const showModal = ref(false);
159
+ const loading = ref(false);
160
+ const checkboxModel = ref<IRecord>({});
161
+ // const cacheCheckModel = {}; // 缓存最初选中的数据
162
+
163
+ const url = '/upms/v1/menuFavority';
164
+
165
+ const getCacheMenuList = async () => {
166
+ menuList.value = await dbstorage.getItem(`U-${props.userName}-ROUTES`);
167
+ menuList.value = menuList.value.filter(f => f.menuCode !== 'SysHome');
168
+ await delay(64);
169
+ setCheckboxedMenu();
170
+ };
171
+
172
+ /** 上部删除 */
173
+ const onRemoveFavorite = (item, idx) => {
174
+ favoriteMenus.value.splice(idx, 1);
175
+ const index = checkboxModel.value[item.parentId]?.findIndex(f => f === item.menuId);
176
+ checkboxModel.value[item.parentId].splice(index, 1);
177
+ // index = cacheCheckModel[item.parentId]?.findIndex(f => f.id === item.id);
178
+ // cacheCheckModel[item.parentId].splice(index, 1);
179
+ };
180
+
181
+ /** 菜单分组 */
182
+ const handleMenuCategoryGroup = data => {
183
+ const folder = [];
184
+ const menus = [];
185
+ data.children.forEach(e => {
186
+ if (['5', '100'].includes(e.menuCategory)) {
187
+ folder.push(e);
188
+ } else {
189
+ menus.push(e);
190
+ }
191
+ });
192
+ return { folder, menus };
193
+ };
194
+
195
+ /** 设置默认选中 */
196
+ const setCheckboxedMenu = () => {
197
+ props.dataSource.forEach(data => {
198
+ if (checkboxModel.value[data.parentId]) {
199
+ checkboxModel.value[data.parentId].push(data.menuId);
200
+ // cacheCheckModel[data.parentId].push(data);
201
+ } else {
202
+ checkboxModel.value[data.parentId] = [data.menuId];
203
+ // cacheCheckModel[data.parentId] = [data];
204
+ }
205
+ });
206
+ };
207
+ /** checkbox change */
208
+ const onChange = (menu, event) => {
209
+ debugger;
210
+ if (event.checked) {
211
+ // 新增
212
+ if (favoriteMenus.value.length === 16) {
213
+ nextTick(() => {
214
+ checkboxModel.value[menu.id].splice(checkboxModel.value[menu.id].length - 1, 1);
215
+ });
216
+ return warnMessage('最多只能选择16个常用功能');
217
+ }
218
+ // const max = getMax();
219
+ // if (cacheCheckModel[menu.id]) {
220
+ // cacheCheckModel[menu.id].push({ id: event.label, seqNo: max + 10 });
221
+ // } else {
222
+ // cacheCheckModel[menu.id] = [{ id: event.label, seqNo: max + 10 }];
223
+ // }
224
+
225
+ const menuItem = menu.children.find(f => f.id === event.label);
226
+ if (menuItem) {
227
+ menuItem.seqNo = getMax() + 10;
228
+ menuItem.menuId = menuItem.id;
229
+ favoriteMenus.value.push(menuItem);
230
+ }
231
+ } else {
232
+ // 顶部删除
233
+ let idx = favoriteMenus.value.findIndex(f => f.menuId === event.label);
234
+ idx !== -1 && favoriteMenus.value.splice(idx, 1);
235
+ // checkbox删除
236
+ idx = checkboxModel.value[menu.id].findIndex(f => f === event.label);
237
+ idx !== -1 && checkboxModel.value[menu.id].splice(idx, 1);
238
+ // 缓存删除
239
+ // idx = cacheCheckModel[menu.id].findIndex(f => f.id === event.label);
240
+ // idx !== -1 && cacheCheckModel[menu.id].splice(idx, 1);
241
+ }
242
+ };
243
+ const onMoveEnd = () => {
244
+ favoriteMenus.value.forEach((item, idx) => {
245
+ item.seqNo = (idx + 1) * 10;
246
+ });
247
+ };
248
+ /** 获取排序最大值 */
249
+ const getMax = () => {
250
+ return max(favoriteMenus.value, item => item.seqNo)?.seqNo || 0;
251
+ };
252
+ const onConfirm = () => {
253
+ console.log(favoriteMenus);
254
+ const body = favoriteMenus.value.map(m => {
255
+ return {
256
+ userName: props.userName,
257
+ menuId: m.menuId,
258
+ seqNo: m.seqNo
259
+ };
260
+ });
261
+ console.log(body);
262
+ loading.value = true;
263
+ getServiceApi()
264
+ .post(url, body)
265
+ .then(() => {
266
+ successMessage();
267
+ onClose();
268
+ emit('success');
269
+ })
270
+ .finally(() => {
271
+ loading.value = false;
272
+ });
273
+ };
274
+
275
+ const onClose = () => {
276
+ showModal.value = false;
277
+ emit('close');
278
+ };
279
+
280
+ const getColor = idx => {
281
+ const colorSet = ['#409eff', '#67c23a', '#13c2c2', '#e85f33', 'orange'];
282
+ return colorSet[idx % 5];
283
+ };
284
+
285
+ const emit = defineEmits<{ (e: 'close'): void; (e: 'success'): void }>();
286
+
287
+ onMounted(() => {
288
+ favoriteMenus.value = clone(props.dataSource, true);
289
+ showModal.value = true;
290
+ getCacheMenuList();
291
+ });
292
+ </script>
293
+ <style lang="scss">
294
+ .u-favorite-modal {
295
+ .vxe-modal--body .vxe-modal--content {
296
+ padding: 0;
297
+ overflow: hidden !important;
298
+ }
299
+
300
+ .el-empty {
301
+ &__description {
302
+ margin-top: 10px;
303
+ }
304
+ }
305
+
306
+ .ut-menu-top-item:hover {
307
+ .ut-menu-del {
308
+ position: absolute;
309
+ display: inline-block;
310
+ color: rgb(240 94 94);
311
+ cursor: pointer;
312
+ }
313
+ }
314
+
315
+ .u-favorite-menu--contain {
316
+ height: calc(100vh - 320px);
317
+ }
318
+
319
+ .vxe-checkbox,
320
+ .vxe-checkbox + .vxe-checkbox {
321
+ width: 120px;
322
+ padding: 4px 0;
323
+ margin-right: 10px;
324
+ margin-left: 0;
325
+ }
326
+
327
+ .vxe-modal--footer {
328
+ border-top: 1px solid #e8e8e8;
329
+ }
330
+ }
331
+ </style>
@@ -0,0 +1,339 @@
1
+ <!--
2
+ * @Author: levi7754 levi7754@163.com
3
+ * @Date: 2023-11-02 10:04:05
4
+ * @LastEditors: levi7754 levi7754@163.com
5
+ * @LastEditTime: 2025-04-29 17:04:36
6
+ * @FilePath: /front-web-mes/src/views/uhome/su-welcome.vue
7
+ * @Description: 欢迎页面
8
+ -->
9
+ <template>
10
+ <div class="ut-home m-3">
11
+ <!-- 顶部 -->
12
+ <div class="h-32 mb-4 p-4 flex justify-between items-center bg-white home-page">
13
+ <div class="flex flex-row items-center flex-[2]">
14
+ <div>
15
+ <el-avatar size="large" class="text-4xl font-bold bg-[var(--el-color-primary)]">{{
16
+ firstName
17
+ }}</el-avatar>
18
+ </div>
19
+ <div class="ml-4 text-xs flex-[2]">
20
+ <div class="flex justify-center items-center">
21
+ <span> {{ getCurrentPeriod() }}, {{ systemHook.getUserInfo?.name || '' }},欢迎回来! </span>
22
+ <div
23
+ class="flex flex-[2] justify-center items-center font-bold"
24
+ style="color: var(--el-color-primary)"
25
+ >
26
+ 星光不问赶路人,岁月不负有心人,以梦为马,不负韶华!
27
+ </div>
28
+ </div>
29
+ <div class="py-2 text-gray-500 flex">
30
+ <span class="inline-block"> 所属角色: </span>
31
+ <div class="w-2/3">{{ getRole() }}</div>
32
+ </div>
33
+ <div class="text-gray-500 flex">
34
+ <span class="inline-block"> 所属组织: </span>
35
+ <div class="w-2/3">{{ getOrg() }}</div>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ <div class="flex flex-col">
40
+ <span class="text-4xl">
41
+ <ut-countdown :show-days="false" :show-labels="false" />
42
+ </span>
43
+ <div class="mt-1 ml-3">{{ getLunarDay() }}</div>
44
+ </div>
45
+ </div>
46
+ <!-- 底部 -->
47
+ <el-row class="m-2" :gutter="10">
48
+ <el-col v-spinning="loading" :lg="24" :md="24" class="">
49
+ <el-card class="mb-2">
50
+ <template #header>
51
+ <div class="flex items-center justify-between dark:bg-black">
52
+ <span class="font-bold">常用菜单</span>
53
+ <span class="text-xs text-gray-400 cursor-pointer" @click="onFavoriteMenu">
54
+ <span>更多</span>
55
+ <i class="vxe-icon-arrow-right" />
56
+ </span>
57
+ </div>
58
+ </template>
59
+
60
+ <div class="default:bg-white dark:bg-black">
61
+ <el-empty
62
+ v-if="!menuList.length"
63
+ :image-size="100"
64
+ description="快来添加常用菜单吧!"
65
+ class="p-0 pb-3"
66
+ />
67
+ <ul
68
+ class="p-0 w-full h-full grid grid-rows-1 grid-cols-8 u-dashed-menu"
69
+ :class="{ 'grid-rows-2': menuList.length > 8 }"
70
+ >
71
+ <li
72
+ v-for="(item, idx) in menuList"
73
+ :key="item.id"
74
+ class="text-center list-none bg-white"
75
+ @click="onClickMenu(item)"
76
+ >
77
+ <div class="h-20 flex justify-center items-center flex-col">
78
+ <div
79
+ class="rounded-full w-10 h-10 flex items-center justify-center"
80
+ :style="{ backgroundColor: getColor(idx) }"
81
+ >
82
+ <iconify-icon-offline
83
+ :icon="item.icon || `ri:${icons[idx]}-line`"
84
+ class="text-2xl text-white"
85
+ />
86
+ </div>
87
+ <span class="text-xs mt-2">{{ item.menuName }}</span>
88
+ </div>
89
+ </li>
90
+ </ul>
91
+ </div>
92
+ <div />
93
+ </el-card>
94
+ </el-col>
95
+
96
+ <el-col :xl="16" :lg="12" :md="24">
97
+ <el-card class="mb-2">
98
+ <template #header>
99
+ <div class="font-bold">
100
+ <span>个人动态</span>
101
+ </div>
102
+ </template>
103
+ <div class="p-3">
104
+ <ul class="p-0 w-full h-full">
105
+ <li
106
+ v-for="item in logList"
107
+ :key="item.id"
108
+ class="w-full list-none p-2 border-b border-gray-200"
109
+ >
110
+ <div class="flex">
111
+ <div>
112
+ <el-avatar class="text-base">{{ firstName }}</el-avatar>
113
+ </div>
114
+ <div class="ml-3">
115
+ <div>
116
+ <span class="text-blue-600 mr-3">{{ item.browser }}</span>
117
+ <span>{{ item.browserVersion || item.platformVersion }}</span>
118
+ </div>
119
+ <div class="text-gray-400 text-sm">{{ item.loginTime }}</div>
120
+ </div>
121
+ </div>
122
+ </li>
123
+ </ul>
124
+ </div>
125
+ </el-card>
126
+ </el-col>
127
+
128
+ <!-- 右侧 -->
129
+ <el-col :xl="8" :lg="12" :md="24" class="">
130
+ <el-card class="mb-2">
131
+ <template #header>
132
+ <div class="font-bold">
133
+ <span>日历</span>
134
+ </div>
135
+ </template>
136
+ <div class="p-1">
137
+ <ut-calendar :holidays="holidays" :statutory-holiday="statutoryHoliday" />
138
+ </div>
139
+ </el-card>
140
+ </el-col>
141
+ </el-row>
142
+ <menu-favorite
143
+ v-if="showFavorite"
144
+ :data-source="menuList"
145
+ :user-name="systemHook.getUserInfo.userName"
146
+ :icons="icons"
147
+ @close="showFavorite = false"
148
+ @success="getMenuList"
149
+ />
150
+ </div>
151
+ </template>
152
+
153
+ <script setup lang="ts">
154
+ import { ref, onMounted, computed } from 'vue';
155
+ import { useRouter } from 'vue-router';
156
+ import dayjs from 'dayjs';
157
+ import { lunarCalendar, cookies } from '@utogether/utils';
158
+ import { useSystemStoreHook } from '../../store/modules/system';
159
+ import { getServiceApi } from '../../api';
160
+ import { kLOGINER } from '../../contant';
161
+ import menuFavorite from './components/menu-favorite.vue';
162
+ defineOptions({ name: 'SuHome' });
163
+
164
+ const systemHook = useSystemStoreHook();
165
+ const router = useRouter();
166
+
167
+ const menuList = ref([]);
168
+ const logList = ref([]);
169
+ const showFavorite = ref(false);
170
+ const loading = ref(false);
171
+
172
+ const firstName = computed(() => {
173
+ return systemHook.getUserInfo.name?.slice(0, 1);
174
+ });
175
+
176
+ // 角色
177
+ const getRole = () => {
178
+ const isAdmin = systemHook.isAdminRole;
179
+ if (isAdmin) {
180
+ return '系统管理员';
181
+ } else {
182
+ return systemHook.getUserInfo?.sysRoles?.map(m => m.roleName).join(',');
183
+ }
184
+ };
185
+
186
+ // 组织
187
+ const getOrg = () => {
188
+ const isAdmin = systemHook.isAdminRole;
189
+ if (isAdmin) {
190
+ return '【系统管理员】拥有所有组织';
191
+ } else {
192
+ if (getRole() === '项目组管理员') {
193
+ return '【项目组管理员】拥有所有组织';
194
+ }
195
+ return systemHook.getOrglist?.map(m => m.orgName).join(',');
196
+ }
197
+ };
198
+
199
+ // 获取时间段
200
+ const getCurrentPeriod = () => {
201
+ const hour = Number(dayjs().format('HH'));
202
+ return hour < 12 ? '上午好' : hour < 18 ? '下午好' : '晚上好';
203
+ };
204
+
205
+ const getLunarDay = () => {
206
+ const time = new Date();
207
+ const lunarday = lunarCalendar.solar2lunar(
208
+ time.getFullYear(),
209
+ time.getMonth() + 1,
210
+ time.getDate()
211
+ ) as IRecord;
212
+ const { gzYear, IMonthCn, IDayCn, cMonth, cDay, ncWeek } = lunarday;
213
+ return `${cMonth}月${cDay}日 ${gzYear}${IMonthCn}${IDayCn} ${ncWeek}`;
214
+ };
215
+
216
+ /** 查询收藏菜单功能 */
217
+ const getMenuList = () => {
218
+ const url = '/upms/v1/menuFavority';
219
+ loading.value = true;
220
+ const query = { pageSize: 20, pageNum: 1, userName: cookies.get(kLOGINER) };
221
+ getServiceApi()
222
+ .get(url, query)
223
+ .then((res: IResponseData) => {
224
+ menuList.value = res?.list || [];
225
+ })
226
+ .finally(() => {
227
+ loading.value = false;
228
+ });
229
+ };
230
+
231
+ const onClickMenu = item => {
232
+ router.push(item.menuPath);
233
+ };
234
+
235
+ const getUserLog = () => {
236
+ const url = '/upms/v1/userMonitor';
237
+ const query = { pageSize: 8, pageNum: 1, employeeName: systemHook.getUserInfo?.name };
238
+ getServiceApi()
239
+ .get(url, query)
240
+ .then((res: IResponseData) => {
241
+ logList.value = res?.list || [];
242
+ });
243
+ };
244
+
245
+ const onFavoriteMenu = () => {
246
+ showFavorite.value = true;
247
+ };
248
+
249
+ onMounted(() => {
250
+ getMenuList();
251
+ getUserLog();
252
+ });
253
+
254
+ const getColor = idx => {
255
+ const colorSet = ['#409eff', '#67c23a', '#13c2c2', '#e85f33', 'orange'];
256
+ return colorSet[idx % 5];
257
+ };
258
+
259
+ const icons = [
260
+ 'community',
261
+ 'shield-star',
262
+ 'group',
263
+ 'settings',
264
+ 'star',
265
+ 'train',
266
+ 'send-plane',
267
+ 'rocket',
268
+ 'device',
269
+ 'compass',
270
+ 'map-pin',
271
+ 'keynote',
272
+ 'article',
273
+ 'tv',
274
+ 'database-2',
275
+ 'calendar'
276
+ ];
277
+
278
+ // 假期设置
279
+ const holidays = [
280
+ {
281
+ 2023: { 12: { 30: '班', 31: '班' } }
282
+ },
283
+ {
284
+ 2024: {
285
+ 1: { 1: '假' },
286
+ 2: {
287
+ 4: '班',
288
+ 10: '假',
289
+ 11: '假',
290
+ 12: '假',
291
+ 13: '假',
292
+ 14: '假',
293
+ 15: '假',
294
+ 16: '假',
295
+ 17: '假',
296
+ 18: '班'
297
+ },
298
+ 4: { 4: '假', 5: '假', 6: '假', 7: '班', 28: '班' },
299
+ 5: { 1: '假', 2: '假', 3: '假', 4: '假', 5: '假', 11: '班' },
300
+ 6: { 8: '假', 9: '假', 10: '假' },
301
+ 9: { 15: '假', 16: '假', 17: '假', 14: '班', 29: '班' },
302
+ 10: { 1: '假', 2: '假', 3: '假', 4: '假', 5: '假', 6: '假', 7: '假', 12: '班' }
303
+ }
304
+ }
305
+ ];
306
+ // 法定假日;
307
+ const statutoryHoliday = [
308
+ { name: '元旦', date: '2024-01-01' },
309
+ { name: '春节', date: '2024-02-10' },
310
+ { name: '清明节', date: '2024-04-04' },
311
+ { name: '劳动节', date: '2024-05-01' },
312
+ { name: '端午节', date: '2024-06-10' },
313
+ { name: '中秋节', date: '2024-09-17' },
314
+ { name: '国庆节', date: '2024-10-01' }
315
+ ];
316
+ </script>
317
+
318
+ <style lang="scss" scoped>
319
+ .ut-home {
320
+ .el-avatar--large {
321
+ --el-avatar-size: 72px;
322
+ }
323
+
324
+ ::v-deep(.el-card__body) {
325
+ padding: 0 !important;
326
+ }
327
+ }
328
+
329
+ // .u-dashed-menu {
330
+ // li {
331
+ // box-shadow: 1px 0 0 0 #e8e8e8, 0 1px 0 0 #e8e8e8, 1px 1px 0 0 #e8e8e8, 1px 0 0 0 #e8e8e8 inset,
332
+ // 0 1px 0 0 #e8e8e8 inset;
333
+ // }
334
+
335
+ // li:hover {
336
+ // box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
337
+ // }
338
+ // }
339
+ </style>