Merge remote-tracking branch 'origin/master'

dev
xins 1 year ago
commit d2c20ebb54

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

@ -0,0 +1,16 @@
<template>
<div>
<app-main/>
</div>
</template>
<script>
import {AppMain} from './components'
export default {
name: 'BoardIndex',
components: {
AppMain,
},
}
</script>

@ -89,48 +89,48 @@ export const constantRoutes = [
] ]
}, },
{ // {
path: '/board1', // path: '/board1',
component: () => import('@/views/board/index'), // component: () => import('@/views/board/index'),
name: 'Index', // name: 'Index',
meta: { title: 'index', icon: 'dashboard', affix: true } // meta: { title: 'index', icon: 'dashboard', affix: true }
}, // },
{ // {
path: '/board2', // path: '/board2',
component: () => import('@/views/board/equipmentMonitoring'), // component: () => import('@/views/board/equipmentMonitoring'),
name: 'Index', // name: 'Index',
meta: { title: 'equipmentMonitoring', icon: 'dashboard', affix: true } // meta: { title: 'equipmentMonitoring', icon: 'dashboard', affix: true }
}, // },
{ // {
path: '/board3', // path: '/board3',
component: () => import('@/views/board/GPS'), // component: () => import('@/views/board/GPS'),
name: 'Index', // name: 'Index',
meta: { title: 'GPS', icon: 'dashboard', affix: true } // meta: { title: 'GPS', icon: 'dashboard', affix: true }
}, // },
{ // {
path: '/board4', // path: '/board4',
component: () => import('@/views/board/senso'), // component: () => import('@/views/board/senso'),
name: 'Index', // name: 'Index',
meta: { title: 'senso', icon: 'dashboard', affix: true } // meta: { title: 'senso', icon: 'dashboard', affix: true }
}, // },
{ // {
path: '/board5', // path: '/board5',
component: () => import('@/views/board/smartScene'), // component: () => import('@/views/board/smartScene'),
name: 'Index', // name: 'Index',
meta: { title: 'smartScene', icon: 'dashboard', affix: true } // meta: { title: 'smartScene', icon: 'dashboard', affix: true }
}, // },
{ // {
path: '/board6', // path: '/board6',
component: () => import('@/views/board/equipment'), // component: () => import('@/views/board/equipment'),
name: 'Index', // name: 'Index',
meta: { title: 'equipment', icon: 'dashboard', affix: true } // meta: { title: 'equipment', icon: 'dashboard', affix: true }
}, // },
{ // {
path: '/board7', // path: '/board7',
component: () => import('@/views/board/allScenes'), // component: () => import('@/views/board/allScenes'),
name: 'Index', // name: 'Index',
meta: { title: 'allScenes', icon: 'dashboard', affix: true } // meta: { title: 'allScenes', icon: 'dashboard', affix: true }
}, // },
] ]
// 动态路由,基于用户权限动态去加载 // 动态路由,基于用户权限动态去加载

@ -2,6 +2,7 @@ import auth from '@/plugins/auth'
import router, { constantRoutes, dynamicRoutes } from '@/router' import router, { constantRoutes, dynamicRoutes } from '@/router'
import { getRouters } from '@/api/menu' import { getRouters } from '@/api/menu'
import Layout from '@/layout/index' import Layout from '@/layout/index'
import BoardIndex from '@/layout/boardIndex'
import ParentView from '@/components/ParentView' import ParentView from '@/components/ParentView'
import InnerLink from '@/layout/components/InnerLink' import InnerLink from '@/layout/components/InnerLink'
@ -58,7 +59,7 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
if (type && route.children) { if (type && route.children) {
route.children = filterChildren(route.children) route.children = filterChildren(route.children)
} }
if (route.component) { if (route.component && route.name !== 'Board') {
// Layout ParentView 组件特殊处理 // Layout ParentView 组件特殊处理
if (route.component === 'Layout') { if (route.component === 'Layout') {
route.component = Layout route.component = Layout
@ -70,6 +71,9 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
route.component = loadView(route.component) route.component = loadView(route.component)
} }
} }
if(route.name === 'Board'){
route.component = BoardIndex
}
if (route.children != null && route.children && route.children.length) { if (route.children != null && route.children && route.children.length) {
route.children = filterAsyncRouter(route.children, route, type) route.children = filterAsyncRouter(route.children, route, type)
} else { } else {

Loading…
Cancel
Save