diff --git a/src/api/community/notice/index.ts b/src/api/community/notice/index.ts new file mode 100644 index 0000000..bbfa9d1 --- /dev/null +++ b/src/api/community/notice/index.ts @@ -0,0 +1,59 @@ +import request from '@/config/axios' +import type {Dayjs} from 'dayjs'; + +/** 通知公告信息 */ +export interface Notice { + id: number; // 通知编号 + title?: string; // 公告标题 + content?: string; // 公告内容 + publisher?: string; // 发布方 + attachments?: string; // 附件URL列表 + publishType?: number; // 发布类型(1-立即发布,2-定时发布) + publishTime?: string; // 发布时间(毫秒时间戳) + endType?: number; // 结束类型(1-长期有效,2-定时结束) + endTime?: string; // 结束时间(毫秒时间戳) + pushEnabled?: boolean; // 是否消息推送 + status?: number; // 状态(0-草稿,1-已发布,2-已过期,3-已撤回) + viewCount?: number; // 浏览次数 + communityIds?: number[]; // 小区ID列表(发布范围) + communityNames?: string[]; // 小区名称列表 + createTime?: string; // 创建时间(毫秒时间戳) + } + +// 通知公告 API +export const NoticeApi = { + // 查询通知公告分页 + getNoticePage: async (params: any) => { + return await request.get({ url: `/community/notice/page`, params }) + }, + + // 查询通知公告详情 + getNotice: async (id: number) => { + return await request.get({ url: `/community/notice/get?id=` + id }) + }, + + // 新增通知公告 + createNotice: async (data: Notice) => { + return await request.post({ url: `/community/notice/create`, data }) + }, + + // 修改通知公告 + updateNotice: async (data: Notice) => { + return await request.put({ url: `/community/notice/update`, data }) + }, + + // 删除通知公告 + deleteNotice: async (id: number) => { + return await request.delete({ url: `/community/notice/delete?id=` + id }) + }, + + /** 批量删除通知公告 */ + deleteNoticeList: async (ids: number[]) => { + return await request.delete({ url: `/community/notice/delete-list?ids=${ids.join(',')}` }) + }, + + // 导出通知公告 Excel + exportNotice: async (params) => { + return await request.download({ url: `/community/notice/export-excel`, params }) + } +} diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 981a68b..45a4b6d 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -203,5 +203,8 @@ export enum DICT_TYPE { COMM_RELATION_TYPE = 'comm_relation_type', COMM_ID_TYPE = 'comm_id_type', COMM_BANNER_LOCATION = 'comm_banner_location', - COMM_MINI_APP_LOCATION = 'comm_mini_app_location' + COMM_MINI_APP_LOCATION = 'comm_mini_app_location', + COMM_NOTICE_PUBLISH_TYPE = 'comm_notice_publish_type', + COMM_NOTICE_END_TYPE = 'comm_notice_end_type', + COMM_NOTICE_STATUS = 'comm_notice_status', } diff --git a/src/views/community/notice/NoticeForm.vue b/src/views/community/notice/NoticeForm.vue new file mode 100644 index 0000000..ecafeea --- /dev/null +++ b/src/views/community/notice/NoticeForm.vue @@ -0,0 +1,230 @@ + + + diff --git a/src/views/community/notice/index.vue b/src/views/community/notice/index.vue new file mode 100644 index 0000000..ce54db7 --- /dev/null +++ b/src/views/community/notice/index.vue @@ -0,0 +1,326 @@ + + +