ViewDate.vue
1.92 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
<!--
* @Description: 内容页面统计年份组件
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-06 12:06:38
-->
<template>
<div class="view-date">统计年份:
<div class="year-plugin">
<div class="year" @click="switchYear">
{{year}}
<img class="arrow-down" src="@/assets/images/arrow-down.png" alt="">
</div>
<SelectBox :isShow="isShow" :dataList="dataList" :boxWidth="'8.61vw'" @selectVal="selectVal"></SelectBox>
<!-- <div v-show="isShow" class="select-year">
<div class="year-item" :class="year == item ? 'active' : ''" v-for="(item,index) in dataList" :key="index" @click.s="selectYear(item)">{{item}}</div>
</div> -->
</div>
业务开始时间:2022年6月30日</div>
</template>
<script type='text/ecmascript-6'>
import datas from '@/utils/data'
export default {
name: 'ViewDate',
data() {
return {
isShow: false,
dataList: datas.DefaultData.yearList,
year: ''
}
},
mounted() {
this.year = this.dataList[0]
},
methods: {
switchYear() {
this.isShow = !this.isShow
},
selectVal(val) {
console.log(val)
this.year = val
this.switchYear()
}
}
}
</script>
<style scoped lang='scss'>
.view-date {
display: flex;
align-items: center;
// width: 100%;
height: 6.67vh;
color: #C9C9C9;
font-size: 14px;
padding: 0 1.33vh;
background-color: #091C40;
.year-plugin {
position: relative;
}
.year {
display: flex;
align-items: center;
justify-content: space-between;
width: 8.61vw;
height: 4vh;
padding: 0 0.56vw;
box-sizing: border-box;
background-image: linear-gradient(270deg, #6578FF 0%, #079FF1 100%);
margin-right: 0.56vw;
color: #FFFFFF;
.arrow-down {
width: 0.69vw;
height: 0.67vh;
}
}
}
</style>