|
|
@ -1,49 +1,114 @@ |
|
|
|
import React from 'react' |
|
|
|
import { Box, AutoRollComponent } from '$components'; |
|
|
|
import { Box, NoData } from '$components'; |
|
|
|
import ReactEcharts from 'echarts-for-react'; |
|
|
|
import moment from 'moment'; |
|
|
|
|
|
|
|
function Infrastructure(props) { |
|
|
|
const { fireTrend } = props; |
|
|
|
let Ydata = fireTrend.map(t => t.count); |
|
|
|
let Xdata = fireTrend.map(t => moment(t.time).format('MM月DD日')); |
|
|
|
|
|
|
|
const getContent = () => { |
|
|
|
return <div className='today_real_alarm'> |
|
|
|
<div className='today_item'> |
|
|
|
<div className='column1_alarm1'>14:22</div> |
|
|
|
<div className='text_blue'><div className='_icon1' />红花岗区大队</div> |
|
|
|
<div className='text_blue'><div className='_icon2' />划龙桥路77号</div> |
|
|
|
</div> |
|
|
|
<div className='today_item'> |
|
|
|
<div className='column1_alarm2'>14:22</div> |
|
|
|
<div className='text_blue'><div className='_icon1' />红花岗区大队</div> |
|
|
|
<div className='text_blue'><div className='_icon2' />划龙桥路77号</div> |
|
|
|
</div> |
|
|
|
<div className='today_item'> |
|
|
|
<div className='column1_alarm1'>14:22</div> |
|
|
|
<div className='text_blue'><div className='_icon1' />红花岗区大队</div> |
|
|
|
<div className='text_blue'><div className='_icon2' />划龙桥路77号</div> |
|
|
|
</div> |
|
|
|
<div className='today_item'> |
|
|
|
<div className='column1_alarm2'>14:22</div> |
|
|
|
<div className='text_blue'><div className='_icon1' />红花岗区大队</div> |
|
|
|
<div className='text_blue'><div className='_icon2' />划龙桥路77号</div> |
|
|
|
</div> |
|
|
|
<div className='today_item'> |
|
|
|
<div className='column1_alarm2'>14:22</div> |
|
|
|
<div className='text_blue'><div className='_icon1' />红花岗区大队</div> |
|
|
|
<div className='text_blue'><div className='_icon2' />划龙桥路77号</div> |
|
|
|
</div> |
|
|
|
<div className='today_item'> |
|
|
|
<div className='column1_alarm2'>14:22</div> |
|
|
|
<div className='text_blue'><div className='_icon1' />红花岗区大队</div> |
|
|
|
<div className='text_blue'><div className='_icon2' />划龙桥路77号</div> |
|
|
|
</div> |
|
|
|
<div className='today_item'> |
|
|
|
<div className='column1_alarm2'>14:22</div> |
|
|
|
<div className='text_blue'><div className='_icon1' />红花岗区大队</div> |
|
|
|
<div className='text_blue'><div className='_icon2' />划龙桥路77号</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
} |
|
|
|
return <Box title={"今日实时警情"} > |
|
|
|
<AutoRollComponent canScroll={true} content={getContent()} divHeight={250} divId={`fire-left-bottom`} /> |
|
|
|
const option = { |
|
|
|
tooltip: { |
|
|
|
trigger: "axis", |
|
|
|
axisPointer: { |
|
|
|
type: "shadow", |
|
|
|
}, |
|
|
|
backgroundColor: "rgba(255,255,255,0.75)", |
|
|
|
extraCssText: "box-shadow: 2px 2px 4px 0px rgba(0,0,0,0.3);", |
|
|
|
textStyle: { |
|
|
|
fontSize: 14, |
|
|
|
color: "#000", |
|
|
|
}, |
|
|
|
formatter: (params) => { |
|
|
|
const item = params[0]; |
|
|
|
return item.name + " : " + item.value + " 次"; |
|
|
|
}, |
|
|
|
}, |
|
|
|
legend: { |
|
|
|
top: 10, |
|
|
|
itemWidth: 20, |
|
|
|
itemHeight: 10, |
|
|
|
left: "center", |
|
|
|
padding: 0, |
|
|
|
textStyle: { |
|
|
|
color: "#E6E6E7", |
|
|
|
fontSize: 14, |
|
|
|
padding: [2, 0, 0, 0], |
|
|
|
}, |
|
|
|
}, |
|
|
|
xAxis: [ |
|
|
|
{ |
|
|
|
type: "category", |
|
|
|
axisLabel: { |
|
|
|
interval: 0, |
|
|
|
color: "rgba(195, 230, 255, 1)", |
|
|
|
fontSize: 10, |
|
|
|
}, |
|
|
|
axisLine: { |
|
|
|
show: true, |
|
|
|
lineStyle: { |
|
|
|
type: 'solid', |
|
|
|
color: "rgba(184, 185, 188, 0.5)", |
|
|
|
width: 1, |
|
|
|
}, |
|
|
|
}, |
|
|
|
data: Xdata, |
|
|
|
}, |
|
|
|
], |
|
|
|
yAxis: [ |
|
|
|
{ |
|
|
|
splitNumber: 5, // 刻度段数
|
|
|
|
type: "value", |
|
|
|
nameTextStyle: { |
|
|
|
color: "rgba(195, 230, 255, 1)", |
|
|
|
fontWeight: 400, |
|
|
|
fontSize: 14, |
|
|
|
padding: [-20, 20, 0, 0] |
|
|
|
}, |
|
|
|
splitLine: { |
|
|
|
show: true, |
|
|
|
lineStyle: { |
|
|
|
type: 'dashed', |
|
|
|
color: 'rgba(89, 153, 200, 0.5)' |
|
|
|
} |
|
|
|
}, |
|
|
|
axisLabel: { |
|
|
|
show: true, |
|
|
|
fontSize: 12, |
|
|
|
color: "rgba(195, 230, 255, 1)", |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
series: [ |
|
|
|
{ |
|
|
|
type: "line", |
|
|
|
symbol: "none", |
|
|
|
barWidth: 16, |
|
|
|
label: { |
|
|
|
show: false, |
|
|
|
position: "top", |
|
|
|
color: "#00A8FF", |
|
|
|
}, |
|
|
|
data: Ydata, |
|
|
|
}, |
|
|
|
], |
|
|
|
grid: { |
|
|
|
x: 50, |
|
|
|
y: 25, |
|
|
|
x2: 30, |
|
|
|
y2: 20 |
|
|
|
}, |
|
|
|
}; |
|
|
|
return <Box title={"火情趋势"} > |
|
|
|
{ |
|
|
|
fireTrend.length ? <ReactEcharts |
|
|
|
option={option} |
|
|
|
notMerge |
|
|
|
lazyUpdate |
|
|
|
style={{ height: 231, width: 423 }} |
|
|
|
/> : <NoData height={231} /> |
|
|
|
} |
|
|
|
</Box> |
|
|
|
} |
|
|
|
|
|
|
|