From de0bcfd8a025f11b95a0add789f65cf4912fadab Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Mon, 26 Jun 2023 14:22:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96gps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/alarmHandling/index.vue | 4 +- src/views/components/carouselChart.vue | 4 +- .../components/gpsPosition.vue | 128 ++++++++++++++++++ src/views/realTimeMonitor/index.vue | 71 +++++++++- 4 files changed, 201 insertions(+), 6 deletions(-) create mode 100644 src/views/realTimeMonitor/components/gpsPosition.vue diff --git a/src/views/alarmHandling/index.vue b/src/views/alarmHandling/index.vue index 28495ce..c958e50 100644 --- a/src/views/alarmHandling/index.vue +++ b/src/views/alarmHandling/index.vue @@ -328,6 +328,7 @@ export default { }, methods: { imgOnload() { + console.log("加载完成"); this.alarmLoading = false; this.canvasloading = false; }, @@ -450,7 +451,6 @@ export default { this.ctx.strokeStyle = "#ff0000"; // 线宽设置,必须放在绘制之前 this.ctx.lineWidth = 1; - // 绘制矩形 var scaleX = this.canvas.width / data.photoWidth, //this.iw图片的宽 scaleY = this.canvas.height / data.photoHeight; //this.ih图片的高 @@ -507,6 +507,7 @@ export default { this.alarmLoading = true; console.log(row); this.photoPic = row.path; + console.log(this.photoPic); this.selectRow = row; //未读变已读 if (row.isread == 0) { @@ -524,6 +525,7 @@ export default { }); }, 300); } + this.$nextTick(() => { this.drawline(row); }); diff --git a/src/views/components/carouselChart.vue b/src/views/components/carouselChart.vue index 93c3991..16012f1 100644 --- a/src/views/components/carouselChart.vue +++ b/src/views/components/carouselChart.vue @@ -1,12 +1,12 @@ + + diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue index c99658c..d30358b 100644 --- a/src/views/realTimeMonitor/index.vue +++ b/src/views/realTimeMonitor/index.vue @@ -61,9 +61,6 @@ :terminalPhoto="terminalPhoto" v-if="terminalPhoto.length > 0" > -
@@ -182,12 +179,31 @@ 关闭 + + 获取GPS位置 + + + + GPS开关 + + + 开启GPS + 关闭GPS + +
+ @@ -201,18 +217,21 @@ import { getReturnedPhotoJoggle, alarmMarkJoggle, getTermStatus, + setTermGPSJoggle, } from "@/utils/api/index"; import { mapState } from "vuex"; import carouselChart from "../components/carouselChart.vue"; import setschedule from "./components/setschedule.vue"; import deviceUpgrade from "./components/deviceUpgrade.vue"; import infoDialog from "./components/infoDialog.vue"; +import gpsPosition from "./components/gpsPosition.vue"; export default { components: { carouselChart, setschedule, deviceUpgrade, infoDialog, + gpsPosition, }, data() { return { @@ -493,6 +512,7 @@ export default { this.$refs.setschedule_ref.getSingleAccess(this.channelId, this.cmdid); this.$refs.setschedule_ref.deviceList(); }, + //声光报警开启关闭 handleCommandWarn(command) { switch (command) { case "open": //开启 @@ -731,6 +751,51 @@ export default { } }); }, + //获取GPS位置 + + handleShowGPS() { + this.$refs.gpsdialog_ref.display(); + this.$refs.gpsdialog_ref.getgpsData(this.cmdid, this.newTermId); + console.log(this.cmdid, this.newTermId); + }, + + //切换gps开启关闭 + handleCommandGps(command) { + switch (command) { + case "open": //开启 + this.changeGPS(1, this.cmdid); + break; + case "close": //关闭 + this.changeGPS(0, this.cmdid); + break; + } + }, + changeGPS(val, cmdid) { + console.log(val, cmdid); + setTermGPSJoggle({ gpsstatus: val, cmdId: cmdid }) + .then((res) => { + console.log(res); + if (val == 0) { + this.$message({ + duration: 1500, + message: "关闭GPS", + type: "success", + showClose: true, + }); + } else { + this.$message({ + duration: 1500, + message: "成功开启GPS", + type: "success", + showClose: true, + }); + } + }) + .catch((err) => { + console.log(err); //代码错误、请求失败捕获 + }); + }, + //历史图片 // handlehistoryPic() { // this.$router.push({ path: "/realTimeSearch" });