|
|
@@ -1,89 +0,0 @@ |
|
|
|
|
|
|
|
import React, { useEffect, useState, useRef } from 'react' |
|
|
|
|
|
|
|
import icon1 from '@/assets/CenterChart2icon1.svg' |
|
|
|
import icon2 from '@/assets/CenterChart2icon2.svg' |
|
|
|
import icon3 from '@/assets/CenterChart2icon3.svg' |
|
|
|
import icon4 from '@/assets/CenterChart2icon4.svg' |
|
|
|
|
|
|
|
|
|
|
|
import './Chart2.less' |
|
|
|
|
|
|
|
|
|
|
|
const Chart2 = () => { |
|
|
|
|
|
|
|
const timmer = useRef(); |
|
|
|
const [year, setYear] = useState('') |
|
|
|
const [month, setMonth] = useState('') |
|
|
|
const [day, setDay] = useState('') |
|
|
|
|
|
|
|
|
|
|
|
const getNewDate = () => { |
|
|
|
const Time = new Date(); |
|
|
|
const year = Time.getFullYear(); |
|
|
|
const month = Time.getMonth() + 1; |
|
|
|
const day = Time.getDate(); |
|
|
|
|
|
|
|
|
|
|
|
setYear(year); |
|
|
|
setMonth(month); |
|
|
|
setDay(day); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
getNewDate(); |
|
|
|
timmer.current = setInterval(getNewDate, 10000); |
|
|
|
return () => { |
|
|
|
clearTimeout(timmer.current) |
|
|
|
} |
|
|
|
//eslint-disable-next-line |
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
<div className='CenterChart2itemDetailBorder'> |
|
|
|
|
|
|
|
<div className='CenterChart2itemcontentOUT'> |
|
|
|
<div className='CenterChart2itemcontent'> |
|
|
|
<img src={icon4} alt="Error" className='CenterChart2itemcontentIcon' /> |
|
|
|
<div className='CenterChart2itemcontentText' > |
|
|
|
<h2 className='CenterChart2itemcontentText1'>车间温度</h2> |
|
|
|
<h2 className='CenterChart2itemcontentText2'> 27℃</h2> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className='CenterChart2itemcontent'> |
|
|
|
<img src={icon2} alt="Error" className='CenterChart2itemcontentIcon' /> |
|
|
|
<div className='CenterChart2itemcontentText' > |
|
|
|
<h2 className='CenterChart2itemcontentText1'>当前火向</h2> |
|
|
|
<h2 className='CenterChart2itemcontentText2'> XXX</h2> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className='CenterChart2itemcontentOUT'> |
|
|
|
<div className='CenterChart2itemcontent'> |
|
|
|
<img src={icon1} alt="Error" className='CenterChart2itemcontentIcon' /> |
|
|
|
<div className='CenterChart2itemcontentText' > |
|
|
|
<h2 className='CenterChart2itemcontentText1'>换火时间</h2> |
|
|
|
<h2 className='CenterChart2itemcontentText2'> 12:41:45</h2> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className='CenterChart2itemcontent'> |
|
|
|
<img src={icon3} alt="Error" className='CenterChart2itemcontentIcon' /> |
|
|
|
<div className='CenterChart2itemcontentText' > |
|
|
|
<h2 className='CenterChart2itemcontentText1'>剩余时间</h2> |
|
|
|
<h2 className='CenterChart2itemcontentText2'> 20h</h2> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</div > |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
export default Chart2; |