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) }