Compare commits

...

4 Commits

Author SHA1 Message Date
XaoLi717
9deee62a47 更改信息展示 2024-11-19 15:19:45 +08:00
XaoLi717
e3c97db099 更改日程表 2024-11-19 15:19:17 +08:00
XaoLi717
15cd752877 更改日程表 2024-11-19 14:21:36 +08:00
XaoLi717
515bcf67f7 更改日程表 2024-11-19 14:02:45 +08:00
3 changed files with 32 additions and 22 deletions

View File

@ -9,7 +9,7 @@
<el-calendar <el-calendar
ref="calendar" ref="calendar"
class="custom-calendar" class="custom-calendar"
:model-value="new Date(currentYear,currentMonth,currentDay)" :model-value="new Date(currentYear,currentMonth)"
> >
<!-- 组件头 内部有日期 还有按钮--> <!-- 组件头 内部有日期 还有按钮-->
<template #header="{ date }"> <template #header="{ date }">
@ -29,7 +29,9 @@
<!-- 自定义展示内容 根据需要自定义就好了--> <!-- 自定义展示内容 根据需要自定义就好了-->
<template #date-cell="{ data }"> <template #date-cell="{ data }">
<div class='holiday'> <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/> <br/>
<span <span
v-for="item in (holidays2[data.day] || [])" v-for="item in (holidays2[data.day] || [])"
@ -204,18 +206,21 @@ onMounted(()=> {
.holiday::-webkit-scrollbar { .holiday::-webkit-scrollbar {
display: none; display: none;
} }
/*今天显示为其他颜色*/
.custom-calendar .is-today { .custom-calendar .is-today {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #FFE6E6;
font-size: 16px; font-size: 16px;
} }
/*设置日历表最大使用边框 还有来个小圆角*/ /*设置日历组件边框大小圆角*/
.custom-calendar { .custom-calendar {
width: 100%; width: 100%;
height: 100%; height: 100%;
border: 1px solid #1f1f1f !important; /* 使用 !important 确保样式生效 */ border: 1px solid #1f1f1f !important; /* 使用 !important 确保样式生效 */
border-radius: 5px; /* 可选:添加圆角 */ border-radius: 5px; /* 可选:添加圆角 */
} }
/*每个小各自大小*/
.el-calendar-table .el-calendar-day { .el-calendar-table .el-calendar-day {
height: 105px/*这个覆盖了原组件宽度*/ height: 105px/*这个覆盖了原组件宽度*/
} }
@ -255,12 +260,17 @@ onMounted(()=> {
text-align: left; text-align: left;
font-size: 22px; font-size: 22px;
} }
// //border: 1px solid var(--el-color-primary);
.seSpan { .seSpan {
font-size: 14px; font-size: 14px;
color: var(--el-color-primary); color: var(--el-color-primary);
border: 1px solid var(--el-color-primary);
border-radius: 2px; /* 可选:添加圆角 */ border-radius: 2px; /* 可选:添加圆角 */
padding: 0 2px 0 2px; padding: 0 2px 0 2px;
} }
//
.el-descriptions-item__content {
white-space: normal !important; /* 允许换行 */
word-wrap: break-word; /* 长单词换行 */
word-break: break-word; /* 强制换行 */
}
</style> </style>

View File

@ -110,6 +110,7 @@ const formData = ref({
const formRules = reactive({ const formRules = reactive({
title: [{ required: true, message: '日程标题不能为空', trigger: 'blur' }], title: [{ required: true, message: '日程标题不能为空', trigger: 'blur' }],
startTime: [{ required: true, message: '日程开始时间不能为空', trigger: 'blur' }], startTime: [{ required: true, message: '日程开始时间不能为空', trigger: 'blur' }],
location: [{ required: true, message: '地点不能为空', trigger: 'blur' }],
ispublic: [{ required: true, message: '日程是否公开不能为空', trigger: 'blur' }], ispublic: [{ required: true, message: '日程是否公开不能为空', trigger: 'blur' }],
endTime: [{ required: true, message: '日程结束时间不能为空', trigger: 'blur' }], endTime: [{ required: true, message: '日程结束时间不能为空', trigger: 'blur' }],
status: [{ required: true, message: '日程状态不能为空', trigger: 'blur' }], status: [{ required: true, message: '日程状态不能为空', trigger: 'blur' }],

View File

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