领导日程展示

This commit is contained in:
XaoLi717 2024-11-18 15:11:27 +08:00
parent 57453a63b0
commit 11e5fc4e57
2 changed files with 25 additions and 6 deletions

View File

@ -8,7 +8,7 @@ export interface HyglVO {
userId: number // 申请人id userId: number // 申请人id
deptName: string // 申请部门名字 deptName: string // 申请部门名字
deptId: number // 申请部门id deptId: number // 申请部门id
time: Date // 申请时间 time: Date | number // 申请时间
depict: string // 描述 depict: string // 描述
type: number // 会议类型 type: number // 会议类型
theme: string // 会议主题 theme: string // 会议主题

View File

@ -1,10 +1,15 @@
<template> <template>
<ContentWrap> <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-form-item label="会议申请历史" prop="createTime"/>
<el-calendar <el-calendar
ref="calendar" ref="calendar"
class="custom-calendar" class="custom-calendar"
:model-value="new Date()" :model-value="new Date(currentYear,currentMonth,currentDay)"
> >
<template #header="{ date }"> <template #header="{ date }">
<el-row> <el-row>
@ -44,6 +49,21 @@ import HyInfoForm from "@/views/Home/hygl/hyinfo/HyInfoForm.vue";
defineOptions({ name: 'HyInfo' }) defineOptions({ name: 'HyInfo' })
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 formRef = ref()
//id //id
@ -101,7 +121,7 @@ const queryParamsHygl = reactive({
userId: undefined, userId: undefined,
deptName: undefined, deptName: undefined,
deptId: undefined, deptId: undefined,
time: [], time: [] as string[],
depict: undefined, depict: undefined,
type: undefined, type: undefined,
theme: undefined, theme: undefined,
@ -129,10 +149,8 @@ const getList = async () => {
const hyglData = await HyglApi.getHyglPage(queryParamsHygl) const hyglData = await HyglApi.getHyglPage(queryParamsHygl)
listHygl.value = hyglData.list listHygl.value = hyglData.list
for(let item of listHygl.value){ for(let item of listHygl.value){
const formattedDate = formatDate2(item.time);
const formattedDate = formatDate2(item.createTime);
// holidays2[formattedDate] // holidays2[formattedDate]
if (!Array.isArray(holidays2[formattedDate])) { if (!Array.isArray(holidays2[formattedDate])) {
holidays2[formattedDate] = []; holidays2[formattedDate] = [];
@ -140,6 +158,7 @@ const getList = async () => {
// title // title
holidays2[formattedDate].push({id:item.id,title:item.title}); holidays2[formattedDate].push({id:item.id,title:item.title});
} }
// console.log("holidays2",holidays2)
} finally { } finally {
} }
} }