diff --git a/src/pages/localTool/standCalendar/index.vue b/src/pages/localTool/standCalendar/index.vue index aa0bb6923..2f5644a44 100644 --- a/src/pages/localTool/standCalendar/index.vue +++ b/src/pages/localTool/standCalendar/index.vue @@ -151,37 +151,41 @@ export default { type: 1 } meetingByMonth(data).then(res => { - // 对传参的数据转义 - res.forEach(item => { - item.attend = JSON.parse(item.attend) - item.files = JSON.parse(item.files) - this.$set(item, 'partPeople', []) - }) - - res.forEach(item => { - item.attend.forEach(msgAtt => { - item.partPeople.push(msgAtt.fillPeople) + if (res.length !== 0) { + // 对传参的数据转义 + res.forEach(item => { + item.attend = JSON.parse(item.attend) + item.files = JSON.parse(item.files) + this.$set(item, 'partPeople', []) }) - }) - this.resDate = res - this.dealMyDate() - this.todayData = [] - this.resDate.forEach(item=>{ - if (item.date.slice(0,10) === this.nowDate) { - this.todayData.push(item) - } - }) + + res.forEach(item => { + item.attend.forEach(msgAtt => { + item.partPeople.push(msgAtt.fillPeople) + }) + }) + this.resDate = res + this.dealMyDate() + this.todayData = [] + this.resDate.forEach(item=>{ + if (item.date.slice(0,10) === this.nowDate) { + this.todayData.push(item) + } + }) + } }) }, /** 获取当前点击日历表格数据*/ calendarOnClick(val) { this.todayData = [] this.timeDay = val - this.resDate.forEach(item => { - if (item.date.slice(0, 10) === this.timeDay.day) { - this.todayData.push(item) - } - }) + if (this.resDate.length !== 0) { + this.resDate.forEach(item => { + if (item.date.slice(0, 10) === this.timeDay.day) { + this.todayData.push(item) + } + }) + } // 点击日历头部日期变化 this.formData.year = val.day.slice(0, 4) + '年' if (val.day.slice(5, 6) === '0') {