fix(ui): 统一表格筛选分页和用量明细,升级 ESLint

This commit is contained in:
zhanjunhao
2026-11-19 23:09:58 +08:00
parent 7908ed53a3
commit 04cc45bbb7
76 changed files with 2556 additions and 2410 deletions
@@ -24,7 +24,6 @@ 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,
@@ -240,63 +239,69 @@ const VideoTaskQueue = ({
{
title: t('操作'),
dataIndex: 'operate',
width: 168,
width: !isCompact ? 220 : 180,
fixed: 'right',
render: (text, record) => {
const normalizedStatus = normalizeVideoTaskStatus(record.status);
return (
<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,
},
]}
>
<Space>
{/* 播放和下载按钮:仅根据状态显示,视频URL在点击时才获取 */}
{normalizedStatus === 'success' && (
<Button
size='small'
type='tertiary'
icon={<ActionPlay size={14} />}
onClick={() => onPlay && onPlay(record)}
>
{t('播放')}
</Button>
<>
<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>
</>
)}
</TableRowActions>
{/* 再生成按钮 - 对所有已完成或失败的任务显示 */}
{(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>
);
},
},