BasicLayout.vue
2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<template>
<el-container>
<el-header>
<global-header />
</el-header>
<el-main class="content-container">
<div class="condition">
<div class="condition-top">
<span class="content-title">
演示项目 2020-06-10 客流综合数据统计
</span>
<span
class="pointer other-options"
:class="{ collapsed: !collapsed }"
@click="collapsed = !collapsed"
>
其他日期选项
<i class="el-icon-arrow-right condition-icon-arrow"></i>
</span>
</div>
<div v-show="!collapsed" class="collapsed-content">
<date-options :show-type="1" :defaults-date.sync="dateType" />
<div class="operate-wrapper">
<el-button class="operate-btn" type="primary" @click="onConfirm"
>确 定</el-button
>
<el-button class="operate-btn reset-btn" @click="onConfirm"
>取 消</el-button
>
</div>
</div>
</div>
<div class="content" :style="{ marginTop: collapsed ? '72px' : '132px' }">
<router-view />
</div>
</el-main>
</el-container>
</template>
<script>
import GlobalHeader from './components/GlobalHeader'
import DateOptions from '@/components/Conditions/DateOptions'
export default {
name: 'BasicLayout',
components: { GlobalHeader, DateOptions },
data() {
return {
collapsed: false,
dateType: 'day'
}
},
methods: {
onConfirm() {
console.log('dateType::', this.dateType)
}
}
}
</script>
<style lang="scss">
@import '~@/styles/variables.scss';
.content-container {
padding: 0;
margin-bottom: 40px;
}
.content {
margin: $headerHeight 165px 0;
background-color: #ccc;
color: #333;
text-align: center;
height: 100vh;
box-shadow: 0 0 3px 0 rgba(0, 0, 0, 1);
transition: all 0.3s linear;
}
.condition {
width: 100%;
position: fixed;
top: $headerHeight;
z-index: 2;
background: #fff;
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.1);
.content-title {
font-size: 20px;
color: #555;
}
.other-options {
float: right;
position: relative;
right: 165px;
top: 6px;
font-size: 13px;
color: #666;
.condition-icon-arrow {
margin-left: 8px;
transition: transform 0.3s;
}
&.collapsed .condition-icon-arrow {
transform: rotate(90deg);
}
}
.condition-top {
text-align: center;
line-height: 60px;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.collapsed-content {
background: #fff;
height: 58px;
// line-height: 58px;
padding: 13px 200px 15px 66px;
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.1);
box-sizing: border-box;
}
.operate-wrapper {
float: right;
.operate-btn + .operate-btn {
margin-left: 10px;
}
}
}
</style>