From ea08f9c81282bbe279e06cd60025b16396ab2018 Mon Sep 17 00:00:00 2001 From: XaoLi717 <144221124+XaoLi717@users.noreply.github.com> Date: Fri, 6 Dec 2024 15:01:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=97=A5=E5=8E=86=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/home/calendar/index.ts | 83 +++++++++++++++-------------- src/utils/dict.ts | 1 + src/views/system/calendar/index.vue | 3 ++ 3 files changed, 46 insertions(+), 41 deletions(-) diff --git a/src/api/home/calendar/index.ts b/src/api/home/calendar/index.ts index 5319be0..e8d144d 100644 --- a/src/api/home/calendar/index.ts +++ b/src/api/home/calendar/index.ts @@ -1,41 +1,42 @@ -import request from '@/config/axios' - -// 工作日历数据 VO -export interface CalendarVO { - id: number // id - date: string // 字符串日期 - isWorkday: number // 是否是节假日 -} - -// 工作日历数据 API -export const CalendarApi = { - // 查询工作日历数据分页 - getCalendarPage: async (params: any) => { - return await request.get({ url: `/home/calendar/page`, params }) - }, - - // 查询工作日历数据详情 - getCalendar: async (id: number) => { - return await request.get({ url: `/home/calendar/get?id=` + id }) - }, - - // 新增工作日历数据 - createCalendar: async (data: CalendarVO) => { - return await request.post({ url: `/home/calendar/create`, data }) - }, - - // 修改工作日历数据 - updateCalendar: async (data: CalendarVO) => { - return await request.put({ url: `/home/calendar/update`, data }) - }, - - // 删除工作日历数据 - deleteCalendar: async (id: number) => { - return await request.delete({ url: `/home/calendar/delete?id=` + id }) - }, - - // 导出工作日历数据 Excel - exportCalendar: async (params) => { - return await request.download({ url: `/home/calendar/export-excel`, params }) - }, -} \ No newline at end of file +import request from '@/config/axios' + +// 工作日历数据 VO +export interface CalendarVO { + id: number // id + date: string // 字符串日期 + isWorkday: number // 是否是节假日 + content: number // 是否是节假日 +} + +// 工作日历数据 API +export const CalendarApi = { + // 查询工作日历数据分页 + getCalendarPage: async (params: any) => { + return await request.get({ url: `/home/calendar/page`, params }) + }, + + // 查询工作日历数据详情 + getCalendar: async (id: number) => { + return await request.get({ url: `/home/calendar/get?id=` + id }) + }, + + // 新增工作日历数据 + createCalendar: async (data: CalendarVO) => { + return await request.post({ url: `/home/calendar/create`, data }) + }, + + // 修改工作日历数据 + updateCalendar: async (data: CalendarVO) => { + return await request.put({ url: `/home/calendar/update`, data }) + }, + + // 删除工作日历数据 + deleteCalendar: async (id: number) => { + return await request.delete({ url: `/home/calendar/delete?id=` + id }) + }, + + // 导出工作日历数据 Excel + exportCalendar: async (params) => { + return await request.download({ url: `/home/calendar/export-excel`, params }) + }, +} diff --git a/src/utils/dict.ts b/src/utils/dict.ts index c3a83c7..04bcc33 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -134,6 +134,7 @@ export enum DICT_TYPE { DRIVER_GENDER = 'driver_Gender', NJGL_STATUS = 'njgl_status', NJGL_DATA_STATUS = 'njgl_data_status', + CALENDAR_CONTENT = 'calendar_content', // ========== SYSTEM 模块 ========== SYSTEM_USER_SEX = 'system_user_sex', diff --git a/src/views/system/calendar/index.vue b/src/views/system/calendar/index.vue index 7b549cc..1aff6e4 100644 --- a/src/views/system/calendar/index.vue +++ b/src/views/system/calendar/index.vue @@ -71,6 +71,7 @@ const queryParamsDate = reactive({ id: undefined, date: [currentYear.value+"-01-01",currentYear.value+"-12-31"],//只获取本年的数据 isWorkday: undefined, + content: undefined, createTime: [], }) @@ -78,6 +79,7 @@ const formDataCaln = ref({ id: undefined, date: undefined, isWorkday: undefined, + content: undefined, }) /** 创建数据 */ @@ -108,6 +110,7 @@ const mapDate = async ()=> { holidayDate.value = list.value.reduce((map, item) => { map[item.date] = { isWorkday: item.isWorkday, + content: item.content, date: item.date, id: item.id }