diff --git a/ruoyi-ui/src/assets/styles/JiHeExpressway.scss b/ruoyi-ui/src/assets/styles/JiHeExpressway.scss
index 0105eb62..87fb830d 100644
--- a/ruoyi-ui/src/assets/styles/JiHeExpressway.scss
+++ b/ruoyi-ui/src/assets/styles/JiHeExpressway.scss
@@ -142,6 +142,7 @@
// 导航菜单
.el-menu--popup {
+
border-radius: 0;
background: linear-gradient(180deg, rgba(6, 66, 88, 0.5) 0%, #064258 93%);
border: 1px solid;
@@ -151,6 +152,25 @@
rgba(55, 231, 255, 0)
)
10 10;
+
+
+ @mixin activeBtn {
+ color: #fff;
+ background: linear-gradient(90deg,
+ rgba(164, 255, 250, 0) 0%,
+ rgba(164, 255, 250, 0.42) 50%,
+ rgba(164, 255, 250, 0) 100%);
+ border: 1px solid;
+ border-image: linear-gradient(90deg,
+ rgba(190, 255, 246, 0.03) 0%,
+ rgba(190, 255, 246, 1) 50%,
+ rgba(190, 255, 246, 0.03) 100%) 1 1;
+
+ p {
+ color: #fff;
+ }
+ }
+
.el-submenu__title {
}
@@ -171,27 +191,17 @@
color: #00d1ff;
}
- &:hover {
- color: #fff;
- background: linear-gradient(
- 90deg,
- rgba(164, 255, 250, 0) 0%,
- rgba(164, 255, 250, 0.42) 50%,
- rgba(164, 255, 250, 0) 100%
- );
- border: 1px solid;
- border-image: linear-gradient(
- 90deg,
- rgba(190, 255, 246, 0.03) 0%,
- rgba(190, 255, 246, 1) 50%,
- rgba(190, 255, 246, 0.03) 100%
- )
- 1 1;
+ &:hover{
+ @include activeBtn;
}
p {
- color: #fff;
+ color: #00d1ff;
}
}
+ .el-menu-item.menuActive, .menuActive .el-submenu__title{
+ @include activeBtn;
+ }
+
.el-menu-item.is-active,
.el-submenu__title.is-active {
color: #fff;
diff --git a/ruoyi-ui/src/common/menuData.js b/ruoyi-ui/src/common/menuData.js
index d840231d..5a643ac5 100644
--- a/ruoyi-ui/src/common/menuData.js
+++ b/ruoyi-ui/src/common/menuData.js
@@ -199,6 +199,14 @@ export default [
path: "/datav/maintainQuery",
component: "datav/maintainQuery/index.vue",
}
+ // ,
+ // {
+ // title: "数字路网",
+ // name: "roadNet",
+ // path: "/datav/roadNet",
+ // component: "datav/roadNet/index.vue",
+ // hide:true
+ // }
],
},
{
diff --git a/ruoyi-ui/src/permission.js b/ruoyi-ui/src/permission.js
index d9b5789d..baaada2b 100644
--- a/ruoyi-ui/src/permission.js
+++ b/ruoyi-ui/src/permission.js
@@ -9,7 +9,7 @@ import permission from './store/modules/permission'
NProgress.configure({ showSpinner: false })
-const whiteList = ['/login', '/auth-redirect', '/bind', '/register']
+const whiteList = ['/login', '/auth-redirect', '/bind', '/register', '/test']
router.beforeEach((to, from, next) => {
NProgress.start()
diff --git a/ruoyi-ui/src/router/routerCreater.js b/ruoyi-ui/src/router/routerCreater.js
index 33d2266e..40099d32 100644
--- a/ruoyi-ui/src/router/routerCreater.js
+++ b/ruoyi-ui/src/router/routerCreater.js
@@ -10,14 +10,33 @@ import menuData from "@/common/menuData";
// 公共路由
import {constantRoutes} from "./index.js";
+
+let ids = []; //层级id列表,每级菜单记录一个id,供菜单回显使用
+let prev = ""; //前缀,用来区分左右侧菜单
+let level = 0; //当前正在处理的菜单层级
+let deltaLvl = 1; //已递归进入的菜单层级,用于编辑完当前菜单后返回时使用
+let counter = {} //记录左右侧菜单的下一个可用索引
function processNode(node) {
+
let arr = [];
- node.forEach((item) => {
+ node.forEach((item, index) => {
+
+ if(level == 0 ){ //处理顶级菜单,加前缀、按照前缀分别计算下一个可用索引记录到counter中
+ prev = item.position.substring(0, 1); //取到前缀
+ counter[prev] == undefined ? counter[prev] = 0 : "";
+ ids = [counter[prev]];
+ counter[prev] ++;
+ }else{
+ ids[level] = index; //如果不是顶级菜单,直接将“下一个可用索引”存到ids列表里
+ }
+
let temp = {
path: item.path || "",
title: item.title,
name: item.name,
+ meta: { menuId : prev + "_" + ids.join("-") }
};
+
if (item.redirect) {
temp.redirect = {
name: item.redirect,
@@ -31,7 +50,15 @@ function processNode(node) {
}
if (item.children && item.children.length > 0) {
+ level ++;
+ if (index == (node.length - 1)){ //处理最后一项菜单还有children、无法返回上一层的情况
+ deltaLvl ++; //记录的是“最后一项有children”的层级的累计数量
+ }
temp.children = processNode(item.children);
+ } else if (index == (node.length - 1)) { //当前层级已处理到最后一项、且最后一项无children时返回
+ level -= deltaLvl;
+ ids.splice(deltaLvl*-1, deltaLvl); //返回后,摘出ids里对应数量的层级数
+ deltaLvl = 1
}
arr.push(temp);
});
@@ -40,6 +67,11 @@ function processNode(node) {
let childrenRoutes = processNode(menuData);
let routes = [
+ {
+ path:"/test",
+ name:"test",
+ component: () => import("@/views/JiHeExpressway/pages/datav/roadNet"),
+ },
{
path: "/index",
name: "index",
@@ -52,7 +84,7 @@ let routes = [
},
{
path: "/",
- name: "index",
+ name: "root",
redirect:{
path:"/home"
}
diff --git a/ruoyi-ui/src/store/modules/user.js b/ruoyi-ui/src/store/modules/user.js
index d709779b..e373b439 100644
--- a/ruoyi-ui/src/store/modules/user.js
+++ b/ruoyi-ui/src/store/modules/user.js
@@ -88,7 +88,6 @@ const user = {
return new Promise((resolve, reject) => {
getInfo().then(res => {
const user = res.user
- console.log(user , "usssssserrrrrrrrrrr")
const avatar = user.avatar == "" ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', res.roles)
diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/Card1/index.vue b/ruoyi-ui/src/views/JiHeExpressway/components/Card1/index.vue
index dc21c63a..fe136d79 100644
--- a/ruoyi-ui/src/views/JiHeExpressway/components/Card1/index.vue
+++ b/ruoyi-ui/src/views/JiHeExpressway/components/Card1/index.vue
@@ -6,7 +6,7 @@
{{ item.label }}:
{{ item1.title }}
-
+ {{ item.dataAll.title }}{{ item.dataAll.value }}{{ item.dataAll.unit }} +
++ {{ item.dataGreen.title }}{{ item.dataGreen.value }}{{ item.dataGreen.unit }} + {{ item.dataRed.title }}{{ item.dataRed.value }}{{ item.dataRed.unit }} +
+