优化卡券号码展示与复制

This commit is contained in:
yml2213
2026-07-23 11:21:55 +08:00
parent bd8b928423
commit d60a771142
2 changed files with 27 additions and 7 deletions
@@ -208,19 +208,27 @@ export default function AdminKuaishouIndustryPage() {
const columns = useMemo<TableColumnsType<AdminKuaishouIndustryVoucher>>( const columns = useMemo<TableColumnsType<AdminKuaishouIndustryVoucher>>(
() => [ () => [
{ {
title: '码', title: '卡券号码',
width: 168, width: 236,
render: (_, row) => ( render: (_, row) => (
<div className="cell-stack"> <div className="cell-stack">
<Typography.Text strong copyable ellipsis={{ tooltip: row.voucherCode }}> <Typography.Text
{row.voucherCode} strong
copyable={Boolean(row.voucherCode)}
className="kuaishou-voucher-code-text"
title={row.voucherCode || undefined}
>
{row.voucherCode || '-'}
</Typography.Text> </Typography.Text>
<span className="muted">{row.unitIndex}</span> <span className="muted kuaishou-voucher-meta">
{formatAdminDateTime(row.sendCallbackSentAt)}
</span>
</div> </div>
), ),
}, },
{ {
title: '订单商品', title: '订单商品',
width: 348,
// 主列自适应:订单号 + 商品名,避免额外「商品」列占宽 // 主列自适应:订单号 + 商品名,避免额外「商品」列占宽
ellipsis: true, ellipsis: true,
render: (_, row) => { render: (_, row) => {
@@ -871,7 +879,7 @@ export default function AdminKuaishouIndustryPage() {
dataSource={vouchers} dataSource={vouchers}
loading={voucherLoading} loading={voucherLoading}
// 列已压缩;仅在极窄容器时横向滚动 // 列已压缩;仅在极窄容器时横向滚动
scroll={scrollX ? { x: scrollX } : undefined} scroll={{ x: scrollX || 1064 }}
pagination={buildAdminTablePagination({ pagination={buildAdminTablePagination({
current: voucherFilters.page, current: voucherFilters.page,
pageSize: voucherFilters.pageSize, pageSize: voucherFilters.pageSize,
@@ -898,7 +906,7 @@ export default function AdminKuaishouIndustryPage() {
<div className="kuaishou-industry-split"> <div className="kuaishou-industry-split">
<Card title="本地券码" className="kuaishou-industry-voucher-card"> <Card title="本地券码" className="kuaishou-industry-voucher-card">
{renderVoucherTable(760)} {renderVoucherTable(1064)}
</Card> </Card>
<Card title="接口操作"> <Card title="接口操作">
+12
View File
@@ -289,6 +289,18 @@ select {
min-width: 0; min-width: 0;
} }
.kuaishou-voucher-code-text {
min-width: 0;
white-space: normal;
overflow-wrap: anywhere;
word-break: break-all;
}
.kuaishou-voucher-meta {
font-size: 12px;
line-height: 1.4;
}
.muted { .muted {
color: #6b7280; color: #6b7280;
} }