Commit 6f5359f6 authored by 纪泽龙's avatar 纪泽龙

增加危险范围的数据

parent 3e4baadd
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-06-21 09:24:11
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-10-11 18:06:41
* @FilePath: /danger-manage-web/src/components/bigWindow/Danger.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="danger-wrapper">
<div class="close" @click="close">
<img src="@/assets/images/closeBtn.png" alt="" />
</div>
<div class="text">
{{deviceData.name}}
</div>
</div>
</template>
<script>
export default {
name: "",
data() {
return {};
},
mounted() {
console.log(this.deviceData);
},
methods: {
close() {
//this.handleClose();
this.mapClass.clearInfoWindow();
},
},
};
</script>
<style lang="scss" scoped>
.danger-wrapper {
background-color: rgba(9, 18, 32, 0.6);
position: absolute;
padding: 30px;
padding-bottom: 0;
box-sizing: border-box;
// width: 100px;
// height: 510px;
.text{
color:#fff;
padding-bottom:30px;
}
.up {
border-bottom: 1px solid #cccccc;
margin-bottom: 15px;
&.noBroder{
border-bottom: 0px solid #cccccc;
margin-bottom: 10px;
}
}
.tit {
line-height: 14px;
color: #ffffff;
font-weight: 600;
position: relative;
margin-left: 12px;
&:before {
content: "";
position: absolute;
width: 5px;
height: 15px;
left: -12px;
top: 0;
background: #fff;
}
}
.close {
position: absolute;
right: 15px;
top: 10px;
cursor: pointer;
}
.one {
width: 100%;
flex-wrap: wrap;
.flex-item {
width: 50%;
margin-bottom: 5px;
.left {
color: #cccccc;
}
.right {
color: #fff;
margin-left: 5px;
}
}
}
.item {
margin-bottom: 5px;
.left {
color: #cccccc;
}
.right {
color: #fff;
margin-left: 5px;
}
.img {
width: 300px;
height: 120px;
display: inline-block;
vertical-align: top;
margin-left: 5px;
img {
width: 100%;
height: 100%;
}
}
}
}
</style>
/*
* @Author: your name
* @Date: 2021-12-07 14:19:18
* @LastEditTime: 2022-10-10 17:09:52
* @LastEditTime: 2022-10-11 11:46:52
* @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
*/
window.danger = { name: "", colorNum: null, path: [], data: {} };
window.dangerArr = JSON.parse(localStorage.getItem('J') ).length>0? JSON.parse(localStorage.getItem('J') ): [];
window.repeat = () => {
window.danger = { name: "", path: [], data: {} };
};
window.save = () => {
window.dangerArr.push(window.danger);
const json = JSON.stringify(window.dangerArr);
localStorage.setItem("J", json);
console.log(json)
window.repeat()
};
var viewModel = {
silhouetteColor: "Yellow",
......@@ -87,8 +99,8 @@ const dangerColor = {
// 1:Cesium.Color.fromCssColorString("red")
1: Cesium.Color.RED.withAlpha(0.5),
2: Cesium.Color.ORANGE.withAlpha(0.5),
3: Cesium.Color.BLUE.withAlpha(0.5),
4: Cesium.Color.YELLOW.withAlpha(0.5),
3: Cesium.Color.YELLOW.withAlpha(0.5),
4: Cesium.Color.BLUE.withAlpha(0.5),
};
// const picUrlList = {
......@@ -316,7 +328,7 @@ export default class CreateCesium {
let offset = Cesium.Cartesian3.fromRadians(
Cesium.Math.toRadians(gps[0]),
Cesium.Math.toRadians(gps[1]),
-160
-161.1
);
// let offset = Cesium.Cartesian3.fromRadians(
// Cesium.Math.toRadians(gaodeLnglat.lng),
......@@ -383,7 +395,7 @@ export default class CreateCesium {
this.createDevice(movement);
}
var picked = this.scene.pick(movement.position);
console.log("picked", picked);
// console.log("picked", picked);
if (Cesium.defined(picked)) {
if (picked.id && picked.id instanceof Cesium.Entity) {
// console.log(picked.id)
......@@ -443,9 +455,12 @@ export default class CreateCesium {
const pitch = Cesium.Math.toDegrees(this.viewer.camera.pitch).toFixed(2);
//围绕X轴旋转
const roll = Cesium.Math.toDegrees(this.viewer.camera.roll).toFixed(2);
console.log(height, heading, pitch, roll);
// console.log(height, heading, pitch, roll);
const ln = this.getLnglat(movement);
console.log(ln);
// console.log(ln);
window.danger.path.push(ln);
console.log(window.danger.path);
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
handler.setInputAction((movement) => {
// 新建
......@@ -454,7 +469,7 @@ export default class CreateCesium {
handler.setInputAction((movement) => {
// 如果是鼠标按下的状态,则监听地图移动
if (this.mouseDownFlag) {
console.log("地图移动");
// console.log("地图移动");
// this.clearInfoWindow();
// 改变位置
// this.changePosition();
......@@ -479,7 +494,7 @@ export default class CreateCesium {
// this.clearInfoWindow();
var picked = this.scene.pick(movement.position);
console.log(movement.position);
// console.log(movement.position);
if (Cesium.defined(picked)) {
if (picked.id && picked.id instanceof Cesium.Entity) {
// console.log(picked.id)
......@@ -532,7 +547,7 @@ export default class CreateCesium {
// 鼠标抬起
this.mouseDownFlag = false;
console.log("up");
// console.log("up");
// this.viewer.scene.screenSpaceCameraController.enableRotate = true;
// handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
......@@ -565,7 +580,7 @@ export default class CreateCesium {
// 打印中心点坐标、高度
// 当鼠地图移动的时候与相机事件隔离
if (!this.mouseDownFlag) {
console.log("相机发生变化");
// console.log("相机发生变化");
// this.clearInfoWindow();
}
});
......
export const dangerArr = [
{
name: "污水处理",
colorNum: 3,
path: [
[114.0802423193686, 38.25212906594326],
[114.08030154601715, 38.251607262524935],
[114.08121715606055, 38.25164695300115],
[114.08118032640901, 38.25221024391822],
],
data: {},
},
{
name: "危废库",
path: [
[114.08110021621, 38.25071796336822],
[114.08111012376774, 38.25045433150584],
[114.08168812394003, 38.250488614016135],
[114.08164030994841, 38.25079994477491],
],
data: {},
colorNum: 2,
},
{
name: "双氧水装置",
path: [
[114.08037390742933, 38.25075081911935],
[114.08102111422541, 38.25076611704053],
[114.08106235110658, 38.25043148083487],
[114.08186157598547, 38.25047264362546],
[114.08188193141116, 38.24996130073124],
[114.08037480953207, 38.249932590119556],
],
data: {},
colorNum: 1,
},
{
name: "双氧水储罐",
path: [
[114.08097316157259, 38.24980239291614],
[114.0818601311899, 38.24987991352474],
[114.0818822111471, 38.24956024306349],
[114.08098376391818, 38.24951885572243],
],
data: {},
colorNum: 1,
},
{
name: "事故池",
path: [
[114.07972706320254, 38.251934583657054],
[114.07973848398622, 38.251575963490374],
[114.08004240688804, 38.251581774583634],
[114.08002489734042, 38.251950654364265],
],
data: {},
colorNum: 4,
},
{
name: "硫磺库",
path: [
[114.07953625950095, 38.25145622691668],
[114.07955338797811, 38.2513178874665],
[114.08002301112488, 38.251377061619046],
[114.08000932886821, 38.25149427805925],
],
data: {},
colorNum: 2,
},
{
name: "液氨球罐",
colorNum: 1,
path: [
[114.07935294871132, 38.24902252371101],
[114.0793830615865, 38.24865370601876],
[114.0799213099661, 38.24870811934452],
[114.07992247747968, 38.2490596822873],
],
data: {},
},
{
name: "干煤棚",
colorNum: 3,
path: [
[114.07838703817312, 38.248883274030256],
[114.07837971646096, 38.24857426701232],
[114.0793256381516, 38.248656072998905],
[114.07928660378576, 38.24896257086807],
],
data: {},
},
{
name: "甲醇球罐",
path: [
[114.07840850606294, 38.24852868580072],
[114.07846609004767, 38.24816618120773],
[114.07900555924418, 38.24818826396147],
[114.07896214915758, 38.2485657203445],
],
data: {},
colorNum: 1,
},
{
name: "脱硫脱硝",
path: [
[114.07831326643978, 38.24946386349275],
[114.07835053881229, 38.249094488763355],
[114.07970969314668, 38.249177870760086],
[114.07968503158452, 38.249621022521914],
],
data: {},
colorNum: 2,
},
{
name: "150T锅炉",
path: [
[114.07826403573092, 38.25041610538391],
[114.07826756226544, 38.249811119304574],
[114.07937025504728, 38.24986209608138],
[114.07932854865001, 38.25049906057526],
],
data: {},
colorNum: 1,
},
{
name: "75T锅炉",
path: [
[114.07836202291801, 38.24984598550623],
[114.07835895740511, 38.24949329139739],
[114.0793149258221, 38.24950495448654],
[114.07929156270377, 38.24989004286162],
],
data: {},
colorNum: 1,
},
{
name: "醇烷化",
colorNum: 1,
path: [
[114.07788305386525, 38.24902452359086],
[114.07792000587226, 38.24881494763276],
[114.0781915677119, 38.24883479798143],
[114.07818775308438, 38.24904718615451],
],
data: {},
},
{
name: "2400氨合成",
colorNum: 1,
path: [
[114.07757578163134, 38.24865762022516],
[114.07760584819745, 38.248386770402014],
[114.07788319106552, 38.24839707344524],
[114.07795414367672, 38.24826206982353],
[114.07824052605362, 38.24826869585147],
[114.07822516569071, 38.24873709204756],
],
data: {},
},
{
name: "大颗粒",
path: [
[114.07748203214578, 38.24977181777981],
[114.07755600198279, 38.249310867672],
[114.07793868895763, 38.24933718425533],
[114.0778791617466, 38.24978811628299],
],
data: {},
colorNum: 2,
},
{
name: "3#脱碳",
colorNum: 1,
path: [
[114.0774122940441, 38.25083680495894],
[114.07742966402962, 38.25041431643015],
[114.07816742485505, 38.25042773313157],
[114.07811902680491, 38.25084109067064],
],
data: {},
},
{
name: "1#脱碳",
path: [
[114.07736827147872, 38.2504016883943],
[114.07737833468077, 38.250202120377146],
[114.07813313619934, 38.25025368152452],
[114.07816939918499, 38.250464604821424],
],
data: {},
colorNum: 1,
},
{
name: "空压站,消防泵房",
colorNum: 2,
path: [
[114.07648176566848, 38.24876231406507],
[114.07740850040965, 38.24881297621928],
[114.07746486986495, 38.248407745254845],
[114.07701274307188, 38.248412741569],
[114.07689683035566, 38.24851199022575],
[114.07655032796976, 38.24855692071795],
],
data: {},
},
{
name: "尿素生产装置",
colorNum: 1,
path: [
[114.07644326010863, 38.249783125942734],
[114.07734547326936, 38.249769249260154],
[114.07730309157522, 38.24926803285693],
[114.07645852296761, 38.249258052783055],
],
data: {},
},
{
name: "冰机",
path: [
[114.07659338170923, 38.249981109684214],
[114.07661473551407, 38.24986218591874],
[114.07674899410013, 38.24986759777573],
[114.07673177371679, 38.24999869046041],
],
data: {},
colorNum: 1,
},
{
name: "H280压缩",
path: [
[114.07636168473813, 38.250391644943825],
[114.07736119612831, 38.25041770639652],
[114.07736221268445, 38.250066057714115],
[114.07638572203807, 38.250006593486276],
],
data: {},
colorNum: 1,
},
{
name: "8M100压缩",
path: [
[114.07632068497128, 38.25096819337832],
[114.07724619364201, 38.25102510952358],
[114.07729932027942, 38.25065483348539],
[114.0763611632972, 38.2506105391965],
],
data: {},
colorNum: 1,
},
{
name: "中和池",
path: [
[114.0764476892525, 38.251388057277936],
[114.07669375239739, 38.25140564452062],
[114.07673732219793, 38.25122243174297],
[114.07648591573471, 38.25119899039575],
],
data: {},
colorNum: 4,
},
{
name: "膜提氢",
colorNum: 2,
path: [
[114.07588871369857, 38.2495528561863],
[114.07591568127637, 38.24940717342778],
[114.07611396280011, 38.24941242465572],
[114.07610863025666, 38.249559594773935],
],
data: {},
},
{
name: "甲醇合成",
path: [
[114.07582619775629, 38.2498981055802],
[114.07580669400515, 38.24977529516414],
[114.07631406585077, 38.249803953760804],
[114.07629629633044, 38.249994075703896],
],
data: {},
colorNum: 1,
},
{
name: "水处理",
path: [
[114.07575765589702, 38.250302690616444],
[114.07585017538672, 38.25010994058152],
[114.07631539021173, 38.250133221900036],
[114.07629852045858, 38.25036483868555],
],
data: {},
colorNum: 3,
},
{
name: "三废炉",
path: [
[114.07538446895977, 38.25092364974689],
[114.07542087621553, 38.25053974732092],
[114.07608574873743, 38.250568256922435],
[114.0762024779363, 38.25064622770106],
[114.07614690640786, 38.250982027231906],
],
data: {},
colorNum: 1,
},
{
name: "新变换",
path: [
[114.07507724449674, 38.24955582804413],
[114.07572686879004, 38.24959835634573],
[114.0757575736981, 38.24940713702969],
[114.07506815524074, 38.24935807751058],
],
data: {},
colorNum: 1,
},
{
name: "变换",
path: [
[114.07509073690964, 38.250153436360456],
[114.07509920562275, 38.24987985409201],
[114.07578164985038, 38.24991737346083],
[114.07575424777615, 38.25022009521355],
],
data: {},
colorNum: 1,
},
{
name: "造气",
path: [
[114.07460492161516, 38.25043141498625],
[114.07459930319125, 38.25027484101991],
[114.07568783954892, 38.2503153993018],
[114.07569321404614, 38.25050557141559],
],
data: {},
colorNum: 1,
},
{
name: "造气",
path: [
[114.07469909667556, 38.25103231655406],
[114.0747304183754, 38.250512152560255],
[114.07537563494651, 38.25051872866674],
[114.07533109169464, 38.25112532353275],
],
data: {},
colorNum: 1,
},
{
name: "硫磺",
path: [
[114.0745842548579, 38.24982178688526],
[114.07457686998632, 38.249651465829466],
[114.07507479362056, 38.24967638869796],
[114.07506400522227, 38.2498509809399],
],
data: {},
colorNum: 2,
},
{
name: "4-5#H280压缩",
path: [
[114.07458551439254, 38.24962305351363],
[114.07460117075044, 38.249439012704315],
[114.07509693683168, 38.24947090168923],
[114.07507104315593, 38.249669088954406],
],
data: {},
colorNum: 1,
},
{
name: "110K变电站",
colorNum: 1,
path: [
[114.07349274420494, 38.25010712675465],
[114.07396488437712, 38.24992690832097],
[114.07381546333403, 38.24962535790453],
[114.07329016901807, 38.24975956466659],
],
data: {},
},
{
name: "预脱硫",
path: [
[114.07396661610711, 38.25005631287631],
[114.07397280394892, 38.24978099223816],
[114.074498874829, 38.24981217373876],
[114.07449942174725, 38.25005976641145],
],
data: {},
colorNum: 1,
},
{
name: "气柜",
path: [
[114.07369342589652, 38.25055248290801],
[114.07373155594613, 38.25023761425316],
[114.07410013187993, 38.250246230088905],
[114.07409377782558, 38.25057015884229],
],
data: {},
colorNum: 1,
},
{
name: "循环水池",
path: [
[114.07412011897662, 38.25112328301312],
[114.07416007953839, 38.25096700275102],
[114.0746029073167, 38.25098940998453],
[114.07457634824875, 38.25117713367422],
],
data: {},
colorNum: 4,
},
];
......@@ -2,14 +2,15 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-03 10:51:24
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-10-10 17:10:12
* @LastEditTime: 2022-10-11 17:40:35
* @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 v-if="charsShow"
<Left
v-if="charsShow"
ref="left"
@clickShow="clickShow"
@dangerDeviceChange="dangerDeviceChange"
......@@ -31,6 +32,7 @@ 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 Danger2 from "@/components/bigWindow/Danger2";
import weixiandian from "@/components/bigWindow/weixiandian";
import ydqt from "@/components/bigWindow/ydqt";
import danger from "@/assets/images/danger.png";
......@@ -41,13 +43,15 @@ import Right from "@/views/indexComponents/Right";
import Bottom from "@/views/indexComponents/Bottom";
import { deviceInfoLists } from "@/api/map/deviceInfo";
import { dangerArr } from "@/utils/cesium/dangerArr.js";
export default {
name: "shouye",
props:{
charsShow:{
type:Boolean,
default:true,
}
props: {
charsShow: {
type: Boolean,
default: true,
},
},
components: {
Top,
......@@ -382,10 +386,35 @@ export default {
this.Cesium.addDevice(item, "pic", ydqt);
}
});
this.danger.forEach((item) => {
this.Cesium.addDanger(item, Danger);
// 如果有缓存
// const J = localStorage.getItem("J");
// if (J) {
// const data = JSON.parse(J);
// data
// .map((item) => {
// return {
// lnglatArr: item.path,
// ...item,
// };
// })
// .forEach((item) => {
// this.Cesium.addDanger(item, Null);
// });
// } else {
// this.danger.forEach((item) => {
// this.Cesium.addDanger(item, Danger);
// });
// }
dangerArr
.map((item) => {
return {
lnglatArr: item.path,
...item,
};
})
.forEach((item) => {
this.Cesium.addDanger(item, Danger2);
});
this.data11.forEach((item) => {
item.config = { scale: 1, textHeight: -32 };
this.Cesium.addDevice(item, "pic", Video);
......@@ -409,15 +438,15 @@ export default {
obj = {
latitude: item.latitude,
longitude: item.longitude,
deviceId:item.mapDeviceId,
deviceId: item.mapDeviceId,
shortNum: 10,
deviceType: item.mapDeviceType,
title: item.mapDeviceName,
config : { scale: 1, textHeight: -32 },
config: { scale: 1, textHeight: -32 },
};
} else {
obj = {
deviceId:item.mapDeviceId,
deviceId: item.mapDeviceId,
latitude: item.latitude,
longitude: item.longitude,
deviceType: item.mapDeviceType,
......@@ -430,7 +459,7 @@ export default {
sbzt: item.monitorDeviceStatus,
jcz: item.monitorValue + "" + item.mapDeviceUnit,
shortNum: 12,
config : { scale: 1, textHeight: -94 },
config: { scale: 1, textHeight: -94 },
};
}
return obj;
......
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