127 lines
2.5 KiB
Vue
127 lines
2.5 KiB
Vue
|
|
<template>
|
||
|
|
<div class="leftBox">
|
||
|
|
<div class="topBox">
|
||
|
|
<el-date-picker
|
||
|
|
v-model="selectedDate"
|
||
|
|
type="month"
|
||
|
|
format="yyyy年MM月"
|
||
|
|
:clearable="false"
|
||
|
|
style="margin-bottom: 10px; width: 150px"
|
||
|
|
@change="changeMonth"
|
||
|
|
prefix-icon="false"
|
||
|
|
/>
|
||
|
|
<div>
|
||
|
|
<i
|
||
|
|
class="el-icon-arrow-left"
|
||
|
|
style="font-size: 18px; font-weight: bold"
|
||
|
|
@click="preMonth"
|
||
|
|
></i>
|
||
|
|
<i
|
||
|
|
class="el-icon-arrow-right"
|
||
|
|
style="font-size: 18px; font-weight: bold"
|
||
|
|
@click="nextMonth"
|
||
|
|
></i>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<el-calendar v-model="selectedDate" />
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
import { workLogApi, projectApi } from "@/utils/api";
|
||
|
|
|
||
|
|
export default {
|
||
|
|
name: "LeftMonth",
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
selectedDate: this.moment(new Date()).format("YYYY-MM-DD"),
|
||
|
|
};
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
changeMonth() {},
|
||
|
|
preMonth() {
|
||
|
|
this.selectedDate = this.moment(this.selectedDate)
|
||
|
|
.subtract(1, "months")
|
||
|
|
.format("YYYY-MM-DD");
|
||
|
|
},
|
||
|
|
nextMonth() {
|
||
|
|
this.selectedDate = this.moment(this.selectedDate)
|
||
|
|
.add(1, "months")
|
||
|
|
.format("YYYY-MM-DD");
|
||
|
|
},
|
||
|
|
},
|
||
|
|
};
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<style scoped lang="scss">
|
||
|
|
.leftBox ::v-deep .el-calendar__header {
|
||
|
|
display: none;
|
||
|
|
}
|
||
|
|
.leftBox ::v-deep .el-date-editor {
|
||
|
|
.el-input__inner {
|
||
|
|
border: none;
|
||
|
|
padding-left: 0;
|
||
|
|
font-size: 18px;
|
||
|
|
color: #333333;
|
||
|
|
font-weight: 600;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
.leftBox ::v-deep .el-calendar__body {
|
||
|
|
padding: 0 !important;
|
||
|
|
thead {
|
||
|
|
th {
|
||
|
|
font-family: PingFang SC;
|
||
|
|
font-weight: 400;
|
||
|
|
font-size: 16px;
|
||
|
|
color: #999999;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
tbody {
|
||
|
|
td {
|
||
|
|
border: none;
|
||
|
|
padding: 10px 0;
|
||
|
|
|
||
|
|
.el-calendar-day {
|
||
|
|
text-align: center;
|
||
|
|
padding: 0 !important;
|
||
|
|
font-size: 16px;
|
||
|
|
span {
|
||
|
|
font-family: cursive !important;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
&.next,
|
||
|
|
&.prev {
|
||
|
|
color: #333 !important;
|
||
|
|
}
|
||
|
|
&.is-selected .el-calendar-day {
|
||
|
|
border-radius: 50% !important;
|
||
|
|
background-color: #4096ff;
|
||
|
|
color: #fff;
|
||
|
|
}
|
||
|
|
.el-calendar-day {
|
||
|
|
height: 40px;
|
||
|
|
width: 40px;
|
||
|
|
line-height: 40px;
|
||
|
|
|
||
|
|
border-radius: 50% !important;
|
||
|
|
&:hover {
|
||
|
|
background-color: #88bdfd;
|
||
|
|
color: #fff;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
.topBox {
|
||
|
|
display: flex;
|
||
|
|
flex-direction: row;
|
||
|
|
justify-content: space-between;
|
||
|
|
align-items: center;
|
||
|
|
i {
|
||
|
|
margin-right: 10px;
|
||
|
|
cursor: pointer;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</style>
|