F web fix bug

pull/22/head
雷二猛 2019-12-06 13:05:44 +08:00
parent fc73cd1d65
commit da58ebab4a
1 changed files with 12 additions and 7 deletions

View File

@ -16,18 +16,23 @@ class ComTable extends React.Component {
contactMap: {} contactMap: {}
} }
} }
componentDidMount() { componentDidMount() {
store.fetchRecords(); store.fetchRecords();
if (contactStore.records.length === 0) { if (contactStore.records.length === 0) {
contactStore.fetchRecords().then(() => { contactStore.fetchRecords().then(this._handleContacts)
} else {
this._handleContacts()
}
}
_handleContacts = () => {
const tmp = {}; const tmp = {};
for (let item of contactStore.records) { for (let item of contactStore.records) {
tmp[item.id] = item tmp[item.id] = item
} }
this.setState({contactMap: tmp}) this.setState({contactMap: tmp})
}) };
}
}
columns = [{ columns = [{
title: '序号', title: '序号',