更改日程表

This commit is contained in:
XaoLi717 2024-11-19 15:19:17 +08:00
parent 15cd752877
commit e3c97db099

View File

@ -8,7 +8,7 @@
<el-calendar
ref="calendar"
class="custom-calendar"
:model-value="new Date(currentYear,currentMonth,currentDay)"
:model-value="new Date(currentYear,currentMonth)"
>
<template #header="{ date }">
<el-row style="width: 100%;">
@ -29,7 +29,9 @@
<div
class='holiday'
>
<span style="font-size: 14px">{{ data.date.getDate()}}</span>
<span style="font-size: 14px">
{{ data.date.getDate() === currentDay? data.date.getDate()+'(今天)':data.date.getDate() }}
</span>
<br/>
<span
v-for="item in (holidays2[data.day] || [])"
@ -40,11 +42,10 @@
<template #reference>
<span @click="openForm(item.id)">{{item.title}}</span>
</template>
<el-descriptions :title="item.title" :column="2" border>
<el-descriptions-item label="状态">{{item.status}}</el-descriptions-item>
<el-descriptions :title="item.title" :column="2">
<el-descriptions-item label="开始时间">{{item.startTime}}</el-descriptions-item>
<el-descriptions-item label="结束时间">{{item.endTime}}</el-descriptions-item>
<el-descriptions-item label="地点">{{item.location}}</el-descriptions-item>
<el-descriptions-item label="备注">{{item.remarks}}</el-descriptions-item>
</el-descriptions>
</el-popover>
<br/>
@ -61,7 +62,6 @@
import { CalendarInstance} from 'element-plus';
import {RcglApi, RcglVO} from "@/api/home/rcgl";
import RcglInfoForm from './RcglInfoForm.vue'
import {DICT_TYPE, getIntDictOptions} from "@/utils/dict";
defineOptions({ name: 'RcInfo' })
@ -103,7 +103,7 @@ const formRef = ref()
const openForm = (id: number) => {
formRef.value.open(id)
}
//使
const calendar = ref<CalendarInstance>()
// 14
@ -133,8 +133,8 @@ const getList = async () => {
holidays2[formattedDate].push({
id:item.id,
title:item.title,
startTime:formatDate2(item.startTime),
endTime:formatDate2(item.endTime),
status:getStatus(item.status),
location:item.location,
remarks:item.remarks
}
@ -143,14 +143,6 @@ const getList = async () => {
} finally {
}
}
const getStatus = (status:number)=>{
const dict = getIntDictOptions(DICT_TYPE.RCGL_RC_STATUS);
for (let item of dict){
if (item.value === status){
return item.label
}
}
}
//
function formatDate(date: Date,time:boolean) {
@ -180,17 +172,21 @@ onMounted(()=> {
.holiday::-webkit-scrollbar {
display: none;
}
/*今天显示为其他颜色*/
.custom-calendar .is-today {
width: 100%;
height: 100%;
background-color: #FFE6E6 ;
font-size: 16px;
}
/*设置日历组件边框大小圆角*/
.custom-calendar {
width: 100%;
height: 100%;
border: 1px solid #1f1f1f !important; /* 使用 !important 确保样式生效 */
border-radius: 5px; /* 可选:添加圆角 */
}
/*每个小各自大小*/
.el-calendar-table .el-calendar-day {
height: 105px/*这个覆盖了原组件宽度*/
}
@ -200,6 +196,7 @@ onMounted(()=> {
font-size: 20px;
font-weight: bold;
}
//
.holiday {
overflow-x: scroll;
text-overflow: ellipsis;
@ -221,13 +218,15 @@ onMounted(()=> {
text-align: left;
font-size: 22px;
}
//border: 1px solid var(--el-color-primary);
//
.seSpan {
font-size: 14px;
color: var(--el-color-primary);
border: 1px solid var(--el-color-primary);
border-radius: 2px; /* 可选:添加圆角 */
padding: 0 2px 0 2px;
}
//
.el-descriptions-item__content {
white-space: normal !important; /* 允许换行 */
word-wrap: break-word; /* 长单词换行 */