会议室信息
This commit is contained in:
parent
a4a72f6952
commit
45695d62a2
@ -16,7 +16,7 @@
|
||||
|
||||
<template #date-cell="{ data }">
|
||||
<div
|
||||
:class="'holiday'"
|
||||
class='holiday'
|
||||
style="max-height: 100%; overflow-y: auto; width: 100%;"
|
||||
>
|
||||
<span style="font-size: 12px">{{ data.date.getDate()}}</span>
|
||||
@ -40,8 +40,9 @@
|
||||
<script setup lang="ts">
|
||||
import { CalendarInstance} from 'element-plus';
|
||||
import { HyglApi, HyglVO } from '@/api/home/hygl'
|
||||
import HyInfoForm from "@/views/Home/hysgl/hysinfo/HyInfoForm.vue";
|
||||
|
||||
defineOptions({ name: 'CalendarAgendaIndex' })
|
||||
defineOptions({ name: 'HyInfo' })
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
@ -56,6 +57,7 @@ const endDate2 = new Date();
|
||||
const startDate2 = new Date();
|
||||
startDate2.setDate(endDate2.getDate() - 14); // 设置14天前的日期
|
||||
|
||||
//获取详细日期时间
|
||||
function formatDate(date: Date,time:boolean) {
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以加1
|
||||
@ -65,6 +67,7 @@ function formatDate(date: Date,time:boolean) {
|
||||
const seconds =time? '59' : '00';
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
}
|
||||
// 获取日期
|
||||
function formatDate2(dat: number) {
|
||||
const date = new Date(dat)
|
||||
const year = date.getFullYear();
|
||||
@ -81,11 +84,12 @@ function formatDate2(dat: number) {
|
||||
// const seconds =time? String(date.getSeconds()).padStart(2, '0') : '00';
|
||||
// return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
// }
|
||||
/** 搜索按钮操作 */
|
||||
|
||||
/** 获取数据 */
|
||||
const handleQuery = () => {
|
||||
queryParamsHygl.pageNo = 1
|
||||
queryParamsHygl.createTime = [formatDate(startDate2,false),formatDate(endDate2,true)]
|
||||
getList()
|
||||
queryParamsHygl.createTime = [formatDate(startDate2,false),formatDate(endDate2,true)]//设置时间区域
|
||||
getList() //获取数据
|
||||
}
|
||||
|
||||
const listHygl = ref<HyglVO[]>([]) // 列表的数据
|
||||
@ -123,8 +127,11 @@ const holidays2 = reactive({});
|
||||
const getList = async () => {
|
||||
try {
|
||||
const hyglData = await HyglApi.getHyglPage(queryParamsHygl)
|
||||
|
||||
listHygl.value = hyglData.list
|
||||
|
||||
for(let item of listHygl.value){
|
||||
|
||||
const formattedDate = formatDate2(item.createTime);
|
||||
// 如果 holidays2[formattedDate] 不存在或不是数组,初始化为数组
|
||||
if (!Array.isArray(holidays2[formattedDate])) {
|
||||
|
Loading…
Reference in New Issue
Block a user