feat: 在新增&编辑渠道时添加点击模型复制名称功能

(cherry picked from commit c4935f392fbffc080359e82b7aa9cca91f009639)
This commit is contained in:
AAEE86
2025-08-24 01:09:08 +08:00
parent 808f5c481e
commit da516af837
3 changed files with 31 additions and 2 deletions

View File

@@ -1485,6 +1485,31 @@ const EditChannelModal = (props) => {
optionList={modelOptions}
style={{ width: '100%' }}
onChange={(value) => handleInputChange('models', value)}
renderSelectedItem={(optionNode) => {
const modelName = String(optionNode?.value ?? '');
return {
isRenderInTag: true,
content: (
<span
className="cursor-pointer select-none"
role="button"
tabIndex={0}
title={t('点击复制模型名称')}
onClick={async (e) => {
e.stopPropagation();
const ok = await copy(modelName);
if (ok) {
showSuccess(t('已复制:{{name}}', { name: modelName }));
} else {
showError(t('复制失败'));
}
}}
>
{optionNode.label || modelName}
</span>
),
};
}}
extraText={(
<Space wrap>
<Button size='small' type='primary' onClick={() => handleInputChange('models', basicModels)}>