From 61e235ea0263da28488a3caa7f2be807d468559b Mon Sep 17 00:00:00 2001
From: 陈婷婷 <506607603@qq.com>
Date: 星期二, 17 三月 2026 09:22:34 +0800
Subject: [PATCH] 菜单修改成动态菜单

---
 src/store/modules/permission.js | 1471 +++-------------------------------------------------------
 1 files changed, 77 insertions(+), 1,394 deletions(-)

diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js
index 52ab7b5..d9485b6 100644
--- a/src/store/modules/permission.js
+++ b/src/store/modules/permission.js
@@ -4,6 +4,8 @@
 import Layout from "@/layout/index";
 import ParentView from "@/components/ParentView";
 import InnerLink from "@/layout/components/InnerLink";
+import { getLoginPageSource } from "@/utils/loginSource"; // 瀵煎叆鐧诲綍鏉ユ簮鍒ゆ柇宸ュ叿
+import axios from "axios";
 
 const permission = {
   state: {
@@ -31,1402 +33,82 @@
   actions: {
     // 鐢熸垚璺敱
     GenerateRoutes({ commit }) {
+      // 绀轰緥锛氭牴鎹櫥褰曟潵婧愭墽琛屼笉鍚岀殑閫昏緫
+      const loginSource = getLoginPageSource();
+      // console.log(`鐢ㄦ埛浠� ${loginSource} 椤甸潰鐧诲綍`);
+      const HIsHide = false;
+      const hiddenMenuNames = [
+        "WayBillPaymentBill",
+        "payWayBillPaymentBillList",
+        "Sell",
+        "Purchase",
+        "ICMO",
+        "ScMould",
+        "System",
+        "Production",
+        "Transport",
+        "GyWarehouse",
+        "GyStockPlace",
+        "GyItemMoney",
+        "GyEmployee",
+        "GyDepartment",
+        "GyCurrency",
+        "GyUnit",
+        "GySupplier",
+        "GyMaterial",
+        "GyCustomer",
+        "GyProperty",
+      ];
+      if (loginSource == "loginTMS") {
+        HIsHide = true;
+      }
+      function convertMenu(menu, level = 0) {
+        const hasChildren = menu.childMenus && menu.childMenus.length > 0;
+        const route = {
+          name: menu.HNumber,
+          path: level === 0 ? `/${menu.HNumber}` : menu.HNumber,
+          meta: {
+            title: menu.HName,
+            icon: "build",
+            link: null,
+            noCache: false,
+          },
+          hidden: hiddenMenuNames.includes(menu.HNumber) ? HIsHide : false,
+          component: hasChildren ? level === 0 ? "Layout" : "ParentView" : menu.Hurl,
+        };
+        if (hasChildren) {
+          route.redirect = "noRedirect";
+          route.children = menu.childMenus.map((child) =>
+            convertMenu(child, level + 1)
+          );
+        }
+        return route;
+      }
       return new Promise((resolve) => {
+        let params = { HMakeName: sessionStorage["HUserName"], HType: "vue" };
         // 鍚戝悗绔姹傝矾鐢辨暟鎹�
-        let data = [
-          {
-            alwaysShow: true,
-            component: "Layout",
-            meta: {
-              icon: "build",
-              link: null,
-              noCache: false,
-              title: "閿�鍞鐞�",
-            },
-            hidden: false,
-            name: "Sell",
-            path: "/sell",
-            redirect: "noRedirect",
-            children: [
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "閿�鍞嚭搴撳崟",
-                },
-                hidden: false,
-                name: "SellOut",
-                path: "sellOut",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "閿�鍞嚭搴撳崟缁存姢",
-                    },
-                    component: () =>
-                      import("@/views/sell/sellOut/sellOutBill.vue"),
-                    hidden: false,
-                    name: "SellOutBill",
-                    path: "sellOutBill",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "閿�鍞嚭搴撳崟",
-                    },
-                    component: () =>
-                      import("@/views/sell/sellOut/sellOutBillEdit.vue"),
-                    hidden: false,
-                    name: "SellOutBillEdit",
-                    path: "sellOutBillEdit",
-                  },
-                ],
-              },
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "閿�鍞鍗�",
-                },
-                hidden: false,
-                name: "SeOrder",
-                path: "seOrder",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "閿�鍞鍗曠淮鎶�",
-                    },
-                    component: () =>
-                      import("@/views/sell/xsSeOrderBill/xsSeOrderBill.vue"),
-                    hidden: false,
-                    name: "XsSeOrderBill",
-                    path: "xsSeOrderBill",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "閿�鍞鍗�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/sell/xsSeOrderBill/xsSeOrderBillEdit.vue"
-                      ),
-                    hidden: false,
-                    name: "XsSeOrderBillEdit",
-                    path: "xsSeOrderBillEdit",
-                  },
-                ],
-              },
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "鍙戣揣閫氱煡鍗�",
-                },
-                hidden: false,
-                name: "SeOutStock",
-                path: "seOutStock",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍙戣揣閫氱煡鍗曠淮鎶�",
-                    },
-                    component: () =>
-                      import("@/views/sell/XsSeOutStockBill.vue"),
-                    hidden: false,
-                    name: "XsSeOutStockBill",
-                    path: "xsSeOutStockBill",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍙戣揣閫氱煡鍗�",
-                    },
-                    component: () =>
-                      import("@/views/sell/XsSeOutStockBillEdit.vue"),
-                    hidden: false,
-                    name: "XsSeOutStockBillEdit",
-                    path: "xsSeOutStockBillEdit",
-                  },
-                ],
-              },
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "閫�璐ч�氱煡鍗�",
-                },
-                hidden: false,
-                name: "SeOutStockBack",
-                path: "seOutStockBack",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "閫�璐ч�氱煡鍗曠淮鎶�",
-                    },
-                    component: () =>
-                      import("@/views/sell/XsSeOutStockBackBillList.vue"),
-                    hidden: false,
-                    name: "XsSeOutStockBackBillList",
-                    path: "xsSeOutStockBackBillList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "閫�璐ч�氱煡鍗�",
-                    },
-                    component: () =>
-                      import("@/views/sell/XsSeOutStockBackBillEdit.vue"),
-                    hidden: false,
-                    name: "XsSeOutStockBackBillEdit",
-                    path: "xsSeOutStockBackBillEdit",
-                  },
-                ],
-              },
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "閿�鍞��璐у崟",
-                },
-                hidden: false,
-                name: "StockBillMainList",
-                path: "StockBillMainList",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "閿�鍞��璐у崟缁存姢",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainList.vue"
-                      ),
-                    hidden: false,
-                    name: "KfICStockBillMainList",
-                    path: "KfICStockBillMainList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "閿�鍞��璐у崟",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainListEdit.vue"
-                      ),
-                    hidden: false,
-                    name: "KfICStockBillMainListEdit",
-                    path: "KfICStockBillMainListEdit",
-                  },
-                ],
-              },
-            ],
-          },
-          {
-            alwaysShow: true,
-            component: "Layout",
-            meta: {
-              icon: "build",
-              link: null,
-              noCache: false,
-              title: "浠撳簱绠$悊",
-            },
-            hidden: false,
-            name: "Warehouse",
-            path: "/warehouse",
-            redirect: "noRedirect",
-            children: [
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "棰嗘枡鍙戣揣",
-                },
-                hidden: false,
-                name: "Shipment",
-                path: "shipment",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍑哄簱鐢宠鍗曠淮鎶�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/warehouse/shipment/Kf_StockOutRequestBillList.vue"
-                      ),
-                    hidden: false,
-                    name: "Kf_StockOutRequestBillList",
-                    path: "Kf_StockOutRequestBillList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍑哄簱鐢宠鍗�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/warehouse/shipment/Kf_StockOutRequestBill.vue"
-                      ),
-                    hidden: false,
-                    name: "Kf_StockOutRequestBill",
-                    path: "Kf_StockOutRequestBill",
-                  },
-                ],
-              },
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "璋冩嫧鐩樼偣",
-                },
-                hidden: false,
-                name: "Transfer",
-                path: "transfer",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "璋冩嫧鐢宠鍗曠淮鎶�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/warehouse/transfer/Kf_MoveStockRequestBillList.vue"
-                      ),
-                    hidden: false,
-                    name: "Kf_MoveStockRequestBillList",
-                    path: "Kf_MoveStockRequestBillList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "璋冩嫧鐢宠鍗�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/warehouse/transfer/Kf_MoveStockRequestBillEdit.vue"
-                      ),
-                    hidden: false,
-                    name: "Kf_MoveStockRequestBillEdit",
-                    path: "Kf_MoveStockRequestBillEdit",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鐩存帴璋冩嫧鍗曠淮鎶�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/KCGL/MoveStockBill/Kf_MoveStockBillList.vue"
-                      ),
-                    hidden: false,
-                    name: "Kf_MoveStockBillList",
-                    path: "Kf_MoveStockBillList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鐩存帴璋冩嫧鍗�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/KCGL/MoveStockBill/Kf_MoveStockBillEdit.vue"
-                      ),
-                    hidden: false,
-                    name: "Kf_MoveStockBillEdit",
-                    path: "Kf_MoveStockBillEdit",
-                  },
-                ],
-              },
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "鏉$爜涓绘。",
-                },
-                hidden: false,
-                name: "BarcodeMaster",
-                path: "barcodeMaster",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鏉$爜鐢熸垚",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/warehouse/barcodeMaster/Gy_BarCodeBill.vue"
-                      ),
-                    hidden: false,
-                    name: "Gy_BarCodeBill",
-                    path: "Gy_BarCodeBill",
-                  },
-                ],
-              },
-            ],
-          },
-          {
-            alwaysShow: true,
-            component: "Layout",
-            meta: {
-              icon: "build",
-              link: null,
-              noCache: false,
-              title: "鍩虹寤烘ā",
-            },
-            hidden: false,
-            name: "Basic",
-            path: "/basic",
-            redirect: "noRedirect",
-            children: [
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "鐢熶骇璧勬枡",
-                },
-                hidden: false,
-                name: "Production",
-                path: "production",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鐢熶骇璧勬枡鍒楄〃",
-                    },
-                    component: () =>
-                      import("@/views/basic/production/gySource.vue"),
-                    hidden: false,
-                    name: "GySource",
-                    path: "gySource",
-                  },
-                ],
-              },
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "鐗╂祦鍩虹璧勬枡",
-                },
-                hidden: false,
-                name: "Transport",
-                path: "transport",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鎵胯繍鍚堝悓鍗曟嵁",
-                    },
-                    component: () =>
-                      import("@/views/basic/gytransport/cgContractTransportBillList/Cg_ContractTransportBillList.vue"),
-                    hidden: false,
-                    name: "CgContractTransportBillList",
-                    path: "cgContractTransportBillList",
-                  },
-                ],
-              },
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "鍏敤璧勬枡",
-                },
-                hidden: false,
-                name: "Gy",
-                path: "gy",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "浠撳簱鍒楄〃",
-                    },
-                    component: () =>
-                      import("@/views/basic/gyWarehouse/gyWarehouse.vue"),
-                    hidden: false,
-                    name: "GyWarehouse",
-                    path: "gyWarehouse",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "浠撲綅鍒楄〃",
-                    },
-                    component: () =>
-                      import("@/views/basic/gyStockPlace/gyStockPlace.vue"),
-                    hidden: false,
-                    name: "GyStockPlace",
-                    path: "gyStockPlace",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "杞﹀瀷鍒楄〃",
-                    },
-                    component: () =>
-                      import("@/views/basic/gyCartypelist/gyCartypelist.vue"),
-                    hidden: false,
-                    name: "GyCartypelist",
-                    path: "gyCartypelist",
-                  },
-                   {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "璐圭敤椤圭洰鍒楄〃",
-                    },
-                    component: () =>
-                      import("@/views/basic/gyItemMoney/gyItemMoney.vue"),
-                    hidden: false,
-                    name: "GyItemMoney",
-                    path: "gyItemMoney",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "杞﹁締鍒楄〃",
-                    },
-                    component: () =>
-                      import("@/views/basic/gyCar/gyCarList.vue"),
-                    hidden: false,
-                    name: "GyCarList",
-                    path: "gyCarList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鑱屽憳鍒楄〃",
-                    },
-                    component: () =>
-                      import("@/views/basic/gyEmployee/gyEmployee.vue"),
-                    hidden: false,
-                    name: "GyEmployee",
-                    path: "gyEmployee",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "閮ㄩ棬鍒楄〃",
-                    },
-                    component: () =>
-                      import("@/views/basic/gy/gyDepartment.vue"),
-                    hidden: false,
-                    name: "GyDepartment",
-                    path: "gyDepartment",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "渚涘簲鍟嗗垪琛�",
-                    },
-                    component: () => import("@/views/basic/gy/gySupplier.vue"),
-                    hidden: false,
-                    name: "GySupplier",
-                    path: "gySupplier",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鐗╂枡鍒楄〃",
-                    },
-                    component: () =>
-                      import("@/views/gyMaterial/GyMaterial.vue"),
-                    hidden: false,
-                    name: "GyMaterial",
-                    path: "GyMaterial",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "瀹㈡埛鍒楄〃",
-                    },
-                    component: () => import("@/views/GyCustomer/index.vue"),
-                    hidden: false,
-                    name: "GyCustomer",
-                    path: "GyCustomer",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "杈呭姪灞炴�у垪琛�",
-                    },
-                    component: () => import("@/views/basic/gyProperty/gyPropertyList.vue"),
-                    hidden: false,
-                    name: "GyProperty",
-                    path: "gyProperty",
-                  },
-                ],
-              },
-            ],
-          },
-          {
-            alwaysShow: true,
-            component: "Layout",
-            meta: {
-              icon: "build",
-              link: null,
-              noCache: false,
-              title: "閲囪喘绠$悊",
-            },
-            hidden: false,
-            name: "Purchase",
-            path: "/purchase",
-            redirect: "noRedirect",
-            children: [
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "閲囪喘璁㈠崟",
-                },
-                hidden: false,
-                name: "PoOrder",
-                path: "poOrder",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "閲囪喘璁㈠崟鍒楄〃",
-                    },
-                    component: () =>
-                      import("@/views/purchase/cgPoOrderBill/cgPoOrderBill"),
-                    hidden: false,
-                    name: "CgPoOrderBill",
-                    path: "cgPoOrderBill",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "閲囪喘璁㈠崟",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/purchase/cgPoOrderBill/cgPoOrderBillEdit"
-                      ),
-                    hidden: false,
-                    name: "CgPoOrderBillEdit",
-                    path: "cgPoOrderBillEdit",
-                  },
-                ],
-              },
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "鏀舵枡閫氱煡鍗�",
-                },
-                hidden: false,
-                name: "PoInStock",
-                path: "PoInStock",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鏀舵枡閫氱煡鍗曞垪琛�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/purchase/cgPoInStockBill/cgPoInStockBill.vue"
-                      ),
-                    hidden: false,
-                    name: "CgPoInStockBillList",
-                    path: "cgPoInStockBillList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鏀舵枡閫氱煡鍗�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/purchase/cgPoInStockBill/cgPoInStockBillEdit.vue"
-                      ),
-                    hidden: false,
-                    name: "CgPoInStockBillEdit",
-                    path: "cgPoInStockBillEdit",
-                  },
-                ],
-              },
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "閲囪喘鍏ュ簱鍗�",
-                },
-                hidden: false,
-                name: "POStockInBill",
-                path: "POStockInBill",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "閲囪喘鍏ュ簱鍗曠淮鎶�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/CaiGouGuanLi/CaiGouRuKu/Kf_POStockInBillList.vue"
-                      ),
-                    hidden: false,
-                    name: "POStockInBillList",
-                    path: "POStockInBillList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "閲囪喘鍏ュ簱鍗�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/CaiGouGuanLi/CaiGouRuKu/Kf_POStockInBillEdit.vue"
-                      ),
-                    hidden: false,
-                    name: "POStockInBillEdit",
-                    path: "POStockInBillEdit",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍒嗗竷寮忚皟鍏ュ崟缁存姢",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/FbStepFoldinBillList/fbStepFoldinBillList.vue"
-                      ),
-                    hidden: false,
-                    name: "FbStepFoldinBillList",
-                    path: "FbStepFoldinBillList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍒嗗竷寮忚皟鍑哄崟缁存姢",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/FbStepFoldOutBillList/fbStepFoldOutBillList.vue"
-                      ),
-                    hidden: false,
-                    name: "FbStepFoldOutBillList",
-                    path: "FbStepFoldOutBillList",
-                  },
-                ],
-              },
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "閲囪喘閫�鏂欏崟",
-                },
-                hidden: false,
-                name: "PostockInBack",
-                path: "postockInBack",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "閲囪喘閫�鏂欏崟鍒楄〃锛堝凡鍏ュ簱锛�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/purchase/postockInBack/Kf_POStockInBackBillList.vue"
-                      ),
-                    hidden: false,
-                    name: "Kf_POStockInBackBillList",
-                    path: "Kf_POStockInBackBillList",
-                    query: "{\"type\":1}"
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "閲囪喘閫�鏂欏崟鍒楄〃锛堟湭鍏ュ簱锛�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/purchase/postockInBack/Kf_POStockInBackBillList.vue"
-                      ),
-                    hidden: false,
-                    name: "Kf_POStockInBackBillList",
-                    path: "Kf_POStockInBackBillList0",
-                    query: "{\"type\":0}"
-                  },
-                ],
-              },
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "鍏朵粬鍑哄簱鍗曠淮鎶�",
-                },
-                hidden: false,
-                name: "OtherOutBill",
-                path: "OtherOutBill",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍏朵粬鍑哄簱鍗曞垪琛�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/KCGL/OtherOutBill/Kf_OtherOutBillList.vue"
-                      ),
-                    hidden: false,
-                    name: "OtherOutBillList",
-                    path: "OtherOutBillList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍏朵粬鍑哄簱鍗�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/KCGL/OtherOutBill/Kf_OtherOutBillEdit.vue"
-                      ),
-                    hidden: false,
-                    name: "OtherOutBillEdit",
-                    path: "OtherOutBillEdit",
-                  },
-                ],
-              },
-            ],
-          },
-          {
-            alwaysShow: true,
-            component: "Layout",
-            meta: {
-              icon: "build",
-              link: null,
-              noCache: false,
-              title: "鐢熶骇绠$悊",
-            },
-            hidden: false,
-            name: "ICMO",
-            path: "/icmo",
-            redirect: "noRedirect",
-            children: [
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "鐢熶骇璁㈠崟",
-                },
-                hidden: false,
-                name: "ScIcmoBill",
-                path: "scIcmoBill",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鐢熶骇璁㈠崟鍒楄〃",
-                    },
-                    component: () => import("@/views/ICMO/ScICMOBillList.vue"),
-                    hidden: false,
-                    name: "ScICMOBillList",
-                    path: "scICMOBillList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鐢熶骇璁㈠崟",
-                    },
-                    component: () => import("@/views/ICMO/ScICMOBillEdit.vue"),
-                    hidden: false,
-                    name: "ScICMOBillEdit",
-                    path: "scICMOBillEdit",
-                  },
-                ],
-              },
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "鐢熶骇鍏ュ簱缁存姢",
-                },
-                hidden: false,
-                name: "ProductInBill",
-                path: "productInBill",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鐢熶骇鍏ュ簱鍒楄〃",
-                    },
-                    component: () =>
-                      import("@/views/ProductInBill/Kf_ProductInBillList.vue"),
-                    hidden: false,
-                    name: "ProductInBillList",
-                    path: "productInBillList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鐢熶骇鍏ュ簱鍗�",
-                    },
-                    component: () =>
-                      import("@/views/ProductInBill/Kf_ProductInBillEdit.vue"),
-                    hidden: false,
-                    name: "ProductInBillEdit",
-                    path: "productInBillEdit",
-                  },
-                ],
-              },
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "鐢熶骇姹囨姤",
-                },
-                hidden: false,
-                name: "ScICMOReportBill",
-                path: "scICMOReportBill",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鐢熶骇姹囨姤鍒楄〃",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/ICMO/ScICMOReportBill/ScICMOReportBillList.vue"
-                      ),
-                    hidden: false,
-                    name: "ScICMOReportBillList",
-                    path: "scICMOReportBillList",
-                  },
-                  // {
-                  //   meta: {
-                  //     icon: "build",
-                  //     link: null,
-                  //     noCache: false,
-                  //     title: "鐢熶骇鍏ュ簱鍗�",
-                  //   },
-                  //   component: () => import("@/views/ProductInBill/Kf_ProductInBillEdit.vue"),
-                  //   hidden: false,
-                  //   name: "ProductInBillEdit",
-                  //   path: "ProductInBillEdit",
-                  // },
-                ],
-              },
-            ],
-          },
-          {
-            alwaysShow: true,
-            component: "Layout",
-            meta: {
-              icon: "build",
-              link: null,
-              noCache: false,
-              title: "鍣ㄥ叿绠$悊",
-            },
-            hidden: false,
-            name: "ScMould",
-            path: "/scMould",
-            redirect: "noRedirect",
-            children: [
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "浠撳偍绠$悊",
-                },
-                hidden: false,
-                name: "Warehouse",
-                path: "warehouse",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍣ㄥ叿棰嗙敤鍑哄簱鍗曠淮鎶�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/scMould/warehouse/Sc_MouldProdOutBillList"
-                      ),
-                    hidden: false,
-                    name: "Sc_MouldProdOutBillList",
-                    path: "Sc_MouldProdOutBillList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍣ㄥ叿棰嗙敤鍑哄簱鍗�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/scMould/warehouse/Sc_MouldProdOutBillEdit"
-                      ),
-                    hidden: false,
-                    name: "Sc_MouldProdOutBillEdit",
-                    path: "Sc_MouldProdOutBillEdit",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍣ㄥ叿棰嗙敤閫�搴撳崟缁存姢",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/scMould/warehouse/Sc_MouldProdBackBillList"
-                      ),
-                    hidden: false,
-                    name: "Sc_MouldProdBackBillList",
-                    path: "Sc_MouldProdBackBillList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍣ㄥ叿棰嗙敤閫�搴撳崟",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/scMould/warehouse/Sc_MouldProdBackBillEdit"
-                      ),
-                    hidden: false,
-                    name: "Sc_MouldProdBackBillEdit",
-                    path: "Sc_MouldProdBackBillEdit",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍣ㄥ叿鐩存帴璋冩嫧鍗曠淮鎶�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/scMould/warehouse/Sc_MouldProdMoveBillList"
-                      ),
-                    hidden: false,
-                    name: "Sc_MouldProdMoveBillList",
-                    path: "Sc_MouldProdMoveBillList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍣ㄥ叿鐩存帴璋冩嫧鍗�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/scMould/warehouse/Sc_MouldProdMoveBillEdit"
-                      ),
-                    hidden: false,
-                    name: "Sc_MouldProdMoveBillEdit",
-                    path: "Sc_MouldProdMoveBillEdit",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍣ㄥ叿鍏ュ簱鐢宠鍗曠淮鎶�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/scMould/warehouse/Sc_MouldInRequestBillList"
-                      ),
-                    hidden: false,
-                    name: "Sc_MouldInRequestBillList",
-                    path: "Sc_MouldInRequestBillList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍣ㄥ叿鍏ュ簱鐢宠鍗�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/scMould/warehouse/Sc_MouldInRequestBillEdit"
-                      ),
-                    hidden: false,
-                    name: "Sc_MouldInRequestBillEdit",
-                    path: "Sc_MouldInRequestBillEdit",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍣ㄥ叿棰嗙敤鐢宠鍗曠淮鎶�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/scMould/warehouse/Sc_MouldOutRequestBillList"
-                      ),
-                    hidden: false,
-                    name: "Sc_MouldOutRequestBillList",
-                    path: "Sc_MouldOutRequestBillList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍣ㄥ叿棰嗙敤鐢宠鍗�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/scMould/warehouse/Sc_MouldOutRequestBillEdit"
-                      ),
-                    hidden: false,
-                    name: "Sc_MouldOutRequestBillEdit",
-                    path: "Sc_MouldOutRequestBillEdit",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍣ㄥ叿璋冩嫧鐢宠鍗曠淮鎶�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/scMould/warehouse/Sc_MouldMoveStockRequestBillList"
-                      ),
-                    hidden: false,
-                    name: "Sc_MouldMoveStockRequestBillList",
-                    path: "Sc_MouldMoveStockRequestBillList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍣ㄥ叿璋冩嫧鐢宠鍗�",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/scMould/warehouse/Sc_MouldMoveStockRequestBillEdit"
-                      ),
-                    hidden: false,
-                    name: "Sc_MouldMoveStockRequestBillEdit",
-                    path: "Sc_MouldMoveStockRequestBillEdit",
-                  },
-                ],
-              },
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "鍩虹寤烘ā",
-                },
-                hidden: false,
-                name: "BasicModeling",
-                path: "basicModeling",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍣ㄥ叿涓绘。",
-                    },
-                    component: () =>
-                      import("@/views/scMould/basicModeling/Gy_MouldFile.vue"),
-                    hidden: false,
-                    name: "Gy_MouldFile",
-                    path: "Gy_MouldFile",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鍣ㄥ叿涓绘。缁存姢",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/scMould/basicModeling/Gy_MouldFileList.vue"
-                      ),
-                    hidden: false,
-                    name: "Gy_MouldFileList",
-                    path: "Gy_MouldFileList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "浜у搧鍖呰瀹瑰櫒鍏宠仈淇℃伅缁存姢",
-                    },
-                    component: () =>
-                      import(
-                        "@/views/scMould/basicModeling/Gy_MaterialPackingRelationList.vue"
-                      ),
-                    hidden: false,
-                    name: "Gy_MaterialPackingRelationList",
-                    path: "Gy_MaterialPackingRelationList",
-                  },
-                ],
-              },
-            ],
-          },
-          {
-            alwaysShow: true,
-            component: "Layout",
-            meta: {
-              icon: "build",
-              link: null,
-              noCache: false,
-              title: "绯荤粺绠$悊",
-            },
-            hidden: false,
-            name: "System",
-            path: "/system",
-            redirect: "noRedirect",
-            children: [
-              {
-                meta: {
-                  icon: "build",
-                  link: null,
-                  noCache: false,
-                  title: "鐢ㄦ埛绠$悊",
-                },
-                hidden: false,
-                name: "User",
-                path: "user",
-                redirect: "noRedirect",
-                component: "Layout",
-                children: [
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鐢ㄦ埛鍒楄〃",
-                    },
-                    component: () =>
-                      import("@/views/system/user/xtUserList.vue"),
-                    hidden: false,
-                    name: "XtUserList",
-                    path: "xtUserList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "瑙掕壊鍒楄〃",
-                    },
-                    component: () =>
-                      import("@/views/system/user/Xt_UserGroupList.vue"),
-                    hidden: false,
-                    name: "Xt_UserGroupList",
-                    path: "Xt_UserGroupList",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "椹鹃┒鍛樺垪琛�",
-                    },
-                    component: () =>import("@/views/system/user/GyDriver.vue"),
-                    hidden: false,
-                    name: "gyDriver",
-                    path: "GyDriver",
-                  },
-                  {
-                    meta: {
-                      icon: "build",
-                      link: null,
-                      noCache: false,
-                      title: "鏉冮檺鏌ヨ",
-                    },
-                    component: () =>
-                      import("@/views/system/user/xtUserRightQuery.vue"),
-                    hidden: true,
-                    name: "XtUserRightQuery",
-                    path: "xtUserRightQuery",
-                  },
-                ],
-              },
-            ],
-          },
-        ];
-        const sdata = JSON.parse(JSON.stringify(data));
-        const rdata = JSON.parse(JSON.stringify(data));
-        const sidebarRoutes = filterAsyncRouter(sdata);
-        const rewriteRoutes = filterAsyncRouter(rdata, false, true);
-        const asyncRoutes = filterDynamicRoutes(dynamicRoutes);
-        rewriteRoutes.push({ path: "*", redirect: "/404", hidden: true });
-        router.addRoutes(asyncRoutes);
-        commit("SET_ROUTES", rewriteRoutes);
-        commit("SET_SIDEBAR_ROUTERS", constantRoutes.concat(sidebarRoutes));
-        commit("SET_DEFAULT_ROUTES", sidebarRoutes);
-        commit("SET_TOPBAR_ROUTES", sidebarRoutes);
-        resolve(rewriteRoutes);
+        getRouters(params).then((res) => {
+          if (res.count == 1) {
+            let menuData = JSON.parse(res.data);
+            const data = menuData.map((item) => convertMenu(item, 0));
+            data.forEach((route) => {
+              route.alwaysShow = true;
+            });
+            const sdata = JSON.parse(JSON.stringify(data));
+            const rdata = JSON.parse(JSON.stringify(data));
+            const sidebarRoutes = filterAsyncRouter(sdata);
+            const rewriteRoutes = filterAsyncRouter(rdata, false, true);
+            rewriteRoutes.push({ path: "*", redirect: "/404", hidden: true });
+            router.addRoutes(rewriteRoutes);
+            commit("SET_ROUTES", rewriteRoutes);
+            commit("SET_SIDEBAR_ROUTERS", constantRoutes.concat(sidebarRoutes));
+            commit("SET_DEFAULT_ROUTES", sidebarRoutes);
+            commit("SET_TOPBAR_ROUTES", sidebarRoutes);
+            resolve(rewriteRoutes);
+          } else {
+            this.$modal.msgError(response.data.code + response.data.Message);
+          }
+        });
       });
     },
   },
@@ -1475,6 +157,7 @@
 
 // 鍔ㄦ�佽矾鐢遍亶鍘嗭紝楠岃瘉鏄惁鍏峰鏉冮檺
 export function filterDynamicRoutes(routes) {
+  console.log(routes);
   const res = [];
   routes.forEach((route) => {
     if (route.permissions) {

--
Gitblit v1.9.1