mirror of https://github.com/openspug/spug
F web fix bug
parent
fc73cd1d65
commit
da58ebab4a
|
@ -16,19 +16,24 @@ 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)
|
||||||
const tmp = {};
|
} else {
|
||||||
for (let item of contactStore.records) {
|
this._handleContacts()
|
||||||
tmp[item.id] = item
|
|
||||||
}
|
|
||||||
this.setState({contactMap: tmp})
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_handleContacts = () => {
|
||||||
|
const tmp = {};
|
||||||
|
for (let item of contactStore.records) {
|
||||||
|
tmp[item.id] = item
|
||||||
|
}
|
||||||
|
this.setState({contactMap: tmp})
|
||||||
|
};
|
||||||
|
|
||||||
columns = [{
|
columns = [{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
key: 'series',
|
key: 'series',
|
||||||
|
|
Loading…
Reference in New Issue