wenlele 1 year ago
parent
commit
78a99859f7
  1. 10
      super-screen/client/src/sections/community-safty/components/infrastructure.js
  2. 4
      super-screen/client/src/sections/community-safty/containers/homePage.js
  3. 7
      super-screen/client/src/sections/fire-control/components/alarm-add.js
  4. 10
      super-screen/client/src/sections/fire-control/components/item-left.js
  5. 6
      super-screen/client/src/sections/fire-control/components/left-middle.js
  6. 2
      super-screen/client/src/sections/fire-control/components/left-top.js
  7. 10
      super-screen/client/src/sections/fire-control/components/style.less
  8. 9
      super-screen/client/src/sections/fire-control/components/time.js
  9. 4
      super-screen/client/src/sections/fire-control/constants/index.js
  10. 22
      super-screen/client/src/sections/fire-control/containers/gis.js
  11. 9
      super-screen/client/src/sections/fire-control/containers/homePage.js
  12. 2
      super-screen/client/src/sections/water-prevention/containers/homePage.js

10
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 { Box, NoData } from '$components';
import { useMockRequest, ApiTable } from '$utils'; import { useMockRequest, ApiTable } from '$utils';
@ -7,14 +7,10 @@ function Infrastructure(props) {
url: 'https://superchangnan.anxinyun.cn/api/xiaofang/devices', url: 'https://superchangnan.anxinyun.cn/api/xiaofang/devices',
method: 'mockGet', method: 'mockGet',
}); });
const datas = devices?.map(s => {
let datas = [] if (typeof (s.data) == 'string') s.data = JSON.parse(s.data)
useEffect(() => {
devices?.map(s => {
s.data = JSON.parse(s.data)
return s; return s;
}) })
}, [devices])
const data = [ const data = [
{ name: '烟感设备', number: datas?.find(s => s.type == 3)?.data?.length || 0 }, { name: '烟感设备', number: datas?.find(s => s.type == 3)?.data?.length || 0 },

4
super-screen/client/src/sections/community-safty/containers/homePage.js

@ -60,9 +60,7 @@ function homePage(props) {
<div className='homepage'> <div className='homepage'>
<div className='_title'> <div className='_title'>
<div className='_title_text'> <div className='_title_text'>
<span>社区安全</span> <span>房屋租赁安全</span>
<div className='_title_dot'></div>
<span>流动人口</span>
</div> </div>
<Weather /> <Weather />
<div onClick={() => { dispatch(push('/homepage')) }} className='_exit' >返回平台</div> <div onClick={() => { dispatch(push('/homepage')) }} className='_exit' >返回平台</div>

7
super-screen/client/src/sections/fire-control/components/alarm-add.js

@ -57,7 +57,12 @@ function FireAddForm(props) {
: '请选择事件地点'}</div> : '请选择事件地点'}</div>
</Form.Item> </Form.Item>
<Form.Item name="type" label="警情类型" rules={[{ required: true, message: '请选择警情类型!' }]}> <Form.Item name="type" label="警情类型" rules={[{ required: true, message: '请选择警情类型!' }]}>
<Select placeholder="请选择警情类型"> <Select
onChange={(s) => {
form.setFieldValue('typeParam', null)
form.setFieldValue('scene', null)
}}
placeholder="请选择警情类型">
{eventType_Data.map(s => <Option value={s}>{s}</Option>)} {eventType_Data.map(s => <Option value={s}>{s}</Option>)}
</Select> </Select>
</Form.Item> </Form.Item>

10
super-screen/client/src/sections/fire-control/components/item-left.js

@ -2,15 +2,15 @@ import React from 'react'
import { Box, AutoRollComponent } from '$components'; import { Box, AutoRollComponent } from '$components';
import moment from 'moment' import moment from 'moment'
import { getName, getPhone } from '$utils'; import { getName, getPhone } from '$utils';
import TimeComponent from './time'; import TimeComponent, { formatSeconds } from './time';
import { typeParam_data } from '../constants/index' import { typeParam_data } from '../constants/index'
import './style.less' import './style.less'
function BasicInfo(props) { function BasicInfo(props) {
const { info: { alarmInfo, rescueInfo } } = props; const { info: { alarmInfo, rescueInfo }, routes: { routes } } = props;
const getContent = () => { const getContent = () => {
return <div style={{ color: "#8FCBFF", marginTop: 9, paddingTop: 10 }}> return <div style={{ color: "#8FCBFF", marginTop: 9, paddingTop: 10 }}>
{alarmInfo?.routes?.steps?.map((s, index) => (index + 1) + '.' + s?.instruction).map(x => { {routes?.steps?.map((s, index) => (index + 1) + '.' + s?.instruction).map(x => {
return <div style={{ marginBottom: 10 }}>{x}</div> return <div style={{ marginBottom: 10 }}>{x}</div>
})}</div> })}</div>
} }
@ -75,10 +75,10 @@ function BasicInfo(props) {
<div className='left_third_bg' style={{ height: 160, paddingTop: 20 }}> <div className='left_third_bg' style={{ height: 160, paddingTop: 20 }}>
<div className='left_item_left3' /> <div className='left_item_left3' />
<div className='left_item_right1' style={{ textAlign: 'left' }}> <div className='left_item_right1' style={{ textAlign: 'left' }}>
<div><span style={{ marginRight: 30, marginBottom: 15 }}>路线规划</span></div> <div><span style={{ marginRight: 30, marginBottom: 15 }}>路线规划 {routes?.time && `(${formatSeconds(routes?.time, true)})`}</span></div>
<AutoRollComponent <AutoRollComponent
key={alarmInfo?.id} key={alarmInfo?.id}
canScroll={alarmInfo?.routes?.steps?.length > 3} canScroll={routes?.steps?.length > 3}
content={getContent()} content={getContent()}
divHeight={100} divHeight={100}
divId={`fire-left-bottom${alarmInfo?.id}`} divId={`fire-left-bottom${alarmInfo?.id}`}

6
super-screen/client/src/sections/fire-control/components/left-middle.js

@ -1,7 +1,7 @@
import React from 'react' import React from 'react'
import { Box, AutoRollComponent, NoData } from '$components'; import { Box, AutoRollComponent, NoData } from '$components';
// import ReactEcharts from 'echarts-for-react'; // import ReactEcharts from 'echarts-for-react';
import { Progress } from 'antd'; import { Progress, Tooltip } from 'antd';
function PopulationDynamics(props) { function PopulationDynamics(props) {
const { fireDevice } = props; const { fireDevice } = props;
@ -129,12 +129,14 @@ function PopulationDynamics(props) {
const getContent = () => { const getContent = () => {
return <div className='fire-device'>{ return <div className='fire-device'>{
fireDevice.map(d => <div className='fire-device-item'> fireDevice.map(d => <div className='fire-device-item'>
<Tooltip title={d.type_name}>
<div className='_name'>{d.type_name}</div> <div className='_name'>{d.type_name}</div>
</Tooltip>
<div className='_progress'> <div className='_progress'>
<Progress <Progress
percent={(d.device_count / total) * 100} percent={(d.device_count / total) * 100}
showInfo={false} showInfo={false}
strokeWidth={12} strokeWidth={14}
strokeColor='#005AC6' strokeColor='#005AC6'
trailColor='#2B375C' trailColor='#2B375C'
strokeLinecap="butt" strokeLinecap="butt"

2
super-screen/client/src/sections/fire-control/components/left-top.js

@ -14,7 +14,7 @@ function BasicInfo(props) {
</div> </div>
<div className='_row2'> <div className='_row2'>
<span>{item.teamName}</span> <span>{item.teamName}</span>
<span>{item.leaderContactPhone}</span> <span>{item.leaderContactPhone.replace(/(\d{3})\d*(\d{4})/, "$1****$2")}</span>
</div> </div>
</div> </div>
</div>)} </div>)}

10
super-screen/client/src/sections/fire-control/components/style.less

@ -293,7 +293,7 @@
// 接入消防设备 // 接入消防设备
.fire-device-item { .fire-device-item {
display: flex; display: flex;
height: 30px; height: 50px;
align-items: center; align-items: center;
justify-content: space-around; justify-content: space-around;
@ -316,11 +316,11 @@
._round { ._round {
position: absolute; position: absolute;
width: 12px; width: 14px;
height: 12px; height: 14px;
background: #fff; background: #fff;
border-radius: 6px; border-radius: 7px;
top: 7px; top: 6px;
} }
} }

9
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 secondTime = parseInt(value);// 秒
var minuteTime = 0;// 分 var minuteTime = 0;// 分
var hourTime = 0;// 小时 var hourTime = 0;// 小时
@ -46,12 +46,13 @@ export const formatSeconds = (value) => {
} }
} }
} }
var result = "" + (parseInt(secondTime) < 10 ? '0' + parseInt(secondTime) : parseInt(secondTime)); var result = symbol ? '' : "" + (parseInt(secondTime) < 10 ? '0' + parseInt(secondTime) : parseInt(secondTime));
result = "" + (parseInt(minuteTime) < 10 ? '0' + parseInt(minuteTime) : parseInt(minuteTime)) + ":" + result; result = "" + ((!symbol && parseInt(minuteTime) < 10) ? '0' + parseInt(minuteTime) : parseInt(minuteTime)) + (symbol ? '分钟' : ":") + result;
result = "" + (parseInt(hourTime) < 10 ? '0' + parseInt(hourTime) : parseInt(hourTime)) + ":" + result; result = (symbol && parseInt(hourTime) == 0) ? result : "" + (!symbol && parseInt(hourTime) < 10 ? '0' + parseInt(hourTime) : parseInt(hourTime)) + (symbol ? '小时' : ":") + result;
if (dayTime > 0) { if (dayTime > 0) {
result = "" + parseInt(dayTime) + "天 " + result; result = "" + parseInt(dayTime) + "天 " + result;
} }
// console.log('result', result); // console.log('result', result);
return result; return result;
} }

4
super-screen/client/src/sections/fire-control/constants/index.js

@ -1,7 +1,7 @@
const typeParam_data = { const typeParam_data = {
'火灾扑救': { '火灾扑救': {
name: '着火物质', name: '着火物质',
options: ['固体物质', '液体或可熔物质', '气体', '带电物体和精密仪器等物质', '烹饪器具内的烹饪物',] options: ['固体物质', '液体或可熔物质', '金属', '气体', '带电物体和精密仪器等物质', '烹饪器具内的烹饪物',]
}, },
'救援抢险': { '救援抢险': {
name: '事件类型', name: '事件类型',
@ -10,7 +10,7 @@ const typeParam_data = {
}, },
'自然灾害': { '自然灾害': {
name: '灾害类型', name: '灾害类型',
options: ['水旱', '气象', '地质灾害', '等自然灾害', '森林、草原火灾'] options: ['水旱', '气象', '地质灾害', '森林、草原火灾']
}, },
'灾难事故': { '灾难事故': {
name: '事故类型', name: '事故类型',

22
super-screen/client/src/sections/fire-control/containers/gis.js

@ -60,13 +60,13 @@ function Map (props) {
} }
useEffect(() => { useEffect(() => {
if (!delay && alarmList?.length > 0 && emergencyList['xfjy']) { if (!delay && (alarmList?.length > 0 || emergencyList['xfjy'])) {
map.clearMap() map.clearMap()
map && renderMarkers() map && renderMarkers()
map && renderAlarms() map && renderAlarms()
setMapInitFit() setMapInitFit()
} }
}, [delay, alarmList, emergencyList]) }, [delay, alarmList, emergencyList, propTab])
const renderMarkers = () => { const renderMarkers = () => {
const data = emergencyList['xfjy'] const data = emergencyList['xfjy']
@ -219,11 +219,8 @@ function Map (props) {
if (result.routes && result.routes.length) { if (result.routes && result.routes.length) {
// 绘制第一条路线,也可以按需求绘制其它几条路线 // 绘制第一条路线,也可以按需求绘制其它几条路线
drawRoute(result.routes[0]) drawRoute(result.routes[0])
props.routeCallback({ routes: result.routes[0] })
props.alarmOk({
alarmInfo: { ...alarmInfo, routes: result.routes[0] },
rescueInfo: rescueInfo
})
} }
} else { } else {
} }
@ -300,7 +297,8 @@ function Map (props) {
</div> </div>
</div> </div>
<div className='alarm_confirm'> {
propTab == 'overview' && <div className='alarm_confirm'>
<div className='hande_button' <div className='hande_button'
onClick={() => { onClick={() => {
map.clearInfoWindow(); map.clearInfoWindow();
@ -314,10 +312,18 @@ function Map (props) {
)) ))
const location = list[0]?.location const location = list[0]?.location
drawDrivings([x.longitude, x.latitude], location.split(','), x, list[0]) 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);
} }
}} }}
>一键护航</div> >一键护航</div>
</div> </div>}
</div>, </div>,
document.getElementById(`alarmcontentid${x.location}`)); document.getElementById(`alarmcontentid${x.location}`));
} }

