feat: 1.升级 Ant Design Ui 至 v6 2. 修复企业充值金额输入限制

This commit is contained in:
zhanjunhao
2026-11-10 18:49:38 +08:00
parent 6ea8a0f7c2
commit 7364edd68c
106 changed files with 1417 additions and 1010 deletions
+12
View File
@@ -636,3 +636,15 @@ mock 与 live 共享完整目录的前端筛选及分页逻辑。live 沿用 `/a
- 已知视觉差异(遵循 Ant Design 默认,不自行设计替代效果):Ant Design 无 warning 按钮类型,`type='warning'`(创作台“升级 / 去充值”、版本说明“撤回”)分别按适配层显示为 primary / default;Badge 计数用 antd 默认色;`Text size='small'` 显示为默认字号;遮罩色由 Semi 深灰改为 antd 默认。 - 已知视觉差异(遵循 Ant Design 默认,不自行设计替代效果):Ant Design 无 warning 按钮类型,`type='warning'`(创作台“升级 / 去充值”、版本说明“撤回”)分别按适配层显示为 primary / default;Badge 计数用 antd 默认色;`Text size='small'` 显示为默认字号;遮罩色由 Semi 深灰改为 antd 默认。
- 风险:TagInput 的 `maxLength`(单个标签长度)在 antd tags 模式下不生效,前端输入不再截断,依赖后端 `max_len` 校验,未修改业务代码;本轮未做浏览器视觉回归,创作台弹层 / 抽屉 / 下拉与 WeyAi 设置页需人工过一遍浅深色与移动端。 - 风险:TagInput 的 `maxLength`(单个标签长度)在 antd tags 模式下不生效,前端输入不再截断,依赖后端 `max_len` 校验,未修改业务代码;本轮未做浏览器视觉回归,创作台弹层 / 抽屉 / 下拉与 WeyAi 设置页需人工过一遍浅深色与移动端。
- 验证:单元测试 388/388;变更文件 ESLint 0 错误;构建通过;变更 CSS Prettier 通过(`CreationDock.jsx` 在合并前已存在的格式差异未顺带修改)。 - 验证:单元测试 388/388;变更文件 ESLint 0 错误;构建通过;变更 CSS Prettier 通过(`CreationDock.jsx` 在合并前已存在的格式差异未顺带修改)。
## Ant Design v6 升级(2026-11-10)
- 基线:复核已提交的 `6ea8a0f`,先在最新 v5 `5.29.3` 清理原生组件废弃 API,再升级并精确锁定 `antd 6.7.0`、`@ant-design/icons 6.3.4`;React / React DOM 保持 `18.3.1`。图标与组件库的主版本均为 6,二者独立发布,不要求次版本号相同。
- API:原生调用迁移 Card 的 `bodyStyle/headStyle/bordered`、弹层的 popup class/style、Alert `message`、Drawer `width`、Modal/Drawer `maskClosable`、Tag `bordered`、Button `iconPosition`、Space/Divider 方向、Spin 提示及包裹类名、Select/TreeSelect 搜索配置、Image 预览开关等。共享适配层继续接受既有业务接口,在内部转换为 v6 API,保留值回调、Form API、分页和遮罩关闭策略;Notification、Timeline 同步改用新配置字段。
- DOM 冲突:通知弹窗、列设置、支付弹窗和新用户礼包的 `.ant-modal-content` 改为 `.ant-modal-container`;控制台 `.ant-alert-message` 改为 `.ant-alert-title`;企业密钥抽屉及视频输入区 `.ant-collapse-content-box` 改为 `.ant-collapse-body`。其他已核对的 Card/Table/Drawer 主体节点继续有效。
- 外观兼容:复用现有 `UiThemeProvider`,保留 v6 CSS variables,恢复 v5 Tag 默认边框及 8px 间距、浅深色原有黑色阴影和无额外模糊的默认遮罩。`antd-v5-compat.css` 恢复必填标记字体与分页 Select 的 3px 自动宽度差异;页面自身已有样式继续覆盖公共默认值。
- 测试适配:表单生命周期测试改用 v6 的 `@rc-component/form`,在测试结束后释放 Node MessagePort;弹窗测试仍断言既有关闭策略与回调,只将读取位置改为 `mask.closable`。新增适配层契约回归,覆盖值回调、远程搜索、语义样式和抽屉尺寸。
- 保留项:聊天 `Chat` 与会话侧栏仍使用 Ant `List`。v6.7.0 已将其标记为弃用,原生 CLI 扫描报告 `chat.jsx` 的 `List` / `List.Item` 两处;适配层还导出 `List` 供 `SessionSidebar` 使用。当前功能受支持;迁移到 `Listy` 会改变消息列表结构和布局,留待有专门视觉基线时处理,不屏蔽该警告。
- 验证边界:40 个组件/页面截图场景覆盖浅深色及桌面/移动端,包含模型超市、技能超市、个人密钥、消费记录、服务监控、充值和个人设置。模型超市使用既有同构 mock,其他页面使用测试账号及真实列表;动态数据、字体抗锯齿及表格约 1px 高度仍可能形成微小差分。RGB 阈值差分不等同于 pixelmatch、SSIM 或全站像素验收,未登录企业/管理员端进行完整视觉验收。
- 生产验证:按本轮用户追加要求,在系统临时目录构建并通过本地 Vite preview 验证产物,不覆盖 `dist/`。重任务串行并采样内存/CPU;截图、构建路径、CLI 输出、测试日志和详细报告仅存于 Git 忽略的 `report/antd-v6/`。企业充值金额校验的并行改动经用户确认保留,纳入最终测试与构建,不计入本轮 Ant Design API 迁移。
- 最终结果:668/668 单测通过,ESLint、Prettier、UI 依赖审计和 `git diff --check` 通过;生产构建成功,产物 28 个页面场景及关键交互通过,无页面异常、静态资源/API 加载失败或写请求。开发版升级前后 40 个场景的 RGB 差分:页面最大 0.425%、组件夹具最大 0.0105%;最终生产包对开发版最大 0.049%。已通过顶栏 UI 退出登录,并验证受保护路由重定向登录页。保留大 chunk 体积告警及上述 `List` 弃用项。
+734 -774
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -4,12 +4,12 @@
"private": true, "private": true,
"type": "module", "type": "module",
"dependencies": { "dependencies": {
"@ant-design/icons": "^5.6.1", "@ant-design/icons": "6.3.4",
"@dagrejs/dagre": "^1.1.4", "@dagrejs/dagre": "^1.1.4",
"@visactor/react-vchart": "~1.8.8", "@visactor/react-vchart": "~1.8.8",
"@visactor/vchart": "~1.8.8", "@visactor/vchart": "~1.8.8",
"@xyflow/react": "^12.6.0", "@xyflow/react": "^12.6.0",
"antd": "^5.23.0", "antd": "6.7.0",
"axios": "^1.19.0", "axios": "^1.19.0",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"colord": "^2.9.3", "colord": "^2.9.3",
@@ -37,7 +37,7 @@ const ChannelConsumption = ({ data, title, icon, t, embedded = false }) => {
</div> </div>
) )
} }
bodyStyle={{ padding: '16px' }} styles={{ body: { padding: '16px' } }}
> >
<div className='h-[300px] flex items-center justify-center text-gray-400'> <div className='h-[300px] flex items-center justify-center text-gray-400'>
{t('暂无数据')} {t('暂无数据')}
@@ -136,7 +136,7 @@ const ChannelConsumption = ({ data, title, icon, t, embedded = false }) => {
</div> </div>
) )
} }
bodyStyle={{ padding: '0' }} styles={{ body: { padding: '0' } }}
> >
<Table <Table
columns={columns} columns={columns}
+1 -1
View File
@@ -180,7 +180,7 @@ const DailyStatsTable = ({ data, title, icon, t, embedded = false }) => {
</div> </div>
) )
} }
bodyStyle={{ padding: '0' }} styles={{ body: { padding: '0' } }}
> >
{embedded && ( {embedded && (
<div className='flex justify-end p-4'> <div className='flex justify-end p-4'>
@@ -251,7 +251,7 @@ const HighFreqLowCostUsers = ({
</Space> </Space>
</div> </div>
} }
bodyStyle={{ padding: '16px' }} styles={{ body: { padding: '16px' } }}
> >
{/* 筛选区 */} {/* 筛选区 */}
<div className='mb-4 grid grid-cols-2 sm:grid-cols-4 gap-3 items-end'> <div className='mb-4 grid grid-cols-2 sm:grid-cols-4 gap-3 items-end'>
@@ -104,7 +104,7 @@ const ModelDistribution = ({ data, title, icon, t }) => {
<span className='font-semibold'>{title}</span> <span className='font-semibold'>{title}</span>
</div> </div>
} }
bodyStyle={{ padding: '16px' }} styles={{ body: { padding: '16px' } }}
> >
{pieSpec ? ( {pieSpec ? (
<div> <div>
+1 -1
View File
@@ -134,7 +134,7 @@ const OverviewCards = ({ overview, loading = false, t }) => {
<Card <Card
key={index} key={index}
className={`${card.bgColor} border-none shadow-sm hover:shadow-md transition-shadow`} className={`${card.bgColor} border-none shadow-sm hover:shadow-md transition-shadow`}
bodyStyle={{ padding: '16px' }} styles={{ body: { padding: '16px' } }}
> >
<div className='flex items-start justify-between'> <div className='flex items-start justify-between'>
<div className='flex-1'> <div className='flex-1'>
@@ -120,7 +120,7 @@ const TopupChannelChart = ({ data, title, icon, t }) => {
<span className='font-semibold'>{title}</span> <span className='font-semibold'>{title}</span>
</div> </div>
} }
bodyStyle={{ padding: '16px' }} styles={{ body: { padding: '16px' } }}
> >
{pieSpec ? ( {pieSpec ? (
<div> <div>
+1 -1
View File
@@ -237,7 +237,7 @@ const TrendCharts = ({ title, icon, data, type, t }) => {
<span className='font-semibold'>{title}</span> <span className='font-semibold'>{title}</span>
</div> </div>
} }
bodyStyle={{ padding: '16px' }} styles={{ body: { padding: '16px' } }}
> >
{spec ? ( {spec ? (
<VChart <VChart
+2 -2
View File
@@ -32,7 +32,7 @@ const UserRanking = ({ data, title, icon, t }) => {
<span className='font-semibold'>{title}</span> <span className='font-semibold'>{title}</span>
</div> </div>
} }
bodyStyle={{ padding: '16px' }} styles={{ body: { padding: '16px' } }}
> >
<div className='h-[300px] flex items-center justify-center text-gray-400'> <div className='h-[300px] flex items-center justify-center text-gray-400'>
{t('暂无数据')} {t('暂无数据')}
@@ -75,7 +75,7 @@ const UserRanking = ({ data, title, icon, t }) => {
</span> </span>
</div> </div>
} }
bodyStyle={{ padding: '16px' }} styles={{ body: { padding: '16px' } }}
> >
<div className='space-y-2 max-h-[450px] overflow-y-auto pr-1'> <div className='space-y-2 max-h-[450px] overflow-y-auto pr-1'>
{data.map((item, index) => ( {data.map((item, index) => (
+1 -1
View File
@@ -300,7 +300,7 @@ const UserSurveyStats = ({ title, icon, t }) => {
<div className={collapsed ? 'hidden' : ''}> <div className={collapsed ? 'hidden' : ''}>
<Card <Card
className='analytics-fold-content shadow-sm' className='analytics-fold-content shadow-sm'
bodyStyle={{ padding: '16px' }} styles={{ body: { padding: '16px' } }}
> >
{!collapsed && ( {!collapsed && (
<Spin spinning={loading}> <Spin spinning={loading}>
@@ -33,7 +33,7 @@ const UserTopupRanking = ({ data, title, icon, t, embedded = false }) => {
</div> </div>
) )
} }
bodyStyle={{ padding: '16px' }} styles={{ body: { padding: '16px' } }}
> >
<div className='h-[300px] flex items-center justify-center text-gray-400'> <div className='h-[300px] flex items-center justify-center text-gray-400'>
{t('暂无数据')} {t('暂无数据')}
@@ -137,7 +137,7 @@ const UserTopupRanking = ({ data, title, icon, t, embedded = false }) => {
</div> </div>
) )
} }
bodyStyle={{ padding: '0' }} styles={{ body: { padding: '0' } }}
> >
<Table <Table
// 列宽合计远超窄屏视口;没有 scroll 时表格会压缩到 min-content 硬塞进去, // 列宽合计远超窄屏视口;没有 scroll 时表格会压缩到 min-content 硬塞进去,
@@ -40,7 +40,7 @@ export const ReportHeader = ({ report, onExport, t }) => {
return ( return (
<div className='flex flex-col gap-4'> <div className='flex flex-col gap-4'>
<Card className='shadow-sm' bodyStyle={{ padding: '16px 20px' }}> <Card className='shadow-sm' styles={{ body: { padding: '16px 20px' } }}>
<div className='flex flex-col md:flex-row md:items-center md:justify-between gap-3'> <div className='flex flex-col md:flex-row md:items-center md:justify-between gap-3'>
<div className='min-w-0'> <div className='min-w-0'>
<div className='text-xs font-semibold tracking-wider text-brand mb-1'> <div className='text-xs font-semibold tracking-wider text-brand mb-1'>
@@ -40,7 +40,7 @@ export const SectionCard = ({
{extra} {extra}
</div> </div>
} }
bodyStyle={{ padding: '16px', ...bodyStyle }} styles={{ body: { padding: '16px', ...bodyStyle } }}
> >
{children} {children}
</Card> </Card>
@@ -106,11 +106,11 @@ export const KpiCard = ({
}) => ( }) => (
<Card <Card
className={`shadow-sm border-none transition-shadow ${onClick ? 'cursor-pointer hover:shadow-md' : ''}`} className={`shadow-sm border-none transition-shadow ${onClick ? 'cursor-pointer hover:shadow-md' : ''}`}
bodyStyle={{ padding: '14px 16px' }}
onClick={onClick} onClick={onClick}
style={{ style={{
borderLeft: `3px solid ${accent || 'var(--ui-color-primary)'}`, borderLeft: `3px solid ${accent || 'var(--ui-color-primary)'}`,
}} }}
styles={{ body: { padding: '14px 16px' } }}
> >
<div className='flex items-center gap-1 text-xs text-gray-500 dark:text-gray-400 mb-1'> <div className='flex items-center gap-1 text-xs text-gray-500 dark:text-gray-400 mb-1'>
<span className='truncate'>{title}</span> <span className='truncate'>{title}</span>
@@ -164,7 +164,7 @@ const NewUserGiftModal = ({ visible, onClose, quota }) => {
</div> </div>
<style jsx='true'>{` <style jsx='true'>{`
.new-user-gift-modal .ant-modal-content { .new-user-gift-modal .ant-modal-container {
border-radius: 20px; border-radius: 20px;
overflow: hidden; overflow: hidden;
padding: 0; padding: 0;
@@ -108,7 +108,6 @@ export function ColumnSettingsModal({
'--cs-theme-border': token.colorBorderSecondary, '--cs-theme-border': token.colorBorderSecondary,
}} }}
onCancel={onCancel} onCancel={onCancel}
maskClosable
keyboard keyboard
footer={ footer={
<div className='table-column-settings-footer'> <div className='table-column-settings-footer'>
@@ -123,6 +122,7 @@ export function ColumnSettingsModal({
</Button> </Button>
</div> </div>
} }
mask={{ closable: true }}
> >
<div className='table-column-settings-all'> <div className='table-column-settings-all'>
<Checkbox <Checkbox
@@ -155,7 +155,7 @@ export function ColumnSettingsModal({
className='table-column-settings-error' className='table-column-settings-error'
type='error' type='error'
showIcon showIcon
message={t('请至少保留一列')} title={t('请至少保留一列')}
/> />
)} )}
</Modal> </Modal>
@@ -21,7 +21,7 @@ html.dark .table-column-settings-dialog {
max-width: calc(100vw - 32px); max-width: calc(100vw - 32px);
} }
.table-column-settings-dialog .ant-modal-content { .table-column-settings-dialog .ant-modal-container {
padding: 20px 24px; padding: 20px 24px;
border-radius: 12px; border-radius: 12px;
} }
+1 -1
View File
@@ -187,7 +187,7 @@ const CardPro = ({
title={headerContent} title={headerContent}
footer={footerContent} footer={footerContent}
shadows={shadows} shadows={shadows}
bordered={bordered} variant={bordered === false ? 'borderless' : 'outlined'}
style={style} style={style}
{...props} {...props}
> >
+1 -2
View File
@@ -656,7 +656,6 @@ const JSONEditor = ({
<TabPane tab={t('可视化')} itemKey='visual' /> <TabPane tab={t('可视化')} itemKey='visual' />
<TabPane tab={t('手动编辑')} itemKey='manual' /> <TabPane tab={t('手动编辑')} itemKey='manual' />
</Tabs> </Tabs>
{template && templateLabel && ( {template && templateLabel && (
<Button type='tertiary' onClick={fillTemplate} size='small'> <Button type='tertiary' onClick={fillTemplate} size='small'>
{templateLabel} {templateLabel}
@@ -667,8 +666,8 @@ const JSONEditor = ({
headerStyle={{ headerStyle={{
padding: 'var(--json-editor-header-padding, 12px 16px)', padding: 'var(--json-editor-header-padding, 12px 16px)',
}} }}
bodyStyle={{ padding: '16px' }}
className='!rounded-2xl' className='!rounded-2xl'
styles={{ body: { padding: '16px' } }}
> >
{/* JSON错误提示 */} {/* JSON错误提示 */}
{hasJsonError && ( {hasJsonError && (
+2 -1
View File
@@ -224,6 +224,7 @@ export function ConsoleDrawer({
rootStyle, rootStyle,
footer, footer,
width = 560, width = 560,
size = width,
...props ...props
}) { }) {
const themeStyle = useConsoleThemeStyle(); const themeStyle = useConsoleThemeStyle();
@@ -231,7 +232,7 @@ export function ConsoleDrawer({
return ( return (
<Drawer <Drawer
{...props} {...props}
width={width} size={size}
rootStyle={{ ...themeStyle, ...rootStyle }} rootStyle={{ ...themeStyle, ...rootStyle }}
footer={normalizeFooter(footer)} footer={normalizeFooter(footer)}
rootClassName={classes( rootClassName={classes(
+3 -5
View File
@@ -281,19 +281,17 @@
min-width: 0; min-width: 0;
overflow-wrap: anywhere; overflow-wrap: anywhere;
} }
:is(.console-page, .console-overlay) .ant-alert-message, :is(.console-page, .console-overlay) .ant-alert-title,
:is(.console-page, .console-overlay) .ant-alert-description { :is(.console-page, .console-overlay) .ant-alert-description {
color: var(--console-text); color: var(--console-text);
font-size: 14px; font-size: 14px;
line-height: 22px; line-height: 22px;
} }
:is(.console-page, .console-overlay) .ant-alert-message { :is(.console-page, .console-overlay) .ant-alert-title {
margin-bottom: 0; margin-bottom: 0;
font-weight: 500; font-weight: 500;
} }
:is(.console-page, .console-overlay) :is(.console-page, .console-overlay) .ant-alert-title + .ant-alert-description {
.ant-alert-message
+ .ant-alert-description {
margin-top: 4px; margin-top: 4px;
} }
:is(.console-page, .console-overlay) .ant-alert-icon { :is(.console-page, .console-overlay) .ant-alert-icon {
@@ -74,7 +74,7 @@ const AnnouncementsPanel = ({
</div> </div>
</div> </div>
} }
bodyStyle={{ padding: 0 }} styles={{ body: { padding: 0 } }}
> >
<ScrollableContainer maxHeight='24rem'> <ScrollableContainer maxHeight='24rem'>
{announcementData.length > 0 ? ( {announcementData.length > 0 ? (
+1 -1
View File
@@ -45,7 +45,7 @@ const ApiInfoPanel = ({
{t('API信息')} {t('API信息')}
</div> </div>
} }
bodyStyle={{ padding: 0 }} styles={{ body: { padding: 0 } }}
> >
<ScrollableContainer maxHeight='24rem'> <ScrollableContainer maxHeight='24rem'>
{apiInfoData.length > 0 ? ( {apiInfoData.length > 0 ? (
+1 -1
View File
@@ -45,7 +45,7 @@ const FaqPanel = ({
{t('常见问答')} {t('常见问答')}
</div> </div>
} }
bodyStyle={{ padding: 0 }} styles={{ body: { padding: 0 } }}
> >
<ScrollableContainer maxHeight='24rem'> <ScrollableContainer maxHeight='24rem'>
{faqData.length > 0 ? ( {faqData.length > 0 ? (
+1 -1
View File
@@ -60,7 +60,7 @@ const UptimePanel = ({
/> />
</div> </div>
} }
bodyStyle={{ padding: 0 }} styles={{ body: { padding: 0 } }}
> >
{/* 内容区域 */} {/* 内容区域 */}
<div className='relative'> <div className='relative'>
@@ -44,7 +44,7 @@ const UserDashboardFilterModal = ({
onOk={handleSearchConfirm} onOk={handleSearchConfirm}
okText={t('查询')} okText={t('查询')}
cancelText={t('取消')} cancelText={t('取消')}
maskClosable mask={{ closable: true }}
> >
<Form layout='vertical' requiredMark={false}> <Form layout='vertical' requiredMark={false}>
<Form.Item label={t('时间范围')} htmlFor='dashboard-filter-range'> <Form.Item label={t('时间范围')} htmlFor='dashboard-filter-range'>
+2 -2
View File
@@ -135,7 +135,7 @@ const NoticeModal = ({
if (loading) { if (loading) {
return ( return (
<div className='nm-empty'> <div className='nm-empty'>
<Spin tip={t('加载中...')}> <Spin description={t('加载中...')}>
<div className='nm-spin-placeholder' /> <div className='nm-spin-placeholder' />
</Spin> </Spin>
</div> </div>
@@ -213,7 +213,6 @@ const NoticeModal = ({
'--nm-tab-bg': token.colorBgLayout, '--nm-tab-bg': token.colorBgLayout,
'--nm-primary': token.colorPrimary, '--nm-primary': token.colorPrimary,
}} }}
maskClosable={true}
footer={ footer={
<div className='nm-footer'> <div className='nm-footer'>
<Checkbox <Checkbox
@@ -230,6 +229,7 @@ const NoticeModal = ({
</Button> </Button>
</div> </div>
} }
mask={{ closable: true }}
> >
<Segmented <Segmented
block block
@@ -203,7 +203,7 @@ const ActionButtons = ({
{/* Divider:原型仅在主操作与工具按钮之间保留一条竖线 */} {/* Divider:原型仅在主操作与工具按钮之间保留一条竖线 */}
{hasPrimaryActions && hasUtilityActions && ( {hasPrimaryActions && hasUtilityActions && (
<Divider type='vertical' className='ui-header-actions-divider' /> <Divider orientation='vertical' className='ui-header-actions-divider' />
)} )}
{isActionVisible('newYear') && ( {isActionVisible('newYear') && (
+1 -1
View File
@@ -147,7 +147,6 @@ const UserArea = ({
placement='bottomRight' placement='bottomRight'
open={open} open={open}
onOpenChange={setOpen} onOpenChange={setOpen}
overlayClassName='ui-account-dropdown'
menu={{ items, onClick: () => setOpen(false) }} menu={{ items, onClick: () => setOpen(false) }}
popupRender={(menu) => ( popupRender={(menu) => (
<div className='ui-account-panel'> <div className='ui-account-panel'>
@@ -168,6 +167,7 @@ const UserArea = ({
{menu} {menu}
</div> </div>
)} )}
classNames={{ root: 'ui-account-dropdown' }}
> >
<AntButton <AntButton
type='text' type='text'
+2 -2
View File
@@ -7,7 +7,7 @@
padding-bottom: 24px; padding-bottom: 24px;
color: var(--nm-text); color: var(--nm-text);
} }
.notice-modal .ant-modal-content { .notice-modal .ant-modal-container {
padding: 20px 24px; padding: 20px 24px;
background: var(--nm-surface); background: var(--nm-surface);
border-radius: 12px; border-radius: 12px;
@@ -175,7 +175,7 @@
.notice-modal.ant-modal { .notice-modal.ant-modal {
top: 24px; top: 24px;
} }
.notice-modal .ant-modal-content { .notice-modal .ant-modal-container {
padding: 20px 16px; padding: 20px 16px;
} }
.nm-notice-scroll, .nm-notice-scroll,
@@ -149,7 +149,7 @@ export const MembershipHistoryContent = ({ visible, t, inline = false }) => {
const status = getMembershipStatus(membership); const status = getMembershipStatus(membership);
const config = STATUS_CONFIG[status] || STATUS_CONFIG.expired; const config = STATUS_CONFIG[status] || STATUS_CONFIG.expired;
return ( return (
<AntTag bordered={false} color={config.color}> <AntTag variant='filled' color={config.color}>
{t(config.label)} {t(config.label)}
</AntTag> </AntTag>
); );
+4 -2
View File
@@ -396,14 +396,15 @@ const ChatArea = ({
<Card <Card
className={`h-full min-h-0 ${styleState.isExperienceMode ? 'border-none shadow-none bg-transparent' : ''}`} className={`h-full min-h-0 ${styleState.isExperienceMode ? 'border-none shadow-none bg-transparent' : ''}`}
bordered={false} variant='borderless'
style={{ style={{
background: styleState.isExperienceMode ? 'transparent' : undefined, background: styleState.isExperienceMode ? 'transparent' : undefined,
backgroundColor: styleState.isExperienceMode backgroundColor: styleState.isExperienceMode
? 'transparent' ? 'transparent'
: undefined, : undefined,
}} }}
bodyStyle={{ styles={{
body: {
padding: 0, padding: 0,
height: '100%', height: '100%',
display: 'flex', display: 'flex',
@@ -414,6 +415,7 @@ const ChatArea = ({
backgroundColor: styleState.isExperienceMode backgroundColor: styleState.isExperienceMode
? 'transparent' ? 'transparent'
: undefined, : undefined,
},
}} }}
> >
{/* 聊天头部 */} {/* 聊天头部 */}
+4 -2
View File
@@ -100,12 +100,14 @@ const DebugPanel = ({
return ( return (
<Card <Card
className='h-full flex flex-col' className='h-full flex flex-col'
bordered={false} variant='borderless'
bodyStyle={{ styles={{
body: {
padding: styleState.isMobile ? '16px' : '24px', padding: styleState.isMobile ? '16px' : '24px',
height: '100%', height: '100%',
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
},
}} }}
> >
<div className='flex items-center justify-between mb-6 flex-shrink-0'> <div className='flex items-center justify-between mb-6 flex-shrink-0'>
+1 -1
View File
@@ -617,7 +617,7 @@ const PersonalSetting = () => {
<div className='ui-profile-meta'> <div className='ui-profile-meta'>
<div className='ui-profile-name'> <div className='ui-profile-name'>
<strong>{getDisplayName()}</strong> <strong>{getDisplayName()}</strong>
<AntTag color='gold' bordered={false}> <AntTag color='gold' variant='filled'>
{roleInfo.text} {roleInfo.text}
</AntTag> </AntTag>
</div> </div>
@@ -837,8 +837,8 @@ const NotificationSettings = ({
? '' ? ''
: 'opacity-50' : 'opacity-50'
}`} }`}
bodyStyle={{ padding: '16px' }}
hoverable hoverable
styles={{ body: { padding: '16px' } }}
> >
<div className='flex justify-between items-center h-full'> <div className='flex justify-between items-center h-full'>
<div className='flex-1 text-left'> <div className='flex-1 text-left'>
@@ -129,7 +129,7 @@ const UserInfoHeader = ({ t, userState }) => {
<Card <Card
size='small' size='small'
className='!rounded-xl' className='!rounded-xl'
bodyStyle={{ padding: '12px 16px' }} styles={{ body: { padding: '12px 16px' } }}
> >
<div className='flex items-center gap-4'> <div className='flex items-center gap-4'>
<div className='flex items-center gap-2'> <div className='flex items-center gap-2'>
@@ -171,7 +171,7 @@ const UserInfoHeader = ({ t, userState }) => {
<Card <Card
size='small' size='small'
className='!rounded-xl' className='!rounded-xl'
bodyStyle={{ padding: '12px 16px' }} styles={{ body: { padding: '12px 16px' } }}
> >
<div className='space-y-3'> <div className='space-y-3'>
<div className='flex items-center justify-between'> <div className='flex items-center justify-between'>
@@ -173,7 +173,7 @@ const AccountBindingSection = ({
) : null} ) : null}
</div> </div>
<div className='ui-settings-row-actions'> <div className='ui-settings-row-actions'>
<AntTag bordered={false} color={bound ? 'success' : undefined}> <AntTag variant='filled' color={bound ? 'success' : undefined}>
{bound ? t('已绑定') : t('未绑定')} {bound ? t('已绑定') : t('未绑定')}
</AntTag> </AntTag>
<Button <Button
@@ -52,7 +52,7 @@ const renderStatus = (status, record, t, showEnableDisableModal) => {
} }
/> />
{meta && ( {meta && (
<AntTag color={meta.color} bordered={false}> <AntTag color={meta.color} variant='filled'>
{t(meta.label)} {t(meta.label)}
</AntTag> </AntTag>
)} )}
@@ -88,7 +88,7 @@ const renderKey = (text) => {
const renderQuotaCell = (text, record, t) => { const renderQuotaCell = (text, record, t) => {
if (record.unlimited_quota) { if (record.unlimited_quota) {
return ( return (
<AntTag color='success' bordered={false}> <AntTag color='success' variant='filled'>
{t('无限制')} {t('无限制')}
</AntTag> </AntTag>
); );
@@ -211,11 +211,11 @@ const ModelTestModal = ({
</div> </div>
) : null ) : null
} }
maskClosable={!isBatchTesting}
rootClassName='console-overlay model-test-modal' rootClassName='console-overlay model-test-modal'
width={isMobile ? 'calc(100vw - 32px)' : 514.8} width={isMobile ? 'calc(100vw - 32px)' : 514.8}
centered centered
styles={{ body: { maxHeight: 'none', overflow: 'visible' } }} styles={{ body: { maxHeight: 'none', overflow: 'visible' } }}
mask={{ closable: !isBatchTesting }}
> >
{hasChannel && ( {hasChannel && (
<div className='model-test-content'> <div className='model-test-content'>
@@ -239,7 +239,7 @@ const MarketCatalog = ({
className='mm-scope-alert' className='mm-scope-alert'
type='warning' type='warning'
showIcon showIcon
message={t( title={t(
'以下价格已按所属企业的等级折扣展示;企业成员使用个人密钥或体验中心调用时同样按企业等级计费。', '以下价格已按所属企业的等级折扣展示;企业成员使用个人密钥或体验中心调用时同样按企业等级计费。',
)} )}
/> />
@@ -138,7 +138,7 @@ const MarketModelCard = ({
<h3 title={model.model_name}>{model.model_name}</h3> <h3 title={model.model_name}>{model.model_name}</h3>
{model.level_locked && ( {model.level_locked && (
<Tooltip title={t('当前等级无权调用此模型,升级等级后可用')}> <Tooltip title={t('当前等级无权调用此模型,升级等级后可用')}>
<Tag icon={<Lock size={11} />} bordered={false}> <Tag icon={<Lock size={11} />} variant='filled'>
{t('仅可见')} {t('仅可见')}
</Tag> </Tag>
</Tooltip> </Tooltip>
@@ -193,7 +193,7 @@ const MarketModelCard = ({
'相比官方牌价的折扣,按当前计价分组实付价计算(已含您的等级折扣),仅供参考', '相比官方牌价的折扣,按当前计价分组实付价计算(已含您的等级折扣),仅供参考',
)} )}
> >
<Tag bordered={false}>{discountText}</Tag> <Tag variant='filled'>{discountText}</Tag>
</Tooltip> </Tooltip>
) : ( ) : (
<span>{getBillingLabel(priceData, t)}</span> <span>{getBillingLabel(priceData, t)}</span>
@@ -187,9 +187,9 @@ const ModelMarketPage = () => {
className='hidden' className='hidden'
src={modalImageUrl} src={modalImageUrl}
preview={{ preview={{
visible: isModalOpenurl, open: isModalOpenurl,
src: modalImageUrl, src: modalImageUrl,
onVisibleChange: (visible) => setIsModalOpenurl(visible), onOpenChange: (visible) => setIsModalOpenurl(visible),
}} }}
/> />
)} )}
@@ -56,8 +56,7 @@ const ModelDetailSideSheet = ({
title={t('模型详情')} title={t('模型详情')}
open={visible} open={visible}
onClose={onClose} onClose={onClose}
maskClosable size={isMobile ? '100%' : 820}
width={isMobile ? '100%' : 820}
rootClassName='mm-detail-drawer mm-theme' rootClassName='mm-detail-drawer mm-theme'
rootStyle={themeStyle} rootStyle={themeStyle}
footer={ footer={
@@ -67,6 +66,7 @@ const ModelDetailSideSheet = ({
</Button> </Button>
</div> </div>
} }
mask={{ closable: true }}
> >
{!modelData ? ( {!modelData ? (
<div className='mm-detail-loading'> <div className='mm-detail-loading'>
@@ -52,7 +52,7 @@ const ModelEndpoints = ({ modelData, endpointMap = {}, t }) => {
<strong>{type}</strong> <strong>{type}</strong>
{path && <code>{path}</code>} {path && <code>{path}</code>}
</div> </div>
{path && <Tag bordered={false}>{method}</Tag>} {path && <Tag variant='filled'>{method}</Tag>}
</div> </div>
); );
})} })}
@@ -137,7 +137,7 @@ const ModelPricingTable = ({
'相比官方牌价的折扣,按当前计价分组实付价计算(已含您的等级折扣),仅供参考', '相比官方牌价的折扣,按当前计价分组实付价计算(已含您的等级折扣),仅供参考',
)} )}
> >
<Tag bordered={false}>{row.discountText}</Tag> <Tag variant='filled'>{row.discountText}</Tag>
</Tooltip> </Tooltip>
)} )}
</span> </span>
@@ -236,7 +236,7 @@ const ModelPricingTable = ({
<span>{t('auto分组调用链路')}</span> <span>{t('auto分组调用链路')}</span>
{autoChain.map((g, idx) => ( {autoChain.map((g, idx) => (
<React.Fragment key={g}> <React.Fragment key={g}>
<Tag bordered={false}>{g}</Tag> <Tag variant='filled'>{g}</Tag>
{idx < autoChain.length - 1 && <ChevronRight size={12} />} {idx < autoChain.length - 1 && <ChevronRight size={12} />}
</React.Fragment> </React.Fragment>
))} ))}
@@ -272,7 +272,7 @@ const RECORD_STATUS_COLORS = {
const recordTagFrom = (node, color) => const recordTagFrom = (node, color) =>
node?.props?.label !== undefined ? ( node?.props?.label !== undefined ? (
<AntTag bordered={false} color={color}> <AntTag variant='filled' color={color}>
{node.props.label} {node.props.label}
</AntTag> </AntTag>
) : ( ) : (
@@ -324,7 +324,7 @@ const applyTaskRecordPresentation = (columns, { COLUMN_KEYS }) =>
className='usage-record-copy-text' className='usage-record-copy-text'
onClick={node.props.children.props.onClick} onClick={node.props.children.props.onClick}
> >
<AntTag bordered={false}>{text}</AntTag> <AntTag variant='filled'>{text}</AntTag>
</span> </span>
</Tooltip> </Tooltip>
); );
+1 -1
View File
@@ -94,7 +94,7 @@ const TaskLogsPage = ({
{/* 只有真实存在进行中任务时才显示,避免误导 */} {/* 只有真实存在进行中任务时才显示,避免误导 */}
{pageStats.pendingCount > 0 && ( {pageStats.pendingCount > 0 && (
<AntTag <AntTag
bordered={false} variant='filled'
color='processing' color='processing'
icon={<Clock size={12} />} icon={<Clock size={12} />}
> >
@@ -96,8 +96,7 @@ const EditTokenDrawer = ({
open={open} open={open}
onClose={onCancel} onClose={onCancel}
title={isEdit ? t('编辑密钥') : t('创建密钥')} title={isEdit ? t('编辑密钥') : t('创建密钥')}
width={isMobile ? '100%' : 560} size={isMobile ? '100%' : 560}
maskClosable
forceRender forceRender
rootClassName='km-edit-drawer' rootClassName='km-edit-drawer'
footer={ footer={
@@ -112,6 +111,7 @@ const EditTokenDrawer = ({
</Button> </Button>
</div> </div>
} }
mask={{ closable: true }}
> >
<Spin spinning={loading}> <Spin spinning={loading}>
<Form <Form
@@ -305,7 +305,7 @@ function renderRecordTime(text) {
function renderRecordType(type, t) { function renderRecordType(type, t) {
const config = TYPE_CONFIG[type] || TYPE_CONFIG.default; const config = TYPE_CONFIG[type] || TYPE_CONFIG.default;
return ( return (
<AntTag bordered={false} color={RECORD_TYPE_COLORS[type]}> <AntTag variant='filled' color={RECORD_TYPE_COLORS[type]}>
{t(config.label)} {t(config.label)}
</AntTag> </AntTag>
); );
@@ -324,7 +324,7 @@ function renderRecordUseTime(record, t) {
{useTime} {useTime}
{firstTime && <em>{firstTime}</em>} {firstTime && <em>{firstTime}</em>}
</span> </span>
<AntTag bordered={false} color={record.is_stream ? 'cyan' : undefined}> <AntTag variant='filled' color={record.is_stream ? 'cyan' : undefined}>
{record.is_stream ? t('流') : t('非流')} {record.is_stream ? t('流') : t('非流')}
</AntTag> </AntTag>
</span> </span>
@@ -409,7 +409,7 @@ const applyUsageRecordPresentation = (
const group = const group =
record.group || getLogOther(record.other)?.group || ''; record.group || getLogOther(record.other)?.group || '';
return group && node?.props?.children ? ( return group && node?.props?.children ? (
<AntTag bordered={false}>{group}</AntTag> <AntTag variant='filled'>{group}</AntTag>
) : null; ) : null;
}, },
}; };
@@ -129,7 +129,7 @@ const PaymentConfirmModal = ({
{renderAmount()} {renderAmount()}
</strong> </strong>
{hasDiscount && ( {hasDiscount && (
<AntTag bordered={false} color='success'> <AntTag variant='filled' color='success'>
{Math.round((1 - discountRate) * 100)}% OFF {Math.round((1 - discountRate) * 100)}% OFF
</AntTag> </AntTag>
)} )}
@@ -35,7 +35,7 @@
font-weight: 400; font-weight: 400;
} }
.payment-confirm-modal .ant-modal-content { .payment-confirm-modal .ant-modal-container {
border-radius: 12px; border-radius: 12px;
padding: 20px 24px; padding: 20px 24px;
} }
+22 -2
View File
@@ -39,6 +39,7 @@ import { useLocation } from 'react-router-dom';
import { useActualTheme } from '../../context/Theme'; import { useActualTheme } from '../../context/Theme';
import { normalizeLanguage } from '../../i18n/language'; import { normalizeLanguage } from '../../i18n/language';
import { colord } from 'colord'; import { colord } from 'colord';
import './antd-v5-compat.css';
// 与下方 Ant Design locale 一一对应的 dayjs 语言(未覆盖语言与 Ant Design 一样回退中文)。 // 与下方 Ant Design locale 一一对应的 dayjs 语言(未覆盖语言与 Ant Design 一样回退中文)。
const DAYJS_LOCALES = { const DAYJS_LOCALES = {
@@ -57,6 +58,17 @@ const DAYJS_LOCALES = {
const PROTOTYPE_DARK_PRIMARY = '#d1963a'; const PROTOTYPE_DARK_PRIMARY = '#d1963a';
const PROTOTYPE_DARK_SEED = '#f2ad41'; const PROTOTYPE_DARK_SEED = '#f2ad41';
// v5 used these shadows in both themes; v6 derives white shadows in dark mode.
const v5ShadowTokens = {
...Object.fromEntries(
Object.entries(theme.getDesignToken()).filter(([name]) =>
name.startsWith('boxShadow'),
),
),
boxShadowTertiary:
'0 1px 2px 0 rgba(0,0,0,0.03), 0 1px 6px -1px rgba(0,0,0,0.02), 0 2px 4px 0 rgba(0,0,0,0.02)',
};
// 页面局部“品牌强调色”(原型 --brand):等于当前主题的种子色。 // 页面局部“品牌强调色”(原型 --brand):等于当前主题的种子色。
// 浅色与自定义主色时即 colorPrimary;仅默认暗色主色 #d1963a 时回到原型种子 #f2ad41, // 浅色与自定义主色时即 colorPrimary;仅默认暗色主色 #d1963a 时回到原型种子 #f2ad41,
// 保证浅色 / 深色 / 自定义主题色三态都只由主题 token 推导,不在页面里另写颜色。 // 保证浅色 / 深色 / 自定义主题色三态都只由主题 token 推导,不在页面里另写颜色。
@@ -82,6 +94,7 @@ export const prototypeTheme = (dark) => ({
}; };
}, },
token: { token: {
...v5ShadowTokens,
colorPrimary: dark ? PROTOTYPE_DARK_PRIMARY : '#b96508', colorPrimary: dark ? PROTOTYPE_DARK_PRIMARY : '#b96508',
colorInfo: dark ? PROTOTYPE_DARK_PRIMARY : '#b96508', colorInfo: dark ? PROTOTYPE_DARK_PRIMARY : '#b96508',
colorBgLayout: dark ? '#11151c' : '#f4f6f9', colorBgLayout: dark ? '#11151c' : '#f4f6f9',
@@ -108,6 +121,13 @@ export const prototypeTheme = (dark) => ({
}, },
}); });
// Keep v5 tag borders and overlay masks while inheriting the existing theme.
const v5ComponentDefaults = {
tag: { variant: 'outlined' },
modal: { mask: { blur: false } },
drawer: { mask: { blur: false } },
};
function TokenBridge() { function TokenBridge() {
const { token } = theme.useToken(); const { token } = theme.useToken();
useLayoutEffect(() => { useLayoutEffect(() => {
@@ -249,14 +269,14 @@ export default function UiThemeProvider({ children }) {
useEffect(() => { useEffect(() => {
ConfigProvider.config({ ConfigProvider.config({
holderRender: (nodes) => ( holderRender: (nodes) => (
<ConfigProvider theme={config} locale={locale}> <ConfigProvider {...v5ComponentDefaults} theme={config} locale={locale}>
{nodes} {nodes}
</ConfigProvider> </ConfigProvider>
), ),
}); });
}, [config, locale]); }, [config, locale]);
return ( return (
<ConfigProvider theme={config} locale={locale}> <ConfigProvider {...v5ComponentDefaults} theme={config} locale={locale}>
<App> <App>
<TokenBridge /> <TokenBridge />
{children} {children}
+18
View File
@@ -0,0 +1,18 @@
/* Keep v5 spacing at component specificity so page overrides still take priority. */
:where(body[data-ui-scope='admin']) .ant-tag {
margin-inline-end: 8px;
}
/* The v6 suffix layout makes automatic pagination selects 3px narrower. */
:where(body[data-ui-scope='admin'])
.ant-pagination-options-size-changer
.ant-select-suffix {
margin-inline-start: 3px;
}
/* v6 changed the required-mark font; retain v5 label metrics and form spacing. */
body[data-ui-scope='admin']
.ant-form-item-label
> label.ant-form-item-required::before {
font-family: SimSun, sans-serif;
}
+56 -16
View File
@@ -129,7 +129,7 @@ export const Button = forwardRef(function Button(
danger={danger} danger={danger}
size={useConsoleControlSize(size)} size={useConsoleControlSize(size)}
shape={circle ? 'circle' : undefined} shape={circle ? 'circle' : undefined}
iconPosition={iconPosition === 'right' ? 'end' : 'start'} iconPlacement={iconPosition === 'right' ? 'end' : 'start'}
/> />
); );
}); });
@@ -193,6 +193,10 @@ export function Select({
prefix, prefix,
dropdownStyle, dropdownStyle,
dropdownClassName, dropdownClassName,
autoClearSearchValue,
onSearch,
searchValue,
filterSort,
...props ...props
}) { }) {
const canSearch = const canSearch =
@@ -210,28 +214,39 @@ export function Select({
} }
styles={{ styles={{
...props.styles, ...props.styles,
popup: { ...props.styles?.popup, root: dropdownStyle }, popup: {
...props.styles?.popup,
root: dropdownStyle ?? props.styles?.popup?.root,
},
}} }}
classNames={{ classNames={{
...props.classNames, ...props.classNames,
popup: { ...props.classNames?.popup, root: dropdownClassName }, popup: {
...props.classNames?.popup,
root: dropdownClassName ?? props.classNames?.popup?.root,
},
}} }}
options={optionList || options} options={optionList || options}
allowClear={showClear ?? props.allowClear} allowClear={showClear ?? props.allowClear}
showSearch={canSearch} showSearch={{
filterOption={ enabled: canSearch,
remote filterOption: remote
? false ? false
: typeof filter === 'function' : typeof filter === 'function'
? filter ? filter
: filter === false : filter === false
? false ? false
: undefined : undefined,
} optionFilterProp: 'label',
optionFilterProp='label' ...(typeof props.showSearch === 'object' ? props.showSearch : {}),
...(autoClearSearchValue !== undefined ? { autoClearSearchValue } : {}),
...(onSearch !== undefined ? { onSearch } : {}),
...(searchValue !== undefined ? { searchValue } : {}),
...(filterSort !== undefined ? { filterSort } : {}),
}}
notFoundContent={emptyContent} notFoundContent={emptyContent}
status={statusOf(validateStatus)} status={statusOf(validateStatus)}
onOpenChange={onDropdownVisibleChange} onOpenChange={onDropdownVisibleChange ?? props.onOpenChange}
prefix={prefix} prefix={prefix}
popupRender={ popupRender={
outerBottomSlot || innerBottomSlot outerBottomSlot || innerBottomSlot
@@ -348,7 +363,7 @@ export function Switch({
{...props} {...props}
checkedChildren={checkedText} checkedChildren={checkedText}
unCheckedChildren={uncheckedText} unCheckedChildren={uncheckedText}
size={size === 'small' ? 'small' : 'default'} size={size === 'small' ? 'small' : 'medium'}
/> />
); );
} }
@@ -369,6 +384,8 @@ export function DatePicker({
presets, presets,
size, size,
inputReadOnly, inputReadOnly,
dropdownClassName,
dropdownStyle,
...props ...props
}) { }) {
const range = type?.toLowerCase().includes('range'); const range = type?.toLowerCase().includes('range');
@@ -377,6 +394,20 @@ export function DatePicker({
return ( return (
<Component <Component
{...props} {...props}
classNames={{
...props.classNames,
popup: {
...props.classNames?.popup,
root: dropdownClassName ?? props.classNames?.popup?.root,
},
}}
styles={{
...props.styles,
popup: {
...props.styles?.popup,
root: dropdownStyle ?? props.styles?.popup?.root,
},
}}
{...(value !== undefined ? { value: convert(value) } : {})} {...(value !== undefined ? { value: convert(value) } : {})}
defaultValue={ defaultValue={
defaultValue === undefined ? undefined : convert(defaultValue) defaultValue === undefined ? undefined : convert(defaultValue)
@@ -426,11 +457,13 @@ export function TreeSelect({
{...props} {...props}
treeData={treeNodes(treeData)} treeData={treeNodes(treeData)}
allowClear={showClear} allowClear={showClear}
showSearch={!!filterTreeNode} showSearch={{
treeNodeFilterProp='title' enabled: !!filterTreeNode,
filterTreeNode={ filterTreeNode:
typeof filterTreeNode === 'function' ? filterTreeNode : undefined typeof filterTreeNode === 'function' ? filterTreeNode : undefined,
} treeNodeFilterProp: 'title',
...(typeof props.showSearch === 'object' ? props.showSearch : {}),
}}
treeDefaultExpandAll={expandAll} treeDefaultExpandAll={expandAll}
/> />
); );
@@ -461,12 +494,19 @@ export function AutoComplete({
renderItem, renderItem,
emptyContent, emptyContent,
onEnterPress, onEnterPress,
onSearch,
showSearch,
size, size,
...props ...props
}) { }) {
return ( return (
<AntAutoComplete <AntAutoComplete
{...props} {...props}
showSearch={
onSearch
? { ...(typeof showSearch === 'object' ? showSearch : {}), onSearch }
: showSearch
}
options={data?.map((item) => options={data?.map((item) =>
typeof item === 'string' ? { value: item } : item, typeof item === 'string' ? { value: item } : item,
)} )}
+55 -23
View File
@@ -27,7 +27,7 @@ import {
paginationEvents, paginationEvents,
paginationShowTotal, paginationShowTotal,
} from './pagination'; } from './pagination';
import { overlayMaskClosable } from './overlayPolicy'; import { overlayMask } from './overlayPolicy';
import './pagination.css'; import './pagination.css';
import { useIsMobile } from '../../hooks/common/useIsMobile'; import { useIsMobile } from '../../hooks/common/useIsMobile';
import { useConsolePage } from '../console/ConsoleContext'; import { useConsolePage } from '../console/ConsoleContext';
@@ -132,7 +132,7 @@ export const Card = forwardRef(function Card(
variant={ variant={
props.variant ?? (bordered === false ? 'borderless' : 'outlined') props.variant ?? (bordered === false ? 'borderless' : 'outlined')
} }
size={size === 'small' ? 'small' : 'default'} size={size === 'small' ? 'small' : 'medium'}
title={ title={
props.title ?? props.title ??
header?.title ?? header?.title ??
@@ -141,7 +141,7 @@ export const Card = forwardRef(function Card(
: undefined) : undefined)
} }
extra={headerExtraContent ?? header?.extra} extra={headerExtraContent ?? header?.extra}
styles={{ header: headerStyle, body: bodyStyle }} styles={{ header: headerStyle, body: bodyStyle, ...props.styles }}
> >
{props.children} {props.children}
{footer && <div className='ui-card-footer'>{footer}</div>} {footer && <div className='ui-card-footer'>{footer}</div>}
@@ -151,15 +151,15 @@ export const Card = forwardRef(function Card(
export const Space = ({ spacing, vertical, size, ...props }) => ( export const Space = ({ spacing, vertical, size, ...props }) => (
<Ant.Space <Ant.Space
{...props} {...props}
direction={vertical ? 'vertical' : 'horizontal'} orientation={vertical ? 'vertical' : 'horizontal'}
size={spacing === 'medium' ? 'middle' : (spacing ?? size)} size={spacing === 'medium' ? 'middle' : (spacing ?? size)}
/> />
); );
export const Divider = ({ margin, align, layout, style, ...props }) => ( export const Divider = ({ margin, align, layout, style, ...props }) => (
<Ant.Divider <Ant.Divider
{...props} {...props}
orientation={align} titlePlacement={align}
type={layout === 'vertical' ? 'vertical' : 'horizontal'} orientation={layout === 'vertical' ? 'vertical' : 'horizontal'}
style={{ margin, ...style }} style={{ margin, ...style }}
/> />
); );
@@ -174,6 +174,7 @@ export const Tag = forwardRef(function Tag(
prefix, prefix,
children, children,
color, color,
bordered,
...props ...props
}, },
ref, ref,
@@ -182,6 +183,7 @@ export const Tag = forwardRef(function Tag(
<Ant.Tag <Ant.Tag
{...props} {...props}
ref={ref} ref={ref}
variant={props.variant ?? (bordered === false ? 'filled' : 'outlined')}
color={ color={
['white', 'grey', 'light-blue', 'light-green'].includes(color) ['white', 'grey', 'light-blue', 'light-green'].includes(color)
? { ? {
@@ -231,6 +233,8 @@ export const Spin = ({
style, style,
className, className,
'data-testid': testId, 'data-testid': testId,
tip,
wrapperClassName,
...props ...props
}) => }) =>
children ? ( children ? (
@@ -239,14 +243,20 @@ export const Spin = ({
className={`ui-spin-shell ${className || ''}`} className={`ui-spin-shell ${className || ''}`}
data-testid={testId} data-testid={testId}
> >
<Ant.Spin {...props} size={controlSize(size)}> <Ant.Spin
{...props}
description={tip ?? props.description}
classNames={{ root: wrapperClassName, ...props.classNames }}
size={size === 'default' ? 'medium' : size}
>
<div style={childStyle}>{children}</div> <div style={childStyle}>{children}</div>
</Ant.Spin> </Ant.Spin>
</div> </div>
) : ( ) : (
<Ant.Spin <Ant.Spin
{...props} {...props}
size={controlSize(size)} size={size === 'default' ? 'medium' : size}
description={tip ?? props.description}
style={style} style={style}
className={className} className={className}
data-testid={testId} data-testid={testId}
@@ -556,8 +566,8 @@ export const Timeline = Object.assign(
.filter(React.isValidElement) .filter(React.isValidElement)
.map((child) => ({ .map((child) => ({
color: child.props.type === 'ongoing' ? 'blue' : undefined, color: child.props.type === 'ongoing' ? 'blue' : undefined,
label: child.props.time, title: child.props.time,
children: ( content: (
<> <>
{child.props.children} {child.props.children}
{child.props.extra} {child.props.extra}
@@ -634,7 +644,7 @@ export const Banner = ({
return ( return (
<Component <Component
{...props} {...props}
message={title} title={title}
type={type === 'danger' ? 'error' : type} type={type === 'danger' ? 'error' : type}
showIcon showIcon
closable={!!closeIcon} closable={!!closeIcon}
@@ -642,9 +652,9 @@ export const Banner = ({
/> />
); );
}; };
export const Alert = (props) => { export const Alert = ({ message, ...props }) => {
const Component = useConsolePage() ? ConsoleAlert : Ant.Alert; const Component = useConsolePage() ? ConsoleAlert : Ant.Alert;
return <Component {...props} />; return <Component {...props} title={props.title ?? message} />;
}; };
function modalProps({ function modalProps({
@@ -659,20 +669,23 @@ function modalProps({
type, type,
bodyStyle, bodyStyle,
maskStyle, maskStyle,
mask,
maskClosable,
destroyOnClose, destroyOnClose,
...props ...props
}) { }) {
return { return {
...props, ...props,
maskClosable: overlayMaskClosable(props.maskClosable), mask: overlayMask(mask, maskClosable),
open: visible, open: visible,
title: header === null ? null : (props.title ?? header), title: header === null ? null : (props.title ?? header),
keyboard: closeOnEsc, keyboard: closeOnEsc,
forceRender: lazyRender === false, forceRender: lazyRender === false,
destroyOnHidden: keepDOM === false || destroyOnClose, destroyOnHidden:
keepDOM === false || destroyOnClose || props.destroyOnHidden,
width: size === 'full-width' ? '100%' : props.width, width: size === 'full-width' ? '100%' : props.width,
okButtonProps: { danger: okType === 'danger', ...props.okButtonProps }, okButtonProps: { danger: okType === 'danger', ...props.okButtonProps },
styles: { body: bodyStyle, mask: maskStyle }, styles: { body: bodyStyle, mask: maskStyle, ...props.styles },
}; };
} }
export const Modal = Object.assign( export const Modal = Object.assign(
@@ -702,18 +715,31 @@ export const SideSheet = ({
headerStyle, headerStyle,
maskStyle, maskStyle,
destroyOnClose, destroyOnClose,
mask,
maskClosable,
width,
height,
...props ...props
}) => { }) => {
const Component = useConsolePage() ? ConsoleDrawer : Ant.Drawer; const Component = useConsolePage() ? ConsoleDrawer : Ant.Drawer;
return ( return (
<Component <Component
{...props} {...props}
maskClosable={overlayMaskClosable(props.maskClosable)} mask={overlayMask(mask, maskClosable)}
size={
props.size ??
(['top', 'bottom'].includes(props.placement) ? height : width)
}
open={visible} open={visible}
onClose={onCancel} onClose={onCancel}
keyboard={closeOnEsc} keyboard={closeOnEsc}
destroyOnHidden={destroyOnClose} destroyOnHidden={destroyOnClose ?? props.destroyOnHidden}
styles={{ body: bodyStyle, header: headerStyle, mask: maskStyle }} styles={{
body: bodyStyle,
header: headerStyle,
mask: maskStyle,
...props.styles,
}}
/> />
); );
}; };
@@ -727,7 +753,12 @@ export const ImagePreview = ({
}) => ( }) => (
<Ant.Image.PreviewGroup <Ant.Image.PreviewGroup
items={Array.isArray(src) ? src : [src]} items={Array.isArray(src) ? src : [src]}
preview={{ visible, onVisibleChange, current: currentIndex, onChange }} preview={{
open: visible,
onOpenChange: onVisibleChange,
current: currentIndex,
onChange,
}}
/> />
); );
@@ -747,11 +778,12 @@ Toast.destroyAll = Ant.message.destroy;
export const Notification = Object.fromEntries( export const Notification = Object.fromEntries(
['success', 'info', 'warning', 'error', 'open'].map((method) => [ ['success', 'info', 'warning', 'error', 'open'].map((method) => [
method, method,
(config) => ({ title, message, content, description, btn, actions, ...config }) =>
Ant.notification[method]({ Ant.notification[method]({
...config, ...config,
message: config.title ?? config.message, title: title ?? message,
description: config.content ?? config.description, description: content ?? description,
actions: actions ?? btn,
}), }),
]), ]),
); );
+13
View File
@@ -32,3 +32,16 @@ export function overlayMaskClosable(
pathname.startsWith('/user-center/'); pathname.startsWith('/user-center/');
return scoped ? true : configured; return scoped ? true : configured;
} }
export function overlayMask(mask, maskClosable, pathname) {
const config =
typeof mask === 'object' && mask !== null
? mask
: mask === undefined
? {}
: { enabled: mask };
return {
...config,
closable: overlayMaskClosable(config.closable ?? maskClosable, pathname),
};
}
+1
View File
@@ -4403,6 +4403,7 @@
"请输入账号": "Please enter the account number", "请输入账号": "Please enter the account number",
"请输入折扣率": "Please enter a discount rate", "请输入折扣率": "Please enter a discount rate",
"请输入整数": "Enter an integer", "请输入整数": "Enter an integer",
"输入数量不能超过 10000,已自动调整为 10000": "The quantity cannot exceed 10000. It has been adjusted to 10000.",
"请输入整数,如 1、5、10": "Enter an integer, e.g. 1, 5, 10", "请输入整数,如 1、5、10": "Enter an integer, e.g. 1, 5, 10",
"请输入证书序列号": "Enter the certificate serial number", "请输入证书序列号": "Enter the certificate serial number",
"请输入支付宝应用 ID": "Enter Alipay App ID", "请输入支付宝应用 ID": "Enter Alipay App ID",
+1
View File
@@ -4204,6 +4204,7 @@
"请输入原密码和新密码": "", "请输入原密码和新密码": "",
"请输入账号": "", "请输入账号": "",
"请输入折扣率": "Please enter a discount rate", "请输入折扣率": "Please enter a discount rate",
"输入数量不能超过 10000,已自动调整为 10000": "La quantité ne peut pas dépasser 10000. Elle a été ramenée à 10000.",
"请输入整数,如 1、5、10": "", "请输入整数,如 1、5、10": "",
"请输入证书序列号": "", "请输入证书序列号": "",
"请输入支付宝应用 ID": "", "请输入支付宝应用 ID": "",
+1
View File
@@ -4403,6 +4403,7 @@
"请输入账号": "口座番号を入力してください", "请输入账号": "口座番号を入力してください",
"请输入折扣率": "割引率を入力してください", "请输入折扣率": "割引率を入力してください",
"请输入整数": "整数を入力してください", "请输入整数": "整数を入力してください",
"输入数量不能超过 10000,已自动调整为 10000": "入力数量の上限は10000です。10000に自動調整しました。",
"请输入整数,如 1、5、10": "整数を入力してください(例:1、5、10)", "请输入整数,如 1、5、10": "整数を入力してください(例:1、5、10)",
"请输入证书序列号": "証明書のシリアル番号を入力してください", "请输入证书序列号": "証明書のシリアル番号を入力してください",
"请输入支付宝应用 ID": "Alipay アプリ ID を入力してください", "请输入支付宝应用 ID": "Alipay アプリ ID を入力してください",
+1
View File
@@ -4403,6 +4403,7 @@
"请输入账号": "계좌번호를 입력하세요", "请输入账号": "계좌번호를 입력하세요",
"请输入折扣率": "할인율을 입력하세요", "请输入折扣率": "할인율을 입력하세요",
"请输入整数": "정수를 입력하세요", "请输入整数": "정수를 입력하세요",
"输入数量不能超过 10000,已自动调整为 10000": "입력 수량은 10000을 초과할 수 없습니다. 10000으로 자동 조정되었습니다.",
"请输入整数,如 1、5、10": "정수를 입력하세요. 예: 1, 5, 10", "请输入整数,如 1、5、10": "정수를 입력하세요. 예: 1, 5, 10",
"请输入证书序列号": "인증서 일련번호를 입력하세요", "请输入证书序列号": "인증서 일련번호를 입력하세요",
"请输入支付宝应用 ID": "Alipay 앱 ID를 입력하세요", "请输入支付宝应用 ID": "Alipay 앱 ID를 입력하세요",
+1
View File
@@ -4236,6 +4236,7 @@
"请输入原密码和新密码": "", "请输入原密码和新密码": "",
"请输入账号": "", "请输入账号": "",
"请输入折扣率": "Please enter a discount rate", "请输入折扣率": "Please enter a discount rate",
"输入数量不能超过 10000,已自动调整为 10000": "Количество не может превышать 10000. Установлено значение 10000.",
"请输入整数,如 1、5、10": "", "请输入整数,如 1、5、10": "",
"请输入证书序列号": "", "请输入证书序列号": "",
"请输入支付宝应用 ID": "", "请输入支付宝应用 ID": "",
+1
View File
@@ -4403,6 +4403,7 @@
"请输入账号": "โปรดกรอกเลขที่บัญชี", "请输入账号": "โปรดกรอกเลขที่บัญชี",
"请输入折扣率": "โปรดกรอกอัตราส่วนลด", "请输入折扣率": "โปรดกรอกอัตราส่วนลด",
"请输入整数": "โปรดกรอกจำนวนเต็ม", "请输入整数": "โปรดกรอกจำนวนเต็ม",
"输入数量不能超过 10000,已自动调整为 10000": "จำนวนต้องไม่เกิน 10000 ระบบปรับเป็น 10000 แล้ว",
"请输入整数,如 1、5、10": "กรอกจำนวนเต็ม เช่น 1, 5, 10", "请输入整数,如 1、5、10": "กรอกจำนวนเต็ม เช่น 1, 5, 10",
"请输入证书序列号": "กรอกหมายเลขซีเรียลของใบรับรอง", "请输入证书序列号": "กรอกหมายเลขซีเรียลของใบรับรอง",
"请输入支付宝应用 ID": "กรอก App ID ของ Alipay", "请输入支付宝应用 ID": "กรอก App ID ของ Alipay",
+1
View File
@@ -4403,6 +4403,7 @@
"请输入账号": "Vui lòng nhập tài khoản", "请输入账号": "Vui lòng nhập tài khoản",
"请输入折扣率": "Vui lòng nhập tỷ lệ chiết khấu", "请输入折扣率": "Vui lòng nhập tỷ lệ chiết khấu",
"请输入整数": "Vui lòng nhập số nguyên", "请输入整数": "Vui lòng nhập số nguyên",
"输入数量不能超过 10000,已自动调整为 10000": "Số lượng không được vượt quá 10000. Đã tự động điều chỉnh thành 10000.",
"请输入整数,如 1、5、10": "Vui lòng nhập số nguyên, ví dụ 1, 5, 10", "请输入整数,如 1、5、10": "Vui lòng nhập số nguyên, ví dụ 1, 5, 10",
"请输入证书序列号": "Vui lòng nhập số sê-ri chứng chỉ", "请输入证书序列号": "Vui lòng nhập số sê-ri chứng chỉ",
"请输入支付宝应用 ID": "Vui lòng nhập ID ứng dụng Alipay", "请输入支付宝应用 ID": "Vui lòng nhập ID ứng dụng Alipay",
+1
View File
@@ -4403,6 +4403,7 @@
"请输入账号": "請輸入帳號", "请输入账号": "請輸入帳號",
"请输入折扣率": "請輸入折扣率", "请输入折扣率": "請輸入折扣率",
"请输入整数": "請輸入整數", "请输入整数": "請輸入整數",
"输入数量不能超过 10000,已自动调整为 10000": "輸入數量不能超過 10000,已自動調整為 10000",
"请输入整数,如 1、5、10": "請輸入整數,如 1、5、10", "请输入整数,如 1、5、10": "請輸入整數,如 1、5、10",
"请输入证书序列号": "請輸入證書序列號", "请输入证书序列号": "請輸入證書序列號",
"请输入支付宝应用 ID": "請輸入支付寶應用 ID", "请输入支付宝应用 ID": "請輸入支付寶應用 ID",
+1
View File
@@ -4351,6 +4351,7 @@
"请输入账号": "请输入账号", "请输入账号": "请输入账号",
"请输入折扣率": "请输入折扣率", "请输入折扣率": "请输入折扣率",
"请输入整数": "请输入整数", "请输入整数": "请输入整数",
"输入数量不能超过 10000,已自动调整为 10000": "输入数量不能超过 10000,已自动调整为 10000",
"请输入整数,如 1、5、10": "请输入整数,如 1、5、10", "请输入整数,如 1、5、10": "请输入整数,如 1、5、10",
"请输入证书序列号": "请输入证书序列号", "请输入证书序列号": "请输入证书序列号",
"请输入支付宝应用 ID": "请输入支付宝应用 ID", "请输入支付宝应用 ID": "请输入支付宝应用 ID",
@@ -147,7 +147,7 @@ const ImageDetailModal = ({
footer={ footer={
// wrap 必须开:三个中文按钮(用作参考图/在此基础上微调/下载图片)合计 ~370px, // wrap 必须开:三个中文按钮(用作参考图/在此基础上微调/下载图片)合计 ~370px,
// 而 modalWidth 是 viewportWidth-48,390px 屏上扣掉 content 的 padding 只剩 ~294px。 // 而 modalWidth 是 viewportWidth-48,390px 屏上扣掉 content 的 padding 只剩 ~294px。
// Space 默认 wrap:false + .ant-modal-content{overflow:hidden}, // Space 默认 wrap:false + .ant-modal-container{overflow:hidden},
// 溢出部分向左溢出并被裁掉 —— 「用作参考图」整个点不到。 // 溢出部分向左溢出并被裁掉 —— 「用作参考图」整个点不到。
<Space wrap style={{ justifyContent: 'flex-end', width: '100%' }}> <Space wrap style={{ justifyContent: 'flex-end', width: '100%' }}>
{onUseAsReference && task.imageUrl && ( {onUseAsReference && task.imageUrl && (
@@ -926,10 +926,10 @@ const ImageTaskList = ({
<Image <Image
src={previewImageUrl} src={previewImageUrl}
preview={{ preview={{
visible: previewVisible, open: previewVisible,
src: previewImageUrl, src: previewImageUrl,
onDownload: handlePreviewDownload, onDownload: handlePreviewDownload,
onVisibleChange: (visible) => { onOpenChange: (visible) => {
setPreviewVisible(visible); setPreviewVisible(visible);
if (!visible) { if (!visible) {
setPreviewImageUrl(''); setPreviewImageUrl('');
@@ -208,6 +208,6 @@
padding: 12px 16px; padding: 12px 16px;
} }
.vip-advanced .ant-collapse-content-box { .vip-advanced .ant-collapse-body {
padding: 4px 16px 16px; padding: 4px 16px 16px;
} }
@@ -53,7 +53,7 @@ const VideoModelPanel = ({
<Card <Card
title={t('选择模型')} title={t('选择模型')}
style={{ marginBottom: '16px' }} style={{ marginBottom: '16px' }}
bodyStyle={{ padding: '12px' }} styles={{ body: { padding: '12px' } }}
> >
<ModelSelector <ModelSelector
key={mode} key={mode}
@@ -74,7 +74,7 @@ const VideoModelPanel = ({
<Card <Card
title={t('模型信息')} title={t('模型信息')}
style={{ marginBottom: '16px' }} style={{ marginBottom: '16px' }}
bodyStyle={{ padding: '12px' }} styles={{ body: { padding: '12px' } }}
> >
<Space vertical spacing='medium' style={{ width: '100%' }}> <Space vertical spacing='medium' style={{ width: '100%' }}>
{/* 厂商 */} {/* 厂商 */}
@@ -125,7 +125,7 @@ const VideoModelPanel = ({
<span>{t('模型价格')}</span> <span>{t('模型价格')}</span>
</div> </div>
} }
bodyStyle={{ padding: '12px' }} styles={{ body: { padding: '12px' } }}
> >
<div <div
style={{ style={{
@@ -889,12 +889,14 @@ const VideoPreviewPanel = ({
return ( return (
<Card <Card
style={{ height: '100%', display: 'flex', flexDirection: 'column' }} style={{ height: '100%', display: 'flex', flexDirection: 'column' }}
bodyStyle={{ styles={{
body: {
flex: 1, flex: 1,
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
overflow: 'hidden', overflow: 'hidden',
padding: 0, padding: 0,
},
}} }}
> >
{/* 始终显示的顶部操作栏 */} {/* 始终显示的顶部操作栏 */}
+8 -8
View File
@@ -173,7 +173,7 @@ const KeyTable = ({
: group : group
} }
> >
<Tag color='blue' bordered={false}> <Tag color='blue' variant='filled'>
{group === 'auto' ? t('智能熔断') : group || t('默认')} {group === 'auto' ? t('智能熔断') : group || t('默认')}
</Tag> </Tag>
</Tooltip> </Tooltip>
@@ -196,7 +196,7 @@ const KeyTable = ({
onChange={() => onToggle(token)} onChange={() => onToggle(token)}
/> />
{extra ? ( {extra ? (
<Tag color={extra.color} bordered={false}> <Tag color={extra.color} variant='filled'>
{t(extra.label)} {t(extra.label)}
</Tag> </Tag>
) : null} ) : null}
@@ -220,7 +220,7 @@ const KeyTable = ({
key: 'quota', key: 'quota',
render: (_, token) => render: (_, token) =>
token.unlimited_quota === true || token.remain_quota < 0 ? ( token.unlimited_quota === true || token.remain_quota < 0 ? (
<Tag color='success' bordered={false}> <Tag color='success' variant='filled'>
{t('无限制')} {t('无限制')}
</Tag> </Tag>
) : ( ) : (
@@ -319,10 +319,10 @@ const DesensitizeNotice = ({ t }) => {
type='success' type='success'
showIcon showIcon
icon={<ShieldCheck size={18} />} icon={<ShieldCheck size={18} />}
message={ title={
<> <>
{t('您的敏感数据已自动脱敏保护')}{' '} {t('您的敏感数据已自动脱敏保护')}{' '}
<Tag color='success' bordered={false}> <Tag color='success' variant='filled'>
{t('已开启')} {t('已开启')}
</Tag> </Tag>
</> </>
@@ -412,10 +412,10 @@ const ModelsDrawer = ({ visible, onClose, token, t }) => {
title={t('可用模型列表')} title={t('可用模型列表')}
open={visible} open={visible}
onClose={onClose} onClose={onClose}
maskClosable
placement='right' placement='right'
width={440} size={440}
rootClassName='km-models-drawer' rootClassName='km-models-drawer'
mask={{ closable: true }}
> >
<dl className='km-models-info'> <dl className='km-models-info'>
<dt>{t('密钥名称')}</dt> <dt>{t('密钥名称')}</dt>
@@ -452,7 +452,7 @@ const ModelsDrawer = ({ visible, onClose, token, t }) => {
{categoryModels.map((model) => ( {categoryModels.map((model) => (
<Tooltip key={model} title={t('点击复制模型名称')}> <Tooltip key={model} title={t('点击复制模型名称')}>
<Tag <Tag
bordered={false} variant='filled'
className='km-model-chip' className='km-model-chip'
role='button' role='button'
tabIndex={0} tabIndex={0}
+1 -1
View File
@@ -74,7 +74,7 @@ const LogoShowcase = () => {
<Card <Card
key={style.name} key={style.name}
className='overflow-hidden shadow-lg hover:shadow-2xl transition-all duration-300 hover:scale-105' className='overflow-hidden shadow-lg hover:shadow-2xl transition-all duration-300 hover:scale-105'
bodyStyle={{ padding: 0 }} styles={{ body: { padding: 0 } }}
> >
<div <div
className='flex flex-col items-center justify-center p-12' className='flex flex-col items-center justify-center p-12'
+7 -7
View File
@@ -133,7 +133,7 @@ const AdminMonitor = () => {
borderRadius: '12px', borderRadius: '12px',
height: '100%', height: '100%',
}} }}
bodyStyle={{ padding: '24px' }} styles={{ body: { padding: '24px' } }}
> >
<div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}> <div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>
<div <div
@@ -665,7 +665,7 @@ const AdminMonitor = () => {
<span>{t('请求趋势')} (24h)</span> <span>{t('请求趋势')} (24h)</span>
</div> </div>
} }
bodyStyle={{ padding: '20px' }} styles={{ body: { padding: '20px' } }}
> >
{renderBarChart( {renderBarChart(
data.requestTrend, data.requestTrend,
@@ -684,7 +684,7 @@ const AdminMonitor = () => {
<span>{t('成本分布')}</span> <span>{t('成本分布')}</span>
</div> </div>
} }
bodyStyle={{ padding: '20px' }} styles={{ body: { padding: '20px' } }}
> >
{renderDonutChart(data.costDistribution)} {renderDonutChart(data.costDistribution)}
</Card> </Card>
@@ -700,7 +700,7 @@ const AdminMonitor = () => {
<span>{t('Token消耗趋势')} (24h)</span> <span>{t('Token消耗趋势')} (24h)</span>
</div> </div>
} }
bodyStyle={{ padding: '20px' }} styles={{ body: { padding: '20px' } }}
> >
{renderStackedAreaChart(data.tokenTrend)} {renderStackedAreaChart(data.tokenTrend)}
</Card> </Card>
@@ -716,7 +716,7 @@ const AdminMonitor = () => {
<span>{t('配额使用情况')}</span> <span>{t('配额使用情况')}</span>
</div> </div>
} }
bodyStyle={{ padding: '20px' }} styles={{ body: { padding: '20px' } }}
> >
{renderGaugeChart(data.quotaUsage)} {renderGaugeChart(data.quotaUsage)}
</Card> </Card>
@@ -735,7 +735,7 @@ const AdminMonitor = () => {
<span>{t('错误类型分布')} (24h)</span> <span>{t('错误类型分布')} (24h)</span>
</div> </div>
} }
bodyStyle={{ padding: '20px' }} styles={{ body: { padding: '20px' } }}
> >
{renderHorizontalBar(data.errorTypes)} {renderHorizontalBar(data.errorTypes)}
</Card> </Card>
@@ -754,7 +754,7 @@ const AdminMonitor = () => {
<span>{t('渠道详细数据')}</span> <span>{t('渠道详细数据')}</span>
</div> </div>
} }
bodyStyle={{ padding: 0 }} styles={{ body: { padding: 0 } }}
> >
<Table <Table
columns={columns} columns={columns}
+1 -1
View File
@@ -328,8 +328,8 @@ const ChannelMonitor = () => {
<Col key={channel.id} xs={24} sm={12} lg={8} xl={6}> <Col key={channel.id} xs={24} sm={12} lg={8} xl={6}>
<Card <Card
className='channel-card' className='channel-card'
bodyStyle={{ padding: '20px' }}
style={{ height: '100%' }} style={{ height: '100%' }}
styles={{ body: { padding: '20px' } }}
> >
{/* 渠道名称和状态 */} {/* 渠道名称和状态 */}
<div style={{ marginBottom: '16px' }}> <div style={{ marginBottom: '16px' }}>
@@ -152,7 +152,6 @@ const ChannelMonitorView = ({ channelStatus, onRefresh }) => {
</div> </div>
} }
headerStyle={{ borderBottom: '2px solid #f0f0f0' }} headerStyle={{ borderBottom: '2px solid #f0f0f0' }}
bodyStyle={{ padding: 16 }}
style={{ style={{
height: '100%', height: '100%',
border: `2px solid ${ border: `2px solid ${
@@ -163,6 +162,7 @@ const ChannelMonitorView = ({ channelStatus, onRefresh }) => {
: '#faad1420' : '#faad1420'
}`, }`,
}} }}
styles={{ body: { padding: 16 } }}
> >
{/* 1. 渠道状态 */} {/* 1. 渠道状态 */}
<div style={{ marginBottom: 16 }}> <div style={{ marginBottom: 16 }}>
+1 -1
View File
@@ -716,7 +716,7 @@ const OrgMembers = ({
className='oc-block-gap' className='oc-block-gap'
type='info' type='info'
showIcon showIcon
message={t( title={t(
'当前企业仅有您一位成员。为员工创建成员账号后,即可在此管理成员角色、额度上限和访问权限。', '当前企业仅有您一位成员。为员工创建成员账号后,即可在此管理成员角色、额度上限和访问权限。',
)} )}
/> />
@@ -363,7 +363,7 @@ const OrgPersonalSettings = ({ orgId }) => {
</> </>
) : ( ) : (
<div className='oc-ps-unlimited'> <div className='oc-ps-unlimited'>
<AntTag color='gold' bordered={false}> <AntTag color='gold' variant='filled'>
{t('不限额')} {t('不限额')}
</AntTag> </AntTag>
<span>{t('企业未对你设置配额上限')}</span> <span>{t('企业未对你设置配额上限')}</span>
@@ -450,7 +450,7 @@ const OrgPersonalSettings = ({ orgId }) => {
<div className='ui-profile-meta'> <div className='ui-profile-meta'>
<div className='ui-profile-name'> <div className='ui-profile-name'>
<strong>{displayName || t('未设置')}</strong> <strong>{displayName || t('未设置')}</strong>
<AntTag color='gold' bordered={false}> <AntTag color='gold' variant='filled'>
{roleLabel(t, member.role)} {roleLabel(t, member.role)}
</AntTag> </AntTag>
</div> </div>
+63 -20
View File
@@ -20,17 +20,14 @@ import { Check as ActionCheck } from '@/components/common/icons/ActionIcons';
import React, { useEffect, useState, useCallback, useMemo } from 'react'; import React, { useEffect, useState, useCallback, useMemo } from 'react';
import { timestamp2string } from '../../helpers/utils'; import { timestamp2string } from '../../helpers/utils';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { import { useThrottledCallback } from 'use-debounce';
Typography, import { Typography, Button, Spin, Table, Tag, Select } from '@/components/ui';
Button,
Spin,
Table,
Tag,
InputNumber,
Select,
} from '@/components/ui';
import { CheckCircle, Clock, XCircle } from 'lucide-react'; import { CheckCircle, Clock, XCircle } from 'lucide-react';
import { Button as AntButton } from 'antd'; import { Button as AntButton, Input as AntInput } from 'antd';
import {
MAX_CUSTOM_AMOUNT,
normalizeCustomAmount,
} from './customRechargeAmount';
import { import {
API, API,
showError, showError,
@@ -82,6 +79,17 @@ const OrgRecharge = ({ orgId }) => {
// 自定义充值(与预设档位互斥;自定义金额无折扣,原价到账) // 自定义充值(与预设档位互斥;自定义金额无折扣,原价到账)
const [isCustomMode, setIsCustomMode] = useState(false); const [isCustomMode, setIsCustomMode] = useState(false);
const [customAmount, setCustomAmount] = useState(null); const [customAmount, setCustomAmount] = useState(null);
const [customAmountExceeded, setCustomAmountExceeded] = useState(false);
// Clamp the amount immediately; throttle feedback so payment state never lags.
const reportCustomAmountExceeded = useThrottledCallback(
() => setCustomAmountExceeded(true),
200,
{ leading: false, trailing: true },
);
const clearCustomAmountError = () => {
reportCustomAmountExceeded.cancel();
setCustomAmountExceeded(false);
};
const [customUnit, setCustomUnit] = useState(1000); // 1000=千 / 10000=万 const [customUnit, setCustomUnit] = useState(1000); // 1000=千 / 10000=万
const customEffectiveAmount = useMemo(() => { const customEffectiveAmount = useMemo(() => {
@@ -89,7 +97,11 @@ const OrgRecharge = ({ orgId }) => {
return Math.floor(Number(customAmount)) * customUnit; return Math.floor(Number(customAmount)) * customUnit;
}, [customAmount, customUnit]); }, [customAmount, customUnit]);
const customValid = customEffectiveAmount >= 1000; const customValid =
Number.isInteger(customAmount) &&
customAmount >= 1 &&
customAmount <= MAX_CUSTOM_AMOUNT &&
customEffectiveAmount >= 1000;
// 当前生效的金额/折扣/赠送(自定义优先) // 当前生效的金额/折扣/赠送(自定义优先)
const effectiveAmountYuan = isCustomMode const effectiveAmountYuan = isCustomMode
@@ -239,6 +251,7 @@ const OrgRecharge = ({ orgId }) => {
}, []); }, []);
const selectPreset = (preset) => { const selectPreset = (preset) => {
clearCustomAmountError();
setSelectedPreset(preset.id); setSelectedPreset(preset.id);
setSelectedPresetObj(preset); setSelectedPresetObj(preset);
setIsCustomMode(false); setIsCustomMode(false);
@@ -246,8 +259,15 @@ const OrgRecharge = ({ orgId }) => {
}; };
const handleCustomAmountChange = (v) => { const handleCustomAmountChange = (v) => {
setCustomAmount(v); const result = normalizeCustomAmount(v);
if (v && Number(v) > 0) { if (!result) return;
if (result.exceeded) {
reportCustomAmountExceeded();
} else {
clearCustomAmountError();
}
setCustomAmount(result.value);
if (result.value) {
setIsCustomMode(true); setIsCustomMode(true);
setSelectedPreset(null); setSelectedPreset(null);
setSelectedPresetObj(null); setSelectedPresetObj(null);
@@ -275,6 +295,7 @@ const OrgRecharge = ({ orgId }) => {
]; ];
const applyCustomQuickPick = (amount, unit) => { const applyCustomQuickPick = (amount, unit) => {
clearCustomAmountError();
setCustomAmount(amount); setCustomAmount(amount);
setCustomUnit(unit); setCustomUnit(unit);
setIsCustomMode(true); setIsCustomMode(true);
@@ -616,16 +637,38 @@ const OrgRecharge = ({ orgId }) => {
)} )}
</h3> </h3>
<div className='oc-rc-custom-input'> <div className='oc-rc-custom-input'>
<InputNumber <div className='oc-rc-custom-field'>
value={customAmount} <AntInput
onChange={handleCustomAmountChange} value={customAmount ?? ''}
min={1} onChange={(event) =>
precision={0} handleCustomAmountChange(event.target.value)
hideButtons }
inputMode='numeric'
pattern='[0-9]*'
placeholder={t('请输入整数,如 1、5、10')} placeholder={t('请输入整数,如 1、5、10')}
status={customInvalid ? 'error' : undefined} status={
customAmountExceeded || customInvalid
? 'error'
: undefined
}
aria-invalid={customAmountExceeded || customInvalid}
aria-describedby='org-recharge-custom-amount-error'
style={{ width: '100%' }} style={{ width: '100%' }}
/> />
<div className='oc-rc-custom-feedback' aria-live='polite'>
<span
id='org-recharge-custom-amount-error'
className={
customAmountExceeded ? undefined : 'is-hidden'
}
aria-hidden={!customAmountExceeded}
>
<Text type='danger'>
{t('输入数量不能超过 10000,已自动调整为 10000')}
</Text>
</span>
</div>
</div>
<Select <Select
value={customUnit} value={customUnit}
onChange={handleCustomUnitChange} onChange={handleCustomUnitChange}
+1 -1
View File
@@ -782,7 +782,7 @@ const OrgSettings = ({ orgId, orgRole }) => {
className='oc-cs-alert' className='oc-cs-alert'
type='error' type='error'
showIcon showIcon
message={t('配置加载失败,为防止误覆盖已有配置,编辑已禁用。')} title={t('配置加载失败,为防止误覆盖已有配置,编辑已禁用。')}
action={ action={
<Button size='small' type='danger' onClick={fetchPromptCfg}> <Button size='small' type='danger' onClick={fetchPromptCfg}>
{t('重试')} {t('重试')}
+1 -1
View File
@@ -406,7 +406,7 @@ const OrgTokens = ({ orgId, orgRole }) => {
className='oc-block-gap' className='oc-block-gap'
type='info' type='info'
showIcon showIcon
message={t( title={t(
'作为普通成员,您只能管理自己创建的密钥。管理员可管理所有密钥。', '作为普通成员,您只能管理自己创建的密钥。管理员可管理所有密钥。',
)} )}
/> />
@@ -637,7 +637,7 @@ const OrgAnalyticsPanel = ({
<h2>{t('{{dim}}消费分布', { dim: dimLabel })}</h2> <h2>{t('{{dim}}消费分布', { dim: dimLabel })}</h2>
<span>{t('Top 10')}</span> <span>{t('Top 10')}</span>
</div> </div>
<AntTag bordered={false}>{t('按消费排序')}</AntTag> <AntTag variant='filled'>{t('按消费排序')}</AntTag>
</div> </div>
{loading ? ( {loading ? (
<div className='oc-ea-loading'> <div className='oc-ea-loading'>
@@ -221,7 +221,7 @@ const OrgTaskRecords = () => {
{/* 只有真实存在进行中任务时才显示,避免误导 */} {/* 只有真实存在进行中任务时才显示,避免误导 */}
{pageStats.pendingCount > 0 && ( {pageStats.pendingCount > 0 && (
<Tag <Tag
bordered={false} variant='filled'
color='processing' color='processing'
icon={<Clock size={12} />} icon={<Clock size={12} />}
> >
@@ -0,0 +1,32 @@
/*
Copyright (C) 2025 QuantumNous
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
export const MAX_CUSTOM_AMOUNT = 10000;
export function normalizeCustomAmount(input) {
if (input === '') return { value: null, exceeded: false };
// Reject the whole edit so pasted decimals or signs cannot change its meaning.
if (!/^[0-9]+$/.test(input)) return null;
const value = Number(input);
if (value === 0) return null;
return {
value: Math.min(value, MAX_CUSTOM_AMOUNT),
exceeded: value > MAX_CUSTOM_AMOUNT,
};
}
+10 -4
View File
@@ -112,7 +112,10 @@ export default function PartnerConsole() {
// mt-[60px]:顶栏 fixed 定位需自行让位(跑马灯由 PageLayout 占位补偿) // mt-[60px]:顶栏 fixed 定位需自行让位(跑马灯由 PageLayout 占位补偿)
<div className='console-content'> <div className='console-content'>
{portalClosed && ( {portalClosed && (
<Card className='!rounded-2xl shadow-sm' bodyStyle={{ padding: 40 }}> <Card
className='!rounded-2xl shadow-sm'
styles={{ body: { padding: 40 } }}
>
<div className='flex flex-col items-center text-center gap-3 max-w-md mx-auto'> <div className='flex flex-col items-center text-center gap-3 max-w-md mx-auto'>
<div className='p-3 rounded-full bg-brand/10 text-brand'> <div className='p-3 rounded-full bg-brand/10 text-brand'>
<Clock size={32} /> <Clock size={32} />
@@ -134,7 +137,10 @@ export default function PartnerConsole() {
)} )}
{!portalClosed && phase === 'error' && ( {!portalClosed && phase === 'error' && (
<Card className='!rounded-2xl shadow-sm' bodyStyle={{ padding: 40 }}> <Card
className='!rounded-2xl shadow-sm'
styles={{ body: { padding: 40 } }}
>
<div className='flex flex-col items-center text-center gap-3 max-w-md mx-auto'> <div className='flex flex-col items-center text-center gap-3 max-w-md mx-auto'>
<div className='p-3 rounded-full bg-orange-50 dark:bg-orange-900/20 text-orange-500'> <div className='p-3 rounded-full bg-orange-50 dark:bg-orange-900/20 text-orange-500'>
<AlertTriangle size={32} /> <AlertTriangle size={32} />
@@ -217,7 +223,7 @@ function BenefitItem({ icon, title, desc }) {
function ApplyCard({ t, onSubmit }) { function ApplyCard({ t, onSubmit }) {
return ( return (
<Card className='!rounded-2xl shadow-sm' bodyStyle={{ padding: 24 }}> <Card className='!rounded-2xl shadow-sm' styles={{ body: { padding: 24 } }}>
<Title heading={5} style={{ marginBottom: 4 }}> <Title heading={5} style={{ marginBottom: 4 }}>
{t('申请成为合作伙伴')} {t('申请成为合作伙伴')}
</Title> </Title>
@@ -300,7 +306,7 @@ function ApplyCard({ t, onSubmit }) {
function StatusCard({ t, self, onRefresh, onReapply }) { function StatusCard({ t, self, onRefresh, onReapply }) {
const pending = self?.status === 'pending'; const pending = self?.status === 'pending';
return ( return (
<Card className='!rounded-2xl shadow-sm' bodyStyle={{ padding: 40 }}> <Card className='!rounded-2xl shadow-sm' styles={{ body: { padding: 40 } }}>
<div className='flex flex-col items-center text-center gap-3 max-w-md mx-auto'> <div className='flex flex-col items-center text-center gap-3 max-w-md mx-auto'>
{pending ? ( {pending ? (
<div className='p-3 rounded-full bg-brand/10 text-brand'> <div className='p-3 rounded-full bg-brand/10 text-brand'>
+7 -7
View File
@@ -208,7 +208,7 @@ export default function Workbench({ self, dashboard }) {
return ( return (
<Card <Card
className='!rounded-2xl shadow-sm' className='!rounded-2xl shadow-sm'
bodyStyle={{ padding: '20px 24px' }} styles={{ body: { padding: '20px 24px' } }}
> >
<div className='flex flex-wrap items-center justify-between gap-3 mb-3'> <div className='flex flex-wrap items-center justify-between gap-3 mb-3'>
<div className='flex items-center gap-2.5 min-w-0'> <div className='flex items-center gap-2.5 min-w-0'>
@@ -273,7 +273,7 @@ function StatCard({ icon, title, value, iconBg, bgColor, onClick }) {
<div onClick={onClick} className={onClick ? 'cursor-pointer' : ''}> <div onClick={onClick} className={onClick ? 'cursor-pointer' : ''}>
<Card <Card
className={`${bgColor} border-none shadow-sm hover:shadow-md transition-shadow !rounded-xl`} className={`${bgColor} border-none shadow-sm hover:shadow-md transition-shadow !rounded-xl`}
bodyStyle={{ padding: 16 }} styles={{ body: { padding: 16 } }}
> >
<div className='flex items-start justify-between gap-2'> <div className='flex items-start justify-between gap-2'>
<div className='flex-1 min-w-0'> <div className='flex-1 min-w-0'>
@@ -1136,7 +1136,7 @@ function PayoutAccount({ t, readOnly }) {
/> />
)} )}
{!editing && account && ( {!editing && account && (
<Card className='!rounded-xl' bodyStyle={{ padding: 20 }}> <Card className='!rounded-xl' styles={{ body: { padding: 20 } }}>
<div className='flex items-start justify-between gap-3'> <div className='flex items-start justify-between gap-3'>
<div className='flex items-center gap-3 min-w-0'> <div className='flex items-center gap-3 min-w-0'>
<div className='p-2.5 bg-brand/10 text-brand rounded-lg flex-shrink-0'> <div className='p-2.5 bg-brand/10 text-brand rounded-lg flex-shrink-0'>
@@ -1171,7 +1171,7 @@ function PayoutAccount({ t, readOnly }) {
</Card> </Card>
)} )}
{!editing && !account && ( {!editing && !account && (
<Card className='!rounded-xl' bodyStyle={{ padding: 24 }}> <Card className='!rounded-xl' styles={{ body: { padding: 24 } }}>
<div className='flex flex-col items-center text-center gap-2 py-4'> <div className='flex flex-col items-center text-center gap-2 py-4'>
<div className='p-2.5 bg-brand/10 text-brand rounded-lg'> <div className='p-2.5 bg-brand/10 text-brand rounded-lg'>
<CreditCard size={22} /> <CreditCard size={22} />
@@ -1194,7 +1194,7 @@ function PayoutAccount({ t, readOnly }) {
</Card> </Card>
)} )}
{editing && ( {editing && (
<Card className='!rounded-xl' bodyStyle={{ padding: 20 }}> <Card className='!rounded-xl' styles={{ body: { padding: 20 } }}>
{/* key 随开合重挂载,避免上次输入残留;账号后端返回掩码,修改需重新完整填写 */} {/* key 随开合重挂载,避免上次输入残留;账号后端返回掩码,修改需重新完整填写 */}
<Form key={editing ? 'open' : 'closed'} onSubmit={save}> <Form key={editing ? 'open' : 'closed'} onSubmit={save}>
{({ formState }) => ( {({ formState }) => (
@@ -1364,7 +1364,7 @@ function Notices({ t, onRead, readOnly }) {
key={n.id} key={n.id}
className='!rounded-xl' className='!rounded-xl'
style={{ marginBottom: 8 }} style={{ marginBottom: 8 }}
bodyStyle={{ padding: 12 }} styles={{ body: { padding: 12 } }}
> >
<div className='flex items-center justify-between'> <div className='flex items-center justify-between'>
<span className='flex items-center gap-2'> <span className='flex items-center gap-2'>
@@ -1394,7 +1394,7 @@ function Notices({ t, onRead, readOnly }) {
key={a.id} key={a.id}
className='!rounded-xl' className='!rounded-xl'
style={{ marginBottom: 8 }} style={{ marginBottom: 8 }}
bodyStyle={{ padding: 12 }} styles={{ body: { padding: 12 } }}
> >
<div className='flex items-center justify-between'> <div className='flex items-center justify-between'>
<Text strong>{a.title}</Text> <Text strong>{a.title}</Text>
+1 -1
View File
@@ -118,7 +118,7 @@ const HistoryPanel = ({ t, refreshTrigger }) => {
key: status, key: status,
}; };
return ( return (
<AntTag bordered={false} color={config.color}> <AntTag variant='filled' color={config.color}>
{t(config.key)} {t(config.key)}
</AntTag> </AntTag>
); );
+1 -1
View File
@@ -175,7 +175,7 @@ const RechargePanel = ({
<Alert <Alert
type='info' type='info'
showIcon showIcon
message={t( title={t(
'管理员未开启在线充值功能,请联系管理员开启或使用兑换码充值。', '管理员未开启在线充值功能,请联系管理员开启或使用兑换码充值。',
)} )}
/> />
+1 -1
View File
@@ -229,9 +229,9 @@ const RechargeV2 = () => {
<Col span={8} key={option.id}> <Col span={8} key={option.id}>
<Card <Card
className={`amount-card ${selectedAmountOption?.id === option.id ? 'selected' : ''}`} className={`amount-card ${selectedAmountOption?.id === option.id ? 'selected' : ''}`}
bodyStyle={{ padding: 20 }}
onClick={() => handleSelectAmount(option)} onClick={() => handleSelectAmount(option)}
hoverable hoverable
styles={{ body: { padding: 20 } }}
> >
{option.badge && ( {option.badge && (
<Tag color={option.badge_color || 'blue'} className='badge'> <Tag color={option.badge_color || 'blue'} className='badge'>
+1 -1
View File
@@ -700,13 +700,13 @@ const GroupMonitor = () => {
<Modal <Modal
open={modalVisible} open={modalVisible}
onCancel={handleCloseModal} onCancel={handleCloseModal}
maskClosable
afterClose={handleAfterClose} afterClose={handleAfterClose}
footer={null} footer={null}
width={950} width={950}
title={selectedGroup?.name} title={selectedGroup?.name}
centered centered
className='group-monitor-modal' className='group-monitor-modal'
mask={{ closable: true }}
> >
{selectedGroup && ( {selectedGroup && (
<> <>
@@ -503,7 +503,7 @@ const GroupMonitorAdmin = () => {
<Col xs={12} sm={6}> <Col xs={12} sm={6}>
<Card <Card
className='overview-card' className='overview-card'
bodyStyle={{ padding: '20px', textAlign: 'center' }} styles={{ body: { padding: '20px', textAlign: 'center' } }}
> >
<div className='text-3xl font-bold text-blue-500'> <div className='text-3xl font-bold text-blue-500'>
{overview.total_groups} {overview.total_groups}
@@ -514,7 +514,7 @@ const GroupMonitorAdmin = () => {
<Col xs={12} sm={6}> <Col xs={12} sm={6}>
<Card <Card
className='overview-card' className='overview-card'
bodyStyle={{ padding: '20px', textAlign: 'center' }} styles={{ body: { padding: '20px', textAlign: 'center' } }}
> >
<div className='text-3xl font-bold text-green-500'> <div className='text-3xl font-bold text-green-500'>
{overview.healthy_groups} {overview.healthy_groups}
@@ -525,7 +525,7 @@ const GroupMonitorAdmin = () => {
<Col xs={12} sm={6}> <Col xs={12} sm={6}>
<Card <Card
className='overview-card' className='overview-card'
bodyStyle={{ padding: '20px', textAlign: 'center' }} styles={{ body: { padding: '20px', textAlign: 'center' } }}
> >
<div className='text-3xl font-bold text-orange-500'> <div className='text-3xl font-bold text-orange-500'>
{overview.warning_groups} {overview.warning_groups}
@@ -536,7 +536,7 @@ const GroupMonitorAdmin = () => {
<Col xs={12} sm={6}> <Col xs={12} sm={6}>
<Card <Card
className='overview-card' className='overview-card'
bodyStyle={{ padding: '20px', textAlign: 'center' }} styles={{ body: { padding: '20px', textAlign: 'center' } }}
> >
<div <div
className='text-3xl font-bold' className='text-3xl font-bold'
@@ -577,7 +577,10 @@ const GroupMonitorAdmin = () => {
return ( return (
<Col key={group.name} xs={24}> <Col key={group.name} xs={24}>
<Card className='group-admin-card' bodyStyle={{ padding: 0 }}> <Card
className='group-admin-card'
styles={{ body: { padding: 0 } }}
>
{/* 分组头部 */} {/* 分组头部 */}
<div <div
className='p-4 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors' className='p-4 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors'
@@ -403,8 +403,8 @@ export default function SettingsHeaderNavModules(props) {
background: 'var(--ui-color-bg-1)', background: 'var(--ui-color-bg-1)',
minHeight: '80px', minHeight: '80px',
}} }}
bodyStyle={{ padding: '16px' }}
shadows='hover' shadows='hover'
styles={{ body: { padding: '16px' } }}
> >
<div <div
style={{ style={{
@@ -557,8 +557,8 @@ export default function SettingsHeaderNavModules(props) {
background: 'var(--ui-color-bg-1)', background: 'var(--ui-color-bg-1)',
minHeight: '80px', minHeight: '80px',
}} }}
bodyStyle={{ padding: '16px' }}
shadows='hover' shadows='hover'
styles={{ body: { padding: '16px' } }}
> >
<div <div
style={{ style={{
@@ -635,8 +635,8 @@ export default function SettingsHeaderNavModules(props) {
background: 'var(--ui-color-bg-1)', background: 'var(--ui-color-bg-1)',
minHeight: '80px', minHeight: '80px',
}} }}
bodyStyle={{ padding: '16px' }}
shadows='hover' shadows='hover'
styles={{ body: { padding: '16px' } }}
> >
<div <div
style={{ style={{
@@ -165,8 +165,8 @@ export default function SettingsOrgUserNavModules(props) {
background: 'var(--ui-color-bg-1)', background: 'var(--ui-color-bg-1)',
minHeight: '64px', minHeight: '64px',
}} }}
bodyStyle={{ padding: '16px' }}
shadows='hover' shadows='hover'
styles={{ body: { padding: '16px' } }}
> >
<div <div
style={{ style={{
@@ -694,12 +694,12 @@ export default function SettingsSidebarModulesAdmin(props) {
return ( return (
<Col key={module.key} xs={24} sm={12} md={8} lg={6} xl={6}> <Col key={module.key} xs={24} sm={12} md={8} lg={6} xl={6}>
<Card <Card
bodyStyle={{ padding: '16px' }}
shadows='hover' shadows='hover'
style={{ style={{
opacity: sectionConfig.enabled ? 1 : 0.5, opacity: sectionConfig.enabled ? 1 : 0.5,
transition: 'opacity 0.2s', transition: 'opacity 0.2s',
}} }}
styles={{ body: { padding: '16px' } }}
> >
<div <div
style={{ style={{
@@ -870,7 +870,7 @@ function PresetGrid({
transition: 'all 0.2s ease', transition: 'all 0.2s ease',
background: 'var(--ui-color-bg-1)', background: 'var(--ui-color-bg-1)',
}} }}
bodyStyle={{ padding: 16 }} styles={{ body: { padding: 16 } }}
> >
<div <div
style={{ style={{
@@ -409,8 +409,8 @@ export default function SettingsSidebarModulesUser() {
className={`!rounded-xl border border-gray-200 hover:border-blue-300 transition-all duration-200 ${ className={`!rounded-xl border border-gray-200 hover:border-blue-300 transition-all duration-200 ${
sidebarModulesUser[section.key]?.enabled ? '' : 'opacity-50' sidebarModulesUser[section.key]?.enabled ? '' : 'opacity-50'
}`} }`}
bodyStyle={{ padding: '16px' }}
hoverable hoverable
styles={{ body: { padding: '16px' } }}
> >
<div className='flex justify-between items-center h-full'> <div className='flex justify-between items-center h-full'>
<div className='flex-1 text-left'> <div className='flex-1 text-left'>
+1 -1
View File
@@ -748,7 +748,7 @@ const SkillMarket = () => {
type='info' type='info'
showIcon showIcon
icon={<Building2 size={15} aria-hidden='true' />} icon={<Building2 size={15} aria-hidden='true' />}
message={ title={
<span className='sm-org-context'> <span className='sm-org-context'>
<span> <span>
{t('当前操作企业')}:<strong>{orgName}</strong> {t('当前操作企业')}:<strong>{orgName}</strong>
+4 -4
View File
@@ -255,7 +255,7 @@ export default function MockSkillMarket() {
onReset={resetFilters} onReset={resetFilters}
extra={ extra={
<> <>
<Tag color='processing' bordered={false}> <Tag color='processing' variant='filled'>
{t('本地演示')} {t('本地演示')}
</Tag> </Tag>
<Text type='secondary'> <Text type='secondary'>
@@ -275,7 +275,7 @@ export default function MockSkillMarket() {
className='sm-notice' className='sm-notice'
type='warning' type='warning'
showIcon showIcon
message={t('浏览器存储不可用,修改仅在本次页面有效')} title={t('浏览器存储不可用,修改仅在本次页面有效')}
/> />
) : null ) : null
} }
@@ -302,7 +302,7 @@ export default function MockSkillMarket() {
onOpen={() => setDetailId(skill.id)} onOpen={() => setDetailId(skill.id)}
badges={ badges={
<Tag <Tag
bordered={false} variant='filled'
color={STATUS_TAG_COLOR[skill.enterprise_status]} color={STATUS_TAG_COLOR[skill.enterprise_status]}
> >
{statusLabel(skill.enterprise_status)} {statusLabel(skill.enterprise_status)}
@@ -359,7 +359,7 @@ export default function MockSkillMarket() {
title={t(editor?.id ? '编辑技能' : '新增技能')} title={t(editor?.id ? '编辑技能' : '新增技能')}
open={Boolean(editor)} open={Boolean(editor)}
onClose={() => setEditor(null)} onClose={() => setEditor(null)}
width={560} size={560}
rootClassName='sm-form-drawer' rootClassName='sm-form-drawer'
footer={ footer={
<Space> <Space>
+1 -1
View File
@@ -96,7 +96,7 @@ export const SkillCard = ({
<div className='sm-card-tags'> <div className='sm-card-tags'>
{badges} {badges}
{tags.map((tag) => ( {tags.map((tag) => (
<Tag key={tag} className='sm-tag' bordered={false}> <Tag key={tag} className='sm-tag' variant='filled'>
{tagLabel(tag)} {tagLabel(tag)}
</Tag> </Tag>
))} ))}
@@ -42,8 +42,7 @@ const SkillDetailDrawer = ({
title={skill?.name} title={skill?.name}
open={open} open={open}
onClose={onClose} onClose={onClose}
maskClosable size={620}
width={620}
rootClassName='sm-detail-drawer sm-theme' rootClassName='sm-detail-drawer sm-theme'
rootStyle={themeStyle} rootStyle={themeStyle}
footer={ footer={
@@ -54,6 +53,7 @@ const SkillDetailDrawer = ({
</div> </div>
) : null ) : null
} }
mask={{ closable: true }}
> >
{skill ? ( {skill ? (
<> <>
@@ -70,7 +70,7 @@ const SkillDetailDrawer = ({
<h3>{t('标签')}</h3> <h3>{t('标签')}</h3>
<div className='sm-detail-tags'> <div className='sm-detail-tags'>
{skill.tags.map((tag) => ( {skill.tags.map((tag) => (
<Tag key={tag} bordered={false}> <Tag key={tag} variant='filled'>
{tagLabel(tag)} {tagLabel(tag)}
</Tag> </Tag>
))} ))}
@@ -93,7 +93,7 @@ const SkillDetailDrawer = ({
<p>{t('任务描述中出现这些词时,该技能会自动生效。')}</p> <p>{t('任务描述中出现这些词时,该技能会自动生效。')}</p>
<div className='sm-detail-tags'> <div className='sm-detail-tags'>
{skill.triggers.map((item) => ( {skill.triggers.map((item) => (
<Tag key={item} bordered={false}> <Tag key={item} variant='filled'>
{item} {item}
</Tag> </Tag>
))} ))}

Some files were not shown because too many files have changed in this diff Show More