mirror of
https://github.com/iczer/vue-antd-admin
synced 2025-04-06 04:00:06 +08:00
增加设置面板‘流式’、‘定宽’切换界面随之修改。
This commit is contained in:
parent
2436182baf
commit
b2b62914ef
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="['page-header', layout == 'head' && fixedWidth == 2 ? layout : '']">
|
<div :class="['page-header', layout == 'head' && pageWidth == 'fixed' ? layout : '']">
|
||||||
<div :class="['page-header-wide']">
|
<div :class="['page-header-wide']">
|
||||||
<div class="breadcrumb">
|
<div class="breadcrumb">
|
||||||
<a-breadcrumb>
|
<a-breadcrumb>
|
||||||
@ -50,7 +50,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState('setting', ['layout', 'showPageTitle', 'fixedWidth'])
|
...mapState('setting', ['layout', 'showPageTitle', 'pageWidth'])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -32,9 +32,9 @@
|
|||||||
<a-list :split="false">
|
<a-list :split="false">
|
||||||
<a-list-item>
|
<a-list-item>
|
||||||
{{$t('navigate.content.title')}}
|
{{$t('navigate.content.title')}}
|
||||||
<a-select :getPopupContainer="getPopupContainer" :dropdown-style="{zIndex: 2001}" size="small" :defaultValue="fixedWidth" @change="setFixedWidth" slot="actions" style="width: 80px">
|
<a-select :getPopupContainer="getPopupContainer" :dropdown-style="{zIndex: 2001}" size="small" :defaultValue="pageWidth" @change="setPageWidth" slot="actions" style="width: 80px">
|
||||||
<a-select-option :value="1">{{$t('navigate.content.fluid')}}</a-select-option>
|
<a-select-option value="fluid">{{$t('navigate.content.fluid')}}</a-select-option>
|
||||||
<a-select-option :value="2">{{$t('navigate.content.fixed')}}</a-select-option>
|
<a-select-option value="fixed">{{$t('navigate.content.fixed')}}</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-list-item>
|
</a-list-item>
|
||||||
<a-list-item>
|
<a-list-item>
|
||||||
@ -131,7 +131,7 @@ export default {
|
|||||||
directions() {
|
directions() {
|
||||||
return this.animates.find(item => item.name == this.animate.name).directions
|
return this.animates.find(item => item.name == this.animate.name).directions
|
||||||
},
|
},
|
||||||
...mapState('setting', ['theme', 'layout', 'animate', 'animates', 'palettes', 'multiPage', 'weekMode', 'fixedHeader', 'fixedSideBar', 'hideSetting', 'fixedWidth'])
|
...mapState('setting', ['theme', 'layout', 'animate', 'animates', 'palettes', 'multiPage', 'weekMode', 'fixedHeader', 'fixedSideBar', 'hideSetting', 'pageWidth'])
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'animate.name': function(val) {
|
'animate.name': function(val) {
|
||||||
@ -165,7 +165,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
...mapMutations('setting', ['setTheme', 'setLayout', 'setMultiPage', 'setWeekMode',
|
...mapMutations('setting', ['setTheme', 'setLayout', 'setMultiPage', 'setWeekMode',
|
||||||
'setFixedSideBar', 'setFixedHeader', 'setAnimate', 'setHideSetting', 'setFixedWidth'])
|
'setFixedSideBar', 'setFixedHeader', 'setAnimate', 'setHideSetting', 'setPageWidth'])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<slot v-if="this.$slots.extra" slot="extra" name="extra"></slot>
|
<slot v-if="this.$slots.extra" slot="extra" name="extra"></slot>
|
||||||
</page-header>
|
</page-header>
|
||||||
<div ref="page" :class="['page-content', layout == 'head' ? (fixedWidth == 2 ? layout : '') : '']" >
|
<div ref="page" :class="['page-content', layout == 'head' ? (pageWidth == 'fixed' ? layout : '') : '']" >
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -60,7 +60,7 @@ export default {
|
|||||||
this.updatePageHeight(0)
|
this.updatePageHeight(0)
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState('setting', ['layout', 'multiPage', 'pageMinHeight', 'fixedWidth']),
|
...mapState('setting', ['layout', 'multiPage', 'pageMinHeight', 'pageWidth']),
|
||||||
pageTitle() {
|
pageTitle() {
|
||||||
let pageTitle = this.page && this.page.title
|
let pageTitle = this.page && this.page.title
|
||||||
return pageTitle === undefined ? (this.title || this.routeName) : this.$t(pageTitle)
|
return pageTitle === undefined ? (this.title || this.routeName) : this.$t(pageTitle)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-layout-header :class="[headerTheme, 'admin-header']">
|
<a-layout-header :class="[headerTheme, 'admin-header']">
|
||||||
<div :class="['admin-header-wide', layout == 'side' ? layout : (fixedWidth == 2 ? layout : '')]">
|
<div :class="['admin-header-wide', layout == 'side' ? layout : (pageWidth == 'fixed' ? layout : '')]">
|
||||||
<router-link v-if="isMobile || layout === 'head'" to="/" :class="['logo', isMobile ? null : 'pc', headerTheme]">
|
<router-link v-if="isMobile || layout === 'head'" to="/" :class="['logo', isMobile ? null : 'pc', headerTheme]">
|
||||||
<img width="32" src="@/assets/img/logo.png" />
|
<img width="32" src="@/assets/img/logo.png" />
|
||||||
<h1 v-if="!isMobile">{{systemName}}</h1>
|
<h1 v-if="!isMobile">{{systemName}}</h1>
|
||||||
@ -53,7 +53,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState('setting', ['theme', 'isMobile', 'layout', 'systemName', 'lang', 'fixedWidth']),
|
...mapState('setting', ['theme', 'isMobile', 'layout', 'systemName', 'lang', 'pageWidth']),
|
||||||
headerTheme () {
|
headerTheme () {
|
||||||
if (this.layout == 'side' && this.theme.mode == 'dark' && !this.isMobile) {
|
if (this.layout == 'side' && this.theme.mode == 'dark' && !this.isMobile) {
|
||||||
return 'light'
|
return 'light'
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
v-if="multiPage"
|
v-if="multiPage"
|
||||||
type="editable-card"
|
type="editable-card"
|
||||||
:active-key="activePage"
|
:active-key="activePage"
|
||||||
:style="`margin: -16px auto 8px; ${layout == 'head' && fixedWidth == 2 ? 'max-width: 1400px;' : ''}`"
|
:style="`margin: -16px auto 8px; ${layout == 'head' && pageWidth == 'fixed' ? 'max-width: 1400px;' : ''}`"
|
||||||
:hide-add="true"
|
:hide-add="true"
|
||||||
@change="changePage"
|
@change="changePage"
|
||||||
@edit="editPage"
|
@edit="editPage"
|
||||||
@ -48,7 +48,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState('setting', ['multiPage', 'animate', 'layout', 'fixedWidth']),
|
...mapState('setting', ['multiPage', 'animate', 'layout', 'pageWidth']),
|
||||||
menuItemList() {
|
menuItemList() {
|
||||||
return [
|
return [
|
||||||
{ key: '1', icon: 'vertical-right', text: this.$t('closeLeft') },
|
{ key: '1', icon: 'vertical-right', text: this.$t('closeLeft') },
|
||||||
|
@ -4,7 +4,7 @@ export default {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
state: {
|
state: {
|
||||||
isMobile: false,
|
isMobile: false,
|
||||||
fixedWidth: 2,
|
pageWidth: 'fixed',
|
||||||
animates: ADMIN.animates,
|
animates: ADMIN.animates,
|
||||||
palettes: ADMIN.palettes,
|
palettes: ADMIN.palettes,
|
||||||
pageMinHeight: 0,
|
pageMinHeight: 0,
|
||||||
@ -51,8 +51,8 @@ export default {
|
|||||||
setAsyncRoutes(state, asyncRoutes) {
|
setAsyncRoutes(state, asyncRoutes) {
|
||||||
state.asyncRoutes = asyncRoutes
|
state.asyncRoutes = asyncRoutes
|
||||||
},
|
},
|
||||||
setFixedWidth(state, fixedWidth) {
|
setPageWidth(state, pageWidth) {
|
||||||
state.fixedWidth = fixedWidth
|
state.pageWidth = pageWidth
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user