feat: 内容管理
This commit is contained in:
@@ -1,43 +1,52 @@
|
||||
import type { ProColumns } from '@ant-design/pro-components';
|
||||
import { Button, Space, Tag, Typography } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import { dateFormat, dateFormatS } from '@/constants';
|
||||
import { Image, Space, Tag, Typography } from 'antd';
|
||||
import type { TradeOrderPageRespVO } from '@/services/trade/order';
|
||||
|
||||
const { Text, Paragraph } = Typography;
|
||||
export const baseOrderColumns: ProColumns<TradeOrderPageRespVO>[] = [
|
||||
{
|
||||
title: '商品',
|
||||
dataIndex: 'spuName',
|
||||
dataIndex: 'items',
|
||||
hideInSearch: true,
|
||||
width: '100%',
|
||||
ellipsis: true,
|
||||
render: (_, record) => (
|
||||
<Paragraph>
|
||||
<Paragraph ellipsis style={{ marginBottom: 0 }}>
|
||||
{record.spuName}
|
||||
</Paragraph>
|
||||
<div>{record.skuName}</div>
|
||||
<Space>
|
||||
<div>
|
||||
<Text type="secondary">数量:</Text>
|
||||
<Text>{record.count}</Text>
|
||||
render: (_, record) => {
|
||||
if (!record.items) {
|
||||
return _;
|
||||
}
|
||||
return record.items.map((item) => (
|
||||
<div
|
||||
style={{ width: '100%', display: 'flex', gap: '8px' }}
|
||||
key={item.id}
|
||||
>
|
||||
<Image src={item.picUrl} width={64} height={64} />
|
||||
<div style={{ flex: '1', overflow: 'hidden' }}>
|
||||
<Paragraph ellipsis style={{ width: '100%', marginBottom: 0 }}>
|
||||
{item.spuName}测试商品名称测试商品名称测试商品名称测试商品名称
|
||||
</Paragraph>
|
||||
<div>{item.skuName}</div>
|
||||
<Space>
|
||||
<div>
|
||||
<Text type="secondary">数量:</Text>
|
||||
<Text>{item.count || 0}</Text>
|
||||
</div>
|
||||
<div>
|
||||
<Text type="secondary">单价:</Text>
|
||||
<Text>
|
||||
{item.price || 0}/{item.unit || '-'}
|
||||
</Text>
|
||||
</div>
|
||||
<div>
|
||||
<Text type="secondary">到手价:</Text>
|
||||
<Text>
|
||||
{item.handedPrice || 0}/{item.unit || '-'}
|
||||
</Text>
|
||||
</div>
|
||||
</Space>
|
||||
</div>
|
||||
<div>
|
||||
<Text type="secondary">单价:</Text>
|
||||
<Text>
|
||||
{record.price}/{record.unit}
|
||||
</Text>
|
||||
</div>
|
||||
<div>
|
||||
<Text type="secondary">到手价:</Text>
|
||||
<Text>
|
||||
{record.handedPrice}/{record.unit}
|
||||
</Text>
|
||||
</div>
|
||||
</Space>
|
||||
</Paragraph>
|
||||
),
|
||||
</div>
|
||||
));
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
@@ -50,7 +59,7 @@ export const baseOrderColumns: ProColumns<TradeOrderPageRespVO>[] = [
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<Paragraph ellipsis style={{ marginBottom: 0 }}>
|
||||
<Text type="secondary">预约时间:</Text>
|
||||
<Text>{dayjs(record.subTime).format(dateFormatS)}</Text>
|
||||
<Text>{record?.subTime || '-'}</Text>
|
||||
<Tag style={{ marginLeft: 10 }}>预约</Tag>
|
||||
<Tag color="error" style={{ marginLeft: 10 }}>
|
||||
加急
|
||||
@@ -58,14 +67,11 @@ export const baseOrderColumns: ProColumns<TradeOrderPageRespVO>[] = [
|
||||
</Paragraph>
|
||||
<Paragraph ellipsis style={{ marginBottom: 0 }}>
|
||||
<Text type="secondary">服务地址:</Text>
|
||||
<Text>
|
||||
{record.serveAddress}
|
||||
服务地址:服务地址:服务地址:服务地址:服务地址:服务地址:
|
||||
</Text>
|
||||
<Text>{record.serveAddress || '-'}</Text>
|
||||
</Paragraph>
|
||||
<div>
|
||||
<Text type="secondary">用户备注:</Text>
|
||||
<Text>{record.userRemark}</Text>
|
||||
<Text>{record.userRemark || '-'}</Text>
|
||||
</div>
|
||||
</Space>
|
||||
),
|
||||
@@ -74,20 +80,20 @@ export const baseOrderColumns: ProColumns<TradeOrderPageRespVO>[] = [
|
||||
title: '财务',
|
||||
dataIndex: 'price',
|
||||
hideInSearch: true,
|
||||
width: '100',
|
||||
width: '100%',
|
||||
render: (_, record) => (
|
||||
<Space direction="vertical">
|
||||
<div>
|
||||
<Text type="secondary">实付金额:</Text>
|
||||
<Text>{record.payPrice}</Text>
|
||||
<Text>{record?.payPrice || '-'}</Text>
|
||||
</div>
|
||||
<div>
|
||||
<Text type="secondary">支付方式:</Text>
|
||||
<Text>{record.payType}</Text>
|
||||
<Text>{record.payType || '-'}</Text>
|
||||
</div>
|
||||
<div>
|
||||
<Text type="secondary">财务状态:</Text>
|
||||
<Text>{record.financeStatus}</Text>
|
||||
<Text>{record.financeStatus || '-'}</Text>
|
||||
</div>
|
||||
</Space>
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user