Browse Source

修改指挥调度路由

wangqin
lau572 6 months ago
parent
commit
13d0b83659
  1. 12
      ruoyi-ui/src/common/menuData.js
  2. 14
      ruoyi-ui/src/router/index.js
  3. 4
      ruoyi-ui/src/store/modules/menu.js
  4. 10
      ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/CustomMenu.vue
  5. 15
      ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/index.vue

12
ruoyi-ui/src/common/menuData.js

@ -88,12 +88,12 @@ export default [
name: "emergencyProcessManagement",
component: "control/event/emergencyProcessManagement/index.vue",
},
{
title: "指挥调度",
path: "/control/event/commandDispatch",
name: "commandDispatch",
component: "control/event/commandDispatch/index.vue",
},
// {
// title: "指挥调度",
// path: "/control/event/commandDispatch",
// name: "commandDispatch",
// component: "control/event/commandDispatch/index.vue",
// },
{
title: "管控事件分析",
path: "/control/event/governanceAnalysis",

14
ruoyi-ui/src/router/index.js

@ -90,6 +90,20 @@ const constantRoutes = [
}
]
},
{
path: '/control//event',
component: Layout,
hidden: true,
redirect: 'noredirect',
children: [
{
path: 'commandDispatch',
component: () => import('@/views/JiHeExpressway/pages/control/event/commandDispatch/index'),
name: 'commandDispatch',
meta: { title: '指挥调度', icon: 'user' }
}
]
},
// {
// path: '/system/user-auth',
// component: Layout,

4
ruoyi-ui/src/store/modules/menu.js

@ -25,8 +25,10 @@ const state = {
if (!temp){
item.active = true;
state.recentPages.push(item);
} else {
let i = state.recentPages.findIndex(unit => unit.path == item.path);
state.recentPages[i] = item;
}
mutations.saveRecent(state);
},

10
ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/CustomMenu.vue

@ -1,32 +1,32 @@
<template>
<el-menu :default-active="activeIndex" mode="horizontal" @select="handleSelect" class="menuBox">
<template v-for="(item, index) in menuData">
<component :index="prefix + '_' + index" v-if="item.children" is="el-submenu" class="menuItem" :class="{ 'menuActive': activeIndex.includes(prefix + '_' + index) }">
<component :index="prefix + '_' + index" v-if="item.children" is="el-submenu" class="menuItem" :class="{ 'menuActive': activeIndex && activeIndex.includes(prefix + '_' + index) }">
<template slot="title">{{ item.title }}</template>
<!-- 第二层菜单 -->
<template v-for="(item1, index1) in item.children">
<component :index="prefix + '_' + index + '-' + index1" v-if="item1.children" is="el-submenu" :class="{ 'menuActive': activeIndex.includes(prefix + '_' + index + '-' + index1) }">
<component :index="prefix + '_' + index + '-' + index1" v-if="item1.children" is="el-submenu" :class="{ 'menuActive': activeIndex && activeIndex.includes(prefix + '_' + index + '-' + index1) }">
<template slot="title">
<p index="1">{{ item1.title }}</p>
</template>
<!-- 第三层菜单 -->
<template v-for="(item2, index2) in item1.children">
<component :index="prefix + '_' + index + '-' + index1 + '-' + index2" is="el-menu-item" :class="{ 'menuActive': activeIndex.includes(prefix + '_' + index + '-' + index1 + '-' + index2) }">{{
<component :index="prefix + '_' + index + '-' + index1 + '-' + index2" is="el-menu-item" :class="{ 'menuActive': activeIndex && activeIndex.includes(prefix + '_' + index + '-' + index1 + '-' + index2) }">{{
item2.title }}
</component>
</template>
</component>
<component :index="prefix + '_' + index + '-' + index1" v-else is="el-menu-item" :class="{ 'menuActive': activeIndex.includes(prefix + '_' + index + '-' + index1) }">{{ item1.title
<component :index="prefix + '_' + index + '-' + index1" v-else is="el-menu-item" :class="{ 'menuActive': activeIndex && activeIndex.includes(prefix + '_' + index + '-' + index1) }">{{ item1.title
}}
</component>
</template>
</component>
<component :index="prefix + '_' + index" v-else is="el-menu-item" class="menuItem"
:class="{ 'menuActive': activeIndex.includes(prefix + '_' + index) }">{{
:class="{ 'menuActive': activeIndex && activeIndex.includes(prefix + '_' + index) }">{{
item.title }}
</component>
</template>

15
ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/index.vue

@ -97,7 +97,8 @@ export default{
handler(newV){
this.addRecent({
title : newV.meta.title,
path : newV.path
path : newV.path,
query : newV.query
});
},
immediate : true
@ -108,7 +109,17 @@ export default{
methods:{
...mapMutations("menu", ["addRecent", "removeRecent","pinRecent"]),
onClickItem(item){
this.$route.path != item.path && this.$router.push(item.path);
if (this.$route.path != item.path){
if (Object.keys(item.query).length > 0){
this.$router.push({
path: item.path,
query: item.query
});
} else {
this.$router.push(item.path);
}
}
},
onPin(item){
this.pinRecent(item);

Loading…
Cancel
Save