diff --git a/src/api/community/activity/index.ts b/src/api/community/activity/index.ts new file mode 100644 index 0000000..641e76c --- /dev/null +++ b/src/api/community/activity/index.ts @@ -0,0 +1,98 @@ +import request from '@/config/axios' + +/** 小区活动信息 */ +export interface Activity { + id?: number + title?: string + content?: string + coverImage?: string + bannerImages?: string[] + serviceCategories?: number[] + serviceTargets?: number[] + registrationStartTime?: number + registrationEndTime?: number + activityStartTime?: number + activityEndTime?: number + location?: string + maxParticipants?: number + contactPerson?: string + contactPhone?: string + currentParticipants?: number + status?: number + viewCount?: number + isDisplay?: boolean + communityIds?: number[] + communityNames?: string[] + createTime?: string +} + +/** 小区活动报名记录 */ +export interface ActivityRegistration { + id?: number + activityId?: number + memberId?: number + memberName?: string + memberPhone?: string + registrationTime?: string + status?: number + remark?: string + createTime?: string +} + +// 小区活动 API +export const ActivityApi = { + // 查询小区活动分页 + getActivityPage: async (params: any) => { + return await request.get({ url: `/community/activity/page`, params }) + }, + + // 查询小区活动详情 + getActivity: async (id: number) => { + return await request.get({ url: `/community/activity/get?id=` + id }) + }, + + // 新增小区活动 + createActivity: async (data: Activity) => { + return await request.post({ url: `/community/activity/create`, data }) + }, + + // 修改小区活动 + updateActivity: async (data: Activity) => { + return await request.put({ url: `/community/activity/update`, data }) + }, + + // 删除小区活动 + deleteActivity: async (id: number) => { + return await request.delete({ url: `/community/activity/delete?id=` + id }) + }, + + /** 批量删除小区活动 */ + deleteActivityList: async (ids: number[]) => { + return await request.delete({ url: `/community/activity/delete-list?ids=${ids.join(',')}` }) + }, + + // 导出小区活动 Excel + exportActivity: async (params) => { + return await request.download({ url: `/community/activity/export-excel`, params }) + }, + + // 发布小区活动 + publishActivity: async (id: number) => { + return await request.put({ url: `/community/activity/publish?id=` + id }) + }, + + // 撤回小区活动 + revokeActivity: async (id: number) => { + return await request.put({ url: `/community/activity/revoke?id=` + id }) + }, + + // 查询活动报名记录分页 + getRegistrationPage: async (params: any) => { + return await request.get({ url: `/community/activity/registration/page`, params }) + }, + + // 审核报名 + auditRegistration: async (id: number, status: number) => { + return await request.put({ url: `/community/activity/registration/audit?id=` + id + `&status=` + status }) + } +} diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 52a31ea..177dbe4 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -214,4 +214,8 @@ export enum DICT_TYPE { COMM_POST_END_TYPE = 'comm_post_end_type', COMM_KNOWLEDGE_CLASS_TYPE = 'comm_knowledge_class_type', + + COMM_ACTIVITY_STATUS = 'comm_activity_status', + COMM_ACTIVITY_SERVICE_TARGET = 'comm_activity_service_target', + COMM_ACTIVITY_SERVICE_CATEGORY = 'comm_activity_service_category', } diff --git a/src/views/community/activity/ActivityForm.vue b/src/views/community/activity/ActivityForm.vue new file mode 100644 index 0000000..aa1ede0 --- /dev/null +++ b/src/views/community/activity/ActivityForm.vue @@ -0,0 +1,349 @@ + + + diff --git a/src/views/community/activity/RegistrationDialog.vue b/src/views/community/activity/RegistrationDialog.vue new file mode 100644 index 0000000..ea6998c --- /dev/null +++ b/src/views/community/activity/RegistrationDialog.vue @@ -0,0 +1,121 @@ + + + diff --git a/src/views/community/activity/index.vue b/src/views/community/activity/index.vue new file mode 100644 index 0000000..77c877d --- /dev/null +++ b/src/views/community/activity/index.vue @@ -0,0 +1,329 @@ + + +