# up device list

This commit is contained in:
xianfuxing 2018-08-18 15:45:01 +08:00
parent a08b33d6d8
commit 781bc88e47
3 changed files with 37 additions and 18 deletions

View File

@ -7,35 +7,43 @@
v-loading="listLoading"
:data="deviceList"
style="width: 100%">
<el-table-column
type="index"
label="序号">
</el-table-column>
<el-table-column
prop="device_id"
label="设备ID"
min-width="180">
</el-table-column>
<el-table-column
prop="device_name"
label="设备名称"
prop="status"
label="状态"
min-width="100">
<template slot-scope="scope">
<span v-if="scope.row.status==0" style="color: #F56C6C">离线</span>
<span v-if="scope.row.status==1" style="color: #67C23A">在线</span>
</template>
</el-table-column>
<el-table-column
prop="chip_type"
label="芯片类型"
min-width="100">
prop="count"
label="计数"
min-width="120">
</el-table-column>
<el-table-column
prop="chip_id"
label="芯片ID"
min-width="180">
prop="signal"
label="信号"
min-width="120">
</el-table-column>
<el-table-column
prop="last_connect"
label="上次连接时间"
min-width="180">
prop="energy"
label="电量"
min-width="120">
</el-table-column>
<el-table-column
prop="last_offline_time"
label="上次离线时间"
min-width="180">
prop="time"
label="时间"
min-width="120">
</el-table-column>
</el-table>
</div>
@ -59,6 +67,13 @@ export default {
this.listLoading = false
})
}
// handleStatusStyle({ row, column, rowIndex, columnIndex }) {
// if (rowIndex === 1 && columnIndex === 1) {
// return 'color: #67C23A'
// } else {
// return ''
// }
// }
},
created() {
this.getDevices()
@ -70,5 +85,10 @@ export default {
</script>
<style lang="scss">
.device-online {
color: #67C23A
}
.device-offline {
color: #F56C6C
}
</style>

View File

@ -1,7 +1,7 @@
<template>
<div class="app-container">
<p class="warn-content">
灭蚊侠提供健康环境你值得拥有
这里是首页
</p>
</div>
</template>

View File

@ -6,8 +6,7 @@
style="width: 100%">
<el-table-column
type="index"
label="序号"
min-width="80">
label="序号">
</el-table-column>
<el-table-column
prop="date"