style: refine product trace UI

This commit is contained in:
Frudrax Cheng
2026-06-05 17:40:13 +08:00
parent fe8bfe3580
commit a693f249a6
3 changed files with 70 additions and 25 deletions
+3 -1
View File
@@ -133,10 +133,12 @@ function ProductTracePublicPage() {
</div> </div>
)} )}
{trace.wechatQrCode && ( {trace.wechatQrCode && (
<div className="detail-item detail-item-block"> <div className="detail-item detail-item-block product-trace-wechat-qr">
<span className="label"></span> <span className="label"></span>
<div className="product-trace-wechat-qr-stage">
<Image src={trace.wechatQrCode} alt="公众号二维码" width={160} /> <Image src={trace.wechatQrCode} alt="公众号二维码" width={160} />
</div> </div>
</div>
)} )}
<div className="detail-item"> <div className="detail-item">
<span className="label"></span> <span className="label"></span>
+44 -11
View File
@@ -3,6 +3,7 @@ import {
Button, Button,
Card, Card,
DatePicker, DatePicker,
Dropdown,
Form, Form,
Image, Image,
Input, Input,
@@ -18,6 +19,7 @@ import {
DeleteOutlined, DeleteOutlined,
EyeOutlined, EyeOutlined,
LinkOutlined, LinkOutlined,
MoreOutlined,
PlusOutlined, PlusOutlined,
QrcodeOutlined, QrcodeOutlined,
StopOutlined, StopOutlined,
@@ -258,9 +260,29 @@ function ProductTracesPage() {
{ {
title: '操作', title: '操作',
key: 'actions', key: 'actions',
width: 260, width: 210,
render: (_: unknown, record: ProductTrace) => ( render: (_: unknown, record: ProductTrace) => {
<Space> const moreItems = [
...(record.isActive
? [
{
key: 'revoke',
label: '停用',
danger: true,
icon: <StopOutlined />,
},
]
: []),
{
key: 'delete',
label: '删除',
danger: true,
icon: <DeleteOutlined />,
},
];
return (
<Space size={0}>
<Button type="link" size="small" icon={<EyeOutlined />} onClick={() => openEdit(record)}> <Button type="link" size="small" icon={<EyeOutlined />} onClick={() => openEdit(record)}>
</Button> </Button>
@@ -272,16 +294,27 @@ function ProductTracesPage() {
> >
</Button> </Button>
{record.isActive && ( <Dropdown
<Button type="link" size="small" danger icon={<StopOutlined />} onClick={() => handleRevoke(record)}> menu={{
items: moreItems,
</Button> onClick: ({ key }) => {
)} if (key === 'revoke') {
<Button type="link" size="small" danger icon={<DeleteOutlined />} onClick={() => handleDelete(record)}> handleRevoke(record);
}
if (key === 'delete') {
handleDelete(record);
}
},
}}
trigger={['click']}
>
<Button type="link" size="small" icon={<MoreOutlined />}>
</Button> </Button>
</Dropdown>
</Space> </Space>
), );
},
}, },
]; ];
+10
View File
@@ -132,6 +132,16 @@
font-weight: bold; font-weight: bold;
} }
.product-trace-wechat-qr {
align-items: stretch;
}
.product-trace-wechat-qr-stage {
width: 100%;
display: flex;
justify-content: center;
}
.copyright { .copyright {
margin-top: 32px; margin-top: 32px;
text-align: center; text-align: center;