From f809e0fb317de0c4762cb684bc3bb58f870d8958 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 23 Sep 2024 12:55:39 +0200 Subject: [PATCH] fix: refs #7323 show prev month week color --- src/pages/Worker/Card/WorkerTimeControl.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/pages/Worker/Card/WorkerTimeControl.vue b/src/pages/Worker/Card/WorkerTimeControl.vue index fbfd4b28d..c6ca9d74a 100644 --- a/src/pages/Worker/Card/WorkerTimeControl.vue +++ b/src/pages/Worker/Card/WorkerTimeControl.vue @@ -326,16 +326,21 @@ const updateData = async () => { }; const getMailStates = async (date) => { + const url = `WorkerTimeControls/${route.params.id}/getMailStates`; + const month = date.getMonth() + 1; + const prevMonth = month == 1 ? 12 : month - 1; + let prevMonthStates = []; + const params = { - month: date.getMonth() + 1, + month, year: date.getFullYear(), }; - const { data } = await axios.get( - `WorkerTimeControls/${route.params.id}/getMailStates`, - { params } - ); - workerTimeControlMails.value = data; + const curMonthStates = (await axios.get(url, { params })).data; + prevMonthStates = (await axios.get(url, { params: { ...params, month: prevMonth } })) + .data; + + workerTimeControlMails.value = curMonthStates.concat(prevMonthStates); }; const showWorkerTimeForm = (propValue, formType) => {