# bug fixed, empty screen
This commit is contained in:
parent
8416b0e17c
commit
5c0a2e12e4
|
@ -78,6 +78,12 @@
|
||||||
import { fetchDeviceList, fetchDeviceLogs } from '@/api/counter'
|
import { fetchDeviceList, fetchDeviceLogs } from '@/api/counter'
|
||||||
import Screen from './components/screen'
|
import Screen from './components/screen'
|
||||||
import Chart from './components/chart'
|
import Chart from './components/chart'
|
||||||
|
|
||||||
|
const defaultLastItem = {
|
||||||
|
mosq_count: '0',
|
||||||
|
signal: '0',
|
||||||
|
energy: '0'
|
||||||
|
}
|
||||||
export default {
|
export default {
|
||||||
name: 'deviceDetail',
|
name: 'deviceDetail',
|
||||||
components: {
|
components: {
|
||||||
|
@ -123,6 +129,9 @@ export default {
|
||||||
this.lineChartData.total.xAxis = dateList.reverse()
|
this.lineChartData.total.xAxis = dateList.reverse()
|
||||||
this.listLoading = false
|
this.listLoading = false
|
||||||
this.lastItem = this.deviceLogs[0]
|
this.lastItem = this.deviceLogs[0]
|
||||||
|
if (this.lastItem === undefined) {
|
||||||
|
this.lastItem = defaultLastItem
|
||||||
|
}
|
||||||
this.flag = true
|
this.flag = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue