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.
- package/README.md +51 -51
- package/dist/components.cjs +5 -5
- package/dist/components.es.js +2476 -2476
- package/dist/style.css +1 -1
- package/package.json +101 -101
- package/packages/approval-process/.eslintrc +6 -6
- package/packages/approval-process/README.md +22 -22
- package/packages/approval-process/index.ts +65 -65
- package/packages/approval-process/package.json +17 -17
- package/packages/approval-process/packages/components/choose-member/BO/departBo.ts +8 -8
- package/packages/approval-process/packages/components/choose-member/BO/memberBo.ts +14 -14
- package/packages/approval-process/packages/components/choose-member/BO/roleBo.ts +16 -16
- package/packages/approval-process/packages/components/choose-member/index.vue +496 -496
- package/packages/approval-process/packages/components/choose-member/styles/common.scss +133 -133
- package/packages/approval-process/packages/components/comment/assets/download.svg +4 -4
- package/packages/approval-process/packages/components/comment/assets/mp3.svg +11 -11
- package/packages/approval-process/packages/components/comment/assets/mp4.svg +11 -11
- package/packages/approval-process/packages/components/comment/assets/other.svg +11 -11
- package/packages/approval-process/packages/components/comment/assets/pdf.svg +11 -11
- package/packages/approval-process/packages/components/comment/assets/ppt.svg +11 -11
- package/packages/approval-process/packages/components/comment/assets/preview.svg +4 -4
- package/packages/approval-process/packages/components/comment/assets/word.svg +11 -11
- package/packages/approval-process/packages/components/comment/assets/xls.svg +11 -11
- package/packages/approval-process/packages/components/comment/index.vue +843 -843
- package/packages/approval-process/packages/components/comment/modules/previewMp.vue +53 -53
- package/packages/approval-process/packages/components/comment/styles/comment-style.scss +303 -303
- package/packages/approval-process/packages/components/image-cropper/index.vue +202 -202
- package/packages/approval-process/packages/components/sign/index.vue +766 -766
- package/packages/approval-process/packages/components/sign/modules/full-screen-sign.vue +19 -19
- package/packages/approval-process/packages/components/urge-dialog/index.vue +120 -120
- package/packages/approval-process/packages/components/vue-esign/index.vue +289 -289
- package/packages/approval-process/packages/flow/approve-component/approve-success.vue +81 -81
- package/packages/approval-process/packages/flow/approve-component/route-params-error.vue +48 -48
- package/packages/approval-process/packages/flow/approve-component/submit-success.vue +58 -58
- package/packages/approval-process/packages/flow/examine-approve-itr.vue +978 -978
- package/packages/approval-process/packages/flow/examine-approve.vue +1065 -1065
- package/packages/approval-process/packages/flow/form-component/associated-approval-form/README.md +38 -38
- package/packages/approval-process/packages/flow/form-component/associated-approval-form/index.vue +158 -158
- package/packages/approval-process/packages/flow/form-component/associated-approval-form/modules/associated-approval-form-mobile.vue +297 -297
- package/packages/approval-process/packages/flow/form-component/associated-approval-form/modules/associated-approval-form-pc.vue +314 -314
- package/packages/approval-process/packages/flow/form-component/associated-approval-form/style/curd-area-mobile.scss +109 -109
- package/packages/approval-process/packages/flow/form-component/associated-approval-form/style/curd-area.scss +95 -95
- package/packages/approval-process/packages/flow/form-component/associated-approval-form/style/out-put.scss +47 -47
- package/packages/approval-process/packages/flow/form-component/show-sign.vue +27 -27
- package/packages/approval-process/packages/flow/styles/common.scss +133 -133
- package/packages/approval-process/packages/flow/styles/examine-approve-pc.scss +465 -465
- package/packages/approval-process/packages/flow/styles/examine-approve-phone.scss +292 -292
- package/packages/approval-process/packages/flow/styles/submit-approve-pc.scss +379 -379
- package/packages/approval-process/packages/flow/styles/submit-approve-phone.scss +336 -336
- package/packages/approval-process/packages/flow/submit-approve-itr.vue +622 -622
- package/packages/approval-process/packages/flow/submit-approve.vue +627 -627
- package/packages/approval-process/packages/flow/systemCom/BO/departBo.ts +8 -8
- package/packages/approval-process/packages/flow/systemCom/BO/memberBo.ts +14 -14
- package/packages/approval-process/packages/flow/systemCom/BO/roleBo.ts +16 -16
- package/packages/approval-process/packages/flow/systemCom/choose-depart.vue +398 -398
- package/packages/approval-process/packages/flow/systemCom/choose-member-phone.vue +514 -514
- package/packages/approval-process/packages/flow/systemCom/choose-member.vue +564 -564
- package/packages/approval-process/packages/flow/systemCom/choose-role.vue +300 -300
- package/packages/approval-process/packages/styles/common.scss +133 -133
- package/packages/approval-process/packages/styles/flex-common.scss +117 -117
- package/packages/approval-process/packages/styles/flexCommon.scss +72 -72
- package/packages/approval-process/packages/styles/main.css +216 -216
- package/packages/approval-process/packages/styles/router-page.scss +370 -370
- package/packages/approval-process/packages/styles/style-set.ts +207 -207
- package/packages/approval-process/packages/types.d.ts +3 -3
- package/packages/approval-process/packages/utils/base.ts +15 -15
- package/packages/approval-process/packages/utils/crypto.ts +66 -66
- package/packages/approval-process/packages/utils/ddUtils.ts +56 -56
- package/packages/approval-process/packages/utils/debounce.ts +35 -35
- package/packages/approval-process/packages/utils/des.js +1107 -1107
- package/packages/approval-process/packages/utils/download.ts +38 -38
- package/packages/approval-process/packages/utils/editor.ts +36 -36
- package/packages/approval-process/packages/utils/getEnv.ts +36 -36
- package/packages/approval-process/packages/utils/os.ts +20 -20
- package/packages/approval-process/packages/utils/path-util.ts +31 -31
- package/packages/approval-process/packages/utils/routerUtil.ts +304 -304
- package/packages/approval-process/packages/utils/string-utils.ts +13 -13
- package/packages/approval-process/packages/utils/throttle.ts +44 -44
- package/packages/approval-process/packages/utils/validate.ts +92 -92
- package/packages/approval-process/packages/utils/ws.ts +218 -218
- package/packages/approval-process/tsconfig.json +72 -72
- package/packages/approval-process/vite.config.ts +56 -56
- package/src/api/bms/dict/bo/DictConfigBO.ts +23 -23
- package/src/api/bms/dict/bo/DictConfigBaseVO.ts +24 -24
- package/src/api/bms/dict/bo/DictConfigSearchBO.ts +12 -12
- package/src/api/bms/dict/bo/DictImportBO.ts +6 -6
- package/src/api/bms/dict/bo/DictVO.ts +21 -21
- package/src/api/bms/dict/bo/PageBaseVO.ts +8 -8
- package/src/api/bms/dict/bo/TotalDictBO.ts +11 -11
- package/src/api/bms/dict/bo/TotalDictPageVO.ts +17 -17
- package/src/api/bms/dict/dict-controller.ts +78 -78
- package/src/api/bms/file/FileExportController.ts +19 -19
- package/src/api/bms/file/FileUploadController.ts +131 -131
- package/src/api/bms/file/bo/FileBaseInfo.ts +13 -13
- package/src/api/bms/file/bo/FileExportVO.ts +17 -17
- package/src/api/bms/file/bo/FilePreviewVO.ts +8 -8
- package/src/api/bms/file/bo/FileUploadInfo.ts +22 -22
- package/src/api/bms/file/bo/FileUrlVO.ts +10 -10
- package/src/api/bms/file/bo/StsTokenVO.ts +20 -20
- package/src/api/bms/flow/FlowCommentController.ts +50 -50
- package/src/api/bms/flow/FlowInstanceController.ts +179 -179
- package/src/api/bms/flow/FlowProcessController.ts +55 -55
- package/src/api/bms/flow/FlowSheetController.ts +27 -27
- package/src/api/bms/flow/FlowSignController.ts +76 -76
- package/src/api/bms/flow/bo/AssociatedApprovalBO.ts +15 -15
- package/src/api/bms/flow/bo/AssociatedApprovalVO.ts +35 -35
- package/src/api/bms/flow/bo/AuditBaseInfo.ts +39 -39
- package/src/api/bms/flow/bo/ButtonVo.ts +7 -7
- package/src/api/bms/flow/bo/DingCallbackBo.ts +13 -13
- package/src/api/bms/flow/bo/FlowCommentBO.ts +12 -12
- package/src/api/bms/flow/bo/FlowCommentVO.ts +23 -23
- package/src/api/bms/flow/bo/FlowInstanceBO.ts +14 -14
- package/src/api/bms/flow/bo/FlowNodeVO.ts +24 -24
- package/src/api/bms/flow/bo/FlowNoticeBO.ts +17 -17
- package/src/api/bms/flow/bo/FlowProcessBO.ts +13 -13
- package/src/api/bms/flow/bo/FlowProcessVO.ts +9 -9
- package/src/api/bms/flow/bo/FlowReplyVO.ts +23 -23
- package/src/api/bms/flow/bo/FlowSheetVO.ts +16 -16
- package/src/api/bms/flow/bo/InstanceBackBO.ts +9 -9
- package/src/api/bms/flow/bo/InstanceNodeBO.ts +13 -13
- package/src/api/bms/flow/bo/InstanceNodeVO.ts +21 -21
- package/src/api/bms/flow/bo/NodeShowVo.ts +19 -19
- package/src/api/bms/flow/bo/ReviewBO.ts +11 -11
- package/src/api/bms/flow/bo/SheetSearchBO.ts +11 -11
- package/src/api/bms/flow/bo/SystemVO.ts +7 -7
- package/src/api/bms/flow/bo/TransmitBO.ts +9 -9
- package/src/api/bms/flow/bo/UrgeFlowBO.ts +7 -7
- package/src/api/bms/flow/bo/UserBaseInfoVo.ts +13 -13
- package/src/api/bms/flow/bo/UserInfoVo.ts +44 -44
- package/src/api/bms/flow/bo/UserResultVo.ts +17 -17
- package/src/api/bms/flow/bo/ValueMapBo.ts +7 -7
- package/src/api/bms/home/HomeController.ts +106 -106
- package/src/api/bms/home/bo/CollectedMenuBo.ts +9 -9
- package/src/api/bms/home/bo/DeptBaseVo.ts +9 -9
- package/src/api/bms/home/bo/DomainVO.ts +13 -13
- package/src/api/bms/home/bo/FunPermission.ts +17 -17
- package/src/api/bms/home/bo/GroupVO.ts +10 -10
- package/src/api/bms/home/bo/HomeMenu.ts +22 -22
- package/src/api/bms/home/bo/HomeMenuVo.ts +11 -11
- package/src/api/bms/home/bo/PersonalizationBo.ts +17 -17
- package/src/api/bms/home/bo/PersonalizationVo.ts +19 -19
- package/src/api/bms/home/bo/PhoneMenu.ts +14 -14
- package/src/api/bms/home/bo/SearchMenuVo.ts +10 -10
- package/src/api/bms/home/bo/UserBaseInfoVo.ts +11 -11
- package/src/api/bms/permission-manage/PermissionController.ts +133 -133
- package/src/api/bms/permission-manage/bo/DataScopeConfig.ts +17 -17
- package/src/api/bms/permission-manage/bo/DataScopePoint.ts +15 -15
- package/src/api/bms/permission-manage/bo/DeptBaseVo.ts +9 -9
- package/src/api/bms/permission-manage/bo/FunPermissionConfig.ts +18 -18
- package/src/api/bms/permission-manage/bo/FunPointVo.ts +9 -9
- package/src/api/bms/permission-manage/bo/PermissionGroupBo.ts +11 -11
- package/src/api/bms/permission-manage/bo/PermissionGroupMemberVo.ts +18 -18
- package/src/api/bms/permission-manage/bo/PermissionGroupPageVo.ts +17 -17
- package/src/api/bms/permission-manage/bo/PermissionGroupVo.ts +17 -17
- package/src/api/bms/permission-manage/bo/RoleBaseVo.ts +9 -9
- package/src/api/bms/permission-manage/bo/TheFirstStepVo.ts +13 -13
- package/src/api/bms/permission-manage/bo/TheSecondStepVo.ts +14 -14
- package/src/api/bms/permission-manage/bo/UserBaseInfoVo.ts +11 -11
- package/src/api/bms/tabulation/TabulationController.ts +78 -78
- package/src/api/bms/tabulation/bo/FieldConditionBO.ts +10 -10
- package/src/api/bms/tabulation/bo/FieldConditionVO.ts +10 -10
- package/src/api/bms/tabulation/bo/OperateButtonVO.ts +9 -9
- package/src/api/bms/tabulation/bo/PersonViewVO.ts +33 -33
- package/src/api/bms/tabulation/bo/SearchVO.ts +33 -33
- package/src/api/bms/tabulation/bo/TabulationBO.ts +14 -14
- package/src/api/bms/tabulation/bo/ViewSortBO.ts +7 -7
- package/src/api/bms/tabulation/bo/ViewVO.ts +12 -12
- package/src/api/common/FileBaseInfo.ts +10 -10
- package/src/api/common/ResponseBean.ts +9 -9
- package/src/api/common/ResponseBeanList.ts +15 -15
- package/src/api/common/ResponseBeanTablePage.ts +21 -21
- package/src/api/common/TableQueryCriteriaVO.ts +10 -10
- package/src/api/common/bo/PageResult.ts +22 -22
- package/src/api/hrms/dept/bo/DeptBaseVo.ts +6 -6
- package/src/api/hrms/dept/bo/DeptTreeVo.ts +23 -23
- package/src/api/hrms/dept/bo/DeptUserVo.ts +9 -9
- package/src/api/hrms/dept/bo/DeptUsersVo.ts +10 -10
- package/src/api/hrms/dept/bo/DeptVo.ts +19 -19
- package/src/api/hrms/dept/bo/UserBaseInfoVo.ts +7 -7
- package/src/api/hrms/dept/deptController.ts +100 -100
- package/src/api/hrms/role/bo/RoleBaseVo.ts +6 -6
- package/src/api/hrms/role/bo/RoleGroupVo.ts +11 -11
- package/src/api/hrms/role/bo/RoleVo.ts +22 -22
- package/src/api/hrms/role/roleController.ts +19 -19
- package/src/api/hrms/user/bo/UserBaseInfoVo.ts +11 -11
- package/src/api/hrms/user/bo/UserCardVO.ts +13 -13
- package/src/api/hrms/user/bo/UserDeptBO.ts +13 -13
- package/src/api/hrms/user/bo/UserRoleBO.ts +11 -11
- package/src/api/hrms/user/bo/UserVO.ts +23 -23
- package/src/api/hrms/user/userController.ts +86 -86
- package/src/api/index.ts +9 -9
- package/src/api/notice/NoticeController.ts +73 -73
- package/src/api/notice/bo/NoticePageBO.ts +24 -24
- package/src/api/notice/bo/NoticeVO.ts +31 -31
- package/src/api/work-order-pc/flow/Bo/ValueMapBo.ts +7 -7
- package/src/api/work-order-pc/flow/ItrFlowProcessController.ts +41 -41
- package/src/api/work-order-pc/flow/Vo/FlowNodeVO.ts +24 -24
- package/src/api/work-order-pc/flow/Vo/UserInfoVo.ts +44 -44
- package/src/assets/layout/avatar-default.svg +6 -6
- package/src/assets/layout/collect-active.svg +7 -7
- package/src/assets/layout/collect-default.svg +7 -7
- package/src/assets/layout/download-active.svg +8 -8
- package/src/assets/layout/download-default.svg +8 -8
- package/src/assets/layout/export-dark.svg +7 -7
- package/src/assets/layout/export-default.svg +7 -7
- package/src/assets/layout/font-active.svg +6 -6
- package/src/assets/layout/font-default.svg +6 -6
- package/src/assets/layout/help-active.svg +10 -10
- package/src/assets/layout/help-default.svg +10 -10
- package/src/assets/layout/home-active.svg +6 -6
- package/src/assets/layout/home.svg +6 -6
- package/src/assets/layout/menu-expand.svg +6 -6
- package/src/assets/layout/menu-position-active.svg +6 -6
- package/src/assets/layout/menu-position-default.svg +6 -6
- package/src/assets/layout/message-active.svg +9 -9
- package/src/assets/layout/message-default.svg +9 -9
- package/src/assets/layout/moon.svg +8 -8
- package/src/assets/layout/router-all-dark.svg +11 -11
- package/src/assets/layout/router-all-default.svg +17 -17
- package/src/assets/layout/search-active.svg +20 -20
- package/src/assets/layout/search-default.svg +20 -20
- package/src/assets/layout/star-default.svg +3 -3
- package/src/assets/layout/sun-active.svg +6 -6
- package/src/assets/layout/sun-default.svg +6 -6
- package/src/assets/layout/switch-moon.svg +3 -3
- package/src/assets/layout/switch-sun.svg +41 -41
- package/src/assets/layout/todo-active.svg +12 -12
- package/src/assets/layout/todo-default.svg +12 -12
- package/src/assets/layout/user-dark.svg +13 -13
- package/src/assets/layout/user-default.svg +13 -13
- package/src/assets/no-permiss-dark.svg +16 -16
- package/src/assets/no-permiss-day.svg +16 -16
- package/src/assets/process/drawer/manyLevel1close.svg +9 -9
- package/src/assets/process/drawer/manyLevel1open.svg +6 -6
- package/src/assets/process/drawer/manyLevel2close.svg +6 -6
- package/src/assets/process/drawer/manyLevel2open.svg +6 -6
- package/src/assets/table-delete/table-delete.svg +2 -2
- package/src/components/annex-img-upload/assets/download.svg +4 -4
- package/src/components/annex-img-upload/assets/mp3.svg +11 -11
- package/src/components/annex-img-upload/assets/mp4.svg +11 -11
- package/src/components/annex-img-upload/assets/other.svg +11 -11
- package/src/components/annex-img-upload/assets/pdf.svg +11 -11
- package/src/components/annex-img-upload/assets/ppt.svg +11 -11
- package/src/components/annex-img-upload/assets/preview.svg +4 -4
- package/src/components/annex-img-upload/assets/word.svg +11 -11
- package/src/components/annex-img-upload/assets/xls.svg +11 -11
- package/src/components/annex-img-upload/index.vue +609 -609
- package/src/components/annex-img-upload/modules/previewMp.vue +53 -53
- package/src/components/annex-upload/assets/download.svg +4 -4
- package/src/components/annex-upload/assets/mp3.svg +11 -11
- package/src/components/annex-upload/assets/mp4.svg +11 -11
- package/src/components/annex-upload/assets/other.svg +11 -11
- package/src/components/annex-upload/assets/pdf.svg +11 -11
- package/src/components/annex-upload/assets/ppt.svg +11 -11
- package/src/components/annex-upload/assets/preview.svg +4 -4
- package/src/components/annex-upload/assets/word.svg +11 -11
- package/src/components/annex-upload/assets/xls.svg +11 -11
- package/src/components/annex-upload/index.vue +800 -798
- package/src/components/annex-upload/modules/previewMp.vue +53 -53
- package/src/components/annex-upload-weijian/assets/download.svg +4 -4
- package/src/components/annex-upload-weijian/assets/mp3.svg +11 -11
- package/src/components/annex-upload-weijian/assets/mp4.svg +11 -11
- package/src/components/annex-upload-weijian/assets/other.svg +11 -11
- package/src/components/annex-upload-weijian/assets/pdf.svg +11 -11
- package/src/components/annex-upload-weijian/assets/ppt.svg +11 -11
- package/src/components/annex-upload-weijian/assets/preview.svg +4 -4
- package/src/components/annex-upload-weijian/assets/word.svg +11 -11
- package/src/components/annex-upload-weijian/assets/xls.svg +11 -11
- package/src/components/annex-upload-weijian/index.vue +772 -772
- package/src/components/annex-upload-weijian/modules/previewMp.vue +53 -53
- package/src/components/base-layout/index.vue +199 -199
- package/src/components/button.vue +14 -14
- package/src/components/layout/ApprovalCenterDrawer.vue +231 -231
- package/src/components/layout/ExportCenterDrawer.vue +164 -164
- package/src/components/layout/LayoutContainer.vue +542 -542
- package/src/components/layout/SysHeader.vue +90 -90
- package/src/components/layout/SysHeaderLeft.vue +114 -114
- package/src/components/layout/SysHeaderRight.vue +112 -112
- package/src/components/layout/SysHeaderTabs.vue +289 -289
- package/src/components/layout/components/avatar-component.vue +77 -77
- package/src/components/layout/components/dark-component.vue +82 -82
- package/src/components/layout/components/download-component.vue +49 -49
- package/src/components/layout/components/font-size-component.vue +66 -66
- package/src/components/layout/components/menu-position-component.vue +97 -97
- package/src/components/layout/components/message-component.vue +64 -64
- package/src/components/layout/components/todo-component.vue +55 -55
- package/src/components/layout/index.ts +34 -34
- package/src/components/layout/message/message-dictionary.ts +27 -27
- 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
- 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
- package/src/components/layout/message/message-icon//345/205/250/351/203/250/351/200/232/347/237/245.svg +8 -8
- 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
- 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
- package/src/components/layout/message/message-icon//345/205/254/345/221/212/351/200/232/347/237/245.svg +12 -12
- 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
- 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
- package/src/components/layout/message/message-icon//345/256/241/346/211/271/351/200/232/347/237/245.svg +8 -8
- 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
- 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
- package/src/components/layout/message/message-icon//345/257/274/345/207/272/351/200/232/347/237/245.svg +13 -13
- 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
- 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
- package/src/components/layout/message/message-icon//346/234/252/350/257/273/351/200/232/347/237/245.svg +11 -11
- package/src/components/layout/message/message-icon//347/251/272/347/212/266/346/200/201.svg +17 -17
- 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
- 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
- package/src/components/layout/message/message-icon//347/263/273/347/273/237/351/200/232/347/237/245.svg +13 -13
- package/src/components/layout/message/message-notification-drawer.vue +533 -533
- package/src/components/layout/personal-sign/ImageCropper.vue +187 -187
- package/src/components/layout/personal-sign/PersonalSignDialog.vue +658 -658
- package/src/components/layout/personalization-guide-dialog.vue +255 -255
- package/src/components/layout/plugin.ts +32 -32
- package/src/components/layout/sideMenu-global.scss +115 -115
- package/src/components/layout/sideMenu.scss +312 -312
- package/src/components/layout/sideMenu.vue +541 -541
- package/src/components/layout/sideMenuSonList.vue +185 -185
- package/src/components/layout/stores/index.ts +5 -5
- package/src/components/layout/stores/useLayoutConfigStore.ts +231 -231
- package/src/components/layout/stores/useLayoutMenuStore.ts +232 -232
- package/src/components/layout/stores/useLayoutNoticeStore.ts +77 -77
- package/src/components/layout/stores/useLayoutTabsStore.ts +367 -367
- package/src/components/layout/styles/icon.scss +72 -72
- package/src/components/layout/types.ts +98 -98
- package/src/components/layout/utils/redirect.ts +144 -144
- package/src/components/list-search-content/components/index.ts +11 -11
- package/src/components/list-search-content/components/search-date-range.vue +74 -74
- package/src/components/list-search-content/components/search-date-time-range.vue +48 -48
- package/src/components/list-search-content/components/search-date.vue +97 -97
- package/src/components/list-search-content/components/search-input-number.vue +59 -59
- package/src/components/list-search-content/components/search-input.vue +46 -46
- package/src/components/list-search-content/components/search-multiple_select.vue +69 -69
- package/src/components/list-search-content/components/search-select.vue +64 -64
- package/src/components/list-search-content/index.vue +803 -803
- package/src/components/list-search-content/modules/add-views-package-dialog.vue +147 -147
- package/src/components/list-search-content/modules/search-condition-area.vue +252 -252
- package/src/components/list-search-content/modules/views-package-manage-dialog.vue +265 -265
- package/src/components/switch.vue +16 -16
- package/src/components.ts +67 -67
- package/src/enum/system/StorageEnum.ts +4 -4
- package/src/global.d.ts +19 -19
- package/src/index.ts +4 -4
- package/src/init.ts +37 -37
- package/src/styles/common.scss +133 -133
- package/src/styles/flex-common.scss +117 -117
- package/src/styles/flexCommon.scss +72 -72
- package/src/styles/main.css +277 -277
- package/src/styles/router-page.scss +370 -370
- package/src/styles/style-set.ts +809 -809
- package/src/utils/HttpUtil.ts +427 -427
- package/src/utils/base.ts +47 -47
- package/src/utils/cell-style.ts +11 -11
- package/src/utils/crypto.ts +98 -98
- package/src/utils/dd-utils.ts +157 -157
- package/src/utils/debounce.ts +35 -35
- package/src/utils/debounceleading.ts +48 -48
- package/src/utils/download.ts +38 -38
- package/src/utils/exitLogin.ts +58 -58
- package/src/utils/filter-key.ts +4 -4
- package/src/utils/formatter-handler.ts +12 -12
- package/src/utils/get-dict.ts +26 -26
- package/src/utils/get-env.ts +36 -36
- package/src/utils/login-path.ts +35 -35
- package/src/utils/path-utils.ts +31 -31
- package/src/utils/permit-utils.ts +68 -68
- package/src/utils/router-utils.ts +321 -321
- package/src/utils/string-utils.ts +166 -166
- package/src/utils/style-set.ts +750 -750
- package/src/utils/throttle.ts +62 -62
- package/src/utils/transform-data.ts +31 -31
- package/src/utils/validate.ts +92 -92
- package/src/utils/ws.ts +218 -218
- package/src/utils/wujie-son.ts +50 -50
- package/src/utils.ts +24 -24
package/src/utils/base.ts
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
/** 在子项目中,需要引入此方法,确保当前项目挂载完成 */
|
|
2
|
-
export const forSureMounted = (system: string) => {
|
|
3
|
-
try {
|
|
4
|
-
let arr: string[] = []
|
|
5
|
-
if (sessionStorage.getItem("readyAppList")) {
|
|
6
|
-
// @ts-ignore
|
|
7
|
-
arr = JSON.parse(sessionStorage.getItem("readyAppList"))
|
|
8
|
-
arr.push(system)
|
|
9
|
-
} else {
|
|
10
|
-
arr = [system]
|
|
11
|
-
}
|
|
12
|
-
sessionStorage.setItem("readyAppList", JSON.stringify(arr))
|
|
13
|
-
} catch (error) {
|
|
14
|
-
sessionStorage.setItem("readyAppList", JSON.stringify([system]))
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// 设置表头样式
|
|
19
|
-
export function tableHeaderCellStyle({ row, column, rowIndex, columnIndex }: never) {
|
|
20
|
-
return {
|
|
21
|
-
color: 'var(--mh-table-text-color)',
|
|
22
|
-
fontWeight: 'bold',
|
|
23
|
-
background: 'var(--mh-table-bg-color)',
|
|
24
|
-
// border: '1px solid var(--custom-theme-border-4)',
|
|
25
|
-
fontSize: 'var(--font-size-description)'
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
export function phoneTableHeaderCellStyle({ row, column, rowIndex, columnIndex }: never) {
|
|
30
|
-
return {
|
|
31
|
-
color: 'var(--custom-theme-text-3)',
|
|
32
|
-
fontWeight: 'bold',
|
|
33
|
-
background: 'var(--custom-theme-fill-4)',
|
|
34
|
-
// border: '1px solid var(--custom-theme-border-4)',
|
|
35
|
-
fontSize: 'var(--font-size-description)'
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
// 该函数用于滚动到页面上第一个错误元素的位置。
|
|
42
|
-
|
|
43
|
-
export const scrollToErrorElement = () => {
|
|
44
|
-
const firstErrorElement = document.querySelector('.is-error');
|
|
45
|
-
if (firstErrorElement) {
|
|
46
|
-
firstErrorElement.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
47
|
-
}
|
|
1
|
+
/** 在子项目中,需要引入此方法,确保当前项目挂载完成 */
|
|
2
|
+
export const forSureMounted = (system: string) => {
|
|
3
|
+
try {
|
|
4
|
+
let arr: string[] = []
|
|
5
|
+
if (sessionStorage.getItem("readyAppList")) {
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
arr = JSON.parse(sessionStorage.getItem("readyAppList"))
|
|
8
|
+
arr.push(system)
|
|
9
|
+
} else {
|
|
10
|
+
arr = [system]
|
|
11
|
+
}
|
|
12
|
+
sessionStorage.setItem("readyAppList", JSON.stringify(arr))
|
|
13
|
+
} catch (error) {
|
|
14
|
+
sessionStorage.setItem("readyAppList", JSON.stringify([system]))
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// 设置表头样式
|
|
19
|
+
export function tableHeaderCellStyle({ row, column, rowIndex, columnIndex }: never) {
|
|
20
|
+
return {
|
|
21
|
+
color: 'var(--mh-table-text-color)',
|
|
22
|
+
fontWeight: 'bold',
|
|
23
|
+
background: 'var(--mh-table-bg-color)',
|
|
24
|
+
// border: '1px solid var(--custom-theme-border-4)',
|
|
25
|
+
fontSize: 'var(--font-size-description)'
|
|
26
|
+
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export function phoneTableHeaderCellStyle({ row, column, rowIndex, columnIndex }: never) {
|
|
30
|
+
return {
|
|
31
|
+
color: 'var(--custom-theme-text-3)',
|
|
32
|
+
fontWeight: 'bold',
|
|
33
|
+
background: 'var(--custom-theme-fill-4)',
|
|
34
|
+
// border: '1px solid var(--custom-theme-border-4)',
|
|
35
|
+
fontSize: 'var(--font-size-description)'
|
|
36
|
+
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
// 该函数用于滚动到页面上第一个错误元素的位置。
|
|
42
|
+
|
|
43
|
+
export const scrollToErrorElement = () => {
|
|
44
|
+
const firstErrorElement = document.querySelector('.is-error');
|
|
45
|
+
if (firstErrorElement) {
|
|
46
|
+
firstErrorElement.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
47
|
+
}
|
|
48
48
|
}
|
package/src/utils/cell-style.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// 设置表格字体大小
|
|
2
|
-
export function tableFontCellStyle({
|
|
3
|
-
row,
|
|
4
|
-
column,
|
|
5
|
-
rowIndex,
|
|
6
|
-
columnIndex,
|
|
7
|
-
}: never) {
|
|
8
|
-
return {
|
|
9
|
-
'font-size': 'var(--font-size-description)'
|
|
10
|
-
};
|
|
11
|
-
}
|
|
1
|
+
// 设置表格字体大小
|
|
2
|
+
export function tableFontCellStyle({
|
|
3
|
+
row,
|
|
4
|
+
column,
|
|
5
|
+
rowIndex,
|
|
6
|
+
columnIndex,
|
|
7
|
+
}: never) {
|
|
8
|
+
return {
|
|
9
|
+
'font-size': 'var(--font-size-description)'
|
|
10
|
+
};
|
|
11
|
+
}
|
package/src/utils/crypto.ts
CHANGED
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
import { sm3, sm4 } from "sm-crypto";
|
|
2
|
-
|
|
3
|
-
export const encryptSM4 = (txt: string, key: string) => {
|
|
4
|
-
// 加密结果
|
|
5
|
-
return sm4.encrypt(txt, strToUtf8Bytes(key));
|
|
6
|
-
//java对应使用示例
|
|
7
|
-
// SymmetricCrypto sm4 = new SymmetricCrypto("SM4/ECB/PKCS5Padding", key.getBytes());
|
|
8
|
-
// System.out.println(sm4.encryptHex(txt));
|
|
9
|
-
};
|
|
10
|
-
export const decryptSM4 = (txt: string, key: string) => {
|
|
11
|
-
// 解密结果
|
|
12
|
-
return sm4.decrypt(txt, strToUtf8Bytes(key));
|
|
13
|
-
//java对应使用示例
|
|
14
|
-
// SymmetricCrypto sm4 = new SymmetricCrypto("SM4/ECB/PKCS5Padding", key.getBytes());
|
|
15
|
-
// System.out.println(sm4.decryptHex(txt));
|
|
16
|
-
};
|
|
17
|
-
export const encryptSM3 = (txt: string) => {
|
|
18
|
-
// 加密结果
|
|
19
|
-
return sm3(txt);
|
|
20
|
-
//java对应使用示例
|
|
21
|
-
// SymmetricCrypto sm4 = new SymmetricCrypto("SM4/ECB/PKCS5Padding", key.getBytes());
|
|
22
|
-
// System.out.println(sm4.encryptHex(txt));
|
|
23
|
-
};
|
|
24
|
-
function strToUtf8Bytes(str: string) {
|
|
25
|
-
const utf8 = [];
|
|
26
|
-
for (let ii = 0; ii < str.length; ii++) {
|
|
27
|
-
let charCode = str.charCodeAt(ii);
|
|
28
|
-
if (charCode < 0x80) utf8.push(charCode);
|
|
29
|
-
else if (charCode < 0x800) {
|
|
30
|
-
utf8.push(0xc0 | (charCode >> 6), 0x80 | (charCode & 0x3f));
|
|
31
|
-
} else if (charCode < 0xd800 || charCode >= 0xe000) {
|
|
32
|
-
utf8.push(
|
|
33
|
-
0xe0 | (charCode >> 12),
|
|
34
|
-
0x80 | ((charCode >> 6) & 0x3f),
|
|
35
|
-
0x80 | (charCode & 0x3f),
|
|
36
|
-
);
|
|
37
|
-
} else {
|
|
38
|
-
ii++;
|
|
39
|
-
// Surrogate pair:
|
|
40
|
-
// UTF-16 encodes 0x10000-0x10FFFF by subtracting 0x10000 and
|
|
41
|
-
// splitting the 20 bits of 0x0-0xFFFFF into two halves
|
|
42
|
-
charCode =
|
|
43
|
-
0x10000 + (((charCode & 0x3ff) << 10) | (str.charCodeAt(ii) & 0x3ff));
|
|
44
|
-
utf8.push(
|
|
45
|
-
0xf0 | (charCode >> 18),
|
|
46
|
-
0x80 | ((charCode >> 12) & 0x3f),
|
|
47
|
-
0x80 | ((charCode >> 6) & 0x3f),
|
|
48
|
-
0x80 | (charCode & 0x3f),
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
//兼容汉字,ASCII码表最大的值为127,大于127的值为特殊字符
|
|
53
|
-
for (let jj = 0; jj < utf8.length; jj++) {
|
|
54
|
-
let code: any = utf8[jj];
|
|
55
|
-
if (code > 127) {
|
|
56
|
-
utf8[jj] = code - 256;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return utf8;
|
|
60
|
-
}
|
|
61
|
-
// 获取加密的hrp-token
|
|
62
|
-
export const getFinalHrpToken = function () {
|
|
63
|
-
let str1 = localStorage.getItem("TOKEN") + "IhfN5d11Zk1ZC%Po" + Date.now();
|
|
64
|
-
let str2 = "*XeL#J@znVJ#sdSv";
|
|
65
|
-
return encryptSM4(str1, str2);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
// 获取本地token 不加密
|
|
69
|
-
export const getFinalTokenResident = function () {
|
|
70
|
-
return localStorage.getItem("TOKEN");
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
// 获取pms的加密token
|
|
74
|
-
export const getPMSFinalToken = function (token: string) {
|
|
75
|
-
let str1 = token + "IhfN5d11Zk1ZC%Po" + Date.now();
|
|
76
|
-
let str2 = "*XeL#J@znVJ#sdSv";
|
|
77
|
-
return encryptSM4(str1, str2);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
// 获取最终的token
|
|
81
|
-
export const getFinalToken = function () {
|
|
82
|
-
// // 从 URL中获取 projectId
|
|
83
|
-
// const hash = window.location.hash;
|
|
84
|
-
// const pathname = window.location.pathname;
|
|
85
|
-
// const projectIdMatch = hash.match(/\/project\/([^\/\?]+)/);
|
|
86
|
-
// const projectId = projectIdMatch ? projectIdMatch[1] : null;
|
|
87
|
-
|
|
88
|
-
// // 如果有 projectId,优先使用项目专属 token
|
|
89
|
-
// if (projectId && pathname.includes("/pms/")) {
|
|
90
|
-
// const projectToken = localStorage.getItem(`TOKEN-${projectId}`);
|
|
91
|
-
// if (projectToken) {
|
|
92
|
-
// return getPMSFinalToken(projectToken);
|
|
93
|
-
// }
|
|
94
|
-
// }
|
|
95
|
-
|
|
96
|
-
// 否则使用通用 TOKEN
|
|
97
|
-
return getFinalHrpToken();
|
|
98
|
-
};
|
|
1
|
+
import { sm3, sm4 } from "sm-crypto";
|
|
2
|
+
|
|
3
|
+
export const encryptSM4 = (txt: string, key: string) => {
|
|
4
|
+
// 加密结果
|
|
5
|
+
return sm4.encrypt(txt, strToUtf8Bytes(key));
|
|
6
|
+
//java对应使用示例
|
|
7
|
+
// SymmetricCrypto sm4 = new SymmetricCrypto("SM4/ECB/PKCS5Padding", key.getBytes());
|
|
8
|
+
// System.out.println(sm4.encryptHex(txt));
|
|
9
|
+
};
|
|
10
|
+
export const decryptSM4 = (txt: string, key: string) => {
|
|
11
|
+
// 解密结果
|
|
12
|
+
return sm4.decrypt(txt, strToUtf8Bytes(key));
|
|
13
|
+
//java对应使用示例
|
|
14
|
+
// SymmetricCrypto sm4 = new SymmetricCrypto("SM4/ECB/PKCS5Padding", key.getBytes());
|
|
15
|
+
// System.out.println(sm4.decryptHex(txt));
|
|
16
|
+
};
|
|
17
|
+
export const encryptSM3 = (txt: string) => {
|
|
18
|
+
// 加密结果
|
|
19
|
+
return sm3(txt);
|
|
20
|
+
//java对应使用示例
|
|
21
|
+
// SymmetricCrypto sm4 = new SymmetricCrypto("SM4/ECB/PKCS5Padding", key.getBytes());
|
|
22
|
+
// System.out.println(sm4.encryptHex(txt));
|
|
23
|
+
};
|
|
24
|
+
function strToUtf8Bytes(str: string) {
|
|
25
|
+
const utf8 = [];
|
|
26
|
+
for (let ii = 0; ii < str.length; ii++) {
|
|
27
|
+
let charCode = str.charCodeAt(ii);
|
|
28
|
+
if (charCode < 0x80) utf8.push(charCode);
|
|
29
|
+
else if (charCode < 0x800) {
|
|
30
|
+
utf8.push(0xc0 | (charCode >> 6), 0x80 | (charCode & 0x3f));
|
|
31
|
+
} else if (charCode < 0xd800 || charCode >= 0xe000) {
|
|
32
|
+
utf8.push(
|
|
33
|
+
0xe0 | (charCode >> 12),
|
|
34
|
+
0x80 | ((charCode >> 6) & 0x3f),
|
|
35
|
+
0x80 | (charCode & 0x3f),
|
|
36
|
+
);
|
|
37
|
+
} else {
|
|
38
|
+
ii++;
|
|
39
|
+
// Surrogate pair:
|
|
40
|
+
// UTF-16 encodes 0x10000-0x10FFFF by subtracting 0x10000 and
|
|
41
|
+
// splitting the 20 bits of 0x0-0xFFFFF into two halves
|
|
42
|
+
charCode =
|
|
43
|
+
0x10000 + (((charCode & 0x3ff) << 10) | (str.charCodeAt(ii) & 0x3ff));
|
|
44
|
+
utf8.push(
|
|
45
|
+
0xf0 | (charCode >> 18),
|
|
46
|
+
0x80 | ((charCode >> 12) & 0x3f),
|
|
47
|
+
0x80 | ((charCode >> 6) & 0x3f),
|
|
48
|
+
0x80 | (charCode & 0x3f),
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//兼容汉字,ASCII码表最大的值为127,大于127的值为特殊字符
|
|
53
|
+
for (let jj = 0; jj < utf8.length; jj++) {
|
|
54
|
+
let code: any = utf8[jj];
|
|
55
|
+
if (code > 127) {
|
|
56
|
+
utf8[jj] = code - 256;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return utf8;
|
|
60
|
+
}
|
|
61
|
+
// 获取加密的hrp-token
|
|
62
|
+
export const getFinalHrpToken = function () {
|
|
63
|
+
let str1 = localStorage.getItem("TOKEN") + "IhfN5d11Zk1ZC%Po" + Date.now();
|
|
64
|
+
let str2 = "*XeL#J@znVJ#sdSv";
|
|
65
|
+
return encryptSM4(str1, str2);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// 获取本地token 不加密
|
|
69
|
+
export const getFinalTokenResident = function () {
|
|
70
|
+
return localStorage.getItem("TOKEN");
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// 获取pms的加密token
|
|
74
|
+
export const getPMSFinalToken = function (token: string) {
|
|
75
|
+
let str1 = token + "IhfN5d11Zk1ZC%Po" + Date.now();
|
|
76
|
+
let str2 = "*XeL#J@znVJ#sdSv";
|
|
77
|
+
return encryptSM4(str1, str2);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// 获取最终的token
|
|
81
|
+
export const getFinalToken = function () {
|
|
82
|
+
// // 从 URL中获取 projectId
|
|
83
|
+
// const hash = window.location.hash;
|
|
84
|
+
// const pathname = window.location.pathname;
|
|
85
|
+
// const projectIdMatch = hash.match(/\/project\/([^\/\?]+)/);
|
|
86
|
+
// const projectId = projectIdMatch ? projectIdMatch[1] : null;
|
|
87
|
+
|
|
88
|
+
// // 如果有 projectId,优先使用项目专属 token
|
|
89
|
+
// if (projectId && pathname.includes("/pms/")) {
|
|
90
|
+
// const projectToken = localStorage.getItem(`TOKEN-${projectId}`);
|
|
91
|
+
// if (projectToken) {
|
|
92
|
+
// return getPMSFinalToken(projectToken);
|
|
93
|
+
// }
|
|
94
|
+
// }
|
|
95
|
+
|
|
96
|
+
// 否则使用通用 TOKEN
|
|
97
|
+
return getFinalHrpToken();
|
|
98
|
+
};
|
package/src/utils/dd-utils.ts
CHANGED
|
@@ -1,158 +1,158 @@
|
|
|
1
|
-
import dd from "dingtalk-jsapi";
|
|
2
|
-
import FileBaseInfo from "hrp-ui-base/api/bms/file/bo/FileBaseInfo"
|
|
3
|
-
import { IsPc } from "./get-env";
|
|
4
|
-
import { ElMessage } from "element-plus";
|
|
5
|
-
/**
|
|
6
|
-
* @description 跳转到新标签页的方法(兼容钉钉内)
|
|
7
|
-
* @param aimUrl
|
|
8
|
-
*/
|
|
9
|
-
export const ddWindowOpen = (aimUrl: string) => {
|
|
10
|
-
if (dd.env.platform !== "notInDingTalk") {
|
|
11
|
-
// 在钉钉
|
|
12
|
-
window.open(aimUrl + "/?ddtab=true", "_blank");
|
|
13
|
-
} else {
|
|
14
|
-
if (window.oaTool && window.oaTool.isOA) {
|
|
15
|
-
window.oaTool.openNewWindow(aimUrl);
|
|
16
|
-
return;
|
|
17
|
-
} else {
|
|
18
|
-
// 不在钉钉
|
|
19
|
-
window.open(aimUrl, "_blank");
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* @description 获取转码路由
|
|
25
|
-
*/
|
|
26
|
-
export const openEncodeUrl = (url: string) => {
|
|
27
|
-
return encodeURIComponent(url);
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* @description 获取到当前用来换取appId的url地址 兼容dd
|
|
32
|
-
* @param str
|
|
33
|
-
*/
|
|
34
|
-
export const getProcessAppIdUrl = (str: string) => {
|
|
35
|
-
if (str.indexOf("?") > -1) {
|
|
36
|
-
if (str.indexOf("/?") > -1) {
|
|
37
|
-
str = str.split("/?")[0];
|
|
38
|
-
} else {
|
|
39
|
-
str = str.split("?")[0];
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
if (str[str.length - 1] === "/") {
|
|
43
|
-
str = str.substring(0, str.length - 1);
|
|
44
|
-
}
|
|
45
|
-
return str;
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* @description 修改钉钉网页的title
|
|
49
|
-
* @param str
|
|
50
|
-
*/
|
|
51
|
-
export const setDingDingTitle = (str?: any) => {
|
|
52
|
-
if (!str || typeof str !== "string") return;
|
|
53
|
-
if (dd.env.platform !== "notInDingTalk") {
|
|
54
|
-
// 在钉钉
|
|
55
|
-
dd.biz.navigation.setTitle({
|
|
56
|
-
title: str,
|
|
57
|
-
});
|
|
58
|
-
document.title = str;
|
|
59
|
-
|
|
60
|
-
} else {
|
|
61
|
-
if (window.oaTool && window.oaTool.isOA) {
|
|
62
|
-
window.oaTool.setTitle(str);
|
|
63
|
-
return;
|
|
64
|
-
} else {
|
|
65
|
-
// 不在钉钉
|
|
66
|
-
document.title = str;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
/** 文件名解码 */
|
|
71
|
-
function decodeFileName(encodedName: string) {
|
|
72
|
-
try {
|
|
73
|
-
// 先进行基本的 URL 解码
|
|
74
|
-
let decoded = decodeURIComponent(encodedName);
|
|
75
|
-
// 处理可能的加号(空格)问题
|
|
76
|
-
decoded = decoded.replace(/\+/g, ' ');
|
|
77
|
-
return decoded;
|
|
78
|
-
} catch (e) {
|
|
79
|
-
console.error('文件名解码失败:', e);
|
|
80
|
-
return encodedName; // 解码失败时返回原名称
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function resolveUrl(url:string) {
|
|
84
|
-
// 如果是完整 URL(包含协议,如 http://、https://、ftp:// 等)
|
|
85
|
-
try {
|
|
86
|
-
new URL(url);
|
|
87
|
-
return url; // 是完整链接,直接返回
|
|
88
|
-
} catch (e) {
|
|
89
|
-
// 不是完整 URL,继续判断
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const origin = window.location.origin;
|
|
93
|
-
const pathname = window.location.pathname;
|
|
94
|
-
|
|
95
|
-
// 去掉开头的 ./ 或 /
|
|
96
|
-
if (url.startsWith('./')) {
|
|
97
|
-
url = url.substring(2);
|
|
98
|
-
} else if (url.startsWith('/')) {
|
|
99
|
-
url = url.substring(1);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// 获取当前页面路径的目录部分(去掉最后的文件名或结尾斜杠)
|
|
103
|
-
const dirPath = pathname.endsWith('/')
|
|
104
|
-
? pathname
|
|
105
|
-
: pathname.substring(0, pathname.lastIndexOf('/') + 1);
|
|
106
|
-
|
|
107
|
-
// 拼接完整 URL
|
|
108
|
-
return origin + dirPath + url;
|
|
109
|
-
}
|
|
110
|
-
/** 下载文件 */
|
|
111
|
-
export const downloadFile =async (item: FileBaseInfo) => {
|
|
112
|
-
let uploadType = ""
|
|
113
|
-
|
|
114
|
-
try {
|
|
115
|
-
let currentUserConfig = sessionStorage.getItem("userConfig")
|
|
116
|
-
? JSON.parse(sessionStorage.getItem("userConfig") as string)
|
|
117
|
-
: null;
|
|
118
|
-
uploadType = currentUserConfig.fileUploadType
|
|
119
|
-
|
|
120
|
-
} catch (error) {
|
|
121
|
-
console.log(error)
|
|
122
|
-
}
|
|
123
|
-
try {
|
|
124
|
-
|
|
125
|
-
await navigator.clipboard.writeText(resolveUrl(item.url));
|
|
126
|
-
console.log('URL 已复制到剪贴板:', resolveUrl(item.url));
|
|
127
|
-
ElMessage.success("文件下载链接已写入剪切板,如遇系统无法下载,自行复制到浏览器打开链接即可下载!")
|
|
128
|
-
} catch (err) {
|
|
129
|
-
console.error('无法写入剪贴板:', err);
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// if (dd.env.platform !== "notInDingTalk" && uploadType == 'oss' && IsPc()) {
|
|
134
|
-
// // 在钉钉
|
|
135
|
-
// dd.downloadFile({
|
|
136
|
-
// url: decodeFileName(item.url),
|
|
137
|
-
// success: (res: any) => {
|
|
138
|
-
// console.log(res);
|
|
139
|
-
// },
|
|
140
|
-
// fail: (err: any) => {
|
|
141
|
-
// console.log(err);
|
|
142
|
-
// },
|
|
143
|
-
// complete: () => {
|
|
144
|
-
|
|
145
|
-
// },
|
|
146
|
-
// });
|
|
147
|
-
// } else {
|
|
148
|
-
let aContent = document.createElement("a");
|
|
149
|
-
// @ts-ignore
|
|
150
|
-
aContent.style = "display: none";
|
|
151
|
-
aContent.download = item.fileName;
|
|
152
|
-
aContent.href = item.url;
|
|
153
|
-
aContent.target = "_blank";
|
|
154
|
-
document.body.appendChild(aContent);
|
|
155
|
-
aContent.click(); // 触发a标签的click事件
|
|
156
|
-
document.body.removeChild(aContent);
|
|
157
|
-
// }
|
|
1
|
+
import dd from "dingtalk-jsapi";
|
|
2
|
+
import FileBaseInfo from "hrp-ui-base/api/bms/file/bo/FileBaseInfo"
|
|
3
|
+
import { IsPc } from "./get-env";
|
|
4
|
+
import { ElMessage } from "element-plus";
|
|
5
|
+
/**
|
|
6
|
+
* @description 跳转到新标签页的方法(兼容钉钉内)
|
|
7
|
+
* @param aimUrl
|
|
8
|
+
*/
|
|
9
|
+
export const ddWindowOpen = (aimUrl: string) => {
|
|
10
|
+
if (dd.env.platform !== "notInDingTalk") {
|
|
11
|
+
// 在钉钉
|
|
12
|
+
window.open(aimUrl + "/?ddtab=true", "_blank");
|
|
13
|
+
} else {
|
|
14
|
+
if (window.oaTool && window.oaTool.isOA) {
|
|
15
|
+
window.oaTool.openNewWindow(aimUrl);
|
|
16
|
+
return;
|
|
17
|
+
} else {
|
|
18
|
+
// 不在钉钉
|
|
19
|
+
window.open(aimUrl, "_blank");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* @description 获取转码路由
|
|
25
|
+
*/
|
|
26
|
+
export const openEncodeUrl = (url: string) => {
|
|
27
|
+
return encodeURIComponent(url);
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @description 获取到当前用来换取appId的url地址 兼容dd
|
|
32
|
+
* @param str
|
|
33
|
+
*/
|
|
34
|
+
export const getProcessAppIdUrl = (str: string) => {
|
|
35
|
+
if (str.indexOf("?") > -1) {
|
|
36
|
+
if (str.indexOf("/?") > -1) {
|
|
37
|
+
str = str.split("/?")[0];
|
|
38
|
+
} else {
|
|
39
|
+
str = str.split("?")[0];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (str[str.length - 1] === "/") {
|
|
43
|
+
str = str.substring(0, str.length - 1);
|
|
44
|
+
}
|
|
45
|
+
return str;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* @description 修改钉钉网页的title
|
|
49
|
+
* @param str
|
|
50
|
+
*/
|
|
51
|
+
export const setDingDingTitle = (str?: any) => {
|
|
52
|
+
if (!str || typeof str !== "string") return;
|
|
53
|
+
if (dd.env.platform !== "notInDingTalk") {
|
|
54
|
+
// 在钉钉
|
|
55
|
+
dd.biz.navigation.setTitle({
|
|
56
|
+
title: str,
|
|
57
|
+
});
|
|
58
|
+
document.title = str;
|
|
59
|
+
|
|
60
|
+
} else {
|
|
61
|
+
if (window.oaTool && window.oaTool.isOA) {
|
|
62
|
+
window.oaTool.setTitle(str);
|
|
63
|
+
return;
|
|
64
|
+
} else {
|
|
65
|
+
// 不在钉钉
|
|
66
|
+
document.title = str;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
/** 文件名解码 */
|
|
71
|
+
function decodeFileName(encodedName: string) {
|
|
72
|
+
try {
|
|
73
|
+
// 先进行基本的 URL 解码
|
|
74
|
+
let decoded = decodeURIComponent(encodedName);
|
|
75
|
+
// 处理可能的加号(空格)问题
|
|
76
|
+
decoded = decoded.replace(/\+/g, ' ');
|
|
77
|
+
return decoded;
|
|
78
|
+
} catch (e) {
|
|
79
|
+
console.error('文件名解码失败:', e);
|
|
80
|
+
return encodedName; // 解码失败时返回原名称
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function resolveUrl(url:string) {
|
|
84
|
+
// 如果是完整 URL(包含协议,如 http://、https://、ftp:// 等)
|
|
85
|
+
try {
|
|
86
|
+
new URL(url);
|
|
87
|
+
return url; // 是完整链接,直接返回
|
|
88
|
+
} catch (e) {
|
|
89
|
+
// 不是完整 URL,继续判断
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const origin = window.location.origin;
|
|
93
|
+
const pathname = window.location.pathname;
|
|
94
|
+
|
|
95
|
+
// 去掉开头的 ./ 或 /
|
|
96
|
+
if (url.startsWith('./')) {
|
|
97
|
+
url = url.substring(2);
|
|
98
|
+
} else if (url.startsWith('/')) {
|
|
99
|
+
url = url.substring(1);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// 获取当前页面路径的目录部分(去掉最后的文件名或结尾斜杠)
|
|
103
|
+
const dirPath = pathname.endsWith('/')
|
|
104
|
+
? pathname
|
|
105
|
+
: pathname.substring(0, pathname.lastIndexOf('/') + 1);
|
|
106
|
+
|
|
107
|
+
// 拼接完整 URL
|
|
108
|
+
return origin + dirPath + url;
|
|
109
|
+
}
|
|
110
|
+
/** 下载文件 */
|
|
111
|
+
export const downloadFile =async (item: FileBaseInfo) => {
|
|
112
|
+
let uploadType = ""
|
|
113
|
+
|
|
114
|
+
try {
|
|
115
|
+
let currentUserConfig = sessionStorage.getItem("userConfig")
|
|
116
|
+
? JSON.parse(sessionStorage.getItem("userConfig") as string)
|
|
117
|
+
: null;
|
|
118
|
+
uploadType = currentUserConfig.fileUploadType
|
|
119
|
+
|
|
120
|
+
} catch (error) {
|
|
121
|
+
console.log(error)
|
|
122
|
+
}
|
|
123
|
+
try {
|
|
124
|
+
|
|
125
|
+
await navigator.clipboard.writeText(resolveUrl(item.url));
|
|
126
|
+
console.log('URL 已复制到剪贴板:', resolveUrl(item.url));
|
|
127
|
+
ElMessage.success("文件下载链接已写入剪切板,如遇系统无法下载,自行复制到浏览器打开链接即可下载!")
|
|
128
|
+
} catch (err) {
|
|
129
|
+
console.error('无法写入剪贴板:', err);
|
|
130
|
+
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// if (dd.env.platform !== "notInDingTalk" && uploadType == 'oss' && IsPc()) {
|
|
134
|
+
// // 在钉钉
|
|
135
|
+
// dd.downloadFile({
|
|
136
|
+
// url: decodeFileName(item.url),
|
|
137
|
+
// success: (res: any) => {
|
|
138
|
+
// console.log(res);
|
|
139
|
+
// },
|
|
140
|
+
// fail: (err: any) => {
|
|
141
|
+
// console.log(err);
|
|
142
|
+
// },
|
|
143
|
+
// complete: () => {
|
|
144
|
+
|
|
145
|
+
// },
|
|
146
|
+
// });
|
|
147
|
+
// } else {
|
|
148
|
+
let aContent = document.createElement("a");
|
|
149
|
+
// @ts-ignore
|
|
150
|
+
aContent.style = "display: none";
|
|
151
|
+
aContent.download = item.fileName;
|
|
152
|
+
aContent.href = item.url;
|
|
153
|
+
aContent.target = "_blank";
|
|
154
|
+
document.body.appendChild(aContent);
|
|
155
|
+
aContent.click(); // 触发a标签的click事件
|
|
156
|
+
document.body.removeChild(aContent);
|
|
157
|
+
// }
|
|
158
158
|
};
|