style: multiple selection tag

This commit is contained in:
jialin
2025-06-26 20:39:07 +08:00
parent c68d85096b
commit e2d79a6802
9 changed files with 93 additions and 35 deletions
@@ -209,12 +209,6 @@ const MessageInput: React.FC<MessageInputProps> = forwardRef(
const handleClearAll = (e: any) => {
e.stopPropagation();
clearAll();
// handleInputChange({ target: { value: '' } });
// setMessage({
// role: Roles.User,
// content: '',
// imgs: []
// });
};
const handleAddMessage = (e?: any) => {
@@ -114,11 +114,15 @@ const ModelItem: React.FC<ModelItemProps> = forwardRef((props, ref) => {
handleDeleteModel(instanceId);
};
const generateValidMessage = (message: Omit<MessageItem, 'uid'>) => {
if (!message.content && !message.imgs?.length && !message.audio?.length) {
return undefined;
}
return message;
};
const handleSubmit = (currentMessage: Omit<MessageItem, 'uid'>) => {
const currentMsg =
currentMessage.content || currentMessage.imgs?.length
? currentMessage
: undefined;
const currentMsg = generateValidMessage(currentMessage);
submitMessage({
system: systemMessage
@@ -289,11 +293,11 @@ const ModelItem: React.FC<ModelItemProps> = forwardRef((props, ref) => {
</Dropdown>
<Popover
autoAdjustOverflow={true}
overlayInnerStyle={{ width: 384, paddingInline: 0 }}
overlayInnerStyle={{ width: 375, paddingInline: 0 }}
content={
<OverlayScroller
maxHeight={500}
style={{ paddingInline: '16px' }}
style={{ paddingInline: '24px' }}
oppositeTheme={true}
>
<DynamicParams
@@ -302,21 +306,25 @@ const ModelItem: React.FC<ModelItemProps> = forwardRef((props, ref) => {
paramsConfig={paramsConfig}
initialValues={initialValues}
showModelSelector={false}
parametersTitle={
<div className="flex-center flex-between">
<span>
{intl.formatMessage({ id: 'playground.parameters' })}
</span>
<Checkbox onChange={handleApplyToAllModels}>
{intl.formatMessage({
id: 'playground.compare.applytoall'
})}
</Checkbox>
</div>
}
/>
</OverlayScroller>
}
trigger={['click']}
arrow={false}
fresh={true}
title={
<div style={{ paddingInline: '16px' }}>
<Checkbox onChange={handleApplyToAllModels}>
{intl.formatMessage({
id: 'playground.compare.applytoall'
})}
</Checkbox>
</div>
}
title={false}
>
<Button
type="text"