From 11e9e5fec09106f3d127b89676e398752eb06a25 Mon Sep 17 00:00:00 2001 From: xianfuxing Date: Wed, 24 Jun 2020 11:48:18 +0800 Subject: [PATCH] =?UTF-8?q?#=20=E6=9B=B4=E6=96=B0=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/counter/detail.vue | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/views/counter/detail.vue b/src/views/counter/detail.vue index ccb1f20..93c12e9 100644 --- a/src/views/counter/detail.vue +++ b/src/views/counter/detail.vue @@ -79,7 +79,7 @@ @@ -112,7 +112,7 @@ @@ -159,6 +159,8 @@ export default { device_id: undefined, page: 1, limit: 20, + start: undefined, + end: undefined, ordering: '-create_time' }, deviceHistoryListQuery: { @@ -211,13 +213,13 @@ export default { this.listLoading = false }) }, - getDeviceLogsTableHistory(params) { - fetchDeviceLogsHistory(params).then(response => { - this.deviceLogs = response.data.results - this.logsTotal = response.data.count - this.listLoading = false - }) - }, + // getDeviceLogsTableHistory(params) { + // fetchDeviceLogsHistory(params).then(response => { + // this.deviceLogs = response.data.results + // this.logsTotal = response.data.count + // this.listLoading = false + // }) + // }, getDeviceTempLog(params) { fetchDeviceTempLog(params).then(response => { const dateList = [] @@ -230,6 +232,7 @@ export default { } }) this.HumitureData.total.xAxis = dateList + this.tempTotal = response.data.count this.tempLoading = false }) }, @@ -268,11 +271,15 @@ export default { const [start, end] = value this.deviceHistoryListQuery.start = start this.deviceHistoryListQuery.end = end + this.deviceTempListQuery.start = start + this.deviceTempListQuery.end = end } }, handleFilter() { this.deviceHistoryListQuery.page = 1 + this.deviceTempListQuery.page = 1 this.getDeviceLogsHistory(this.deviceHistoryListQuery) + this.getDeviceTempTableLog(this.deviceTempListQuery) }, handleCurrentChange(page) { this.listLoading = true @@ -292,14 +299,14 @@ export default { this.tempLoading = true this.deviceTempListQuery.page = page this.deviceTempListQuery.device_id = this.device_id - this.getDeviceTempTableLog(this.deviceTempListQuery) + this.getDeviceTempLog(this.deviceTempListQuery) }, - handleTempSizeChange(page) { + handleTempSizeChange(val) { this.tempLoading = true - this.deviceTempListQuery.page = page + this.deviceTempListQuery.limit = val this.deviceTempListQuery.device_id = device_id const device_id = this.$store.getters.deviceID - this.getDeviceTempTableLog(this.deviceTempListQuery) + this.getDeviceTempLog(this.deviceTempListQuery) }, handleTabClick(tab, event) { // console.log(tab, event) @@ -320,7 +327,7 @@ export default { this.deviceHistoryListQuery.device_id = this.device_id this.deviceTempListQuery.device_id = this.device_id this.getDevices({ device_id: this.device_id }) - this.getDeviceLogsTableHistory({ device_id: this.device_id, limit: 20 }) + // this.getDeviceLogsTableHistory({ device_id: this.device_id, limit: 20 }) this.getDeviceTempLog({ device_id: this.device_id, last_day: 1, limit: 30 }) this.getDeviceTempTableLog(this.deviceTempListQuery) }