# bug fixed, 添加device logs hisory api
This commit is contained in:
parent
781960bf17
commit
be79586a4d
|
@ -9,8 +9,17 @@ export function fetchDeviceList(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// device log api
|
||||
// device log list api
|
||||
export function fetchDeviceLogs(query) {
|
||||
return request({
|
||||
url: '/api/counter/logs/',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// device logs history api
|
||||
export function fetchDeviceLogsHistory(query) {
|
||||
return request({
|
||||
url: '/api/counter/device/logs/history/',
|
||||
method: 'get',
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { fetchDeviceList, fetchDeviceLogs } from '@/api/counter'
|
||||
import { fetchDeviceList, fetchDeviceLogsHistory } from '@/api/counter'
|
||||
import Screen from './components/screen'
|
||||
import Chart from './components/chart'
|
||||
|
||||
|
@ -100,8 +100,8 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
getDeviceLogs(params) {
|
||||
fetchDeviceLogs(params).then(response => {
|
||||
getDeviceLogsHistory(params) {
|
||||
fetchDeviceLogsHistory(params).then(response => {
|
||||
const dateList = []
|
||||
this.deviceLogs = response.data.results
|
||||
this.deviceLogs.forEach((item, index) => {
|
||||
|
@ -142,7 +142,7 @@ export default {
|
|||
},
|
||||
created() {
|
||||
const device_id = this.$store.getters.deviceID
|
||||
this.getDeviceLogs({ device_id })
|
||||
this.getDeviceLogsHistory({ device_id })
|
||||
this.getDevices({ device_id })
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue