F web fix bug

pull/22/head
雷二猛 2019-12-02 23:22:18 +08:00
parent 3fa411e072
commit 1ccfdf2db7
1 changed files with 11 additions and 7 deletions

View File

@ -21,15 +21,19 @@ class ComTable extends React.Component {
componentDidMount() { componentDidMount() {
store.fetchRecords(); store.fetchRecords();
if (hostStore.records.length === 0) { if (hostStore.records.length === 0) {
hostStore.fetchRecords().then(() => { hostStore.fetchRecords().then(this._handleHosts)
} else {
this._handleHosts()
}
}
_handleHosts = () => {
const tmp = {}; const tmp = {};
for (let item of hostStore.records) { for (let item of hostStore.records) {
tmp[item.id] = item tmp[item.id] = item
} }
this.setState({hosts: tmp}) this.setState({hosts: tmp})
}) };
}
}
columns = [{ columns = [{
title: '序号', title: '序号',