fix(ui): 统一三中心表格交互并优化企业及配套页面
- 公共表格:统一分组标签、状态开关和危险操作确认,支持防重复提交和失败重试,修复浮层触发组件的 ref 转发。 - 控制台:统一用户和渠道编辑抽屉,修正分组回填与提交格式,对齐系统设置操作区和预约列表。 - 企业中心:调整技能中心页签和窄屏布局,优化质量监控提示栏、效能分析及成本对账,统一消耗明细和审计日志筛选。 - 用户中心及公共页面:优化密钥和消费记录展示,对齐模型超市筛选,统一公开与内嵌客户端下载页。 - 同步多语言文案、组件规范与移动端视口要求。
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { TABLE_GROUP_COLUMN_WIDTH } from '@/components/common/table/TableGroupTags';
|
||||
import { toGroupList } from '@/helpers/groupList';
|
||||
import { confirmTableAction } from '@/components/common/table/confirmTableAction';
|
||||
import TableStatusSwitch from '@/components/common/table/TableStatusSwitch';
|
||||
import { writeClipboardText } from '../../../helpers/clipboard';
|
||||
import React, { useState } from 'react';
|
||||
import { Switch } from 'antd';
|
||||
import {
|
||||
Button,
|
||||
InputNumber,
|
||||
@@ -34,11 +37,8 @@ const formatDisplayPercent = (value, digits = 0) => {
|
||||
function ChannelStatusSwitch({ record, manageChannel, t }) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
return (
|
||||
<Switch
|
||||
size='small'
|
||||
<TableStatusSwitch
|
||||
checked={record.status === 1}
|
||||
checkedChildren={t('启用')}
|
||||
unCheckedChildren={t('禁用')}
|
||||
disabled={!isRoot()}
|
||||
loading={loading}
|
||||
aria-label={t('状态')}
|
||||
@@ -405,20 +405,16 @@ export const getChannelsColumns = ({
|
||||
key: COLUMN_KEYS.GROUP,
|
||||
title: t('分组'),
|
||||
dataIndex: 'group',
|
||||
render: (text, record, index) => (
|
||||
<div>
|
||||
<Space spacing={2}>
|
||||
{text
|
||||
?.split(',')
|
||||
.sort((a, b) => {
|
||||
if (a === 'default') return -1;
|
||||
if (b === 'default') return 1;
|
||||
return a.localeCompare(b);
|
||||
})
|
||||
.map((item, index) => renderGroup(item))}
|
||||
</Space>
|
||||
</div>
|
||||
),
|
||||
width: TABLE_GROUP_COLUMN_WIDTH,
|
||||
render: (groups) =>
|
||||
renderGroup(
|
||||
toGroupList(groups).sort((left, right) => {
|
||||
if (left === right) return 0;
|
||||
if (left === 'default') return -1;
|
||||
if (right === 'default') return 1;
|
||||
return left.localeCompare(right);
|
||||
}),
|
||||
),
|
||||
},
|
||||
{
|
||||
key: COLUMN_KEYS.TYPE,
|
||||
@@ -723,19 +719,20 @@ export const getChannelsColumns = ({
|
||||
type: 'danger',
|
||||
onClick: async () => {
|
||||
const content = await buildDeleteConfirmContent(record.id, t);
|
||||
Modal.confirm({
|
||||
confirmTableAction({
|
||||
title: t('确定是否要删除此渠道?'),
|
||||
content,
|
||||
onOk: () => {
|
||||
(async () => {
|
||||
await manageChannel(record.id, 'delete', record);
|
||||
await refresh();
|
||||
setTimeout(() => {
|
||||
if (channels.length === 0 && activePage > 1) {
|
||||
refresh(activePage - 1);
|
||||
}
|
||||
}, 100);
|
||||
})();
|
||||
okType: 'danger',
|
||||
focusable: { autoFocusButton: 'cancel' },
|
||||
onOk: async () => {
|
||||
if (!(await manageChannel(record.id, 'delete', record)))
|
||||
return false;
|
||||
await refresh();
|
||||
setTimeout(() => {
|
||||
if (channels.length === 0 && activePage > 1) {
|
||||
refresh(activePage - 1);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user