修改跳转

dev
夜笙歌 1 year ago
parent da13e574c2
commit 7b691403db

@ -2,18 +2,21 @@
<div>
<div class="title">智慧物联监控平台</div>
<div>
<div :class="`menu ${nowMenu==='1'? 'menuClick' :''}`" style="left: 2%" @click="toLink('index')">
<div :class="`menu ${nowMenu==='1'? 'menuClick' :''}`" style="left: 2%" @click="toLink('index')">
<span>
监控主页
</span>
</div>
<div :class="`menu ${nowMenu==='2'? 'menuClick' :''}`" style="left: 9%">
<el-dropdown trigger="click" @command="dropdownLink">
<el-dropdown trigger="click" @command="dropdownLink">
<span class="el-dropdown-link">
{{ name }} <i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown" >
<el-dropdown-item :command="{router:i.router,name:i.sceneName}" v-for="i in selectSecnesList">{{ i.sceneName }}</el-dropdown-item>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="i in selectSecnesList" :command="{router:i.router,name:i.sceneName}">{{
i.sceneName
}}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
@ -29,13 +32,13 @@
</div>
</div>
<div class="right">
<div class="right" >
<span>
</span>
</div>
<div class="rightImg">
<div class="rightImg" @click="toIndex">
</div>
</div>
</template>
@ -49,7 +52,7 @@ export default {
data() {
return {
selectSecnesList: [],
name:'智慧场景'
name: '智慧场景'
}
},
props: {
@ -61,8 +64,8 @@ export default {
mounted() {
this.setSelectSecnes()
if(this.$route.name === 'SmartScene'){
if(this.$route.query?.name){
if (this.$route.name === 'SmartScene') {
if (this.$route.query?.name) {
this.name = this.$route.query?.name
}
}
@ -72,12 +75,16 @@ export default {
const {data} = await selectSecnes()
this.selectSecnesList = data
},
toLink(e){
this.$router.push({ path: "/board/"+e });
toLink(e) {
this.$router.push({path: "/board/" + e});
},
dropdownLink(e){
dropdownLink(e) {
this.name = e.name
this.$router.push({ path: "/board/"+(e.router||'smartScene'),query: {name: e.name} });
this.$router.push({path: "/board/" + (e.router || 'smartScene'), query: {name: e.name}});
},
toIndex() {
console.log(123)
this.$router.push({path: "/index"});
}
}
};

Loading…
Cancel
Save