Browse Source

修改指挥调度路由

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

16
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",
@ -226,8 +226,8 @@ export default [
name: "InformationReleaseManagement",
path: "/service/InformationReleaseManagement",
component: "service/InformationReleaseManagement/index.vue"
},
{
},
{
title: "公众服务统计",
name: "publicService",
path: "/service/publicService",

16
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,
@ -223,4 +237,4 @@ const constantRoutes = [
]
export { constantRoutes };
export { constantRoutes };

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

@ -3,7 +3,7 @@ const state = {
recentPages: [],
isRecentOpen:"",
}
const mutations = {
saveRecent(state){
localStorage.setItem("recentPages", JSON.stringify(state.recentPages));
@ -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);
},
@ -65,7 +67,7 @@ const state = {
}
}
const getters = {
isRecentOpen(state){
if (state.isRecentOpen === ""){
@ -80,4 +82,4 @@ const getters = {
state,
getters,
mutations,
}
}

14
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>
@ -86,7 +86,7 @@ export default {
}
// this.$emit("onChange", node, key);
this.$route.path != node.path && this.$router.push(node.path);
}
}
@ -134,7 +134,7 @@ export default {
::v-deep .el-icon-arrow-down {
display: none !important;
}
::v-deep .el-submenu__title{
@include btnClass;
}

21
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);
@ -201,7 +212,7 @@ export default{
}
</script>
<style lang="scss" scoped>
.recent_pages{
.recent_pages{
display: flex; flex-direction: row; align-items:stretch; padding: 0 20px;
h4{ width: 110px; height: 32px; line-height: 32px; text-align: center; margin: 0; padding: 0; font-weight: bold; color: #3de8ff; display: flex; align-items: center; justify-content: center;
.iconfont{ margin-right: 3px;}
@ -222,7 +233,7 @@ export default{
position: relative;
height: 30px;
padding: 0 3px;
.btn_main {
cursor: pointer;
background-image: linear-gradient(180deg, #005c79 0%, #009bcc 100%);
@ -266,4 +277,4 @@ export default{
}
}
}
</style>
</style>

Loading…
Cancel
Save