From 19704fffdfa842695203d15dc1cc46c908c5f1fd Mon Sep 17 00:00:00 2001 From: "peng.peng" Date: Thu, 24 Aug 2023 13:39:35 +0800 Subject: [PATCH] =?UTF-8?q?=EF=BC=88*=EF=BC=89=E6=B6=88=E9=98=B2=E5=8A=9F?= =?UTF-8?q?=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();