|
|
@ -33,10 +33,32 @@ import Carousel from "@screen/pages/control/event/event/EventDetailDialog/Carous |
|
|
|
import { WarningTypeList, WarningSubclassList } from "@screen/utils/enum.js" |
|
|
|
// import { getRoadInfoByStakeMark, getProduct } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js" |
|
|
|
import { dialogDelayVisible } from "./../mixin" |
|
|
|
import { LaneOccupancyList } from "@screen/utils/enum.js" |
|
|
|
import { LaneOccupancyList, DirectionTypes } from "@screen/utils/enum.js" |
|
|
|
|
|
|
|
|
|
|
|
let vehicleTypeList = []; |
|
|
|
|
|
|
|
function getDuration(warningTime) { |
|
|
|
const currentTime = moment(); |
|
|
|
const specifiedTime = moment(warningTime); |
|
|
|
|
|
|
|
const duration = moment.duration(currentTime.diff(specifiedTime)); |
|
|
|
|
|
|
|
const hours = Math.floor(duration.asHours()); |
|
|
|
const minutes = Math.floor(duration.asMinutes()) % 60; |
|
|
|
const seconds = Math.floor(duration.asSeconds()) % 60; |
|
|
|
|
|
|
|
return `${padZero(hours)}:${padZero(minutes)}:${padZero(seconds)}`; |
|
|
|
} |
|
|
|
|
|
|
|
function padZero(num) { |
|
|
|
num = num.toString(); |
|
|
|
while (num.length < 2) { |
|
|
|
num = "0" + num; |
|
|
|
} |
|
|
|
return num; |
|
|
|
} |
|
|
|
|
|
|
|
// 感知事件 |
|
|
|
export default { |
|
|
|
name: 'PerceiveEvent', |
|
|
@ -52,6 +74,7 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
interval: null, |
|
|
|
loading: true, |
|
|
|
activeName: 'first', |
|
|
|
deviceControlVisible: false, |
|
|
@ -76,6 +99,12 @@ export default { |
|
|
|
key: "stakeMark", |
|
|
|
type: "text", |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "路段方向:", |
|
|
|
key: "direction", |
|
|
|
type: "text", |
|
|
|
isAlone: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "事件来源:", |
|
|
|
key: "warningSource", |
|
|
@ -138,11 +167,11 @@ export default { |
|
|
|
key: "duration", |
|
|
|
type: "text", |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "天气情况:", |
|
|
|
key: "weather", |
|
|
|
type: "text", |
|
|
|
}, |
|
|
|
// { |
|
|
|
// label: "天气情况:", |
|
|
|
// key: "weather", |
|
|
|
// type: "text", |
|
|
|
// }, |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
@ -150,6 +179,11 @@ export default { |
|
|
|
this.getDetails(); |
|
|
|
this.getVehicleTypeList(); |
|
|
|
}, |
|
|
|
async mounted() { |
|
|
|
}, |
|
|
|
beforeDestroy() { |
|
|
|
clearInterval(this.interval); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getVehicleTypeList() { |
|
|
|
if (vehicleTypeList.length) return; |
|
|
@ -227,6 +261,9 @@ export default { |
|
|
|
setTimeout(() => { |
|
|
|
this.$refs.FormConfigRef.reset(true); |
|
|
|
}); |
|
|
|
this.data.direction = DirectionTypes[this.data.direction]; |
|
|
|
this.data.duration = getDuration(this.data.warningTime); |
|
|
|
this.interval = setInterval(() => { this.data.duration = getDuration(this.data.warningTime); }, 1000) |
|
|
|
}) |
|
|
|
.catch((e) => { |
|
|
|
Message.error("详情获取失败" + e); |
|
|
|