wszhyWx/pages/controller/controller.vue
2024-01-11 11:55:38 +08:00

3255 lines
94 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<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" v-if="purviewList.indexOf('10')!=-1">
<div class="item">
<u-collapse :accordion='false' :item-style="itemStyle" :head-style='headStyle' ref="collapseView">
<u-collapse-item :title="item.nickName" v-for="(item,index) in itemList" :key="index" align="center"
v-show="isInclude(item)">
<view class="collapseItem">
<view class="line"></view>
<view class="control_model">
<view class="control">
控制模式:
</view>
<view class="model">
<text @click="change00(item.type,1)"
:class="getTypeRoll(item.type)==1?'txt_act':'txt'">打&nbsp;&nbsp;&nbsp;开</text>
<text @click="change00(item.type,2)"
:class="getTypeRoll(item.type)==2?'txt_act':'txt'">{{ item.type_2 ? '关&nbsp;&nbsp;&nbsp;闭' : '停&nbsp;&nbsp;&nbsp;止' }}</text>
<text @click="change00(item.type,3)" v-if="!item.type_2"
:class="getTypeRoll(item.type)==3?'txt_act':'txt'">关&nbsp;&nbsp;&nbsp;闭</text>
</view>
<view class="line1"></view>
<view class="roll_input" v-if="!item.type_2">
<view class="">
<view class="">
<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"
placeholder="0">
</view>
<text>通道关闭</text>
</view>
</view>
<view class="roll_input" v-else>
<view class="">
<view class="">
<input v-model="item.value"
@blur="blurChangeData00_1(item.type+1,$event)" type="number"
placeholder="0">
</view>
<text>通道;</text>
</view>
</view>
</view>
</view>
</u-collapse-item>
</u-collapse>
</div>
</view>
<!-- 丽水权限 -->
<view class="content" v-if="purviewList.indexOf('9')!=-1">
<view class="lishui-item" v-if="fanStatus.open != 0">
<view class="lishui-title">
<view class="title-left">
{{ fanStatus.name }}
</view>
<view class="title-right" @click="fanmodelHander">
设置
<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>
<template v-for="item, index in statusList">
<view class="lishui-item" v-if="item.open != 0" :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>
</template>
</view>
<!-- 东北五防 -->
<view class="content" v-if="purviewList.indexOf('8')!=-1">
<template v-for="(item,index) in fiveControlList">
<view class="lishui-item" v-if="item.controlState != 0" :key="index">
<view class="lishui-title">
<view class="title-left">
{{ item.title }}
</view>
<view class="title-right" @click="openFiveControlShow(index)">
设置
<image src="../../static/set-arrow.png" mode=""></image>
</view>
</view>
<view class="lishui-content" v-if="item.controlState != 0">
<view class="lishui-set">
<view class="set-1">
<image v-if="item.controlState == 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.controlState != 1" class="sel" src="../../static/sel.png" mode=""></image>
<view v-else class="sel-no"></view>
<span>手机控制</span>
</view>
</view>
<view class="lishui-status" v-if="Number(item.progress) == ''">
静止状态:
<span>{{ item.progress }}%</span>
</view>
</view>
<view v-else class="status-noTrue">
<image src="../../static/noTrue.png" mode=""></image>
<span>当前设备无效</span>
</view>
</view>
</template>
</view>
<!-- 补光灯 -->
<view class="content" v-if="purviewList.indexOf('20')!=-1">
<view class="lishui-item" v-if="supplementLightStatus.open != 0">
<view class="lishui-title">
<view class="title-left">
补光灯
</view>
<view class="title-right" @click="supplementLightHander">
设置
<image src="../../static/set-arrow.png" mode=""></image>
</view>
</view>
<view class="lishui-content" v-if="supplementLightStatus.open != 0">
<view class="lishui-set">
<view class="set-1">
<image v-if="supplementLightStatus.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="supplementLightStatus.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" style="grid-template-columns: repeat(4, 1fr);grid-row-gap: 20rpx;grid-column-gap: 20rpx;">
<view class="btn " :class="supplementLightStatus.status[0] == 1 ? 'btn-on' : 'btn-off'" style="width: 140rpx;height: 66rpx;">
<image class="fan-img" v-if="supplementLightStatus.status[0] == 1" src="../../static/supplementLight.png" alt="" style="width: 26rpx;height: 24rpx;animation: unset;">
</image>
<image v-else src="../../static/fan-off.png" alt="" style="width: 20rpx;height: 20rpx;"></image>
<span style="font-size: 22rpx;margin-left: 5rpx;">1#补光灯</span>
</view>
<view class="btn" :class="supplementLightStatus.status[1] == 1 ? 'btn-on' : 'btn-off'" style="width: 140rpx;height: 66rpx;">
<image class="fan-img" v-if="supplementLightStatus.status[1] == 1" src="../../static/supplementLight.png" alt="" style="width: 26rpx;height: 24rpx;animation: unset;">
</image>
<image v-else src="../../static/fan-off.png" alt="" style="width: 20rpx;height: 20rpx;"></image>
<span style="font-size: 22rpx;margin-left: 5rpx;">2#补光灯</span>
</view>
<view class="btn" :class="supplementLightStatus.status[2] == 1 ? 'btn-on' : 'btn-off'" style="width: 140rpx;height: 66rpx;">
<image class="fan-img" v-if="supplementLightStatus.status[2] == 1" src="../../static/supplementLight.png" alt="" style="width: 26rpx;height: 24rpx;animation: unset;">
</image>
<image v-else src="../../static/fan-off.png" alt="" style="width: 20rpx;height: 20rpx;"></image>
<span style="font-size: 22rpx;margin-left: 5rpx;">3#补光灯</span>
</view>
<view class="btn" :class="supplementLightStatus.status[3] == 1 ? 'btn-on' : 'btn-off'" style="width: 140rpx;height: 66rpx;">
<image class="fan-img" v-if="supplementLightStatus.status[3] == 1" src="../../static/supplementLight.png" alt="" style="width: 26rpx;height: 24rpx;animation: unset;">
</image>
<image v-else src="../../static/fan-off.png" alt="" style="width: 20rpx;height: 20rpx;"></image>
<span style="font-size: 22rpx;margin-left: 5rpx;">4#补光灯</span>
</view>
<view class="btn" :class="supplementLightStatus.status[4] == 1 ? 'btn-on' : 'btn-off'" style="width: 140rpx;height: 66rpx;">
<image class="fan-img" v-if="supplementLightStatus.status[4] == 1" src="../../static/supplementLight.png" alt="" style="width: 26rpx;height: 24rpx;animation: unset;">
</image>
<image v-else src="../../static/fan-off.png" alt="" style="width: 20rpx;height: 20rpx;"></image>
<span style="font-size: 22rpx;margin-left: 5rpx;">5#补光灯</span>
</view>
<view class="btn" :class="supplementLightStatus.status[5] == 1 ? 'btn-on' : 'btn-off'" style="width: 140rpx;height: 66rpx;">
<image class="fan-img" v-if="supplementLightStatus.status[5] == 1" src="../../static/supplementLight.png" alt="" style="width: 26rpx;height: 24rpx;animation: unset;">
</image>
<image v-else src="../../static/fan-off.png" alt="" style="width: 20rpx;height: 20rpx;"></image>
<span style="font-size: 22rpx;margin-left: 5rpx;">6#补光灯</span>
</view>
<view class="btn" :class="supplementLightStatus.status[6] == 1 ? 'btn-on' : 'btn-off'" style="width: 140rpx;height: 66rpx;">
<image class="fan-img" v-if="supplementLightStatus.status[6] == 1" src="../../static/supplementLight.png" alt="" style="width: 26rpx;height: 24rpx;animation: unset;">
</image>
<image v-else src="../../static/fan-off.png" alt="" style="width: 20rpx;height: 20rpx;"></image>
<span style="font-size: 22rpx;margin-left: 5rpx;">7#补光灯</span>
</view>
<view class="btn" :class="supplementLightStatus.status[7] == 1 ? 'btn-on' : 'btn-off'" style="width: 140rpx;height: 66rpx;">
<image class="fan-img" v-if="supplementLightStatus.status[7] == 1" src="../../static/supplementLight.png" alt="" style="width: 26rpx;height: 24rpx;animation: unset;">
</image>
<image v-else src="../../static/fan-off.png" alt="" style="width: 20rpx;height: 20rpx;"></image>
<span style="font-size: 22rpx;margin-left: 5rpx;">8#补光灯</span>
</view>
</view>
</view>
<view v-else class="status-noTrue">
<image src="../../static/noTrue.png" mode=""></image>
<span>当前设备无效</span>
</view>
</view>
</view>
<!-- 环流风扇 -->
<view class="content" v-if="purviewList.indexOf('21')!=-1">
<template v-for="(item,index) in circulationFengshanList">
<view class="lishui-item" v-if="item.circulationFengshanState != 0" :key="index">
<view class="lishui-title">
<view class="title-left">
{{ item.name }}
</view>
<view class="title-right" @click="circulationFengshanHander(index)">
设置
<image src="../../static/set-arrow.png" mode=""></image>
</view>
</view>
<view class="lishui-content" v-if="item.circulationFengshanState != 0">
<view class="lishui-set">
<view class="set-1">
<image v-if="item.circulationFengshanState == 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.circulationFengshanState != 1" class="sel" src="../../static/sel.png" mode=""></image>
<view v-else class="sel-no"></view>
<span>手机控制</span>
</view>
</view>
<view class="lishui-status">
<view class="btn" :class="item.open == 1 ? 'btn-on' : 'btn-off'">
<image class="fan-img" v-if="item.open == 1" src="../../static/fan-on.png" alt="">
</image>
<image v-else src="../../static/fan-off.png" alt=""></image>
<span>{{item.open == 1 ? '打开' : '关闭'}}</span>
</view>
</view>
</view>
<view v-else class="status-noTrue">
<image src="../../static/noTrue.png" mode=""></image>
<span>当前设备无效</span>
</view>
</view>
</template>
</view>
<!-- 标准风机 -->
<view class="content" v-if="purviewList.indexOf('26')!=-1">
<view class="lishui-item" v-if="standardFanStatus.open != 0">
<view class="lishui-title">
<view class="title-left">
{{ standardFanStatus.name }}
</view>
<view class="title-right" @click="standardFanmodelHander">
设置
<image src="../../static/set-arrow.png" mode=""></image>
</view>
</view>
<view class="lishui-content" v-if="standardFanStatus.open != 0">
<view class="lishui-set">
<view class="set-1">
<image v-if="standardFanStatus.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="standardFanStatus.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="standardFanStatus.status[0] == 1 ? 'btn-on' : 'btn-off'">
<image class="fan-img" v-if="standardFanStatus.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="standardFanStatus.status[1] == 1 ? 'btn-on' : 'btn-off'">
<image class="fan-img" v-if="standardFanStatus.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="standardFanStatus.status[2] == 1 ? 'btn-on' : 'btn-off'">
<image class="fan-img" v-if="standardFanStatus.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="standardFanStatus.status[3] == 1 ? 'btn-on' : 'btn-off'">
<image class="fan-img" v-if="standardFanStatus.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="standardFanStatus.status[4] == 1 ? 'btn-on' : 'btn-off'">
<image class="fan-img" v-if="standardFanStatus.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>
<!-- 湿帘泵 -->
<view class="content" v-if="purviewList.indexOf('26')!=-1">
<template v-for="(item,index) in fanwetcurtainList">
<view class="lishui-item" v-if="item.fanwetcurtainState != 0" :key="index">
<view class="lishui-title">
<view class="title-left">
{{ item.name }}
</view>
<view class="title-right" @click="fanwetcurtainHander(index)">
设置
<image src="../../static/set-arrow.png" mode=""></image>
</view>
</view>
<view class="lishui-content" v-if="item.fanwetcurtainState != 0">
<view class="lishui-set">
<view class="set-1">
<image v-if="item.fanwetcurtainState == 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.fanwetcurtainState != 1" class="sel" src="../../static/sel.png" mode=""></image>
<view v-else class="sel-no"></view>
<span>手机控制</span>
</view>
</view>
<view class="lishui-status">
<view class="btn" :class="item.open == 1 ? 'btn-on' : 'btn-off'">
<image class="fan-img" v-if="item.open == 1" src="../../static/fanwetcurtain.png" alt="" style="animation: unset;">
</image>
<image v-else src="../../static/fan-off.png" alt=""></image>
<span>{{item.open == 1 ? '打开' : '关闭'}}</span>
</view>
</view>
</view>
<view v-else class="status-noTrue">
<image src="../../static/noTrue.png" mode=""></image>
<span>当前设备无效</span>
</view>
</view>
</template>
</view>
<!-- 高压微雾 -->
<view class="content" v-if="purviewList.indexOf('23')!=-1">
<template v-for="(item,index) in highpressuremistList">
<view class="lishui-item" v-if="item.highpressuremistState != 0" :key="index">
<view class="lishui-title">
<view class="title-left">
{{ item.name }}
</view>
<view class="title-right" @click="highpressuremistHander(index)">
设置
<image src="../../static/set-arrow.png" mode=""></image>
</view>
</view>
<view class="lishui-content" v-if="item.highpressuremistState != 0">
<view class="lishui-set">
<view class="set-1">
<image v-if="item.highpressuremistState == 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.highpressuremistState != 1" class="sel" src="../../static/sel.png" mode=""></image>
<view v-else class="sel-no"></view>
<span>手机控制</span>
</view>
</view>
<view class="lishui-status">
<view class="btn" :class="item.open == 1 ? 'btn-on' : 'btn-off'">
<image class="fan-img" v-if="item.open == 1" src="../../static/highpressuremist.png" alt="" style="animation: unset;width: 34rpx;height: 29rpx;">
</image>
<image v-else src="../../static/fan-off.png" alt=""></image>
<span>{{item.open == 1 ? '打开' : '关闭'}}</span>
</view>
</view>
</view>
<view v-else class="status-noTrue">
<image src="../../static/noTrue.png" mode=""></image>
<span>当前设备无效</span>
</view>
</view>
</template>
</view>
<!-- #湿窗外翻窗 -->
<view class="content" v-if="purviewList.indexOf('26')!=-1">
<template v-for="(item,index) in outFlipWindowList">
<view class="lishui-item" v-if="item.outFlipWindowState != 0" :key="index">
<view class="lishui-title">
<view class="title-left">
{{ item.name }}
</view>
<view class="title-right" @click="outFlipWindowHander(index)">
设置
<image src="../../static/set-arrow.png" mode=""></image>
</view>
</view>
<view class="lishui-content" v-if="item.outFlipWindowState != 0">
<view class="lishui-set">
<view class="set-1">
<image v-if="item.outFlipWindowState == 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.outFlipWindowState != 1" class="sel" src="../../static/sel.png" mode=""></image>
<view v-else class="sel-no"></view>
<span>手机控制</span>
</view>
</view>
<view class="lishui-status">
静止状态:
<span :style="item.progress!=100 ? 'color:#FF6C6C' : ''">{{ item.progress }}%</span>
</view>
</view>
<view v-else class="status-noTrue">
<image src="../../static/noTrue.png" mode=""></image>
<span>当前设备无效</span>
</view>
</view>
</template>
</view>
<!-- 内遮阳 -->
<view class="content" v-if="purviewList.indexOf('24')!=-1">
<template v-for="(item,index) in innercurtainList">
<view class="lishui-item" v-if="item.innercurtainState != 0" :key="index">
<view class="lishui-title">
<view class="title-left">
{{ item.name }}
</view>
<view class="title-right" @click="innercurtainHander(index)">
设置
<image src="../../static/set-arrow.png" mode=""></image>
</view>
</view>
<view class="lishui-content" v-if="item.innercurtainState != 0">
<view class="lishui-set">
<view class="set-1">
<image v-if="item.innercurtainState == 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.innercurtainState != 1" class="sel" src="../../static/sel.png" mode=""></image>
<view v-else class="sel-no"></view>
<span>手机控制</span>
</view>
</view>
<view class="lishui-status">
静止状态:
<span :style="item.progress!=100 ? 'color:#FF6C6C' : ''">{{ item.progress }}%</span>
</view>
</view>
<view v-else class="status-noTrue">
<image src="../../static/noTrue.png" mode=""></image>
<span>当前设备无效</span>
</view>
</view>
</template>
</view>
<!-- 外遮阳 -->
<view class="content" v-if="purviewList.indexOf('25')!=-1">
<template v-for="(item,index) in externalsunshadeList">
<view class="lishui-item" v-if="item.externalsunshadeState != 0" :key="index">
<view class="lishui-title">
<view class="title-left">
{{ item.name }}
</view>
<view class="title-right" @click="externalsunshadeHander(index)">
设置
<image src="../../static/set-arrow.png" mode=""></image>
</view>
</view>
<view class="lishui-content" v-if="item.externalsunshadeState != 0">
<view class="lishui-set">
<view class="set-1">
<image v-if="item.externalsunshadeState == 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.externalsunshadeState != 1" class="sel" src="../../static/sel.png" mode=""></image>
<view v-else class="sel-no"></view>
<span>手机控制</span>
</view>
</view>
<view class="lishui-status">
静止状态:
<span :style="item.progress!=100 ? 'color:#FF6C6C' : ''">{{ item.progress }}%</span>
</view>
</view>
<view v-else class="status-noTrue">
<image src="../../static/noTrue.png" mode=""></image>
<span>当前设备无效</span>
</view>
</view>
</template>
</view>
<!-- 通风窗 -->
<view class="content" v-if="purviewList.indexOf('19')!=-1">
<template v-for="(item,index) in airWindowList">
<view class="lishui-item" v-if="item.airWindowState != 0" :key="index">
<view class="lishui-title">
<view class="title-left">
{{ item.name }}
</view>
<view class="title-right" @click="airWindowHander(index)">
设置
<image src="../../static/set-arrow.png" mode=""></image>
</view>
</view>
<view class="lishui-content" v-if="item.airWindowState != 0">
<view class="lishui-set">
<view class="set-1">
<image v-if="item.airWindowState == 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.airWindowState != 1" class="sel" src="../../static/sel.png" mode=""></image>
<view v-else class="sel-no"></view>
<span>手机控制</span>
</view>
</view>
<view class="lishui-status">
静止状态:
<span :style="item.progress!=100 ? 'color:#FF6C6C' : ''">{{ item.progress }}%</span>
</view>
</view>
<view v-else class="status-noTrue">
<image src="../../static/noTrue.png" mode=""></image>
<span>当前设备无效</span>
</view>
</view>
</template>
</view>
<!-- *#电磁阀 -->
<view class="content">
<view v-for="(item,index) in 8" :key="index">
<view class="valve" v-if="purviewList.indexOf((index + 11).toString())!=-1">
<image src="../../static/valve.png" mode=""></image>
<span>{{index+1}}#电磁阀</span>
<view @click="openValveControlShow(index)">
设置
<image src="../../static/right-arrow.png" mode=""></image>
</view>
</view>
</view>
</view>
<!-- 东北五防弹框 -->
<u-popup v-model="fiveControlShow" mode="center" :mask-close-able='true' width="640rpx" height="454rpx"
:closeable='false'>
<view class="contentPop lishui-item">
<view class="contentPop_box">
<view class="title">
{{ pop_title }}
</view>
</view>
<view class="lishui-content">
<view class="model-title">
控制模式:
</view>
<view class="lishui-flex">
<view class="btn btn-140 " @click="changefiveControl(1)"
:class="fiveControlIndex==1?'btn-on':'btn-off'">
<span>自动运行</span>
</view>
<view class="btn btn-140 " @click="changefiveControl(2)"
:class="fiveControlIndex==2?'btn-on':'btn-off'">
<span>手动打开</span>
</view>
<view class="btn btn-140 " @click="changefiveControl(3)"
:class="fiveControlIndex==3?'btn-on':'btn-off'">
<span>手动关闭</span>
</view>
<view class="btn btn-110 " @click="changefiveControl(4)"
:class="fiveControlIndex==4?'btn-on':'btn-off'" v-if="close_btn_all">
<span>停止</span>
</view>
</view>
</view>
<view class="changeMoreBtn" @click="toWebView(fiveControlUrl)">
<image src="../../static/changeMore.png" mode=""></image>
<text>修改更多参数</text>
</view>
<image src="../../static/closed.png" mode="" @click="fiveControlShow=false"></image>
</view>
</u-popup>
<!-- 顶卷膜弹框 -->
<u-popup v-model="modelShow" mode="center" :mask-close-able='true' width="640rpx" height="454rpx"
: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>
<view class="changeMoreBtn" @click="toWebView('skylight')">
<image src="../../static/changeMore.png" mode=""></image>
<text>修改更多参数</text>
</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="654rpx"
: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 class="changeMoreBtn" @click="toWebView('fan')">
<image src="../../static/changeMore.png" mode=""></image>
<text>修改更多参数</text>
</view>
</view>
<image src="../../static/closed.png" mode="" @click="fanmodelShow=false"></image>
</view>
</u-popup>
<!-- 标准风机弹框 -->
<u-popup v-model="standardFanmodelShow" mode="center" :mask-close-able='true' width="640rpx" height="654rpx"
:closeable='false'>
<view class="contentPop lishui-item">
<view class="contentPop_box padding-none">
<view class="title">
{{standardFanStatus.name}}
</view>
</view>
<view class="lishui-content padding-none">
<view class="lishui-set">
<view class="set-1" @click="changeStandardFanOpen(1)">
<image v-if="standardFanOpenIndex == 1" class="sel" src="../../static/sel.png" mode=""></image>
<view v-else class="sel-no"></view>
<span>自动运行</span>
</view>
<view class="set-2" @click="changeStandardFanOpen(2)">
<image v-if="standardFanOpenIndex == 2" class="sel" src="../../static/sel.png" mode=""></image>
<view v-else class="sel-no"></view>
<span>手动打开</span>
</view>
<view class="set-3" @click="changeStandardFanOpen(3)">
<image v-if="standardFanOpenIndex == 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="changeStandardFanIndexOpen(0)" :class="standardFanActList1[0]=='1'?'btn-on':'btn-off'">
<span>一号风机</span>
</view>
<view class="btn" @click="changeStandardFanIndexOpen(1)" :class="standardFanActList1[1]=='1'?'btn-on':'btn-off'">
<span>二号风机</span>
</view>
<view class="btn" @click="changeStandardFanIndexOpen(2)" :class="standardFanActList1[2]=='1'?'btn-on':'btn-off'">
<span>三号风机</span>
</view>
<view class="btn" @click="changeStandardFanIndexOpen(3)" :class="standardFanActList1[3]=='1'?'btn-on':'btn-off'">
<span>四号风机</span>
</view>
<view class="btn" @click="changeStandardFanIndexOpen(4)" :class="standardFanActList1[4]=='1'?'btn-on':'btn-off'">
<span>五号风机</span>
</view>
</view>
<view class="changeMoreBtn" @click="toWebView('wetFan')">
<image src="../../static/changeMore.png" mode=""></image>
<text>修改更多参数</text>
</view>
</view>
<image src="../../static/closed.png" mode="" @click="standardFanmodelShow=false"></image>
</view>
</u-popup>
<!-- *#电磁阀弹框 -->
<u-popup v-model="valveControlShow" mode="center" :mask-close-able='true' width="640rpx" height="610rpx"
:closeable='false'>
<view class="contentPop lishui-item">
<view class="contentPop_box">
<view class="title">
{{ valvePopTitle }}
</view>
</view>
<view class="lishui-content">
<view class="model-title">
控制模式:
</view>
<view class="lishui-flex">
<view class="btn btn-140 " @click="changeValveControl(1)"
:class="valveControlIndex==1?'btn-on':'btn-off'">
<span>自动运行</span>
</view>
<view class="btn btn-140 " @click="changeValveControl(2)"
:class="valveControlIndex==2?'btn-on':'btn-off'">
<span>手动启动</span>
</view>
<view class="btn btn-140 " @click="changeValveControl(3)"
:class="valveControlIndex==3?'btn-on':'btn-off'">
<span>手动关闭</span>
</view>
</view>
<view class="input_value">
手动启动时间<input v-model="valve_input_value" type="number" placeholder="0" @blur='changeValveInput'/>min
</view>
</view>
<view class="changeMoreBtn" @click="toWebView1('electromagneticControl')">
<image src="../../static/changeMore.png" mode=""></image>
<text>修改更多参数</text>
</view>
<image src="../../static/closed.png" mode="" @click="valveControlShow=false"></image>
</view>
</u-popup>
<!-- 补光灯弹框 -->
<u-popup v-model="supplementLightShow" mode="center" :mask-close-able='true' width="640rpx" height="770rpx"
:closeable='false'>
<view class="contentPop lishui-item">
<view class="contentPop_box padding-none">
<view class="title">
补光灯
</view>
</view>
<view class="lishui-content padding-none">
<view class="model-title" style="margin: 30rpx 0 30rpx 30rpx;">
控制模式:
</view>
<view class="lishui-flex" style="box-sizing: border-box;padding: 0 30rpx;">
<view class="btn btn-140 " @click="changeLightControl(1)"
:class="lightControlIndex==1?'btn-on':'btn-off'">
<span>自动运行</span>
</view>
<view class="btn btn-140 " @click="changeLightControl(2)"
:class="lightControlIndex==2?'btn-on':'btn-off'">
<span>手动启动</span>
</view>
<view class="btn btn-140 " @click="changeLightControl(3)"
:class="lightControlIndex==3?'btn-on':'btn-off'">
<span>手动关闭</span>
</view>
</view>
<view class="" style="width: 100%;height: 1rpx;background: #DDDDDD;margin-top: 30rpx;"></view>
<view class="model-title" style="padding:30rpx 0 0 30rpx;">
手动打开时开几号补光灯
</view>
<view class="lishui-grid" style="grid-template-columns: repeat(4, 1fr);grid-row-gap: 20rpx;grid-column-gap: 20rpx;">
<view class="btn" @click="changeLightOpen(0)" :class="actListLight[0]=='1'?'btn-on':'btn-off'" style="width: 130rpx !important;height: 66rpx;">
<span style="font-size: 24rpx;">1#补光灯</span>
</view>
<view class="btn" @click="changeLightOpen(1)" :class="actListLight[1]=='1'?'btn-on':'btn-off'" style="width: 130rpx !important;height: 66rpx;">
<span style="font-size: 24rpx;">2#补光灯</span>
</view>
<view class="btn" @click="changeLightOpen(2)" :class="actListLight[2]=='1'?'btn-on':'btn-off'" style="width: 130rpx !important;height: 66rpx;">
<span style="font-size: 24rpx;">3#补光灯</span>
</view>
<view class="btn" @click="changeLightOpen(3)" :class="actListLight[3]=='1'?'btn-on':'btn-off'" style="width: 130rpx !important;height: 66rpx;">
<span style="font-size: 24rpx;">4#补光灯</span>
</view>
<view class="btn" @click="changeLightOpen(4)" :class="actListLight[4]=='1'?'btn-on':'btn-off'" style="width: 130rpx !important;height: 66rpx;">
<span style="font-size: 24rpx;">5#补光灯</span>
</view>
<view class="btn" @click="changeLightOpen(5)" :class="actListLight[5]=='1'?'btn-on':'btn-off'" style="width: 130rpx !important;height: 66rpx;">
<span style="font-size: 24rpx;">6#补光灯</span>
</view>
<view class="btn" @click="changeLightOpen(6)" :class="actListLight[6]=='1'?'btn-on':'btn-off'" style="width: 130rpx !important;height: 66rpx;">
<span style="font-size: 24rpx;">7#补光灯</span>
</view>
<view class="btn" @click="changeLightOpen(7)" :class="actListLight[7]=='1'?'btn-on':'btn-off'" style="width: 130rpx !important;height: 66rpx;">
<span style="font-size: 24rpx;">8#补光灯</span>
</view>
</view>
<view class="" style="width: 100%;height: 1rpx;background: #DDDDDD;margin-top: 30rpx;"></view>
<view class="changeMoreBtn" @click="toWebView('LED')">
<image src="../../static/changeMore.png" mode=""></image>
<text>修改更多参数</text>
</view>
</view>
<image src="../../static/closed.png" mode="" @click="supplementLightShow=false"></image>
</view>
</u-popup>
<!-- 环流风扇弹框 -->
<u-popup v-model="circulationFengshanShow" mode="center" :mask-close-able='true' width="640rpx" height="454rpx"
:closeable='false'>
<view class="contentPop lishui-item">
<view class="contentPop_box">
<view class="title">
{{ (popCirculationFengshanName + 1)+"#环流风扇" }}
</view>
</view>
<view class="lishui-content">
<view class="model-title">
控制模式:
</view>
<view class="lishui-flex">
<view class="btn btn-140 " @click="changeCirculationControl(1)"
:class="circulationControlIndex==1?'btn-on':'btn-off'">
<span>自动运行</span>
</view>
<view class="btn btn-140 " @click="changeCirculationControl(2)"
:class="circulationControlIndex==2?'btn-on':'btn-off'">
<span>手动打开</span>
</view>
<view class="btn btn-140 " @click="changeCirculationControl(3)"
:class="circulationControlIndex==3?'btn-on':'btn-off'">
<span>手动关闭</span>
</view>
</view>
</view>
<view class="changeMoreBtn" @click="toWebView('circulationCan')">
<image src="../../static/changeMore.png" mode=""></image>
<text>修改更多参数</text>
</view>
<image src="../../static/closed.png" mode="" @click="circulationFengshanShow=false"></image>
</view>
</u-popup>
<!-- 湿帘泵弹框 -->
<u-popup v-model="fanwetcurtainShow" mode="center" :mask-close-able='true' width="640rpx" height="454rpx"
:closeable='false'>
<view class="contentPop lishui-item">
<view class="contentPop_box">
<view class="title">
{{ (popfanwetcurtainName + 1)+"#湿帘泵" }}
</view>
</view>
<view class="lishui-content">
<view class="model-title">
控制模式:
</view>
<view class="lishui-flex">
<view class="btn btn-140 " @click="changefanwetcurtainControl(1)"
:class="fanwetcurtainControlIndex==1?'btn-on':'btn-off'">
<span>自动运行</span>
</view>
<view class="btn btn-140 " @click="changefanwetcurtainControl(2)"
:class="fanwetcurtainControlIndex==2?'btn-on':'btn-off'">
<span>手动打开</span>
</view>
<view class="btn btn-140 " @click="changefanwetcurtainControl(3)"
:class="fanwetcurtainControlIndex==3?'btn-on':'btn-off'">
<span>手动关闭</span>
</view>
</view>
</view>
<view class="changeMoreBtn" @click="toWebView('wetFan')">
<image src="../../static/changeMore.png" mode=""></image>
<text>修改更多参数</text>
</view>
<image src="../../static/closed.png" mode="" @click="fanwetcurtainShow=false"></image>
</view>
</u-popup>
<!-- 高压微雾弹框 -->
<u-popup v-model="highpressuremistShow" mode="center" :mask-close-able='true' width="640rpx" height="454rpx"
:closeable='false'>
<view class="contentPop lishui-item">
<view class="contentPop_box">
<view class="title">
{{ (pophighpressuremistName + 1)+"#高压微雾" }}
</view>
</view>
<view class="lishui-content">
<view class="model-title">
控制模式:
</view>
<view class="lishui-flex">
<view class="btn btn-140 " @click="changehighpressuremistControl(1)"
:class="highpressuremistControlIndex==1?'btn-on':'btn-off'">
<span>自动运行</span>
</view>
<view class="btn btn-140 " @click="changehighpressuremistControl(2)"
:class="highpressuremistControlIndex==2?'btn-on':'btn-off'">
<span>手动打开</span>
</view>
<view class="btn btn-140 " @click="changehighpressuremistControl(3)"
:class="highpressuremistControlIndex==3?'btn-on':'btn-off'">
<span>手动关闭</span>
</view>
</view>
</view>
<view class="changeMoreBtn" @click="toWebView('coercionMist')">
<image src="../../static/changeMore.png" mode=""></image>
<text>修改更多参数</text>
</view>
<image src="../../static/closed.png" mode="" @click="highpressuremistShow=false"></image>
</view>
</u-popup>
<!-- 湿帘外翻窗弹框 -->
<u-popup v-model="outFlipWindowShow" mode="center" :mask-close-able='true' width="640rpx" height="454rpx"
:closeable='false'>
<view class="contentPop lishui-item">
<view class="contentPop_box">
<view class="title">
{{ (popoutFlipWindowName + 1)+"#湿帘外翻窗" }}
</view>
</view>
<view class="lishui-content">
<view class="model-title">
控制模式:
</view>
<view class="lishui-flex">
<view class="btn btn-140 " @click="changeoutFlipWindowControl(1)"
:class="outFlipWindowControlIndex==1?'btn-on':'btn-off'">
<span style="font-size: 28rpx;">自动运行</span>
</view>
<view class="btn btn-140 " @click="changeoutFlipWindowControl(2)"
:class="outFlipWindowControlIndex==2?'btn-on':'btn-off'">
<span style="font-size: 28rpx;">手动打开</span>
</view>
<view class="btn btn-140 " @click="changeoutFlipWindowControl(3)"
:class="outFlipWindowControlIndex==3?'btn-on':'btn-off'">
<span style="font-size: 28rpx;">手动关闭</span>
</view>
<view class="btn btn-110 " @click="changeoutFlipWindowControl(4)"
:class="outFlipWindowControlIndex==4?'btn-on':'btn-off'">
<span style="font-size: 28rpx;">停止</span>
</view>
</view>
</view>
<view class="changeMoreBtn" @click="toWebView('wetFan')">
<image src="../../static/changeMore.png" mode=""></image>
<text>修改更多参数</text>
</view>
<image src="../../static/closed.png" mode="" @click="outFlipWindowShow=false"></image>
</view>
</u-popup>
<!-- 内遮阳 -->
<u-popup v-model="innercurtainShow" mode="center" :mask-close-able='true' width="640rpx" height="454rpx"
:closeable='false'>
<view class="contentPop lishui-item">
<view class="contentPop_box">
<view class="title">
{{ (popinnercurtainName + 1)+"#内遮阳" }}
</view>
</view>
<view class="lishui-content">
<view class="model-title">
控制模式:
</view>
<view class="lishui-flex">
<view class="btn btn-140 " @click="changeinnercurtainControl(1)"
:class="innercurtainControlIndex==1?'btn-on':'btn-off'">
<span style="font-size: 28rpx;">自动运行</span>
</view>
<view class="btn btn-140 " @click="changeinnercurtainControl(2)"
:class="innercurtainControlIndex==2?'btn-on':'btn-off'">
<span style="font-size: 28rpx;">手动打开</span>
</view>
<view class="btn btn-140 " @click="changeinnercurtainControl(3)"
:class="innercurtainControlIndex==3?'btn-on':'btn-off'">
<span style="font-size: 28rpx;">手动关闭</span>
</view>
<view class="btn btn-110 " @click="changeinnercurtainControl(4)"
:class="innercurtainControlIndex==4?'btn-on':'btn-off'">
<span style="font-size: 28rpx;">停止</span>
</view>
</view>
</view>
<view class="changeMoreBtn" @click="toWebView('insizeSunshade')">
<image src="../../static/changeMore.png" mode=""></image>
<text>修改更多参数</text>
</view>
<image src="../../static/closed.png" mode="" @click="innercurtainShow=false"></image>
</view>
</u-popup>
<!-- 外遮阳 -->
<u-popup v-model="externalsunshadeShow" mode="center" :mask-close-able='true' width="640rpx" height="454rpx"
:closeable='false'>
<view class="contentPop lishui-item">
<view class="contentPop_box">
<view class="title">
{{ (popexternalsunshadeName + 1)+"#外遮阳" }}
</view>
</view>
<view class="lishui-content">
<view class="model-title">
控制模式:
</view>
<view class="lishui-flex">
<view class="btn btn-140 " @click="changeexternalsunshadeControl(1)"
:class="externalsunshadeControlIndex==1?'btn-on':'btn-off'">
<span style="font-size: 28rpx;">自动运行</span>
</view>
<view class="btn btn-140 " @click="changeexternalsunshadeControl(2)"
:class="externalsunshadeControlIndex==2?'btn-on':'btn-off'">
<span style="font-size: 28rpx;">手动打开</span>
</view>
<view class="btn btn-140 " @click="changeexternalsunshadeControl(3)"
:class="externalsunshadeControlIndex==3?'btn-on':'btn-off'">
<span style="font-size: 28rpx;">手动关闭</span>
</view>
<view class="btn btn-110 " @click="changeexternalsunshadeControl(4)"
:class="externalsunshadeControlIndex==4?'btn-on':'btn-off'">
<span style="font-size: 28rpx;">停止</span>
</view>
</view>
</view>
<view class="changeMoreBtn" @click="toWebView('outsizeSunshade')">
<image src="../../static/changeMore.png" mode=""></image>
<text>修改更多参数</text>
</view>
<image src="../../static/closed.png" mode="" @click="externalsunshadeShow=false"></image>
</view>
</u-popup>
<!-- 通风窗 -->
<u-popup v-model="airWindowShow" mode="center" :mask-close-able='true' width="640rpx" height="454rpx"
:closeable='false'>
<view class="contentPop lishui-item">
<view class="contentPop_box">
<view class="title">
{{ (popairWindowName + 1)+"#通风窗" }}
</view>
</view>
<view class="lishui-content">
<view class="model-title">
控制模式:
</view>
<view class="lishui-flex">
<view class="btn btn-140 " @click="changeairWindowControl(1)"
:class="airWindowControlIndex==1?'btn-on':'btn-off'">
<span style="font-size: 28rpx;">自动运行</span>
</view>
<view class="btn btn-140 " @click="changeairWindowControl(2)"
:class="airWindowControlIndex==2?'btn-on':'btn-off'">
<span style="font-size: 28rpx;">手动打开</span>
</view>
<view class="btn btn-140 " @click="changeairWindowControl(3)"
:class="airWindowControlIndex==3?'btn-on':'btn-off'">
<span style="font-size: 28rpx;">手动关闭</span>
</view>
<view class="btn btn-110 " @click="changeairWindowControl(4)"
:class="airWindowControlIndex==4?'btn-on':'btn-off'">
<span style="font-size: 28rpx;">停止</span>
</view>
</view>
</view>
<view class="changeMoreBtn" @click="toWebView('sunroofControl')">
<image src="../../static/changeMore.png" mode=""></image>
<text>修改更多参数</text>
</view>
<image src="../../static/closed.png" mode="" @click="airWindowShow=false"></image>
</view>
</u-popup>
<view class="content" v-if="!purviewList.length" style="text-align: center;">
暂无权限查看
</view>
</view>
</template>
<script>
export default {
data() {
return {
// 头部导航背景
background: {
backgroundColor: '#24B383',
},
deviceId: '',
wxgetpermission: [], //小程序手机控制权限数据
itemList: [{
head: "1#顶卷膜",
type: 21680,
open_value: 0,
close_value: 0
},
{
head: "2#顶卷膜",
type: 21683,
open_value: 0,
close_value: 0
},
{
head: "3#顶卷膜",
type: 21686,
open_value: 0,
close_value: 0
},
{
head: "1#侧卷膜",
type: 21689,
open_value: 0,
close_value: 0
},
{
head: "2#侧卷膜",
type: 21692,
open_value: 0,
close_value: 0
},
{
head: "外遮阳1",
type: 21695,
open_value: 0,
close_value: 0
},
{
head: "外遮阳2",
type: 21698,
open_value: 0,
close_value: 0
},
{
head: "外遮阳3",
type: 21701,
open_value: 0,
close_value: 0
},
{
head: "外遮阳4",
type: 21704,
open_value: 0,
close_value: 0
},
{
head: "外遮阳5",
type: 21707,
open_value: 0,
close_value: 0
},
{
head: "风机1",
type: 21710,
value: 0,
type_2: 2
},
{
head: "风机2",
type: 21712,
value: 0,
type_2: 2
},
{
head: "风机3",
type: 21714,
value: 0,
type_2: 2
},
{
head: "风机4",
type: 21716,
value: 0,
type_2: 2
},
{
head: "风机5",
type: 21718,
value: 0,
type_2: 2
},
{
head: "风机6",
type: 21720,
value: 0,
type_2: 2
},
{
head: "风机7",
type: 21722,
value: 0,
type_2: 2
},
{
head: "风机8",
type: 21724,
value: 0,
type_2: 2
},
{
head: "风机9",
type: 21726,
value: 0,
type_2: 2
},
{
head: "风机10",
type: 21728,
value: 0,
type_2: 2
},
],
itemStyle: {
width: "690rpx",
background: " #FFFFFF",
boxShadow: "0rpx 4rpx 20rpx 0rpx rgba(153,153,153,0.1)",
borderRadius: "20rpx",
marginBottom: '30rpx',
},
headStyle: {
fontSize: "30rpx",
fontFamily: "PingFang-SC-Bold",
fontWeight: "bold",
color: "#333333",
height: '91rpx'
},
txt_act_list: [{
txt_act21680: 0,
key: 21680
},
{
txt_act21683: 0,
key: 21683
},
{
txt_act21686: 0,
key: 21686
},
{
txt_act21689: 0,
key: 21689
},
{
txt_act21692: 0,
key: 21692
},
{
txt_act21695: 0,
key: 21695
},
{
txt_act21698: 0,
key: 21698
},
{
txt_act21701: 0,
key: 21701
},
{
txt_act21704: 0,
key: 21704
},
{
txt_act21707: 0,
key: 21707
},
{
txt_act21710: 0,
key: 21710
},
{
txt_act21712: 0,
key: 21712
},
{
txt_act21714: 0,
key: 21714
},
{
txt_act21716: 0,
key: 21716
},
{
txt_act21718: 0,
key: 21718
},
{
txt_act21720: 0,
key: 21720
},
{
txt_act21722: 0,
key: 21722
},
{
txt_act21724: 0,
key: 21724
},
{
txt_act21726: 0,
key: 21726
},
{
txt_act21728: 0,
key: 21728
},
],
inputData: [],
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: [],
//标准风机
standardFanmodelShow: false,
standardFanStatus: {
name: '标准风机',
open: 0,
status: []
},
standardFanOpenIndex: 0,
standardFanInputData2: [],
standardFanActList1: [],
fiveControl: {}, //读取(五防项目)控制器
fiveControlShow: false, //五防项目show
fiveControlIndex: 0, //五防项目index
pop_title: '',
close_btn_all: false,
fiveControlUrl: "",
fiveControlList: [{
title: '加温水泵',
controlState: 0,
num: '1000',
close_btn: false
},
{
title: '地热风机',
controlState: 0,
num: '1002',
close_btn: false
},
{
title: '上风口',
controlState: 0,
num: '1004',
close_btn: true,
progress_num: '1006',
progress: ''
},
{
title: '下风口',
controlState: 0,
num: '1007',
close_btn: true,
progress_num: '1009',
progress: ''
},
{
title: '卷被',
controlState: 0,
num: '1010',
close_btn: true
},
{
title: '除雪',
controlState: 0,
num: '1013',
close_btn: false
},
],
valveControlShow:false,//电磁阀
valvePopTitle:'',
valve_input_value:'',
valveControlIndex: 0,
supplementLightShow:false,//补光灯
lightControlIndex:0,
supplementLightStatus: {
name: '补光灯',
open: 0,
status: []
},
actListLight:[],
circulationFengshanShow:false,//环流风扇
circulationControlIndex:0,
circulationFengshanList:[
{name:'1#环流风扇',circulationFengshanState:0,open:0},
{name:'2#环流风扇',circulationFengshanState:0,open:0},
],
popCirculationFengshanName:'',
fanwetcurtainShow:false,//湿帘泵
fanwetcurtainControlIndex:0,
fanwetcurtainList:[
{name:'1#湿帘泵',fanwetcurtainState:0,open:0},
{name:'2#湿帘泵',fanwetcurtainState:0,open:0},
],
popfanwetcurtainName:'',
highpressuremistShow:false,//高压微雾
highpressuremistControlIndex:0,
highpressuremistList:[
{name:'1#高压微雾',highpressuremistState:0,open:0},
{name:'2#高压微雾',highpressuremistState:0,open:0},
],
pophighpressuremistName:'',
outFlipWindowShow:false,//湿帘外翻窗
outFlipWindowControlIndex:0,
outFlipWindowList:[
{name:'1#湿帘外翻窗',outFlipWindowState:0,progress:0},
{name:'2#湿帘外翻窗',outFlipWindowState:0,progress:0},
],
popoutFlipWindowName:'',
innercurtainShow:false,//内遮阳
innercurtainControlIndex:0,
innercurtainList:[
{name:'1#内遮阳',innercurtainState:0,progress:0},
{name:'2#内遮阳',innercurtainState:0,progress:0},
],
popinnercurtainName:'',
externalsunshadeShow:false,//外遮阳
externalsunshadeControlIndex:0,
externalsunshadeList:[
{name:'1#外遮阳',externalsunshadeState:0,progress:0},
{name:'2#外遮阳',externalsunshadeState:0,progress:0},
],
popexternalsunshadeName:'',
airWindowShow:false,//通风窗
airWindowControlIndex:0,
airWindowList:[
{name:'1#通风窗',airWindowState:0,progress:0},
{name:'2#通风窗',airWindowState:0,progress:0},
{name:'3#通风窗',airWindowState:0,progress:0},
{name:'4#通风窗',airWindowState:0,progress:0},
],
popairWindowName:'',
};
},
onReady(){
if(this.purviewList.indexOf('10')!=-1){
setTimeout(() => {
this.$refs.collapseView.init();
}, 1000);
}
},
onLoad(options) {
console.log(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: '加载中...'
})
this.dataInit();
},
methods: {
// 小程序手机控制权限数据
getcontrol_wxgetpermission() {
var deviceId = this.deviceId
this.$http({
url: this.api.getcontrol_wxgetpermission + '?deviceId=' + deviceId,
method: 'GET'
}).then(res => {
if (res.code == 200) {
this.wxgetpermission = res.data;
this.itemList = this.itemList.map(i => {
return {
...i,
nickName: ''
}
})
this.itemList.forEach(h => {
let s = this.wxgetpermission.filter(m => m.name == h.head)
if (s.length > 0) {
h.nickName = s[0].nickName
}
})
}
})
},
// 判断小程序手机控制是否有这个项,有的话返回true
isInclude(el) {
let result = false;
this.wxgetpermission.forEach(item => {
if (item.name == el.head) {
result = true
}
})
return result
},
toWebView1(url) {
let num = this.valvePopTitle.substring(0, 1)
uni.navigateTo({
url: `/pages/web_view_controller/web_view_controller?deviceId=${this.deviceId}&url=${url}&num=${num}`
})
},
toWebView(url) {
uni.navigateTo({
url: `/pages/web_view_controller/web_view_controller?deviceId=${this.deviceId}&url=${url}`
})
},
//开启几号风机
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);
},
// 标准风机
changeStandardFanOpen(index) {
this.standardFanOpenIndex = index
var dataNum = {
target: {
value: this.standardFanOpenIndex,
},
};
this.changeBtn('21950', dataNum);
},
//标准风机 开启几号风机
changeStandardFanIndexOpen(active) {
if (this.standardFanActList1[active] == '1') {
this.standardFanActList1[active] = '0'
} else {
this.standardFanActList1[active] = '1'
}
var revList = this.standardFanActList1.slice().reverse()
var num = revList.join("");
var dataNum = {
target: {
value: parseInt(num, 2),
},
};
this.changeBtn('21951', dataNum);
},
//顶卷膜修改
changeOpen1(index) {
this.openIndex1 = index
var dataNum = {
target: {
value: this.openIndex1,
},
};
this.changeBtn(21613 + ((this.indexs - 1) * 11), dataNum);
},
// 五防项目修改
changefiveControl(index) {
this.fiveControlIndex = index
var dataNum = {
target: {
value: this.fiveControlIndex,
},
};
if (this.pop_title == '加温水泵') {
this.changeBtn(21520, dataNum);
} else if (this.pop_title == '地热风机') {
this.changeBtn(21526, dataNum);
} else if (this.pop_title == '上风口') {
this.changeBtn(21530, dataNum);
} else if (this.pop_title == '下风口') {
this.changeBtn(21541, dataNum);
} else if (this.pop_title == '卷被') {
this.changeBtn(21548, dataNum);
} else if (this.pop_title == '除雪') {
this.changeBtn(21558, dataNum);
}
},
// *#电磁阀
changeValveControl(index){
this.valveControlIndex = index;
let dataNum = {
target: {
value: this.valveControlIndex,
},
};
let num = (this.valvePopTitle.substring(0, 1) - 1) * 50 + 20201;
this.changeBtn(num, dataNum);
},
// *#电磁阀输入框
changeValveInput(){
// console.log(this.valve_input_value);
if(this.valve_input_value < 1){
uni.showToast({
title:'数字不能小于1',
icon:'error',
duration:2000
})
}
let dataNum = {
target: {
value: this.valve_input_value,
},
};
let num = (this.valvePopTitle.substring(0, 1) - 1) * 50 + 20202;
this.changeBtn(num, dataNum);
},
// 补光灯
changeLightControl(index){
this.lightControlIndex = index;
let dataNum = {
target: {
value: this.lightControlIndex,
},
};
this.changeBtn(21400, dataNum);
},
// 开启几号补光灯
changeLightOpen(index){
if (this.actListLight[index] == '1') {
this.actListLight[index] = '0'
} else {
this.actListLight[index] = '1'
}
var revList = this.actListLight.slice().reverse()
var num = revList.join("");
var dataNum = {
target: {
value: parseInt(num, 2),
},
};
this.changeBtn('21401', dataNum);
},
// 环流风扇
changeCirculationControl(index){
this.circulationControlIndex = index;
let dataNum = {
target: {
value: this.circulationControlIndex,
},
};
if(this.popCirculationFengshanName == 0){
this.changeBtn(21450, dataNum);
}else if(this.popCirculationFengshanName == 1){
this.changeBtn(21470, dataNum);
}
},
// 湿帘泵
changefanwetcurtainControl(index){
this.fanwetcurtainControlIndex = index;
let dataNum = {
target: {
value: this.fanwetcurtainControlIndex,
},
};
if(this.popfanwetcurtainName == 0){
this.changeBtn(21970, dataNum);
}else if(this.popfanwetcurtainName == 1){
this.changeBtn(21972, dataNum);
}
},
// 高压微雾
changehighpressuremistControl(index){
this.highpressuremistControlIndex = index;
let dataNum = {
target: {
value: this.highpressuremistControlIndex,
},
};
if(this.pophighpressuremistName == 0){
this.changeBtn(21800, dataNum);
}else if(this.pophighpressuremistName == 1){
this.changeBtn(21808, dataNum);
}
},
// 湿帘外翻窗弹框
changeoutFlipWindowControl(index){
this.outFlipWindowControlIndex = index;
let dataNum = {
target: {
value: this.outFlipWindowControlIndex,
},
};
if(this.popoutFlipWindowName == 0){
this.changeBtn(21974, dataNum);
}else if(this.popoutFlipWindowName == 1){
this.changeBtn(21979, dataNum);
}
},
// 内遮阳
changeinnercurtainControl(index){
this.innercurtainControlIndex = index;
let dataNum = {
target: {
value: this.innercurtainControlIndex,
},
};
if(this.popinnercurtainName == 0){
this.changeBtn(21840, dataNum);
}else if(this.popinnercurtainName == 1){
this.changeBtn(21858, dataNum);
}
},
// 外遮阳
changeexternalsunshadeControl(index){
this.externalsunshadeControlIndex = index;
let dataNum = {
target: {
value: this.externalsunshadeControlIndex,
},
};
if(this.popexternalsunshadeName == 0){
this.changeBtn(21900, dataNum);
}else if(this.popexternalsunshadeName == 1){
this.changeBtn(21915, dataNum);
}
},
// 通风窗
changeairWindowControl(index){
this.airWindowControlIndex = index;
let dataNum = {
target: {
value: this.airWindowControlIndex,
},
};
if(this.popairWindowName == 0){
this.changeBtn(21250, dataNum);
}else if(this.popairWindowName == 1){
this.changeBtn(21273, dataNum);
}else if(this.popairWindowName == 2){
this.changeBtn(21296, dataNum);
}else if(this.popairWindowName == 3){
this.changeBtn(21319, 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
var data = {
deviceId: this.deviceId
};
this.$http({
url: this.api.getReadControlliShuiControl,
data: data,
method: 'GET',
}).then((res => {
this.inputData2 = res.data;
this.openIndex1 = this.inputData2[21613 + ((this.indexs - 1) * 11)]
// this.openIndex = this.inputData2[21600]
// this.getAct21601()
}))
},
// 根据type参数返回对应的txt_act21680
getTypeRoll(i) {
let arr = this.txt_act_list.filter(el => el.key == i)
return arr[0][Object.keys(arr[0])[0]]
},
// 读取所有寄存器的状态值
dataInit() {
var deviceId = this.deviceId
this.$http({
url: this.api.getcontrol_cpermission + '?deviceId=' + deviceId,
method: 'POST',
}).then((res => {
if(res.code == 200){
uni.hideLoading()
uni.stopPullDownRefresh();
res.data.forEach((el, index) => {
this.purviewList.push(el.id.toString())
})
// 控制器状态获取
this.getControl_getState();
clearInterval(this.statusInterval) && this.statusInterval
this.statusInterval = setInterval(() => {
this.getControl_getState()
}, 3000);
//查看金华权限
if (this.purviewList.indexOf('10') != -1) {
// 小程序手机控制权限数据
this.getcontrol_wxgetpermission();
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++) {
if (!this.itemList[i].type_2) {
this.itemList[i].open_value = this.inputData[Number('21681') +
i *
3]
this.itemList[i].close_value = this.inputData[Number('21682') +
i *
3]
this.getType((21680 + i * 3), 1)
} else {
this.itemList[i].value = this.inputData[21711 + (i - 10) * 2]
this.getType((21710 + (i - 10) * 2), 2)
}
}
// 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);
// }
// 查看五防项目权限
// if (this.purviewList.indexOf('8') != -1) {
// }
// 读取(补光灯)控制器
// if(this.purviewList.indexOf('20') != -1){
// };
// 环流风扇
// if(this.purviewList.indexOf('21') != -1){};
}
}))
},
// 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) {
// 丽水
if (this.purviewList.indexOf('9') != -1){
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)
}
}
// 五防项目状态
if (this.purviewList.indexOf('8') != -1){
this.fiveControlList.forEach(el => {
el.controlState = res.data[el.num];
if (el.progress_num) {
el.progress = res.data[el.progress_num];
}
});
}
// 补光灯状态值获取
if(this.purviewList.indexOf('20') != -1){
this.supplementLightStatus.open = res.data[1068];
this.supplementLightStatus.status = [];
let numLight = res.data[1069];
let numLight1 = this.padString(numLight.toString(2),8);
let openListNew = [];
openListNew = numLight1.split('')
this.supplementLightStatus.status = openListNew.reverse()
};
// 环流风扇状态值获取
if(this.purviewList.indexOf('21') != -1){
this.circulationFengshanList.forEach((el,index)=>{
el.circulationFengshanState = res.data[1074 + index * 2];
el.open = res.data[1075 + index * 2];
})
};
// 标准风机
if(this.purviewList.indexOf('26') != -1){
this.standardFanStatus.open = res.data['1078']
this.standardFanStatus.status = []
var standardnum = res.data['1079']
var standardnum1 = this.padString(standardnum.toString(2), 5)
var openListNew = []
openListNew = standardnum1.split("")
this.standardFanStatus.status = openListNew.reverse()
};
// 湿帘泵
if(this.purviewList.indexOf('26') != -1){
this.fanwetcurtainList.forEach((el,index)=>{
el.fanwetcurtainState = res.data[1080 + index * 2];
el.open = res.data[1081 + index * 2];
})
};
// 高压微雾
if(this.purviewList.indexOf('23') != -1){
this.highpressuremistList.forEach((el,index)=>{
el.highpressuremistState = res.data[1070 + index * 2];
el.open = res.data[1071 + index * 2];
})
};
// 湿窗外翻窗
if(this.purviewList.indexOf('26') != -1){
this.outFlipWindowList.forEach((el,index)=>{
el.outFlipWindowState = res.data[1084 + index * 3];
el.progress = res.data[1086 + index * 3];
})
};
//内遮阳
if(this.purviewList.indexOf('24') != -1){
this.innercurtainList.forEach((el,index)=>{
el.innercurtainState = res.data[1090 + index * 3];
el.progress = res.data[1092 + index * 3];
})
};
//外遮阳
if(this.purviewList.indexOf('25') != -1){
this.externalsunshadeList.forEach((el,index)=>{
el.externalsunshadeState = res.data[1096 + index * 3];
el.progress = res.data[1098 + index * 3];
})
};
//通风窗
if(this.purviewList.indexOf('19') != -1){
this.airWindowList.forEach((el,index)=>{
el.airWindowState = res.data[1102 + index * 3];
el.progress = res.data[1104 + index * 3];
})
};
}
})
},
// 丽水 风机
fanmodelHander(){
this.fanmodelShow = true;
var data = {
deviceId: this.deviceId
};
this.$http({
url: this.api.getReadControlliShuiControl,
data: data,
method: 'GET',
}).then((res => {
this.inputData2 = res.data;
// this.openIndex1 = this.inputData2[21613 + ((this.indexs - 1) * 11)]
this.openIndex = this.inputData2[21600]
this.getAct21601()
}))
},
// 标准风机
standardFanmodelHander(){
this.standardFanmodelShow = true;
var deviceId = this.deviceId
this.$http({
url:this.api.readControl_fanwetcurtain + '?deviceId=' + deviceId,
method: 'GET'
}).then(res => {
if (res.code == 200) {
this.standardFanInputData2 = res.data;
this.standardFanOpenIndex = this.standardFanInputData2[21950]
this.standardFanActList1 = []
let num = this.standardFanInputData2['21951']
let num1 = this.padString(num.toString(2), 5)
let openListNew = []
openListNew = num1.split("")
openListNew.forEach((el, index) => {
this.standardFanActList1.push(openListNew[openListNew.length - index - 1])
})
}
})
},
// 东北五防弹框
openFiveControlShow(index) {
this.fiveControlShow = true;
this.pop_title = this.fiveControlList[index].title;
this.close_btn_all = this.fiveControlList[index].close_btn;
var deviceId = this.deviceId
this.$http({
url: this.api.readControl_fiveControl + '?deviceId=' + deviceId,
method: 'GET'
}).then(res => {
if (res.code == 200) {
uni.hideLoading();
uni.stopPullDownRefresh();
this.fiveControl = res.data
if (index == 0) {
this.fiveControlIndex = this.fiveControl[21520];
this.fiveControlUrl = 'waterPump';
} else if (index == 1) {
this.fiveControlIndex = this.fiveControl[21526];
this.fiveControlUrl = 'geothermalFan'
} else if (index == 2) {
this.fiveControlIndex = this.fiveControl[21530];
this.fiveControlUrl = 'uptake'
} else if (index == 3) {
this.fiveControlIndex = this.fiveControl[21541];
this.fiveControlUrl = 'downtake'
} else if (index == 4) {
this.fiveControlIndex = this.fiveControl[21548];
this.fiveControlUrl = 'rollByRoll'
} else if (index == 5) {
this.fiveControlIndex = this.fiveControl[21558];
this.fiveControlUrl = 'snowRemoval'
}
}
})
},
// 电磁阀
openValveControlShow(index){
this.valveControlShow = true
this.valvePopTitle = index+1 + '#电磁阀';
var data = {
deviceId: this.deviceId
};
this.$http({
url: this.api['readControl_solenoidValve'+`${index+1}`],
data: data,
method: 'GET',
}).then(res=>{
if (res.code == 200) {
this.valveControlIndex = res.data[20201 + index * 50]
this.valve_input_value = res.data[20202 + index * 50]
}
})
},
// 补光灯
supplementLightHander(){
var deviceId = this.deviceId;
this.supplementLightShow = true;
this.$http({
url:this.api.readControl_readfilllight + '?deviceId=' + deviceId,
method: 'GET'
}).then(res => {
if (res.code == 200) {
// console.log(res,'补光灯');
uni.hideLoading();
uni.stopPullDownRefresh();
this.lightControlIndex = res.data[21400];
this.actListLight = []
let numLight = res.data[21401];
let numLight1 = this.padString(numLight.toString(2),8);
let openListNew = [];
openListNew = numLight1.split('')
this.actListLight = openListNew.reverse()
}
})
},
// 环流风扇弹框
circulationFengshanHander(index){
this.circulationControlIndex = 0;
this.popCirculationFengshanName = index;
var deviceId = this.deviceId
this.circulationFengshanShow=true;
this.$http({
url:this.api.readControl_readcirculationfan + '?deviceId=' + deviceId,
method: 'GET'
}).then(res => {
if (res.code == 200) {
uni.hideLoading();
uni.stopPullDownRefresh();
this.circulationControlIndex = res.data[21450 + index * 20];
}
})
},
// 湿帘泵弹框
fanwetcurtainHander(index){
this.fanwetcurtainControlIndex = 0;
this.popfanwetcurtainName = index;
var deviceId = this.deviceId
this.fanwetcurtainShow=true;
this.$http({
url:this.api.readControl_fanwetcurtain + '?deviceId=' + deviceId,
method: 'GET'
}).then(res => {
if (res.code == 200) {
uni.hideLoading();
uni.stopPullDownRefresh();
this.fanwetcurtainControlIndex = res.data[21970 + index * 2];
}
})
},
// 高压微雾
highpressuremistHander(index){
this.highpressuremistControlIndex = 0;
this.pophighpressuremistName = index;
var deviceId = this.deviceId
this.highpressuremistShow=true;
this.$http({
url:this.api.readControl_fanwetcurtain + '?deviceId=' + deviceId,
method: 'GET'
}).then(res => {
if (res.code == 200) {
uni.hideLoading();
uni.stopPullDownRefresh();
this.highpressuremistControlIndex = res.data[21800 + index * 8];
}
})
},
// 湿帘外翻窗
outFlipWindowHander(index){
this.outFlipWindowControlIndex = 0;
this.popoutFlipWindowName = index;
var deviceId = this.deviceId
this.outFlipWindowShow=true;
this.$http({
url:this.api.readControl_fanwetcurtain + '?deviceId=' + deviceId,
method: 'GET'
}).then(res => {
if (res.code == 200) {
uni.hideLoading();
uni.stopPullDownRefresh();
this.outFlipWindowControlIndex = res.data[21974 + index * 5];
}
})
},
// 内遮阳
innercurtainHander(index){
this.innercurtainControlIndex = 0;
this.popinnercurtainName = index;
var deviceId = this.deviceId
this.innercurtainShow=true;
this.$http({
url:this.api.readControl_innercurtain + '?deviceId=' + deviceId,
method: 'GET'
}).then(res => {
if (res.code == 200) {
uni.hideLoading();
uni.stopPullDownRefresh();
this.innercurtainControlIndex = res.data[21840 + index * 18];
}
})
},
// 外遮阳
externalsunshadeHander(index){
this.externalsunshadeControlIndex = 0;
this.popexternalsunshadeName = index;
var deviceId = this.deviceId
this.externalsunshadeShow=true;
this.$http({
url:this.api.readControl_externalsunshade + '?deviceId=' + deviceId,
method: 'GET'
}).then(res => {
if (res.code == 200) {
uni.hideLoading();
uni.stopPullDownRefresh();
this.externalsunshadeControlIndex = res.data[21900 + index * 15];
}
})
},
// 通风窗
airWindowHander(index){
this.airWindowControlIndex = 0;
this.popairWindowName = index;
var deviceId = this.deviceId
this.airWindowShow=true;
this.$http({
url:this.api.readControl_readskylight + '?deviceId=' + deviceId,
method: 'GET'
}).then(res => {
if (res.code == 200) {
uni.hideLoading();
uni.stopPullDownRefresh();
this.airWindowControlIndex = res.data[21250 + index * 23];
}
})
},
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');
},
getType(type, flag) {
if (flag == 1) {
var number = this.padString(Number(this.inputData[type]).toString(2), 3)
// console.log(number); //001
// console.log(number[0]); //0 bit2 关闭
// console.log(number[1]); //0 bit1 停止
// console.log(number[2]); //1 bit0 打开
let arr = this.txt_act_list.filter(el => el.key == type)
let key1 = Object.keys(arr[0])[0];
this.txt_act_list.forEach(el => {
if (el.key == type) {
if (Number(number[0])) {
el[key1] = 3
} else if (Number(number[1])) {
el[key1] = 2
} else if (Number(number[2])) {
el[key1] = 1
} else {
el[key1] = 0
}
}
})
} else if (flag == 2) {
var number = this.padString(Number(this.inputData[type]).toString(2), 2)
// console.log(number); //01
// console.log(number[0]); //1 bit1 关闭
// console.log(number[1]); //1 bit0 打开
let arr = this.txt_act_list.filter(el => el.key == type)
let key1 = Object.keys(arr[0])[0];
this.txt_act_list.forEach(el => {
if (el.key == type) {
if (Number(number[0])) {
el[key1] = 2
} else if (Number(number[1])) {
el[key1] = 1
} else {
el[key1] = 0
}
}
})
}
},
change00(type, index) {
uni.showLoading({
title: '加载中...'
})
let arr = this.txt_act_list.filter(el => el.key == type)
let key1 = Object.keys(arr[0])[0];
this.txt_act_list.forEach(el=>{
if(el.key == type){
el[key1] = index
}
})
if (type > 21679 && type < 21708) {
var list = ["0", "0", "0"];
if (index == 1) {
list[2] = "1";
} else {
list[2] = "0";
}
if (index == 2) {
list[1] = "1";
} else {
list[1] = "0";
}
if (index == 3) {
list[0] = "1";
} else {
list[0] = "0";
}
} else if (type > 21709 && type < 21729) {
var list = ["0", "0"];
if (index == 1) {
list[1] = "1";
} else {
list[1] = "0";
};
if (index == 2) {
list[0] = "1";
} else {
list[0] = "0";
};
}
var num = list.join("");
var dataNum = {
target: {
value: parseInt(num, 2),
},
};
this.change(type, dataNum);
},
change(code, el) {
var data = {
equipmentId: this.deviceId,
regAddress: code,
num: el.target.value,
};
this.delayTimer(0, data);
},
delayTimer(i, data) {
const that = this;
//整体接口
let j = 5;
//避免开启多个计时器
this.timer && clearInterval(this.timer);
this.timer = setInterval(() => {
++i;
if (i == j) {
that.changeData(data);
clearInterval(this.timer);
}
}, 100);
},
changeData(data) {
const that = this
this.$http({
url: this.api.writeJinHuaControl_write,
data: data
}).then((res) => {
if (res.code == 200) {
uni.hideLoading()
uni.showToast({
title: res.msg,
icon: "success",
})
this.dataInit()
} else {
uni.showToast({
title: "失败!",
icon: "error",
})
}
});
},
// x#顶卷膜输入框
blurChangeData00_1(code, el) {
uni.showLoading({
title: '加载中...'
})
var data = el.target.value
// console.log(data);
var sendData = {
target: {
value: data
}
}
this.change(code, sendData)
},
blurChangeData00_2(code, el) {
uni.showLoading({
title: '加载中...'
})
var data = el.target.value
var sendData = {
target: {
value: data
}
}
this.change(code, sendData)
},
}
}
</script>
<style lang="scss" scoped>
.controller {
width: 100%;
min-height: 100vh;
background-color: #F5F6FA;
box-sizing: border-box;
padding: 30rpx;
.content {
box-sizing: border-box;
// padding: 30rpx;
::v-deep .uicon-arrow-down {
width: 16rpx;
height: 8rpx;
}
::v-deep .uicon-arrow-down::before {
content: " ";
width: 16rpx;
height: 8rpx;
background: url('../../static/downArrow.png') center no-repeat;
background-size: 100% 100%;
position: absolute;
}
.collapseItem {
width: 100%;
height: 298rpx;
.line {
width: 100%;
height: 1rpx;
background: #DDDDDD;
}
.control_model {
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 30rpx 30rpx 28rpx;
.control {
font-size: 28rpx;
font-family: PingFang-SC-Bold;
font-weight: bold;
color: #333333;
box-sizing: border-box;
padding: 0 50rpx;
}
.model {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 10rpx;
box-sizing: border-box;
padding: 0 50rpx;
.txt {
width: 150rpx;
height: 66rpx;
background: #EFFCF7;
border: 2px solid rgba(58, 187, 144, 0.25);
border-radius: 10rpx;
font-size: 28rpx;
font-family: PingFang-SC-Bold;
font-weight: bold;
color: #24B383;
text-align: center;
line-height: 62rpx;
}
.txt_act {
width: 150rpx;
height: 66rpx;
background: linear-gradient(0deg, #54CDA4, #27B584);
border-radius: 10rpx;
font-size: 28rpx;
font-family: PingFang-SC-Bold;
font-weight: bold;
color: #EFFCF7;
text-align: center;
line-height: 66rpx;
}
}
.line1 {
width: 630rpx;
height: 1rpx;
background: #DDDDDD;
margin: 30rpx 0;
}
.roll_input {
display: flex;
align-items: center;
justify-content: space-around;
box-sizing: border-box;
padding: 0 50rpx;
view {
display: flex;
align-items: center;
view {
width: 110rpx;
height: 66rpx;
background: #F5F6FA;
border: 2px solid #E1E2E6;
border-radius: 10rpx;
margin-right: 15rpx;
>input {
width: 100%;
height: 100%;
text-align: center;
}
}
text {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
}
}
}
}
}
.valve{
width: 100%;
height: 100rpx;
background: #FFFFFF;
box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(153, 153, 153, 0.1);
border-radius: 20rpx;
margin-bottom: 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 20rpx;
image{
width: 60rpx;
height: 61rpx;
margin-right: 20rpx;
}
span{
font-size: 34rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
flex: 1;
}
view{
width: 120rpx;
height: 54rpx;
background: #F5F6FA;
border: 2px solid #E1E2E6;
border-radius: 10rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: bold;
color: #666666;
display: flex;
align-items: center;
justify-content: center;
image{
width: 12rpx;
height: 20rpx;
margin-left: 19rpx;
}
}
}
.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;
}
.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 !important;
}
}
&.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: #24B383;
}
}
}
}
.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: #24B383;
}
}
}
}
.input_value{
width: 100%;
height: 126rpx;
border-top: 1rpx solid #DDDDDD;
border-bottom: 1rpx solid #DDDDDD;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
display: flex;
align-items: center;
justify-content: center;
margin-top: 30rpx;
input{
width: 120rpx;
height: 66rpx;
background: #F5F6FA;
border: 2px solid #E1E2E6;
border-radius: 10rpx;
margin: 0 20rpx;
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
padding: 0 20rpx;
}
}
.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: #24B383;
}
}
}
}
}
}
/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 0rpx;
>view {
width: 175rpx !important;
span {
margin-left: 0;
}
}
}
}
}
}
.changeMoreBtn {
width: 340rpx;
height: 80rpx;
background: linear-gradient(0deg, #57CFA6, #25B383);
box-shadow: 0rpx 3rpx 15rpx 0rpx rgba(36, 179, 131, 0.35);
border-radius: 15rpx;
display: flex;
justify-content: center;
align-items: center;
margin: 30rpx auto;
>image {
width: 30rpx;
height: 30rpx;
margin-right: 16rpx;
}
>text {
font-size: 30rpx;
font-family: PingFang-SC-Bold;
font-weight: bold;
color: #FFFFFF;
}
}
</style>