hookehuyr

refactor(router): 清理并重构路由配置

移除demo和vben相关路由,添加帮助页面路由
更新密码设置页面引用命名
添加类型声明文件和帮助页面组件
...@@ -5,9 +5,8 @@ import { computed, ref, watch } from 'vue'; ...@@ -5,9 +5,8 @@ import { computed, ref, watch } from 'vue';
5 import { useRouter } from 'vue-router'; 5 import { useRouter } from 'vue-router';
6 6
7 import { AuthenticationLoginExpiredModal } from '@vben/common-ui'; 7 import { AuthenticationLoginExpiredModal } from '@vben/common-ui';
8 -import { VBEN_DOC_URL, VBEN_GITHUB_URL } from '@vben/constants';
9 import { useWatermark } from '@vben/hooks'; 8 import { useWatermark } from '@vben/hooks';
10 -import { BookOpenText, CircleHelp, SvgGithubIcon } from '@vben/icons'; 9 +import { CircleHelp } from '@vben/icons';
11 import { 10 import {
12 BasicLayout, 11 BasicLayout,
13 LockScreen, 12 LockScreen,
...@@ -16,7 +15,6 @@ import { ...@@ -16,7 +15,6 @@ import {
16 } from '@vben/layouts'; 15 } from '@vben/layouts';
17 import { preferences } from '@vben/preferences'; 16 import { preferences } from '@vben/preferences';
18 import { useAccessStore, useUserStore } from '@vben/stores'; 17 import { useAccessStore, useUserStore } from '@vben/stores';
19 -import { openWindow } from '@vben/utils';
20 18
21 import { $t } from '#/locales'; 19 import { $t } from '#/locales';
22 import { useAuthStore } from '#/store'; 20 import { useAuthStore } from '#/store';
...@@ -94,27 +92,7 @@ const menus = computed(() => [ ...@@ -94,27 +92,7 @@ const menus = computed(() => [
94 }, 92 },
95 { 93 {
96 handler: () => { 94 handler: () => {
97 - openWindow(VBEN_DOC_URL, { 95 + router.push({ name: 'Help' });
98 - target: '_blank',
99 - });
100 - },
101 - icon: BookOpenText,
102 - text: $t('ui.widgets.document'),
103 - },
104 - {
105 - handler: () => {
106 - openWindow(VBEN_GITHUB_URL, {
107 - target: '_blank',
108 - });
109 - },
110 - icon: SvgGithubIcon,
111 - text: 'GitHub',
112 - },
113 - {
114 - handler: () => {
115 - openWindow(`${VBEN_GITHUB_URL}/issues`, {
116 - target: '_blank',
117 - });
118 }, 96 },
119 icon: CircleHelp, 97 icon: CircleHelp,
120 text: $t('ui.widgets.qa'), 98 text: $t('ui.widgets.qa'),
......
1 +/*
2 + * @Date: 2025-11-17 19:45:50
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2026-01-06 15:03:22
5 + * @FilePath: /vben-admin/apps/web-ele/src/router/routes/modules/demos.ts
6 + * @Description: 文件描述
7 + */
1 import type { RouteRecordRaw } from 'vue-router'; 8 import type { RouteRecordRaw } from 'vue-router';
2 9
3 -import { $t } from '#/locales'; 10 +const routes: RouteRecordRaw[] = [];
4 -
5 -const routes: RouteRecordRaw[] = [
6 - {
7 - meta: {
8 - icon: 'ic:baseline-view-in-ar',
9 - keepAlive: true,
10 - order: 1000,
11 - title: $t('demos.title'),
12 - },
13 - name: 'Demos',
14 - path: '/demos',
15 - children: [
16 - {
17 - meta: {
18 - title: $t('demos.elementPlus'),
19 - },
20 - name: 'NaiveDemos',
21 - path: '/demos/element',
22 - component: () => import('#/views/demos/element/index.vue'),
23 - },
24 - {
25 - meta: {
26 - title: $t('demos.form'),
27 - },
28 - name: 'BasicForm',
29 - path: '/demos/form',
30 - component: () => import('#/views/demos/form/basic.vue'),
31 - },
32 - ],
33 - },
34 -];
35 11
36 export default routes; 12 export default routes;
......
1 +/*
2 + * @Date: 2025-11-17 19:45:50
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2026-01-06 15:26:01
5 + * @FilePath: /vben-admin/apps/web-ele/src/router/routes/modules/vben.ts
6 + * @Description: 路由模块 - Vben 相关页面
7 + */
1 import type { RouteRecordRaw } from 'vue-router'; 8 import type { RouteRecordRaw } from 'vue-router';
2 9
3 -import {
4 - VBEN_ANT_PREVIEW_URL,
5 - VBEN_DOC_URL,
6 - VBEN_GITHUB_URL,
7 - VBEN_LOGO_URL,
8 - VBEN_NAIVE_PREVIEW_URL,
9 - VBEN_TD_PREVIEW_URL,
10 -} from '@vben/constants';
11 -import { SvgAntdvLogoIcon, SvgTDesignIcon } from '@vben/icons';
12 -
13 -import { IFrameView } from '#/layouts';
14 import { $t } from '#/locales'; 10 import { $t } from '#/locales';
15 11
16 const routes: RouteRecordRaw[] = [ 12 const routes: RouteRecordRaw[] = [
17 { 13 {
18 - meta: {
19 - badgeType: 'dot',
20 - icon: VBEN_LOGO_URL,
21 - order: 9998,
22 - title: $t('demos.vben.title'),
23 - },
24 - name: 'VbenProject',
25 - path: '/vben-admin',
26 - children: [
27 - {
28 - name: 'VbenDocument',
29 - path: '/vben-admin/document',
30 - component: IFrameView,
31 - meta: {
32 - icon: 'lucide:book-open-text',
33 - link: VBEN_DOC_URL,
34 - title: $t('demos.vben.document'),
35 - },
36 - },
37 - {
38 - name: 'VbenGithub',
39 - path: '/vben-admin/github',
40 - component: IFrameView,
41 - meta: {
42 - icon: 'mdi:github',
43 - link: VBEN_GITHUB_URL,
44 - title: 'Github',
45 - },
46 - },
47 - {
48 - name: 'VbenNaive',
49 - path: '/vben-admin/naive',
50 - component: IFrameView,
51 - meta: {
52 - badgeType: 'dot',
53 - icon: 'logos:naiveui',
54 - link: VBEN_NAIVE_PREVIEW_URL,
55 - title: $t('demos.vben.naive-ui'),
56 - },
57 - },
58 - {
59 - name: 'VbenAntd',
60 - path: '/vben-admin/antd',
61 - component: IFrameView,
62 - meta: {
63 - badgeType: 'dot',
64 - icon: SvgAntdvLogoIcon,
65 - link: VBEN_ANT_PREVIEW_URL,
66 - title: $t('demos.vben.antdv'),
67 - },
68 - },
69 - {
70 - name: 'VbenTDesign',
71 - path: '/vben-admin/tdesign',
72 - component: IFrameView,
73 - meta: {
74 - badgeType: 'dot',
75 - icon: SvgTDesignIcon,
76 - link: VBEN_TD_PREVIEW_URL,
77 - title: $t('demos.vben.tdesign'),
78 - },
79 - },
80 - ],
81 - },
82 - {
83 - name: 'VbenAbout',
84 - path: '/vben-admin/about',
85 - component: () => import('#/views/_core/about/index.vue'),
86 - meta: {
87 - icon: 'lucide:copyright',
88 - title: $t('demos.vben.about'),
89 - order: 9999,
90 - },
91 - },
92 - {
93 name: 'Profile', 14 name: 'Profile',
94 path: '/profile', 15 path: '/profile',
95 component: () => import('#/views/_core/profile/index.vue'), 16 component: () => import('#/views/_core/profile/index.vue'),
...@@ -99,6 +20,16 @@ const routes: RouteRecordRaw[] = [ ...@@ -99,6 +20,16 @@ const routes: RouteRecordRaw[] = [
99 title: $t('page.auth.profile'), 20 title: $t('page.auth.profile'),
100 }, 21 },
101 }, 22 },
23 + {
24 + name: 'Help',
25 + path: '/help',
26 + component: () => import('#/views/_core/help/index.vue'),
27 + meta: {
28 + icon: 'lucide:circle-help',
29 + hideInMenu: true,
30 + title: $t('ui.widgets.qa'),
31 + },
32 + },
102 ]; 33 ];
103 34
104 export default routes; 35 export default routes;
......
1 +<script setup lang="ts">
2 +import { Page } from '@vben/common-ui';
3 +</script>
4 +
5 +<template>
6 + <Page title="问题与帮助" description="这里可以放置常见问题、使用说明等内容">
7 + <div class="flex flex-col gap-4">
8 + <div class="text-lg font-medium">常见问题</div>
9 + <div class="text-sm text-gray-600">
10 + 这里是示例问题帮助页面,后续可以根据实际业务替换为真实内容。
11 + </div>
12 + </div>
13 + </Page>
14 +</template>
1 +<!--
2 + * @Date: 2025-11-17 19:45:50
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2026-01-06 14:08:28
5 + * @FilePath: /vben-admin/apps/web-ele/src/views/_core/profile/password-setting.vue
6 + * @Description: 文件描述
7 +-->
1 <script setup lang="ts"> 8 <script setup lang="ts">
2 import type { VbenFormSchema } from '#/adapter/form'; 9 import type { VbenFormSchema } from '#/adapter/form';
3 10
...@@ -7,7 +14,8 @@ import { ProfilePasswordSetting, z } from '@vben/common-ui'; ...@@ -7,7 +14,8 @@ import { ProfilePasswordSetting, z } from '@vben/common-ui';
7 14
8 import { ElMessage } from 'element-plus'; 15 import { ElMessage } from 'element-plus';
9 16
10 -const profilePasswordSettingRef = ref(); 17 +const _profilePasswordSettingRef =
18 + ref<InstanceType<typeof ProfilePasswordSetting>>();
11 19
12 const formSchema = computed((): VbenFormSchema[] => { 20 const formSchema = computed((): VbenFormSchema[] => {
13 return [ 21 return [
...@@ -53,12 +61,13 @@ const formSchema = computed((): VbenFormSchema[] => { ...@@ -53,12 +61,13 @@ const formSchema = computed((): VbenFormSchema[] => {
53 }); 61 });
54 62
55 function handleSubmit() { 63 function handleSubmit() {
64 + void _profilePasswordSettingRef.value;
56 ElMessage.success('密码修改成功'); 65 ElMessage.success('密码修改成功');
57 } 66 }
58 </script> 67 </script>
59 <template> 68 <template>
60 <ProfilePasswordSetting 69 <ProfilePasswordSetting
61 - ref="profilePasswordSettingRef" 70 + ref="_profilePasswordSettingRef"
62 class="w-1/3" 71 class="w-1/3"
63 :form-schema="formSchema" 72 :form-schema="formSchema"
64 @submit="handleSubmit" 73 @submit="handleSubmit"
......
1 +/*
2 + * @Date: 2026-01-06 15:17:42
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2026-01-06 15:22:28
5 + * @FilePath: /vben-admin/apps/web-ele/src/vite-env.d.ts
6 + * @Description: 文件描述
7 + */
8 +import 'vite/client';
9 +
10 +declare module '*.vue' {
11 + import type { DefineComponent } from 'vue';
12 +
13 + const component: DefineComponent<object, object, any>;
14 +
15 + export default component;
16 +}
...@@ -9,5 +9,5 @@ ...@@ -9,5 +9,5 @@
9 } 9 }
10 }, 10 },
11 "references": [{ "path": "./tsconfig.node.json" }], 11 "references": [{ "path": "./tsconfig.node.json" }],
12 - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] 12 + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "src/**/*.d.ts"]
13 } 13 }
......