فهرست منبع

更新 首页

wzh 3 سال پیش
والد
کامیت
295f954b34
5فایلهای تغییر یافته به همراه23 افزوده شده و 10 حذف شده
  1. 7 1
      src/auth/menuData.js
  2. 8 1
      src/components/Aside.vue
  3. 6 6
      src/main.js
  4. 1 1
      src/router/index.js
  5. 1 1
      src/views/index/Login.vue

+ 7 - 1
src/auth/menuData.js

@@ -3,9 +3,10 @@ let menuData = [
     icon: "menuIcons/index.png",
     title: "首页",
     code: "VOYAGELIST",
+    path: "/index",
     items: [
       {
-        path: "/",
+        path: "/index",
         name: "首页",
         code: "VOYAGELIST",
       },
@@ -15,6 +16,7 @@ let menuData = [
     icon: "menuIcons/ship.png",
     title: "航次管理",
     code: "VOYAGEMANAGE",
+    path: "/voyage",
     items: [
       {
         path: "/voyage/voyageList",
@@ -27,6 +29,7 @@ let menuData = [
     icon: "menuIcons/agency.png",
     title: "代理管理",
     code: "PROXYMANAGE",
+    path: "/agencyManage",
     items: [
       {
         path: "/agencyManage/agencyCompanyList",
@@ -39,6 +42,7 @@ let menuData = [
     icon: "menuIcons/cargo.png",
     title: "货种管理",
     code: "CARGOMANAGE",
+    path: "/cargoManage",
     items: [
       {
         path: "/cargoManage/cargoList",
@@ -51,6 +55,7 @@ let menuData = [
     icon: "menuIcons/account.png",
     title: "账户管理",
     code: "ACCOUNTMANAGE",
+    path: "/accountManage",
     items: [
       {
         path: "/accountManage/subAccountList",
@@ -68,6 +73,7 @@ let menuData = [
     icon: "menuIcons/setting.png",
     title: "权限管理",
     code: "PERMISSIONMANAGE",
+    path: "/authManage",
     items: [
       {
         path: "/authManage/departmentList",

+ 8 - 1
src/components/Aside.vue

@@ -15,7 +15,14 @@
     >
       <template v-slot:title>
         <img
-          style="width: 30px; height: 30px; background: #fff; padding: 1px"
+          :style="{
+            width: '30px',
+            height: '30px',
+            background: store.state.currentMenuItem.includes(item.path)
+              ? '#fff'
+              : ' #adacac',
+            padding: '1px',
+          }"
           :src="item.icon"
           alt=""
         />

+ 6 - 6
src/main.js

@@ -32,23 +32,23 @@ router.beforeEach(async (to, from, next) => {
     if (store.state.menuData.length) {
       let path = store.state?.menuData[0]?.items[0].path;
       if (0 === to.matched.length) {
-        next("/");
+        next("/index");
       } else if (to.path == "/login") {
-        next("/");
+        next("/index");
       } else if (rolePermission?.indexOf(to.meta.code) == -1) {
-        if (to.path == "/") {
+        if (to.path == "/index") {
           next();
         } else {
-          next("/");
+          next("/index");
         }
       } else {
         next();
       }
     } else {
-      if (to.path == "/") {
+      if (to.path == "/index") {
         next();
       } else {
-        next("/");
+        next("/index");
       }
     }
   } else {

+ 1 - 1
src/router/index.js

@@ -12,7 +12,7 @@ const router = createRouter({
   history: createWebHashHistory(),
   routes: [
     {
-      path: "/",
+      path: "/index",
       name: "index",
       meta: {
         title: "主页",

+ 1 - 1
src/views/index/Login.vue

@@ -237,7 +237,7 @@ function login() {
           localStorage.loginAccountId
         );
 
-        router.replace("/");
+        router.replace("/index");
         store.commit("changeLogin", true);
       } else {
         ElNotification.error({