diff --git a/src/api/calendar/Calendar.ts b/src/api/calendar/Calendar.ts index 38be445c2..d9328e63d 100644 --- a/src/api/calendar/Calendar.ts +++ b/src/api/calendar/Calendar.ts @@ -7,6 +7,7 @@ export interface dateBase { isCurrent: boolean; title: number; isHolidays: boolean; + isWorks: boolean; date: string; lunars: string; lunarsChina: string; @@ -90,6 +91,7 @@ class Calendar { title: w - i, isCurrent: false, isHolidays: DateClass.getHolidays([y, m, w - i]), + isWorks: DateClass.getWorks([y, m, w - i]), date: `${y}-${clockFactory(m)}-${clockFactory(w - i)}`, lunars: lun, lunarsChinese: @@ -100,7 +102,8 @@ class Calendar { lunarDay: DateClass.getlunarDay(Number(l[0]), Number(l[1]), Number(l[2])), animal: DateClass.getAnimal(Number(l[0])), astro: DateClass.toAstro(y, m, w - i), - term: getTerm(Number(l[0]), m, w - i) + term: getTerm(Number(l[0]), m, w - i), + }); } return arr; @@ -112,7 +115,6 @@ class Calendar { const arr: dateBase[] = []; const y = date[1] === 12 ? date[0] + 1 : date[0]; const m = date[1] === 12 ? 1 : date[1] + 1; - for (let i = 1; i < 42 - day.length + 1; i++) { const lun = DateClass.getLunars(y, m, i); const l = lun.split('-'); @@ -120,6 +122,7 @@ class Calendar { title: i, isCurrent: false, isHolidays: DateClass.getHolidays([y, m, i]), + isWorks: DateClass.getWorks([y, m, i]), date: `${y}-${clockFactory(m)}-${clockFactory(i)}`, lunars: lun, lunarsChinese: @@ -145,6 +148,7 @@ class Calendar { title: i, isCurrent: true, isHolidays: DateClass.getHolidays([date[0], date[1], i]), + isWorks: DateClass.getWorks([date[0], date[1], i]), date: `${date[0]}-${clockFactory(date[1])}-${clockFactory(i)}`, lunars: lun, lunarsChinese: @@ -183,6 +187,7 @@ class Calendar { for (let row = 0; row < 6; row++) { dateArray.push(params.splice(0, 7)); } + console.log("日历数据",dateArray) return dateArray; } } diff --git a/src/api/calendar/DateClass.ts b/src/api/calendar/DateClass.ts index 9d0714507..32daf75c3 100644 --- a/src/api/calendar/DateClass.ts +++ b/src/api/calendar/DateClass.ts @@ -32,6 +32,18 @@ class DateClass { config.Holidays.indexOf(`${date[0]}${clockFactory(date[1])}${clockFactory(date[2])}`) > -1 ); + } + getWorks(date: number[]) { + console.log("日清杀杀杀",`${date[0]}${clockFactory(date[1])}${clockFactory(date[2])}`) + console.log("日清杀杀杀--》",config.Works.indexOf(`${date[0]}${clockFactory(date[1])}${clockFactory(date[2])}`)) + console.log("日清杀杀杀--》",( + config.Works.indexOf(`${date[0]}${clockFactory(date[1])}${clockFactory(date[2])}`) > + -1 + )) + return ( + config.Works.indexOf(`${date[0]}${clockFactory(date[1])}${clockFactory(date[2])}`) > + -1 + ); } /** * 获取公历月份天数 @@ -306,8 +318,8 @@ class DateClass { console.log("计算时间--0--》",y,m,d,t) switch(t){ case 2: - let startWeek = this.getMonday(y,m,d,'s',0) - let endWeek = this.getMonday(y,m,d,'e',0) + let startWeek = this.getMonday(y,m,d,'s',-1) + let endWeek = this.getMonday(y,m,d,'e',-1) return { start:startWeek, end:endWeek @@ -354,7 +366,7 @@ class DateClass { /** @ 作者: 秦东 @ 时间: 2024-07-12 13:48:55 - @ 功能: 获取周 + @ 功能: 任意日期获取周 */ getMonday = (year: number, month: number, taday: number,type: any, dates: any) => { // let now = new Date(); @@ -396,6 +408,9 @@ class DateClass { let days = y + "-" + m + "-" + d; return [y, m, d]; } + + //获得上周的开始日期 + // getLastWeekStartDate() } export default new DateClass(); diff --git a/src/api/calendar/config.ts b/src/api/calendar/config.ts index 911138f2e..eacc07ee3 100644 --- a/src/api/calendar/config.ts +++ b/src/api/calendar/config.ts @@ -132,6 +132,38 @@ export default { '20230125', '20230126', '20230127', + '20231230', + '20240101', + '20240210', + '20240210', + '20240211', + '20240212', + '20240213', + '20240214', + '20240215', + '20240216', + '20240217', + '20240404', + '20240405', + '20240406', + '20240501', + '20240502', + '20240503', + '20240504', + '20240505', + '20240608', + '20240609', + '20240610', + '20240915', + '20240916', + '20240917', + '20241001', + '20241002', + '20241003', + '20241004', + '20241005', + '20241006', + '20241007', ], /** * 补休日期 @@ -165,5 +197,13 @@ export default { '20220507', '20221008', '20221009', + '20240204', + '20240218', + '20240407', + '20240428', + '20240511', + '20240914', + '20240929', + '20241012', ], }; diff --git a/src/components/DesignForm/app/calendar/calendar1/calendarItem.vue b/src/components/DesignForm/app/calendar/calendar1/calendarItem.vue new file mode 100644 index 000000000..dc6185c40 --- /dev/null +++ b/src/components/DesignForm/app/calendar/calendar1/calendarItem.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/components/DesignForm/app/calendar/calendar1/calendarPage.vue b/src/components/DesignForm/app/calendar/calendar1/calendarPage.vue index 1e8d12e56..ac5998962 100644 --- a/src/components/DesignForm/app/calendar/calendar1/calendarPage.vue +++ b/src/components/DesignForm/app/calendar/calendar1/calendarPage.vue @@ -5,6 +5,13 @@ --> @@ -102,7 +168,7 @@ const forwardTime = () =>{ } } .weekNumber{ - + } } diff --git a/src/components/DesignForm/app/calendar/calendar1/dayPage.vue b/src/components/DesignForm/app/calendar/calendar1/dayPage.vue new file mode 100644 index 000000000..b6fcd3707 --- /dev/null +++ b/src/components/DesignForm/app/calendar/calendar1/dayPage.vue @@ -0,0 +1,24 @@ + + + + diff --git a/src/components/DesignForm/app/calendar/calendar1/monthPage.vue b/src/components/DesignForm/app/calendar/calendar1/monthPage.vue new file mode 100644 index 000000000..07cf93f8d --- /dev/null +++ b/src/components/DesignForm/app/calendar/calendar1/monthPage.vue @@ -0,0 +1,122 @@ + + + + diff --git a/src/components/DesignForm/app/calendar/calendar1/weekPage.vue b/src/components/DesignForm/app/calendar/calendar1/weekPage.vue new file mode 100644 index 000000000..ed4b4445c --- /dev/null +++ b/src/components/DesignForm/app/calendar/calendar1/weekPage.vue @@ -0,0 +1,24 @@ + + + + diff --git a/src/components/DesignForm/app/calendarPage.vue b/src/components/DesignForm/app/calendarPage.vue index ab14dd546..2de7a0c0f 100644 --- a/src/components/DesignForm/app/calendarPage.vue +++ b/src/components/DesignForm/app/calendarPage.vue @@ -25,7 +25,7 @@ let timek = new Date()