parent
985e8be5b8
commit
2a7203b9a5
@ -0,0 +1,117 @@
|
||||
<template>
|
||||
<div class="card">
|
||||
<div class="title">
|
||||
<div class="title__icon">
|
||||
<div class="title__icon--main">
|
||||
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M675.10784 488.39168h96.27648l194.5344-167.54176c-8.4992-19.98848-18.0224-39.20896-28.83072-57.69728l-257.99168 221.7472-3.98848 3.49184M535.8592 20.1472v78.90944l79.20128-68.34176c-25.78432-5.40672-52.14208-9.28768-79.20128-10.56768m407.35232 468.24448l56.16128-48.34304c-3.40992-23.60832-8.95488-46.51008-15.6672-68.89472L847.3856 488.3968h95.83104v-0.00512m-160.79872-387.8912L535.8592 312.4224v82.86208l297.53856-256.4096a498.59072 498.59072 0 0 0-50.97984-38.3744M672.96256 46.37184L535.8592 164.3264v82.87744l200.89344-173.19936c-20.53632-10.48576-41.64608-20.00896-63.79008-27.63264m236.49792 174.94016a489.66656 489.66656 0 0 0-39.84384-47.7184L535.8592 460.544v27.8528h63.57504l310.02624-267.0848M489.2672 20.1472C228.05504 32.38912 19.88608 247.47008 19.88608 511.6416c0 114.37568 39.28064 219.35616 104.66816 302.92992l364.71296-313.6V20.1472m31.85152 514.76992l-366.22336 314.92608c89.87136 94.98112 216.64768 154.53184 357.6832 154.53184 264.20224 0 479.26784-208.19968 491.53024-469.4528h-482.99008z" fill="#ffffff"></path></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="title__text">
|
||||
访问量
|
||||
</div>
|
||||
<div class="title__select">
|
||||
<el-date-picker v-model="year" value-format="yyyy" type="year" placeholder="年份" @change="getData"></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<BarChart id="visit-bar-chart" width="100%" height="36.8vh"></BarChart>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BarChart from './BarChart.vue'
|
||||
export default {
|
||||
components: {
|
||||
BarChart
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
year: new Date().getFullYear().toString()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.$emit('change', this.year)
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import "../index.scss";
|
||||
.card {
|
||||
border-radius: px2vw(7);
|
||||
filter: drop-shadow(0 0 7.5px rgba(211, 215, 221, 0.4));
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #d8e2f0;
|
||||
padding: px2vw(20) px2vw(46) px2vw(40) px2vw(20);
|
||||
}
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&__icon {
|
||||
width: px2vw(32);
|
||||
height: px2vw(30);
|
||||
position: relative;
|
||||
|
||||
&--main {
|
||||
width: px2vw(28);
|
||||
height: px2vw(28);
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background: rgba(158, 182, 252, 0.5);
|
||||
border-radius: 100%;
|
||||
padding: px2vw(5);
|
||||
}
|
||||
&::before {
|
||||
content: '';
|
||||
width: px2vw(28);
|
||||
height: px2vw(28);
|
||||
top: 0;
|
||||
left: 0;
|
||||
border-radius: 100%;
|
||||
background: #3e8bd7;
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
&__text {
|
||||
font-size: px2vw(20);
|
||||
letter-spacing: px2vw(1);
|
||||
color: #1c1a1d;
|
||||
font-weight: 500;
|
||||
padding-left: px2vw(10);
|
||||
}
|
||||
&__select {
|
||||
margin-left: auto;
|
||||
|
||||
::v-deep .el-date-editor--year {
|
||||
width: px2vw(265) !important;
|
||||
height: px2vw(41) !important;
|
||||
}
|
||||
::v-deep .el-input__inner {
|
||||
width: px2vw(265) !important;
|
||||
height: px2vw(41) !important;
|
||||
background: #f5f7f9 !important;
|
||||
border-radius: px2vw(8) !important;
|
||||
font-size: px2vw(20) !important;
|
||||
}
|
||||
::v-deep .el-input__prefix {
|
||||
height: px2vw(41) !important;
|
||||
line-height: px2vw(41) !important;
|
||||
}
|
||||
::v-deep .el-input__icon {
|
||||
height: px2vw(41) !important;
|
||||
line-height: px2vw(41) !important;
|
||||
}
|
||||
::v-deep .el-input__suffix {
|
||||
height: px2vw(41) !important;
|
||||
line-height: px2vw(41) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
#visit-bar-chart {
|
||||
margin-top: px2vw(38);
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,7 @@
|
||||
// 将px转换为vw的混入函数
|
||||
@function px2vw($px) {
|
||||
@return ($px / 1668) * 100vw;
|
||||
}
|
||||
@function px2vh($px) {
|
||||
@return ($px / 1066) * 100vh;
|
||||
}
|
||||
Loading…
Reference in new issue