refactor(ui): 将合并引入的 Semi 组件迁移到 Ant Design 适配层
- 创作台、WeyAi 设置、OrgResolver 共 23 个文件改从 @/components/ui 引入 - Popover 改用 open/trigger='click'/onOpenChange,移除 .semi-portal 判定 - Dropdown.Title / Item active 改为 menu group / selectedKeys - Slider tooltip.formatter、Checkbox.Group、TagInput maxCount、DatePicker 取 Date 参数 - --semi-color-* 改为 --ui-color-*,遮罩色用 antd 默认,.semi-* 选择器改为 .ant-* - docs/UI_MIGRATION.md 记录组件映射、视觉差异与风险
This commit is contained in:
@@ -27,7 +27,7 @@ import {
|
||||
HelpCircle,
|
||||
Home,
|
||||
} from 'lucide-react';
|
||||
import { Button } from '@douyinfe/semi-ui';
|
||||
import { Button } from '@/components/ui';
|
||||
import { API } from '../../helpers/api';
|
||||
import { UserContext } from '../../context/User';
|
||||
import Loading from '../../components/common/ui/Loading';
|
||||
|
||||
@@ -36,7 +36,7 @@ import {
|
||||
Tag,
|
||||
TagInput,
|
||||
Typography,
|
||||
} from '@douyinfe/semi-ui';
|
||||
} from '@/components/ui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { API, showError, showSuccess } from '../../../helpers';
|
||||
import SettingsWeyAiContentEditor from './SettingsWeyAiContentEditor';
|
||||
|
||||
@@ -25,7 +25,7 @@ import React, { useEffect, useState } from 'react';
|
||||
import {
|
||||
Banner,
|
||||
Button,
|
||||
CheckboxGroup,
|
||||
Checkbox,
|
||||
DatePicker,
|
||||
Input,
|
||||
InputNumber,
|
||||
@@ -40,7 +40,7 @@ import {
|
||||
TextArea,
|
||||
Typography,
|
||||
Upload,
|
||||
} from '@douyinfe/semi-ui';
|
||||
} from '@/components/ui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { API, showError, showSuccess } from '../../../helpers';
|
||||
import { formatBytes, uploadContentFile } from './contentUpload';
|
||||
@@ -116,7 +116,7 @@ const FieldControl = ({ field, value, onChange, t }) => {
|
||||
value={value || []}
|
||||
onChange={(list) => onChange(list.length ? list : undefined)}
|
||||
maxLength={field.max_len || undefined}
|
||||
max={field.max_items || undefined}
|
||||
maxCount={field.max_items || undefined}
|
||||
placeholder={t('回车添加')}
|
||||
/>
|
||||
);
|
||||
@@ -366,7 +366,7 @@ const SettingsWeyAiContentEditor = ({
|
||||
key={role.key}
|
||||
className='mb-4 p-3'
|
||||
style={{
|
||||
border: '1px solid var(--semi-color-border)',
|
||||
border: '1px solid var(--ui-color-border)',
|
||||
borderRadius: 8,
|
||||
}}
|
||||
>
|
||||
@@ -448,8 +448,7 @@ const SettingsWeyAiContentEditor = ({
|
||||
{t('适用端')}
|
||||
<Text type='danger'> *</Text>
|
||||
</Text>
|
||||
<CheckboxGroup
|
||||
direction='horizontal'
|
||||
<Checkbox.Group
|
||||
value={form.platforms}
|
||||
onChange={(v) => set('platforms', v)}
|
||||
options={slot.platforms.map((p) => ({ value: p, label: p }))}
|
||||
@@ -481,7 +480,7 @@ const SettingsWeyAiContentEditor = ({
|
||||
<DatePicker
|
||||
type='dateTime'
|
||||
value={toDate(form.start_at)}
|
||||
onChange={(d) => set('start_at', toSec(d))}
|
||||
onChange={(_, d) => set('start_at', toSec(d))}
|
||||
placeholder={t('不限')}
|
||||
/>
|
||||
</div>
|
||||
@@ -490,7 +489,7 @@ const SettingsWeyAiContentEditor = ({
|
||||
<DatePicker
|
||||
type='dateTime'
|
||||
value={toDate(form.end_at)}
|
||||
onChange={(d) => set('end_at', toSec(d))}
|
||||
onChange={(_, d) => set('end_at', toSec(d))}
|
||||
placeholder={t('不限')}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -33,7 +33,7 @@ import {
|
||||
Spin,
|
||||
Switch,
|
||||
Typography,
|
||||
} from '@douyinfe/semi-ui';
|
||||
} from '@/components/ui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { API, showError, showSuccess } from '../../../helpers';
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ import {
|
||||
Tag,
|
||||
TextArea,
|
||||
Typography,
|
||||
} from '@douyinfe/semi-ui';
|
||||
} from '@/components/ui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { API, showError, showSuccess } from '../../../helpers';
|
||||
import MarkdownRenderer from '../../../components/common/markdown/MarkdownRenderer';
|
||||
@@ -299,7 +299,7 @@ const SettingsWeyAiReleaseNotes = () => {
|
||||
? new Date(draft.released_at * 1000)
|
||||
: undefined
|
||||
}
|
||||
onChange={(date) =>
|
||||
onChange={(_, date) =>
|
||||
setDraft({
|
||||
...draft,
|
||||
// Local noon: the same calendar day in every time zone within ±12 h.
|
||||
@@ -340,7 +340,7 @@ const SettingsWeyAiReleaseNotes = () => {
|
||||
className='mt-2 p-3 rounded'
|
||||
style={{
|
||||
minHeight: 200,
|
||||
border: '1px solid var(--semi-color-border)',
|
||||
border: '1px solid var(--ui-color-border)',
|
||||
}}
|
||||
>
|
||||
{draft.content.trim() ? (
|
||||
|
||||
Reference in New Issue
Block a user