diff --git a/src/views/big-screen/index.vue b/src/views/big-screen/index.vue index ddfc2e6..b19d343 100644 --- a/src/views/big-screen/index.vue +++ b/src/views/big-screen/index.vue @@ -2,7 +2,7 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-10-17 11:34:00 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-12-02 10:24:07 + * @LastEditTime: 2024-12-02 10:47:38 * @FilePath: \znxjxt-ui\src\views\big-screen\index.vue * @Description: 大屏首页 --> @@ -1239,8 +1239,8 @@ export default { .getCoordinates(); const targetLocation = item.data.location; // 计算两点之间的差值 - const dx = (targetLocation[0] - currentLocation[0]) / 100; - const dy = (targetLocation[1] - currentLocation[1]) / 100; + const dx = (targetLocation[0] * 1 - currentLocation[0] * 1) / 100; + const dy = (targetLocation[1] * 1 - currentLocation[1] * 1) / 100; // 设置计数器 let count = 0; // 创建定时器,每10ms移动一次,总共移动100次,约1秒完成 @@ -1252,8 +1252,8 @@ export default { } // 计算当前帧的位置 - const x = currentLocation[0] + dx * count; - const y = currentLocation[1] + dy * count; + const x = currentLocation[0] * 1 + dx * count; + const y = currentLocation[1] * 1 + dy * count; // 更新小车位置 const [features] = this.carMapPointSource.getFeatures(); @@ -1380,6 +1380,7 @@ export default { }, beforeDestroy() { clearInterval(this.timeFlag); + // 发送停止接收小车位置 const data = { type: "carLocation", status: false }; this.$ws.send(data); }, diff --git a/src/views/big-screen/overview-components/components/inspection-follow.vue b/src/views/big-screen/overview-components/components/inspection-follow.vue index f76f4d3..edfdeef 100644 --- a/src/views/big-screen/overview-components/components/inspection-follow.vue +++ b/src/views/big-screen/overview-components/components/inspection-follow.vue @@ -2,7 +2,7 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-11-15 13:14:03 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-11-15 14:06:48 + * @LastEditTime: 2024-12-02 10:46:24 * @FilePath: \znxjxt-ui\src\views\big-screen\overview-components\components\inspection-follow.vue * @Description: 总览大屏-巡检车辆-跟车弹窗 --> @@ -15,12 +15,6 @@ diff --git a/src/views/big-screen/overview-components/inspection-vehicles.vue b/src/views/big-screen/overview-components/inspection-vehicles.vue index 28bc227..084b956 100644 --- a/src/views/big-screen/overview-components/inspection-vehicles.vue +++ b/src/views/big-screen/overview-components/inspection-vehicles.vue @@ -79,7 +79,6 @@ size="mini" type="text" style="margin-right: 0.6rem" - @click="detailDefect(scope.row)" >详情 @@ -151,7 +150,6 @@ import { getCarList, closeVideoUrl } from "@/api/xj/screen/disease-screen"; import InspectionFollow from "./components/inspection-follow.vue"; import InspectionView from "./components/inspection-view.vue"; -import { closeWebsocket } from "@/plugins/websocket.js"; export default { name: "InspectionVehicles", components: { @@ -229,13 +227,6 @@ export default { this.getTableData(); }, - /** - * @description: 表格详情事件 - * @param {*} val - * @return {*} - */ - detailDefect(val) {}, - /** * @description: 表格跟车事件 * @param {*} val @@ -244,6 +235,8 @@ export default { followCar(val) { this.followTitle = "跟车详情"; this.showCarVisible = true; + const carData = { type: "carLocation", status: true }; + this.$ws.send(carData); }, /** @@ -266,7 +259,9 @@ export default { this.followTitle = ""; this.showCarVisible = false; this.dialogItem = {}; - closeWebsocket(); + // 停止接收病害信息 + const carData = { type: "carLocation", status: false }; + this.$ws.send(carData); }, /**