|
@@ -1,11 +1,20 @@
|
1
|
1
|
<template>
|
2
|
|
- <div class="d2-layout-header-aside-group" :style="styleLayoutMainGroup" :class="{grayMode: grayActive}">
|
|
2
|
+ <div
|
|
3
|
+ class="d2-layout-header-aside-group"
|
|
4
|
+ :style="styleLayoutMainGroup"
|
|
5
|
+ :class="{ grayMode: grayActive }"
|
|
6
|
+ >
|
3
|
7
|
<!-- 半透明遮罩 -->
|
4
|
8
|
<div class="d2-layout-header-aside-mask"></div>
|
5
|
9
|
<!-- 主体内容 -->
|
6
|
10
|
<div class="d2-layout-header-aside-content" flex="dir:top">
|
7
|
11
|
<!-- 顶栏 -->
|
8
|
|
- <div class="d2-theme-header" :style="{ opacity: this.searchActive ? 0.5 : 1 }" flex-box="0" flex>
|
|
12
|
+ <div
|
|
13
|
+ class="d2-theme-header"
|
|
14
|
+ :style="{ opacity: this.searchActive ? 0.5 : 1 }"
|
|
15
|
+ flex-box="0"
|
|
16
|
+ flex
|
|
17
|
+ >
|
9
|
18
|
<!-- <router-link
|
10
|
19
|
to="/index"
|
11
|
20
|
:class="{'logo-group': true, 'logo-transition': asideTransition}"
|
|
@@ -14,18 +23,15 @@
|
14
|
23
|
<img v-if="asideCollapse" :src="`${$baseUrl}image/theme/${themeActiveSetting.name}/logo/icon-only.png`">
|
15
|
24
|
<img v-else :src="`${$baseUrl}image/theme/${themeActiveSetting.name}/logo/all.png`">
|
16
|
25
|
</router-link> -->
|
17
|
|
- <div
|
18
|
|
- class="imgFather"
|
19
|
|
-
|
20
|
|
- flex-box="0">
|
21
|
|
- <img src="../../assets/images/logo.png" alt="">
|
|
26
|
+ <div class="imgFather" flex-box="0">
|
|
27
|
+ <img src="../../assets/images/logo.png" alt="" />
|
22
|
28
|
<!-- <img v-if="asideCollapse" :src="`${$baseUrl}image/theme/${themeActiveSetting.name}/logo/icon-only.png`">
|
23
|
29
|
<img v-else :src="`${$baseUrl}image/theme/${themeActiveSetting.name}/logo/all.png`"> -->
|
24
|
30
|
</div>
|
25
|
31
|
<!-- <div class="toggle-aside-btn" @click="handleToggleAside" flex-box="0">
|
26
|
32
|
<d2-icon name="bars"/>
|
27
|
33
|
</div> -->
|
28
|
|
- <d2-menu-header flex-box="1"/>
|
|
34
|
+ <d2-menu-header flex-box="1" />
|
29
|
35
|
<!-- 顶栏右侧 -->
|
30
|
36
|
<div class="d2-header-right" flex-box="0">
|
31
|
37
|
<!-- 如果你只想在开发环境显示这个按钮请添加 v-if="$env === 'development'" -->
|
|
@@ -36,7 +42,7 @@
|
36
|
42
|
<d2-header-size/>
|
37
|
43
|
<d2-header-locales/>
|
38
|
44
|
<d2-header-color/> -->
|
39
|
|
- <d2-header-user/>
|
|
45
|
+ <d2-header-user />
|
40
|
46
|
</div>
|
41
|
47
|
</div>
|
42
|
48
|
<!-- 下面 主体 -->
|
|
@@ -57,12 +63,16 @@
|
57
|
63
|
<!-- 搜索 -->
|
58
|
64
|
<transition name="fade-scale">
|
59
|
65
|
<div v-if="searchActive" class="d2-theme-container-main-layer" flex>
|
60
|
|
- <d2-panel-search ref="panelSearch" @close="searchPanelClose"/>
|
|
66
|
+ <d2-panel-search ref="panelSearch" @close="searchPanelClose" />
|
61
|
67
|
</div>
|
62
|
68
|
</transition>
|
63
|
69
|
<!-- 内容 -->
|
64
|
70
|
<transition name="fade-scale">
|
65
|
|
- <div v-if="!searchActive" class="d2-theme-container-main-layer" flex="dir:top">
|
|
71
|
+ <div
|
|
72
|
+ v-if="!searchActive"
|
|
73
|
+ class="d2-theme-container-main-layer"
|
|
74
|
+ flex="dir:top"
|
|
75
|
+ >
|
66
|
76
|
<!-- tab -->
|
67
|
77
|
<!-- <div class="d2-theme-container-main-header" flex-box="0">
|
68
|
78
|
<d2-tabs/>
|
|
@@ -75,37 +85,41 @@
|
75
|
85
|
</keep-alive>
|
76
|
86
|
</transition>
|
77
|
87
|
</div>
|
|
88
|
+ <Foot></Foot>
|
78
|
89
|
</div>
|
79
|
90
|
</transition>
|
|
91
|
+
|
80
|
92
|
</div>
|
|
93
|
+
|
|
94
|
+
|
81
|
95
|
</div>
|
82
|
96
|
</div>
|
83
|
97
|
</div>
|
84
|
98
|
</template>
|
85
|
99
|
|
86
|
100
|
<script>
|
87
|
|
-import d2MenuSide from './components/menu-side'
|
88
|
|
-import d2MenuHeader from './components/menu-header'
|
89
|
|
-import d2Tabs from './components/tabs'
|
|
101
|
+import d2MenuSide from "./components/menu-side";
|
|
102
|
+import d2MenuHeader from "./components/menu-header";
|
|
103
|
+import d2Tabs from "./components/tabs";
|
|
104
|
+import Foot from "./components/footer";
|
90
|
105
|
// import d2HeaderFullscreen from './components/header-fullscreen'
|
91
|
106
|
// import d2HeaderLocales from './components/header-locales'
|
92
|
107
|
// import d2HeaderSearch from './components/header-search'
|
93
|
108
|
// import d2HeaderSize from './components/header-size'
|
94
|
109
|
// import d2HeaderTheme from './components/header-theme'
|
95
|
|
-import d2HeaderUser from './components/header-user'
|
|
110
|
+import d2HeaderUser from "./components/header-user";
|
96
|
111
|
// import d2HeaderLog from './components/header-log'
|
97
|
112
|
// import d2HeaderColor from './components/header-color'
|
98
|
|
-import { mapState, mapGetters, mapActions } from 'vuex'
|
99
|
|
-import mixinSearch from './mixins/search'
|
|
113
|
+import { mapState, mapGetters, mapActions } from "vuex";
|
|
114
|
+import mixinSearch from "./mixins/search";
|
100
|
115
|
export default {
|
101
|
|
- name: 'd2-layout-header-aside',
|
102
|
|
- mixins: [
|
103
|
|
- mixinSearch
|
104
|
|
- ],
|
|
116
|
+ name: "d2-layout-header-aside",
|
|
117
|
+ mixins: [mixinSearch],
|
105
|
118
|
components: {
|
106
|
119
|
d2MenuSide,
|
107
|
120
|
d2MenuHeader,
|
108
|
121
|
d2Tabs,
|
|
122
|
+ Foot,
|
109
|
123
|
// d2HeaderFullscreen,
|
110
|
124
|
// d2HeaderLocales,
|
111
|
125
|
// d2HeaderSearch,
|
|
@@ -115,42 +129,44 @@ export default {
|
115
|
129
|
// d2HeaderLog,
|
116
|
130
|
// d2HeaderColor
|
117
|
131
|
},
|
118
|
|
- data () {
|
|
132
|
+ data() {
|
119
|
133
|
return {
|
120
|
134
|
// [侧边栏宽度] 正常状态
|
121
|
|
- asideWidth: '200px',
|
|
135
|
+ asideWidth: "200px",
|
122
|
136
|
// [侧边栏宽度] 折叠状态
|
123
|
|
- asideWidthCollapse: '65px'
|
124
|
|
- }
|
|
137
|
+ asideWidthCollapse: "65px",
|
|
138
|
+ };
|
125
|
139
|
},
|
126
|
140
|
computed: {
|
127
|
|
- ...mapState('d2admin', {
|
128
|
|
- keepAlive: state => state.page.keepAlive,
|
129
|
|
- grayActive: state => state.gray.active,
|
130
|
|
- transitionActive: state => state.transition.active,
|
131
|
|
- asideCollapse: state => state.menu.asideCollapse,
|
132
|
|
- asideTransition: state => state.menu.asideTransition
|
|
141
|
+ ...mapState("d2admin", {
|
|
142
|
+ keepAlive: (state) => state.page.keepAlive,
|
|
143
|
+ grayActive: (state) => state.gray.active,
|
|
144
|
+ transitionActive: (state) => state.transition.active,
|
|
145
|
+ asideCollapse: (state) => state.menu.asideCollapse,
|
|
146
|
+ asideTransition: (state) => state.menu.asideTransition,
|
133
|
147
|
}),
|
134
|
|
- ...mapGetters('d2admin', {
|
135
|
|
- themeActiveSetting: 'theme/activeSetting'
|
|
148
|
+ ...mapGetters("d2admin", {
|
|
149
|
+ themeActiveSetting: "theme/activeSetting",
|
136
|
150
|
}),
|
137
|
151
|
/**
|
138
|
152
|
* @description 用来实现带参路由的缓存
|
139
|
153
|
*/
|
140
|
|
- routerViewKey () {
|
|
154
|
+ routerViewKey() {
|
141
|
155
|
// 默认情况下 key 类似 __transition-n-/foo
|
142
|
156
|
// 这里的字符串操作是为了最终 key 的格式和原来相同 类似 __transition-n-__stamp-time-/foo
|
143
|
|
- const stamp = this.$route.meta[`__stamp-${this.$route.path}`] || ''
|
144
|
|
- return `${stamp ? `__stamp-${stamp}-` : ''}${this.$route.path}`
|
|
157
|
+ const stamp = this.$route.meta[`__stamp-${this.$route.path}`] || "";
|
|
158
|
+ return `${stamp ? `__stamp-${stamp}-` : ""}${this.$route.path}`;
|
145
|
159
|
},
|
146
|
160
|
/**
|
147
|
161
|
* @description 最外层容器的背景图片样式
|
148
|
162
|
*/
|
149
|
|
- styleLayoutMainGroup () {
|
|
163
|
+ styleLayoutMainGroup() {
|
150
|
164
|
return this.themeActiveSetting.backgroundImage
|
151
|
|
- ? { backgroundImage: `url('${this.$baseUrl}${this.themeActiveSetting.backgroundImage}')` }
|
152
|
|
- : {}
|
153
|
|
- }
|
|
165
|
+ ? {
|
|
166
|
+ backgroundImage: `url('${this.$baseUrl}${this.themeActiveSetting.backgroundImage}')`,
|
|
167
|
+ }
|
|
168
|
+ : {};
|
|
169
|
+ },
|
154
|
170
|
},
|
155
|
171
|
methods: {
|
156
|
172
|
// ...mapActions('d2admin/menu', [
|
|
@@ -162,24 +178,24 @@ export default {
|
162
|
178
|
// handleToggleAside () {
|
163
|
179
|
// this.asideCollapseToggle()
|
164
|
180
|
// }
|
165
|
|
- }
|
166
|
|
-}
|
|
181
|
+ },
|
|
182
|
+};
|
167
|
183
|
</script>
|
168
|
184
|
|
169
|
185
|
<style lang="scss">
|
170
|
186
|
// 注册主题
|
171
|
|
-@import '~@/assets/style/theme/register.scss';
|
|
187
|
+@import "~@/assets/style/theme/register.scss";
|
172
|
188
|
//头部导航背景色
|
173
|
|
-.d2-theme-header{
|
174
|
|
- background-image:url(../../assets/images/nav-bg.png)
|
|
189
|
+.d2-theme-header {
|
|
190
|
+ background-image: url(../../assets/images/nav-bg.png);
|
175
|
191
|
}
|
176
|
192
|
//整体内容背景色
|
177
|
|
-.d2-layout-header-aside-group{
|
178
|
|
- background-image:url(../../assets/images/bg.png)
|
|
193
|
+.d2-layout-header-aside-group {
|
|
194
|
+ background-image: url(../../assets/images/bg.png);
|
179
|
195
|
}
|
180
|
|
-.imgFather{
|
|
196
|
+.imgFather {
|
181
|
197
|
display: flex;
|
182
|
198
|
align-items: center;
|
183
|
|
- padding-left: 10px;;
|
|
199
|
+ padding-left: 10px;
|
184
|
200
|
}
|
185
|
201
|
</style>
|