新增updatatime,离线-状态隐藏和修改72参数

pull/21/head
pangdundun 2023-10-12 17:15:37 +08:00
parent c36307ecd8
commit 9a9a2a10f2
40 changed files with 80 additions and 51 deletions

View File

@ -224,7 +224,7 @@
indexs: 1, indexs: 1,
inputData1: [], inputData1: [],
timer: null timer_: null
}; };
}, },
watch: { watch: {
@ -234,13 +234,13 @@
this.deviceId = option.id this.deviceId = option.id
this.dataInit() this.dataInit()
let that = this let that = this
this.timer = setInterval(function() { this.timer_ = setInterval(function() {
that.dataInit(); that.dataInit();
}, 5000); }, 5000);
}, },
onUnload() { onUnload() {
let that = this let that = this
clearTimeout(that.timer) clearTimeout(that.timer_)
}, },
onPullDownRefresh() { onPullDownRefresh() {
// uni.showLoading({ // uni.showLoading({
@ -271,7 +271,7 @@
var data = { var data = {
"equipmentId": deviceId, "equipmentId": deviceId,
"pattern": 0, // //6ph- "pattern": 0, // //6ph-
"regNum": 71 "regNum": 72
} }
this.$http({ this.$http({
url: this.api.readFs_state, url: this.api.readFs_state,
@ -586,8 +586,8 @@
}, },
closePop() { closePop() {
this.dataInit(); // this.dataInit();
this.getReg(); // this.getReg();
this.show = false this.show = false
} }
} }

View File

@ -11,7 +11,7 @@
<text <text
:class="item.deviceState == 1 ? 'state' : 'state_act'">{{ item.deviceState == 1 ? "在线" : "离线"}}</text> :class="item.deviceState == 1 ? 'state' : 'state_act'">{{ item.deviceState == 1 ? "在线" : "离线"}}</text>
</view> </view>
<view class="right" @click="toFertilizer(item)"> <view class="right" @click="toFertilizer(item)" v-if="item.deviceState == 1">
<text>状态</text> <text>状态</text>
<image src="../../static/right-arrow.png" mode=""></image> <image src="../../static/right-arrow.png" mode=""></image>
</view> </view>

View File

@ -38,6 +38,10 @@
</view> </view>
</view> </view>
</view> </view>
<view class="updateTime">
<span></span>
<span>*更新数据时间&nbsp;: &nbsp;{{ updateTime }}</span>
</view>
</view> </view>
<!-- <view class="testBase" v-for="(item1,index1) in waterAndFertilizerParamsList" :key="index1"> <!-- <view class="testBase" v-for="(item1,index1) in waterAndFertilizerParamsList" :key="index1">
@ -251,7 +255,8 @@
{ label: '无线传感器信噪比SNR', value: 58, countType: 1,unit: 'dB' }, { label: '无线传感器信噪比SNR', value: 58, countType: 1,unit: 'dB' },
], ],
timer:null timer:null,
updateTime:''
} }
}, },
onLoad() { onLoad() {
@ -327,12 +332,14 @@
method: 'post', method: 'post',
}).then(res => { }).then(res => {
// console.log(res, ''); // console.log(res, '');
if(res.code == 200){ if(res.code == 200){
uni.hideLoading({ uni.hideLoading({
title: '完成' title: '完成'
}); });
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
i.childList= res.data; i.childList= res.data;
this.updateTime = res.data[0].updateTime
// console.log(this.waterAndFertilizerParamsList); // console.log(this.waterAndFertilizerParamsList);
}else{ }else{
@ -484,7 +491,7 @@
padding: 10rpx 0rpx; padding: 10rpx 0rpx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-evenly; // justify-content: space-evenly;
.item { .item {
width: 50%; width: 50%;
@ -517,6 +524,14 @@
} }
} }
} }
.updateTime{
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20rpx;
font-size: 22rpx;
}
} }
.testBase { .testBase {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -413,7 +413,7 @@ var _default = {
topActive: 0, topActive: 0,
indexs: 1, indexs: 1,
inputData1: [], inputData1: [],
timer: null timer_: null
}; };
}, },
watch: {}, watch: {},
@ -421,13 +421,13 @@ var _default = {
this.deviceId = option.id; this.deviceId = option.id;
this.dataInit(); this.dataInit();
var that = this; var that = this;
this.timer = setInterval(function () { this.timer_ = setInterval(function () {
that.dataInit(); that.dataInit();
}, 5000); }, 5000);
}, },
onUnload: function onUnload() { onUnload: function onUnload() {
var that = this; var that = this;
clearTimeout(that.timer); clearTimeout(that.timer_);
}, },
onPullDownRefresh: function onPullDownRefresh() { onPullDownRefresh: function onPullDownRefresh() {
// uni.showLoading({ // uni.showLoading({
@ -460,7 +460,7 @@ var _default = {
"equipmentId": deviceId, "equipmentId": deviceId,
"pattern": 0, "pattern": 0,
//需要根据文档填写 //6目标ph-数值 //需要根据文档填写 //6目标ph-数值
"regNum": 71 "regNum": 72
}; };
this.$http({ this.$http({
url: this.api.readFs_state, url: this.api.readFs_state,
@ -752,8 +752,8 @@ var _default = {
this.indexs = index; this.indexs = index;
this.getReg(); this.getReg();
}), (0, _defineProperty2.default)(_methods, "closePop", function closePop() { }), (0, _defineProperty2.default)(_methods, "closePop", function closePop() {
this.dataInit(); // this.dataInit();
this.getReg(); // this.getReg();
this.show = false; this.show = false;
}), _methods) }), _methods)
}; };

