From 08503590029c52e090ad1c2f83182df8da4866a3 Mon Sep 17 00:00:00 2001 From: Theo <971366405@qq.com> Date: Sun, 1 Sep 2024 01:27:01 +0800 Subject: [PATCH] =?UTF-8?q?wip:=20:construction:=20=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=85=AC=E5=91=8A=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 通知公告开发 --- src/api/notice.ts | 75 ++-- .../NavBar/components/NavbarAction.vue | 2 +- src/views/demo/wang-editor.vue | 8 +- src/views/notice/index.vue | 393 ++++++++++++++++++ src/views/system/notice/index.vue | 312 +++++--------- 5 files changed, 535 insertions(+), 255 deletions(-) create mode 100644 src/views/notice/index.vue diff --git a/src/api/notice.ts b/src/api/notice.ts index cb73bff0..fd33b6e8 100644 --- a/src/api/notice.ts +++ b/src/api/notice.ts @@ -25,7 +25,11 @@ class NoticeAPI { }); } - /** 添加通知公告*/ + /** + * 添加通知公告 + * @param data Notice表单数据 + * @returns + */ static add(data: NoticeForm) { return request({ url: `${NOTICE_BASE_URL}`, @@ -59,63 +63,64 @@ class NoticeAPI { method: "delete", }); } + + /** + * 发布通知 + * + * @param id 被发布的通知公告id + * @returns + */ + static releaseNotice(id: number) { + return request({ + url: `${NOTICE_BASE_URL}/release/${id}`, + method: "patch", + }); + } + + /** + * 撤回通知 + * + * @param id 撤回的通知id + * @returns + */ + static recallNotice(id: number) { + return request({ + url: `${NOTICE_BASE_URL}/recall/${id}`, + method: "patch", + }); + } } export default NoticeAPI; /** 通知公告分页查询参数 */ export interface NoticePageQuery extends PageQuery { - id?: bigint; - /** 通知标题 */ + /** 标题 */ title?: string; - /** 通知内容 */ - content?: string; - /** 通知类型 */ - noticeType?: number; - /** 发布人 */ - releaseBy?: bigint; - /** 优先级(0-低 1-中 2-高) */ - priority?: number; - /** 目标类型(0-全体 1-指定) */ - tarType?: number; /** 发布状态(0-未发布 1已发布 2已撤回) */ sendStatus?: number; - /** 发布时间 */ - sendTime?: [string, string]; - /** 撤回时间 */ - recallTime?: [string, string]; - /** 创建时间 */ - createTime?: Date; - /** 更新时间 */ - updateTime?: Date; } /** 通知公告表单对象 */ export interface NoticeForm { - id?: bigint; + id?: number; /** 通知标题 */ title?: string; /** 通知内容 */ content?: string; /** 通知类型 */ noticeType?: number; - /** 发布人 */ - releaseBy?: bigint; /** 优先级(0-低 1-中 2-高) */ priority?: number; /** 目标类型(0-全体 1-指定) */ tarType?: number; - /** 发布状态(0-未发布 1已发布 2已撤回) */ - sendStatus?: number; - /** 发布时间 */ - sendTime?: Date; - /** 撤回时间 */ - recallTime?: Date; + /** 目标ID合集,以,分割 */ + tarIds?: string; } /** 通知公告分页对象 */ export interface NoticePageVO { - id?: bigint; + id?: string; /** 通知标题 */ title?: string; /** 通知内容 */ @@ -129,13 +134,9 @@ export interface NoticePageVO { /** 目标类型(0-全体 1-指定) */ tarType?: number; /** 发布状态(0-未发布 1已发布 2已撤回) */ - sendStatus?: number; + releaseStatus?: number; /** 发布时间 */ - sendTime?: Date; + releaseTime?: Date; /** 撤回时间 */ recallTime?: Date; - /** 创建时间 */ - createTime?: Date; - /** 更新时间 */ - updateTime?: Date; } diff --git a/src/layout/components/NavBar/components/NavbarAction.vue b/src/layout/components/NavBar/components/NavbarAction.vue index 102995fd..def658a2 100644 --- a/src/layout/components/NavBar/components/NavbarAction.vue +++ b/src/layout/components/NavBar/components/NavbarAction.vue @@ -1,7 +1,7 @@