From b7c0350134be79e419a85c96306fffdac1355af8 Mon Sep 17 00:00:00 2001 From: aixianling Date: Mon, 23 Dec 2024 14:19:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(config):=20=E6=B7=BB=E5=8A=A0=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E9=A6=96=E9=A1=B5=E9=85=8D=E7=BD=AE=E5=B9=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AF=BC=E8=88=AA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -增加自定义首页配置项,支持设置不同的首页组件 -优化导航功能,添加固定首页到导航栏 - 重构路由生成逻辑,支持自定义签到页和首页 - 更新组件以适应新的导航结构 --- bin/build.js | 10 +++++++--- .../AppAccountManage.vue} | 6 +++--- src/components/mainContent.vue | 6 +++--- src/components/sliderNav.vue | 7 +++---- src/main.js | 1 + 5 files changed, 17 insertions(+), 13 deletions(-) rename project/xumu/{AppSystemAccount/AppSystemAccount.vue => AppAccountManage/AppAccountManage.vue} (99%) diff --git a/bin/build.js b/bin/build.js index 65280a51..26b91a94 100644 --- a/bin/build.js +++ b/bin/build.js @@ -39,11 +39,14 @@ const createRoutes = (config = {}) => { const routes = [] // 获取签到页面的路径,如果未指定,则使用默认路径 let signPage = '../views/sign' + let {signPage: sign, homePage: home = "console"} = config.extra || {} if (config.extra?.signPage) { - const sign = config.extra.signPage signPage = `../apps/custom/${sign}/${sign}` } - + let homePage = `../views/console` + if (config.extra?.homePage) { + homePage = `../apps/custom/${home}/${home}` + } // 查找并处理所有应用,将它们的信息添加到路由中 return findApp("src/apps", app => getAppInfo(app, routes)).then(() => { // 生成并输出apps.js文件,定义所有应用的路由 @@ -52,7 +55,8 @@ const createRoutes = (config = {}) => { {path: '/dv', name: '数据大屏入口', component: () => import('../views/dvIndex')}, {path: '/v', name: 'Home', component: () => import('../views/home'), children: [ {path:'/',name:'mainEntry', component:()=>import('../views/mainEntry'),children:[ - ${routes.map(e => { + {name: "工作台", path: "${home}", component: () => import('${homePage}')}, + ${routes.filter(e => ![sign, home].includes(e.name)).map(e => { // 解构每个路由的属性,用于生成路由配置 const {name, label, esm} = e // 生成单个路由配置的字符串表示 diff --git a/project/xumu/AppSystemAccount/AppSystemAccount.vue b/project/xumu/AppAccountManage/AppAccountManage.vue similarity index 99% rename from project/xumu/AppSystemAccount/AppSystemAccount.vue rename to project/xumu/AppAccountManage/AppAccountManage.vue index 2fe2d4ab..ab25d2b4 100644 --- a/project/xumu/AppSystemAccount/AppSystemAccount.vue +++ b/project/xumu/AppAccountManage/AppAccountManage.vue @@ -1,5 +1,5 @@