fix(ui): 统一三中心表格交互并优化企业及配套页面

- 公共表格:统一分组标签、状态开关和危险操作确认,支持防重复提交和失败重试,修复浮层触发组件的 ref 转发。
- 控制台:统一用户和渠道编辑抽屉,修正分组回填与提交格式,对齐系统设置操作区和预约列表。
- 企业中心:调整技能中心页签和窄屏布局,优化质量监控提示栏、效能分析及成本对账,统一消耗明细和审计日志筛选。
- 用户中心及公共页面:优化密钥和消费记录展示,对齐模型超市筛选,统一公开与内嵌客户端下载页。
- 同步多语言文案、组件规范与移动端视口要求。
This commit is contained in:
zhanjunhao
2026-11-24 13:26:07 +08:00
parent 9b9e98a6b4
commit 437a0345e8
124 changed files with 2682 additions and 1810 deletions
@@ -1,7 +1,9 @@
import { TABLE_GROUP_COLUMN_WIDTH } from '@/components/common/table/TableGroupTags';
import { confirmTableAction } from '@/components/common/table/confirmTableAction';
import { Copy as ActionCopy } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Button as AntButton, Tooltip as AntTooltip } from 'antd';
import { Button, Space, Tag, Modal, Tooltip } from '@/components/ui';
import { Button, Space, Tag, Tooltip } from '@/components/ui';
import {
timestamp2string,
getLobeHubIcon,
@@ -94,12 +96,17 @@ const renderCategories = (categories, t, categoryNames) => {
// Render groups (enable_groups)
const renderGroups = (groups) => {
if (!groups || groups.length === 0) return '-';
return renderLimitedItems({
items: groups,
renderItem: (g, idx) => (
<React.Fragment key={idx}>{renderGroup(g)}</React.Fragment>
),
});
return (
<span className='table-group-tags'>
{renderLimitedItems({
items: groups,
renderItem: (group, index) => (
<React.Fragment key={index}>{renderGroup(group)}</React.Fragment>
),
wrap: false,
})}
</span>
);
};
// Render tags
@@ -261,14 +268,15 @@ const renderOperations = (
danger
size='small'
onClick={() => {
Modal.confirm({
confirmTableAction({
title: t('确定是否要删除此模型?'),
content: t('此修改将不可逆'),
onOk: () => {
(async () => {
await manageModel(record.id, 'delete', record);
await refresh();
})();
okType: 'danger',
focusable: { autoFocusButton: 'cancel' },
onOk: async () => {
if (!(await manageModel(record.id, 'delete', record)))
return false;
await refresh();
},
});
}}
@@ -407,6 +415,7 @@ export const getModelsColumns = ({
{
title: t('可用分组'),
dataIndex: 'enable_groups',
width: TABLE_GROUP_COLUMN_WIDTH,
render: renderGroups,
},
{
@@ -1,3 +1,4 @@
import TableActionPopconfirm from '@/components/common/table/TableActionPopconfirm';
import '../../../console/module-alignment.css';
import React, { useState, useEffect, useCallback } from 'react';
import {
@@ -6,7 +7,6 @@ import {
Typography,
Space,
Tag,
Popconfirm,
Card,
Avatar,
Spin,
@@ -71,12 +71,14 @@ const PrefillGroupManagement = ({ visible, onClose }) => {
if (res.data.success) {
showSuccess(t('删除成功'));
loadGroups();
return true;
} else {
showError(res.data.message || t('删除失败'));
}
} catch (error) {
showError(t('删除失败'));
}
return false;
};
// 编辑组
@@ -184,14 +186,14 @@ const PrefillGroupManagement = ({ visible, onClose }) => {
<Button type='link' size='small' onClick={() => handleEdit(record)}>
{t('编辑')}
</Button>
<Popconfirm
<TableActionPopconfirm
title={t('确定删除此组?')}
onConfirm={() => deleteGroup(record.id)}
>
<Button size='small' type='link' danger>
{t('删除')}
</Button>
</Popconfirm>
</TableActionPopconfirm>
</Space>
),
},