@@ -214,6 +214,10 @@
// 预警音乐类型
warningType: "",
cameraList:[{ rtspUrl: "rtsp://192.168.1.138:8557/h264"}],
+ nowRtspurl:"",
+ //设置摄像头切换休眠标识
+ flag : false,
+ textStyle : 70,
}
},
mounted() {
@@ -236,9 +240,31 @@
this.videoFaceList = res.data;
})
},
- plays(){
- this.cameraList.push({rtspUrl: "rtsp://192.168.1.138:8557/h264"});
+ getCurrentTime() {
+ //获取当前时间并打印
+ var _this = this;
+ let yy = new Date().getFullYear();
+ let mm = new Date().getMonth()+1;
+ let dd = new Date().getDate();
+ let hh = new Date().getHours();
+ let mf = new Date().getMinutes()<10 ? '0'+new Date().getMinutes() : new Date().getMinutes();
+ let ss = new Date().getSeconds()<10 ? '0'+new Date().getSeconds() : new Date().getSeconds();
+ let sss = new Date().getMilliseconds() <10 ? '0'+new Date().getMilliseconds() : new Date().getMilliseconds() ;
+ _this.gettime = yy+'/'+mm+'/'+dd+' '+hh+':'+mf+':'+ss+':'+sss;
+ console.log("当前时间为:");
+ console.log(_this.gettime);
},
+ sleep(ms) { //sleep延迟方法2
+ var unixtime_ms = new Date().getTime();
+ while(new Date().getTime() < unixtime_ms + ms) {
+ console.log("当前睡眠" +this.nowRtspurl+ "暂停中")
+ this.getCurrentTime()
+ }
+ },
+ // plays(){
+ // // this.cameraList.pop();
+ // this.cameraList.push({rtspUrl: "rtsp://admin:123uestc@192.168.1.32:554"});
+ // },
// 初始化4条预警数据
initGetWarningPicture() {
this.$http.post("/faces/compareList", {
@@ -286,6 +312,7 @@
this.$http.get(`warning/taskInfo/${cameraId}`).then(res => {
if (res.data.code === 0) {
this.taskName = res.data.data.taskName
+ this.textStyle = res.data.data.controlThreshold
} else {
this.$message.warning(res.data.message)
}
@@ -340,15 +367,24 @@
console.log("WebSocket Connection closed");
},
websocketonmessage(e) {
- console.log("数据传输")
+ // console.log("前端数据传输时间");
+ // this.getCurrentTime();
// console.log(e)
// ws数据字符串转json
- let wsObj = JSON.parse(e.data)
- // console.log("this wsObj")
- // console.log(wsObj)
- // ws数据推送成功
- // 处理ws推送的预警信息
- this.getWarningPicture(wsObj)
+ // if(this.flag == true){
+ // console.log("onmessage延迟停止中:")
+ // this.sleep(2000)
+ // this.flag = false
+ //
+ // }
+ // else {
+ let wsObj = JSON.parse(e.data)
+ // console.log("this wsObj")
+ // console.log(wsObj)
+ // ws数据推送成功
+ // 处理ws推送的预警信息
+ this.getWarningPicture(wsObj)
+ // }
},
// 抓拍的图片处理
getPicture(obj) {
@@ -391,18 +427,10 @@
for (let i = 0; i < warningData.length; i++) {
this.videoFaceList.unshift(warningData[i])
}
- console.log("this is videofacelist")
- console.log(this.videoFaceList)
+ // this.videoFaceList = warningData;
+ // console.log("this is videofacelist")
+ // console.log(this.videoFaceList)
- // else {
- // // console.log("this videofacelist")
- // // console.log(this.videoFaceList)
- // for (let i = 0; i < warningData.length; i++) {
- // this.videoFaceList.unshift(warningData[i])
- // }
- // // console.log("this videofacelist")
- // // console.log(this.videoFaceList)
- // }
//this.warningList = warningData
//console.log(this.compareList)
@@ -410,35 +438,35 @@
let warningType = this.$refs.notice
warningType.play()
// this.$message.warning("有新的预警信息")
- this.compareList.forEach((item, index, arr) => {
- // "1" 红色#FF343E "2" 橙色#FFA61A "0" 蓝色#2FC8FA
- // if (item.taskType == "1" || item.taskType == "2" || item.taskType == "3") {
- // if (item.taskType == "1") {
- // item.taskType = "#FF343E"
- // } else if (item.taskType == "2") {
- // item.taskType = "#FFA61A"
- // } else if (item.taskType == "3") {
- // item.taskType = "#2FC8FA"
- // } else {
- // item.taskType = "#CCC"
- // }
- // }
- this.$nextTick(() => {
- if (this.$refs[`warningImage${index}`].length != 0) {
- let canvas = this.$refs[`warningImage${index}`][0]
- let cxt = canvas.getContext("2d");
- cxt.clearRect(0, 0, 120, 120);
- let img = new Image();
- img.src = item.bgImg;
- img.onload = function() {
- cxt.drawImage(img, item.positionVO.x, item.positionVO.y, item
- .positionVO.w, item.positionVO.h, 0, 0,
- 120,
- 120);
- }
- }
- })
- })
+ // this.compareList.forEach((item, index, arr) => {
+ // // "1" 红色#FF343E "2" 橙色#FFA61A "0" 蓝色#2FC8FA
+ // // if (item.taskType == "1" || item.taskType == "2" || item.taskType == "3") {
+ // // if (item.taskType == "1") {
+ // // item.taskType = "#FF343E"
+ // // } else if (item.taskType == "2") {
+ // // item.taskType = "#FFA61A"
+ // // } else if (item.taskType == "3") {
+ // // item.taskType = "#2FC8FA"
+ // // } else {
+ // // item.taskType = "#CCC"
+ // // }
+ // // }
+ // this.$nextTick(() => {
+ // if (this.$refs[`warningImage${index}`].length != 0) {
+ // let canvas = this.$refs[`warningImage${index}`][0]
+ // let cxt = canvas.getContext("2d");
+ // cxt.clearRect(0, 0, 120, 120);
+ // let img = new Image();
+ // img.src = item.bgImg;
+ // img.onload = function() {
+ // cxt.drawImage(img, item.positionVO.x, item.positionVO.y, item
+ // .positionVO.w, item.positionVO.h, 0, 0,
+ // 120,
+ // 120);
+ // }
+ // }
+ // })
+ // })
},
// 卡口树隐藏显示
barrierSelectStateClick() {
@@ -455,11 +483,33 @@
})
}
},
+ getRtspByCameraId(cameraId) {
+ this.$http.get(`/camera/findById/${cameraId}`).then(res => {
+
+ if (res.data.code === 0) {
+
+ // this.cameraList. = res.data.data.rtspUrl
+ this.nowRtspurl = res.data.data.rtspUrl
+ this.flag = true
+ this.$http.get("http://192.168.1.196:5001/returnRtspUrl",{
+ params:{
+ url:this.nowRtspurl
+ }
+ })
+ this.videoFaceList = []
+ // this.$forceUpdate()
+ } else {
+ // this.$message.warning(res.data.message)
+ }
+ })
+
+ },
// 级联事件切换摄像头
handleNodeClick(data, a, b) {
- console.log(data)
+ // console.log(data)
if (data.type == "camera" && data.status === "Y") {
// 切换摄像头清空上一个摄像头的今日抓拍
+ this.videoFaceList = []
this.currentFaces = []
// 摄像头名字用于展示
this.barrierName = data.label
@@ -469,10 +519,12 @@
// 获取任务名称
this.getTaskNameByCameraId(this.cameraId)
// 切换摄像头时默认查询一条数据展示
- this.initTotal(this.cameraId)
+ //this.initTotal(this.cameraId)
+ //切换摄像头的地址,同时向算法端传递参数
+ this.getRtspByCameraId(this.cameraId)
// ws 关闭再打开是为了调用send()方法传递摄像头id
- this.websocketclose()
- this.websocketonopen()
+ // this.websocketclose()
+ // this.websocketonopen()
}
},
// 打开预警任务
diff --git a/src/views/modules/monitoring/surveillance.vue b/src/views/modules/monitoring/surveillance.vue
index cff1ac5..d0fd43b 100644
--- a/src/views/modules/monitoring/surveillance.vue
+++ b/src/views/modules/monitoring/surveillance.vue
@@ -1,33 +1,33 @@
-
-
-
-
-
-
-
-
-
-
- {{item.label}}
-
-
-
-
-
- 运行中
- 已暂停
-
-
-
- 搜索
- 重置
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
新建布控任务
@@ -117,7 +117,7 @@
- {{scope.row.disposalType == '1' ? '抓捕类' : scope.row.disposalType == '2' ? '监控类' :'提示类'}}
+ {{scope.row.disposalType}}
@@ -140,11 +140,11 @@
-
-
- 查看
-
-
+
+
+
+
+
抓捕类
监控类型
提示类 -->
- 严重告警结果,针对需要立即处理的对象
- 普通告警结果,针对需要关注的对象
- 结果通知,可用于演示或测试使用
+
+
+
@@ -183,7 +183,7 @@
-
+
@@ -237,12 +237,12 @@
object: '1',
library: '',
targetImg: '',
- disposalType: '3',
+ disposalType: '',
monitorType: '1',
time: '',
monitorArea: '',
cameraList: '',
- monitorThreshold: 20,
+ monitorThreshold: 0,
police: '1',
polices: '',
note: '',
diff --git a/src/views/modules/monitoring/warning.vue b/src/views/modules/monitoring/warning.vue
index 24fb52a..2b600d4 100644
--- a/src/views/modules/monitoring/warning.vue
+++ b/src/views/modules/monitoring/warning.vue
@@ -40,7 +40,7 @@
-
+