From b5bf355a9551f954ba7bb1d4e9ba0904fa3be6f3 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Thu, 19 Jun 2025 18:38:57 +0800
Subject: [PATCH] feat:区域显示
---
src/views/wel/components/calendarBox.vue | 69 +++++++++++++++++++++++-----------
1 files changed, 46 insertions(+), 23 deletions(-)
diff --git a/src/views/wel/components/calendarBox.vue b/src/views/wel/components/calendarBox.vue
index 3b39e81..20ce47e 100644
--- a/src/views/wel/components/calendarBox.vue
+++ b/src/views/wel/components/calendarBox.vue
@@ -26,9 +26,9 @@
import dayjs from 'dayjs';
import { jobEventBar, getCalen } from '@/api/home/index';
import { useRouter } from 'vue-router';
-import ev1 from '@/assets/images/workbench/ev1.png';
-import ev2 from '@/assets/images/workbench/ev2.png';
-import { ElMessage } from 'element-plus'
+import ev1 from '@/assets/images/workbench/ev1.svg';
+import ev2 from '@/assets/images/workbench/ev2.svg';
+import { ElMessage } from 'element-plus';
const router = useRouter();
const events = ref({});
const params = ref({
@@ -68,12 +68,14 @@
const getDate = date => {
return date.getDate();
};
+
// 获取对应日期的事件
const getEvents = dateString => {
return events.value[dateString] || [];
};
const monthRange = getCurrentMonthRange();
params.value = monthRange;
+
const getJobEventBar = () => {
getCalen(params.value).then(res => {
if (res.data.code !== 0) return;
@@ -88,8 +90,13 @@
day: day,
},
});
- }else{
- ElMessage.warning('加急开发中...')
+ } else {
+ router.push({
+ path: '/job/jobstatistics',
+ query: {
+ day: day,
+ },
+ });
}
};
onMounted(() => {
@@ -98,32 +105,48 @@
</script>
<style lang="scss">
.calenBox {
-.el-calendar__title{
-font-weight: bold;
-font-size: 14px;
-color: #363636;
-}
+ height: 630px;
+ .el-calendar {
+ height: 100%; // 日历填充容器
+ // 标题样式
+ &__title {
+ font-weight: bold;
+ font-size: 14px;
+ color: #363636;
+ }
-
- .el-calendar-table td.is-selected {
- background-color: #f0f7ff;
- border: 2px solid #409eff;
- border-radius: 4px;
- }
- .el-calendar-table td.is-selected .date-number {
- font-weight: bold;
- color: #409eff;
+ // 日历主体
+ &__body {
+ height: 98%; // 关键:继承父高度
+
+ .el-calendar-table {
+ height: 90% !important; // 百分比生效
+ }
+ }
+
+ // 选中日期样式
+ .el-calendar-table td.is-selected {
+ background-color: #f0f7ff;
+ border: 2px solid #409eff;
+ border-radius: 4px;
+
+ .date-number {
+ font-weight: bold;
+ color: #409eff;
+ }
+ }
}
- .el-calendar-table td.is-selected .events {
- // padding: 2px;
+ // 隐藏按钮组中间按钮
+ .el-button-group > .el-button:not(:first-child):not(:last-child) {
+ display: none;
}
}
</style>
<style lang="scss" scoped>
.calenBox {
- margin-top: 10px;
- height: 546px;
+ margin-top: 17px;
+ height: 630px;
overflow: hidden;
.event-item {
font-size: 12px;
--
Gitblit v1.9.3