<template>
	<view>
		<view>
			<view class="item ddflex">
				<view class="label">机柜名称</view>
				<view class="item-input fflex ddflex">
					<view>{{cabInfo.devName}}</view>
					<!-- <view class="state">在线</view> -->
				</view>
			</view>
			<view class="item ddflex">
				<view class="label">机柜编号</view>
				<view class="item-input fflex">
					{{cabInfo.devId}}
				</view>
			</view>
			<view class="item ddflex">
				<view class="label">机柜温度</view>
				<view class="item-input fflex">
					<block v-if="cabInfo.cabTemp">{{cabInfo.cabTemp}}℃</block>
					<view v-else>未知</view>
				</view>
			</view>
			<view class="item ddflex">
				<view class="label">机柜电压</view>
				<view class="item-input fflex">
					<block v-if="cabInfo.cabVol">{{cabInfo.cabVol}}V</block>
					<view v-else>未知</view>
				</view>
			</view>
			<view class="item ddflex">
				<view class="label">当前电流</view>
				<view class="item-input fflex">
					<block v-if="cabInfo.cabCur">{{cabInfo.cabCur}}A</block>
					<view v-else>未知</view>
				</view>
			</view>
			<view class="item ddflex">
				<view class="label">信号强度</view>
				<view class="item-input fflex">
					<block v-if="cabInfo.dbm">{{cabInfo.dbm}}</block>
					<view v-else>未知</view>
				</view>
			</view>
			<view class="item ddflex">
				<view class="label">电表度数</view>
				<view class="item-input fflex">
					<block v-if="cabInfo.emKwh">{{cabInfo.emKwh}}KWH</block>
					<view v-else>未知</view>
				</view>
			</view>
			<view class="item ddflex">
				<view class="label">仓门数量</view>
				<view class="item-input fflex">
					<block v-if="cabInfo.doorCount">{{cabInfo.doorCount}}</block>
					<view v-else>未知</view>
				</view>
			</view>
			<view class="item ddflex">
				<view class="label">空仓数量</view>
				<view class="item-input fflex">
					<block v-if="cabInfo.nullDoorCount">{{cabInfo.nullDoorCount}}</block>
					<view v-else>未知</view>
				</view>
			</view>
			<view class="item ddflex">
				<view class="label">可用电池数量</view>
				<view class="item-input fflex">
					<block v-if="cabInfo.useDoorCount">{{cabInfo.useDoorCount}}</block>
					<view v-else>未知</view>
				</view>
			</view>
			<!-- <view class="item ddflex">
				<view class="label">iccid</view>
				<view class="item-input fflex">
					89860469092190149474
				</view>
			</view>
			<view class="item ddflex">
				<view class="label">硬件版本</view>
				<view class="item-input fflex">
					V1.2
				</view>
			</view>
			<view class="item ddflex">
				<view class="label">软件版本</view>
				<view class="item-input fflex">
					ZXSCMB-3.25-20220714
				</view>
			</view>
			<view class="item ddflex">
				<view class="label">协议版本</view>
				<view class="item-input fflex">
					V1.2
				</view>
			</view> -->
			
		</view>
		
		<!-- 保存按钮 -->
		<!-- <view class="savepadding" style="height: 150rpx;"></view>
		<view class="savepadding submit-box">
			<view class="submit-btn" @click="jumpUrl('/machineAndCell/machineDetailEdit/machineDetailEdit')">
				更改机柜地址
			</view>
		</view> -->
		
	</view>
</template>

<script>
	const app = getApp();
	const req = require("../../utils/request.js");
	export default {
		components: {
		},
		props: {},
		data() {
			return {
				id:null,
				cabInfo:{}
			}
		},
		onLoad(options) {
			this.id = options.id
			this.getDataInfo()
		},
		onShow() {
			
		},
		methods: {
			jumpUrl(url) {
				if (req.isLogins(true)) {
					uni.navigateTo({
						url: url
					})
				}
			},
			getDataInfo(){
				req.getRequest('/admin/v2/cab/info',{devId:this.id},res=>{
					this.cabInfo = res
				})
			}
		},
		mounted() {
			
		},
		onPageScroll: function(e) {
		}
	}
</script>

<style>
	@import "./machineDetail.css";
</style>