style: refine product trace UI
This commit is contained in:
@@ -133,9 +133,11 @@ function ProductTracePublicPage() {
|
||||
</div>
|
||||
)}
|
||||
{trace.wechatQrCode && (
|
||||
<div className="detail-item detail-item-block">
|
||||
<div className="detail-item detail-item-block product-trace-wechat-qr">
|
||||
<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 className="detail-item">
|
||||
|
||||
+56
-23
@@ -3,6 +3,7 @@ import {
|
||||
Button,
|
||||
Card,
|
||||
DatePicker,
|
||||
Dropdown,
|
||||
Form,
|
||||
Image,
|
||||
Input,
|
||||
@@ -18,6 +19,7 @@ import {
|
||||
DeleteOutlined,
|
||||
EyeOutlined,
|
||||
LinkOutlined,
|
||||
MoreOutlined,
|
||||
PlusOutlined,
|
||||
QrcodeOutlined,
|
||||
StopOutlined,
|
||||
@@ -258,30 +260,61 @@ function ProductTracesPage() {
|
||||
{
|
||||
title: '操作',
|
||||
key: 'actions',
|
||||
width: 260,
|
||||
render: (_: unknown, record: ProductTrace) => (
|
||||
<Space>
|
||||
<Button type="link" size="small" icon={<EyeOutlined />} onClick={() => openEdit(record)}>
|
||||
详情
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
icon={<QrcodeOutlined />}
|
||||
onClick={() => handleGenerateQrCode(record)}
|
||||
>
|
||||
二维码
|
||||
</Button>
|
||||
{record.isActive && (
|
||||
<Button type="link" size="small" danger icon={<StopOutlined />} onClick={() => handleRevoke(record)}>
|
||||
停用
|
||||
width: 210,
|
||||
render: (_: unknown, record: ProductTrace) => {
|
||||
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>
|
||||
)}
|
||||
<Button type="link" size="small" danger icon={<DeleteOutlined />} onClick={() => handleDelete(record)}>
|
||||
删除
|
||||
</Button>
|
||||
</Space>
|
||||
),
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
icon={<QrcodeOutlined />}
|
||||
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>
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -132,6 +132,16 @@
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.product-trace-wechat-qr {
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.product-trace-wechat-qr-stage {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
margin-top: 32px;
|
||||
text-align: center;
|
||||
|
||||
Reference in New Issue
Block a user