ソースを参照

✨ 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.
t0ng7u 7 ヶ月 前
コミット
9730b9ba2d
1 ファイル変更10 行追加1 行削除
  1. 10 1
      web/src/components/table/models/modals/EditModelModal.jsx

+ 10 - 1
web/src/components/table/models/modals/EditModelModal.jsx

@@ -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>