Commit 979ad42e by zhaochengxiang

模型目录搜索

parent fbb9ccaf
...@@ -440,6 +440,10 @@ const ModelTree = (props) => { ...@@ -440,6 +440,10 @@ const ModelTree = (props) => {
); );
}; };
const onAutoCompleteChange = (value) => {
setSearchKeyword(value);
}
const onAutoCompleteSelect = (value, option) => { const onAutoCompleteSelect = (value, option) => {
const paths = value.split('/'); const paths = value.split('/');
setSearchKeyword(paths[paths.length-1]); setSearchKeyword(paths[paths.length-1]);
...@@ -553,6 +557,7 @@ const ModelTree = (props) => { ...@@ -553,6 +557,7 @@ const ModelTree = (props) => {
style={{ marginBottom: 10, width: '100%' }} style={{ marginBottom: 10, width: '100%' }}
onSelect={onAutoCompleteSelect} onSelect={onAutoCompleteSelect}
onSearch={onAutoCompleteSearch} onSearch={onAutoCompleteSearch}
onChange={onAutoCompleteChange}
onClear={() => { setSearchKeyword(''); }} onClear={() => { setSearchKeyword(''); }}
> >
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment