fix(ui): 统一三中心表格交互并优化企业及配套页面
- 公共表格:统一分组标签、状态开关和危险操作确认,支持防重复提交和失败重试,修复浮层触发组件的 ref 转发。 - 控制台:统一用户和渠道编辑抽屉,修正分组回填与提交格式,对齐系统设置操作区和预约列表。 - 企业中心:调整技能中心页签和窄屏布局,优化质量监控提示栏、效能分析及成本对账,统一消耗明细和审计日志筛选。 - 用户中心及公共页面:优化密钥和消费记录展示,对齐模型超市筛选,统一公开与内嵌客户端下载页。 - 同步多语言文案、组件规范与移动端视口要求。
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import TableActionPopconfirm from '@/components/common/table/TableActionPopconfirm';
|
||||
import TableStatusSwitch from '@/components/common/table/TableStatusSwitch';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import {
|
||||
Button,
|
||||
@@ -6,11 +8,9 @@ import {
|
||||
Input,
|
||||
InputNumber,
|
||||
Modal,
|
||||
Popconfirm,
|
||||
Row,
|
||||
Space,
|
||||
Spin,
|
||||
Switch,
|
||||
Table,
|
||||
Tag,
|
||||
Typography,
|
||||
@@ -267,7 +267,7 @@ export default function SettingImagePricing({ options, refresh }) {
|
||||
|
||||
const remove = async (index) => {
|
||||
const next = configs.filter((_, configIndex) => configIndex !== index);
|
||||
await save(next);
|
||||
return save(next);
|
||||
};
|
||||
|
||||
const toggle = async (index, enabled) => {
|
||||
@@ -323,7 +323,7 @@ export default function SettingImagePricing({ options, refresh }) {
|
||||
dataIndex: 'enabled',
|
||||
key: 'enabled',
|
||||
render: (enabled, _record, index) => (
|
||||
<Switch
|
||||
<TableStatusSwitch
|
||||
checked={enabled !== false}
|
||||
onChange={(checked) => toggle(index, checked)}
|
||||
aria-label={t('启用图片分档计费')}
|
||||
@@ -344,14 +344,14 @@ export default function SettingImagePricing({ options, refresh }) {
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
<Popconfirm
|
||||
<TableActionPopconfirm
|
||||
title={t('确定删除此图片定价配置吗?')}
|
||||
onConfirm={() => remove(index)}
|
||||
>
|
||||
<Button aria-label={t('删除')} type='link' size='small' danger>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</TableActionPopconfirm>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import TableActionPopconfirm from '@/components/common/table/TableActionPopconfirm';
|
||||
import { useEffectEvent } from '../../../hooks/common/useEffectEvent';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import {
|
||||
@@ -178,12 +179,14 @@ const SettingModelCategory = () => {
|
||||
if (success) {
|
||||
showSuccess(t('删除成功'));
|
||||
await loadCategories();
|
||||
return true;
|
||||
} else {
|
||||
showError(message || t('删除失败'));
|
||||
}
|
||||
} catch (error) {
|
||||
showError(t('删除失败: {{message}}', { message: error.message }));
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
// 重置分类
|
||||
@@ -236,7 +239,7 @@ const SettingModelCategory = () => {
|
||||
>
|
||||
{t('修改')}
|
||||
</Button>
|
||||
<Popconfirm
|
||||
<TableActionPopconfirm
|
||||
title={t('确定要删除这个分类吗?')}
|
||||
content={t('删除前请确保已删除其下的所有二级分类')}
|
||||
onConfirm={() => handleDelete(record.id)}
|
||||
@@ -246,7 +249,7 @@ const SettingModelCategory = () => {
|
||||
<Button type='link' size='small' danger>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</TableActionPopconfirm>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
@@ -286,7 +289,7 @@ const SettingModelCategory = () => {
|
||||
>
|
||||
{t('修改')}
|
||||
</Button>
|
||||
<Popconfirm
|
||||
<TableActionPopconfirm
|
||||
title={t('确定要删除这个分类吗?')}
|
||||
content={t('此操作不可恢复')}
|
||||
onConfirm={() => handleDelete(record.id)}
|
||||
@@ -296,7 +299,7 @@ const SettingModelCategory = () => {
|
||||
<Button type='link' size='small' danger>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</TableActionPopconfirm>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import TableActionPopconfirm from '@/components/common/table/TableActionPopconfirm';
|
||||
import { I18N_TECHNICAL_TEXT } from '../../../i18n/technicalText.js';
|
||||
import React, { useEffect, useState, useRef } from 'react';
|
||||
import {
|
||||
@@ -9,7 +10,6 @@ import {
|
||||
Table,
|
||||
Modal,
|
||||
Tag,
|
||||
Popconfirm,
|
||||
Space,
|
||||
Input,
|
||||
InputNumber,
|
||||
@@ -361,14 +361,14 @@ export default function SettingVideoModel(props) {
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
<Popconfirm
|
||||
<TableActionPopconfirm
|
||||
title={t('确定要删除此定价配置吗?')}
|
||||
onConfirm={() => handleDeletePricing(index)}
|
||||
>
|
||||
<Button type='link' size='small' danger>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</TableActionPopconfirm>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
@@ -442,14 +442,14 @@ export default function SettingVideoModel(props) {
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
<Popconfirm
|
||||
<TableActionPopconfirm
|
||||
title={t('确定要删除此模型吗?')}
|
||||
onConfirm={() => handleDeleteModel(index)}
|
||||
>
|
||||
<Button type='link' size='small' danger>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</TableActionPopconfirm>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user