View File

@ -1 +1 @@
<view class="preciseWaterAndFertilizer"><u-navbar vue-id="cdd718f8-1" background="{{background}}" is-back="{{true}}" back-icon-color="#FFFFFF" border-bottom="{{false}}" title="精准水肥" title-color="#FFFFFF" title-bold="{{true}}" title-size="32" bind:__l="__l"></u-navbar><view class="content"><block wx:for="{{deviceList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="item"><image src="../../static/icon_precise.png" mode></image><view class="center"><text>{{item.deviceTypeName}}</text><text class="{{[item.deviceState==1?'state':'state_act']}}">{{item.deviceState==1?"在线":"离线"}}</text></view><view data-event-opts="{{[['tap',[['toFertilizer',['$0'],[[['deviceList','',index]]]]]]]}}" class="right" bindtap="__e"><text>状态</text><image src="../../static/right-arrow.png" mode></image></view></view></block></view></view> <view class="preciseWaterAndFertilizer"><u-navbar vue-id="cdd718f8-1" background="{{background}}" is-back="{{true}}" back-icon-color="#FFFFFF" border-bottom="{{false}}" title="精准水肥" title-color="#FFFFFF" title-bold="{{true}}" title-size="32" bind:__l="__l"></u-navbar><view class="content"><block wx:for="{{deviceList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="item"><image src="../../static/icon_precise.png" mode></image><view class="center"><text>{{item.deviceTypeName}}</text><text class="{{[item.deviceState==1?'state':'state_act']}}">{{item.deviceState==1?"在线":"离线"}}</text></view><block wx:if="{{item.deviceState==1}}"><view data-event-opts="{{[['tap',[['toFertilizer',['$0'],[[['deviceList','',index]]]]]]]}}" class="right" bindtap="__e"><text>状态</text><image src="../../static/right-arrow.png" mode></image></view></block></view></block></view></view>

View File

