fix: enp 设备状态查询的优化

This commit is contained in:
caoqianming 2024-04-17 11:02:41 +08:00
parent 2ce50e7bac
commit aa2a4c136c
6 changed files with 17 additions and 12 deletions

View File

@ -49,7 +49,7 @@ export const runningStateEnum = new EnumFactory({
20: { text: '待机', type: 'primary' },
30: { text: '停机', type: 'warning' },
40: { text: '故障', type: 'danger' },
50: { text: '未知', type: 'info' },
50: { text: '离线', type: 'info' },
}, parseInt)
export const onlingEnum = new EnumFactory({

View File

@ -570,8 +570,11 @@ export default {
},
getChartTime() {
let endDate = new Date();
endDate.setTime(endDate.getTime() - 1000 * 60);
endDate.setSeconds(0);
let startDate = new Date();
startDate.setTime(endDate.getTime() - 1000 * 3600 * 6);
startDate.setSeconds(0);
console.log(tool.dateFormat1(startDate), tool.dateFormat1(endDate));
let params = {
query: {
@ -681,7 +684,6 @@ export default {
type: item.cate_code,
cate_code: item.cate_code,
state: item.running_state,
is_online: item.is_online,
};
let config = {
show: true,
@ -710,7 +712,6 @@ export default {
id = "11111",
type,
height,
is_online,
cate_code,
state,
} = attrs;
@ -731,7 +732,6 @@ export default {
attrs: attrs,
id: id,
type: type,
is_online: is_online,
cate_code: cate_code,
state: state,
position: Cesium.Cartesian3.fromDegrees(

View File

@ -431,7 +431,7 @@ export default {
// echarts.connect([myChart, myChart2])
}).then(() => {
params['equipment_id'] = this.eqs.id
that.$API.bi.dataset.exec.req('eq_status', params).then(res2 => {
that.$API.bi.dataset.exec.req('enp_eq_rs', params).then(res2 => {
let newOption2 = Object.assign({}, this.basicOption);
newOption2.yAxis.minInterval = 1;
newOption2.dataset.source = res2.data.ds0;
@ -442,7 +442,7 @@ export default {
})
}).then(() => {
params['equipment_id'] = this.eqz.id
that.$API.bi.dataset.exec.req('eq_status', params).then(res3 => {
that.$API.bi.dataset.exec.req('enp_eq_rs', params).then(res3 => {
let newOption3 = Object.assign({}, this.basicOption);
newOption3.yAxis.minInterval = 1;
newOption3.dataset.source = res3.data.ds0;

View File

@ -310,14 +310,14 @@ export default {
var bicode = 'enp_edata2'
if (type == 1) {
var myChart = echarts.getInstanceByDom(document.getElementById('dataChart'));
bicode = 'eq_status'
bicode = 'enp_eq_rs'
myChart.showLoading();
} else if (type == 2) {
var myChart2 = echarts.getInstanceByDom(document.getElementById('dataChart2'));
myChart2.showLoading();
} else if (type == 3) {
var myChart3 = echarts.getInstanceByDom(document.getElementById('dataChart3'));
bicode = 'eq_status'
bicode = 'enp_eq_rs'
myChart3.showLoading();
}
// else {

View File

@ -49,7 +49,7 @@
<el-tag :type="runningStateEnum[item.running_state]?.type">{{
runningStateEnum[item.running_state]?.text }}</el-tag>|
{{ item.name }} |
运行时间 <span style="font-weight:bold; font-size: 1.6vh">{{ item.total_duration_run
运行时间 <span style="font-weight:bold; font-size: 1.6vh">{{ item.duration_run
}}</span> h
</div>
</div>
@ -62,7 +62,7 @@
<div v-if="item.type == 30">
<div><el-tag :type="runningStateEnum[item.running_state]?.type">{{
runningStateEnum[item.running_state]?.text }}</el-tag>|{{ item.name }} |
运行时间 <span style="font-weight:bold; font-size: 1.6vh">{{ item.total_duration_run
运行时间 <span style="font-weight:bold; font-size: 1.6vh">{{ item.duration_run
}}</span> h
</div>
</div>
@ -73,7 +73,7 @@
<template #default="scope">
<div v-for="item in scope.row.equip_data" v-bind:key="item.id">
<div v-if="item.type == 40">
<div>{{ item.avg_tsp }}
<div>TSP均值 {{ item.avg_tsp }}
</div>
</div>
</div>

View File

@ -82,11 +82,16 @@
</el-select>
</el-form-item>
</el-col>
<el-col :md="24" :sm="24">
<el-col :md="12" :sm="24">
<el-form-item label="计算公式">
<el-input v-model="form.formula" clearable></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="调用方法">
<el-input v-model="form.func_on_change" clearable></el-input>
</el-form-item>
</el-col>
<el-col :md="8" :sm="24">
<el-form-item label="是否启用">
<el-switch v-model="form.enabled"/>