9
super-screen/client/src/sections/fire-control/containers/homePage.js

@ -24,6 +24,7 @@ function homePage (props) {
const [tab, setTab] = useState('overview') const [tab, setTab] = useState('overview')
const [emengencyTab, setEmengencyTab] = useState('xfyjwz'); const [emengencyTab, setEmengencyTab] = useState('xfyjwz');
const [alarmInfo, setAlarmInfo] = useState({}) const [alarmInfo, setAlarmInfo] = useState({})
const [routes, setRoutes] = useState({})
const [longitudeLatitude, setLongitudeLatitude] = useState({}) const [longitudeLatitude, setLongitudeLatitude] = useState({})
const [fireDevice, setFireDevice] = useState([]) const [fireDevice, setFireDevice] = useState([])
@ -61,9 +62,7 @@ function homePage (props) {
<div className='homepage'> <div className='homepage'>
<div className='_title'> <div className='_title'>
<div className='_title_text'> <div className='_title_text'>
<span>智慧消防</span> <span>消防一键护航</span>
<div className='_title_dot'></div>
<span>一键护航</span>
</div> </div>
<Weather /> <Weather />
<div onClick={() => { dispatch(push('/homepage')) }} className='_exit' >返回平台</div> <div onClick={() => { dispatch(push('/homepage')) }} className='_exit' >返回平台</div>
@ -85,6 +84,7 @@ function homePage (props) {
: :
<div className='child' style={{ height: '100%' }} > <div className='child' style={{ height: '100%' }} >
<Left <Left
routes={routes}
info={alarmInfo} info={alarmInfo}
endEvent={() => { endEvent() }} endEvent={() => { endEvent() }}
cardContentHeight={document.body.clientHeight * 0.896} /> cardContentHeight={document.body.clientHeight * 0.896} />
@ -106,6 +106,9 @@ function homePage (props) {
changeEmengencyTab={(e) => { changeEmengencyTab={(e) => {
setEmengencyTab(e) setEmengencyTab(e)
}} }}
routeCallback={(e) => {
setRoutes(e);
}}
/> />
</div> </div>
<div className='homepage-left homepage-left-right'> <div className='homepage-left homepage-left-right'>

2
super-screen/client/src/sections/water-prevention/containers/homePage.js

@ -176,7 +176,7 @@ function homePage(props) {
<div className='homepage'> <div className='homepage'>
<div className='_title'> <div className='_title'>
<div className='water_title_text'> <div className='water_title_text'>
水务防汛实时监测预警系统 防汛提前知
</div> </div>
<Weather /> <Weather />
<div onClick={() => { dispatch(push('/homepage')) }} className='_exit' >返回平台</div> <div onClick={() => { dispatch(push('/homepage')) }} className='_exit' >返回平台</div>

Loading…
Cancel
Save