Browse Source

持续时间修改

dev
wenlele 2 years ago
parent
commit
767a270520
  1. 2
      web/client/src/sections/problem/containers/dataAlarm.jsx

2
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) + '分钟'
}

Loading…
Cancel
Save