From 8b311649e4df84a7ad51bcc19fb1a012fcde9219 Mon Sep 17 00:00:00 2001 From: "peng.peng" Date: Thu, 24 Aug 2023 12:48:38 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=B6=88=E9=98=B2=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/infrastructure.js | 14 ++---- .../community-safty/containers/homePage.js | 4 +- .../fire-control/components/alarm-add.js | 7 ++- .../sections/fire-control/constants/index.js | 4 +- .../sections/fire-control/containers/gis.js | 47 ++++++++++--------- .../fire-control/containers/homePage.js | 8 ++-- .../water-prevention/containers/homePage.js | 2 +- 7 files changed, 42 insertions(+), 44 deletions(-) diff --git a/super-screen/client/src/sections/community-safty/components/infrastructure.js b/super-screen/client/src/sections/community-safty/components/infrastructure.js index 2f2ed07..0d4626f 100644 --- a/super-screen/client/src/sections/community-safty/components/infrastructure.js +++ b/super-screen/client/src/sections/community-safty/components/infrastructure.js @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react' +import React from 'react' import { Box, NoData } from '$components'; import { useMockRequest, ApiTable } from '$utils'; @@ -7,14 +7,10 @@ function Infrastructure(props) { url: 'https://superchangnan.anxinyun.cn/api/xiaofang/devices', method: 'mockGet', }); - - let datas = [] - useEffect(() => { - devices?.map(s => { - s.data = JSON.parse(s.data) - return s; - }) - }, [devices]) + const datas = devices?.map(s => { + if (typeof (s.data) == 'string') s.data = JSON.parse(s.data) + return s; + }) const data = [ { name: '烟感设备', number: datas?.find(s => s.type == 3)?.data?.length || 0 }, diff --git a/super-screen/client/src/sections/community-safty/containers/homePage.js b/super-screen/client/src/sections/community-safty/containers/homePage.js index 4142f6a..51cfb70 100644 --- a/super-screen/client/src/sections/community-safty/containers/homePage.js +++ b/super-screen/client/src/sections/community-safty/containers/homePage.js @@ -60,9 +60,7 @@ function homePage(props) {
- 社区安全 -
- 流动人口 + 房屋租赁安全
{ dispatch(push('/homepage')) }} className='_exit' >返回平台
diff --git a/super-screen/client/src/sections/fire-control/components/alarm-add.js b/super-screen/client/src/sections/fire-control/components/alarm-add.js index b2bf6dd..18d6225 100644 --- a/super-screen/client/src/sections/fire-control/components/alarm-add.js +++ b/super-screen/client/src/sections/fire-control/components/alarm-add.js @@ -57,7 +57,12 @@ function FireAddForm(props) { : '请选择事件地点'}
- { + form.setFieldValue('typeParam', null) + form.setFieldValue('scene', null) + }} + placeholder="请选择警情类型"> {eventType_Data.map(s => )} diff --git a/super-screen/client/src/sections/fire-control/constants/index.js b/super-screen/client/src/sections/fire-control/constants/index.js index bf2e9ef..7701767 100644 --- a/super-screen/client/src/sections/fire-control/constants/index.js +++ b/super-screen/client/src/sections/fire-control/constants/index.js @@ -1,7 +1,7 @@ const typeParam_data = { '火灾扑救': { name: '着火物质', - options: ['固体物质', '液体或可熔物质', '气体', '带电物体和精密仪器等物质', '烹饪器具内的烹饪物',] + options: ['固体物质', '液体或可熔物质', '金属', '气体', '带电物体和精密仪器等物质', '烹饪器具内的烹饪物',] }, '救援抢险': { name: '事件类型', @@ -10,7 +10,7 @@ const typeParam_data = { }, '自然灾害': { name: '灾害类型', - options: ['水旱', '气象', '地质灾害', '等自然灾害', '森林、草原火灾'] + options: ['水旱', '气象', '地质灾害', '森林、草原火灾'] }, '灾难事故': { name: '事故类型', diff --git a/super-screen/client/src/sections/fire-control/containers/gis.js b/super-screen/client/src/sections/fire-control/containers/gis.js index 1c9809a..1393ba8 100644 --- a/super-screen/client/src/sections/fire-control/containers/gis.js +++ b/super-screen/client/src/sections/fire-control/containers/gis.js @@ -17,8 +17,8 @@ const tabs = [ { name: '应急避难场所', tab: 'yjbns', className: 'emergency_button' }, ] -function Map (props) { - const { dispatch, actions, emergencyList, propTab,setLongitudeLatitude } = props; +function Map(props) { + const { dispatch, actions, emergencyList, propTab, setLongitudeLatitude } = props; const [delay, setDelay] = useState(true) const [tab, setTab] = useState('xfyjwz') const [visible, setVisible] = useState(false) @@ -231,7 +231,7 @@ function Map (props) { // driving.clear() //清除路线 } - function drawRoute (route) { + function drawRoute(route) { var path = parseRouteToPath(route) var routeLine = new AMap.Polyline({ @@ -256,13 +256,13 @@ function Map (props) { } //计算两点距离 - function computeDis (p1, p2) { + function computeDis(p1, p2) { return Math.round(p1.distance(p2)); } // 解析DrivingRoute对象,构造成AMap.Polyline的path参数需要的格式 // DrivingResult对象结构参考文档 https://lbs.amap.com/api/javascript-api/reference/route-search#m_DriveRoute - function parseRouteToPath (route) { + function parseRouteToPath(route) { var path = [] for (var i = 0, l = route.steps.length; i < l; i++) { var step = route.steps[i] @@ -300,24 +300,25 @@ function Map (props) {
-
-
{ - map.clearInfoWindow(); - if (emergencyList['xfjy']?.length > 0) { - const list = emergencyList['xfjy'].sort((b, a) => computeDis( - new AMap.LngLat(x.longitude, x.latitude), - new AMap.LngLat(b.location?.split(',')[0], b.location?.split(',')[1]) - ) - computeDis( - new AMap.LngLat(x.longitude, x.latitude), - new AMap.LngLat(a.location?.split(',')[0], a.location?.split(',')[1]) - )) - const location = list[0]?.location - drawDrivings([x.longitude, x.latitude], location.split(','), x, list[0]) - } - }} - >一键护航
-
+ { + propTab == 'overview' &&
+
{ + map.clearInfoWindow(); + if (emergencyList['xfjy']?.length > 0) { + const list = emergencyList['xfjy'].sort((b, a) => computeDis( + new AMap.LngLat(x.longitude, x.latitude), + new AMap.LngLat(b.location?.split(',')[0], b.location?.split(',')[1]) + ) - computeDis( + new AMap.LngLat(x.longitude, x.latitude), + new AMap.LngLat(a.location?.split(',')[0], a.location?.split(',')[1]) + )) + const location = list[0]?.location + drawDrivings([x.longitude, x.latitude], location.split(','), x, list[0]) + } + }} + >一键护航
+
} , document.getElementById(`alarmcontentid${x.location}`)); } diff --git a/super-screen/client/src/sections/fire-control/containers/homePage.js b/super-screen/client/src/sections/fire-control/containers/homePage.js index b301a25..f23ed82 100644 --- a/super-screen/client/src/sections/fire-control/containers/homePage.js +++ b/super-screen/client/src/sections/fire-control/containers/homePage.js @@ -16,7 +16,7 @@ import Weather from '../../water-prevention/components/weather'; import { FullScreenContainer } from '$components' import { useFsRequest } from '$utils'; -function homePage (props) { +function homePage(props) { const { dispatch, actions } = props; const childStyle = { height: '32%', color: '#fff', marginBottom: 17 } const cardHeight = document.body.clientHeight * 0.896 * 0.32 @@ -53,9 +53,7 @@ function homePage (props) {
- 智慧消防 -
- 一键护航 + 消防一键护航
{ dispatch(push('/homepage')) }} className='_exit' >返回平台
@@ -129,7 +127,7 @@ function homePage (props) { } -function mapStateToProps (state) { +function mapStateToProps(state) { const { auth, global } = state; diff --git a/super-screen/client/src/sections/water-prevention/containers/homePage.js b/super-screen/client/src/sections/water-prevention/containers/homePage.js index ed9810f..be53414 100644 --- a/super-screen/client/src/sections/water-prevention/containers/homePage.js +++ b/super-screen/client/src/sections/water-prevention/containers/homePage.js @@ -176,7 +176,7 @@ function homePage(props) {
- 水务防汛实时监测预警系统 + 防汛提前知
{ dispatch(push('/homepage')) }} className='_exit' >返回平台
From 065591000af765dffb012d7bc4dbe335b18918b5 Mon Sep 17 00:00:00 2001 From: "peng.peng" Date: Thu, 24 Aug 2023 12:54:03 +0800 Subject: [PATCH 2/6] =?UTF-8?q?(*)=E6=B6=88=E9=98=B2=E7=AB=99=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/src/sections/fire-control/containers/gis.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/super-screen/client/src/sections/fire-control/containers/gis.js b/super-screen/client/src/sections/fire-control/containers/gis.js index 1393ba8..219ab80 100644 --- a/super-screen/client/src/sections/fire-control/containers/gis.js +++ b/super-screen/client/src/sections/fire-control/containers/gis.js @@ -60,7 +60,7 @@ function Map(props) { } useEffect(() => { - if (!delay && alarmList?.length > 0 && emergencyList['xfjy']) { + if (!delay && (alarmList?.length > 0 || emergencyList['xfjy'])) { map.clearMap() map && renderMarkers() map && renderAlarms() @@ -301,7 +301,7 @@ function Map(props) {
{ - propTab == 'overview' &&
+ propTab !== 'overview' &&
{ map.clearInfoWindow(); From 19704fffdfa842695203d15dc1cc46c908c5f1fd Mon Sep 17 00:00:00 2001 From: "peng.peng" Date: Thu, 24 Aug 2023 13:39:35 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=EF=BC=88*=EF=BC=89=E6=B6=88=E9=98=B2?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/fire-control/components/item-left.js | 4 ++-- .../client/src/sections/fire-control/components/time.js | 9 +++++---- .../client/src/sections/fire-control/containers/gis.js | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/super-screen/client/src/sections/fire-control/components/item-left.js b/super-screen/client/src/sections/fire-control/components/item-left.js index 01d7d1d..f709d40 100644 --- a/super-screen/client/src/sections/fire-control/components/item-left.js +++ b/super-screen/client/src/sections/fire-control/components/item-left.js @@ -2,7 +2,7 @@ import React from 'react' import { Box, AutoRollComponent } from '$components'; import moment from 'moment' import { getName, getPhone } from '$utils'; -import TimeComponent from './time'; +import TimeComponent, { formatSeconds } from './time'; import { typeParam_data } from '../constants/index' import './style.less' function BasicInfo(props) { @@ -75,7 +75,7 @@ function BasicInfo(props) {
-
路线规划
+
路线规划 {alarmInfo?.routes?.time && `(${formatSeconds(alarmInfo?.routes?.time, true)})`}
3} diff --git a/super-screen/client/src/sections/fire-control/components/time.js b/super-screen/client/src/sections/fire-control/components/time.js index 1352d27..aba54fe 100644 --- a/super-screen/client/src/sections/fire-control/components/time.js +++ b/super-screen/client/src/sections/fire-control/components/time.js @@ -22,7 +22,7 @@ export default TimeComponent; //秒数转化为天时分秒 -export const formatSeconds = (value) => { +export const formatSeconds = (value, symbol) => { var secondTime = parseInt(value);// 秒 var minuteTime = 0;// 分 var hourTime = 0;// 小时 @@ -46,12 +46,13 @@ export const formatSeconds = (value) => { } } } - var result = "" + (parseInt(secondTime) < 10 ? '0' + parseInt(secondTime) : parseInt(secondTime)); - result = "" + (parseInt(minuteTime) < 10 ? '0' + parseInt(minuteTime) : parseInt(minuteTime)) + ":" + result; - result = "" + (parseInt(hourTime) < 10 ? '0' + parseInt(hourTime) : parseInt(hourTime)) + ":" + result; + var result = symbol ? '' : "" + (parseInt(secondTime) < 10 ? '0' + parseInt(secondTime) : parseInt(secondTime)); + result = "" + ((!symbol && parseInt(minuteTime) < 10) ? '0' + parseInt(minuteTime) : parseInt(minuteTime)) + (symbol ? '分钟' : ":") + result; + result = (symbol && parseInt(hourTime) == 0) ? result : "" + (!symbol && parseInt(hourTime) < 10 ? '0' + parseInt(hourTime) : parseInt(hourTime)) + (symbol ? '小时' : ":") + result; if (dayTime > 0) { result = "" + parseInt(dayTime) + "天 " + result; } // console.log('result', result); + return result; } \ No newline at end of file diff --git a/super-screen/client/src/sections/fire-control/containers/gis.js b/super-screen/client/src/sections/fire-control/containers/gis.js index 219ab80..fc4219a 100644 --- a/super-screen/client/src/sections/fire-control/containers/gis.js +++ b/super-screen/client/src/sections/fire-control/containers/gis.js @@ -301,7 +301,7 @@ function Map(props) {
{ - propTab !== 'overview' &&
+ propTab == 'overview' &&
{ map.clearInfoWindow(); From db8dd620b8d9b96d4493197ed24a54410a69cab4 Mon Sep 17 00:00:00 2001 From: "peng.peng" Date: Thu, 24 Aug 2023 13:52:11 +0800 Subject: [PATCH 4/6] =?UTF-8?q?(*)=E6=B6=88=E9=98=B2=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/fire-control/containers/gis.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/super-screen/client/src/sections/fire-control/containers/gis.js b/super-screen/client/src/sections/fire-control/containers/gis.js index fc4219a..3f8a656 100644 --- a/super-screen/client/src/sections/fire-control/containers/gis.js +++ b/super-screen/client/src/sections/fire-control/containers/gis.js @@ -66,7 +66,7 @@ function Map(props) { map && renderAlarms() setMapInitFit() } - }, [delay, alarmList, emergencyList]) + }, [delay, alarmList, emergencyList, propTab]) const renderMarkers = () => { const data = emergencyList['xfjy'] @@ -219,11 +219,8 @@ function Map(props) { if (result.routes && result.routes.length) { // 绘制第一条路线,也可以按需求绘制其它几条路线 drawRoute(result.routes[0]) + props.routeCallback({ routes: result.routes[0] }) - props.alarmOk({ - alarmInfo: { ...alarmInfo, routes: result.routes[0] }, - rescueInfo: rescueInfo - }) } } else { } @@ -315,6 +312,14 @@ function Map(props) { )) const location = list[0]?.location drawDrivings([x.longitude, x.latitude], location.split(','), x, list[0]) + + props.alarmOk({ + alarmInfo: { ...x }, + rescueInfo: list[0] + }) + setTimeout(() => { + drawDrivings([x.longitude, x.latitude], location.split(','), x, list[0]) + }, 200); } }} >一键护航
From 2ae43ceb63f8f65f2c965bea034d4af1e854ea31 Mon Sep 17 00:00:00 2001 From: liujiangyong Date: Thu, 24 Aug 2023 13:53:51 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sections/fire-control/components/left-middle.js | 8 +++++--- .../src/sections/fire-control/components/left-top.js | 2 +- .../src/sections/fire-control/components/style.less | 10 +++++----- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/super-screen/client/src/sections/fire-control/components/left-middle.js b/super-screen/client/src/sections/fire-control/components/left-middle.js index 2b757ae..c1f8fe5 100644 --- a/super-screen/client/src/sections/fire-control/components/left-middle.js +++ b/super-screen/client/src/sections/fire-control/components/left-middle.js @@ -1,7 +1,7 @@ import React from 'react' import { Box, AutoRollComponent, NoData } from '$components'; // import ReactEcharts from 'echarts-for-react'; -import { Progress } from 'antd'; +import { Progress, Tooltip } from 'antd'; function PopulationDynamics(props) { const { fireDevice } = props; @@ -129,12 +129,14 @@ function PopulationDynamics(props) { const getContent = () => { return
{ fireDevice.map(d =>
-
{d.type_name}
+ +
{d.type_name}
+
{item.teamName} - {item.leaderContactPhone} + {item.leaderContactPhone.replace(/(\d{3})\d*(\d{4})/, "$1****$2")}
)} diff --git a/super-screen/client/src/sections/fire-control/components/style.less b/super-screen/client/src/sections/fire-control/components/style.less index 55681ed..a8fd9d2 100644 --- a/super-screen/client/src/sections/fire-control/components/style.less +++ b/super-screen/client/src/sections/fire-control/components/style.less @@ -293,7 +293,7 @@ // 接入消防设备 .fire-device-item { display: flex; - height: 30px; + height: 50px; align-items: center; justify-content: space-around; @@ -316,11 +316,11 @@ ._round { position: absolute; - width: 12px; - height: 12px; + width: 14px; + height: 14px; background: #fff; - border-radius: 6px; - top: 7px; + border-radius: 7px; + top: 6px; } } From 1f47a9a2cd8bbdf2d43dd8861524c22cae4634f3 Mon Sep 17 00:00:00 2001 From: "peng.peng" Date: Thu, 24 Aug 2023 13:59:28 +0800 Subject: [PATCH 6/6] =?UTF-8?q?(*)=E6=B6=88=E9=98=B2=E4=B8=80=E9=94=AE?= =?UTF-8?q?=E6=8A=A4=E8=88=AA=20=E6=98=BE=E7=A4=BA=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/fire-control/components/item-left.js | 8 ++++---- .../src/sections/fire-control/containers/homePage.js | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/super-screen/client/src/sections/fire-control/components/item-left.js b/super-screen/client/src/sections/fire-control/components/item-left.js index f709d40..ea28074 100644 --- a/super-screen/client/src/sections/fire-control/components/item-left.js +++ b/super-screen/client/src/sections/fire-control/components/item-left.js @@ -6,11 +6,11 @@ import TimeComponent, { formatSeconds } from './time'; import { typeParam_data } from '../constants/index' import './style.less' function BasicInfo(props) { - const { info: { alarmInfo, rescueInfo } } = props; + const { info: { alarmInfo, rescueInfo }, routes: { routes } } = props; const getContent = () => { return
- {alarmInfo?.routes?.steps?.map((s, index) => (index + 1) + '.' + s?.instruction).map(x => { + {routes?.steps?.map((s, index) => (index + 1) + '.' + s?.instruction).map(x => { return
{x}
})}
} @@ -75,10 +75,10 @@ function BasicInfo(props) {
-
路线规划 {alarmInfo?.routes?.time && `(${formatSeconds(alarmInfo?.routes?.time, true)})`}
+
路线规划 {routes?.time && `(${formatSeconds(routes?.time, true)})`}
3} + canScroll={routes?.steps?.length > 3} content={getContent()} divHeight={100} divId={`fire-left-bottom${alarmInfo?.id}`} diff --git a/super-screen/client/src/sections/fire-control/containers/homePage.js b/super-screen/client/src/sections/fire-control/containers/homePage.js index 20d6489..920d9e0 100644 --- a/super-screen/client/src/sections/fire-control/containers/homePage.js +++ b/super-screen/client/src/sections/fire-control/containers/homePage.js @@ -24,6 +24,7 @@ function homePage(props) { const [tab, setTab] = useState('overview') const [emengencyTab, setEmengencyTab] = useState('xfyjwz'); const [alarmInfo, setAlarmInfo] = useState({}) + const [routes, setRoutes] = useState({}) const [longitudeLatitude, setLongitudeLatitude] = useState({}) const [fireDevice, setFireDevice] = useState([]) @@ -83,6 +84,7 @@ function homePage(props) { :
{ endEvent() }} cardContentHeight={document.body.clientHeight * 0.896} /> @@ -104,6 +106,9 @@ function homePage(props) { changeEmengencyTab={(e) => { setEmengencyTab(e) }} + routeCallback={(e) => { + setRoutes(e); + }} />