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,55 @@
|
|
|
1
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
2
|
+
import { message } from '../../../index';
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
export default function useDg(request) {
|
|
5
|
+
// 开始比对
|
|
6
|
+
var compareHandle = useCallback(function (templateId, fileId) {
|
|
7
|
+
return request === null || request === void 0 ? void 0 : request({
|
|
8
|
+
url: "/api/zmdms-resource/seal/create-compare-task/" + templateId + "/" + fileId,
|
|
9
|
+
method: 'GET',
|
|
10
|
+
}).then(function (res) {
|
|
11
|
+
if (res.status === 200 && res.data.code === 200) {
|
|
12
|
+
message.success(i18next.t('操作成功'));
|
|
13
|
+
return res;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
message.error(res.data.msg || i18next.t('出错了'));
|
|
17
|
+
return Promise.reject(res.data.msg || i18next.t('出错了'));
|
|
18
|
+
}
|
|
19
|
+
}).catch(function (error) {
|
|
20
|
+
var _a, _b, _c, _d;
|
|
21
|
+
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('请求失败!'));
|
|
22
|
+
return Promise.reject(((_d = (_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.msg) || i18next.t('请求失败!'));
|
|
23
|
+
});
|
|
24
|
+
}, [request]);
|
|
25
|
+
// 查看比对结果
|
|
26
|
+
var lookCompareHandle = useCallback(function (taskId) {
|
|
27
|
+
return request === null || request === void 0 ? void 0 : request({
|
|
28
|
+
url: "/api/zmdms-resource/seal/query-compare-task/" + taskId,
|
|
29
|
+
method: 'GET',
|
|
30
|
+
}).then(function (res) {
|
|
31
|
+
var _a;
|
|
32
|
+
if (res.status === 200 && res.data.code === 200) {
|
|
33
|
+
if ((_a = res.data.data[0]) === null || _a === void 0 ? void 0 : _a.url) {
|
|
34
|
+
// 比对文件预览
|
|
35
|
+
window.open(res.data.data[0].url);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
message.info(i18next.t('文件比对中,请稍后再试!'));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
message.error(res.data.msg || i18next.t('出错了'));
|
|
43
|
+
}
|
|
44
|
+
}).catch(function (error) {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
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('请求失败!'));
|
|
47
|
+
});
|
|
48
|
+
}, [request]);
|
|
49
|
+
return {
|
|
50
|
+
/** 开始比对 */
|
|
51
|
+
compareHandle: compareHandle,
|
|
52
|
+
/** 查看比对结果 */
|
|
53
|
+
lookCompareHandle: lookCompareHandle,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -20,6 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
23
24
|
/**
|
|
24
25
|
* @author 陈亚雄
|
|
25
26
|
* @description 单文件上传
|
|
@@ -37,7 +38,7 @@ import { checkFile } from '../utils/upload';
|
|
|
37
38
|
var delayTime = 1000;
|
|
38
39
|
var UploadSingle = function (_a) {
|
|
39
40
|
var _b, _c, _d, _e;
|
|
40
|
-
var _f = _a.text, text = _f === void 0 ? '导入' : _f, children = _a.children, ztAccept = _a.ztAccept, maxSize = _a.maxSize, maxSizeStr = _a.maxSizeStr, resultCallback = _a.resultCallback, apiBaseUrl = _a.apiBaseUrl, beforeUpload = _a.beforeUpload, restProps = __rest(_a, ["text", "children", "ztAccept", "maxSize", "maxSizeStr", "resultCallback", "apiBaseUrl", "beforeUpload"]);
|
|
41
|
+
var _f = _a.text, text = _f === void 0 ? i18next.t('导入') : _f, children = _a.children, ztAccept = _a.ztAccept, maxSize = _a.maxSize, maxSizeStr = _a.maxSizeStr, resultCallback = _a.resultCallback, apiBaseUrl = _a.apiBaseUrl, beforeUpload = _a.beforeUpload, restProps = __rest(_a, ["text", "children", "ztAccept", "maxSize", "maxSizeStr", "resultCallback", "apiBaseUrl", "beforeUpload"]);
|
|
41
42
|
var _g = useState(false), visible = _g[0], setVisible = _g[1];
|
|
42
43
|
var _h = useState(), percent = _h[0], setPercent = _h[1];
|
|
43
44
|
var time = useRef(0);
|
|
@@ -85,13 +86,13 @@ var UploadSingle = function (_a) {
|
|
|
85
86
|
function successCallback(result) {
|
|
86
87
|
time.current = 0;
|
|
87
88
|
setVisible(false);
|
|
88
|
-
message.success('文件导入成功!');
|
|
89
|
+
message.success(i18next.t('文件导入成功!'));
|
|
89
90
|
resultCallback && resultCallback('0', result);
|
|
90
91
|
}
|
|
91
92
|
function errorCallback(result) {
|
|
92
93
|
time.current = 0;
|
|
93
94
|
setVisible(false);
|
|
94
|
-
message.error('文件导入失败!');
|
|
95
|
+
message.error(i18next.t('文件导入失败!'));
|
|
95
96
|
resultCallback && resultCallback('1', result);
|
|
96
97
|
}
|
|
97
98
|
var baseUrl = ((_b = apiBaseUrl === null || apiBaseUrl === void 0 ? void 0 : apiBaseUrl.endsWith) === null || _b === void 0 ? void 0 : _b.call(apiBaseUrl, '/'))
|
|
@@ -105,7 +106,7 @@ var UploadSingle = function (_a) {
|
|
|
105
106
|
var fileAction = "" + baseUrl + _action;
|
|
106
107
|
return (React.createElement(React.Fragment, null,
|
|
107
108
|
React.createElement(AntUpload, __assign({ beforeUpload: beforeFileUpload, onChange: onFileChange, showUploadList: false, maxCount: 1, action: fileAction }, restProps), children ? children : React.createElement(Button, { type: "primary" }, text)),
|
|
108
|
-
React.createElement(Modal, { visible: visible, loading: false, title:
|
|
109
|
+
React.createElement(Modal, { visible: visible, loading: false, title: i18next.t('文件上传中'), footer: null, closable: false },
|
|
109
110
|
React.createElement(Progress, { percent: percent }))));
|
|
110
111
|
};
|
|
111
112
|
export default UploadSingle;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IWaterConfig } from './water';
|
|
3
|
+
export interface IWatermark extends IWaterConfig {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
visible?: boolean;
|
|
7
|
+
isMutationObserver?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* 是否添加将背景添加到body标签中
|
|
10
|
+
* 如果采取之前的模式 打印的时候需要勾选显示背景才能显示内容
|
|
11
|
+
*/
|
|
12
|
+
isAppendBody?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 是否采用 shadow-root的模式创建水印
|
|
15
|
+
*/
|
|
16
|
+
isShadow?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface WatermarkComponent extends React.FC<IWatermark> {
|
|
19
|
+
displayName: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createWatermark(watermarkText: string | string[], options: any, container: any): DocumentFragment;
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
export function createWatermark(watermarkText, options, container) {
|
|
14
|
+
var width = options.width, height = options.height, rotate = options.rotate;
|
|
15
|
+
var watermarkWidth = width * 2;
|
|
16
|
+
var watermarkHeight = height * 2;
|
|
17
|
+
// 计算旋转后水印的占用空间
|
|
18
|
+
var radians = (Math.abs(rotate) * Math.PI) / 180;
|
|
19
|
+
var sin = Math.sin(radians);
|
|
20
|
+
var cos = Math.cos(radians);
|
|
21
|
+
var rotatedWidth = cos * watermarkWidth + sin * watermarkHeight;
|
|
22
|
+
var rotatedHeight = sin * watermarkWidth + cos * watermarkHeight;
|
|
23
|
+
// 计算容器可以容纳多少行和列的水印
|
|
24
|
+
var containerWidth = Math.max(container.offsetWidth || 1200, document.body.clientWidth);
|
|
25
|
+
var containerHeight = Math.max(container.offsetHeight || 1200, document.body.clientHeight);
|
|
26
|
+
var cols = Math.ceil(containerWidth / rotatedWidth);
|
|
27
|
+
var rows = Math.ceil(containerHeight / rotatedHeight);
|
|
28
|
+
// 创建一个水印元素
|
|
29
|
+
var fragment = document.createDocumentFragment();
|
|
30
|
+
// 循环创建和定位水印元素
|
|
31
|
+
for (var row = 0; row < rows; row++) {
|
|
32
|
+
for (var col = 0; col < cols; col++) {
|
|
33
|
+
// 克隆水印元素
|
|
34
|
+
var watermark = createWatermarkItem(watermarkText, __assign({}, options));
|
|
35
|
+
// 设置绝对定位
|
|
36
|
+
watermark.style.left = col * rotatedWidth + "px";
|
|
37
|
+
watermark.style.top = row * rotatedHeight + "px";
|
|
38
|
+
// 将克隆的水印添加到容器中
|
|
39
|
+
fragment.appendChild(watermark);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return fragment;
|
|
43
|
+
}
|
|
44
|
+
function createWatermarkItem(watermarkText, options) {
|
|
45
|
+
// 创建一个水印元素
|
|
46
|
+
var watermark = document.createElement('div');
|
|
47
|
+
watermark.className = 'shadow-root--container';
|
|
48
|
+
var textContent = watermarkText;
|
|
49
|
+
if (Array.isArray(watermarkText)) {
|
|
50
|
+
textContent = watermarkText.join('\n');
|
|
51
|
+
}
|
|
52
|
+
watermark.innerHTML = "\n <span style=\"position: absolute; top: 20px; left: 20px\">" + textContent + "</span>\n <span style=\"position: absolute; bottom: 20px; right: 20px\">" + textContent + "</span>\n ";
|
|
53
|
+
var font = options.font, rotate = options.rotate, width = options.width, height = options.height, top = options.top, left = options.left;
|
|
54
|
+
// 设置水印样式
|
|
55
|
+
watermark.style.position = 'absolute';
|
|
56
|
+
watermark.style.top = (top || 50) + "px";
|
|
57
|
+
watermark.style.left = (left || 50) + "px";
|
|
58
|
+
watermark.style.width = (width || 200) * 2 + "px";
|
|
59
|
+
watermark.style.height = (height || 200) * 2 + "px";
|
|
60
|
+
watermark.style.color = (font === null || font === void 0 ? void 0 : font.color) || 'rgba(0, 0, 0, 0.2)';
|
|
61
|
+
watermark.style.fontFamily = (font === null || font === void 0 ? void 0 : font.fontFamily) || i18next.t('微软雅黑');
|
|
62
|
+
watermark.style.fontSize = ((font === null || font === void 0 ? void 0 : font.fontSize) || 14) + "px";
|
|
63
|
+
watermark.style.fontStyle = (font === null || font === void 0 ? void 0 : font.fontStyle) || 'normal';
|
|
64
|
+
watermark.style.fontWeight = (font === null || font === void 0 ? void 0 : font.fontWeight) || 'normal';
|
|
65
|
+
watermark.style.textAlign = (font === null || font === void 0 ? void 0 : font.textAlign) || 'center';
|
|
66
|
+
watermark.style.zIndex = '1000';
|
|
67
|
+
watermark.style.whiteSpace = 'pre';
|
|
68
|
+
watermark.style.transform = "rotate(" + (rotate || -20) + "deg)";
|
|
69
|
+
return watermark;
|
|
70
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 创建水印
|
|
3
|
+
*/
|
|
4
|
+
export declare function createWater(config: IWaterConfig): {
|
|
5
|
+
imgBase64: string;
|
|
6
|
+
canvasWidth: number;
|
|
7
|
+
canvasHeight: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* 默认配置
|
|
11
|
+
*/
|
|
12
|
+
export declare function mergeWaterConfig(waterConfig?: IWaterConfig): {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
rotate: number;
|
|
16
|
+
zIndex: number;
|
|
17
|
+
content: string | string[];
|
|
18
|
+
lineSpacing: number;
|
|
19
|
+
font: {
|
|
20
|
+
color: string | CanvasGradient | CanvasPattern;
|
|
21
|
+
fontSize: number;
|
|
22
|
+
fontWeight: number | "normal" | "light" | "weight";
|
|
23
|
+
fontStyle: "normal" | "none" | "italic" | "oblique";
|
|
24
|
+
fontFamily: string;
|
|
25
|
+
textAlign: CanvasTextAlign;
|
|
26
|
+
};
|
|
27
|
+
image: string;
|
|
28
|
+
};
|
|
29
|
+
export interface IWaterConfig {
|
|
30
|
+
width?: number;
|
|
31
|
+
height?: number;
|
|
32
|
+
rotate?: number;
|
|
33
|
+
zIndex?: number;
|
|
34
|
+
image?: string;
|
|
35
|
+
content?: string | string[];
|
|
36
|
+
lineSpacing?: number;
|
|
37
|
+
font?: {
|
|
38
|
+
color?: CanvasFillStrokeStyles['fillStyle'];
|
|
39
|
+
fontSize?: number;
|
|
40
|
+
fontWeight?: 'normal' | 'light' | 'weight' | number;
|
|
41
|
+
fontStyle?: 'none' | 'normal' | 'italic' | 'oblique';
|
|
42
|
+
fontFamily?: string;
|
|
43
|
+
textAlign?: CanvasTextAlign;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export interface IWaterResult {
|
|
47
|
+
image: string;
|
|
48
|
+
width: number;
|
|
49
|
+
height: number;
|
|
50
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
2
|
+
/**
|
|
3
|
+
* 创建水印
|
|
4
|
+
*/
|
|
5
|
+
export function createWater(config) {
|
|
6
|
+
var _a = mergeWaterConfig(config), width = _a.width, height = _a.height, rotate = _a.rotate, content = _a.content, font = _a.font, lineSpacing = _a.lineSpacing;
|
|
7
|
+
// 创建canvas元素
|
|
8
|
+
var canvas = document.createElement('canvas');
|
|
9
|
+
canvas.width = width * 2;
|
|
10
|
+
canvas.height = height * 2;
|
|
11
|
+
var ctx = canvas.getContext('2d');
|
|
12
|
+
if (ctx) {
|
|
13
|
+
// 设置字体样式
|
|
14
|
+
ctx.font = font.fontStyle + " " + font.fontWeight + " " + font.fontSize + "px " + font.fontFamily;
|
|
15
|
+
ctx.fillStyle = font.color;
|
|
16
|
+
ctx.textAlign = font.textAlign;
|
|
17
|
+
// 绘制水印文本的函数
|
|
18
|
+
var drawText = function (textLines, x, y) {
|
|
19
|
+
ctx.save();
|
|
20
|
+
ctx.translate(x, y);
|
|
21
|
+
ctx.rotate((Math.PI / 180) * rotate);
|
|
22
|
+
if (Array.isArray(textLines)) {
|
|
23
|
+
// 多行文本
|
|
24
|
+
textLines.forEach(function (line, index) {
|
|
25
|
+
ctx.fillText(line, 0, index * (font.fontSize + lineSpacing));
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
// 单行文本
|
|
30
|
+
ctx.fillText(textLines, 0, 0);
|
|
31
|
+
}
|
|
32
|
+
ctx.restore();
|
|
33
|
+
};
|
|
34
|
+
// 绘制两个重叠的水印文本
|
|
35
|
+
drawText(content, width / 2, height / 2); // 中心对齐第一个文本
|
|
36
|
+
drawText(content, (width * 3) / 2, (height * 3) / 2); // 中心对齐第二个文本
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
imgBase64: canvas.toDataURL('image/png'),
|
|
40
|
+
canvasWidth: canvas.width,
|
|
41
|
+
canvasHeight: canvas.height,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* 默认配置
|
|
46
|
+
*/
|
|
47
|
+
export function mergeWaterConfig(waterConfig) {
|
|
48
|
+
var _a, _b, _c, _d, _e, _f;
|
|
49
|
+
return {
|
|
50
|
+
width: (waterConfig === null || waterConfig === void 0 ? void 0 : waterConfig.width) || 200,
|
|
51
|
+
height: (waterConfig === null || waterConfig === void 0 ? void 0 : waterConfig.height) || 200,
|
|
52
|
+
rotate: (waterConfig === null || waterConfig === void 0 ? void 0 : waterConfig.rotate) || -20,
|
|
53
|
+
zIndex: (waterConfig === null || waterConfig === void 0 ? void 0 : waterConfig.zIndex) || 10,
|
|
54
|
+
content: (waterConfig === null || waterConfig === void 0 ? void 0 : waterConfig.content) || i18next.t('浙商中拓'),
|
|
55
|
+
lineSpacing: 4,
|
|
56
|
+
font: {
|
|
57
|
+
color: ((_a = waterConfig === null || waterConfig === void 0 ? void 0 : waterConfig.font) === null || _a === void 0 ? void 0 : _a.color) || 'rgba(0, 0, 0, 0.2)',
|
|
58
|
+
fontSize: ((_b = waterConfig === null || waterConfig === void 0 ? void 0 : waterConfig.font) === null || _b === void 0 ? void 0 : _b.fontSize) || 14,
|
|
59
|
+
fontWeight: ((_c = waterConfig === null || waterConfig === void 0 ? void 0 : waterConfig.font) === null || _c === void 0 ? void 0 : _c.fontWeight) || 'normal',
|
|
60
|
+
fontStyle: ((_d = waterConfig === null || waterConfig === void 0 ? void 0 : waterConfig.font) === null || _d === void 0 ? void 0 : _d.fontStyle) || 'normal',
|
|
61
|
+
fontFamily: ((_e = waterConfig === null || waterConfig === void 0 ? void 0 : waterConfig.font) === null || _e === void 0 ? void 0 : _e.fontFamily) || i18next.t('微软雅黑'),
|
|
62
|
+
textAlign: ((_f = waterConfig === null || waterConfig === void 0 ? void 0 : waterConfig.font) === null || _f === void 0 ? void 0 : _f.textAlign) || 'center',
|
|
63
|
+
},
|
|
64
|
+
image: waterConfig === null || waterConfig === void 0 ? void 0 : waterConfig.image,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
2
|
+
import React, { memo, useRef, useState, forwardRef, useImperativeHandle, } from 'react';
|
|
3
|
+
import { useMutationObserver } from 'ahooks';
|
|
4
|
+
var WatermarkDiv = function (props, ref) {
|
|
5
|
+
var zIndex = props.zIndex, image = props.image, isMutationObserver = props.isMutationObserver, isAppendBody = props.isAppendBody;
|
|
6
|
+
var waterDomRef = useRef(null);
|
|
7
|
+
var _a = useState(1), num = _a[0], setNum = _a[1];
|
|
8
|
+
useImperativeHandle(ref, function () {
|
|
9
|
+
return {
|
|
10
|
+
getWaterDomRef: function () { return waterDomRef.current; },
|
|
11
|
+
toggleVisible: function () {
|
|
12
|
+
if (waterDomRef.current) {
|
|
13
|
+
waterDomRef.current.style.visibility = 'hidden';
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
useMutationObserver(function (mutationsList) {
|
|
19
|
+
if (!isMutationObserver || isAppendBody) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
console.log(i18next.t('触发子级'), mutationsList);
|
|
23
|
+
setNum(function (num) { return num + 1; });
|
|
24
|
+
}, waterDomRef, {
|
|
25
|
+
attributes: true,
|
|
26
|
+
});
|
|
27
|
+
return (React.createElement("div", { ref: waterDomRef, key: num, className: "ztxk-watermark--div", style: {
|
|
28
|
+
zIndex: zIndex,
|
|
29
|
+
position: 'absolute',
|
|
30
|
+
visibility: 'visible',
|
|
31
|
+
left: 0,
|
|
32
|
+
top: 0,
|
|
33
|
+
width: '100%',
|
|
34
|
+
height: '100%',
|
|
35
|
+
pointerEvents: 'none',
|
|
36
|
+
backgroundRepeat: 'repeat',
|
|
37
|
+
backgroundPosition: 'left top',
|
|
38
|
+
backgroundImage: "url(" + image + ")",
|
|
39
|
+
} }));
|
|
40
|
+
};
|
|
41
|
+
export default memo(forwardRef(WatermarkDiv));
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
2
|
+
import React, { memo, useRef, useMemo, forwardRef, useImperativeHandle, useEffect, } from 'react';
|
|
3
|
+
import { createWatermark } from './utils';
|
|
4
|
+
import { useMemoizedFn, useMount } from 'ahooks';
|
|
5
|
+
var WatermarkShadow = function (props, ref) {
|
|
6
|
+
var
|
|
7
|
+
// zIndex,
|
|
8
|
+
isMutationObserver = props.isMutationObserver, content = props.content, font = props.font, rotate = props.rotate, width = props.width, height = props.height, containerDomRef = props.containerDomRef;
|
|
9
|
+
var waterDomRef = useRef(null);
|
|
10
|
+
var shadowRootRef = useRef();
|
|
11
|
+
var createWaterMemo = useMemoizedFn(function () {
|
|
12
|
+
if (!content) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
var watermarkFragment = createWatermark(content, {
|
|
16
|
+
font: font,
|
|
17
|
+
rotate: rotate,
|
|
18
|
+
width: width,
|
|
19
|
+
height: height,
|
|
20
|
+
}, containerDomRef === null || containerDomRef === void 0 ? void 0 : containerDomRef.current);
|
|
21
|
+
if (shadowRootRef.current) {
|
|
22
|
+
while (shadowRootRef.current.firstChild) {
|
|
23
|
+
shadowRootRef.current.removeChild(shadowRootRef.current.firstChild);
|
|
24
|
+
}
|
|
25
|
+
shadowRootRef.current.appendChild(watermarkFragment);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
// 初始化一个监听器
|
|
29
|
+
var observerMemo = useMemo(function () {
|
|
30
|
+
// 配置观察器的选项
|
|
31
|
+
var config = { childList: true, attributes: true, subtree: true };
|
|
32
|
+
// 创建一个回调函数来处理观察到的变化
|
|
33
|
+
var callback = function (mutationsList) {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
console.log(i18next.t('触发子级'), mutationsList);
|
|
36
|
+
// 先解除监听
|
|
37
|
+
(_a = observer === null || observer === void 0 ? void 0 : observer.disconnect) === null || _a === void 0 ? void 0 : _a.call(observer);
|
|
38
|
+
createWaterMemo();
|
|
39
|
+
// 等元素挂载后再开始监听
|
|
40
|
+
(_b = observer === null || observer === void 0 ? void 0 : observer.observe) === null || _b === void 0 ? void 0 : _b.call(observer, shadowRootRef.current, config);
|
|
41
|
+
};
|
|
42
|
+
// 创建一个 MutationObserver 实例并传入回调函数
|
|
43
|
+
var observer = new MutationObserver(callback);
|
|
44
|
+
return {
|
|
45
|
+
observer: observer,
|
|
46
|
+
config: config,
|
|
47
|
+
};
|
|
48
|
+
}, [createWaterMemo]);
|
|
49
|
+
// 初始化创建shadow节点
|
|
50
|
+
useMount(function () {
|
|
51
|
+
if (waterDomRef.current) {
|
|
52
|
+
var shadowRoot = waterDomRef.current.attachShadow({
|
|
53
|
+
mode: 'open',
|
|
54
|
+
});
|
|
55
|
+
shadowRootRef.current = shadowRoot;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
useEffect(function () {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
if (!content) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
var watermarkFragment = createWatermark(content, {
|
|
64
|
+
font: font,
|
|
65
|
+
rotate: rotate,
|
|
66
|
+
width: width,
|
|
67
|
+
height: height,
|
|
68
|
+
}, containerDomRef === null || containerDomRef === void 0 ? void 0 : containerDomRef.current);
|
|
69
|
+
if (shadowRootRef.current) {
|
|
70
|
+
while (shadowRootRef.current.firstChild) {
|
|
71
|
+
shadowRootRef.current.removeChild(shadowRootRef.current.firstChild);
|
|
72
|
+
}
|
|
73
|
+
shadowRootRef.current.appendChild(watermarkFragment);
|
|
74
|
+
// 是否监听?
|
|
75
|
+
if (isMutationObserver) {
|
|
76
|
+
(_b = (_a = observerMemo.observer) === null || _a === void 0 ? void 0 : _a.observe) === null || _b === void 0 ? void 0 : _b.call(_a, shadowRootRef.current, observerMemo.config);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return function () {
|
|
80
|
+
var _a, _b;
|
|
81
|
+
(_b = (_a = observerMemo.observer) === null || _a === void 0 ? void 0 : _a.disconnect) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
82
|
+
};
|
|
83
|
+
}, [
|
|
84
|
+
content,
|
|
85
|
+
font,
|
|
86
|
+
height,
|
|
87
|
+
rotate,
|
|
88
|
+
width,
|
|
89
|
+
observerMemo,
|
|
90
|
+
isMutationObserver,
|
|
91
|
+
containerDomRef,
|
|
92
|
+
]);
|
|
93
|
+
useImperativeHandle(ref, function () {
|
|
94
|
+
return {
|
|
95
|
+
getWaterDomRef: function () { return waterDomRef.current; },
|
|
96
|
+
toggleVisible: function () {
|
|
97
|
+
if (waterDomRef.current) {
|
|
98
|
+
waterDomRef.current.style.visibility = 'hidden';
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
return (React.createElement("div", { ref: waterDomRef, className: "ztxk-watermark--div", style: {
|
|
104
|
+
// 将这个层级设置为最高
|
|
105
|
+
zIndex: 9999,
|
|
106
|
+
position: 'absolute',
|
|
107
|
+
visibility: 'visible',
|
|
108
|
+
overflow: 'hidden',
|
|
109
|
+
left: 0,
|
|
110
|
+
top: 0,
|
|
111
|
+
width: '100%',
|
|
112
|
+
height: '100%',
|
|
113
|
+
pointerEvents: 'none',
|
|
114
|
+
} }));
|
|
115
|
+
};
|
|
116
|
+
export default memo(forwardRef(WatermarkShadow));
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
13
|
+
import React, { memo, useEffect, useRef, useMemo } from 'react';
|
|
14
|
+
import classNames from 'classnames';
|
|
15
|
+
import WatermarkDiv from './watermark-div';
|
|
16
|
+
import WatermarkShadow from './watermark-shadow';
|
|
17
|
+
import { createWater, mergeWaterConfig } from './water';
|
|
18
|
+
import { useMutationObserver } from 'ahooks';
|
|
19
|
+
var reRendering = function (mutation, isWatermarkEle) {
|
|
20
|
+
var flag = false;
|
|
21
|
+
// Whether to delete the watermark node
|
|
22
|
+
if (mutation.removedNodes.length) {
|
|
23
|
+
flag = Array.from(mutation.removedNodes).some(function (node) {
|
|
24
|
+
return isWatermarkEle(node);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return flag;
|
|
28
|
+
};
|
|
29
|
+
// TODO: 通过方法设置水印隐藏 (有没有必要做)
|
|
30
|
+
var Watermark = function (props) {
|
|
31
|
+
var children = props.children, className = props.className, _a = props.visible, visible = _a === void 0 ? true : _a, _b = props.isMutationObserver, isMutationObserver = _b === void 0 ? true : _b, isAppendBody = props.isAppendBody, isShadow = props.isShadow, waterConfigProps = __rest(props, ["children", "className", "visible", "isMutationObserver", "isAppendBody", "isShadow"]);
|
|
32
|
+
// 主容器类名
|
|
33
|
+
var classes = classNames('ztxk-watermark', className, {
|
|
34
|
+
'ztxk-watermark--hidden': !visible,
|
|
35
|
+
});
|
|
36
|
+
var waterDomRef = useRef();
|
|
37
|
+
var waterDomChildHandleRef = useRef();
|
|
38
|
+
// 创建水印相关逻辑
|
|
39
|
+
var _c = mergeWaterConfig(waterConfigProps), zIndex = _c.zIndex, image = _c.image, content = _c.content, width = _c.width, height = _c.height, rotate = _c.rotate, font = _c.font, lineSpacing = _c.lineSpacing;
|
|
40
|
+
var config = useMemo(function () {
|
|
41
|
+
// 文本水印
|
|
42
|
+
if (!image) {
|
|
43
|
+
var _a = createWater({
|
|
44
|
+
content: content,
|
|
45
|
+
width: width,
|
|
46
|
+
height: height,
|
|
47
|
+
rotate: rotate,
|
|
48
|
+
font: font,
|
|
49
|
+
lineSpacing: lineSpacing,
|
|
50
|
+
}), imgBase64 = _a.imgBase64, canvasWidth = _a.canvasWidth, canvasHeight = _a.canvasHeight;
|
|
51
|
+
return {
|
|
52
|
+
image: imgBase64,
|
|
53
|
+
width: canvasWidth,
|
|
54
|
+
height: canvasHeight,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
image: image,
|
|
59
|
+
width: width,
|
|
60
|
+
height: height,
|
|
61
|
+
};
|
|
62
|
+
}, [content, font, height, image, rotate, width, lineSpacing]);
|
|
63
|
+
useMutationObserver(function (mutationsList) {
|
|
64
|
+
if (!isMutationObserver || isAppendBody) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
console.log(i18next.t('触发父级'), mutationsList);
|
|
68
|
+
mutationsList.forEach(function (mutation) {
|
|
69
|
+
var _a, _b;
|
|
70
|
+
if (reRendering(mutation, function (node) {
|
|
71
|
+
var _a, _b;
|
|
72
|
+
return node === ((_b = (_a = waterDomChildHandleRef.current) === null || _a === void 0 ? void 0 : _a.getWaterDomRef) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
73
|
+
})) {
|
|
74
|
+
waterDomRef.current.appendChild((_b = (_a = waterDomChildHandleRef.current) === null || _a === void 0 ? void 0 : _a.getWaterDomRef) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}, waterDomRef, {
|
|
78
|
+
childList: true,
|
|
79
|
+
});
|
|
80
|
+
useEffect(function () {
|
|
81
|
+
if (!isAppendBody) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (visible) {
|
|
85
|
+
document.body.style.background = "url(" + config.image + ") left top repeat";
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
document.body.style.background = '';
|
|
89
|
+
}
|
|
90
|
+
}, [isAppendBody, visible, config.image]);
|
|
91
|
+
if (isShadow) {
|
|
92
|
+
return (React.createElement("div", { className: classes, style: { position: 'relative' }, ref: waterDomRef },
|
|
93
|
+
children,
|
|
94
|
+
React.createElement(WatermarkShadow, { ref: waterDomChildHandleRef, isMutationObserver: isMutationObserver, content: content, font: font, rotate: rotate, width: width, height: height, containerDomRef: waterDomRef, zIndex: zIndex })));
|
|
95
|
+
}
|
|
96
|
+
return isAppendBody ? (React.createElement("div", { className: classes, style: { position: 'relative' }, ref: waterDomRef }, children)) : (React.createElement("div", { className: classes, style: { position: 'relative' }, ref: waterDomRef },
|
|
97
|
+
children,
|
|
98
|
+
React.createElement(WatermarkDiv, { ref: waterDomChildHandleRef, isMutationObserver: isMutationObserver, isAppendBody: isAppendBody, zIndex: zIndex, image: config.image })));
|
|
99
|
+
};
|
|
100
|
+
var WatermarkCom = memo(Watermark);
|
|
101
|
+
WatermarkCom.displayName = 'ZTXK_WEBUI_Watermark';
|
|
102
|
+
export default WatermarkCom;
|