Commit 886fc20b authored by 李成龙's avatar 李成龙

代码优化

parent ba83440e
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import AmosEcharts from 'amos-viz/lib/echarts';
import AmosWebSocket from 'amos-websocket';
import { Connect } from 'amos-framework';
// import { getRiskRiseUprateAction } from './../../../../services/situationService';
// import SysWsURL, { completeToken } from './../../../../consts/wsUrlConsts';
const eventConnect = Connect.eventConnect;
/**
* 巡检点统计
......@@ -68,12 +61,12 @@ class RiskDegreePie extends Component {
type: 'pie',
radius: ['60%', '70%'],
avoidLabelOverlap: false,
color:['#FE0000','#5FFFFD'],
color: ['#FE0000', '#5FFFFD'],
label: {
normal: {
show: true,
color: 'white',
fontSize:25,
fontSize: 25,
position: 'center',
formatter: '{b}'
}
......@@ -83,9 +76,9 @@ class RiskDegreePie extends Component {
show: false
}
},
data:[
{value: 125, name: null},
{value: 810, name: '2%'},
data: [
{ value: 125, name: null },
{ value: 810, name: '2%' }
]
}
]
......@@ -117,12 +110,12 @@ class RiskDegreePie extends Component {
type: 'pie',
radius: ['60%', '70%'],
avoidLabelOverlap: false,
color:['#FE6600','#5FFFFD'],
color: ['#FE6600', '#5FFFFD'],
label: {
normal: {
show: true,
color: 'white',
fontSize:25,
fontSize: 25,
position: 'center',
formatter: '{b}'
}
......@@ -132,9 +125,9 @@ class RiskDegreePie extends Component {
show: false
}
},
data:[
{value: 125, name: null},
{value: 810, name: '2%'},
data: [
{ value: 125, name: null },
{ value: 810, name: '2%' }
]
}
]
......@@ -165,13 +158,13 @@ class RiskDegreePie extends Component {
name: '风险率',
type: 'pie',
radius: ['60%', '70%'],
color:['#FFD600','#5FFFFD'],
color: ['#FFD600', '#5FFFFD'],
avoidLabelOverlap: false,
label: {
normal: {
show: true,
color: 'white',
fontSize:25,
fontSize: 25,
position: 'center',
formatter: '{b}'
}
......@@ -181,9 +174,9 @@ class RiskDegreePie extends Component {
show: false
}
},
data:[
{value: 125, name: null},
{value: 810, name: '2%'},
data: [
{ value: 125, name: null },
{ value: 810, name: '2%' }
]
}
]
......@@ -192,7 +185,7 @@ class RiskDegreePie extends Component {
handleData = () => {
this.getRiskRiseUprate();
}
};
render() {
let { monthData, seasonData, yearData } = this.state;
......@@ -201,31 +194,31 @@ class RiskDegreePie extends Component {
let seasonOption = this.getSeasonOptions('season', seasonData);
let yearOption = this.getYearOptions('year', yearData);
return (
<div className="risk-degree-pie-child" style={{color:'#5FFFFD',textAlign:'center'}}>
<div className="risk-degree-pie-child" style={{ color: '#5FFFFD', textAlign: 'center' }}>
<div className="risk-degree-pie1">
<AmosEcharts option={monthOption} style={{ height: '210px', width: '210px' }}/>
<AmosEcharts option={monthOption} style={{ height: '210px', width: '210px' }} />
<div>
<div style={{fontSize:34,fontWeight:'bold',display:'inline-block'}}>{monthData.countOfType0} </div>
<div style={{fontSize:22,color:'red',fontWeight:'bold',display:'inline-block',marginLeft:10}}>{monthData.type0Rate}</div>
<div style={{ fontSize: 34, fontWeight: 'bold', display: 'inline-block' }}>{monthData.countOfType0} </div>
<div style={{ fontSize: 22, color: 'red', fontWeight: 'bold', display: 'inline-block', marginLeft: 10 }}>{monthData.type0Rate}</div>
</div>
<div style={{fontSize:22,color:'#CEC700'}}>本月风险</div>
<div style={{ fontSize: 22, color: '#CEC700' }}>本月风险</div>
</div>
<div className="risk-degree-pie2">
<AmosEcharts option={seasonOption} style={{ height: '210px', width: '210px' }}/>
<AmosEcharts option={seasonOption} style={{ height: '210px', width: '210px' }} />
<div>
<div style={{fontSize:34,fontWeight:'bold',display:'inline-block'}}>{monthData.countOfType0} </div>
<div style={{fontSize:22,fontWeight:'bold',color:'red',display:'inline-block',marginLeft:10}}>{monthData.type0Rate}</div>
<div style={{ fontSize: 34, fontWeight: 'bold', display: 'inline-block' }}>{monthData.countOfType0} </div>
<div style={{ fontSize: 22, fontWeight: 'bold', color: 'red', display: 'inline-block', marginLeft: 10 }}>{monthData.type0Rate}</div>
</div>
<div style={{fontSize:22,color:'#CEC700'}}>本季度风险</div>
<div style={{ fontSize: 22, color: '#CEC700' }}>本季度风险</div>
</div>
<div className="risk-degree-pie3">
<AmosEcharts option={yearOption} style={{ height: '210px', width: '210px' }}/>
<AmosEcharts option={yearOption} style={{ height: '210px', width: '210px' }} />
<div>
<div style={{fontSize:34,fontWeight:'bold',display:'inline-block'}}>{monthData.countOfType0} </div>
<div style={{fontSize:22,color:'red',fontWeight:'bold',display:'inline-block',marginLeft:10}}>{monthData.type0Rate}</div>
<div style={{ fontSize: 34, fontWeight: 'bold', display: 'inline-block' }}>{monthData.countOfType0} </div>
<div style={{ fontSize: 22, color: 'red', fontWeight: 'bold', display: 'inline-block', marginLeft: 10 }}>{monthData.type0Rate}</div>
</div>
<div style={{fontSize:22,color:'#CEC700'}}>本年风险</div>
<div style={{ fontSize: 22, color: '#CEC700' }}>本年风险</div>
</div>
</div>
);
......
This diff is collapsed.
......@@ -36,7 +36,7 @@ const provienceData = [
{ name: '新疆', area: '其他', type: 'areaCenterCity', InValue: '0' }
];
const geoCoordMap = {
const geoCoordMap = {
黑龙江: [126.6433411, 45.74149323],
吉林: [125.3154297, 43.89256287],
辽宁: [123.4116821, 41.7966156],
......@@ -268,6 +268,7 @@ const provienceData = [
菏泽: [115.480656, 35.23375],
合肥: [117.27, 31.86],
武汉: [114.31, 30.52],
大庆: [125.03, 46.58] };
大庆: [125.03, 46.58]
};
export { provienceData, geoCoordMap }
export { provienceData, geoCoordMap };
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