peng.peng 1 year ago
parent
commit
631e6cd6ae
  1. 14
      super-screen/client/src/sections/water-prevention/components/right-top.js
  2. 14
      super-screen/client/src/sections/water-prevention/components/style.less

14
super-screen/client/src/sections/water-prevention/components/right-top.js

@ -1,6 +1,7 @@
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import { Box, AutoRollComponent } from '$components'; import { Box, AutoRollComponent } from '$components';
import { Tooltip } from 'antd'; import { Tooltip } from 'antd';
import moment from 'moment';
import './style.less'; import './style.less';
function CitySafty(props) { function CitySafty(props) {
@ -12,7 +13,7 @@ function CitySafty(props) {
<div className={`_rank_item1`}> <div className={`_rank_item1`}>
<Tooltip placement="topLeft" title={s.name}>{s.name}</Tooltip> <Tooltip placement="topLeft" title={s.name}>{s.name}</Tooltip>
</div> </div>
<div className='_rank_item2'>{s.currentTime}</div> <div className='_rank_item2'>{s.currentTime ? moment(s.currentTime).format('HH:mm:ss') : '--'}</div>
<div className='_rank_item3'>{s.waterLevel}{s.waterLevel && <div className={s.waterLevel - s.lastWaterLevel > 0 ? '_upicon' : '_downicon'} />}</div> <div className='_rank_item3'>{s.waterLevel}{s.waterLevel && <div className={s.waterLevel - s.lastWaterLevel > 0 ? '_upicon' : '_downicon'} />}</div>
<div className='_rank_item4'> <div className='_rank_item4'>
<div className={s.futureState === '正常' ? 'normalbg' : 'warningbg'} > <div className={s.futureState === '正常' ? 'normalbg' : 'warningbg'} >
@ -24,7 +25,16 @@ function CitySafty(props) {
</div> </div>
} }
return <Box title={"水位趋势预测图"} > const renderDate = () => {
let renderTime = ''
const time = trendData?.find(t => t.currentTime)?.currentTime
if (time) {
renderTime = moment(time).format('YYYY-MM-DD')
}
return <div>{renderTime}</div>
}
return <Box title={"水位趋势预测图"} subtitleSelect={renderDate()} >
<div className='water_traffic_ranking'> <div className='water_traffic_ranking'>
<div className='_rank_title'> <div className='_rank_title'>
<div className='_rank_item1'>点位名称</div> <div className='_rank_item1'>点位名称</div>

14
super-screen/client/src/sections/water-prevention/components/style.less

@ -407,22 +407,22 @@
._rank_item1 { ._rank_item1 {
text-align: center; text-align: center;
width: 25%; width: 35%;
} }
._rank_item2 { ._rank_item2 {
text-align: center; text-align: center;
width: 20%; width: 15%;
} }
._rank_item3 { ._rank_item3 {
text-align: right; text-align: center;
width: 25%; width: 20%;
} }
._rank_item4 { ._rank_item4 {
text-align: center; text-align: center;
width: 35%; width: 30%;
} }
} }
@ -445,7 +445,7 @@
._rank_item1 { ._rank_item1 {
text-align: center; text-align: center;
width: 20%; width: 35%;
margin-left: 5px; margin-left: 5px;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
@ -454,7 +454,7 @@
._rank_item2 { ._rank_item2 {
// text-align: center; // text-align: center;
width: 35%; width: 20%;
} }
._rank_item3 { ._rank_item3 {

Loading…
Cancel
Save