From 308f1000a4164ac7d1f48b3ca0402f4b525ebdda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Tue, 19 Sep 2023 17:45:03 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/layout/boardIndex.vue | 16 +++++ ruoyi-ui/src/router/index.js | 84 ++++++++++++------------ ruoyi-ui/src/store/modules/permission.js | 6 +- 3 files changed, 63 insertions(+), 43 deletions(-) create mode 100644 ruoyi-ui/src/layout/boardIndex.vue diff --git a/ruoyi-ui/src/layout/boardIndex.vue b/ruoyi-ui/src/layout/boardIndex.vue new file mode 100644 index 0000000..99bd68b --- /dev/null +++ b/ruoyi-ui/src/layout/boardIndex.vue @@ -0,0 +1,16 @@ + + + diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 7045646..5882149 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -89,48 +89,48 @@ export const constantRoutes = [ ] }, - { - path: '/board1', - component: () => import('@/views/board/index'), - name: 'Index', - meta: { title: 'index', icon: 'dashboard', affix: true } - }, - { - path: '/board2', - component: () => import('@/views/board/equipmentMonitoring'), - name: 'Index', - meta: { title: 'equipmentMonitoring', icon: 'dashboard', affix: true } - }, - { - path: '/board3', - component: () => import('@/views/board/GPS'), - name: 'Index', - meta: { title: 'GPS', icon: 'dashboard', affix: true } - }, - { - path: '/board4', - component: () => import('@/views/board/senso'), - name: 'Index', - meta: { title: 'senso', icon: 'dashboard', affix: true } - }, - { - path: '/board5', - component: () => import('@/views/board/smartScene'), - name: 'Index', - meta: { title: 'smartScene', icon: 'dashboard', affix: true } - }, - { - path: '/board6', - component: () => import('@/views/board/equipment'), - name: 'Index', - meta: { title: 'equipment', icon: 'dashboard', affix: true } - }, - { - path: '/board7', - component: () => import('@/views/board/allScenes'), - name: 'Index', - meta: { title: 'allScenes', icon: 'dashboard', affix: true } - }, + // { + // path: '/board1', + // component: () => import('@/views/board/index'), + // name: 'Index', + // meta: { title: 'index', icon: 'dashboard', affix: true } + // }, + // { + // path: '/board2', + // component: () => import('@/views/board/equipmentMonitoring'), + // name: 'Index', + // meta: { title: 'equipmentMonitoring', icon: 'dashboard', affix: true } + // }, + // { + // path: '/board3', + // component: () => import('@/views/board/GPS'), + // name: 'Index', + // meta: { title: 'GPS', icon: 'dashboard', affix: true } + // }, + // { + // path: '/board4', + // component: () => import('@/views/board/senso'), + // name: 'Index', + // meta: { title: 'senso', icon: 'dashboard', affix: true } + // }, + // { + // path: '/board5', + // component: () => import('@/views/board/smartScene'), + // name: 'Index', + // meta: { title: 'smartScene', icon: 'dashboard', affix: true } + // }, + // { + // path: '/board6', + // component: () => import('@/views/board/equipment'), + // name: 'Index', + // meta: { title: 'equipment', icon: 'dashboard', affix: true } + // }, + // { + // path: '/board7', + // component: () => import('@/views/board/allScenes'), + // name: 'Index', + // meta: { title: 'allScenes', icon: 'dashboard', affix: true } + // }, ] // 动态路由,基于用户权限动态去加载 diff --git a/ruoyi-ui/src/store/modules/permission.js b/ruoyi-ui/src/store/modules/permission.js index 2287665..4e45738 100644 --- a/ruoyi-ui/src/store/modules/permission.js +++ b/ruoyi-ui/src/store/modules/permission.js @@ -2,6 +2,7 @@ import auth from '@/plugins/auth' import router, { constantRoutes, dynamicRoutes } from '@/router' import { getRouters } from '@/api/menu' import Layout from '@/layout/index' +import BoardIndex from '@/layout/boardIndex' import ParentView from '@/components/ParentView' import InnerLink from '@/layout/components/InnerLink' @@ -58,7 +59,7 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { if (type && route.children) { route.children = filterChildren(route.children) } - if (route.component) { + if (route.component && route.name !== 'Board') { // Layout ParentView 组件特殊处理 if (route.component === 'Layout') { route.component = Layout @@ -70,6 +71,9 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { route.component = loadView(route.component) } } + if(route.name === 'Board'){ + route.component = BoardIndex + } if (route.children != null && route.children && route.children.length) { route.children = filterAsyncRouter(route.children, route, type) } else { From da13e574c27d25c63c458093904bc3d59eb38599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Tue, 19 Sep 2023 18:04:11 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/components/BoardTopNav/index.vue | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/ruoyi-ui/src/components/BoardTopNav/index.vue b/ruoyi-ui/src/components/BoardTopNav/index.vue index f66ff2c..fe5d892 100644 --- a/ruoyi-ui/src/components/BoardTopNav/index.vue +++ b/ruoyi-ui/src/components/BoardTopNav/index.vue @@ -2,27 +2,27 @@
智慧物联监控平台
-
+
监控主页
- + - 智慧场景 + {{ name }} - - {{ i.sceneName }} + + {{ i.sceneName }}
-
+
设备监测
-
+
传感器汇总 @@ -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} }); } } }; From 7b691403dbb4bd96dbfeaee2b95213db24cff302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Tue, 19 Sep 2023 18:14:12 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/components/BoardTopNav/index.vue | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/ruoyi-ui/src/components/BoardTopNav/index.vue b/ruoyi-ui/src/components/BoardTopNav/index.vue index fe5d892..bc82330 100644 --- a/ruoyi-ui/src/components/BoardTopNav/index.vue +++ b/ruoyi-ui/src/components/BoardTopNav/index.vue @@ -2,18 +2,21 @@
智慧物联监控平台
-
+
监控主页
- + {{ name }} - - {{ i.sceneName }} + + {{ + i.sceneName + }} +
@@ -29,13 +32,13 @@
-
+
管 理
-
+
@@ -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"}); } } };