diff --git a/user-frontend/src/layouts/UserLayout.vue b/user-frontend/src/layouts/UserLayout.vue index 90078cb..ff05820 100644 --- a/user-frontend/src/layouts/UserLayout.vue +++ b/user-frontend/src/layouts/UserLayout.vue @@ -16,17 +16,26 @@ :collapse-transition="false" @select="showMobileMenu = false" > - {{ $t('nav.agent') || 'AI数字员工' }} - {{ $t('nav.discovery') }} - {{ $t('nav.workspace') }} - {{ $t('nav.customers') }} - {{ $t('nav.products') }} - {{ $t('nav.quotations') }} - {{ $t('nav.translate') }} - {{ $t('nav.marketing') }} - {{ $t('nav.followup') }} - {{ $t('nav.analytics') }} - {{ $t('nav.team') }} + {{ $t('nav.home') || '首页工作台' }} + {{ $t('nav.customers') }} + + + {{ $t('nav.products') }} + {{ $t('nav.quotations') }} + + {{ $t('nav.translate') }} + + + {{ $t('nav.profile') }} + {{ $t('nav.analytics') }} + {{ $t('nav.team') }} + @@ -36,17 +45,17 @@ - {{ $t('nav.workspace') }} - {{ $t('nav.' + route.name?.toLowerCase()) || route.meta.title }} + {{ $t('nav.home') || '首页工作台' }} + {{ $t('nav.' + route.name?.toLowerCase()) || route.meta.title }}
{{ currentLang }} - + {{ creditBalance }} {{ $t('topbar.credits') }} - + @@ -58,8 +67,8 @@ diff --git a/user-frontend/src/router/index.js b/user-frontend/src/router/index.js index f81e129..1cdede0 100644 --- a/user-frontend/src/router/index.js +++ b/user-frontend/src/router/index.js @@ -3,52 +3,49 @@ import { createRouter, createWebHistory } from 'vue-router' const routes = [ { path: '/login', redirect: '/' }, { path: '/', name: 'Landing', component: () => import('@/views/WorkspaceLanding.vue') }, - { - path: '/agent', - component: () => import('@/layouts/UserLayout.vue'), - meta: { requiresAuth: true }, - children: [ - { path: '', name: 'Agent', component: () => import('@/views/Agent.vue'), meta: { title: 'AI数字员工' } }, - ] - }, { path: '/workspace', component: () => import('@/layouts/UserLayout.vue'), meta: { requiresAuth: true }, children: [ - { path: '', name: 'Workspace', component: () => import('@/views/Workspace.vue'), meta: { title: '工作台' } }, + { path: '', name: 'Home', component: () => import('@/views/NewHome.vue'), meta: { title: '首页工作台' } }, + { path: 'customers', name: 'Customers', component: () => import('@/views/Customers.vue'), meta: { title: '客户管理' } }, + { path: 'products', name: 'Products', component: () => import('@/views/Products.vue'), meta: { title: '产品库' } }, + { path: 'quotations', name: 'Quotations', component: () => import('@/views/Quotations.vue'), meta: { title: '报价单' } }, + { path: 'translate', name: 'Translate', component: () => import('@/views/Translate.vue'), meta: { title: '智能翻译' } }, + { path: 'analytics', name: 'Analytics', component: () => import('@/views/Analytics.vue'), meta: { title: '数据分析' } }, + { path: 'team', name: 'Team', component: () => import('@/views/Team.vue'), meta: { title: '团队协作' } }, + { path: 'profile', name: 'Profile', component: () => import('@/views/Profile.vue'), meta: { title: '个人中心' } }, + { path: 'profile/credits', name: 'Credits', component: () => import('@/views/Credits.vue'), meta: { title: '购买次数' } }, + { path: 'profile/certification', name: 'Certification', component: () => import('@/views/Certification.vue'), meta: { title: '实名认证' } }, + { path: 'profile/invoice', name: 'Invoice', component: () => import('@/views/Invoice.vue'), meta: { title: '发票管理' } }, + { path: 'profile/notifications', name: 'Notifications', component: () => import('@/views/Notifications.vue'), meta: { title: '通知中心' } }, + { path: 'profile/feedback', name: 'Feedback', component: () => import('@/views/Feedback.vue'), meta: { title: '意见反馈' } }, ] }, + // Redirect old top-level routes to new /workspace children + { path: '/customers', redirect: '/workspace/customers' }, + { path: '/products', redirect: '/workspace/products' }, + { path: '/quotations', redirect: '/workspace/quotations' }, + { path: '/translate', redirect: '/workspace/translate' }, + { path: '/analytics', redirect: '/workspace/analytics' }, + { path: '/team', redirect: '/workspace/team' }, + { path: '/profile', redirect: '/workspace/profile' }, + { path: '/credits', redirect: '/workspace/profile/credits' }, + { path: '/certification', redirect: '/workspace/profile/certification' }, + { path: '/invoice', redirect: '/workspace/profile/invoice' }, + { path: '/notifications', redirect: '/workspace/profile/notifications' }, + { path: '/feedback', redirect: '/workspace/profile/feedback' }, + { path: '/agent', redirect: '/workspace' }, + { path: '/workspace/home', redirect: '/workspace' }, + + // Hidden routes – still accessible via direct URL but not in sidebar { - path: '/translate', + path: '/discovery', component: () => import('@/layouts/UserLayout.vue'), meta: { requiresAuth: true }, children: [ - { path: '', name: 'Translate', component: () => import('@/views/Translate.vue'), meta: { title: '智能翻译' } }, - ] - }, - { - path: '/customers', - component: () => import('@/layouts/UserLayout.vue'), - meta: { requiresAuth: true }, - children: [ - { path: '', name: 'Customers', component: () => import('@/views/Customers.vue'), meta: { title: '客户管理' } }, - ] - }, - { - path: '/products', - component: () => import('@/layouts/UserLayout.vue'), - meta: { requiresAuth: true }, - children: [ - { path: '', name: 'Products', component: () => import('@/views/Products.vue'), meta: { title: '产品库' } }, - ] - }, - { - path: '/quotations', - component: () => import('@/layouts/UserLayout.vue'), - meta: { requiresAuth: true }, - children: [ - { path: '', name: 'Quotations', component: () => import('@/views/Quotations.vue'), meta: { title: '报价单' } }, + { path: '', name: 'Discovery', component: () => import('@/views/Discovery.vue'), meta: { title: '发现客户' } }, ] }, { @@ -59,14 +56,6 @@ const routes = [ { path: '', name: 'Marketing', component: () => import('@/views/Marketing.vue'), meta: { title: '营销素材' } }, ] }, - { - path: '/discovery', - component: () => import('@/layouts/UserLayout.vue'), - meta: { requiresAuth: true }, - children: [ - { path: '', name: 'Discovery', component: () => import('@/views/Discovery.vue'), meta: { title: '发现客户' } }, - ] - }, { path: '/followup', component: () => import('@/layouts/UserLayout.vue'), @@ -75,70 +64,6 @@ const routes = [ { path: '', name: 'Followup', component: () => import('@/views/Followup.vue'), meta: { title: '智能跟进' } }, ] }, - { - path: '/analytics', - component: () => import('@/layouts/UserLayout.vue'), - meta: { requiresAuth: true }, - children: [ - { path: '', name: 'Analytics', component: () => import('@/views/Analytics.vue'), meta: { title: '数据分析' } }, - ] - }, - { - path: '/team', - component: () => import('@/layouts/UserLayout.vue'), - meta: { requiresAuth: true }, - children: [ - { path: '', name: 'Team', component: () => import('@/views/Team.vue'), meta: { title: '团队协作' } }, - ] - }, - { - path: '/notifications', - component: () => import('@/layouts/UserLayout.vue'), - meta: { requiresAuth: true }, - children: [ - { path: '', name: 'Notifications', component: () => import('@/views/Notifications.vue'), meta: { title: '通知中心' } }, - ] - }, - { - path: '/profile', - component: () => import('@/layouts/UserLayout.vue'), - meta: { requiresAuth: true }, - children: [ - { path: '', name: 'Profile', component: () => import('@/views/Profile.vue'), meta: { title: '个人中心' } }, - ] - }, - { - path: '/credits', - component: () => import('@/layouts/UserLayout.vue'), - meta: { requiresAuth: true }, - children: [ - { path: '', name: 'Credits', component: () => import('@/views/Credits.vue'), meta: { title: '购买次数' } }, - ] - }, - { - path: '/certification', - component: () => import('@/layouts/UserLayout.vue'), - meta: { requiresAuth: true }, - children: [ - { path: '', name: 'Certification', component: () => import('@/views/Certification.vue'), meta: { title: '实名认证' } }, - ] - }, - { - path: '/invoice', - component: () => import('@/layouts/UserLayout.vue'), - meta: { requiresAuth: true }, - children: [ - { path: '', name: 'Invoice', component: () => import('@/views/Invoice.vue'), meta: { title: '发票管理' } }, - ] - }, - { - path: '/feedback', - component: () => import('@/layouts/UserLayout.vue'), - meta: { requiresAuth: true }, - children: [ - { path: '', name: 'Feedback', component: () => import('@/views/Feedback.vue'), meta: { title: '意见反馈' } }, - ] - }, { path: '/:pathMatch(.*)*', redirect: '/' }, ] diff --git a/user-frontend/src/views/NewHome.vue b/user-frontend/src/views/NewHome.vue new file mode 100644 index 0000000..c316fba --- /dev/null +++ b/user-frontend/src/views/NewHome.vue @@ -0,0 +1,679 @@ + + + + + diff --git a/user-frontend/src/views/Profile.vue b/user-frontend/src/views/Profile.vue index ceab703..ab0922f 100644 --- a/user-frontend/src/views/Profile.vue +++ b/user-frontend/src/views/Profile.vue @@ -11,19 +11,22 @@
-