diff --git a/frontend/src/pages/platformRock/RockTokenTable.tsx b/frontend/src/pages/platformRock/RockTokenTable.tsx index b7557ba..8d90ff1 100644 --- a/frontend/src/pages/platformRock/RockTokenTable.tsx +++ b/frontend/src/pages/platformRock/RockTokenTable.tsx @@ -275,7 +275,7 @@ export function RockTokenTable({ columns={columns} dataSource={tokens} loading={loadingTokens} - scroll={{ x: 1700 }} + scroll={{ x: 1100 }} rowSelection={{ selectedRowKeys: selectedTokenIds, preserveSelectedRowKeys: true, diff --git a/frontend/src/pages/platformRock/TokenRecycleBinDrawer.tsx b/frontend/src/pages/platformRock/TokenRecycleBinDrawer.tsx index de42203..3120fdb 100644 --- a/frontend/src/pages/platformRock/TokenRecycleBinDrawer.tsx +++ b/frontend/src/pages/platformRock/TokenRecycleBinDrawer.tsx @@ -17,6 +17,7 @@ import type { ColumnsType } from 'antd/es/table' import { UndoOutlined } from '@ant-design/icons' import { rockApi, type RockTokenItem, type RockTokenRestoreResult } from '../../api' import { formatDateTime } from '../../utils/time' +import { TokenInfoCell } from './tokenColumns' const { Text } = Typography @@ -181,43 +182,11 @@ export function TokenRecycleBinDrawer({ ).length const columns: ColumnsType = [ - { title: 'ID', dataIndex: 'id', width: 80 }, { - title: '0666 编号 / 兑换码', - dataIndex: 'upstream_token_id', - width: 360, - onCell: () => ({ style: { whiteSpace: 'nowrap' } }), - render: (_, record) => { - const text = `${record.upstream_token_id || '-'}/${record.redeem_code || '-'}` - // 复制按钮只复制兑换码,编号不参与复制 - const copyText = (record.redeem_code || '').trim() - return ( - - {text} - - ) - }, - }, - { - title: '包ID / 提取码', - width: 260, - render: (_, record) => { - const packageText = record.package_id ? String(record.package_id) : '-' - const text = `${packageText}/${record.token || '-'}` - // 复制按钮只复制提取码,包 ID 不参与复制 - const copyText = (record.token || '').trim() - return ( - - {text} - - ) - }, + title: 'ID / Token(编号/兑换码 · 包ID/提取码)', + key: 'token_info', + width: 330, + render: (_, record) => , }, { title: '状态', @@ -230,19 +199,19 @@ export function TokenRecycleBinDrawer({ { title: '订单号', dataIndex: 'assigned_order_no', - width: 200, + width: 180, render: (value?: string) => value || '-', }, { title: '角色', dataIndex: 'actual_role_name', - width: 140, + width: 130, render: (value?: string) => value || '-', }, { title: '删除时间', dataIndex: 'deleted_at', - width: 170, + width: 160, render: (value?: string | null) => formatDateTime(value), }, { @@ -347,7 +316,7 @@ export function TokenRecycleBinDrawer({ columns={columns} dataSource={rows} loading={loading} - scroll={{ x: 1560 }} + scroll={{ x: 1160 }} rowSelection={{ selectedRowKeys: selectedIds, onChange: (keys, selected) => { diff --git a/frontend/src/pages/platformRock/TokenRemarkCell.tsx b/frontend/src/pages/platformRock/TokenRemarkCell.tsx index 6571ba1..e4f231f 100644 --- a/frontend/src/pages/platformRock/TokenRemarkCell.tsx +++ b/frontend/src/pages/platformRock/TokenRemarkCell.tsx @@ -6,6 +6,7 @@ import { DeleteOutlined, EditOutlined, ExclamationCircleOutlined, + MessageOutlined, StopOutlined, } from '@ant-design/icons' import type { RockTokenItem } from '../../api' @@ -16,9 +17,16 @@ export interface TokenRemarkCellProps { record: RockTokenItem onUpdateRemark: (id: number, remark: string, status?: string) => void onMarkAbnormal: (id: number, remark?: string) => void + // 紧凑模式:表格里只渲染一个图标按钮,备注内容通过悬浮提示和弹层查看 + compact?: boolean } -export function TokenRemarkCell({ record, onUpdateRemark, onMarkAbnormal }: TokenRemarkCellProps) { +export function TokenRemarkCell({ + record, + onUpdateRemark, + onMarkAbnormal, + compact, +}: TokenRemarkCellProps) { const [open, setOpen] = useState(false) const [inputValue, setInputValue] = useState(record.remark || '') @@ -165,6 +173,31 @@ export function TokenRemarkCell({ record, onUpdateRemark, onMarkAbnormal }: Toke const isAbnormalOrReported = record.status === 'abnormal' || (record.remark && record.remark.includes('上报')) + if (compact) { + const hasRemark = Boolean(record.remark) + return ( + { + setOpen(v) + if (v) setInputValue(record.remark || '') + }} + placement="bottomLeft" + > + - - + +