Commit 1fee76e4 authored by 纪泽龙's avatar 纪泽龙

Merge branch 'jzl'

parents 2196ccc2 03b095da
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-06-21 09:24:11
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-13 17:53:09
* @LastEditTime: 2022-10-10 10:01:57
* @FilePath: /danger-manage-web/src/components/bigWindow/Danger.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
......@@ -37,21 +37,50 @@
<span class="left">监测值:</span
><span v-unValue class="right">{{ deviceData.jcz }}</span>
</div>
</div>
</div>
</template>
<script>
import { getInfo } from "@/api/map/deviceInfo";
export default {
name: "tcq",
data() {
return {};
return {
deviceData: null,
};
},
mounted() {
console.log(this.deviceData);
created() {
// console.log(this.deviceData);
this.$nextTick(() => {
this.getInfo(this.deviceData.deviceId);
});
},
methods: {
getInfo(id) {
getInfo(id).then((res) => {
const data = res.data;
const obj = {
deviceId: data.mapDeviceId,
latitude: data.latitude,
longitude: data.longitude,
deviceType: data.mapDeviceType,
title: data.mapDeviceName,
sbmc: data.mapDeviceName,
// 号
sbbh: item.mapDeviceNum,
// 探测介质
tcjz: data.mapDeviceMedium,
sbzt: data.monitorDeviceStatus,
jcz: data.monitorValue + "" + data.mapDeviceUnit,
shortNum: 12,
config: { scale: 1, textHeight: -94 },
};
this.deviceData = obj;
});
},
close() {
//this.handleClose();
this.mapClass.clearInfoWindow();
......
/*
* @Author: your name
* @Date: 2022-02-25 17:07:40
* @LastEditTime: 2022-02-26 20:59:40
* @LastEditors: Please set LastEditors
* @LastEditTime: 2022-10-10 10:01:14
* @LastEditors: 纪泽龙 jizelong@qq.com
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /newDev/gassafety-progress/gassafetyprogress-web/src/directive/permission/hasValue.js
*/
......@@ -11,8 +11,19 @@
* Copyright (c) 2021 gassafety
*/
export default {
export default {
inserted(el, binding, vnode) {
el.innerHTML = el.innerHTML.replace(/\s+/g, "") ? el.innerHTML : "-";
}
// console.log("开始")
if (!el.innerHTML.replace(/\s+/g, "")) {
el.innerHTML = "-";
}
// el.innerHTML = el.innerHTML.replace(/\s+/g, "") ? el.innerHTML : "-";
},
componentUpdated(el, binding, vnode) {
// console.log("改变了", el.innerHTML);
// el.innerHTML = el.innerHTML.replace(/\s+/g, "") ? el.innerHTML : "-";
if (!el.innerHTML.replace(/\s+/g, "")) {
el.innerHTML = "-";
}
},
};
/*
* @Author: your name
* @Date: 2021-12-07 14:19:18
* @LastEditTime: 2022-10-07 15:24:09
* @LastEditTime: 2022-10-10 10:16:23
* @LastEditors: 纪泽龙 jizelong@qq.com
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /cesium-vue/src/utils/seieumClass.js
......@@ -41,25 +41,46 @@ export const DEVICE_PIC_TYPE = {
ZHIYEWEIHAI: 4,
YINHUAN: 5,
};
// 死数据用的
// const DEVICE_PIC_URL = {
// 1: require("@/assets/marks/jiankong.png"),
// 2: require("@/assets/marks/weixian.png"),
// 3: require("@/assets/marks/qttcq.png"),
// 4: require("@/assets/marks/yltcq.png"),
// 11: require("@/assets/indexImages/bottom/videoUrl.png"),
// 12: require("@/assets/indexImages/bottom/qtbjqUrl.png"),
// 13: require("@/assets/indexImages/bottom/ydtcqUrl.png"),
// 14: require("@/assets/indexImages/bottom/yltcqUrl.png"),
// 15: require("@/assets/indexImages/bottom/wdtcqUrl.png"),
// // 首页的
// };
const DEVICE_PIC_URL = {
1: require("@/assets/marks/jiankong.png"),
2: require("@/assets/marks/weixian.png"),
3: require("@/assets/marks/qttcq.png"),
4: require("@/assets/marks/yltcq.png"),
// 4: require("@/assets/indexImages/bottom/1.png"),
11: require("@/assets/indexImages/bottom/videoUrl.png"),
12: require("@/assets/indexImages/bottom/qtbjqUrl.png"),
13: require("@/assets/indexImages/bottom/ydtcqUrl.png"),
14: require("@/assets/indexImages/bottom/yltcqUrl.png"),
15: require("@/assets/indexImages/bottom/wdtcqUrl.png"),
// 工业探测器
1: require("@/assets/indexImages/bottom/gytcqUrl.png"),
// 温度变送器
2: require("@/assets/indexImages/bottom/wdbsqUrl.png"),
// 压力监测设备
3: require("@/assets/indexImages/bottom/yljcqUrl.png"),
// 液位探测器
4: require("@/assets/indexImages/bottom/ywtcqUrl.png"),
// 摄像头
5: require("@/assets/indexImages/bottom/video2.png"),
// 危险骷髅
10: require("@/assets/marks/weixian.png"),
// 11: require("@/assets/indexImages/bottom/videoUrl.png"),
// 12: require("@/assets/indexImages/bottom/qtbjqUrl.png"),
// 13: require("@/assets/indexImages/bottom/ydtcqUrl.png"),
// 14: require("@/assets/indexImages/bottom/yltcqUrl.png"),
// 15: require("@/assets/indexImages/bottom/wdtcqUrl.png"),
// 首页的
};
const DEVICE_PIC_URL_WRING = {
12: require("@/assets/indexImages/bottom/qtbjqUrlWring.png"),
// 12: require("@/assets/indexImages/bottom/qtbjqUrlWring.png"),
};
const DEVICE_PIC_URL_ALARM = {
12: require("@/assets/indexImages/bottom/qtbjqUrlAlarm.png"),
// 12: require("@/assets/indexImages/bottom/qtbjqUrlAlarm.png"),
};
const arr = [];
const dangerColor = {
......@@ -781,14 +802,15 @@ export default class CreateCesium {
const { longitude, latitude, shortNum, deviceType, title, deviceState } =
item;
let imageUrl;
// 1正常,2警告,3报警,没有的就按原来的算
if (deviceState == 1 || !deviceState) {
imageUrl = DEVICE_PIC_URL[deviceType];
} else if (deviceState == 2) {
imageUrl = DEVICE_PIC_URL_WRING[deviceType];
} else {
imageUrl = DEVICE_PIC_URL_ALARM[deviceType];
}
// // 1正常,2警告,3报警,没有的就按原来的算
// if (deviceState == 1 || !deviceState) {
// imageUrl = DEVICE_PIC_URL[deviceType];
// } else if (deviceState == 2) {
// imageUrl = DEVICE_PIC_URL_WRING[deviceType];
// } else {
// imageUrl = DEVICE_PIC_URL_ALARM[deviceType];
// }
imageUrl = DEVICE_PIC_URL[deviceType];
const obj = this.createPicture(
imageUrl,
......@@ -808,7 +830,7 @@ export default class CreateCesium {
this.deviceTilesArr[deviceType] = [];
}
this.deviceTilesArr[deviceType].push(obj);
console.log("obj", obj);
// console.log("obj", obj);
// }
} else {
// arr.forEach((item) => {
......
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-06-16 15:03:40
* @Date: 2022-09-29 16:57:34
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-30 17:16:23
* @FilePath: /danger-manage-web/src/views/bigwindow/index.vue
* @LastEditTime: 2022-10-10 10:12:39
* @FilePath: /danger-manage-web/src/views/dangerControl/monitor/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="big-window">
<!-- <button @click="$router.push('/')">idnex</button> -->
<!-- <div class="danger">
<el-button @click="dangerChange" type="primary">{{
danger ? "隐藏危险区域" : "展示危险区域"
}}</el-button>
</div> -->
<!-- <div class="go-index">
<el-button @click="$router.push('/index')" type="primary"
>首页</el-button
>
</div> -->
<div id="mapbox"></div>
<div class="index-wrapper">
<Index :charsShow="false" />
</div>
</template>
<script>
import CreateCesium, { DEVICE_PIC_TYPE } from "@/utils/cesium/cesiumClass.js";
import Video from "@/components/bigWindow/video";
import tcq from "@/components/bigWindow/tcq";
import Null from "@/components/bigWindow/Null";
import Danger from "@/components/bigWindow/Danger";
import danger from "@/assets/images/danger.png";
import Editor from "@/components/Editor";
// 危险源实时监测
import Index from "@/views/index.vue";
export default {
name: "monitor",
name: "",
components: {
Editor,
Index,
},
data() {
return {
// Cesium: null,
danger: true,
data1: [
{
deviceType: 11,
longitude: 114.07848044941088,
latitude: 38.24830985372926,
shortNum: 10,
title: "视频1",
},
{
deviceType: 11,
longitude: 114.07858975280202,
latitude: 38.24853877908846,
shortNum: 16,
title: "视频2",
},
{
deviceType: 11,
longitude: 114.0788726514246,
latitude: 38.24854905109693,
shortNum: 16,
title: "视频3",
},
{
deviceType: 11,
longitude: 114.07933673582353,
latitude: 38.24932372451273,
shortNum: 10,
title: "视频4",
},
{
deviceType: 11,
longitude: 114.07943113040781,
latitude: 38.249634714126636,
shortNum: 16,
title: "视频5",
},
{
deviceType: 11,
longitude: 114.08000305885355,
latitude: 38.2494852174479,
shortNum: 16,
title: "视频6",
},
{
deviceType: 11,
longitude: 114.08007200486942,
latitude: 38.249835018521594,
shortNum: 16,
title: "视频7",
},
{
deviceType: 11,
longitude: 114.07771206027549,
latitude: 38.252223651533114,
shortNum: 16,
title: "视频8",
},
],
data2: [
{
deviceType: 3,
longitude: 114.08274961653991,
latitude: 38.24983876031178,
shortNum: 15,
title: "气体探测器",
sbmc: "气体探测器",
sbbh: "HBS030015037",
tcjz: "甲烷",
sbzt: "正常",
},
{
deviceType: 4,
longitude: 114.08344461545148,
latitude: 38.249814328043456,
shortNum: 15,
title: "压力探测器",
sbmc: "压力探测器",
sbbh: "HBS030015037",
tcjz: "压力",
sbzt: "正常",
jcz: "2.3MPa",
},
],
};
},
mounted() {
this.Cesium = new CreateCesium(
"mapbox",
["../3dtiles/jsondata/tileset.json"],
this
);
// this.danger.forEach((item) => {
// this.Cesium.addDanger(item, Danger);
// });
this.data1.forEach((item) => {
item.config = { scale: 1, textHeight: -32 };
this.Cesium.addDevice(item, "pic", Video);
});
this.data2.forEach((item) => {
this.Cesium.addDevice(item, "pic", tcq);
});
},
methods: {
dangerChange() {
this.danger = !this.danger;
// 当infowindow里存在danger-wrappeclass名称时,就清楚infowindow
this.Cesium.dangerTotal(this.danger, "danger-wrappe");
},
},
beforeDestroy() {
// 挂掉该关的 infowindow 跟计算infowindow位置的计时器
this.Cesium.clearInfoWindow();
this.Cesium.destroy();
return {};
},
methods: {},
};
</script>
<style lang="scss" scoped>
.big-window {
.index-wrapper {
width: 100%;
// height: 100%;
height: calc(100vh - 50px);
#mapbox {
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
}
.danger {
position: fixed;
top: 20px;
right: 20px;
z-index: 10;
}
.go-index {
position: fixed;
top: 20px;
left: 20px;
z-index: 10;
}
// height: 100vh;
// background: red;
position: relative;
}
</style>
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-06-16 15:03:40
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-30 17:23:18
* @LastEditTime: 2022-10-10 10:17:30
* @FilePath: /danger-manage-web/src/views/bigwindow/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -62,7 +62,7 @@ export default {
data2: [
{
deviceType: 2,
deviceType: 10,
longitude: 114.081436341043262,
latitude: 38.24983817327583,
shortNum: 7,
......@@ -79,7 +79,7 @@ export default {
yhrscw: "二氧化碳。",
},
{
deviceType: 2,
deviceType: 10,
longitude: 114.07705728663734,
latitude: 38.249097661403205,
shortNum: 6,
......
......@@ -2,19 +2,19 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-03 10:51:24
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-30 17:23:02
* @LastEditTime: 2022-10-10 10:17:13
* @FilePath: /danger-manage-web/src/views/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="index-wrapper">
<Top />
<Left
<Left v-if="charsShow"
ref="left"
@clickShow="clickShow"
@dangerDeviceChange="dangerDeviceChange"
/>
<Right ref="right" />
<Right v-if="charsShow" ref="right" />
<Bottom
v-show="deviceOrDangerType == 1"
@deviceChange="deviceChange"
......@@ -39,8 +39,16 @@ import Top from "@/views/indexComponents/Top";
import Left from "@/views/indexComponents/Left";
import Right from "@/views/indexComponents/Right";
import Bottom from "@/views/indexComponents/Bottom";
import { deviceInfoLists } from "@/api/map/deviceInfo";
export default {
name: "shouye",
props:{
charsShow:{
type:Boolean,
default:true,
}
},
components: {
Top,
Left,
......@@ -53,8 +61,8 @@ export default {
deviceOrDangerType: 1,
data2: [
{
deviceType: 2,
longitude: 114.081436341043262,
deviceType: 10,
longitude: 114.081436341043262,
latitude: 38.24983817327583,
shortNum: 7,
title: "锅炉点火",
......@@ -70,8 +78,8 @@ export default {
yhrscw: "二氧化碳。",
},
{
deviceType: 2,
longitude: 114.07705728663734,
deviceType: 10,
longitude: 114.07705728663734,
latitude: 38.249097661403205,
shortNum: 6,
title: "有害气体",
......@@ -189,56 +197,56 @@ export default {
],
data11: [
{
deviceType: 11,
deviceType: 5,
longitude: 114.07848044941088,
latitude: 38.24830985372926,
shortNum: 10,
title: "视频1",
},
{
deviceType: 11,
deviceType: 5,
longitude: 114.07858975280202,
latitude: 38.24853877908846,
shortNum: 16,
title: "视频2",
},
{
deviceType: 11,
deviceType: 5,
longitude: 114.0788726514246,
latitude: 38.24854905109693,
shortNum: 16,
title: "视频3",
},
{
deviceType: 11,
deviceType: 5,
longitude: 114.07933673582353,
latitude: 38.24932372451273,
shortNum: 10,
title: "视频4",
},
{
deviceType: 11,
deviceType: 5,
longitude: 114.07943113040781,
latitude: 38.249634714126636,
shortNum: 16,
title: "视频5",
},
{
deviceType: 11,
deviceType: 5,
longitude: 114.08000305885355,
latitude: 38.2494852174479,
shortNum: 16,
title: "视频6",
},
{
deviceType: 11,
deviceType: 5,
longitude: 114.08007200486942,
latitude: 38.249835018521594,
shortNum: 16,
title: "视频7",
},
{
deviceType: 11,
deviceType: 5,
longitude: 114.07771206027549,
latitude: 38.252223651533114,
shortNum: 16,
......@@ -365,6 +373,7 @@ export default {
// rootTopShowChange(boolean) {
// this.$parent.$parent.topShow = boolean;
// },
init() {
this.data2.forEach((item, index) => {
if (index == 0) {
......@@ -381,12 +390,59 @@ export default {
item.config = { scale: 1, textHeight: -32 };
this.Cesium.addDevice(item, "pic", Video);
});
this.data12.forEach((item) => {
item.config = { scale: 1, textHeight: -94 };
this.Cesium.addDevice(item, "pic", tcq);
});
// 初始化危险源关闭
// this.data12.forEach((item) => {
// item.config = { scale: 1, textHeight: -94 };
// this.Cesium.addDevice(item, "pic", tcq);
// });
// // 初始化危险源关闭
this.Cesium.dangerAllShow(false);
this.deviceInfoLists();
},
deviceInfoLists() {
deviceInfoLists().then((res) => {
console.log("设备", res);
res
.map((item) => {
let obj;
// 视频
if (item.mapDeviceType == 5) {
obj = {
latitude: item.latitude,
longitude: item.longitude,
deviceId:item.mapDeviceId,
shortNum: 10,
deviceType: item.mapDeviceType,
title: item.mapDeviceName,
config : { scale: 1, textHeight: -32 },
};
} else {
obj = {
deviceId:item.mapDeviceId,
latitude: item.latitude,
longitude: item.longitude,
deviceType: item.mapDeviceType,
title: item.mapDeviceName,
sbmc: item.mapDeviceName,
// 号
sbbh: item.mapDeviceNum,
// 探测介质
tcjz: item.mapDeviceMedium,
sbzt: item.monitorDeviceStatus,
jcz: item.monitorValue + "" + item.mapDeviceUnit,
shortNum: 12,
config : { scale: 1, textHeight: -94 },
};
}
return obj;
})
.forEach((item) => {
if (item.deviceType == 5) {
this.Cesium.addDevice(item, "pic", Video);
} else {
this.Cesium.addDevice(item, "pic", tcq);
}
});
});
},
clickShow(e) {
// 控制两个组件的展示与隐藏
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-13 09:55:30
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-14 10:25:34
* @LastEditTime: 2022-10-09 17:39:15
* @FilePath: /danger-manage-web/src/views/indexComponents/Bottom.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -42,57 +42,78 @@
</template>
<script>
// 视频图标
import video1 from "@/assets/indexImages/bottom/video1.png";
import video2 from "@/assets/indexImages/bottom/video2.png";
// 气体报警器提标
import qtbjq1 from "@/assets/indexImages/bottom/qtbjq1.png";
import qtbjq2 from "@/assets/indexImages/bottom/qtbjq2.png";
// // 视频图标
// import video1 from "@/assets/indexImages/bottom/video1.png";
// import video2 from "@/assets/indexImages/bottom/video2.png";
// // 气体报警器提标
// import qtbjq1 from "@/assets/indexImages/bottom/qtbjq1.png";
// import qtbjq2 from "@/assets/indexImages/bottom/qtbjq2.png";
// 用电探测器
import ydtcq1 from "@/assets/indexImages/bottom/ydtcq1.png";
import ydtcq2 from "@/assets/indexImages/bottom/ydtcq2.png";
// // 用电探测器
// import ydtcq1 from "@/assets/indexImages/bottom/ydtcq1.png";
// import ydtcq2 from "@/assets/indexImages/bottom/ydtcq2.png";
// 压力探测器
import yltcq1 from "@/assets/indexImages/bottom/yltcq1.png";
import yltcq2 from "@/assets/indexImages/bottom/yltcq2.png";
// // 压力探测器
// import yltcq1 from "@/assets/indexImages/bottom/yltcq1.png";
// import yltcq2 from "@/assets/indexImages/bottom/yltcq2.png";
// 温度探测器
import wdtcq1 from "@/assets/indexImages/bottom/wdtcq1.png";
import wdtcq2 from "@/assets/indexImages/bottom/wdtcq2.png";
// // 温度探测器
// import wdtcq1 from "@/assets/indexImages/bottom/wdtcq1.png";
// import wdtcq2 from "@/assets/indexImages/bottom/wdtcq2.png";
// 工业探测器
import gytcq1 from "@/assets/indexImages/bottom/gytcq1.png";
import gytcq2 from "@/assets/indexImages/bottom/gytcq2.png";
// 温度变送器
import wdbsq1 from "@/assets/indexImages/bottom/wdbsq1.png";
import wdbsq2 from "@/assets/indexImages/bottom/wdbsq2.png";
// 压力监测设备
import yljcq1 from "@/assets/indexImages/bottom/yljcq1.png";
import yljcq2 from "@/assets/indexImages/bottom/yljcq2.png";
// 液位探测器
import ywtcq1 from "@/assets/indexImages/bottom/ywtcq1.png";
import ywtcq2 from "@/assets/indexImages/bottom/ywtcq2.png";
// 摄像头
import video1 from "@/assets/indexImages/bottom/video1.png";
import video2 from "@/assets/indexImages/bottom/video2.png";
export default {
name: "",
data() {
return {
data: [
{ name: "摄像头", icon: video1, iconActive: video2, deviceType: 11 },
{
name: "气体报警器",
icon: qtbjq1,
iconActive: qtbjq2,
deviceType: 12,
name: "工业探测器",
icon: gytcq1,
iconActive: gytcq2,
deviceType: 1,
},
{
name: "温度变送器",
icon: wdbsq1,
iconActive: wdbsq2,
deviceType: 2,
},
{
name: "用电探测器",
icon: ydtcq1,
iconActive: ydtcq2,
deviceType: 13,
name: "压力监测设备",
icon: yljcq1,
iconActive: yljcq2,
deviceType: 3,
},
{
name: "压力探测器",
icon: yltcq1,
iconActive: yltcq2,
deviceType: 14,
name: "液位探测器",
icon: ywtcq1,
iconActive: ywtcq2,
deviceType: 4,
},
{
name: "温度探测器",
icon: wdtcq1,
iconActive: wdtcq2,
deviceType: 15,
name: "摄像头",
icon: video1,
iconActive: video2,
deviceType: 5,
},
],
activeArr: [11, 12, 13, 14, 15],
activeArr: [1, 2, 3, 4, 5],
};
},
methods: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment