From 767a2705200f6fc6d602952aff65e08b28bc90ff Mon Sep 17 00:00:00 2001 From: wenlele Date: Wed, 12 Oct 2022 15:41:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=81=E7=BB=AD=E6=97=B6=E9=97=B4=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/client/src/sections/problem/containers/dataAlarm.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/client/src/sections/problem/containers/dataAlarm.jsx b/web/client/src/sections/problem/containers/dataAlarm.jsx index ff185d5..6136bb7 100644 --- a/web/client/src/sections/problem/containers/dataAlarm.jsx +++ b/web/client/src/sections/problem/containers/dataAlarm.jsx @@ -257,7 +257,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb { name: '持续时间', sort: 19.5, value: 'sustainTime', render: (_, r, index) => { // console.log(r.updateTime); - let time = moment(r.updateTime).diff(moment(r.createTime), 'seconds') + let time = moment(r.confirmTime || r.updateTime || moment().format("YYYY-MM-DD HH:mm:ss")).diff(moment(r.createTime), 'seconds') // console.log(time); return time < 60 ? '< 1分钟' : time > 3600 ? Math.floor(time / 3600) + '小时' + Math.floor((time - Math.floor(time / 3600) * 3600) / 60) + '分钟' : Math.floor((time - Math.floor(time / 3600) * 3600) / 60) + '分钟' }