This commit is contained in:
shijingjing
2022-07-18 10:55:29 +08:00
parent 74466bf775
commit 1f729bf860
3 changed files with 243 additions and 139 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div class="calendarInfo">
<uni-calendar :insert="true" :selected="selected" :lunar="false" @change="change"/>
<uni-calendar :insert="true" :selected="selected" :lunar="false" @change="change" @monthSwitch="changeMonth"/>
<div class="dailyMatters">
<div>
@@ -38,6 +38,7 @@ export default {
year: '',
month: '',
day: '',
yyyyMM: '',
}
},
components: {
@@ -49,6 +50,14 @@ export default {
},
methods: {
changeMonth(e) {
if(e.month<=9) {
this.yyyyMM = e.year + '-' + '0' + e.month
} else if(e.month > 9) {
this.yyyyMM = e.year + '-' + e.month
}
this.getData()
},
change(val) {
this.date = `${val.year} + '-' + ${val.month} + '-' + ${val.day}`
},
@@ -62,21 +71,27 @@ export default {
},
getData() {
this.$http.post(`/app/appmasssendingtask/statisticsCalendar`, null, {
params: {},
params: {
yyyyMM: this.yyyyMM,
},
})
.then((res) => {
if (res?.data) {
this.calendarList = res.data;
var arr = Object.keys(res.data).map(key => (res.data[key]))
var calList = arr.filter(item=> (item.taskList && item.taskList.length > 0))
let arr = Object.keys(res.data).map(key => (res.data[key]))
let calList = arr.filter(item=> (item.taskList && item.taskList.length > 0))
this.selected = calList.map(item=> {
if(item.day>=1 && item.day<=9) {
if(this.month>=1 && this.month <=9) {
return this.year + '-' + '0' + this.month + '-' + '0' + item.day
return {
date: this.year + '-' + '0' + this.month + '-' + '0' + item.day
}
}
} else if(item.day> 9) {
if(this.month > 9) {
return this.year + '-' + this.month + '-' + item.day
return {
date: this.year + '-' + this.month + '-' + item.day
}
}
}
})