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
+86 -61
View File
@@ -17,7 +17,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { TableRowActions } from '@/components/common/table/TableToolbar';
import {
ExternalLink as ActionExternalLink,
BarChart3 as ActionBarChart3,
@@ -854,70 +853,96 @@ const AdminOrganizations = () => {
{
title: t('操作'),
key: 'actions',
width: 140,
width: 380,
fixed: 'right',
render: (_, record) =>
isAdmin() ? (
<TableRowActions
items={[
{
key: 'quota',
label: t('调额'),
onClick: () => {
render: (_, record) => (
<div className='console-module-row-actions'>
{isAdmin() && (
<>
<Button
type='link'
size='small'
onClick={() => openEditModal(record)}
>
{t('编辑')}
</Button>
<Button
type='link'
size='small'
onClick={() => {
setQuotaOrgId(record.id);
setQuotaAmount(0);
setQuotaModalVisible(true);
},
},
{
key: 'features',
label: t('功能开关'),
onClick: () => openFeatureModal(record),
},
{
key: 'status',
label:
record.status === 4
? t('激活')
: record.status === 1
? t('冻结')
: t('解冻'),
onClick: () =>
record.status === 4
? handleActivate(record.id)
: handleStatusChange(
record.id,
record.status === 1 ? 2 : 1,
),
},
isRoot() && {
key: 'notifications',
disabled: alertToggleLoading === record.id,
label: alertExcludedIds.has(record.id)
? t('恢复通知')
: t('屏蔽通知'),
title: alertExcludedIds.has(record.id)
? t('已屏蔽预警,点击恢复')
: t('屏蔽该企业的预警通知'),
onClick: () => toggleAlertExclude(record),
},
{
key: 'delete',
label: t('删除'),
danger: true,
onClick: () => handleDelete(record.id),
},
]}
>
<Button
type='link'
size='small'
onClick={() => openEditModal(record)}
>
{t('编辑')}
</Button>
</TableRowActions>
) : null,
}}
>
{t('调额')}
</Button>
<Button
type='link'
size='small'
onClick={() => openFeatureModal(record)}
>
{t('功能开关')}
</Button>
{record.status === 4 ? (
<Button
size='small'
type='link'
onClick={() => handleActivate(record.id)}
>
{t('激活')}
</Button>
) : record.status === 1 ? (
<Button
size='small'
type='link'
onClick={() => handleStatusChange(record.id, 2)}
>
{t('冻结')}
</Button>
) : (
<Button
size='small'
type='link'
onClick={() => handleStatusChange(record.id, 1)}
>
{t('解冻')}
</Button>
)}
<Button
type='link'
size='small'
danger
onClick={() => handleDelete(record.id)}
>
{t('删除')}
</Button>
{isRoot() && (
<Button
size='small'
type='link'
loading={alertToggleLoading === record.id}
title={
alertExcludedIds.has(record.id)
? t('已屏蔽预警,点击恢复')
: t('屏蔽该企业的预警通知')
}
aria-label={
alertExcludedIds.has(record.id)
? t('恢复该企业的预警')
: t('屏蔽该企业的预警')
}
onClick={() => toggleAlertExclude(record)}
>
{alertExcludedIds.has(record.id)
? t('恢复通知')
: t('屏蔽通知')}
</Button>
)}
</>
)}
</div>
),
},
];