无人机管理后台前端(已迁走)
张含笑
2025-07-22 40136e63ea1a8d534fb9fabdfdd523d9fdb9a495
feat:日历样式调整
1 files modified
31 ■■■■ changed files
src/views/wel/components/calendarBox.vue 31 ●●●● patch | view | raw | blame | history
src/views/wel/components/calendarBox.vue
@@ -10,6 +10,7 @@
            :clearable="false"
            :prefix-icon="''"
            @change="handleMonthChange"
            :format="'YYYY年M月'"
          />
          <img :src="caright" alt="" @click="selectDate('next-month')" />
        </div>
@@ -56,11 +57,16 @@
  end_date: undefined,
  start_date: undefined,
});
const formatDate = (date, format = 'YYYY年M月') => {
  return dayjs(date).format(format);
};
const eventIcons = ref({
  'work-order': ev1,
  task: ev2,
});
// 初始化月份范围
const monthRange = getCurrentMonthRange();
params.value = monthRange;
// 检查日期是否是当前月份
const isCurrentMonth = date => {
  return dayjs(date).isSame(dayjs(), 'month');
@@ -124,9 +130,7 @@
    currentMonth.value = dayjs(currentMonth.value).add(1, 'month').toDate();
  }
  // 等待DOM更新
  await nextTick();
  // 强制清除所有选中状态
  const selectedCells = document.querySelectorAll('.el-calendar-table td.is-selected');
  selectedCells.forEach(cell => {
@@ -136,6 +140,7 @@
  // 如果是当前月份才设置选中
  if (isCurrentMonth(currentMonth.value)) {
    selectedDate.value = new Date();
  }
};
@@ -170,11 +175,6 @@
const getEvents = dateString => {
  return events.value[dateString] || [];
};
// 初始化月份范围
const monthRange = getCurrentMonthRange();
params.value = monthRange;
const jumpcalendar = (event, day) => {
  if (event.name === '工单') {
    router.push({
@@ -254,19 +254,6 @@
    margin-right: 5px;
    margin-bottom: 8px;
  }
  // 非选中日期的样式
  .el-calendar-table td:not(.is-selected) {
    .el-calendar-day {
      background: #f5f7fa;
      border: 1px solid #efefef;
      .date-number {
        font-weight: normal;
        color: inherit;
      }
    }
  }
  .el-input__prefix-inner {
    display: none !important;
  }
@@ -290,7 +277,7 @@
  .el-date-editor.el-input__wrapper {
    height: var(--el-input-height, var(--el-component-size));
    width: 150px !important;
    width: 170px !important;
  }
}
</style>