fix(ui): 修复登录与并发请求并统一表格、主题和页面展示

验证:868 项单测、ESLint、Prettier、UI 依赖审计和差异检查通过。
This commit is contained in:
zhanjunhao
2026-11-19 18:58:46 +08:00
parent 99fe167103
commit 13105bdba5
128 changed files with 4672 additions and 5391 deletions
@@ -18,8 +18,8 @@ For commercial licensing, please contact support@quantumnous.com
*/
import React from 'react';
import { Tag, Button, Space, Popover, Dropdown } from '@/components/ui';
import { IconMore } from '@/components/ui/icons';
import { Tag, Button, Popover } from '@/components/ui';
import { TableRowActions } from '@/components/common/table/TableToolbar';
import {
renderQuota,
timestamp2string,
@@ -144,46 +144,42 @@ export const getRedemptionsColumns = ({
},
},
{
title: '',
title: t('操作'),
dataIndex: 'operate',
fixed: 'right',
width: 205,
width: 215,
render: (text, record) => {
// Create dropdown menu items for more operations
const moreMenuItems = [
{
node: 'item',
name: t('删除'),
type: 'danger',
onClick: () => {
showDeleteRedemptionModal(record);
},
},
];
if (record.status === REDEMPTION_STATUS.UNUSED && !isExpired(record)) {
const moreMenuItems = [];
if (isAdmin() && !isExpired(record)) {
const unused = record.status === REDEMPTION_STATUS.UNUSED;
moreMenuItems.push({
node: 'item',
name: t('禁用'),
type: 'warning',
onClick: () => {
manageRedemption(record.id, REDEMPTION_ACTIONS.DISABLE, record);
},
});
} else if (!isExpired(record)) {
moreMenuItems.push({
node: 'item',
name: t('启用'),
type: 'secondary',
onClick: () => {
manageRedemption(record.id, REDEMPTION_ACTIONS.ENABLE, record);
},
key: 'toggle-status',
label: unused ? t('禁用') : t('启用'),
disabled: record.status === REDEMPTION_STATUS.USED,
onClick: () =>
manageRedemption(
record.id,
unused ? REDEMPTION_ACTIONS.DISABLE : REDEMPTION_ACTIONS.ENABLE,
record,
),
});
}
moreMenuItems.unshift({
key: 'copy',
label: t('复制'),
onClick: () => copyText(record.key),
});
if (isAdmin()) {
moreMenuItems.push({
key: 'delete',
label: t('删除'),
danger: true,
onClick: () => showDeleteRedemptionModal(record),
});
}
return (
<Space>
<TableRowActions items={moreMenuItems}>
<Popover
// 触屏必须 click:这是查看兑换码明文的唯一入口
trigger={hoverOrClickTrigger()}
@@ -191,41 +187,24 @@ export const getRedemptionsColumns = ({
style={{ padding: 20 }}
position='top'
>
<Button type='tertiary' size='small'>
<Button type='link' size='small'>
{t('查看')}
</Button>
</Popover>
<Button
size='small'
onClick={async () => {
await copyText(record.key);
}}
>
{t('复制')}
</Button>
{isAdmin() && (
<>
<Button
type='tertiary'
size='small'
onClick={() => {
setEditingRedemption(record);
setShowEdit(true);
}}
disabled={record.status !== REDEMPTION_STATUS.UNUSED}
>
{t('编辑')}
</Button>
<Dropdown
trigger='click'
position='bottomRight'
menu={moreMenuItems}
>
<Button type='tertiary' size='small' icon={<IconMore />} />
</Dropdown>
</>
<Button
type='link'
size='small'
onClick={() => {
setEditingRedemption(record);
setShowEdit(true);
}}
disabled={record.status !== REDEMPTION_STATUS.UNUSED}
>
{t('编辑')}
</Button>
)}
</Space>
</TableRowActions>
);
},
},