pull/63/head
孙萌 2023-12-04 14:48:53 +08:00
parent b8a8121161
commit 5edfe5088c
2 changed files with 42 additions and 5 deletions

View File

@ -160,6 +160,10 @@ export default {
getControlGetState(data) {
return sendGetRequest('/readControl/getState', data)
},
//控制器 气象站实时数据折线图
getControlChartdata(data) {
return sendPostRequest('/equip/chartdata?equipmentId='+data, '')
},

View File

@ -1,8 +1,8 @@
<template>
<div class="formula realTime">
<div class="page-content new-data" :class="deviceName == 10 ? 'control-page' : ''">
<div class="page-content new-data" :class="deviceName == 10||deviceName == 30 ? 'control-page' : ''">
<div class="control-view" v-if="deviceName == 10">
<div class="control-view" v-if="deviceName == 10||deviceName == 30">
<div class="title">气象站:</div>
<vue-seamless class="control-list" :data="controlList" :class-option="defaultOption1">
<div class="list-view" v-for="item, index in controlList " :key="index">
@ -22,8 +22,6 @@
<div class="table-title">
<img src="../../assets/image/real-time.png" alt="" />
实时数据
<!-- <div class="tips">种植作物1</div> -->
</div>
<div class="timeNow" v-if="list.length">
<!-- {{ time.year.year }}-{{ time.year.month }}-{{ time.year.date }}<span> {{ time.time }}:{{ time.timeS
@ -53,7 +51,7 @@
</div>
<div class="flex-list realTime-bottom">
<div class="left-view">
<div class="left-view" v-if="deviceName!=30">
<div ref="monitor" class="monitor" id="monitor">
<!-- <video ref="videoPlayer" class="video-js" id="video-js"></video> -->
<div ref="videoPlayer" class="video-js" id="video-js"></div>
@ -606,6 +604,41 @@ export default {
}
})
}
} else if (this.deviceName == 30) {
this.api.getControlRtDatastation(formData).then(res => {
this.controlList = []
if (res.data.code == 200) {
res.data.data.forEach((el, index) => {
list.forEach((el1, index1) => {
if (el.formula == el1.value) {
// console.log(el1);
var num = el.environmentData + el1.unit
this.list.push({
...el,
name:el.environmentDataId,
num: num,
img: require(`../../assets/image/real-time-${el.formula}.png`)
})
this.controlList.push({
...el,
num: num,
img: require(`../../assets/image/real-time-${el.formula}.png`)
})
}
})
})
}
// console.log(this.controlList);
})
this.api.getControlChartdata(equipmentId).then(res => {
if (res.data.code == 200) {
res.data.data.forEach((el, index) => {
var chartsData = res.data.data
realTimeLine('realTime-line', chartsData)
})
}
})
}
},