Merge pull request #1624 from KeRan213539/#1583_bug_fix

#1583 bug fix
This commit is contained in:
Fury Zhu 2019-09-19 16:57:05 +08:00 committed by GitHub
commit caba884069
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,6 +100,10 @@ class ConfigurationManagement extends React.Component {
contentList: [],
isAdvancedQuery: false,
isCheckAll: false,
rowSelection: {
onChange: this.configDataTableOnChange.bind(this),
selectedRowKeys: [],
},
};
const obj = {
dataId: this.dataId || '',
@ -250,6 +254,10 @@ class ConfigurationManagement extends React.Component {
});
}
this.getData();
configsTableSelected.clear();
const { rowSelection } = this.state;
rowSelection.selectedRowKeys = [];
this.setState({ rowSelection });
}
getData(pageNo = 1, clearSelect = true) {
@ -1070,22 +1078,14 @@ class ConfigurationManagement extends React.Component {
});
}
configsTableOnSelect(selected, record, records) {
if (selected) {
configsTableSelected.set(record.id, record);
} else {
configsTableSelected.delete(record.id);
}
}
configsTableOnSelectAll(selected, records) {
if (selected) {
records.forEach((record, i) => {
configsTableSelected.set(record.id, record);
});
} else {
configsTableSelected.clear();
}
configDataTableOnChange(ids, records) {
const { rowSelection } = this.state;
rowSelection.selectedRowKeys = ids;
this.setState({ rowSelection });
configsTableSelected.clear();
ids.forEach((id, i) => {
configsTableSelected.set(id, id);
});
}
render() {
@ -1285,10 +1285,7 @@ class ConfigurationManagement extends React.Component {
fixedHeader
maxBodyHeight={400}
ref={'dataTable'}
rowSelection={{
onSelect: this.configsTableOnSelect,
onSelectAll: this.configsTableOnSelectAll,
}}
rowSelection={this.state.rowSelection}
>
<Table.Column title={'Data Id'} dataIndex={'dataId'} />
<Table.Column title={'Group'} dataIndex={'group'} />