From 7b745c6f4c82fefef2b2290ffb6c49e499bfb659 Mon Sep 17 00:00:00 2001
From: SunTao <328867980@qq.com>
Date: Tue, 3 Dec 2024 15:24:58 +0800
Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E8=B7=9F=E8=BD=A6=E7=97=85?=
=?UTF-8?q?=E5=AE=B3=E8=B0=83=E6=95=B4=EF=BC=8C=E8=B7=9F=E8=BD=A6=E8=A7=86?=
=?UTF-8?q?=E9=A2=91=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package.json | 1 +
.../disease-components/traffic-safety.vue | 4 +-
.../components/inspection-follow.vue | 59 +++++++++-
.../components/inspection-view.vue | 111 ++++++++++++------
.../inspection-vehicles.vue | 4 +-
.../overview-components/today-inspection.vue | 4 +-
.../components/image-dialog.vue | 42 +++----
7 files changed, 159 insertions(+), 66 deletions(-)
diff --git a/package.json b/package.json
index cd710f2..bf7947f 100644
--- a/package.json
+++ b/package.json
@@ -48,6 +48,7 @@
"echarts-gl": "^2.0.9",
"element-ui": "2.15.14",
"file-saver": "2.0.5",
+ "flv.js": "^1.6.2",
"fuse.js": "6.4.3",
"highlight.js": "9.18.5",
"js-beautify": "1.13.0",
diff --git a/src/views/big-screen/disease-components/traffic-safety.vue b/src/views/big-screen/disease-components/traffic-safety.vue
index ce9bd38..770194f 100644
--- a/src/views/big-screen/disease-components/traffic-safety.vue
+++ b/src/views/big-screen/disease-components/traffic-safety.vue
@@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com
* @Date: 2024-10-21 09:59:32
* @LastEditors: SunTao 328867980@qq.com
- * @LastEditTime: 2024-11-21 09:05:48
+ * @LastEditTime: 2024-12-03 14:52:09
* @FilePath: \znxjxt-ui\src\views\big-screen\disease-components\traffic-safety.vue
* @Description: 病害巡检大屏-今日巡查
-->
@@ -635,7 +635,7 @@ export default {
align-items: center;
justify-content: center;
padding-left: 1.5rem;
- font-size: 2rem;
+ font-size: 1.5rem;
// background-image: url("../../../assets/screen/traffic/traffic-left.png");
background-image: url("~@/assets/screen/disease/today-left.png");
background-repeat: no-repeat;
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 f9b25e5..03b9321 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-12-03 13:10:46
+ * @LastEditTime: 2024-12-03 14:32:34
* @FilePath: \znxjxt-ui\src\views\big-screen\overview-components\components\inspection-follow.vue
* @Description: 总览大屏-巡检车辆-跟车弹窗
-->
@@ -32,6 +32,8 @@ export default {
return {
// 小车图层数据源
carLayerSource: null,
+ // 病害图层数据源
+ defectLayerSource: null,
};
},
created() {
@@ -47,8 +49,7 @@ export default {
if (item.type === "carPosition") {
if (!this.carMapPointSource) {
this.drawCarMapPoint(item.data);
- }
- else {
+ } else {
// 获取当前位置和目标位置
const currentLocation = this.carMapPointSource
.getFeatures()[0]
@@ -58,7 +59,7 @@ export default {
// 计算两点之间的差值
const dx = (targetLocation[0] * 1 - currentLocation[0] * 1) / 100;
const dy = (targetLocation[1] * 1 - currentLocation[1] * 1) / 100;
-
+
// 设置计数器
let count = 0;
// 创建定时器,每10ms移动一次,总共移动100次,约1秒完成
@@ -90,7 +91,16 @@ export default {
}, 10);
}
} else if (item.type === "defect") {
- console.log(item, "生成得病害");
+ if (!this.defectLayerSource) {
+ this.drawDefectMapPoint(item.data);
+ } else {
+ const feature = new Feature({
+ geometry: new Point(item.geometry.coordinates),
+ data: item,
+ type: "defectPoint",
+ });
+ this.defectLayerSource.addFeature(feature);
+ }
}
});
},
@@ -135,6 +145,45 @@ export default {
map.addLayer(carMapPointLayer);
});
},
+
+ /**
+ * @description: 绘制病害地图点位
+ * @param {object} item
+ * @return {void}
+ */
+ drawDefectMapPoint(item) {
+ const features = [];
+ const feature = new Feature({
+ geometry: new Point(item.geometry.coordinates),
+ data: item,
+ type: "defectPoint",
+ });
+ // 可以给点位设置样式
+ feature.setStyle([
+ new Style({
+ image: new Icon({
+ crossOrigin: "anonymous",
+ src: require(`@/assets/screen/index/${item.defecttype}.png`),
+ // 图标缩放比例
+ scale: 0.5,
+ }),
+ }),
+ ]);
+ features.push(feature);
+ this.defectLayerSource = new VectorSource({
+ features,
+ });
+ const carMapPointLayer = new VectorLayer({
+ source: this.defectLayerSource,
+ properties: {
+ type: "defectPoint",
+ },
+ });
+ this.$nextTick(() => {
+ const map = this.$refs.carMap.instance.get("map");
+ map.addLayer(carMapPointLayer);
+ });
+ },
},
};
diff --git a/src/views/big-screen/overview-components/components/inspection-view.vue b/src/views/big-screen/overview-components/components/inspection-view.vue
index 8b7a244..c190c34 100644
--- a/src/views/big-screen/overview-components/components/inspection-view.vue
+++ b/src/views/big-screen/overview-components/components/inspection-view.vue
@@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com
* @Date: 2024-11-15 14:23:21
* @LastEditors: SunTao 328867980@qq.com
- * @LastEditTime: 2024-12-03 13:35:29
+ * @LastEditTime: 2024-12-03 14:14:14
* @FilePath: \znxjxt-ui\src\views\big-screen\overview-components\components\inspection-view.vue
* @Description: 总览大屏-巡检车辆-视频查看弹窗
-->
@@ -10,18 +10,20 @@
diff --git a/src/views/big-screen/overview-components/inspection-vehicles.vue b/src/views/big-screen/overview-components/inspection-vehicles.vue
index 95fa72d..3b3ccf4 100644
--- a/src/views/big-screen/overview-components/inspection-vehicles.vue
+++ b/src/views/big-screen/overview-components/inspection-vehicles.vue
@@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com
* @Date: 2024-11-08 09:40:18
* @LastEditors: SunTao 328867980@qq.com
- * @LastEditTime: 2024-12-03 13:19:02
+ * @LastEditTime: 2024-12-03 14:10:16
* @FilePath: \znxjxt-ui\src\views\big-screen\overview-components\inspection-vehicles.vue
* @Description: 总览大屏-巡检车辆
-->
@@ -132,7 +132,7 @@
@@ -622,7 +622,7 @@ export default {
span {
cursor: pointer;
- font-size: 2rem;
+ font-size: 1.5rem;
font-weight: 800;
font-family: "DouYu";
background: linear-gradient(
diff --git a/src/views/xj/inspection/confirmation-management/components/image-dialog.vue b/src/views/xj/inspection/confirmation-management/components/image-dialog.vue
index 99a828f..f5345c5 100644
--- a/src/views/xj/inspection/confirmation-management/components/image-dialog.vue
+++ b/src/views/xj/inspection/confirmation-management/components/image-dialog.vue
@@ -2,8 +2,8 @@
* @Author: SunTao 328867980@qq.com
* @Date: 2024-11-01 17:25:06
* @LastEditors: SunTao 328867980@qq.com
- * @LastEditTime: 2024-11-14 15:00:35
- * @FilePath: \znxjxt-ui\src\views\xj\inspection\confirmation-management\image-dialog.vue
+ * @LastEditTime: 2024-12-03 15:14:12
+ * @FilePath: \znxjxt-ui\src\views\xj\inspection\confirmation-management\components\image-dialog.vue
* @Description: 病害确认-影像模式弹窗
-->
@@ -139,10 +139,10 @@
@@ -416,21 +416,23 @@ export default {
/* 是病害/不是病害点击事件 */
changeDefect(value) {
- mergeDefect({
- status: value,
- snapShotIds: [this.defectData[this.currentIndex].snapshotId],
- })
- .then(({ code, msg }) => {
- if (code === 200) {
- this.showImage(this.currentIndex);
- this.$modal.msgSuccess("修改成功");
- } else {
- this.$modal.msgWarning(msg);
- }
+ if (this.defectData.length > 0) {
+ mergeDefect({
+ status: value,
+ snapShotIds: [this.defectData[this.currentIndex].snapshotId],
})
- .finally(() => {
- this.getList();
- });
+ .then(({ code, msg }) => {
+ if (code === 200) {
+ this.showImage(this.currentIndex);
+ this.$modal.msgSuccess("修改成功");
+ } else {
+ this.$modal.msgWarning(msg);
+ }
+ })
+ .finally(() => {
+ this.getList();
+ });
+ }
},
/* 键盘事件 */
@@ -457,10 +459,10 @@ export default {
}
} else if (event.keyCode === 89) {
// 确认病害
- this.changeDefect(1);
+ this.changeDefect(2);
} else if (event.keyCode === 78) {
// 不是病害
- this.changeDefect(0);
+ this.changeDefect(3);
}
},
},