新增控制器实时数据模块

This commit is contained in:
pangdundun 2023-11-10 10:43:22 +08:00
parent 8709ea2587
commit fe7098e5b6
44 changed files with 480 additions and 174 deletions

View File

@ -24,6 +24,8 @@ let api = {
readFs_reg:"/readFs/reg",//根据设备ID获取实时数据 readFs_reg:"/readFs/reg",//根据设备ID获取实时数据
readJinHuaControl_reg:"/readJinHuaControl/reg",//读取所有寄存器的状态值 readJinHuaControl_reg:"/readJinHuaControl/reg",//读取所有寄存器的状态值
writeJinHuaControl_write:"/writeJinHuaControl/write",//控制器写入数据(金华) writeJinHuaControl_write:"/writeJinHuaControl/write",//控制器写入数据(金华)
getcontrol_rtdata:"/getcontrol/rtdata",//主页查看控制器实时数据
getcontrol_fsdata:"/getcontrol/fsdata",//控制器实时数据折线图
} }
export default api export default api

View File

@ -90,6 +90,7 @@
valuePHList: [], valuePHList: [],
newValuePHList: [], newValuePHList: [],
unit: '', unit: '',
equipmentName:'',
titleName: '', titleName: '',
echartName: '' echartName: ''
@ -115,6 +116,9 @@
this.unit = option.unit this.unit = option.unit
this.opts.yAxis.data[0].title = option.unit this.opts.yAxis.data[0].title = option.unit
} }
if(option.equipmentName){
this.equipmentName = option.equipmentName
}
this.titleName = this.getStatus(option.equipmentNumber, option.targetValue) this.titleName = this.getStatus(option.equipmentNumber, option.targetValue)
}, },
@ -141,7 +145,7 @@
// 线 // 线
getEchartsData() { getEchartsData() {
this.$http({ this.$http({
url: this.api.chart_fsdata + '?equipmentId=' + this.equipmentId, url: (this.equipmentName == 1 ? this.api.chart_fsdata : this.api.getcontrol_fsdata) + '?equipmentId=' + this.equipmentId,
method: 'POST' method: 'POST'
}).then(res => { }).then(res => {
// console.log(res, '线'); // console.log(res, '线');

View File

@ -24,17 +24,20 @@
欢迎使用温室智慧云数据统计 欢迎使用温室智慧云数据统计
</view> </view>
<view class="waterAndFertilizerParams" v-for="(item1,index1) in waterAndFertilizerParamsList" :key="index1" v-if="item1.equipmentName==1"> <view class="waterAndFertilizerParams" v-for="(item1,index1) in waterAndFertilizerParamsList" :key="index1">
<view class="nav"> <view class="nav">
<image src="../../static/PH.png" mode=""></image> <image src="../../static/PH.png" mode=""></image>
<text>{{ item1.deviceTypeName }}</text> <text>{{ item1.deviceTypeName }}</text>
</view> </view>
<view class="detail"> <view class="detail">
<view class="item" v-for="(item2,index2) in item1.childList" :key="index2" @click="toTarget_water_fertilizer_PH(item2.equipmentId,item2.environmentData,item2.environmentDataId,item2.equipmentNumber,item2.targetValue,getTypeList(item2.formula))"> <view class="item" v-for="(item2,index2) in item1.childList" :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/icon${ (index2 + 1) < 9 ? (index2 + 1) : 1 }.png`' mode=""></image> --> <!-- <image :src='`../../static/icon/icon${ (index2 + 1) < 9 ? (index2 + 1) : 1 }.png`' mode=""></image> -->
<image :src="`../../static/icon_new/icon${ item2.formula }.png`" mode=""></image> <image :src="`../../static/icon_new/icon${ item2.formula }.png`" mode=""></image>
<view class="info"> <view class="info">
<view class="">{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}</view> <view class="">
{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}
</view>
<view class="">{{ item2.environmentData + getTypeList(item2.formula) }}</view> <view class="">{{ item2.environmentData + getTypeList(item2.formula) }}</view>
</view> </view>
</view> </view>
@ -194,70 +197,363 @@
//label valuecode //label valuecode
//countType 0 1-400 2/10 3(-400) / 10 //countType 0 1-400 2/10 3(-400) / 10
typeList: [ typeList: [{
{ label: '无意义的传感器', value: 0, countType: 0 }, label: '无意义的传感器',
{ label: '空气温度', value: 1, countType: 3,unit: '℃' }, value: 0,
{ label: '空气湿度', value: 2, countType: 2,unit: '%' }, countType: 0
{ label: '光亮度', value: 3, countType: 2,unit: 'Klux' }, },
{ label: '二氧化碳', value: 4, countType: 0,unit: 'ppm' }, {
{ label: '土壤温度', value: 5, countType: 3,unit: '℃' }, label: '空气温度',
{ label: '土壤湿度', value: 6, countType: 2,unit: '%' }, value: 1,
{ label: '水温', value: 7, countType: 3,unit: '℃' }, countType: 3,
{ label: '水肥PH', value: 8, countType: 2,unit: '' }, unit: '℃'
{ label: '水肥EC', value: 9, countType: 2,unit: 'mS/cm' }, },
{ label: '压差', value: 10, countType: 0,unit: 'Pa' }, {
{ label: '风速', value: 11, countType: 2,unit: 'm/s' }, label: '空气湿度',
{ label: '风向', value: 12, countType: 0,unit: '°' }, value: 2,
{ label: '雨雪信号', value: 13, countType: 0,unit: '' }, countType: 2,
{ label: '降雨量', value: 14, countType: 2,unit: 'mm' }, unit: '%'
{ label: '光合有效辐射', value: 15, countType: 2,unit: 'umol/m2.s' }, },
{ label: '太阳总辐射', value: 16, countType: 0,unit: 'W/m2' }, {
{ label: '流量', value: 17, countType: 0,unit: 'L/H' }, label: '光亮度',
{ label: '大气压强', value: 18, countType: 2,unit: 'KPa' }, value: 3,
{ label: '土壤PH', value: 19, countType: 2,unit: '' }, countType: 2,
{ label: '土壤EC', value: 20, countType: 0,unit: 'uS/cm' }, unit: 'Klux'
{ label: '叶面温度', value: 21, countType: 3,unit: '℃'}, },
{ label: '叶面湿度', value: 22, countType: 2,unit: '%' }, {
{ label: '果实直径', value: 23, countType: 0,unit: 'mm' }, label: '二氧化碳',
{ label: '茎秆直径', value: 24, countType: 0,unit: 'mm' }, value: 4,
{ label: '流速', value: 25, countType: 2,unit: 'm/s' }, countType: 0,
{ label: '瞬时流量', value: 26, countType: 2,unit: 'm3' }, unit: 'ppm'
{ label: '当日流量', value: 27, countType: 2,unit: 'T' }, },
{ label: '累计流量', value: 28, countType: 0,unit: 'T' }, {
{ label: '无线气象站电池电压', value: 29, countType: 2,unit: 'V' }, label: '土壤温度',
{ label: '无线气象站无线信号强度', value: 30, countType: 1,unit: 'dBm' }, value: 5,
{ label: '无线气象站信噪比SNR', value: 31, countType: 1,unit: 'dB' }, countType: 3,
{ label: 'PM1.0', value: 32, countType: 0,unit: 'μg/m2' }, unit: '℃'
{ label: 'PM2.5', value: 33, countType: 0,unit: 'μg/m2' }, },
{ label: 'PM10', value: 34, countType: 0,unit: 'μg/m2' }, {
{ label: '紫外辐射', value: 35, countType: 0,unit: 'W/m2' }, label: '土壤湿度',
{ label: '蒸发量', value: 36, countType: 2,unit: 'mm' }, value: 6,
{ label: '负氧离子', value: 37, countType: 0,unit: '个/cm3' }, countType: 2,
{ label: '露点温度', value: 38, countType: 3,unit: '℃'}, unit: '%'
{ label: '设备电压', value: 39, countType: 2,unit: 'V' }, },
{ label: '设备电流', value: 40, countType: 2,unit: 'A' }, {
{ label: '土壤氮含量', value: 41, countType: 0,unit: 'mg/kg' }, label: '水温',
{ label: '土壤磷含量', value: 42, countType: 0,unit: 'mg/kg' }, value: 7,
{ label: '土壤钾含量', value: 43, countType: 0,unit: 'mg/kg' }, countType: 3,
{ label: '管道压力', value: 44, countType: 0,unit: 'Kpa' }, unit: '℃'
{ label: '一氧化碳', value: 45, countType: 0,unit: 'ppm' }, },
{ label: '氨气', value: 46, countType: 0,unit: 'ppm' }, {
{ label: '硫化氢', value: 47, countType: 0,unit: 'ppm' }, label: '水肥PH',
{ label: '氧气', value: 48, countType: 2,unit: '%vol' }, value: 8,
{ label: '甲烷', value: 49, countType: 2,unit: '%vol' }, countType: 2,
{ label: '铜CU', value: 50, countType: 0,unit: 'mg/kg' }, unit: ''
{ label: '镉CD', value: 51, countType: 2,unit: 'mg/kg' }, },
{ label: '铅PB', value: 52, countType: 0,unit: 'mg/kg' }, {
{ label: '噪声', value: 53, countType: 0,unit: 'dB' }, label: '水肥EC',
{ label: '叶面面积', value: 54, countType: 0,unit: 'mm' }, value: 9,
{ label: '虫数量', value: 55, countType: 0,unit: '个' }, countType: 2,
{ label: '无线传感器电池电压', value: 56, countType: 2,unit: 'V' }, unit: 'mS/cm'
{ label: '无线传感器无线信号强度', value: 57, countType: 1,unit: 'dBm' }, },
{ label: '无线传感器信噪比SNR', value: 58, countType: 1,unit: 'dB' }, {
label: '压差',
value: 10,
countType: 0,
unit: 'Pa'
},
{
label: '风速',
value: 11,
countType: 2,
unit: 'm/s'
},
{
label: '风向',
value: 12,
countType: 0,
unit: '°'
},
{
label: '雨雪信号',
value: 13,
countType: 0,
unit: ''
},
{
label: '降雨量',
value: 14,
countType: 2,
unit: 'mm'
},
{
label: '光合有效辐射',
value: 15,
countType: 2,
unit: 'umol/m2.s'
},
{
label: '太阳总辐射',
value: 16,
countType: 0,
unit: 'W/m2'
},
{
label: '流量',
value: 17,
countType: 0,
unit: 'L/H'
},
{
label: '大气压强',
value: 18,
countType: 2,
unit: 'KPa'
},
{
label: '土壤PH',
value: 19,
countType: 2,
unit: ''
},
{
label: '土壤EC',
value: 20,
countType: 0,
unit: 'uS/cm'
},
{
label: '叶面温度',
value: 21,
countType: 3,
unit: '℃'
},
{
label: '叶面湿度',
value: 22,
countType: 2,
unit: '%'
},
{
label: '果实直径',
value: 23,
countType: 0,
unit: 'mm'
},
{
label: '茎秆直径',
value: 24,
countType: 0,
unit: 'mm'
},
{
label: '流速',
value: 25,
countType: 2,
unit: 'm/s'
},
{
label: '瞬时流量',
value: 26,
countType: 2,
unit: 'm3'
},
{
label: '当日流量',
value: 27,
countType: 2,
unit: 'T'
},
{
label: '累计流量',
value: 28,
countType: 0,
unit: 'T'
},
{
label: '无线气象站电池电压',
value: 29,
countType: 2,
unit: 'V'
},
{
label: '无线气象站无线信号强度',
value: 30,
countType: 1,
unit: 'dBm'
},
{
label: '无线气象站信噪比SNR',
value: 31,
countType: 1,
unit: 'dB'
},
{
label: 'PM1.0',
value: 32,
countType: 0,
unit: 'μg/m2'
},
{
label: 'PM2.5',
value: 33,
countType: 0,
unit: 'μg/m2'
},
{
label: 'PM10',
value: 34,
countType: 0,
unit: 'μg/m2'
},
{
label: '紫外辐射',
value: 35,
countType: 0,
unit: 'W/m2'
},
{
label: '蒸发量',
value: 36,
countType: 2,
unit: 'mm'
},
{
label: '负氧离子',
value: 37,
countType: 0,
unit: '个/cm3'
},
{
label: '露点温度',
value: 38,
countType: 3,
unit: '℃'
},
{
label: '设备电压',
value: 39,
countType: 2,
unit: 'V'
},
{
label: '设备电流',
value: 40,
countType: 2,
unit: 'A'
},
{
label: '土壤氮含量',
value: 41,
countType: 0,
unit: 'mg/kg'
},
{
label: '土壤磷含量',
value: 42,
countType: 0,
unit: 'mg/kg'
},
{
label: '土壤钾含量',
value: 43,
countType: 0,
unit: 'mg/kg'
},
{
label: '管道压力',
value: 44,
countType: 0,
unit: 'Kpa'
},
{
label: '一氧化碳',
value: 45,
countType: 0,
unit: 'ppm'
},
{
label: '氨气',
value: 46,
countType: 0,
unit: 'ppm'
},
{
label: '硫化氢',
value: 47,
countType: 0,
unit: 'ppm'
},
{
label: '氧气',
value: 48,
countType: 2,
unit: '%vol'
},
{
label: '甲烷',
value: 49,
countType: 2,
unit: '%vol'
},
{
label: '铜CU',
value: 50,
countType: 0,
unit: 'mg/kg'
},
{
label: '镉CD',
value: 51,
countType: 2,
unit: 'mg/kg'
},
{
label: '铅PB',
value: 52,
countType: 0,
unit: 'mg/kg'
},
{
label: '噪声',
value: 53,
countType: 0,
unit: 'dB'
},
{
label: '叶面面积',
value: 54,
countType: 0,
unit: 'mm'
},
{
label: '虫数量',
value: 55,
countType: 0,
unit: '个'
},
{
label: '无线传感器电池电压',
value: 56,
countType: 2,
unit: 'V'
},
{
label: '无线传感器无线信号强度',
value: 57,
countType: 1,
unit: 'dBm'
},
{
label: '无线传感器信噪比SNR',
value: 58,
countType: 1,
unit: 'dB'
},
], ],
timer:null, timer: null,
updateTime:'' updateTime: ''
} }
}, },
onLoad() { onLoad() {
@ -321,9 +617,9 @@
success: function(res) { success: function(res) {
that.getEquipmentInfo(uni.getStorageSync('userid')) that.getEquipmentInfo(uni.getStorageSync('userid'))
}, },
fail:function(err){ fail: function(err) {
uni.reLaunch({ uni.reLaunch({
url:'/pages/login/login' url: '/pages/login/login'
}) })
} }
}) })
@ -342,33 +638,32 @@
// console.log(res, 'id'); // console.log(res, 'id');
if (res.code == 200) { if (res.code == 200) {
this.waterAndFertilizerParamsList = res.data.map((item,index)=>{ this.waterAndFertilizerParamsList = res.data.map((item, index) => {
return { return {
...item, ...item,
childList:[] childList: []
} }
}) })
this.waterAndFertilizerParamsList.forEach((i,index)=>{ this.waterAndFertilizerParamsList.forEach((i, index) => {
// console.log(i.deviceId,'i.deviceId');
if(i.deviceId == 2023042214250018) return
this.$http({ this.$http({
url: this.api.getFs_rtdata + "?equipmentId=" + i.deviceId, url: (i.equipmentName == 1 ? this.api.getFs_rtdata : this.api.getcontrol_rtdata) + "?equipmentId=" + i.deviceId,
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 this.updateTime = res.data[0].updateTime
// console.log(this.waterAndFertilizerParamsList); // console.log(this.waterAndFertilizerParamsList);
}else{ } else {
} }
}).catch(err=>{ }).catch(err => {
console.log('接口失败'); console.log('接口失败');
}) })
}) })
@ -378,32 +673,34 @@
}, },
// 线 // 线
toTarget_water_fertilizer_PH(id,data,name,equipmentNumber,targetValue,unit){ toTarget_water_fertilizer_PH(id, data, name, equipmentNumber, targetValue, unit,equipmentName) {
uni.navigateTo({ uni.navigateTo({
url:'/pages/target_water_fertilizer_PH/target_water_fertilizer_PH?id=' + id + '&data=' + data + '&name=' + name + '&equipmentNumber=' + equipmentNumber + '&targetValue=' + targetValue + '&unit=' + unit url: '/pages/target_water_fertilizer_PH/target_water_fertilizer_PH?id=' + id + '&data=' +
data + '&name=' + name + '&equipmentNumber=' + equipmentNumber + '&targetValue=' +
targetValue + '&unit=' + unit + '&equipmentName=' + equipmentName
}) })
}, },
// //
getTypeList(val){ getTypeList(val) {
let typeList1 = [] let typeList1 = []
typeList1 = this.typeList.filter(item=> { typeList1 = this.typeList.filter(item => {
return item.value == val return item.value == val
}) })
return typeList1[0].unit return typeList1[0].unit
}, },
// ,1# // ,1#
getStatus(equipmentNumber,targetValue){ getStatus(equipmentNumber, targetValue) {
if(targetValue == 1){ if (targetValue == 1) {
return '目标' return '目标'
}else if(targetValue == 0 && equipmentNumber == 0){ } else if (targetValue == 0 && equipmentNumber == 0) {
return '1#平均' return '1#平均'
}else if(targetValue == 0 && equipmentNumber == 15){ } else if (targetValue == 0 && equipmentNumber == 15) {
return '2#平均' return '2#平均'
}else if(targetValue == 0 && equipmentNumber != 0 && equipmentNumber != 15){ } else if (targetValue == 0 && equipmentNumber != 0 && equipmentNumber != 15) {
return equipmentNumber + '#' return equipmentNumber + '#'
} }
} }
@ -548,7 +845,8 @@
} }
} }
} }
.updateTime{
.updateTime {
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

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

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

@ -1557,7 +1557,7 @@ function initData(vueOptions, context) {
try { try {
data = data.call(context); // 支持 Vue.prototype 上挂的数据 data = data.call(context); // 支持 Vue.prototype 上挂的数据
} catch (e) { } catch (e) {
if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) { if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data); console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
} }
} }
@ -8934,7 +8934,7 @@ function type(obj) {
function flushCallbacks$1(vm) { function flushCallbacks$1(vm) {
if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) { if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) { if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
var mpInstance = vm.$scope; var mpInstance = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid + console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']'); ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
@ -8955,14 +8955,14 @@ function nextTick$1(vm, cb) {
//1.nextTick 之前 已 setData 且 setData 还未回调完成 //1.nextTick 之前 已 setData 且 setData 还未回调完成
//2.nextTick 之前存在 render watcher //2.nextTick 之前存在 render watcher
if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) { if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){ if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
var mpInstance = vm.$scope; var mpInstance = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid + console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
']:nextVueTick'); ']:nextVueTick');
} }
return nextTick(cb, vm) return nextTick(cb, vm)
}else{ }else{
if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){ if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
var mpInstance$1 = vm.$scope; var mpInstance$1 = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid + console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
']:nextMPTick'); ']:nextMPTick');
@ -9058,7 +9058,7 @@ var patch = function(oldVnode, vnode) {
}); });
var diffData = this.$shouldDiffData === false ? data : diff(data, mpData); var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
if (Object.keys(diffData).length) { if (Object.keys(diffData).length) {
if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) { if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid + console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
']差量更新', ']差量更新',
JSON.stringify(diffData)); JSON.stringify(diffData));
@ -12006,7 +12006,7 @@ var api = (_api = {
sel_user: "/api/sel/user", sel_user: "/api/sel/user",
//根据id查询用户信息 //根据id查询用户信息
getFs_rtdata: "/getFs/rtdata" getFs_rtdata: "/getFs/rtdata"
}, (0, _defineProperty2.default)(_api, "selFs_time", "/selFs/time"), (0, _defineProperty2.default)(_api, "sel_eqbyid", "/sel/eqbyid/"), (0, _defineProperty2.default)(_api, "chart_fsdata", "/chart/fsdata"), (0, _defineProperty2.default)(_api, "user_update_pwd", "/user/update/pwd"), (0, _defineProperty2.default)(_api, "readFs_state", "/readFs/state"), (0, _defineProperty2.default)(_api, "writeFs", "/writeFs"), (0, _defineProperty2.default)(_api, "readFs_reg", "/readFs/reg"), (0, _defineProperty2.default)(_api, "readJinHuaControl_reg", "/readJinHuaControl/reg"), (0, _defineProperty2.default)(_api, "writeJinHuaControl_write", "/writeJinHuaControl/write"), _api); }, (0, _defineProperty2.default)(_api, "selFs_time", "/selFs/time"), (0, _defineProperty2.default)(_api, "sel_eqbyid", "/sel/eqbyid/"), (0, _defineProperty2.default)(_api, "chart_fsdata", "/chart/fsdata"), (0, _defineProperty2.default)(_api, "user_update_pwd", "/user/update/pwd"), (0, _defineProperty2.default)(_api, "readFs_state", "/readFs/state"), (0, _defineProperty2.default)(_api, "writeFs", "/writeFs"), (0, _defineProperty2.default)(_api, "readFs_reg", "/readFs/reg"), (0, _defineProperty2.default)(_api, "readJinHuaControl_reg", "/readJinHuaControl/reg"), (0, _defineProperty2.default)(_api, "writeJinHuaControl_write", "/writeJinHuaControl/write"), (0, _defineProperty2.default)(_api, "getcontrol_rtdata", "/getcontrol/rtdata"), (0, _defineProperty2.default)(_api, "getcontrol_fsdata", "/getcontrol/fsdata"), _api);
var _default = api; var _default = api;
exports.default = _default; exports.default = _default;
@ -12373,7 +12373,7 @@ function _extends() {
var formatRegExp = /%[sdj%]/g; var formatRegExp = /%[sdj%]/g;
var warning = function warning() {}; // don't print warning message when in production env or node runtime var warning = function warning() {}; // don't print warning message when in production env or node runtime
if (typeof process !== 'undefined' && Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}) && "development" !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') { if (typeof process !== 'undefined' && Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}) && "development" !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') {
warning = function warning(type, errors) { warning = function warning(type, errors) {
if (typeof console !== 'undefined' && console.warn) { if (typeof console !== 'undefined' && console.warn) {
if (errors.every(function (e) { if (errors.every(function (e) {

View File

@ -255,6 +255,7 @@ var _default = {
valuePHList: [], valuePHList: [],
newValuePHList: [], newValuePHList: [],
unit: '', unit: '',
equipmentName: '',
titleName: '', titleName: '',
echartName: '' echartName: ''
}; };
@ -278,6 +279,9 @@ var _default = {
this.unit = option.unit; this.unit = option.unit;
this.opts.yAxis.data[0].title = option.unit; this.opts.yAxis.data[0].title = option.unit;
} }
if (option.equipmentName) {
this.equipmentName = option.equipmentName;
}
this.titleName = this.getStatus(option.equipmentNumber, option.targetValue); this.titleName = this.getStatus(option.equipmentNumber, option.targetValue);
}, },
mounted: function mounted() { mounted: function mounted() {
@ -303,7 +307,7 @@ var _default = {
getEchartsData: function getEchartsData() { getEchartsData: function getEchartsData() {
var _this2 = this; var _this2 = this;
this.$http({ this.$http({
url: this.api.chart_fsdata + '?equipmentId=' + this.equipmentId, url: (this.equipmentName == 1 ? this.api.chart_fsdata : this.api.getcontrol_fsdata) + '?equipmentId=' + this.equipmentId,
method: 'POST' method: 'POST'
}).then(function (res) { }).then(function (res) {
// console.log(res, '获取折线图数据'); // console.log(res, '获取折线图数据');

View File

@ -129,9 +129,7 @@ var render = function () {
_vm.waterAndFertilizerParamsList, _vm.waterAndFertilizerParamsList,
function (item1, index1) { function (item1, index1) {
var $orig = _vm.__get_orig(item1) var $orig = _vm.__get_orig(item1)
var l0 = var l0 = _vm.__map(item1.childList, function (item2, index2) {
item1.equipmentName == 1
? _vm.__map(item1.childList, function (item2, index2) {
var $orig = _vm.__get_orig(item2) var $orig = _vm.__get_orig(item2)
var m0 = _vm.getTypeList(item2.formula) var m0 = _vm.getTypeList(item2.formula)
var m1 = _vm.getStatus(item2.equipmentNumber, item2.targetValue) var m1 = _vm.getStatus(item2.equipmentNumber, item2.targetValue)
@ -143,7 +141,6 @@ var render = function () {
m2: m2, m2: m2,
} }
}) })
: null
return { return {
$orig: $orig, $orig: $orig,
l0: l0, l0: l0,
@ -280,6 +277,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
// //
// //
// //
//
//
//
var _default = { var _default = {
data: function data() { data: function data() {
return { return {
@ -759,10 +759,8 @@ var _default = {
}); });
}); });
_this.waterAndFertilizerParamsList.forEach(function (i, index) { _this.waterAndFertilizerParamsList.forEach(function (i, index) {
// console.log(i.deviceId,'i.deviceId');
if (i.deviceId == 2023042214250018) return;
_this.$http({ _this.$http({
url: _this.api.getFs_rtdata + "?equipmentId=" + i.deviceId, url: (i.equipmentName == 1 ? _this.api.getFs_rtdata : _this.api.getcontrol_rtdata) + "?equipmentId=" + i.deviceId,
method: 'post' method: 'post'
}).then(function (res) { }).then(function (res) {
// console.log(res, '主页查看施肥机实时数据'); // console.log(res, '主页查看施肥机实时数据');
@ -784,9 +782,9 @@ var _default = {
}); });
}, },
// 跳转到折线图 // 跳转到折线图
toTarget_water_fertilizer_PH: function toTarget_water_fertilizer_PH(id, data, name, equipmentNumber, targetValue, unit) { toTarget_water_fertilizer_PH: function toTarget_water_fertilizer_PH(id, data, name, equipmentNumber, targetValue, unit, equipmentName) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/target_water_fertilizer_PH/target_water_fertilizer_PH?id=' + id + '&data=' + data + '&name=' + name + '&equipmentNumber=' + equipmentNumber + '&targetValue=' + targetValue + '&unit=' + unit url: '/pages/target_water_fertilizer_PH/target_water_fertilizer_PH?id=' + id + '&data=' + data + '&name=' + name + '&equipmentNumber=' + equipmentNumber + '&targetValue=' + targetValue + '&unit=' + unit + '&equipmentName=' + equipmentName
}); });
}, },
// 数据单位 // 数据单位

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"><block wx:if="{{item1.$orig.equipmentName==1}}"><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','$2','$3','$4',item2.m0],[[['waterAndFertilizerParamsList','',index1],['childList','',index2,'equipmentId']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'environmentData']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'environmentDataId']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'equipmentNumber']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'targetValue']]]]]]]}}" class="item data-v-34c343d8" bindtap="__e"><image src="{{'../../static/icon_new/icon'+item2.$orig.formula+'.png'}}" mode class="data-v-34c343d8"></image><view class="info data-v-34c343d8"><view class="data-v-34c343d8">{{item2.m1+item2.$orig.environmentDataId}}</view><view class="data-v-34c343d8">{{item2.$orig.environmentData+item2.m2}}</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></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','$2','$3','$4',item2.m0,'$5'],[[['waterAndFertilizerParamsList','',index1],['childList','',index2,'equipmentId']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'environmentData']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'environmentDataId']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'equipmentNumber']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'targetValue']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'equipmentName']]]]]]]}}" class="item data-v-34c343d8" bindtap="__e"><image src="{{'../../static/icon_new/icon'+item2.$orig.formula+'.png'}}" mode class="data-v-34c343d8"></image><view class="info data-v-34c343d8"><view class="data-v-34c343d8">{{''+(item2.m1+item2.$orig.environmentDataId)+''}}</view><view class="data-v-34c343d8">{{item2.$orig.environmentData+item2.m2}}</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>