feat: 学院端整体布局修改
This commit is contained in:
parent
87564e9c81
commit
4d62c98158
|
@ -12,7 +12,11 @@
|
||||||
v-bind="settings"
|
v-bind="settings"
|
||||||
>
|
>
|
||||||
<template v-slot:rightContentRender>
|
<template v-slot:rightContentRender>
|
||||||
<right-content :top-menu="settings.layout === 'topmenu'" :is-mobile="isMobile" :theme="settings.theme" />
|
<right-content
|
||||||
|
:top-menu="settings.layout === 'topmenu'"
|
||||||
|
:is-mobile="isMobile"
|
||||||
|
:theme="settings.theme"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<!-- <template v-slot:footerRender>
|
<!-- <template v-slot:footerRender>
|
||||||
<global-footer />
|
<global-footer />
|
||||||
|
@ -44,21 +48,21 @@ export default {
|
||||||
// 侧栏收起状态
|
// 侧栏收起状态
|
||||||
collapsed: false,
|
collapsed: false,
|
||||||
title: defaultSettings.title,
|
title: defaultSettings.title,
|
||||||
settings: {
|
// settings: {
|
||||||
// 布局类型
|
// // 布局类型
|
||||||
layout: defaultSettings.layout, // 'sidemenu', 'topmenu'
|
// layout: defaultSettings.layout, // 'sidemenu', 'topmenu'
|
||||||
// 定宽: true / 流式: false
|
// // 定宽: true / 流式: false
|
||||||
contentWidth: defaultSettings.layout === 'sidemenu' ? false : defaultSettings.contentWidth === 'Fixed',
|
// contentWidth: defaultSettings.layout === 'sidemenu' ? false : defaultSettings.contentWidth === 'Fixed',
|
||||||
// 主题 'dark' | 'light'
|
// // 主题 'dark' | 'light'
|
||||||
theme: defaultSettings.navTheme,
|
// theme: defaultSettings.navTheme,
|
||||||
// 主色调
|
// // 主色调
|
||||||
primaryColor: defaultSettings.primaryColor,
|
// primaryColor: defaultSettings.primaryColor,
|
||||||
fixedHeader: defaultSettings.fixedHeader,
|
// fixedHeader: defaultSettings.fixedHeader,
|
||||||
fixSiderbar: defaultSettings.fixSiderbar,
|
// fixSiderbar: defaultSettings.fixSiderbar,
|
||||||
colorWeak: defaultSettings.colorWeak,
|
// colorWeak: defaultSettings.colorWeak,
|
||||||
hideHintAlert: false,
|
// hideHintAlert: false,
|
||||||
hideCopyButton: false
|
// hideCopyButton: false
|
||||||
},
|
// },
|
||||||
// 媒体查询
|
// 媒体查询
|
||||||
query: {},
|
query: {},
|
||||||
// 是否手机模式
|
// 是否手机模式
|
||||||
|
@ -68,19 +72,38 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
...mapState({
|
...mapState({
|
||||||
// 动态主路由
|
// 动态主路由
|
||||||
mainMenu: state => state.permission.addRouters
|
mainMenu: state => state.permission.addRouters,
|
||||||
})
|
currentRole: state => state.user.currentRole
|
||||||
|
}),
|
||||||
|
settings: function () {
|
||||||
|
const code = this.currentRole && this.currentRole.code
|
||||||
|
return {
|
||||||
|
// 布局类型
|
||||||
|
layout: code === 'student' ? 'topmenu' : defaultSettings.layout, // 'sidemenu', 'topmenu'
|
||||||
|
// 定宽: true / 流式: false
|
||||||
|
contentWidth: code === 'student' ? true : (defaultSettings.layout === 'sidemenu' ? false : defaultSettings.contentWidth === 'Fixed'),
|
||||||
|
// 主题 'dark' | 'light'
|
||||||
|
theme: defaultSettings.navTheme,
|
||||||
|
// 主色调
|
||||||
|
primaryColor: defaultSettings.primaryColor,
|
||||||
|
fixedHeader: defaultSettings.fixedHeader,
|
||||||
|
fixSiderbar: defaultSettings.fixSiderbar,
|
||||||
|
colorWeak: defaultSettings.colorWeak,
|
||||||
|
hideHintAlert: false,
|
||||||
|
hideCopyButton: false
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
const routes = this.mainMenu.find(item => item.path === '/')
|
const routes = this.mainMenu.find(item => item.path === '/')
|
||||||
this.menus = (routes && routes.children) || []
|
this.menus = (routes && routes.children) || []
|
||||||
// 处理侧栏收起状态
|
// 处理侧栏收起状态
|
||||||
this.$watch('collapsed', () => {
|
this.$watch('collapsed', () => {
|
||||||
this.$store.commit(SIDEBAR_TYPE, this.collapsed)
|
this.$store.commit(SIDEBAR_TYPE, this.collapsed)
|
||||||
})
|
})
|
||||||
this.$watch('isMobile', () => {
|
this.$watch('isMobile', () => {
|
||||||
this.$store.commit(TOGGLE_MOBILE_TYPE, this.isMobile)
|
this.$store.commit(TOGGLE_MOBILE_TYPE, this.isMobile)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
const userAgent = navigator.userAgent
|
const userAgent = navigator.userAgent
|
||||||
|
@ -119,11 +142,10 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
@import "./BasicLayout.less";
|
@import './BasicLayout.less';
|
||||||
|
|
||||||
/*隐藏原本的图标*/
|
/*隐藏原本的图标*/
|
||||||
.ant-pro-global-header-trigger{
|
.ant-pro-global-header-trigger {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -13,7 +13,8 @@ const user = {
|
||||||
roles: [],
|
roles: [],
|
||||||
buttons: [], // 按钮权限
|
buttons: [], // 按钮权限
|
||||||
info: {},
|
info: {},
|
||||||
person: {}
|
person: {},
|
||||||
|
currentRole: {}
|
||||||
},
|
},
|
||||||
|
|
||||||
mutations: {
|
mutations: {
|
||||||
|
@ -61,6 +62,7 @@ const user = {
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
const data = response.data
|
const data = response.data
|
||||||
|
state.currentRole = data.currentRole
|
||||||
commit('SET_ROLES', 1)
|
commit('SET_ROLES', 1)
|
||||||
commit('SET_BUTTONS', data.permissions)
|
commit('SET_BUTTONS', data.permissions)
|
||||||
commit('SET_INFO', data.user)
|
commit('SET_INFO', data.user)
|
||||||
|
|
|
@ -1,15 +1,28 @@
|
||||||
<template>
|
<template>
|
||||||
<a-card :bordered="false" style="display: flex;justify-content:center;height: 100%" >
|
<div>
|
||||||
<div style="margin:100px auto;">
|
<Myhome v-if="currentRole && currentRole.code === 'student'"></Myhome>
|
||||||
<img src="~@/assets/welcome.png" class="logo" alt="logo">
|
<a-card v-else :bordered="false" style="display: flex;justify-content:center;height: 100%">
|
||||||
</div>
|
<div style="margin:100px auto;">
|
||||||
</a-card>
|
<img src="~@/assets/welcome.png" class="logo" alt="logo" />
|
||||||
|
</div>
|
||||||
|
</a-card>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
import Myhome from '@/views/myhome/index.vue'
|
||||||
|
export default {
|
||||||
|
components: { Myhome },
|
||||||
|
data () {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState({
|
||||||
|
currentRole: state => state.user.currentRole
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
Loading…
Reference in New Issue