diff --git a/src/views/inspection/calendar.vue b/src/views/inspection/calendar.vue index 26643f3..edc098d 100644 --- a/src/views/inspection/calendar.vue +++ b/src/views/inspection/calendar.vue @@ -33,7 +33,7 @@ {{ data.day.slice(-2) }}

- + {{item.start == data.day ? item.title : ''}}
@@ -63,12 +63,16 @@ export default { let lastDay = new Date(fullYear,fullMonth,0).getDate() this.today = fullYear + '-' + fullMonth + '-' + fullDay this.getData(fullYear + '-' + fullMonth + '-01',fullYear + '-' + fullMonth + '-' + lastDay) - this.$nextTick(() =>{ + + }, + mounted(){ + this.$nextTick(() =>{ // console.log(document.querySelector('.el-calendar__title')) // 点击前一个月 let prevBtn = document.querySelector( ".el-calendar__button-group .el-button-group>button:nth-child(1)" ); + console.log('prevBtn------------------->',prevBtn) prevBtn.addEventListener("click", e => { let year = this.dateValue.getFullYear() let month = (this.dateValue.getMonth() + 1) < 10 ? '0' + (this.dateValue.getMonth() + 1) : this.dateValue.getMonth() + 1; @@ -111,8 +115,9 @@ export default { }, methods: { getData(startTime,endTime){ - // console.log('date ====>',date) + getCalendarData({startDate:startTime,endDate:endTime}).then(res =>{ + console.log('date ====>',res.data.data) this.calcData = res.data.data }) },