修改日历点击按钮列表显示问题

main
jinna 1 year ago
parent 476a280916
commit 073439011d
  1. 11
      src/views/inspection/calendar.vue

@ -33,7 +33,7 @@
{{ data.day.slice(-2) }}
</p>
<div style="display:flex;align-items:center;flex-direction: column;height:74%;overflow:auto;">
<span class="txt_box right_txt" v-for="item in calcData" :key="item.title">
<span class="txt_box right_txt" v-for="item in calcData" :key="item.planCode">
{{item.start == data.day ? item.title : ''}}
</span>
</div>
@ -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
})
},

Loading…
Cancel
Save