feat: 1.升级 Ant Design Ui 至 v6 2. 修复企业充值金额输入限制
This commit is contained in:
@@ -37,7 +37,7 @@ const ChannelConsumption = ({ data, title, icon, t, embedded = false }) => {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
<div className='h-[300px] flex items-center justify-center text-gray-400'>
|
||||
{t('暂无数据')}
|
||||
@@ -136,7 +136,7 @@ const ChannelConsumption = ({ data, title, icon, t, embedded = false }) => {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
bodyStyle={{ padding: '0' }}
|
||||
styles={{ body: { padding: '0' } }}
|
||||
>
|
||||
<Table
|
||||
columns={columns}
|
||||
|
||||
@@ -180,7 +180,7 @@ const DailyStatsTable = ({ data, title, icon, t, embedded = false }) => {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
bodyStyle={{ padding: '0' }}
|
||||
styles={{ body: { padding: '0' } }}
|
||||
>
|
||||
{embedded && (
|
||||
<div className='flex justify-end p-4'>
|
||||
|
||||
@@ -251,7 +251,7 @@ const HighFreqLowCostUsers = ({
|
||||
</Space>
|
||||
</div>
|
||||
}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
{/* 筛选区 */}
|
||||
<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>
|
||||
</div>
|
||||
}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
{pieSpec ? (
|
||||
<div>
|
||||
|
||||
@@ -134,7 +134,7 @@ const OverviewCards = ({ overview, loading = false, t }) => {
|
||||
<Card
|
||||
key={index}
|
||||
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-1'>
|
||||
|
||||
@@ -120,7 +120,7 @@ const TopupChannelChart = ({ data, title, icon, t }) => {
|
||||
<span className='font-semibold'>{title}</span>
|
||||
</div>
|
||||
}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
{pieSpec ? (
|
||||
<div>
|
||||
|
||||
@@ -237,7 +237,7 @@ const TrendCharts = ({ title, icon, data, type, t }) => {
|
||||
<span className='font-semibold'>{title}</span>
|
||||
</div>
|
||||
}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
{spec ? (
|
||||
<VChart
|
||||
|
||||
@@ -32,7 +32,7 @@ const UserRanking = ({ data, title, icon, t }) => {
|
||||
<span className='font-semibold'>{title}</span>
|
||||
</div>
|
||||
}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
<div className='h-[300px] flex items-center justify-center text-gray-400'>
|
||||
{t('暂无数据')}
|
||||
@@ -75,7 +75,7 @@ const UserRanking = ({ data, title, icon, t }) => {
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
<div className='space-y-2 max-h-[450px] overflow-y-auto pr-1'>
|
||||
{data.map((item, index) => (
|
||||
|
||||
@@ -300,7 +300,7 @@ const UserSurveyStats = ({ title, icon, t }) => {
|
||||
<div className={collapsed ? 'hidden' : ''}>
|
||||
<Card
|
||||
className='analytics-fold-content shadow-sm'
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
{!collapsed && (
|
||||
<Spin spinning={loading}>
|
||||
|
||||
@@ -33,7 +33,7 @@ const UserTopupRanking = ({ data, title, icon, t, embedded = false }) => {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
<div className='h-[300px] flex items-center justify-center text-gray-400'>
|
||||
{t('暂无数据')}
|
||||
@@ -137,7 +137,7 @@ const UserTopupRanking = ({ data, title, icon, t, embedded = false }) => {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
bodyStyle={{ padding: '0' }}
|
||||
styles={{ body: { padding: '0' } }}
|
||||
>
|
||||
<Table
|
||||
// 列宽合计远超窄屏视口;没有 scroll 时表格会压缩到 min-content 硬塞进去,
|
||||
|
||||
@@ -40,7 +40,7 @@ export const ReportHeader = ({ report, onExport, t }) => {
|
||||
|
||||
return (
|
||||
<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='min-w-0'>
|
||||
<div className='text-xs font-semibold tracking-wider text-brand mb-1'>
|
||||
|
||||
@@ -40,7 +40,7 @@ export const SectionCard = ({
|
||||
{extra}
|
||||
</div>
|
||||
}
|
||||
bodyStyle={{ padding: '16px', ...bodyStyle }}
|
||||
styles={{ body: { padding: '16px', ...bodyStyle } }}
|
||||
>
|
||||
{children}
|
||||
</Card>
|
||||
@@ -106,11 +106,11 @@ export const KpiCard = ({
|
||||
}) => (
|
||||
<Card
|
||||
className={`shadow-sm border-none transition-shadow ${onClick ? 'cursor-pointer hover:shadow-md' : ''}`}
|
||||
bodyStyle={{ padding: '14px 16px' }}
|
||||
onClick={onClick}
|
||||
style={{
|
||||
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'>
|
||||
<span className='truncate'>{title}</span>
|
||||
|
||||
@@ -164,7 +164,7 @@ const NewUserGiftModal = ({ visible, onClose, quota }) => {
|
||||
</div>
|
||||
|
||||
<style jsx='true'>{`
|
||||
.new-user-gift-modal .ant-modal-content {
|
||||
.new-user-gift-modal .ant-modal-container {
|
||||
border-radius: 20px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
|
||||
@@ -108,7 +108,6 @@ export function ColumnSettingsModal({
|
||||
'--cs-theme-border': token.colorBorderSecondary,
|
||||
}}
|
||||
onCancel={onCancel}
|
||||
maskClosable
|
||||
keyboard
|
||||
footer={
|
||||
<div className='table-column-settings-footer'>
|
||||
@@ -123,6 +122,7 @@ export function ColumnSettingsModal({
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
mask={{ closable: true }}
|
||||
>
|
||||
<div className='table-column-settings-all'>
|
||||
<Checkbox
|
||||
@@ -155,7 +155,7 @@ export function ColumnSettingsModal({
|
||||
className='table-column-settings-error'
|
||||
type='error'
|
||||
showIcon
|
||||
message={t('请至少保留一列')}
|
||||
title={t('请至少保留一列')}
|
||||
/>
|
||||
)}
|
||||
</Modal>
|
||||
|
||||
@@ -21,7 +21,7 @@ html.dark .table-column-settings-dialog {
|
||||
max-width: calc(100vw - 32px);
|
||||
}
|
||||
|
||||
.table-column-settings-dialog .ant-modal-content {
|
||||
.table-column-settings-dialog .ant-modal-container {
|
||||
padding: 20px 24px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ const CardPro = ({
|
||||
title={headerContent}
|
||||
footer={footerContent}
|
||||
shadows={shadows}
|
||||
bordered={bordered}
|
||||
variant={bordered === false ? 'borderless' : 'outlined'}
|
||||
style={style}
|
||||
{...props}
|
||||
>
|
||||
|
||||
@@ -656,7 +656,6 @@ const JSONEditor = ({
|
||||
<TabPane tab={t('可视化')} itemKey='visual' />
|
||||
<TabPane tab={t('手动编辑')} itemKey='manual' />
|
||||
</Tabs>
|
||||
|
||||
{template && templateLabel && (
|
||||
<Button type='tertiary' onClick={fillTemplate} size='small'>
|
||||
{templateLabel}
|
||||
@@ -667,8 +666,8 @@ const JSONEditor = ({
|
||||
headerStyle={{
|
||||
padding: 'var(--json-editor-header-padding, 12px 16px)',
|
||||
}}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
className='!rounded-2xl'
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
{/* JSON错误提示 */}
|
||||
{hasJsonError && (
|
||||
|
||||
@@ -224,6 +224,7 @@ export function ConsoleDrawer({
|
||||
rootStyle,
|
||||
footer,
|
||||
width = 560,
|
||||
size = width,
|
||||
...props
|
||||
}) {
|
||||
const themeStyle = useConsoleThemeStyle();
|
||||
@@ -231,7 +232,7 @@ export function ConsoleDrawer({
|
||||
return (
|
||||
<Drawer
|
||||
{...props}
|
||||
width={width}
|
||||
size={size}
|
||||
rootStyle={{ ...themeStyle, ...rootStyle }}
|
||||
footer={normalizeFooter(footer)}
|
||||
rootClassName={classes(
|
||||
|
||||
@@ -281,19 +281,17 @@
|
||||
min-width: 0;
|
||||
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 {
|
||||
color: var(--console-text);
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
}
|
||||
:is(.console-page, .console-overlay) .ant-alert-message {
|
||||
:is(.console-page, .console-overlay) .ant-alert-title {
|
||||
margin-bottom: 0;
|
||||
font-weight: 500;
|
||||
}
|
||||
:is(.console-page, .console-overlay)
|
||||
.ant-alert-message
|
||||
+ .ant-alert-description {
|
||||
:is(.console-page, .console-overlay) .ant-alert-title + .ant-alert-description {
|
||||
margin-top: 4px;
|
||||
}
|
||||
:is(.console-page, .console-overlay) .ant-alert-icon {
|
||||
|
||||
@@ -74,7 +74,7 @@ const AnnouncementsPanel = ({
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
bodyStyle={{ padding: 0 }}
|
||||
styles={{ body: { padding: 0 } }}
|
||||
>
|
||||
<ScrollableContainer maxHeight='24rem'>
|
||||
{announcementData.length > 0 ? (
|
||||
|
||||
@@ -45,7 +45,7 @@ const ApiInfoPanel = ({
|
||||
{t('API信息')}
|
||||
</div>
|
||||
}
|
||||
bodyStyle={{ padding: 0 }}
|
||||
styles={{ body: { padding: 0 } }}
|
||||
>
|
||||
<ScrollableContainer maxHeight='24rem'>
|
||||
{apiInfoData.length > 0 ? (
|
||||
|
||||
@@ -45,7 +45,7 @@ const FaqPanel = ({
|
||||
{t('常见问答')}
|
||||
</div>
|
||||
}
|
||||
bodyStyle={{ padding: 0 }}
|
||||
styles={{ body: { padding: 0 } }}
|
||||
>
|
||||
<ScrollableContainer maxHeight='24rem'>
|
||||
{faqData.length > 0 ? (
|
||||
|
||||
@@ -60,7 +60,7 @@ const UptimePanel = ({
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
bodyStyle={{ padding: 0 }}
|
||||
styles={{ body: { padding: 0 } }}
|
||||
>
|
||||
{/* 内容区域 */}
|
||||
<div className='relative'>
|
||||
|
||||
@@ -44,7 +44,7 @@ const UserDashboardFilterModal = ({
|
||||
onOk={handleSearchConfirm}
|
||||
okText={t('查询')}
|
||||
cancelText={t('取消')}
|
||||
maskClosable
|
||||
mask={{ closable: true }}
|
||||
>
|
||||
<Form layout='vertical' requiredMark={false}>
|
||||
<Form.Item label={t('时间范围')} htmlFor='dashboard-filter-range'>
|
||||
|
||||
@@ -135,7 +135,7 @@ const NoticeModal = ({
|
||||
if (loading) {
|
||||
return (
|
||||
<div className='nm-empty'>
|
||||
<Spin tip={t('加载中...')}>
|
||||
<Spin description={t('加载中...')}>
|
||||
<div className='nm-spin-placeholder' />
|
||||
</Spin>
|
||||
</div>
|
||||
@@ -213,7 +213,6 @@ const NoticeModal = ({
|
||||
'--nm-tab-bg': token.colorBgLayout,
|
||||
'--nm-primary': token.colorPrimary,
|
||||
}}
|
||||
maskClosable={true}
|
||||
footer={
|
||||
<div className='nm-footer'>
|
||||
<Checkbox
|
||||
@@ -230,6 +229,7 @@ const NoticeModal = ({
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
mask={{ closable: true }}
|
||||
>
|
||||
<Segmented
|
||||
block
|
||||
|
||||
@@ -203,7 +203,7 @@ const ActionButtons = ({
|
||||
|
||||
{/* Divider:原型仅在主操作与工具按钮之间保留一条竖线 */}
|
||||
{hasPrimaryActions && hasUtilityActions && (
|
||||
<Divider type='vertical' className='ui-header-actions-divider' />
|
||||
<Divider orientation='vertical' className='ui-header-actions-divider' />
|
||||
)}
|
||||
|
||||
{isActionVisible('newYear') && (
|
||||
|
||||
@@ -147,7 +147,6 @@ const UserArea = ({
|
||||
placement='bottomRight'
|
||||
open={open}
|
||||
onOpenChange={setOpen}
|
||||
overlayClassName='ui-account-dropdown'
|
||||
menu={{ items, onClick: () => setOpen(false) }}
|
||||
popupRender={(menu) => (
|
||||
<div className='ui-account-panel'>
|
||||
@@ -168,6 +167,7 @@ const UserArea = ({
|
||||
{menu}
|
||||
</div>
|
||||
)}
|
||||
classNames={{ root: 'ui-account-dropdown' }}
|
||||
>
|
||||
<AntButton
|
||||
type='text'
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
padding-bottom: 24px;
|
||||
color: var(--nm-text);
|
||||
}
|
||||
.notice-modal .ant-modal-content {
|
||||
.notice-modal .ant-modal-container {
|
||||
padding: 20px 24px;
|
||||
background: var(--nm-surface);
|
||||
border-radius: 12px;
|
||||
@@ -175,7 +175,7 @@
|
||||
.notice-modal.ant-modal {
|
||||
top: 24px;
|
||||
}
|
||||
.notice-modal .ant-modal-content {
|
||||
.notice-modal .ant-modal-container {
|
||||
padding: 20px 16px;
|
||||
}
|
||||
.nm-notice-scroll,
|
||||
|
||||
@@ -149,7 +149,7 @@ export const MembershipHistoryContent = ({ visible, t, inline = false }) => {
|
||||
const status = getMembershipStatus(membership);
|
||||
const config = STATUS_CONFIG[status] || STATUS_CONFIG.expired;
|
||||
return (
|
||||
<AntTag bordered={false} color={config.color}>
|
||||
<AntTag variant='filled' color={config.color}>
|
||||
{t(config.label)}
|
||||
</AntTag>
|
||||
);
|
||||
|
||||
@@ -396,24 +396,26 @@ const ChatArea = ({
|
||||
|
||||
<Card
|
||||
className={`h-full min-h-0 ${styleState.isExperienceMode ? 'border-none shadow-none bg-transparent' : ''}`}
|
||||
bordered={false}
|
||||
variant='borderless'
|
||||
style={{
|
||||
background: styleState.isExperienceMode ? 'transparent' : undefined,
|
||||
backgroundColor: styleState.isExperienceMode
|
||||
? 'transparent'
|
||||
: undefined,
|
||||
}}
|
||||
bodyStyle={{
|
||||
padding: 0,
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
overflow: 'hidden',
|
||||
minHeight: 0,
|
||||
background: styleState.isExperienceMode ? 'transparent' : undefined,
|
||||
backgroundColor: styleState.isExperienceMode
|
||||
? 'transparent'
|
||||
: undefined,
|
||||
styles={{
|
||||
body: {
|
||||
padding: 0,
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
overflow: 'hidden',
|
||||
minHeight: 0,
|
||||
background: styleState.isExperienceMode ? 'transparent' : undefined,
|
||||
backgroundColor: styleState.isExperienceMode
|
||||
? 'transparent'
|
||||
: undefined,
|
||||
},
|
||||
}}
|
||||
>
|
||||
{/* 聊天头部 */}
|
||||
|
||||
@@ -100,12 +100,14 @@ const DebugPanel = ({
|
||||
return (
|
||||
<Card
|
||||
className='h-full flex flex-col'
|
||||
bordered={false}
|
||||
bodyStyle={{
|
||||
padding: styleState.isMobile ? '16px' : '24px',
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
variant='borderless'
|
||||
styles={{
|
||||
body: {
|
||||
padding: styleState.isMobile ? '16px' : '24px',
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<div className='flex items-center justify-between mb-6 flex-shrink-0'>
|
||||
|
||||
@@ -617,7 +617,7 @@ const PersonalSetting = () => {
|
||||
<div className='ui-profile-meta'>
|
||||
<div className='ui-profile-name'>
|
||||
<strong>{getDisplayName()}</strong>
|
||||
<AntTag color='gold' bordered={false}>
|
||||
<AntTag color='gold' variant='filled'>
|
||||
{roleInfo.text}
|
||||
</AntTag>
|
||||
</div>
|
||||
|
||||
@@ -837,8 +837,8 @@ const NotificationSettings = ({
|
||||
? ''
|
||||
: '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'>
|
||||
|
||||
@@ -129,7 +129,7 @@ const UserInfoHeader = ({ t, userState }) => {
|
||||
<Card
|
||||
size='small'
|
||||
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-2'>
|
||||
@@ -171,7 +171,7 @@ const UserInfoHeader = ({ t, userState }) => {
|
||||
<Card
|
||||
size='small'
|
||||
className='!rounded-xl'
|
||||
bodyStyle={{ padding: '12px 16px' }}
|
||||
styles={{ body: { padding: '12px 16px' } }}
|
||||
>
|
||||
<div className='space-y-3'>
|
||||
<div className='flex items-center justify-between'>
|
||||
|
||||
@@ -173,7 +173,7 @@ const AccountBindingSection = ({
|
||||
) : null}
|
||||
</div>
|
||||
<div className='ui-settings-row-actions'>
|
||||
<AntTag bordered={false} color={bound ? 'success' : undefined}>
|
||||
<AntTag variant='filled' color={bound ? 'success' : undefined}>
|
||||
{bound ? t('已绑定') : t('未绑定')}
|
||||
</AntTag>
|
||||
<Button
|
||||
|
||||
@@ -52,7 +52,7 @@ const renderStatus = (status, record, t, showEnableDisableModal) => {
|
||||
}
|
||||
/>
|
||||
{meta && (
|
||||
<AntTag color={meta.color} bordered={false}>
|
||||
<AntTag color={meta.color} variant='filled'>
|
||||
{t(meta.label)}
|
||||
</AntTag>
|
||||
)}
|
||||
@@ -88,7 +88,7 @@ const renderKey = (text) => {
|
||||
const renderQuotaCell = (text, record, t) => {
|
||||
if (record.unlimited_quota) {
|
||||
return (
|
||||
<AntTag color='success' bordered={false}>
|
||||
<AntTag color='success' variant='filled'>
|
||||
{t('无限制')}
|
||||
</AntTag>
|
||||
);
|
||||
|
||||
@@ -211,11 +211,11 @@ const ModelTestModal = ({
|
||||
</div>
|
||||
) : null
|
||||
}
|
||||
maskClosable={!isBatchTesting}
|
||||
rootClassName='console-overlay model-test-modal'
|
||||
width={isMobile ? 'calc(100vw - 32px)' : 514.8}
|
||||
centered
|
||||
styles={{ body: { maxHeight: 'none', overflow: 'visible' } }}
|
||||
mask={{ closable: !isBatchTesting }}
|
||||
>
|
||||
{hasChannel && (
|
||||
<div className='model-test-content'>
|
||||
|
||||
@@ -239,7 +239,7 @@ const MarketCatalog = ({
|
||||
className='mm-scope-alert'
|
||||
type='warning'
|
||||
showIcon
|
||||
message={t(
|
||||
title={t(
|
||||
'以下价格已按所属企业的等级折扣展示;企业成员使用个人密钥或体验中心调用时同样按企业等级计费。',
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -138,7 +138,7 @@ const MarketModelCard = ({
|
||||
<h3 title={model.model_name}>{model.model_name}</h3>
|
||||
{model.level_locked && (
|
||||
<Tooltip title={t('当前等级无权调用此模型,升级等级后可用')}>
|
||||
<Tag icon={<Lock size={11} />} bordered={false}>
|
||||
<Tag icon={<Lock size={11} />} variant='filled'>
|
||||
{t('仅可见')}
|
||||
</Tag>
|
||||
</Tooltip>
|
||||
@@ -193,7 +193,7 @@ const MarketModelCard = ({
|
||||
'相比官方牌价的折扣,按当前计价分组实付价计算(已含您的等级折扣),仅供参考',
|
||||
)}
|
||||
>
|
||||
<Tag bordered={false}>{discountText}</Tag>
|
||||
<Tag variant='filled'>{discountText}</Tag>
|
||||
</Tooltip>
|
||||
) : (
|
||||
<span>{getBillingLabel(priceData, t)}</span>
|
||||
|
||||
@@ -187,9 +187,9 @@ const ModelMarketPage = () => {
|
||||
className='hidden'
|
||||
src={modalImageUrl}
|
||||
preview={{
|
||||
visible: isModalOpenurl,
|
||||
open: isModalOpenurl,
|
||||
src: modalImageUrl,
|
||||
onVisibleChange: (visible) => setIsModalOpenurl(visible),
|
||||
onOpenChange: (visible) => setIsModalOpenurl(visible),
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -56,8 +56,7 @@ const ModelDetailSideSheet = ({
|
||||
title={t('模型详情')}
|
||||
open={visible}
|
||||
onClose={onClose}
|
||||
maskClosable
|
||||
width={isMobile ? '100%' : 820}
|
||||
size={isMobile ? '100%' : 820}
|
||||
rootClassName='mm-detail-drawer mm-theme'
|
||||
rootStyle={themeStyle}
|
||||
footer={
|
||||
@@ -67,6 +66,7 @@ const ModelDetailSideSheet = ({
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
mask={{ closable: true }}
|
||||
>
|
||||
{!modelData ? (
|
||||
<div className='mm-detail-loading'>
|
||||
|
||||
@@ -52,7 +52,7 @@ const ModelEndpoints = ({ modelData, endpointMap = {}, t }) => {
|
||||
<strong>{type}</strong>
|
||||
{path && <code>{path}</code>}
|
||||
</div>
|
||||
{path && <Tag bordered={false}>{method}</Tag>}
|
||||
{path && <Tag variant='filled'>{method}</Tag>}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -137,7 +137,7 @@ const ModelPricingTable = ({
|
||||
'相比官方牌价的折扣,按当前计价分组实付价计算(已含您的等级折扣),仅供参考',
|
||||
)}
|
||||
>
|
||||
<Tag bordered={false}>{row.discountText}</Tag>
|
||||
<Tag variant='filled'>{row.discountText}</Tag>
|
||||
</Tooltip>
|
||||
)}
|
||||
</span>
|
||||
@@ -236,7 +236,7 @@ const ModelPricingTable = ({
|
||||
<span>{t('auto分组调用链路')}</span>
|
||||
{autoChain.map((g, idx) => (
|
||||
<React.Fragment key={g}>
|
||||
<Tag bordered={false}>{g}</Tag>
|
||||
<Tag variant='filled'>{g}</Tag>
|
||||
{idx < autoChain.length - 1 && <ChevronRight size={12} />}
|
||||
</React.Fragment>
|
||||
))}
|
||||
|
||||
@@ -272,7 +272,7 @@ const RECORD_STATUS_COLORS = {
|
||||
|
||||
const recordTagFrom = (node, color) =>
|
||||
node?.props?.label !== undefined ? (
|
||||
<AntTag bordered={false} color={color}>
|
||||
<AntTag variant='filled' color={color}>
|
||||
{node.props.label}
|
||||
</AntTag>
|
||||
) : (
|
||||
@@ -324,7 +324,7 @@ const applyTaskRecordPresentation = (columns, { COLUMN_KEYS }) =>
|
||||
className='usage-record-copy-text'
|
||||
onClick={node.props.children.props.onClick}
|
||||
>
|
||||
<AntTag bordered={false}>{text}</AntTag>
|
||||
<AntTag variant='filled'>{text}</AntTag>
|
||||
</span>
|
||||
</Tooltip>
|
||||
);
|
||||
|
||||
@@ -94,7 +94,7 @@ const TaskLogsPage = ({
|
||||
{/* 只有真实存在进行中任务时才显示,避免误导 */}
|
||||
{pageStats.pendingCount > 0 && (
|
||||
<AntTag
|
||||
bordered={false}
|
||||
variant='filled'
|
||||
color='processing'
|
||||
icon={<Clock size={12} />}
|
||||
>
|
||||
|
||||
@@ -96,8 +96,7 @@ const EditTokenDrawer = ({
|
||||
open={open}
|
||||
onClose={onCancel}
|
||||
title={isEdit ? t('编辑密钥') : t('创建密钥')}
|
||||
width={isMobile ? '100%' : 560}
|
||||
maskClosable
|
||||
size={isMobile ? '100%' : 560}
|
||||
forceRender
|
||||
rootClassName='km-edit-drawer'
|
||||
footer={
|
||||
@@ -112,6 +111,7 @@ const EditTokenDrawer = ({
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
mask={{ closable: true }}
|
||||
>
|
||||
<Spin spinning={loading}>
|
||||
<Form
|
||||
|
||||
@@ -305,7 +305,7 @@ function renderRecordTime(text) {
|
||||
function renderRecordType(type, t) {
|
||||
const config = TYPE_CONFIG[type] || TYPE_CONFIG.default;
|
||||
return (
|
||||
<AntTag bordered={false} color={RECORD_TYPE_COLORS[type]}>
|
||||
<AntTag variant='filled' color={RECORD_TYPE_COLORS[type]}>
|
||||
{t(config.label)}
|
||||
</AntTag>
|
||||
);
|
||||
@@ -324,7 +324,7 @@ function renderRecordUseTime(record, t) {
|
||||
{useTime}
|
||||
{firstTime && <em>{firstTime}</em>}
|
||||
</span>
|
||||
<AntTag bordered={false} color={record.is_stream ? 'cyan' : undefined}>
|
||||
<AntTag variant='filled' color={record.is_stream ? 'cyan' : undefined}>
|
||||
{record.is_stream ? t('流') : t('非流')}
|
||||
</AntTag>
|
||||
</span>
|
||||
@@ -409,7 +409,7 @@ const applyUsageRecordPresentation = (
|
||||
const group =
|
||||
record.group || getLogOther(record.other)?.group || '';
|
||||
return group && node?.props?.children ? (
|
||||
<AntTag bordered={false}>{group}</AntTag>
|
||||
<AntTag variant='filled'>{group}</AntTag>
|
||||
) : null;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -129,7 +129,7 @@ const PaymentConfirmModal = ({
|
||||
{renderAmount()}
|
||||
</strong>
|
||||
{hasDiscount && (
|
||||
<AntTag bordered={false} color='success'>
|
||||
<AntTag variant='filled' color='success'>
|
||||
{Math.round((1 - discountRate) * 100)}% OFF
|
||||
</AntTag>
|
||||
)}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.payment-confirm-modal .ant-modal-content {
|
||||
.payment-confirm-modal .ant-modal-container {
|
||||
border-radius: 12px;
|
||||
padding: 20px 24px;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ import { useLocation } from 'react-router-dom';
|
||||
import { useActualTheme } from '../../context/Theme';
|
||||
import { normalizeLanguage } from '../../i18n/language';
|
||||
import { colord } from 'colord';
|
||||
import './antd-v5-compat.css';
|
||||
|
||||
// 与下方 Ant Design locale 一一对应的 dayjs 语言(未覆盖语言与 Ant Design 一样回退中文)。
|
||||
const DAYJS_LOCALES = {
|
||||
@@ -57,6 +58,17 @@ const DAYJS_LOCALES = {
|
||||
const PROTOTYPE_DARK_PRIMARY = '#d1963a';
|
||||
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):等于当前主题的种子色。
|
||||
// 浅色与自定义主色时即 colorPrimary;仅默认暗色主色 #d1963a 时回到原型种子 #f2ad41,
|
||||
// 保证浅色 / 深色 / 自定义主题色三态都只由主题 token 推导,不在页面里另写颜色。
|
||||
@@ -82,6 +94,7 @@ export const prototypeTheme = (dark) => ({
|
||||
};
|
||||
},
|
||||
token: {
|
||||
...v5ShadowTokens,
|
||||
colorPrimary: dark ? PROTOTYPE_DARK_PRIMARY : '#b96508',
|
||||
colorInfo: dark ? PROTOTYPE_DARK_PRIMARY : '#b96508',
|
||||
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() {
|
||||
const { token } = theme.useToken();
|
||||
useLayoutEffect(() => {
|
||||
@@ -249,14 +269,14 @@ export default function UiThemeProvider({ children }) {
|
||||
useEffect(() => {
|
||||
ConfigProvider.config({
|
||||
holderRender: (nodes) => (
|
||||
<ConfigProvider theme={config} locale={locale}>
|
||||
<ConfigProvider {...v5ComponentDefaults} theme={config} locale={locale}>
|
||||
{nodes}
|
||||
</ConfigProvider>
|
||||
),
|
||||
});
|
||||
}, [config, locale]);
|
||||
return (
|
||||
<ConfigProvider theme={config} locale={locale}>
|
||||
<ConfigProvider {...v5ComponentDefaults} theme={config} locale={locale}>
|
||||
<App>
|
||||
<TokenBridge />
|
||||
{children}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -129,7 +129,7 @@ export const Button = forwardRef(function Button(
|
||||
danger={danger}
|
||||
size={useConsoleControlSize(size)}
|
||||
shape={circle ? 'circle' : undefined}
|
||||
iconPosition={iconPosition === 'right' ? 'end' : 'start'}
|
||||
iconPlacement={iconPosition === 'right' ? 'end' : 'start'}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@@ -193,6 +193,10 @@ export function Select({
|
||||
prefix,
|
||||
dropdownStyle,
|
||||
dropdownClassName,
|
||||
autoClearSearchValue,
|
||||
onSearch,
|
||||
searchValue,
|
||||
filterSort,
|
||||
...props
|
||||
}) {
|
||||
const canSearch =
|
||||
@@ -210,28 +214,39 @@ export function Select({
|
||||
}
|
||||
styles={{
|
||||
...props.styles,
|
||||
popup: { ...props.styles?.popup, root: dropdownStyle },
|
||||
popup: {
|
||||
...props.styles?.popup,
|
||||
root: dropdownStyle ?? props.styles?.popup?.root,
|
||||
},
|
||||
}}
|
||||
classNames={{
|
||||
...props.classNames,
|
||||
popup: { ...props.classNames?.popup, root: dropdownClassName },
|
||||
popup: {
|
||||
...props.classNames?.popup,
|
||||
root: dropdownClassName ?? props.classNames?.popup?.root,
|
||||
},
|
||||
}}
|
||||
options={optionList || options}
|
||||
allowClear={showClear ?? props.allowClear}
|
||||
showSearch={canSearch}
|
||||
filterOption={
|
||||
remote
|
||||
showSearch={{
|
||||
enabled: canSearch,
|
||||
filterOption: remote
|
||||
? false
|
||||
: typeof filter === 'function'
|
||||
? filter
|
||||
: filter === false
|
||||
? false
|
||||
: undefined
|
||||
}
|
||||
optionFilterProp='label'
|
||||
: undefined,
|
||||
optionFilterProp: 'label',
|
||||
...(typeof props.showSearch === 'object' ? props.showSearch : {}),
|
||||
...(autoClearSearchValue !== undefined ? { autoClearSearchValue } : {}),
|
||||
...(onSearch !== undefined ? { onSearch } : {}),
|
||||
...(searchValue !== undefined ? { searchValue } : {}),
|
||||
...(filterSort !== undefined ? { filterSort } : {}),
|
||||
}}
|
||||
notFoundContent={emptyContent}
|
||||
status={statusOf(validateStatus)}
|
||||
onOpenChange={onDropdownVisibleChange}
|
||||
onOpenChange={onDropdownVisibleChange ?? props.onOpenChange}
|
||||
prefix={prefix}
|
||||
popupRender={
|
||||
outerBottomSlot || innerBottomSlot
|
||||
@@ -348,7 +363,7 @@ export function Switch({
|
||||
{...props}
|
||||
checkedChildren={checkedText}
|
||||
unCheckedChildren={uncheckedText}
|
||||
size={size === 'small' ? 'small' : 'default'}
|
||||
size={size === 'small' ? 'small' : 'medium'}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -369,6 +384,8 @@ export function DatePicker({
|
||||
presets,
|
||||
size,
|
||||
inputReadOnly,
|
||||
dropdownClassName,
|
||||
dropdownStyle,
|
||||
...props
|
||||
}) {
|
||||
const range = type?.toLowerCase().includes('range');
|
||||
@@ -377,6 +394,20 @@ export function DatePicker({
|
||||
return (
|
||||
<Component
|
||||
{...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) } : {})}
|
||||
defaultValue={
|
||||
defaultValue === undefined ? undefined : convert(defaultValue)
|
||||
@@ -426,11 +457,13 @@ export function TreeSelect({
|
||||
{...props}
|
||||
treeData={treeNodes(treeData)}
|
||||
allowClear={showClear}
|
||||
showSearch={!!filterTreeNode}
|
||||
treeNodeFilterProp='title'
|
||||
filterTreeNode={
|
||||
typeof filterTreeNode === 'function' ? filterTreeNode : undefined
|
||||
}
|
||||
showSearch={{
|
||||
enabled: !!filterTreeNode,
|
||||
filterTreeNode:
|
||||
typeof filterTreeNode === 'function' ? filterTreeNode : undefined,
|
||||
treeNodeFilterProp: 'title',
|
||||
...(typeof props.showSearch === 'object' ? props.showSearch : {}),
|
||||
}}
|
||||
treeDefaultExpandAll={expandAll}
|
||||
/>
|
||||
);
|
||||
@@ -461,12 +494,19 @@ export function AutoComplete({
|
||||
renderItem,
|
||||
emptyContent,
|
||||
onEnterPress,
|
||||
onSearch,
|
||||
showSearch,
|
||||
size,
|
||||
...props
|
||||
}) {
|
||||
return (
|
||||
<AntAutoComplete
|
||||
{...props}
|
||||
showSearch={
|
||||
onSearch
|
||||
? { ...(typeof showSearch === 'object' ? showSearch : {}), onSearch }
|
||||
: showSearch
|
||||
}
|
||||
options={data?.map((item) =>
|
||||
typeof item === 'string' ? { value: item } : item,
|
||||
)}
|
||||
|
||||
+55
-23
@@ -27,7 +27,7 @@ import {
|
||||
paginationEvents,
|
||||
paginationShowTotal,
|
||||
} from './pagination';
|
||||
import { overlayMaskClosable } from './overlayPolicy';
|
||||
import { overlayMask } from './overlayPolicy';
|
||||
import './pagination.css';
|
||||
import { useIsMobile } from '../../hooks/common/useIsMobile';
|
||||
import { useConsolePage } from '../console/ConsoleContext';
|
||||
@@ -132,7 +132,7 @@ export const Card = forwardRef(function Card(
|
||||
variant={
|
||||
props.variant ?? (bordered === false ? 'borderless' : 'outlined')
|
||||
}
|
||||
size={size === 'small' ? 'small' : 'default'}
|
||||
size={size === 'small' ? 'small' : 'medium'}
|
||||
title={
|
||||
props.title ??
|
||||
header?.title ??
|
||||
@@ -141,7 +141,7 @@ export const Card = forwardRef(function Card(
|
||||
: undefined)
|
||||
}
|
||||
extra={headerExtraContent ?? header?.extra}
|
||||
styles={{ header: headerStyle, body: bodyStyle }}
|
||||
styles={{ header: headerStyle, body: bodyStyle, ...props.styles }}
|
||||
>
|
||||
{props.children}
|
||||
{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 }) => (
|
||||
<Ant.Space
|
||||
{...props}
|
||||
direction={vertical ? 'vertical' : 'horizontal'}
|
||||
orientation={vertical ? 'vertical' : 'horizontal'}
|
||||
size={spacing === 'medium' ? 'middle' : (spacing ?? size)}
|
||||
/>
|
||||
);
|
||||
export const Divider = ({ margin, align, layout, style, ...props }) => (
|
||||
<Ant.Divider
|
||||
{...props}
|
||||
orientation={align}
|
||||
type={layout === 'vertical' ? 'vertical' : 'horizontal'}
|
||||
titlePlacement={align}
|
||||
orientation={layout === 'vertical' ? 'vertical' : 'horizontal'}
|
||||
style={{ margin, ...style }}
|
||||
/>
|
||||
);
|
||||
@@ -174,6 +174,7 @@ export const Tag = forwardRef(function Tag(
|
||||
prefix,
|
||||
children,
|
||||
color,
|
||||
bordered,
|
||||
...props
|
||||
},
|
||||
ref,
|
||||
@@ -182,6 +183,7 @@ export const Tag = forwardRef(function Tag(
|
||||
<Ant.Tag
|
||||
{...props}
|
||||
ref={ref}
|
||||
variant={props.variant ?? (bordered === false ? 'filled' : 'outlined')}
|
||||
color={
|
||||
['white', 'grey', 'light-blue', 'light-green'].includes(color)
|
||||
? {
|
||||
@@ -231,6 +233,8 @@ export const Spin = ({
|
||||
style,
|
||||
className,
|
||||
'data-testid': testId,
|
||||
tip,
|
||||
wrapperClassName,
|
||||
...props
|
||||
}) =>
|
||||
children ? (
|
||||
@@ -239,14 +243,20 @@ export const Spin = ({
|
||||
className={`ui-spin-shell ${className || ''}`}
|
||||
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>
|
||||
</Ant.Spin>
|
||||
</div>
|
||||
) : (
|
||||
<Ant.Spin
|
||||
{...props}
|
||||
size={controlSize(size)}
|
||||
size={size === 'default' ? 'medium' : size}
|
||||
description={tip ?? props.description}
|
||||
style={style}
|
||||
className={className}
|
||||
data-testid={testId}
|
||||
@@ -556,8 +566,8 @@ export const Timeline = Object.assign(
|
||||
.filter(React.isValidElement)
|
||||
.map((child) => ({
|
||||
color: child.props.type === 'ongoing' ? 'blue' : undefined,
|
||||
label: child.props.time,
|
||||
children: (
|
||||
title: child.props.time,
|
||||
content: (
|
||||
<>
|
||||
{child.props.children}
|
||||
{child.props.extra}
|
||||
@@ -634,7 +644,7 @@ export const Banner = ({
|
||||
return (
|
||||
<Component
|
||||
{...props}
|
||||
message={title}
|
||||
title={title}
|
||||
type={type === 'danger' ? 'error' : type}
|
||||
showIcon
|
||||
closable={!!closeIcon}
|
||||
@@ -642,9 +652,9 @@ export const Banner = ({
|
||||
/>
|
||||
);
|
||||
};
|
||||
export const Alert = (props) => {
|
||||
export const Alert = ({ message, ...props }) => {
|
||||
const Component = useConsolePage() ? ConsoleAlert : Ant.Alert;
|
||||
return <Component {...props} />;
|
||||
return <Component {...props} title={props.title ?? message} />;
|
||||
};
|
||||
|
||||
function modalProps({
|
||||
@@ -659,20 +669,23 @@ function modalProps({
|
||||
type,
|
||||
bodyStyle,
|
||||
maskStyle,
|
||||
mask,
|
||||
maskClosable,
|
||||
destroyOnClose,
|
||||
...props
|
||||
}) {
|
||||
return {
|
||||
...props,
|
||||
maskClosable: overlayMaskClosable(props.maskClosable),
|
||||
mask: overlayMask(mask, maskClosable),
|
||||
open: visible,
|
||||
title: header === null ? null : (props.title ?? header),
|
||||
keyboard: closeOnEsc,
|
||||
forceRender: lazyRender === false,
|
||||
destroyOnHidden: keepDOM === false || destroyOnClose,
|
||||
destroyOnHidden:
|
||||
keepDOM === false || destroyOnClose || props.destroyOnHidden,
|
||||
width: size === 'full-width' ? '100%' : props.width,
|
||||
okButtonProps: { danger: okType === 'danger', ...props.okButtonProps },
|
||||
styles: { body: bodyStyle, mask: maskStyle },
|
||||
styles: { body: bodyStyle, mask: maskStyle, ...props.styles },
|
||||
};
|
||||
}
|
||||
export const Modal = Object.assign(
|
||||
@@ -702,18 +715,31 @@ export const SideSheet = ({
|
||||
headerStyle,
|
||||
maskStyle,
|
||||
destroyOnClose,
|
||||
mask,
|
||||
maskClosable,
|
||||
width,
|
||||
height,
|
||||
...props
|
||||
}) => {
|
||||
const Component = useConsolePage() ? ConsoleDrawer : Ant.Drawer;
|
||||
return (
|
||||
<Component
|
||||
{...props}
|
||||
maskClosable={overlayMaskClosable(props.maskClosable)}
|
||||
mask={overlayMask(mask, maskClosable)}
|
||||
size={
|
||||
props.size ??
|
||||
(['top', 'bottom'].includes(props.placement) ? height : width)
|
||||
}
|
||||
open={visible}
|
||||
onClose={onCancel}
|
||||
keyboard={closeOnEsc}
|
||||
destroyOnHidden={destroyOnClose}
|
||||
styles={{ body: bodyStyle, header: headerStyle, mask: maskStyle }}
|
||||
destroyOnHidden={destroyOnClose ?? props.destroyOnHidden}
|
||||
styles={{
|
||||
body: bodyStyle,
|
||||
header: headerStyle,
|
||||
mask: maskStyle,
|
||||
...props.styles,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -727,7 +753,12 @@ export const ImagePreview = ({
|
||||
}) => (
|
||||
<Ant.Image.PreviewGroup
|
||||
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(
|
||||
['success', 'info', 'warning', 'error', 'open'].map((method) => [
|
||||
method,
|
||||
(config) =>
|
||||
({ title, message, content, description, btn, actions, ...config }) =>
|
||||
Ant.notification[method]({
|
||||
...config,
|
||||
message: config.title ?? config.message,
|
||||
description: config.content ?? config.description,
|
||||
title: title ?? message,
|
||||
description: content ?? description,
|
||||
actions: actions ?? btn,
|
||||
}),
|
||||
]),
|
||||
);
|
||||
|
||||
@@ -32,3 +32,16 @@ export function overlayMaskClosable(
|
||||
pathname.startsWith('/user-center/');
|
||||
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),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user