diff --git a/super-screen/client/src/sections/water-prevention/components/emergency-left-bottom.js b/super-screen/client/src/sections/water-prevention/components/emergency-left-bottom.js index a177073..1f0b274 100644 --- a/super-screen/client/src/sections/water-prevention/components/emergency-left-bottom.js +++ b/super-screen/client/src/sections/water-prevention/components/emergency-left-bottom.js @@ -1,28 +1,30 @@ import React from 'react' -import { Box } from '$components'; +import { Box, AutoRollComponent } from '$components'; import { Tooltip } from 'antd'; function Infrastructure(props) { const { waterLevelAlarms } = props; - return -
- { - // alarm_unhandle FF2C2C alarm_handle FFEA00 - waterLevelAlarms.map(a =>
= 3 ? 'alarm_handle' : 'alarm_unhandle'}> -
-
-
- -
{a.alarms[0]?.source?.name}
-
-
= 3 ? '#FFEA00' : '#FF2C2C' }}>{convertLevelToLabel(a.alarms[0]?.level)}
-
-
{a.alarms[0]?.content}
+ const renderList = () =>
+ { + // alarm_unhandle FF2C2C alarm_handle FFEA00 + waterLevelAlarms.map(a =>
= 3 ? 'alarm_handle' : 'alarm_unhandle'}> +
+
+
+ +
{a.alarms[0]?.source?.name}
+
+
= 3 ? '#FFEA00' : '#FF2C2C' }}>{convertLevelToLabel(a.alarms[0]?.level)}
-
) - } -
+
{a.alarms[0]?.content}
+
+
) + } +
+ + return + {waterLevelAlarms?.length > 0 ? : '暂无数据 等UI出图'} } diff --git a/super-screen/client/src/sections/water-prevention/containers/gis.js b/super-screen/client/src/sections/water-prevention/containers/gis.js index 8e54688..1c7baee 100644 --- a/super-screen/client/src/sections/water-prevention/containers/gis.js +++ b/super-screen/client/src/sections/water-prevention/containers/gis.js @@ -1,6 +1,7 @@ import React, { useEffect, useState } from 'react'; import { connect } from 'react-redux'; import { render } from 'react-dom'; +import { Tooltip } from 'antd'; import { data as heatmapData } from './data' import { SHUI_ZHAN } from '../constants/water'; import './gis.less' @@ -340,21 +341,36 @@ function Map(props) { } const renderLeftTop = () => { + let hCount = 0, mCount = 0, lCount = 0; + for (const a of waterLevelAlarms) { + switch (a.alarms[0].level) { + case 1: + hCount += 1 + break; + case 2: + mCount += 1 + break; + case 3: + lCount += 1 + break; + default: + break; + } + } return
- {[{ name: '高风险区域', key: 'high', data: 3 }, - { name: '中风险区域', key: 'middle', data: 13 }, - { name: '低风险区域', key: 'low', data: 13 }].map(s => { + {[{ name: '高风险区域', key: 'high', data: hCount }, + { name: '中风险区域', key: 'middle', data: mCount }, + { name: '低风险区域', key: 'low', data: lCount }].map(s => { return
{s.name}
-
{s.data}/21
+
{s.data}/{trendData.length}
})} -
} @@ -392,16 +408,18 @@ function Map(props) {
} - const renderWaterwarningbg = () => { + const renderWaterwarningbg = (alarm) => { return
-
城区沿江水涝
未启动
-
[自然灾害事故]
+
{alarm.structureName}
+
未启动
+
+
[{alarm.alarms[0]?.content}]
-
2023-02-12 16:42:34
+
{alarm.alarms[0]?.startTime}
- 6月11日上午11点左右,低洼堤坝出现江水倒灌灾,需要进行救援。6月11日上午11点左右,低洼堤坝出现江水倒灌灾,需要进行救援。 + {alarm.alarms[0]?.details?.content}
@@ -580,7 +598,7 @@ function Map(props) { {/* 左上角图例 */} {tab == 'overview' && renderLeftTop()} - {tab == 'emergency' && renderWaterwarningbg()} + {tab == 'emergency' && waterLevelAlarms.length && renderWaterwarningbg(waterLevelAlarms[0])} {renderRightBottom()} {/* 四周遮罩 */}
diff --git a/super-screen/client/src/sections/water-prevention/containers/gis.less b/super-screen/client/src/sections/water-prevention/containers/gis.less index 3204be9..6567cf2 100644 --- a/super-screen/client/src/sections/water-prevention/containers/gis.less +++ b/super-screen/client/src/sections/water-prevention/containers/gis.less @@ -534,6 +534,14 @@ color: #FFF; text-align: center; + ._name { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + width: 140px; + display: inline-block; + } + ._state { color: #D1C800; background: rgba(255, 247, 0, 0.2);