This commit is contained in:
张成
2025-10-08 17:15:31 +08:00
parent cda6e0f222
commit 43eb9715fa
4 changed files with 99 additions and 38 deletions

View File

@@ -32,6 +32,9 @@ import { setParamSetupServer } from './store/app'
import routerConfig, { createBaseRoutes, setupRouterGuards } from './router'
// ==================== 系统页面 ====================
// 主页
import HomePage from './views/home/index.vue'
// system 页面
import SysLog from './views/system/sys_log.vue'
import SysParamSetup from './views/system/sys_param_setup.vue'
@@ -95,6 +98,7 @@ class AdminFramework {
this.Page500 = Page500
// 导出系统页面
this.HomePage = HomePage
this.SysLog = SysLog
this.SysParamSetup = SysParamSetup
this.SysRole = SysRole
@@ -159,8 +163,7 @@ class AdminFramework {
// 如果提供了 VueRouter自动创建 Router
if (VueRouter && !this.router) {
// 获取主路由配置(包含 home
const mainRoute = this.getRoutes({ Main, ParentView, Page404 })
const mainRoute = this.getRoutes({ Main, ParentView, Page404, HomePage })
this.router = this.createRouter(VueRouter, {
Main,
@@ -278,14 +281,14 @@ class AdminFramework {
* @returns {Object} 主路由配置
*/
getRoutes(components = {}) {
const { Main, ParentView, Page404 } = components
const { Main, ParentView, Page404, HomePage } = components
if (!Main || !ParentView || !Page404) {
console.error('Missing required layout components')
return null
}
return uiTool.getRoutes(Main, ParentView, Page404)
return uiTool.getRoutes(Main, ParentView, Page404, HomePage)
}
/**
@@ -323,6 +326,7 @@ export {
setupRouterGuards,
// 系统页面
HomePage,
SysLog,
SysParamSetup,
SysRole,

View File

@@ -168,7 +168,7 @@ export default class uiTool {
return []
}
static getRoutes(Main, ParentView, Page404) {
static getRoutes(Main, ParentView, Page404, HomePage) {
let mainRoute = {
path: '/',
name: '主视图',
@@ -181,7 +181,7 @@ export default class uiTool {
path: '/home',
name: 'home',
meta: { title: '首页', notCache: true },
component: {
component: HomePage || {
render: h => h('div', { style: { padding: '20px' } }, '欢迎使用管理系统')
}
}

44
src/views/home/index.vue Normal file
View File

@@ -0,0 +1,44 @@
<template>
<div class="content-view">
<h1 class="home-title">
<span class="hy">欢迎登陆 </span>
{{sysFormModel.title}}
</h1>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
name: 'home',
components: {},
data() {
return {}
},
computed: {
...mapGetters({
sysFormModel: 'app/sysFormModel',
}),
},
mounted() {
//
},
}
</script>
<style scoped lang="less">
.content-view {
display: flex;
justify-content: center;
align-items: center;
.hy {
font-size: 18px;
}
.home-title {
font-size: 30px;
color: #2d8cf0;
}
}
</style>