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
+4 -2
View File
@@ -133,9 +133,11 @@ 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>
<Image src={trace.wechatQrCode} alt="公众号二维码" width={160} /> <div className="product-trace-wechat-qr-stage">
<Image src={trace.wechatQrCode} alt="公众号二维码" width={160} />
</div>
</div> </div>
)} )}
<div className="detail-item"> <div className="detail-item">
+56 -23
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,30 +260,61 @@ function ProductTracesPage() {
{ {
title: '操作', title: '操作',
key: 'actions', key: 'actions',
width: 260, width: 210,
render: (_: unknown, record: ProductTrace) => ( render: (_: unknown, record: ProductTrace) => {
<Space> const moreItems = [
<Button type="link" size="small" icon={<EyeOutlined />} onClick={() => openEdit(record)}> ...(record.isActive
? [
</Button> {
<Button key: 'revoke',
type="link" label: '停用',
size="small" danger: true,
icon={<QrcodeOutlined />} icon: <StopOutlined />,
onClick={() => handleGenerateQrCode(record)} },
> ]
: []),
</Button> {
{record.isActive && ( key: 'delete',
<Button type="link" size="small" danger icon={<StopOutlined />} onClick={() => handleRevoke(record)}> label: '删除',
danger: true,
icon: <DeleteOutlined />,
},
];
return (
<Space size={0}>
<Button type="link" size="small" icon={<EyeOutlined />} onClick={() => openEdit(record)}>
</Button> </Button>
)} <Button
<Button type="link" size="small" danger icon={<DeleteOutlined />} onClick={() => handleDelete(record)}> type="link"
size="small"
</Button> icon={<QrcodeOutlined />}
</Space> onClick={() => handleGenerateQrCode(record)}
), >
</Button>
<Dropdown
menu={{
items: moreItems,
onClick: ({ key }) => {
if (key === 'revoke') {
handleRevoke(record);
}
if (key === 'delete') {
handleDelete(record);
}
},
}}
trigger={['click']}
>
<Button type="link" size="small" icon={<MoreOutlined />}>
</Button>
</Dropdown>
</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;