<!--pages/station/index.wxml-->
<view class="custom-tabs">
<view class="custom_box" wx:for="{{baseInfo.list}}" wx:key="index">
 <view class="custom_title">
 <view class="custom_title_name">设备编号</view>
 <view class="custom_title_gl">{{item.name}} </view>
 </view>
 <view class="custom_div">
 <view class="batteryccc">实时功率</view>
 <view class="custom_title_gl">{{converter.formattoFixed(item.power*1,2)}}<text class="batteryccc"> kW</text> </view>
 </view>
 <view class="custom_div">
 <view class="batteryccc">在线状态</view>
 <!-- <view class="{{item.comState== '离线' ? 'tag_type2red':'tag_type2'}}">{{item.comState}}</view> -->
 <view wx:if="{{item.comState==0}}" class="tag_type2red">离线</view>
 <view wx:else class="tag_type2">在线</view>
 <!-- <view class="tag_type2">{{item.comState}}</view> -->
 </view>
 <view class="custom_div">
 <view class="batteryccc">故障状态</view>
 <!-- <view class="tag_type1">{{item.faultState}}</view> -->
 <!-- <view class="{{item.faultState== '正常' ? 'tag_type2':'tag_type2red'}}">{{item.faultState}}</view> -->
 <view wx:if="{{item.faultState == 0}}" class="tag_type2">正常</view>
 <view  wx:else class="tag_type2red">故障</view>

 </view>
 <view class="custom_div">
 <view class="batteryccc">运行状态</view>
 <!-- <view class="tag_type3">{{item.runState}}</view> -->
 <!-- <view class="{{item.runState== '运行' ? 'tag_type2':'tag_type3'}}">{{item.runState}}</view> -->
 <view wx:if="{{item.runState== 1}}" class="tag_type2">运行</view>
 <view wx:else class="tag_type3">停机</view>

 </view>
 <view class="custom_div">
 <view class="batteryccc">投运时间</view>
 <view class="custom_div1">{{item.createTime}}</view>
 </view>
</view>
<view class="tag_typetext">没有更多数据...</view>
</view>
<!-- 
createAt 投运时间
comState 在线状态
power 实时功率
 故障状态 faultState
 运行状态 runState
name  名称
 -->
 <wxs module="converter">
 var formattoFixed = function(amount,unm) {
     return amount.toFixed(unm*1);
    }
   var formatAmount = function(amount) {
    if (amount==undefined) {
        return '1000';
      }
      if (amount < 10000) {
        return amount.toFixed(2);
      } else {
        return (amount / 10000).toFixed(2);
      }
    }
    var formatAmounts = function(amount) {
    if (amount==undefined) {
        return '元';
      }
      if (amount < 10000) {
        return'元';
      } else {
        return'万元';
      }
    }
    module.exports = {
      formatAmount: formatAmount,
      formatAmounts: formatAmounts,
      formattoFixed:formattoFixed
    }
</wxs>