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

View File

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

View File

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