diff --git a/f/web-kboss/src/api/HistoricalOrders.js b/f/web-kboss/src/api/HistoricalOrders.js new file mode 100644 index 0000000..bc44cca --- /dev/null +++ b/f/web-kboss/src/api/HistoricalOrders.js @@ -0,0 +1,20 @@ +import request from '@/utils/request' +export function getListAPI(id) { + return request({ + url: `/product/get_zhipu_0112_product.dspy`, + method: 'get', + params: { + userid: id + } + }) +} +// 详情 +export function getDetailAPI(keyword) { + return request({ + url: `/product/get_zhipu_0112_product_detail.dspy`, + method: 'get', + params: { + keyword + } + }) +} diff --git a/f/web-kboss/src/router/index.js b/f/web-kboss/src/router/index.js index aa1d3e5..032ce69 100644 --- a/f/web-kboss/src/router/index.js +++ b/f/web-kboss/src/router/index.js @@ -467,10 +467,20 @@ export const asyncRoutes = [ meta: { title: "百度订单", fullPath: "/customer/orderManagement", noCache: true, }, }, { - path: "orderManagement", + path: "HistoricalOrders", component: () => import("@/views/customer/orderManagement/HistoricalOrders/index.vue"), - name: "OrderManagement", - meta: { title: "阿里云订单", fullPath: "/customer/orderManagement", noCache: true, }, + name: "HistoricalOrders", + meta: { title: "历史订单", fullPath: "/customer/orderManagement", noCache: true, requireUser: 'ZhipuHZ' }, + requireUser: 'ZhipuHZ' + }, + // 订单详情 + { + path: "orderDetails", + component: () => import("@/views/customer/orderManagement/orderDetails/index.vue"), + name: "orderDetails", + meta: { title: "订单详情", fullPath: "/customer/orderManagement", noCache: true, requireUser: 'ZhipuHZ' }, + hidden: true, + requireUser: 'ZhipuHZ' } ] @@ -901,10 +911,6 @@ export const asyncRoutes = [ }, - { - - }, - // 退订管理 - 变为一级菜单(包含子菜单) { path: "/unsubscribeManagement", diff --git a/f/web-kboss/src/store/modules/permission.js b/f/web-kboss/src/store/modules/permission.js index 7f338ab..d302399 100644 --- a/f/web-kboss/src/store/modules/permission.js +++ b/f/web-kboss/src/store/modules/permission.js @@ -1,3 +1,4 @@ +// permission.js - 修改后的完整代码 import { asyncRoutes, constantRoutes } from "@/router"; // 获取用户代理字符串 @@ -235,6 +236,10 @@ const actions = { const userRoles = rootState.user.roles || JSON.parse(sessionStorage.getItem('roles') || '[]'); console.log("用户角色:", userRoles); + // 获取用户名 + const username = params.user || rootState.user.user || ''; + console.log("当前用户名:", username, "检查是否是ZhipuHZ:", username === 'ZhipuHZ'); + console.log("用户类型:", userType, "orgType:", orgType); // 确定设备类型 @@ -296,7 +301,55 @@ const actions = { console.log("添加用户特定路由后的accessedRoutes:", accessedRoutes); } - console.log("ACTION generateRoutes - calculated accessedRoutes:", accessedRoutes); + // ========== 暴力过滤:直接修改 accessedRoutes ========== + // 遍历所有路由,找到 /orderManagement 路由,然后过滤它的子路由 + accessedRoutes = accessedRoutes.map(route => { + if (route.path === "/orderManagement") { + console.log("找到订单管理路由,准备过滤子路由,用户名:", username); + + // 创建路由副本 + const newRoute = { ...route }; + + if (newRoute.children) { + // 如果不是 ZhipuHZ 用户,过滤掉 HistoricalOrders 和 orderDetails 路由 + if (username !== 'ZhipuHZ') { + console.log(`用户 ${username} 不是 ZhipuHZ,过滤订单管理子路由`); + newRoute.children = newRoute.children.filter(child => + child.path !== 'HistoricalOrders' && child.path !== 'orderDetails' + ); + console.log(`过滤后子路由:`, newRoute.children.map(c => c.path)); + } else { + console.log(`用户 ${username} 是 ZhipuHZ,保留所有子路由`); + } + } + + return newRoute; + } + + // 对于其他路由,保持原样 + return route; + }); + + // 再次检查,确保没有遗漏的任何 orderManagement 路由 + accessedRoutes.forEach(route => { + if (route.children) { + route.children = route.children.filter(child => { + // 如果子路由是 orderManagement,也需要处理 + if (child.path === "/orderManagement") { + console.log("在子路由中找到订单管理路由,准备过滤,用户名:", username); + + if (child.children && username !== 'ZhipuHZ') { + child.children = child.children.filter(grandChild => + grandChild.path !== 'HistoricalOrders' && grandChild.path !== 'orderDetails' + ); + } + } + return true; + }); + } + }); + + console.log("ACTION generateRoutes - 最终 calculated accessedRoutes:", accessedRoutes); commit("SET_ROUTES", accessedRoutes); resolve(accessedRoutes); diff --git a/f/web-kboss/src/views/customer/orderManagement/HistoricalOrders/index.vue b/f/web-kboss/src/views/customer/orderManagement/HistoricalOrders/index.vue index 9755d40..3286312 100644 --- a/f/web-kboss/src/views/customer/orderManagement/HistoricalOrders/index.vue +++ b/f/web-kboss/src/views/customer/orderManagement/HistoricalOrders/index.vue @@ -1,15 +1,116 @@ - + + + + + + + + + + + + + + + + + + {{ item.name }}: {{ item.value }} + + + - + + + + + + + + 详情 + + + + + diff --git a/f/web-kboss/src/views/customer/orderManagement/orderDetails/index.vue b/f/web-kboss/src/views/customer/orderManagement/orderDetails/index.vue new file mode 100644 index 0000000..580c029 --- /dev/null +++ b/f/web-kboss/src/views/customer/orderManagement/orderDetails/index.vue @@ -0,0 +1,331 @@ + + + + + 服务器监控面板 + 实时监控168台服务器状态 + + + + + + + 搜索 + + + + + + + 在线服务器 + 0 + + + 离线服务器 + 0 + + + 告警服务器 + 0 + + + 过期服务器 + 168 + + + + + + + + 云算力调度系统服务、算力运维服务型GPU ({{ filteredList.length }}台) + 高性能图形渲染服务、并行数据处理服务型GPU ({{ filteredList.length }}台) + + + + + + + {{ server.device_id }} + + + + 内网IP: {{ server.internal_ip }} + 公网IP: {{ server.public_ip }} + 设备周期: {{ server.service_period.start_date }} 至 {{ server.service_period.end_date }} + + + + 硬件配置 + + GPU型号: {{ server.hardware_config.gpu.model }} + 显存: {{ server.hardware_config.gpu.memory }} + CPU: {{ server.hardware_config.cpu }} + 内存: {{ server.hardware_config.ram }} + 存储: {{ server.hardware_config.storage }} + + + + + 网络配置 + + 带宽: {{ server.network_config.bandwidth }} + + + + + 服务等级 + + SLA保障: {{ server.service_level.sla }} + 最大并发数: {{ server.service_level.max_concurrent_connections }} + 最大负载: {{ server.service_level.max_load_threshold }} + 计费方式: {{ formatBillingMethod(server.service_level.billing_method) }} + + + + + 历史数据 + + 运行率: {{ server.historical_stats.uptime_rate }} + 平均负载: {{ server.historical_stats.average_load }} + 峰值负载: {{ server.historical_stats.peak_load }} + 总使用时长: {{ server.historical_stats.total_usage_hours }}小时 + + + + 租用过期 + + + + + + + + + +
实时监控168台服务器状态