-
-
-
-
-
+
@@ -163,13 +172,15 @@
import 'element-ui/lib/theme-chalk/display.css';
import Task from './barrier-task'
import barrierAllPic from './barrier-all-pic'
+ import videoControl from'./video-control'
export default {
directives: {
clickoutside
},
components: {
Task,
- barrierAllPic
+ barrierAllPic,
+ videoControl
},
data() {
return {
@@ -200,13 +211,15 @@
totalSnapShot: 0,
// 预警列表
warningList: [],
+ videoFaceList:[],
// 预警音乐类型
warningType: "",
+ cameraList:[{ rtspUrl: "rtsp://admin:123uestc@192.168.1.32:554/h264"}],
}
},
mounted() {
//this.timer = setInterval(this.get, 1000);
- this.get()
+ // this.get()
},
beforeDestroy() {},
created() {
@@ -218,15 +231,18 @@
methods: {
get(){
- this.warningList = [];
+ this.videoFaceList = [];
// console.log("this waringlist"+this.warningList);
- this.$http.get("/faces/list").then(res => {
- this.warningList = res.data;
+ this.$http.get("/faces/returnList").then(res => {
+ this.videoFaceList = res.data;
})
},
+ plays(){
+ this.cameraList.push({rtspUrl: "rtsp://admin:123uestc@192.168.1.32:554/h264"});
+ },
// 初始化4条预警数据
initGetWarningPicture() {
- this.$http.post("/warning/alarm", {
+ this.$http.post("/faces/compareList", {
"page": {
"pageNo": 1,
"pageSize": 4,
@@ -325,27 +341,15 @@
console.log("WebSocket Connection closed");
},
websocketonmessage(e) {
+ console.log("数据传输")
+ console.log(e)
// ws数据字符串转json
let wsObj = JSON.parse(e.data)
+ console.log("this wsObj")
+ console.log(wsObj)
// ws数据推送成功
- if (wsObj.code === 200) {
- // wsObj.cmd === "BAYONET" 人脸抓拍图片
- if (wsObj.cmd === "BAYONET") {
- this.getPicture(wsObj.data)
- }
- // wsObj.cmd === "WARNING" 预警信息
- else {
- // 处理ws推送的预警信息
- this.getWarningPicture(wsObj.data)
- }
- } else if (wsObj.code === 401) {
- this.$router.replace({
- name: 'login'
- })
- } else {
- this.$message.error(wsObj.message)
- this
- }
+ // 处理ws推送的预警信息
+ this.getWarningPicture(wsObj)
},
// 抓拍的图片处理
getPicture(obj) {
@@ -383,18 +387,22 @@
*/
getWarningPicture(warningData) {
// warningData为数组说明是初始化数据,为对象说明是ws推送的数据
- if (!Array.isArray(warningData)) {
+
if (this.warningList.length === 4) {
this.warningList.pop()
this.warningList.unshift(warningData)
} else {
- this.warningList.unshift(warningData)
+ console.log("this warningDAta")
+ console.log(warningData)
+ this.warningList = warningData
+ // this.warningList.unshift(warningData)
+ console.log("this warningList")
+ console.log(this.warningList)
}
// 声音 和 tips预警
let warningType = this.$refs.notice
warningType.play()
- this.$message.warning("有新的预警信息")
- }
+ // this.$message.warning("有新的预警信息")
this.warningList.forEach((item, index, arr) => {
// "1" 红色#FF343E "2" 橙色#FFA61A "0" 蓝色#2FC8FA
// if (item.taskType == "1" || item.taskType == "2" || item.taskType == "3") {
diff --git a/vue.config.js b/vue.config.js
index 09a5a42..4aedb2b 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -19,6 +19,15 @@ module.exports = {
overlay: {
errors: true,
warnings: true
+ },
+ proxy:{
+ '/api':{
+ target:"http://192.168.1.181:8286/",
+ changeOrigin: true,
+ pathRewrite: {
+ '^/api':'/api'
+ }
+ }
}
}
}