diff --git a/f/web-kboss/src/router/index.js b/f/web-kboss/src/router/index.js index 7896471..b705694 100644 --- a/f/web-kboss/src/router/index.js +++ b/f/web-kboss/src/router/index.js @@ -364,7 +364,7 @@ export const asyncRoutes = [ children: [ { path: "orderManagement", - component: () => import("@/views/customer/orderManagement"), + component: () => import("@/views/customer/orderManagement/index.vue"), name: "OrderManagement", meta: { title: "百度订单", fullPath: "/customer/orderManagement", noCache: true, }, }, @@ -388,7 +388,7 @@ export const asyncRoutes = [ { path: "userResource", component: () => import( // "@/views/customer/userResource/iframeJiNan.vue"//iframe报错 - "@/views/customer/userResource" + "@/views/customer/userResource/index.vue" ), name: "userResource", meta: { title: "百度资源", fullPath: "/customer/userResource", noCache: true }, }, ] @@ -799,25 +799,7 @@ export const asyncRoutes = [ { }, - // 工单管理 - 变为一级菜单 - { - path: "/workOrderManagement", - component: Layout, - meta: { - title: "工单管理", - icon: "el-icon-tickets", - noCache: true, - fullPath: "/workOrderManagement" - }, - children: [ - { - path: "index", - component: () => import("@/views/customer/workOrderManagement"), - name: "WorkOrderManagement", - meta: { title: "工单管理", fullPath: "/workOrderManagement/index" }, - } - ] - }, + // 退订管理 - 变为一级菜单(包含子菜单) { path: "/unsubscribeManagement", @@ -899,6 +881,25 @@ export const asyncRoutes = [ } ] }, + // 工单管理 - 变为一级菜单 + { + path: "/workOrderManagement", + component: Layout, + meta: { + title: "工单管理", + icon: "el-icon-tickets", + noCache: true, + fullPath: "/workOrderManagement" + }, + children: [ + { + path: "index", + component: () => import("@/views/customer/workOrderManagement"), + name: "WorkOrderManagement", + meta: { title: "工单管理", fullPath: "/workOrderManagement/index" }, + } + ] + }, // // 客户 { @@ -1089,7 +1090,7 @@ export const asyncRoutes = [ { path: "pendingPro", component: () => import("@/views/customer/approveMangement/pendingPro.vue"), - name: "pendingPro", + name: "pendingPro", meta: { title: "待审清单", fullPath: "/approveMangement/index" }, }, { @@ -1838,37 +1839,38 @@ export const asyncRoutes = [ }, },], }, + // { + // path: "/administrator", component: Layout, redirect: "/administrator/index", meta: { + // title: "企业管理", + // icon: "el-icon-office-building", + // noCache: true, + // fullPath: "/administrator" + // }, + // children: [ + // { + // path: "departmentManagement", + // component: () => import("@/views/administrator/departmentManagement"), + // name: "epartmentManagement", + // meta: { + // title: "部门管理", fullPath: "/administrator/departmentManagement", + // }, + // }, { + // path: "configureOrganizationUserRole", + // component: () => import("@/views/administrator/configureOrganizationUserRole"), + // name: "ConfigureOrganizationUserRole", + // meta: { + // title: "角色管理", fullPath: "/administrator/configureOrganizationUserRole", + // }, + // }, { + // path: "stationMessageSettings", + // component: () => import("@/views/administrator/stationMessageSettings"), + // name: "StationMessageSettings", + // meta: { + // title: "站内信设置", fullPath: "/administrator/stationMessageSettings", + // }, + // },], + // }, { - path: "/administrator", component: Layout, redirect: "/administrator/index", meta: { - title: "企业管理", - icon: "el-icon-office-building", - noCache: true, - fullPath: "/administrator" - }, - children: [ - { - path: "departmentManagement", - component: () => import("@/views/administrator/departmentManagement"), - name: "epartmentManagement", - meta: { - title: "部门管理", fullPath: "/administrator/departmentManagement", - }, - }, { - path: "configureOrganizationUserRole", - component: () => import("@/views/administrator/configureOrganizationUserRole"), - name: "ConfigureOrganizationUserRole", - meta: { - title: "角色管理", fullPath: "/administrator/configureOrganizationUserRole", - }, - }, { - path: "stationMessageSettings", - component: () => import("@/views/administrator/stationMessageSettings"), - name: "StationMessageSettings", - meta: { - title: "站内信设置", fullPath: "/administrator/stationMessageSettings", - }, - },], - }, { path: "/management", hidden: true, component: Layout, diff --git a/f/web-kboss/src/store/modules/permission.js b/f/web-kboss/src/store/modules/permission.js index ce82e16..12cbbac 100644 --- a/f/web-kboss/src/store/modules/permission.js +++ b/f/web-kboss/src/store/modules/permission.js @@ -24,6 +24,9 @@ function filterAsyncRoutes(routes, permissions, userRoles = []) { // 检查当前路由是否在权限列表中 const hasPermission = permissions.some(p => p.path === route.meta?.fullPath); + // 特殊处理:确保"全部产品"和"资源概览"这两个一级路由在客户角色下显示 + const isCriticalRoute = route.path === "/product" || route.path === "/overview"; + // 检查是否为仅客户可访问的路由 const isCustomerOnlyRoute = customerOnlyRoutes.includes(route.path); @@ -36,6 +39,10 @@ function filterAsyncRoutes(routes, permissions, userRoles = []) { if (hasPermission) { res.push(tmpRoute); } + // 如果是关键路由且用户是客户,也要加入结果 + else if (isCriticalRoute && userRoles.includes('客户')) { + res.push(tmpRoute); + } // 如果没有直接权限,但有子路由,递归处理子路由 else if (tmpRoute.children) { const filteredChildren = filterAsyncRoutes(tmpRoute.children, permissions, userRoles); @@ -73,11 +80,12 @@ function addUserRoutes(routes, userType, orgType, userRoles = []) { // 新增:为所有用户添加五个新的客户菜单,但只有客户角色才能看到 const newCustomerRoutes = [ - routes.find(route => route.path === "/workOrderManagement"), routes.find(route => route.path === "/unsubscribeManagement"), routes.find(route => route.path === "/informationPerfect"), routes.find(route => route.path === "/rechargeManagement"), - routes.find(route => route.path === "/invoiceManagement") + routes.find(route => route.path === "/invoiceManagement"), + routes.find(route => route.path === "/workOrderManagement") + ].filter(route => { // 过滤掉undefined,并且只有客户角色才能看到这些路由 return route && userRoles.includes('客户'); diff --git a/f/web-kboss/src/views/customer/orderManagement/index.vue b/f/web-kboss/src/views/customer/orderManagement/index.vue index 9cbf51d..3b3d37e 100644 --- a/f/web-kboss/src/views/customer/orderManagement/index.vue +++ b/f/web-kboss/src/views/customer/orderManagement/index.vue @@ -184,7 +184,7 @@ @@ -220,7 +220,7 @@
{{ formatOrderDate(scope.row.order_date) }}
- + diff --git a/f/web-kboss/src/views/customer/userResource/index.vue b/f/web-kboss/src/views/customer/userResource/index.vue index dd2892b..99aa653 100644 --- a/f/web-kboss/src/views/customer/userResource/index.vue +++ b/f/web-kboss/src/views/customer/userResource/index.vue @@ -52,13 +52,28 @@ border v-loading="loading" > - - + + + + + + + + + + +