83 lines
2.2 KiB
TypeScript
Raw Normal View History

2025-09-02 16:22:57 +08:00
import { MyButtons, MyColumns, MyProTableProps } from '@/common';
import { Apis } from '@/gen/Apis';
2025-09-18 19:40:30 +08:00
import ChargeStandardHasHouse from '@/pages/asset/list/components/modals/ChargeStandardHasHouse';
import { ProTable } from '@ant-design/pro-components';
import { Space } from 'antd';
import { useEffect, useRef } from 'react';
export default function Index({ ...rest }) {
const actionLooks = useRef<any>();
useEffect(() => {
actionLooks?.current.reloadAndRest();
}, [rest.loadmore]);
return (
<>
<ProTable<Record<any, any>>
{...MyProTableProps.props}
actionRef={actionLooks}
request={async (params, sort) =>
MyProTableProps.request(
{
...params,
2025-09-08 17:22:58 +08:00
house_charge_standards_id: rest.item?.house_charge_has_houses_id,
},
sort,
2025-09-02 16:22:57 +08:00
Apis.HouseCharage.HouseChargeHasHouses.List,
)
}
toolBarRender={(action) => [
2025-09-08 17:22:58 +08:00
<ChargeStandardHasHouse
item={rest.item}
reload={action?.reload}
2025-09-08 17:22:58 +08:00
title={'绑房'}
/>,
]}
search={false}
columns={[
MyColumns.ID(),
{
2025-09-02 16:22:57 +08:00
title: '房屋名称',
dataIndex: 'full_name',
},
{
2025-09-02 16:22:57 +08:00
title: '项目名称',
dataIndex: 'project_name',
},
{
2025-09-02 16:22:57 +08:00
title: '楼栋名称',
dataIndex: 'building_name',
},
{
title: '单元名称',
dataIndex: 'unit_name',
},
{
title: '房号',
dataIndex: 'name',
},
{
title: '绑定时间',
dataIndex: 'updated_at',
search: false,
},
MyColumns.Option({
render: (_, item: any, index, action) => (
<Space key={index}>
2025-09-08 17:22:58 +08:00
<MyButtons.Delete
2025-09-02 16:22:57 +08:00
onConfirm={() =>
Apis.HouseCharage.HouseChargeHasHouses.Delete({
id: item.id,
}).then(() => action?.reload())
}
/>
</Space>
),
}),
]}
/>
</>
);
}