|
|
|
@ -1,5 +1,12 @@ |
|
|
|
|
<template> |
|
|
|
|
<div class="app-container home"> |
|
|
|
|
<el-form :model="data.form" label-width="0px"> |
|
|
|
|
<el-form-item label=""> |
|
|
|
|
<el-select v-model="data.form.device"> |
|
|
|
|
<el-option v-for="item in data.devArr" :label="item.deviceName" :value="item.deviceId" @click.native="selectDevice(item.deviceId)"/> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<div class="top"> |
|
|
|
|
<div class="card"> |
|
|
|
|
<div><img src="../../../assets/images/用电量.png"></div> |
|
|
|
@ -67,7 +74,7 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script name="Index"> |
|
|
|
|
import {getDrgl, getDcgl} from '../../../api/emonitor/api' |
|
|
|
|
import {getDrgl, getDcgl,getSb} from '../../../api/emonitor/api' |
|
|
|
|
import {onMounted, reactive} from "vue"; |
|
|
|
|
import * as echarts from 'echarts'; |
|
|
|
|
export default { |
|
|
|
@ -217,12 +224,21 @@ export default { |
|
|
|
|
temIn:'', |
|
|
|
|
temOut:'', |
|
|
|
|
time:'', |
|
|
|
|
form:{ |
|
|
|
|
device: 1 |
|
|
|
|
}, |
|
|
|
|
devArr:'', |
|
|
|
|
deviceId: 1, |
|
|
|
|
}) |
|
|
|
|
onMounted(() => {//需要获取到element,所以是onMounted的Hook |
|
|
|
|
// getDrgl(1).then((res)=>{ |
|
|
|
|
// console.log(res) |
|
|
|
|
// }) |
|
|
|
|
getDcgl(1).then((res)=>{ |
|
|
|
|
//需要获取到element,所以是onMounted的Hook |
|
|
|
|
onMounted(() => { |
|
|
|
|
getSbFun() |
|
|
|
|
getDcglFun() |
|
|
|
|
getDrglFun() |
|
|
|
|
}); |
|
|
|
|
//渲染电磁锅炉数据 |
|
|
|
|
function getDcglFun(){ |
|
|
|
|
getDcgl(data.deviceId).then((res)=>{ |
|
|
|
|
console.log(res) |
|
|
|
|
//日用电量 |
|
|
|
|
let arr = [] |
|
|
|
@ -530,7 +546,9 @@ export default { |
|
|
|
|
myChart4.resize(); |
|
|
|
|
}; |
|
|
|
|
}) |
|
|
|
|
getDrgl(1).then((res)=>{ |
|
|
|
|
} |
|
|
|
|
function getDrglFun(){ |
|
|
|
|
getDrgl(data.deviceId).then((res)=>{ |
|
|
|
|
console.log('1',res) |
|
|
|
|
if(res.data!=null){ |
|
|
|
|
data.tempIn=res.data.tempIn |
|
|
|
@ -648,15 +666,31 @@ export default { |
|
|
|
|
myChart3.resize(); |
|
|
|
|
}; |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
return { |
|
|
|
|
data |
|
|
|
|
//获取电磁锅炉设备 |
|
|
|
|
function getSbFun(){ |
|
|
|
|
getSb().then((res)=>{ |
|
|
|
|
console.log('获取设备',res.data) |
|
|
|
|
for(let i = 0;i < res.data.length;i++){ |
|
|
|
|
if(res.data[i].modelName == '电磁锅炉'){ |
|
|
|
|
data.devArr = res.data[i].children |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
console.log('devArr',data.devArr) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
//切换设备 |
|
|
|
|
function selectDevice(id){ |
|
|
|
|
console.log(id) |
|
|
|
|
data.deviceId = id; |
|
|
|
|
getDcglFun() |
|
|
|
|
getDrglFun() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
components: {}, |
|
|
|
|
mounted() {}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return {data, selectDevice} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|