diff --git a/src/api/counter.js b/src/api/counter.js
index acbdc76..cae40ad 100644
--- a/src/api/counter.js
+++ b/src/api/counter.js
@@ -12,7 +12,7 @@ export function fetchDeviceList(query) {
// device log api
export function fetchDeviceLogs(query) {
return request({
- url: '/api/counter/logs/',
+ url: '/api/counter/device/logs/history/',
method: 'get',
params: query
})
diff --git a/src/views/counter/components/screen.vue b/src/views/counter/components/screen.vue
index edf27a3..06ee523 100644
--- a/src/views/counter/components/screen.vue
+++ b/src/views/counter/components/screen.vue
@@ -30,14 +30,14 @@
- 状态:
离线
在线
@@ -56,8 +56,7 @@ export default {
name: 'screen',
props: {
deviceID: String,
- lastItem: Object,
- status: Number
+ lastItem: Object
},
data() {
return {
@@ -73,7 +72,7 @@ export default {
// return this.lastItem.calc_time.substr(0, 16).split('')
},
lastCount() {
- const count = this.lastItem.mosq_count
+ const count = this.lastItem.count
const qty = 'Qty.' + ' '.repeat(10 - count.length) + '00' + count
return qty.split('')
}
diff --git a/src/views/counter/detail.vue b/src/views/counter/detail.vue
index 3ffb213..297db01 100644
--- a/src/views/counter/detail.vue
+++ b/src/views/counter/detail.vue
@@ -6,7 +6,6 @@
@@ -37,29 +36,13 @@
min-width="150">
-
-
-
-
-
-
@@ -81,6 +64,7 @@ import Chart from './components/chart'
const defaultLastItem = {
mosq_count: '0',
+ status: '0',
signal: '0',
energy: '0'
}
@@ -104,7 +88,6 @@ export default {
activeName: 'screen',
total: 0,
lastItem: {},
- status: 0,
showChart: false,
flag: false
}
@@ -122,23 +105,22 @@ export default {
const dateList = []
this.deviceLogs = response.data.results
this.deviceLogs.forEach((item, index) => {
- this.lineChartData.total.historyData.push(item.mosq_count)
- dateList.push(item.calc_time.substr(11))
+ this.lineChartData.total.historyData.push(item.total)
+ dateList.push(item.date.substr(5))
})
this.total = response.data.count
this.lineChartData.total.xAxis = dateList.reverse()
this.listLoading = false
- this.lastItem = this.deviceLogs[0]
- if (this.lastItem === undefined) {
- this.lastItem = defaultLastItem
- }
- this.flag = true
})
},
getDevices(params) {
fetchDeviceList(params).then(response => {
this.deviceList = response.data.results
- this.status = this.deviceList[0].status
+ this.lastItem = this.deviceList[0]
+ if (this.lastItem === undefined) {
+ this.lastItem = defaultLastItem
+ }
+ this.flag = true
})
},
coordinate(row, column) {
@@ -171,6 +153,6 @@ export default {
opacity: 0;
}
.v-enter-active, .v-leave-active {
- transition: opacity 1.5s
+ transition: opacity 1s
}