|
|
@ -29,7 +29,7 @@ import Video from "@screen/components/Video"; |
|
|
|
import Form from "@screen/components/FormConfig"; |
|
|
|
import request from "@/utils/request"; |
|
|
|
import { Message } from "element-ui"; |
|
|
|
import moment from "moment"; |
|
|
|
import moment, { fn } from "moment"; |
|
|
|
import Carousel from "@screen/pages/control/event/event/EventDetailDialog/Carousel"; |
|
|
|
import { |
|
|
|
WarningTypeList, |
|
|
@ -183,8 +183,10 @@ export default { |
|
|
|
}; |
|
|
|
}, |
|
|
|
async created() { |
|
|
|
this.getDetails(); |
|
|
|
this.getVehicleTypeList(); |
|
|
|
let self = this; |
|
|
|
this.getVehicleTypeList(function(){ |
|
|
|
self.getDetails(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
async mounted() { }, |
|
|
|
beforeDestroy() { |
|
|
@ -220,8 +222,11 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
getVehicleTypeList() { |
|
|
|
if (vehicleTypeList.length) return; |
|
|
|
getVehicleTypeList(fn) { |
|
|
|
if (vehicleTypeList.length) { |
|
|
|
fn() |
|
|
|
return |
|
|
|
}; |
|
|
|
|
|
|
|
request({ |
|
|
|
url: `/system/dict/data/type/${"sys_vehicle_type"}`, |
|
|
@ -230,13 +235,13 @@ export default { |
|
|
|
}) |
|
|
|
.then(({ data, code }) => { |
|
|
|
if (code != 200) return Message.error("详情获取失败"); |
|
|
|
|
|
|
|
vehicleTypeList = this.formList[5].options.options = data.map( |
|
|
|
(item) => ({ |
|
|
|
key: item.dictValue, |
|
|
|
label: item.dictLabel, |
|
|
|
}) |
|
|
|
); |
|
|
|
fn(); |
|
|
|
}) |
|
|
|
.catch((err) => { }); |
|
|
|
}, |
|
|
@ -301,10 +306,6 @@ export default { |
|
|
|
setTimeout(() => { |
|
|
|
this.$refs.FormConfigRef.reset(true); |
|
|
|
}); |
|
|
|
setTimeout(() => { |
|
|
|
this.formList[5].options = { options: |
|
|
|
WarningSubclassList[data.warningType] || []}; |
|
|
|
}, 100); |
|
|
|
this.data.direction = DirectionTypes[this.data.direction]; |
|
|
|
this.data.duration = getDuration(this.data.warningTime); |
|
|
|
this.interval = setInterval(() => { |
|
|
|