diff --git a/package.json b/package.json index f426b8e..c4c2537 100644 --- a/package.json +++ b/package.json @@ -41,12 +41,14 @@ "axios": "0.24.0", "clipboard": "2.0.8", "core-js": "3.25.2", + "dayjs": "^1.11.13", "echarts": "4.9.0", "element-ui": "2.15.10", "file-saver": "2.0.5", "flv.js": "^1.6.2", "fuse.js": "6.4.3", "highlight.js": "9.18.5", + "jquery": "^3.7.1", "js-beautify": "1.13.0", "js-cookie": "3.0.1", "jsencrypt": "3.0.0-rc.1", diff --git a/src/App.vue b/src/App.vue index 6283b38..858ac04 100644 --- a/src/App.vue +++ b/src/App.vue @@ -23,4 +23,5 @@ export default { background: linear-gradient(to right, rgba(31, 45, 50, 1), rgba(11, 19, 24, 1)); height: calc(100vh - 84px); } + diff --git a/src/api/quniao/infoStatistics.js b/src/api/quniao/infoStatistics.js new file mode 100644 index 0000000..961b3c2 --- /dev/null +++ b/src/api/quniao/infoStatistics.js @@ -0,0 +1,16 @@ +import request from '@/utils/request'; +export function intrusionNum(data) { + return request({ + url: `/api/brid/intrusionNum`, + method: 'post', + data: data + }) +} +// 鸟类入侵警告 +export function reportList(data) { + return request({ + url: `/api/brid/reportList`, + method: 'post', + data: data + }) +} \ No newline at end of file diff --git a/src/api/quniao/soundWave.js b/src/api/quniao/soundWave.js index 4834873..2a56eeb 100644 --- a/src/api/quniao/soundWave.js +++ b/src/api/quniao/soundWave.js @@ -126,4 +126,13 @@ export function videoLogin(data) { method: 'get', // data: data }) +} +// 一键开关声波设备 +export function openCloseDevice(data) { + return request({ + baseUrl: 'VUE_APP_CAMERA_API', + url: '/api/brid/openCloseDevice', + method: 'post', + data: data + }) } \ No newline at end of file diff --git a/src/components/FlvPlayer/index.vue b/src/components/FlvPlayer/index.vue index 5a73154..becb25c 100644 --- a/src/components/FlvPlayer/index.vue +++ b/src/components/FlvPlayer/index.vue @@ -1,6 +1,6 @@ @@ -9,18 +9,35 @@ import flvjs from "flv.js"; export default { name: "FlvPlayer", - props: { - src: { - type: String, - required: true, - default: "", + // props: { + // src: { + // type: String, + // required: true, + // default: "", + // }, + // }, + + // mounted() { + // this.$nextTick(() => { + // if (this.src) { + // console.log(this.src,'获取到了视频流') + // console.log(this.src) + // this.initFlvPlayer(); + // } + // }); + // }, + props: ["src"], + watch: { + src(newVal) { + if (newVal) { + console.log(newVal, "获取到了视频流"); + this.initFlvPlayer(); + } }, }, - mounted() { - this.initFlvPlayer(); - }, methods: { initFlvPlayer() { + console.log(this.src, "视频播放组件"); const videoElement = this.$refs.videoElement; if (flvjs.isSupported()) { const flvPlayer = flvjs.createPlayer({ @@ -57,12 +74,48 @@ export default { \ No newline at end of file diff --git a/src/views/quniao/device/index.vue b/src/views/quniao/device/index.vue index 2ae24bd..6fe46dd 100644 --- a/src/views/quniao/device/index.vue +++ b/src/views/quniao/device/index.vue @@ -260,7 +260,7 @@ import { appearStatusReq, loopPlayReq, musicListReq, - addDeviceTask + addDeviceTask, } from "@/api/quniao/deviceOption"; import musicList from "./musicList.vue"; export default { @@ -401,7 +401,7 @@ export default { //获取任务列表 getTaskList() { getDeviceTaskList().then((res) => { - console.log(res); + console.log(res, "获取任务列表"); if (res.code == 200) { this.taskListData = res.rows; } @@ -547,24 +547,35 @@ export default { taskTimes: [{ taskTime: this.dayData }], startTimeinfo: this.formatTime(this.startTime), endTimeinfo: this.formatTime(this.endTime), - taskName:this.taskName + taskName: this.taskName, }; - console.log(data); - addDeviceTask(data).then(res=>{ - console.log(res,1111111111) - if(res.code==200){ - this.getTaskList() - } - }) + if ( + data.deviceIds && + data.taskType && + data.taskTimes && + data.startTimeinfo && + data.endTimeinfo && + data.taskName + ) { + addDeviceTask(data).then((res) => { + console.log(res, 1111111111); + if (res.code == 200) { + this.getTaskList(); + } + }); + } else { + this.$message.error("请填写完整信息"); + } + console.log(data); }, // 时间格式转换 formatTime(chinaStandard) { var date = new Date(chinaStandard); - // var y = date.getFullYear(); - // var m = date.getMonth() + 1; - // m = m < 10 ? "0" + m : m; - // var d = date.getDate(); - // d = d < 10 ? "0" + d : d; + // var y = date.getFullYear(); + // var m = date.getMonth() + 1; + // m = m < 10 ? "0" + m : m; + // var d = date.getDate(); + // d = d < 10 ? "0" + d : d; var h = date.getHours(); h = h < 10 ? "0" + h : h; var minute = date.getMinutes(); diff --git a/src/views/quniao/infoStatistics/index.vue b/src/views/quniao/infoStatistics/index.vue index 6e96cff..7d3b5ce 100644 --- a/src/views/quniao/infoStatistics/index.vue +++ b/src/views/quniao/infoStatistics/index.vue @@ -1,27 +1,613 @@ + \ No newline at end of file diff --git a/src/views/quniao/soundWave/index copy.vue b/src/views/quniao/soundWave/index copy.vue deleted file mode 100644 index edf4666..0000000 --- a/src/views/quniao/soundWave/index copy.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/quniao/soundWave/index.vue b/src/views/quniao/soundWave/index.vue index e075b39..017a340 100644 --- a/src/views/quniao/soundWave/index.vue +++ b/src/views/quniao/soundWave/index.vue @@ -294,7 +294,11 @@
-
+
驱鸟双目相机(可见光)
- - +
+ +
-
+
驱鸟双目相机(红外)
- +
+ +
- + + 一键关闭 + + + 一键开启 +
- - + + - + - + { - console.log(res, "可见光视频"); - }); - }, // 初始化摄像头列表 initCameraList() { cameraList().then((res) => { - console.log(res, 1111, "请求后台获取摄像头的通道号"); - let cameraListName = res; - let result1 = cameraListName.filter((item) => { + this.cameraListName = res; + let result1 = this.cameraListName.filter((item) => { return item.name == "驱鸟双目相机(可见光)"; }); console.log(result1, "result1"); - this.channel = result1[0].channel; - this.cameraCode = result1[0].code; - // this.cameraPreform(channel); - this.initPositionList(); + if (result1.length !== 0) { + this.channel = result1[0].channel; + this.cameraCode = result1[0].code; + this.initPositionList(); + } }); }, // 获取nvrList @@ -699,15 +733,21 @@ export default { }, // 新增巡视任务确定 dialogOkBtn() { - addPatrolTask(this.dialogForm).then((res) => { - if (res.code == 200) { - this.$message({ - message: "新增成功", - type: "success", + this.$refs.ruleForm.validate((valid) => { + if (valid) { + addPatrolTask(this.dialogForm).then((res) => { + if (res.code == 200) { + this.$message({ + message: "新增成功", + type: "success", + }); + this.dialogVisible = false; + this.dialogForm = {}; + this.initPatrolTaskList(); + } else { + return false; + } }); - this.dialogVisible = false; - this.dialogForm = {}; - this.initPatrolTaskList(); } }); }, @@ -743,13 +783,74 @@ export default { }, // 获取视频登录 initVideoLogin() { + var that = this; + let best_URL = process.env.VUE_APP_CAMERA_API; videoLogin().then((res) => { - console.log(res, "获取视频登录"); - // setToken - setToken(res.data.accessToken); - // this.initVideoPlayer1(); + $.ajax({ + url: `${best_URL}/api/push/getPlayUrl?app=1&stream=1&mediaServerId=zlmediakit-local`, + type: "GET", + contentType: "application/json", + headers: { + "access-token": `${res.data.accessToken}`, + }, + success: function (res) { + that.videoPlayer1 = res.data.flv; + }, + }); + $.ajax({ + url: `${best_URL}/api/push/getPlayUrl?app=2&stream=2&mediaServerId=zlmediakit-local`, + type: "GET", + contentType: "application/json", + headers: { + "access-token": `${res.data.accessToken}`, + }, + success: function (res) { + that.videoPlayer2 = res.data.flv; + }, + }); }); }, + // 一键开启关闭声波 + oneKeyBtn(Blob, num) { + oneKeyReq(num).then((res) => { + console.log(res, "控制声波设备"); + if (res.code == 200) { + this.oneKeyButtonNum = !Blob; + this.$message({ + message: res.msg, + type: "success", + }); + } + }); + }, + // 获取声波列表 + initDeviceList() { + deviceListReq().then((res) => { + let data = res.rows; + let dataBole = data.every((item) => item.volume1Status == 0); + // console.log(dataBole,"设备列表") + this.oneKeyButtonNum = dataBole; + }); + }, + // 点击切换通道号 + video_canvasBtn(num) { + this.video_canvas_index = num; + var name = ""; + if (num == 0) { + name = "驱鸟双目相机(可见光)"; + } else { + name = "驱鸟双目相机(红外)"; + } + let result1 = this.cameraListName.filter((item) => { + return item.name == name; + }); + console.log(result1, "result1",name); + if (result1.length !== 0) { + this.channel = result1[0].channel; + this.cameraCode = result1[0].code; + this.initPositionList(); + } + }, }, mounted() { this.$nextTick(() => { @@ -773,6 +874,7 @@ export default { this.presetting_list_title(this.presetting_list_title_index); this.initVideoLogin(); + this.initDeviceList(); }, beforeDestroy() {}, }; @@ -1092,7 +1194,7 @@ tbody tr td { } .cameraContent { width: 100%; - height: calc(100vh - 120px); + height: calc(100vh - 125px); display: flex; flex-direction: column; justify-content: space-between; @@ -1205,6 +1307,7 @@ video { justify-content: center; align-items: center; font-size: 1vw; + cursor: pointer; } .quedin { border: 1px solid rgb(64, 229, 240); @@ -1328,6 +1431,82 @@ video { margin-bottom: 4px; margin-right: 10px; } +.oneKeyButton { + position: absolute; + right: 4%; + top: 2%; + width: 7%; + height: 5%; + font-size: 1vw; + cursor: pointer; + z-index: 99999; +} + +.oneKeyButton > span { + display: flex; + width: 100%; + height: 100%; + justify-content: center; + align-items: center; +} + +.openDevice { + border: 1px solid #43e7f2; + color: #43e7f2; + background: linear-gradient( + 45deg, + rgb(67, 231, 242, 0.4), + rgb(67, 231, 242, 0.2), + rgb(0, 0, 0, 0), + rgb(0, 0, 0, 0), + rgb(0, 0, 0, 0), + rgb(67, 231, 242, 0.2), + rgb(67, 231, 242, 0.4) + ), + linear-gradient( + 135deg, + rgb(67, 231, 242, 0.4), + rgb(67, 231, 242, 0.2), + rgb(0, 0, 0, 0), + rgb(0, 0, 0, 0), + rgb(0, 0, 0, 0), + rgb(67, 231, 242, 0.2), + rgb(67, 231, 242, 0.4) + ); +} + +.closeDevice { + /* display: none; */ + border: 1px solid #767c97; + color: #c6d3ec; + background: linear-gradient( + 45deg, + rgb(118, 124, 151, 0.4), + rgb(118, 124, 151, 0.2), + rgb(0, 0, 0, 0), + rgb(0, 0, 0, 0), + rgb(0, 0, 0, 0), + rgb(118, 124, 151, 0.2), + rgb(118, 124, 151, 0.4) + ), + linear-gradient( + 135deg, + rgb(118, 124, 151, 0.4), + rgb(118, 124, 151, 0.2), + rgb(0, 0, 0, 0), + rgb(0, 0, 0, 0), + rgb(0, 0, 0, 0), + rgb(118, 124, 151, 0.2), + rgb(118, 124, 151, 0.4) + ); +} +.video_box { + height: 100%; +} +#shipin1_video1, +#shipin1_video2 { + height: 90%; +}