From 6e5f681b48fbf793bc24c099843270f7ee51495d Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Fri, 24 May 2024 14:26:11 +0800 Subject: [PATCH] add --- src/views/oa_schedule_calendar/index.vue | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/views/oa_schedule_calendar/index.vue b/src/views/oa_schedule_calendar/index.vue index 583a8fe..04460e2 100644 --- a/src/views/oa_schedule_calendar/index.vue +++ b/src/views/oa_schedule_calendar/index.vue @@ -21,6 +21,7 @@ import { apiOaScheduleLists, apiOaScheduleDetail } from '@/api/oa_schedule' import EditPopup from '../oa_schedule/edit.vue' import DeatilPopup from '../oa_schedule/detail.vue' +import { timeFormat } from '@/utils/util' const now = ref(new Date()) const formData = ref([]) @@ -29,16 +30,6 @@ const showEdit = ref(false) const detailRef = ref(null) const showDetail = ref(false) - -function timeToDay(time) { - const dateTime = new Date(time); - const year = dateTime.getFullYear(); - const month = dateTime.getMonth() + 1; - const day = dateTime.getDate(); - const dateOnlyString = `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`; - return dateOnlyString; -} - function getDatesBetween(startDate, endDate) { const dates = []; let currentDate = new Date(startDate); @@ -47,7 +38,7 @@ function getDatesBetween(startDate, endDate) { currentDate.setDate(currentDate.getDate() + 1); } let list = dates.map(item => { - return timeToDay(item) + return timeFormat(item, 'yyyy-mm-dd'); }) return list } @@ -62,7 +53,6 @@ const calcLaberTime = (time) => { return sum } - // 编辑 const handleEdit = async (data) => { data.id ? showDetail.value = true : showEdit.value = true