fix:会议

This commit is contained in:
shijing 2024-03-15 17:47:03 +08:00
parent b0a0529abd
commit 9eb4058212
10 changed files with 540 additions and 409 deletions

BIN
public/factory.glb Normal file

Binary file not shown.

View File

@ -173,6 +173,23 @@ tool.dateFormat = function (date, fmt='yyyy-MM-dd hh:mm:ss') {
}
return fmt;
}
tool.dateFormat1 = function (date) {
date = new Date(date);
let newDate = '';
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
let hour = date.getHours();
let minute = date.getMinutes();
let second = date.getSeconds();
month = month > 9 ? month : '0' + month;
day = day > 9 ? day : '0' + day;
hour = hour > 9 ? hour : '0' + hour;
minute = minute > 9 ? minute : '0' + minute;
second = second > 9 ? second : '0' + second;
newDate = year+'-'+month+'-'+day+' '+hour+':'+minute+':'+second;
return newDate;
}
/* 千分符 */
tool.groupSeparator = function (num) {

View File

@ -61,11 +61,13 @@
<h4 class="infoDom_header">
<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>
</h4>
<div class="infoBody">
<p class="bodyTitle"><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">
<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>
@ -78,15 +80,40 @@
<el-icon class="radio-ico"><el-icon-warningFilled /></el-icon>
<span>离线</span>
</div>
</div>
<div v-else-if="objItem.type==40">
<div class="infoTableTr" v-if="objItem.cate_code=='cems'">
<div class="infoTableHeadTh">PM2.5</div>
<div class="infoTableHeadTh">PM10</div>
<div class="infoTableHeadTh">风速</div>
</div>
<div class="infoTableTr" v-if="objItem.cate_code=='cems'">
<div class="infoTableBodytd">13.00μg/</div>
<div class="infoTableBodytd">13.00μg/</div>
<div class="infoTableBodytd">0.5m/s</div>
</div>
<div class="infoTableTr">
<div class="infoTableHeadTh">TSP</div>
<div class="infoTableHeadTh">温度</div>
<div class="infoTableHeadTh">湿度</div>
</div>
<div class="infoTableTr">
<div class="infoTableBodytd">0.18mg/</div>
<div class="infoTableBodytd">18.6</div>
<div class="infoTableBodytd">53.4%</div>
</div>
</div>
</div>
<p class="bodyTitle"><span class="titleIcon"></span>历史监测数据</p>
<p class="bodyTitle"><span class="titleIcon"></span>历史监测</p>
<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 * as echarts from "echarts";
import cems from './enpComponents/cems.vue';
export default {
name: 'cesium',
@ -108,7 +135,68 @@ export default {
aqms:true,//
tsp:true,//TSP
cems: true,//CEMS
monitor:true,//
monitor: true,//
intervalequ: null,//
basicOption: {
tooltip: {
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>";
return result;
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
yAxis: {
type: 'value',
axisLine: { show: true},
axisTick: {show: false},
splitLine: {show: false}
},
dataset: {source: []},
xAxis: { type: 'category', splitLine: {show:false} },
visualMap: {
top: 5,
right:10,
symbolSize: 1,
orient: "horizontal",
textStyle: {
color: '#ffffff',
fontSize: 10
},
pieces: [
{
gt: 0.5,
lte: 1,
label: '运行',
color: '#21a51f'
},
{
gt: -0.5,
lte: 0.5,
label: '待机',
color: '#ff8608'
},
{
gt: -1,
lte: -0.5,
label: '离线',
color: '#c7c7c7'
},
],
},
series: [{type: 'line',}]
}
}
},
created() {
@ -134,365 +222,288 @@ export default {
timeline:false,//
navigationHelpButton:false,//
navigationInstructionsInitiallyVisible:false
});
});
this.viewer = viewer;
// homeButton
// this.viewer.homeButton.viewModel.command.beforeExecute.addEventListener((e) => {
// e.cancel = true;
// //
// this.viewer.camera.flyTo({
// destination: Cesium.Cartesian3.fromDegrees(119.196653, 26.031937, 50),
// })
// })
// viewer.scene.globe.depthTestAgainstTerrain = false
//
// viewer.scene.screenSpaceCameraController.minimumZoomDistance = 1
//
// viewer.scene.globe.show = false
//logo
// viewer.scene.globe.enableLighting = true;
// viewer._cesiumWidget._creditContainer.style.display = 'none';
viewer.scene.globe.enableLighting = true;
viewer._cesiumWidget._creditContainer.style.display = 'none';
//*****cesium3dtiles*****//
const tileset = new Cesium.Cesium3DTileset({
url: "/3dtiles/tileset.json",
// url: "http://49.232.14.174:2226/pf/3dtiles/tileset.json",
});
tileset.readyPromise.then(function (tileset) {
viewer.scene.primitives.add(tileset);
//tileset
const cartographic = Cesium.Cartographic.fromCartesian(
tileset.boundingSphere.center
);
console.log('cartographic',cartographic);
const { longitude, latitude, height } = cartographic;
//
const current = Cesium.Cartesian3.fromRadians(
longitude,
latitude,
height
)
//
const surface = Cesium.Cartesian3.fromRadians(
cartographic.longitude, //
cartographic.latitude, //
0 //
)
//height
const offset = Cesium.Cartesian3.fromRadians(
longitude, latitude, 0
);
//tileset(modelMatrix),tileset
const translation = Cesium.Cartesian3.subtract(
offset, //height
surface, //
new Cesium.Cartesian3()
);
tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
//tileset
// tileset.tileLoad.addEventListener(function (tile) {
// let content = tile.content;
// // let featuresLength = content.featuresLength;
// let feature = content.getFeature(0);
// //tileset
// const cartographicMesh = Cesium.Cartographic.fromCartesian(
// feature._content._model._boundingSphere.center
// );
// //
// const currentMesh = Cesium.Cartesian3.fromRadians(
// cartographicMesh.longitude, //
// cartographicMesh.latitude, //
// cartographicMesh.height
// )
// //
// const surfaceMesh = Cesium.Cartesian3.fromRadians(
// cartographicMesh.longitude, //
// cartographicMesh.latitude, //
// 2 //
// )
// })
//tileset
viewer.zoomTo(
tileset,
new Cesium.HeadingPitchRange(
-4.0,
-0.65,
500
)
);
that.getEquipmentList();
});
//
// const tileset = new Cesium.Cesium3DTileset({
// url: "/3dtiles/tileset.json",
// // url: "http://49.232.14.174:2226/pf/3dtiles/tileset.json",
// });
// tileset.readyPromise.then(function (tileset) {
// viewer.scene.primitives.add(tileset);
// //tileset
// const cartographic = Cesium.Cartographic.fromCartesian(
// tileset.boundingSphere.center
// );
// console.log('cartographic',cartographic);
// const { longitude, latitude, height } = cartographic;
// //
// const current = Cesium.Cartesian3.fromRadians(
// longitude,
// latitude,
// height
// )
// //
// const surface = Cesium.Cartesian3.fromRadians(
// cartographic.longitude, //
// cartographic.latitude, //
// 0 //
// )
// //height
// const offset = Cesium.Cartesian3.fromRadians(
// longitude, latitude, 0
// );
// //tileset(modelMatrix),tileset
// const translation = Cesium.Cartesian3.subtract(
// offset, //height
// surface, //
// new Cesium.Cartesian3()
// );
// tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
// //tileset
// // tileset.tileLoad.addEventListener(function (tile) {
// // let content = tile.content;
// // // let featuresLength = content.featuresLength;
// // let feature = content.getFeature(0);
// // //tileset
// // const cartographicMesh = Cesium.Cartographic.fromCartesian(
// // feature._content._model._boundingSphere.center
// // );
// // //
// // const currentMesh = Cesium.Cartesian3.fromRadians(
// // cartographicMesh.longitude, //
// // cartographicMesh.latitude, //
// // cartographicMesh.height
// // )
// // //
// // const surfaceMesh = Cesium.Cartesian3.fromRadians(
// // cartographicMesh.longitude, //
// // cartographicMesh.latitude, //
// // 2 //
// // )
// // })
// //tileset
// viewer.zoomTo(
// tileset,
// new Cesium.HeadingPitchRange(
// -4.0,
// -0.65,
// 500
// )
// );
// that.getEquipmentList();
// });
// //
// var handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas);
// handler.setInputAction(function (click) {
// var feature = viewer.scene.pick(click.position);
// console.log("feature",feature);
// console.log("_attrs", feature.id._attrs);
// that.objItem = feature.id._attrs;
// that.getInfo(feature.id._id);
// if (Cesium.defined(feature)) {
// //
// 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 latitude = Cesium.Math.toDegrees(cartographic.latitude);//
// var height = cartographic.height; //
// // console.log('Longitude: ' + longitude);
// // console.log('Latitude: ' + latitude);
// // console.log('Height: ' + height);
// //
// //
// }
// }
// },
// Cesium.ScreenSpaceEventType.LEFT_CLICK);
// that.intervalequ = setInterval(() => {
// that.getEquipmentList();
// },60000)
//*****cesium3dtiles*****//
console.log('');
//*****cesium.glb*****//
//1viewer.scene.primitives.add
// var position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 0.1);
// var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(position);
// var url = "factory.glb";
// // glb
// var model = viewer.scene.primitives.add(Cesium.Model.fromGltf({
// url: url,
// modelMatrix: modelMatrix,
// scale: 1000//
// }));
// //
// model.readyPromise.then(function(model) {
// console.log(':', model);
// //
// var boundingSphere = model.boundingSphere;
// //
// viewer.camera.flyToBoundingSphere(boundingSphere, {
// duration: 0 //
// });
// //
// viewer.trackedEntity = model;
// }).otherwise(function(error) {
// console.error(':', error);
// });
//2viewer.entities.add
var url = "factory.glb";
var height = 0;
viewer.entities.removeAll() //entity
var position = Cesium.Cartesian3.fromDegrees(87.62594666147378, 42.975362631477815, height)
var heading = Cesium.Math.toRadians(310) //135
var pitch = Cesium.Math.toRadians(0);
var roll = Cesium.Math.toRadians(0);
var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll)
var orientation = Cesium.Transforms.headingPitchRollQuaternion(
position,hpr
)
var modelEntity = viewer.entities.add({
name: 'photon',
position: position,
orientation: orientation,
model: {
uri: url,//entitits.addgltfuriurl.glb
scale: 1.0,//
minimumPixelSize: 256,//
maximumScale: 20000,//minimumPixelSize
incrementallyLoadTextures: true,//
shadows: Cesium.ShadowMode.ENABLED,
heightReference: Cesium.HeightReference.NONE
},
})
viewer.trackedEntity = modelEntity; //
viewer.zoomTo(modelEntity, new Cesium.HeadingPitchRange(-4.2, -0.5, 30));
that.getEquipmentList();
//
var handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas);
handler.setInputAction(function (click) {
var feature = viewer.scene.pick(click.position);
console.log("feature",feature);
console.log("_attrs", feature.id._attrs);
that.objItem = feature.id._attrs;
that.getInfo(feature.id._id);
if (Cesium.defined(feature)) {
//
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 latitude = Cesium.Math.toDegrees(cartographic.latitude);//
var height = cartographic.height; //
// console.log('Longitude: ' + longitude);
// console.log('Latitude: ' + latitude);
// console.log('Height: ' + height);
//
//
}
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
//*****cesium3dtiles*****//
//*****cesium.glb*****//
//
// viewer.scene.globe.show = false
//
// var position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 0.1);
// var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(position);
// var url = "/glb/photon4.glb";
// // glb
// var model = viewer.scene.primitives.add(Cesium.Model.fromGltf({
// url: url,
// modelMatrix: modelMatrix,
// scale: 1000//
// }));
// //
// model.readyPromise.then(function(model) {
// console.log(':', model);
// //
// var boundingSphere = model.boundingSphere;
// //
// viewer.camera.flyToBoundingSphere(boundingSphere, {
// duration: 0 //
// });
// //
// viewer.trackedEntity = model;
// }).otherwise(function(error) {
// console.error(':', error);
// });
// var url = "/glb/photon4.glb";
// var height = 0;
// viewer.entities.removeAll() //entity
// var position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, height)
// var heading = Cesium.Math.toRadians(310) //135
// var pitch = Cesium.Math.toRadians(0);
// var roll = Cesium.Math.toRadians(0);
// var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll)
// var orientation = Cesium.Transforms.headingPitchRollQuaternion(
// position,
// hpr
// )
// var modelEntity = viewer.entities.add({
// name: 'photon',
// position: position,
// orientation: orientation,
// model: {
// uri: url,//entitits.addgltfuriurl.glb
// scale: 1.0,//
// minimumPixelSize: 2500,//
// maximumScale: 20000,//minimumPixelSize
// incrementallyLoadTextures: true,//
// runAnimations: true,//gltf
// clampAnimations: true,//gltf姿
// shadows: Cesium.ShadowMode.ENABLED,
// heightReference: Cesium.HeightReference.NONE
// },
// })
// // //
// // modelEntity.model.readyPromise.then(function(model) {
// // //
// // // primitives
// // var primitives = model.primitives;
// // //
// // primitives.forEach(function(primitive) {
// // // primitive GeometryInstance
// // //
// // //
// // var geometryInstance = primitive.geometryInstance;
// // //
// // console.log('Mesh:', geometryInstance);
// // });
// // }).otherwise(function(error) {
// // //
// // console.error(':', error);
// // });
// viewer.trackedEntity = modelEntity; //
// viewer.zoomTo(modelEntity);
// //
// viewer.entities.add({
// // fromDegreesCartesian3
// position: Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 1),
// point: {
// //
// pixelSize: 5,
// // fromCssColorString 使CSS
// color: Cesium.Color.fromCssColorString('#ee0000'),
// //
// outlineColor: Cesium.Color.fromCssColorString('#fff'),
// // ()
// outlineWidth: 2,
// //
// distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1500),
// //
// show: true
// }
// });
// //
// // console.log('Cesium.Cartesian3.fromDegrees',Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 0.5))
// viewer.entities.add({
// position: Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 0.5),
// billboard: {
// // URICanvas
// image: 'img/elec.png',
// //
// color: Cesium.Color.WHITE.withAlpha(0.8),
// //
// height: 50,
// //
// width: 50,
// //
// rotation: 20,
// //
// sizeInMeters: false,
// //
// verticalOrigin: Cesium.VerticalOrigin.CENTER,
// //
// horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
// //
// pixelOffset: new Cesium.Cartesian2(10, 0),
// // 1.01.0
// scale: 1.0,
// //
// distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 20000),
// //
// show: true
// }
// });
// setTimeout(() => {
// if (modelEntity.model.ready) {
// console.log('Model is loaded',modelEntity.model);
// } else {
// console.log('Model is still loading',modelEntity.model);
// }
// }, 10000);
// Cesium.when(modelEntity.model.readyPromise).then(function(model) {
// window.alert(model);
// }).otherwise(function(error){
// window.alert(error);
// });
// // modelEntity.model.readyPromise.then(function(model) {
// // //
// // console.log('Model loaded successfully')
// // }).otherwise(function(error) {
// // //
// // console.error('Failed to load model', error);
// // });
// // //
// // modelEntity.readyPromise.then(function(entity) {
// // var modelInstance = entity._modelInstance;
// // if (!modelInstance || !modelInstance.ready) {
// // console.error('');
// // return;
// // }
// // var geometryInstances = modelInstance.geometryInstances;
// // if (!geometryInstances || geometryInstances.length === 0) {
// // console.error('');
// // return;
// // }
// // var meshData = [];
// // geometryInstances.forEach(function(geometryInstance) {
// // var attributes = geometryInstance.attributes;
// // if (attributes && attributes.position) {
// // var positions = attributes.position.values;
// // // positions
// // // ...
// // meshData.push(/* */);
// // }
// // });
// // console.log("", meshData);
// // }).otherwise(function(error) {
// // console.error(":", error);
// // });
//
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 latitude = Cesium.Math.toDegrees(cartographic.latitude);//
var height = cartographic.height; //
console.log('Longitude: ' + longitude);
console.log('Latitude: ' + latitude);
console.log('Height: ' + height);
//
//
}
}
},
Cesium.ScreenSpaceEventType.LEFT_CLICK);
// // // entity
// // if (modelEntity.model) {
// // //
// // modelEntity.model.readyPromise.then(function(model) {
// // //
// // var geometry = model._glTFModel.scene.children[0].geometry; //
// // var attributes = geometry.attributes;
// // var positions = attributes.position.array; //
// // console.log("");
// // }).otherwise(function(error) {
// // //
// // console.error(":", error);
// // });
// // } else {
// // console.error("");
// // }
// // //
// // var entityCollection = viewer.entities;
// // //
// // var modelEntities = [];
// // //
// // entityCollection.values.forEach(function(entity) {
// // //
// // if (entity.model) {
// // //
// // modelEntities.push(entity.mesh);
// // }
// // });
// // // //
// // console.log(modelEntities);
// // //
// // var entityCollection = new Cesium.EntityCollection();
// // // modelEntities
// // modelEntities.forEach(function(modelEntity) {
// // //
// // var annotationEntity = entityCollection.add(new Cesium.Entity({
// // position: modelEntity.position, //
// // billboard: {
// // image: 'img/elec.png', //
// // scale: 0.5, //
// // //
// // }
// // }));
// // });
// // //
// // viewer.entities.add(entityCollection);
// //
// viewer.screenSpaceEventHandler.setInputAction(function (click) {
// var pickedObject = viewer.scene.pick(click.position);
// console.log("pickedObject",pickedObject);//mesh
// if (Cesium.defined(pickedObject) && pickedObject.id) {
// //
// var mesh = pickedObject.mesh;//modelMesh
// var node = pickedObject.node;//modelNode
// var position = pickedObject.id.position;
// //
// console.log(':', mesh);
// console.log(':', node);
// console.log(':', position);
// }
// }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
//*****cesium.glb*****//
},
methods: {
getChartTime() {
let endDate = new Date();
let startDate = new Date();
startDate.setTime(endDate.getTime() - 1000 * 3600 * 6);
console.log(tool.dateFormat1(startDate), tool.dateFormat1(endDate));
let params = {
query: {
end_time: tool.dateFormat1(endDate),
start_time: tool.dateFormat1(startDate),
time_bucket: "1 minute",
equipment_id: this.objItem.id
},
};
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)
let newOption = Object.assign({}, this.basicOption);
newOption.dataset.source = res.data.ds0;
myChart.setOption(newOption);
myChart.hideLoading()
})
// this.initChart();
},
//
getItemIcon(cateCode) {
switch (cateCode) {
case "eq_big":
return "img/enp_blue/eq_big.png";
case "eq_main":
return "img/enp_blue/eq_main.png";
case "eq_trans":
return "img/enp_blue/eq_trans.png";
case "fog_cannon":
return "img/enp_blue/fog_cannon.png";
case "dry_fog":
return "img/enp_blue/dry_fog.png";
case "dust_clean":
return "img/enp_blue/dust_clean.png";
case "truck_clean":
return "img/enp_blue/truck_clean.png";
case "wstation":
return "img/enp_blue/wstation.png";
case "tltx":
return "img/enp_blue/tltx.png";
case "tsp":
return "img/enp_blue/tsp.png";
case "cems":
return "img/enp_blue/cems.png";
case "aqms":
return "img/enp_blue/aqms.png";
case "monitor":
return "img/enp_blue/monitor.png";
}
},
//线
createoutLine(){
const orangeOutlined = this.viewer.entities.add({
name:
"Orange line with black outline at height and following the surface",
polyline: {
positions: Cesium.Cartesian3.fromDegreesArrayHeights([
119.196653, 26.031937, //线
10,//
119.196653, 26.031947, //
250,
]),
width: 5,
material: new Cesium.PolylineOutlineMaterialProperty({
color: Cesium.Color.ORANGE,
outlineWidth: 2,
outlineColor: Cesium.Color.BLACK,//
}),
},
});
},
//class
bindBtnClass(index) {
let classInfo = { btns: true, btnsActive: false };
@ -504,14 +515,14 @@ export default {
//
getEquipmentList() {
let that = this;
that.removePointer();
// 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)
let lon = parseFloat(item.coordinates.longitude);
let lat = parseFloat(item.coordinates.latitude);
let height = parseInt(item.coordinates.height) + 5;
let height = parseInt(item.coordinates.height) + 0.5;
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 };
@ -570,11 +581,30 @@ export default {
that.objItem = res;
console.log(res)
})
this.getChartTime();
},
initChart() {
var that = this;
var myChart = echarts.getInstanceByDom(document.getElementById('infoCharts'));
if (myChart == undefined) {
myChart = echarts.init(document.getElementById('infoCharts'));
}
myChart.showLoading();
this.$API.bi.dataset.exec.req('enp_edata2', {
query: this.query,
raise_exception: true
}).then(res => {
let newOption = Object.assign({}, this.basicOption);
let ds0 = res.data.ds0
ds0.pop()
newOption.dataset.source = res.data.ds0;
newOption.title.text = this.currentEquipmentName;
myChart.setOption(newOption);
}).then(() => { myChart.hideLoading() })
},
//
removePointer() {
let allEntitiesPoint = []
// console.log(viewer.entities.values)
let allEntitiesPoint = [];
this.viewer.entities.values.forEach((item) => {
allEntitiesPoint.push(item.id)
})
@ -586,6 +616,13 @@ export default {
closeInfo() {
this.infoShow = false;
},
//cemstsp
infoToDetail() {
let that = this;
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)
@ -604,48 +641,27 @@ export default {
})
console.log("allEntitiesPoint",allEntitiesPoint)
},
//
getItemIcon(cateCode) {
switch (cateCode) {
case "eq_big":
return "img/enp_blue/eq_big.png";
case "eq_main":
return "img/enp_blue/eq_main.png";
case "eq_trans":
return "img/enp_blue/eq_trans.png";
case "fog_cannon":
return "img/enp_blue/fog_cannon.png";
case "dry_fog":
return "img/enp_blue/dry_fog.png";
case "dust_clean":
return "img/enp_blue/dust_clean.png";
case "truck_clean":
return "img/enp_blue/truck_clean.png";
case "wstation":
return "img/enp_blue/wstation.png";
case "tltx":
return "img/enp_blue/tltx.png";
case "tsp":
return "img/enp_blue/tsp.png";
case "cems":
return "img/enp_blue/cems.png";
case "aqms":
return "img/enp_blue/aqms.png";
case "monitor":
return "img/enp_blue/monitor.png";
}
},
//
showChange(val) {
let classname = 'bottomMenu' + val;
document.getElementsByClassName(classname)[0].style.display = 'block';
if (document.getElementsByClassName(classname)[0].style.display == 'block') {
document.getElementsByClassName(classname)[0].style.display = 'none';
}else{
document.getElementsByClassName(classname)[0].style.display = 'block';
}
},
//
handleMouseLeave(val) {
let classname = 'bottomMenu' + val;
document.getElementsByClassName(classname)[0].style.display = 'none';
},
}
},
beforeUnmount() {
// viewer.destroy();
this.viewer = null;
},
}
</script>
<style>
@ -661,7 +677,7 @@ export default {
position: fixed;
right: 22%;
bottom: 10%;
width: 20%;
width: 380px;
min-height: 20vh;
min-width: 360px;
background: rgba(0, 50, 56, 0.8);
@ -679,6 +695,11 @@ export default {
left: 10px;
top:10px;
}
.infoDom_toDetail{
position: absolute;
right: 10px;
top:10px;
}
.bodyTitle{
height: 24px;
line-height: 24px;
@ -777,11 +798,11 @@ export default {
.bottomMenu_item>.el-checkbox__input.is-checked>.el-checkbox__inner {
width: 20px;
height: 20px;
background-color: #00f6ff;
border-color: #00f6ff;
background-color: #1ca50a;
border-color: #1ca50a;
}
.bottomMenu_item>.el-checkbox__input.is-checked+.el-checkbox__label{
color: #00f6ff;
color: #1ca50a;
}
.bottomMenu_item>.el-checkbox__input.is-checked .el-checkbox__inner::after{
height: 11px;
@ -790,4 +811,27 @@ export default {
width: 6px;
}
/* 底部多选框--end */
.bodyContainer{
margin: 10px;
}
.infoTableTr{
display: flex;
justify-content: space-between;
}
.infoTableTr>div{
flex: 0 0 33%;
height: 30px;
text-align: center;
line-height: 30px;
}
.infoTableHeadTh{
background: rgb(80, 127, 80);
}
.infoTableBodytd{
background: rgba(38 ,52 ,38 ,.8);
}
.infoCharts{
width: 100%;
height: 150px;
}
</style>

View File

@ -10,7 +10,7 @@
</el-header>
<el-main class="nopadding">
<scTable :data="tableData" style="width: 100%;" size="large" :apiObj="apiObj" row-key="id"
:params="params" hidePagination hideDo @row-click="rowClick">
:params="params" hidePagination hideDo @row-click="rowClick">
<el-table-column type="index" width="50" />
<el-table-column prop="number" label="设备编号" width="120" />
<el-table-column prop="name" label="设备名称" width="160" />
@ -106,6 +106,20 @@
import * as echarts from "echarts";
import { runningStateEnum } from "@/utils/enum.js";
export default {
props: {
directDetail: {
type: Boolean,
default: () => {
return false;
},
},
eqId: {
type: String,
default: () => {
return '';
},
},
},
data() {
return {
runningStateEnum,
@ -168,6 +182,16 @@ export default {
}
},
mounted() {
if (this.directDetail) {
this.currentEquipmentId = this.eqId;
this.currentEquipmentName = this.eqId;
this.query.equipment_id = this.eqId;
this.$nextTick(() => { this.handleQuery() })
}
console.log(runningStateEnum[50])
this.initTimeRange()
},

View File

@ -12,7 +12,7 @@
<scTable :data="tableData" style="width: 100%;" size="large" row-key="id" v-loading="tableLoading">
<el-table-column type="index" width="50" />
<el-table-column prop="equipment_number" label="设备编号" width="120" />
<el-table-column prop="drain_name" label="排口名称" width="180" />
<el-table-column prop="equipment_name" label="设备名称" width="180" />
<el-table-column prop="metric_0" label="0分钟" />
<el-table-column prop="metric_5" label="5分钟" />
<el-table-column prop="metric_10" label="10分钟" />
@ -29,9 +29,11 @@
<el-table-column prop="dust_alarm" label="预警值" />
<el-table-column label="是否达标" width="120">
<template #default="scope">
<span v-if="scope.row.metric_hour < scope.row.dust_alarm"
<div v-if="scope.row.dust_alarm">
<span v-if="scope.row.metric_hour < scope.row.dust_alarm"
style="color:green;font-weight: bold;">达标</span>
<span v-else style="color:red;font-weight: bold;">未达标</span>
<span v-else style="color:red;font-weight: bold;">未达标</span>
</div>
</template>
</el-table-column>
</scTable>
@ -50,7 +52,8 @@ export default {
"year": 2024,
"month": 1,
"metric": "dust_rtd",
"drain_type": 10
"drain_type": 10,
"ecate_code":"cems"
}
}
},
@ -69,7 +72,7 @@ export default {
getTableData() {
this.initDate()
this.tableLoading = true
this.$API.bi.dataset.exec.req('enp_edata_metric', { query: this.query, raise_exception: true }).then(res => {
this.$API.bi.dataset.exec.req('enp_edata_metric_nodrain', { query: this.query, raise_exception: true }).then(res => {
let data = res.data2.ds0
for (let i = 0, y = data.length; i < y; i++) {
for (let key in data[i]) {

View File

@ -17,7 +17,7 @@
</div>
</div>
<div class="right-panel">
<el-select v-model="query.cate" placeholder="车辆分类" @change="handleQuery" clearable>
<el-select v-model="query.cate__code" placeholder="车辆分类" @change="handleQuery" clearable>
<el-option v-for="item in cateOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
@ -27,7 +27,7 @@
</div>
</el-header>
<el-main>
<scTable :data="tableData" :apiObj="apiObj" :params="params" :query="query" size="large" style=""
<scTable ref="table" :data="tableData" :apiObj="apiObj" :params="params" :query="query" size="large" style=""
@row-click="rowClick">
<el-table-column type="index" width="50" />
<el-table-column prop="number" label="车牌号"></el-table-column>
@ -53,10 +53,8 @@ export default {
query: {},
params: { type: 30, tags: 'carwash' },
cateOptions: [
{ id: 1, name: '场内运输车辆' },
{ id: 2, name: '非路道移动机械' },
// { id: 3, name: '' },
// { id: 4, name: '' },
{ id: 'inner_car', name: '场内运输车辆' },
{ id: 'inner_car2', name: '非路道移动机械' },
],
apiObj: this.$API.em.equipment.list,

View File

@ -226,6 +226,8 @@
<div id="dataChart" style="width: 100%; height:280px;margin-top:4px; padding: 4px"></div>
<div style="height: 4px"></div>
<div id="dataChart2" style="width: 100%; height:140px; padding: 4px"></div>
<div style="height: 4px"></div>
<div id="dataChart3" style="width: 100%; height:140px;padding: 4px"></div>
</div>
</el-main>
@ -236,6 +238,20 @@
<script>
import * as echarts from "echarts";
export default {
props: {
directDetail: {
type: Boolean,
default: () => {
return false;
},
},
eqId: {
type: String,
default: () => {
return '';
},
},
},
data() {
return {
count: 0,
@ -380,8 +396,11 @@ export default {
var that = this;
var chartDom = document.getElementById('dataChart');
var chartDom2 = document.getElementById('dataChart2');
var chartDom3 = document.getElementById('dataChart3');
var myChart = echarts.init(chartDom, 'dark');
var myChart2 = echarts.init(chartDom2, 'dark');
var myChart3 = echarts.init(chartDom3, 'dark');
echarts.connect([myChart, myChart2,myChart3])
let params = {
query: that.biquery,
// raise_exception: true
@ -420,7 +439,17 @@ export default {
newOption2.title.text = that.eqs.name;
myChart2.setOption(newOption2);
myChart2.hideLoading()
echarts.connect([myChart, myChart2])
})
}).then(() => {
params['equipment_id'] = this.eqz.id
that.$API.bi.dataset.exec.req('eq_status', params).then(res3 => {
let newOption3 = Object.assign({}, this.basicOption);
newOption3.yAxis.minInterval = 1;
newOption3.dataset.source = res3.data.ds0;
newOption3.dataZoom.startValue = that.biquery.start_time;
newOption3.title.text = that.eqz.name;
myChart3.setOption(newOption3);
myChart3.hideLoading()
})
})
},

View File

@ -338,8 +338,9 @@ export default {
} else if (type == 2) {
newOption.series = [
{ type: 'line', encode: { y: 'tsp', seriesName: ["tsp"] } },
{ type: 'line', encode: { y: '温度', seriesName: ["温度"] } },
{ type: 'line', encode: { y: '压力', seriesName: ["压力"] } }]
// { type: 'line', encode: { y: '', seriesName: [""] } },
// { type: 'line', encode: { y: '', seriesName: [""] } }
]
newOption.title.text = that.eqc.name;
newOption.yAxis.minInterval = 1;
myChart2.setOption(newOption);

View File

@ -50,7 +50,12 @@
<el-table-column prop="door_name" label="门禁名称"></el-table-column>
<el-table-column prop="vehicle_number" label="车辆识别代号VIN"></el-table-column>
<el-table-column prop="emission_standard" label="排放标准"></el-table-column>
<el-table-column prop="" label="新能源"></el-table-column>
<el-table-column prop="" label="新能源">
<template #default="scope">
<el-tag type="info" v-if="scope.row.is_new_energy"></el-tag>
<el-tag v-else type="danger"></el-tag>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>

View File

@ -238,7 +238,7 @@
<div style="flex-shrink:1;width: 100px;align-self: center;display: flex;flex-direction: column;">
<div class="todyCarItem" v-for="item in pieData" :key="item">
<span style="color: #d5d5d5;">{{ item.name }}</span>
<span style="font-size: 30px;color: #00f6ff;font-weight: bold;display: inline-block;text-align: center;">{{ item.value }}</span>
<span style="font-size: 35px;color: #00f6ff;font-weight: bold;display: inline-block;text-align: center;">{{ item.value }}</span>
</div>
</div>
</div>
@ -385,7 +385,7 @@ export default {
series: {
name: '今日车辆数量统计',
type: 'pie',
radius: [35, 45],
radius: [35, 55],
center: ['50%', '50%'],
emphasis: {
focus: 'series',
@ -436,6 +436,7 @@ export default {
cemsData: [],
tspData: [],
wData: [],
intervalinfo:null,//
}
},
created() {
@ -448,15 +449,23 @@ export default {
that.getleft1Data();
that.getleft2Data();
that.getleft3Data();
this.getright1Data();
this.getright2Data();
this.getright3Data();
that.getright1Data();
that.getright2Data();
that.getright3Data();
that.initCharts();
that.addListener();
that.$nextTick(() => {
setTimeout(function () {
}, 5000);
});
// that.intervalinfo = setInterval(() => {
// that.getleft1Data();
// // that.getleft2Data();
// that.getleft3Data();
// that.getright1Data();
// that.getright2Data();
// that.getright3Data();
// },60000)
},
beforeUnmount() {
//
@ -758,6 +767,7 @@ export default {
},
},
unmounted() {
this.intervalinfo = null;
document.documentElement.classList.remove("dark");
this.$TOOL.data.remove("APP_DARK")
},