Browse Source

(*)消防功能优化

master
peng.peng 1 year ago
parent
commit
19704fffdf
  1. 4
      super-screen/client/src/sections/fire-control/components/item-left.js
  2. 9
      super-screen/client/src/sections/fire-control/components/time.js
  3. 2
      super-screen/client/src/sections/fire-control/containers/gis.js

4
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) {
<div className='left_third_bg' style={{ height: 160, paddingTop: 20 }}>
<div className='left_item_left3' />
<div className='left_item_right1' style={{ textAlign: 'left' }}>
<div><span style={{ marginRight: 30, marginBottom: 15 }}>路线规划</span></div>
<div><span style={{ marginRight: 30, marginBottom: 15 }}>路线规划 {alarmInfo?.routes?.time && `(${formatSeconds(alarmInfo?.routes?.time, true)})`}</span></div>
<AutoRollComponent
key={alarmInfo?.id}
canScroll={alarmInfo?.routes?.steps?.length > 3}

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 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;
}

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

@ -301,7 +301,7 @@ function Map(props) {
</div>
{
propTab !== 'overview' && <div className='alarm_confirm'>
propTab == 'overview' && <div className='alarm_confirm'>
<div className='hande_button'
onClick={() => {
map.clearInfoWindow();

Loading…
Cancel
Save