fix: new config add tag

This commit is contained in:
LoadChange 2020-03-08 22:55:45 +08:00
parent 842818f4f0
commit 59c19c442f
2 changed files with 16 additions and 6 deletions

View File

@ -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) {
if (value.length > 5) {
value.pop();
@ -155,6 +162,7 @@ class NewConfig extends React.Component {
}
});
this.setState({
tagLst: value,
config_tags: value,
});
}
@ -497,6 +505,7 @@ class NewConfig extends React.Component {
>
<Select
size={'medium'}
showSearch
hasArrow
style={{ width: '100%', height: '100%!important' }}
autoWidth
@ -507,6 +516,7 @@ class NewConfig extends React.Component {
dataSource={this.state.tagLst}
value={this.state.config_tags}
onChange={this.setConfigTags.bind(this)}
onSearch={val => this.tagSearch(val)}
hasClear
/>
</FormItem>

File diff suppressed because one or more lines are too long