From 3ae0c6ed19c227269f6fcbdd0399cb645b48b504 Mon Sep 17 00:00:00 2001 From: wang_fan_w <2547096351@qq.com> Date: Fri, 28 Jun 2024 19:01:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A4=96=E9=93=BE=E7=9A=84=E5=A4=84?= =?UTF-8?q?=E7=90=86=E9=80=BB=E8=BE=91=E4=BB=A5=E5=8F=8A=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E8=A7=86=E5=8F=A3=E7=BB=84=E4=BB=B6=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 16 +------ src/components.d.ts | 2 + src/components/external-link-page/index.vue | 42 ++++++++++++++++ src/components/fill-page/index.vue | 48 +++++++++++++++++++ src/hooks/useRoutingMethod.ts | 15 +++++- src/lang/modules/enUS.ts | 1 + src/lang/modules/zhCN.ts | 3 +- src/layout/components/Main/index.vue | 6 +-- src/router/index.ts | 11 +++++ src/router/route-output.ts | 5 +- src/router/route.ts | 16 +++++++ src/style/global-style.scss | 1 + .../external-links/link-gitee/link-gitee.vue | 8 +--- .../link-juejin/link-juejin.vue | 3 ++ 14 files changed, 149 insertions(+), 28 deletions(-) create mode 100644 src/components/external-link-page/index.vue create mode 100644 src/components/fill-page/index.vue create mode 100644 src/views/external-links/link-juejin/link-juejin.vue diff --git a/README.md b/README.md index cc9f3b9..cde7c73 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,7 @@ ### 介绍 📖 -DC-Admin 一款基于 Vue3、TypeScript、Vite5、Pinia、Arco-Design 开源的后台管理框架,使用目前最新技术栈开发。项目提供了一些常用组件,在一定程度上提高您的开发效率。另外本项目还封装了一些常用组件、Hooks、动态路由等功能。 - +DC-Admin 一款基于 Vue3、TypeScript、Vite5、Pinia、Arco-Design 开源的后台管理框架,符合直觉的使用模式,使用目前最新技术栈开发。项目提供了一些常用组件,在一定程度上提高您的开发效率。另外本项目还封装了一些常用组件、Hooks、动态路由等功能。 ### 在线预览 👀 @@ -75,29 +74,18 @@ pnpm lint:eslint pnpm lint:prettier ``` - ### 项目截图 📷 - 登录页: - - - 首页: - - - 表格页: - - - 用户中心: - - - 系统配置页: - - ### 文件资源目录 📚 ```text @@ -153,4 +141,4 @@ DC-Admin ### 项目后台接口 🧩 -建设中 \ No newline at end of file +建设中 diff --git a/src/components.d.ts b/src/components.d.ts index a273c6b..ff0d1f0 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -9,6 +9,8 @@ declare module 'vue' { export interface GlobalComponents { CodemirrorCode: typeof import('./components/codemirror-code/index.vue')['default'] CodeView: typeof import('./components/code-view/index.vue')['default'] + ExternalLinkPage: typeof import('./components/external-link-page/index.vue')['default'] + FillPage: typeof import('./components/fill-page/index.vue')['default'] LangProvider: typeof import('./components/lang-provider/index.vue')['default'] MainTransition: typeof import('./components/main-transition/index.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] diff --git a/src/components/external-link-page/index.vue b/src/components/external-link-page/index.vue new file mode 100644 index 0000000..f0c68d8 --- /dev/null +++ b/src/components/external-link-page/index.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/src/components/fill-page/index.vue b/src/components/fill-page/index.vue new file mode 100644 index 0000000..6df6e13 --- /dev/null +++ b/src/components/fill-page/index.vue @@ -0,0 +1,48 @@ + + + + + diff --git a/src/hooks/useRoutingMethod.ts b/src/hooks/useRoutingMethod.ts index ad4063b..f2f8547 100644 --- a/src/hooks/useRoutingMethod.ts +++ b/src/hooks/useRoutingMethod.ts @@ -27,8 +27,21 @@ export const useRoutingMethod = () => { const { tabsList } = storeToRefs(routerStore); return tabsList.value.find((item: Menu.MenuOptions) => item.name == key); }; + + /** + * 处理外链跳转,打开一个新窗口并根据url跳转 + * @param {any} route 路由 + */ + const openExternalLinks = (route: any) => { + // 处理外链跳转 + if (route.meta.link && !route.meta.iframe) { + window.open(route.meta.link as string, "_blank"); + } + }; + return { findLinearArray, - findTagsList + findTagsList, + openExternalLinks }; }; diff --git a/src/lang/modules/enUS.ts b/src/lang/modules/enUS.ts index 73a7b7d..2790342 100644 --- a/src/lang/modules/enUS.ts +++ b/src/lang/modules/enUS.ts @@ -25,6 +25,7 @@ export default { ["user-settings"]: "user settings", ["external-links"]: "external links", ["link-gitee"]: "link gitee", + ["link-juejin"]: "link juejin", ["about-project"]: "about project", ["not-power"]: "No permission", ["not-found"]: "Page not found", diff --git a/src/lang/modules/zhCN.ts b/src/lang/modules/zhCN.ts index cc67154..52cf44f 100644 --- a/src/lang/modules/zhCN.ts +++ b/src/lang/modules/zhCN.ts @@ -25,7 +25,8 @@ export default { ["user-settings"]: "用户设置", ["about-project"]: "关于项目", ["external-links"]: "外部链接", - ["link-gitee"]: "链接 gitee", + ["link-gitee"]: "外链 gitee", + ["link-juejin"]: "外链 掘金", ["not-power"]: "没有权限", ["not-found"]: "未找到页面", ["zh-CN"]: "中文", diff --git a/src/layout/components/Main/index.vue b/src/layout/components/Main/index.vue index 304d828..39f5e48 100644 --- a/src/layout/components/Main/index.vue +++ b/src/layout/components/Main/index.vue @@ -1,6 +1,6 @@