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
@@ -24,6 +24,7 @@ import {
Trash2 as ActionTrash2,
AlertCircle as ActionAlertCircle,
} from '@/components/common/icons/ActionIcons';
import { TableRowActions } from '@/components/common/table/TableToolbar';
import React, { useState, useEffect } from 'react';
import {
Table,
@@ -239,69 +240,63 @@ const VideoTaskQueue = ({
{
title: t('操作'),
dataIndex: 'operate',
width: !isCompact ? 220 : 180,
width: 168,
fixed: 'right',
render: (text, record) => {
const normalizedStatus = normalizeVideoTaskStatus(record.status);
return (
<Space>
{/* 播放和下载按钮:仅根据状态显示,视频URL在点击时才获取 */}
<TableRowActions
items={[
normalizedStatus === 'success' && {
key: 'download',
label: t('下载'),
onClick: () => onDownload(record),
icon: <ActionDownload size={14} />,
},
(normalizedStatus === 'success' ||
normalizedStatus === 'failure') &&
canRegenerateVideoTask(record) && {
key: 'regenerate',
label: t('再生成'),
onClick: () => onRegenerate && onRegenerate(record),
icon: <ActionRefreshCw size={14} />,
},
{
key: 'delete',
label: t('删除'),
onClick: () => {
Modal.warning({
title: t('确定删除此任务?'),
content: t('删除后将无法恢复'),
icon: (
<ActionAlertCircle
size={24}
style={{ color: '#f59e0b' }}
/>
),
okText: t('确定'),
cancelText: t('取消'),
onOk: () => onDelete(record.task_id),
centered: true,
okButtonProps: { type: 'danger' },
});
},
icon: <ActionTrash2 size={14} />,
danger: true,
},
]}
>
{normalizedStatus === 'success' && (
<>
<Button
size='small'
type='tertiary'
icon={<ActionPlay size={14} />}
onClick={() => onPlay && onPlay(record)}
>
{!isCompact ? t('播放') : ''}
</Button>
<Button
size='small'
type='tertiary'
icon={<ActionDownload size={14} />}
onClick={() => onDownload(record)}
>
{!isCompact ? t('下载') : ''}
</Button>
</>
<Button
size='small'
type='tertiary'
icon={<ActionPlay size={14} />}
onClick={() => onPlay && onPlay(record)}
>
{t('播放')}
</Button>
)}
{/* 再生成按钮 - 对所有已完成或失败的任务显示 */}
{(normalizedStatus === 'success' ||
normalizedStatus === 'failure') &&
canRegenerateVideoTask(record) && (
<Button
size='small'
type='primary'
icon={<ActionRefreshCw size={14} />}
onClick={() => onRegenerate && onRegenerate(record)}
>
{!isCompact ? t('再生成') : ''}
</Button>
)}
<Button
size='small'
type='danger'
icon={<ActionTrash2 size={14} />}
onClick={() => {
Modal.warning({
title: t('确定删除此任务?'),
content: t('删除后将无法恢复'),
icon: (
<ActionAlertCircle size={24} style={{ color: '#f59e0b' }} />
),
okText: t('确定'),
cancelText: t('取消'),
onOk: () => onDelete(record.task_id),
centered: true,
okButtonProps: { type: 'danger' },
});
}}
>
{!isCompact ? t('删除') : ''}
</Button>
</Space>
</TableRowActions>
);
},
},