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
|
@@ -1,11 +1,68 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
2
|
+
import React, { useContext, useEffect } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import { Button } from '../../../index';
|
|
5
|
+
import { SearchContext, SearchContainerContext } from './search-container';
|
|
6
|
+
import useRecordCommonSearch from './useRecordCommonSearch';
|
|
4
7
|
var SearchRight = function (_a) {
|
|
5
|
-
var children = _a.children, className = _a.className, onSearchHandle = _a.onSearchHandle, onResetHandle = _a.onResetHandle;
|
|
8
|
+
var children = _a.children, className = _a.className, onSearchHandle = _a.onSearchHandle, onResetHandle = _a.onResetHandle, addRightMarginBottom = _a.addRightMarginBottom;
|
|
9
|
+
var rightSearchHandleRef = React.useContext(SearchContainerContext).rightSearchHandleRef;
|
|
6
10
|
var classes = classNames('zt-search__right', className);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
var _b = useContext(SearchContext), showDynamicRef = _b.showDynamicRef, setDynamicVisibleRef = _b.setDynamicVisibleRef, dynamicRef = _b.dynamicRef, hideDynamic = _b.hideDynamic;
|
|
12
|
+
var _c = useRecordCommonSearch(), onRecordSearchHandle = _c.onRecordSearchHandle, recordCommonSearch = _c.recordCommonSearch, setCurrentRecordCommonSearchKey = _c.setCurrentRecordCommonSearchKey, setHasSearchButton = _c.setHasSearchButton;
|
|
13
|
+
useEffect(function () {
|
|
14
|
+
setHasSearchButton === null || setHasSearchButton === void 0 ? void 0 : setHasSearchButton(true);
|
|
15
|
+
}, []);
|
|
16
|
+
var selfOnResetHandle = function () {
|
|
17
|
+
setCurrentRecordCommonSearchKey === null || setCurrentRecordCommonSearchKey === void 0 ? void 0 : setCurrentRecordCommonSearchKey('');
|
|
18
|
+
onResetHandle === null || onResetHandle === void 0 ? void 0 : onResetHandle();
|
|
19
|
+
};
|
|
20
|
+
if (rightSearchHandleRef) {
|
|
21
|
+
rightSearchHandleRef.current = onSearchHandle;
|
|
22
|
+
}
|
|
23
|
+
return (React.createElement("div", { className: classes, style: { marginBottom: addRightMarginBottom ? '10px' : 0 } },
|
|
24
|
+
React.createElement("div", { className: classNames('zt-search__right-buttons'), style: {
|
|
25
|
+
marginRight: (showDynamicRef === null || showDynamicRef === void 0 ? void 0 : showDynamicRef.current) && !hideDynamic ? '0px' : '5px',
|
|
26
|
+
} },
|
|
27
|
+
React.createElement(Button, { type: "default", onClick: selfOnResetHandle, style: { marginTop: 0 } }, i18next.t('重置')),
|
|
28
|
+
(showDynamicRef === null || showDynamicRef === void 0 ? void 0 : showDynamicRef.current) && !hideDynamic && (React.createElement(Button, { onClick: function () { var _a; return (_a = setDynamicVisibleRef === null || setDynamicVisibleRef === void 0 ? void 0 : setDynamicVisibleRef.current) === null || _a === void 0 ? void 0 : _a.call(setDynamicVisibleRef, true); }, type: "default", compact: true }, i18next.t('自定义')))),
|
|
29
|
+
React.createElement("div", { className: classNames('zt-search__right-search-buttons') },
|
|
30
|
+
React.createElement(Button, { type: "primary", onClick: onSearchHandle, htmlType: "submit" }, i18next.t('查询')),
|
|
31
|
+
recordCommonSearch && (showDynamicRef === null || showDynamicRef === void 0 ? void 0 : showDynamicRef.current) ? (React.createElement(Button, { type: "default", onClick: function () {
|
|
32
|
+
onRecordSearchHandle();
|
|
33
|
+
} }, i18next.t('常用搜索'))) : null)));
|
|
34
|
+
// return !recordCommonSearch ? (
|
|
35
|
+
// <div className={classes}>
|
|
36
|
+
// <Button type="default" onClick={selfOnResetHandle}>
|
|
37
|
+
// {i18next.t('重置')}
|
|
38
|
+
// </Button>
|
|
39
|
+
// <Button type="primary" onClick={onSearchHandle} htmlType="submit">
|
|
40
|
+
// {i18next.t('查询')}
|
|
41
|
+
// </Button>
|
|
42
|
+
// </div>
|
|
43
|
+
// ) : (
|
|
44
|
+
// <div className={classes}>
|
|
45
|
+
// <div className="zt-search__right--record-left">
|
|
46
|
+
// <Button type="default" onClick={selfOnResetHandle}>
|
|
47
|
+
// {i18next.t('重置')}
|
|
48
|
+
// </Button>
|
|
49
|
+
// <Button type="primary" onClick={onSearchHandle} htmlType="submit">
|
|
50
|
+
// {i18next.t('查询')}
|
|
51
|
+
// </Button>
|
|
52
|
+
// </div>
|
|
53
|
+
// <div className="zt-search__right--record-right" style={{ marginTop: 12 }}>
|
|
54
|
+
// <Button
|
|
55
|
+
// type="default"
|
|
56
|
+
// onClick={onRecordSearchHandle}
|
|
57
|
+
// style={{ width: '100%' }}
|
|
58
|
+
// >
|
|
59
|
+
// {/* {currentRecordCommonSearchKey
|
|
60
|
+
// ? i18next.t('更新常用搜索')
|
|
61
|
+
// : i18next.t('保存为常用搜索')} */}
|
|
62
|
+
// {i18next.t('保存为常用搜索')}
|
|
63
|
+
// </Button>
|
|
64
|
+
// </div>
|
|
65
|
+
// </div>
|
|
66
|
+
// );
|
|
10
67
|
};
|
|
11
68
|
export default SearchRight;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import MyStorage from '../../utils/MyStorage';
|
|
3
|
+
export default function useRecordCommonInit(): {
|
|
4
|
+
recordCommonSearchStorageKey: string;
|
|
5
|
+
setRecordCommonSearchStorageKey: React.Dispatch<React.SetStateAction<string>>;
|
|
6
|
+
storageRef: React.MutableRefObject<MyStorage>;
|
|
7
|
+
recordCommonList: any[];
|
|
8
|
+
setRecordCommonList: React.Dispatch<React.SetStateAction<any[]>>;
|
|
9
|
+
currentRecordCommonSearchKey: string;
|
|
10
|
+
setCurrentRecordCommonSearchKey: React.Dispatch<React.SetStateAction<string>>;
|
|
11
|
+
setData: (data: any) => Promise<unknown>;
|
|
12
|
+
deleteData: (localIndex: number) => Promise<void>;
|
|
13
|
+
setReplaceData: (data: any) => Promise<any>;
|
|
14
|
+
reTransformData: (data: any, timeKeys?: any) => {};
|
|
15
|
+
updateServerData: () => Promise<unknown>;
|
|
16
|
+
hasSearchButton: boolean;
|
|
17
|
+
setHasSearchButton: React.Dispatch<React.SetStateAction<boolean>>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,258 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (_) try {
|
|
28
|
+
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;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
49
|
+
import { useEffect, useState, useRef } from 'react';
|
|
50
|
+
import { COMMON_RECORD_SEARCH_KEY } from './useRecordCommonSearch';
|
|
51
|
+
import MyStorage from '../../utils/MyStorage';
|
|
52
|
+
import dayjs from 'dayjs';
|
|
53
|
+
import { catchHandle } from '../../utils/fetch';
|
|
54
|
+
export default function useRecordCommonInit() {
|
|
55
|
+
var _this = this;
|
|
56
|
+
// 当前表单用哪个key来存储数据。{ key: [{ title: xx, data: xx, key: xx }, {...}] }
|
|
57
|
+
var _a = useState(), recordCommonSearchStorageKey = _a[0], setRecordCommonSearchStorageKey = _a[1];
|
|
58
|
+
// 是否有查询按钮
|
|
59
|
+
var _b = useState(false), hasSearchButton = _b[0], setHasSearchButton = _b[1];
|
|
60
|
+
// 常用搜索列表存储实例
|
|
61
|
+
var storageRef = useRef(new MyStorage({ tableKey: COMMON_RECORD_SEARCH_KEY }));
|
|
62
|
+
// 常用搜索列表
|
|
63
|
+
var _c = useState([]), recordCommonList = _c[0], setRecordCommonList = _c[1];
|
|
64
|
+
// 当前常用搜索key值
|
|
65
|
+
var _d = useState(''), currentRecordCommonSearchKey = _d[0], setCurrentRecordCommonSearchKey = _d[1];
|
|
66
|
+
useEffect(function () {
|
|
67
|
+
if (!recordCommonSearchStorageKey) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
storageRef.current
|
|
71
|
+
.getItem(recordCommonSearchStorageKey)
|
|
72
|
+
.then(function (res) { return setRecordCommonList(res || []); });
|
|
73
|
+
}, [recordCommonSearchStorageKey]);
|
|
74
|
+
/**
|
|
75
|
+
* description: 数据转换。主要是将时间对象转成字符串
|
|
76
|
+
*/
|
|
77
|
+
var transformData = function (data) {
|
|
78
|
+
// 处理数据,将数据中的时间对象做一下转换
|
|
79
|
+
var dataValue = data;
|
|
80
|
+
var newDataValue = {}; // 为了不影响之前的数据
|
|
81
|
+
var timeKeys = [];
|
|
82
|
+
if (dataValue) {
|
|
83
|
+
Object.keys(dataValue).forEach(function (key) {
|
|
84
|
+
var value = dataValue[key];
|
|
85
|
+
if (Array.isArray(value)) {
|
|
86
|
+
newDataValue[key] = [];
|
|
87
|
+
value.forEach(function (item) {
|
|
88
|
+
if (dayjs.isDayjs(item)) {
|
|
89
|
+
timeKeys.push(key);
|
|
90
|
+
newDataValue[key].push(dayjs(item).format('YYYY-MM-DD HH:mm:ss'));
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
newDataValue[key].push(item);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
var itemIsDayjs = dayjs.isDayjs(value);
|
|
99
|
+
if (itemIsDayjs) {
|
|
100
|
+
timeKeys.push(key);
|
|
101
|
+
}
|
|
102
|
+
newDataValue[key] = itemIsDayjs
|
|
103
|
+
? dayjs(value).format('YYYY-MM-DD HH:mm:ss')
|
|
104
|
+
: value;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
newDataValue: newDataValue,
|
|
110
|
+
timeKeys: timeKeys,
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* @description: 数据转换。主要是将时间字符串转成时间对象。
|
|
115
|
+
*/
|
|
116
|
+
var reTransformData = function (data, timeKeys) {
|
|
117
|
+
if (timeKeys === void 0) { timeKeys = []; }
|
|
118
|
+
// 处理数据,将数据中的时间对象做一下转换
|
|
119
|
+
var dataValue = data;
|
|
120
|
+
var newDataValue = {}; // 为了不影响之前的数据
|
|
121
|
+
if (dataValue) {
|
|
122
|
+
Object.keys(dataValue).forEach(function (key) {
|
|
123
|
+
var value = dataValue[key];
|
|
124
|
+
if (Array.isArray(value)) {
|
|
125
|
+
newDataValue[key] = [];
|
|
126
|
+
value.forEach(function (item) {
|
|
127
|
+
if (timeKeys.includes(key)) {
|
|
128
|
+
newDataValue[key].push(dayjs(item));
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
newDataValue[key].push(item);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
newDataValue[key] = timeKeys.includes(key) ? dayjs(value) : value;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return newDataValue;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* description: 存储数据
|
|
144
|
+
* @param {*} data 常用搜索数据
|
|
145
|
+
* @param {*} localIndex 本地存储索引 如果传了索引 就是修改
|
|
146
|
+
*/
|
|
147
|
+
var setData = function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
148
|
+
var localKey, _a, newDataValue, timeKeys, saveData;
|
|
149
|
+
var _b;
|
|
150
|
+
return __generator(this, function (_c) {
|
|
151
|
+
localKey = recordCommonSearchStorageKey;
|
|
152
|
+
if (!localKey) {
|
|
153
|
+
return [2 /*return*/];
|
|
154
|
+
}
|
|
155
|
+
_a = transformData(data.value), newDataValue = _a.newDataValue, timeKeys = _a.timeKeys;
|
|
156
|
+
saveData = __assign(__assign({}, data), { value: newDataValue, timeKeys: timeKeys });
|
|
157
|
+
return [2 /*return*/, (_b = storageRef === null || storageRef === void 0 ? void 0 : storageRef.current) === null || _b === void 0 ? void 0 : _b.getItem(localKey).then(function (res) {
|
|
158
|
+
var _a, _b;
|
|
159
|
+
// 处理数据,将数据中的时间对象做一下转换
|
|
160
|
+
var result = res;
|
|
161
|
+
if (!result) {
|
|
162
|
+
result = [saveData];
|
|
163
|
+
}
|
|
164
|
+
else if (Array.isArray(result)) {
|
|
165
|
+
var index = result.findIndex(function (item) { return item.key === saveData.key; });
|
|
166
|
+
if (index !== -1) {
|
|
167
|
+
result[index] = saveData;
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
result.unshift(saveData);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
setCurrentRecordCommonSearchKey(saveData.key);
|
|
174
|
+
if (setRecordCommonList) {
|
|
175
|
+
setRecordCommonList(result);
|
|
176
|
+
}
|
|
177
|
+
return (_b = (_a = storageRef === null || storageRef === void 0 ? void 0 : storageRef.current) === null || _a === void 0 ? void 0 : _a.setItem(localKey, result)) === null || _b === void 0 ? void 0 : _b.then(function () {
|
|
178
|
+
return updateServerData();
|
|
179
|
+
});
|
|
180
|
+
})];
|
|
181
|
+
});
|
|
182
|
+
}); };
|
|
183
|
+
/**
|
|
184
|
+
* description: 删除数据
|
|
185
|
+
* @param {*} localIndex 本地存储索引
|
|
186
|
+
*/
|
|
187
|
+
var deleteData = function (localIndex) { return __awaiter(_this, void 0, void 0, function () {
|
|
188
|
+
var localKey;
|
|
189
|
+
var _a;
|
|
190
|
+
return __generator(this, function (_b) {
|
|
191
|
+
localKey = recordCommonSearchStorageKey;
|
|
192
|
+
if (!localKey) {
|
|
193
|
+
return [2 /*return*/];
|
|
194
|
+
}
|
|
195
|
+
return [2 /*return*/, (_a = storageRef === null || storageRef === void 0 ? void 0 : storageRef.current) === null || _a === void 0 ? void 0 : _a.getItem(localKey).then(function (res) {
|
|
196
|
+
var _a, _b;
|
|
197
|
+
if (Array.isArray(res)) {
|
|
198
|
+
res.splice(localIndex, 1);
|
|
199
|
+
(_b = (_a = storageRef === null || storageRef === void 0 ? void 0 : storageRef.current) === null || _a === void 0 ? void 0 : _a.setItem(localKey, res)) === null || _b === void 0 ? void 0 : _b.then(function () {
|
|
200
|
+
return updateServerData();
|
|
201
|
+
});
|
|
202
|
+
if (setRecordCommonList) {
|
|
203
|
+
setRecordCommonList(res);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
})];
|
|
207
|
+
});
|
|
208
|
+
}); };
|
|
209
|
+
/**
|
|
210
|
+
* description: 直接替换原有数据
|
|
211
|
+
* @param {*} data 常用搜索数据
|
|
212
|
+
*/
|
|
213
|
+
var setReplaceData = function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
214
|
+
var localKey;
|
|
215
|
+
var _a;
|
|
216
|
+
return __generator(this, function (_b) {
|
|
217
|
+
localKey = recordCommonSearchStorageKey;
|
|
218
|
+
if (!localKey) {
|
|
219
|
+
return [2 /*return*/];
|
|
220
|
+
}
|
|
221
|
+
if (setRecordCommonList) {
|
|
222
|
+
setRecordCommonList(data);
|
|
223
|
+
}
|
|
224
|
+
return [2 /*return*/, (_a = storageRef === null || storageRef === void 0 ? void 0 : storageRef.current) === null || _a === void 0 ? void 0 : _a.setItem(localKey, data)];
|
|
225
|
+
});
|
|
226
|
+
}); };
|
|
227
|
+
/**
|
|
228
|
+
* 直接更新服务器数据
|
|
229
|
+
*/
|
|
230
|
+
var updateServerData = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
231
|
+
var _a, _b;
|
|
232
|
+
return __generator(this, function (_c) {
|
|
233
|
+
return [2 /*return*/, (_b = (_a = storageRef.current) === null || _a === void 0 ? void 0 : _a.getAllItems()) === null || _b === void 0 ? void 0 : _b.then(function (res) {
|
|
234
|
+
return catchHandle({
|
|
235
|
+
customKey: COMMON_RECORD_SEARCH_KEY,
|
|
236
|
+
customValue: JSON.stringify(res),
|
|
237
|
+
mark: i18next.t('常用搜索用户配置'),
|
|
238
|
+
});
|
|
239
|
+
})];
|
|
240
|
+
});
|
|
241
|
+
}); };
|
|
242
|
+
return {
|
|
243
|
+
recordCommonSearchStorageKey: recordCommonSearchStorageKey,
|
|
244
|
+
setRecordCommonSearchStorageKey: setRecordCommonSearchStorageKey,
|
|
245
|
+
storageRef: storageRef,
|
|
246
|
+
recordCommonList: recordCommonList,
|
|
247
|
+
setRecordCommonList: setRecordCommonList,
|
|
248
|
+
currentRecordCommonSearchKey: currentRecordCommonSearchKey,
|
|
249
|
+
setCurrentRecordCommonSearchKey: setCurrentRecordCommonSearchKey,
|
|
250
|
+
setData: setData,
|
|
251
|
+
deleteData: deleteData,
|
|
252
|
+
setReplaceData: setReplaceData,
|
|
253
|
+
reTransformData: reTransformData,
|
|
254
|
+
updateServerData: updateServerData,
|
|
255
|
+
hasSearchButton: hasSearchButton,
|
|
256
|
+
setHasSearchButton: setHasSearchButton,
|
|
257
|
+
};
|
|
258
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const COMMON_RECORD_SEARCH_KEY = "ztxk_form_common_record_search_key";
|
|
2
|
+
export default function useRecordCommonSearch(): {
|
|
3
|
+
onRecordSearchHandle: () => void;
|
|
4
|
+
recordCommonSearch: boolean;
|
|
5
|
+
currentRecordCommonSearchKey: string;
|
|
6
|
+
setCurrentRecordCommonSearchKey: (key: string) => void;
|
|
7
|
+
setHasSearchButton: any;
|
|
8
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
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 React, { useState, useRef, useImperativeHandle, forwardRef, useEffect, useContext, } from 'react';
|
|
39
|
+
import { message, Modal, Input } from '../../../index';
|
|
40
|
+
import { useRecordCommonSearchContext } from './useRecordCommonSearchContext';
|
|
41
|
+
import { SearchContext } from './search-container';
|
|
42
|
+
// 总的存储常用搜索的key值
|
|
43
|
+
export var COMMON_RECORD_SEARCH_KEY = 'ztxk_form_common_record_search_key';
|
|
44
|
+
export default function useRecordCommonSearch() {
|
|
45
|
+
var _a = useRecordCommonSearchContext(), form = _a.form, recordCommonSearch = _a.recordCommonSearch, recordCommonList = _a.recordCommonList, currentRecordCommonSearchKey = _a.currentRecordCommonSearchKey, setData = _a.setData, setCurrentRecordCommonSearchKey = _a.setCurrentRecordCommonSearchKey, setHasSearchButton = _a.setHasSearchButton;
|
|
46
|
+
var dynamicRef = useContext(SearchContext).dynamicRef;
|
|
47
|
+
var iptRef = useRef(null);
|
|
48
|
+
useEffect(function () {
|
|
49
|
+
var _a;
|
|
50
|
+
if (!(recordCommonList === null || recordCommonList === void 0 ? void 0 : recordCommonList.length)) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
var currentCommon = recordCommonList.find(function (item) { return item.key === currentRecordCommonSearchKey; });
|
|
54
|
+
if (currentCommon) {
|
|
55
|
+
(_a = iptRef.current) === null || _a === void 0 ? void 0 : _a.setValue(currentCommon.title);
|
|
56
|
+
}
|
|
57
|
+
}, [currentRecordCommonSearchKey, recordCommonList]);
|
|
58
|
+
/**
|
|
59
|
+
* 保存为常用搜索事件
|
|
60
|
+
*/
|
|
61
|
+
var onRecordSearchHandle = function () {
|
|
62
|
+
if (!form) {
|
|
63
|
+
message.info(i18next.t('组件需要接受表单实例form'));
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
Modal.confirm({
|
|
67
|
+
icon: null,
|
|
68
|
+
// title: currentRecordCommonSearchKey
|
|
69
|
+
// ? i18next.t('更新常用搜索')
|
|
70
|
+
// : i18next.t('保存为常用搜索'),
|
|
71
|
+
title: i18next.t('保存为常用搜索'),
|
|
72
|
+
content: React.createElement(MyInput, { ref: iptRef }),
|
|
73
|
+
onOk: function () {
|
|
74
|
+
var _a, _b, _c, _d;
|
|
75
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
76
|
+
var currentCommonName, currentData, data, err_1;
|
|
77
|
+
return __generator(this, function (_e) {
|
|
78
|
+
switch (_e.label) {
|
|
79
|
+
case 0:
|
|
80
|
+
currentCommonName = (_a = iptRef.current) === null || _a === void 0 ? void 0 : _a.getValue();
|
|
81
|
+
if (!currentCommonName) {
|
|
82
|
+
message.info(i18next.t('请输入常用搜索名称!'));
|
|
83
|
+
return [2 /*return*/, Promise.reject(new Error(i18next.t('请输入常用搜索名称!')))];
|
|
84
|
+
}
|
|
85
|
+
currentData = form.getFieldsValue();
|
|
86
|
+
console.log(i18next.t('当前表单数据'), currentData);
|
|
87
|
+
console.log('当前表单配置数据', (_b = dynamicRef.current) === null || _b === void 0 ? void 0 : _b.dynamicList);
|
|
88
|
+
data = {
|
|
89
|
+
title: currentCommonName,
|
|
90
|
+
value: currentData,
|
|
91
|
+
// key: currentRecordCommonSearchKey || Date.now(),
|
|
92
|
+
key: Date.now(),
|
|
93
|
+
dynamicList: ((_c = dynamicRef.current) === null || _c === void 0 ? void 0 : _c.dynamicList) || [],
|
|
94
|
+
};
|
|
95
|
+
_e.label = 1;
|
|
96
|
+
case 1:
|
|
97
|
+
_e.trys.push([1, 3, , 4]);
|
|
98
|
+
return [4 /*yield*/, (setData === null || setData === void 0 ? void 0 : setData(data))];
|
|
99
|
+
case 2:
|
|
100
|
+
_e.sent();
|
|
101
|
+
message.info(i18next.t('保存成功!'));
|
|
102
|
+
(_d = iptRef.current) === null || _d === void 0 ? void 0 : _d.setValue('');
|
|
103
|
+
return [3 /*break*/, 4];
|
|
104
|
+
case 3:
|
|
105
|
+
err_1 = _e.sent();
|
|
106
|
+
message.info(i18next.t('保存常用搜索失败!'));
|
|
107
|
+
return [2 /*return*/, Promise.reject(new Error(i18next.t('保存常用搜索失败!')))];
|
|
108
|
+
case 4: return [2 /*return*/];
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
},
|
|
113
|
+
onCancel: function () {
|
|
114
|
+
console.log('Cancel');
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
setTimeout(function () {
|
|
118
|
+
if (!(recordCommonList === null || recordCommonList === void 0 ? void 0 : recordCommonList.length)) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
var currentCommon = recordCommonList.find(function (item) { return item.key === currentRecordCommonSearchKey; });
|
|
122
|
+
if (currentCommon) {
|
|
123
|
+
// iptRef.current?.setValue(currentCommon.title);
|
|
124
|
+
}
|
|
125
|
+
}, 0);
|
|
126
|
+
};
|
|
127
|
+
return {
|
|
128
|
+
onRecordSearchHandle: onRecordSearchHandle,
|
|
129
|
+
recordCommonSearch: recordCommonSearch,
|
|
130
|
+
currentRecordCommonSearchKey: currentRecordCommonSearchKey,
|
|
131
|
+
setCurrentRecordCommonSearchKey: setCurrentRecordCommonSearchKey,
|
|
132
|
+
setHasSearchButton: setHasSearchButton,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
var MyInput = forwardRef(function (props, ref) {
|
|
136
|
+
var _a = useState(''), value = _a[0], setValue = _a[1];
|
|
137
|
+
var onChange = function (e) {
|
|
138
|
+
setValue(e.target.value);
|
|
139
|
+
};
|
|
140
|
+
useImperativeHandle(ref, function () { return ({
|
|
141
|
+
getValue: function () { return value; },
|
|
142
|
+
setValue: setValue,
|
|
143
|
+
}); });
|
|
144
|
+
return (React.createElement(Input, { placeholder: i18next.t('请输入常用搜索名称!'), value: value, onChange: onChange }));
|
|
145
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const RecordCommonSearchContext: React.Context<{
|
|
3
|
+
form?: any;
|
|
4
|
+
hasSearchButton?: boolean;
|
|
5
|
+
setHasSearchButton?: any;
|
|
6
|
+
recordCommonSearch?: boolean;
|
|
7
|
+
recordCommonSearchStorageKey?: string;
|
|
8
|
+
setRecordCommonSearchStorageKey?: any;
|
|
9
|
+
storageRef?: any;
|
|
10
|
+
recordCommonList: any[];
|
|
11
|
+
setRecordCommonList?: (list: any[]) => void;
|
|
12
|
+
currentRecordCommonSearchKey?: string;
|
|
13
|
+
setCurrentRecordCommonSearchKey?: (key: string) => void;
|
|
14
|
+
setData?: (data: any, localIndex?: number) => any;
|
|
15
|
+
deleteData?: (localIndex: number) => any;
|
|
16
|
+
setReplaceData?: (data: any) => any;
|
|
17
|
+
reTransformData?: (data: any, timeKeys: string[]) => any;
|
|
18
|
+
updateServerData?: () => any;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const useRecordCommonSearchContext: () => {
|
|
21
|
+
form?: any;
|
|
22
|
+
hasSearchButton?: boolean;
|
|
23
|
+
setHasSearchButton?: any;
|
|
24
|
+
recordCommonSearch?: boolean;
|
|
25
|
+
recordCommonSearchStorageKey?: string;
|
|
26
|
+
setRecordCommonSearchStorageKey?: any;
|
|
27
|
+
storageRef?: any;
|
|
28
|
+
recordCommonList: any[];
|
|
29
|
+
setRecordCommonList?: (list: any[]) => void;
|
|
30
|
+
currentRecordCommonSearchKey?: string;
|
|
31
|
+
setCurrentRecordCommonSearchKey?: (key: string) => void;
|
|
32
|
+
setData?: (data: any, localIndex?: number) => any;
|
|
33
|
+
deleteData?: (localIndex: number) => any;
|
|
34
|
+
setReplaceData?: (data: any) => any;
|
|
35
|
+
reTransformData?: (data: any, timeKeys: string[]) => any;
|
|
36
|
+
updateServerData?: () => any;
|
|
37
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function useTemplate(options: {
|
|
3
|
+
templateKey?: string;
|
|
4
|
+
currentList?: any;
|
|
5
|
+
initDynamicArr?: any[];
|
|
6
|
+
onInsideChange?: (newList: any[]) => void;
|
|
7
|
+
tableKey?: string;
|
|
8
|
+
}): {
|
|
9
|
+
templateList: any[];
|
|
10
|
+
setTemplateList: React.Dispatch<React.SetStateAction<any[]>>;
|
|
11
|
+
currentTemplateKey: string;
|
|
12
|
+
setCurrentTemplateKey: React.Dispatch<React.SetStateAction<string>>;
|
|
13
|
+
setData: (data: any, isSaveServer?: boolean) => Promise<void>;
|
|
14
|
+
saveCurrentTemplate: () => Promise<void>;
|
|
15
|
+
deleteData: (localIndex: number) => Promise<void>;
|
|
16
|
+
setReplaceData: (data: any) => Promise<any>;
|
|
17
|
+
openTemplateModal: () => void;
|
|
18
|
+
renderTemplateModal: () => JSX.Element;
|
|
19
|
+
getCurrentTemplate: () => any;
|
|
20
|
+
};
|