96 lines
2.5 KiB
TypeScript
96 lines
2.5 KiB
TypeScript
|
|
import {
|
||
|
|
MyButtons,
|
||
|
|
MyColumns,
|
||
|
|
MyPageContainer,
|
||
|
|
MyProTableProps,
|
||
|
|
usePageTabs,
|
||
|
|
} from '@/common';
|
||
|
|
import { Apis } from '@/gen/Apis';
|
||
|
|
import { BannerSpacesTypeEnum } from '@/gen/Enums';
|
||
|
|
import { ProTable } from '@ant-design/pro-components';
|
||
|
|
import { useNavigate } from '@umijs/max';
|
||
|
|
import { Space } from 'antd';
|
||
|
|
import HouseChargeCreate from './modals/HouseChargeCreate';
|
||
|
|
import HouseChargeUpdate from './modals/HouseChargeUpdate';
|
||
|
|
|
||
|
|
export default function Index({ title = '收费标准' }) {
|
||
|
|
const navigate = useNavigate();
|
||
|
|
|
||
|
|
// 注册当前页面为标签页
|
||
|
|
usePageTabs({
|
||
|
|
tabKey: 'house-charge',
|
||
|
|
tabLabel: title,
|
||
|
|
});
|
||
|
|
|
||
|
|
return (
|
||
|
|
<MyPageContainer
|
||
|
|
title={title}
|
||
|
|
enableTabs={true}
|
||
|
|
tabKey="banner-spaces"
|
||
|
|
tabLabel={title}
|
||
|
|
>
|
||
|
|
<ProTable
|
||
|
|
{...MyProTableProps.props}
|
||
|
|
request={async (params, sort) =>
|
||
|
|
MyProTableProps.request(
|
||
|
|
params,
|
||
|
|
sort,
|
||
|
|
Apis.HouseCharage.HouseChargeStandards.List,
|
||
|
|
)
|
||
|
|
}
|
||
|
|
toolBarRender={(action) => [
|
||
|
|
<HouseChargeCreate
|
||
|
|
key="Create"
|
||
|
|
reload={action?.reload}
|
||
|
|
title={title}
|
||
|
|
/>,
|
||
|
|
]}
|
||
|
|
columns={[
|
||
|
|
MyColumns.ID(),
|
||
|
|
{
|
||
|
|
title: '广告位名称',
|
||
|
|
dataIndex: 'name',
|
||
|
|
},
|
||
|
|
MyColumns.EnumTag({
|
||
|
|
title: '类型',
|
||
|
|
dataIndex: 'type',
|
||
|
|
valueEnum: BannerSpacesTypeEnum,
|
||
|
|
search: false,
|
||
|
|
}),
|
||
|
|
{
|
||
|
|
title: '备注',
|
||
|
|
dataIndex: 'remark',
|
||
|
|
search: false,
|
||
|
|
ellipsis: true,
|
||
|
|
},
|
||
|
|
MyColumns.CreatedAt(),
|
||
|
|
MyColumns.Option({
|
||
|
|
render: (_, item: any, index, action) => (
|
||
|
|
<Space key={index}>
|
||
|
|
<MyButtons.View
|
||
|
|
title="查看"
|
||
|
|
onClick={() => {
|
||
|
|
navigate(`/house_charge/${item.id}`);
|
||
|
|
}}
|
||
|
|
/>
|
||
|
|
<HouseChargeUpdate
|
||
|
|
item={item}
|
||
|
|
reload={action?.reload}
|
||
|
|
title={title}
|
||
|
|
/>
|
||
|
|
<MyButtons.Delete
|
||
|
|
onConfirm={() =>
|
||
|
|
Apis.HouseCharage.HouseChargeStandards.Delete({
|
||
|
|
id: item.id,
|
||
|
|
}).then(() => action?.reload())
|
||
|
|
}
|
||
|
|
/>
|
||
|
|
</Space>
|
||
|
|
),
|
||
|
|
}),
|
||
|
|
]}
|
||
|
|
/>
|
||
|
|
</MyPageContainer>
|
||
|
|
);
|
||
|
|
}
|