From 25c725c6e8157f7f9b5abd82a2aadfaa285222ac Mon Sep 17 00:00:00 2001 From: ChenZhaoYu <790348264@qq.com> Date: Thu, 23 Feb 2023 11:49:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8D=95=E6=B6=88=E6=81=AF=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E5=92=8C=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/chat/index.ts | 16 ++++++ src/views/chat/components/Message/Text.vue | 61 +++++++++++++++++---- src/views/chat/components/Message/index.vue | 19 ++++++- src/views/chat/index.vue | 36 +++++++++++- 4 files changed, 120 insertions(+), 12 deletions(-) diff --git a/src/store/modules/chat/index.ts b/src/store/modules/chat/index.ts index 9db57d4..203e194 100644 --- a/src/store/modules/chat/index.ts +++ b/src/store/modules/chat/index.ts @@ -110,6 +110,22 @@ export const useChatStore = defineStore('chat-store', { } }, + deleteChatByUuid(uuid: number, index: number) { + if (!uuid || uuid === 0) { + if (this.chat.length) { + this.chat[0].data.splice(index, 1) + this.recordState() + } + return + } + + const chatIndex = this.chat.findIndex(item => item.uuid === uuid) + if (chatIndex !== -1) { + this.chat[chatIndex].data.splice(index, 1) + this.recordState() + } + }, + clearChatByUuid(uuid: number) { if (!uuid || uuid === 0) { if (this.chat.length) { diff --git a/src/views/chat/components/Message/Text.vue b/src/views/chat/components/Message/Text.vue index 23a2ed8..abc881d 100644 --- a/src/views/chat/components/Message/Text.vue +++ b/src/views/chat/components/Message/Text.vue @@ -1,7 +1,9 @@