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:
qiubaishen
2026-11-10 12:48:02 +08:00
parent e3b82b981a
commit d46926f334
30 changed files with 201 additions and 180 deletions
+44 -49
View File
@@ -35,7 +35,7 @@ import {
Skeleton,
TextArea,
Tooltip,
} from '@douyinfe/semi-ui';
} from '@/components/ui';
import {
AlertCircle,
ArrowLeft,
@@ -161,10 +161,6 @@ const getStorage = () => {
}
};
// 弹层内点击 Select 下拉等其他 portal 时不关闭弹层
const isInsideOtherPortal = (e) =>
Boolean(e?.target?.closest?.('.semi-portal, .semi-select-option-list'));
/** 估价文案:"预计 ¥x · 约 N 秒 · 失败自动退还";估价失败 → "价格以实际扣费为准"。 */
export const quoteText = (
t,
@@ -275,15 +271,14 @@ const DockPopover = ({
}
return (
<Popover
visible={open}
trigger='custom'
open={open}
trigger='click'
position='topLeft'
showArrow={false}
onClickOutSide={(e) => {
if (!isInsideOtherPortal(e)) onClose();
onOpenChange={(next) => {
if (!next) onClose();
}}
onEscKeyDown={onClose}
contentClassName={`cs-popover ${className}`}
classNames={{ body: `cs-popover ${className}` }}
content={
open ? (
<div className='cs-pop-body' role='dialog' aria-label={title}>
@@ -1122,28 +1117,25 @@ const CreationDock = ({ form, compare = null }) => {
<Dropdown
trigger='click'
position='topLeft'
clickToHide
render={
<Dropdown.Menu>
{modeOptions.map((o) => (
<Dropdown.Item
key={o.mode}
active={mode === o.mode}
disabled={o.disabled}
onClick={() => {
if (!o.disabled) setMode(o.mode);
}}
>
<span className='cs-mode-item'>
<span>{t(modeLabels[o.mode] || o.mode)}</span>
{o.disabled && o.reason ? (
<span className='cs-mode-reason'>{t(o.reason)}</span>
) : null}
</span>
</Dropdown.Item>
))}
</Dropdown.Menu>
}
menu={{
selectable: true,
selectedKeys: [mode],
items: modeOptions.map((o) => ({
key: o.mode,
disabled: o.disabled,
onClick: () => {
if (!o.disabled) setMode(o.mode);
},
label: (
<span className='cs-mode-item'>
<span>{t(modeLabels[o.mode] || o.mode)}</span>
{o.disabled && o.reason ? (
<span className='cs-mode-reason'>{t(o.reason)}</span>
) : null}
</span>
),
})),
}}
>
<button
type='button'
@@ -1463,24 +1455,27 @@ const CreationDock = ({ form, compare = null }) => {
<Dropdown
trigger='click'
position='topRight'
render={
<Dropdown.Menu>
<Dropdown.Title>{t('最近使用的提示词')}</Dropdown.Title>
{promptHistory.map((item) => (
<Dropdown.Item
key={item}
onClick={() => {
menu={{
items: [
{
type: 'group',
key: 'prompt-history',
label: t('最近使用的提示词'),
children: promptHistory.map((item) => ({
key: item,
label: (
<span className='cs-history-item' title={item}>
{item}
</span>
),
onClick: () => {
setPrompt(item);
requestAnimationFrame(focusPrompt);
}}
>
<span className='cs-history-item' title={item}>
{item}
</span>
</Dropdown.Item>
))}
</Dropdown.Menu>
}
},
})),
},
],
}}
>
<button
type='button'