feat: 1.升级 Ant Design Ui 至 v6 2. 修复企业充值金额输入限制
This commit is contained in:
@@ -147,7 +147,7 @@ const ImageDetailModal = ({
|
||||
footer={
|
||||
// wrap 必须开:三个中文按钮(用作参考图/在此基础上微调/下载图片)合计 ~370px,
|
||||
// 而 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%' }}>
|
||||
{onUseAsReference && task.imageUrl && (
|
||||
|
||||
@@ -926,10 +926,10 @@ const ImageTaskList = ({
|
||||
<Image
|
||||
src={previewImageUrl}
|
||||
preview={{
|
||||
visible: previewVisible,
|
||||
open: previewVisible,
|
||||
src: previewImageUrl,
|
||||
onDownload: handlePreviewDownload,
|
||||
onVisibleChange: (visible) => {
|
||||
onOpenChange: (visible) => {
|
||||
setPreviewVisible(visible);
|
||||
if (!visible) {
|
||||
setPreviewImageUrl('');
|
||||
|
||||
@@ -208,6 +208,6 @@
|
||||
padding: 12px 16px;
|
||||
}
|
||||
|
||||
.vip-advanced .ant-collapse-content-box {
|
||||
.vip-advanced .ant-collapse-body {
|
||||
padding: 4px 16px 16px;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ const VideoModelPanel = ({
|
||||
<Card
|
||||
title={t('选择模型')}
|
||||
style={{ marginBottom: '16px' }}
|
||||
bodyStyle={{ padding: '12px' }}
|
||||
styles={{ body: { padding: '12px' } }}
|
||||
>
|
||||
<ModelSelector
|
||||
key={mode}
|
||||
@@ -74,7 +74,7 @@ const VideoModelPanel = ({
|
||||
<Card
|
||||
title={t('模型信息')}
|
||||
style={{ marginBottom: '16px' }}
|
||||
bodyStyle={{ padding: '12px' }}
|
||||
styles={{ body: { padding: '12px' } }}
|
||||
>
|
||||
<Space vertical spacing='medium' style={{ width: '100%' }}>
|
||||
{/* 厂商 */}
|
||||
@@ -125,7 +125,7 @@ const VideoModelPanel = ({
|
||||
<span>{t('模型价格')}</span>
|
||||
</div>
|
||||
}
|
||||
bodyStyle={{ padding: '12px' }}
|
||||
styles={{ body: { padding: '12px' } }}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
|
||||
@@ -889,12 +889,14 @@ const VideoPreviewPanel = ({
|
||||
return (
|
||||
<Card
|
||||
style={{ height: '100%', display: 'flex', flexDirection: 'column' }}
|
||||
bodyStyle={{
|
||||
flex: 1,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
overflow: 'hidden',
|
||||
padding: 0,
|
||||
styles={{
|
||||
body: {
|
||||
flex: 1,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
overflow: 'hidden',
|
||||
padding: 0,
|
||||
},
|
||||
}}
|
||||
>
|
||||
{/* 始终显示的顶部操作栏 */}
|
||||
|
||||
@@ -173,7 +173,7 @@ const KeyTable = ({
|
||||
: group
|
||||
}
|
||||
>
|
||||
<Tag color='blue' bordered={false}>
|
||||
<Tag color='blue' variant='filled'>
|
||||
{group === 'auto' ? t('智能熔断') : group || t('默认')}
|
||||
</Tag>
|
||||
</Tooltip>
|
||||
@@ -196,7 +196,7 @@ const KeyTable = ({
|
||||
onChange={() => onToggle(token)}
|
||||
/>
|
||||
{extra ? (
|
||||
<Tag color={extra.color} bordered={false}>
|
||||
<Tag color={extra.color} variant='filled'>
|
||||
{t(extra.label)}
|
||||
</Tag>
|
||||
) : null}
|
||||
@@ -220,7 +220,7 @@ const KeyTable = ({
|
||||
key: 'quota',
|
||||
render: (_, token) =>
|
||||
token.unlimited_quota === true || token.remain_quota < 0 ? (
|
||||
<Tag color='success' bordered={false}>
|
||||
<Tag color='success' variant='filled'>
|
||||
{t('无限制')}
|
||||
</Tag>
|
||||
) : (
|
||||
@@ -319,10 +319,10 @@ const DesensitizeNotice = ({ t }) => {
|
||||
type='success'
|
||||
showIcon
|
||||
icon={<ShieldCheck size={18} />}
|
||||
message={
|
||||
title={
|
||||
<>
|
||||
{t('您的敏感数据已自动脱敏保护')}{' '}
|
||||
<Tag color='success' bordered={false}>
|
||||
<Tag color='success' variant='filled'>
|
||||
{t('已开启')}
|
||||
</Tag>
|
||||
</>
|
||||
@@ -412,10 +412,10 @@ const ModelsDrawer = ({ visible, onClose, token, t }) => {
|
||||
title={t('可用模型列表')}
|
||||
open={visible}
|
||||
onClose={onClose}
|
||||
maskClosable
|
||||
placement='right'
|
||||
width={440}
|
||||
size={440}
|
||||
rootClassName='km-models-drawer'
|
||||
mask={{ closable: true }}
|
||||
>
|
||||
<dl className='km-models-info'>
|
||||
<dt>{t('密钥名称')}</dt>
|
||||
@@ -452,7 +452,7 @@ const ModelsDrawer = ({ visible, onClose, token, t }) => {
|
||||
{categoryModels.map((model) => (
|
||||
<Tooltip key={model} title={t('点击复制模型名称')}>
|
||||
<Tag
|
||||
bordered={false}
|
||||
variant='filled'
|
||||
className='km-model-chip'
|
||||
role='button'
|
||||
tabIndex={0}
|
||||
|
||||
@@ -74,7 +74,7 @@ const LogoShowcase = () => {
|
||||
<Card
|
||||
key={style.name}
|
||||
className='overflow-hidden shadow-lg hover:shadow-2xl transition-all duration-300 hover:scale-105'
|
||||
bodyStyle={{ padding: 0 }}
|
||||
styles={{ body: { padding: 0 } }}
|
||||
>
|
||||
<div
|
||||
className='flex flex-col items-center justify-center p-12'
|
||||
|
||||
@@ -133,7 +133,7 @@ const AdminMonitor = () => {
|
||||
borderRadius: '12px',
|
||||
height: '100%',
|
||||
}}
|
||||
bodyStyle={{ padding: '24px' }}
|
||||
styles={{ body: { padding: '24px' } }}
|
||||
>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>
|
||||
<div
|
||||
@@ -665,7 +665,7 @@ const AdminMonitor = () => {
|
||||
<span>{t('请求趋势')} (24h)</span>
|
||||
</div>
|
||||
}
|
||||
bodyStyle={{ padding: '20px' }}
|
||||
styles={{ body: { padding: '20px' } }}
|
||||
>
|
||||
{renderBarChart(
|
||||
data.requestTrend,
|
||||
@@ -684,7 +684,7 @@ const AdminMonitor = () => {
|
||||
<span>{t('成本分布')}</span>
|
||||
</div>
|
||||
}
|
||||
bodyStyle={{ padding: '20px' }}
|
||||
styles={{ body: { padding: '20px' } }}
|
||||
>
|
||||
{renderDonutChart(data.costDistribution)}
|
||||
</Card>
|
||||
@@ -700,7 +700,7 @@ const AdminMonitor = () => {
|
||||
<span>{t('Token消耗趋势')} (24h)</span>
|
||||
</div>
|
||||
}
|
||||
bodyStyle={{ padding: '20px' }}
|
||||
styles={{ body: { padding: '20px' } }}
|
||||
>
|
||||
{renderStackedAreaChart(data.tokenTrend)}
|
||||
</Card>
|
||||
@@ -716,7 +716,7 @@ const AdminMonitor = () => {
|
||||
<span>{t('配额使用情况')}</span>
|
||||
</div>
|
||||
}
|
||||
bodyStyle={{ padding: '20px' }}
|
||||
styles={{ body: { padding: '20px' } }}
|
||||
>
|
||||
{renderGaugeChart(data.quotaUsage)}
|
||||
</Card>
|
||||
@@ -735,7 +735,7 @@ const AdminMonitor = () => {
|
||||
<span>{t('错误类型分布')} (24h)</span>
|
||||
</div>
|
||||
}
|
||||
bodyStyle={{ padding: '20px' }}
|
||||
styles={{ body: { padding: '20px' } }}
|
||||
>
|
||||
{renderHorizontalBar(data.errorTypes)}
|
||||
</Card>
|
||||
@@ -754,7 +754,7 @@ const AdminMonitor = () => {
|
||||
<span>{t('渠道详细数据')}</span>
|
||||
</div>
|
||||
}
|
||||
bodyStyle={{ padding: 0 }}
|
||||
styles={{ body: { padding: 0 } }}
|
||||
>
|
||||
<Table
|
||||
columns={columns}
|
||||
|
||||
@@ -328,8 +328,8 @@ const ChannelMonitor = () => {
|
||||
<Col key={channel.id} xs={24} sm={12} lg={8} xl={6}>
|
||||
<Card
|
||||
className='channel-card'
|
||||
bodyStyle={{ padding: '20px' }}
|
||||
style={{ height: '100%' }}
|
||||
styles={{ body: { padding: '20px' } }}
|
||||
>
|
||||
{/* 渠道名称和状态 */}
|
||||
<div style={{ marginBottom: '16px' }}>
|
||||
|
||||
@@ -152,7 +152,6 @@ const ChannelMonitorView = ({ channelStatus, onRefresh }) => {
|
||||
</div>
|
||||
}
|
||||
headerStyle={{ borderBottom: '2px solid #f0f0f0' }}
|
||||
bodyStyle={{ padding: 16 }}
|
||||
style={{
|
||||
height: '100%',
|
||||
border: `2px solid ${
|
||||
@@ -163,6 +162,7 @@ const ChannelMonitorView = ({ channelStatus, onRefresh }) => {
|
||||
: '#faad1420'
|
||||
}`,
|
||||
}}
|
||||
styles={{ body: { padding: 16 } }}
|
||||
>
|
||||
{/* 1. 渠道状态 */}
|
||||
<div style={{ marginBottom: 16 }}>
|
||||
|
||||
@@ -716,7 +716,7 @@ const OrgMembers = ({
|
||||
className='oc-block-gap'
|
||||
type='info'
|
||||
showIcon
|
||||
message={t(
|
||||
title={t(
|
||||
'当前企业仅有您一位成员。为员工创建成员账号后,即可在此管理成员角色、额度上限和访问权限。',
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -363,7 +363,7 @@ const OrgPersonalSettings = ({ orgId }) => {
|
||||
</>
|
||||
) : (
|
||||
<div className='oc-ps-unlimited'>
|
||||
<AntTag color='gold' bordered={false}>
|
||||
<AntTag color='gold' variant='filled'>
|
||||
{t('不限额')}
|
||||
</AntTag>
|
||||
<span>{t('企业未对你设置配额上限')}</span>
|
||||
@@ -450,7 +450,7 @@ const OrgPersonalSettings = ({ orgId }) => {
|
||||
<div className='ui-profile-meta'>
|
||||
<div className='ui-profile-name'>
|
||||
<strong>{displayName || t('未设置')}</strong>
|
||||
<AntTag color='gold' bordered={false}>
|
||||
<AntTag color='gold' variant='filled'>
|
||||
{roleLabel(t, member.role)}
|
||||
</AntTag>
|
||||
</div>
|
||||
|
||||
@@ -20,17 +20,14 @@ import { Check as ActionCheck } from '@/components/common/icons/ActionIcons';
|
||||
import React, { useEffect, useState, useCallback, useMemo } from 'react';
|
||||
import { timestamp2string } from '../../helpers/utils';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
Typography,
|
||||
Button,
|
||||
Spin,
|
||||
Table,
|
||||
Tag,
|
||||
InputNumber,
|
||||
Select,
|
||||
} from '@/components/ui';
|
||||
import { useThrottledCallback } from 'use-debounce';
|
||||
import { Typography, Button, Spin, Table, Tag, Select } from '@/components/ui';
|
||||
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 {
|
||||
API,
|
||||
showError,
|
||||
@@ -82,6 +79,17 @@ const OrgRecharge = ({ orgId }) => {
|
||||
// 自定义充值(与预设档位互斥;自定义金额无折扣,原价到账)
|
||||
const [isCustomMode, setIsCustomMode] = useState(false);
|
||||
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 customEffectiveAmount = useMemo(() => {
|
||||
@@ -89,7 +97,11 @@ const OrgRecharge = ({ orgId }) => {
|
||||
return Math.floor(Number(customAmount)) * customUnit;
|
||||
}, [customAmount, customUnit]);
|
||||
|
||||
const customValid = customEffectiveAmount >= 1000;
|
||||
const customValid =
|
||||
Number.isInteger(customAmount) &&
|
||||
customAmount >= 1 &&
|
||||
customAmount <= MAX_CUSTOM_AMOUNT &&
|
||||
customEffectiveAmount >= 1000;
|
||||
|
||||
// 当前生效的金额/折扣/赠送(自定义优先)
|
||||
const effectiveAmountYuan = isCustomMode
|
||||
@@ -239,6 +251,7 @@ const OrgRecharge = ({ orgId }) => {
|
||||
}, []);
|
||||
|
||||
const selectPreset = (preset) => {
|
||||
clearCustomAmountError();
|
||||
setSelectedPreset(preset.id);
|
||||
setSelectedPresetObj(preset);
|
||||
setIsCustomMode(false);
|
||||
@@ -246,8 +259,15 @@ const OrgRecharge = ({ orgId }) => {
|
||||
};
|
||||
|
||||
const handleCustomAmountChange = (v) => {
|
||||
setCustomAmount(v);
|
||||
if (v && Number(v) > 0) {
|
||||
const result = normalizeCustomAmount(v);
|
||||
if (!result) return;
|
||||
if (result.exceeded) {
|
||||
reportCustomAmountExceeded();
|
||||
} else {
|
||||
clearCustomAmountError();
|
||||
}
|
||||
setCustomAmount(result.value);
|
||||
if (result.value) {
|
||||
setIsCustomMode(true);
|
||||
setSelectedPreset(null);
|
||||
setSelectedPresetObj(null);
|
||||
@@ -275,6 +295,7 @@ const OrgRecharge = ({ orgId }) => {
|
||||
];
|
||||
|
||||
const applyCustomQuickPick = (amount, unit) => {
|
||||
clearCustomAmountError();
|
||||
setCustomAmount(amount);
|
||||
setCustomUnit(unit);
|
||||
setIsCustomMode(true);
|
||||
@@ -616,16 +637,38 @@ const OrgRecharge = ({ orgId }) => {
|
||||
)}
|
||||
</h3>
|
||||
<div className='oc-rc-custom-input'>
|
||||
<InputNumber
|
||||
value={customAmount}
|
||||
onChange={handleCustomAmountChange}
|
||||
min={1}
|
||||
precision={0}
|
||||
hideButtons
|
||||
placeholder={t('请输入整数,如 1、5、10')}
|
||||
status={customInvalid ? 'error' : undefined}
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
<div className='oc-rc-custom-field'>
|
||||
<AntInput
|
||||
value={customAmount ?? ''}
|
||||
onChange={(event) =>
|
||||
handleCustomAmountChange(event.target.value)
|
||||
}
|
||||
inputMode='numeric'
|
||||
pattern='[0-9]*'
|
||||
placeholder={t('请输入整数,如 1、5、10')}
|
||||
status={
|
||||
customAmountExceeded || customInvalid
|
||||
? 'error'
|
||||
: undefined
|
||||
}
|
||||
aria-invalid={customAmountExceeded || customInvalid}
|
||||
aria-describedby='org-recharge-custom-amount-error'
|
||||
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
|
||||
value={customUnit}
|
||||
onChange={handleCustomUnitChange}
|
||||
|
||||
@@ -782,7 +782,7 @@ const OrgSettings = ({ orgId, orgRole }) => {
|
||||
className='oc-cs-alert'
|
||||
type='error'
|
||||
showIcon
|
||||
message={t('配置加载失败,为防止误覆盖已有配置,编辑已禁用。')}
|
||||
title={t('配置加载失败,为防止误覆盖已有配置,编辑已禁用。')}
|
||||
action={
|
||||
<Button size='small' type='danger' onClick={fetchPromptCfg}>
|
||||
{t('重试')}
|
||||
|
||||
@@ -406,7 +406,7 @@ const OrgTokens = ({ orgId, orgRole }) => {
|
||||
className='oc-block-gap'
|
||||
type='info'
|
||||
showIcon
|
||||
message={t(
|
||||
title={t(
|
||||
'作为普通成员,您只能管理自己创建的密钥。管理员可管理所有密钥。',
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -637,7 +637,7 @@ const OrgAnalyticsPanel = ({
|
||||
<h2>{t('{{dim}}消费分布', { dim: dimLabel })}</h2>
|
||||
<span>{t('Top 10')}</span>
|
||||
</div>
|
||||
<AntTag bordered={false}>{t('按消费排序')}</AntTag>
|
||||
<AntTag variant='filled'>{t('按消费排序')}</AntTag>
|
||||
</div>
|
||||
{loading ? (
|
||||
<div className='oc-ea-loading'>
|
||||
|
||||
@@ -221,7 +221,7 @@ const OrgTaskRecords = () => {
|
||||
{/* 只有真实存在进行中任务时才显示,避免误导 */}
|
||||
{pageStats.pendingCount > 0 && (
|
||||
<Tag
|
||||
bordered={false}
|
||||
variant='filled'
|
||||
color='processing'
|
||||
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,
|
||||
};
|
||||
}
|
||||
@@ -112,7 +112,10 @@ export default function PartnerConsole() {
|
||||
// mt-[60px]:顶栏 fixed 定位需自行让位(跑马灯由 PageLayout 占位补偿)
|
||||
<div className='console-content'>
|
||||
{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='p-3 rounded-full bg-brand/10 text-brand'>
|
||||
<Clock size={32} />
|
||||
@@ -134,7 +137,10 @@ export default function PartnerConsole() {
|
||||
)}
|
||||
|
||||
{!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='p-3 rounded-full bg-orange-50 dark:bg-orange-900/20 text-orange-500'>
|
||||
<AlertTriangle size={32} />
|
||||
@@ -217,7 +223,7 @@ function BenefitItem({ icon, title, desc }) {
|
||||
|
||||
function ApplyCard({ t, onSubmit }) {
|
||||
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 }}>
|
||||
{t('申请成为合作伙伴')}
|
||||
</Title>
|
||||
@@ -300,7 +306,7 @@ function ApplyCard({ t, onSubmit }) {
|
||||
function StatusCard({ t, self, onRefresh, onReapply }) {
|
||||
const pending = self?.status === 'pending';
|
||||
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'>
|
||||
{pending ? (
|
||||
<div className='p-3 rounded-full bg-brand/10 text-brand'>
|
||||
|
||||
@@ -208,7 +208,7 @@ export default function Workbench({ self, dashboard }) {
|
||||
return (
|
||||
<Card
|
||||
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 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' : ''}>
|
||||
<Card
|
||||
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-1 min-w-0'>
|
||||
@@ -1136,7 +1136,7 @@ function PayoutAccount({ t, readOnly }) {
|
||||
/>
|
||||
)}
|
||||
{!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-center gap-3 min-w-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>
|
||||
)}
|
||||
{!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='p-2.5 bg-brand/10 text-brand rounded-lg'>
|
||||
<CreditCard size={22} />
|
||||
@@ -1194,7 +1194,7 @@ function PayoutAccount({ t, readOnly }) {
|
||||
</Card>
|
||||
)}
|
||||
{editing && (
|
||||
<Card className='!rounded-xl' bodyStyle={{ padding: 20 }}>
|
||||
<Card className='!rounded-xl' styles={{ body: { padding: 20 } }}>
|
||||
{/* key 随开合重挂载,避免上次输入残留;账号后端返回掩码,修改需重新完整填写 */}
|
||||
<Form key={editing ? 'open' : 'closed'} onSubmit={save}>
|
||||
{({ formState }) => (
|
||||
@@ -1364,7 +1364,7 @@ function Notices({ t, onRead, readOnly }) {
|
||||
key={n.id}
|
||||
className='!rounded-xl'
|
||||
style={{ marginBottom: 8 }}
|
||||
bodyStyle={{ padding: 12 }}
|
||||
styles={{ body: { padding: 12 } }}
|
||||
>
|
||||
<div className='flex items-center justify-between'>
|
||||
<span className='flex items-center gap-2'>
|
||||
@@ -1394,7 +1394,7 @@ function Notices({ t, onRead, readOnly }) {
|
||||
key={a.id}
|
||||
className='!rounded-xl'
|
||||
style={{ marginBottom: 8 }}
|
||||
bodyStyle={{ padding: 12 }}
|
||||
styles={{ body: { padding: 12 } }}
|
||||
>
|
||||
<div className='flex items-center justify-between'>
|
||||
<Text strong>{a.title}</Text>
|
||||
|
||||
@@ -118,7 +118,7 @@ const HistoryPanel = ({ t, refreshTrigger }) => {
|
||||
key: status,
|
||||
};
|
||||
return (
|
||||
<AntTag bordered={false} color={config.color}>
|
||||
<AntTag variant='filled' color={config.color}>
|
||||
{t(config.key)}
|
||||
</AntTag>
|
||||
);
|
||||
|
||||
@@ -175,7 +175,7 @@ const RechargePanel = ({
|
||||
<Alert
|
||||
type='info'
|
||||
showIcon
|
||||
message={t(
|
||||
title={t(
|
||||
'管理员未开启在线充值功能,请联系管理员开启或使用兑换码充值。',
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -229,9 +229,9 @@ const RechargeV2 = () => {
|
||||
<Col span={8} key={option.id}>
|
||||
<Card
|
||||
className={`amount-card ${selectedAmountOption?.id === option.id ? 'selected' : ''}`}
|
||||
bodyStyle={{ padding: 20 }}
|
||||
onClick={() => handleSelectAmount(option)}
|
||||
hoverable
|
||||
styles={{ body: { padding: 20 } }}
|
||||
>
|
||||
{option.badge && (
|
||||
<Tag color={option.badge_color || 'blue'} className='badge'>
|
||||
|
||||
@@ -700,13 +700,13 @@ const GroupMonitor = () => {
|
||||
<Modal
|
||||
open={modalVisible}
|
||||
onCancel={handleCloseModal}
|
||||
maskClosable
|
||||
afterClose={handleAfterClose}
|
||||
footer={null}
|
||||
width={950}
|
||||
title={selectedGroup?.name}
|
||||
centered
|
||||
className='group-monitor-modal'
|
||||
mask={{ closable: true }}
|
||||
>
|
||||
{selectedGroup && (
|
||||
<>
|
||||
|
||||
@@ -503,7 +503,7 @@ const GroupMonitorAdmin = () => {
|
||||
<Col xs={12} sm={6}>
|
||||
<Card
|
||||
className='overview-card'
|
||||
bodyStyle={{ padding: '20px', textAlign: 'center' }}
|
||||
styles={{ body: { padding: '20px', textAlign: 'center' } }}
|
||||
>
|
||||
<div className='text-3xl font-bold text-blue-500'>
|
||||
{overview.total_groups}
|
||||
@@ -514,7 +514,7 @@ const GroupMonitorAdmin = () => {
|
||||
<Col xs={12} sm={6}>
|
||||
<Card
|
||||
className='overview-card'
|
||||
bodyStyle={{ padding: '20px', textAlign: 'center' }}
|
||||
styles={{ body: { padding: '20px', textAlign: 'center' } }}
|
||||
>
|
||||
<div className='text-3xl font-bold text-green-500'>
|
||||
{overview.healthy_groups}
|
||||
@@ -525,7 +525,7 @@ const GroupMonitorAdmin = () => {
|
||||
<Col xs={12} sm={6}>
|
||||
<Card
|
||||
className='overview-card'
|
||||
bodyStyle={{ padding: '20px', textAlign: 'center' }}
|
||||
styles={{ body: { padding: '20px', textAlign: 'center' } }}
|
||||
>
|
||||
<div className='text-3xl font-bold text-orange-500'>
|
||||
{overview.warning_groups}
|
||||
@@ -536,7 +536,7 @@ const GroupMonitorAdmin = () => {
|
||||
<Col xs={12} sm={6}>
|
||||
<Card
|
||||
className='overview-card'
|
||||
bodyStyle={{ padding: '20px', textAlign: 'center' }}
|
||||
styles={{ body: { padding: '20px', textAlign: 'center' } }}
|
||||
>
|
||||
<div
|
||||
className='text-3xl font-bold'
|
||||
@@ -577,7 +577,10 @@ const GroupMonitorAdmin = () => {
|
||||
|
||||
return (
|
||||
<Col key={group.name} xs={24}>
|
||||
<Card className='group-admin-card' bodyStyle={{ padding: 0 }}>
|
||||
<Card
|
||||
className='group-admin-card'
|
||||
styles={{ body: { padding: 0 } }}
|
||||
>
|
||||
{/* 分组头部 */}
|
||||
<div
|
||||
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)',
|
||||
minHeight: '80px',
|
||||
}}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
shadows='hover'
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
@@ -557,8 +557,8 @@ export default function SettingsHeaderNavModules(props) {
|
||||
background: 'var(--ui-color-bg-1)',
|
||||
minHeight: '80px',
|
||||
}}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
shadows='hover'
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
@@ -635,8 +635,8 @@ export default function SettingsHeaderNavModules(props) {
|
||||
background: 'var(--ui-color-bg-1)',
|
||||
minHeight: '80px',
|
||||
}}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
shadows='hover'
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
|
||||
@@ -165,8 +165,8 @@ export default function SettingsOrgUserNavModules(props) {
|
||||
background: 'var(--ui-color-bg-1)',
|
||||
minHeight: '64px',
|
||||
}}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
shadows='hover'
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
|
||||
@@ -694,12 +694,12 @@ export default function SettingsSidebarModulesAdmin(props) {
|
||||
return (
|
||||
<Col key={module.key} xs={24} sm={12} md={8} lg={6} xl={6}>
|
||||
<Card
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
shadows='hover'
|
||||
style={{
|
||||
opacity: sectionConfig.enabled ? 1 : 0.5,
|
||||
transition: 'opacity 0.2s',
|
||||
}}
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
|
||||
@@ -870,7 +870,7 @@ function PresetGrid({
|
||||
transition: 'all 0.2s ease',
|
||||
background: 'var(--ui-color-bg-1)',
|
||||
}}
|
||||
bodyStyle={{ padding: 16 }}
|
||||
styles={{ body: { padding: 16 } }}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
|
||||
@@ -409,8 +409,8 @@ export default function SettingsSidebarModulesUser() {
|
||||
className={`!rounded-xl border border-gray-200 hover:border-blue-300 transition-all duration-200 ${
|
||||
sidebarModulesUser[section.key]?.enabled ? '' : 'opacity-50'
|
||||
}`}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
hoverable
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
<div className='flex justify-between items-center h-full'>
|
||||
<div className='flex-1 text-left'>
|
||||
|
||||
@@ -748,7 +748,7 @@ const SkillMarket = () => {
|
||||
type='info'
|
||||
showIcon
|
||||
icon={<Building2 size={15} aria-hidden='true' />}
|
||||
message={
|
||||
title={
|
||||
<span className='sm-org-context'>
|
||||
<span>
|
||||
{t('当前操作企业')}:<strong>{orgName}</strong>
|
||||
|
||||
@@ -255,7 +255,7 @@ export default function MockSkillMarket() {
|
||||
onReset={resetFilters}
|
||||
extra={
|
||||
<>
|
||||
<Tag color='processing' bordered={false}>
|
||||
<Tag color='processing' variant='filled'>
|
||||
{t('本地演示')}
|
||||
</Tag>
|
||||
<Text type='secondary'>
|
||||
@@ -275,7 +275,7 @@ export default function MockSkillMarket() {
|
||||
className='sm-notice'
|
||||
type='warning'
|
||||
showIcon
|
||||
message={t('浏览器存储不可用,修改仅在本次页面有效')}
|
||||
title={t('浏览器存储不可用,修改仅在本次页面有效')}
|
||||
/>
|
||||
) : null
|
||||
}
|
||||
@@ -302,7 +302,7 @@ export default function MockSkillMarket() {
|
||||
onOpen={() => setDetailId(skill.id)}
|
||||
badges={
|
||||
<Tag
|
||||
bordered={false}
|
||||
variant='filled'
|
||||
color={STATUS_TAG_COLOR[skill.enterprise_status]}
|
||||
>
|
||||
{statusLabel(skill.enterprise_status)}
|
||||
@@ -359,7 +359,7 @@ export default function MockSkillMarket() {
|
||||
title={t(editor?.id ? '编辑技能' : '新增技能')}
|
||||
open={Boolean(editor)}
|
||||
onClose={() => setEditor(null)}
|
||||
width={560}
|
||||
size={560}
|
||||
rootClassName='sm-form-drawer'
|
||||
footer={
|
||||
<Space>
|
||||
|
||||
@@ -96,7 +96,7 @@ export const SkillCard = ({
|
||||
<div className='sm-card-tags'>
|
||||
{badges}
|
||||
{tags.map((tag) => (
|
||||
<Tag key={tag} className='sm-tag' bordered={false}>
|
||||
<Tag key={tag} className='sm-tag' variant='filled'>
|
||||
{tagLabel(tag)}
|
||||
</Tag>
|
||||
))}
|
||||
|
||||
@@ -42,8 +42,7 @@ const SkillDetailDrawer = ({
|
||||
title={skill?.name}
|
||||
open={open}
|
||||
onClose={onClose}
|
||||
maskClosable
|
||||
width={620}
|
||||
size={620}
|
||||
rootClassName='sm-detail-drawer sm-theme'
|
||||
rootStyle={themeStyle}
|
||||
footer={
|
||||
@@ -54,6 +53,7 @@ const SkillDetailDrawer = ({
|
||||
</div>
|
||||
) : null
|
||||
}
|
||||
mask={{ closable: true }}
|
||||
>
|
||||
{skill ? (
|
||||
<>
|
||||
@@ -70,7 +70,7 @@ const SkillDetailDrawer = ({
|
||||
<h3>{t('标签')}</h3>
|
||||
<div className='sm-detail-tags'>
|
||||
{skill.tags.map((tag) => (
|
||||
<Tag key={tag} bordered={false}>
|
||||
<Tag key={tag} variant='filled'>
|
||||
{tagLabel(tag)}
|
||||
</Tag>
|
||||
))}
|
||||
@@ -93,7 +93,7 @@ const SkillDetailDrawer = ({
|
||||
<p>{t('任务描述中出现这些词时,该技能会自动生效。')}</p>
|
||||
<div className='sm-detail-tags'>
|
||||
{skill.triggers.map((item) => (
|
||||
<Tag key={item} bordered={false}>
|
||||
<Tag key={item} variant='filled'>
|
||||
{item}
|
||||
</Tag>
|
||||
))}
|
||||
|
||||
@@ -71,14 +71,16 @@ const SkillFilterSidebar = ({
|
||||
</div>
|
||||
<Select
|
||||
className='sm-tag-select'
|
||||
showSearch
|
||||
showSearch={{
|
||||
enabled: true,
|
||||
optionFilterProp: 'label',
|
||||
}}
|
||||
allowClear
|
||||
mode='multiple'
|
||||
maxTagCount={0}
|
||||
maxTagPlaceholder={() =>
|
||||
t('已选 {{count}} 个标签', { count: selectedTags.length })
|
||||
}
|
||||
optionFilterProp='label'
|
||||
aria-label={t('搜索并选择标签')}
|
||||
placeholder={t('搜索并选择标签')}
|
||||
value={selectedTags}
|
||||
|
||||
@@ -185,7 +185,7 @@ const Status = () => {
|
||||
headerStyle={{
|
||||
borderBottom: '1px solid var(--ui-color-border)',
|
||||
}}
|
||||
bodyStyle={{ padding: '20px' }}
|
||||
styles={{ body: { padding: '20px' } }}
|
||||
>
|
||||
<Row gutter={[16, 16]}>
|
||||
{group.monitors.map((item, mIndex) => (
|
||||
|
||||
@@ -420,7 +420,10 @@ const Invoice = () => {
|
||||
<TabPane tab={t('申请开票')} itemKey='apply'>
|
||||
<div className='space-y-4 mt-4'>
|
||||
{/* 可开票充值记录 */}
|
||||
<Card title={t('选择充值记录')} bodyStyle={{ padding: '12px' }}>
|
||||
<Card
|
||||
title={t('选择充值记录')}
|
||||
styles={{ body: { padding: '12px' } }}
|
||||
>
|
||||
<Table
|
||||
columns={topupColumns}
|
||||
dataSource={availableTopups}
|
||||
@@ -444,7 +447,7 @@ const Invoice = () => {
|
||||
</Card>
|
||||
|
||||
{/* 开票信息 */}
|
||||
<Card title={t('开票信息')} bodyStyle={{ padding: '16px' }}>
|
||||
<Card title={t('开票信息')} styles={{ body: { padding: '16px' } }}>
|
||||
<div className='space-y-3'>
|
||||
{/* 常用开票信息选择 */}
|
||||
{titles.length > 0 && (
|
||||
|
||||
Reference in New Issue
Block a user