This commit is contained in:
shijingjing
2022-08-02 15:32:52 +08:00
parent ea9a966286
commit 0775105b18

View File

@@ -92,34 +92,35 @@ export default {
.then((res) => { .then((res) => {
if (res?.data) { if (res?.data) {
this.calendarList = res.data; this.calendarList = res.data;
setTimeout(()=>{ let arr = Object.keys(res.data).map(key => (res.data[key]))
let arr = Object.keys(res.data).map(key => (res.data[key])) this.list = arr[this.day - 1]?.taskList
this.list = arr[this.day - 1]?.taskList console.log(this.list,'this.list');
let calList = arr.filter(item=> (item.taskList && item.taskList.length > 0)) let calList = arr.filter(item=> (item.taskList && item.taskList.length > 0))
this.selected = calList.map(item=> { console.log(calList,'calList');
if(item.day>=1 && item.day<=9) { this.selected = calList.map(item=> {
if(this.month>=1 && this.month <=9) { if(item.day>=1 && item.day<=9) {
return { if(this.month>=1 && this.month <=9) {
date: this.year + '-' + '0' + this.month + '-' + '0' + item.day return {
} date: this.year + '-' + '0' + this.month + '-' + '0' + item.day
} else {
return {
date: this.year + '-' + this.month + '-' + '0' + item.day
}
} }
} else if(item.day> 9) { } else {
if(this.month > 9) { return {
return { date: this.year + '-' + this.month + '-' + '0' + item.day
date: this.year + '-' + this.month + '-' + item.day
}
} else {
return {
date: this.year + '-' + '0' + this.month + '-' + item.day
}
} }
} }
}) } else if(item.day> 9) {
},1000) if(this.month > 9) {
return {
date: this.year + '-' + this.month + '-' + item.day
}
} else {
return {
date: this.year + '-' + '0' + this.month + '-' + item.day
}
}
}
})
console.log(this.selected, 'this.selected');
} }
}); });
}, },