From 13360113efe30b6d0eebd6f8c94039d5a0c65ef5 Mon Sep 17 00:00:00 2001
From: Kven <2955163637@qq.com>
Date: Wed, 26 Mar 2025 21:19:40 +0800
Subject: [PATCH] =?UTF-8?q?feat(message):=20=E4=BC=98=E5=8C=96=E6=B6=88?=
=?UTF-8?q?=E6=81=AF=E9=80=9A=E7=9F=A5=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修改标题为"IOT设备管理系统"
- 优化消息通知组件,增加未读消息数量显示- 添加消息详情查看功能
- 更新消息列表展示,增加操作按钮
- 调整消息接口路径
---
index.html | 2 +-
src/api/message.ts | 39 --------------
src/api/messages.ts | 2 +-
src/components/message-box/list.vue | 5 +-
src/components/navbar/index.vue | 25 ++++++++-
src/views/notification/notice/index.vue | 59 ++++++++++++++++++---
src/views/system/log/index.vue | 8 +--
src/views/user/messages/index.vue | 69 +++++++++++++++++++++----
8 files changed, 144 insertions(+), 65 deletions(-)
delete mode 100644 src/api/message.ts
diff --git a/index.html b/index.html
index 15de931..67403fb 100644
--- a/index.html
+++ b/index.html
@@ -8,7 +8,7 @@
href="https://unpkg.byted-static.com/latest/byted/arco-config/assets/favicon.ico"
/>
-
基于MQTT的IOT设备管理系统
+ IOT设备管理系统
diff --git a/src/api/message.ts b/src/api/message.ts
deleted file mode 100644
index ff4cbd2..0000000
--- a/src/api/message.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import axios from 'axios';
-
-export interface MessageRecord {
- id: number;
- type: string;
- title: string;
- subTitle: string;
- avatar?: string;
- content: string;
- time: string;
- status: 0 | 1;
- messageType?: number;
-}
-export type MessageListType = MessageRecord[];
-
-export function queryMessageList() {
- return axios.post('/api/message/list');
-}
-
-interface MessageStatus {
- ids: string[];
-}
-
-// 批量设置消息已读
-export function setMessageStatus(data: MessageStatus) {
- return axios.post('/api/message/read', data);
-}
-
-export interface ChatRecord {
- id: number;
- username: string;
- content: string;
- time: string;
- isCollect: boolean;
-}
-
-export function queryChatList() {
- return axios.post('/api/chat/list');
-}
diff --git a/src/api/messages.ts b/src/api/messages.ts
index 238fda0..76e686d 100644
--- a/src/api/messages.ts
+++ b/src/api/messages.ts
@@ -68,7 +68,7 @@ export function queryMessagesList(data: MessagesRecord) {
}
// 未读消息数量
export function queryMessagesCount() {
- return axios.get('/api/rest/notice/count-unread');
+ return axios.get('/api/rest/notice/countUnread');
}
// 已读消息数量
diff --git a/src/components/message-box/list.vue b/src/components/message-box/list.vue
index 9106e71..a5671b3 100644
--- a/src/components/message-box/list.vue
+++ b/src/components/message-box/list.vue
@@ -69,12 +69,11 @@