From 3be2e099bbc05e902dfcfabc403ade0a2aba8ef4 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Mon, 21 Jul 2025 15:12:44 +0800
Subject: [PATCH] feat:数据中心优化

---
 src/views/wel/components/calendarBox.vue |   80 +++++++++++++++++++++++++---------------
 1 files changed, 50 insertions(+), 30 deletions(-)

diff --git a/src/views/wel/components/calendarBox.vue b/src/views/wel/components/calendarBox.vue
index 20ce47e..1fb2eb7 100644
--- a/src/views/wel/components/calendarBox.vue
+++ b/src/views/wel/components/calendarBox.vue
@@ -12,8 +12,8 @@
               :class="event.type"
               @click="jumpcalendar(event, data.day)"
             >
-              <img :src="getEventIcon(event.type)" alt="" />
-              {{ event.name }}<span>{{ event.value }}</span>
+              <div class="imgBox"><img :src="getEventIcon(event.type)" alt="" /> {{ event.name }}</div>
+              <span>{{ event.value }}</span>
             </div>
           </div>
         </div>
@@ -79,7 +79,13 @@
 const getJobEventBar = () => {
   getCalen(params.value).then(res => {
     if (res.data.code !== 0) return;
-    events.value = res.data.data;
+    const a = res.data.data;
+    const filteredData = {};
+    for (let date in a) {
+      filteredData[date] = a[date].filter(item => item.type !== 'work-order');
+    }
+    events.value = filteredData;
+    // events.value = res.data.data
   });
 };
 const jumpcalendar = (event, day) => {
@@ -105,31 +111,54 @@
 </script>
 <style lang="scss">
 .calenBox {
- height: 630px;
-  .el-calendar {
-    height: 100%; // 日历填充容器
+  //  height: 630px;
+  height: pxToVh(660);
+  // 隐藏按钮组中间按钮
+  .el-button-group > .el-button:not(:first-child):not(:last-child) {
+    display: none;
+  }
+  .date-number {
+  font-size: 13px !important;}
+}
+</style>
+
+<style lang="scss" scoped>
+.calenBox {
+  margin-top: 10px;
+  // height: 630px;
+  height: pxToVh(622);
+  border-radius: 10px;
+  overflow: hidden;
+  background-color: #fff;
+
+  ::v-deep(.el-calendar) {
+    // height: 80%; // 日历填充容器
     // 标题样式
-    &__title {
+    .el-calendar__title {
       font-weight: bold;
       font-size: 14px;
       color: #363636;
     }
 
     // 日历主体
-    &__body {
-      height: 98%; // 关键:继承父高度
-      
-      .el-calendar-table {
-        height: 90% !important; // 百分比生效
-      }
-    }
+    // &__body {
+    //   height: 98%; // 关键:继承父高度
 
+    //   .el-calendar-table {
+    //     height: 90% !important; // 百分比生效
+    //   }
+    // }
+    .el-calendar-table .el-calendar-day {
+   
+       height: pxToVh(91) !important;
+    }
+ 
     // 选中日期样式
     .el-calendar-table td.is-selected {
       background-color: #f0f7ff;
       border: 2px solid #409eff;
       border-radius: 4px;
-      
+
       .date-number {
         font-weight: bold;
         color: #409eff;
@@ -137,30 +166,18 @@
     }
   }
 
-  // 隐藏按钮组中间按钮
-  .el-button-group > .el-button:not(:first-child):not(:last-child) {
-    display: none;
-  }
-}
-</style>
-<style lang="scss" scoped>
-.calenBox {
-  margin-top: 17px;
-  height: 630px;
-  overflow: hidden;
   .event-item {
     font-size: 12px;
     // padding: 2px;
-
+    text-align: center;
     border-radius: 3px;
     white-space: nowrap;
-    // overflow: hidden;
-    // text-overflow: ellipsis;
 
     &.work-order {
       font-weight: 400;
       font-size: 12px;
       color: #7b7b7b;
+
       span {
         font-weight: 600;
         font-size: 14px;
@@ -173,13 +190,16 @@
       font-weight: 400;
       font-size: 12px;
       color: #7b7b7b;
+
       span {
         font-weight: 600;
-        font-size: 14px;
+        font-size: 18px;
         color: #029d36;
         margin-left: 2px;
       }
     }
+    .imgBox {
+   font-size: 12px;}
   }
 }
 </style>

--
Gitblit v1.9.3