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", 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",
@ -226,8 +226,8 @@ export default [
name: "InformationReleaseManagement", name: "InformationReleaseManagement",
path: "/service/InformationReleaseManagement", path: "/service/InformationReleaseManagement",
component: "service/InformationReleaseManagement/index.vue" component: "service/InformationReleaseManagement/index.vue"
}, },
{ {
title: "公众服务统计", title: "公众服务统计",
name: "publicService", name: "publicService",
path: "/service/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', // path: '/system/user-auth',
// component: Layout, // 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: [], recentPages: [],
isRecentOpen:"", isRecentOpen:"",
} }
const mutations = { const mutations = {
saveRecent(state){ saveRecent(state){
localStorage.setItem("recentPages", JSON.stringify(state.recentPages)); localStorage.setItem("recentPages", JSON.stringify(state.recentPages));
@ -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);
}, },
@ -65,7 +67,7 @@ const state = {
} }
} }
const getters = { const getters = {
isRecentOpen(state){ isRecentOpen(state){
if (state.isRecentOpen === ""){ if (state.isRecentOpen === ""){
@ -80,4 +82,4 @@ const getters = {
state, state,
getters, getters,
mutations, mutations,
} }

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

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

Loading…
Cancel
Save