@ -270,6 +270,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
// //
// //
// //
//
//
//
//
var _default = { var _default = {
data: function data() { data: function data() {
return { return {
@ -656,7 +660,8 @@ var _default = {
countType: 1, countType: 1,
unit: 'dB' unit: 'dB'
}], }],
timer: null timer: null,
updateTime: ''
}; };
}, },
onLoad: function onLoad() { onLoad: function onLoad() {
@ -731,12 +736,14 @@ var _default = {
method: 'post' method: 'post'
}).then(function (res) { }).then(function (res) {
// console.log(res, '主页查看施肥机实时数据'); // console.log(res, '主页查看施肥机实时数据');
if (res.code == 200) { if (res.code == 200) {
uni.hideLoading({ uni.hideLoading({
title: '完成' title: '完成'
}); });
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
i.childList = res.data; i.childList = res.data;
_this.updateTime = res.data[0].updateTime;
// console.log(this.waterAndFertilizerParamsList); // console.log(this.waterAndFertilizerParamsList);
} else {} } else {}
}).catch(function (err) { }).catch(function (err) {

View File

@ -1 +1 @@
<view class="timeEnvironment data-v-34c343d8"><u-navbar vue-id="63a4351c-1" background="{{background}}" is-back="{{true}}" back-icon-color="#FFFFFF" border-bottom="{{false}}" title="实时环境" title-color="#FFFFFF" title-bold="{{true}}" title-size="32" class="data-v-34c343d8" bind:__l="__l"></u-navbar><view class="navbar data-v-34c343d8"><image src="../../static/timeEnvironment_bg.png" mode class="data-v-34c343d8"></image></view><view class="content data-v-34c343d8"><view class="title data-v-34c343d8"><image src="../../static/logo_1.png" mode class="data-v-34c343d8"></image><view class="right data-v-34c343d8"><view class="data-v-34c343d8">温室智慧云</view><view class="data-v-34c343d8">Greenhouse wisdom Cloud</view></view></view><view class="subtitle data-v-34c343d8">欢迎使用温室智慧云数据统计</view><block wx:for="{{$root.l1}}" wx:for-item="item1" wx:for-index="index1" wx:key="index1"><view class="waterAndFertilizerParams data-v-34c343d8"><view class="nav data-v-34c343d8"><image src="../../static/PH.png" mode class="data-v-34c343d8"></image><text class="data-v-34c343d8">{{item1.$orig.deviceTypeName}}</text></view><view class="detail data-v-34c343d8"><block wx:for="{{item1.l0}}" wx:for-item="item2" wx:for-index="index2" wx:key="index2"><view data-event-opts="{{[['tap',[['toTarget_water_fertilizer_PH',['$0','$1'],[[['waterAndFertilizerParamsList','',index1],['childList','',index2,'equipmentId']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'environmentData']]]]]]]}}" class="item data-v-34c343d8" bindtap="__e"><image src="{{'../../static/icon/icon'+(index2+1<9?index2+1:1)+'.png'}}" mode class="data-v-34c343d8"></image><view class="info data-v-34c343d8"><view class="data-v-34c343d8">{{item2.m0+item2.$orig.environmentDataId}}</view><view class="data-v-34c343d8">{{item2.$orig.environmentData+item2.m1}}</view></view></view></block></view></view></block></view></view> <view class="timeEnvironment data-v-34c343d8"><u-navbar vue-id="63a4351c-1" background="{{background}}" is-back="{{true}}" back-icon-color="#FFFFFF" border-bottom="{{false}}" title="实时环境" title-color="#FFFFFF" title-bold="{{true}}" title-size="32" class="data-v-34c343d8" bind:__l="__l"></u-navbar><view class="navbar data-v-34c343d8"><image src="../../static/timeEnvironment_bg.png" mode class="data-v-34c343d8"></image></view><view class="content data-v-34c343d8"><view class="title data-v-34c343d8"><image src="../../static/logo_1.png" mode class="data-v-34c343d8"></image><view class="right data-v-34c343d8"><view class="data-v-34c343d8">温室智慧云</view><view class="data-v-34c343d8">Greenhouse wisdom Cloud</view></view></view><view class="subtitle data-v-34c343d8">欢迎使用温室智慧云数据统计</view><block wx:for="{{$root.l1}}" wx:for-item="item1" wx:for-index="index1" wx:key="index1"><view class="waterAndFertilizerParams data-v-34c343d8"><view class="nav data-v-34c343d8"><image src="../../static/PH.png" mode class="data-v-34c343d8"></image><text class="data-v-34c343d8">{{item1.$orig.deviceTypeName}}</text></view><view class="detail data-v-34c343d8"><block wx:for="{{item1.l0}}" wx:for-item="item2" wx:for-index="index2" wx:key="index2"><view data-event-opts="{{[['tap',[['toTarget_water_fertilizer_PH',['$0','$1'],[[['waterAndFertilizerParamsList','',index1],['childList','',index2,'equipmentId']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'environmentData']]]]]]]}}" class="item data-v-34c343d8" bindtap="__e"><image src="{{'../../static/icon/icon'+(index2+1<9?index2+1:1)+'.png'}}" mode class="data-v-34c343d8"></image><view class="info data-v-34c343d8"><view class="data-v-34c343d8">{{item2.m0+item2.$orig.environmentDataId}}</view><view class="data-v-34c343d8">{{item2.$orig.environmentData+item2.m1}}</view></view></view></block></view><view class="updateTime data-v-34c343d8"><label class="_span data-v-34c343d8"></label><label class="_span data-v-34c343d8">{{"*更新数据时间 :  "+updateTime}}</label></view></view></block></view></view>

View File

@ -114,7 +114,6 @@
padding: 10rpx 0rpx; padding: 10rpx 0rpx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-evenly;
} }
.timeEnvironment .content .waterAndFertilizerParams .detail .item.data-v-34c343d8 { .timeEnvironment .content .waterAndFertilizerParams .detail .item.data-v-34c343d8 {
width: 50%; width: 50%;
@ -141,6 +140,14 @@
font-weight: bold; font-weight: bold;
color: #333333; color: #333333;
} }
.timeEnvironment .content .waterAndFertilizerParams .updateTime.data-v-34c343d8 {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20rpx;
font-size: 22rpx;
}
.timeEnvironment .content .testBase.data-v-34c343d8 { .timeEnvironment .content .testBase.data-v-34c343d8 {
width: 690rpx; width: 690rpx;
height: auto; height: auto;