Merge pull request #2433 from loadchange/bugfix/20200308
fix: new config add tag
This commit is contained in:
commit
994da9cbeb
@ -145,6 +145,13 @@ class NewConfig extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tagSearch(value) {
|
||||||
|
const { tagLst } = this.state;
|
||||||
|
if (!tagLst.includes(value)) {
|
||||||
|
this.setState({ tagLst: [value, ...tagLst] });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setConfigTags(value) {
|
setConfigTags(value) {
|
||||||
if (value.length > 5) {
|
if (value.length > 5) {
|
||||||
value.pop();
|
value.pop();
|
||||||
@ -155,6 +162,7 @@ class NewConfig extends React.Component {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.setState({
|
this.setState({
|
||||||
|
tagLst: value,
|
||||||
config_tags: value,
|
config_tags: value,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -497,6 +505,7 @@ class NewConfig extends React.Component {
|
|||||||
>
|
>
|
||||||
<Select
|
<Select
|
||||||
size={'medium'}
|
size={'medium'}
|
||||||
|
showSearch
|
||||||
hasArrow
|
hasArrow
|
||||||
style={{ width: '100%', height: '100%!important' }}
|
style={{ width: '100%', height: '100%!important' }}
|
||||||
autoWidth
|
autoWidth
|
||||||
@ -507,6 +516,7 @@ class NewConfig extends React.Component {
|
|||||||
dataSource={this.state.tagLst}
|
dataSource={this.state.tagLst}
|
||||||
value={this.state.config_tags}
|
value={this.state.config_tags}
|
||||||
onChange={this.setConfigTags.bind(this)}
|
onChange={this.setConfigTags.bind(this)}
|
||||||
|
onSearch={val => this.tagSearch(val)}
|
||||||
hasClear
|
hasClear
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user