wszhyWx/pages/timeEnvironment/timeEnvironment.vue

865 lines
29 KiB
Vue
Raw Normal View History

2023-09-28 10:07:02 +00:00
<template>
<view class="timeEnvironment">
<u-navbar :background="background" :is-back='true' back-icon-color='#FFFFFF' :border-bottom="false" title="实时环境"
title-color='#FFFFFF' :title-bold='true' title-size='32'></u-navbar>
<view class="navbar">
2023-10-05 04:08:22 +00:00
<image src="../../static/timeEnvironment_bg.png" mode=""></image>
2023-09-28 10:07:02 +00:00
</view>
<view class="content">
<view class="title">
2023-10-05 04:08:22 +00:00
<image src="../../static/logo_1.png" mode=""></image>
2023-09-28 10:07:02 +00:00
<view class="right">
<view class="">
温室智慧云
</view>
<view class="">
Greenhouse wisdom Cloud
</view>
</view>
</view>
<view class="subtitle">
欢迎使用温室智慧云数据统计
</view>
2023-11-10 02:43:22 +00:00
<view class="waterAndFertilizerParams" v-for="(item1,index1) in waterAndFertilizerParamsList" :key="index1">
2023-09-28 10:07:02 +00:00
<view class="nav">
2023-10-05 04:08:22 +00:00
<image src="../../static/PH.png" mode=""></image>
2023-09-28 10:07:02 +00:00
<text>{{ item1.deviceTypeName }}</text>
</view>
<view class="detail">
2024-01-10 02:42:05 +00:00
<view class="item" v-for="(item2,index2) in item1.childList_mubiao" :key="index2"
2023-11-10 02:43:22 +00:00
@click="toTarget_water_fertilizer_PH(item2.equipmentId,item2.environmentData,item2.environmentDataId,item2.equipmentNumber,item2.targetValue,getTypeList(item2.formula),item2.equipmentName)">
2023-10-24 09:48:48 +00:00
<image :src="`../../static/icon_new/icon${ item2.formula }.png`" mode=""></image>
2023-09-28 10:07:02 +00:00
<view class="info">
2023-11-10 02:43:22 +00:00
<view class="">
{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}
</view>
2024-01-11 01:27:30 +00:00
<view class="" :style="item2.equipmentStart == 0 ? 'color:red':''">{{ item2.equipmentStart == 0 ? '故障' : (item2.environmentData + getTypeList(item2.formula)) }}</view>
2023-09-28 10:07:02 +00:00
</view>
</view>
2024-01-10 02:42:05 +00:00
<view class="line" v-if="item1.childList_mubiao.length > 0"></view>
<view class="item" v-for="(item2,index2) in item1.childList_one" :key="index2"
@click="toTarget_water_fertilizer_PH(item2.equipmentId,item2.environmentData,item2.environmentDataId,item2.equipmentNumber,item2.targetValue,getTypeList(item2.formula),item2.equipmentName)">
<image :src="`../../static/icon_new/icon${ item2.formula }.png`" mode=""></image>
<view class="info">
<view class="">
{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}
</view>
2024-01-11 01:27:30 +00:00
<view class="" :style="item2.equipmentStart == 0 ? 'color:red':''">{{ item2.equipmentStart == 0 ? '故障' : item2.environmentData + getTypeList(item2.formula) }}</view>
2024-01-10 02:42:05 +00:00
</view>
</view>
<view class="line" v-if="item1.childList_one.length > 0"></view>
<view class="item" v-for="(item2,index2) in item1.childList_two" :key="index2"
@click="toTarget_water_fertilizer_PH(item2.equipmentId,item2.environmentData,item2.environmentDataId,item2.equipmentNumber,item2.targetValue,getTypeList(item2.formula),item2.equipmentName)">
<image :src="`../../static/icon_new/icon${ item2.formula }.png`" mode=""></image>
<view class="info">
<view class="">
{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}
</view>
2024-01-11 01:27:30 +00:00
<view class="" :style="item2.equipmentStart == 0 ? 'color:red':''">{{ item2.equipmentStart == 0 ? '故障' : item2.environmentData + getTypeList(item2.formula) }}</view>
2024-01-10 02:42:05 +00:00
</view>
</view>
<view class="line" v-if="item1.childList_two.length > 0"></view>
<view class="item" v-for="(item2,index2) in item1.childList_three" :key="index2"
@click="toTarget_water_fertilizer_PH(item2.equipmentId,item2.environmentData,item2.environmentDataId,item2.equipmentNumber,item2.targetValue,getTypeList(item2.formula),item2.equipmentName)">
<image :src="`../../static/icon_new/icon${ item2.formula }.png`" mode=""></image>
<view class="info">
<view class="">
{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}
</view>
2024-01-11 01:27:30 +00:00
<view class="" :style="item2.equipmentStart == 0 ? 'color:red':''">{{ item2.equipmentStart == 0 ? '故障' : item2.environmentData + getTypeList(item2.formula) }}</view>
2024-01-10 02:42:05 +00:00
</view>
</view>
<view class="line" v-if="item1.childList_three.length > 0"></view>
<view class="item" v-for="(item2,index2) in item1.childList_four" :key="index2"
@click="toTarget_water_fertilizer_PH(item2.equipmentId,item2.environmentData,item2.environmentDataId,item2.equipmentNumber,item2.targetValue,getTypeList(item2.formula),item2.equipmentName)">
<image :src="`../../static/icon_new/icon${ item2.formula }.png`" mode=""></image>
<view class="info">
<view class="">
{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}
</view>
2024-01-11 01:27:30 +00:00
<view class="" :style="item2.equipmentStart == 0 ? 'color:red':''">{{ item2.equipmentStart == 0 ? '故障' : item2.environmentData + getTypeList(item2.formula) }}</view>
2024-01-10 02:42:05 +00:00
</view>
</view>
<view class="line" v-if="item1.childList_four.length > 0"></view>
<view class="item" v-for="(item2,index2) in item1.childList_five" :key="index2"
@click="toTarget_water_fertilizer_PH(item2.equipmentId,item2.environmentData,item2.environmentDataId,item2.equipmentNumber,item2.targetValue,getTypeList(item2.formula),item2.equipmentName)">
<image :src="`../../static/icon_new/icon${ item2.formula }.png`" mode=""></image>
<view class="info">
<view class="">
{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}
</view>
2024-01-11 01:27:30 +00:00
<view class="" :style="item2.equipmentStart == 0 ? 'color:red':''">{{ item2.equipmentStart == 0 ? '故障' : item2.environmentData + getTypeList(item2.formula) }}</view>
2024-01-10 02:42:05 +00:00
</view>
</view>
<view class="line" v-if="item1.childList_five.length > 0"></view>
<view class="item" v-for="(item2,index2) in item1.childList_six" :key="index2"
@click="toTarget_water_fertilizer_PH(item2.equipmentId,item2.environmentData,item2.environmentDataId,item2.equipmentNumber,item2.targetValue,getTypeList(item2.formula),item2.equipmentName)">
<image :src="`../../static/icon_new/icon${ item2.formula }.png`" mode=""></image>
<view class="info">
<view class="">
{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}
</view>
2024-01-11 01:27:30 +00:00
<view class="" :style="item2.equipmentStart == 0 ? 'color:red':''">{{ item2.equipmentStart == 0 ? '故障' : item2.environmentData + getTypeList(item2.formula) }}</view>
2024-01-10 02:42:05 +00:00
</view>
</view>
<view class="line" v-if="item1.childList_six.length > 0"></view>
<view class="item" v-for="(item2,index2) in item1.childList_seven" :key="index2"
@click="toTarget_water_fertilizer_PH(item2.equipmentId,item2.environmentData,item2.environmentDataId,item2.equipmentNumber,item2.targetValue,getTypeList(item2.formula),item2.equipmentName)">
<image :src="`../../static/icon_new/icon${ item2.formula }.png`" mode=""></image>
<view class="info">
<view class="">
{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}
</view>
2024-01-11 01:27:30 +00:00
<view class="" :style="item2.equipmentStart == 0 ? 'color:red':''">{{ item2.equipmentStart == 0 ? '故障' : item2.environmentData + getTypeList(item2.formula) }}</view>
2024-01-10 02:42:05 +00:00
</view>
</view>
<view class="line" v-if="item1.childList_seven.length > 0"></view>
<view class="item" v-for="(item2,index2) in item1.childList_eight" :key="index2"
@click="toTarget_water_fertilizer_PH(item2.equipmentId,item2.environmentData,item2.environmentDataId,item2.equipmentNumber,item2.targetValue,getTypeList(item2.formula),item2.equipmentName)">
<image :src="`../../static/icon_new/icon${ item2.formula }.png`" mode=""></image>
<view class="info">
<view class="">
{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}
</view>
2024-01-11 01:27:30 +00:00
<view class="" :style="item2.equipmentStart == 0 ? 'color:red':''">{{ item2.equipmentStart == 0 ? '故障' : item2.environmentData + getTypeList(item2.formula) }}</view>
2024-01-10 02:42:05 +00:00
</view>
</view>
<view class="line" v-if="item1.childList_eight.length > 0"></view>
<view class="item" v-for="(item2,index2) in item1.childList_nine" :key="index2"
@click="toTarget_water_fertilizer_PH(item2.equipmentId,item2.environmentData,item2.environmentDataId,item2.equipmentNumber,item2.targetValue,getTypeList(item2.formula),item2.equipmentName)">
<image :src="`../../static/icon_new/icon${ item2.formula }.png`" mode=""></image>
<view class="info">
<view class="">
{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}
</view>
2024-01-11 01:27:30 +00:00
<view class="" :style="item2.equipmentStart == 0 ? 'color:red':''">{{ item2.equipmentStart == 0 ? '故障' : item2.environmentData + getTypeList(item2.formula) }}</view>
2024-01-10 02:42:05 +00:00
</view>
</view>
<view class="line" v-if="item1.childList_nine.length > 0"></view>
<view class="item" v-for="(item2,index2) in item1.childList_ten" :key="index2"
@click="toTarget_water_fertilizer_PH(item2.equipmentId,item2.environmentData,item2.environmentDataId,item2.equipmentNumber,item2.targetValue,getTypeList(item2.formula),item2.equipmentName)">
<image :src="`../../static/icon_new/icon${ item2.formula }.png`" mode=""></image>
<view class="info">
<view class="">
{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}
</view>
2024-01-11 01:27:30 +00:00
<view class="" :style="item2.equipmentStart == 0 ? 'color:red':''">{{ item2.equipmentStart == 0 ? '故障' : item2.environmentData + getTypeList(item2.formula) }}</view>
2024-01-10 02:42:05 +00:00
</view>
</view>
<view class="line" v-if="item1.childList_ten.length > 0"></view>
<view class="item" v-for="(item2,index2) in item1.childList_eleven" :key="index2"
@click="toTarget_water_fertilizer_PH(item2.equipmentId,item2.environmentData,item2.environmentDataId,item2.equipmentNumber,item2.targetValue,getTypeList(item2.formula),item2.equipmentName)">
<image :src="`../../static/icon_new/icon${ item2.formula }.png`" mode=""></image>
<view class="info">
<view class="">
{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}
</view>
2024-01-11 01:27:30 +00:00
<view class="" :style="item2.equipmentStart == 0 ? 'color:red':''">{{ item2.equipmentStart == 0 ? '故障' : item2.environmentData + getTypeList(item2.formula) }}</view>
2024-01-10 02:42:05 +00:00
</view>
</view>
<view class="line" v-if="item1.childList_eleven.length > 0"></view>
<view class="item" v-for="(item2,index2) in item1.childList_twelve" :key="index2"
@click="toTarget_water_fertilizer_PH(item2.equipmentId,item2.environmentData,item2.environmentDataId,item2.equipmentNumber,item2.targetValue,getTypeList(item2.formula),item2.equipmentName)">
<image :src="`../../static/icon_new/icon${ item2.formula }.png`" mode=""></image>
<view class="info">
<view class="">
{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}
</view>
2024-01-11 01:27:30 +00:00
<view class="" :style="item2.equipmentStart == 0 ? 'color:red':''">{{ item2.equipmentStart == 0 ? '故障' : item2.environmentData + getTypeList(item2.formula) }}</view>
2024-01-10 02:42:05 +00:00
</view>
</view>
<view class="line" v-if="item1.childList_twelve.length > 0"></view>
<view class="item" v-for="(item2,index2) in item1.childList_thirteen" :key="index2"
@click="toTarget_water_fertilizer_PH(item2.equipmentId,item2.environmentData,item2.environmentDataId,item2.equipmentNumber,item2.targetValue,getTypeList(item2.formula),item2.equipmentName)">
<image :src="`../../static/icon_new/icon${ item2.formula }.png`" mode=""></image>
<view class="info">
<view class="">
{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}
</view>
2024-01-11 01:27:30 +00:00
<view class="" :style="item2.equipmentStart == 0 ? 'color:red':''">{{ item2.equipmentStart == 0 ? '故障' : item2.environmentData + getTypeList(item2.formula) }}</view>
2024-01-10 02:42:05 +00:00
</view>
</view>
<view class="line" v-if="item1.childList_thirteen.length > 0"></view>
<view class="item" v-for="(item2,index2) in item1.childList_fourteen" :key="index2"
@click="toTarget_water_fertilizer_PH(item2.equipmentId,item2.environmentData,item2.environmentDataId,item2.equipmentNumber,item2.targetValue,getTypeList(item2.formula),item2.equipmentName)">
<image :src="`../../static/icon_new/icon${ item2.formula }.png`" mode=""></image>
<view class="info">
<view class="">
{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}
</view>
2024-01-11 01:27:30 +00:00
<view class="" :style="item2.equipmentStart == 0 ? 'color:red':''">{{ item2.equipmentStart == 0 ? '故障' : item2.environmentData + getTypeList(item2.formula) }}</view>
2024-01-10 02:42:05 +00:00
</view>
</view>
<view class="line" v-if="item1.childList_fourteen.length > 0"></view>
2023-09-28 10:07:02 +00:00
</view>
<view class="updateTime">
<span></span>
<span>*更新数据时间&nbsp;: &nbsp;{{ updateTime }}</span>
</view>
2023-09-28 10:07:02 +00:00
</view>
2024-01-10 02:42:05 +00:00
2023-09-28 10:07:02 +00:00
</view>
</view>
</template>
<script>
export default {
data() {
return {
// 头部导航背景
background: {
backgroundColor: 'transparent',
},
// 水肥参数
waterAndFertilizerParamsList: [
2023-11-10 02:43:22 +00:00
2023-09-28 10:07:02 +00:00
],
// 测试基地
testBaseList: [{
2023-10-05 04:08:22 +00:00
img: "../../static/base1.png",
2023-09-28 10:07:02 +00:00
name: '空气温度',
value: "38.8klux"
},
{
2023-10-05 04:08:22 +00:00
img: "../../static/base2.png",
2023-09-28 10:07:02 +00:00
name: '光亮度',
value: "38.8klux"
},
{
2023-10-05 04:08:22 +00:00
img: "../../static/base3.png",
2023-09-28 10:07:02 +00:00
name: '二氧化碳',
value: "二氧化碳"
},
{
2023-10-05 04:08:22 +00:00
img: "../../static/base3.png",
2023-09-28 10:07:02 +00:00
name: '二氧化碳',
value: "678PPM"
},
{
2023-10-05 04:08:22 +00:00
img: "../../static/base4.png",
2023-09-28 10:07:02 +00:00
name: '土壤温度',
value: "20℃"
},
{
2023-10-05 04:08:22 +00:00
img: "../../static/base4.png",
2023-09-28 10:07:02 +00:00
name: '土壤温度',
value: "30.1℃"
},
{
2023-10-05 04:08:22 +00:00
img: "../../static/base5.png",
2023-09-28 10:07:02 +00:00
name: '土壤湿度',
value: "18.5%"
},
{
2023-10-05 04:08:22 +00:00
img: "../../static/base5.png",
2023-09-28 10:07:02 +00:00
name: '土壤湿度',
value: "18.5%"
},
{
2023-10-05 04:08:22 +00:00
img: "../../static/base6.png",
2023-09-28 10:07:02 +00:00
name: '水肥PH',
value: "0"
},
{
2023-10-05 04:08:22 +00:00
img: "../../static/base6.png",
2023-09-28 10:07:02 +00:00
name: '水肥EC',
value: "0.2mS/cm"
},
{
2023-10-05 04:08:22 +00:00
img: "../../static/base7.png",
2023-09-28 10:07:02 +00:00
name: '3#空气温度',
value: "29.8C"
},
{
2023-10-05 04:08:22 +00:00
img: "../../static/base8.png",
2023-09-28 10:07:02 +00:00
name: '3#空气湿度',
value: "80.6%"
},
{
2023-10-05 04:08:22 +00:00
img: "../../static/base2.png",
2023-09-28 10:07:02 +00:00
name: '3#光亮度',
value: "34.6 klux"
},
{
2023-10-05 04:08:22 +00:00
img: "../../static/base3.png",
2023-09-28 10:07:02 +00:00
name: '3#二氧化碳',
value: "29.8C"
},
{
2023-10-05 04:08:22 +00:00
img: "../../static/base5.png",
2023-09-28 10:07:02 +00:00
name: '3#土壤温度',
value: "31℃"
},
],
// 测试基地
testBaseList1: [{
2023-10-05 04:08:22 +00:00
img: "../../static/1.png",
2023-09-28 10:07:02 +00:00
name: '4#光亮度',
value: "43 klux"
},
{
2023-10-05 04:08:22 +00:00
img: "../../static/2.png",
2023-09-28 10:07:02 +00:00
name: '4#二氧化碳',
value: "742 PPM"
},
{
2023-10-05 04:08:22 +00:00
img: "../../static/3.png",
2023-09-28 10:07:02 +00:00
name: '4#土壤温度',
value: "29.3C"
},
{
2023-10-05 04:08:22 +00:00
img: "../../static/4.png",
2023-09-28 10:07:02 +00:00
name: '4#土壤湿度',
value: "4%"
},
],
2023-11-10 02:43:22 +00:00
2023-10-05 04:08:22 +00:00
//label是名称 value是code码
//countType计算类型 0是原数据 1是原数据-400 2是原数据/10 3是(原数据-400) / 10
2023-11-22 09:28:49 +00:00
typeList: [],
2023-11-10 02:43:22 +00:00
timer: null,
updateTime: ''
2023-09-28 10:07:02 +00:00
}
},
2023-10-07 06:44:30 +00:00
onLoad() {
2024-01-10 02:42:05 +00:00
this.typeList = this.api.typeList
2023-10-14 03:16:59 +00:00
uni.showLoading({
title: '加载中...'
});
2023-10-07 06:44:30 +00:00
let that = this
2023-10-14 03:16:59 +00:00
uni.getStorage({
key: 'token',
success: function(res) {
that.getEquipmentInfo(uni.getStorageSync('userid'))
},
2023-11-10 02:43:22 +00:00
})
2023-10-07 06:44:30 +00:00
this.timer = setInterval(function() {
uni.getStorage({
key: 'token',
success: function(res) {
that.getEquipmentInfo(uni.getStorageSync('userid'))
},
2023-11-10 02:43:22 +00:00
})
2023-10-07 06:44:30 +00:00
}, 60000);
},
2023-12-28 09:17:50 +00:00
onShow() {
let that = this
clearInterval(that.timer) && that.timer
this.timer = setInterval(function() {
uni.getStorage({
key: 'token',
success: function(res) {
that.getEquipmentInfo(uni.getStorageSync('userid'))
},
})
}, 60000);
},
2024-01-10 02:42:05 +00:00
onHide() {
2023-10-14 03:16:59 +00:00
let that = this
2023-12-28 09:17:50 +00:00
clearInterval(that.timer) && that.timer
2023-10-07 06:44:30 +00:00
},
onPullDownRefresh() {
2023-10-14 03:16:59 +00:00
uni.showLoading({
title: '加载中...'
});
2023-11-10 02:43:22 +00:00
let that = this
2023-10-07 06:44:30 +00:00
uni.getStorage({
key: 'token',
success: function(res) {
that.getEquipmentInfo(uni.getStorageSync('userid'))
},
2023-11-10 02:43:22 +00:00
})
2023-09-28 10:07:02 +00:00
},
mounted() {
2023-10-14 03:16:59 +00:00
uni.showLoading({
title: '加载中...'
});
2023-09-28 10:07:02 +00:00
let that = this
uni.getStorage({
key: 'token',
success: function(res) {
that.getEquipmentInfo(uni.getStorageSync('userid'))
},
2023-11-10 02:43:22 +00:00
fail: function(err) {
2023-09-28 10:07:02 +00:00
uni.reLaunch({
2023-11-10 02:43:22 +00:00
url: '/pages/login/login'
2023-09-28 10:07:02 +00:00
})
}
})
},
methods: {
// 根据用户id查询对应的设备数据
getEquipmentInfo(userid) {
let that = this
2023-10-14 03:16:59 +00:00
// uni.showLoading({
// title: '加载中...'
// });
2023-09-28 10:07:02 +00:00
this.$http({
url: this.api.sel_eqbyid + userid,
method: 'GET'
}).then(res => {
2023-10-07 06:44:30 +00:00
// console.log(res, '根据用户id查询对应的设备数据');
2023-09-28 10:07:02 +00:00
if (res.code == 200) {
2023-11-10 02:43:22 +00:00
this.waterAndFertilizerParamsList = res.data.map((item, index) => {
2023-09-28 10:07:02 +00:00
return {
...item,
2024-01-10 02:42:05 +00:00
childList: [],
childList_mubiao: [],//目标
childList_1: [],//平均
childList_2: [],//平均
childList_one: [],//1#
childList_two: [],//2#
childList_three: [],//3#
childList_four: [],//4#
childList_five: [],//5#
childList_six: [],//6#
childList_seven: [],//7#
childList_eight: [],//8#
childList_nine: [],//9#
childList_ten: [],//10#
childList_eleven: [],//11#
childList_twelve: [],//12#
childList_thirteen: [],//13#
childList_fourteen: [],//14#
2023-09-28 10:07:02 +00:00
}
})
2023-11-10 02:43:22 +00:00
this.waterAndFertilizerParamsList.forEach((i, index) => {
2024-01-10 02:42:05 +00:00
2023-09-28 10:07:02 +00:00
this.$http({
2024-01-10 02:42:05 +00:00
url: (i.equipmentName == 1 ? this.api.getFs_rtdata : this.api
.getcontrol_rtdata) + "?equipmentId=" + i.deviceId,
2023-09-28 10:07:02 +00:00
method: 'post',
}).then(res => {
2023-10-08 07:37:17 +00:00
// console.log(res, '主页查看施肥机实时数据');
2023-11-10 02:43:22 +00:00
if (res.code == 200) {
2023-09-28 10:07:02 +00:00
uni.hideLoading({
title: '完成'
});
2023-10-07 06:44:30 +00:00
uni.stopPullDownRefresh();
2023-11-10 02:43:22 +00:00
i.childList = res.data;
2024-01-10 02:42:05 +00:00
i.childList_mubiao = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == '目标');
i.childList_1 = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == '1#平均');
i.childList_2 = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == '2#平均');
i.childList_one = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == (el.equipmentNumber + '#') && el.equipmentNumber == 1);
i.childList_one = [...i.childList_1,...i.childList_one];
i.childList_two = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == (el.equipmentNumber + '#') && el.equipmentNumber == 2);
i.childList_two = [...i.childList_2,...i.childList_two]
i.childList_three = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == (el.equipmentNumber + '#') && el.equipmentNumber == 3);
i.childList_four = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == (el.equipmentNumber + '#') && el.equipmentNumber == 4);
i.childList_five = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == (el.equipmentNumber + '#') && el.equipmentNumber == 5);
i.childList_six = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == (el.equipmentNumber + '#') && el.equipmentNumber == 6);
i.childList_seven = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == (el.equipmentNumber + '#') && el.equipmentNumber == 7);
i.childList_eight = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == (el.equipmentNumber + '#') && el.equipmentNumber == 8);
i.childList_nine = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == (el.equipmentNumber + '#') && el.equipmentNumber == 9);
i.childList_ten = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == (el.equipmentNumber + '#') && el.equipmentNumber == 10);
i.childList_eleven = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == (el.equipmentNumber + '#') && el.equipmentNumber == 11);
i.childList_twelve = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == (el.equipmentNumber + '#') && el.equipmentNumber == 12);
i.childList_thirteen = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == (el.equipmentNumber + '#') && el.equipmentNumber == 13);
i.childList_fourteen = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == (el.equipmentNumber + '#') && el.equipmentNumber == 14);
this.updateTime = res.data[0].updateTime
2023-11-24 02:13:41 +00:00
// console.log(this.waterAndFertilizerParamsList);
2023-11-10 02:43:22 +00:00
} else {
2023-09-28 10:07:02 +00:00
}
2023-11-10 02:43:22 +00:00
}).catch(err => {
2023-10-07 08:53:26 +00:00
console.log('接口失败');
2023-09-28 10:07:02 +00:00
})
})
2023-11-23 11:02:09 +00:00
// equipmentName==1的
2024-01-10 02:42:05 +00:00
let waterAndFertilizerParamsList_1 = this.waterAndFertilizerParamsList.filter(e => e
.equipmentName == 1).sort((a, b) => a.equipmentStatu - b.equipmentStatu)
2023-11-23 11:02:09 +00:00
// equipmentName==10的
2024-01-10 02:42:05 +00:00
let waterAndFertilizerParamsList_10 = this.waterAndFertilizerParamsList.filter(e => e
.equipmentName == 10).sort((a, b) => a.equipmentStatu - b.equipmentStatu);
2023-11-24 02:13:41 +00:00
// console.log(waterAndFertilizerParamsList_1,waterAndFertilizerParamsList_10,'00000000000');
2024-01-10 02:42:05 +00:00
this.waterAndFertilizerParamsList = [...waterAndFertilizerParamsList_1, ...
waterAndFertilizerParamsList_10
];
// console.log(this.waterAndFertilizerParamsList, 'this.waterAndFertilizerParamsList');
2023-09-28 10:07:02 +00:00
}
})
},
2023-11-10 02:43:22 +00:00
2023-09-28 10:07:02 +00:00
// 跳转到折线图
2024-01-10 02:42:05 +00:00
toTarget_water_fertilizer_PH(id, data, name, equipmentNumber, targetValue, unit, equipmentName) {
2023-09-28 10:07:02 +00:00
uni.navigateTo({
2023-11-10 02:43:22 +00:00
url: '/pages/target_water_fertilizer_PH/target_water_fertilizer_PH?id=' + id + '&data=' +
data + '&name=' + name + '&equipmentNumber=' + equipmentNumber + '&targetValue=' +
targetValue + '&unit=' + unit + '&equipmentName=' + equipmentName
2023-09-28 10:07:02 +00:00
})
},
2023-11-10 02:43:22 +00:00
2023-10-05 04:08:22 +00:00
// 数据单位
2023-11-10 02:43:22 +00:00
getTypeList(val) {
2023-10-05 04:08:22 +00:00
let typeList1 = []
2023-11-10 02:43:22 +00:00
typeList1 = this.typeList.filter(item => {
return item.value == val
2023-10-05 04:08:22 +00:00
})
return typeList1[0].unit
},
2023-11-10 02:43:22 +00:00
2023-10-05 04:08:22 +00:00
// 判断是否是平均或者目标,或者是1#
2023-11-10 02:43:22 +00:00
getStatus(equipmentNumber, targetValue) {
if (targetValue == 1) {
2023-10-05 04:08:22 +00:00
return '目标'
2023-11-10 02:43:22 +00:00
} else if (targetValue == 0 && equipmentNumber == 0) {
2023-10-05 04:08:22 +00:00
return '1#平均'
2023-11-10 02:43:22 +00:00
} else if (targetValue == 0 && equipmentNumber == 15) {
2023-10-05 04:08:22 +00:00
return '2#平均'
2023-11-10 02:43:22 +00:00
} else if (targetValue == 0 && equipmentNumber != 0 && equipmentNumber != 15) {
2023-10-07 01:49:48 +00:00
return equipmentNumber + '#'
2023-09-28 10:07:02 +00:00
}
}
}
}
</script>
<style lang="scss" scoped>
.timeEnvironment {
width: 100%;
min-height: 100vh;
box-sizing: border-box;
position: relative;
background-color: #F5F6FA;
.navbar {
width: 100%;
height: 100%;
>image {
width: 750rpx;
height: 500rpx;
position: absolute;
top: 0;
left: 0;
}
}
.content {
position: absolute;
z-index: 2;
box-sizing: border-box;
padding: 0rpx 30rpx 30rpx;
.title {
display: flex;
align-items: center;
>image {
width: 71rpx;
height: 65rpx;
}
.right {
margin-left: 14rpx;
>view:nth-child(1) {
font-size: 44rpx;
font-family: AlibabaPuHuiTiB;
font-weight: bold;
color: #FFFFFF;
}
>view:nth-child(2) {
font-size: 16rpx;
font-family: Arial-BoldMT;
font-weight: bold;
color: #FFFFFF;
line-height: 20rpx;
opacity: 0.5;
}
}
}
.subtitle {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: #FFFFFF;
margin-top: 26rpx;
}
.waterAndFertilizerParams {
width: 690rpx;
height: auto;
box-sizing: border-box;
padding: 20rpx;
background: #FFFFFF;
box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(153, 153, 153, 0.1);
border-radius: 20rpx;
margin-top: 69rpx;
.nav {
height: 90rpx;
display: flex;
align-items: center;
border-bottom: 1rpx solid #DDDDDD;
>image {
width: 50rpx;
height: 50rpx;
margin-right: 16rpx;
}
>text {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
}
.detail {
width: 100%;
height: calc(100% - 90rpx);
box-sizing: border-box;
padding: 10rpx 0rpx;
display: flex;
flex-wrap: wrap;
// justify-content: space-evenly;
2023-09-28 10:07:02 +00:00
2024-01-10 02:42:05 +00:00
.line {
width: 100%;
height: 1rpx;
background-color: #DDDDDD;
flex-shrink: 0;
margin-top: 20rpx;
}
2023-09-28 10:07:02 +00:00
.item {
width: 50%;
display: flex;
align-items: center;
box-sizing: border-box;
padding-left: 20rpx;
margin-top: 30rpx;
>image {
width: 80rpx;
height: 80rpx;
margin-right: 19rpx;
}
.info {
>view:nth-child(1) {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
>view:nth-child(2) {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
}
}
}
2023-11-10 02:43:22 +00:00
.updateTime {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20rpx;
font-size: 22rpx;
}
2023-09-28 10:07:02 +00:00
}
.testBase {
width: 690rpx;
height: auto;
background: #FFFFFF;
box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(153, 153, 153, 0.1);
border-radius: 20rpx;
margin-top: 30rpx;
.nav {
height: 90rpx;
box-sizing: border-box;
padding: 20rpx;
display: flex;
align-items: center;
>image {
width: 50rpx;
height: 50rpx;
margin-right: 16rpx;
}
>text {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
}
.detail {
width: 100%;
height: calc(100% - 90rpx);
display: flex;
flex-wrap: wrap;
padding-bottom: 46rpx;
.item {
width: 33%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
margin-top: 30rpx;
>image {
width: 60rpx;
height: 60rpx;
}
.info {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-top: 10rpx;
>view:nth-child(1) {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
>view:nth-child(2) {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
}
}
}
}
.testBase1 {
width: 690rpx;
height: auto;
background: #FFFFFF;
box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(153, 153, 153, 0.1);
border-radius: 20rpx;
margin-top: 30rpx;
box-sizing: border-box;
padding: 0 20rpx 1rpx;
.nav {
height: 90rpx;
box-sizing: border-box;
padding: 20rpx;
display: flex;
align-items: center;
>image {
width: 50rpx;
height: 50rpx;
margin-right: 16rpx;
}
>text:nth-child(2) {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
>text:nth-child(3) {
width: 90rpx;
height: 44rpx;
background: #EFFCF7;
border: 2px solid rgba(58, 187, 144, 0.25);
border-radius: 22rpx;
font-size: 20rpx;
font-family: PingFang SC;
font-weight: bold;
color: #37BA8E;
display: flex;
justify-content: center;
align-items: center;
margin-left: 15rpx;
}
}
.item {
width: 650rpx;
height: 90rpx;
background: #F5F6FA;
border: 2px solid #E7E9F1;
border-radius: 10rpx;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 30rpx;
box-sizing: border-box;
padding: 0 30rpx 0 20rpx;
>image {
width: 40rpx;
height: 39rpx;
margin-right: 20rpx;
}
>text:nth-child(2) {
flex: 1;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
>text:nth-child(3) {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
}
}
}
}
</style>