From bf0a8ba59873787140ccb22650d77b6269d322e6 Mon Sep 17 00:00:00 2001 From: jlzhou <12020042@qq.com> Date: Tue, 7 Jan 2025 15:34:03 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=96=B0=E5=A2=9E=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin-ui/src/components/RuoYi/Git/index.vue | 12 +- admin-ui/src/layout/components/Navbar.vue | 3 + admin-ui/src/router/index.js | 24 ++- admin-ui/src/views/test.vue | 102 ++++++++++++ admin-ui/src/views/test/index.vue | 11 ++ admin-ui/src/views/test/uploader.vue | 164 ++++++++++++++++++++ 6 files changed, 308 insertions(+), 8 deletions(-) create mode 100644 admin-ui/src/views/test.vue create mode 100644 admin-ui/src/views/test/index.vue create mode 100644 admin-ui/src/views/test/uploader.vue diff --git a/admin-ui/src/components/RuoYi/Git/index.vue b/admin-ui/src/components/RuoYi/Git/index.vue index c8d6fd5..9d7ad98 100644 --- a/admin-ui/src/components/RuoYi/Git/index.vue +++ b/admin-ui/src/components/RuoYi/Git/index.vue @@ -1,13 +1,11 @@ diff --git a/admin-ui/src/layout/components/Navbar.vue b/admin-ui/src/layout/components/Navbar.vue index 028b99c..a360c40 100644 --- a/admin-ui/src/layout/components/Navbar.vue +++ b/admin-ui/src/layout/components/Navbar.vue @@ -15,6 +15,9 @@ --> + + + diff --git a/admin-ui/src/router/index.js b/admin-ui/src/router/index.js index 4cf50bc..57b8830 100644 --- a/admin-ui/src/router/index.js +++ b/admin-ui/src/router/index.js @@ -1,4 +1,4 @@ -import { createWebHistory,createWebHashHistory, createRouter } from 'vue-router' +import { createWebHistory, createWebHashHistory, createRouter } from 'vue-router' /* Layout */ import Layout from '@/layout' @@ -24,6 +24,17 @@ import Layout from '@/layout' } */ +const env = import.meta.env.VITE_APP_ENV; +const children = [] +if (env == 'development') { + + const files = import.meta.glob('@/views/test/*.vue');//异步导入 + for (let fileName in files) { + let moduleName = fileName.replace(/^.*\/(\w+)\.vue$/, "$1"); + children.push({ path: moduleName, component: files[fileName] }) + } +} +console.debug(children) // 公共路由 export const constantRoutes = [ { @@ -83,9 +94,20 @@ export const constantRoutes = [ meta: { title: '个人中心', icon: 'user' } } ] + }, { + path: '/test', + component: () => import('@/views/test'), + hidden: true, + redirect: '/test/index', + children } ] + + + + + // 动态路由,基于用户权限动态去加载 export const dynamicRoutes = [ { diff --git a/admin-ui/src/views/test.vue b/admin-ui/src/views/test.vue new file mode 100644 index 0000000..784aa80 --- /dev/null +++ b/admin-ui/src/views/test.vue @@ -0,0 +1,102 @@ + + + \ No newline at end of file diff --git a/admin-ui/src/views/test/index.vue b/admin-ui/src/views/test/index.vue new file mode 100644 index 0000000..0bf4dd0 --- /dev/null +++ b/admin-ui/src/views/test/index.vue @@ -0,0 +1,11 @@ + + + \ No newline at end of file diff --git a/admin-ui/src/views/test/uploader.vue b/admin-ui/src/views/test/uploader.vue new file mode 100644 index 0000000..e9cb509 --- /dev/null +++ b/admin-ui/src/views/test/uploader.vue @@ -0,0 +1,164 @@ + + + \ No newline at end of file