领导日程展示

This commit is contained in:
XaoLi717 2024-11-18 15:21:10 +08:00
parent a0e88e9831
commit de42899819
2 changed files with 23 additions and 3 deletions

View File

@ -121,7 +121,7 @@ const queryParamsHygl = reactive({
userId: undefined,
deptName: undefined,
deptId: undefined,
time: [] as string[],
time: [],
depict: undefined,
type: undefined,
theme: undefined,
@ -150,7 +150,7 @@ const getList = async () => {
listHygl.value = hyglData.list
for(let item of listHygl.value){
const formattedDate = formatDate2(item.time);
const formattedDate = formatDate2(item.createTime);
// holidays2[formattedDate]
if (!Array.isArray(holidays2[formattedDate])) {
holidays2[formattedDate] = [];

View File

@ -1,10 +1,15 @@
<template>
<ContentWrap>
<el-button-group style="display: flex; justify-content: space-between;">
<el-button size="large" @click="selectDate(-1)">上月</el-button>
<el-button size="large" @click="today()">今天</el-button>
<el-button size="large" @click="selectDate(1)">下月</el-button>
</el-button-group>
<el-form-item label="领导日程展示" prop="createTime"/>
<el-calendar
ref="calendar"
class="custom-calendar"
:model-value="new Date()"
:model-value="new Date(currentYear,currentMonth,currentDay)"
>
<template #header="{ date }">
<el-row>
@ -62,6 +67,21 @@ const queryParamsRcgl = reactive({
createTime: [] as string[],
})
const currentDay = ref(new Date().getDate()) //
const currentMonth = ref(new Date().getMonth()) //
const currentYear = ref(new Date().getFullYear()) //
//
const selectDate = (val:number) => {
if (!val){
return
}
currentMonth.value+=val
console.log("today",currentYear.value,currentMonth.value,currentDay.value)
}
//
const today = () => {
currentMonth.value = new Date().getMonth() //
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (id: number) => {