2025-09-08 17:22:58 +08:00
|
|
|
import {
|
|
|
|
|
MyButtons,
|
|
|
|
|
MyColumns,
|
|
|
|
|
MyPageContainer,
|
|
|
|
|
MyProTableProps,
|
|
|
|
|
usePageTabs,
|
|
|
|
|
} from '@/common';
|
|
|
|
|
import { Apis } from '@/gen/Apis';
|
2025-09-10 19:10:17 +08:00
|
|
|
import { HouseChargeTaskDetailsStatusEnum } from '@/gen/Enums';
|
2025-09-08 17:22:58 +08:00
|
|
|
import { ProTable } from '@ant-design/pro-components';
|
|
|
|
|
import { Space } from 'antd';
|
|
|
|
|
|
2025-09-10 19:10:17 +08:00
|
|
|
export default function Index({ title = '任务结果' }) {
|
2025-09-08 17:22:58 +08:00
|
|
|
// 注册当前页面为标签页
|
|
|
|
|
usePageTabs({
|
2025-09-10 19:10:17 +08:00
|
|
|
tabKey: 'charge_task_details',
|
2025-09-08 17:22:58 +08:00
|
|
|
tabLabel: title,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<MyPageContainer
|
|
|
|
|
title={title}
|
|
|
|
|
enableTabs={true}
|
|
|
|
|
tabKey="bills"
|
|
|
|
|
tabLabel={title}
|
|
|
|
|
>
|
|
|
|
|
<ProTable
|
|
|
|
|
{...MyProTableProps.props}
|
|
|
|
|
request={async (params, sort) =>
|
|
|
|
|
MyProTableProps.request(
|
|
|
|
|
params,
|
|
|
|
|
sort,
|
2025-09-10 19:10:17 +08:00
|
|
|
Apis.HouseCharage.HouseChargeTaskDetails.List,
|
2025-09-08 17:22:58 +08:00
|
|
|
)
|
|
|
|
|
}
|
2025-09-10 19:10:17 +08:00
|
|
|
// toolBarRender={(action) => [
|
|
|
|
|
// <ChargeTasksCreate
|
|
|
|
|
// key="Create"
|
|
|
|
|
// reload={action?.reload}
|
|
|
|
|
// title={title}
|
|
|
|
|
// />,
|
|
|
|
|
// ]}
|
2025-09-08 17:22:58 +08:00
|
|
|
columns={[
|
2025-09-10 19:10:17 +08:00
|
|
|
{
|
|
|
|
|
title: '任务ID',
|
|
|
|
|
dataIndex: 'house_charge_tasks_id',
|
|
|
|
|
search: false,
|
|
|
|
|
},
|
2025-09-08 17:22:58 +08:00
|
|
|
MyColumns.ID(),
|
|
|
|
|
MyColumns.EnumTag({
|
|
|
|
|
title: '任务状态',
|
|
|
|
|
dataIndex: 'status',
|
2025-09-10 19:10:17 +08:00
|
|
|
valueEnum: HouseChargeTaskDetailsStatusEnum,
|
2025-09-08 17:22:58 +08:00
|
|
|
}),
|
|
|
|
|
{
|
|
|
|
|
title: '账单月份',
|
|
|
|
|
render: (_, record) => {
|
|
|
|
|
return `${record.year}-${String(record.month).padStart(2, '0')}`;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '计费开始日期',
|
|
|
|
|
dataIndex: 'start_date',
|
|
|
|
|
search: false,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '计费结束日期',
|
|
|
|
|
dataIndex: 'end_date',
|
|
|
|
|
search: false,
|
|
|
|
|
},
|
|
|
|
|
MyColumns.UpdatedAt(),
|
|
|
|
|
MyColumns.CreatedAt(),
|
|
|
|
|
MyColumns.Option({
|
|
|
|
|
render: (_, item: any, index, action) => (
|
|
|
|
|
<Space key={index}>
|
|
|
|
|
<MyButtons.Delete
|
|
|
|
|
onConfirm={() =>
|
2025-09-10 19:10:17 +08:00
|
|
|
Apis.HouseCharage.HouseChargeTaskDetails.Delete({
|
2025-09-08 17:22:58 +08:00
|
|
|
id: item.id,
|
|
|
|
|
}).then(() => action?.reload())
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</Space>
|
|
|
|
|
),
|
|
|
|
|
}),
|
|
|
|
|
]}
|
|
|
|
|
/>
|
|
|
|
|
</MyPageContainer>
|
|
|
|
|
);
|
|
|
|
|
}
|