Parcourir la source

样式的修改

695593266@qq.com il y a 9 heures
Parent
commit
da662c0028

+ 2 - 43
src/views/factoryCalendar/components/MultiCalendarView.vue

@@ -79,15 +79,9 @@
           <el-tooltip
             v-for="day in vm.calendarCells"
             :key="day.key"
-            placement="auto"
+            placement="top"
             effect="light"
             :disabled="!day.date"
-            :manual="true"
-            :value="activeTooltipKey === day.key"
-            :enterable="false"
-            :popper-append-to-body="true"
-            :popper-options="tooltipPopperOptions"
-            popper-class="factory-calendar-day-tooltip"
           >
             <div slot="content" class="calendar-tooltip">
               <div>日期类型:{{ vm.getDateTypeText(day) }}</div>
@@ -104,9 +98,7 @@
             <div
               class="calendar-cell"
               :class="vm.getDayClass(day)"
-              @mouseenter="showTooltip(day)"
-              @mouseleave="hideTooltip(day)"
-              @click="openDayDrawer(day)"
+              @click="vm.openDayDrawer(day)"
             >
               <div class="day-head">
                 <span>{{ day.dayText }}</span>
@@ -157,39 +149,6 @@
         type: Object,
         required: true
       }
-    },
-    data() {
-      return {
-        activeTooltipKey: '',
-        tooltipPopperOptions: {
-          modifiers: {
-            preventOverflow: {
-              boundariesElement: 'viewport',
-              padding: 12
-            },
-            flip: {
-              boundariesElement: 'viewport',
-              padding: 12
-            }
-          }
-        }
-      };
-    },
-    methods: {
-      showTooltip(day) {
-        if (day.date) {
-          this.activeTooltipKey = day.key;
-        }
-      },
-      hideTooltip(day) {
-        if (!day || this.activeTooltipKey === day.key) {
-          this.activeTooltipKey = '';
-        }
-      },
-      openDayDrawer(day) {
-        this.hideTooltip(day);
-        this.vm.openDayDrawer(day);
-      }
     }
   };
 </script>

+ 2 - 35
src/views/factoryCalendar/components/factoryCalendar.scss

@@ -4000,42 +4000,9 @@
     }
   }
 
