import {
MyButtons,
MyColumns,
MyPageContainer,
MyProTableProps,
useCurrentPermissions,
} from '@/common';
import { Selects } from '@/components/Select';
import { Apis } from '@/gen/Apis';
import {
AssetCarPortsPropertyTypeEnum,
AssetCarPortsStatusEnum,
AssetCarPortsTypeEnum,
} from '@/gen/Enums';
import { ProTable } from '@ant-design/pro-components';
import { Space } from 'antd';
import SpaceUpdate from './modals/SpaceUpdate';
export default function Index({ title = '车位列表' }) {
const getCurrentPermissions = useCurrentPermissions();
let tableRender = (item: any, action: any) => {
return getCurrentPermissions({
update: ,
delete: (
Apis.Asset.AssetCarPorts.Delete({
id: item.id,
}).then(() => action?.reload())
}
/>
),
});
};
return (
MyProTableProps.request(params, sort, Apis.Asset.AssetCarPorts.List)
}
// toolBarRender={(action) => [
// ,
// ]}
columns={[
MyColumns.ID({ search: false }),
Selects?.AssetProjects({
title: '选择项目',
key: 'asset_projects_id',
hidden: true,
}),
{
title: '项目名称',
dataIndex: ['asset_project', 'name'],
search: {
transform: (value) => {
return { project_name: value };
},
},
},
{
title: '车场名称',
dataIndex: ['asset_parking_place', 'name'],
search: {
transform: (value) => {
return { parking_place_name: value };
},
},
},
{
title: '车位号',
dataIndex: 'name',
search: false,
},
{
title: '车位全称',
dataIndex: 'full_name',
},
{
title: '建筑面积',
dataIndex: 'built_area',
search: false,
},
MyColumns.EnumTag({
title: '类型',
dataIndex: 'type',
valueEnum: AssetCarPortsTypeEnum,
}),
MyColumns.EnumTag({
title: '产权类型',
dataIndex: 'property_type',
valueEnum: AssetCarPortsPropertyTypeEnum,
}),
MyColumns.EnumTag({
title: '状态',
dataIndex: 'status',
valueEnum: AssetCarPortsStatusEnum,
}),
MyColumns.CreatedAt(),
MyColumns.Option({
render: (_, item: any, index, action) => (
{tableRender(item, action)}
),
}),
]}
/>
);
}