feat(ui): enhance tag input

1. EditModelModal quality-of-life
   • Added comma parsing to `Form.TagInput`; users can now paste
     `tag1, tag2 , tag3` to bulk-create tags.
   • Updated placeholder copy to reflect the new capability.

All files pass linting; no runtime changes outside the intended UI updates.
This commit is contained in:
t0ng7u
2025-08-01 03:00:12 +08:00
parent 508799c452
commit 9730b9ba2d

View File

@@ -285,10 +285,19 @@ const EditModelModal = (props) => {
<Form.TagInput
field='tags'
label={t('标签')}
placeholder={t('输入标签后按回车添加')}
placeholder={t('输入标签或使用","分隔多个标签')}
addOnBlur
showClear
style={{ width: '100%' }}
onChange={(newTags) => {
if (!formApiRef.current) return;
const normalize = (tags) => {
if (!Array.isArray(tags)) return [];
return [...new Set(tags.flatMap(tag => tag.split(',').map(t => t.trim()).filter(Boolean)))];
};
const normalized = normalize(newTags);
formApiRef.current.setValue('tags', normalized);
}}
/>
</Col>
</Row>