From 52043adbc126ce78f66f261550bdddd8f689423b Mon Sep 17 00:00:00 2001 From: yml2213 Date: Sun, 18 Oct 2026 11:24:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8D=8F=E4=BD=9C=E5=8D=95=E7=A4=BC?= =?UTF-8?q?=E5=8C=85=E5=90=8D=E5=88=86=E8=A1=8C=E6=98=BE=E7=A4=BA=EF=BC=8C?= =?UTF-8?q?=E4=BF=9D=E7=95=99=E7=B1=BB=E7=9B=AE=E5=89=8D=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/frontend/src/pages/HuyaCollabPage.tsx | 38 +++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/web/frontend/src/pages/HuyaCollabPage.tsx b/web/frontend/src/pages/HuyaCollabPage.tsx index aba6cd3..8b67939 100644 --- a/web/frontend/src/pages/HuyaCollabPage.tsx +++ b/web/frontend/src/pages/HuyaCollabPage.tsx @@ -1573,6 +1573,37 @@ export default function HuyaCollabPage() { return short.length > 10 ? `${short.slice(0, 10)}…` : short; }; + /** + * 表格里选中礼包后的显示: + * 第一行保留活动 / 类目前缀(如「[限量返场]」),第二行完整显示礼包名。 + * 之前整串单行塞进 160px,前缀就把真正的礼包名挤成省略号了。 + */ + const renderGiftSelectedLabel = (name: string) => { + const gift = giftOptions.find((item) => item.name === name); + if (!gift) { + return ( + + {name} + + ); + } + return ( + + {gift.category_name && ( + + [{gift.category_name}] + + )} + + {gift.name} + + + ); + }; + const renderFrequentGiftChips = ( current: string | undefined, pick: (name: string) => void, @@ -1756,7 +1787,7 @@ export default function HuyaCollabPage() { ), }, { - title: '礼包 / 备注', width: 160, + title: '礼包 / 备注', width: 190, ...sortProps('gift_name'), render: (_, row) => ( @@ -1772,6 +1803,9 @@ export default function HuyaCollabPage() { disabled={!canEdit} placeholder="+ 点选礼包" popupMatchSelectWidth={false} + // 前缀单独一行、礼包名完整换行,别让单行省略号把名字吃掉 + labelRender={() => renderGiftSelectedLabel(row.gift_name)} + styles={{ content: { whiteSpace: 'normal', textOverflow: 'clip', lineHeight: 1.3 } }} notFoundContent={giftOptions.length === 0 ? '礼包缓存为空:先在「新建」里贴 CK 拉一次' : '没有匹配的礼包'} onChange={(next: string) => void patchOrder(row, { gift_name: next })} /> @@ -2154,7 +2188,7 @@ export default function HuyaCollabPage() { loading={loading} columns={columns} dataSource={rows} - scroll={{ x: 2200, y: 'calc(100vh - 460px)' }} + scroll={{ x: 2240, y: 'calc(100vh - 460px)' }} sortDirections={['ascend', 'descend']} onChange={(_pagination, _filters, sorter, extra) => { if (extra.action !== 'sort') return;