|
|
@@ -164,12 +164,14 @@ class TableModel extends React.Component {
|
|
|
}
|
|
|
|
|
|
this.dataArr = result;
|
|
|
+ console.log(this.dataArr);
|
|
|
this.dataIndex = 0;
|
|
|
}
|
|
|
|
|
|
setRefresh() {
|
|
|
this.changeData();
|
|
|
if (this.dataArr.length > 1) {
|
|
|
+ console.log('setRefresh');
|
|
|
this.timing({
|
|
|
intervalFunction: function () {
|
|
|
this.changeData();
|
|
|
@@ -194,6 +196,7 @@ class TableModel extends React.Component {
|
|
|
clearInterval() {
|
|
|
for (let index in this.timerKeys) {
|
|
|
clearInterval(this.timerKeys[index]);
|
|
|
+ console.log('移除' + this.timerKeys[index]);
|
|
|
this.timerKeys.splice(index, 1);
|
|
|
}
|
|
|
}
|
|
|
@@ -210,11 +213,13 @@ class TableModel extends React.Component {
|
|
|
this.clearInterval();
|
|
|
}
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
- if (isEqual(this.sortData(nextProps.data), this.newProps.data)) {
|
|
|
- this.newProps = nextProps;
|
|
|
+ if (isEqual(nextProps.data, this.newProps.data)) {
|
|
|
return;
|
|
|
}
|
|
|
+ this.newProps = nextProps;
|
|
|
this.clearInterval();
|
|
|
+ this.initSort();
|
|
|
+ this.sortData(this.newProps.data);
|
|
|
this.splitData();
|
|
|
this.setRefresh();
|
|
|
}
|