ztxkui 4.2.18-21 → 4.2.18-220
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.js +315 -291
- package/dist/Demo.js +64 -43
- package/dist/DemoCom/BasicDemo.js +57 -56
- package/dist/DemoCom/CodeQueryDemo.js +3 -2
- package/dist/DemoCom/CollapseDemo.js +28 -27
- package/dist/DemoCom/DragSort.js +11 -10
- package/dist/DemoCom/FormDemo.js +36 -30
- package/dist/DemoCom/PrintContainerDemo.js +151 -150
- package/dist/DemoCom/PrintDemo.js +15 -14
- package/dist/DemoCom/SinaturesDemo.js +9 -8
- package/dist/DemoCom/SyhDemo.js +21 -20
- package/dist/DemoCom/TableAnalyse.js +34 -33
- package/dist/DemoCom/TableDemo.js +73 -69
- package/dist/DemoCom/TableDemo1.js +84 -34
- package/dist/DemoCom/TableDetail.d.ts +9 -0
- package/dist/DemoCom/TableDetail.js +259 -0
- package/dist/DemoCom/TestCom.js +22 -19
- package/dist/DemoCom/data.d.ts +110 -0
- package/dist/DemoCom/data.js +2308 -0
- package/dist/TableDemo/BasicTable.js +225 -25
- package/dist/TableDemo/EditableTable.js +146 -72
- package/dist/TableDemo/ModalTable.js +25 -24
- package/dist/TableDemo/ProEditableTable.js +30 -29
- package/dist/TableDemo/data.d.ts +34 -0
- package/dist/TableDemo/data.js +387 -10
- package/dist/TableDemo/index.js +3 -3
- package/dist/TreeDemo.js +8 -7
- package/dist/TreeSelectDemo.js +12 -8
- package/dist/UI/Form/index.d.ts +3 -0
- package/dist/UI/Form/index.js +347 -0
- package/dist/UI/Input/index.d.ts +17 -0
- package/dist/UI/Input/index.js +74 -0
- package/dist/UI/InputNumber/index.d.ts +3 -0
- package/dist/UI/InputNumber/index.js +45 -0
- package/dist/UI/OldForm/index.d.ts +9 -0
- package/dist/UI/OldForm/index.js +302 -0
- package/dist/UI/Select/EmpForQuitDemo.d.ts +15 -0
- package/dist/UI/Select/EmpForQuitDemo.js +120 -0
- package/dist/UI/Select/index.d.ts +10 -0
- package/dist/UI/Select/index.js +207 -0
- package/dist/UI/Table/BusinessListDemo.d.ts +15 -0
- package/dist/UI/Table/BusinessListDemo.js +227 -0
- package/dist/UI/Table/BusinessMemberDemo.d.ts +18 -0
- package/dist/UI/Table/BusinessMemberDemo.js +181 -0
- package/dist/UI/Table/index.d.ts +10 -0
- package/dist/UI/Table/index.js +850 -0
- package/dist/UI/TreeSelect/index.d.ts +3 -0
- package/dist/UI/TreeSelect/index.js +120 -0
- package/dist/UI/index.d.ts +2 -0
- package/dist/UI/index.js +34 -0
- package/dist/UploadDemo.js +27 -23
- package/dist/components/Button/button.d.ts +6 -0
- package/dist/components/Button/button.js +11 -4
- package/dist/components/Collapse/collapse.js +2 -1
- package/dist/components/DatePicker/data-picker.d.ts +3 -1
- package/dist/components/EnhanceSelect/index.d.ts +11 -1
- package/dist/components/EnhanceSelect/index.js +231 -49
- package/dist/components/EnhanceTree/index.js +4 -3
- package/dist/components/EnhanceTreeSelect/index.d.ts +5 -1
- package/dist/components/EnhanceTreeSelect/index.js +57 -7
- package/dist/components/Export/export.js +5 -4
- package/dist/components/Form/form.d.ts +11 -1
- package/dist/components/Form/form.js +5 -3
- package/dist/components/Input/input.d.ts +5 -3
- package/dist/components/Input/input.js +72 -3
- package/dist/components/InputNumber/input-number.js +3 -2
- package/dist/components/Layout/layout.d.ts +4 -4
- package/dist/components/Menu/menu.d.ts +1 -1
- package/dist/components/NumberCase/index.js +9 -7
- package/dist/components/Print/print.js +4 -3
- package/dist/components/PrintContainer/AttachPreviewModal.js +3 -2
- package/dist/components/PrintContainer/PrintModal.js +4 -3
- package/dist/components/PrintContainer/handle.d.ts +2 -4
- package/dist/components/PrintContainer/handle.js +3 -2
- package/dist/components/PrintContainer/lodop.js +2 -1
- package/dist/components/PrintContainer/print-container.js +74 -73
- package/dist/components/PrintContainer/service.js +5 -4
- package/dist/components/ProForm/hooks.d.ts +23 -0
- package/dist/components/ProForm/hooks.js +209 -0
- package/dist/components/ProForm/index.d.ts +9 -0
- package/dist/components/ProForm/index.js +168 -0
- package/dist/components/ProForm/interface.d.ts +200 -0
- package/dist/components/ProForm/interface.js +1 -0
- package/dist/components/ProForm/item.d.ts +13 -0
- package/dist/components/ProForm/item.js +222 -0
- package/dist/components/ProForm/items.d.ts +5 -0
- package/dist/components/ProForm/items.js +36 -0
- package/dist/components/ProForm/record-common-list.d.ts +18 -0
- package/dist/components/ProForm/record-common-list.js +83 -0
- package/dist/components/ProForm/search-drawer.d.ts +14 -0
- package/dist/components/ProForm/search-drawer.js +237 -0
- package/dist/components/ProForm/setting.d.ts +5 -0
- package/dist/components/ProForm/setting.js +12 -0
- package/dist/components/ProForm/useCommonSearch.d.ts +35 -0
- package/dist/components/ProForm/useCommonSearch.js +352 -0
- package/dist/components/ProFormList/index.d.ts +12 -0
- package/dist/components/ProFormList/index.js +34 -0
- package/dist/components/RangePicker/range-picker.js +5 -2
- package/dist/components/SortableCancel/sortable-cancel.d.ts +1 -0
- package/dist/components/SortableCancel/sortable-cancel.js +2 -2
- package/dist/components/Table/components/FillDown.js +2 -1
- package/dist/components/Table/components/FilterDropdown.d.ts +1 -0
- package/dist/components/Table/components/FilterDropdown.js +36 -12
- package/dist/components/Table/hooks/useColumns.d.ts +5 -0
- package/dist/components/Table/hooks/useColumns.js +396 -22
- package/dist/components/Table/hooks/useDropRef.js +2 -1
- package/dist/components/Table/hooks/useScuRfresh.d.ts +3 -0
- package/dist/components/Table/hooks/useScuRfresh.js +22 -0
- package/dist/components/Table/hooks/useSelectSubtotal.js +5 -1
- package/dist/components/Table/hooks/useVituralScrollBar.d.ts +10 -0
- package/dist/components/Table/hooks/useVituralScrollBar.js +234 -0
- package/dist/components/Table/index.d.ts +4 -0
- package/dist/components/Table/table-adddel-column.js +4 -3
- package/dist/components/Table/table-dynamic.d.ts +1 -0
- package/dist/components/Table/table-dynamic.js +447 -60
- package/dist/components/Table/table-enhance-cell.d.ts +3 -0
- package/dist/components/Table/table-enhance-cell.js +28 -8
- package/dist/components/Table/table-menu.d.ts +7 -0
- package/dist/components/Table/table-menu.js +359 -0
- package/dist/components/Table/table-resizable-title.js +1 -0
- package/dist/components/Table/table-sort.js +4 -3
- package/dist/components/Table/table.d.ts +16 -0
- package/dist/components/Table/table.js +241 -65
- package/dist/components/Table/utils/dom.js +2 -1
- package/dist/components/Table/utils/filterHandle.d.ts +1 -1
- package/dist/components/Table/utils/filterHandle.js +27 -12
- package/dist/components/Table/utils/getSummaryData.d.ts +1 -1
- package/dist/components/Table/utils/getSummaryData.js +279 -24
- package/dist/components/Table/utils/shallowEqual.js +2 -1
- package/dist/components/Table/utils/validate.js +25 -6
- package/dist/components/Tabs/tabs.d.ts +2 -0
- package/dist/components/Tabs/tabs.js +3 -1
- package/dist/components/TranslationButton/DownFile.d.ts +7 -0
- package/dist/components/TranslationButton/DownFile.js +95 -0
- package/dist/components/TranslationButton/PreviewFile.d.ts +5 -0
- package/dist/components/TranslationButton/PreviewFile.js +73 -0
- package/dist/components/TranslationButton/TranslationButton.d.ts +34 -0
- package/dist/components/TranslationButton/TranslationButton.js +245 -0
- package/dist/components/TranslationButton/hooks.d.ts +8 -0
- package/dist/components/TranslationButton/hooks.js +139 -0
- package/dist/components/TranslationButton/index.d.ts +4 -0
- package/dist/components/TranslationButton/index.js +4 -0
- package/dist/components/TreeSelect/index.d.ts +19 -0
- package/dist/components/TreeSelect/index.js +88 -0
- package/dist/components/Upload/upload-table.js +31 -26
- package/dist/components/Upload/upload.d.ts +20 -1
- package/dist/components/Upload/upload.js +172 -27
- package/dist/components/Upload/utils.d.ts +9 -2
- package/dist/components/Upload/utils.js +153 -38
- package/dist/components/UploadCustom/hooks/useDg.d.ts +6 -0
- package/dist/components/UploadCustom/hooks/useDg.js +55 -0
- package/dist/components/UploadSingle/upload-single.js +5 -4
- package/dist/components/Watermark/index.d.ts +2 -0
- package/dist/components/Watermark/index.js +2 -0
- package/dist/components/Watermark/interface.d.ts +20 -0
- package/dist/components/Watermark/interface.js +1 -0
- package/dist/components/Watermark/utils.d.ts +1 -0
- package/dist/components/Watermark/utils.js +70 -0
- package/dist/components/Watermark/water.d.ts +50 -0
- package/dist/components/Watermark/water.js +66 -0
- package/dist/components/Watermark/watermark-div.d.ts +4 -0
- package/dist/components/Watermark/watermark-div.js +41 -0
- package/dist/components/Watermark/watermark-shadow.d.ts +6 -0
- package/dist/components/Watermark/watermark-shadow.js +116 -0
- package/dist/components/Watermark/watermark.d.ts +3 -0
- package/dist/components/Watermark/watermark.js +102 -0
- package/dist/components/WorkflowPrintContainer/component/Gragh/Gragh.d.ts +9 -0
- package/dist/components/WorkflowPrintContainer/component/Gragh/Gragh.js +63 -0
- package/dist/components/WorkflowPrintContainer/component/Header.d.ts +12 -0
- package/dist/components/WorkflowPrintContainer/component/Header.js +109 -0
- package/dist/components/WorkflowPrintContainer/component/ProcessDetail.d.ts +18 -0
- package/dist/components/WorkflowPrintContainer/component/ProcessDetail.js +243 -0
- package/dist/components/WorkflowPrintContainer/component/Upload/index.d.ts +20 -0
- package/dist/components/WorkflowPrintContainer/component/Upload/index.js +59 -0
- package/dist/components/WorkflowPrintContainer/component/association/component/TableList.d.ts +10 -0
- package/dist/components/WorkflowPrintContainer/component/association/component/TableList.js +75 -0
- package/dist/components/WorkflowPrintContainer/component/association/index.d.ts +9 -0
- package/dist/components/WorkflowPrintContainer/component/association/index.js +92 -0
- package/dist/components/WorkflowPrintContainer/component/attention/component/TableList.d.ts +9 -0
- package/dist/components/WorkflowPrintContainer/component/attention/component/TableList.js +38 -0
- package/dist/components/WorkflowPrintContainer/component/attention/index.d.ts +10 -0
- package/dist/components/WorkflowPrintContainer/component/attention/index.js +95 -0
- package/dist/components/WorkflowPrintContainer/component/audit/component/TableList.d.ts +8 -0
- package/dist/components/WorkflowPrintContainer/component/audit/component/TableList.js +53 -0
- package/dist/components/WorkflowPrintContainer/component/audit/index.d.ts +7 -0
- package/dist/components/WorkflowPrintContainer/component/audit/index.js +88 -0
- package/dist/components/WorkflowPrintContainer/component/previewTable/component/TableList.d.ts +9 -0
- package/dist/components/WorkflowPrintContainer/component/previewTable/component/TableList.js +53 -0
- package/dist/components/WorkflowPrintContainer/component/previewTable/index.d.ts +11 -0
- package/dist/components/WorkflowPrintContainer/component/previewTable/index.js +60 -0
- package/dist/components/WorkflowPrintContainer/component/send/component/TableList.d.ts +9 -0
- package/dist/components/WorkflowPrintContainer/component/send/component/TableList.js +50 -0
- package/dist/components/WorkflowPrintContainer/component/send/index.d.ts +9 -0
- package/dist/components/WorkflowPrintContainer/component/send/index.js +92 -0
- package/dist/components/WorkflowPrintContainer/component/trail/component/TableList.d.ts +12 -0
- package/dist/components/WorkflowPrintContainer/component/trail/component/TableList.js +282 -0
- package/dist/components/WorkflowPrintContainer/component/trail/index.d.ts +11 -0
- package/dist/components/WorkflowPrintContainer/component/trail/index.js +56 -0
- package/dist/components/WorkflowPrintContainer/images.d.ts +2 -0
- package/dist/components/WorkflowPrintContainer/images.js +2 -0
- package/dist/components/WorkflowPrintContainer/index.d.ts +2 -0
- package/dist/components/WorkflowPrintContainer/index.js +2 -0
- package/dist/components/WorkflowPrintContainer/service.d.ts +14 -0
- package/dist/components/WorkflowPrintContainer/service.js +101 -0
- package/dist/components/WorkflowPrintContainer/usePagination.d.ts +14 -0
- package/dist/components/WorkflowPrintContainer/usePagination.js +22 -0
- package/dist/components/WorkflowPrintContainer/workflow-print-container.d.ts +100 -0
- package/dist/components/WorkflowPrintContainer/workflow-print-container.js +236 -0
- package/dist/components/ZtIcon/index.js +2 -0
- package/dist/components/business/Analyse/index.js +12 -11
- package/dist/components/business/CodeQuery/component/SearchForm.js +3 -2
- package/dist/components/business/CodeQuery/component/TableList.js +5 -4
- package/dist/components/business/CodeQuery/hooks.js +2 -1
- package/dist/components/business/CodeQuery/index.js +2 -1
- package/dist/components/business/Common/UserForgetPassword/index.js +36 -28
- package/dist/components/business/Common/UserInfo/component/MakingForm.js +11 -10
- package/dist/components/business/Common/UserInfo/index.js +5 -4
- package/dist/components/business/Common/UserPassword/index.js +14 -11
- package/dist/components/business/Common/validatePassword.d.ts +1 -1
- package/dist/components/business/Common/validatePassword.js +17 -7
- package/dist/components/business/DetailCard/index.js +7 -6
- package/dist/components/business/DetailHeader/index.js +7 -6
- package/dist/components/business/DetailList/index.js +5 -4
- package/dist/components/business/DgColumns/index.js +12 -11
- package/dist/components/business/ExportButton/index.js +6 -5
- package/dist/components/business/Footer/index.js +4 -1
- package/dist/components/business/GridList/item.d.ts +1 -1
- package/dist/components/business/List/item.d.ts +1 -1
- package/dist/components/business/NewList/item.d.ts +1 -1
- package/dist/components/business/NewList/item.js +1 -1
- package/dist/components/business/OperationBtnGroup/index.js +17 -16
- package/dist/components/business/SearchContainer/hooks/useDynamic.d.ts +2 -1
- package/dist/components/business/SearchContainer/hooks/useDynamic.js +6 -3
- package/dist/components/business/SearchContainer/hooks/useToggle.d.ts +1 -1
- package/dist/components/business/SearchContainer/hooks/useToggle.js +31 -12
- package/dist/components/business/SearchContainer/record-common-item.d.ts +14 -0
- package/dist/components/business/SearchContainer/record-common-item.js +83 -0
- package/dist/components/business/SearchContainer/record-common-list.d.ts +3 -0
- package/dist/components/business/SearchContainer/record-common-list.js +95 -0
- package/dist/components/business/SearchContainer/search-container.d.ts +22 -0
- package/dist/components/business/SearchContainer/search-container.js +66 -3
- package/dist/components/business/SearchContainer/search-drawer.d.ts +1 -0
- package/dist/components/business/SearchContainer/search-drawer.js +167 -13
- package/dist/components/business/SearchContainer/search-item.js +48 -5
- package/dist/components/business/SearchContainer/search-left.d.ts +8 -0
- package/dist/components/business/SearchContainer/search-left.js +105 -68
- package/dist/components/business/SearchContainer/search-right.d.ts +4 -0
- package/dist/components/business/SearchContainer/search-right.js +62 -5
- package/dist/components/business/SearchContainer/useRecordCommonInit.d.ts +18 -0
- package/dist/components/business/SearchContainer/useRecordCommonInit.js +258 -0
- package/dist/components/business/SearchContainer/useRecordCommonSearch.d.ts +8 -0
- package/dist/components/business/SearchContainer/useRecordCommonSearch.js +145 -0
- package/dist/components/business/SearchContainer/useRecordCommonSearchContext.d.ts +37 -0
- package/dist/components/business/SearchContainer/useRecordCommonSearchContext.js +8 -0
- package/dist/components/business/SearchContainer/useTemplate.d.ts +20 -0
- package/dist/components/business/SearchContainer/useTemplate.js +347 -0
- package/dist/components/business/Signatures/components/AttachOperation.js +7 -6
- package/dist/components/business/Signatures/components/CodeModal.d.ts +3 -0
- package/dist/components/business/Signatures/components/CodeModal.js +157 -0
- package/dist/components/business/Signatures/components/CompareResult.js +7 -6
- package/dist/components/business/Signatures/components/DetailTable.js +37 -34
- package/dist/components/business/Signatures/components/QunjSeal.js +5 -4
- package/dist/components/business/Signatures/components/SealCheckbox.js +3 -2
- package/dist/components/business/Signatures/components/TemplateAttach.js +2 -1
- package/dist/components/business/Signatures/index.js +64 -53
- package/dist/components/business/SortList/sort-drawer.js +5 -4
- package/dist/components/business/Template/index.js +11 -10
- package/dist/components/electron-signatures/content.d.ts +9 -0
- package/dist/components/electron-signatures/content.js +1146 -0
- package/dist/components/electron-signatures/demoComponents/coUseDetail.d.ts +8 -0
- package/dist/components/electron-signatures/demoComponents/coUseDetail.js +255 -0
- package/dist/components/electron-signatures/demoComponents/data.d.ts +58 -0
- package/dist/components/electron-signatures/demoComponents/data.js +1307 -0
- package/dist/components/electron-signatures/demoComponents/detail.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/detail.js +283 -0
- package/dist/components/electron-signatures/demoComponents/index.d.ts +2 -0
- package/dist/components/electron-signatures/demoComponents/index.js +30 -0
- package/dist/components/electron-signatures/demoComponents/jgqrd.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/jgqrd.js +135 -0
- package/dist/components/electron-signatures/demoComponents/making.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/making.js +211 -0
- package/dist/components/electron-signatures/demoComponents/makingData.d.ts +675 -0
- package/dist/components/electron-signatures/demoComponents/makingData.js +1178 -0
- package/dist/components/electron-signatures/demoComponents/newDetail.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/newDetail.js +283 -0
- package/dist/components/electron-signatures/demoComponents/preview.d.ts +3 -0
- package/dist/components/electron-signatures/demoComponents/preview.js +9 -0
- package/dist/components/electron-signatures/demoComponents/singleQjDetail.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/singleQjDetail.js +530 -0
- package/dist/components/electron-signatures/demoComponents/singleQjMaking.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/singleQjMaking.js +219 -0
- package/dist/components/electron-signatures/demoComponents/test.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/test.js +119 -0
- package/dist/components/electron-signatures/dgComponents/contract-comparison.d.ts +39 -0
- package/dist/components/electron-signatures/dgComponents/contract-comparison.js +53 -0
- package/dist/components/electron-signatures/dgComponents/file-comparison-btn.d.ts +11 -0
- package/dist/components/electron-signatures/dgComponents/file-comparison-btn.js +180 -0
- package/dist/components/electron-signatures/dgComponents/new-contract-comparison.d.ts +45 -0
- package/dist/components/electron-signatures/dgComponents/new-contract-comparison.js +68 -0
- package/dist/components/electron-signatures/dgComponents/useContractColumns.d.ts +21 -0
- package/dist/components/electron-signatures/dgComponents/useContractColumns.js +171 -0
- package/dist/components/electron-signatures/electron-signatures-fragment.d.ts +8 -0
- package/dist/components/electron-signatures/electron-signatures-fragment.js +392 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-batch-download.d.ts +52 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-batch-download.js +509 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-detail.d.ts +8 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-detail.js +59 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-download.d.ts +16 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-download.js +85 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-firstLevelPerson.d.ts +9 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-firstLevelPerson.js +16 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item-detail.d.ts +15 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item-detail.js +16 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item.d.ts +20 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item.js +47 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-list.d.ts +11 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-list.js +191 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-personal-sign.d.ts +35 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-personal-sign.js +39 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-setting.d.ts +15 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-setting.js +10 -0
- package/dist/components/electron-signatures/electronComponents/last-qys-modal.d.ts +7 -0
- package/dist/components/electron-signatures/electronComponents/last-qys-modal.js +42 -0
- package/dist/components/electron-signatures/electronComponents/useCheckedSealInfoList.d.ts +3 -0
- package/dist/components/electron-signatures/electronComponents/useCheckedSealInfoList.js +43 -0
- package/dist/components/electron-signatures/electronComponents/useElectronColumns.d.ts +30 -0
- package/dist/components/electron-signatures/electronComponents/useElectronColumns.js +398 -0
- package/dist/components/electron-signatures/electronComponents/useFetchElectronData.d.ts +24 -0
- package/dist/components/electron-signatures/electronComponents/useFetchElectronData.js +254 -0
- package/dist/components/electron-signatures/electronComponents/useGetDeptInfo.d.ts +3 -0
- package/dist/components/electron-signatures/electronComponents/useGetDeptInfo.js +35 -0
- package/dist/components/electron-signatures/fileComponents/file-operation.d.ts +7 -0
- package/dist/components/electron-signatures/fileComponents/file-operation.js +67 -0
- package/dist/components/electron-signatures/fileComponents/file-type-select.d.ts +12 -0
- package/dist/components/electron-signatures/fileComponents/file-type-select.js +10 -0
- package/dist/components/electron-signatures/fileComponents/file-upload.d.ts +11 -0
- package/dist/components/electron-signatures/fileComponents/file-upload.js +146 -0
- package/dist/components/electron-signatures/fileComponents/fileUtils.d.ts +17 -0
- package/dist/components/electron-signatures/fileComponents/fileUtils.js +36 -0
- package/dist/components/electron-signatures/fileComponents/new-file-operation.d.ts +10 -0
- package/dist/components/electron-signatures/fileComponents/new-file-operation.js +73 -0
- package/dist/components/electron-signatures/fileComponents/useFetchFileTypeData.d.ts +13 -0
- package/dist/components/electron-signatures/fileComponents/useFetchFileTypeData.js +43 -0
- package/dist/components/electron-signatures/fileComponents/useFileColumns.d.ts +38 -0
- package/dist/components/electron-signatures/fileComponents/useFileColumns.js +329 -0
- package/dist/components/electron-signatures/fileComponents/useFileTypeColumns.d.ts +19 -0
- package/dist/components/electron-signatures/fileComponents/useFileTypeColumns.js +72 -0
- package/dist/components/electron-signatures/hooks/useGetQjVerifyCode.d.ts +30 -0
- package/dist/components/electron-signatures/hooks/useGetQjVerifyCode.js +132 -0
- package/dist/components/electron-signatures/hooks/useMergeRecords.d.ts +17 -0
- package/dist/components/electron-signatures/hooks/useMergeRecords.js +49 -0
- package/dist/components/electron-signatures/hooks/useParseElectronListData.d.ts +49 -0
- package/dist/components/electron-signatures/hooks/useParseElectronListData.js +111 -0
- package/dist/components/electron-signatures/hooks/useParseElectronSetting.d.ts +111 -0
- package/dist/components/electron-signatures/hooks/useParseElectronSetting.js +436 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedElectronData.d.ts +40 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedElectronData.js +139 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedQunjData.d.ts +36 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedQunjData.js +48 -0
- package/dist/components/electron-signatures/hooks/useParseQunjListData.d.ts +56 -0
- package/dist/components/electron-signatures/hooks/useParseQunjListData.js +204 -0
- package/dist/components/electron-signatures/hooks/useParseQunjSingleData.d.ts +34 -0
- package/dist/components/electron-signatures/hooks/useParseQunjSingleData.js +110 -0
- package/dist/components/electron-signatures/hooks/useParseRecords.d.ts +65 -0
- package/dist/components/electron-signatures/hooks/useParseRecords.js +165 -0
- package/dist/components/electron-signatures/index.d.ts +15 -0
- package/dist/components/electron-signatures/index.js +63 -0
- package/dist/components/electron-signatures/interface.d.ts +865 -0
- package/dist/components/electron-signatures/interface.js +57 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-apply.d.ts +6 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-apply.js +8 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-check.d.ts +21 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-check.js +41 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-detail.d.ts +35 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-detail.js +267 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-list.d.ts +24 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-list.js +355 -0
- package/dist/components/electron-signatures/qunjComponents/useFetchQunjData.d.ts +20 -0
- package/dist/components/electron-signatures/qunjComponents/useFetchQunjData.js +66 -0
- package/dist/components/electron-signatures/qunjComponents/useQunjColumns.d.ts +36 -0
- package/dist/components/electron-signatures/qunjComponents/useQunjColumns.js +321 -0
- package/dist/components/electron-signatures/translateComponents/TranslateButton.d.ts +10 -0
- package/dist/components/electron-signatures/translateComponents/TranslateButton.js +44 -0
- package/dist/components/electron-signatures/translateComponents/useTranslateCom.d.ts +22 -0
- package/dist/components/electron-signatures/translateComponents/useTranslateCom.js +50 -0
- package/dist/components/electron-signatures/utils.d.ts +26 -0
- package/dist/components/electron-signatures/utils.js +67 -0
- package/dist/components/utils/MyStorage.d.ts +36 -0
- package/dist/components/utils/MyStorage.js +120 -0
- package/dist/components/utils/ZtxkContext.d.ts +67 -0
- package/dist/components/utils/ZtxkContext.js +20 -0
- package/dist/components/utils/checkSealCoUse.d.ts +16 -0
- package/dist/components/utils/checkSealCoUse.js +83 -0
- package/dist/components/utils/fetch.d.ts +10 -0
- package/dist/components/utils/fetch.js +119 -0
- package/dist/components/utils/index.d.ts +9 -0
- package/dist/components/utils/index.js +11 -0
- package/dist/components/utils/processNumber.d.ts +12 -0
- package/dist/components/utils/processNumber.js +106 -0
- package/dist/components/utils/upload.js +6 -3
- package/dist/components/utils/useBaseContext.d.ts +23 -0
- package/dist/components/utils/useBaseContext.js +31 -0
- package/dist/components/utils/useMemoizedFn.d.ts +4 -0
- package/dist/components/utils/useMemoizedFn.js +19 -0
- package/dist/components/utils/usePrevious.d.ts +3 -0
- package/dist/components/utils/usePrevious.js +13 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/index.css +2205 -58
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +255 -86
- package/dist/locales/en-US.json +828 -0
- package/dist/locales/zh-CN.json +828 -0
- package/dist/request.js +7 -6
- package/package.json +13 -4
|
@@ -0,0 +1,207 @@
|
|
|
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 React, { useState } from 'react';
|
|
13
|
+
// 注意:不要从 '../../index'(入口文件)导入组件
|
|
14
|
+
// 入口文件 index.tsx 依赖 './UI',从这里导入会形成循环引用,
|
|
15
|
+
// 导致模块顶层解构时组件还是 undefined
|
|
16
|
+
import Select from '../../components/Select';
|
|
17
|
+
import EnhanceSelect from '../../components/EnhanceSelect';
|
|
18
|
+
import FetchSelect from '../../components/FetchSelect';
|
|
19
|
+
import EmpForQuitDemo from './EmpForQuitDemo';
|
|
20
|
+
var Option = Select.Option, OptGroup = Select.OptGroup;
|
|
21
|
+
var sectionStyle = {
|
|
22
|
+
marginBottom: 24,
|
|
23
|
+
};
|
|
24
|
+
var labelStyle = {
|
|
25
|
+
display: 'block',
|
|
26
|
+
marginBottom: 8,
|
|
27
|
+
fontSize: 14,
|
|
28
|
+
fontWeight: 600,
|
|
29
|
+
color: '#333',
|
|
30
|
+
};
|
|
31
|
+
var descStyle = {
|
|
32
|
+
marginTop: 4,
|
|
33
|
+
fontSize: 12,
|
|
34
|
+
color: '#999',
|
|
35
|
+
};
|
|
36
|
+
var widthStyle = { width: 240 };
|
|
37
|
+
/** 基础选项数据 */
|
|
38
|
+
var fruitOptions = [
|
|
39
|
+
{ id: 'apple', name: '苹果' },
|
|
40
|
+
{ id: 'banana', name: '香蕉' },
|
|
41
|
+
{ id: 'orange', name: '橙子' },
|
|
42
|
+
{ id: 'grape', name: '葡萄' },
|
|
43
|
+
{ id: 'peach', name: '桃子' },
|
|
44
|
+
];
|
|
45
|
+
/** 模拟远程接口:FetchSelect 要求返回 { status: 200, data: { code: 200, data: { records: [] } } } */
|
|
46
|
+
function mockRequest(options) {
|
|
47
|
+
var _a;
|
|
48
|
+
var searchKey = ((_a = options === null || options === void 0 ? void 0 : options.params) === null || _a === void 0 ? void 0 : _a.name) || '';
|
|
49
|
+
var allUsers = [
|
|
50
|
+
{ id: '1', name: '张三' },
|
|
51
|
+
{ id: '2', name: '李四' },
|
|
52
|
+
{ id: '3', name: '王五' },
|
|
53
|
+
{ id: '4', name: '赵六' },
|
|
54
|
+
{ id: '5', name: '孙七' },
|
|
55
|
+
];
|
|
56
|
+
var records = allUsers.filter(function (item) { return item.name.indexOf(searchKey) >= 0; });
|
|
57
|
+
return Promise.resolve({
|
|
58
|
+
status: 200,
|
|
59
|
+
data: { code: 200, data: { records: records } },
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/** 分页远程搜索的模拟数据:66 条,按 currentSize=10 每页 10 条分 7 页 */
|
|
63
|
+
var ALL_PAGE_USERS = Array.from({ length: 66 }, function (_, i) { return ({
|
|
64
|
+
id: String(i + 1),
|
|
65
|
+
name: "\u6D4B\u8BD5\u4EBA\u5458" + String(i + 1).padStart(2, '0'),
|
|
66
|
+
dept: ['人事部', '财务部', '技术部'][i % 3],
|
|
67
|
+
}); });
|
|
68
|
+
/**
|
|
69
|
+
* 模拟远程分页接口:EnhanceSelect 远程搜索要求返回
|
|
70
|
+
* { code: 200, data: { records: [], total: N } }
|
|
71
|
+
* 请求参数由组件拼装:{ size: 每页条数, current: 页码, ...params, [搜索字段]: 关键字 }
|
|
72
|
+
*/
|
|
73
|
+
function mockPageRequest(options) {
|
|
74
|
+
var _a = (options === null || options === void 0 ? void 0 : options.params) || {}, _b = _a.current, current = _b === void 0 ? 1 : _b, _c = _a.size, size = _c === void 0 ? 10 : _c, _d = _a.name, name = _d === void 0 ? '' : _d;
|
|
75
|
+
var filtered = ALL_PAGE_USERS.filter(function (item) { return item.name.indexOf(name) >= 0; });
|
|
76
|
+
var start = (current - 1) * size;
|
|
77
|
+
var records = filtered.slice(start, start + size);
|
|
78
|
+
// 模拟 300ms 网络延迟,便于观察 loading 和滚动加载效果
|
|
79
|
+
return new Promise(function (resolve) {
|
|
80
|
+
return setTimeout(function () { return resolve({ code: 200, data: { records: records, total: filtered.length } }); }, 300);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 下拉框示例
|
|
85
|
+
*
|
|
86
|
+
* - Select:对 antd Select 的封装,点击已选中项可再次展开下拉框
|
|
87
|
+
* - EnhanceSelect:增强下拉框,支持直接传 list、远程搜索、全选/反选、拼接字段等
|
|
88
|
+
* - FetchSelect:远程获取数据的下拉框,输入时防抖远程搜索
|
|
89
|
+
*/
|
|
90
|
+
var SelectDemo = function () {
|
|
91
|
+
var _a = useState('apple'), singleValue = _a[0], setSingleValue = _a[1];
|
|
92
|
+
var _b = useState(['banana', 'orange']), multiValue = _b[0], setMultiValue = _b[1];
|
|
93
|
+
var _c = useState(), enhanceSingleValue = _c[0], setEnhanceSingleValue = _c[1];
|
|
94
|
+
var _d = useState([]), enhanceMultiValue = _d[0], setEnhanceMultiValue = _d[1];
|
|
95
|
+
var _e = useState(), fetchValue = _e[0], setFetchValue = _e[1];
|
|
96
|
+
var _f = useState(), pageSearchValue = _f[0], setPageSearchValue = _f[1];
|
|
97
|
+
var _g = useState(), enhanceCurrentData = _g[0], setEnhanceCurrentData = _g[1];
|
|
98
|
+
return (React.createElement("div", { style: { padding: '20px', maxWidth: 600 } },
|
|
99
|
+
React.createElement("h2", null, "\u4E0B\u62C9\u6846"),
|
|
100
|
+
React.createElement("div", { style: sectionStyle },
|
|
101
|
+
React.createElement("label", { style: labelStyle }, "\u57FA\u7840\u7528\u6CD5\uFF08Select.Option\uFF0C\u53EF\u6E05\u7A7A\uFF09"),
|
|
102
|
+
React.createElement(Select, { style: widthStyle, allowClear: true, placeholder: "\u8BF7\u9009\u62E9\u6C34\u679C", value: singleValue, onChange: function (value) { return setSingleValue(value); } }, fruitOptions.map(function (item) { return (React.createElement(Option, { key: item.id, value: item.id }, item.name)); })),
|
|
103
|
+
React.createElement("div", { style: descStyle },
|
|
104
|
+
"\u5F53\u524D\u9009\u4E2D\uFF1A",
|
|
105
|
+
singleValue || '未选择')),
|
|
106
|
+
React.createElement("div", { style: sectionStyle },
|
|
107
|
+
React.createElement("label", { style: labelStyle }, "\u7981\u7528\u72B6\u6001\uFF08\u7EC4\u4EF6\u7981\u7528 + \u9009\u9879\u7981\u7528\uFF09"),
|
|
108
|
+
React.createElement(Select, { style: widthStyle, defaultValue: "apple", disabled: true }, fruitOptions.map(function (item) { return (React.createElement(Option, { key: item.id, value: item.id }, item.name)); })),
|
|
109
|
+
React.createElement(Select, { style: __assign(__assign({}, widthStyle), { marginLeft: 12 }), placeholder: "\u8461\u8404\u4E0D\u53EF\u9009" }, fruitOptions.map(function (item) { return (React.createElement(Option, { key: item.id, value: item.id, disabled: item.id === 'grape' }, item.name)); }))),
|
|
110
|
+
React.createElement("div", { style: sectionStyle },
|
|
111
|
+
React.createElement("label", { style: labelStyle }, "\u591A\u9009\u6A21\u5F0F\uFF08mode=\"multiple\"\uFF09"),
|
|
112
|
+
React.createElement(Select, { style: { width: 360 }, mode: "multiple", allowClear: true, placeholder: "\u8BF7\u9009\u62E9\u591A\u4E2A\u6C34\u679C", value: multiValue, onChange: function (value) { return setMultiValue(value); } }, fruitOptions.map(function (item) { return (React.createElement(Option, { key: item.id, value: item.id }, item.name)); })),
|
|
113
|
+
React.createElement("div", { style: descStyle },
|
|
114
|
+
"\u5F53\u524D\u9009\u4E2D\uFF1A",
|
|
115
|
+
multiValue.join('、') || '未选择')),
|
|
116
|
+
React.createElement("div", { style: sectionStyle },
|
|
117
|
+
React.createElement("label", { style: labelStyle }, "\u672C\u5730\u641C\u7D22\uFF08showSearch\uFF0C\u6309\u9009\u9879\u6587\u672C\u8FC7\u6EE4\uFF09"),
|
|
118
|
+
React.createElement(Select, { style: widthStyle, showSearch: true, allowClear: true, placeholder: "\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22", optionFilterProp: "children" }, fruitOptions.map(function (item) { return (React.createElement(Option, { key: item.id, value: item.id }, item.name)); })),
|
|
119
|
+
React.createElement("div", { style: descStyle }, "optionFilterProp=\"children\" \u8868\u793A\u6309\u9009\u9879\u5185\u5BB9\u5339\u914D\uFF08\u4E0D\u533A\u5206\u5927\u5C0F\u5199\uFF09")),
|
|
120
|
+
React.createElement("div", { style: sectionStyle },
|
|
121
|
+
React.createElement("label", { style: labelStyle }, "\u5206\u7EC4\uFF08Select.OptGroup\uFF09"),
|
|
122
|
+
React.createElement(Select, { style: widthStyle, placeholder: "\u8BF7\u9009\u62E9" },
|
|
123
|
+
React.createElement(OptGroup, { label: "\u6C34\u679C" },
|
|
124
|
+
React.createElement(Option, { value: "apple" }, "\u82F9\u679C"),
|
|
125
|
+
React.createElement(Option, { value: "banana" }, "\u9999\u8549")),
|
|
126
|
+
React.createElement(OptGroup, { label: "\u852C\u83DC" },
|
|
127
|
+
React.createElement(Option, { value: "potato" }, "\u571F\u8C46"),
|
|
128
|
+
React.createElement(Option, { value: "tomato" }, "\u897F\u7EA2\u67FF")))),
|
|
129
|
+
React.createElement("div", { style: sectionStyle },
|
|
130
|
+
React.createElement("label", { style: labelStyle }, "\u589E\u5F3A\u4E0B\u62C9\u6846\uFF08EnhanceSelect\uFF0C\u76F4\u63A5\u4F20 list \u6570\u636E\uFF09"),
|
|
131
|
+
React.createElement(EnhanceSelect, { style: widthStyle, allowClear: true, placeholder: "\u8BF7\u9009\u62E9\u6C34\u679C", list: fruitOptions, dataKey: "id", titleKey: "name", value: enhanceSingleValue, onChange: function (value, _option, currentData) {
|
|
132
|
+
setEnhanceSingleValue(value);
|
|
133
|
+
setEnhanceCurrentData(currentData);
|
|
134
|
+
} }),
|
|
135
|
+
React.createElement("div", { style: descStyle },
|
|
136
|
+
"\u5F53\u524D\u9009\u4E2D\uFF1A",
|
|
137
|
+
enhanceSingleValue || '未选择',
|
|
138
|
+
enhanceCurrentData
|
|
139
|
+
? "\uFF08\u5B8C\u6574\u6570\u636E\uFF1A" + JSON.stringify(enhanceCurrentData) + "\uFF09"
|
|
140
|
+
: ''),
|
|
141
|
+
React.createElement("div", { style: descStyle }, "onChange \u7B2C\u4E09\u4E2A\u53C2\u6570 currentData \u662F\u5F53\u524D\u9009\u4E2D\u9879\u7684\u539F\u59CB\u6570\u636E\u5BF9\u8C61")),
|
|
142
|
+
React.createElement("div", { style: sectionStyle },
|
|
143
|
+
React.createElement("label", { style: labelStyle }, "\u589E\u5F3A\u4E0B\u62C9\u6846\uFF08\u663E\u793A\"\u5168\u90E8\"\u9009\u9879 + \u62FC\u63A5\u5B57\u6BB5 joinKey\uFF09"),
|
|
144
|
+
React.createElement(EnhanceSelect, { style: { width: 360 }, allowClear: true, placeholder: "\u8BF7\u9009\u62E9", list: [
|
|
145
|
+
{ id: '1', name: '张三', code: 'A001', dept: '人事部' },
|
|
146
|
+
{ id: '2', name: '李四', code: 'A002', dept: '财务部' },
|
|
147
|
+
{ id: '3', name: '王五', code: 'A003', dept: '人事部' },
|
|
148
|
+
{ id: '3', name: '王五', code: '', dept: '人事部' },
|
|
149
|
+
], dataKey: "id", titleKey: "name", joinKey: ['code', 'dept'], joinStr: "-", showAll: true }),
|
|
150
|
+
React.createElement("div", { style: descStyle }, "showAll \u4F1A\u5728\u6700\u4E0A\u65B9\u8FFD\u52A0\u4E00\u9879 value \u4E3A\u7A7A\u5B57\u7B26\u4E32\u7684\"\u5168\u90E8\"\uFF1BjoinKey \u628A\u591A\u4E2A\u5B57\u6BB5\u7528 joinStr \u62FC\u63A5\u5C55\u793A\uFF1B\u5B57\u6BB5\u4E0D\u5B58\u5728\u6216\u4E3A\u7A7A\u65F6\u4E0D\u4F1A\u62FC\u51FA\u591A\u4F59\u7684\u8FDE\u63A5\u7B26")),
|
|
151
|
+
React.createElement("div", { style: sectionStyle },
|
|
152
|
+
React.createElement("label", { style: labelStyle }, "\u589E\u5F3A\u4E0B\u62C9\u6846\uFF08isJoinInLabel=false\uFF0C\u9009\u4E2D\u540E\u56DE\u663E\u53EA\u663E\u793A\u4E3B\u6807\u9898\uFF09"),
|
|
153
|
+
React.createElement(EnhanceSelect, { style: { width: 360 }, allowClear: true, placeholder: "\u9009\u4E2D\u540E\u53EA\u663E\u793A\u59D3\u540D\uFF0C\u4E0D\u663E\u793A\u62FC\u63A5\u4E32", list: [
|
|
154
|
+
{ id: '1', name: '张三', code: 'A001', dept: '人事部' },
|
|
155
|
+
{ id: '2', name: '李四', code: 'A002', dept: '财务部' },
|
|
156
|
+
{ id: '3', name: '王五', code: 'A003', dept: '人事部' },
|
|
157
|
+
], dataKey: "id", titleKey: "name", joinKey: ['code', 'dept'], joinStr: "-", isJoinInLabel: false }),
|
|
158
|
+
React.createElement("div", { style: descStyle }, "\u4E0B\u62C9\u5217\u8868\u91CC\u4ECD\u663E\u793A\u300C\u5F20\u4E09-A001-\u4EBA\u4E8B\u90E8\u300D\u5B8C\u6574\u62FC\u63A5\uFF0C\u4F46\u9009\u4E2D\u540E\u8F93\u5165\u6846\u53EA\u56DE\u663E\u300C\u5F20\u4E09\u300D\uFF1B \u4E0D\u4F20\u8BE5\u5C5E\u6027\u65F6\u53D6\u5168\u5C40\u914D\u7F6E isSelectJoinInLabel\uFF08\u9ED8\u8BA4\u663E\u793A\u62FC\u63A5\u4E32\uFF09")),
|
|
159
|
+
React.createElement("div", { style: sectionStyle },
|
|
160
|
+
React.createElement("label", { style: labelStyle }, "\u589E\u5F3A\u4E0B\u62C9\u6846\uFF08\u591A\u9009 + \u4E0B\u62C9\u5E95\u90E8\u5168\u9009/\u53CD\u9009\u6309\u94AE\uFF09"),
|
|
161
|
+
React.createElement(EnhanceSelect, { style: { width: 360 }, mode: "multiple", allowClear: true, placeholder: "\u8BF7\u9009\u62E9\u591A\u4E2A", list: fruitOptions, dataKey: "id", titleKey: "name", value: enhanceMultiValue,
|
|
162
|
+
// 多选模式下 value 实际是数组,但组件 onChange 类型声明为 string,这里做一次断言
|
|
163
|
+
onChange: function (value) {
|
|
164
|
+
return setEnhanceMultiValue(value || []);
|
|
165
|
+
} }),
|
|
166
|
+
React.createElement("div", { style: descStyle },
|
|
167
|
+
"mode=\"multiple\" \u65F6\u4E0B\u62C9\u5E95\u90E8\u81EA\u52A8\u51FA\u73B0\u300C\u5168\u9009\u300D\u300C\u53CD\u9009\u300D\u6309\u94AE\uFF1B\u5F53\u524D\u9009\u4E2D\uFF1A",
|
|
168
|
+
enhanceMultiValue.join('、') || '未选择')),
|
|
169
|
+
React.createElement("div", { style: sectionStyle },
|
|
170
|
+
React.createElement("label", { style: labelStyle }, "\u589E\u5F3A\u4E0B\u62C9\u6846\uFF08\u7981\u7528\u6307\u5B9A\u9009\u9879 disabledValues\uFF09"),
|
|
171
|
+
React.createElement(EnhanceSelect, { style: widthStyle, placeholder: "\u8461\u8404\u3001\u6843\u5B50\u88AB\u7981\u7528", list: fruitOptions, dataKey: "id", titleKey: "name", disabledValues: ['grape', 'peach'] })),
|
|
172
|
+
React.createElement("div", { style: sectionStyle },
|
|
173
|
+
React.createElement("label", { style: labelStyle }, "\u8FDC\u7A0B\u6570\u636E\u4E0B\u62C9\u6846\uFF08FetchSelect + mock \u63A5\u53E3\uFF09"),
|
|
174
|
+
React.createElement(FetchSelect, { style: widthStyle, allowClear: true, placeholder: "\u8F93\u5165\u59D3\u540D\u8FDC\u7A0B\u641C\u7D22", url: "/mock/users", request: mockRequest, dataKey: "id", dataTitle: "name", value: fetchValue, onChange: function (value) { return setFetchValue(value); } }),
|
|
175
|
+
React.createElement("div", { style: descStyle },
|
|
176
|
+
"\u5F53\u524D\u9009\u4E2D\uFF1A",
|
|
177
|
+
fetchValue || '未选择'),
|
|
178
|
+
React.createElement("div", { style: descStyle }, "FetchSelect \u521D\u59CB\u5316\u81EA\u52A8\u8BF7\u6C42\u4E00\u6B21\uFF0C\u8F93\u5165\u65F6 300ms \u9632\u6296\u8FDC\u7A0B\u641C\u7D22\uFF1B\u5B9E\u9645\u9879\u76EE\u4E2D request \u4E00\u822C\u4F20 axios \u5B9E\u4F8B\uFF0Curl \u4F20\u63A5\u53E3\u5730\u5740\uFF0C\u8FD4\u56DE\u683C\u5F0F\u8981\u6C42 data.records")),
|
|
179
|
+
React.createElement("div", { style: sectionStyle },
|
|
180
|
+
React.createElement("label", { style: labelStyle }, "\u8FDC\u7A0B\u641C\u7D22 + \u6EDA\u52A8\u5206\u9875\uFF08remoteSearch + isPage\uFF09"),
|
|
181
|
+
React.createElement(EnhanceSelect, { style: widthStyle, allowClear: true, placeholder: "\u8F93\u5165\u59D3\u540D\u641C\u7D22\uFF0C\u6EDA\u52A8\u5230\u5E95\u90E8\u52A0\u8F7D\u4E0B\u4E00\u9875", url: "/mock/users/page", request: mockPageRequest,
|
|
182
|
+
// remoteSearch 必须传:滚动分页的触发条件是 remoteSearch && isPage,
|
|
183
|
+
// 只传 isPage 不传 remoteSearch 时组件退化为一次性拉取 + 本地过滤,永不分页
|
|
184
|
+
remoteSearch: true,
|
|
185
|
+
// 开启滚动分页:滚到底部(距底 100px)且 selectList.length < total 时加载下一页
|
|
186
|
+
isPage: true,
|
|
187
|
+
// 每页条数,默认 30;这里设小一点方便演示滚动加载
|
|
188
|
+
currentSize: 10, dataKey: "id", titleKey: "name", value: pageSearchValue, onChange: function (value) { return setPageSearchValue(value); }, onCompleted: function (data) {
|
|
189
|
+
return console.log('已加载选项数:', data === null || data === void 0 ? void 0 : data.length);
|
|
190
|
+
} }),
|
|
191
|
+
React.createElement("div", { style: descStyle },
|
|
192
|
+
"\u5F53\u524D\u9009\u4E2D\uFF1A",
|
|
193
|
+
pageSearchValue || '未选择'),
|
|
194
|
+
React.createElement("div", { style: descStyle }, "mock \u6570\u636E\u5171 66 \u6761\u3001\u6BCF\u9875 10 \u6761\uFF1A\u6253\u5F00\u4E0B\u62C9\u5148\u52A0\u8F7D\u7B2C 1 \u9875\uFF0C\u6EDA\u52A8\u5230\u5E95\u90E8\u81EA\u52A8\u8FFD\u52A0\u4E0B\u4E00\u9875\uFF1B \u8F93\u5165\u5173\u952E\u5B57\u540E\u6309\u5173\u952E\u5B57\u8FDC\u7A0B\u641C\u7D22\uFF0Ctotal \u540C\u6B65\u7F29\u5C0F\u3002\u5206\u9875\u751F\u6548\u7684\u524D\u63D0\uFF1A \u2460 remoteSearch + isPage \u540C\u65F6\u914D\u7F6E\uFF1B\u2461 \u63A5\u53E3\u6309 current/size \u53C2\u6570\u8FD4\u56DE\u5BF9\u5E94\u9875\uFF1B\u2462 \u8FD4\u56DE\u7684 data.total \u662F\u603B\u6761\u6570\uFF08count \u53D6\u81EA res.data.total\uFF0C\u4F4D\u7F6E\u4E0D\u5BF9\u65F6\u5206\u9875\u6C38\u8FDC\u4E0D\u4F1A\u89E6\u53D1\uFF0C\u9700\u8981 transformData \u8F6C\u6362\uFF09")),
|
|
195
|
+
React.createElement("div", { style: sectionStyle },
|
|
196
|
+
React.createElement("label", { style: labelStyle }, "\u4E1A\u52A1\u8FD8\u539F\uFF1A\u5458\u5DE5\u79BB\u804C\u7533\u8BF7\u4E0B\u62C9\uFF08EmpForQuitSelect\uFF0C\u72EC\u7ACB\u7EC4\u4EF6\u6587\u4EF6\uFF09"),
|
|
197
|
+
React.createElement(EmpForQuitDemo, null),
|
|
198
|
+
React.createElement("div", { style: descStyle }, "\u590D\u523B zthr \u4E1A\u52A1\u5C01\u88C5\u7684\u5B8C\u6574\u914D\u7F6E\uFF1AremoteSearch + remoteSearchKey=\"empName\"\uFF08\u641C\u7D22\u5173\u952E\u5B57\u6309 empName \u4F20\u540E\u7AEF\uFF09\u3001 joinKey=\"fullDepName\"\uFF08\u5B57\u7B26\u4E32\u5F62\u5F0F\uFF0C\u4E0B\u62C9\u9879\u663E\u793A\u300C\u59D3\u540D-\u90E8\u95E8\u5168\u8DEF\u5F84\u300D\uFF0C\u90E8\u95E8\u7F3A\u5931\u4E0D\u62FC\u8FDE\u63A5\u7B26\uFF09\u3001 isPage \u6EDA\u52A8\u5206\u9875\u3001params \u52A8\u6001 stringify \u4E14\u53D8\u5316\u65F6\u7528\u65F6\u95F4\u6233 key \u5F3A\u5236\u91CD\u6E32\u67D3\uFF08\u70B9\u4E0A\u65B9\u6309\u94AE\u5207\u6362\u90E8\u95E8\u8FC7\u6EE4\u53EF\u9A8C\u8BC1\uFF09\u3002\u7EC4\u4EF6\u4EE3\u7801\u5728\u72EC\u7ACB\u7684 EmpForQuitDemo.tsx \u6587\u4EF6\u4E2D\u3002")),
|
|
199
|
+
React.createElement("div", { style: sectionStyle },
|
|
200
|
+
React.createElement("label", { style: labelStyle }, "\u5BF9\u6BD4\u5C0F\u7ED3"),
|
|
201
|
+
React.createElement("ul", { style: { fontSize: 13, color: '#555', lineHeight: '22px' } },
|
|
202
|
+
React.createElement("li", null, "Select\uFF1A\u57FA\u7840\u5C01\u88C5\uFF0C\u7528\u6CD5\u540C antd Select\uFF0C\u4FEE\u590D\u4E86\"\u70B9\u51FB\u5DF2\u9009\u4E2D\u9879\u4E0D\u5C55\u5F00\"\u7684\u95EE\u9898"),
|
|
203
|
+
React.createElement("li", null, "EnhanceSelect\uFF1A\u4F18\u5148\u4F7F\u7528\uFF0C\u652F\u6301 list \u672C\u5730\u6570\u636E\u3001url+request \u8FDC\u7A0B\u6570\u636E\u3001\u8FDC\u7A0B\u641C\u7D22\u3001\u5168\u9009/\u53CD\u9009\u3001\u5B57\u6BB5\u62FC\u63A5\u3001\u6570\u636E\u7F13\u5B58\uFF08isCatch\uFF09\u7B49"),
|
|
204
|
+
React.createElement("li", null, "FetchSelect\uFF1A\u8F7B\u91CF\u8FDC\u7A0B\u6570\u636E\u4E0B\u62C9\u6846\uFF0C\u53EA\u505A\"\u62C9\u53D6 + \u641C\u7D22\"\uFF0C\u8FD4\u56DE\u683C\u5F0F\u8981\u6C42 data.records"),
|
|
205
|
+
React.createElement("li", null, "\u4E09\u4E2A\u7EC4\u4EF6\u7684 onChange \u90FD\u4F1A\u56DE\u4F20 (value, option)\uFF0CEnhanceSelect \u989D\u5916\u56DE\u4F20\u7B2C\u4E09\u4E2A\u53C2\u6570 currentData\uFF08\u9009\u4E2D\u9879\u539F\u59CB\u6570\u636E\uFF09")))));
|
|
206
|
+
};
|
|
207
|
+
export default SelectDemo;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 业务还原用例:复刻 zmdms-zthr-front 外事团组列表(groupList/List/component/TableList.tsx)的表格用法
|
|
3
|
+
*
|
|
4
|
+
* 用于复现业务反馈的「右键查看明细 / 全屏」报错问题,保持与业务侧完全一致的关键写法:
|
|
5
|
+
* 1. 序号列只有 render,没有 key/dataIndex(detail 明细会跳过该列);
|
|
6
|
+
* 2. 固定列:fixed left 的序号/编号列 + fixed right 的状态/操作列;
|
|
7
|
+
* 3. 标题列 render 返回 Button(link),状态列 render 里嵌套点击回调;
|
|
8
|
+
* 4. 操作列 key="operation" 无 dataIndex,render 返回「主按钮 + Dropdown 其他操作」;
|
|
9
|
+
* 5. Table 配置 isFlex、bordered、pagination={false}、scroll={{ x: 'max-content' }}。
|
|
10
|
+
*
|
|
11
|
+
* 使用方式:右键表格行 → 查看明细 / 全屏,观察控制台是否报错。
|
|
12
|
+
*/
|
|
13
|
+
import React from 'react';
|
|
14
|
+
declare const _default: React.NamedExoticComponent<{}>;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 业务还原用例:复刻 zmdms-zthr-front 外事团组列表(groupList/List/component/TableList.tsx)的表格用法
|
|
3
|
+
*
|
|
4
|
+
* 用于复现业务反馈的「右键查看明细 / 全屏」报错问题,保持与业务侧完全一致的关键写法:
|
|
5
|
+
* 1. 序号列只有 render,没有 key/dataIndex(detail 明细会跳过该列);
|
|
6
|
+
* 2. 固定列:fixed left 的序号/编号列 + fixed right 的状态/操作列;
|
|
7
|
+
* 3. 标题列 render 返回 Button(link),状态列 render 里嵌套点击回调;
|
|
8
|
+
* 4. 操作列 key="operation" 无 dataIndex,render 返回「主按钮 + Dropdown 其他操作」;
|
|
9
|
+
* 5. Table 配置 isFlex、bordered、pagination={false}、scroll={{ x: 'max-content' }}。
|
|
10
|
+
*
|
|
11
|
+
* 使用方式:右键表格行 → 查看明细 / 全屏,观察控制台是否报错。
|
|
12
|
+
*/
|
|
13
|
+
import React, { memo, useCallback } from 'react';
|
|
14
|
+
import { Dropdown, Menu } from 'antd';
|
|
15
|
+
import Button from '../../components/Button';
|
|
16
|
+
import Table from '../../components/Table';
|
|
17
|
+
/** 操作码 → 操作名(与业务侧 operateCodes 对齐) */
|
|
18
|
+
var ACTION_TEXT_MAP = {
|
|
19
|
+
edit: '编辑',
|
|
20
|
+
delete: '删除',
|
|
21
|
+
submit: '发起审批',
|
|
22
|
+
revoke: '撤销审批',
|
|
23
|
+
specialistModify: '表单修改',
|
|
24
|
+
changeStatus: '状态修改',
|
|
25
|
+
};
|
|
26
|
+
/** 模拟列表数据:覆盖「有/无操作码、有/无批件号」等情况 */
|
|
27
|
+
var RECORDS = [
|
|
28
|
+
{
|
|
29
|
+
id: '1',
|
|
30
|
+
approvalNo: 'PJ2026-0001',
|
|
31
|
+
fileTitle: '关于组织赴德国参加工业展的请示',
|
|
32
|
+
applyDepName: '国际业务部',
|
|
33
|
+
flowTypeName: '出境团组',
|
|
34
|
+
abroadTaskName: '参加展会',
|
|
35
|
+
visitCountryNames: '德国',
|
|
36
|
+
teamLeaderName: '张三',
|
|
37
|
+
departureDate: '2026-03-15',
|
|
38
|
+
returnDate: '2026-03-25',
|
|
39
|
+
stayDays: 10,
|
|
40
|
+
groupStatusName: '审批中',
|
|
41
|
+
operateCodes: ['edit', 'delete', 'submit', 'revoke', 'changeStatus'],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: '2',
|
|
45
|
+
fileTitle: '关于赴日本开展技术交流的申请',
|
|
46
|
+
applyDepName: '技术中心',
|
|
47
|
+
flowTypeName: '出境团组',
|
|
48
|
+
abroadTaskName: '技术交流',
|
|
49
|
+
visitCountryNames: '日本',
|
|
50
|
+
teamLeaderName: '李四',
|
|
51
|
+
departureDate: '2026-04-08',
|
|
52
|
+
returnDate: '2026-04-15',
|
|
53
|
+
stayDays: 7,
|
|
54
|
+
groupStatusName: '待提交',
|
|
55
|
+
operateCodes: ['edit', 'delete', 'submit'],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: '3',
|
|
59
|
+
approvalNo: 'PJ2026-0003',
|
|
60
|
+
fileTitle: '关于赴新加坡商务考察的请示',
|
|
61
|
+
applyDepName: '市场部',
|
|
62
|
+
flowTypeName: '出境团组',
|
|
63
|
+
abroadTaskName: '商务考察',
|
|
64
|
+
visitCountryNames: '新加坡、马来西亚',
|
|
65
|
+
teamLeaderName: '王五',
|
|
66
|
+
departureDate: '2026-05-02',
|
|
67
|
+
returnDate: '2026-05-10',
|
|
68
|
+
stayDays: 8,
|
|
69
|
+
groupStatusName: '已通过',
|
|
70
|
+
// 无操作码:操作列 render 返回 null,验证明细弹框对 null render 的兜底
|
|
71
|
+
operateCodes: [],
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: '4',
|
|
75
|
+
approvalNo: '',
|
|
76
|
+
fileTitle: '关于赴泰国售后服务的申请',
|
|
77
|
+
applyDepName: '服务中心',
|
|
78
|
+
flowTypeName: '出境团组',
|
|
79
|
+
abroadTaskName: '售后服务',
|
|
80
|
+
visitCountryNames: '泰国',
|
|
81
|
+
teamLeaderName: '赵六',
|
|
82
|
+
departureDate: '',
|
|
83
|
+
returnDate: '',
|
|
84
|
+
stayDays: 0,
|
|
85
|
+
groupStatusName: '草稿',
|
|
86
|
+
// 未返回 operateCodes 字段(undefined):验证字段缺失时的兜底
|
|
87
|
+
},
|
|
88
|
+
];
|
|
89
|
+
/**
|
|
90
|
+
* 业务还原的列表组件(结构与业务侧 TableList.tsx 保持一致)
|
|
91
|
+
*/
|
|
92
|
+
var BusinessTableList = function (_a) {
|
|
93
|
+
var _b = _a.authMap, authMap = _b === void 0 ? {} : _b, onAction = _a.onAction, onTitleClick = _a.onTitleClick;
|
|
94
|
+
var renderOperations = useCallback(function (record) {
|
|
95
|
+
// 操作以接口返回的 operateCodes 为准
|
|
96
|
+
var actions = record.operateCodes || [];
|
|
97
|
+
if (!actions.length)
|
|
98
|
+
return null;
|
|
99
|
+
// 过滤无权限操作
|
|
100
|
+
var allowed = actions.filter(function (action) { return !authMap[action]; });
|
|
101
|
+
if (!allowed.length)
|
|
102
|
+
return null;
|
|
103
|
+
var first = allowed[0], rest = allowed.slice(1);
|
|
104
|
+
return (React.createElement(React.Fragment, null,
|
|
105
|
+
React.createElement(Button, { type: "link", style: { padding: 0 }, onClick: function () { return onAction === null || onAction === void 0 ? void 0 : onAction(first, record); } }, ACTION_TEXT_MAP[first]),
|
|
106
|
+
rest.length > 0 && (React.createElement(Dropdown, { overlay: React.createElement(Menu, { onClick: function (_a) {
|
|
107
|
+
var key = _a.key;
|
|
108
|
+
return onAction === null || onAction === void 0 ? void 0 : onAction(key, record);
|
|
109
|
+
} }, rest.map(function (action) { return (React.createElement(Menu.Item, { key: action }, ACTION_TEXT_MAP[action])); })) },
|
|
110
|
+
React.createElement(Button, { type: "link", style: { padding: 0, marginLeft: 8 } }, "\u5176\u4ED6\u64CD\u4F5C")))));
|
|
111
|
+
}, [authMap, onAction]);
|
|
112
|
+
var columns = [
|
|
113
|
+
{
|
|
114
|
+
title: '序号',
|
|
115
|
+
width: 60,
|
|
116
|
+
fixed: 'left',
|
|
117
|
+
align: 'center',
|
|
118
|
+
// 与业务一致:只有 render,没有 key/dataIndex
|
|
119
|
+
render: function (_text, _record, index) { return "" + (index + 1); },
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
title: '集团批件号',
|
|
123
|
+
dataIndex: 'approvalNo',
|
|
124
|
+
key: 'approvalNo',
|
|
125
|
+
width: 130,
|
|
126
|
+
fixed: 'left',
|
|
127
|
+
render: function (text) { return text || '— —'; },
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
title: '文件标题',
|
|
131
|
+
dataIndex: 'fileTitle',
|
|
132
|
+
key: 'fileTitle',
|
|
133
|
+
width: 260,
|
|
134
|
+
fixed: 'left',
|
|
135
|
+
render: function (text, record) { return (React.createElement(Button, { type: "link", style: { padding: 0 }, onClick: function () { return onTitleClick === null || onTitleClick === void 0 ? void 0 : onTitleClick(record); } }, text)); },
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
title: '申办单位',
|
|
139
|
+
dataIndex: 'applyDepName',
|
|
140
|
+
key: 'applyDepName',
|
|
141
|
+
width: 140,
|
|
142
|
+
fixed: 'left',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
title: '团组类型',
|
|
146
|
+
dataIndex: 'flowTypeName',
|
|
147
|
+
key: 'flowTypeName',
|
|
148
|
+
width: 100,
|
|
149
|
+
align: 'center',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
title: '出国(境)任务',
|
|
153
|
+
dataIndex: 'abroadTaskName',
|
|
154
|
+
key: 'abroadTaskName',
|
|
155
|
+
width: 160,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
title: '出访国家/地区',
|
|
159
|
+
dataIndex: 'visitCountryNames',
|
|
160
|
+
key: 'visitCountryNames',
|
|
161
|
+
width: 140,
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
title: '团组负责人',
|
|
165
|
+
dataIndex: 'teamLeaderName',
|
|
166
|
+
key: 'teamLeaderName',
|
|
167
|
+
width: 100,
|
|
168
|
+
align: 'center',
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
title: '拟出发日期',
|
|
172
|
+
dataIndex: 'departureDate',
|
|
173
|
+
key: 'departureDate',
|
|
174
|
+
width: 110,
|
|
175
|
+
align: 'center',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
title: '拟归国(境)日期',
|
|
179
|
+
dataIndex: 'returnDate',
|
|
180
|
+
key: 'returnDate',
|
|
181
|
+
width: 130,
|
|
182
|
+
align: 'center',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
title: '停留天数',
|
|
186
|
+
dataIndex: 'stayDays',
|
|
187
|
+
key: 'stayDays',
|
|
188
|
+
width: 90,
|
|
189
|
+
align: 'center',
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
title: '状态',
|
|
193
|
+
dataIndex: 'groupStatusName',
|
|
194
|
+
key: 'groupStatusName',
|
|
195
|
+
width: 130,
|
|
196
|
+
fixed: 'right',
|
|
197
|
+
align: 'center',
|
|
198
|
+
render: function (text) {
|
|
199
|
+
// 业务侧这里会根据 processInstId 渲染可点击跳转的状态链接,demo 用普通按钮代替
|
|
200
|
+
return (React.createElement(Button, { type: "link", style: { padding: 0 } }, text));
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
title: '操作',
|
|
205
|
+
key: 'operation',
|
|
206
|
+
width: 180,
|
|
207
|
+
fixed: 'right',
|
|
208
|
+
align: 'center',
|
|
209
|
+
render: function (_text, record) { return renderOperations(record); },
|
|
210
|
+
},
|
|
211
|
+
];
|
|
212
|
+
return (React.createElement(Table, { isFlex: true, columns: columns, dataSource: RECORDS, rowKey: "id", bordered: true, pagination: false, scroll: { x: 'max-content' } }));
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* 业务还原用例:右键查看明细 / 全屏
|
|
216
|
+
* 操作列动作统一打印到控制台
|
|
217
|
+
*/
|
|
218
|
+
var BusinessListDemo = function () {
|
|
219
|
+
var onActionHandle = useCallback(function (action, record) {
|
|
220
|
+
console.log('业务操作:', action, record);
|
|
221
|
+
}, []);
|
|
222
|
+
var onTitleClickHandle = useCallback(function (record) {
|
|
223
|
+
console.log('打开单据:', record);
|
|
224
|
+
}, []);
|
|
225
|
+
return (React.createElement(BusinessTableList, { onAction: onActionHandle, onTitleClick: onTitleClickHandle }));
|
|
226
|
+
};
|
|
227
|
+
export default memo(BusinessListDemo);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 业务还原用例:复刻 zmdms-zthr-front 团队成员维护表(fa/apply/Making/component/MemberTable.tsx)的编辑表格用法
|
|
3
|
+
*
|
|
4
|
+
* 用于复现业务反馈的「右键查看明细,弹框没有内容」问题,保持与业务侧完全一致的关键写法:
|
|
5
|
+
* 1. 所有列都只有 title + render,没有 key/dataIndex(此前 flattenColumns
|
|
6
|
+
* 会把这类列全部跳过,导致明细弹框空白);
|
|
7
|
+
* 2. 列头用带红色 * 的 JSX 标识必填(title 是 ReactElement);
|
|
8
|
+
* 3. 单元格直接 render 受控组件(Input / 自定义输入),不传 onEditableSave、
|
|
9
|
+
* 不用 editable 配置;
|
|
10
|
+
* 4. 操作列同样没有 key,render 首行返回 null、其他行返回 Popconfirm 按钮;
|
|
11
|
+
* 5. rowKey 传函数:rowKey={(_, index) => String(index)};
|
|
12
|
+
* 6. Table 配置 bordered、pagination={false}、scroll={{ x: 'max-content' }}。
|
|
13
|
+
*
|
|
14
|
+
* 使用方式:右键表格行 → 查看明细,弹框应展示所有列的单元格内容。
|
|
15
|
+
*/
|
|
16
|
+
import React from 'react';
|
|
17
|
+
declare const _default: React.NamedExoticComponent<{}>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,181 @@
|
|
|
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 __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
13
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
14
|
+
to[j] = from[i];
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* 业务还原用例:复刻 zmdms-zthr-front 团队成员维护表(fa/apply/Making/component/MemberTable.tsx)的编辑表格用法
|
|
19
|
+
*
|
|
20
|
+
* 用于复现业务反馈的「右键查看明细,弹框没有内容」问题,保持与业务侧完全一致的关键写法:
|
|
21
|
+
* 1. 所有列都只有 title + render,没有 key/dataIndex(此前 flattenColumns
|
|
22
|
+
* 会把这类列全部跳过,导致明细弹框空白);
|
|
23
|
+
* 2. 列头用带红色 * 的 JSX 标识必填(title 是 ReactElement);
|
|
24
|
+
* 3. 单元格直接 render 受控组件(Input / 自定义输入),不传 onEditableSave、
|
|
25
|
+
* 不用 editable 配置;
|
|
26
|
+
* 4. 操作列同样没有 key,render 首行返回 null、其他行返回 Popconfirm 按钮;
|
|
27
|
+
* 5. rowKey 传函数:rowKey={(_, index) => String(index)};
|
|
28
|
+
* 6. Table 配置 bordered、pagination={false}、scroll={{ x: 'max-content' }}。
|
|
29
|
+
*
|
|
30
|
+
* 使用方式:右键表格行 → 查看明细,弹框应展示所有列的单元格内容。
|
|
31
|
+
*/
|
|
32
|
+
import React, { memo, useCallback, useState } from 'react';
|
|
33
|
+
import { Popconfirm } from 'antd';
|
|
34
|
+
import Button from '../../components/Button';
|
|
35
|
+
import Input from '../../components/Input';
|
|
36
|
+
import Table from '../../components/Table';
|
|
37
|
+
/** 必填列头(红色 * 前缀,与业务侧 requiredTitle 一致) */
|
|
38
|
+
var requiredTitle = function (title) { return (React.createElement("span", null,
|
|
39
|
+
React.createElement("span", { style: { color: '#ff4d4f', marginRight: 4 } }, "*"),
|
|
40
|
+
title)); };
|
|
41
|
+
var createEmptyMember = function () { return ({}); };
|
|
42
|
+
var INITIAL_MEMBERS = [
|
|
43
|
+
{
|
|
44
|
+
userId: '1',
|
|
45
|
+
userName: '张三',
|
|
46
|
+
sexName: '男',
|
|
47
|
+
birthday: '1990-05',
|
|
48
|
+
lastNameCn: '张',
|
|
49
|
+
firstNameCn: '三',
|
|
50
|
+
positionName: '项目经理',
|
|
51
|
+
mobile: '13800000001',
|
|
52
|
+
idCard: '110101199005011234',
|
|
53
|
+
unitName: '国际业务部',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
userId: '2',
|
|
57
|
+
userName: '李四',
|
|
58
|
+
sexName: '女',
|
|
59
|
+
birthday: '1995-11',
|
|
60
|
+
lastNameCn: '李',
|
|
61
|
+
firstNameCn: '四',
|
|
62
|
+
positionName: '翻译',
|
|
63
|
+
mobile: '13800000002',
|
|
64
|
+
idCard: '310101199511022345',
|
|
65
|
+
unitName: '技术中心',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
userId: undefined,
|
|
69
|
+
userName: undefined,
|
|
70
|
+
sexName: undefined,
|
|
71
|
+
birthday: undefined,
|
|
72
|
+
lastNameCn: undefined,
|
|
73
|
+
firstNameCn: undefined,
|
|
74
|
+
positionName: undefined,
|
|
75
|
+
mobile: undefined,
|
|
76
|
+
idCard: undefined,
|
|
77
|
+
unitName: undefined,
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
/**
|
|
81
|
+
* 业务还原的成员编辑表格(结构与业务侧 MemberTable.tsx 保持一致)
|
|
82
|
+
*/
|
|
83
|
+
var BusinessMemberDemo = function () {
|
|
84
|
+
var _a = useState(INITIAL_MEMBERS), members = _a[0], setMembers = _a[1];
|
|
85
|
+
/** 更新行字段 */
|
|
86
|
+
var updateRow = useCallback(function (index, fields) {
|
|
87
|
+
setMembers(function (prev) {
|
|
88
|
+
return prev.map(function (item, i) { return (i === index ? __assign(__assign({}, item), fields) : item); });
|
|
89
|
+
});
|
|
90
|
+
}, []);
|
|
91
|
+
/** 添加成员 */
|
|
92
|
+
var onAddHandle = useCallback(function () {
|
|
93
|
+
setMembers(function (prev) { return __spreadArray(__spreadArray([], prev), [createEmptyMember()]); });
|
|
94
|
+
}, []);
|
|
95
|
+
/** 删除成员(首行不可删) */
|
|
96
|
+
var onDeleteHandle = useCallback(function (index) {
|
|
97
|
+
setMembers(function (prev) { return prev.filter(function (_, i) { return i !== index; }); });
|
|
98
|
+
}, []);
|
|
99
|
+
var columns = [
|
|
100
|
+
{
|
|
101
|
+
title: '序号',
|
|
102
|
+
width: 55,
|
|
103
|
+
align: 'center',
|
|
104
|
+
fixed: 'left',
|
|
105
|
+
render: function (_, __, index) { return index + 1; },
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
title: requiredTitle('姓名'),
|
|
109
|
+
width: 140,
|
|
110
|
+
fixed: 'left',
|
|
111
|
+
render: function (text, record, index) { return (React.createElement(Input, { value: record === null || record === void 0 ? void 0 : record.userName, disabled: index === 0, placeholder: "\u8BF7\u9009\u62E9\u4EBA\u5458", onChange: function (e) { return updateRow(index, { userName: e.target.value }); } })); },
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
title: '性别',
|
|
115
|
+
width: 70,
|
|
116
|
+
render: function (text, record) { return (React.createElement(Input, { value: record === null || record === void 0 ? void 0 : record.sexName, disabled: true })); },
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
title: '出生年月',
|
|
120
|
+
width: 110,
|
|
121
|
+
render: function (text, record) { return (React.createElement(Input, { value: record === null || record === void 0 ? void 0 : record.birthday, disabled: true })); },
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
title: requiredTitle('中文姓'),
|
|
125
|
+
width: 90,
|
|
126
|
+
render: function (text, record, index) { return (React.createElement(Input, { value: record === null || record === void 0 ? void 0 : record.lastNameCn, onChange: function (e) {
|
|
127
|
+
return updateRow(index, { lastNameCn: e.target.value });
|
|
128
|
+
} })); },
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
title: requiredTitle('中文名'),
|
|
132
|
+
width: 90,
|
|
133
|
+
render: function (text, record, index) { return (React.createElement(Input, { value: record === null || record === void 0 ? void 0 : record.firstNameCn, onChange: function (e) {
|
|
134
|
+
return updateRow(index, { firstNameCn: e.target.value });
|
|
135
|
+
} })); },
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
title: '身份证号',
|
|
139
|
+
width: 170,
|
|
140
|
+
render: function (text, record) { return (React.createElement(Input, { value: record === null || record === void 0 ? void 0 : record.idCard, disabled: true })); },
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
title: '单位',
|
|
144
|
+
width: 150,
|
|
145
|
+
render: function (text, record) { return (React.createElement(Input, { value: record === null || record === void 0 ? void 0 : record.unitName, disabled: true })); },
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
title: requiredTitle('职务'),
|
|
149
|
+
width: 140,
|
|
150
|
+
render: function (text, record, index) { return (React.createElement(Input, { value: record === null || record === void 0 ? void 0 : record.positionName, onChange: function (e) {
|
|
151
|
+
return updateRow(index, { positionName: e.target.value });
|
|
152
|
+
} })); },
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
title: requiredTitle('手机号'),
|
|
156
|
+
width: 130,
|
|
157
|
+
render: function (text, record, index) { return (React.createElement(Input, { value: record === null || record === void 0 ? void 0 : record.mobile, maxLength: 11, onChange: function (e) { return updateRow(index, { mobile: e.target.value }); } })); },
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
title: '操作',
|
|
161
|
+
width: 70,
|
|
162
|
+
align: 'center',
|
|
163
|
+
fixed: 'right',
|
|
164
|
+
render: function (text, record, index) {
|
|
165
|
+
// 首行不可删除:render 返回 null,验证明细对 null render 的兜底
|
|
166
|
+
return index === 0 ? null : (React.createElement(Popconfirm, { title: "\u786E\u5B9A\u5220\u9664\u8BE5\u6210\u5458\u5417\uFF1F", onConfirm: function () { return onDeleteHandle(index); }, okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88" },
|
|
167
|
+
React.createElement(Button, { type: "link", size: "small" }, "\u5220\u9664")));
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
];
|
|
171
|
+
return (React.createElement("div", null,
|
|
172
|
+
React.createElement("div", { style: { marginBottom: 8 } },
|
|
173
|
+
React.createElement(Button, { type: "link", size: "small", onClick: onAddHandle }, "\uFF0B \u6DFB\u52A0\u6210\u5458")),
|
|
174
|
+
React.createElement(Table, { rowKey: function (_, index) { return String(index); }, columns: columns, dataSource: members, bordered: true, pagination: false, scroll: { x: 'max-content' },
|
|
175
|
+
// 本表格虽然没有传 onEditableSave(不算组件意义上的"编辑表格"),
|
|
176
|
+
// 但单元格实际都是输入框:全屏后 Select 等浮层挂在 body,
|
|
177
|
+
// 会被全屏的 top layer 遮挡无法显示,因此单独关闭右键全屏入口。
|
|
178
|
+
// 真编辑表格(传 onEditableSave)默认就没有全屏,无需配置
|
|
179
|
+
isContextMenuFullscreen: false })));
|
|
180
|
+
};
|
|
181
|
+
export default memo(BusinessMemberDemo);
|