修改跳转

dev
夜笙歌 1 year ago
parent 7a62384750
commit 33d3e978e5

@ -14,7 +14,7 @@
{{ name }} <i class="el-icon-arrow-down el-icon--right"></i> {{ name }} <i class="el-icon-arrow-down el-icon--right"></i>
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<div class="topNavScroll" style="height: 300px;overflow: auto;background-color: #053563;padding: 0;border: none;"> <div class="topNavScroll" style="max-height: 300px;overflow: auto;background-color: #053563;padding: 0;border: none;">
<el-dropdown-item v-for="i in selectSecnesList" :key="i.sceneId" <el-dropdown-item v-for="i in selectSecnesList" :key="i.sceneId"
:command="{router:i.router,name:i.sceneName,sceneId:i.sceneId}"> :command="{router:i.router,name:i.sceneName,sceneId:i.sceneId}">
<span style="color: #f8fefd"> <span style="color: #f8fefd">
@ -78,7 +78,7 @@ export default {
if (!this.$store.getters.sceneId) { if (!this.$store.getters.sceneId) {
this.$router.replace({path: "/board/index"}) this.$router.replace({path: "/board/index"})
} }
if (this.$route.name === 'SmartScene' || this.$route.name === 'GPS' || this.$route.name === 'index' || this.$store.getters.sceneId) { if (this.$route.name === 'smartScene' || this.$route.name === 'GPS' || this.$route.name === 'index' || this.$store.getters.sceneId) {
} else { } else {
if (this.$store.state.user.permissions.includes('business:monitor:index') || this.$store.state.user.permissions.includes('*:*:*')) { if (this.$store.state.user.permissions.includes('business:monitor:index') || this.$store.state.user.permissions.includes('*:*:*')) {
await this.$router.replace({path: "/board/index"}); await this.$router.replace({path: "/board/index"});
@ -88,7 +88,7 @@ export default {
} }
} }
await this.setSelectSecnes() await this.setSelectSecnes()
if (this.$route.name === 'SmartScene' || this.$route.name === 'GPS') { if (this.$route.name === 'smartScene' || this.$route.name === 'GPS') {
if (this.$route.query?.name) { if (this.$route.query?.name) {
this.name = this.$route.query?.name this.name = this.$route.query?.name
} else { } else {

@ -21,6 +21,7 @@ export default {
} else { } else {
selectSecnes().then((e)=>{ selectSecnes().then((e)=>{
let data = e.data.find(e=> e.defaultFlag === '1') let data = e.data.find(e=> e.defaultFlag === '1')
this.$store.dispatch('app/setSceneId', data.sceneId)
this.$router.push({path: '/board/'+data.router+'?name='+data.sceneName}) this.$router.push({path: '/board/'+data.router+'?name='+data.sceneName})
}) })
// this.$router.push({path: '/board/smartScene'}) // this.$router.push({path: '/board/smartScene'})

Loading…
Cancel
Save