Compare commits
8 Commits
b68cf11c78
...
a3faab2336
Author | SHA1 | Date |
---|---|---|
liubaixun | a3faab2336 | |
liubaixun | c4a8bd9b44 | |
孙萌 | 74e0100ab7 | |
pangdundun | fe7098e5b6 | |
pangdundun | 8709ea2587 | |
liubaixun | bd10c554b1 | |
liubaixun | 6ea08e8063 | |
pangdundun | 738d268aa0 |
397
api/driverapi.js
|
@ -7,23 +7,388 @@ let api = {
|
|||
baseUrl: variable.baseUrl,
|
||||
|
||||
|
||||
user_login:'/user/login',// 登录
|
||||
selFs_time:'/selFs/time',//主页查看施肥机历史数据
|
||||
user_logout:'/user/logout',//退出
|
||||
user_upload:'/user/upload',//上传logo
|
||||
update_user:"/api/update/user",//用户更新个人信息,修改昵称密码等
|
||||
sel_user:"/api/sel/user",//根据id查询用户信息
|
||||
getFs_rtdata:"/getFs/rtdata",//主页查看施肥机实时数据
|
||||
selFs_time:"/selFs/time",//主页查看施肥机历史数据
|
||||
sel_eqbyid:"/sel/eqbyid/",//根据用户id查询对应的设备数据
|
||||
chart_fsdata:"/chart/fsdata",//实时数据折线图
|
||||
user_update_pwd:"/user/update/pwd",//用户修改密码
|
||||
user_login: '/user/login', // 登录
|
||||
selFs_time: '/selFs/time', //主页查看施肥机历史数据
|
||||
user_logout: '/user/logout', //退出
|
||||
user_upload: '/user/upload', //上传logo
|
||||
update_user: "/api/update/user", //用户更新个人信息,修改昵称密码等
|
||||
sel_user: "/api/sel/user", //根据id查询用户信息
|
||||
getFs_rtdata: "/getFs/rtdata", //主页查看施肥机实时数据
|
||||
selFs_time: "/selFs/time", //主页查看施肥机历史数据
|
||||
sel_eqbyid: "/sel/eqbyid/", //根据用户id查询对应的设备数据
|
||||
chart_fsdata: "/chart/fsdata", //实时数据折线图
|
||||
user_update_pwd: "/user/update/pwd", //用户修改密码
|
||||
|
||||
readFs_state:"/readFs/state",//根据设备ID获取实时数据
|
||||
writeFs:"/writeFs",//根据设备ID获取实时数据
|
||||
readFs_reg:"/readFs/reg",//根据设备ID获取实时数据
|
||||
readJinHuaControl_reg:"/readJinHuaControl/reg",//读取所有寄存器的状态值
|
||||
writeJinHuaControl_write:"/writeJinHuaControl/write",//控制器写入数据(金华)
|
||||
readFs_state: "/readFs/state", //根据设备ID获取实时数据
|
||||
writeFs: "/writeFs", //根据设备ID获取实时数据
|
||||
readFs_reg: "/readFs/reg", //根据设备ID获取实时数据
|
||||
readJinHuaControl_reg: "/readJinHuaControl/reg", //读取所有寄存器的状态值
|
||||
writeJinHuaControl_write: "/writeJinHuaControl/write", //控制器写入数据(金华)
|
||||
getcontrol_rtdata: "/getcontrol/rtdata", //主页查看控制器实时数据
|
||||
getcontrol_fsdata: "/getcontrol/fsdata", //控制器实时数据折线图
|
||||
|
||||
getcontrol_cpermission: '/getcontrol/cpermission', //根据设备id查询控制器权限
|
||||
getControl_getState: '/readControl/getState', //控制器 设备运行状态
|
||||
getReadControlliShuiControl: '/readControl/liShuiControl', //控制器 顶模和风机
|
||||
|
||||
|
||||
//countType计算类型 0是原数据 1是原数据-400 2是原数据/10 3是(原数据-400) / 10 4是(原数据-1000)/10
|
||||
typeList: [{
|
||||
label: '无意义的传感器',
|
||||
value: 0,
|
||||
countType: 0,
|
||||
unit: ''
|
||||
},
|
||||
{
|
||||
label: '空气温度',
|
||||
value: 1,
|
||||
countType: 3,
|
||||
unit: '℃'
|
||||
},
|
||||
{
|
||||
label: '空气湿度',
|
||||
value: 2,
|
||||
countType: 2,
|
||||
unit: '%'
|
||||
},
|
||||
{
|
||||
label: '光亮度',
|
||||
value: 3,
|
||||
countType: 2,
|
||||
unit: 'Klux'
|
||||
},
|
||||
{
|
||||
label: '二氧化碳',
|
||||
value: 4,
|
||||
countType: 0,
|
||||
unit: 'ppm'
|
||||
},
|
||||
{
|
||||
label: '土壤温度',
|
||||
value: 5,
|
||||
countType: 3,
|
||||
unit: '℃'
|
||||
},
|
||||
{
|
||||
label: '土壤湿度',
|
||||
value: 6,
|
||||
countType: 2,
|
||||
unit: '%'
|
||||
},
|
||||
{
|
||||
label: '水温',
|
||||
value: 7,
|
||||
countType: 3,
|
||||
unit: '℃'
|
||||
},
|
||||
{
|
||||
label: '水肥PH',
|
||||
value: 8,
|
||||
countType: 2,
|
||||
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: '风向',
|
||||
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: 4,
|
||||
unit: 'KPa'
|
||||
},
|
||||
{
|
||||
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'
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
export default api
|
|
@ -2,10 +2,10 @@
|
|||
<view class="controller">
|
||||
<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="content">
|
||||
<!-- 金华权限 -->
|
||||
<view class="content" v-if="purviewList.indexOf('10')!=-1">
|
||||
<div class="item">
|
||||
<u-collapse :item-style="itemStyle" :head-style='headStyle'>
|
||||
<u-collapse :accordion='false' :item-style="itemStyle" :head-style='headStyle'>
|
||||
<u-collapse-item :title="item.head" v-for="(item,index) in itemList" :key="index" align="center">
|
||||
<view class="collapseItem">
|
||||
<view class="line"></view>
|
||||
|
@ -25,14 +25,16 @@
|
|||
<view class="roll_input">
|
||||
<view class="">
|
||||
<view class="">
|
||||
<input v-model="item.open_value" @blur="blurChangeData00_1(item.type+1,$event)" type="number"
|
||||
<input v-model="item.open_value"
|
||||
@blur="blurChangeData00_1(item.type+1,$event)" type="number"
|
||||
placeholder="0">
|
||||
</view>
|
||||
<text>通道打开;</text>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="">
|
||||
<input v-model="item.close_value" @blur="blurChangeData00_2(item.type+2,$event)" type="number"
|
||||
<input v-model="item.close_value"
|
||||
@blur="blurChangeData00_2(item.type+2,$event)" type="number"
|
||||
placeholder="0">
|
||||
</view>
|
||||
<text>通道关闭</text>
|
||||
|
@ -44,6 +46,185 @@
|
|||
</u-collapse>
|
||||
</div>
|
||||
</view>
|
||||
|
||||
<!-- 丽水权限 -->
|
||||
<view class="content" v-if="purviewList.indexOf('9')!=-1">
|
||||
<view class="lishui-item">
|
||||
<view class="lishui-title">
|
||||
<view class="title-left">
|
||||
{{ fanStatus.name }}
|
||||
</view>
|
||||
<view class="title-right" @click="fanmodelShow=true">
|
||||
设置
|
||||
<image src="../../static/set-arrow.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="lishui-content" v-if="fanStatus.open != 0">
|
||||
<view class="lishui-set">
|
||||
<view class="set-1">
|
||||
<image v-if="fanStatus.open == 1" class="sel" src="../../static/sel.png" mode=""></image>
|
||||
<view v-else class="sel-no"></view>
|
||||
<span>自动控制</span>
|
||||
</view>
|
||||
<view class="set-2">
|
||||
<image v-if="fanStatus.open != 1" class="sel" src="../../static/sel.png" mode=""></image>
|
||||
<view v-else class="sel-no"></view>
|
||||
<span>手机控制</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="lishui-grid">
|
||||
<view class="btn " :class="fanStatus.status[0] == 1 ? 'btn-on' : 'btn-off'">
|
||||
<image class="fan-img" v-if="fanStatus.status[0] == 1" src="../../static/fan-on.png" alt="">
|
||||
</image>
|
||||
<image v-else src="../../static/fan-off.png" alt=""></image>
|
||||
<span>1#风机</span>
|
||||
</view>
|
||||
<view class="btn" :class="fanStatus.status[1] == 1 ? 'btn-on' : 'btn-off'">
|
||||
<image class="fan-img" v-if="fanStatus.status[1] == 1" src="../../static/fan-on.png" alt="">
|
||||
</image>
|
||||
<image v-else src="../../static/fan-off.png" alt=""></image> <span>2#风机</span>
|
||||
</view>
|
||||
<view class="btn" :class="fanStatus.status[2] == 1 ? 'btn-on' : 'btn-off'">
|
||||
<image class="fan-img" v-if="fanStatus.status[2] == 1" src="../../static/fan-on.png" alt="">
|
||||
</image>
|
||||
<image v-else src="../../static/fan-off.png" alt=""></image> <span>3#风机</span>
|
||||
</view>
|
||||
<view class="btn" :class="fanStatus.status[3] == 1 ? 'btn-on' : 'btn-off'">
|
||||
<image class="fan-img" v-if="fanStatus.status[3] == 1" src="../../static/fan-on.png" alt="">
|
||||
</image>
|
||||
<image v-else src="../../static/fan-off.png" alt=""></image> <span>4#风机</span>
|
||||
</view>
|
||||
<view class="btn" :class="fanStatus.status[4] == 1 ? 'btn-on' : 'btn-off'">
|
||||
<image class="fan-img" v-if="fanStatus.status[4] == 1" src="../../static/fan-on.png" alt="">
|
||||
</image>
|
||||
<image v-else src="../../static/fan-off.png" alt=""></image> <span>5#风机</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="status-noTrue">
|
||||
<image src="../../static/noTrue.png" mode=""></image>
|
||||
<span>当前设备无效</span>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="lishui-item" v-for="item, index in statusList" :key="index">
|
||||
<view class="lishui-title">
|
||||
<view class="title-left">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
<view class="title-right" @click="openModelShow(index)">
|
||||
设置
|
||||
<image src="../../static/set-arrow.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="lishui-content" v-if="item.open != 0">
|
||||
<view class="lishui-set">
|
||||
<view class="set-1">
|
||||
<image v-if="item.open == 1" class="sel" src="../../static/sel.png" mode=""></image>
|
||||
<view v-else class="sel-no"></view>
|
||||
<span>自动控制</span>
|
||||
</view>
|
||||
<view class="set-2">
|
||||
<image v-if="item.open != 1" class="sel" src="../../static/sel.png" mode=""></image>
|
||||
<view v-else class="sel-no"></view>
|
||||
<span>手机控制</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="lishui-status">
|
||||
{{ getNumberStatus(item.index) }}:
|
||||
<span>{{ item.progress }}%</span>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="status-noTrue">
|
||||
<image src="../../static/noTrue.png" mode=""></image>
|
||||
<span>当前设备无效</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-popup v-model="modelShow" mode="center" :mask-close-able='true' width="640rpx" height="350rpx"
|
||||
:closeable='false'>
|
||||
<view class="contentPop lishui-item">
|
||||
<view class="contentPop_box">
|
||||
<view class="title">
|
||||
顶卷膜{{indexs}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="lishui-content">
|
||||
<view class="model-title">
|
||||
控制模式:
|
||||
</view>
|
||||
<view class="lishui-flex">
|
||||
<view class="btn btn-140 " @click="changeOpen1(1)" :class="openIndex1==1?'btn-on':'btn-off'">
|
||||
<span>自动运行</span>
|
||||
</view>
|
||||
<view class="btn btn-140 " @click="changeOpen1(2)" :class="openIndex1==2?'btn-on':'btn-off'">
|
||||
<span>手动打开</span>
|
||||
</view>
|
||||
<view class="btn btn-140 " @click="changeOpen1(3)" :class="openIndex1==3?'btn-on':'btn-off'">
|
||||
<span>手动关闭</span>
|
||||
</view>
|
||||
<view class="btn btn-110 " @click="changeOpen1(4)" :class="openIndex1==4?'btn-on':'btn-off'">
|
||||
<span>停止</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<image src="../../static/closed.png" mode="" @click="modelShow=false"></image>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-popup v-model="fanmodelShow" mode="center" :mask-close-able='true' width="640rpx" height="550rpx"
|
||||
:closeable='false'>
|
||||
<view class="contentPop lishui-item">
|
||||
<view class="contentPop_box padding-none">
|
||||
<view class="title">
|
||||
{{fanStatus.name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="lishui-content padding-none">
|
||||
<view class="lishui-set">
|
||||
<view class="set-1" @click="changeOpen(1)">
|
||||
<image v-if="openIndex == 1" class="sel" src="../../static/sel.png" mode=""></image>
|
||||
<view v-else class="sel-no"></view>
|
||||
<span>自动运行</span>
|
||||
</view>
|
||||
<view class="set-2" @click="changeOpen(2)">
|
||||
<image v-if="openIndex == 2" class="sel" src="../../static/sel.png" mode=""></image>
|
||||
<view v-else class="sel-no"></view>
|
||||
<span>手动打开</span>
|
||||
</view>
|
||||
<view class="set-3" @click="changeOpen(3)">
|
||||
<image v-if="openIndex == 3" class="sel" src="../../static/sel.png" mode=""></image>
|
||||
<view v-else class="sel-no"></view>
|
||||
<span>手动关闭</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="model-title" style="padding:30rpx 0 0 30rpx;">
|
||||
手动打开时,开几号风机:
|
||||
</view>
|
||||
<view class="lishui-grid">
|
||||
<view class="btn" @click="changeIndexOpen(0)" :class="actList1[0]=='1'?'btn-on':'btn-off'">
|
||||
<span>一号风阻</span>
|
||||
</view>
|
||||
<view class="btn" @click="changeIndexOpen(1)" :class="actList1[1]=='1'?'btn-on':'btn-off'">
|
||||
<span>二号风阻</span>
|
||||
</view>
|
||||
<view class="btn" @click="changeIndexOpen(2)" :class="actList1[2]=='1'?'btn-on':'btn-off'">
|
||||
<span>三号风阻</span>
|
||||
</view>
|
||||
<view class="btn" @click="changeIndexOpen(3)" :class="actList1[3]=='1'?'btn-on':'btn-off'">
|
||||
<span>四号风阻</span>
|
||||
</view>
|
||||
<view class="btn" @click="changeIndexOpen(4)" :class="actList1[4]=='1'?'btn-on':'btn-off'">
|
||||
<span>五号风阻</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<image src="../../static/closed.png" mode="" @click="fanmodelShow=false"></image>
|
||||
</view>
|
||||
</u-popup>
|
||||
<view class="content" v-if="!purviewList.length" style="text-align: center;">
|
||||
暂无权限查看
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -60,28 +241,28 @@
|
|||
itemList: [{
|
||||
head: "1#顶卷膜",
|
||||
type: 21680,
|
||||
open_value:0,
|
||||
close_value:0
|
||||
open_value: 0,
|
||||
close_value: 0
|
||||
}, {
|
||||
head: "2#顶卷膜",
|
||||
type: 21683,
|
||||
open_value:0,
|
||||
close_value:0
|
||||
open_value: 0,
|
||||
close_value: 0
|
||||
}, {
|
||||
head: "3#顶卷膜",
|
||||
type: 21686,
|
||||
open_value:0,
|
||||
close_value:0
|
||||
open_value: 0,
|
||||
close_value: 0
|
||||
}, {
|
||||
head: "1#侧卷膜",
|
||||
type: 21689,
|
||||
open_value:0,
|
||||
close_value:0
|
||||
open_value: 0,
|
||||
close_value: 0
|
||||
}, {
|
||||
head: "2#侧卷膜",
|
||||
type: 21692,
|
||||
open_value:0,
|
||||
close_value:0
|
||||
open_value: 0,
|
||||
close_value: 0
|
||||
}, ],
|
||||
itemStyle: {
|
||||
width: "690rpx",
|
||||
|
@ -107,16 +288,35 @@
|
|||
inputData1: [],
|
||||
timer: '',
|
||||
|
||||
|
||||
purviewList: [], //权限的list
|
||||
typeList: [],
|
||||
statusList: [],
|
||||
statusInterval: null, //状态接口调取
|
||||
fanStatus: {
|
||||
name: '风机',
|
||||
open: 0,
|
||||
status: []
|
||||
},
|
||||
indexs: 1, //弹窗打开的顶卷膜index
|
||||
openIndex1: 0, //顶卷膜的index
|
||||
modelShow: false, //顶卷膜show
|
||||
fanmodelShow: false, //风机show
|
||||
openIndex: 0, //风机有效性
|
||||
inputData2: [],
|
||||
actList1: [],
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.typeList = this.api.typeList
|
||||
if (options.id) {
|
||||
this.deviceId = options.id;
|
||||
}
|
||||
|
||||
this.dataInit()
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.statusInterval) && this.statusInterval
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
|
@ -124,17 +324,85 @@
|
|||
this.dataInit();
|
||||
},
|
||||
methods: {
|
||||
//开启几号风机
|
||||
changeIndexOpen(active) {
|
||||
if (this.actList1[active] == '1') {
|
||||
this.actList1[active] = '0'
|
||||
} else {
|
||||
this.actList1[active] = '1'
|
||||
}
|
||||
var revList = this.actList1.slice().reverse()
|
||||
var num = revList.join("");
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: parseInt(num, 2),
|
||||
},
|
||||
};
|
||||
this.changeBtn('21601', dataNum);
|
||||
},
|
||||
//风机有效性修改
|
||||
changeOpen(index) {
|
||||
this.openIndex = index
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: this.openIndex,
|
||||
},
|
||||
};
|
||||
this.changeBtn('21600', dataNum);
|
||||
},
|
||||
//顶卷膜修改
|
||||
changeOpen1(index) {
|
||||
this.openIndex1 = index
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: this.openIndex1,
|
||||
},
|
||||
};
|
||||
this.changeBtn(21613 + ((this.indexs - 1) * 11), dataNum);
|
||||
},
|
||||
changeBtn(code, el) {
|
||||
|
||||
var data = {
|
||||
equipmentId: this.deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value,
|
||||
};
|
||||
this.delayTimerBtn(0, data);
|
||||
},
|
||||
//切换btn的限制 写入停止后j*100毫秒调取函数
|
||||
delayTimerBtn(i, data) {
|
||||
const that = this;
|
||||
//整体接口
|
||||
let j = 10;
|
||||
//避免开启多个计时器
|
||||
this.timer && clearInterval(this.timer);
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
++i;
|
||||
if (i == j) {
|
||||
that.changeData(data);
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
//打开顶卷膜的弹窗
|
||||
openModelShow(index) {
|
||||
this.indexs = index + 1
|
||||
this.modelShow = true
|
||||
|
||||
this.openIndex1 = this.inputData2[21613 + ((this.indexs - 1) * 11)]
|
||||
},
|
||||
// 根据type参数返回对应的txt_act21680
|
||||
getTypeRoll(i){
|
||||
if(i == 21680){
|
||||
getTypeRoll(i) {
|
||||
if (i == 21680) {
|
||||
return this.txt_act21680
|
||||
}else if(i == 21683){
|
||||
} else if (i == 21683) {
|
||||
return this.txt_act21683
|
||||
}else if(i == 21686){
|
||||
} else if (i == 21686) {
|
||||
return this.txt_act21686
|
||||
}else if(i == 21689){
|
||||
} else if (i == 21689) {
|
||||
return this.txt_act21689
|
||||
}else if(i == 21692){
|
||||
} else if (i == 21692) {
|
||||
return this.txt_act21692
|
||||
}
|
||||
},
|
||||
|
@ -144,29 +412,120 @@
|
|||
dataInit() {
|
||||
var deviceId = this.deviceId
|
||||
this.$http({
|
||||
url: this.api.readJinHuaControl_reg + '?deviceId=' + deviceId,
|
||||
url: this.api.getcontrol_cpermission + '?deviceId=' + deviceId,
|
||||
method: 'POST',
|
||||
}).then(res => {
|
||||
// console.log(res, 'deviceId读取所有寄存器的状态值');
|
||||
if (res.code == 200) {
|
||||
uni.hideLoading()
|
||||
uni.stopPullDownRefresh();
|
||||
this.inputData = res.data
|
||||
for(let i=0;i<this.itemList.length;i++){
|
||||
this.itemList[i].open_value = this.inputData[Number('21681')+i*3]
|
||||
this.itemList[i].close_value = this.inputData[Number('21682')+i*3]
|
||||
}
|
||||
// console.log(this.itemList);
|
||||
}).then((res => {
|
||||
res.data.forEach((el, index) => {
|
||||
this.purviewList.push(el.id.toString())
|
||||
})
|
||||
//查看金华权限
|
||||
if (this.purviewList.indexOf('10') != -1) {
|
||||
this.$http({
|
||||
url: this.api.readJinHuaControl_reg + '?deviceId=' + deviceId,
|
||||
method: 'POST',
|
||||
}).then(res => {
|
||||
// console.log(res, 'deviceId读取所有寄存器的状态值');
|
||||
if (res.code == 200) {
|
||||
uni.hideLoading()
|
||||
uni.stopPullDownRefresh();
|
||||
this.inputData = res.data
|
||||
for (let i = 0; i < this.itemList.length; i++) {
|
||||
this.itemList[i].open_value = this.inputData[Number('21681') + i *
|
||||
3]
|
||||
this.itemList[i].close_value = this.inputData[Number('21682') + i *
|
||||
3]
|
||||
}
|
||||
// console.log(this.itemList);
|
||||
|
||||
this.getType('21680')
|
||||
this.getType('21683')
|
||||
this.getType('21686')
|
||||
this.getType('21689')
|
||||
this.getType('21692')
|
||||
this.getType('21680')
|
||||
this.getType('21683')
|
||||
this.getType('21686')
|
||||
this.getType('21689')
|
||||
this.getType('21692')
|
||||
}
|
||||
})
|
||||
}
|
||||
//查看丽水权限
|
||||
if (this.purviewList.indexOf('9') != -1) {
|
||||
this.getControl_getState()
|
||||
this.getReadControlliShuiControl()
|
||||
clearInterval(this.statusInterval) && this.statusInterval
|
||||
this.statusInterval = setInterval(() => {
|
||||
|
||||
this.getControl_getState()
|
||||
|
||||
}, 3000);
|
||||
}
|
||||
}))
|
||||
|
||||
},
|
||||
getReadControlliShuiControl() {
|
||||
var data = {
|
||||
deviceId: this.deviceId
|
||||
};
|
||||
this.$http({
|
||||
url: this.api.getReadControlliShuiControl,
|
||||
data: data,
|
||||
method: 'GET',
|
||||
}).then((res => {
|
||||
this.inputData2 = res.data;
|
||||
this.openIndex = this.inputData2[21600]
|
||||
this.getAct21601()
|
||||
}))
|
||||
},
|
||||
getAct21601() {
|
||||
this.actList1 = []
|
||||
var num = this.inputData2['21601']
|
||||
var num1 = this.padString(num.toString(2), 5)
|
||||
var openListNew = []
|
||||
openListNew = num1.split("")
|
||||
openListNew.forEach((el, index) => {
|
||||
this.actList1.push(openListNew[openListNew.length - index - 1])
|
||||
})
|
||||
},
|
||||
getControl_getState() {
|
||||
var data = {
|
||||
deviceId: this.deviceId
|
||||
};
|
||||
this.$http({
|
||||
url: this.api.getControl_getState,
|
||||
data: data,
|
||||
method: 'GET',
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.fanStatus.open = res.data['1023']
|
||||
this.fanStatus.status = []
|
||||
var num = res.data['1024']
|
||||
var num1 = this.padString(num.toString(2), 5)
|
||||
var openListNew = []
|
||||
openListNew = num1.split("")
|
||||
this.fanStatus.status = openListNew.reverse()
|
||||
this.statusList = []
|
||||
for (var i = 0; i < 4; i++) {
|
||||
var statusData = {
|
||||
name: `顶卷膜${i + 1}`,
|
||||
open: res.data[(1025 + (i * 3))],
|
||||
progress: res.data[(1027 + (i * 3))],
|
||||
index: res.data[(1026 + (i * 3))]
|
||||
}
|
||||
this.statusList.push(statusData)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getNumberStatus(index) {
|
||||
if (index == 0) {
|
||||
return '静止状态'
|
||||
} else if (index == 1) {
|
||||
return '正向打开中'
|
||||
} else if (index == 2) {
|
||||
return '反向关闭中'
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
padString(str, length) {
|
||||
return str.padStart(length, '0');
|
||||
},
|
||||
|
@ -269,7 +628,6 @@
|
|||
};
|
||||
this.change(type, dataNum);
|
||||
},
|
||||
|
||||
change(code, el) {
|
||||
var data = {
|
||||
equipmentId: this.deviceId,
|
||||
|
@ -307,6 +665,7 @@
|
|||
title: res.msg,
|
||||
icon: "success",
|
||||
})
|
||||
this.dataInit()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "失败!",
|
||||
|
@ -477,5 +836,313 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.lishui-item {
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(153, 153, 153, 0.1);
|
||||
border-radius: 20rpx;
|
||||
min-height: 150rpx;
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
.lishui-title {
|
||||
width: 100%;
|
||||
padding: 0 20rpx 0 30rpx;
|
||||
border-bottom: 1rpx solid #DDD;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.title-left {
|
||||
font-size: 34rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.title-right {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #999999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
image {
|
||||
margin-left: 20rpx;
|
||||
width: 16rpx;
|
||||
height: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.status-noTrue {
|
||||
width: 100%;
|
||||
height: 150rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 32rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #999999;
|
||||
|
||||
image {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.lishui-content {
|
||||
padding: 0 30rpx;
|
||||
|
||||
.lishui-set {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
border-bottom: 1rpx solid #DDD;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
>view {
|
||||
padding: 0 35rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
>span {
|
||||
font-weight: bold;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.sel {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.sel-no {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
background: #F5F6FA;
|
||||
border: 2rpx solid #E1E2E6;
|
||||
border-radius: 50%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.lishui-status {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 35rpx 0;
|
||||
|
||||
span {
|
||||
font-size: 34rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #24B383;
|
||||
margin-left: 15rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.lishui-flex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
>view {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 140px;
|
||||
height: 66rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
font-weight: bold;
|
||||
padding: 0 15rpx;
|
||||
white-space: nowrap;
|
||||
|
||||
&.btn-140 {
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
&.btn-110 {
|
||||
width: 110px;
|
||||
}
|
||||
|
||||
&.btn-on {
|
||||
background: linear-gradient(0deg, #54CDA4, #27B584);
|
||||
border-radius: 10rpx;
|
||||
|
||||
span {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
&.btn-off {
|
||||
background: #EFFCF7;
|
||||
border: 2px solid rgba(58, 187, 144, 0.25);
|
||||
border-radius: 10rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
span {
|
||||
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.model-title {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.lishui-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-row-gap: 30rpx; //纵向间隔
|
||||
grid-column-gap: 30rpx; //横向间隔
|
||||
padding: 30rpx 0 35rpx 0;
|
||||
|
||||
.btn {
|
||||
width: 190rpx;
|
||||
height: 66rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
>image {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
|
||||
&.fan-img {
|
||||
animation: rotate 5s linear infinite;
|
||||
/* 持续时间为 5 秒,线性缓动,无限循环 */
|
||||
/* 定义旋转动画 */
|
||||
}
|
||||
|
||||
@keyframes rotate {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
span {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
&.btn-on {
|
||||
background: linear-gradient(0deg, #54CDA4, #27B584);
|
||||
border-radius: 10rpx;
|
||||
|
||||
span {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
&.btn-off {
|
||||
background: #EFFCF7;
|
||||
border: 2px solid rgba(58, 187, 144, 0.25);
|
||||
border-radius: 10rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
span {
|
||||
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/deep/.u-mode-center-box {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.contentPop {
|
||||
width: 100%;
|
||||
min-height: calc(100% - 70rpx);
|
||||
position: relative;
|
||||
|
||||
.contentPop_box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
padding-bottom: 30rpx;
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
height: 91rpx;
|
||||
font-size: 34rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
border-bottom: 1rpx solid #DDDDDD;
|
||||
text-align: center;
|
||||
line-height: 91rpx;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
>image {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
position: absolute;
|
||||
bottom: -70rpx;
|
||||
left: 50%;
|
||||
transform: translate(-50%);
|
||||
}
|
||||
|
||||
.padding-none {
|
||||
padding: unset !important;
|
||||
}
|
||||
|
||||
.lishui-content {
|
||||
.lishui-set {
|
||||
padding: unset;
|
||||
|
||||
>view {
|
||||
padding: 0 15rpx;
|
||||
|
||||
span {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.lishui-grid {
|
||||
padding: 0rpx 30rpx 30rpx;
|
||||
|
||||
>view {
|
||||
width: 175rpx !important;
|
||||
|
||||
span {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -7,7 +7,7 @@
|
|||
<view class="item" v-for="item,index in deviceList" :key="index" v-if="item.equipmentName==10">
|
||||
<image src="../../static/greenhouseDevice.png" mode=""></image>
|
||||
<view class="center">
|
||||
<text>{{item.equipmentName==10 ? item.equipmentStatu+'#'+item.deviceTypeName : ''}}</text>
|
||||
<text>{{item.equipmentName==10 ? item.deviceTypeName : ''}}</text>
|
||||
<text
|
||||
:class="item.deviceState == 1 ? 'state' : 'state_act'">{{ item.deviceState == 1 ? "在线" : "离线"}}</text>
|
||||
</view>
|
||||
|
@ -28,7 +28,8 @@
|
|||
background: {
|
||||
backgroundColor: '#24B383',
|
||||
},
|
||||
deviceList: []
|
||||
deviceList: [],
|
||||
timer:null,
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
|
@ -42,7 +43,14 @@
|
|||
that.getEquipmentInfo(uni.getStorageSync('userid'))
|
||||
}
|
||||
})
|
||||
setInterval(function() {
|
||||
|
||||
},
|
||||
onHide() {
|
||||
clearInterval(this.timer)&&this.timer
|
||||
},
|
||||
onShow() {
|
||||
const that = this
|
||||
this.timer=setInterval(function() {
|
||||
uni.getStorage({
|
||||
key: 'token',
|
||||
success: function(res) {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
title-color='#FFFFFF' :title-bold='true' title-size='32'></u-navbar>
|
||||
|
||||
<view class="content">
|
||||
<view class="item" v-for="item,index in deviceList" :key="index">
|
||||
<view class="item" v-for="item,index in deviceList" :key="index" v-if="item.equipmentName==1">
|
||||
<image src="../../static/icon_precise.png" mode=""></image>
|
||||
<view class="center">
|
||||
<text>{{item.deviceTypeName}}</text>
|
||||
|
|
|
@ -90,6 +90,7 @@
|
|||
valuePHList: [],
|
||||
newValuePHList: [],
|
||||
unit: '',
|
||||
equipmentName:'',
|
||||
|
||||
titleName: '',
|
||||
echartName: ''
|
||||
|
@ -115,6 +116,9 @@
|
|||
this.unit = 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)
|
||||
},
|
||||
|
@ -141,7 +145,7 @@
|
|||
// 获取折线图数据
|
||||
getEchartsData() {
|
||||
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'
|
||||
}).then(res => {
|
||||
// console.log(res, '获取折线图数据');
|
||||
|
|
|
@ -24,16 +24,20 @@
|
|||
欢迎使用温室智慧云数据统计
|
||||
</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">
|
||||
<image src="../../static/PH.png" mode=""></image>
|
||||
<text>{{ item1.deviceTypeName }}</text>
|
||||
</view>
|
||||
<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))">
|
||||
<image :src='`../../static/icon/icon${ (index2 + 1) < 9 ? (index2 + 1) : 1 }.png`' mode=""></image>
|
||||
<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_new/icon${ item2.formula }.png`" mode=""></image>
|
||||
<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>
|
||||
</view>
|
||||
|
@ -193,73 +197,14 @@
|
|||
|
||||
//label是名称 value是code码
|
||||
//countType计算类型 0是原数据 1是原数据-400 2是原数据/10 3是(原数据-400) / 10
|
||||
typeList: [
|
||||
{ label: '无意义的传感器', value: 0, countType: 0 },
|
||||
{ label: '空气温度', value: 1, countType: 3,unit: '℃' },
|
||||
{ label: '空气湿度', value: 2, countType: 2,unit: '%' },
|
||||
{ label: '光亮度', value: 3, countType: 2,unit: 'Klux' },
|
||||
{ label: '二氧化碳', value: 4, countType: 0,unit: 'ppm' },
|
||||
{ label: '土壤温度', value: 5, countType: 3,unit: '℃' },
|
||||
{ label: '土壤湿度', value: 6, countType: 2,unit: '%' },
|
||||
{ label: '水温', value: 7, countType: 3,unit: '℃' },
|
||||
{ label: '水肥PH', value: 8, countType: 2,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: '风向', 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' },
|
||||
],
|
||||
typeList: [],
|
||||
|
||||
timer:null,
|
||||
updateTime:''
|
||||
timer: null,
|
||||
updateTime: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.typeList=this.api.typeList
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
|
@ -297,7 +242,7 @@
|
|||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
let that = this
|
||||
let that = this
|
||||
uni.getStorage({
|
||||
key: 'token',
|
||||
success: function(res) {
|
||||
|
@ -320,9 +265,9 @@
|
|||
success: function(res) {
|
||||
that.getEquipmentInfo(uni.getStorageSync('userid'))
|
||||
},
|
||||
fail:function(err){
|
||||
fail: function(err) {
|
||||
uni.reLaunch({
|
||||
url:'/pages/login/login'
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}
|
||||
})
|
||||
|
@ -341,33 +286,32 @@
|
|||
// console.log(res, '根据用户id查询对应的设备数据');
|
||||
if (res.code == 200) {
|
||||
|
||||
this.waterAndFertilizerParamsList = res.data.map((item,index)=>{
|
||||
this.waterAndFertilizerParamsList = res.data.map((item, index) => {
|
||||
return {
|
||||
...item,
|
||||
childList:[]
|
||||
childList: []
|
||||
}
|
||||
})
|
||||
this.waterAndFertilizerParamsList.forEach((i,index)=>{
|
||||
console.log(i.deviceId,'i.deviceId');
|
||||
if(i.deviceId == 2023042214250018) return
|
||||
this.waterAndFertilizerParamsList.forEach((i, index) => {
|
||||
|
||||
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',
|
||||
}).then(res => {
|
||||
// console.log(res, '主页查看施肥机实时数据');
|
||||
|
||||
if(res.code == 200){
|
||||
if (res.code == 200) {
|
||||
uni.hideLoading({
|
||||
title: '完成'
|
||||
});
|
||||
uni.stopPullDownRefresh();
|
||||
i.childList= res.data;
|
||||
i.childList = res.data;
|
||||
this.updateTime = res.data[0].updateTime
|
||||
// console.log(this.waterAndFertilizerParamsList);
|
||||
}else{
|
||||
} else {
|
||||
|
||||
}
|
||||
}).catch(err=>{
|
||||
}).catch(err => {
|
||||
console.log('接口失败');
|
||||
})
|
||||
})
|
||||
|
@ -377,32 +321,34 @@
|
|||
},
|
||||
|
||||
// 跳转到折线图
|
||||
toTarget_water_fertilizer_PH(id,data,name,equipmentNumber,targetValue,unit){
|
||||
toTarget_water_fertilizer_PH(id, data, name, equipmentNumber, targetValue, unit,equipmentName) {
|
||||
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 = []
|
||||
typeList1 = this.typeList.filter(item=> {
|
||||
return item.value == val
|
||||
typeList1 = this.typeList.filter(item => {
|
||||
return item.value == val
|
||||
})
|
||||
return typeList1[0].unit
|
||||
},
|
||||
|
||||
// 判断是否是平均或者目标,或者是1#
|
||||
getStatus(equipmentNumber,targetValue){
|
||||
if(targetValue == 1){
|
||||
getStatus(equipmentNumber, targetValue) {
|
||||
if (targetValue == 1) {
|
||||
return '目标'
|
||||
}else if(targetValue == 0 && equipmentNumber == 0){
|
||||
} else if (targetValue == 0 && equipmentNumber == 0) {
|
||||
return '1#平均'
|
||||
}else if(targetValue == 0 && equipmentNumber == 15){
|
||||
} else if (targetValue == 0 && equipmentNumber == 15) {
|
||||
return '2#平均'
|
||||
}else if(targetValue == 0 && equipmentNumber != 0 && equipmentNumber != 15){
|
||||
} else if (targetValue == 0 && equipmentNumber != 0 && equipmentNumber != 15) {
|
||||
return equipmentNumber + '#'
|
||||
}
|
||||
}
|
||||
|
@ -547,7 +493,8 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
.updateTime{
|
||||
|
||||
.updateTime {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
|
|
@ -25,5 +25,5 @@
|
|||
"ignore": [],
|
||||
"include": []
|
||||
},
|
||||
"appid": "wx05b45a2699f02a2b"
|
||||
"appid": "wx0518521f67048cc8"
|
||||
}
|
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 909 B |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 6.2 KiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 5.3 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 6.2 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 5.3 KiB |
After Width: | Height: | Size: 5.3 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 6.2 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 146 B |