Skip to content

Commit 2108fcc

Browse files
committed
style(layout): 调整UI布局
1 parent 5457d54 commit 2108fcc

File tree

16 files changed

+431
-575
lines changed

16 files changed

+431
-575
lines changed

src/components/MessageBox/MessageBox.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<el-badge :value="menuNum.summary"
1414
:max="9"
1515
class="item">
16-
<svgIcon icon-class="dashboard_notification"
16+
<svgIcon icon-class="notification"
1717
class="icon"
1818
@click.native="visible = true"></svgIcon>
1919
</el-badge>
@@ -45,14 +45,14 @@ export default {
4545
</script>
4646
<style lang="scss" scoped>
4747
.icon {
48-
width: 2em !important;
49-
height: 2em !important;
48+
width: 2.5em !important;
49+
height: 100% !important;
5050
cursor: pointer;
51-
margin-top:16px;
52-
margin-bottom: 16px;
51+
// margin-top: 16px;
52+
// margin-bottom: 16px;
5353
transition: all 0.5s ease-out;
5454
&:hover {
55-
transform: translateX(-4px);
55+
box-shadow: 0px 4px 12px 0px rgba(7, 17, 27, 0.1);
5656
}
5757
}
5858
</style>
Lines changed: 1 addition & 0 deletions
Loading

src/icons/svg/menu/工作桌面.svg

Lines changed: 2 additions & 2 deletions
Loading

src/icons/svg/menu/开发人员工具.svg

Lines changed: 2 additions & 2 deletions
Loading

src/icons/svg/menu/系统管理.svg

Lines changed: 2 additions & 2 deletions
Loading

src/icons/svg/menu/通知公告.svg

Lines changed: 2 additions & 2 deletions
Loading

src/styles/element-variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ http://element-cn.eleme.io/#/zh-CN/component/custom-theme#strong-xiu-gai-bian-li
77

88
// 官方说如果这个文件存在,字体路径是必须覆盖的,我没时间测试删除以后会怎样
99
$--font-path: '~element-ui/lib/theme-chalk/fonts';
10-
$--color-primary:#1867c0;
10+
$--color-primary:#616dad;
1111
$--color-success:#4CAF50;
1212
$--color-warning:#fb8c00;
1313
$--color-danger:#ff5252;

src/views/layout/Layout.vue

Lines changed: 39 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,74 @@
11
<!--
22
@file 框架页布局
3-
@author BoBo
3+
@author ytyang
44
@copyright NanJing Anshare Tech .Com
55
@createDate 2018年11月13日14:50:08
66
-->
77
<template>
8-
<div class="app-wrapper">
8+
<div :class="classObj"
9+
class="app-wrapper">
910
<!-- 导航栏 -->
1011
<Header />
1112
<!-- 左侧边栏 -->
1213
<div class="main-container">
13-
<!-- 面包屑导航 -->
14-
<Breadcrumb></Breadcrumb>
14+
<!-- TAB标签页 -->
15+
<!-- <TagsView /> -->
16+
<!-- <Breadcrumb></Breadcrumb> -->
1517
<!-- 包含二级路由,可以继续嵌套子页面 -->
1618
<AppMain />
1719
</div>
20+
1821
<el-backtop target=".main-container"></el-backtop>
19-
<div class="elevator">
20-
<!-- 消息中心 -->
21-
<MessageBox></MessageBox>
22-
</div>
22+
2323
</div>
2424
</template>
2525

26-
<script lang="ts">
27-
import { mapGetters } from 'vuex';
28-
import MessageBox from '@/components/MessageBox/MessageBox.vue';
26+
<script>
2927
30-
import {
31-
AppMain,
32-
Header, // TagsView 暂时去掉tab
33-
} from '@/views/layout/components/index.ts';
34-
import { Component, Vue, Watch } from 'vue-property-decorator';
35-
import Breadcrumb from '@/components/Breadcrumb/index.vue';
28+
import { AppMain, Header } from '@/views/layout/components/index.ts';
29+
// import Breadcrumb from '@/components/Breadcrumb/index.vue';
3630
37-
@Component({
31+
export default {
32+
name: 'Layout',
33+
data() {
34+
return {};
35+
},
3836
components: {
3937
AppMain,
40-
MessageBox,
38+
// TagsView,
4139
Header,
42-
Breadcrumb,
40+
// Breadcrumb,
4341
},
44-
})
45-
export default class Layout extends Vue {
46-
created() {
47-
this.$store.dispatch('initFlowTree');
48-
}
49-
}
42+
computed: {
43+
sidebar() {
44+
return this.$store.state.app.sidebar;
45+
},
46+
classObj() {
47+
return {
48+
hideSidebar: !this.sidebar.opened,
49+
openSidebar: this.sidebar.opened,
50+
};
51+
},
52+
},
53+
54+
mounted() {
55+
window.addEventListener('scroll', () => {});
56+
},
57+
};
5058
</script>
5159

5260
<style rel="stylesheet/scss" lang="scss" scoped>
5361
@import 'src/styles/mixin.scss';
5462
.app-wrapper {
5563
@include clearfix;
56-
position: relative;
57-
height: 100%;
58-
width: 100%;
59-
background: #eee;
6064
overflow: auto;
61-
.elevator {
62-
position: fixed;
63-
top: 45%;
64-
padding: 0 8px;
65-
border-top-left-radius: 8px;
66-
border-bottom-left-radius: 8px;
67-
margin-top: -140px;
68-
right: 0;
69-
background-color: #fff;
70-
box-shadow: 0px 4px 12px 0px rgba(7, 17, 27, 0.1);
71-
}
65+
height: 100%;
66+
background: #f0f3f7;
7267
// 主体区域
7368
.main-container {
74-
left: 0px;
75-
top: 80px;
76-
right: 0;
77-
height: auto;
78-
position: absolute;
79-
width: 90%;
80-
margin: 10px auto 10px;
69+
background: #f0f3f7;
70+
padding: 10px 50px;
71+
height: calc(100% - 120px);
8172
}
8273
}
83-
.drawer-bg {
84-
background: #000;
85-
opacity: 0.3;
86-
width: 100%;
87-
top: 0;
88-
height: 100%;
89-
position: absolute;
90-
z-index: 999;
91-
}
9274
</style>
Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,53 @@
11
<!--
22
@file 本页面用于加载其他二级路由对应的子页面,被layout/layout.vue引用
33
嵌套顺序App.vue->Layout.vue->AppMain.vue
4-
@author BoBo
4+
@author ytyang
55
@copyright NanJing Anshare Tech .Com
66
@createDate 2018年11月13日14:48:28
77
-->
88
<template>
99
<section class="app-main"
1010
ref="appmain"
11-
@scroll="handleScroll">
12-
<router-view :scrollTop="scrollTop"
13-
:key="key"
14-
@viewScroll="viewScroll" />
11+
@scroll="handleScroll"
12+
>
13+
<router-view :scrollTop="scrollTop"
14+
:key="key"
15+
@viewScroll="viewScroll" />
1516
</section>
1617
</template>
17-
<script lang="ts">
18-
import { Component, Vue, Prop } from 'vue-property-decorator';
1918

20-
@Component({
19+
<script>
20+
export default {
2121
name: 'AppMain',
22-
})
23-
export default class AppMain extends Vue {
24-
$refs!: {
25-
appmain: HTMLFormElement;
26-
};
27-
28-
scrollTop = 0;
29-
30-
ISPUBLIC = process.env.VUE_APP_ISPUBLIC;
31-
32-
get cachedViews() {
33-
return this.$store.state.tagsView.cachedViews;
34-
}
35-
36-
get key() {
37-
return this.$route.fullPath;
38-
}
39-
40-
// 根据右侧滚动条实时刷新滚动条距离顶部的位置,并通过<router-view>传入子页面
41-
handleScroll() {
42-
this.scrollTop = this.$refs.appmain.scrollTop;
43-
}
44-
45-
// 重定位滚动条
46-
viewScroll(v) {
47-
this.$refs.appmain.scrollTop = v;
48-
}
49-
}
22+
data() {
23+
return {
24+
scrollTop: 0,
25+
ISPUBLIC: process.env.VUE_APP_ISPUBLIC,
26+
};
27+
},
28+
computed: {
29+
cachedViews() {
30+
return this.$store.state.tagsView.cachedViews;
31+
},
32+
key() {
33+
return this.$route.fullPath;
34+
},
35+
},
36+
methods: {
37+
// 根据右侧滚动条实时刷新滚动条距离顶部的位置,并通过<router-view>传入子页面
38+
handleScroll() {
39+
this.scrollTop = this.$refs.appmain.scrollTop;
40+
},
41+
// 重定位滚动条
42+
viewScroll(v) {
43+
this.$refs.appmain.scrollTop = v;
44+
},
45+
},
46+
};
5047
</script>
5148
<style lang="scss" scoped>
5249
.app-main {
5350
// padding-top: 16px;
54-
height: 100%;
51+
height:100%;
5552
}
5653
</style>

0 commit comments

Comments
 (0)