Commit 0604ed7a authored by xinglei's avatar xinglei

增加首页websocket刷新

parent 4c395eb2
...@@ -88,16 +88,19 @@ class SafetyIndexWeek extends Component { ...@@ -88,16 +88,19 @@ class SafetyIndexWeek extends Component {
super(props); super(props);
this.state = { this.state = {
data: {} data: {}
}; };
} }
componentDidMount() { componentDidMount() {
this.safetyIndexWeekData();
}
safetyIndexWeekData = () => {
safetyIndexWeekAction().then(data => { safetyIndexWeekAction().then(data => {
this.setState({ this.setState({
data: data data
}) });
}) });
} }
getOptionsx = (map) => { getOptionsx = (map) => {
......
...@@ -64,20 +64,21 @@ class StatisticsCheck extends Component { ...@@ -64,20 +64,21 @@ class StatisticsCheck extends Component {
super(props); super(props);
this.state = { this.state = {
data: [] data: []
}; };
} }
componentDidMount() { componentDidMount() {
this.statisticsCheckData();
}
statisticsCheckData = () => {
statisticsCheckAction().then(data => { statisticsCheckAction().then(data => {
this.setState({ this.setState({
data: data data
}) });
}) });
} }
getOptionsx = (data) => { getOptionsx = (data) => {
return { return {
tooltip: { tooltip: {
......
...@@ -13,18 +13,19 @@ class StatisticsDuty extends Component { ...@@ -13,18 +13,19 @@ class StatisticsDuty extends Component {
super(props); super(props);
this.state = { this.state = {
data: {} data: {}
}; };
} }
componentDidMount() { componentDidMount() {
this.statisticsDutyData();
}
statisticsDutyData = () => {
statisticsDutyAction().then(data => { statisticsDutyAction().then(data => {
this.setState({ this.setState({
data: data data
}) });
}) });
} }
render() { render() {
......
...@@ -38,11 +38,14 @@ export default class Statistical extends Component { ...@@ -38,11 +38,14 @@ export default class Statistical extends Component {
break; break;
case 'week_safety_index': case 'week_safety_index':
console.log('一周安全指数趋势刷新~~~~~~~~~~~~~~~~~~~~'); console.log('一周安全指数趋势刷新~~~~~~~~~~~~~~~~~~~~');
this.safetyIndexWeek.safetyIndexWeekData();
break; break;
case 'today_check_status': case 'today_check_status':
console.log('今日巡检情况刷新~~~~~~~~~~~~~~~~~~~~'); console.log('今日巡检情况刷新~~~~~~~~~~~~~~~~~~~~');
this.statisticsCheck.statisticsCheckData();
break; break;
case 'today_duty': case 'today_duty':
this.statisticsDuty.statisticsDutyData();
console.log('今日值班刷新~~~~~~~~~~~~~~~~~~~~'); console.log('今日值班刷新~~~~~~~~~~~~~~~~~~~~');
break; break;
case 'all': case 'all':
...@@ -50,6 +53,9 @@ export default class Statistical extends Component { ...@@ -50,6 +53,9 @@ export default class Statistical extends Component {
this.safetyIndex.getSafetyIndex(); this.safetyIndex.getSafetyIndex();
this.safetyExecute.safetyExecuteList(); this.safetyExecute.safetyExecuteList();
this.equipStatus.equipStatusList(); this.equipStatus.equipStatusList();
this.safetyIndexWeek.safetyIndexWeekData();
this.statisticsCheck.statisticsCheckData();
this.statisticsDuty.statisticsDutyData();
break; break;
default: default:
console.log(refreshType,':类型不支持'); console.log(refreshType,':类型不支持');
...@@ -68,9 +74,9 @@ export default class Statistical extends Component { ...@@ -68,9 +74,9 @@ export default class Statistical extends Component {
<EquipStatusList ref={node => this.equipStatus = node} /> <EquipStatusList ref={node => this.equipStatus = node} />
</div> </div>
<div className="statistical-right"> <div className="statistical-right">
<SafetyIndexWeek /> <SafetyIndexWeek ref={node => this.safetyIndexWeek = node} />
<StatisticsCheck /> <StatisticsCheck ref={node => this.statisticsCheck = node} />
<StatisticsDuty /> <StatisticsDuty ref={node => this.statisticsDuty = node} />
</div> </div>
</div> </div>
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment