From f36b494c6a5ad9a11a43e270eb46db855a9adf8f Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Thu, 20 Jun 2024 15:16:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=AB=98=E7=BA=A7=E7=BC=96=E6=8E=92?= =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/api/application.ts | 13 +++- ui/src/components/ai-chat/index.vue | 36 ++++++++--- ui/src/views/application-workflow/index.vue | 4 +- ui/src/views/dataset/DatasetSetting.vue | 67 ++++++++++++--------- ui/src/workflow/index.vue | 9 --- 5 files changed, 78 insertions(+), 51 deletions(-) diff --git a/ui/src/api/application.ts b/ui/src/api/application.ts index f6d5ca303..f37f67937 100644 --- a/ui/src/api/application.ts +++ b/ui/src/api/application.ts @@ -149,6 +149,16 @@ const postChatOpen: (data: ApplicationFormType) => Promise> = (data) return post(`${prefix}/chat/open`, data) } +/** + * 获得工作流临时回话Id + * @param 参数 + +} + */ +const postWorkflowChatOpen: (data: ApplicationFormType) => Promise> = (data) => { + return post(`${prefix}/chat_workflow/open`, data) +} + /** * 正式回话Id * @param 参数 @@ -257,5 +267,6 @@ export default { putChatVote, getApplicationHitTest, getApplicationModel, - putPublishApplication + putPublishApplication, + postWorkflowChatOpen } diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index 56be13c5d..d5d8c7c37 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -371,16 +371,32 @@ function getChartOpenId(chat?: any) { } }) } else { - return applicationApi - .postChatOpen(obj) - .then((res) => { - chartOpenId.value = res.data - chatMessage(chat) - }) - .catch((res) => { - loading.value = false - return Promise.reject(res) - }) + if (obj.type === 'WORK_FLOW') { + const submitObj = { + work_flow: obj.work_flow + } + return applicationApi + .postWorkflowChatOpen(submitObj) + .then((res) => { + chartOpenId.value = res.data + chatMessage(chat) + }) + .catch((res) => { + loading.value = false + return Promise.reject(res) + }) + } else { + return applicationApi + .postChatOpen(obj) + .then((res) => { + chartOpenId.value = res.data + chatMessage(chat) + }) + .catch((res) => { + loading.value = false + return Promise.reject(res) + }) + } } } /** diff --git a/ui/src/views/application-workflow/index.vue b/ui/src/views/application-workflow/index.vue index 89e7b38ae..9e5ed86cd 100644 --- a/ui/src/views/application-workflow/index.vue +++ b/ui/src/views/application-workflow/index.vue @@ -154,8 +154,8 @@ const closeInterval = () => { onMounted(() => { getDetail() - // // 初始化定时任务 - // initInterval() + // 初始化定时任务 + initInterval() }) onBeforeUnmount(() => { diff --git a/ui/src/views/dataset/DatasetSetting.vue b/ui/src/views/dataset/DatasetSetting.vue index 457ec625e..ea57b6eb2 100644 --- a/ui/src/views/dataset/DatasetSetting.vue +++ b/ui/src/views/dataset/DatasetSetting.vue @@ -51,35 +51,44 @@ /> - -

关联应用

- - - - - - {{ item.name }} - - - +
+

关联应用

+ + + +
+
+ + + + + {{ item.name }} +
+
+
+
+
+
保存 diff --git a/ui/src/workflow/index.vue b/ui/src/workflow/index.vue index 6ae4aba82..b5adf710e 100644 --- a/ui/src/workflow/index.vue +++ b/ui/src/workflow/index.vue @@ -591,13 +591,4 @@ defineExpose({ left: 24px; z-index: 2; } -// .lf-dnd-text { -// width: 200px; -// } -// .lf-dnd-shape { -// height: 50px; -// } -// .lf-node-selected { -// border: 1px solid #000; -// }