2025-09-02 16:22:57 +08:00
|
|
|
import { MyButtons, MyColumns, MyProTableProps } from '@/common';
|
2025-09-01 21:32:29 +08:00
|
|
|
import { Apis } from '@/gen/Apis';
|
2025-09-08 17:22:58 +08:00
|
|
|
import ChargeStandardHasHouse from '@/pages/asset/components/modals/ChargeStandardHasHouse';
|
2025-09-01 21:32:29 +08:00
|
|
|
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,
|
2025-09-01 21:32:29 +08:00
|
|
|
},
|
|
|
|
|
sort,
|
2025-09-02 16:22:57 +08:00
|
|
|
Apis.HouseCharage.HouseChargeHasHouses.List,
|
2025-09-01 21:32:29 +08:00
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
toolBarRender={(action) => [
|
2025-09-08 17:22:58 +08:00
|
|
|
<ChargeStandardHasHouse
|
|
|
|
|
item={rest.item}
|
2025-09-01 21:32:29 +08:00
|
|
|
reload={action?.reload}
|
2025-09-08 17:22:58 +08:00
|
|
|
title={'绑房'}
|
2025-09-01 21:32:29 +08:00
|
|
|
/>,
|
|
|
|
|
]}
|
|
|
|
|
search={false}
|
|
|
|
|
columns={[
|
|
|
|
|
MyColumns.ID(),
|
|
|
|
|
{
|
2025-09-02 16:22:57 +08:00
|
|
|
title: '房屋名称',
|
|
|
|
|
dataIndex: 'full_name',
|
2025-09-01 21:32:29 +08:00
|
|
|
},
|
|
|
|
|
{
|
2025-09-02 16:22:57 +08:00
|
|
|
title: '项目名称',
|
|
|
|
|
dataIndex: 'project_name',
|
2025-09-01 21:32:29 +08:00
|
|
|
},
|
|
|
|
|
{
|
2025-09-02 16:22:57 +08:00
|
|
|
title: '楼栋名称',
|
|
|
|
|
dataIndex: 'building_name',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '单元名称',
|
|
|
|
|
dataIndex: 'unit_name',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '房号',
|
|
|
|
|
dataIndex: 'name',
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
title: '绑定时间',
|
|
|
|
|
dataIndex: 'updated_at',
|
2025-09-01 21:32:29 +08:00
|
|
|
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())
|
|
|
|
|
}
|
|
|
|
|
/>
|
2025-09-01 21:32:29 +08:00
|
|
|
</Space>
|
|
|
|
|
),
|
|
|
|
|
}),
|
|
|
|
|
]}
|
|
|
|
|
/>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|