hookehuyr

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

移除demo和vben相关路由,添加帮助页面路由
更新密码设置页面引用命名
添加类型声明文件和帮助页面组件
......@@ -5,9 +5,8 @@ import { computed, ref, watch } from 'vue';
import { useRouter } from 'vue-router';
import { AuthenticationLoginExpiredModal } from '@vben/common-ui';
import { VBEN_DOC_URL, VBEN_GITHUB_URL } from '@vben/constants';
import { useWatermark } from '@vben/hooks';
import { BookOpenText, CircleHelp, SvgGithubIcon } from '@vben/icons';
import { CircleHelp } from '@vben/icons';
import {
BasicLayout,
LockScreen,
......@@ -16,7 +15,6 @@ import {
} from '@vben/layouts';
import { preferences } from '@vben/preferences';
import { useAccessStore, useUserStore } from '@vben/stores';
import { openWindow } from '@vben/utils';
import { $t } from '#/locales';
import { useAuthStore } from '#/store';
......@@ -94,27 +92,7 @@ const menus = computed(() => [
},
{
handler: () => {
openWindow(VBEN_DOC_URL, {
target: '_blank',
});
},
icon: BookOpenText,
text: $t('ui.widgets.document'),
},
{
handler: () => {
openWindow(VBEN_GITHUB_URL, {
target: '_blank',
});
},
icon: SvgGithubIcon,
text: 'GitHub',
},
{
handler: () => {
openWindow(`${VBEN_GITHUB_URL}/issues`, {
target: '_blank',
});
router.push({ name: 'Help' });
},
icon: CircleHelp,
text: $t('ui.widgets.qa'),
......
/*
* @Date: 2025-11-17 19:45:50
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-06 15:03:22
* @FilePath: /vben-admin/apps/web-ele/src/router/routes/modules/demos.ts
* @Description: 文件描述
*/
import type { RouteRecordRaw } from 'vue-router';
import { $t } from '#/locales';
const routes: RouteRecordRaw[] = [
{
meta: {
icon: 'ic:baseline-view-in-ar',
keepAlive: true,
order: 1000,
title: $t('demos.title'),
},
name: 'Demos',
path: '/demos',
children: [
{
meta: {
title: $t('demos.elementPlus'),
},
name: 'NaiveDemos',
path: '/demos/element',
component: () => import('#/views/demos/element/index.vue'),
},
{
meta: {
title: $t('demos.form'),
},
name: 'BasicForm',
path: '/demos/form',
component: () => import('#/views/demos/form/basic.vue'),
},
],
},
];
const routes: RouteRecordRaw[] = [];
export default routes;
......
/*
* @Date: 2025-11-17 19:45:50
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-06 15:26:01
* @FilePath: /vben-admin/apps/web-ele/src/router/routes/modules/vben.ts
* @Description: 路由模块 - Vben 相关页面
*/
import type { RouteRecordRaw } from 'vue-router';
import {
VBEN_ANT_PREVIEW_URL,
VBEN_DOC_URL,
VBEN_GITHUB_URL,
VBEN_LOGO_URL,
VBEN_NAIVE_PREVIEW_URL,
VBEN_TD_PREVIEW_URL,
} from '@vben/constants';
import { SvgAntdvLogoIcon, SvgTDesignIcon } from '@vben/icons';
import { IFrameView } from '#/layouts';
import { $t } from '#/locales';
const routes: RouteRecordRaw[] = [
{
meta: {
badgeType: 'dot',
icon: VBEN_LOGO_URL,
order: 9998,
title: $t('demos.vben.title'),
},
name: 'VbenProject',
path: '/vben-admin',
children: [
{
name: 'VbenDocument',
path: '/vben-admin/document',
component: IFrameView,
meta: {
icon: 'lucide:book-open-text',
link: VBEN_DOC_URL,
title: $t('demos.vben.document'),
},
},
{
name: 'VbenGithub',
path: '/vben-admin/github',
component: IFrameView,
meta: {
icon: 'mdi:github',
link: VBEN_GITHUB_URL,
title: 'Github',
},
},
{
name: 'VbenNaive',
path: '/vben-admin/naive',
component: IFrameView,
meta: {
badgeType: 'dot',
icon: 'logos:naiveui',
link: VBEN_NAIVE_PREVIEW_URL,
title: $t('demos.vben.naive-ui'),
},
},
{
name: 'VbenAntd',
path: '/vben-admin/antd',
component: IFrameView,
meta: {
badgeType: 'dot',
icon: SvgAntdvLogoIcon,
link: VBEN_ANT_PREVIEW_URL,
title: $t('demos.vben.antdv'),
},
},
{
name: 'VbenTDesign',
path: '/vben-admin/tdesign',
component: IFrameView,
meta: {
badgeType: 'dot',
icon: SvgTDesignIcon,
link: VBEN_TD_PREVIEW_URL,
title: $t('demos.vben.tdesign'),
},
},
],
},
{
name: 'VbenAbout',
path: '/vben-admin/about',
component: () => import('#/views/_core/about/index.vue'),
meta: {
icon: 'lucide:copyright',
title: $t('demos.vben.about'),
order: 9999,
},
},
{
name: 'Profile',
path: '/profile',
component: () => import('#/views/_core/profile/index.vue'),
......@@ -99,6 +20,16 @@ const routes: RouteRecordRaw[] = [
title: $t('page.auth.profile'),
},
},
{
name: 'Help',
path: '/help',
component: () => import('#/views/_core/help/index.vue'),
meta: {
icon: 'lucide:circle-help',
hideInMenu: true,
title: $t('ui.widgets.qa'),
},
},
];
export default routes;
......
<script setup lang="ts">
import { Page } from '@vben/common-ui';
</script>
<template>
<Page title="问题与帮助" description="这里可以放置常见问题、使用说明等内容">
<div class="flex flex-col gap-4">
<div class="text-lg font-medium">常见问题</div>
<div class="text-sm text-gray-600">
这里是示例问题帮助页面,后续可以根据实际业务替换为真实内容。
</div>
</div>
</Page>
</template>
<!--
* @Date: 2025-11-17 19:45:50
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-06 14:08:28
* @FilePath: /vben-admin/apps/web-ele/src/views/_core/profile/password-setting.vue
* @Description: 文件描述
-->
<script setup lang="ts">
import type { VbenFormSchema } from '#/adapter/form';
......@@ -7,7 +14,8 @@ import { ProfilePasswordSetting, z } from '@vben/common-ui';
import { ElMessage } from 'element-plus';
const profilePasswordSettingRef = ref();
const _profilePasswordSettingRef =
ref<InstanceType<typeof ProfilePasswordSetting>>();
const formSchema = computed((): VbenFormSchema[] => {
return [
......@@ -53,12 +61,13 @@ const formSchema = computed((): VbenFormSchema[] => {
});
function handleSubmit() {
void _profilePasswordSettingRef.value;
ElMessage.success('密码修改成功');
}
</script>
<template>
<ProfilePasswordSetting
ref="profilePasswordSettingRef"
ref="_profilePasswordSettingRef"
class="w-1/3"
:form-schema="formSchema"
@submit="handleSubmit"
......
/*
* @Date: 2026-01-06 15:17:42
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-06 15:22:28
* @FilePath: /vben-admin/apps/web-ele/src/vite-env.d.ts
* @Description: 文件描述
*/
import 'vite/client';
declare module '*.vue' {
import type { DefineComponent } from 'vue';
const component: DefineComponent<object, object, any>;
export default component;
}
......@@ -9,5 +9,5 @@
}
},
"references": [{ "path": "./tsconfig.node.json" }],
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "src/**/*.d.ts"]
}
......