fix(ui): 优化商品列表列宽,SKU 不再换行
- SKU 列 180→200px 并加 ellipsis,长 SKU 单行省略不换行 - 名称列加 width:200 + ellipsis,不再无限占满剩余空间 - 目录编码 160→140,售价/成本 110→100,库存/状态 90→80,操作 90→80 - SKU Typography.Text 加 maxWidth:100% + ellipsis 确保超长文本单行截断
This commit is contained in:
@@ -338,17 +338,17 @@ export default function MerchantCenter() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const productColumns: ColumnsType<MerchantProduct> = [
|
const productColumns: ColumnsType<MerchantProduct> = [
|
||||||
{ title: 'SKU', dataIndex: 'sku', width: 180, render: (v) => <Typography.Text code copyable>{v}</Typography.Text> },
|
{ title: 'SKU', dataIndex: 'sku', width: 200, ellipsis: true, render: (v) => <Typography.Text code copyable={{ tooltips: false }} style={{ maxWidth: '100%' }} ellipsis>{v}</Typography.Text> },
|
||||||
{ title: '名称', dataIndex: 'display_name', ellipsis: true, render: (_, r) => r.display_name || r.product?.name || '-' },
|
{ title: '名称', dataIndex: 'display_name', width: 200, ellipsis: true, render: (_, r) => r.display_name || r.product?.name || '-' },
|
||||||
{ title: '目录编码', dataIndex: ['product', 'code'], width: 160, ellipsis: true, render: (_, r) => r.product?.code || '-' },
|
{ title: '目录编码', dataIndex: ['product', 'code'], width: 140, ellipsis: true, render: (_, r) => r.product?.code || '-' },
|
||||||
{ title: '售价', dataIndex: 'price_amount', width: 110, render: money },
|
{ title: '售价', dataIndex: 'price_amount', width: 100, render: money },
|
||||||
{ title: '成本', dataIndex: 'cost_amount', width: 110, render: money },
|
{ title: '成本', dataIndex: 'cost_amount', width: 100, render: money },
|
||||||
{ title: '库存', dataIndex: 'stock', width: 90, render: (v) => (v < 0 ? '无限' : v) },
|
{ title: '库存', dataIndex: 'stock', width: 80, render: (v) => (v < 0 ? '无限' : v) },
|
||||||
{ title: '状态', dataIndex: 'status', width: 90, render: productStatusTag },
|
{ title: '状态', dataIndex: 'status', width: 80, render: productStatusTag },
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
width: 90,
|
width: 80,
|
||||||
render: (_, record) => canManage ? (
|
render: (_, record) => canManage ? (
|
||||||
<Button type="link" size="small" onClick={() => openProductEdit(record)}>编辑</Button>
|
<Button type="link" size="small" onClick={() => openProductEdit(record)}>编辑</Button>
|
||||||
) : '-',
|
) : '-',
|
||||||
|
|||||||
Reference in New Issue
Block a user