<template>
	<div id="device">
		<!--设备列表-->
		<el-table :data="deviceList" border style="width: 100%">
			<el-table-column prop="name" label="名称" width="180" align="center">
			</el-table-column>
			<el-table-column prop="deviceId" label="设备编号" width="240" align="center">
			</el-table-column>
			<el-table-column label="地址" width="180" align="center">
				<template slot-scope="scope">
					<div slot="reference" class="name-wrapper">
						<el-tag size="medium">{{ scope.row.host.address }}</el-tag>
					</div>
				</template>
			</el-table-column>
			<el-table-column prop="manufacturer" label="厂家" align="center">
			</el-table-column>
			<el-table-column prop="model" label="固件版本" align="center">
			</el-table-column>
			<el-table-column prop="transport" label="通讯方式" align="center">
			</el-table-column>
			<el-table-column label="状态" width="180" align="center">
				<template slot-scope="scope">
					<div slot="reference" class="name-wrapper">
						<el-tag size="medium">{{ scope.row.online==1?'在线' :'离线'}}</el-tag>
					</div>
				</template>
			</el-table-column>

			<el-table-column label="操作" width="240" align="center">
				<template slot-scope="scope">
					<el-button size="mini" @click="refDevice(scope.row)">刷新</el-button>
					<el-button size="mini" @click="currentDevice=scope.row;showDevicePushConfirm=true">查看通道</el-button>
				</template>
			</el-table-column>
		</el-table>
		
		<!--推流信息确认框-->
		<el-dialog title="通道列表" :visible.sync="showDevicePushConfirm" width="40%">
			<el-table :data="getcurrentDeviceChannels" style="width: 100%">
				<el-table-column prop="channelId" label="通道编号" width="210">
				</el-table-column>
				<el-table-column prop="name" label="通道名称" width="180">
				</el-table-column>
				<el-table-column prop="address" label="地址">
				</el-table-column>
				<el-table-column label="操作" width="240" align="center">
					<template slot-scope="scope">
						<el-button size="mini" @click="sendDevicePush(scope.row)">预览视频</el-button>
						<el-button size="mini" @click="sendDevicePush(scope.row)">录像查询</el-button>
					</template>
				</el-table-column>
			</el-table>
		</el-dialog>
		
	</div>

</template>

<script>
	export default {
		name: 'device',
		props: {
			deviceList: Array,
		},
		data() {

		},
		methods: {

		}
	}
</script>

<style>
</style>
