Commit 27813738 by 潘建波

修改bug

2 parents 4aaaee78 3433573b
......@@ -3,9 +3,9 @@ import axios from "axios";
console.log(process.env.NODE_ENV);
switch (process.env.NODE_ENV) {
case "development":
baseUrl = "http://192.168.9.133:20080"; // 测试环境url
// baseUrl = "http://192.168.9.133:20080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086";
// baseUrl = 'http://vion-panda.51vip.biz:52510';
baseUrl = 'http://vion-panda.51vip.biz:52510';
break;
case "pre":
baseUrl = "https://pre-server.feleti.cn"; // 预上线环境url
......
......@@ -58,7 +58,13 @@
<el-input v-model="videoEditParam.vchan_name"></el-input>
</el-form-item>
<el-form-item label="取流地址">
<el-input v-model="videoEditParam.video_url" disabled></el-input>
<el-input v-model="videoEditParam.video_url" disabled></el-input>
</el-form-item>
<el-form-item label="经度">
<el-input v-model="videoEditParam.longitude"></el-input>
</el-form-item>
<el-form-item label="纬度">
<el-input v-model="videoEditParam.latitude"></el-input>
</el-form-item>
</el-form>
</div>
......@@ -94,7 +100,9 @@
videoTree:[],
videoEditParam:{
vchan_name:'',
video_url:''
video_url:'',
longitude:'',
latitude:''
},
videoEditVisible:false,
vchan_duid:'',
......@@ -286,11 +294,15 @@
this.vchan_duid=row.vchan_duid;
this.videoEditParam.vchan_name = row.vchan_name;
this.videoEditParam.video_url = row.video_url;
this.videoEditParam.longitude = row.longitude;
this.videoEditParam.latitude = row.latitude;
this.videoEditVisible=true;
},
editSave(){
this.$api.resource.editVideo({
name:this.videoEditParam.vchan_name
name:this.videoEditParam.vchan_name,
longitude : this.videoEditParam.longitude,
latitude: this.videoEditParam.latitude
},this.dev_unid,this.vchan_duid).then(res=>{
if(res.ecode==200){
this.$message({
......
......@@ -289,10 +289,22 @@ export default {
this.illageList = JSON.parse(localStorage.getItem("违法类型"));
},
getTrafficHour() {
let date = new Date();
let Y = date.getFullYear();
let M = date.getMonth() > 10 ? date.getMonth() : `0${date.getMonth() + 1}`;
let D = date.getDate() > 10 ? date.getDate() : `0${date.getDate()}`;
let h = date.getHours() > 10 ? date.getHours() : `0${date.getHours()}`;
let m =
date.getMinutes() > 10 ? date.getMinutes() : `0${date.getMinutes()}`;
let s = date.getSeconds();
let startDate = `${Y}-${M}-${D} 00:00:00`;
let curDate = `${Y}-${M}-${D} ${h}:${m}:${s}`;
let data = {
illegal_type: this.illtype,
event_type: this.eventtype,
key_vehicle_type: this.special_type
key_vehicle_type: this.special_type,
start_dt:startDate,
end_dt:curDate,
};
this.$api.show.getTrafficHour(data).then(res => {
console.log('违法事件趋势',res);
......
......@@ -195,6 +195,7 @@ export default {
},
methods: {
alarmevent(data) {
console.log('alarmdata',data);
//移动地图
this.$refs.map.movemap(data,null,2);
},
......
<template>
<div style="width:100%">
<div id="map" class="maps"></div>
<div id="popup" class="ol-popup">
<div id="popup" class="ol-popup img-popup">
<a
href="#"
id="popup-closer"
......@@ -31,7 +31,7 @@
</template>
<script>
import {mapState} from "vuex";
import { mapState } from "vuex";
import videoPlay from "../public/videoPlay";
import { inherits } from "ol/util.js";
import Map from "ol/Map";
......@@ -81,6 +81,7 @@ var closer = "";
var taskcloser = "";
var overlay = "";
var infooverlay = "";
var mapcenter = [120.324447, 36.074594];
var RotateNorthControl = (function(Control) {
function RotateNorthControl(opt_options) {
var options = opt_options || {};
......@@ -105,9 +106,8 @@ var RotateNorthControl = (function(Control) {
RotateNorthControl.prototype.constructor = RotateNorthControl;
RotateNorthControl.prototype.handleRotateNorth = function handleRotateNorth() {
let pos = [120.324447, 36.074594];
Views.animate({
center: pos,
center: mapcenter,
duration: 400,
zoom: 14
});
......@@ -183,7 +183,7 @@ export default {
zoom: 2, // 并且定义地图显示层级为2
minZoom: 13,
maxZoom: 18,
center: [120.324447, 36.064594]
center: mapcenter
});
map = new Map({
controls: defaultControls().extend([new RotateNorthControl()]),
......@@ -258,7 +258,6 @@ export default {
});
if (type && type == 2) {
this.addLayer(data, pos);
console.log('alarmdata',data);
}
},
closepopup() {
......@@ -303,8 +302,9 @@ export default {
element: container,
autoPan: true,
position: pos,
offset: [0, -30],
autoPanAnimation: {
duration: 500
duration: 100
}
});
map.addOverlay(overlay);
......@@ -380,45 +380,46 @@ export default {
}
});
map.addOverlay(overlay);
let obj = {};
if (data.vchan_name == "视频1") {
obj.rtsp_url =
"rtsp://192.168.9.133:8554//opt/data/vedio/1579253441478.264";
} else if (data.vchan_name == "视频2") {
obj.rtsp_url =
"rtsp://192.168.9.133:8554//opt/data/vedio/1577516797543.264";
}
this.playurl = obj;
// this.$store.commit('setocxstate', 1)
setTimeout(() => {
this.$refs.mapvideo.videoPlay();
}, 100);
//获取视频流
// this.$api.device.getFxStream(this.dev_unid, data.vchan_refid).then(res => {
// debugger
// if(res.task_list.length >0) {
// var taskarr = res.task_list;
// let obj = {};
// for(let i = 0; i < taskarr.length; i++){
// if(taskarr[i].rtsp_url !=''){
// obj.rtsp_url = res.task_list[i].rtsp_url
// break;
// }
// }
// this.playurl = obj
// this.$refs.ocx.videoPlay()
// } else {
// this.$message({
// message: '该相机下没有分析任务',
// type: 'error'
// });
// }
// })
// if (data.vchan_name == "视频1") {
// obj.rtsp_url =
// "rtsp://192.168.9.133:8554//opt/data/vedio/1579253441478.264";
// } else if (data.vchan_name == "视频2") {
// obj.rtsp_url =
// "rtsp://192.168.9.133:8554//opt/data/vedio/1577516797543.264";
// }
// this.playurl = obj;
// // this.$store.commit('setocxstate', 1)
// setTimeout(() => {
// this.$refs.mapvideo.videoPlay();
// }, 100);
console.log(data);
let vrefid = data.vchan_refid ? data.vchan_refid : data.refid;
// 获取视频流
this.$api.device.getFxStream(this.dev_unid, vrefid).then(res => {
if (res.task_list.length > 0) {
var taskarr = res.task_list;
let obj = {};
for (let i = 0; i < taskarr.length; i++) {
if (taskarr[i].rtsp_url != "") {
obj.rtsp_url = res.task_list[i].rtsp_url;
break;
}
}
console.log('playurl', obj)
this.playurl = obj;
this.$refs.mapvideo.videoPlay();
} else {
this.$message({
message: "该相机下没有分析任务",
type: "error"
});
}
});
},
getDevList() {
this.$api.show.getDevList(this.dev_unid).then(res => {
let devlist = [];
this.$store.commit("setDevList", res.list_data);
res.list_data.map(ele => {
if (ele.vchan_type == "camera") {
devlist.push(ele);
......@@ -439,15 +440,14 @@ export default {
});
}
},
computed:{
...mapState(['mapopen'])
computed: {
...mapState(["mapopen"])
},
watch:{
mapopen(){
setTimeout(()=> {
map.updateSize();
},1000)
watch: {
mapopen() {
setTimeout(() => {
map.updateSize();
}, 1000);
// this.InitMap();
}
},
......@@ -503,6 +503,9 @@ export default {
width: 20vw;
height 25vh;
}
.img-popup {
height auto
}
.ol-popup:after, .ol-popup:before {
top: 100%;
border: solid transparent;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!