diff --git a/src/components.d.ts b/src/components.d.ts index 48baaf7..fa54962 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -22,6 +22,7 @@ declare module 'vue' { ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElHeader: typeof import('element-plus/es')['ElHeader'] + ElIcon: typeof import('element-plus/es')['ElIcon'] ElInput: typeof import('element-plus/es')['ElInput'] ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] ElMain: typeof import('element-plus/es')['ElMain'] @@ -35,6 +36,7 @@ declare module 'vue' { ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] + ElTag: typeof import('element-plus/es')['ElTag'] ElTree: typeof import('element-plus/es')['ElTree'] MapSelector: typeof import('./components/MapSelector.vue')['default'] Pagination: typeof import('./components/Pagination/index.vue')['default'] diff --git a/src/router/index.js b/src/router/index.js index 8cd2c38..60ac0e1 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -18,6 +18,12 @@ export const constantRoutes = [ // 动态路由配置(需要权限) export const asyncRoutes = [ + { + path: 'dashboard', + name: 'Dashboard', + component: () => import('@/views/Dashboard/index.vue'), + meta: { title: '仪表盘', permissions: ['dashboard'] }, + }, { path: 'SystemManage', meta: { title: '系统管理', permissions: ['system'] }, diff --git a/src/style/main.scss b/src/style/main.scss index 82830d4..e8949a3 100644 --- a/src/style/main.scss +++ b/src/style/main.scss @@ -34,3 +34,23 @@ body { .pointer { cursor: pointer; } + +*::-webkit-scrollbar { + width: 12px; + height: 12px; +} +*::-webkit-scrollbar-button { + width: 0px; + height: 0px; + display: none; +} +*::-webkit-scrollbar-corner { + background-color: transparent; +} +*::-webkit-scrollbar-thumb { + border: 4px solid rgba(0, 0, 0, 0); + height: 6px; + border-radius: 25px; + background-clip: padding-box; + background-color: rgba(0, 0, 0, 0.3); +} diff --git a/src/utils/rpc.js b/src/utils/rpc.js index 5185646..9b1952b 100644 --- a/src/utils/rpc.js +++ b/src/utils/rpc.js @@ -46,7 +46,6 @@ instance.interceptors.request.use( // HTTP response拦截 instance.interceptors.response.use( (response) => { - console.log(response) if (response.data.error.code === 200) { return Promise.resolve(response.data.result) } else if (response.data.error.code === 401) { diff --git a/src/views/Dashboard/OrderTypeChart.vue b/src/views/Dashboard/OrderTypeChart.vue new file mode 100644 index 0000000..74c8a43 --- /dev/null +++ b/src/views/Dashboard/OrderTypeChart.vue @@ -0,0 +1,128 @@ + + + + 订单类型分布 + + + + + + + + + diff --git a/src/views/Dashboard/RecentDrawings.vue b/src/views/Dashboard/RecentDrawings.vue new file mode 100644 index 0000000..ad1607c --- /dev/null +++ b/src/views/Dashboard/RecentDrawings.vue @@ -0,0 +1,145 @@ + + + + 最近图纸生成 + 查看全部 + + + + + {{ item.file_name }} + + 生成编号:{{ item.order_no }} + 用户:{{ item.username }}({{ item.user_id }}) + + + 生成时间:{{ + item.CreatedAt ? dayjs(item.CreatedAt).format('YYYY-MM-DD HH:mm:ss') : '' + }} + + + + + 待执行 + 已分发 + 执行中 + 执行完成(未收集结果) + 结果已收集 + 执行异常 + + + + + + + + + + diff --git a/src/views/Dashboard/RecentOrders.vue b/src/views/Dashboard/RecentOrders.vue new file mode 100644 index 0000000..bf7c956 --- /dev/null +++ b/src/views/Dashboard/RecentOrders.vue @@ -0,0 +1,120 @@ + + + + 最近订单 + 查看全部 + + + + + + + + {{ scope.row.amount }} + + + + + + + 待付款 + 待支付 + 已支付 + 支付失败 + 已取消 + 已退款 + + + + + + + + + + diff --git a/src/views/Dashboard/RevenueChart.vue b/src/views/Dashboard/RevenueChart.vue new file mode 100644 index 0000000..15b887e --- /dev/null +++ b/src/views/Dashboard/RevenueChart.vue @@ -0,0 +1,181 @@ + + + + 收入趋势 + + + 月度 + + + 季度 + + + 年度 + + + + + + + + + + diff --git a/src/views/Dashboard/index.vue b/src/views/Dashboard/index.vue new file mode 100644 index 0000000..7323658 --- /dev/null +++ b/src/views/Dashboard/index.vue @@ -0,0 +1,269 @@ + + + + + + + + 总用户数 + {{ data.total_users }} + + + + {{ data.total_users_mom_ratio }} 较上月 + + + + + + + + + + + + 今日活跃 + {{ data.active_today }} + + + {{ data.active_today_dod_ratio }} 较昨日 + + + + + + + + + + + + 商品生成量 + {{ data.drawings_generated }} + + + {{ data.drawings_generated_mom_ratio }} 较上月 + + + + + + + + + + + + 本月收入 + ¥{{ data.month_income_cents / 100 }} + + + {{ data.month_income_cents_mom_ratio }} 较上月 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/GenerateRecord/index.vue b/src/views/GenerateRecord/index.vue index 2f47233..739af6d 100644 --- a/src/views/GenerateRecord/index.vue +++ b/src/views/GenerateRecord/index.vue @@ -35,6 +35,14 @@ header-row-class-name="table-header" > + + 待执行