|
|
|
@ -29,7 +29,7 @@ |
|
|
|
|
<view |
|
|
|
|
:class="['date', { |
|
|
|
|
'nowDay': item.month === 'current' && nowYear === currentYear && nowMonth === currentMonth && nowDate === item.date, |
|
|
|
|
'hasPlan': item.month === 'current' && dateList.includes(`${currentYear}-${formatterNum(currentMonth)}-${formatterNum(item.date)}`), |
|
|
|
|
'hasPlan': item.month === 'current' && dateList.filter(v => v.date === `${currentYear}-${formatterNum(currentMonth)}-${formatterNum(item.date)}`).length > 0, |
|
|
|
|
'isClock': item.month === 'current' && dateList.includes(`${currentYear}-${formatterNum(currentMonth)}-${formatterNum(item.date)}`) |
|
|
|
|
}]" |
|
|
|
|
>{{ item.month === 'current' ? item.date : '' }}</view> |
|
|
|
@ -39,7 +39,7 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
// import { queryMemorandumMonth } from '../api'; |
|
|
|
|
import { getMonthRecord } from '@/api/learning'; |
|
|
|
|
export default { |
|
|
|
|
props: { |
|
|
|
|
calendarData: { |
|
|
|
@ -68,24 +68,18 @@ export default { |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.getAllArr(); |
|
|
|
|
// this.getDateList(); |
|
|
|
|
this.getDateList(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// async getDateList() { |
|
|
|
|
// const res = await queryMemorandumMonth({ datetime: this.monthYear }); |
|
|
|
|
// if (Number(res.status === 200) && res.data.success) { |
|
|
|
|
// if (res.data.result.length > 0) { |
|
|
|
|
// // eslint-disable-next-line arrow-parens |
|
|
|
|
// res.data.result.forEach(v => { |
|
|
|
|
// if (!this.dateList.includes(v)) { |
|
|
|
|
// this.dateList.push(v); |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
// } |
|
|
|
|
// } else { |
|
|
|
|
// this.$util.showMsg(res.data.message || res.data.msg); |
|
|
|
|
// } |
|
|
|
|
// }, |
|
|
|
|
async getDateList() { |
|
|
|
|
const { data } = await getMonthRecord( |
|
|
|
|
{ |
|
|
|
|
month: `${this.currentYear}-${this.currentMonth < 10 ? '0' + this.currentMonth : this.currentMonth}`, |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
this.dateList = data; |
|
|
|
|
console.log(data); |
|
|
|
|
}, |
|
|
|
|
// 获取某年某月总共多少天 |
|
|
|
|
getDateLen(year, month) { |
|
|
|
|
let actualMonth = month - 1; |
|
|
|
@ -197,7 +191,7 @@ export default { |
|
|
|
|
this.currentMonth = month; |
|
|
|
|
this.monthYear = year + '年' + (month < 10 ? '0' + month : month) + '月'; |
|
|
|
|
this.getAllArr(); |
|
|
|
|
// this.getDateList(); |
|
|
|
|
this.getDateList(); |
|
|
|
|
}, |
|
|
|
|
// 点击 下月 |
|
|
|
|
gotoNextMonth() { |
|
|
|
@ -206,7 +200,7 @@ export default { |
|
|
|
|
this.currentMonth = month; |
|
|
|
|
this.monthYear = year + '年' + (month < 10 ? '0' + month : month) + '月'; |
|
|
|
|
this.getAllArr(); |
|
|
|
|
// this.getDateList(); |
|
|
|
|
this.getDateList(); |
|
|
|
|
}, |
|
|
|
|
clockPreTask(id) { |
|
|
|
|
this.$emit('clock', id); |
|
|
|
|