From 2b0789112f345da0fc020d5ebd9dc2a5b286298f Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 8 Jul 2024 12:39:49 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E3=80=91AI=EF=BC=9A=E5=86=99=E4=BD=9C=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=9A=84=E5=BB=BA=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ai/writer/index.ts | 4 +- .../conversation/ConversationList.vue | 3 +- src/views/ai/writer/components/Left.vue | 176 +++++++++--------- src/views/ai/writer/components/Right.vue | 88 ++++----- src/views/ai/writer/components/Tag.vue | 27 ++- src/views/ai/writer/index.vue | 92 ++++----- 6 files changed, 201 insertions(+), 189 deletions(-) diff --git a/src/api/ai/writer/index.ts b/src/api/ai/writer/index.ts index 01664b3d..57c23b4f 100644 --- a/src/api/ai/writer/index.ts +++ b/src/api/ai/writer/index.ts @@ -3,7 +3,9 @@ import { fetchEventSource } from '@microsoft/fetch-event-source' import { getAccessToken } from '@/utils/auth' import { config } from '@/config/axios/config' +// TODO @hhhero:可以改成 WriteVO 哈,主要是保持一致 export interface WriteParams { + // TODO @hhhero:注释。每个属性的后面哈。会更简洁一点 /** * 1:撰写 2:回复 */ @@ -33,6 +35,7 @@ export interface WriteParams { */ language: number } + export const writeStream = ({ data, onClose, @@ -46,7 +49,6 @@ export const writeStream = ({ onClose?: (...args: any[]) => void ctrl: AbortController }) => { - // return request.post({ url: '/ai/write/generate-stream', data }) const token = getAccessToken() return fetchEventSource(`${config.base_url}/ai/write/generate-stream`, { method: 'post', diff --git a/src/views/ai/chat/index/components/conversation/ConversationList.vue b/src/views/ai/chat/index/components/conversation/ConversationList.vue index 911f0fbb..6a7e32fa 100644 --- a/src/views/ai/chat/index/components/conversation/ConversationList.vue +++ b/src/views/ai/chat/index/components/conversation/ConversationList.vue @@ -226,7 +226,7 @@ const conversationTimeGroup = async (list: ChatConversationVO[]) => { const threeDays = 3 * oneDay const sevenDays = 7 * oneDay const thirtyDays = 30 * oneDay - for (const conversation: ChatConversationVO of list) { + for (const conversation of list) { // 置顶 if (conversation.pinned) { groupMap['置顶'].push(conversation) @@ -247,7 +247,6 @@ const conversationTimeGroup = async (list: ChatConversationVO[]) => { groupMap['三十天前'].push(conversation) } } - console.log('----groupMap', groupMap) return groupMap } diff --git a/src/views/ai/writer/components/Left.vue b/src/views/ai/writer/components/Left.vue index af808b15..0369d9df 100644 --- a/src/views/ai/writer/components/Left.vue +++ b/src/views/ai/writer/components/Left.vue @@ -1,5 +1,5 @@ diff --git a/src/views/ai/writer/components/Right.vue b/src/views/ai/writer/components/Right.vue index 30b74cdc..94140011 100644 --- a/src/views/ai/writer/components/Right.vue +++ b/src/views/ai/writer/components/Right.vue @@ -35,52 +35,52 @@ diff --git a/src/views/ai/writer/components/Tag.vue b/src/views/ai/writer/components/Tag.vue index 4a32e572..d496b517 100644 --- a/src/views/ai/writer/components/Tag.vue +++ b/src/views/ai/writer/components/Tag.vue @@ -13,20 +13,19 @@ - diff --git a/src/views/ai/writer/index.vue b/src/views/ai/writer/index.vue index 8875830f..27276431 100644 --- a/src/views/ai/writer/index.vue +++ b/src/views/ai/writer/index.vue @@ -1,61 +1,67 @@ +