-  @at-root body .factory-calendar-day-tooltip {
-    max-width: min(360px, calc(100vw - 32px));
-    max-height: calc(100vh - 32px);
-    padding: 0;
-    border: 1px solid #d8e6f7;
-    border-radius: 8px;
-    box-shadow: 0 16px 36px rgba(31, 45, 61, 0.18);
-    overflow: auto;
-
-    .popper__arrow {
-      border-top-color: #d8e6f7 !important;
-      border-bottom-color: #d8e6f7 !important;
-    }
-  }
-
-  @at-root body .factory-calendar-day-tooltip .calendar-tooltip {
-    min-width: 260px;
-    padding: 12px 14px;
+  .calendar-tooltip {
+    line-height: 24px;
     color: #303133;
-    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
-    border-radius: 8px;
-    line-height: 22px;
-  }
-
-  @at-root body .factory-calendar-day-tooltip .calendar-tooltip > div {
-    padding: 7px 10px;
-    border-radius: 6px;
-    background: rgba(236, 246, 255, 0.68);
-    color: #2f3a4a;
-    font-size: 13px;
-    font-weight: 600;
-    word-break: break-word;
-  }
-
-  @at-root body .factory-calendar-day-tooltip .calendar-tooltip > div + div {
-    margin-top: 6px;
   }
 
   .plan-tooltip {

+ 2 - 125
src/views/home/index.vue

@@ -263,13 +263,10 @@
                   v-for="day in calendarCells"
                   :key="day.key"
                   :disabled="!day.date"
-                  placement="auto"
+                  placement="bottom-start"
                   effect="light"
                   popper-class="calendar-day-tooltip"
-                  :popper-append-to-body="true"
-                  :popper-options="calendarTooltipPopperOptions"
-                  :manual="true"
-                  :value="activeCalendarTooltipKey === day.key"
+                  :popper-append-to-body="false"
                   :open-delay="120"
                   :hide-after="0"
                   :enterable="false"
@@ -307,8 +304,6 @@
                   <div
                     class="calendar-cell"
                     :class="getCalendarDayClass(day)"
-                    @mouseenter="showCalendarTooltip(day)"
-                    @mouseleave="hideCalendarTooltip(day)"
                     @click="day.date && openCalendarDayDrawer(day)"
                   >
                     <div v-if="day.date" class="day-head">
@@ -549,19 +544,6 @@
         hasMore: true,
         portals: [],
         selectedCalendarType: 1,
-        activeCalendarTooltipKey: '',
-        calendarTooltipPopperOptions: {
-          modifiers: {
-            preventOverflow: {
-              boundariesElement: 'viewport',
-              padding: 12
-            },
-            flip: {
-              boundariesElement: 'viewport',
-              padding: 12
-            }
-          }
-        },
         calendarTypeOptions: [
           { label: '标准生产日历', shortLabel: '标准生产', value: 1 },
           { label: '设备维护日历', shortLabel: '设备维护', value: 2 },
@@ -819,21 +801,10 @@
       console.log('day~~~', day);
       this.selectedScheduleDate = day;
     },
-    showCalendarTooltip(day) {
-      if (day.date) {
-        this.activeCalendarTooltipKey = day.key;
-      }
-    },
-    hideCalendarTooltip(day) {
-      if (!day || this.activeCalendarTooltipKey === day.key) {
-        this.activeCalendarTooltipKey = '';
-      }
-    },
     openCalendarDayDrawer(day) {
       if (!day || !day.date) {
         return;
       }
-      this.hideCalendarTooltip(day);
       this.handleDateClick(day.date);
       this.currentDay = {
         ...day,
@@ -2867,97 +2838,3 @@
     }
   }
 </style>
-
-<style lang="scss">
-  body .calendar-day-tooltip {
-    max-width: min(360px, calc(100vw - 32px));
-    max-height: calc(100vh - 32px);
-    padding: 0;
-    border: 1px solid #d8e6f7;
-    border-radius: 8px;
-    box-shadow: 0 16px 36px rgba(31, 45, 61, 0.18);
-    overflow: auto;
-
-    .popper__arrow {
-      border-top-color: #d8e6f7 !important;
-      border-bottom-color: #d8e6f7 !important;
-    }
-  }
-
-  body .calendar-day-tooltip .calendar-tooltip-content {
-    min-width: 270px;
-    max-width: 340px;
-    padding: 12px 14px;
-    color: #303133;
-    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
-    border-radius: 8px;
-  }
-
-  body .calendar-day-tooltip .tooltip-head {
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    gap: 12px;
-    margin-bottom: 10px;
-    padding-bottom: 8px;
-    border-bottom: 1px solid #e6eef8;
-
-    strong {
-      color: #1f3d66;
-      font-size: 15px;
-      line-height: 20px;
-      font-weight: 700;
-    }
-
-    span {
-      height: 20px;
-      padding: 0 8px;
-      border-radius: 10px;
-      background: #fff1f0;
-      color: #f5222d;
-      font-size: 12px;
-      font-weight: 700;
-      line-height: 20px;
-    }
-  }
-
-  body .calendar-day-tooltip .tooltip-row {
-    display: grid;
-    grid-template-columns: 72px minmax(0, 1fr);
-    gap: 10px;
-    align-items: start;
-    margin-top: 7px;
-    padding: 6px 8px;
-    border-radius: 6px;
-    background: rgba(236, 246, 255, 0.68);
-    font-size: 13px;
-    line-height: 20px;
-
-    span {
-      color: #7b8794;
-    }
-
-    strong {
-      color: #2f3a4a;
-      font-weight: 600;
-      word-break: break-word;
-    }
-  }
-
-  body .calendar-day-tooltip .tooltip-stats {
-    display: flex;
-    flex-wrap: wrap;
-    gap: 8px;
-    margin-top: 12px;
-
-    span {
-      padding: 3px 9px;
-      border-radius: 12px;
-      background: #edf5ff;
-      color: #1f66c2;
-      font-size: 12px;
-      font-weight: 700;
-      line-height: 18px;
-    }
-  }
-</style>