From 8a228763c7d6cc7e8349345ee13c4f34e7945b8e Mon Sep 17 00:00:00 2001 From: Kven <2955163637@qq.com> Date: Mon, 23 Dec 2024 13:56:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=85=AC=E5=91=8A=E6=A8=A1=E5=9D=97):=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=AC=E5=91=8A=E5=A2=9E=E5=88=A0=E6=94=B9?= =?UTF-8?q?=E6=9F=A5=E5=92=8C=E7=94=A8=E6=88=B7=E5=85=AC=E5=91=8A=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.新增公告增删改查功能 2.新增用户页面公告展示功能 --- src/api/bulletin-mgmt.ts | 105 ++++++ src/api/bulletins.ts | 26 ++ .../bulletin/components/bulletin-edit.vue | 254 +++++++++++++++ .../system/bulletin/components/detail.vue | 148 +++++++++ .../noticeSet => system/bulletin}/index.vue | 301 +++++++++++------- .../user/bulletins/components/detail.vue | 148 +++++++++ .../notice => user/bulletins}/index.vue | 226 +++++-------- 7 files changed, 940 insertions(+), 268 deletions(-) create mode 100644 src/api/bulletin-mgmt.ts create mode 100644 src/api/bulletins.ts create mode 100644 src/views/system/bulletin/components/bulletin-edit.vue create mode 100644 src/views/system/bulletin/components/detail.vue rename src/views/{notification/noticeSet => system/bulletin}/index.vue (59%) create mode 100644 src/views/user/bulletins/components/detail.vue rename src/views/{notification/notice => user/bulletins}/index.vue (53%) diff --git a/src/api/bulletin-mgmt.ts b/src/api/bulletin-mgmt.ts new file mode 100644 index 0000000..39f0c48 --- /dev/null +++ b/src/api/bulletin-mgmt.ts @@ -0,0 +1,105 @@ +import axios from 'axios'; + +export interface BulletinCreateRecord { + title: string; + top: boolean; + content: string; + remark: string; + attachmentIds?: string[]; +} + + +export interface BulletinRecord extends BulletinCreateRecord { + id: number; + state: string; + publishTime: string; + createTime: string; + +} + +export interface BulletinsRecord { + title?: string; + state?: string[]; + publishTimeBegin?: string[]; + publishTimeEnd?: string[]; + total?: number; + current: number; + pages: number; +} + +export interface AttachmentRecord { + type: string; + file: any; +} + + +// 查看详情 +export function queryBulletinListAll(id: number) { + return axios.get(`/api/rest/bulletin/${id}`); +} + +// 分页查询 +export function queryBulletinList(data: BulletinsRecord) { + return axios({ + url: '/api/rest/bulletin', + method: 'get', + params: data, + }); +} + +// 添加公告 +export function create(data: BulletinCreateRecord) { + return axios.post(`/api/rest/bulletin`, data); +} + +// 更新公告 +export function update(data: BulletinRecord) { + return axios.patch(`/api/rest/bulletin/${data.id}`, data); +} + +// 置顶状态 +export function toggle(id: number) { + return axios.patch(`/api/rest/bulletin/${id}/toggle-top`); +} + +// 发布编辑 +export function publish(data: number[]) { + return axios.patch(`/api/rest/bulletin/publish`, data); +} + +// 关闭公告 +export function close(id: number) { + return axios.patch(`/api/rest/bulletin/${id}/toggleClose`); +} + +// 删除公告 +export function remove(id: number) { + return axios.delete(`/api/rest/bulletin/${id}`); +} + +// 添加附件 +export function addAttachments(data: any) { + return axios({ + method: 'post', + url: '/api/rest/attachment', + headers: { + 'Content-Type': 'multipart/form-data', + }, + data, + }) +} + +// 获取附件信息 +export function addAttachment(id: string) { + return axios.get(`/api/rest/attachment/find/${id}`); +} + +// 删除附件 +export function deleteAttachment(id: string) { + return axios.delete(`/api/rest/attachment/delete/${id}`); +} + +// 获取部门树 +export function queryDeptTreeList() { + return axios.get(`/api/deptTree`); +} diff --git a/src/api/bulletins.ts b/src/api/bulletins.ts new file mode 100644 index 0000000..fc1582a --- /dev/null +++ b/src/api/bulletins.ts @@ -0,0 +1,26 @@ +import axios from 'axios'; + +export interface BulletinsRecord { + title?: string; + state?: number[]; + top?: boolean; + publishTimeBegin?: string[]; + publishTimeEnd?: string[]; + total?: number; + size: number; + isRead?: boolean; + current: number; +} + +// 查看详情 +export function queryBulletinsListAll(id: number) { + return axios.get(`/api/rest/bulletin/self/${id}`); +} +// 分页查询 +export function queryBulletinsList(data: BulletinsRecord) { + return axios({ + url: '/api/rest/bulletin/self', + method: 'get', + params: data, + }); +} \ No newline at end of file diff --git a/src/views/system/bulletin/components/bulletin-edit.vue b/src/views/system/bulletin/components/bulletin-edit.vue new file mode 100644 index 0000000..784f5ee --- /dev/null +++ b/src/views/system/bulletin/components/bulletin-edit.vue @@ -0,0 +1,254 @@ + + + + + diff --git a/src/views/system/bulletin/components/detail.vue b/src/views/system/bulletin/components/detail.vue new file mode 100644 index 0000000..1ee0267 --- /dev/null +++ b/src/views/system/bulletin/components/detail.vue @@ -0,0 +1,148 @@ + + + + + + + + diff --git a/src/views/notification/noticeSet/index.vue b/src/views/system/bulletin/index.vue similarity index 59% rename from src/views/notification/noticeSet/index.vue rename to src/views/system/bulletin/index.vue index 9615485..28d83ce 100644 --- a/src/views/notification/noticeSet/index.vue +++ b/src/views/system/bulletin/index.vue @@ -14,55 +14,40 @@ + + + + + - - - - - - - - - - + + @@ -89,14 +74,12 @@ - + + + + 发布 + - - - 导出 - - +
- +
- + -