@cgeui/business-components 0.0.2 → 0.0.3
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/esm/BatteryPack/common.js +134 -0
- package/dist/esm/BatteryPack/demo/alarmChecked.js +226 -0
- package/dist/esm/BatteryPack/demo/assets/BatteryPackCombined.svg +49 -0
- package/dist/esm/BatteryPack/demo/assets/BatteryPackWithIsor.svg +51 -0
- package/dist/esm/BatteryPack/demo/basic.js +174 -0
- package/dist/esm/BatteryPack/demo/batteryClick.js +178 -0
- package/dist/esm/BatteryPack/demo/combined.js +241 -0
- package/dist/esm/BatteryPack/demo/count.js +176 -0
- package/dist/esm/BatteryPack/demo/fault.js +192 -0
- package/dist/esm/BatteryPack/demo/faultWithIsor.js +235 -0
- package/dist/esm/BatteryPack/demo/lightType.js +207 -0
- package/dist/esm/BatteryPack/demo/multiple.js +177 -0
- package/dist/esm/BatteryPack/demo/setDefaultValue.js +90 -0
- package/dist/esm/BatteryPack/demo/showCellInfo.js +86 -0
- package/dist/esm/BatteryPack/demo/showIsor.js +184 -0
- package/dist/esm/BatteryPack/index.js +624 -0
- package/dist/esm/BatteryPack/index.less +411 -0
- package/dist/esm/BatteryPack/interface.js +1 -0
- package/dist/esm/BatteryPack/theme/dark.less +11 -0
- package/dist/esm/BatteryPack/theme/default.less +14 -0
- package/dist/esm/BatteryPack/theme/index.less +2 -0
- package/dist/esm/BatteryPack/tooltip.less +53 -0
- package/dist/esm/BatteryPack/type.js +1 -0
- package/dist/esm/BatteryPack/utils.js +51 -0
- package/dist/esm/Card/CardTitle/CardTitle.js +23 -0
- package/dist/esm/Card/CardTitle/index.js +1 -0
- package/dist/esm/Card/CardTitle/index.less +15 -0
- package/dist/esm/Card/NormalCard/CatlCard.js +33 -0
- package/dist/esm/Card/NormalCard/index.js +1 -0
- package/dist/esm/Card/NormalCard/index.less +15 -0
- package/dist/esm/Card/assets/icon-notice.svg +4 -0
- package/dist/esm/Card/index.js +2 -0
- package/dist/esm/DataVisualProgress/Components/AnalysisFaultLevelPage.js +52 -0
- package/dist/esm/DataVisualProgress/demo/alarmChecked.js +50 -0
- package/dist/esm/DataVisualProgress/demo/alarmFaultShow.js +115 -0
- package/dist/esm/DataVisualProgress/demo/assets/backgroundImage.svg +47 -0
- package/dist/esm/DataVisualProgress/demo/basic.js +148 -0
- package/dist/esm/DataVisualProgress/demo/data.js +114 -0
- package/dist/esm/DataVisualProgress/demo/dayListOption.js +148 -0
- package/dist/esm/DataVisualProgress/demo/legendData.js +125 -0
- package/dist/esm/DataVisualProgress/demo/occurAlarm.js +486 -0
- package/dist/esm/DataVisualProgress/demo/option.js +1009 -0
- package/dist/esm/DataVisualProgress/demo/timeFilterOption.js +74 -0
- package/dist/esm/DataVisualProgress/index.js +396 -0
- package/dist/esm/DataVisualProgress/interface.js +1 -0
- package/dist/esm/DataVisualProgress/style.less +266 -0
- package/dist/esm/DataVisualProgress/theme/dark.less +5 -0
- package/dist/esm/DataVisualProgress/theme/default.less +5 -0
- package/dist/esm/DataVisualProgress/theme/index.less +2 -0
- package/dist/esm/DataVisualProgress/utils.js +398 -0
- package/dist/esm/EditableInput/demo/basic.js +23 -0
- package/dist/esm/EditableInput/demo/textarea.js +30 -0
- package/dist/esm/EditableInput/index.js +75 -0
- package/dist/esm/EditableInput/index.less +26 -0
- package/dist/esm/EditableInput/interface.js +1 -0
- package/dist/esm/ElectricityPriceChart/config.js +141 -0
- package/dist/esm/ElectricityPriceChart/demo/assets/basic.svg +52 -0
- package/dist/esm/ElectricityPriceChart/demo/basic.js +9 -0
- package/dist/esm/ElectricityPriceChart/demo/legend.js +10 -0
- package/dist/esm/ElectricityPriceChart/demo/multi.js +13 -0
- package/dist/esm/ElectricityPriceChart/demo/noxAxis.js +10 -0
- package/dist/esm/ElectricityPriceChart/demo/show.js +41 -0
- package/dist/esm/ElectricityPriceChart/index.js +53 -0
- package/dist/esm/ElectricityPriceChart/index.less +33 -0
- package/dist/esm/ElectricityPriceChart/interface.js +1 -0
- package/dist/esm/ElectricityPriceChart/locale/en-US.js +8 -0
- package/dist/esm/ElectricityPriceChart/locale/index.js +7 -0
- package/dist/esm/ElectricityPriceChart/locale/zh-CN.js +8 -0
- package/dist/esm/ElectricityPriceChart/utils.js +26 -0
- package/dist/esm/FaultCalendar/demo/basic.js +94 -0
- package/dist/esm/FaultCalendar/demo/basic.less +4 -0
- package/dist/esm/FaultCalendar/index.js +78 -0
- package/dist/esm/FaultCalendar/index.less +158 -0
- package/dist/esm/FaultCalendar/interface.js +1 -0
- package/dist/esm/FaultCalendar/util.js +62 -0
- package/dist/esm/Form/SchemaForm/SchemaForm.js +149 -0
- package/dist/esm/Form/SchemaForm/index.js +38 -0
- package/dist/esm/Form/SchemaForm/index.less +22 -0
- package/dist/esm/Form/StateForm/index.js +110 -0
- package/dist/esm/Form/StateForm/index.less +75 -0
- package/dist/esm/Form/StateFormGroup/StateFormGroup.js +59 -0
- package/dist/esm/Form/StateFormGroup/index.js +1 -0
- package/dist/esm/Form/index.js +2 -0
- package/dist/esm/GroupTagCascader/demo/basic.js +67 -0
- package/dist/esm/GroupTagCascader/demo/index.js +1 -0
- package/dist/esm/GroupTagCascader/index.js +79 -0
- package/dist/esm/GroupTagCascader/interface.js +1 -0
- package/dist/esm/GroupTagCascader/locale/en-US.js +5 -0
- package/dist/esm/GroupTagCascader/locale/index.js +7 -0
- package/dist/esm/GroupTagCascader/locale/zh-CN.js +5 -0
- package/dist/esm/GroupTagCascader/util.js +124 -0
- package/dist/esm/IndicatorCard/index.js +25 -0
- package/dist/esm/IndicatorCard/index.less +30 -0
- package/dist/esm/NumberCard/NumberCard.js +123 -0
- package/dist/esm/NumberCard/demo/assets/icon-cloudAlarm.png +0 -0
- package/dist/esm/NumberCard/demo/assets/icon-localAlarm.png +0 -0
- package/dist/esm/NumberCard/demo/assets/icon-safetyWarning.png +0 -0
- package/dist/esm/NumberCard/demo/basic.js +21 -0
- package/dist/esm/NumberCard/demo/column.js +34 -0
- package/dist/esm/NumberCard/demo/description.js +54 -0
- package/dist/esm/NumberCard/demo/icon.js +51 -0
- package/dist/esm/NumberCard/demo/isShowBasisCompare.js +88 -0
- package/dist/esm/NumberCard/demo/size.js +40 -0
- package/dist/esm/NumberCard/demo/style.js +32 -0
- package/dist/esm/NumberCard/demo/textLayout.js +34 -0
- package/dist/esm/NumberCard/demo/theme.js +57 -0
- package/dist/esm/NumberCard/index.css +166 -0
- package/dist/esm/NumberCard/index.js +1 -0
- package/dist/esm/NumberCard/index.less +367 -0
- package/dist/esm/NumberCard/interface.js +1 -0
- package/dist/esm/NumberCard/util.js +49 -0
- package/dist/esm/OperationButtons/demo/basic.js +81 -0
- package/dist/esm/OperationButtons/index.js +78 -0
- package/dist/esm/OperationButtons/index.less +72 -0
- package/dist/esm/OperationButtons/interface.js +1 -0
- package/dist/esm/PageHeader/demo/basic.js +13 -0
- package/dist/esm/PageHeader/demo/whiteBg.js +49 -0
- package/dist/esm/PageHeader/index.js +15 -0
- package/dist/esm/ProLayout/ViewPage/index.js +31 -0
- package/dist/esm/ProLayout/index.js +172 -0
- package/dist/esm/ProLayout/interface.js +1 -0
- package/dist/esm/ProLayout/style.less +40 -0
- package/dist/esm/ProLayout/utils.js +39 -0
- package/dist/esm/TableInPdf/ItemTable.js +35 -0
- package/dist/esm/TableInPdf/demo/basic.js +63 -0
- package/dist/esm/TableInPdf/index.js +57 -0
- package/dist/esm/TableInPdf/index.less +12 -0
- package/dist/esm/TableInPdf/interface.js +1 -0
- package/dist/esm/TableInPdf/utils.js +10 -0
- package/dist/esm/TablePage/components/drawerForm.js +352 -0
- package/dist/esm/TablePage/components/toolButton.js +168 -0
- package/dist/esm/TablePage/demo/addNewLine.js +72 -0
- package/dist/esm/TablePage/demo/adjust.less +3 -0
- package/dist/esm/TablePage/demo/appendBatchOperation.js +122 -0
- package/dist/esm/TablePage/demo/basic.js +49 -0
- package/dist/esm/TablePage/demo/batchDelete.js +63 -0
- package/dist/esm/TablePage/demo/batchDeleteAndOperation.js +132 -0
- package/dist/esm/TablePage/demo/colorPicker.js +8 -0
- package/dist/esm/TablePage/demo/createdInLine.js +64 -0
- package/dist/esm/TablePage/demo/customForm.js +111 -0
- package/dist/esm/TablePage/demo/drawFormLayout.js +49 -0
- package/dist/esm/TablePage/demo/drawFormTextPlaceholder.js +53 -0
- package/dist/esm/TablePage/demo/formConfig.js +53 -0
- package/dist/esm/TablePage/demo/operationConfig.js +65 -0
- package/dist/esm/TablePage/demo/reactions.js +72 -0
- package/dist/esm/TablePage/demo/reactions2.js +74 -0
- package/dist/esm/TablePage/demo/selectAll.js +122 -0
- package/dist/esm/TablePage/demo/toolButtonOffset.js +53 -0
- package/dist/esm/TablePage/index.css +106 -0
- package/dist/esm/TablePage/index.js +600 -0
- package/dist/esm/TablePage/index.less +171 -0
- package/dist/esm/TablePage/type.js +1 -0
- package/dist/esm/TablePage/utils.js +112 -0
- package/dist/esm/index.js +14 -0
- package/dist/esm/interface.js +2 -0
- package/dist/esm/locales/en-US.js +58 -0
- package/dist/esm/locales/index.js +7 -0
- package/dist/esm/locales/zh-CN.js +58 -0
- package/dist/esm/theme/var/common.less +148 -0
- package/dist/esm/theme/var/dark.less +28 -0
- package/dist/esm/theme/var/index.less +5 -0
- package/dist/esm/theme/var/light.less +28 -0
- package/dist/esm/utils/constants/battery.js +14 -0
- package/dist/esm/utils/constants/env.js +6 -0
- package/dist/esm/utils/constants/helper.js +5 -0
- package/dist/esm/utils/constants/table.js +17 -0
- package/dist/esm/utils/formAdapter/BasicAdapter.js +71 -0
- package/dist/esm/utils/formAdapter/FormSchemaAdapter.js +149 -0
- package/dist/esm/utils/index.js +5 -0
- package/dist/esm/utils/locale.js +10 -0
- package/dist/esm/utils/store/action.js +316 -0
- package/dist/esm/utils/store/index.js +44 -0
- package/dist/esm/utils/tableAdapter/CustomFilter.js +206 -0
- package/dist/esm/utils/tableAdapter/index.less +50 -0
- package/dist/esm/utils/tableAdapter/table.js +195 -0
- package/dist/esm/utils/time/index.js +26 -0
- package/dist/esm/utils/types/data.d.ts +51 -0
- package/dist/lib/BatteryPack/common.js +138 -0
- package/dist/lib/BatteryPack/demo/alarmChecked.js +232 -0
- package/dist/lib/BatteryPack/demo/assets/BatteryPackCombined.svg +49 -0
- package/dist/lib/BatteryPack/demo/assets/BatteryPackWithIsor.svg +51 -0
- package/dist/lib/BatteryPack/demo/basic.js +180 -0
- package/dist/lib/BatteryPack/demo/batteryClick.js +184 -0
- package/dist/lib/BatteryPack/demo/combined.js +247 -0
- package/dist/lib/BatteryPack/demo/count.js +182 -0
- package/dist/lib/BatteryPack/demo/fault.js +198 -0
- package/dist/lib/BatteryPack/demo/faultWithIsor.js +242 -0
- package/dist/lib/BatteryPack/demo/lightType.js +211 -0
- package/dist/lib/BatteryPack/demo/multiple.js +183 -0
- package/dist/lib/BatteryPack/demo/setDefaultValue.js +96 -0
- package/dist/lib/BatteryPack/demo/showCellInfo.js +92 -0
- package/dist/lib/BatteryPack/demo/showIsor.js +190 -0
- package/dist/lib/BatteryPack/index.js +627 -0
- package/dist/lib/BatteryPack/index.less +411 -0
- package/dist/lib/BatteryPack/interface.js +5 -0
- package/dist/lib/BatteryPack/theme/dark.less +11 -0
- package/dist/lib/BatteryPack/theme/default.less +14 -0
- package/dist/lib/BatteryPack/theme/index.less +2 -0
- package/dist/lib/BatteryPack/tooltip.less +53 -0
- package/dist/lib/BatteryPack/type.js +5 -0
- package/dist/lib/BatteryPack/utils.js +58 -0
- package/dist/lib/Card/CardTitle/CardTitle.js +29 -0
- package/dist/lib/Card/CardTitle/index.js +13 -0
- package/dist/lib/Card/CardTitle/index.less +15 -0
- package/dist/lib/Card/NormalCard/CatlCard.js +38 -0
- package/dist/lib/Card/NormalCard/index.js +13 -0
- package/dist/lib/Card/NormalCard/index.less +15 -0
- package/dist/lib/Card/assets/icon-notice.svg +4 -0
- package/dist/lib/Card/index.js +27 -0
- package/dist/lib/DataVisualProgress/Components/AnalysisFaultLevelPage.js +56 -0
- package/dist/lib/DataVisualProgress/demo/alarmChecked.js +56 -0
- package/dist/lib/DataVisualProgress/demo/alarmFaultShow.js +121 -0
- package/dist/lib/DataVisualProgress/demo/assets/backgroundImage.svg +47 -0
- package/dist/lib/DataVisualProgress/demo/basic.js +155 -0
- package/dist/lib/DataVisualProgress/demo/data.js +120 -0
- package/dist/lib/DataVisualProgress/demo/dayListOption.js +154 -0
- package/dist/lib/DataVisualProgress/demo/legendData.js +131 -0
- package/dist/lib/DataVisualProgress/demo/occurAlarm.js +492 -0
- package/dist/lib/DataVisualProgress/demo/option.js +1015 -0
- package/dist/lib/DataVisualProgress/demo/timeFilterOption.js +80 -0
- package/dist/lib/DataVisualProgress/index.js +399 -0
- package/dist/lib/DataVisualProgress/interface.js +5 -0
- package/dist/lib/DataVisualProgress/style.less +266 -0
- package/dist/lib/DataVisualProgress/theme/dark.less +5 -0
- package/dist/lib/DataVisualProgress/theme/default.less +5 -0
- package/dist/lib/DataVisualProgress/theme/index.less +2 -0
- package/dist/lib/DataVisualProgress/utils.js +404 -0
- package/dist/lib/EditableInput/demo/basic.js +30 -0
- package/dist/lib/EditableInput/demo/textarea.js +37 -0
- package/dist/lib/EditableInput/index.js +80 -0
- package/dist/lib/EditableInput/index.less +26 -0
- package/dist/lib/EditableInput/interface.js +5 -0
- package/dist/lib/ElectricityPriceChart/config.js +148 -0
- package/dist/lib/ElectricityPriceChart/demo/assets/basic.svg +52 -0
- package/dist/lib/ElectricityPriceChart/demo/basic.js +16 -0
- package/dist/lib/ElectricityPriceChart/demo/legend.js +17 -0
- package/dist/lib/ElectricityPriceChart/demo/multi.js +20 -0
- package/dist/lib/ElectricityPriceChart/demo/noxAxis.js +17 -0
- package/dist/lib/ElectricityPriceChart/demo/show.js +48 -0
- package/dist/lib/ElectricityPriceChart/index.js +58 -0
- package/dist/lib/ElectricityPriceChart/index.less +33 -0
- package/dist/lib/ElectricityPriceChart/interface.js +5 -0
- package/dist/lib/ElectricityPriceChart/locale/en-US.js +14 -0
- package/dist/lib/ElectricityPriceChart/locale/index.js +14 -0
- package/dist/lib/ElectricityPriceChart/locale/zh-CN.js +14 -0
- package/dist/lib/ElectricityPriceChart/utils.js +32 -0
- package/dist/lib/FaultCalendar/demo/basic.js +100 -0
- package/dist/lib/FaultCalendar/demo/basic.less +4 -0
- package/dist/lib/FaultCalendar/index.js +83 -0
- package/dist/lib/FaultCalendar/index.less +158 -0
- package/dist/lib/FaultCalendar/interface.js +5 -0
- package/dist/lib/FaultCalendar/util.js +68 -0
- package/dist/lib/Form/SchemaForm/SchemaForm.js +155 -0
- package/dist/lib/Form/SchemaForm/index.js +45 -0
- package/dist/lib/Form/SchemaForm/index.less +22 -0
- package/dist/lib/Form/StateForm/index.js +115 -0
- package/dist/lib/Form/StateForm/index.less +75 -0
- package/dist/lib/Form/StateFormGroup/StateFormGroup.js +66 -0
- package/dist/lib/Form/StateFormGroup/index.js +13 -0
- package/dist/lib/Form/index.js +28 -0
- package/dist/lib/GroupTagCascader/demo/basic.js +72 -0
- package/dist/lib/GroupTagCascader/demo/index.js +13 -0
- package/dist/lib/GroupTagCascader/index.js +85 -0
- package/dist/lib/GroupTagCascader/interface.js +5 -0
- package/dist/lib/GroupTagCascader/locale/en-US.js +11 -0
- package/dist/lib/GroupTagCascader/locale/index.js +14 -0
- package/dist/lib/GroupTagCascader/locale/zh-CN.js +11 -0
- package/dist/lib/GroupTagCascader/util.js +130 -0
- package/dist/lib/IndicatorCard/index.js +31 -0
- package/dist/lib/IndicatorCard/index.less +30 -0
- package/dist/lib/NumberCard/NumberCard.js +127 -0
- package/dist/lib/NumberCard/demo/assets/icon-cloudAlarm.png +0 -0
- package/dist/lib/NumberCard/demo/assets/icon-localAlarm.png +0 -0
- package/dist/lib/NumberCard/demo/assets/icon-safetyWarning.png +0 -0
- package/dist/lib/NumberCard/demo/basic.js +27 -0
- package/dist/lib/NumberCard/demo/column.js +40 -0
- package/dist/lib/NumberCard/demo/description.js +59 -0
- package/dist/lib/NumberCard/demo/icon.js +56 -0
- package/dist/lib/NumberCard/demo/isShowBasisCompare.js +93 -0
- package/dist/lib/NumberCard/demo/size.js +44 -0
- package/dist/lib/NumberCard/demo/style.js +36 -0
- package/dist/lib/NumberCard/demo/textLayout.js +38 -0
- package/dist/lib/NumberCard/demo/theme.js +61 -0
- package/dist/lib/NumberCard/index.css +166 -0
- package/dist/lib/NumberCard/index.js +13 -0
- package/dist/lib/NumberCard/index.less +367 -0
- package/dist/lib/NumberCard/interface.js +5 -0
- package/dist/lib/NumberCard/util.js +53 -0
- package/dist/lib/OperationButtons/demo/basic.js +88 -0
- package/dist/lib/OperationButtons/index.js +83 -0
- package/dist/lib/OperationButtons/index.less +72 -0
- package/dist/lib/OperationButtons/interface.js +5 -0
- package/dist/lib/PageHeader/demo/basic.js +14 -0
- package/dist/lib/PageHeader/demo/whiteBg.js +50 -0
- package/dist/lib/PageHeader/index.js +20 -0
- package/dist/lib/ProLayout/ViewPage/index.js +36 -0
- package/dist/lib/ProLayout/index.js +179 -0
- package/dist/lib/ProLayout/interface.js +5 -0
- package/dist/lib/ProLayout/style.less +40 -0
- package/dist/lib/ProLayout/utils.js +44 -0
- package/dist/lib/TableInPdf/ItemTable.js +39 -0
- package/dist/lib/TableInPdf/demo/basic.js +68 -0
- package/dist/lib/TableInPdf/index.js +61 -0
- package/dist/lib/TableInPdf/index.less +12 -0
- package/dist/lib/TableInPdf/interface.js +5 -0
- package/dist/lib/TableInPdf/utils.js +15 -0
- package/dist/lib/TablePage/components/drawerForm.js +356 -0
- package/dist/lib/TablePage/components/toolButton.js +173 -0
- package/dist/lib/TablePage/demo/addNewLine.js +78 -0
- package/dist/lib/TablePage/demo/adjust.less +3 -0
- package/dist/lib/TablePage/demo/appendBatchOperation.js +127 -0
- package/dist/lib/TablePage/demo/basic.js +55 -0
- package/dist/lib/TablePage/demo/batchDelete.js +69 -0
- package/dist/lib/TablePage/demo/batchDeleteAndOperation.js +137 -0
- package/dist/lib/TablePage/demo/colorPicker.js +14 -0
- package/dist/lib/TablePage/demo/createdInLine.js +70 -0
- package/dist/lib/TablePage/demo/customForm.js +115 -0
- package/dist/lib/TablePage/demo/drawFormLayout.js +55 -0
- package/dist/lib/TablePage/demo/drawFormTextPlaceholder.js +59 -0
- package/dist/lib/TablePage/demo/formConfig.js +59 -0
- package/dist/lib/TablePage/demo/operationConfig.js +71 -0
- package/dist/lib/TablePage/demo/reactions.js +78 -0
- package/dist/lib/TablePage/demo/reactions2.js +80 -0
- package/dist/lib/TablePage/demo/selectAll.js +127 -0
- package/dist/lib/TablePage/demo/toolButtonOffset.js +59 -0
- package/dist/lib/TablePage/index.css +106 -0
- package/dist/lib/TablePage/index.js +605 -0
- package/dist/lib/TablePage/index.less +171 -0
- package/dist/lib/TablePage/type.js +5 -0
- package/dist/lib/TablePage/utils.js +119 -0
- package/dist/lib/index.js +117 -0
- package/dist/lib/interface.js +11 -0
- package/dist/lib/locales/en-US.js +65 -0
- package/dist/lib/locales/index.js +14 -0
- package/dist/lib/locales/zh-CN.js +65 -0
- package/dist/lib/theme/var/common.less +148 -0
- package/dist/lib/theme/var/dark.less +28 -0
- package/dist/lib/theme/var/index.less +5 -0
- package/dist/lib/theme/var/light.less +28 -0
- package/dist/lib/utils/constants/battery.js +20 -0
- package/dist/lib/utils/constants/env.js +12 -0
- package/dist/lib/utils/constants/helper.js +11 -0
- package/dist/lib/utils/constants/table.js +23 -0
- package/dist/lib/utils/formAdapter/BasicAdapter.js +77 -0
- package/dist/lib/utils/formAdapter/FormSchemaAdapter.js +155 -0
- package/dist/lib/utils/index.js +60 -0
- package/dist/lib/utils/locale.js +16 -0
- package/dist/lib/utils/store/action.js +322 -0
- package/dist/lib/utils/store/index.js +50 -0
- package/dist/lib/utils/tableAdapter/CustomFilter.js +211 -0
- package/dist/lib/utils/tableAdapter/index.less +50 -0
- package/dist/lib/utils/tableAdapter/table.js +200 -0
- package/dist/lib/utils/time/index.js +33 -0
- package/dist/lib/utils/types/data.d.ts +51 -0
- package/package.json +2 -1
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["request", "columns", "search", "customOperation", "lang", "scroll", "defaultOperationConfig", "appendOperation", "appendBatchOperation", "batchDelete", "appendButton", "components", "drawerWidth", "langPackage", "appendOperationLayout", "isUseIntl", "customIntl", "isSelectAll", "currentPageData", "total", "rowKey", "titleSlot", "leftSlot", "drawFormLayout", "drawFormTextPlaceholder", "toolButtonOffset", "tablePageRef"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
9
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
13
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
14
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
15
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
18
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
19
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
20
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
22
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
23
|
+
import { Button, Modal, showConfirm, Space } from '@cgeui/components';
|
|
24
|
+
import { enUSIntl, ProTable, zhCNIntl } from '@cgeui/pro-components';
|
|
25
|
+
import { throttle } from 'lodash';
|
|
26
|
+
import { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
27
|
+
import { IntlProvider } from 'react-intl';
|
|
28
|
+
import locales from "../locales";
|
|
29
|
+
import { getLocale, TableColumAdapter } from "../utils";
|
|
30
|
+
import DrawerForm from "./components/drawerForm";
|
|
31
|
+
import ToolButtons from "./components/toolButton";
|
|
32
|
+
import "./index.less";
|
|
33
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
34
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
35
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
36
|
+
var POPUP_CONTAINER_COMPONENTS = ['select', 'treeSelect', 'time', 'timeRange', 'cascader'];
|
|
37
|
+
var TablePage = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
38
|
+
var _defaultOperationConf, _defaultOperationConf2, _defaultOperationConf3, _defaultOperationConf4, _defaultOperationConf5, _defaultOperationConf6, _defaultOperationConf7, _defaultOperationConf8, _defaultOperationConf9, _defaultOperationConf10, _defaultOperationConf11, _defaultOperationConf12, _defaultOperationConf13, _defaultOperationConf14, _defaultOperationConf15;
|
|
39
|
+
var request = _ref.request,
|
|
40
|
+
columns = _ref.columns,
|
|
41
|
+
_ref$search = _ref.search,
|
|
42
|
+
search = _ref$search === void 0 ? {
|
|
43
|
+
labelWidth: 'auto',
|
|
44
|
+
collapsed: false,
|
|
45
|
+
collapseRender: function collapseRender() {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
} : _ref$search,
|
|
49
|
+
_ref$customOperation = _ref.customOperation,
|
|
50
|
+
customOperation = _ref$customOperation === void 0 ? false : _ref$customOperation,
|
|
51
|
+
lang = _ref.lang,
|
|
52
|
+
scroll = _ref.scroll,
|
|
53
|
+
_ref$defaultOperation = _ref.defaultOperationConfig,
|
|
54
|
+
defaultOperationConfig = _ref$defaultOperation === void 0 ? {
|
|
55
|
+
C: {},
|
|
56
|
+
R: {},
|
|
57
|
+
U: {},
|
|
58
|
+
D: {}
|
|
59
|
+
} : _ref$defaultOperation,
|
|
60
|
+
appendOperation = _ref.appendOperation,
|
|
61
|
+
appendBatchOperation = _ref.appendBatchOperation,
|
|
62
|
+
_ref$batchDelete = _ref.batchDelete,
|
|
63
|
+
batchDelete = _ref$batchDelete === void 0 ? false : _ref$batchDelete,
|
|
64
|
+
appendButton = _ref.appendButton,
|
|
65
|
+
components = _ref.components,
|
|
66
|
+
drawerWidth = _ref.drawerWidth,
|
|
67
|
+
langPackage = _ref.langPackage,
|
|
68
|
+
_ref$appendOperationL = _ref.appendOperationLayout,
|
|
69
|
+
appendOperationLayout = _ref$appendOperationL === void 0 ? 'right' : _ref$appendOperationL,
|
|
70
|
+
_ref$isUseIntl = _ref.isUseIntl,
|
|
71
|
+
isUseIntl = _ref$isUseIntl === void 0 ? true : _ref$isUseIntl,
|
|
72
|
+
customIntl = _ref.customIntl,
|
|
73
|
+
_ref$isSelectAll = _ref.isSelectAll,
|
|
74
|
+
isSelectAll = _ref$isSelectAll === void 0 ? false : _ref$isSelectAll,
|
|
75
|
+
currentPageData = _ref.currentPageData,
|
|
76
|
+
total = _ref.total,
|
|
77
|
+
_ref$rowKey = _ref.rowKey,
|
|
78
|
+
rowKey = _ref$rowKey === void 0 ? 'id' : _ref$rowKey,
|
|
79
|
+
titleSlot = _ref.titleSlot,
|
|
80
|
+
leftSlot = _ref.leftSlot,
|
|
81
|
+
_ref$drawFormLayout = _ref.drawFormLayout,
|
|
82
|
+
drawFormLayout = _ref$drawFormLayout === void 0 ? 'horizontal' : _ref$drawFormLayout,
|
|
83
|
+
drawFormTextPlaceholder = _ref.drawFormTextPlaceholder,
|
|
84
|
+
toolButtonOffset = _ref.toolButtonOffset,
|
|
85
|
+
tablePageRef = _ref.tablePageRef,
|
|
86
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
87
|
+
var curLang = lang || getLocale() || 'zh-CN';
|
|
88
|
+
var locale = locales[curLang];
|
|
89
|
+
var tableLocal = locale === null || locale === void 0 ? void 0 : locale.Table;
|
|
90
|
+
var actionRef = useRef();
|
|
91
|
+
var _useState = useState({}),
|
|
92
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
93
|
+
curRow = _useState2[0],
|
|
94
|
+
setCurRow = _useState2[1];
|
|
95
|
+
var _useState3 = useState(false),
|
|
96
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
97
|
+
isShowDetail = _useState4[0],
|
|
98
|
+
setIsShowDetail = _useState4[1];
|
|
99
|
+
var _useState5 = useState(false),
|
|
100
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
101
|
+
isShowEdit = _useState6[0],
|
|
102
|
+
setIsShowEdit = _useState6[1];
|
|
103
|
+
var _useState7 = useState(false),
|
|
104
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
105
|
+
isShowAdd = _useState8[0],
|
|
106
|
+
setIsShowAdd = _useState8[1];
|
|
107
|
+
var _useState9 = useState(null),
|
|
108
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
109
|
+
addFormDefaultValue = _useState10[0],
|
|
110
|
+
setAddFormDefaultValue = _useState10[1];
|
|
111
|
+
var _useState11 = useState(false),
|
|
112
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
113
|
+
isLoading = _useState12[0],
|
|
114
|
+
setIsLoading = _useState12[1];
|
|
115
|
+
//批量处理功能
|
|
116
|
+
var _useState13 = useState([]),
|
|
117
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
118
|
+
selectedRowsArr = _useState14[0],
|
|
119
|
+
setSelectedRowsArr = _useState14[1];
|
|
120
|
+
var isShowReadBtn = !defaultOperationConfig || (defaultOperationConfig === null || defaultOperationConfig === void 0 ? void 0 : defaultOperationConfig.R);
|
|
121
|
+
var isShowUpdateBtn = !defaultOperationConfig || (defaultOperationConfig === null || defaultOperationConfig === void 0 ? void 0 : defaultOperationConfig.U);
|
|
122
|
+
var isShowCreateInLineBtn = !defaultOperationConfig || (defaultOperationConfig === null || defaultOperationConfig === void 0 ? void 0 : defaultOperationConfig.CL);
|
|
123
|
+
var isShowDeleteBtn = !defaultOperationConfig || (defaultOperationConfig === null || defaultOperationConfig === void 0 ? void 0 : defaultOperationConfig.D);
|
|
124
|
+
var isShowBatchDeleteBtn = batchDelete || (defaultOperationConfig === null || defaultOperationConfig === void 0 ? void 0 : defaultOperationConfig.BD); //默认不显示
|
|
125
|
+
|
|
126
|
+
var deleteTitle = defaultOperationConfig === null || defaultOperationConfig === void 0 || (_defaultOperationConf = defaultOperationConfig.D) === null || _defaultOperationConf === void 0 ? void 0 : _defaultOperationConf.title;
|
|
127
|
+
var readText = defaultOperationConfig === null || defaultOperationConfig === void 0 || (_defaultOperationConf2 = defaultOperationConfig.R) === null || _defaultOperationConf2 === void 0 ? void 0 : _defaultOperationConf2.text;
|
|
128
|
+
var updateText = defaultOperationConfig === null || defaultOperationConfig === void 0 || (_defaultOperationConf3 = defaultOperationConfig.U) === null || _defaultOperationConf3 === void 0 ? void 0 : _defaultOperationConf3.text;
|
|
129
|
+
var deleteText = defaultOperationConfig === null || defaultOperationConfig === void 0 || (_defaultOperationConf4 = defaultOperationConfig.D) === null || _defaultOperationConf4 === void 0 ? void 0 : _defaultOperationConf4.text;
|
|
130
|
+
var createInLineText = defaultOperationConfig === null || defaultOperationConfig === void 0 || (_defaultOperationConf5 = defaultOperationConfig.CL) === null || _defaultOperationConf5 === void 0 ? void 0 : _defaultOperationConf5.text;
|
|
131
|
+
var deleteContent = defaultOperationConfig === null || defaultOperationConfig === void 0 || (_defaultOperationConf6 = defaultOperationConfig.D) === null || _defaultOperationConf6 === void 0 ? void 0 : _defaultOperationConf6.content;
|
|
132
|
+
var deleteEvent = defaultOperationConfig === null || defaultOperationConfig === void 0 || (_defaultOperationConf7 = defaultOperationConfig.D) === null || _defaultOperationConf7 === void 0 ? void 0 : _defaultOperationConf7.proxyEvent;
|
|
133
|
+
var editButtonClick = defaultOperationConfig === null || defaultOperationConfig === void 0 || (_defaultOperationConf8 = defaultOperationConfig.U) === null || _defaultOperationConf8 === void 0 ? void 0 : _defaultOperationConf8.clickEvent;
|
|
134
|
+
var viewButtonClick = defaultOperationConfig === null || defaultOperationConfig === void 0 || (_defaultOperationConf9 = defaultOperationConfig.R) === null || _defaultOperationConf9 === void 0 ? void 0 : _defaultOperationConf9.clickEvent;
|
|
135
|
+
var deleteButtonClick = defaultOperationConfig === null || defaultOperationConfig === void 0 || (_defaultOperationConf10 = defaultOperationConfig.D) === null || _defaultOperationConf10 === void 0 ? void 0 : _defaultOperationConf10.clickEvent;
|
|
136
|
+
var addFormDefaultKey = (defaultOperationConfig === null || defaultOperationConfig === void 0 || (_defaultOperationConf11 = defaultOperationConfig.CL) === null || _defaultOperationConf11 === void 0 ? void 0 : _defaultOperationConf11.defaultKey) || [];
|
|
137
|
+
|
|
138
|
+
// 添加默认类名
|
|
139
|
+
var createClassName = (defaultOperationConfig === null || defaultOperationConfig === void 0 || (_defaultOperationConf12 = defaultOperationConfig.C) === null || _defaultOperationConf12 === void 0 ? void 0 : _defaultOperationConf12.rootClassName) || '';
|
|
140
|
+
var editClassName = (defaultOperationConfig === null || defaultOperationConfig === void 0 || (_defaultOperationConf13 = defaultOperationConfig.U) === null || _defaultOperationConf13 === void 0 ? void 0 : _defaultOperationConf13.rootClassName) || '';
|
|
141
|
+
var readClassName = (defaultOperationConfig === null || defaultOperationConfig === void 0 || (_defaultOperationConf14 = defaultOperationConfig.R) === null || _defaultOperationConf14 === void 0 ? void 0 : _defaultOperationConf14.rootClassName) || '';
|
|
142
|
+
var deleteClassName = (defaultOperationConfig === null || defaultOperationConfig === void 0 || (_defaultOperationConf15 = defaultOperationConfig.D) === null || _defaultOperationConf15 === void 0 ? void 0 : _defaultOperationConf15.rootClassName) || '';
|
|
143
|
+
|
|
144
|
+
//是否用户选择了全选
|
|
145
|
+
var _useState15 = useState(false),
|
|
146
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
147
|
+
isSelectAllState = _useState16[0],
|
|
148
|
+
setSelectAllState = _useState16[1];
|
|
149
|
+
//当前是否为全选状态
|
|
150
|
+
var _useState17 = useState(false),
|
|
151
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
152
|
+
isSelectAllFlag = _useState18[0],
|
|
153
|
+
setSelectAllFlag = _useState18[1];
|
|
154
|
+
//目前选中的key值
|
|
155
|
+
var _useState19 = useState([]),
|
|
156
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
157
|
+
currentSelectedKeys = _useState20[0],
|
|
158
|
+
setCurrentSelectedKeys = _useState20[1];
|
|
159
|
+
//全选后被剔除的所有key值
|
|
160
|
+
var _useState21 = useState([]),
|
|
161
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
162
|
+
exceptedKeys = _useState22[0],
|
|
163
|
+
setExceptedKeys = _useState22[1];
|
|
164
|
+
var _useState23 = useState(false),
|
|
165
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
166
|
+
deleteLoading = _useState24[0],
|
|
167
|
+
setDeleteLoading = _useState24[1];
|
|
168
|
+
|
|
169
|
+
//需要调用的内部函数加载这个位置
|
|
170
|
+
useImperativeHandle(tablePageRef, function () {
|
|
171
|
+
return {
|
|
172
|
+
openAddNewLine: function openAddNewLine(formDefaultValue) {
|
|
173
|
+
setAddFormDefaultValue(formDefaultValue || null);
|
|
174
|
+
setIsShowAdd(true);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
});
|
|
178
|
+
useEffect(function () {
|
|
179
|
+
if (isSelectAllState) {
|
|
180
|
+
var currentPageKeys = [];
|
|
181
|
+
currentPageData === null || currentPageData === void 0 || currentPageData.forEach(function (item) {
|
|
182
|
+
if ((item === null || item === void 0 ? void 0 : item[rowKey]) === undefined) return;
|
|
183
|
+
currentPageKeys.push(item === null || item === void 0 ? void 0 : item[rowKey]);
|
|
184
|
+
});
|
|
185
|
+
//剔除已经去除的数组内的值
|
|
186
|
+
var tempCurrentPageKeys = currentPageKeys;
|
|
187
|
+
exceptedKeys.forEach(function (item) {
|
|
188
|
+
var tempArr = tempCurrentPageKeys.filter(function (i) {
|
|
189
|
+
return i !== item;
|
|
190
|
+
});
|
|
191
|
+
tempCurrentPageKeys = tempArr;
|
|
192
|
+
});
|
|
193
|
+
setCurrentSelectedKeys(tempCurrentPageKeys);
|
|
194
|
+
}
|
|
195
|
+
}, [currentPageData, isSelectAllState]);
|
|
196
|
+
useEffect(function () {
|
|
197
|
+
//取消全选
|
|
198
|
+
if (!isSelectAllState) {
|
|
199
|
+
setCurrentSelectedKeys([]);
|
|
200
|
+
setSelectedRowsArr([]);
|
|
201
|
+
setSelectAllFlag(false);
|
|
202
|
+
}
|
|
203
|
+
}, [isSelectAllState]);
|
|
204
|
+
useEffect(function () {
|
|
205
|
+
if (isSelectAllFlag) {
|
|
206
|
+
//再次点击全选
|
|
207
|
+
var currentPageKeys = [];
|
|
208
|
+
currentPageData === null || currentPageData === void 0 || currentPageData.forEach(function (item) {
|
|
209
|
+
currentPageKeys.push(item === null || item === void 0 ? void 0 : item[rowKey]);
|
|
210
|
+
});
|
|
211
|
+
setCurrentSelectedKeys(currentPageKeys);
|
|
212
|
+
//清空排除的key数组
|
|
213
|
+
setExceptedKeys([]);
|
|
214
|
+
}
|
|
215
|
+
}, [isSelectAllFlag]);
|
|
216
|
+
var getAuth = useCallback(function (type, row) {
|
|
217
|
+
var _defaultOperationConf16;
|
|
218
|
+
return !(defaultOperationConfig !== null && defaultOperationConfig !== void 0 && (_defaultOperationConf16 = defaultOperationConfig[type]) !== null && _defaultOperationConf16 !== void 0 && _defaultOperationConf16.authority) ? true : defaultOperationConfig[type].authority(row);
|
|
219
|
+
}, [defaultOperationConfig]);
|
|
220
|
+
var getDisabled = useCallback(function (type, row) {
|
|
221
|
+
var _defaultOperationConf17;
|
|
222
|
+
return !(defaultOperationConfig !== null && defaultOperationConfig !== void 0 && (_defaultOperationConf17 = defaultOperationConfig[type]) !== null && _defaultOperationConf17 !== void 0 && _defaultOperationConf17.disable) ? false : defaultOperationConfig[type].disable(row);
|
|
223
|
+
}, [defaultOperationConfig]);
|
|
224
|
+
var closeModal = function closeModal() {
|
|
225
|
+
Modal.destroyAll();
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
// 点击详情事件
|
|
229
|
+
var handleClickDetail = function handleClickDetail(row) {
|
|
230
|
+
if (viewButtonClick && typeof viewButtonClick === 'function') {
|
|
231
|
+
viewButtonClick(row);
|
|
232
|
+
} else {
|
|
233
|
+
setCurRow(row);
|
|
234
|
+
setIsShowDetail(true);
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
// 点击编辑事件
|
|
239
|
+
var handleClickEdit = function handleClickEdit(row) {
|
|
240
|
+
if (editButtonClick && typeof editButtonClick === 'function') {
|
|
241
|
+
editButtonClick(row);
|
|
242
|
+
} else {
|
|
243
|
+
setCurRow(row);
|
|
244
|
+
setIsShowEdit(true);
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
// 点击行内新增按钮
|
|
249
|
+
var handleClickAddInLine = function handleClickAddInLine(row) {
|
|
250
|
+
var obj = {};
|
|
251
|
+
addFormDefaultKey === null || addFormDefaultKey === void 0 || addFormDefaultKey.forEach(function (item) {
|
|
252
|
+
obj["".concat(item)] = row["".concat(item)];
|
|
253
|
+
});
|
|
254
|
+
setAddFormDefaultValue(obj);
|
|
255
|
+
setIsShowAdd(true);
|
|
256
|
+
};
|
|
257
|
+
var onClickDelete = useCallback(throttle( /*#__PURE__*/function () {
|
|
258
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(row) {
|
|
259
|
+
var isSuccess, _actionRef$current;
|
|
260
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
261
|
+
while (1) switch (_context.prev = _context.next) {
|
|
262
|
+
case 0:
|
|
263
|
+
if (!(typeof deleteEvent === 'function')) {
|
|
264
|
+
_context.next = 12;
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
setDeleteLoading(true);
|
|
268
|
+
_context.prev = 2;
|
|
269
|
+
_context.next = 5;
|
|
270
|
+
return deleteEvent(row);
|
|
271
|
+
case 5:
|
|
272
|
+
isSuccess = _context.sent;
|
|
273
|
+
if (isSuccess) {
|
|
274
|
+
setDeleteLoading(false);
|
|
275
|
+
closeModal();
|
|
276
|
+
(_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 || _actionRef$current.reloadAndRest();
|
|
277
|
+
}
|
|
278
|
+
_context.next = 12;
|
|
279
|
+
break;
|
|
280
|
+
case 9:
|
|
281
|
+
_context.prev = 9;
|
|
282
|
+
_context.t0 = _context["catch"](2);
|
|
283
|
+
setDeleteLoading(false);
|
|
284
|
+
case 12:
|
|
285
|
+
case "end":
|
|
286
|
+
return _context.stop();
|
|
287
|
+
}
|
|
288
|
+
}, _callee, null, [[2, 9]]);
|
|
289
|
+
}));
|
|
290
|
+
return function (_x) {
|
|
291
|
+
return _ref2.apply(this, arguments);
|
|
292
|
+
};
|
|
293
|
+
}(), 1000, {
|
|
294
|
+
leading: true,
|
|
295
|
+
trailing: false
|
|
296
|
+
}), []);
|
|
297
|
+
var deleteConfirm = function deleteConfirm(row) {
|
|
298
|
+
showConfirm({
|
|
299
|
+
title: deleteTitle ? deleteTitle : tableLocal.deleteTitle,
|
|
300
|
+
className: "".concat(deleteClassName, " tablePage-delete-modal"),
|
|
301
|
+
content: /*#__PURE__*/_jsxs(_Fragment, {
|
|
302
|
+
children: [deleteContent ? deleteContent : tableLocal.deleteContent, /*#__PURE__*/_jsxs("div", {
|
|
303
|
+
className: "modal-button",
|
|
304
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
305
|
+
onClick: function onClick() {
|
|
306
|
+
return closeModal();
|
|
307
|
+
},
|
|
308
|
+
children: tableLocal.cancel
|
|
309
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
310
|
+
type: "primary",
|
|
311
|
+
onClick: function onClick() {
|
|
312
|
+
onClickDelete(row);
|
|
313
|
+
},
|
|
314
|
+
loading: deleteLoading,
|
|
315
|
+
children: tableLocal.OK
|
|
316
|
+
})]
|
|
317
|
+
})]
|
|
318
|
+
})
|
|
319
|
+
});
|
|
320
|
+
};
|
|
321
|
+
// 点击删除事件
|
|
322
|
+
var handleClickDelete = function handleClickDelete(row) {
|
|
323
|
+
if (deleteButtonClick && typeof deleteButtonClick === 'function') {
|
|
324
|
+
deleteButtonClick(row);
|
|
325
|
+
} else {
|
|
326
|
+
deleteConfirm(row);
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
var onSelectedRowsChange = function onSelectedRowsChange(selectedRowKeys, selectedRows) {
|
|
330
|
+
setCurrentSelectedKeys(selectedRowKeys);
|
|
331
|
+
setSelectedRowsArr(selectedRows);
|
|
332
|
+
};
|
|
333
|
+
var onSelectChange = function onSelectChange(record, selected) {
|
|
334
|
+
if (isSelectAllState) {
|
|
335
|
+
//如果当前为全选状态
|
|
336
|
+
if (!selected) {
|
|
337
|
+
//置为非全选状态
|
|
338
|
+
setSelectAllFlag(false);
|
|
339
|
+
setExceptedKeys(function (val) {
|
|
340
|
+
return [].concat(_toConsumableArray(val), [record === null || record === void 0 ? void 0 : record[rowKey]]);
|
|
341
|
+
});
|
|
342
|
+
} else {
|
|
343
|
+
//剔除被剔除的key数组
|
|
344
|
+
var filteredArray = exceptedKeys.filter(function (item) {
|
|
345
|
+
return item !== (record === null || record === void 0 ? void 0 : record[rowKey]);
|
|
346
|
+
});
|
|
347
|
+
setExceptedKeys(filteredArray);
|
|
348
|
+
if (!(filteredArray !== null && filteredArray !== void 0 && filteredArray.length)) {
|
|
349
|
+
setSelectAllFlag(true);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
var onSelectAllChange = function onSelectAllChange(selected, selectedRows, changeRows) {
|
|
355
|
+
if (!selected) {
|
|
356
|
+
//当页反选时加入已剔除的数组中
|
|
357
|
+
var tempKeys = [];
|
|
358
|
+
changeRows.forEach(function (item) {
|
|
359
|
+
tempKeys.push(item === null || item === void 0 ? void 0 : item[rowKey]);
|
|
360
|
+
});
|
|
361
|
+
setExceptedKeys(function (val) {
|
|
362
|
+
return _toConsumableArray(new Set([].concat(_toConsumableArray(val), tempKeys)));
|
|
363
|
+
});
|
|
364
|
+
setSelectAllFlag(false);
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
var rowSelectionConfig = isSelectAll ? {
|
|
368
|
+
type: 'checkbox',
|
|
369
|
+
onChange: onSelectedRowsChange,
|
|
370
|
+
onSelect: onSelectChange,
|
|
371
|
+
preserveSelectedRowKeys: true,
|
|
372
|
+
selectedRowKeys: currentSelectedKeys,
|
|
373
|
+
onSelectAll: onSelectAllChange
|
|
374
|
+
} : {
|
|
375
|
+
type: 'checkbox',
|
|
376
|
+
onChange: onSelectedRowsChange
|
|
377
|
+
// preserveSelectedRowKeys: true,
|
|
378
|
+
};
|
|
379
|
+
var rowSelection = (isShowBatchDeleteBtn || appendBatchOperation) && rowSelectionConfig;
|
|
380
|
+
var defaultOperationRender = function defaultOperationRender(row) {
|
|
381
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
382
|
+
children: [isShowReadBtn && /*#__PURE__*/_jsx(Button, {
|
|
383
|
+
type: "link",
|
|
384
|
+
onClick: function onClick() {
|
|
385
|
+
return handleClickDetail(row);
|
|
386
|
+
},
|
|
387
|
+
children: readText ? readText : tableLocal.detailFormTitle
|
|
388
|
+
}), isShowUpdateBtn && getAuth('U', row) && /*#__PURE__*/_jsx(Button, {
|
|
389
|
+
type: "link",
|
|
390
|
+
disabled: getDisabled('U', row),
|
|
391
|
+
onClick: function onClick() {
|
|
392
|
+
return handleClickEdit(row);
|
|
393
|
+
},
|
|
394
|
+
children: updateText ? updateText : tableLocal.editFormTitle
|
|
395
|
+
}), isShowCreateInLineBtn && getAuth('CL', row) && /*#__PURE__*/_jsx(Button, {
|
|
396
|
+
type: "link",
|
|
397
|
+
disabled: getDisabled('CL', row),
|
|
398
|
+
onClick: function onClick() {
|
|
399
|
+
return handleClickAddInLine(row);
|
|
400
|
+
},
|
|
401
|
+
children: createInLineText ? createInLineText : tableLocal.newTitle
|
|
402
|
+
}), isShowDeleteBtn && getAuth('D', row) && /*#__PURE__*/_jsx(Button, {
|
|
403
|
+
type: "link",
|
|
404
|
+
disabled: getDisabled('D', row),
|
|
405
|
+
onClick: function onClick() {
|
|
406
|
+
return handleClickDelete(row);
|
|
407
|
+
},
|
|
408
|
+
children: deleteText ? deleteText : tableLocal.deleteTitle
|
|
409
|
+
})]
|
|
410
|
+
});
|
|
411
|
+
};
|
|
412
|
+
var defaultOperation = function defaultOperation(row) {
|
|
413
|
+
if (appendOperationLayout === 'left') {
|
|
414
|
+
return /*#__PURE__*/_jsxs(Space, {
|
|
415
|
+
"data-testid": "table-operation",
|
|
416
|
+
className: "table-operation",
|
|
417
|
+
children: [appendOperation && typeof appendOperation === 'function' && appendOperation(row), defaultOperationRender(row)]
|
|
418
|
+
});
|
|
419
|
+
} else if (appendOperationLayout === 'right') {
|
|
420
|
+
return /*#__PURE__*/_jsxs(Space, {
|
|
421
|
+
"data-testid": "table-operation",
|
|
422
|
+
className: "table-operation",
|
|
423
|
+
children: [defaultOperationRender(row), appendOperation && typeof appendOperation === 'function' && appendOperation(row)]
|
|
424
|
+
});
|
|
425
|
+
} else {
|
|
426
|
+
return /*#__PURE__*/_jsxs(Space, {
|
|
427
|
+
"data-testid": "table-operation",
|
|
428
|
+
className: "table-operation",
|
|
429
|
+
children: [isShowReadBtn && /*#__PURE__*/_jsx(Button, {
|
|
430
|
+
type: "link",
|
|
431
|
+
onClick: function onClick() {
|
|
432
|
+
return handleClickDetail(row);
|
|
433
|
+
},
|
|
434
|
+
children: readText ? readText : tableLocal.detailFormTitle
|
|
435
|
+
}), isShowUpdateBtn && getAuth('U', row) && /*#__PURE__*/_jsx(Button, {
|
|
436
|
+
type: "link",
|
|
437
|
+
disabled: getDisabled('U', row),
|
|
438
|
+
onClick: function onClick() {
|
|
439
|
+
return handleClickEdit(row);
|
|
440
|
+
},
|
|
441
|
+
children: updateText ? updateText : tableLocal.editFormTitle
|
|
442
|
+
}), appendOperation && typeof appendOperation === 'function' && appendOperation(row), isShowCreateInLineBtn && getAuth('CL', row) && /*#__PURE__*/_jsx(Button, {
|
|
443
|
+
type: "link",
|
|
444
|
+
disabled: getDisabled('CL', row),
|
|
445
|
+
onClick: function onClick() {
|
|
446
|
+
return handleClickAddInLine(row);
|
|
447
|
+
},
|
|
448
|
+
children: createInLineText ? createInLineText : tableLocal.newTitle
|
|
449
|
+
}), isShowDeleteBtn && getAuth('D', row) && /*#__PURE__*/_jsx(Button, {
|
|
450
|
+
type: "link",
|
|
451
|
+
disabled: getDisabled('D', row),
|
|
452
|
+
onClick: function onClick() {
|
|
453
|
+
return handleClickDelete(row);
|
|
454
|
+
},
|
|
455
|
+
children: deleteText ? deleteText : tableLocal.deleteTitle
|
|
456
|
+
})]
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
var renderDefaultOperation = function renderDefaultOperation() {
|
|
461
|
+
return new TableColumAdapter(columns.operation, isUseIntl, customIntl).useIntl().render(function (record, row) {
|
|
462
|
+
return defaultOperation(row);
|
|
463
|
+
}).data;
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
// 处理columns
|
|
467
|
+
var tableColumns = Object.keys(columns).map(function (item) {
|
|
468
|
+
var _itemData$valueType;
|
|
469
|
+
var itemData = columns[item];
|
|
470
|
+
var popupContainer = POPUP_CONTAINER_COMPONENTS;
|
|
471
|
+
if (popupContainer.includes(itemData.valueType) || itemData.valueEnum || (_itemData$valueType = itemData.valueType) !== null && _itemData$valueType !== void 0 && _itemData$valueType.startsWith('date')) {
|
|
472
|
+
return new TableColumAdapter(itemData, isUseIntl, customIntl).useIntl().usePopupContainer().data;
|
|
473
|
+
}
|
|
474
|
+
if (!customOperation && item === 'operation') {
|
|
475
|
+
return renderDefaultOperation();
|
|
476
|
+
}
|
|
477
|
+
return new TableColumAdapter(itemData, isUseIntl, customIntl).useIntl().data;
|
|
478
|
+
});
|
|
479
|
+
var selectedCount = 0;
|
|
480
|
+
if (total) {
|
|
481
|
+
selectedCount = isSelectAllState ? total - (exceptedKeys === null || exceptedKeys === void 0 ? void 0 : exceptedKeys.length) : selectedRowsArr === null || selectedRowsArr === void 0 ? void 0 : selectedRowsArr.length;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
// 处理request
|
|
485
|
+
var handleRequest = /*#__PURE__*/function () {
|
|
486
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
487
|
+
var res,
|
|
488
|
+
_args2 = arguments;
|
|
489
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
490
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
491
|
+
case 0:
|
|
492
|
+
setIsLoading(true);
|
|
493
|
+
_context2.next = 3;
|
|
494
|
+
return request.apply(void 0, _args2);
|
|
495
|
+
case 3:
|
|
496
|
+
res = _context2.sent;
|
|
497
|
+
setIsLoading(false);
|
|
498
|
+
return _context2.abrupt("return", res);
|
|
499
|
+
case 6:
|
|
500
|
+
case "end":
|
|
501
|
+
return _context2.stop();
|
|
502
|
+
}
|
|
503
|
+
}, _callee2);
|
|
504
|
+
}));
|
|
505
|
+
return function handleRequest() {
|
|
506
|
+
return _ref3.apply(this, arguments);
|
|
507
|
+
};
|
|
508
|
+
}();
|
|
509
|
+
return /*#__PURE__*/_jsx(IntlProvider, {
|
|
510
|
+
value: {
|
|
511
|
+
intl: curLang === 'zh-CN' ? zhCNIntl : enUSIntl,
|
|
512
|
+
valueTypeMap: {}
|
|
513
|
+
},
|
|
514
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
515
|
+
className: titleSlot || leftSlot ? 'tablePage table-page-with-title' : 'tablePage',
|
|
516
|
+
children: [titleSlot && /*#__PURE__*/_jsx("div", {
|
|
517
|
+
className: "table-page-header-title",
|
|
518
|
+
children: titleSlot
|
|
519
|
+
}), /*#__PURE__*/_jsx(ToolButtons, {
|
|
520
|
+
tableRef: actionRef,
|
|
521
|
+
tableLocal: tableLocal,
|
|
522
|
+
batchDelete: batchDelete,
|
|
523
|
+
defaultOperationConfig: defaultOperationConfig,
|
|
524
|
+
setIsShowAdd: setIsShowAdd,
|
|
525
|
+
selectedRowsArr: selectedRowsArr,
|
|
526
|
+
setSelectedRowsArr: setSelectedRowsArr,
|
|
527
|
+
setAddFormDefaultValue: setAddFormDefaultValue,
|
|
528
|
+
appendButton: appendButton,
|
|
529
|
+
appendBatchOperation: appendBatchOperation,
|
|
530
|
+
isSelectAll: isSelectAll,
|
|
531
|
+
setSelectAllState: setSelectAllState,
|
|
532
|
+
isSelectAllFlag: isSelectAllFlag,
|
|
533
|
+
setSelectAllFlag: setSelectAllFlag,
|
|
534
|
+
isSelectAllState: isSelectAllState,
|
|
535
|
+
exceptedKeys: exceptedKeys,
|
|
536
|
+
total: total,
|
|
537
|
+
toolButtonOffset: toolButtonOffset
|
|
538
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
539
|
+
className: leftSlot ? 'table-page-table-box table-page-box-with-left' : 'table-page-table-box',
|
|
540
|
+
children: [leftSlot && /*#__PURE__*/_jsx("div", {
|
|
541
|
+
className: "table-page-table-left",
|
|
542
|
+
children: leftSlot
|
|
543
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
544
|
+
className: leftSlot ? 'proTableBox table-with-left' : 'proTableBox',
|
|
545
|
+
children: [isSelectAll && selectedCount !== 0 && /*#__PURE__*/_jsxs("div", {
|
|
546
|
+
className: "selectedCountText",
|
|
547
|
+
children: ["\u5DF2\u9009", /*#__PURE__*/_jsxs("span", {
|
|
548
|
+
className: "selectedCountNumber",
|
|
549
|
+
children: ["\uFF08", selectedCount, "\uFF09"]
|
|
550
|
+
})]
|
|
551
|
+
}), /*#__PURE__*/_jsx(ProTable, _objectSpread(_objectSpread({
|
|
552
|
+
scroll: scroll || {
|
|
553
|
+
x: 1500
|
|
554
|
+
},
|
|
555
|
+
actionRef: ref ? ref : actionRef,
|
|
556
|
+
rowKey: rowKey,
|
|
557
|
+
search: search,
|
|
558
|
+
pagination: {
|
|
559
|
+
pageSizeOptions: [5, 10, 20],
|
|
560
|
+
defaultPageSize: 10
|
|
561
|
+
},
|
|
562
|
+
request: handleRequest,
|
|
563
|
+
columns: tableColumns,
|
|
564
|
+
options: false,
|
|
565
|
+
rowSelection: rowSelection
|
|
566
|
+
}, props), {}, {
|
|
567
|
+
locale: isLoading ? _objectSpread(_objectSpread({}, props.locale), {}, {
|
|
568
|
+
emptyText: ' '
|
|
569
|
+
}) : props.locale
|
|
570
|
+
}))]
|
|
571
|
+
})]
|
|
572
|
+
}), /*#__PURE__*/_jsx(DrawerForm, _objectSpread({
|
|
573
|
+
lang: curLang,
|
|
574
|
+
langPackage: langPackage,
|
|
575
|
+
columns: columns,
|
|
576
|
+
isUseIntl: isUseIntl,
|
|
577
|
+
customIntl: customIntl,
|
|
578
|
+
tableRef: actionRef,
|
|
579
|
+
curRow: curRow,
|
|
580
|
+
addFormDefaultValue: addFormDefaultValue,
|
|
581
|
+
defaultOperationConfig: defaultOperationConfig,
|
|
582
|
+
tableLocal: tableLocal,
|
|
583
|
+
isShowDetail: isShowDetail,
|
|
584
|
+
isShowEdit: isShowEdit,
|
|
585
|
+
isShowAdd: isShowAdd,
|
|
586
|
+
setIsShowDetail: setIsShowDetail,
|
|
587
|
+
setIsShowEdit: setIsShowEdit,
|
|
588
|
+
setIsShowAdd: setIsShowAdd,
|
|
589
|
+
components: components,
|
|
590
|
+
drawerWidth: drawerWidth,
|
|
591
|
+
drawFormLayout: drawFormLayout,
|
|
592
|
+
createClassName: createClassName,
|
|
593
|
+
editClassName: editClassName,
|
|
594
|
+
readClassName: readClassName,
|
|
595
|
+
drawFormTextPlaceholder: drawFormTextPlaceholder
|
|
596
|
+
}, props))]
|
|
597
|
+
})
|
|
598
|
+
});
|
|
599
|
+
});
|
|
600
|
+
export default TablePage;
|