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
+29 -35
View File
@@ -19,8 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
import React, { useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Button, Empty, Modal, Space, Tag, Typography } from 'antd';
import { TableRowActions } from '@/components/common/table/TableToolbar';
import { Button, Empty, Popconfirm, Space, Tag, Typography } from 'antd';
import { Table } from '@/components/ui';
import { ConsoleAlert as Alert } from '../console/ConsolePrimitives';
import { Plus } from '../common/icons/ActionIcons';
@@ -149,37 +148,7 @@ const ProfileTable = ({ mode, orgId, canWrite = true, emptyHint }) => {
fixed: 'right',
width: 180,
render: (_, r) => (
<TableRowActions
items={[
canWrite && {
key: 'edit',
label: t('编辑'),
onClick: () => setEditing(r),
},
canWrite && {
key: 'delete',
label: t('删除'),
danger: true,
onClick: () =>
Modal.confirm({
title: t('确认删除该集合?'),
content: t('使用该虚拟模型名的请求将返回"模型不存在"。'),
okText: t('确认'),
cancelText: t('取消'),
okButtonProps: { danger: true },
onOk: async () => {
try {
await deleteProfile(mode, orgId, r.id);
showSuccess(t('已删除'));
load();
} catch (e) {
if (e?.message) showError(e.message);
}
},
}),
},
]}
>
<Space size={8} wrap>
<Button
type='link'
size='small'
@@ -188,7 +157,32 @@ const ProfileTable = ({ mode, orgId, canWrite = true, emptyHint }) => {
>
{t('试路由')}
</Button>
</TableRowActions>
{canWrite && (
<>
<Button type='link' size='small' onClick={() => setEditing(r)}>
{t('编辑')}
</Button>
<Popconfirm
title={t('确认删除该集合?')}
description={t('使用该虚拟模型名的请求将返回"模型不存在"。')}
okButtonProps={{ danger: true }}
onConfirm={async () => {
try {
await deleteProfile(mode, orgId, r.id);
showSuccess(t('已删除'));
load();
} catch (e) {
if (e?.message) showError(e.message);
}
}}
>
<Button type='link' size='small' danger>
{t('删除')}
</Button>
</Popconfirm>
</>
)}
</Space>
),
},
];
@@ -227,7 +221,7 @@ const ProfileTable = ({ mode, orgId, canWrite = true, emptyHint }) => {
loading={loading}
columns={columns}
dataSource={list}
pagination={false}
pagination={mode === 'org' ? { resetOnDataChange: true } : false}
scroll={{ x: 'max-content' }}
empty={
<Empty