Commit 27813738 by 潘建波

修改bug

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