ztxkui 4.2.18-21 → 4.2.18-220
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/dist/App.js +315 -291
- package/dist/Demo.js +64 -43
- package/dist/DemoCom/BasicDemo.js +57 -56
- package/dist/DemoCom/CodeQueryDemo.js +3 -2
- package/dist/DemoCom/CollapseDemo.js +28 -27
- package/dist/DemoCom/DragSort.js +11 -10
- package/dist/DemoCom/FormDemo.js +36 -30
- package/dist/DemoCom/PrintContainerDemo.js +151 -150
- package/dist/DemoCom/PrintDemo.js +15 -14
- package/dist/DemoCom/SinaturesDemo.js +9 -8
- package/dist/DemoCom/SyhDemo.js +21 -20
- package/dist/DemoCom/TableAnalyse.js +34 -33
- package/dist/DemoCom/TableDemo.js +73 -69
- package/dist/DemoCom/TableDemo1.js +84 -34
- package/dist/DemoCom/TableDetail.d.ts +9 -0
- package/dist/DemoCom/TableDetail.js +259 -0
- package/dist/DemoCom/TestCom.js +22 -19
- package/dist/DemoCom/data.d.ts +110 -0
- package/dist/DemoCom/data.js +2308 -0
- package/dist/TableDemo/BasicTable.js +225 -25
- package/dist/TableDemo/EditableTable.js +146 -72
- package/dist/TableDemo/ModalTable.js +25 -24
- package/dist/TableDemo/ProEditableTable.js +30 -29
- package/dist/TableDemo/data.d.ts +34 -0
- package/dist/TableDemo/data.js +387 -10
- package/dist/TableDemo/index.js +3 -3
- package/dist/TreeDemo.js +8 -7
- package/dist/TreeSelectDemo.js +12 -8
- package/dist/UI/Form/index.d.ts +3 -0
- package/dist/UI/Form/index.js +347 -0
- package/dist/UI/Input/index.d.ts +17 -0
- package/dist/UI/Input/index.js +74 -0
- package/dist/UI/InputNumber/index.d.ts +3 -0
- package/dist/UI/InputNumber/index.js +45 -0
- package/dist/UI/OldForm/index.d.ts +9 -0
- package/dist/UI/OldForm/index.js +302 -0
- package/dist/UI/Select/EmpForQuitDemo.d.ts +15 -0
- package/dist/UI/Select/EmpForQuitDemo.js +120 -0
- package/dist/UI/Select/index.d.ts +10 -0
- package/dist/UI/Select/index.js +207 -0
- package/dist/UI/Table/BusinessListDemo.d.ts +15 -0
- package/dist/UI/Table/BusinessListDemo.js +227 -0
- package/dist/UI/Table/BusinessMemberDemo.d.ts +18 -0
- package/dist/UI/Table/BusinessMemberDemo.js +181 -0
- package/dist/UI/Table/index.d.ts +10 -0
- package/dist/UI/Table/index.js +850 -0
- package/dist/UI/TreeSelect/index.d.ts +3 -0
- package/dist/UI/TreeSelect/index.js +120 -0
- package/dist/UI/index.d.ts +2 -0
- package/dist/UI/index.js +34 -0
- package/dist/UploadDemo.js +27 -23
- package/dist/components/Button/button.d.ts +6 -0
- package/dist/components/Button/button.js +11 -4
- package/dist/components/Collapse/collapse.js +2 -1
- package/dist/components/DatePicker/data-picker.d.ts +3 -1
- package/dist/components/EnhanceSelect/index.d.ts +11 -1
- package/dist/components/EnhanceSelect/index.js +231 -49
- package/dist/components/EnhanceTree/index.js +4 -3
- package/dist/components/EnhanceTreeSelect/index.d.ts +5 -1
- package/dist/components/EnhanceTreeSelect/index.js +57 -7
- package/dist/components/Export/export.js +5 -4
- package/dist/components/Form/form.d.ts +11 -1
- package/dist/components/Form/form.js +5 -3
- package/dist/components/Input/input.d.ts +5 -3
- package/dist/components/Input/input.js +72 -3
- package/dist/components/InputNumber/input-number.js +3 -2
- package/dist/components/Layout/layout.d.ts +4 -4
- package/dist/components/Menu/menu.d.ts +1 -1
- package/dist/components/NumberCase/index.js +9 -7
- package/dist/components/Print/print.js +4 -3
- package/dist/components/PrintContainer/AttachPreviewModal.js +3 -2
- package/dist/components/PrintContainer/PrintModal.js +4 -3
- package/dist/components/PrintContainer/handle.d.ts +2 -4
- package/dist/components/PrintContainer/handle.js +3 -2
- package/dist/components/PrintContainer/lodop.js +2 -1
- package/dist/components/PrintContainer/print-container.js +74 -73
- package/dist/components/PrintContainer/service.js +5 -4
- package/dist/components/ProForm/hooks.d.ts +23 -0
- package/dist/components/ProForm/hooks.js +209 -0
- package/dist/components/ProForm/index.d.ts +9 -0
- package/dist/components/ProForm/index.js +168 -0
- package/dist/components/ProForm/interface.d.ts +200 -0
- package/dist/components/ProForm/interface.js +1 -0
- package/dist/components/ProForm/item.d.ts +13 -0
- package/dist/components/ProForm/item.js +222 -0
- package/dist/components/ProForm/items.d.ts +5 -0
- package/dist/components/ProForm/items.js +36 -0
- package/dist/components/ProForm/record-common-list.d.ts +18 -0
- package/dist/components/ProForm/record-common-list.js +83 -0
- package/dist/components/ProForm/search-drawer.d.ts +14 -0
- package/dist/components/ProForm/search-drawer.js +237 -0
- package/dist/components/ProForm/setting.d.ts +5 -0
- package/dist/components/ProForm/setting.js +12 -0
- package/dist/components/ProForm/useCommonSearch.d.ts +35 -0
- package/dist/components/ProForm/useCommonSearch.js +352 -0
- package/dist/components/ProFormList/index.d.ts +12 -0
- package/dist/components/ProFormList/index.js +34 -0
- package/dist/components/RangePicker/range-picker.js +5 -2
- package/dist/components/SortableCancel/sortable-cancel.d.ts +1 -0
- package/dist/components/SortableCancel/sortable-cancel.js +2 -2
- package/dist/components/Table/components/FillDown.js +2 -1
- package/dist/components/Table/components/FilterDropdown.d.ts +1 -0
- package/dist/components/Table/components/FilterDropdown.js +36 -12
- package/dist/components/Table/hooks/useColumns.d.ts +5 -0
- package/dist/components/Table/hooks/useColumns.js +396 -22
- package/dist/components/Table/hooks/useDropRef.js +2 -1
- package/dist/components/Table/hooks/useScuRfresh.d.ts +3 -0
- package/dist/components/Table/hooks/useScuRfresh.js +22 -0
- package/dist/components/Table/hooks/useSelectSubtotal.js +5 -1
- package/dist/components/Table/hooks/useVituralScrollBar.d.ts +10 -0
- package/dist/components/Table/hooks/useVituralScrollBar.js +234 -0
- package/dist/components/Table/index.d.ts +4 -0
- package/dist/components/Table/table-adddel-column.js +4 -3
- package/dist/components/Table/table-dynamic.d.ts +1 -0
- package/dist/components/Table/table-dynamic.js +447 -60
- package/dist/components/Table/table-enhance-cell.d.ts +3 -0
- package/dist/components/Table/table-enhance-cell.js +28 -8
- package/dist/components/Table/table-menu.d.ts +7 -0
- package/dist/components/Table/table-menu.js +359 -0
- package/dist/components/Table/table-resizable-title.js +1 -0
- package/dist/components/Table/table-sort.js +4 -3
- package/dist/components/Table/table.d.ts +16 -0
- package/dist/components/Table/table.js +241 -65
- package/dist/components/Table/utils/dom.js +2 -1
- package/dist/components/Table/utils/filterHandle.d.ts +1 -1
- package/dist/components/Table/utils/filterHandle.js +27 -12
- package/dist/components/Table/utils/getSummaryData.d.ts +1 -1
- package/dist/components/Table/utils/getSummaryData.js +279 -24
- package/dist/components/Table/utils/shallowEqual.js +2 -1
- package/dist/components/Table/utils/validate.js +25 -6
- package/dist/components/Tabs/tabs.d.ts +2 -0
- package/dist/components/Tabs/tabs.js +3 -1
- package/dist/components/TranslationButton/DownFile.d.ts +7 -0
- package/dist/components/TranslationButton/DownFile.js +95 -0
- package/dist/components/TranslationButton/PreviewFile.d.ts +5 -0
- package/dist/components/TranslationButton/PreviewFile.js +73 -0
- package/dist/components/TranslationButton/TranslationButton.d.ts +34 -0
- package/dist/components/TranslationButton/TranslationButton.js +245 -0
- package/dist/components/TranslationButton/hooks.d.ts +8 -0
- package/dist/components/TranslationButton/hooks.js +139 -0
- package/dist/components/TranslationButton/index.d.ts +4 -0
- package/dist/components/TranslationButton/index.js +4 -0
- package/dist/components/TreeSelect/index.d.ts +19 -0
- package/dist/components/TreeSelect/index.js +88 -0
- package/dist/components/Upload/upload-table.js +31 -26
- package/dist/components/Upload/upload.d.ts +20 -1
- package/dist/components/Upload/upload.js +172 -27
- package/dist/components/Upload/utils.d.ts +9 -2
- package/dist/components/Upload/utils.js +153 -38
- package/dist/components/UploadCustom/hooks/useDg.d.ts +6 -0
- package/dist/components/UploadCustom/hooks/useDg.js +55 -0
- package/dist/components/UploadSingle/upload-single.js +5 -4
- package/dist/components/Watermark/index.d.ts +2 -0
- package/dist/components/Watermark/index.js +2 -0
- package/dist/components/Watermark/interface.d.ts +20 -0
- package/dist/components/Watermark/interface.js +1 -0
- package/dist/components/Watermark/utils.d.ts +1 -0
- package/dist/components/Watermark/utils.js +70 -0
- package/dist/components/Watermark/water.d.ts +50 -0
- package/dist/components/Watermark/water.js +66 -0
- package/dist/components/Watermark/watermark-div.d.ts +4 -0
- package/dist/components/Watermark/watermark-div.js +41 -0
- package/dist/components/Watermark/watermark-shadow.d.ts +6 -0
- package/dist/components/Watermark/watermark-shadow.js +116 -0
- package/dist/components/Watermark/watermark.d.ts +3 -0
- package/dist/components/Watermark/watermark.js +102 -0
- package/dist/components/WorkflowPrintContainer/component/Gragh/Gragh.d.ts +9 -0
- package/dist/components/WorkflowPrintContainer/component/Gragh/Gragh.js +63 -0
- package/dist/components/WorkflowPrintContainer/component/Header.d.ts +12 -0
- package/dist/components/WorkflowPrintContainer/component/Header.js +109 -0
- package/dist/components/WorkflowPrintContainer/component/ProcessDetail.d.ts +18 -0
- package/dist/components/WorkflowPrintContainer/component/ProcessDetail.js +243 -0
- package/dist/components/WorkflowPrintContainer/component/Upload/index.d.ts +20 -0
- package/dist/components/WorkflowPrintContainer/component/Upload/index.js +59 -0
- package/dist/components/WorkflowPrintContainer/component/association/component/TableList.d.ts +10 -0
- package/dist/components/WorkflowPrintContainer/component/association/component/TableList.js +75 -0
- package/dist/components/WorkflowPrintContainer/component/association/index.d.ts +9 -0
- package/dist/components/WorkflowPrintContainer/component/association/index.js +92 -0
- package/dist/components/WorkflowPrintContainer/component/attention/component/TableList.d.ts +9 -0
- package/dist/components/WorkflowPrintContainer/component/attention/component/TableList.js +38 -0
- package/dist/components/WorkflowPrintContainer/component/attention/index.d.ts +10 -0
- package/dist/components/WorkflowPrintContainer/component/attention/index.js +95 -0
- package/dist/components/WorkflowPrintContainer/component/audit/component/TableList.d.ts +8 -0
- package/dist/components/WorkflowPrintContainer/component/audit/component/TableList.js +53 -0
- package/dist/components/WorkflowPrintContainer/component/audit/index.d.ts +7 -0
- package/dist/components/WorkflowPrintContainer/component/audit/index.js +88 -0
- package/dist/components/WorkflowPrintContainer/component/previewTable/component/TableList.d.ts +9 -0
- package/dist/components/WorkflowPrintContainer/component/previewTable/component/TableList.js +53 -0
- package/dist/components/WorkflowPrintContainer/component/previewTable/index.d.ts +11 -0
- package/dist/components/WorkflowPrintContainer/component/previewTable/index.js +60 -0
- package/dist/components/WorkflowPrintContainer/component/send/component/TableList.d.ts +9 -0
- package/dist/components/WorkflowPrintContainer/component/send/component/TableList.js +50 -0
- package/dist/components/WorkflowPrintContainer/component/send/index.d.ts +9 -0
- package/dist/components/WorkflowPrintContainer/component/send/index.js +92 -0
- package/dist/components/WorkflowPrintContainer/component/trail/component/TableList.d.ts +12 -0
- package/dist/components/WorkflowPrintContainer/component/trail/component/TableList.js +282 -0
- package/dist/components/WorkflowPrintContainer/component/trail/index.d.ts +11 -0
- package/dist/components/WorkflowPrintContainer/component/trail/index.js +56 -0
- package/dist/components/WorkflowPrintContainer/images.d.ts +2 -0
- package/dist/components/WorkflowPrintContainer/images.js +2 -0
- package/dist/components/WorkflowPrintContainer/index.d.ts +2 -0
- package/dist/components/WorkflowPrintContainer/index.js +2 -0
- package/dist/components/WorkflowPrintContainer/service.d.ts +14 -0
- package/dist/components/WorkflowPrintContainer/service.js +101 -0
- package/dist/components/WorkflowPrintContainer/usePagination.d.ts +14 -0
- package/dist/components/WorkflowPrintContainer/usePagination.js +22 -0
- package/dist/components/WorkflowPrintContainer/workflow-print-container.d.ts +100 -0
- package/dist/components/WorkflowPrintContainer/workflow-print-container.js +236 -0
- package/dist/components/ZtIcon/index.js +2 -0
- package/dist/components/business/Analyse/index.js +12 -11
- package/dist/components/business/CodeQuery/component/SearchForm.js +3 -2
- package/dist/components/business/CodeQuery/component/TableList.js +5 -4
- package/dist/components/business/CodeQuery/hooks.js +2 -1
- package/dist/components/business/CodeQuery/index.js +2 -1
- package/dist/components/business/Common/UserForgetPassword/index.js +36 -28
- package/dist/components/business/Common/UserInfo/component/MakingForm.js +11 -10
- package/dist/components/business/Common/UserInfo/index.js +5 -4
- package/dist/components/business/Common/UserPassword/index.js +14 -11
- package/dist/components/business/Common/validatePassword.d.ts +1 -1
- package/dist/components/business/Common/validatePassword.js +17 -7
- package/dist/components/business/DetailCard/index.js +7 -6
- package/dist/components/business/DetailHeader/index.js +7 -6
- package/dist/components/business/DetailList/index.js +5 -4
- package/dist/components/business/DgColumns/index.js +12 -11
- package/dist/components/business/ExportButton/index.js +6 -5
- package/dist/components/business/Footer/index.js +4 -1
- package/dist/components/business/GridList/item.d.ts +1 -1
- package/dist/components/business/List/item.d.ts +1 -1
- package/dist/components/business/NewList/item.d.ts +1 -1
- package/dist/components/business/NewList/item.js +1 -1
- package/dist/components/business/OperationBtnGroup/index.js +17 -16
- package/dist/components/business/SearchContainer/hooks/useDynamic.d.ts +2 -1
- package/dist/components/business/SearchContainer/hooks/useDynamic.js +6 -3
- package/dist/components/business/SearchContainer/hooks/useToggle.d.ts +1 -1
- package/dist/components/business/SearchContainer/hooks/useToggle.js +31 -12
- package/dist/components/business/SearchContainer/record-common-item.d.ts +14 -0
- package/dist/components/business/SearchContainer/record-common-item.js +83 -0
- package/dist/components/business/SearchContainer/record-common-list.d.ts +3 -0
- package/dist/components/business/SearchContainer/record-common-list.js +95 -0
- package/dist/components/business/SearchContainer/search-container.d.ts +22 -0
- package/dist/components/business/SearchContainer/search-container.js +66 -3
- package/dist/components/business/SearchContainer/search-drawer.d.ts +1 -0
- package/dist/components/business/SearchContainer/search-drawer.js +167 -13
- package/dist/components/business/SearchContainer/search-item.js +48 -5
- package/dist/components/business/SearchContainer/search-left.d.ts +8 -0
- package/dist/components/business/SearchContainer/search-left.js +105 -68
- package/dist/components/business/SearchContainer/search-right.d.ts +4 -0
- package/dist/components/business/SearchContainer/search-right.js +62 -5
- package/dist/components/business/SearchContainer/useRecordCommonInit.d.ts +18 -0
- package/dist/components/business/SearchContainer/useRecordCommonInit.js +258 -0
- package/dist/components/business/SearchContainer/useRecordCommonSearch.d.ts +8 -0
- package/dist/components/business/SearchContainer/useRecordCommonSearch.js +145 -0
- package/dist/components/business/SearchContainer/useRecordCommonSearchContext.d.ts +37 -0
- package/dist/components/business/SearchContainer/useRecordCommonSearchContext.js +8 -0
- package/dist/components/business/SearchContainer/useTemplate.d.ts +20 -0
- package/dist/components/business/SearchContainer/useTemplate.js +347 -0
- package/dist/components/business/Signatures/components/AttachOperation.js +7 -6
- package/dist/components/business/Signatures/components/CodeModal.d.ts +3 -0
- package/dist/components/business/Signatures/components/CodeModal.js +157 -0
- package/dist/components/business/Signatures/components/CompareResult.js +7 -6
- package/dist/components/business/Signatures/components/DetailTable.js +37 -34
- package/dist/components/business/Signatures/components/QunjSeal.js +5 -4
- package/dist/components/business/Signatures/components/SealCheckbox.js +3 -2
- package/dist/components/business/Signatures/components/TemplateAttach.js +2 -1
- package/dist/components/business/Signatures/index.js +64 -53
- package/dist/components/business/SortList/sort-drawer.js +5 -4
- package/dist/components/business/Template/index.js +11 -10
- package/dist/components/electron-signatures/content.d.ts +9 -0
- package/dist/components/electron-signatures/content.js +1146 -0
- package/dist/components/electron-signatures/demoComponents/coUseDetail.d.ts +8 -0
- package/dist/components/electron-signatures/demoComponents/coUseDetail.js +255 -0
- package/dist/components/electron-signatures/demoComponents/data.d.ts +58 -0
- package/dist/components/electron-signatures/demoComponents/data.js +1307 -0
- package/dist/components/electron-signatures/demoComponents/detail.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/detail.js +283 -0
- package/dist/components/electron-signatures/demoComponents/index.d.ts +2 -0
- package/dist/components/electron-signatures/demoComponents/index.js +30 -0
- package/dist/components/electron-signatures/demoComponents/jgqrd.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/jgqrd.js +135 -0
- package/dist/components/electron-signatures/demoComponents/making.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/making.js +211 -0
- package/dist/components/electron-signatures/demoComponents/makingData.d.ts +675 -0
- package/dist/components/electron-signatures/demoComponents/makingData.js +1178 -0
- package/dist/components/electron-signatures/demoComponents/newDetail.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/newDetail.js +283 -0
- package/dist/components/electron-signatures/demoComponents/preview.d.ts +3 -0
- package/dist/components/electron-signatures/demoComponents/preview.js +9 -0
- package/dist/components/electron-signatures/demoComponents/singleQjDetail.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/singleQjDetail.js +530 -0
- package/dist/components/electron-signatures/demoComponents/singleQjMaking.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/singleQjMaking.js +219 -0
- package/dist/components/electron-signatures/demoComponents/test.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/test.js +119 -0
- package/dist/components/electron-signatures/dgComponents/contract-comparison.d.ts +39 -0
- package/dist/components/electron-signatures/dgComponents/contract-comparison.js +53 -0
- package/dist/components/electron-signatures/dgComponents/file-comparison-btn.d.ts +11 -0
- package/dist/components/electron-signatures/dgComponents/file-comparison-btn.js +180 -0
- package/dist/components/electron-signatures/dgComponents/new-contract-comparison.d.ts +45 -0
- package/dist/components/electron-signatures/dgComponents/new-contract-comparison.js +68 -0
- package/dist/components/electron-signatures/dgComponents/useContractColumns.d.ts +21 -0
- package/dist/components/electron-signatures/dgComponents/useContractColumns.js +171 -0
- package/dist/components/electron-signatures/electron-signatures-fragment.d.ts +8 -0
- package/dist/components/electron-signatures/electron-signatures-fragment.js +392 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-batch-download.d.ts +52 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-batch-download.js +509 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-detail.d.ts +8 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-detail.js +59 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-download.d.ts +16 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-download.js +85 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-firstLevelPerson.d.ts +9 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-firstLevelPerson.js +16 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item-detail.d.ts +15 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item-detail.js +16 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item.d.ts +20 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item.js +47 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-list.d.ts +11 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-list.js +191 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-personal-sign.d.ts +35 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-personal-sign.js +39 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-setting.d.ts +15 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-setting.js +10 -0
- package/dist/components/electron-signatures/electronComponents/last-qys-modal.d.ts +7 -0
- package/dist/components/electron-signatures/electronComponents/last-qys-modal.js +42 -0
- package/dist/components/electron-signatures/electronComponents/useCheckedSealInfoList.d.ts +3 -0
- package/dist/components/electron-signatures/electronComponents/useCheckedSealInfoList.js +43 -0
- package/dist/components/electron-signatures/electronComponents/useElectronColumns.d.ts +30 -0
- package/dist/components/electron-signatures/electronComponents/useElectronColumns.js +398 -0
- package/dist/components/electron-signatures/electronComponents/useFetchElectronData.d.ts +24 -0
- package/dist/components/electron-signatures/electronComponents/useFetchElectronData.js +254 -0
- package/dist/components/electron-signatures/electronComponents/useGetDeptInfo.d.ts +3 -0
- package/dist/components/electron-signatures/electronComponents/useGetDeptInfo.js +35 -0
- package/dist/components/electron-signatures/fileComponents/file-operation.d.ts +7 -0
- package/dist/components/electron-signatures/fileComponents/file-operation.js +67 -0
- package/dist/components/electron-signatures/fileComponents/file-type-select.d.ts +12 -0
- package/dist/components/electron-signatures/fileComponents/file-type-select.js +10 -0
- package/dist/components/electron-signatures/fileComponents/file-upload.d.ts +11 -0
- package/dist/components/electron-signatures/fileComponents/file-upload.js +146 -0
- package/dist/components/electron-signatures/fileComponents/fileUtils.d.ts +17 -0
- package/dist/components/electron-signatures/fileComponents/fileUtils.js +36 -0
- package/dist/components/electron-signatures/fileComponents/new-file-operation.d.ts +10 -0
- package/dist/components/electron-signatures/fileComponents/new-file-operation.js +73 -0
- package/dist/components/electron-signatures/fileComponents/useFetchFileTypeData.d.ts +13 -0
- package/dist/components/electron-signatures/fileComponents/useFetchFileTypeData.js +43 -0
- package/dist/components/electron-signatures/fileComponents/useFileColumns.d.ts +38 -0
- package/dist/components/electron-signatures/fileComponents/useFileColumns.js +329 -0
- package/dist/components/electron-signatures/fileComponents/useFileTypeColumns.d.ts +19 -0
- package/dist/components/electron-signatures/fileComponents/useFileTypeColumns.js +72 -0
- package/dist/components/electron-signatures/hooks/useGetQjVerifyCode.d.ts +30 -0
- package/dist/components/electron-signatures/hooks/useGetQjVerifyCode.js +132 -0
- package/dist/components/electron-signatures/hooks/useMergeRecords.d.ts +17 -0
- package/dist/components/electron-signatures/hooks/useMergeRecords.js +49 -0
- package/dist/components/electron-signatures/hooks/useParseElectronListData.d.ts +49 -0
- package/dist/components/electron-signatures/hooks/useParseElectronListData.js +111 -0
- package/dist/components/electron-signatures/hooks/useParseElectronSetting.d.ts +111 -0
- package/dist/components/electron-signatures/hooks/useParseElectronSetting.js +436 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedElectronData.d.ts +40 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedElectronData.js +139 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedQunjData.d.ts +36 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedQunjData.js +48 -0
- package/dist/components/electron-signatures/hooks/useParseQunjListData.d.ts +56 -0
- package/dist/components/electron-signatures/hooks/useParseQunjListData.js +204 -0
- package/dist/components/electron-signatures/hooks/useParseQunjSingleData.d.ts +34 -0
- package/dist/components/electron-signatures/hooks/useParseQunjSingleData.js +110 -0
- package/dist/components/electron-signatures/hooks/useParseRecords.d.ts +65 -0
- package/dist/components/electron-signatures/hooks/useParseRecords.js +165 -0
- package/dist/components/electron-signatures/index.d.ts +15 -0
- package/dist/components/electron-signatures/index.js +63 -0
- package/dist/components/electron-signatures/interface.d.ts +865 -0
- package/dist/components/electron-signatures/interface.js +57 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-apply.d.ts +6 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-apply.js +8 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-check.d.ts +21 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-check.js +41 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-detail.d.ts +35 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-detail.js +267 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-list.d.ts +24 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-list.js +355 -0
- package/dist/components/electron-signatures/qunjComponents/useFetchQunjData.d.ts +20 -0
- package/dist/components/electron-signatures/qunjComponents/useFetchQunjData.js +66 -0
- package/dist/components/electron-signatures/qunjComponents/useQunjColumns.d.ts +36 -0
- package/dist/components/electron-signatures/qunjComponents/useQunjColumns.js +321 -0
- package/dist/components/electron-signatures/translateComponents/TranslateButton.d.ts +10 -0
- package/dist/components/electron-signatures/translateComponents/TranslateButton.js +44 -0
- package/dist/components/electron-signatures/translateComponents/useTranslateCom.d.ts +22 -0
- package/dist/components/electron-signatures/translateComponents/useTranslateCom.js +50 -0
- package/dist/components/electron-signatures/utils.d.ts +26 -0
- package/dist/components/electron-signatures/utils.js +67 -0
- package/dist/components/utils/MyStorage.d.ts +36 -0
- package/dist/components/utils/MyStorage.js +120 -0
- package/dist/components/utils/ZtxkContext.d.ts +67 -0
- package/dist/components/utils/ZtxkContext.js +20 -0
- package/dist/components/utils/checkSealCoUse.d.ts +16 -0
- package/dist/components/utils/checkSealCoUse.js +83 -0
- package/dist/components/utils/fetch.d.ts +10 -0
- package/dist/components/utils/fetch.js +119 -0
- package/dist/components/utils/index.d.ts +9 -0
- package/dist/components/utils/index.js +11 -0
- package/dist/components/utils/processNumber.d.ts +12 -0
- package/dist/components/utils/processNumber.js +106 -0
- package/dist/components/utils/upload.js +6 -3
- package/dist/components/utils/useBaseContext.d.ts +23 -0
- package/dist/components/utils/useBaseContext.js +31 -0
- package/dist/components/utils/useMemoizedFn.d.ts +4 -0
- package/dist/components/utils/useMemoizedFn.js +19 -0
- package/dist/components/utils/usePrevious.d.ts +3 -0
- package/dist/components/utils/usePrevious.js +13 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/index.css +2205 -58
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +255 -86
- package/dist/locales/en-US.json +828 -0
- package/dist/locales/zh-CN.json +828 -0
- package/dist/request.js +7 -6
- package/package.json +13 -4
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (_) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
38
|
+
import { useCallback, useContext, useEffect, useState, useMemo, useRef, } from 'react';
|
|
39
|
+
import { message } from '../../../index';
|
|
40
|
+
import { ElectronSignaturesContext } from '..';
|
|
41
|
+
/**
|
|
42
|
+
* 获取电子印章远程数据
|
|
43
|
+
*/
|
|
44
|
+
export default function useFetchElectronData(options) {
|
|
45
|
+
var _this = this;
|
|
46
|
+
var request = options.request, needQys = options.needQys, deptId = options.deptId, secondDepId = options.secondDepId, flowId = options.flowId, organizationType = options.organizationType, records = options.records;
|
|
47
|
+
var isFilterLegalSeal = useContext(ElectronSignaturesContext).isFilterLegalSeal;
|
|
48
|
+
// records里面是否有勾选了电子印章的数据
|
|
49
|
+
var hasElectronMemo = useMemo(function () {
|
|
50
|
+
var _a;
|
|
51
|
+
return (_a = records === null || records === void 0 ? void 0 : records.some) === null || _a === void 0 ? void 0 : _a.call(records, function (record) { return !!record.isElectronicSeal; });
|
|
52
|
+
}, [records]);
|
|
53
|
+
var isFirstRenderRef = useRef(false);
|
|
54
|
+
// 印章列表数据
|
|
55
|
+
var _a = useState(), electronList = _a[0], setElectronList = _a[1];
|
|
56
|
+
// 个人签署(手签章)配置列表
|
|
57
|
+
var _b = useState([]), personalSignList = _b[0], setPersonalSignList = _b[1];
|
|
58
|
+
// 一级责任人数据
|
|
59
|
+
var _c = useState(), firstLevelPersonName = _c[0], setFirstLevelPersonName = _c[1];
|
|
60
|
+
// 获取流程下需要过滤掉的印章列表 开关关闭或失败时降级不过滤
|
|
61
|
+
var getFilterSealList = useCallback(function (flowId) {
|
|
62
|
+
if (!flowId || !request || !isFilterLegalSeal) {
|
|
63
|
+
return Promise.resolve([]);
|
|
64
|
+
}
|
|
65
|
+
return request({
|
|
66
|
+
url: '/api/zmdms-scm-system/legalsealflow/getSeal',
|
|
67
|
+
params: { flowId: flowId },
|
|
68
|
+
method: 'GET',
|
|
69
|
+
})
|
|
70
|
+
.then(function (res) {
|
|
71
|
+
if (res.status === 200 && res.data.code === 200) {
|
|
72
|
+
return res.data.data || [];
|
|
73
|
+
}
|
|
74
|
+
return [];
|
|
75
|
+
})
|
|
76
|
+
.catch(function () {
|
|
77
|
+
return [];
|
|
78
|
+
});
|
|
79
|
+
}, [request, isFilterLegalSeal]);
|
|
80
|
+
// 获取电子印章信息 接口层必须传入部门id 和 流程id 才能获取到印章信息
|
|
81
|
+
var getElectronList = useCallback(function (params) {
|
|
82
|
+
var newParam = {
|
|
83
|
+
size: 200,
|
|
84
|
+
};
|
|
85
|
+
if (params.deptId) {
|
|
86
|
+
newParam.deptId = params.deptId;
|
|
87
|
+
}
|
|
88
|
+
if (params.flowId) {
|
|
89
|
+
newParam.flowId = params.flowId;
|
|
90
|
+
}
|
|
91
|
+
if (params.secondDepId) {
|
|
92
|
+
newParam.secondDepId = params.secondDepId;
|
|
93
|
+
}
|
|
94
|
+
// 个人签署(手签章)配置的组织机构类型 不传则后端按默认处理
|
|
95
|
+
if (params.organizationType) {
|
|
96
|
+
newParam.organizationType = params.organizationType;
|
|
97
|
+
}
|
|
98
|
+
return request === null || request === void 0 ? void 0 : request({
|
|
99
|
+
url: '/api/zmdms-resource/flowdeptseal/select-seal-info-list',
|
|
100
|
+
params: newParam,
|
|
101
|
+
method: 'GET',
|
|
102
|
+
}).then(function (res) { return __awaiter(_this, void 0, void 0, function () {
|
|
103
|
+
var firstRecord, sealInfoList, personalSignList_1, filterSealList, newSealInfoList, filterSealIds_1;
|
|
104
|
+
var _a, _b;
|
|
105
|
+
return __generator(this, function (_c) {
|
|
106
|
+
switch (_c.label) {
|
|
107
|
+
case 0:
|
|
108
|
+
if (!(res.status === 200 && res.data.code === 200)) return [3 /*break*/, 2];
|
|
109
|
+
firstRecord = ((_b = (_a = res.data.data) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) || {};
|
|
110
|
+
sealInfoList = firstRecord.sealInfoList || [];
|
|
111
|
+
personalSignList_1 = firstRecord.personalSignList || [];
|
|
112
|
+
return [4 /*yield*/, getFilterSealList(params.flowId)];
|
|
113
|
+
case 1:
|
|
114
|
+
filterSealList = _c.sent();
|
|
115
|
+
newSealInfoList = sealInfoList;
|
|
116
|
+
if (filterSealList.length > 0) {
|
|
117
|
+
filterSealIds_1 = new Set(filterSealList.map(function (item) { return item.sealId + ''; }));
|
|
118
|
+
newSealInfoList = sealInfoList.filter(function (seal) { return !filterSealIds_1.has(seal.sealId + ''); });
|
|
119
|
+
}
|
|
120
|
+
return [2 /*return*/, {
|
|
121
|
+
sealInfoList: newSealInfoList,
|
|
122
|
+
personalSignList: personalSignList_1,
|
|
123
|
+
}];
|
|
124
|
+
case 2:
|
|
125
|
+
message.error(res.data.msg || i18next.t('出错了'));
|
|
126
|
+
return [2 /*return*/, Promise.reject(res)];
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}); }).catch(function (error) {
|
|
130
|
+
var _a, _b;
|
|
131
|
+
message.error(((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || i18next.t('请求失败!'));
|
|
132
|
+
return Promise.reject(error);
|
|
133
|
+
});
|
|
134
|
+
}, [request, getFilterSealList]);
|
|
135
|
+
// 获取一级责任人名字 通过部门
|
|
136
|
+
var getFirstLevelPerson = useCallback(function (deptId) {
|
|
137
|
+
return request({
|
|
138
|
+
url: "/api/zmdms-resource/seal/get-yjzrr-name/" + deptId,
|
|
139
|
+
method: 'GET',
|
|
140
|
+
})
|
|
141
|
+
.then(function (res) {
|
|
142
|
+
var _a;
|
|
143
|
+
if (res.status === 200 && res.data.code === 200) {
|
|
144
|
+
return (_a = res.data.data) === null || _a === void 0 ? void 0 : _a.userName;
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
// 20240920:不需要报错提示
|
|
148
|
+
// if (canEdit) {
|
|
149
|
+
// message.error(res.data.msg || '出错了');
|
|
150
|
+
// }
|
|
151
|
+
return Promise.reject(res);
|
|
152
|
+
}
|
|
153
|
+
})
|
|
154
|
+
.catch(function (error) {
|
|
155
|
+
// 20240920:不需要报错提示
|
|
156
|
+
// if (canEdit) {
|
|
157
|
+
// message.error(error?.response?.data?.msg || '请求失败!');
|
|
158
|
+
// }
|
|
159
|
+
return Promise.reject(error);
|
|
160
|
+
});
|
|
161
|
+
}, [request]);
|
|
162
|
+
// 获取一级责任人名字 通过二级单元
|
|
163
|
+
var getFirstLevelPersonBysecondDepId = useCallback(function (secondDepId) {
|
|
164
|
+
return request({
|
|
165
|
+
url: "/api/zmdms-resource/seal/get-yjzrr-name-by-sec-unit/" + secondDepId,
|
|
166
|
+
method: 'GET',
|
|
167
|
+
})
|
|
168
|
+
.then(function (res) {
|
|
169
|
+
var _a;
|
|
170
|
+
if (res.status === 200 && res.data.code === 200) {
|
|
171
|
+
return (_a = res.data.data) === null || _a === void 0 ? void 0 : _a.userName;
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
// 20240920:不需要报错提示
|
|
175
|
+
// if (canEdit) {
|
|
176
|
+
// message.error(res.data.msg || '出错了');
|
|
177
|
+
// }
|
|
178
|
+
return Promise.reject(res);
|
|
179
|
+
}
|
|
180
|
+
})
|
|
181
|
+
.catch(function (error) {
|
|
182
|
+
// 20240920:不需要报错提示
|
|
183
|
+
// if (canEdit) {
|
|
184
|
+
// message.error(error?.response?.data?.msg || '请求失败!');
|
|
185
|
+
// }
|
|
186
|
+
return Promise.reject(error);
|
|
187
|
+
});
|
|
188
|
+
}, [request]);
|
|
189
|
+
// 获取契约锁列表数据
|
|
190
|
+
useEffect(function () {
|
|
191
|
+
// 如果不需要契约锁数据
|
|
192
|
+
if (needQys + '' !== '1') {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
getElectronList({
|
|
196
|
+
deptId: deptId,
|
|
197
|
+
secondDepId: secondDepId,
|
|
198
|
+
flowId: flowId,
|
|
199
|
+
organizationType: organizationType,
|
|
200
|
+
}).then(function (res) {
|
|
201
|
+
setElectronList(res.sealInfoList);
|
|
202
|
+
setPersonalSignList(res.personalSignList);
|
|
203
|
+
});
|
|
204
|
+
}, [needQys, deptId, secondDepId, flowId, organizationType, getElectronList]);
|
|
205
|
+
// 20240920:部门变更了 需要重新获取一级责任人
|
|
206
|
+
// 20250522: 有些流程没有部门id,但是会传入二级单元,根据二级单元获取一级责任人
|
|
207
|
+
useEffect(function () {
|
|
208
|
+
setFirstLevelPersonName('');
|
|
209
|
+
isFirstRenderRef.current = false;
|
|
210
|
+
}, [deptId, secondDepId]);
|
|
211
|
+
useEffect(function () {
|
|
212
|
+
// 如果不需要契约锁数据
|
|
213
|
+
if (needQys + '' !== '1') {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
if (!isFirstRenderRef.current && hasElectronMemo) {
|
|
217
|
+
isFirstRenderRef.current = true;
|
|
218
|
+
if (deptId) {
|
|
219
|
+
getFirstLevelPerson(deptId)
|
|
220
|
+
.then(function (res) {
|
|
221
|
+
setFirstLevelPersonName(res);
|
|
222
|
+
})
|
|
223
|
+
.catch(function (err) {
|
|
224
|
+
setFirstLevelPersonName('');
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
else if (secondDepId) {
|
|
228
|
+
getFirstLevelPersonBysecondDepId(secondDepId)
|
|
229
|
+
.then(function (res) {
|
|
230
|
+
setFirstLevelPersonName(res);
|
|
231
|
+
})
|
|
232
|
+
.catch(function (err) {
|
|
233
|
+
setFirstLevelPersonName('');
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}, [
|
|
238
|
+
getFirstLevelPerson,
|
|
239
|
+
getFirstLevelPersonBysecondDepId,
|
|
240
|
+
needQys,
|
|
241
|
+
deptId,
|
|
242
|
+
secondDepId,
|
|
243
|
+
hasElectronMemo,
|
|
244
|
+
isFirstRenderRef,
|
|
245
|
+
]);
|
|
246
|
+
return {
|
|
247
|
+
/** 当前印章列表数据 */
|
|
248
|
+
electronList: electronList,
|
|
249
|
+
/** 个人签署(手签章)配置列表 后端已展开最终签署用户 signUsers */
|
|
250
|
+
personalSignList: personalSignList,
|
|
251
|
+
/** 当前经济责任人(一级责任人)数据 */
|
|
252
|
+
firstLevelPersonName: firstLevelPersonName,
|
|
253
|
+
};
|
|
254
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
2
|
+
/**
|
|
3
|
+
* 验证契约锁是否全部盖章
|
|
4
|
+
*/
|
|
5
|
+
import useMemoizedFn from '../../utils/useMemoizedFn';
|
|
6
|
+
export default function useCheckedSealInfoList(request) {
|
|
7
|
+
var getDeptInfo = useMemoizedFn(function (params) {
|
|
8
|
+
return new Promise(function (resolve, reject) {
|
|
9
|
+
request({
|
|
10
|
+
url: '/api/zmdms-system/dept/detail',
|
|
11
|
+
params: params,
|
|
12
|
+
method: 'GET',
|
|
13
|
+
})
|
|
14
|
+
.then(function (res) {
|
|
15
|
+
var _a;
|
|
16
|
+
if ((res === null || res === void 0 ? void 0 : res.status) === 200 && ((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.code) === 200) {
|
|
17
|
+
var result = res.data.data;
|
|
18
|
+
resolve(result || {});
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
// message.error(res.data.msg || '获取部门信息失败!');
|
|
22
|
+
reject(res.data.msg || i18next.t('获取部门信息失败!'));
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
.catch(function (error) {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
// message.error(error?.response?.data?.msg || '获取部门信息失败!');
|
|
28
|
+
reject(((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || i18next.t('获取部门信息失败!'));
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
getDeptInfo: getDeptInfo,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
2
|
+
/**
|
|
3
|
+
* 附件相关操作 下载 预览 删除
|
|
4
|
+
*/
|
|
5
|
+
import React, { memo } from 'react';
|
|
6
|
+
import { Button, Popconfirm, Checkbox } from '../../../index';
|
|
7
|
+
import { downloadFileCallBack, previewFile, batchPreviewFile, } from 'ztxkutils/dist/fileOperation';
|
|
8
|
+
import { getToken } from 'ztxkutils/dist/authority';
|
|
9
|
+
import { dangerouslySetXss } from 'ztxkutils/dist/tools';
|
|
10
|
+
import { downloadFile } from './fileUtils';
|
|
11
|
+
import { isImage } from '../../utils/upload';
|
|
12
|
+
import FileUpload from './file-upload';
|
|
13
|
+
import TranslationButton from '../translateComponents/TranslateButton';
|
|
14
|
+
var FileOperation = function (props) {
|
|
15
|
+
var isDownload = props.isDownload, isPreview = props.isPreview, isEdit = props.isEdit, isWater = props.isWater, records = props.records, isDelete = props.isDelete, fileName = props.fileName, _a = props.fileId, fileId = _a === void 0 ? '' : _a, _b = props.preFileId, preFileId = _b === void 0 ? '' : _b, _c = props.preFileName, preFileName = _c === void 0 ? '' : _c, _d = props.apiBaseUrl, apiBaseUrl = _d === void 0 ? '' : _d, _e = props.fileBaseUrl, fileBaseUrl = _e === void 0 ? '' : _e, onDelete = props.onDelete, onWatermarkChange = props.onWatermarkChange, organizationId = props.organizationId, isReplaceFile = props.isReplaceFile, fileList = props.fileList, onFileReplace = props.onFileReplace, _f = props.showAddWater, showAddWater = _f === void 0 ? true : _f, request = props.request, previewUrl = props.previewUrl, isTranslation = props.isTranslation, record = props.record, realIndex = props.realIndex, setRecords = props.setRecords, isNeedDg = props.isNeedDg;
|
|
16
|
+
var previewBtn = function (attachId, previewTitle, fileName) {
|
|
17
|
+
return (React.createElement(Button, { type: "link", onClick: function () {
|
|
18
|
+
// 实现批量预览,只针对图片
|
|
19
|
+
var result = isImage(fileName);
|
|
20
|
+
if (result) {
|
|
21
|
+
var allImage = (Array.isArray(records) ? records : [])
|
|
22
|
+
.filter(function (item) { return isImage(item.attachName) && item.attachId !== attachId; })
|
|
23
|
+
.map(function (item) { return item.attachId; });
|
|
24
|
+
batchPreviewFile(fileBaseUrl, attachId + "," + allImage, {
|
|
25
|
+
titleName: fileName,
|
|
26
|
+
});
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
previewFile(fileBaseUrl, attachId, {
|
|
30
|
+
titleName: dangerouslySetXss(fileName),
|
|
31
|
+
});
|
|
32
|
+
} }, previewTitle));
|
|
33
|
+
};
|
|
34
|
+
function onFileChange(info) {
|
|
35
|
+
onFileReplace && onFileReplace(info, fileId);
|
|
36
|
+
}
|
|
37
|
+
return (React.createElement("div", { className: "file-operation--wrap" },
|
|
38
|
+
React.createElement("p", { className: "file-operation--title" }, fileName),
|
|
39
|
+
showAddWater && isEdit && fileId && (React.createElement("div", { className: "file-operation--isWater" },
|
|
40
|
+
React.createElement(Checkbox, { checked: isWater, onChange: function (e) {
|
|
41
|
+
onWatermarkChange && onWatermarkChange(e.target.checked);
|
|
42
|
+
} }, i18next.t('添加水印')))),
|
|
43
|
+
React.createElement("div", { className: "file-operation--list" },
|
|
44
|
+
isReplaceFile && (React.createElement(FileUpload, { fileList: fileList, apiBaseUrl: apiBaseUrl, onFileChange: onFileChange, type: "link" }, i18next.t('替换'))),
|
|
45
|
+
isDownload && fileId ? (React.createElement(Button, { type: "link", onClick: function () {
|
|
46
|
+
downloadFileCallBack(apiBaseUrl, fileId, dangerouslySetXss(fileName) || i18next.t('附件'), {
|
|
47
|
+
addWaterMark: false,
|
|
48
|
+
});
|
|
49
|
+
} }, i18next.t('下载'))) : null,
|
|
50
|
+
isPreview && fileId && previewBtn(fileId, i18next.t('预览'), fileName),
|
|
51
|
+
isPreview &&
|
|
52
|
+
preFileId &&
|
|
53
|
+
previewBtn(preFileId, i18next.t('上一版'), preFileName),
|
|
54
|
+
(!isEdit && isDownload && fileId && isWater) ||
|
|
55
|
+
(!isEdit && !showAddWater) ? (React.createElement(Button, { type: "link", onClick: function () {
|
|
56
|
+
var token = getToken();
|
|
57
|
+
downloadFile(fileId, dangerouslySetXss(fileName) || i18next.t('附件'), {
|
|
58
|
+
API_BASEURL: apiBaseUrl,
|
|
59
|
+
authToken: token ? token : '',
|
|
60
|
+
organizationId: organizationId,
|
|
61
|
+
});
|
|
62
|
+
} }, i18next.t('下载水印版'))) : null,
|
|
63
|
+
isDelete && (fileId || fileName) && (React.createElement(Popconfirm, { title: i18next.t('是否删除该条数据?'), cancelText: i18next.t('否'), okText: i18next.t('是'), onConfirm: onDelete },
|
|
64
|
+
React.createElement(Button, { type: "link" }, i18next.t('删除')))),
|
|
65
|
+
isNeedDg && (React.createElement(TranslationButton, { request: request, previewUrl: previewUrl, isTranslation: isTranslation, record: record, realIndex: realIndex, setRecords: setRecords })))));
|
|
66
|
+
};
|
|
67
|
+
export default memo(FileOperation);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 附件类型下拉框
|
|
3
|
+
*/
|
|
4
|
+
import React, { memo } from 'react';
|
|
5
|
+
import { EnhanceSelect } from '../../../index';
|
|
6
|
+
var FileTypeSelect = function (props) {
|
|
7
|
+
var list = props.list, value = props.value, onChange = props.onChange;
|
|
8
|
+
return (React.createElement(EnhanceSelect, { list: list, dataKey: "dictKey", titleKey: "dictValue", value: value, onChange: onChange, dropdownMatchSelectWidth: 160 }));
|
|
9
|
+
};
|
|
10
|
+
export default memo(FileTypeSelect);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 附件上传按钮
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { IFileUploadProps } from '../interface';
|
|
6
|
+
declare const _default: React.NamedExoticComponent<IFileUploadProps>;
|
|
7
|
+
export default _default;
|
|
8
|
+
/**
|
|
9
|
+
* 附件上传前的控制
|
|
10
|
+
*/
|
|
11
|
+
export declare function useBeforeUpload(props: Partial<IFileUploadProps>): (file: any, fileList: any[]) => any;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
13
|
+
/**
|
|
14
|
+
* 附件上传按钮
|
|
15
|
+
*/
|
|
16
|
+
import React, { memo, useCallback, useMemo, useState } from 'react';
|
|
17
|
+
import { Upload } from 'antd';
|
|
18
|
+
import { Button, message } from '../../../index';
|
|
19
|
+
import useBaseContext from '../../utils/useBaseContext';
|
|
20
|
+
import useLastest from '../../utils/useLastest';
|
|
21
|
+
import { getToken } from 'ztxkutils/dist/authority';
|
|
22
|
+
import { formatUnit, getFileExtension } from '../utils';
|
|
23
|
+
var FileUpload = function (props) {
|
|
24
|
+
var apiBaseUrl = props.apiBaseUrl, headers = props.headers, data = props.data, isPublic = props.isPublic, acceptList = props.acceptList, maxSize = props.maxSize, beforeUpload = props.beforeUpload, disAllowDuplicateFile = props.disAllowDuplicateFile, fileList = props.fileList, onFileChange = props.onFileChange, children = props.children, _a = props.multiple, multiple = _a === void 0 ? true : _a, _b = props.type, type = _b === void 0 ? 'primary' : _b;
|
|
25
|
+
var _c = useState(false), loading = _c[0], setLoading = _c[1];
|
|
26
|
+
// 取接口地址
|
|
27
|
+
var defaultApiBaseUrl = useBaseContext().apiBaseUrl;
|
|
28
|
+
var _d = useBasicInfo({
|
|
29
|
+
apiBaseUrl: apiBaseUrl || defaultApiBaseUrl,
|
|
30
|
+
headers: headers,
|
|
31
|
+
data: data,
|
|
32
|
+
isPublic: isPublic,
|
|
33
|
+
}), fileAction = _d.fileAction, fileHeaders = _d.fileHeaders, fileData = _d.fileData;
|
|
34
|
+
// 文件上传前的判断处理
|
|
35
|
+
var beforeUploadHandle = useBeforeUpload({
|
|
36
|
+
acceptList: acceptList,
|
|
37
|
+
maxSize: maxSize,
|
|
38
|
+
beforeUpload: beforeUpload,
|
|
39
|
+
disAllowDuplicateFile: disAllowDuplicateFile,
|
|
40
|
+
fileList: fileList,
|
|
41
|
+
});
|
|
42
|
+
var onChange = useCallback(function (info) {
|
|
43
|
+
setLoading(true);
|
|
44
|
+
var file = info.file;
|
|
45
|
+
if (file.status === 'done' || file.status === 'error') {
|
|
46
|
+
setLoading(false);
|
|
47
|
+
}
|
|
48
|
+
if (file.status === 'error') {
|
|
49
|
+
message.info(i18next.t('该 {{slot0}} 附件上传失败,请重新上传!', {
|
|
50
|
+
slot0: file.name,
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
onFileChange && onFileChange(info);
|
|
54
|
+
}, [onFileChange]);
|
|
55
|
+
return (React.createElement(Upload, { action: fileAction, headers: fileHeaders, data: fileData, showUploadList: false, beforeUpload: beforeUploadHandle, onChange: onChange, disabled: loading, multiple: multiple, className: "electron-file-upload" },
|
|
56
|
+
React.createElement(Button, { type: type, loading: loading }, children)));
|
|
57
|
+
};
|
|
58
|
+
export default memo(FileUpload);
|
|
59
|
+
function useBasicInfo(props) {
|
|
60
|
+
var action = props.action, _a = props.apiBaseUrl, apiBaseUrl = _a === void 0 ? '' : _a, headers = props.headers, data = props.data, isPublic = props.isPublic;
|
|
61
|
+
// 文件上传路径
|
|
62
|
+
var fileAction = action ? action : createUploadFileLink({ apiBaseUrl: apiBaseUrl });
|
|
63
|
+
// 文件上传头部参数
|
|
64
|
+
var fileHeaders = useMemo(function () {
|
|
65
|
+
return __assign({ 'Zmdms-Auth': getToken() || '' }, headers);
|
|
66
|
+
}, [headers]);
|
|
67
|
+
// 其余参数
|
|
68
|
+
var fileData = useMemo(function () {
|
|
69
|
+
var newData = __assign({}, data);
|
|
70
|
+
// 如果是公用的 上传的时候 需要传递这个参数
|
|
71
|
+
if (isPublic) {
|
|
72
|
+
newData.isAuth = '2';
|
|
73
|
+
}
|
|
74
|
+
return newData;
|
|
75
|
+
}, [data, isPublic]);
|
|
76
|
+
return {
|
|
77
|
+
fileAction: fileAction,
|
|
78
|
+
fileHeaders: fileHeaders,
|
|
79
|
+
fileData: fileData,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function createUploadFileLink(options) {
|
|
83
|
+
var apiBaseUrl = options.apiBaseUrl;
|
|
84
|
+
return apiBaseUrl + "/api/zmdms-resource/oss/endpoint/put-file-attach";
|
|
85
|
+
}
|
|
86
|
+
// 默认限制的文件类型
|
|
87
|
+
var NO_ACCEPT = ['exe'];
|
|
88
|
+
/**
|
|
89
|
+
* 附件上传前的控制
|
|
90
|
+
*/
|
|
91
|
+
export function useBeforeUpload(props) {
|
|
92
|
+
var acceptList = props.acceptList, _a = props.maxSize, maxSize = _a === void 0 ? 104857600 : _a, beforeUpload = props.beforeUpload, disAllowDuplicateFile = props.disAllowDuplicateFile, fileList = props.fileList;
|
|
93
|
+
var maxSizeStr = formatUnit(maxSize);
|
|
94
|
+
var fileListRef = useLastest(fileList);
|
|
95
|
+
return useCallback(function (file, fileList) {
|
|
96
|
+
var _a, _b;
|
|
97
|
+
var fileName = file.name, fileSize = file.size;
|
|
98
|
+
// 获取文件后缀
|
|
99
|
+
var _c = getFileExtension(fileName), fileExtension = _c[1];
|
|
100
|
+
if (beforeUpload) {
|
|
101
|
+
var result = beforeUpload(file, fileList);
|
|
102
|
+
if (result) {
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (disAllowDuplicateFile &&
|
|
107
|
+
((_b = (_a = fileListRef.current) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, function (item) { return item.name === fileName || item.attachName === fileName; }))) {
|
|
108
|
+
message.warning(i18next.t('不能上传同名附件!'));
|
|
109
|
+
return Upload.LIST_IGNORE;
|
|
110
|
+
}
|
|
111
|
+
// 文件大小
|
|
112
|
+
if (fileSize === 0) {
|
|
113
|
+
message.warning(i18next.t('不能上传空文件!'));
|
|
114
|
+
return Upload.LIST_IGNORE;
|
|
115
|
+
}
|
|
116
|
+
// 获取支持的附件类型
|
|
117
|
+
var ACCEPT = acceptList ? acceptList : [];
|
|
118
|
+
ACCEPT = ACCEPT.map(function (a) { return a.toLowerCase(); });
|
|
119
|
+
// 默认支持任何格式的文件,但是不支持exe
|
|
120
|
+
if (ACCEPT.length > 0 && !ACCEPT.includes(fileExtension)) {
|
|
121
|
+
message.warning(i18next.t('不支持 {{fileExtension}} 文件格式', {
|
|
122
|
+
fileExtension: fileExtension,
|
|
123
|
+
}));
|
|
124
|
+
return Upload.LIST_IGNORE;
|
|
125
|
+
}
|
|
126
|
+
if (ACCEPT.length === 0 && NO_ACCEPT.includes(fileExtension)) {
|
|
127
|
+
message.warning(i18next.t('不支持 {{fileExtension}} 文件格式', {
|
|
128
|
+
fileExtension: fileExtension,
|
|
129
|
+
}));
|
|
130
|
+
return Upload.LIST_IGNORE;
|
|
131
|
+
}
|
|
132
|
+
// 文件大小限制
|
|
133
|
+
if (maxSize && fileSize > maxSize) {
|
|
134
|
+
message.warning(i18next.t('文件超出 {{maxSizeStr}}!', { maxSizeStr: maxSizeStr }));
|
|
135
|
+
return Upload.LIST_IGNORE;
|
|
136
|
+
}
|
|
137
|
+
return Promise.resolve(file);
|
|
138
|
+
}, [
|
|
139
|
+
acceptList,
|
|
140
|
+
maxSize,
|
|
141
|
+
maxSizeStr,
|
|
142
|
+
beforeUpload,
|
|
143
|
+
fileListRef,
|
|
144
|
+
disAllowDuplicateFile,
|
|
145
|
+
]);
|
|
146
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface IOptions {
|
|
2
|
+
API_BASEURL: string;
|
|
3
|
+
authToken?: string;
|
|
4
|
+
organizationId?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 附件下载方法
|
|
8
|
+
* @param fileId 附件id
|
|
9
|
+
* @param fileName 附件名称
|
|
10
|
+
* @param options
|
|
11
|
+
* @param options.API_BASEURL {string} 接口请求的前缀地址 必传
|
|
12
|
+
* @param options.authToken {string} token 非必传
|
|
13
|
+
* @param options.waterMark {boolean | string} 是否添加水印 是否指定水印名称 非必传
|
|
14
|
+
* @param options.open boolean 是否不需要登录信息
|
|
15
|
+
*/
|
|
16
|
+
export declare function downloadFile(fileId: string, fileName: string, options: IOptions): Promise<unknown>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 附件下载方法
|
|
3
|
+
* @param fileId 附件id
|
|
4
|
+
* @param fileName 附件名称
|
|
5
|
+
* @param options
|
|
6
|
+
* @param options.API_BASEURL {string} 接口请求的前缀地址 必传
|
|
7
|
+
* @param options.authToken {string} token 非必传
|
|
8
|
+
* @param options.waterMark {boolean | string} 是否添加水印 是否指定水印名称 非必传
|
|
9
|
+
* @param options.open boolean 是否不需要登录信息
|
|
10
|
+
*/
|
|
11
|
+
export function downloadFile(fileId, fileName, options) {
|
|
12
|
+
var API_BASEURL = options.API_BASEURL, authToken = options.authToken, organizationId = options.organizationId;
|
|
13
|
+
return new Promise(function (resolve, reject) {
|
|
14
|
+
var xhr = new XMLHttpRequest();
|
|
15
|
+
// 获取请求基础数据
|
|
16
|
+
xhr.open('GET', API_BASEURL + "/api/zmdms-resource/seal/download-watermark-attach/" + fileId + "?watermarkOrganizationType=12&watermarkOrganizationId=" + organizationId + "&Zmdms-Auth=bearer " + authToken, true);
|
|
17
|
+
xhr.responseType = 'blob';
|
|
18
|
+
xhr.onload = function () {
|
|
19
|
+
if (xhr.status === 200 || xhr.status === 201) {
|
|
20
|
+
var link = document.createElement('a');
|
|
21
|
+
link.href = window.URL.createObjectURL(xhr.response);
|
|
22
|
+
link.download = (fileName === null || fileName === void 0 ? void 0 : fileName.split('.')[0]) + ".pdf";
|
|
23
|
+
// fix Firefox
|
|
24
|
+
link.style.display = 'none';
|
|
25
|
+
document.body.appendChild(link);
|
|
26
|
+
link.click();
|
|
27
|
+
document.body.removeChild(link);
|
|
28
|
+
window.URL.revokeObjectURL(link.href);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
xhr.onerror = function (err) {
|
|
32
|
+
reject(err);
|
|
33
|
+
};
|
|
34
|
+
xhr.send();
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 附件相关操作 下载 预览 删除
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { IFileOperationProps } from '../interface';
|
|
6
|
+
declare const _default: React.NamedExoticComponent<IFileOperationProps & {
|
|
7
|
+
currentDate?: any;
|
|
8
|
+
isWorlflowCompleted?: any;
|
|
9
|
+
}>;
|
|
10
|
+
export default _default;
|