hrp-ui-base 1.4.6 → 1.4.7

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 (373) hide show
  1. package/README.md +51 -51
  2. package/dist/components.cjs +5 -5
  3. package/dist/components.es.js +2476 -2476
  4. package/dist/style.css +1 -1
  5. package/package.json +101 -101
  6. package/packages/approval-process/.eslintrc +6 -6
  7. package/packages/approval-process/README.md +22 -22
  8. package/packages/approval-process/index.ts +65 -65
  9. package/packages/approval-process/package.json +17 -17
  10. package/packages/approval-process/packages/components/choose-member/BO/departBo.ts +8 -8
  11. package/packages/approval-process/packages/components/choose-member/BO/memberBo.ts +14 -14
  12. package/packages/approval-process/packages/components/choose-member/BO/roleBo.ts +16 -16
  13. package/packages/approval-process/packages/components/choose-member/index.vue +496 -496
  14. package/packages/approval-process/packages/components/choose-member/styles/common.scss +133 -133
  15. package/packages/approval-process/packages/components/comment/assets/download.svg +4 -4
  16. package/packages/approval-process/packages/components/comment/assets/mp3.svg +11 -11
  17. package/packages/approval-process/packages/components/comment/assets/mp4.svg +11 -11
  18. package/packages/approval-process/packages/components/comment/assets/other.svg +11 -11
  19. package/packages/approval-process/packages/components/comment/assets/pdf.svg +11 -11
  20. package/packages/approval-process/packages/components/comment/assets/ppt.svg +11 -11
  21. package/packages/approval-process/packages/components/comment/assets/preview.svg +4 -4
  22. package/packages/approval-process/packages/components/comment/assets/word.svg +11 -11
  23. package/packages/approval-process/packages/components/comment/assets/xls.svg +11 -11
  24. package/packages/approval-process/packages/components/comment/index.vue +843 -843
  25. package/packages/approval-process/packages/components/comment/modules/previewMp.vue +53 -53
  26. package/packages/approval-process/packages/components/comment/styles/comment-style.scss +303 -303
  27. package/packages/approval-process/packages/components/image-cropper/index.vue +202 -202
  28. package/packages/approval-process/packages/components/sign/index.vue +766 -766
  29. package/packages/approval-process/packages/components/sign/modules/full-screen-sign.vue +19 -19
  30. package/packages/approval-process/packages/components/urge-dialog/index.vue +120 -120
  31. package/packages/approval-process/packages/components/vue-esign/index.vue +289 -289
  32. package/packages/approval-process/packages/flow/approve-component/approve-success.vue +81 -81
  33. package/packages/approval-process/packages/flow/approve-component/route-params-error.vue +48 -48
  34. package/packages/approval-process/packages/flow/approve-component/submit-success.vue +58 -58
  35. package/packages/approval-process/packages/flow/examine-approve-itr.vue +978 -978
  36. package/packages/approval-process/packages/flow/examine-approve.vue +1065 -1065
  37. package/packages/approval-process/packages/flow/form-component/associated-approval-form/README.md +38 -38
  38. package/packages/approval-process/packages/flow/form-component/associated-approval-form/index.vue +158 -158
  39. package/packages/approval-process/packages/flow/form-component/associated-approval-form/modules/associated-approval-form-mobile.vue +297 -297
  40. package/packages/approval-process/packages/flow/form-component/associated-approval-form/modules/associated-approval-form-pc.vue +314 -314
  41. package/packages/approval-process/packages/flow/form-component/associated-approval-form/style/curd-area-mobile.scss +109 -109
  42. package/packages/approval-process/packages/flow/form-component/associated-approval-form/style/curd-area.scss +95 -95
  43. package/packages/approval-process/packages/flow/form-component/associated-approval-form/style/out-put.scss +47 -47
  44. package/packages/approval-process/packages/flow/form-component/show-sign.vue +27 -27
  45. package/packages/approval-process/packages/flow/styles/common.scss +133 -133
  46. package/packages/approval-process/packages/flow/styles/examine-approve-pc.scss +465 -465
  47. package/packages/approval-process/packages/flow/styles/examine-approve-phone.scss +292 -292
  48. package/packages/approval-process/packages/flow/styles/submit-approve-pc.scss +379 -379
  49. package/packages/approval-process/packages/flow/styles/submit-approve-phone.scss +336 -336
  50. package/packages/approval-process/packages/flow/submit-approve-itr.vue +622 -622
  51. package/packages/approval-process/packages/flow/submit-approve.vue +627 -627
  52. package/packages/approval-process/packages/flow/systemCom/BO/departBo.ts +8 -8
  53. package/packages/approval-process/packages/flow/systemCom/BO/memberBo.ts +14 -14
  54. package/packages/approval-process/packages/flow/systemCom/BO/roleBo.ts +16 -16
  55. package/packages/approval-process/packages/flow/systemCom/choose-depart.vue +398 -398
  56. package/packages/approval-process/packages/flow/systemCom/choose-member-phone.vue +514 -514
  57. package/packages/approval-process/packages/flow/systemCom/choose-member.vue +564 -564
  58. package/packages/approval-process/packages/flow/systemCom/choose-role.vue +300 -300
  59. package/packages/approval-process/packages/styles/common.scss +133 -133
  60. package/packages/approval-process/packages/styles/flex-common.scss +117 -117
  61. package/packages/approval-process/packages/styles/flexCommon.scss +72 -72
  62. package/packages/approval-process/packages/styles/main.css +216 -216
  63. package/packages/approval-process/packages/styles/router-page.scss +370 -370
  64. package/packages/approval-process/packages/styles/style-set.ts +207 -207
  65. package/packages/approval-process/packages/types.d.ts +3 -3
  66. package/packages/approval-process/packages/utils/base.ts +15 -15
  67. package/packages/approval-process/packages/utils/crypto.ts +66 -66
  68. package/packages/approval-process/packages/utils/ddUtils.ts +56 -56
  69. package/packages/approval-process/packages/utils/debounce.ts +35 -35
  70. package/packages/approval-process/packages/utils/des.js +1107 -1107
  71. package/packages/approval-process/packages/utils/download.ts +38 -38
  72. package/packages/approval-process/packages/utils/editor.ts +36 -36
  73. package/packages/approval-process/packages/utils/getEnv.ts +36 -36
  74. package/packages/approval-process/packages/utils/os.ts +20 -20
  75. package/packages/approval-process/packages/utils/path-util.ts +31 -31
  76. package/packages/approval-process/packages/utils/routerUtil.ts +304 -304
  77. package/packages/approval-process/packages/utils/string-utils.ts +13 -13
  78. package/packages/approval-process/packages/utils/throttle.ts +44 -44
  79. package/packages/approval-process/packages/utils/validate.ts +92 -92
  80. package/packages/approval-process/packages/utils/ws.ts +218 -218
  81. package/packages/approval-process/tsconfig.json +72 -72
  82. package/packages/approval-process/vite.config.ts +56 -56
  83. package/src/api/bms/dict/bo/DictConfigBO.ts +23 -23
  84. package/src/api/bms/dict/bo/DictConfigBaseVO.ts +24 -24
  85. package/src/api/bms/dict/bo/DictConfigSearchBO.ts +12 -12
  86. package/src/api/bms/dict/bo/DictImportBO.ts +6 -6
  87. package/src/api/bms/dict/bo/DictVO.ts +21 -21
  88. package/src/api/bms/dict/bo/PageBaseVO.ts +8 -8
  89. package/src/api/bms/dict/bo/TotalDictBO.ts +11 -11
  90. package/src/api/bms/dict/bo/TotalDictPageVO.ts +17 -17
  91. package/src/api/bms/dict/dict-controller.ts +78 -78
  92. package/src/api/bms/file/FileExportController.ts +19 -19
  93. package/src/api/bms/file/FileUploadController.ts +131 -131
  94. package/src/api/bms/file/bo/FileBaseInfo.ts +13 -13
  95. package/src/api/bms/file/bo/FileExportVO.ts +17 -17
  96. package/src/api/bms/file/bo/FilePreviewVO.ts +8 -8
  97. package/src/api/bms/file/bo/FileUploadInfo.ts +22 -22
  98. package/src/api/bms/file/bo/FileUrlVO.ts +10 -10
  99. package/src/api/bms/file/bo/StsTokenVO.ts +20 -20
  100. package/src/api/bms/flow/FlowCommentController.ts +50 -50
  101. package/src/api/bms/flow/FlowInstanceController.ts +179 -179
  102. package/src/api/bms/flow/FlowProcessController.ts +55 -55
  103. package/src/api/bms/flow/FlowSheetController.ts +27 -27
  104. package/src/api/bms/flow/FlowSignController.ts +76 -76
  105. package/src/api/bms/flow/bo/AssociatedApprovalBO.ts +15 -15
  106. package/src/api/bms/flow/bo/AssociatedApprovalVO.ts +35 -35
  107. package/src/api/bms/flow/bo/AuditBaseInfo.ts +39 -39
  108. package/src/api/bms/flow/bo/ButtonVo.ts +7 -7
  109. package/src/api/bms/flow/bo/DingCallbackBo.ts +13 -13
  110. package/src/api/bms/flow/bo/FlowCommentBO.ts +12 -12
  111. package/src/api/bms/flow/bo/FlowCommentVO.ts +23 -23
  112. package/src/api/bms/flow/bo/FlowInstanceBO.ts +14 -14
  113. package/src/api/bms/flow/bo/FlowNodeVO.ts +24 -24
  114. package/src/api/bms/flow/bo/FlowNoticeBO.ts +17 -17
  115. package/src/api/bms/flow/bo/FlowProcessBO.ts +13 -13
  116. package/src/api/bms/flow/bo/FlowProcessVO.ts +9 -9
  117. package/src/api/bms/flow/bo/FlowReplyVO.ts +23 -23
  118. package/src/api/bms/flow/bo/FlowSheetVO.ts +16 -16
  119. package/src/api/bms/flow/bo/InstanceBackBO.ts +9 -9
  120. package/src/api/bms/flow/bo/InstanceNodeBO.ts +13 -13
  121. package/src/api/bms/flow/bo/InstanceNodeVO.ts +21 -21
  122. package/src/api/bms/flow/bo/NodeShowVo.ts +19 -19
  123. package/src/api/bms/flow/bo/ReviewBO.ts +11 -11
  124. package/src/api/bms/flow/bo/SheetSearchBO.ts +11 -11
  125. package/src/api/bms/flow/bo/SystemVO.ts +7 -7
  126. package/src/api/bms/flow/bo/TransmitBO.ts +9 -9
  127. package/src/api/bms/flow/bo/UrgeFlowBO.ts +7 -7
  128. package/src/api/bms/flow/bo/UserBaseInfoVo.ts +13 -13
  129. package/src/api/bms/flow/bo/UserInfoVo.ts +44 -44
  130. package/src/api/bms/flow/bo/UserResultVo.ts +17 -17
  131. package/src/api/bms/flow/bo/ValueMapBo.ts +7 -7
  132. package/src/api/bms/home/HomeController.ts +106 -106
  133. package/src/api/bms/home/bo/CollectedMenuBo.ts +9 -9
  134. package/src/api/bms/home/bo/DeptBaseVo.ts +9 -9
  135. package/src/api/bms/home/bo/DomainVO.ts +13 -13
  136. package/src/api/bms/home/bo/FunPermission.ts +17 -17
  137. package/src/api/bms/home/bo/GroupVO.ts +10 -10
  138. package/src/api/bms/home/bo/HomeMenu.ts +22 -22
  139. package/src/api/bms/home/bo/HomeMenuVo.ts +11 -11
  140. package/src/api/bms/home/bo/PersonalizationBo.ts +17 -17
  141. package/src/api/bms/home/bo/PersonalizationVo.ts +19 -19
  142. package/src/api/bms/home/bo/PhoneMenu.ts +14 -14
  143. package/src/api/bms/home/bo/SearchMenuVo.ts +10 -10
  144. package/src/api/bms/home/bo/UserBaseInfoVo.ts +11 -11
  145. package/src/api/bms/permission-manage/PermissionController.ts +133 -133
  146. package/src/api/bms/permission-manage/bo/DataScopeConfig.ts +17 -17
  147. package/src/api/bms/permission-manage/bo/DataScopePoint.ts +15 -15
  148. package/src/api/bms/permission-manage/bo/DeptBaseVo.ts +9 -9
  149. package/src/api/bms/permission-manage/bo/FunPermissionConfig.ts +18 -18
  150. package/src/api/bms/permission-manage/bo/FunPointVo.ts +9 -9
  151. package/src/api/bms/permission-manage/bo/PermissionGroupBo.ts +11 -11
  152. package/src/api/bms/permission-manage/bo/PermissionGroupMemberVo.ts +18 -18
  153. package/src/api/bms/permission-manage/bo/PermissionGroupPageVo.ts +17 -17
  154. package/src/api/bms/permission-manage/bo/PermissionGroupVo.ts +17 -17
  155. package/src/api/bms/permission-manage/bo/RoleBaseVo.ts +9 -9
  156. package/src/api/bms/permission-manage/bo/TheFirstStepVo.ts +13 -13
  157. package/src/api/bms/permission-manage/bo/TheSecondStepVo.ts +14 -14
  158. package/src/api/bms/permission-manage/bo/UserBaseInfoVo.ts +11 -11
  159. package/src/api/bms/tabulation/TabulationController.ts +78 -78
  160. package/src/api/bms/tabulation/bo/FieldConditionBO.ts +10 -10
  161. package/src/api/bms/tabulation/bo/FieldConditionVO.ts +10 -10
  162. package/src/api/bms/tabulation/bo/OperateButtonVO.ts +9 -9
  163. package/src/api/bms/tabulation/bo/PersonViewVO.ts +33 -33
  164. package/src/api/bms/tabulation/bo/SearchVO.ts +33 -33
  165. package/src/api/bms/tabulation/bo/TabulationBO.ts +14 -14
  166. package/src/api/bms/tabulation/bo/ViewSortBO.ts +7 -7
  167. package/src/api/bms/tabulation/bo/ViewVO.ts +12 -12
  168. package/src/api/common/FileBaseInfo.ts +10 -10
  169. package/src/api/common/ResponseBean.ts +9 -9
  170. package/src/api/common/ResponseBeanList.ts +15 -15
  171. package/src/api/common/ResponseBeanTablePage.ts +21 -21
  172. package/src/api/common/TableQueryCriteriaVO.ts +10 -10
  173. package/src/api/common/bo/PageResult.ts +22 -22
  174. package/src/api/hrms/dept/bo/DeptBaseVo.ts +6 -6
  175. package/src/api/hrms/dept/bo/DeptTreeVo.ts +23 -23
  176. package/src/api/hrms/dept/bo/DeptUserVo.ts +9 -9
  177. package/src/api/hrms/dept/bo/DeptUsersVo.ts +10 -10
  178. package/src/api/hrms/dept/bo/DeptVo.ts +19 -19
  179. package/src/api/hrms/dept/bo/UserBaseInfoVo.ts +7 -7
  180. package/src/api/hrms/dept/deptController.ts +100 -100
  181. package/src/api/hrms/role/bo/RoleBaseVo.ts +6 -6
  182. package/src/api/hrms/role/bo/RoleGroupVo.ts +11 -11
  183. package/src/api/hrms/role/bo/RoleVo.ts +22 -22
  184. package/src/api/hrms/role/roleController.ts +19 -19
  185. package/src/api/hrms/user/bo/UserBaseInfoVo.ts +11 -11
  186. package/src/api/hrms/user/bo/UserCardVO.ts +13 -13
  187. package/src/api/hrms/user/bo/UserDeptBO.ts +13 -13
  188. package/src/api/hrms/user/bo/UserRoleBO.ts +11 -11
  189. package/src/api/hrms/user/bo/UserVO.ts +23 -23
  190. package/src/api/hrms/user/userController.ts +86 -86
  191. package/src/api/index.ts +9 -9
  192. package/src/api/notice/NoticeController.ts +73 -73
  193. package/src/api/notice/bo/NoticePageBO.ts +24 -24
  194. package/src/api/notice/bo/NoticeVO.ts +31 -31
  195. package/src/api/work-order-pc/flow/Bo/ValueMapBo.ts +7 -7
  196. package/src/api/work-order-pc/flow/ItrFlowProcessController.ts +41 -41
  197. package/src/api/work-order-pc/flow/Vo/FlowNodeVO.ts +24 -24
  198. package/src/api/work-order-pc/flow/Vo/UserInfoVo.ts +44 -44
  199. package/src/assets/layout/avatar-default.svg +6 -6
  200. package/src/assets/layout/collect-active.svg +7 -7
  201. package/src/assets/layout/collect-default.svg +7 -7
  202. package/src/assets/layout/download-active.svg +8 -8
  203. package/src/assets/layout/download-default.svg +8 -8
  204. package/src/assets/layout/export-dark.svg +7 -7
  205. package/src/assets/layout/export-default.svg +7 -7
  206. package/src/assets/layout/font-active.svg +6 -6
  207. package/src/assets/layout/font-default.svg +6 -6
  208. package/src/assets/layout/help-active.svg +10 -10
  209. package/src/assets/layout/help-default.svg +10 -10
  210. package/src/assets/layout/home-active.svg +6 -6
  211. package/src/assets/layout/home.svg +6 -6
  212. package/src/assets/layout/menu-expand.svg +6 -6
  213. package/src/assets/layout/menu-position-active.svg +6 -6
  214. package/src/assets/layout/menu-position-default.svg +6 -6
  215. package/src/assets/layout/message-active.svg +9 -9
  216. package/src/assets/layout/message-default.svg +9 -9
  217. package/src/assets/layout/moon.svg +8 -8
  218. package/src/assets/layout/router-all-dark.svg +11 -11
  219. package/src/assets/layout/router-all-default.svg +17 -17
  220. package/src/assets/layout/search-active.svg +20 -20
  221. package/src/assets/layout/search-default.svg +20 -20
  222. package/src/assets/layout/star-default.svg +3 -3
  223. package/src/assets/layout/sun-active.svg +6 -6
  224. package/src/assets/layout/sun-default.svg +6 -6
  225. package/src/assets/layout/switch-moon.svg +3 -3
  226. package/src/assets/layout/switch-sun.svg +41 -41
  227. package/src/assets/layout/todo-active.svg +12 -12
  228. package/src/assets/layout/todo-default.svg +12 -12
  229. package/src/assets/layout/user-dark.svg +13 -13
  230. package/src/assets/layout/user-default.svg +13 -13
  231. package/src/assets/no-permiss-dark.svg +16 -16
  232. package/src/assets/no-permiss-day.svg +16 -16
  233. package/src/assets/process/drawer/manyLevel1close.svg +9 -9
  234. package/src/assets/process/drawer/manyLevel1open.svg +6 -6
  235. package/src/assets/process/drawer/manyLevel2close.svg +6 -6
  236. package/src/assets/process/drawer/manyLevel2open.svg +6 -6
  237. package/src/assets/table-delete/table-delete.svg +2 -2
  238. package/src/components/annex-img-upload/assets/download.svg +4 -4
  239. package/src/components/annex-img-upload/assets/mp3.svg +11 -11
  240. package/src/components/annex-img-upload/assets/mp4.svg +11 -11
  241. package/src/components/annex-img-upload/assets/other.svg +11 -11
  242. package/src/components/annex-img-upload/assets/pdf.svg +11 -11
  243. package/src/components/annex-img-upload/assets/ppt.svg +11 -11
  244. package/src/components/annex-img-upload/assets/preview.svg +4 -4
  245. package/src/components/annex-img-upload/assets/word.svg +11 -11
  246. package/src/components/annex-img-upload/assets/xls.svg +11 -11
  247. package/src/components/annex-img-upload/index.vue +609 -609
  248. package/src/components/annex-img-upload/modules/previewMp.vue +53 -53
  249. package/src/components/annex-upload/assets/download.svg +4 -4
  250. package/src/components/annex-upload/assets/mp3.svg +11 -11
  251. package/src/components/annex-upload/assets/mp4.svg +11 -11
  252. package/src/components/annex-upload/assets/other.svg +11 -11
  253. package/src/components/annex-upload/assets/pdf.svg +11 -11
  254. package/src/components/annex-upload/assets/ppt.svg +11 -11
  255. package/src/components/annex-upload/assets/preview.svg +4 -4
  256. package/src/components/annex-upload/assets/word.svg +11 -11
  257. package/src/components/annex-upload/assets/xls.svg +11 -11
  258. package/src/components/annex-upload/index.vue +800 -798
  259. package/src/components/annex-upload/modules/previewMp.vue +53 -53
  260. package/src/components/annex-upload-weijian/assets/download.svg +4 -4
  261. package/src/components/annex-upload-weijian/assets/mp3.svg +11 -11
  262. package/src/components/annex-upload-weijian/assets/mp4.svg +11 -11
  263. package/src/components/annex-upload-weijian/assets/other.svg +11 -11
  264. package/src/components/annex-upload-weijian/assets/pdf.svg +11 -11
  265. package/src/components/annex-upload-weijian/assets/ppt.svg +11 -11
  266. package/src/components/annex-upload-weijian/assets/preview.svg +4 -4
  267. package/src/components/annex-upload-weijian/assets/word.svg +11 -11
  268. package/src/components/annex-upload-weijian/assets/xls.svg +11 -11
  269. package/src/components/annex-upload-weijian/index.vue +772 -772
  270. package/src/components/annex-upload-weijian/modules/previewMp.vue +53 -53
  271. package/src/components/base-layout/index.vue +199 -199
  272. package/src/components/button.vue +14 -14
  273. package/src/components/layout/ApprovalCenterDrawer.vue +231 -231
  274. package/src/components/layout/ExportCenterDrawer.vue +164 -164
  275. package/src/components/layout/LayoutContainer.vue +542 -542
  276. package/src/components/layout/SysHeader.vue +90 -90
  277. package/src/components/layout/SysHeaderLeft.vue +114 -114
  278. package/src/components/layout/SysHeaderRight.vue +112 -112
  279. package/src/components/layout/SysHeaderTabs.vue +289 -289
  280. package/src/components/layout/components/avatar-component.vue +77 -77
  281. package/src/components/layout/components/dark-component.vue +82 -82
  282. package/src/components/layout/components/download-component.vue +49 -49
  283. package/src/components/layout/components/font-size-component.vue +66 -66
  284. package/src/components/layout/components/menu-position-component.vue +97 -97
  285. package/src/components/layout/components/message-component.vue +64 -64
  286. package/src/components/layout/components/todo-component.vue +55 -55
  287. package/src/components/layout/index.ts +34 -34
  288. package/src/components/layout/message/message-dictionary.ts +27 -27
  289. package/src/components/layout/message/message-icon//345/205/250/351/203/250/351/200/232/347/237/245-/350/223/235.svg +8 -8
  290. package/src/components/layout/message/message-icon//345/205/250/351/203/250/351/200/232/347/237/245-/351/273/221.svg +8 -8
  291. package/src/components/layout/message/message-icon//345/205/250/351/203/250/351/200/232/347/237/245.svg +8 -8
  292. package/src/components/layout/message/message-icon//345/205/254/345/221/212/351/200/232/347/237/245-/350/223/235.svg +12 -12
  293. package/src/components/layout/message/message-icon//345/205/254/345/221/212/351/200/232/347/237/245-/351/273/221.svg +12 -12
  294. package/src/components/layout/message/message-icon//345/205/254/345/221/212/351/200/232/347/237/245.svg +12 -12
  295. package/src/components/layout/message/message-icon//345/256/241/346/211/271/351/200/232/347/237/245-/350/223/235.svg +8 -8
  296. package/src/components/layout/message/message-icon//345/256/241/346/211/271/351/200/232/347/237/245-/351/273/221.svg +8 -8
  297. package/src/components/layout/message/message-icon//345/256/241/346/211/271/351/200/232/347/237/245.svg +8 -8
  298. package/src/components/layout/message/message-icon//345/257/274/345/207/272/351/200/232/347/237/245-/350/223/235.svg +13 -13
  299. package/src/components/layout/message/message-icon//345/257/274/345/207/272/351/200/232/347/237/245-/351/273/221.svg +13 -13
  300. package/src/components/layout/message/message-icon//345/257/274/345/207/272/351/200/232/347/237/245.svg +13 -13
  301. package/src/components/layout/message/message-icon//346/234/252/350/257/273/351/200/232/347/237/245-/350/223/235.svg +11 -11
  302. package/src/components/layout/message/message-icon//346/234/252/350/257/273/351/200/232/347/237/245-/351/273/221.svg +11 -11
  303. package/src/components/layout/message/message-icon//346/234/252/350/257/273/351/200/232/347/237/245.svg +11 -11
  304. package/src/components/layout/message/message-icon//347/251/272/347/212/266/346/200/201.svg +17 -17
  305. package/src/components/layout/message/message-icon//347/263/273/347/273/237/351/200/232/347/237/245-/350/223/235.svg +13 -13
  306. package/src/components/layout/message/message-icon//347/263/273/347/273/237/351/200/232/347/237/245-/351/273/221.svg +13 -13
  307. package/src/components/layout/message/message-icon//347/263/273/347/273/237/351/200/232/347/237/245.svg +13 -13
  308. package/src/components/layout/message/message-notification-drawer.vue +533 -533
  309. package/src/components/layout/personal-sign/ImageCropper.vue +187 -187
  310. package/src/components/layout/personal-sign/PersonalSignDialog.vue +658 -658
  311. package/src/components/layout/personalization-guide-dialog.vue +255 -255
  312. package/src/components/layout/plugin.ts +32 -32
  313. package/src/components/layout/sideMenu-global.scss +115 -115
  314. package/src/components/layout/sideMenu.scss +312 -312
  315. package/src/components/layout/sideMenu.vue +541 -541
  316. package/src/components/layout/sideMenuSonList.vue +185 -185
  317. package/src/components/layout/stores/index.ts +5 -5
  318. package/src/components/layout/stores/useLayoutConfigStore.ts +231 -231
  319. package/src/components/layout/stores/useLayoutMenuStore.ts +232 -232
  320. package/src/components/layout/stores/useLayoutNoticeStore.ts +77 -77
  321. package/src/components/layout/stores/useLayoutTabsStore.ts +367 -367
  322. package/src/components/layout/styles/icon.scss +72 -72
  323. package/src/components/layout/types.ts +98 -98
  324. package/src/components/layout/utils/redirect.ts +144 -144
  325. package/src/components/list-search-content/components/index.ts +11 -11
  326. package/src/components/list-search-content/components/search-date-range.vue +74 -74
  327. package/src/components/list-search-content/components/search-date-time-range.vue +48 -48
  328. package/src/components/list-search-content/components/search-date.vue +97 -97
  329. package/src/components/list-search-content/components/search-input-number.vue +59 -59
  330. package/src/components/list-search-content/components/search-input.vue +46 -46
  331. package/src/components/list-search-content/components/search-multiple_select.vue +69 -69
  332. package/src/components/list-search-content/components/search-select.vue +64 -64
  333. package/src/components/list-search-content/index.vue +803 -803
  334. package/src/components/list-search-content/modules/add-views-package-dialog.vue +147 -147
  335. package/src/components/list-search-content/modules/search-condition-area.vue +252 -252
  336. package/src/components/list-search-content/modules/views-package-manage-dialog.vue +265 -265
  337. package/src/components/switch.vue +16 -16
  338. package/src/components.ts +67 -67
  339. package/src/enum/system/StorageEnum.ts +4 -4
  340. package/src/global.d.ts +19 -19
  341. package/src/index.ts +4 -4
  342. package/src/init.ts +37 -37
  343. package/src/styles/common.scss +133 -133
  344. package/src/styles/flex-common.scss +117 -117
  345. package/src/styles/flexCommon.scss +72 -72
  346. package/src/styles/main.css +277 -277
  347. package/src/styles/router-page.scss +370 -370
  348. package/src/styles/style-set.ts +809 -809
  349. package/src/utils/HttpUtil.ts +427 -427
  350. package/src/utils/base.ts +47 -47
  351. package/src/utils/cell-style.ts +11 -11
  352. package/src/utils/crypto.ts +98 -98
  353. package/src/utils/dd-utils.ts +157 -157
  354. package/src/utils/debounce.ts +35 -35
  355. package/src/utils/debounceleading.ts +48 -48
  356. package/src/utils/download.ts +38 -38
  357. package/src/utils/exitLogin.ts +58 -58
  358. package/src/utils/filter-key.ts +4 -4
  359. package/src/utils/formatter-handler.ts +12 -12
  360. package/src/utils/get-dict.ts +26 -26
  361. package/src/utils/get-env.ts +36 -36
  362. package/src/utils/login-path.ts +35 -35
  363. package/src/utils/path-utils.ts +31 -31
  364. package/src/utils/permit-utils.ts +68 -68
  365. package/src/utils/router-utils.ts +321 -321
  366. package/src/utils/string-utils.ts +166 -166
  367. package/src/utils/style-set.ts +750 -750
  368. package/src/utils/throttle.ts +62 -62
  369. package/src/utils/transform-data.ts +31 -31
  370. package/src/utils/validate.ts +92 -92
  371. package/src/utils/ws.ts +218 -218
  372. package/src/utils/wujie-son.ts +50 -50
  373. package/src/utils.ts +24 -24
