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", name: "emergencyProcessManagement",
component: "control/event/emergencyProcessManagement/index.vue", component: "control/event/emergencyProcessManagement/index.vue",
}, },
{ // {
title: "指挥调度", // title: "指挥调度",
path: "/control/event/commandDispatch", // path: "/control/event/commandDispatch",
name: "commandDispatch", // name: "commandDispatch",
component: "control/event/commandDispatch/index.vue", // component: "control/event/commandDispatch/index.vue",
}, // },
{ {
title: "管控事件分析", title: "管控事件分析",
path: "/control/event/governanceAnalysis", 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', // path: '/system/user-auth',
// component: Layout, // component: Layout,

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

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

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

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

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

@ -97,7 +97,8 @@ export default{
handler(newV){ handler(newV){
this.addRecent({ this.addRecent({
title : newV.meta.title, title : newV.meta.title,
path : newV.path path : newV.path,
query : newV.query
}); });
}, },
immediate : true immediate : true
@ -108,7 +109,17 @@ export default{
methods:{ methods:{
...mapMutations("menu", ["addRecent", "removeRecent","pinRecent"]), ...mapMutations("menu", ["addRecent", "removeRecent","pinRecent"]),
onClickItem(item){ 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){ onPin(item){
this.pinRecent(item); this.pinRecent(item);

Loading…
Cancel
Save