fix:排放图标点击事件

This commit is contained in:
shijing 2024-04-08 11:20:45 +08:00
parent d120b827ae
commit 6e932ef1e9
4 changed files with 169 additions and 80 deletions

BIN
public/9M.glb Normal file

Binary file not shown.

BIN
public/photon_tree.glb Normal file

Binary file not shown.

BIN
public/tree.glb Normal file

Binary file not shown.

View File

@ -157,62 +157,26 @@
>
<span class="titleIcon"></span>实时监测
</p>
<p class="bodyTitle" v-else-if="objItem.cate_code != 'monitor'">
<p class="bodyTitle" v-else-if="objItem.type != '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>
<span>运行</span>
</div>
<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>
<span>离线</span>
</div>
</div>
<div
v-else-if="
objItem.type == 40 && objItem.cate_code == 'cems'
"
>
<div v-if="objItem.cate_code == 'cems'">
<div class="infoTableTr">
<div class="infoTableHeadTh">颗粒物</div>
<div class="infoTableHeadTh">SO₂</div>
<div class="infoTableHeadTh">NOx</div>
</div>
<div class="infoTableTr">
<div class="infoTableBodytd">13.00mg/</div>
<div class="infoTableBodytd">13.00mg/</div>
<div class="infoTableBodytd">13.00mg/</div>
<div class="infoTableBodytd">
{{ objItem.颗粒物折算值 }}mg/
</div>
<div class="infoTableBodytd">
{{ objItem.so2折算值 }}mg/
</div>
<div class="infoTableBodytd">
{{ objItem.nox折算值 }}mg/
</div>
</div>
<div class="infoTableTr">
<div class="infoTableHeadTh">流量</div>
@ -220,25 +184,76 @@
<div class="infoTableHeadTh">湿度</div>
</div>
<div class="infoTableTr">
<div class="infoTableBodytd">22320.000/h</div>
<div class="infoTableBodytd">70.54</div>
<div class="infoTableBodytd">0.80%</div>
<div class="infoTableBodytd">
{{ objItem.流量 }}/h
</div>
<div class="infoTableBodytd">
{{ objItem.温度 }}
</div>
<div class="infoTableBodytd">
{{ objItem.湿度 }}%
</div>
</div>
</div>
<div
v-else-if="
objItem.type == 40 && objItem.cate_code == 'tsp'
"
>
<div v-else-if="objItem.cate_code == 'tsp'">
<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 class="infoTableBodytd">
{{ objItem.tsp }}mg/
</div>
<div class="infoTableBodytd">
{{ objItem.温度 }}
</div>
<div class="infoTableBodytd">
{{ objItem.湿度 }}%
</div>
</div>
</div>
<div v-else>
<div class="rdio-group">
<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
? 'redIcon'
: objItem.state == 30
? 'redIcon'
: objItem.state == 40
? 'redIcon'
: '',
]"
>
<el-icon class="radio-ico"
><el-icon-warningFilled
/></el-icon>
<span>停机</span>
</div>
<div
:class="[
'radio-item',
objItem.state == 50 ? 'redIcon' : '',
]"
>
<el-icon class="radio-ico"
><el-icon-warningFilled
/></el-icon>
<span>离线</span>
</div>
</div>
</div>
</div>
@ -285,15 +300,15 @@ export default {
formatter: function (params) {
var result = "";
let text =
params[0].data[1] == 1
params[0].data[1] == 10
? "运行"
: params[0].data[1] == 0
? "待机"
: "故障";
: params[0].data[1] == 50
? "离线"
: "停机";
let colors =
text == "运行"
? "#21a51f"
: text == "机"
: text == "机"
? "#ff8608"
: "#c7c7c7";
var lineHtml =
@ -345,26 +360,45 @@ export default {
},
pieces: [
{
gt: 0.5,
lte: 1,
gt: 1,
lte: 11,
label: "运行",
color: "#21a51f",
},
{
gt: -0.5,
lte: 0.5,
label: "机",
gt: 15,
lte: 45,
label: "机",
color: "#ff8608",
},
{
gt: -1,
lte: -0.5,
gt: 46,
lte: 55,
label: "离线",
color: "#c7c7c7",
},
],
},
series: [{ type: "line" }],
series: [
{
type: "line",
encode: { y: "运行状态", seriesName: ["运行状态"] },
itemStyle: {
normal: {
color: function (params) {
var value = params.value;
if (value < 15) {
return "#21a51f";
} else if (value >= 15 && value < 45) {
return "#ff8608";
} else {
return "c7c7c7";
}
},
},
},
},
],
},
modelPosition: [
{ lng: 88.64154268696439, lat: 42.721977308996635 },
@ -547,7 +581,7 @@ export default {
myChart.showLoading();
// 使
// myChart.setOption(option)
this.$API.bi.dataset.exec.req("eq_status", params).then((res) => {
this.$API.bi.dataset.exec.req("enp_edata2", params).then((res) => {
console.log(res);
let newOption = Object.assign({}, this.basicOption);
newOption.dataset.source = res.data.ds0;
@ -629,18 +663,21 @@ export default {
item.coordinates.longitude &&
item.coordinates.latitude
) {
console.log(item);
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);
let type = item.cate_code;
let arrs = {
name: item.name,
lon: lon,
lat: lat,
height: height,
id: item.id,
type: type,
type: item.cate_code,
cate_code: item.cate_code,
state: item.running_state,
is_online: item.is_online,
};
let config = {
show: true,
@ -667,8 +704,11 @@ export default {
lon,
lat,
id = "11111",
type = "display",
type,
height,
is_online,
cate_code,
state,
} = attrs;
const {
show = true,
@ -687,6 +727,9 @@ export default {
attrs: attrs,
id: id,
type: type,
is_online: is_online,
cate_code: cate_code,
state: state,
position: Cesium.Cartesian3.fromDegrees(
lon || 117.08387268794274,
lat || 31.6557737395655433,
@ -738,14 +781,60 @@ export default {
},
//
getInfo(equpmentId) {
console.log("this.objItem------clickItem", this.objItem);
let that = this;
that.infoShow = true;
console.log(equpmentId);
//id
this.$API.em.equipment.item.req(equpmentId).then((res) => {
that.objItem = res;
console.log(res);
});
// //id
// this.$API.em.equipment.item.req(equpmentId).then((res) => {
// that.objItem = res;
// console.log(res);
// });
if (that.objItem.type == "tsp" || that.objItem.type == "cems") {
let nowDate = new Date();
let startDate = new Date();
let year = nowDate.getFullYear();
let month = nowDate.getMonth() + 1;
let day = nowDate.getDate();
let hour = nowDate.getHours();
month = month < 10 ? "0" + month : month;
day = day < 10 ? "0" + day : day;
hour = hour < 10 ? "0" + hour : hour;
let start_time =
year + "-" + month + "-" + day + " " + hour + ":00:00";
let end_time =
year + "-" + month + "-" + day + " " + hour + ":59:00";
let params = {
query: {
end_time: end_time,
start_time: start_time,
time_bucket: "1 hour",
equipment_id: this.objItem.id,
},
};
this.$API.bi.dataset.exec
.req("enp_edata2", params)
.then((res) => {
console.log(res);
if (res.data2.ds0 && res.data2.ds0.length > 0) {
if (that.objItem.type == "tsp") {
that.objItem.tsp = res.data2.ds0[0].tsp;
that.objItem.温度 = res.data2.ds0[0].温度;
that.objItem.湿度 = res.data2.ds0[0].湿度;
} else if (that.objItem.type == "cems") {
that.objItem.流量 = res.data2.ds0[0].流量;
that.objItem.湿度 = res.data2.ds0[0].湿度;
that.objItem.温度 = res.data2.ds0[0].温度;
that.objItem.so2折算值 =
res.data2.ds0[0].so2折算值;
that.objItem.nox折算值 =
res.data2.ds0[0].nox折算值;
that.objItem.颗粒物折算值 =
res.data2.ds0[0].颗粒物折算值;
}
}
});
}
this.getChartTime();
},
initChart() {