mirror of https://github.com/openspug/spug
F web fix bug
parent
3fa411e072
commit
1ccfdf2db7
|
@ -21,16 +21,20 @@ 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)
|
||||||
const tmp = {};
|
} else {
|
||||||
for (let item of hostStore.records) {
|
this._handleHosts()
|
||||||
tmp[item.id] = item
|
|
||||||
}
|
|
||||||
this.setState({hosts: tmp})
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_handleHosts = () => {
|
||||||
|
const tmp = {};
|
||||||
|
for (let item of hostStore.records) {
|
||||||
|
tmp[item.id] = item
|
||||||
|
}
|
||||||
|
this.setState({hosts: tmp})
|
||||||
|
};
|
||||||
|
|
||||||
columns = [{
|
columns = [{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
key: 'series',
|
key: 'series',
|
||||||
|
|
Loading…
Reference in New Issue