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
|
@@ -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
|
* @description 导出按钮组件
|
|
25
26
|
* @author 宋宇环
|
|
@@ -32,11 +33,11 @@ var ExportButton = function (_a) {
|
|
|
32
33
|
var _c = useState(false), loading = _c[0], setLoading = _c[1];
|
|
33
34
|
var onClickExport = function () {
|
|
34
35
|
if (!url) {
|
|
35
|
-
message.warning('该功能正在开发中');
|
|
36
|
+
message.warning(i18next.t('该功能正在开发中'));
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
39
|
if (total === 0) {
|
|
39
|
-
message.warning('无数据可导出');
|
|
40
|
+
message.warning(i18next.t('无数据可导出'));
|
|
40
41
|
return;
|
|
41
42
|
}
|
|
42
43
|
setLoading(true);
|
|
@@ -50,7 +51,7 @@ var ExportButton = function (_a) {
|
|
|
50
51
|
.then(function (res) {
|
|
51
52
|
setLoading(false);
|
|
52
53
|
if (!res.headers['content-disposition']) {
|
|
53
|
-
message.warning('没有可导出的内容');
|
|
54
|
+
message.warning(i18next.t('没有可导出的内容'));
|
|
54
55
|
return;
|
|
55
56
|
}
|
|
56
57
|
var fileName = res.headers['content-disposition'].split(';');
|
|
@@ -60,7 +61,7 @@ var ExportButton = function (_a) {
|
|
|
60
61
|
type: 'application/vnd.ms-excel',
|
|
61
62
|
});
|
|
62
63
|
if (blob.size < 1) {
|
|
63
|
-
alert('导出失败,导出的内容为空!');
|
|
64
|
+
alert(i18next.t('导出失败,导出的内容为空!'));
|
|
64
65
|
return;
|
|
65
66
|
}
|
|
66
67
|
var aLink = document.createElement('a');
|
|
@@ -76,6 +77,6 @@ var ExportButton = function (_a) {
|
|
|
76
77
|
setLoading(false);
|
|
77
78
|
});
|
|
78
79
|
};
|
|
79
|
-
return (React.createElement(Button, __assign({ loading: loading, type: "default", onClick: onClickExport }, restProps),
|
|
80
|
+
return (React.createElement(Button, __assign({ loading: loading, type: "default", onClick: onClickExport }, restProps), i18next.t('导出')));
|
|
80
81
|
};
|
|
81
82
|
export default memo(ExportButton);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
1
2
|
import React, { memo } from 'react';
|
|
2
3
|
import { Pagination, Button, Layout, Dropdown } from '../../../index';
|
|
3
4
|
var pageSizeOptions = ['10', '20', '30', '100'];
|
|
@@ -13,7 +14,9 @@ var Footer = function (_a) {
|
|
|
13
14
|
}
|
|
14
15
|
if (item.DOMType === 'pagination') {
|
|
15
16
|
var total = item.total, pageSize = item.pageSize, current = item.current, onChange = item.onChange, onShowSizeChange = item.onShowSizeChange;
|
|
16
|
-
return (React.createElement(Pagination, { key: index, total: total, pageSize: pageSize, current: current, onChange: onChange, onShowSizeChange: onShowSizeChange, showTotal: function (total) {
|
|
17
|
+
return (React.createElement(Pagination, { key: index, total: total, pageSize: pageSize, current: current, onChange: onChange, onShowSizeChange: onShowSizeChange, showTotal: function (total) {
|
|
18
|
+
return i18next.t('共{{total}}条', { total: total });
|
|
19
|
+
}, showSizeChanger: true, pageSizeOptions: pageSizeOptions }));
|
|
17
20
|
}
|
|
18
21
|
if (item.DOMType === 'dropdown') {
|
|
19
22
|
return (React.createElement(Dropdown.Button, { className: "footer__dropdown-btn", overlay: item.overlay, key: index }, item.text));
|
|
@@ -18,7 +18,7 @@ var Item = function (_a) {
|
|
|
18
18
|
return (React.createElement(React.Fragment, null,
|
|
19
19
|
React.createElement(Col, __assign({ className: classes + ' zt-new-grid-item--title',
|
|
20
20
|
// span={titleSpan ? titleSpan : Math.ceil(span * 0.3)}
|
|
21
|
-
span: titleSpan ? titleSpan : 3, title: title }, titleProps),
|
|
21
|
+
span: titleSpan ? titleSpan : 3, title: typeof title === 'string' ? title : '' }, titleProps),
|
|
22
22
|
React.createElement("span", { className: "zt-new-grid-item--title-text" }, title),
|
|
23
23
|
React.createElement("span", { className: "zt-new-grid-item--title-colon" }, colon && ':')),
|
|
24
24
|
React.createElement(Col, __assign({ className: showDiff
|
|
@@ -9,53 +9,54 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
12
13
|
import React from 'react';
|
|
13
14
|
import { Button, Popconfirm } from '../../../';
|
|
14
15
|
import { isBtnAuth } from 'ztxkutils/dist/authority';
|
|
15
16
|
var BTN_GROUP_CONFIG = {
|
|
16
17
|
8: [
|
|
17
18
|
{
|
|
18
|
-
name: '启用',
|
|
19
|
+
name: i18next.t('启用'),
|
|
19
20
|
type: 'unfreeze',
|
|
20
21
|
authority: 'freeze',
|
|
21
|
-
confirmMsg: '是否确定启用?',
|
|
22
|
+
confirmMsg: i18next.t('是否确定启用?'),
|
|
22
23
|
},
|
|
23
24
|
],
|
|
24
25
|
10: [
|
|
25
|
-
{ name: '修改', type: 'update', authority: 'add' },
|
|
26
|
-
{ name: '提交审核', type: 'submitApprove', authority: 'add' },
|
|
26
|
+
{ name: i18next.t('修改'), type: 'update', authority: 'add' },
|
|
27
|
+
{ name: i18next.t('提交审核'), type: 'submitApprove', authority: 'add' },
|
|
27
28
|
{
|
|
28
|
-
name: '作废',
|
|
29
|
+
name: i18next.t('作废'),
|
|
29
30
|
type: 'cancelLation',
|
|
30
31
|
authority: 'add',
|
|
31
|
-
confirmMsg: '是否确定作废?作废后单据不能再操作。',
|
|
32
|
+
confirmMsg: i18next.t('是否确定作废?作废后单据不能再操作。'),
|
|
32
33
|
},
|
|
33
34
|
],
|
|
34
35
|
15: [
|
|
35
36
|
{
|
|
36
|
-
name: '撤销提交',
|
|
37
|
+
name: i18next.t('撤销提交'),
|
|
37
38
|
type: 'cancelSubmit',
|
|
38
39
|
authority: 'add',
|
|
39
|
-
confirmMsg: '是否确定撤销提交',
|
|
40
|
+
confirmMsg: i18next.t('是否确定撤销提交'),
|
|
40
41
|
},
|
|
41
|
-
{ name: '审核', type: 'approve', authority: 'approve' },
|
|
42
|
+
{ name: i18next.t('审核'), type: 'approve', authority: 'approve' },
|
|
42
43
|
],
|
|
43
44
|
30: [
|
|
44
|
-
{ name: '修改', type: 'update', authority: 'add' },
|
|
45
|
+
{ name: i18next.t('修改'), type: 'update', authority: 'add' },
|
|
45
46
|
{
|
|
46
|
-
name: '作废',
|
|
47
|
+
name: i18next.t('作废'),
|
|
47
48
|
type: 'cancelLation',
|
|
48
49
|
authority: 'add',
|
|
49
|
-
confirmMsg: '是否确定作废?作废后单据不能再操作。',
|
|
50
|
+
confirmMsg: i18next.t('是否确定作废?作废后单据不能再操作。'),
|
|
50
51
|
},
|
|
51
|
-
{ name: '提交审核', type: 'submitApprove', authority: 'add' },
|
|
52
|
+
{ name: i18next.t('提交审核'), type: 'submitApprove', authority: 'add' },
|
|
52
53
|
],
|
|
53
54
|
50: [
|
|
54
55
|
{
|
|
55
|
-
name: '撤销审核',
|
|
56
|
+
name: i18next.t('撤销审核'),
|
|
56
57
|
type: 'cancelApprove',
|
|
57
58
|
authority: 'approve',
|
|
58
|
-
confirmMsg: '是否确定撤销审核?',
|
|
59
|
+
confirmMsg: i18next.t('是否确定撤销审核?'),
|
|
59
60
|
},
|
|
60
61
|
],
|
|
61
62
|
};
|
|
@@ -83,7 +84,7 @@ var OperationBtnGroup = function (_a) {
|
|
|
83
84
|
isAuth = canOperations;
|
|
84
85
|
}
|
|
85
86
|
if (btnConfig.confirmMsg) {
|
|
86
|
-
return (React.createElement(Popconfirm, { key: btnConfig.type, title: btnConfig.confirmMsg, cancelText:
|
|
87
|
+
return (React.createElement(Popconfirm, { key: btnConfig.type, title: btnConfig.confirmMsg, cancelText: i18next.t('否'), okText: i18next.t('是'), onConfirm: function () { return onClickHandle(btnConfig.type, id, isAuth); } },
|
|
87
88
|
React.createElement(Button, { type: "link", style: {
|
|
88
89
|
height: 28,
|
|
89
90
|
}, disabled: !isAuth }, btnConfig.name)));
|
|
@@ -20,7 +20,8 @@ export declare function getNewChildren(children: any): any;
|
|
|
20
20
|
*/
|
|
21
21
|
export declare function getSearchParams(storageKey: string, params: any, otherKeys?: any): any;
|
|
22
22
|
declare function useDynamic(children: React.ReactNode, isDynamic?: boolean, // 是否利用动态列配置
|
|
23
|
-
dynamicStorageKey?: string
|
|
23
|
+
dynamicStorageKey?: string, // 动态列配置的key值
|
|
24
|
+
rerender?: boolean): {
|
|
24
25
|
dynamicArr: ISearchLayout[];
|
|
25
26
|
initDynamicArr: ISearchLayout[];
|
|
26
27
|
newChildren: any;
|
|
@@ -124,8 +124,8 @@ export function getSearchParams(storageKey, params, otherKeys) {
|
|
|
124
124
|
return resultParams;
|
|
125
125
|
}
|
|
126
126
|
function useDynamic(children, isDynamic, // 是否利用动态列配置
|
|
127
|
-
dynamicStorageKey // 动态列配置的key值
|
|
128
|
-
) {
|
|
127
|
+
dynamicStorageKey, // 动态列配置的key值
|
|
128
|
+
rerender) {
|
|
129
129
|
/** 当前传入的组件排列顺序 */
|
|
130
130
|
var _a = useState([]), dynamicArr = _a[0], setDynamicArr = _a[1];
|
|
131
131
|
/** 初始化顺序,根据传入得组件children元素得到,重置时需要用到它 */
|
|
@@ -227,7 +227,10 @@ dynamicStorageKey // 动态列配置的key值
|
|
|
227
227
|
setDynamicArr(_currentDynamicList_1);
|
|
228
228
|
setInitDynamicArr(_initDynamicList_1);
|
|
229
229
|
}
|
|
230
|
-
|
|
230
|
+
// rerender 这个rerender只是为了触发effect,不要删掉。如果不触发的化,这个方法只会执行一次
|
|
231
|
+
// 导致一些问题
|
|
232
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
233
|
+
}, [children, dynamicStorageKey, isDynamic, rerender]);
|
|
231
234
|
return {
|
|
232
235
|
dynamicArr: dynamicArr,
|
|
233
236
|
initDynamicArr: initDynamicArr,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export default function useToggle(domRef: React.MutableRefObject<HTMLDivElement | null>, dynamicList: any, isToggle: any): {
|
|
2
|
+
export default function useToggle(domRef: React.MutableRefObject<HTMLDivElement | null>, dynamicList: any, isToggle: any, toggleNum: number, defaultToggle?: boolean): {
|
|
3
3
|
toggle: boolean;
|
|
4
4
|
setToggle: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
5
5
|
onToggleChange: () => void;
|
|
@@ -3,52 +3,71 @@
|
|
|
3
3
|
* @description 设置自动展开收起
|
|
4
4
|
*/
|
|
5
5
|
import { useEffect, useState, useCallback, useRef } from 'react';
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import useBaseContext from '../../../utils/useBaseContext';
|
|
7
|
+
export default function useToggle(domRef, dynamicList, isToggle, toggleNum, defaultToggle) {
|
|
8
|
+
var _a = useState(defaultToggle || false), toggle = _a[0], setToggle = _a[1];
|
|
8
9
|
var isHandle = useRef(false);
|
|
10
|
+
var getScaleFactor = useBaseContext().getScaleFactor;
|
|
11
|
+
var isDynamicArr = Array.isArray(dynamicList);
|
|
12
|
+
var dynamicListLength = isDynamicArr ? dynamicList.length : 0;
|
|
9
13
|
useEffect(function () {
|
|
10
14
|
if (domRef.current &&
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
isDynamicArr &&
|
|
16
|
+
dynamicListLength &&
|
|
13
17
|
isToggle &&
|
|
14
|
-
!isHandle.current
|
|
18
|
+
!isHandle.current &&
|
|
19
|
+
!defaultToggle) {
|
|
20
|
+
var scaleFactor = getScaleFactor();
|
|
15
21
|
var height = domRef.current.offsetHeight;
|
|
16
|
-
|
|
22
|
+
var maxHeight = toggleNum * (42 * Number(scaleFactor));
|
|
23
|
+
if (height >= maxHeight) {
|
|
17
24
|
setToggle(false);
|
|
18
|
-
domRef.current.style.cssText =
|
|
25
|
+
domRef.current.style.cssText = "max-height: " + maxHeight + "px;";
|
|
19
26
|
}
|
|
20
27
|
else {
|
|
21
28
|
setToggle(true);
|
|
22
29
|
domRef.current.style.cssText = 'max-height: 800px;';
|
|
23
30
|
}
|
|
24
31
|
}
|
|
25
|
-
}, [
|
|
32
|
+
}, [
|
|
33
|
+
domRef,
|
|
34
|
+
isDynamicArr,
|
|
35
|
+
dynamicListLength,
|
|
36
|
+
isToggle,
|
|
37
|
+
defaultToggle,
|
|
38
|
+
getScaleFactor,
|
|
39
|
+
toggleNum,
|
|
40
|
+
]);
|
|
26
41
|
var onToggleChange = useCallback(function () {
|
|
27
42
|
if (!domRef.current) {
|
|
28
43
|
return;
|
|
29
44
|
}
|
|
45
|
+
var scaleFactor = getScaleFactor();
|
|
30
46
|
isHandle.current = true;
|
|
47
|
+
var maxHeight = toggleNum * (42 * Number(scaleFactor));
|
|
31
48
|
if (toggle) {
|
|
32
49
|
setToggle(false);
|
|
33
|
-
domRef.current.style.cssText =
|
|
50
|
+
domRef.current.style.cssText = "max-height: " + maxHeight + "px;";
|
|
34
51
|
}
|
|
35
52
|
else {
|
|
36
53
|
setToggle(true);
|
|
37
54
|
domRef.current.style.cssText = 'max-height: 800px;';
|
|
38
55
|
}
|
|
39
|
-
}, [toggle, domRef]);
|
|
56
|
+
}, [toggle, domRef, toggleNum, getScaleFactor]);
|
|
40
57
|
var setToggleHandle = useCallback(function (toggle) {
|
|
41
58
|
if (!domRef.current) {
|
|
42
59
|
return;
|
|
43
60
|
}
|
|
61
|
+
var scaleFactor = getScaleFactor();
|
|
44
62
|
isHandle.current = true;
|
|
63
|
+
var maxHeight = toggleNum * (42 * Number(scaleFactor));
|
|
45
64
|
if (toggle) {
|
|
46
65
|
domRef.current.style.cssText = 'max-height: 800px;';
|
|
47
66
|
}
|
|
48
67
|
else {
|
|
49
|
-
domRef.current.style.cssText =
|
|
68
|
+
domRef.current.style.cssText = "max-height: " + maxHeight + "px;";
|
|
50
69
|
}
|
|
51
70
|
setToggle(toggle);
|
|
52
|
-
}, [domRef]);
|
|
71
|
+
}, [domRef, toggleNum, getScaleFactor]);
|
|
53
72
|
return { toggle: toggle, setToggle: setToggle, onToggleChange: onToggleChange, setToggleHandle: setToggleHandle };
|
|
54
73
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ISortableProps {
|
|
3
|
+
type: string | symbol;
|
|
4
|
+
onMoveItem: (dragIndex: number, hoverIndex: number) => void;
|
|
5
|
+
onMoveEnd?: () => void;
|
|
6
|
+
index: number;
|
|
7
|
+
id?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: any;
|
|
10
|
+
children?: any;
|
|
11
|
+
onClick?: any;
|
|
12
|
+
}
|
|
13
|
+
declare const Sortable: React.FC<ISortableProps>;
|
|
14
|
+
export default Sortable;
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
import React, { useRef } from 'react';
|
|
14
|
+
import classNames from 'classnames';
|
|
15
|
+
import { useDrag, useDrop } from 'react-dnd';
|
|
16
|
+
var Sortable = function (_a) {
|
|
17
|
+
var type = _a.type, onMoveItem = _a.onMoveItem, onMoveEnd = _a.onMoveEnd, index = _a.index, id = _a.id, children = _a.children, style = _a.style, className = _a.className, onClick = _a.onClick;
|
|
18
|
+
var ref = useRef(null);
|
|
19
|
+
var classes = classNames('record-common-sortable', className, {});
|
|
20
|
+
/**
|
|
21
|
+
* @description 定义可放置对象
|
|
22
|
+
*/
|
|
23
|
+
var _b = useDrop({
|
|
24
|
+
accept: type,
|
|
25
|
+
hover: function (item, monitor) {
|
|
26
|
+
var _a;
|
|
27
|
+
if (!ref.current) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// 当前拖动项索引
|
|
31
|
+
var dragIndex = item.index;
|
|
32
|
+
// 当前放置位置索引
|
|
33
|
+
var hoverIndex = index;
|
|
34
|
+
// 不要将项目本身替换
|
|
35
|
+
if (dragIndex === hoverIndex) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
// 获取当前项的位置信息
|
|
39
|
+
var hoverBoundingRect = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
40
|
+
// 元素高度的一半
|
|
41
|
+
var hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;
|
|
42
|
+
// 确定鼠标位置
|
|
43
|
+
var clientOffset = monitor.getClientOffset();
|
|
44
|
+
// 鼠标位置纵坐标 与 当前hover元素顶部位置差
|
|
45
|
+
var hoverClientY = clientOffset.y - hoverBoundingRect.top;
|
|
46
|
+
// 临界值判断
|
|
47
|
+
// 如果当前拖拽元素本身在当前放置元素之上 并且 鼠标位置与当前放置元素之差 要小于中间位置
|
|
48
|
+
if (dragIndex < hoverIndex && hoverClientY < hoverMiddleY) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
// 如果当前拖拽元素本身在当前放置元素之下 并且鼠标位置与当前放置元素之差要 大于 中间位置
|
|
52
|
+
if (dragIndex > hoverIndex && hoverClientY > hoverMiddleY) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
onMoveItem(dragIndex, hoverIndex);
|
|
56
|
+
item.index = hoverIndex;
|
|
57
|
+
},
|
|
58
|
+
}), drop = _b[1];
|
|
59
|
+
/**
|
|
60
|
+
* @description 定义可拖动对象
|
|
61
|
+
*/
|
|
62
|
+
var _c = useDrag({
|
|
63
|
+
type: type,
|
|
64
|
+
item: function () {
|
|
65
|
+
return { id: id, index: index };
|
|
66
|
+
},
|
|
67
|
+
collect: function (monitor) { return ({
|
|
68
|
+
isDragging: monitor.isDragging(),
|
|
69
|
+
}); },
|
|
70
|
+
end: function (item, monitor) {
|
|
71
|
+
if (!monitor.didDrop()) {
|
|
72
|
+
console.log(i18next.t('鼠标在非可放置区域松开(未放置)'));
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
onMoveEnd === null || onMoveEnd === void 0 ? void 0 : onMoveEnd();
|
|
76
|
+
console.log(i18next.t('鼠标在可放置区域松开(放置成功)'));
|
|
77
|
+
},
|
|
78
|
+
}), isDragging = _c[0].isDragging, drag = _c[1];
|
|
79
|
+
var opacity = isDragging ? 0 : 1;
|
|
80
|
+
drag(drop(ref));
|
|
81
|
+
return (React.createElement("div", { ref: ref, className: classes, style: __assign(__assign({}, style), { opacity: opacity }), onClick: onClick }, children));
|
|
82
|
+
};
|
|
83
|
+
export default Sortable;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import { Popconfirm } from '../../../index';
|
|
4
|
+
import { DeleteOutlined } from '@ant-design/icons';
|
|
5
|
+
import { useRecordCommonSearchContext } from './useRecordCommonSearchContext';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import { DndProvider } from 'react-dnd';
|
|
8
|
+
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
9
|
+
import RecordCommonItem from './record-common-item';
|
|
10
|
+
import useMemoizedFn from '../../utils/useMemoizedFn';
|
|
11
|
+
import update from 'immutability-helper';
|
|
12
|
+
import { SearchContainerContext, SearchContext } from './search-container';
|
|
13
|
+
var RecordCommonList = function () {
|
|
14
|
+
var _a = useRecordCommonSearchContext(), form = _a.form, recordCommonList = _a.recordCommonList, currentRecordCommonSearchKey = _a.currentRecordCommonSearchKey, setCurrentRecordCommonSearchKey = _a.setCurrentRecordCommonSearchKey, deleteData = _a.deleteData, reTransformData = _a.reTransformData, setReplaceData = _a.setReplaceData, updateServerData = _a.updateServerData;
|
|
15
|
+
var dynamicRef = useContext(SearchContext).dynamicRef;
|
|
16
|
+
var rightSearchHandleRef = React.useContext(SearchContainerContext).rightSearchHandleRef;
|
|
17
|
+
var handleClick = function (item) {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
if (currentRecordCommonSearchKey === item.key) {
|
|
20
|
+
setCurrentRecordCommonSearchKey === null || setCurrentRecordCommonSearchKey === void 0 ? void 0 : setCurrentRecordCommonSearchKey('');
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
setCurrentRecordCommonSearchKey === null || setCurrentRecordCommonSearchKey === void 0 ? void 0 : setCurrentRecordCommonSearchKey(item.key);
|
|
24
|
+
// // 更新配置
|
|
25
|
+
if (item.dynamicList) {
|
|
26
|
+
(_b = (_a = dynamicRef.current) === null || _a === void 0 ? void 0 : _a.onSure) === null || _b === void 0 ? void 0 : _b.call(_a, item.dynamicList, {
|
|
27
|
+
isNotSaveToServer: true,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
// dynamicRef.current?.setDynamicList?.(item.dynamicList || []);
|
|
31
|
+
// const dynamicStorageKey = dynamicRef.current?.dynamicStorageKey;
|
|
32
|
+
// if (dynamicStorageKey) {
|
|
33
|
+
// setDynamicKey(dynamicStorageKey, item.dynamicList || []);
|
|
34
|
+
// }
|
|
35
|
+
// // 更新配置
|
|
36
|
+
// 增加一些延迟,以便能给表单设置上值
|
|
37
|
+
setTimeout(function () {
|
|
38
|
+
var _a, _b, _c;
|
|
39
|
+
var formData = reTransformData === null || reTransformData === void 0 ? void 0 : reTransformData(item.value, item.timeKeys);
|
|
40
|
+
// 遍历表单动态列表,将 show 为 true 的字段,保留在 formData 中
|
|
41
|
+
(_b = (_a = item === null || item === void 0 ? void 0 : item.dynamicList) === null || _a === void 0 ? void 0 : _a.forEach) === null || _b === void 0 ? void 0 : _b.call(_a, function (formItem) {
|
|
42
|
+
if (formItem.show) {
|
|
43
|
+
if (formData.hasOwnProperty(formItem.name)) {
|
|
44
|
+
// 只要 formData 里有这个字段(包括 null 或空字符串),就保留;否则置为 undefined
|
|
45
|
+
formData[formItem.name] = formData[formItem.name];
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
formData[formItem.name] = undefined;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
form === null || form === void 0 ? void 0 : form.setFieldsValue(formData);
|
|
53
|
+
// 触发查询事件
|
|
54
|
+
(_c = rightSearchHandleRef === null || rightSearchHandleRef === void 0 ? void 0 : rightSearchHandleRef.current) === null || _c === void 0 ? void 0 : _c.call(rightSearchHandleRef);
|
|
55
|
+
}, 100);
|
|
56
|
+
};
|
|
57
|
+
var deleteItem = function (index) {
|
|
58
|
+
deleteData === null || deleteData === void 0 ? void 0 : deleteData(index);
|
|
59
|
+
};
|
|
60
|
+
var onMoveItem = useMemoizedFn(function (dragIndex, hoverIndex) {
|
|
61
|
+
// 由于对于固定列,不能进行拖拽排序,所以需要找出所有包含固定列的属性出来
|
|
62
|
+
var dragCard = recordCommonList[dragIndex];
|
|
63
|
+
var currentList = update(recordCommonList, {
|
|
64
|
+
$splice: [
|
|
65
|
+
[dragIndex, 1],
|
|
66
|
+
[hoverIndex, 0, dragCard],
|
|
67
|
+
],
|
|
68
|
+
});
|
|
69
|
+
setReplaceData === null || setReplaceData === void 0 ? void 0 : setReplaceData(currentList);
|
|
70
|
+
});
|
|
71
|
+
var onMoveEnd = useMemoizedFn(function () {
|
|
72
|
+
updateServerData === null || updateServerData === void 0 ? void 0 : updateServerData();
|
|
73
|
+
});
|
|
74
|
+
return recordCommonList.length > 0 ? (React.createElement("div", { className: "record-common-list--container" },
|
|
75
|
+
React.createElement("div", { className: "record-common-list--title" }, i18next.t('常用搜索')),
|
|
76
|
+
React.createElement("div", { className: "record-common-list--item--container" },
|
|
77
|
+
React.createElement(DndProvider, { backend: HTML5Backend, context: window }, recordCommonList.map(function (item, index) { return (React.createElement(RecordCommonItem, { type: "record-common-item", key: item.key, onMoveItem: onMoveItem, onMoveEnd: onMoveEnd, index: index, className: classNames('record-common-list--item', {
|
|
78
|
+
'record-common-list--item--active': currentRecordCommonSearchKey === item.key,
|
|
79
|
+
}), onClick: function () {
|
|
80
|
+
handleClick(item);
|
|
81
|
+
// rightSearchHandleRef?.current?.();
|
|
82
|
+
} },
|
|
83
|
+
React.createElement("div", { className: "record-common-list--item--title", title: item.title }, item.title),
|
|
84
|
+
React.createElement(Popconfirm, { title: i18next.t('确认删除吗?'), onConfirm: function (e) {
|
|
85
|
+
var _a, _b;
|
|
86
|
+
(_a = e === null || e === void 0 ? void 0 : e.preventDefault) === null || _a === void 0 ? void 0 : _a.call(e);
|
|
87
|
+
(_b = e === null || e === void 0 ? void 0 : e.stopPropagation) === null || _b === void 0 ? void 0 : _b.call(e);
|
|
88
|
+
deleteItem === null || deleteItem === void 0 ? void 0 : deleteItem(index);
|
|
89
|
+
if (item.key === currentRecordCommonSearchKey) {
|
|
90
|
+
setCurrentRecordCommonSearchKey === null || setCurrentRecordCommonSearchKey === void 0 ? void 0 : setCurrentRecordCommonSearchKey('');
|
|
91
|
+
}
|
|
92
|
+
}, onCancel: function (e) { var _a; return (_a = e === null || e === void 0 ? void 0 : e.stopPropagation) === null || _a === void 0 ? void 0 : _a.call(e); } },
|
|
93
|
+
React.createElement(DeleteOutlined, { onClick: function (e) { var _a; return (_a = e === null || e === void 0 ? void 0 : e.stopPropagation) === null || _a === void 0 ? void 0 : _a.call(e); }, className: "record-common-list--delete" })))); }))))) : null;
|
|
94
|
+
};
|
|
95
|
+
export default RecordCommonList;
|
|
@@ -3,6 +3,28 @@ export interface ISearchContainerProps {
|
|
|
3
3
|
dark?: boolean;
|
|
4
4
|
nobottom?: boolean;
|
|
5
5
|
className?: string;
|
|
6
|
+
/** 是否不显示自定义按钮 */
|
|
7
|
+
hideDynamic?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* 容器item子组件回车行为
|
|
10
|
+
* 可以通过外部传入搜索事件的模式,不推荐
|
|
11
|
+
* 暂时保留,可以当成后续的一些补充(不止回车查询,也可以回车提交之类的)
|
|
12
|
+
*/
|
|
13
|
+
onItemEnterHandle?: any;
|
|
14
|
+
form?: any;
|
|
15
|
+
recordCommonSearch?: boolean;
|
|
6
16
|
}
|
|
17
|
+
export declare const SearchContainerContext: React.Context<{
|
|
18
|
+
/** 子元素回车行为 */
|
|
19
|
+
onItemEnterHandle?: any;
|
|
20
|
+
rightSearchHandleRef?: any;
|
|
21
|
+
}>;
|
|
22
|
+
interface ISearContext {
|
|
23
|
+
showDynamicRef: any;
|
|
24
|
+
setDynamicVisibleRef: any;
|
|
25
|
+
dynamicRef: any;
|
|
26
|
+
hideDynamic?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare const SearchContext: React.Context<ISearContext>;
|
|
7
29
|
declare const SearchContainer: React.FC<ISearchContainerProps>;
|
|
8
30
|
export default SearchContainer;
|
|
@@ -20,16 +20,79 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import React from 'react';
|
|
23
|
+
import React, { createContext, useRef, useContext } from 'react';
|
|
24
24
|
import classNames from 'classnames';
|
|
25
|
+
import useMemoizedFn from '../../utils/useMemoizedFn';
|
|
26
|
+
import { RecordCommonSearchContext } from './useRecordCommonSearchContext';
|
|
27
|
+
import RecordCommonList from './record-common-list';
|
|
28
|
+
import useRecordCommonInit from './useRecordCommonInit';
|
|
29
|
+
import { FormContext } from '../../Form/form';
|
|
30
|
+
import useBaseContext from '../../utils/useBaseContext';
|
|
31
|
+
import { getFinalValue } from '../../utils';
|
|
32
|
+
// 搜索容器上下文
|
|
33
|
+
export var SearchContainerContext = React.createContext({});
|
|
34
|
+
export var SearchContext = createContext({
|
|
35
|
+
showDynamicRef: {},
|
|
36
|
+
setDynamicVisibleRef: {},
|
|
37
|
+
dynamicRef: {},
|
|
38
|
+
hideDynamic: false,
|
|
39
|
+
});
|
|
25
40
|
var SearchContainer = function (_a) {
|
|
26
|
-
var children = _a.children, dark = _a.dark, nobottom = _a.nobottom, className = _a.className, restProps = __rest(_a, ["children", "dark", "nobottom", "className"]);
|
|
41
|
+
var children = _a.children, dark = _a.dark, nobottom = _a.nobottom, className = _a.className, onItemEnterHandle = _a.onItemEnterHandle, form = _a.form, recordCommonSearch = _a.recordCommonSearch, hideDynamic = _a.hideDynamic, restProps = __rest(_a, ["children", "dark", "nobottom", "className", "onItemEnterHandle", "form", "recordCommonSearch", "hideDynamic"]);
|
|
42
|
+
var _b = useBaseContext(), isRecordCommonSearch = _b.isRecordCommonSearch, isUIWeeklyReview = _b.isUIWeeklyReview;
|
|
27
43
|
var classes = classNames('zt-search', className, {
|
|
28
44
|
// 他们一开始觉得背景色可以,后来觉得不可以 要去掉
|
|
29
45
|
// 'zt-search--dark': dark,
|
|
30
46
|
// 'zt-search--no-bottom': dark || nobottom,
|
|
31
47
|
'zt-search--no-bottom': nobottom,
|
|
48
|
+
'zt-search--weekly-review': isUIWeeklyReview,
|
|
32
49
|
});
|
|
33
|
-
|
|
50
|
+
var onItemEnterHandleMemo = useMemoizedFn(onItemEnterHandle);
|
|
51
|
+
var rightSearchHandleRef = useRef();
|
|
52
|
+
var showDynamicRef = useRef(false);
|
|
53
|
+
var setDynamicVisibleRef = useRef(null);
|
|
54
|
+
var dynamicRef = useRef(null);
|
|
55
|
+
// 是否开启常用搜索
|
|
56
|
+
// 如果全局开启了默认添加,那么只要没有单独配置关闭,都认为需要打开
|
|
57
|
+
var isCommonSearchEnabled = getFinalValue(isRecordCommonSearch, recordCommonSearch);
|
|
58
|
+
// 获取form
|
|
59
|
+
var ParentForm = useContext(FormContext).form;
|
|
60
|
+
var currentForm = form || ParentForm;
|
|
61
|
+
var _c = useRecordCommonInit(), storageRef = _c.storageRef, recordCommonSearchStorageKey = _c.recordCommonSearchStorageKey, setRecordCommonSearchStorageKey = _c.setRecordCommonSearchStorageKey, recordCommonList = _c.recordCommonList, setRecordCommonList = _c.setRecordCommonList, currentRecordCommonSearchKey = _c.currentRecordCommonSearchKey, setCurrentRecordCommonSearchKey = _c.setCurrentRecordCommonSearchKey, setData = _c.setData, deleteData = _c.deleteData, setReplaceData = _c.setReplaceData, reTransformData = _c.reTransformData, updateServerData = _c.updateServerData, hasSearchButton = _c.hasSearchButton, setHasSearchButton = _c.setHasSearchButton;
|
|
62
|
+
return (React.createElement(SearchContainerContext.Provider, { value: {
|
|
63
|
+
onItemEnterHandle: onItemEnterHandleMemo,
|
|
64
|
+
rightSearchHandleRef: rightSearchHandleRef,
|
|
65
|
+
} },
|
|
66
|
+
React.createElement(SearchContext.Provider, { value: {
|
|
67
|
+
showDynamicRef: showDynamicRef,
|
|
68
|
+
setDynamicVisibleRef: setDynamicVisibleRef,
|
|
69
|
+
dynamicRef: dynamicRef,
|
|
70
|
+
hideDynamic: hideDynamic,
|
|
71
|
+
} },
|
|
72
|
+
React.createElement(RecordCommonSearchContext.Provider, { value: {
|
|
73
|
+
form: form,
|
|
74
|
+
recordCommonSearch: isCommonSearchEnabled &&
|
|
75
|
+
currentForm &&
|
|
76
|
+
recordCommonSearchStorageKey,
|
|
77
|
+
recordCommonSearchStorageKey: recordCommonSearchStorageKey,
|
|
78
|
+
setRecordCommonSearchStorageKey: setRecordCommonSearchStorageKey,
|
|
79
|
+
storageRef: storageRef,
|
|
80
|
+
recordCommonList: recordCommonList,
|
|
81
|
+
setRecordCommonList: setRecordCommonList,
|
|
82
|
+
currentRecordCommonSearchKey: currentRecordCommonSearchKey,
|
|
83
|
+
setCurrentRecordCommonSearchKey: setCurrentRecordCommonSearchKey,
|
|
84
|
+
setData: setData,
|
|
85
|
+
deleteData: deleteData,
|
|
86
|
+
setReplaceData: setReplaceData,
|
|
87
|
+
reTransformData: reTransformData,
|
|
88
|
+
updateServerData: updateServerData,
|
|
89
|
+
setHasSearchButton: setHasSearchButton,
|
|
90
|
+
} },
|
|
91
|
+
React.createElement("div", __assign({ className: classes }, restProps), children),
|
|
92
|
+
isCommonSearchEnabled &&
|
|
93
|
+
currentForm &&
|
|
94
|
+
recordCommonSearchStorageKey &&
|
|
95
|
+
hasSearchButton &&
|
|
96
|
+
showDynamicRef.current ? (React.createElement(RecordCommonList, null)) : null))));
|
|
34
97
|
};
|
|
35
98
|
export default SearchContainer;
|