@@ -1,772 +1,772 @@
1
- <!--
2
- * @description: 附件上传组件(卫健版)
3
- * - 与 annex-upload 的差异:
4
- * 1. 单文件大小上限 50MB(普通版 20MB)
5
- * 2. 支持医疗影像 .dcm 文件类型
6
- * - 接口与上传/预览策略已与最新版 annex-upload 对齐
7
- * @fileName: annex-upload-weijian/index.vue
8
- * @author: huatuo
9
- !-->
10
- <template>
11
- <div class="upload-attachments">
12
- <!-- 上传 -->
13
- <el-upload
14
- class="fzile-uploader"
15
- ref="upload"
16
- v-model:file-list="fileList"
17
- :auto-upload="true"
18
- accept=".docx,.doc,.xls,.xlsx,.jpg,.pdf,.png,.bmp,.ppt,.pptx,.jpeg,.tiff,.raw,.heif,.gif,.mp3,.mp4,.rar,.zip,.7z,.wps,.dcm,.DOCX,.DOC,.XLS,.XLSX,.JPG,.PDF,.PNG,.BMP,.PPT,.PPTX,.JPEG,.TIFF,.RAW,.HEIF,.GIF,.MP3,.MP4,.RAR,.ZIP,.7Z,.WPS,.DCM"
19
- :before-upload="beforeUploadOSS"
20
- :action="uploadUrl"
21
- :show-file-list="false"
22
- :data="{ pageId: props.pageId }"
23
- list-type="picture"
24
- :on-exceed="handleExceed"
25
- :limit="props.limited"
26
- v-if="props.formType != 'detail'"
27
- :headers="ossHeader"
28
- size="large"
29
- :disabled="props.loading"
30
- :http-request="uploadFileOSS"
31
- multiple
32
- >
33
- <el-button
34
- type="primary"
35
- text
36
- bg
37
- icon="Upload"
38
- style="font-size: var(--font-size-body)"
39
- size="large"
40
- >上传附件</el-button
41
- >
42
- <template #tip>
43
- <div class="el-upload__tip">
44
- 附件上限数量{{ props.limited }}个,单次最多选择{{
45
- props.limited
46
- }}个,单文件大小不超过50MB
47
- 且附件上传格式仅限docx、doc、wps、xls、xlsx、jpg、pdf、png、bmp、ppt、pptx、jpeg、raw、heif、tiff、gif、mp3、mp4、dcm、rar、zip、7z。
48
- </div>
49
- </template>
50
- </el-upload>
51
-
52
- <div class="file-list-box flex-row-start">
53
- <div
54
- class="file-out-box"
55
- v-for="(item, index) in sendFileList"
56
- :key="index"
57
- @click.stop="previewFile(item, index)"
58
- >
59
- <div class="file-list-item flex-row-between">
60
- <div class="flex-row-start file-list-item-left">
61
- <el-image
62
- class="file-list-item-icon"
63
- :src="item.url"
64
- :zoom-rate="1.2"
65
- :initial-index="0"
66
- fit="cover"
67
- preview-teleported="true"
68
- @error="handleImageError"
69
- @load="handleImageLoad"
70
- v-loading="submitLoading"
71
- v-if="
72
- getFileType(item.url) === 'jpg' ||
73
- getFileType(item.url) === 'png' ||
74
- getFileType(item.url) === 'bmp' ||
75
- getFileType(item.url) === 'jpeg' ||
76
- getFileType(item.url) === 'raw' ||
77
- getFileType(item.url) === 'heif' ||
78
- getFileType(item.url) === 'tiff' ||
79
- getFileType(item.url) === 'gif'
80
- "
81
- >
82
- <template #error>
83
- <img src="./assets/other.svg" class="file-icon" />
84
- </template>
85
- </el-image>
86
- <div v-else class="file-list-item-icon">
87
- <img
88
- src="./assets/pdf.svg"
89
- v-if="getFileType(item.url) === 'pdf'"
90
- class="file-icon"
91
- />
92
- <img
93
- src="./assets/word.svg"
94
- v-else-if="
95
- getFileType(item.url) === 'docx' ||
96
- getFileType(item.url) === 'doc'
97
- "
98
- class="file-icon"
99
- />
100
- <img
101
- src="./assets/mp3.svg"
102
- v-else-if="getFileType(item.url) === 'mp3'"
103
- class="file-icon"
104
- />
105
- <img
106
- src="./assets/mp4.svg"
107
- v-else-if="getFileType(item.url) === 'mp4'"
108
- class="file-icon"
109
- />
110
- <img
111
- src="./assets/xls.svg"
112
- v-else-if="
113
- getFileType(item.url) === 'xls' ||
114
- getFileType(item.url) === 'xlsx'
115
- "
116
- class="file-icon"
117
- />
118
- <img
119
- src="./assets/ppt.svg"
120
- v-else-if="
121
- getFileType(item.url) === 'ppt' ||
122
- getFileType(item.url) === 'pptx'
123
- "
124
- class="file-icon"
125
- />
126
- <img src="./assets/other.svg" v-else class="file-icon" />
127
- </div>
128
- <div
129
- class="flex-column-around file-name-box"
130
- style="align-items: flex-start"
131
- >
132
- <el-tooltip effect="dark" :content="item.fileName">
133
- <div class="file-name">{{ item.fileName }}</div>
134
- </el-tooltip>
135
- <div class="file-size">{{ item.fileSize || "--" }}</div>
136
- </div>
137
- </div>
138
- <div class="flex-column-around file-list-item-right">
139
- <img
140
- src="./assets/preview.svg"
141
- alt=""
142
- class="file-preview"
143
- @click.stop="previewFile(item, index)"
144
- />
145
-
146
- <img
147
- src="./assets/download.svg"
148
- alt=""
149
- class="file-download"
150
- @click.stop="downloadFile(item)"
151
- v-if="props.allowDownload"
152
- />
153
- </div>
154
- </div>
155
- <div
156
- class="delete-box"
157
- @click.stop="deleteUploadItem(item, index)"
158
- v-if="props.formType != 'detail'"
159
- >
160
- <div class="table-delete">
161
- <img
162
- src="../../assets/table-delete/table-delete.svg"
163
- alt="删除"
164
- width="25"
165
- height="25"
166
- />
167
- </div>
168
- </div>
169
- </div>
170
- <div
171
- class="notData"
172
- v-if="
173
- props.formType == 'detail' &&
174
- !(
175
- sendFileList &&
176
- Array.isArray(sendFileList) &&
177
- sendFileList.length > 0
178
- )
179
- "
180
- >
181
- 暂无附件
182
- </div>
183
- </div>
184
- <!-- 专门用来预览的组件 -->
185
- <el-image
186
- style="display: none"
187
- ref="previewImgRef"
188
- :src="perviewImg.url"
189
- :preview-src-list="perviewImg.srcList"
190
- preview-teleported="true"
191
- id="previewImgId"
192
- @close="handleClosePreview"
193
- >
194
- </el-image>
195
- <!-- 预览mp3,mp4 -->
196
- <PreviewMp ref="previewMpRef"></PreviewMp>
197
- </div>
198
- </template>
199
-
200
- <script setup lang="ts">
201
- import { ref, watch, onMounted, PropType, nextTick } from "vue";
202
- import {
203
- type UploadUserFile,
204
- ElMessage,
205
- } from "element-plus";
206
- import axios from "axios";
207
- import { getFileType, ddWindowOpen } from "hrp-ui-base";
208
- import PreviewMp from "./modules/previewMp.vue";
209
- import FileUploadController from "hrp-ui-base/api/bms/file/FileUploadController";
210
- import StsTokenVO from "hrp-ui-base/api/bms/file/bo/StsTokenVO";
211
- import FileBaseInfo from "hrp-ui-base/api/bms/file/bo/FileBaseInfo";
212
- import FileUrlVO from "hrp-ui-base/api/bms/file/bo/FileUrlVO";
213
- import { downloadFile } from "hrp-ui-base";
214
-
215
- const props = defineProps({
216
- // 上传方式(保留 prop 以兼容外部传参,但实际预览读取 sessionStorage.userConfig.fileUploadType)
217
- type: {
218
- type: String as PropType<"oss" | "minio">,
219
- default: "oss",
220
- require: true,
221
- },
222
- // 页面id
223
- pageId: {
224
- type: String,
225
- default: "",
226
- require: true,
227
- },
228
- // formType 页面类型
229
- formType: {
230
- type: String as PropType<"add" | "edit" | "detail">,
231
- default: "add",
232
- require: true,
233
- },
234
- // 默认的文件列表
235
- fileDetailList: {
236
- type: Array as PropType<any[]>,
237
- default: false,
238
- require: false,
239
- },
240
- // 页面的loading,由外部控制内部的loading
241
- loading: {
242
- type: Boolean,
243
- require: true,
244
- default: false,
245
- },
246
- keyForReturn: {
247
- type: Number,
248
- require: true,
249
- default: "",
250
- },
251
- limited: {
252
- type: Number,
253
- require: true,
254
- default: 9,
255
- },
256
- // 是否允许下载附件
257
- allowDownload: {
258
- type: Boolean,
259
- require: false,
260
- default: true,
261
- },
262
- });
263
- const emits = defineEmits(["getUploadIds", "getUploadInfo", "changeLoading"]);
264
- const token = localStorage.getItem("TOKEN");
265
- const uploadUrl =
266
- window.location.origin + window.location.pathname + "api/bms/file/upload";
267
- const minioHeader = ref({ "Authorization-Token": token });
268
- const ossHeader = ref({
269
- // 指定该Object被下载时的网页缓存行为。
270
- "Cache-Control": "no-cache",
271
- // 指定该Object被下载时的名称。
272
- "Content-Disposition": "example.txt",
273
- // 指定该Object被下载时的内容编码格式。
274
- "Content-Encoding": "utf-8",
275
- // 指定过期时间,单位为毫秒。
276
- Expires: "1000",
277
- // 指定Object的存储类型。
278
- "x-oss-storage-class": "Standard",
279
- // 指定Object标签,可同时设置多个标签。
280
- "x-oss-tagging": "Tag1=1&Tag2=2",
281
- // 指定初始化分片上传时是否覆盖同名Object。此处设置为true,表示禁止覆盖同名Object。
282
- "x-oss-forbid-overwrite": "true",
283
- });
284
- const uploadFilesIds = ref<string[]>([]);
285
- const fileInfoList = ref<any[]>([]);
286
-
287
- const handleClosePreview = () => {
288
- perviewImg.value.url = "";
289
- perviewImg.value.srcList = [];
290
- };
291
- const submitLoading = ref<boolean>(false);
292
- // 上传附件
293
- const fileList = ref<UploadUserFile[]>([]);
294
- const fileName = ref<string>("");
295
- const beforeUploadOSS = async (e: any) => {
296
-
297
- changeLoadingStatus(true);
298
- // 卫健版差异点:单文件大小上限 50MB
299
- const is50M = e.size / 1024 / 1024 < 50;
300
- if (!is50M) {
301
- changeLoadingStatus(false);
302
- ElMessage.error("上传文件大小不能超过 50MB!");
303
- return false;
304
- }
305
- fileName.value = e.name;
306
- };
307
-
308
- /** oss 上传方法(接口已对齐最新版 annex-upload,使用 FileUploadController.upload) */
309
- const uploadFileOSS = async (uploadMsg: any) => {
310
- try {
311
- console.log(uploadMsg);
312
- const fileOBJ = uploadMsg.file;
313
- FileUploadController.upload(fileOBJ, props.pageId)
314
- .then((data) => {
315
- if (data.code === 200 && data.res) {
316
- sendFileList.value.push(data.res);
317
- emits(
318
- "getUploadIds",
319
- sendFileList.value.map((item) => {
320
- return item.fileId;
321
- }),
322
- props.keyForReturn
323
- );
324
- emits(
325
- "getUploadInfo",
326
- sendFileList.value.map((item) => {
327
- return item;
328
- }),
329
- props.keyForReturn
330
- );
331
- } else {
332
- ElMessage.error("数据发生错误,请重新上传!");
333
- }
334
- })
335
- .catch((err) => {
336
- ElMessage.error("数据发生错误,请重试!");
337
- })
338
- .finally(() => {
339
- changeLoadingStatus(false);
340
- });
341
- } catch (err) {
342
- console.debug(err);
343
- }
344
- };
345
- const ossClient = ref();
346
- const handleImageLoad = () => {
347
- changeLoadingStatus(false);
348
- };
349
- const handleImageError = () => {
350
- changeLoadingStatus(false);
351
- };
352
- const handleExceed = (e: any) => {
353
- ElMessage({
354
- message: `最多上传${props.limited}个文件!`,
355
- type: "error",
356
- });
357
- };
358
- const sendFileList = ref<Array<FileBaseInfo>>([]);
359
- /** 删除 */
360
- const deleteUploadItem = (item: any, index: any) => {
361
- sendFileList.value.splice(index, 1);
362
- fileList.value = JSON.parse(JSON.stringify(sendFileList.value));
363
- emits(
364
- "getUploadIds",
365
- sendFileList.value.map((item) => {
366
- return item.fileId;
367
- }),
368
- props.keyForReturn
369
- );
370
- emits(
371
- "getUploadInfo",
372
- sendFileList.value.map((item) => {
373
- return item;
374
- }),
375
- props.keyForReturn
376
- );
377
- };
378
- watch(
379
- () => {
380
- return props.fileDetailList;
381
- },
382
- () => {
383
- if (props.fileDetailList && Array.isArray(props.fileDetailList)) {
384
- sendFileList.value = props.fileDetailList;
385
- fileList.value = JSON.parse(JSON.stringify(sendFileList.value));
386
- }
387
- },
388
- { deep: true, immediate: true }
389
- );
390
-
391
- /** 上传中 */
392
- const handleUploadProgress = () => {
393
- emits("changeLoading", true);
394
- };
395
- /** 上传失败 */
396
- const handleUploadError = (err: any) => {
397
- ElMessage({
398
- message: "上传失败!",
399
- type: "error",
400
- });
401
- changeLoadingStatus(false);
402
- };
403
- const changeLoadingStatus = (status: boolean) => {
404
- emits("changeLoading", status);
405
- submitLoading.value = status;
406
- };
407
-
408
- //清空图片列表
409
- const clearFileList = () => {
410
- sendFileList.value = [];
411
- };
412
-
413
- /** 上传的方式 */
414
- onMounted(() => {});
415
- const ossName = ref<string>("");
416
- const stsToken = ref<StsTokenVO>(new StsTokenVO());
417
-
418
- /** 获取minio 上传地址 */
419
- const minioOption = ref<FileUrlVO>(new FileUrlVO());
420
- const getMinioUploadUrl = async (fileName: string) => {
421
- await FileUploadController.getUploadUrl(props.pageId, fileName).then(
422
- (data) => {
423
- if (data.code === 200 && data.res) {
424
- minioOption.value = data.res;
425
- } else {
426
- ElMessage.error("获取上传路径失败!");
427
- }
428
- }
429
- );
430
- };
431
- /** minio 上传方法 */
432
- const uploadFileMinio = async (uploadMsg: any) => {
433
- console.debug(uploadMsg);
434
- if (minioOption.value) {
435
- try {
436
- let config = { "Content-Type": uploadMsg.file.type };
437
- axiosPost("put", minioOption.value.policyUrl, uploadMsg.file, config)
438
- .then(function (res) {
439
- setTimeout(() => {
440
- FileUploadController.checkFileUpload(
441
- minioOption.value.fileId ? minioOption.value.fileId : ""
442
- )
443
- .then((data) => {
444
- if (data.code == 200) {
445
- FileUploadController.getMinioFileUrl(
446
- minioOption.value.fileId ? minioOption.value.fileId : ""
447
- )
448
- .then((data) => {
449
- if (data.code === 200 && data.res) {
450
- sendFileList.value.push(data.res);
451
- ElMessage.success("上传成功!");
452
- emits(
453
- "getUploadIds",
454
- sendFileList.value.map((item) => {
455
- return item.fileId;
456
- }),
457
- props.keyForReturn
458
- );
459
- emits(
460
- "getUploadInfo",
461
- sendFileList.value.map((item) => {
462
- return item;
463
- }),
464
- props.keyForReturn
465
- );
466
- }
467
- })
468
- .finally(() => {
469
- changeLoadingStatus(false);
470
- });
471
- } else {
472
- ElMessage.error("上传失败,请重新上传!");
473
- changeLoadingStatus(false);
474
- }
475
- })
476
- .catch(() => {
477
- ElMessage.error("上传失败,请重新上传!");
478
- changeLoadingStatus(false);
479
- });
480
- }, 1000);
481
- })
482
- .catch(() => {
483
- ElMessage.error("上传失败,请重新上传!");
484
- changeLoadingStatus(false);
485
- });
486
- } catch (err) {
487
- console.debug(err);
488
- }
489
- } else {
490
- ElMessage.error("数据发生错误,请重新上传!");
491
- }
492
- };
493
- function axiosPost(method: string, url: string, data: any, config: any) {
494
- let result = axios({
495
- method: method,
496
- url: url,
497
- data: data,
498
- headers: config,
499
- })
500
- .then((resp) => {
501
- return resp;
502
- })
503
- .catch((error) => {
504
- return "exception=" + error;
505
- });
506
- return result;
507
- }
508
- /** 预览文件(接口已对齐最新版 annex-upload) */
509
- const previewFile = async (item: FileBaseInfo, index: number) => {
510
- if (
511
- getFileType(item.url) === "jpg" ||
512
- getFileType(item.url) === "png" ||
513
- getFileType(item.url) === "bmp" ||
514
- getFileType(item.url) === "jpeg" ||
515
- getFileType(item.url) === "raw" ||
516
- getFileType(item.url) === "heif" ||
517
- getFileType(item.url) === "tiff" ||
518
- getFileType(item.url) === "gif"
519
- ) {
520
- // 图片的情况
521
- perviewImg.value.url = item.url;
522
- perviewImg.value.srcList = [item.url];
523
- nextTick(() => {
524
- previewImgRef.value?.showPreview();
525
- });
526
- } else if (getFileType(item.url) === "mp3") {
527
- previewMpRef.value?.open("mp3", item);
528
- } else if (getFileType(item.url) === "mp4") {
529
- previewMpRef.value?.open("mp4", item);
530
- } else if (
531
- getFileType(item.url) === "zip" ||
532
- getFileType(item.url) === "7z" ||
533
- getFileType(item.url) === "rar" ||
534
- getFileType(item.url) === "dcm"
535
- ) {
536
- // 压缩包 / 医疗影像 dcm 无在线预览,直接下载
537
- downloadFile(item);
538
- } else {
539
- try {
540
- let currentUserConfig = sessionStorage.getItem("userConfig")
541
- ? JSON.parse(sessionStorage.getItem("userConfig") as string)
542
- : null;
543
- if (currentUserConfig && currentUserConfig.fileUploadType === "oss") {
544
- await FileUploadController.getFilePreview(item.fileId).then((data) => {
545
- if (data.code == 200 && data.res) {
546
- ddWindowOpen(
547
- window.location.origin +
548
- window.location.pathname +
549
- "ay-doc/index.html?url=" +
550
- data.res.webOfficeUrl +
551
- "&token=" +
552
- data.res.accessToken
553
- );
554
- } else {
555
- ElMessage.error("预览失败,请稍后再试!");
556
- }
557
- });
558
- } else if (
559
- currentUserConfig &&
560
- currentUserConfig.fileUploadType === "minio"
561
- ) {
562
- FileUploadController.getMinioFilePreview(item.fileId).then((data) => {
563
- if (data.code == 200 && data.res) {
564
- window.open(
565
- window.location.origin +
566
- window.location.pathname +
567
- "preview/onlinePreview?url=" +
568
- data.res
569
- );
570
- }
571
- });
572
- }
573
- } catch (error) {
574
- alert("读取本地用户信息失败!");
575
- }
576
- }
577
- };
578
- // Base64编码(支持中文)
579
- function base64Encode(str: string) {
580
- return btoa(
581
- encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, p1) =>
582
- String.fromCharCode(parseInt("0x" + p1, 16))
583
- )
584
- );
585
- }
586
-
587
- /** 专门用来预览的组件 */
588
- const previewImgRef = ref();
589
- const perviewImg = ref<{ url: string; srcList: string[] }>({
590
- url: "",
591
- srcList: [],
592
- });
593
- /** mp3,mp4 预览 */
594
- const previewMpRef = ref();
595
- defineExpose({
596
- clearFileList,
597
- sendFileList,
598
- });
599
- </script>
600
-
601
- <style lang="scss">
602
- @use "../../styles/flex-common.scss";
603
-
604
- .file-uploader {
605
- .imgSize {
606
- width: 99px;
607
-
608
- > span {
609
- cursor: pointer;
610
- position: absolute;
611
- color: black;
612
- font-size: 20px;
613
- right: -69px;
614
- height: 30px;
615
- top: -12px;
616
- width: 37px;
617
- }
618
-
619
- el-image {
620
- width: 100%;
621
- }
622
- }
623
-
624
- .el-upload__tip {
625
- font-size: var(--font-size-body);
626
- font-weight: 400;
627
- text-align: left;
628
- color: var(--custom-theme-text-3);
629
- }
630
- }
631
-
632
- .upload-attachments {
633
- .notData {
634
- font-size: var(--font-size-body);
635
- }
636
-
637
- .el-upload-list {
638
- position: relative;
639
- text-align: center;
640
- display: flex;
641
- flex-wrap: wrap;
642
- width: 100%;
643
-
644
- .el-upload-list__item {
645
- margin-left: 5px;
646
- flex-direction: column;
647
- width: 17%;
648
- }
649
- }
650
-
651
- .file-uploader {
652
- .imgSize {
653
- width: 99px;
654
-
655
- > span {
656
- cursor: pointer;
657
- position: absolute;
658
- color: black;
659
- font-size: 20px;
660
- right: -69px;
661
- height: 30px;
662
- top: -12px;
663
- width: 37px;
664
- }
665
-
666
- el-image {
667
- width: 100%;
668
- }
669
- }
670
- }
671
- }
672
-
673
- .preview-img {
674
- img {
675
- width: 100%;
676
- }
677
- }
678
-
679
- .exceed-limit {
680
- border-color: red !important;
681
- }
682
-
683
- .error-message {
684
- color: red;
685
- }
686
-
687
- .file-list-box {
688
- margin-top: 10px;
689
- width: 100%;
690
- height: auto;
691
-
692
- .file-out-box {
693
- cursor: pointer;
694
- border: 1px solid var(--custom-theme-border-4);
695
- border-radius: 6px 6px 6px 6px;
696
- background: var(--custom-theme-fill-7);
697
- padding: 24px 8px 8px;
698
- width: 272px;
699
- height: 80px;
700
- margin-right: 16px;
701
- margin-bottom: 16px;
702
- position: relative;
703
- }
704
-
705
- .file-list-item {
706
- width: 256px;
707
- height: 48px;
708
-
709
- .file-list-item-left {
710
- width: calc(100% - 20px);
711
- height: 100%;
712
-
713
- .file-list-item-icon {
714
- width: 41px;
715
- height: 41px;
716
-
717
- .file-icon {
718
- width: 41px;
719
- }
720
- }
721
-
722
- .file-name-box {
723
- margin-left: 8px;
724
- height: 100%;
725
- max-width: calc(100% - 50px);
726
-
727
- .file-name {
728
- font-weight: 400;
729
- font-size: 12px;
730
- color: var(--custom-theme-text-1);
731
- line-height: 12x;
732
- display: -webkit-box;
733
- -webkit-box-orient: vertical;
734
- -webkit-line-clamp: 2;
735
- overflow: hidden;
736
- word-break: break-all;
737
- }
738
-
739
- .file-size {
740
- font-weight: 400;
741
- font-size: 12px;
742
- color: var(--custom-theme-text-3);
743
- line-height: 11px;
744
- }
745
- }
746
- }
747
-
748
- .file-list-item-right {
749
- height: 100%;
750
-
751
- .file-preview {
752
- width: 16px;
753
- cursor: pointer;
754
- }
755
-
756
- .file-download {
757
- width: 16px;
758
- cursor: pointer;
759
- }
760
- }
761
- }
762
-
763
- .delete-box {
764
- position: absolute;
765
- right: -7px;
766
- top: -7px;
767
- overflow: hidden;
768
- font-size: 16px;
769
- cursor: pointer;
770
- }
771
- }
772
- </style>
1
+ <!--
2
+ * @description: 附件上传组件(卫健版)
3
+ * - 与 annex-upload 的差异:
4
+ * 1. 单文件大小上限 50MB(普通版 20MB)
5
+ * 2. 支持医疗影像 .dcm 文件类型
6
+ * - 接口与上传/预览策略已与最新版 annex-upload 对齐
7
+ * @fileName: annex-upload-weijian/index.vue
8
+ * @author: huatuo
9
+ !-->
10
+ <template>
11
+ <div class="upload-attachments">
12
+ <!-- 上传 -->
13
+ <el-upload
14
+ class="fzile-uploader"
15
+ ref="upload"
16
+ v-model:file-list="fileList"
17
+ :auto-upload="true"
18
+ accept=".docx,.doc,.xls,.xlsx,.jpg,.pdf,.png,.bmp,.ppt,.pptx,.jpeg,.tiff,.raw,.heif,.gif,.mp3,.mp4,.rar,.zip,.7z,.wps,.dcm,.DOCX,.DOC,.XLS,.XLSX,.JPG,.PDF,.PNG,.BMP,.PPT,.PPTX,.JPEG,.TIFF,.RAW,.HEIF,.GIF,.MP3,.MP4,.RAR,.ZIP,.7Z,.WPS,.DCM"
19
+ :before-upload="beforeUploadOSS"
20
+ :action="uploadUrl"
21
+ :show-file-list="false"
22
+ :data="{ pageId: props.pageId }"
23
+ list-type="picture"
24
+ :on-exceed="handleExceed"
25
+ :limit="props.limited"
26
+ v-if="props.formType != 'detail'"
27
+ :headers="ossHeader"
28
+ size="large"
29
+ :disabled="props.loading"
30
+ :http-request="uploadFileOSS"
31
+ multiple
32
+ >
33
+ <el-button
34
+ type="primary"
35
+ text
36
+ bg
37
+ icon="Upload"
38
+ style="font-size: var(--font-size-body)"
39
+ size="large"
40
+ >上传附件</el-button
41
+ >
42
+ <template #tip>
43
+ <div class="el-upload__tip">
44
+ 附件上限数量{{ props.limited }}个,单次最多选择{{
45
+ props.limited
46
+ }}个,单文件大小不超过50MB
47
+ 且附件上传格式仅限docx、doc、wps、xls、xlsx、jpg、pdf、png、bmp、ppt、pptx、jpeg、raw、heif、tiff、gif、mp3、mp4、dcm、rar、zip、7z。
48
+ </div>
49
+ </template>
50
+ </el-upload>
51
+
52
+ <div class="file-list-box flex-row-start">
53
+ <div
54
+ class="file-out-box"
55
+ v-for="(item, index) in sendFileList"
56
+ :key="index"
57
+ @click.stop="previewFile(item, index)"
58
+ >
59
+ <div class="file-list-item flex-row-between">
60
+ <div class="flex-row-start file-list-item-left">
61
+ <el-image
62
+ class="file-list-item-icon"
63
+ :src="item.url"
64
+ :zoom-rate="1.2"
65
+ :initial-index="0"
66
+ fit="cover"
67
+ preview-teleported="true"
68
+ @error="handleImageError"
69
+ @load="handleImageLoad"
70
+ v-loading="submitLoading"
71
+ v-if="
72
+ getFileType(item.url) === 'jpg' ||
73
+ getFileType(item.url) === 'png' ||
74
+ getFileType(item.url) === 'bmp' ||
75
+ getFileType(item.url) === 'jpeg' ||
76
+ getFileType(item.url) === 'raw' ||
77
+ getFileType(item.url) === 'heif' ||
78
+ getFileType(item.url) === 'tiff' ||
79
+ getFileType(item.url) === 'gif'
80
+ "
81
+ >
82
+ <template #error>
83
+ <img src="./assets/other.svg" class="file-icon" />
84
+ </template>
85
+ </el-image>
86
+ <div v-else class="file-list-item-icon">
87
+ <img
88
+ src="./assets/pdf.svg"
89
+ v-if="getFileType(item.url) === 'pdf'"
90
+ class="file-icon"
91
+ />
92
+ <img
93
+ src="./assets/word.svg"
94
+ v-else-if="
95
+ getFileType(item.url) === 'docx' ||
96
+ getFileType(item.url) === 'doc'
97
+ "
98
+ class="file-icon"
99
+ />
100
+ <img
101
+ src="./assets/mp3.svg"
102
+ v-else-if="getFileType(item.url) === 'mp3'"
103
+ class="file-icon"
104
+ />
105
+ <img
106
+ src="./assets/mp4.svg"
107
+ v-else-if="getFileType(item.url) === 'mp4'"
108
+ class="file-icon"
109
+ />
110
+ <img
111
+ src="./assets/xls.svg"
112
+ v-else-if="
113
+ getFileType(item.url) === 'xls' ||
114
+ getFileType(item.url) === 'xlsx'
115
+ "
116
+ class="file-icon"
117
+ />
118
+ <img
119
+ src="./assets/ppt.svg"
120
+ v-else-if="
121
+ getFileType(item.url) === 'ppt' ||
122
+ getFileType(item.url) === 'pptx'
123
+ "
124
+ class="file-icon"
125
+ />
126
+ <img src="./assets/other.svg" v-else class="file-icon" />
127
+ </div>
128
+ <div
129
+ class="flex-column-around file-name-box"
130
+ style="align-items: flex-start"
131
+ >
132
+ <el-tooltip effect="dark" :content="item.fileName">
133
+ <div class="file-name">{{ item.fileName }}</div>
134
+ </el-tooltip>
135
+ <div class="file-size">{{ item.fileSize || "--" }}</div>
136
+ </div>
137
+ </div>
138
+ <div class="flex-column-around file-list-item-right">
139
+ <img
140
+ src="./assets/preview.svg"
141
+ alt=""
142
+ class="file-preview"
143
+ @click.stop="previewFile(item, index)"
144
+ />
145
+
146
+ <img
147
+ src="./assets/download.svg"
148
+ alt=""
149
+ class="file-download"
150
+ @click.stop="downloadFile(item)"
151
+ v-if="props.allowDownload"
152
+ />
153
+ </div>
154
+ </div>
155
+ <div
156
+ class="delete-box"
157
+ @click.stop="deleteUploadItem(item, index)"
158
+ v-if="props.formType != 'detail'"
159
+ >
160
+ <div class="table-delete">
161
+ <img
162
+ src="../../assets/table-delete/table-delete.svg"
163
+ alt="删除"
164
+ width="25"
165
+ height="25"
166
+ />
167
+ </div>
168
+ </div>
169
+ </div>
170
+ <div
171
+ class="notData"
172
+ v-if="
173
+ props.formType == 'detail' &&
174
+ !(
175
+ sendFileList &&
176
+ Array.isArray(sendFileList) &&
177
+ sendFileList.length > 0
178
+ )
179
+ "
180
+ >
181
+ 暂无附件
182
+ </div>
183
+ </div>
184
+ <!-- 专门用来预览的组件 -->
185
+ <el-image
186
+ style="display: none"
187
+ ref="previewImgRef"
188
+ :src="perviewImg.url"
189
+ :preview-src-list="perviewImg.srcList"
190
+ preview-teleported="true"
191
+ id="previewImgId"
192
+ @close="handleClosePreview"
193
+ >
194
+ </el-image>
195
+ <!-- 预览mp3,mp4 -->
196
+ <PreviewMp ref="previewMpRef"></PreviewMp>
197
+ </div>
198
+ </template>
199
+
200
+ <script setup lang="ts">
201
+ import { ref, watch, onMounted, PropType, nextTick } from "vue";
202
+ import {
203
+ type UploadUserFile,
204
+ ElMessage,
205
+ } from "element-plus";
206
+ import axios from "axios";
207
+ import { getFileType, ddWindowOpen } from "hrp-ui-base";
208
+ import PreviewMp from "./modules/previewMp.vue";
209
+ import FileUploadController from "hrp-ui-base/api/bms/file/FileUploadController";
210
+ import StsTokenVO from "hrp-ui-base/api/bms/file/bo/StsTokenVO";
211
+ import FileBaseInfo from "hrp-ui-base/api/bms/file/bo/FileBaseInfo";
212
+ import FileUrlVO from "hrp-ui-base/api/bms/file/bo/FileUrlVO";
213
+ import { downloadFile } from "hrp-ui-base";
214
+
215
+ const props = defineProps({
216
+ // 上传方式(保留 prop 以兼容外部传参,但实际预览读取 sessionStorage.userConfig.fileUploadType)
217
+ type: {
218
+ type: String as PropType<"oss" | "minio">,
219
+ default: "oss",
220
+ require: true,
221
+ },
222
+ // 页面id
223
+ pageId: {
224
+ type: String,
225
+ default: "",
226
+ require: true,
227
+ },
228
+ // formType 页面类型
229
+ formType: {
230
+ type: String as PropType<"add" | "edit" | "detail">,
231
+ default: "add",
232
+ require: true,
233
+ },
234
+ // 默认的文件列表
235
+ fileDetailList: {
236
+ type: Array as PropType<any[]>,
237
+ default: false,
238
+ require: false,
239
+ },
240
+ // 页面的loading,由外部控制内部的loading
241
+ loading: {
242
+ type: Boolean,
243
+ require: true,
244
+ default: false,
245
+ },
246
+ keyForReturn: {
247
+ type: Number,
248
+ require: true,
249
+ default: "",
250
+ },
251
+ limited: {
252
+ type: Number,
253
+ require: true,
254
+ default: 9,
255
+ },
256
+ // 是否允许下载附件
257
+ allowDownload: {
258
+ type: Boolean,
259
+ require: false,
260
+ default: true,
261
+ },
262
+ });
263
+ const emits = defineEmits(["getUploadIds", "getUploadInfo", "changeLoading"]);
264
+ const token = localStorage.getItem("TOKEN");
265
+ const uploadUrl =
266
+ window.location.origin + window.location.pathname + "api/bms/file/upload";
267
+ const minioHeader = ref({ "Authorization-Token": token });
268
+ const ossHeader = ref({
269
+ // 指定该Object被下载时的网页缓存行为。
270
+ "Cache-Control": "no-cache",
271
+ // 指定该Object被下载时的名称。
272
+ "Content-Disposition": "example.txt",
273
+ // 指定该Object被下载时的内容编码格式。
274
+ "Content-Encoding": "utf-8",
275
+ // 指定过期时间,单位为毫秒。
276
+ Expires: "1000",
277
+ // 指定Object的存储类型。
278
+ "x-oss-storage-class": "Standard",
279
+ // 指定Object标签,可同时设置多个标签。
280
+ "x-oss-tagging": "Tag1=1&Tag2=2",
281
+ // 指定初始化分片上传时是否覆盖同名Object。此处设置为true,表示禁止覆盖同名Object。
282
+ "x-oss-forbid-overwrite": "true",
283
+ });
284
+ const uploadFilesIds = ref<string[]>([]);
285
+ const fileInfoList = ref<any[]>([]);
286
+
287
+ const handleClosePreview = () => {
288
+ perviewImg.value.url = "";
289
+ perviewImg.value.srcList = [];
290
+ };
291
+ const submitLoading = ref<boolean>(false);
292
+ // 上传附件
293
+ const fileList = ref<UploadUserFile[]>([]);
294
+ const fileName = ref<string>("");
295
+ const beforeUploadOSS = async (e: any) => {
296
+
297
+ changeLoadingStatus(true);
298
+ // 卫健版差异点:单文件大小上限 50MB
299
+ const is50M = e.size / 1024 / 1024 < 50;
300
+ if (!is50M) {
301
+ changeLoadingStatus(false);
302
+ ElMessage.error("上传文件大小不能超过 50MB!");
303
+ return false;
304
+ }
305
+ fileName.value = e.name;
306
+ };
307
+
308
+ /** oss 上传方法(接口已对齐最新版 annex-upload,使用 FileUploadController.upload) */
309
+ const uploadFileOSS = async (uploadMsg: any) => {
310
+ try {
311
+ console.log(uploadMsg);
312
+ const fileOBJ = uploadMsg.file;
313
+ FileUploadController.upload(fileOBJ, props.pageId)
314
+ .then((data) => {
315
+ if (data.code === 200 && data.res) {
316
+ sendFileList.value.push(data.res);
317
+ emits(
318
+ "getUploadIds",
319
+ sendFileList.value.map((item) => {
320
+ return item.fileId;
321
+ }),
322
+ props.keyForReturn
323
+ );
324
+ emits(
325
+ "getUploadInfo",
326
+ sendFileList.value.map((item) => {
327
+ return item;
328
+ }),
329
+ props.keyForReturn
330
+ );
331
+ } else {
332
+ ElMessage.error("数据发生错误,请重新上传!");
333
+ }
334
+ })
335
+ .catch((err) => {
336
+ ElMessage.error("数据发生错误,请重试!");
337
+ })
338
+ .finally(() => {
339
+ changeLoadingStatus(false);
340
+ });
341
+ } catch (err) {
342
+ console.debug(err);
343
+ }
344
+ };
345
+ const ossClient = ref();
346
+ const handleImageLoad = () => {
347
+ changeLoadingStatus(false);
348
+ };
349
+ const handleImageError = () => {
350
+ changeLoadingStatus(false);
351
+ };
352
+ const handleExceed = (e: any) => {
353
+ ElMessage({
354
+ message: `最多上传${props.limited}个文件!`,
355
+ type: "error",
356
+ });
357
+ };
358
+ const sendFileList = ref<Array<FileBaseInfo>>([]);
359
+ /** 删除 */
360
+ const deleteUploadItem = (item: any, index: any) => {
361
+ sendFileList.value.splice(index, 1);
362
+ fileList.value = JSON.parse(JSON.stringify(sendFileList.value));
363
+ emits(
364
+ "getUploadIds",
365
+ sendFileList.value.map((item) => {
366
+ return item.fileId;
367
+ }),
368
+ props.keyForReturn
369
+ );
370
+ emits(
371
+ "getUploadInfo",
372
+ sendFileList.value.map((item) => {
373
+ return item;
374
+ }),
375
+ props.keyForReturn
376
+ );
377
+ };
378
+ watch(
379
+ () => {
380
+ return props.fileDetailList;
381
+ },
382
+ () => {
383
+ if (props.fileDetailList && Array.isArray(props.fileDetailList)) {
384
+ sendFileList.value = props.fileDetailList;
385
+ fileList.value = JSON.parse(JSON.stringify(sendFileList.value));
386
+ }
387
+ },
388
+ { deep: true, immediate: true }
389
+ );
390
+
391
+ /** 上传中 */
392
+ const handleUploadProgress = () => {
393
+ emits("changeLoading", true);
394
+ };
395
+ /** 上传失败 */
396
+ const handleUploadError = (err: any) => {
397
+ ElMessage({
398
+ message: "上传失败!",
399
+ type: "error",
400
+ });
401
+ changeLoadingStatus(false);
402
+ };
403
+ const changeLoadingStatus = (status: boolean) => {
404
+ emits("changeLoading", status);
405
+ submitLoading.value = status;
406
+ };
407
+
408
+ //清空图片列表
409
+ const clearFileList = () => {
410
+ sendFileList.value = [];
411
+ };
412
+
413
+ /** 上传的方式 */
414
+ onMounted(() => {});
415
+ const ossName = ref<string>("");
416
+ const stsToken = ref<StsTokenVO>(new StsTokenVO());
417
+
418
+ /** 获取minio 上传地址 */
419
+ const minioOption = ref<FileUrlVO>(new FileUrlVO());
420
+ const getMinioUploadUrl = async (fileName: string) => {
421
+ await FileUploadController.getUploadUrl(props.pageId, fileName).then(
422
+ (data) => {
423
+ if (data.code === 200 && data.res) {
424
+ minioOption.value = data.res;
425
+ } else {
426
+ ElMessage.error("获取上传路径失败!");
427
+ }
428
+ }
429
+ );
430
+ };
431
+ /** minio 上传方法 */
432
+ const uploadFileMinio = async (uploadMsg: any) => {
433
+ console.debug(uploadMsg);
434
+ if (minioOption.value) {
435
+ try {
436
+ let config = { "Content-Type": uploadMsg.file.type };
437
+ axiosPost("put", minioOption.value.policyUrl, uploadMsg.file, config)
438
+ .then(function (res) {
439
+ setTimeout(() => {
440
+ FileUploadController.checkFileUpload(
441
+ minioOption.value.fileId ? minioOption.value.fileId : ""
442
+ )
443
+ .then((data) => {
444
+ if (data.code == 200) {
445
+ FileUploadController.getMinioFileUrl(
446
+ minioOption.value.fileId ? minioOption.value.fileId : ""
447
+ )
448
+ .then((data) => {
449
+ if (data.code === 200 && data.res) {
450
+ sendFileList.value.push(data.res);
451
+ ElMessage.success("上传成功!");
452
+ emits(
453
+ "getUploadIds",
454
+ sendFileList.value.map((item) => {
455
+ return item.fileId;
456
+ }),
457
+ props.keyForReturn
458
+ );
459
+ emits(
460
+ "getUploadInfo",
461
+ sendFileList.value.map((item) => {
462
+ return item;
463
+ }),
464
+ props.keyForReturn
465
+ );
466
+ }
467
+ })
468
+ .finally(() => {
469
+ changeLoadingStatus(false);
470
+ });
471
+ } else {
472
+ ElMessage.error("上传失败,请重新上传!");
473
+ changeLoadingStatus(false);
474
+ }
475
+ })
476
+ .catch(() => {
477
+ ElMessage.error("上传失败,请重新上传!");
478
+ changeLoadingStatus(false);
479
+ });
480
+ }, 1000);
481
+ })
482
+ .catch(() => {
483
+ ElMessage.error("上传失败,请重新上传!");
484
+ changeLoadingStatus(false);
485
+ });
486
+ } catch (err) {
487
+ console.debug(err);
488
+ }
489
+ } else {
490
+ ElMessage.error("数据发生错误,请重新上传!");
491
+ }
492
+ };
493
+ function axiosPost(method: string, url: string, data: any, config: any) {
494
+ let result = axios({
495
+ method: method,
496
+ url: url,
497
+ data: data,
498
+ headers: config,
499
+ })
500
+ .then((resp) => {
501
+ return resp;
502
+ })
503
+ .catch((error) => {
504
+ return "exception=" + error;
505
+ });
506
+ return result;
507
+ }
508
+ /** 预览文件(接口已对齐最新版 annex-upload) */
509
+ const previewFile = async (item: FileBaseInfo, index: number) => {
510
+ if (
511
+ getFileType(item.url) === "jpg" ||
512
+ getFileType(item.url) === "png" ||
513
+ getFileType(item.url) === "bmp" ||
514
+ getFileType(item.url) === "jpeg" ||
515
+ getFileType(item.url) === "raw" ||
516
+ getFileType(item.url) === "heif" ||
517
+ getFileType(item.url) === "tiff" ||
518
+ getFileType(item.url) === "gif"
519
+ ) {
520
+ // 图片的情况
521
+ perviewImg.value.url = item.url;
522
+ perviewImg.value.srcList = [item.url];
523
+ nextTick(() => {
524
+ previewImgRef.value?.showPreview();
525
+ });
526
+ } else if (getFileType(item.url) === "mp3") {
527
+ previewMpRef.value?.open("mp3", item);
528
+ } else if (getFileType(item.url) === "mp4") {
529
+ previewMpRef.value?.open("mp4", item);
530
+ } else if (
531
+ getFileType(item.url) === "zip" ||
532
+ getFileType(item.url) === "7z" ||
533
+ getFileType(item.url) === "rar" ||
534
+ getFileType(item.url) === "dcm"
535
+ ) {
536
+ // 压缩包 / 医疗影像 dcm 无在线预览,直接下载
537
+ downloadFile(item);
538
+ } else {
539
+ try {
540
+ let currentUserConfig = sessionStorage.getItem("userConfig")
541
+ ? JSON.parse(sessionStorage.getItem("userConfig") as string)
542
+ : null;
543
+ if (currentUserConfig && currentUserConfig.fileUploadType === "oss") {
544
+ await FileUploadController.getFilePreview(item.fileId).then((data) => {
545
+ if (data.code == 200 && data.res) {
546
+ ddWindowOpen(
547
+ window.location.origin +
548
+ window.location.pathname +
549
+ "ay-doc/index.html?url=" +
550
+ data.res.webOfficeUrl +
551
+ "&token=" +
552
+ data.res.accessToken
553
+ );
554
+ } else {
555
+ ElMessage.error("预览失败,请稍后再试!");
556
+ }
557
+ });
558
+ } else if (
559
+ currentUserConfig &&
560
+ currentUserConfig.fileUploadType === "minio"
561
+ ) {
562
+ FileUploadController.getMinioFilePreview(item.fileId).then((data) => {
563
+ if (data.code == 200 && data.res) {
564
+ window.open(
565
+ window.location.origin +
566
+ window.location.pathname +
567
+ "preview/onlinePreview?url=" +
568
+ data.res
569
+ );
570
+ }
571
+ });
572
+ }
573
+ } catch (error) {
574
+ alert("读取本地用户信息失败!");
575
+ }
576
+ }
577
+ };
578
+ // Base64编码(支持中文)
579
+ function base64Encode(str: string) {
580
+ return btoa(
581
+ encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, p1) =>
582
+ String.fromCharCode(parseInt("0x" + p1, 16))
583
+ )
584
+ );
585
+ }
586
+
587
+ /** 专门用来预览的组件 */
588
+ const previewImgRef = ref();
589
+ const perviewImg = ref<{ url: string; srcList: string[] }>({
590
+ url: "",
591
+ srcList: [],
592
+ });
593
+ /** mp3,mp4 预览 */
594
+ const previewMpRef = ref();
595
+ defineExpose({
596
+ clearFileList,
597
+ sendFileList,
598
+ });
599
+ </script>
600
+
601
+ <style lang="scss">
602
+ @use "../../styles/flex-common.scss";
603
+
604
+ .file-uploader {
605
+ .imgSize {
606
+ width: 99px;
607
+
608
+ > span {
609
+ cursor: pointer;
610
+ position: absolute;
611
+ color: black;
612
+ font-size: 20px;
613
+ right: -69px;
614
+ height: 30px;
615
+ top: -12px;
616
+ width: 37px;
617
+ }
618
+
619
+ el-image {
620
+ width: 100%;
621
+ }
622
+ }
623
+
624
+ .el-upload__tip {
625
+ font-size: var(--font-size-body);
626
+ font-weight: 400;
627
+ text-align: left;
628
+ color: var(--custom-theme-text-3);
629
+ }
630
+ }
631
+
632
+ .upload-attachments {
633
+ .notData {
634
+ font-size: var(--font-size-body);
635
+ }
636
+
637
+ .el-upload-list {
638
+ position: relative;
639
+ text-align: center;
640
+ display: flex;
641
+ flex-wrap: wrap;
642
+ width: 100%;
643
+
644
+ .el-upload-list__item {
645
+ margin-left: 5px;
646
+ flex-direction: column;
647
+ width: 17%;
648
+ }
649
+ }
650
+
651
+ .file-uploader {
652
+ .imgSize {
653
+ width: 99px;
654
+
655
+ > span {
656
+ cursor: pointer;
657
+ position: absolute;
658
+ color: black;
659
+ font-size: 20px;
660
+ right: -69px;
661
+ height: 30px;
662
+ top: -12px;
663
+ width: 37px;
664
+ }
665
+
666
+ el-image {
667
+ width: 100%;
668
+ }
669
+ }
670
+ }
671
+ }
672
+
673
+ .preview-img {
674
+ img {
675
+ width: 100%;
676
+ }
677
+ }
678
+
679
+ .exceed-limit {
680
+ border-color: red !important;
681
+ }
682
+
683
+ .error-message {
684
+ color: red;
685
+ }
686
+
687
+ .file-list-box {
688
+ margin-top: 10px;
689
+ width: 100%;
690
+ height: auto;
691
+
692
+ .file-out-box {
693
+ cursor: pointer;
694
+ border: 1px solid var(--custom-theme-border-4);
695
+ border-radius: 6px 6px 6px 6px;
696
+ background: var(--custom-theme-fill-7);
697
+ padding: 24px 8px 8px;
698
+ width: 272px;
699
+ height: 80px;
700
+ margin-right: 16px;
701
+ margin-bottom: 16px;
702
+ position: relative;
703
+ }
704
+
705
+ .file-list-item {
706
+ width: 256px;
707
+ height: 48px;
708
+
709
+ .file-list-item-left {
710
+ width: calc(100% - 20px);
711
+ height: 100%;
712
+
713
+ .file-list-item-icon {
714
+ width: 41px;
715
+ height: 41px;
716
+
717
+ .file-icon {
718
+ width: 41px;
719
+ }
720
+ }
721
+
722
+ .file-name-box {
723
+ margin-left: 8px;
724
+ height: 100%;
725
+ max-width: calc(100% - 50px);
726
+
727
+ .file-name {
728
+ font-weight: 400;
729
+ font-size: 12px;
730
+ color: var(--custom-theme-text-1);
731
+ line-height: 12x;
732
+ display: -webkit-box;
733
+ -webkit-box-orient: vertical;
734
+ -webkit-line-clamp: 2;
735
+ overflow: hidden;
736
+ word-break: break-all;
737
+ }
738
+
739
+ .file-size {
740
+ font-weight: 400;
741
+ font-size: 12px;
742
+ color: var(--custom-theme-text-3);
743
+ line-height: 11px;
744
+ }
745
+ }
746
+ }
747
+
748
+ .file-list-item-right {
749
+ height: 100%;
750
+
751
+ .file-preview {
752
+ width: 16px;
753
+ cursor: pointer;
754
+ }
755
+
756
+ .file-download {
757
+ width: 16px;
758
+ cursor: pointer;
759
+ }
760
+ }
761
+ }
762
+
763
+ .delete-box {
764
+ position: absolute;
765
+ right: -7px;
766
+ top: -7px;
767
+ overflow: hidden;
768
+ font-size: 16px;
769
+ cursor: pointer;
770
+ }
771
+ }
772
+ </style>