📌 feat(table): add fixed right column to all data tables

Fix the last column (operation/detail columns) to the right side across all table components to improve user experience and ensure important actions remain visible during horizontal scrolling.

Changes:
- ChannelsTable.js: Fix operation column to right
- UsersTable.js: Fix operation column to right
- TokensTable.js: Fix operation column to right
- RedemptionsTable.js: Fix operation column to right
- LogsTable.js: Fix details column to right
- MjLogsTable.js: Fix fail reason column to right
- TaskLogsTable.js: Fix fail reason column to right

All tables now have their rightmost column fixed using Semi Design's `fixed: 'right'` property, ensuring critical information and actions are always accessible regardless of table scroll position.
This commit is contained in:
Apple\Apple
2025-06-07 02:45:07 +08:00
parent b4be218af8
commit 2100d32bab
7 changed files with 230 additions and 269 deletions

View File

@@ -87,17 +87,14 @@ const UsersTable = () => {
{
title: 'ID',
dataIndex: 'id',
width: 50,
},
{
title: t('用户名'),
dataIndex: 'username',
width: 100,
},
{
title: t('分组'),
dataIndex: 'group',
width: 100,
render: (text, record, index) => {
return <div>{renderGroup(text)}</div>;
},
@@ -105,7 +102,6 @@ const UsersTable = () => {
{
title: t('统计信息'),
dataIndex: 'info',
width: 280,
render: (text, record, index) => {
return (
<div>
@@ -127,7 +123,6 @@ const UsersTable = () => {
{
title: t('邀请信息'),
dataIndex: 'invite',
width: 250,
render: (text, record, index) => {
return (
<div>
@@ -149,7 +144,6 @@ const UsersTable = () => {
{
title: t('角色'),
dataIndex: 'role',
width: 120,
render: (text, record, index) => {
return <div>{renderRole(text)}</div>;
},
@@ -157,7 +151,6 @@ const UsersTable = () => {
{
title: t('状态'),
dataIndex: 'status',
width: 100,
render: (text, record, index) => {
return (
<div>
@@ -173,7 +166,7 @@ const UsersTable = () => {
{
title: '',
dataIndex: 'operate',
width: 150,
fixed: 'right',
render: (text, record, index) => {
if (record.DeletedAt !== null) {
return <></>;
@@ -549,36 +542,39 @@ const UsersTable = () => {
></EditUser>
<Card
className="!rounded-2xl overflow-hidden"
className="!rounded-2xl"
title={renderHeader()}
shadows='always'
bordered={false}
>
<Table
columns={columns}
dataSource={users}
pagination={{
formatPageText: (page) =>
t('第 {{start}} - {{end}} 条,共 {{total}} 条', {
start: page.currentStart,
end: page.currentEnd,
total: userCount,
}),
currentPage: activePage,
pageSize: pageSize,
total: userCount,
pageSizeOpts: [10, 20, 50, 100],
showSizeChanger: true,
onPageSizeChange: (size) => {
handlePageSizeChange(size);
},
onPageChange: handlePageChange,
}}
loading={loading}
onRow={handleRow}
className="rounded-xl overflow-hidden"
size="middle"
/>
<div style={{ overflow: 'auto' }}>
<Table
columns={columns}
dataSource={users}
scroll={{ x: 'max-content' }}
pagination={{
formatPageText: (page) =>
t('第 {{start}} - {{end}} 条,共 {{total}} 条', {
start: page.currentStart,
end: page.currentEnd,
total: userCount,
}),
currentPage: activePage,
pageSize: pageSize,
total: userCount,
pageSizeOpts: [10, 20, 50, 100],
showSizeChanger: true,
onPageSizeChange: (size) => {
handlePageSizeChange(size);
},
onPageChange: handlePageChange,
}}
loading={loading}
onRow={handleRow}
className="rounded-xl overflow-hidden"
size="middle"
/>
</div>
</Card>
</>
);