<template>
	<view class="page_padding">
		<view class="detail_list contentboxsty page_content font13">
			<view class="content_row">
				<view class="name font_bold">设备</view>
				<view class="text">{{form.eq_name}}</view>
			</view>
			<view class="content_row">
				<view class="name font_bold">设备名称</view>
				<view class="text">{{form.name}}</view>
			</view>
			<view class="content_row">
				<view class="name font_bold">设备功率</view>
				<view class="text">{{form.power}}</view>
			</view>
			<view class="content_row">
				<view class="name font_bold">设备IP</view>
				<view class="text">{{form.equipment_configs.length>0? form.equipment_configs[0].ip:''}}</view>
			</view>
			<view class="content_row">
				<view class="name font_bold">端口</view>
				<view class="text">{{form.equipment_configs.length>0? form.equipment_configs[0].port:''}}</view>
			</view>
			<view class="content_row">
				<view class="name font_bold">状态</view>
				<view class="text">{{form.active_status==true?'启用':'禁用'}}</view>
			</view>
			<view class="textarea_row">
				<view class="name font_bold font13">备注</view>
				<view class="text textareaText">
					{{form.remark}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form:{
					equipment_configs:[
						{ip:'',port:''}
					]
				}
			}
		},
		onLoad(options){
			this.getDetail(options.id);
		},
		methods: {
			getDetail(id){
				this.$api.postFuncLoading('/device.info',{id:id}).then(res=>{
					this.form = res.data
				})
			},
		}
	}
</script>

<style scoped lang="scss">
.content_row{display: flex;align-items: center;padding-top: 17px;
	.name{flex-basis: 80px;}
	.text{flex: 1;}
}
.textarea_row{
	.name{padding: 17px 0;}
	.textareaText{min-height: 80px;}
}
</style>
