# rename detail view name, because will be chached if named 'detail'

This commit is contained in:
xianfuxing 2018-08-20 21:29:03 +08:00
parent 920b1da28d
commit 14919161eb
2 changed files with 6 additions and 7 deletions

View File

@ -57,13 +57,12 @@
<script> <script>
import { fetchDeviceLogs } from '@/api/counter' import { fetchDeviceLogs } from '@/api/counter'
export default { export default {
name: 'detail', name: 'deviceDetail',
data() { data() {
return { return {
listLoading: true, listLoading: true,
deviceLogs: [], deviceLogs: [],
total: 0, total: 0
deviceId: 868575028779264
} }
}, },
methods: { methods: {
@ -79,17 +78,17 @@ export default {
}, },
handleCurrentChange(page) { handleCurrentChange(page) {
this.listLoading = true this.listLoading = true
const device_id = this.deviceId const device_id = this.$store.getters.deviceID
this.getDeviceLogs({ device_id, page }) this.getDeviceLogs({ device_id, page })
}, },
handleSizeChange(page) { handleSizeChange(page) {
this.listLoading = true this.listLoading = true
const device_id = this.deviceId const device_id = this.$store.getters.deviceID
this.getDeviceLogs({ device_id, page }) this.getDeviceLogs({ device_id, page })
} }
}, },
created() { created() {
const device_id = this.deviceId const device_id = this.$store.getters.deviceID
this.getDeviceLogs({ device_id }) this.getDeviceLogs({ device_id })
console.log(this.$store.getters.deviceID) console.log(this.$store.getters.deviceID)
} }

View File

@ -141,7 +141,7 @@ export default {
handleDeviceClick(deviceID) { handleDeviceClick(deviceID) {
// console.log(deviceID) // console.log(deviceID)
this.$store.dispatch('chnageDeviceID', deviceID).then(() => { this.$store.dispatch('chnageDeviceID', deviceID).then(() => {
// this.$router.push('/counter/detail') this.$router.push('/counter/detail')
}).catch(() => { }).catch(() => {
console.log('Err: get device_id failed in device page') console.log('Err: get device_id failed in device page')
}) })