From 552baacee94256e002a51c7bc879c4b4aced9633 Mon Sep 17 00:00:00 2001 From: Sisyphus Date: Sat, 4 Jul 2026 19:01:09 +0800 Subject: [PATCH] =?UTF-8?q?feat(F006-W3xC):=20=E6=95=B0=E6=8D=AE=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E9=A6=96=E9=A1=B5=20statistics/index=20=E8=B5=B0=20or?= =?UTF-8?q?der=20=E7=9C=9F=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新建 src/modules/statistics/StatisticsView.vue (357 行) * 顶部 4 stat: 订单总数/总额 + 今日订单/交易额 + 较昨日差值 * 趋势线 (双 Y 轴: 订单数 + 交易额, 近 7 天按 createDate 分桶) * 环图 (5 状态: 待付款/已付款/已发货/已完成/已取消) * 近期订单表 (DataTable 5 行, status->el-tag 彩色) * 走 /sys/openapi/order/list 真 API, 失败回退 FALLBACK_* - router 改: / 路径 -> StatisticsView, 旧 /dashboard 重定向到 / - 新增 /statistics/index 路径 -> StatisticsView - 验证 (Playwright 外网): 4 stat 500/¥47M/0/¥0 真数据, 2 图表画, 4 主题切色 --- src/modules/statistics/StatisticsView.vue | 357 ++++++++++++++++++++++ src/router/index.ts | 204 ++++++++++++- 2 files changed, 558 insertions(+), 3 deletions(-) create mode 100644 src/modules/statistics/StatisticsView.vue diff --git a/src/modules/statistics/StatisticsView.vue b/src/modules/statistics/StatisticsView.vue new file mode 100644 index 0000000..c2ade19 --- /dev/null +++ b/src/modules/statistics/StatisticsView.vue @@ -0,0 +1,357 @@ + + + + + diff --git a/src/router/index.ts b/src/router/index.ts index f3aeef6..40a6830 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,6 +1,15 @@ import { createRouter, createWebHistory } from 'vue-router' import type { RouteRecordRaw } from 'vue-router' +/** + * 路由结构 + * - /login 公开 + * - / + /dashboard 实际页面 + * - /inquiry 询价列表 + * - /inquiry/:id 询价详情 + * - /:module/:action 通配占位(覆盖菜单映射的 70 个 url,避免 404) + * - /:pathMatch(.*)* 兜底跳首页 + */ const routes: RouteRecordRaw[] = [ { path: '/login', @@ -8,11 +17,200 @@ const routes: RouteRecordRaw[] = [ component: () => import('@/modules/auth/LoginView.vue'), meta: { title: '登录', public: true } }, + // W3.x C P0.1: 数据统计首页 (生产环境一级模块, 走 order 真 API) { path: '/', - name: 'Dashboard', - component: () => import('@/modules/dashboard/DashboardView.vue'), - meta: { title: '数据看板', icon: 'dashboard' } + name: 'Statistics', + component: () => import('@/modules/statistics/StatisticsView.vue'), + meta: { title: '数据统计', icon: 'DataAnalysis' } + }, + { + path: '/dashboard', + redirect: '/' + }, + // statistics/index 走通配时, 仍走 StatisticsView + { + path: '/statistics/index', + name: 'StatisticsIndex', + component: () => import('@/modules/statistics/StatisticsView.vue'), + meta: { title: '数据统计', icon: 'DataAnalysis' } + }, + { + path: '/inquiry', + name: 'InquiryList', + component: () => import('@/modules/inquiry/InquiryListView.vue'), + meta: { title: '询价管理' } + }, + { + path: '/inquiry/:id', + name: 'InquiryDetail', + component: () => import('@/modules/inquiry/InquiryDetailView.vue'), + meta: { title: '询价详情' } + }, + // W3.2 订单管理(具体路由必须在 /:module/:action 之前,否则被通配拦截) + { + path: '/order', + name: 'OrderList', + component: () => import('@/modules/order/OrderListView.vue'), + meta: { title: '订单管理' } + }, + { + path: '/order/:id', + name: 'OrderDetail', + component: () => import('@/modules/order/OrderDetailView.vue'), + meta: { title: '订单详情' } + }, + // W4.19 业务模块(必须在通配占位之前) + { + path: '/user/enterprise', + name: 'UserEnterpriseList', + component: () => import('@/modules/user/EnterpriseListView.vue'), + meta: { title: '企业管理' } + }, + { + path: '/user/finance', + name: 'UserFinanceList', + component: () => import('@/modules/user/FinanceListView.vue'), + meta: { title: '财务管理' } + }, + { + path: '/supplier/activity', + name: 'SupplierActivityList', + component: () => import('@/modules/supplier/ActivityListView.vue'), + meta: { title: '营销活动' } + }, + // W4.1 集成管理 - 应用列表(具体路由必须在通配占位之前) + // 详情是 dialog 弹窗不是路由页(老 vue app-list.vue 结构) + { + path: '/openapi/app', + name: 'OpenAppList', + component: () => import('@/modules/openapi/OpenAppListView.vue'), + meta: { title: '应用列表' } + }, + // W4.2 集成管理 - 公司账号管理 + { + path: '/openapi/company', + name: 'OpenCompanyAccount', + component: () => import('@/modules/openapi/CompanyAccountListView.vue'), + meta: { title: '公司账号管理' } + }, + // W4.3 集成管理 - 审计日志 + { + path: '/openapi/audit-log', + name: 'OpenAuditLog', + component: () => import('@/modules/openapi/AuditLogListView.vue'), + meta: { title: '审计日志' } + }, + // W4.5 用户管理(后台用户) + { + path: '/sys/user', + name: 'SysUserList', + component: () => import('@/modules/sys/UserListView.vue'), + meta: { title: '用户管理' } + }, + // W4.6 角色管理 + { + path: '/sys/role', + name: 'SysRoleList', + component: () => import('@/modules/sys/RoleListView.vue'), + meta: { title: '角色管理' } + }, + // W4.7 参数管理(对应老 devtools/param, 后端 /sys/params/*) + { + path: '/sys/params', + name: 'SysParamsList', + component: () => import('@/modules/sys/ParamsListView.vue'), + meta: { title: '参数管理' } + }, + // W4.14 sys 模块补全:部门/菜单/日志 + { + path: '/sys/dept', + name: 'SysDeptList', + component: () => import('@/modules/sys/DeptListView.vue'), + meta: { title: '部门管理' } + }, + { + path: '/sys/menu', + name: 'SysMenuList', + component: () => import('@/modules/sys/MenuListView.vue'), + meta: { title: '菜单管理' } + }, + { + path: '/sys/log-login', + name: 'SysLogLogin', + component: () => import('@/modules/sys/LogLoginView.vue'), + meta: { title: '登录日志' } + }, + { + path: '/sys/log-operation', + name: 'SysLogOperation', + component: () => import('@/modules/sys/LogOperationView.vue'), + meta: { title: '操作日志' } + }, + // W4.16 sys 模块补全:岗位/错误日志/定时任务/角色组/文件 + { + path: '/sys/post', + name: 'SysPostList', + component: () => import('@/modules/sys/PostListView.vue'), + meta: { title: '岗位管理' } + }, + { + path: '/sys/log-error', + name: 'SysLogError', + component: () => import('@/modules/sys/LogErrorView.vue'), + meta: { title: '错误日志' } + }, + { + path: '/sys/schedule', + name: 'SysScheduleList', + component: () => import('@/modules/sys/ScheduleListView.vue'), + meta: { title: '定时任务' } + }, + { + path: '/sys/role-group', + name: 'SysRoleGroupList', + component: () => import('@/modules/sys/RoleGroupListView.vue'), + meta: { title: '角色组管理' } + }, + { + path: '/sys/file', + name: 'SysFileList', + component: () => import('@/modules/sys/FileListView.vue'), + meta: { title: '文件管理' } + }, + // W4.18 字典/通知/商品 + { + path: '/sys/dict-data', + name: 'SysDictDataList', + component: () => import('@/modules/sys/DictDataListView.vue'), + meta: { title: '字典数据' } + }, + { + path: '/sys/dict-type', + name: 'SysDictTypeList', + component: () => import('@/modules/sys/DictTypeListView.vue'), + meta: { title: '字典类型' } + }, + { + path: '/sys/notice', + name: 'SysNoticeList', + component: () => import('@/modules/sys/NoticeListView.vue'), + meta: { title: '通知公告' } + }, + { + path: '/sys/product', + name: 'SysProductList', + component: () => import('@/modules/sys/ProductListView.vue'), + meta: { title: '商品管理' } + }, + // W3.1 通用通配占位 — 覆盖菜单 70 个 url(两层路径,如 /admin/user/finance/recharge) + // 注意:必须放在具体路由后面,否则会拦截 /inquiry /login + // 使用 ?:action 让 action 可选(单层路径如 /sys/user 也匹配),不加 (.*)* 避免贪婪匹配抢静态路由 + { + path: '/:module/:action?', + name: 'Placeholder', + component: () => import('@/modules/placeholder/PlaceholderView.vue'), + meta: { title: '即将上线' } }, { path: '/:pathMatch(.*)*',