From 888687237a38de70274f47cbc75d1f5d02e4f8eb Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Tue, 5 Mar 2024 14:59:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=B6=88=E6=81=AF=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2&?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/modules/message/index.ts | 50 +++ .../ms-message/MessageCenterDrawer.vue | 361 ++++++++++++++++++ .../business/ms-message/locale/en-US.ts | 15 + .../business/ms-message/locale/zh-CN.ts | 15 + frontend/src/components/pure/navbar/index.vue | 17 +- 5 files changed, 448 insertions(+), 10 deletions(-) create mode 100644 frontend/src/components/business/ms-message/MessageCenterDrawer.vue create mode 100644 frontend/src/components/business/ms-message/locale/en-US.ts create mode 100644 frontend/src/components/business/ms-message/locale/zh-CN.ts diff --git a/frontend/src/api/modules/message/index.ts b/frontend/src/api/modules/message/index.ts index 71e7701895..44749ac27e 100644 --- a/frontend/src/api/modules/message/index.ts +++ b/frontend/src/api/modules/message/index.ts @@ -1,5 +1,7 @@ import MSR from '@/api/http/index'; +import { CommonList, TableQueryParams } from '@/models/common'; + export interface MessageRecord { id: number; type: string; @@ -11,6 +13,7 @@ export interface MessageRecord { status: 0 | 1; messageType?: number; } + export type MessageListType = MessageRecord[]; export function queryMessageList() { @@ -36,3 +39,50 @@ export interface ChatRecord { export function queryChatList() { return MSR.post({ url: '/api/chat/list' }); } + +interface MessageHistoryQueryParams extends TableQueryParams { + id: number[]; + title: string; + createTime: string; + operator: string; + operation: string; +} + +interface historyQueryParams extends Partial { + type?: string; + receiver?: string; + status?: string; + resourceType?: string; +} + +export interface MessageHistoryItem { + id: number; + type: string; + receiver: string; + subject: string; + status: string; + createTime: string; + operator: string; + operation: string; + resourceId: string; + resourceType: string; + resourceName: string; + content: string; +} + +export function queryMessageHistoryList(data: historyQueryParams) { + return MSR.post>({ url: '/notification/list/all/page', data }); +} + +export interface OptionItem { + id: string; + name: string; +} + +export function queryMessageHistoryCount(data: historyQueryParams) { + return MSR.post({ url: '/notification/count', data }); +} + +export function getMessageReadAll() { + return MSR.get({ url: '/notification/read/all' }); +} diff --git a/frontend/src/components/business/ms-message/MessageCenterDrawer.vue b/frontend/src/components/business/ms-message/MessageCenterDrawer.vue new file mode 100644 index 0000000000..be7da5d6cc --- /dev/null +++ b/frontend/src/components/business/ms-message/MessageCenterDrawer.vue @@ -0,0 +1,361 @@ + + + + + diff --git a/frontend/src/components/business/ms-message/locale/en-US.ts b/frontend/src/components/business/ms-message/locale/en-US.ts new file mode 100644 index 0000000000..5713883468 --- /dev/null +++ b/frontend/src/components/business/ms-message/locale/en-US.ts @@ -0,0 +1,15 @@ +export default { + 'ms.message.management': 'Message management', + 'ms.message.extend': '(Only display internal news within the past 3 months)', + 'ms.message.all': 'All messages', + 'ms.message.bug': 'Bug', + 'ms.message.case': 'Case', + 'ms.message.api': 'Api', + 'ms.message.list.all': 'All', + 'ms.message.list.me': '{var}My', + 'ms.message.list.unRead': 'Unread', + 'ms.message.list.read': 'Read', + 'ms.message.make.as.read': 'Mark all as read', + 'ms.message.notice.title': 'Notification Title', + 'ms.message.me': ' {var}Me', +}; diff --git a/frontend/src/components/business/ms-message/locale/zh-CN.ts b/frontend/src/components/business/ms-message/locale/zh-CN.ts new file mode 100644 index 0000000000..a5043c6eb3 --- /dev/null +++ b/frontend/src/components/business/ms-message/locale/zh-CN.ts @@ -0,0 +1,15 @@ +export default { + 'ms.message.management': '消息管理', + 'ms.message.extend': '(仅展示近3个月内站内消息)', + 'ms.message.all': '全部消息', + 'ms.message.bug': '缺陷管理', + 'ms.message.case': '用例管理', + 'ms.message.api': '接口测试', + 'ms.message.list.all': '全部', + 'ms.message.list.me': '{var}我的', + 'ms.message.list.unRead': '未读', + 'ms.message.list.read': '已读', + 'ms.message.make.as.read': '全部标为已读', + 'ms.message.notice.title': '通知标题', + 'ms.message.me': ' {var}我', +}; diff --git a/frontend/src/components/pure/navbar/index.vue b/frontend/src/components/pure/navbar/index.vue index fdac35960f..2057b83a6c 100644 --- a/frontend/src/components/pure/navbar/index.vue +++ b/frontend/src/components/pure/navbar/index.vue @@ -53,7 +53,7 @@
- + @@ -136,6 +136,7 @@
+