Commit b37a6aee authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

🐞 fix(TableLayout 组件): 修复批量操作

parent bc13b2b7
import React, { useRef, useState, useImperativeHandle } from 'react';
import React, { useRef, useState, useImperativeHandle, useEffect } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card } from 'antd';
import { StandardTable } from 'god';
......@@ -52,13 +52,7 @@ const Table: React.FC<Iprops> = (props: any) => {
useStateEffects
} = props;
const tableRef = useRef<any>({});
const [selectRow, selectRowFns] = useRowSelectionTable({
extendsSelection: {
onChange: () => {
fetchRowkeys(selectRowFns.selectedRowKeys)
},
}
});
const [selectRow, selectRowFns] = useRowSelectionTable();
/** 列表数据 */
const fetchData = (params?: any) => {
......@@ -102,6 +96,10 @@ const Table: React.FC<Iprops> = (props: any) => {
}
useEffect(() => {
fetchRowkeys && fetchRowkeys(selectRowFns.selectedRowKeys)
}, [selectRowFns])
return (
<PageHeaderWrapper>
<Card>
......
......@@ -24,7 +24,7 @@ const WaitAddedMarketing = () => {
if (id) {
res = await PublicApi.postMarketingPlatformActivitySubmit({ id: Number(id) })
} else {
// res = await PublicApi.postPurchasePurchaseInquirySubmitBatch({ ids: rowkeys });
res = await PublicApi.postMarketingPlatformActivitySubmitBatch({ ids: rowkeys });
}
if (res.code === 1000) {
ref.current.reload();
......@@ -263,14 +263,14 @@ const WaitAddedMarketing = () => {
icon={<DeleteOutlined />}
loading={loading}
onClick={() => fetchDeleteBatch()}
disabled={rowkeys.length !== 0}
disabled={rowkeys.length === 0}
>
批量删除
</Button>
<Button
loading={loading}
onClick={() => fetchSubmitBatch()}
disabled={rowkeys.length !== 0}
disabled={rowkeys.length === 0}
>
批量提交审核
</Button>
......
......@@ -162,6 +162,15 @@ const MerchantMarketingSearch = () => {
},
enum: [],
},
memberName: {
type: 'string',
'x-component-props': {
placeholder: '会员名称',
style: {
width: 160,
},
},
},
}
},
sumbit: {
......
......@@ -175,6 +175,15 @@ const WaitAuditMerchantMarketing = () => {
},
enum: [],
},
memberName: {
type: 'string',
'x-component-props': {
placeholder: '会员名称',
style: {
width: 160,
},
},
},
}
},
sumbit: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment