fix:改变模型方向

This commit is contained in:
shijing 2024-04-03 10:48:59 +08:00
parent 824f0cd6bc
commit 46742f99b4
1 changed files with 1033 additions and 781 deletions

View File

@ -1,14 +1,31 @@
<template>
<div style="width: 100%; height: 100%;">
<div id="cesiumContainer" style="width: 100%;height: 100%;"></div>
<div style="width: 100%; height: 100%">
<div id="cesiumContainer" style="width: 100%; height: 100%"></div>
<div v-show="activeIndex == 0" class="btns_enp">
<div style="position: relative;">
<div style="position: relative">
<div class="btns" @click="showChange(1)">生产设备</div>
<div class="bottomMenu bottomMenu1" @mouseleave="handleMouseLeave(1)">
<el-checkbox class="bottomMenu_item" v-model="eq_big" label="大型生产设备" @change="checkboxChange('eq_big')"/>
<el-checkbox class="bottomMenu_item" v-model="eq_main" label="主要生产设备" @change="checkboxChange('eq_main')"/>
<el-checkbox class="bottomMenu_item" v-model="eq_trans" label="输送设备" @change="checkboxChange('eq_trans')"/>
<div
class="bottomMenu bottomMenu1"
@mouseleave="handleMouseLeave(1)"
>
<el-checkbox
class="bottomMenu_item"
v-model="eq_big"
label="大型生产设备"
@change="checkboxChange('eq_big')"
/>
<el-checkbox
class="bottomMenu_item"
v-model="eq_main"
label="主要生产设备"
@change="checkboxChange('eq_main')"
/>
<el-checkbox
class="bottomMenu_item"
v-model="eq_trans"
label="输送设备"
@change="checkboxChange('eq_trans')"
/>
<!-- <el-checkbox-group v-model="equCheck" @change="checkChange(equCheck)">
<el-checkbox class="bottomMenu_item" value="eq_big" label="大型生产设备"/>
<el-checkbox class="bottomMenu_item" value="eq_main" label="主要生产设备"/>
@ -16,15 +33,48 @@
</el-checkbox-group> -->
</div>
</div>
<div style="position: relative;">
<div style="position: relative">
<div class="btns" @click="showChange(2)">治理设备</div>
<div class="bottomMenu bottomMenu2" @mouseleave="handleMouseLeave(2)">
<el-checkbox class="bottomMenu_item" v-model="fog_cannon" label="雾炮" @change="checkboxChange('fog_cannon')"/>
<el-checkbox class="bottomMenu_item" v-model="dry_fog" label="干雾" @change="checkboxChange('dry_fog')"/>
<el-checkbox class="bottomMenu_item" v-model="dust_clean" label="除尘器" @change="checkboxChange('dust_clean')"/>
<el-checkbox class="bottomMenu_item" v-model="truck_clean" label="环卫车" @change="checkboxChange('truck_clean')"/>
<el-checkbox class="bottomMenu_item" v-model="wstation" label="洗车台" @change="checkboxChange('wstation')"/>
<el-checkbox class="bottomMenu_item" v-model="tltx" label="脱硫脱硝" @change="checkboxChange('tltx')"/>
<div
class="bottomMenu bottomMenu2"
@mouseleave="handleMouseLeave(2)"
>
<el-checkbox
class="bottomMenu_item"
v-model="fog_cannon"
label="雾炮"
@change="checkboxChange('fog_cannon')"
/>
<el-checkbox
class="bottomMenu_item"
v-model="dry_fog"
label="干雾"
@change="checkboxChange('dry_fog')"
/>
<el-checkbox
class="bottomMenu_item"
v-model="dust_clean"
label="除尘器"
@change="checkboxChange('dust_clean')"
/>
<el-checkbox
class="bottomMenu_item"
v-model="truck_clean"
label="环卫车"
@change="checkboxChange('truck_clean')"
/>
<el-checkbox
class="bottomMenu_item"
v-model="wstation"
label="洗车台"
@change="checkboxChange('wstation')"
/>
<el-checkbox
class="bottomMenu_item"
v-model="tltx"
label="脱硫脱硝"
@change="checkboxChange('tltx')"
/>
<!-- <el-checkbox-group v-model="equCheck2">
<el-checkbox class="bottomMenu_item" value="wp" label="雾炮"/>
<el-checkbox class="bottomMenu_item" value="gw" label="干雾"/>
@ -35,22 +85,48 @@
</el-checkbox-group> -->
</div>
</div>
<div style="position: relative;">
<div style="position: relative">
<div class="btns" @click="showChange(3)">监测设备</div>
<div class="bottomMenu bottomMenu3" @mouseleave="handleMouseLeave(3)">
<el-checkbox class="bottomMenu_item" v-model="tsp" label="TSP" @change="checkboxChange('tsp')"/>
<el-checkbox class="bottomMenu_item" v-model="cems" label="CEMS" @change="checkboxChange('cems')"/>
<el-checkbox class="bottomMenu_item" v-model="aqms" label="空气微站" @change="checkboxChange('aqms')"/>
<div
class="bottomMenu bottomMenu3"
@mouseleave="handleMouseLeave(3)"
>
<el-checkbox
class="bottomMenu_item"
v-model="tsp"
label="TSP"
@change="checkboxChange('tsp')"
/>
<el-checkbox
class="bottomMenu_item"
v-model="cems"
label="CEMS"
@change="checkboxChange('cems')"
/>
<el-checkbox
class="bottomMenu_item"
v-model="aqms"
label="空气微站"
@change="checkboxChange('aqms')"
/>
<!-- <el-checkbox-group v-model="equCheck3">
<el-checkbox class="bottomMenu_item" value="cems" label="CEMS"/>
<el-checkbox class="bottomMenu_item" value="tsp" label="TSP"/>
</el-checkbox-group> -->
</div>
</div>
<div style="position: relative;">
<div style="position: relative">
<div class="btns" @click="showChange(4)">监控设备</div>
<div class="bottomMenu bottomMenu4" @mouseleave="handleMouseLeave(4)">
<el-checkbox class="bottomMenu_item" v-model="monitor" label="监控设备" @cahnge="checkboxChange('monitor')"/>
<div
class="bottomMenu bottomMenu4"
@mouseleave="handleMouseLeave(4)"
>
<el-checkbox
class="bottomMenu_item"
v-model="monitor"
label="监控设备"
@cahnge="checkboxChange('monitor')"
/>
<!-- <el-checkbox-group v-model="equCheck4">
<el-checkbox class="bottomMenu_item" value="jksb" label="监控设备" />
</el-checkbox-group> -->
@ -59,29 +135,75 @@
</div>
<div v-show="infoShow" class="infoDom">
<h4 class="infoDom_header">
<el-icon class="infoDom_close" @click="closeInfo()"><el-icon-close /></el-icon>
<el-icon class="infoDom_close" @click="closeInfo()"
><el-icon-close
/></el-icon>
{{ objItem.name }}
<el-button size="small" class="infoDom_toDetail" @click="infoToDetail()">详情</el-button>
<el-button
size="small"
class="infoDom_toDetail"
@click="infoToDetail()"
>详情</el-button
>
</h4>
<div class="infoBody">
<p class="bodyTitle" v-if="objItem.cate_code=='tsp'||objItem.cate_code=='cems'||objItem.cate_code=='aqms'"><span class="titleIcon"></span>实时监测</p>
<p class="bodyTitle" v-else-if="objItem.cate_code!='monitor'"><span class="titleIcon"></span>实时状态</p>
<p
class="bodyTitle"
v-if="
objItem.cate_code == 'tsp' ||
objItem.cate_code == 'cems' ||
objItem.cate_code == 'aqms'
"
>
<span class="titleIcon"></span>实时监测
</p>
<p class="bodyTitle" v-else-if="objItem.cate_code != 'monitor'">
<span class="titleIcon"></span>实时状态
</p>
<div class="bodyContainer">
<div class="rdio-group" v-if="objItem.type==10||objItem.type==30">
<div :class="['radio-item' ,objItem.state==10?'greenIcon':'']">
<el-icon class="radio-ico"><el-icon-successFilled /></el-icon>
<div
class="rdio-group"
v-if="objItem.type == 10 || objItem.type == 30"
>
<div
:class="[
'radio-item',
objItem.state == 10 ? 'greenIcon' : '',
]"
>
<el-icon class="radio-ico"
><el-icon-successFilled
/></el-icon>
<span>运行</span>
</div>
<div :class="['radio-item' ,objItem.state==20?'orangeIcon':'']">
<el-icon class="radio-ico"><el-icon-removeFilled /></el-icon>
<div
:class="[
'radio-item',
objItem.state == 20 ? 'orangeIcon' : '',
]"
>
<el-icon class="radio-ico"
><el-icon-removeFilled
/></el-icon>
<span>待机</span>
</div>
<div :class="['radio-item' ,objItem.state==30?'redIcon':'']">
<el-icon class="radio-ico"><el-icon-warningFilled /></el-icon>
<div
:class="[
'radio-item',
objItem.state == 30 ? 'redIcon' : '',
]"
>
<el-icon class="radio-ico"
><el-icon-warningFilled
/></el-icon>
<span>离线</span>
</div>
</div>
<div v-else-if="objItem.type==40&&objItem.cate_code=='cems'">
<div
v-else-if="
objItem.type == 40 && objItem.cate_code == 'cems'
"
>
<div class="infoTableTr">
<div class="infoTableHeadTh">颗粒物</div>
<div class="infoTableHeadTh">SO₂</div>
@ -103,7 +225,11 @@
<div class="infoTableBodytd">0.80%</div>
</div>
</div>
<div v-else-if="objItem.type==40&&objItem.cate_code=='tsp'">
<div
v-else-if="
objItem.type == 40 && objItem.cate_code == 'tsp'
"
>
<div class="infoTableTr">
<div class="infoTableHeadTh">TSP</div>
<div class="infoTableHeadTh">温度</div>
@ -117,19 +243,23 @@
</div>
</div>
<p class="bodyTitle"><span class="titleIcon"></span>历史监测</p>
<div class="infoCharts" id="infoCharts" style="width:360px;height: 150px;"></div>
<div
class="infoCharts"
id="infoCharts"
style="width: 360px; height: 150px"
></div>
</div>
</div>
</div>
</template>
<script>
import tool from '@/utils/tool'
import * as Cesium from 'cesium';
import tool from "@/utils/tool";
import * as Cesium from "cesium";
import * as echarts from "echarts";
import cems from './enpComponents/cems.vue';
import cems from "./enpComponents/cems.vue";
export default {
name: 'cesium',
props: ['activeIndex'],
name: "cesium",
props: ["activeIndex"],
data() {
return {
objItem: {},
@ -151,70 +281,98 @@ export default {
intervalequ: null, //
basicOption: {
tooltip: {
trigger: 'axis',
trigger: "axis",
formatter: function (params) {
var result = '';
let text = params[0].data[1] == 1 ? '运行' : params[0].data[1] == 0 ? '待机' : '故障';
let colors = text=='运行'?'#21a51f':text=='待机'?'#ff8608':'#c7c7c7';
var lineHtml = '<div style="height:1px;background:#333333;width:100%"></div>';
var dotHtml = '<span style="display:inline-block;margin-right:5px;border-radius:4px;width:8px;height:8px;background-color:' + colors + '"></span>';
let state = '<span style="color:' + colors + '">'+text+'</span>';
result += params[0].name + lineHtml + "</br>" + dotHtml + params[0].seriesName + '' + state + "</br>";
var result = "";
let text =
params[0].data[1] == 1
? "运行"
: params[0].data[1] == 0
? "待机"
: "故障";
let colors =
text == "运行"
? "#21a51f"
: text == "待机"
? "#ff8608"
: "#c7c7c7";
var lineHtml =
'<div style="height:1px;background:#333333;width:100%"></div>';
var dotHtml =
'<span style="display:inline-block;margin-right:5px;border-radius:4px;width:8px;height:8px;background-color:' +
colors +
'"></span>';
let state =
'<span style="color:' +
colors +
'">' +
text +
"</span>";
result +=
params[0].name +
lineHtml +
"</br>" +
dotHtml +
params[0].seriesName +
"" +
state +
"</br>";
return result;
}
},
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true,
},
yAxis: {
type: 'value',
type: "value",
axisLine: { show: true },
axisTick: { show: false },
splitLine: {show: false}
splitLine: { show: false },
},
dataset: { source: [] },
xAxis: { type: 'category', splitLine: {show:false} },
xAxis: { type: "category", splitLine: { show: false } },
visualMap: {
top: 5,
right: 10,
symbolSize: 1,
orient: "horizontal",
textStyle: {
color: '#ffffff',
fontSize: 10
color: "#ffffff",
fontSize: 10,
},
pieces: [
{
gt: 0.5,
lte: 1,
label: '运行',
color: '#21a51f'
label: "运行",
color: "#21a51f",
},
{
gt: -0.5,
lte: 0.5,
label: '待机',
color: '#ff8608'
label: "待机",
color: "#ff8608",
},
{
gt: -1,
lte: -0.5,
label: '离线',
color: '#c7c7c7'
label: "离线",
color: "#c7c7c7",
},
],
},
series: [{type: 'line',}]
}
}
series: [{ type: "line" }],
},
};
},
created() {
const scriptInfo = document.createElement("script");
scriptInfo.setAttribute("data-callType", "callScript");
scriptInfo.src = "https://cesium.com/downloads/cesiumjs/releases/1.75/Build/Cesium/Cesium.js";
scriptInfo.src =
"https://cesium.com/downloads/cesiumjs/releases/1.75/Build/Cesium/Cesium.js";
document.head.appendChild(scriptInfo);
},
mounted() {
@ -233,10 +391,11 @@ export default {
selectionIndicator: false, //
timeline: false, //
navigationHelpButton: false, //
navigationInstructionsInitiallyVisible:false
navigationInstructionsInitiallyVisible: false,
});
this.viewer = viewer;
if(Cesium.FeatureDetection.supportsImageRenderingPixelated()){//
if (Cesium.FeatureDetection.supportsImageRenderingPixelated()) {
//
viewer.resolutionScale = window.devicePixelRatio;
}
//齿
@ -259,7 +418,7 @@ export default {
// viewer.scene.globe.show = false
//logo
viewer.scene.globe.enableLighting = true;
viewer._cesiumWidget._creditContainer.style.display = 'none';
viewer._cesiumWidget._creditContainer.style.display = "none";
//*****cesium3dtiles*****//
// const tileset = new Cesium.Cesium3DTileset({
// url: "/3dtiles/tileset.json",
@ -362,7 +521,7 @@ export default {
// },60000)
//*****cesium3dtiles*****//
console.log('');
console.log("");
//*****cesium.glb*****//
//1viewer.scene.primitives.add
// var position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 0.1);
@ -392,34 +551,39 @@ export default {
//2viewer.entities.add
var url = "factory.glb";
var height = 0;
viewer.entities.removeAll() //entity
var position = Cesium.Cartesian3.fromDegrees(88.644, 42.7229, height)
var heading = Cesium.Math.toRadians(191) //310
viewer.entities.removeAll(); //entity
var position = Cesium.Cartesian3.fromDegrees(88.644, 42.723, height);
var heading = Cesium.Math.toRadians(191); //310
var pitch = Cesium.Math.toRadians(0);
var roll = Cesium.Math.toRadians(0);
var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll)
var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
var orientation = Cesium.Transforms.headingPitchRollQuaternion(
position,hpr
)
position,
hpr
);
var modelScale = 30.0; //
var modelEntity = viewer.entities.add({
name: 'photon',
name: "photon",
position: position,
orientation: orientation,
model: {
uri: url, //entitits.addgltfuriurl.glb
scale: modelScale, //
modelMatrix: Cesium.Transforms.eastNorthUpToFixedFrame(position),
modelMatrix:
Cesium.Transforms.eastNorthUpToFixedFrame(position),
minimumPixelSize: 256, //
maximumScale: 20000, //minimumPixelSize
incrementallyLoadTextures: true, //
shadows: Cesium.ShadowMode.ENABLED,
heightReference: Cesium.HeightReference.NONE
heightReference: Cesium.HeightReference.NONE,
},
})
});
viewer.trackedEntity = modelEntity; //
//
viewer.zoomTo(modelEntity, new Cesium.HeadingPitchRange(-3.1, -0.6, 900));
viewer.zoomTo(
modelEntity,
new Cesium.HeadingPitchRange(0.3, -0.5, 900)
);
that.getEquipmentList();
//
var handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas);
@ -434,19 +598,21 @@ export default {
var pickedPosition = viewer.scene.pickPosition(click.position);
if (Cesium.defined(pickedPosition)) {
//
var cartographic = Cesium.Cartographic.fromCartesian(pickedPosition);
var longitude = Cesium.Math.toDegrees(cartographic.longitude);//
var cartographic =
Cesium.Cartographic.fromCartesian(pickedPosition);
var longitude = Cesium.Math.toDegrees(
cartographic.longitude
); //
var latitude = Cesium.Math.toDegrees(cartographic.latitude); //
var height = cartographic.height; //
console.log('Longitude: ' + longitude);
console.log('Latitude: ' + latitude);
console.log('Height: ' + height);
console.log("Longitude: " + longitude);
console.log("Latitude: " + latitude);
console.log("Height: " + height);
//
//
}
}
},
Cesium.ScreenSpaceEventType.LEFT_CLICK);
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
},
methods: {
getChartTime() {
@ -459,20 +625,20 @@ export default {
end_time: tool.dateFormat1(endDate),
start_time: tool.dateFormat1(startDate),
time_bucket: "1 minute",
equipment_id: this.objItem.id
equipment_id: this.objItem.id,
},
};
let myChart = echarts.init(document.getElementById('infoCharts'));
let myChart = echarts.init(document.getElementById("infoCharts"));
myChart.showLoading();
// 使
// myChart.setOption(option)
this.$API.bi.dataset.exec.req('eq_status', params).then(res => {
console.log(res)
this.$API.bi.dataset.exec.req("eq_status", params).then((res) => {
console.log(res);
let newOption = Object.assign({}, this.basicOption);
newOption.dataset.source = res.data.ds0;
myChart.setOption(newOption);
myChart.hideLoading()
})
myChart.hideLoading();
});
// this.initChart();
},
//
@ -509,13 +675,14 @@ export default {
//线
createoutLine() {
const orangeOutlined = this.viewer.entities.add({
name:
"Orange line with black outline at height and following the surface",
name: "Orange line with black outline at height and following the surface",
polyline: {
positions: Cesium.Cartesian3.fromDegreesArrayHeights([
119.196653, 26.031937, //线
119.196653,
26.031937, //线
10, //
119.196653, 26.031947, //
119.196653,
26.031947, //
250,
]),
width: 5,
@ -541,100 +708,167 @@ export default {
// that.removePointer();
that.$API.em.equipment.list.req({ page: 0 }).then((res) => {
res.forEach((item) => {
if ( item.cate!==null&&item.coordinates && item.coordinates.longitude && item.coordinates.latitude) {
let imgUrl = that.getItemIcon(item.cate_code)
if (
item.cate !== null &&
item.coordinates &&
item.coordinates.longitude &&
item.coordinates.latitude
) {
let imgUrl = that.getItemIcon(item.cate_code);
let lon = parseFloat(item.coordinates.longitude);
let lat = parseFloat(item.coordinates.latitude);
let height = parseInt(item.coordinates.height) + 15;
let type = item.cate_code;
let arrs = { name:item.name, lon: lon, lat:lat, height:height, id:item.id, type: type };
let config = { show: true, fontSize: '16px', fillColor: '#ffffff', fillWidth: 1, pixelOffsetX: 10, pixelOffsetY: -30, image: imgUrl, imgWidth: 50, imgHeight: 50, textDistance: 550000, imgDistance: 550000 };
let arrs = {
name: item.name,
lon: lon,
lat: lat,
height: height,
id: item.id,
type: type,
};
let config = {
show: true,
fontSize: "16px",
fillColor: "#ffffff",
fillWidth: 1,
pixelOffsetX: 10,
pixelOffsetY: -30,
image: imgUrl,
imgWidth: 50,
imgHeight: 50,
textDistance: 550000,
imgDistance: 550000,
};
that.addPointer(arrs, config);
}
})
})
});
});
},
//
creatgetInfoePoint(attrs, config) {
const { name = '测试', lon, lat, id='11111', type = 'display' ,height} = attrs
const { show = true, fontSize, fillColor, fillWidth,pixelOffsetX, pixelOffsetY, image, imgWidth, imgHeight, textDistance, imgDistance } = config
const {
name = "测试",
lon,
lat,
id = "11111",
type = "display",
height,
} = attrs;
const {
show = true,
fontSize,
fillColor,
fillWidth,
pixelOffsetX,
pixelOffsetY,
image,
imgWidth,
imgHeight,
textDistance,
imgDistance,
} = config;
return new Cesium.Entity({
attrs: attrs,
id: id,
type: type,
position: Cesium.Cartesian3.fromDegrees(lon||117.08387268794274, lat||31.6557737395655433,height), //
position: Cesium.Cartesian3.fromDegrees(
lon || 117.08387268794274,
lat || 31.6557737395655433,
height
), //
label: {
show: show,
text: name,
font: (fontSize || '14px'),
font: fontSize || "14px",
style: Cesium.LabelStyle.FILL,
fillColor: Cesium.Color.LIME,
fillColor: Cesium.Color.fromCssColorString(fillColor || '#fff'),
fillColor: Cesium.Color.fromCssColorString(
fillColor || "#fff"
),
outline: false, //
outlineColor: Cesium.Color.WHITE, //
outlineWidth: fillWidth || 4, //
showBackground: true, //
backgroundColor: Cesium.Color.fromCssColorString('#1ca50a'), //
backgroundColor: Cesium.Color.fromCssColorString("#1ca50a"), //
verticalOrigin: Cesium.VerticalOrigin.BOTTOM, //
pixelOffset: new Cesium.Cartesian2(pixelOffsetX || 50, pixelOffsetY || -25), //
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, textDistance || 550000) //
pixelOffset: new Cesium.Cartesian2(
pixelOffsetX || 50,
pixelOffsetY || -25
), //
distanceDisplayCondition:
new Cesium.DistanceDisplayCondition(
0,
textDistance || 550000
), //
},
billboard: {
//
image: image || 'img/enp_blue/warning_enp.png',
image: image || "img/enp_blue/warning_enp.png",
width: imgWidth || 30,
height: imgHeight || 30,
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, imgDistance || 550000) //
}
})
distanceDisplayCondition:
new Cesium.DistanceDisplayCondition(
0,
imgDistance || 550000
), //
},
});
},
//
addPointer(attrs, config) {
let that = this;
let obj = that.creatgetInfoePoint(attrs, config);
that.viewer.entities.add(obj)
that.viewer.entities.add(obj);
},
//
getInfo(equpmentId) {
let that = this;
that.infoShow = true;
console.log(equpmentId)
console.log(equpmentId);
//id
this.$API.em.equipment.item.req(equpmentId).then((res) => {
that.objItem = res;
console.log(res)
})
console.log(res);
});
this.getChartTime();
},
initChart() {
var that = this;
var myChart = echarts.getInstanceByDom(document.getElementById('infoCharts'));
var myChart = echarts.getInstanceByDom(
document.getElementById("infoCharts")
);
if (myChart == undefined) {
myChart = echarts.init(document.getElementById('infoCharts'));
myChart = echarts.init(document.getElementById("infoCharts"));
}
myChart.showLoading();
this.$API.bi.dataset.exec.req('enp_edata2', {
this.$API.bi.dataset.exec
.req("enp_edata2", {
query: this.query,
raise_exception: true
}).then(res => {
raise_exception: true,
})
.then((res) => {
let newOption = Object.assign({}, this.basicOption);
let ds0 = res.data.ds0
ds0.pop()
let ds0 = res.data.ds0;
ds0.pop();
newOption.dataset.source = res.data.ds0;
newOption.title.text = this.currentEquipmentName;
myChart.setOption(newOption);
}).then(() => { myChart.hideLoading() })
})
.then(() => {
myChart.hideLoading();
});
},
//
removePointer() {
let allEntitiesPoint = [];
this.viewer.entities.values.forEach((item) => {
allEntitiesPoint.push(item.id)
})
allEntitiesPoint.push(item.id);
});
allEntitiesPoint.forEach((item) => {
const entity_obj = this.viewer.entities.getById(item)
this.viewer.entities.remove(entity_obj)
})
const entity_obj = this.viewer.entities.getById(item);
this.viewer.entities.remove(entity_obj);
});
},
closeInfo() {
this.infoShow = false;
@ -642,50 +876,57 @@ export default {
//cemstsp
infoToDetail() {
let that = this;
this.$APi.enp.drain_equip.list.req({ equipment: that.objItem.id, page: 0 }).then(res => {
this.$APi.enp.drain_equip.list
.req({ equipment: that.objItem.id, page: 0 })
.then((res) => {
let drainId = res[0].drain;
})
});
},
// checkChange(val) {
// console.log('checkChange',val)
// console.log('checkChange',this.equCheck)
// },
checkboxChange(val) {
console.log('checkboxChange', val);
let valu = this[val]
console.log('valu', valu);
let allEntitiesPoint = []
console.log("checkboxChange", val);
let valu = this[val];
console.log("valu", valu);
let allEntitiesPoint = [];
this.viewer.entities.values.forEach((item) => {
allEntitiesPoint.push(item)
allEntitiesPoint.push(item);
if (item._type == val) {
item._show = valu
item.show = valu
item._show = valu;
item.show = valu;
}
})
console.log("allEntitiesPoint",allEntitiesPoint)
});
console.log("allEntitiesPoint", allEntitiesPoint);
},
//
showChange(val) {
let classname = 'bottomMenu' + val;
if (document.getElementsByClassName(classname)[0].style.display == 'block') {
document.getElementsByClassName(classname)[0].style.display = 'none';
let classname = "bottomMenu" + val;
if (
document.getElementsByClassName(classname)[0].style.display ==
"block"
) {
document.getElementsByClassName(classname)[0].style.display =
"none";
} else {
document.getElementsByClassName(classname)[0].style.display = 'block';
document.getElementsByClassName(classname)[0].style.display =
"block";
}
},
//
handleMouseLeave(val) {
let classname = 'bottomMenu' + val;
document.getElementsByClassName(classname)[0].style.display = 'none';
let classname = "bottomMenu" + val;
document.getElementsByClassName(classname)[0].style.display =
"none";
},
},
beforeUnmount() {
// viewer.destroy();
this.viewer = null;
},
}
};
</script>
<style>
/* #cesiumContainer,
@ -704,14 +945,14 @@ export default {
min-height: 20vh;
min-width: 360px;
background: rgba(0, 50, 56, 0.8);
border: 1px solid rgba(63,174,229,.5);
border: 1px solid rgba(63, 174, 229, 0.5);
}
.infoDom_header {
font-size: 18px;
padding: 10px;
text-align: center;
position: relative;
border-bottom: 1px solid rgba(63,174,229,.5);
border-bottom: 1px solid rgba(63, 174, 229, 0.5);
}
.infoDom_close {
position: absolute;
@ -749,13 +990,16 @@ export default {
.radio-item {
width: 60px;
}
.greenIcon,.greenIcon>.radio-ico{
.greenIcon,
.greenIcon > .radio-ico {
color: #1ca50a;
}
.orangeIcon,.orangeIcon>.radio-ico{
.orangeIcon,
.orangeIcon > .radio-ico {
color: orange;
}
.redIcon,.redIcon>.radio-ico{
.redIcon,
.redIcon > .radio-ico {
color: #f41a1a;
}
.btns_enp {
@ -773,19 +1017,23 @@ export default {
height: 5vh;
font-size: 2vh;
line-height: 4.9vh;
background-image: url('/public/img/enp_blue/btn.png');
background-image: url("/public/img/enp_blue/btn.png");
background-size: 100% 100%;
text-align: center;
color: #ffffff;
}
.btns.btnsActive {
background-image: url('/public/img/enp_blue/btn_active.png');
background-image: url("/public/img/enp_blue/btn_active.png");
}
/* 底部多选框--start 调节checkbox大小和颜色*/
.bottomMenu {
padding: 10px 10px 0 10px;
background: linear-gradient(to right, rgba(5, 56, 72,.7), rgba(16, 123, 144,.7));
background: linear-gradient(
to right,
rgba(5, 56, 72, 0.7),
rgba(16, 123, 144, 0.7)
);
width: 200px;
position: absolute;
display: none;
@ -810,7 +1058,11 @@ export default {
padding-left: 10px;
line-height: 40px;
margin-bottom: 10px;
background: linear-gradient(to right, rgba(27, 143, 164,.5), rgb(16, 123, 144,.5));
background: linear-gradient(
to right,
rgba(27, 143, 164, 0.5),
rgb(16, 123, 144, 0.5)
);
}
.bottomMenu_item .el-checkbox__inner {
width: 20px;
@ -851,7 +1103,7 @@ export default {
background: rgb(80, 127, 80);
}
.infoTableBodytd {
background: rgba(38 ,52 ,38 ,.8);
background: rgba(38, 52, 38, 0.8);
}
.infoCharts {
width: 100%;