加个setTimeout

This commit is contained in:
shijingjing
2022-08-01 17:15:29 +08:00
parent 0d28ef2e2e
commit f15358ad1c

View File

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