<template><!--正常设备列表-->
	<div class="page-box">
    <div v-for="(item,index) in dataList" :key="index" class="list-box">
    	<dl>
    		<span class="list-title">设备名称</span>
    		<span class="list-text">{{item.deviceName}}</span>
    	</dl>
    	<dl>
    		<span class="list-title">设备编码</span>
    		<span class="list-text">{{item.deviceCode}}</span>
    	</dl>
    	<dl>
    		<span class="list-title">所属机房</span>
    		<span class="list-text">{{item.roomName}}</span>
    	</dl>
    	<!--<dl>
    		<span class="list-title">设备地址</span>
    		<span class="list-text">{{item.address}}</span>
    	</dl>-->
    	<dl>
    		<span class="list-title">巡检人</span>
    		<span class="list-text">{{item.userName}}</span>
    	</dl>
    	<dl>
    		<span class="list-title">联系电话</span>
    		<span class="list-text">{{item.telephone}}</span>
    	</dl>
    </div>
	</div>
</template>

<script>
	import {getDeviceDetailsForSjsNormal} from './service/getData.js';
	export default {
		name: '',
		data () {
	    return {
	    	sysId: '', //系统id
	    	dataList: []
	    }
	  },
	  created: function() {
	  	this.sysId = this.$route.query.sysId;
	  	this.getDataList();
	  },
	  methods: {
	  	getDataList() {
	  		var self = this;
	  		var jsonData = {
	  			companyId: localStorage.companyId || '',
	  			sysId: self.sysId,
	  			deviceState: '1' //设备状态(1:正常;3:维保;7:停用)
	  		};
	  		self.$Spin.show();
	  		getDeviceDetailsForSjsNormal(jsonData).then(res => {
	  			self.$Spin.hide();
	  			if(res.status == 200) {
	  				self.dataList = res.data;
	  			}
	  		})
	  	},
	  }
	}
</script>

<style scoped="scoped">
	@import url("./assets/css/list.css");
</style>

