From 5e09229143834368ec5c4e02ea08838de61a98ba Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Tue, 8 Jul 2025 10:39:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=A6=96=E9=A1=B5=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E3=80=81=E5=8F=B3=E4=B8=8A=E8=A7=92=E5=92=8C=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/layouts/basic.vue | 60 ++- .../src/locales/langs/zh-CN/page.json | 2 +- apps/web-antd/src/preferences.ts | 5 + .../src/router/routes/modules/dashboard.ts | 62 ++-- .../analytics/analytics-customer-type.vue | 65 ++++ apps/web-antd/src/views/dashboard/index.vue | 346 ++++++++++++++++++ 6 files changed, 480 insertions(+), 60 deletions(-) create mode 100644 apps/web-antd/src/views/dashboard/analytics/analytics-customer-type.vue create mode 100644 apps/web-antd/src/views/dashboard/index.vue diff --git a/apps/web-antd/src/layouts/basic.vue b/apps/web-antd/src/layouts/basic.vue index 2777f4a..4128dd1 100644 --- a/apps/web-antd/src/layouts/basic.vue +++ b/apps/web-antd/src/layouts/basic.vue @@ -4,14 +4,8 @@ import type { NotificationItem } from '@vben/layouts'; import { computed, onMounted, ref, watch } from 'vue'; import { AuthenticationLoginExpiredModal, useVbenModal } from '@vben/common-ui'; -import { VBEN_DOC_URL, VBEN_GITHUB_URL } from '@vben/constants'; import { useWatermark } from '@vben/hooks'; -import { - AntdProfileOutlined, - BookOpenText, - CircleHelp, - MdiGithub, -} from '@vben/icons'; +import { AntdProfileOutlined } from '@vben/icons'; import { BasicLayout, LockScreen, @@ -20,7 +14,7 @@ import { } from '@vben/layouts'; import { preferences } from '@vben/preferences'; import { useAccessStore, useUserStore } from '@vben/stores'; -import { formatDateTime, openWindow } from '@vben/utils'; +import { formatDateTime } from '@vben/utils'; import { getUnreadNotifyMessageCount, @@ -57,31 +51,31 @@ const menus = computed(() => [ icon: AntdProfileOutlined, text: $t('ui.widgets.profile'), }, - { - handler: () => { - openWindow(VBEN_DOC_URL, { - target: '_blank', - }); - }, - icon: BookOpenText, - text: $t('ui.widgets.document'), - }, - { - handler: () => { - openWindow(VBEN_GITHUB_URL, { - target: '_blank', - }); - }, - icon: MdiGithub, - text: 'GitHub', - }, - { - handler: () => { - helpModalApi.open(); - }, - icon: CircleHelp, - text: $t('ui.widgets.qa'), - }, + // { + // handler: () => { + // openWindow(VBEN_DOC_URL, { + // target: '_blank', + // }); + // }, + // icon: BookOpenText, + // text: $t('ui.widgets.document'), + // }, + // { + // handler: () => { + // openWindow(VBEN_GITHUB_URL, { + // target: '_blank', + // }); + // }, + // icon: MdiGithub, + // text: 'GitHub', + // }, + // { + // handler: () => { + // helpModalApi.open(); + // }, + // icon: CircleHelp, + // text: $t('ui.widgets.qa'), + // }, ]); const avatar = computed(() => { diff --git a/apps/web-antd/src/locales/langs/zh-CN/page.json b/apps/web-antd/src/locales/langs/zh-CN/page.json index eefc492..41d8fec 100644 --- a/apps/web-antd/src/locales/langs/zh-CN/page.json +++ b/apps/web-antd/src/locales/langs/zh-CN/page.json @@ -7,7 +7,7 @@ "forgetPassword": "忘记密码" }, "dashboard": { - "title": "概览", + "title": "首页", "analytics": "分析页", "workspace": "工作台" }, diff --git a/apps/web-antd/src/preferences.ts b/apps/web-antd/src/preferences.ts index 3556ad1..a5fb24c 100644 --- a/apps/web-antd/src/preferences.ts +++ b/apps/web-antd/src/preferences.ts @@ -12,11 +12,16 @@ export const overridesPreferences = defineOverridesPreferences({ accessMode: 'backend', name: import.meta.env.VITE_APP_TITLE, enableRefreshToken: true, + defaultHomePath: '/dashboard', }, logo: { // source: 'https://www.agrandtech.com.cn/favicon.ico', source: '/agt.png', }, + theme: { + /** 默认主题 */ + mode: 'light', + }, footer: { /** 默认关闭 footer 页脚,因为有一定遮挡 */ enable: false, diff --git a/apps/web-antd/src/router/routes/modules/dashboard.ts b/apps/web-antd/src/router/routes/modules/dashboard.ts index 2cccc81..0ed61b2 100644 --- a/apps/web-antd/src/router/routes/modules/dashboard.ts +++ b/apps/web-antd/src/router/routes/modules/dashboard.ts @@ -3,35 +3,45 @@ import type { RouteRecordRaw } from 'vue-router'; import { $t } from '#/locales'; const routes: RouteRecordRaw[] = [ + // { + // meta: { + // icon: 'lucide:layout-dashboard', + // order: -1, + // title: $t('page.dashboard.title'), + // }, + // name: 'Dashboard2', + // path: '/dashboard2', + // children: [ + // { + // name: 'Workspace', + // path: '/workspace', + // component: () => import('#/views/dashboard/workspace/index.vue'), + // meta: { + // icon: 'carbon:workspace', + // title: $t('page.dashboard.workspace'), + // }, + // }, + // { + // name: 'Analytics', + // path: '/analytics', + // component: () => import('#/views/dashboard/analytics/index.vue'), + // meta: { + // affixTab: true, + // icon: 'lucide:area-chart', + // title: $t('page.dashboard.analytics'), + // }, + // }, + // ], + // }, { - meta: { - icon: 'lucide:layout-dashboard', - order: -1, - title: $t('page.dashboard.title'), - }, name: 'Dashboard', path: '/dashboard', - children: [ - { - name: 'Workspace', - path: '/workspace', - component: () => import('#/views/dashboard/workspace/index.vue'), - meta: { - icon: 'carbon:workspace', - title: $t('page.dashboard.workspace'), - }, - }, - { - name: 'Analytics', - path: '/analytics', - component: () => import('#/views/dashboard/analytics/index.vue'), - meta: { - affixTab: true, - icon: 'lucide:area-chart', - title: $t('page.dashboard.analytics'), - }, - }, - ], + component: () => import('#/views/dashboard/index.vue'), + meta: { + icon: 'ion:home-outline', + title: $t('page.dashboard.title'), + order: -1, + }, }, { name: 'Profile', diff --git a/apps/web-antd/src/views/dashboard/analytics/analytics-customer-type.vue b/apps/web-antd/src/views/dashboard/analytics/analytics-customer-type.vue new file mode 100644 index 0000000..20212af --- /dev/null +++ b/apps/web-antd/src/views/dashboard/analytics/analytics-customer-type.vue @@ -0,0 +1,65 @@ + + + diff --git a/apps/web-antd/src/views/dashboard/index.vue b/apps/web-antd/src/views/dashboard/index.vue new file mode 100644 index 0000000..9691035 --- /dev/null +++ b/apps/web-antd/src/views/dashboard/index.vue @@ -0,0 +1,346 @@ + + +