Skip to content

Commit

Permalink
fix(router): fix the problem that the home device list cannot jump
Browse files Browse the repository at this point in the history
  • Loading branch information
dgiot-fe committed Apr 22, 2022
1 parent b00af1c commit 1c16b44
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/dgiot/components/DgiotBaiduMap/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@
},
markerClustererShow: {
type: Boolean,
default: false,
default: true,
},
busShow: {
type: Boolean,
Expand Down Expand Up @@ -423,7 +423,7 @@
},
scrollWheelZoom: {
type: Boolean,
default: false,
default: true,
},
center: {
type: Object,
Expand Down
2 changes: 2 additions & 0 deletions src/dgiot/plugins/permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ DgiotProgress.configure({
showSpinner: false,
})
router.beforeEach(async (to, from, next) => {
window.errRoute = null
store.dispatch('routes/setRoutesOpenTime', {
router: to.meta.component,
timestamp: moment(new Date()).valueOf(),
})
if (to.name == '404') {
window.errRoute = to
console.log('dgiot router log---')
console.log(to)
return false
Expand Down
1 change: 1 addition & 0 deletions src/views/DeviceCloud/manage/devicelist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
:map-center="mapLabel.position"
:nav-show="true"
:scale-show="true"
:scroll-wheel-zoom="true"
/>
</el-card>
<span slot="footer" class="dialog-footer">
Expand Down
29 changes: 24 additions & 5 deletions src/views/DeviceCloud/manage/platform_overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,14 @@
<el-col :span="12">
<dgiot-icon icon="device-recover-fill" />
</el-col>
<el-col class="card-right" :span="12">
<router-link to="dashboard/device">
<p>{{ $translateTitle('home.dev_count') }}</p>
<p>{{ _dev_count }}</p>
</router-link>
<el-col
class="card-right"
:span="12"
style="cursor: pointer"
@click.native="goDevice()"
>
<p>{{ $translateTitle('home.dev_count') }}</p>
<p>{{ _dev_count }}</p>
</el-col>
</el-card>
</el-col>
Expand Down Expand Up @@ -1286,6 +1289,14 @@
product: name,
},
})
console.log(window.errRoute)
if (window?.errRoute?.name)
this.$router.push({
path: '/dashboard/devicelist',
query: {
product: name,
},
})
},
_goDevice(item) {
this.$router.push({
Expand All @@ -1294,6 +1305,14 @@
devicename: item.name,
},
})
console.log(window.errRoute)
if (window?.errRoute?.name)
this.$router.push({
path: '/dashboard/devicelist',
query: {
devicename: item.name,
},
})
},
goLink(type, item) {
switch (type) {
Expand Down

0 comments on commit 1c16b44

Please sign in to comment.