Files
tashow-manager/src/pages/prod/list/config.tsx
2025-10-29 17:10:53 +08:00

91 lines
2.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { ProColumns } from '@ant-design/pro-components';
import { Badge, Button, Image, Space, Typography } from 'antd';
import dayjs from 'dayjs';
import type { Prod } from '@/services/prod/prod-manager';
const { Text } = Typography;
export const baseTenantColumns: ProColumns<Prod>[] = [
{
title: '商品',
dataIndex: 'prodName',
render: (_, record) => (
<Space>
<Image width={64} height={64} src={record.pic} />
<div>
<div>
<Text>{record.categoryName}</Text>
</div>
<div>
<Text type="secondary">ID{record.categoryName}</Text>
</div>
<div>
<Text type="secondary">{record.categoryName}</Text>
</div>
</div>
</Space>
),
},
{
title: '服务信息',
dataIndex: 'categoryId',
render: () => (
<Space direction="vertical">
<div>
<Text type="secondary"></Text>
<Text></Text>
</div>
<div>
<Text type="secondary"></Text>
<Text></Text>
</div>
<div>
<Text type="secondary"></Text>
<Text></Text>
</div>
</Space>
),
},
{
title: '状态',
dataIndex: 'status',
valueType: 'switch',
width: 300,
hideInSearch: true,
render: () => (
<Space direction="vertical">
<Space>
<Badge status="success" text="出售中" />
<Badge status="default" text="已置灰" />
<Badge status="warning" text="待审核" />
<Badge status="default" text="仓库中" />
</Space>
<Button size="small" type="dashed">
</Button>
</Space>
),
},
{
title: '时间信息',
dataIndex: 'createTime',
valueType: 'dateRange',
hideInSearch: true, // 在搜索表单中隐藏
render: (_, record) => (
<Space direction="vertical">
<div>
<Image></Image>
</div>
<div>
<Text type="secondary"></Text>
{dayjs(record.createTime).format('YYYY-MM-DD HH:mm:ss')}
</div>
<div>
<Text type="secondary"></Text>
{dayjs(record.updateTime).format('YYYY-MM-DD HH:mm:ss')}
</div>
</Space>
),
},
];