# bug fixed, empty screen

This commit is contained in:
xianfuxing 2018-08-26 21:07:37 +08:00
parent 8416b0e17c
commit 5c0a2e12e4
1 changed files with 9 additions and 0 deletions

View File

@ -78,6 +78,12 @@
import { fetchDeviceList, fetchDeviceLogs } from '@/api/counter'
import Screen from './components/screen'
import Chart from './components/chart'
const defaultLastItem = {
mosq_count: '0',
signal: '0',
energy: '0'
}
export default {
name: 'deviceDetail',
components: {
@ -123,6 +129,9 @@ export default {
this.lineChartData.total.xAxis = dateList.reverse()
this.listLoading = false
this.lastItem = this.deviceLogs[0]
if (this.lastItem === undefined) {
this.lastItem = defaultLastItem
}
this.flag = true
})
},