From 25c027f3d8e9bb59fef1d419406efadf19c71017 Mon Sep 17 00:00:00 2001 From: Kven <2955163637@qq.com> Date: Mon, 23 Jun 2025 21:25:52 +0800 Subject: [PATCH] =?UTF-8?q?refactor(@vben/web-antd):=20=E4=BC=98=E5=8C=96w?= =?UTF-8?q?ord=E6=A8=A1=E5=9D=97=E7=B1=BB=E5=9E=8B=E6=8E=A8=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -修复了一些类型定义和数据结构的问题 --- apps/web-antd/package.json | 3 ++ apps/web-antd/src/api/core/chatflow.ts | 49 ++++++++++++++---- .../views/word/components/word-list-view.vue | 21 +++++--- .../views/word/components/word-work-view.vue | 29 +++++------ apps/web-antd/src/views/word/index.vue | 38 ++++++++------ apps/web-antd/src/views/word/typing.ts | 51 ++++++++++++++++--- .../src/views/workflow/modules/form.vue | 12 ++--- apps/web-antd/src/views/workflow/typing.ts | 15 ++++++ pnpm-lock.yaml | 22 ++++++++ 9 files changed, 176 insertions(+), 64 deletions(-) create mode 100644 apps/web-antd/src/views/workflow/typing.ts diff --git a/apps/web-antd/package.json b/apps/web-antd/package.json index e74c3af..d2ec890 100644 --- a/apps/web-antd/package.json +++ b/apps/web-antd/package.json @@ -52,5 +52,8 @@ "pinia": "catalog:", "vue": "catalog:", "vue-router": "catalog:" + }, + "devDependencies": { + "@types/markdown-it": "^14.1.2" } } diff --git a/apps/web-antd/src/api/core/chatflow.ts b/apps/web-antd/src/api/core/chatflow.ts index e26edd1..172ee2f 100644 --- a/apps/web-antd/src/api/core/chatflow.ts +++ b/apps/web-antd/src/api/core/chatflow.ts @@ -24,15 +24,21 @@ export namespace ChatflowApi { } export interface ChatListResult { - id: string; - name: string; - inputs: { - [key: string]: any; - }; - status: string; - introduction: string; - createAt: string; - updatedAt: string; + data: [ + { + createAt: string; + id: string; + inputs: { + [key: string]: any; + }; + introduction: string; + name: string; + status: string; + updatedAt: string; + }, + ]; + limit: number; + hasMore: boolean; } export interface deleteParams { @@ -47,6 +53,24 @@ export namespace ChatflowApi { firstId: string; limit: string; } + + export interface ChatMessageResult { + data: [ + { + answer: string; + conversationId: string; + createdAt: string; + id: string; + inputs: { + [key: string]: any; + }; + messageFiles: []; + query: string; + }, + ]; + limit: number; + hasMore: boolean; + } } // 聊天流 @@ -69,7 +93,7 @@ export async function getChatList( const url = params.appid ? `/v1/chat/conversations/${params.appid}` : '/v1/chat/conversations/'; - return requestClient.request(url, { + return requestClient.request(url, { data, method: 'POST', }); @@ -95,5 +119,8 @@ export function getChatflowMessage( appId: string, data: ChatflowApi.ChatMessageParams, ) { - return requestClient.post(`/v1/chat/messages/${appId}`, data); + return requestClient.post( + `/v1/chat/messages/${appId}`, + data, + ); } diff --git a/apps/web-antd/src/views/word/components/word-list-view.vue b/apps/web-antd/src/views/word/components/word-list-view.vue index 8441d78..f381b3b 100644 --- a/apps/web-antd/src/views/word/components/word-list-view.vue +++ b/apps/web-antd/src/views/word/components/word-list-view.vue @@ -1,12 +1,11 @@