增加设置面板‘流式’、‘定宽’切换界面随之修改。

master
samulle 4 years ago
parent 2436182baf
commit b2b62914ef
  1. 4
      src/components/page/header/PageHeader.vue
  2. 10
      src/components/setting/Setting.vue
  3. 4
      src/layouts/PageLayout.vue
  4. 4
      src/layouts/header/AdminHeader.vue
  5. 4
      src/layouts/tabs/TabsView.vue
  6. 6
      src/store/modules/setting.js

@ -1,5 +1,5 @@
<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="breadcrumb">
<a-breadcrumb>
@ -50,7 +50,7 @@ export default {
},
},
computed: {
...mapState('setting', ['layout', 'showPageTitle', 'fixedWidth'])
...mapState('setting', ['layout', 'showPageTitle', 'pageWidth'])
}
}
</script>

@ -32,9 +32,9 @@
<a-list :split="false">
<a-list-item>
{{$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-option :value="1">{{$t('navigate.content.fluid')}}</a-select-option>
<a-select-option :value="2">{{$t('navigate.content.fixed')}}</a-select-option>
<a-select :getPopupContainer="getPopupContainer" :dropdown-style="{zIndex: 2001}" size="small" :defaultValue="pageWidth" @change="setPageWidth" slot="actions" style="width: 80px">
<a-select-option value="fluid">{{$t('navigate.content.fluid')}}</a-select-option>
<a-select-option value="fixed">{{$t('navigate.content.fixed')}}</a-select-option>
</a-select>
</a-list-item>
<a-list-item>
@ -131,7 +131,7 @@ export default {
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: {
'animate.name': function(val) {
@ -165,7 +165,7 @@ export default {
})
},
...mapMutations('setting', ['setTheme', 'setLayout', 'setMultiPage', 'setWeekMode',
'setFixedSideBar', 'setFixedHeader', 'setAnimate', 'setHideSetting', 'setFixedWidth'])
'setFixedSideBar', 'setFixedHeader', 'setAnimate', 'setHideSetting', 'setPageWidth'])
}
}
</script>

@ -13,7 +13,7 @@
</div>
<slot v-if="this.$slots.extra" slot="extra" name="extra"></slot>
</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>
</div>
</div>
@ -60,7 +60,7 @@ export default {
this.updatePageHeight(0)
},
computed: {
...mapState('setting', ['layout', 'multiPage', 'pageMinHeight', 'fixedWidth']),
...mapState('setting', ['layout', 'multiPage', 'pageMinHeight', 'pageWidth']),
pageTitle() {
let pageTitle = this.page && this.page.title
return pageTitle === undefined ? (this.title || this.routeName) : this.$t(pageTitle)

@ -1,6 +1,6 @@
<template>
<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]">
<img width="32" src="@/assets/img/logo.png" />
<h1 v-if="!isMobile">{{systemName}}</h1>
@ -53,7 +53,7 @@ export default {
}
},
computed: {
...mapState('setting', ['theme', 'isMobile', 'layout', 'systemName', 'lang', 'fixedWidth']),
...mapState('setting', ['theme', 'isMobile', 'layout', 'systemName', 'lang', 'pageWidth']),
headerTheme () {
if (this.layout == 'side' && this.theme.mode == 'dark' && !this.isMobile) {
return 'light'

@ -5,7 +5,7 @@
v-if="multiPage"
type="editable-card"
: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"
@change="changePage"
@edit="editPage"
@ -48,7 +48,7 @@ export default {
}
},
computed: {
...mapState('setting', ['multiPage', 'animate', 'layout', 'fixedWidth']),
...mapState('setting', ['multiPage', 'animate', 'layout', 'pageWidth']),
menuItemList() {
return [
{ key: '1', icon: 'vertical-right', text: this.$t('closeLeft') },

@ -4,7 +4,7 @@ export default {
namespaced: true,
state: {
isMobile: false,
fixedWidth: 2,
pageWidth: 'fixed',
animates: ADMIN.animates,
palettes: ADMIN.palettes,
pageMinHeight: 0,
@ -51,8 +51,8 @@ export default {
setAsyncRoutes(state, asyncRoutes) {
state.asyncRoutes = asyncRoutes
},
setFixedWidth(state, fixedWidth) {
state.fixedWidth = fixedWidth
setPageWidth(state, pageWidth) {
state.pageWidth = pageWidth
}
}
}

Loading…
Cancel
Save