修改路由

dev
夜笙歌 1 year ago
parent 308f1000a4
commit da13e574c2

@ -2,27 +2,27 @@
<div>
<div class="title">智慧物联监控平台</div>
<div>
<div :class="`menu ${nowMenu==='1'? 'menuClick' :''}`" style="left: 2%">
<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">
<el-dropdown trigger="click" @command="dropdownLink">
<span class="el-dropdown-link">
智慧场景 <i class="el-icon-arrow-down el-icon--right"></i>
{{ name }} <i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="i in selectSecnesList">{{ i.sceneName }}</el-dropdown-item>
<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>
</el-dropdown>
</div>
<div :class="`menu ${nowMenu==='3'? 'menuClick' :''}`" style="left: 16%">
<div :class="`menu ${nowMenu==='3'? 'menuClick' :''}`" style="left: 16%" @click="toLink('equipmentMonitoring')">
<span>
设备监测
</span>
</div>
<div :class="`menu ${nowMenu==='4'? 'menuClick' :''}`" style="left: 23%">
<div :class="`menu ${nowMenu==='4'? 'menuClick' :''}`" style="left: 23%" @click="toLink('senso')">
<span>
传感器汇总
</span>
@ -48,7 +48,8 @@ import {
export default {
data() {
return {
selectSecnesList: []
selectSecnesList: [],
name:'智慧场景'
}
},
props: {
@ -60,11 +61,23 @@ export default {
mounted() {
this.setSelectSecnes()
if(this.$route.name === 'SmartScene'){
if(this.$route.query?.name){
this.name = this.$route.query?.name
}
}
},
methods: {
async setSelectSecnes() {
const {data} = await selectSecnes()
this.selectSecnesList = data
},
toLink(e){
this.$router.push({ path: "/board/"+e });
},
dropdownLink(e){
this.name = e.name
this.$router.push({ path: "/board/"+(e.router||'smartScene'),query: {name: e.name} });
}
}
};

Loading…
Cancel
Save