<cu-custom bgColor="bg-gradual-blue"  
 isBack="true"> 
  <block bindtap="back" slot="backText" >返回</block> 
  <view slot="content">({{HotelName}})_{{RoomNumber}}</view> 
</cu-custom> 
<view class="flex solid-bottom  justify-between ">
  <view class=" padding-5 margin-5 radius">  
  <text class="text-black">异常数量：</text>
  <text class="text-red">{{errorsNumber}}</text>
  <text class="text-black">/{{deviceList.length}}</text>

  </view>
      <view class="bg-grey padding-5 margin-5 radius" hover-class="navigator-hover" bindtap="checkWardRoundRecords" >查看查房记录</view>
      <view class="bg-grey padding-5 margin-5 radius"  hover-class="navigator-hover" bindtap="uploadWardRoundStatus">上传查房状态</view>
      <view class="bg-grey padding-5 margin-5 radius"  hover-class="navigator-hover" bindtap="refreshDeviceList">刷新设备</view>
    </view>

 <!-- 设备状态表格 -->
  <view class="th">
    <text class="th-item">设备名称</text>
    <text class="th-item td ">状态</text>  
    <text class="th-item td2">设备检测</text>
  </view>
<scroll-view scroll-y  scroll-into-view="{{toView}}" id="NmyScroll"  style="height:{{scrollHeight}}rpx;">
  <view class="device-table">
  <block wx:for="{{deviceList}}" wx:key="id">
    <view class="tr">
      <!-- 名称 -->
      <text class="th-item {{item.equipmentstatus==='hideModal_1'? 'bg-green':item.equipmentstatus==='hideModal_0'? 'bg-red':'textbcolor'}} ">{{item.name}}</text>

      <!-- 状态 -->
      <view class="td status" style="margin-left: 10rpx;" >
        <text class="status-text {{item.status==='在线'||item.status==='显示'?'on':'off'}}">{{item.status}}</text>
      </view>

      <!-- 按钮 -->
      <view class="td2 btn-group">
        <button class="btn green" data-id="{{item.id}}" data-st="正常" data-target="DialogModal1" bindtap="showModal">设备检测</button>       
      </view>
      
    </view>

  </block>
  
</view>
</scroll-view>
<view class="cu-modal {{modalName=='DialogModal1'?'show':''}}">
  <view class="cu-dialog">
    <view class="cu-bar bg-white justify-end">
      <view class="content">{{deviceList[deviceListindex].name}}</view>
     
    </view>
    <view >
    <view class=" text-left" > 检测流程：</view>
    <textarea auto-height maxlength="-1" class="solids " disabled="true" confirm-type="return" style="width: 95%;font-size: 32rpx;text-align: left;white-space: pre-wrap; word-break: break-all; line-height: 1.5;" value=" {{deviceList[deviceListindex].note}}"/>
    
    </view>
    <view class="cu-bar bg-white justify-end">
      <view class="action">
        <button class="cu-btn bg-gray  text-xl text-blue" data-id="hideModal_1" bindtap="DialogModal2" disabled="{{modalName=='DialogModal3'}}" >修改检测流程</button>
        <button class="cu-btn bg-red  text-xl text-black margin-left" data-id="hideModal_0" bindtap="DialogModal1" disabled="{{modalName=='DialogModal3'}}" >异常</button>
        <button class="cu-btn bg-green text-xl text-black margin-left" data-id="hideModal_1" bindtap="DialogModal1" disabled="{{modalName=='DialogModal3'}}" >正常</button>

      </view>
    </view>

  </view>
</view>

  <!-- 修改检测流程弹窗 -->
  <view class="cu-modal {{modalName=='DialogModal3'?'show':''}}">
    <view class="cu-dialog">
      <view class="cu-bar bg-white justify-end">
        <view class="content">修改检测流程 - {{deviceList[deviceListindex].name}}</view>
      </view>
      <view >
        <view class=" text-left" > 检测流程：</view>
        <textarea auto-height maxlength="-1"   class="solids " focus="true"  bindinput="inputSearchForHotels"	confirm-type="return" style="width: 95%;font-size: 32rpx;text-align: left;white-space: pre-wrap; word-break: break-all; line-height: 1.5;" value=" {{deviceList[deviceListindex].note}}"/>
      </view>
      <view class="cu-bar bg-white justify-end">
        <view class="action">       
          <button class="cu-btn bg-red  text-xl text-black margin-left" data-id="cancel" bindtap="saveTheText">取消</button>
          <button class="cu-btn bg-green text-xl text-black margin-left" data-id="ok" bindtap="saveTheText">保存</button>
        </view>
      </view>
    </view>
  </view>

  <!-- 异常原因输入弹窗 -->
  <view class="cu-modal {{modalName=='DialogModal4'?'show':''}}">
    <view class="cu-dialog">
      <view class="cu-bar bg-white justify-end">
        <view class="content">异常原因 - {{deviceList[deviceListindex].name}}</view>
      </view>
      <view >
        <view class=" text-left" > 请输入异常原因：</view>
        <textarea auto-height maxlength="-1"   class="solids " focus="true"  bindinput="inputErrorReason"	confirm-type="return" style="width: 95%;font-size: 32rpx;text-align: left;white-space: pre-wrap; word-break: break-all; line-height: 1.5;" value=" {{errorReason}}"/>
      </view>
      <view class="cu-bar bg-white justify-end">
        <view class="action">       
          <button class="cu-btn bg-red  text-xl text-black margin-left" bindtap="cancelErrorReasonModal">取消</button>
          <button class="cu-btn bg-green text-xl text-black margin-left" bindtap="confirmErrorReasonModal">确定</button>
        </view>
      </view>
    </view>
  </view>


