From a9d767c67a1bb2792326e07fb5dbef1021ee2a57 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Wed, 7 Aug 2024 11:07:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E6=8F=90=E7=A4=BA=E8=AF=8D=E4=BD=BF=E7=94=A8md?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=BE=93=E5=85=A5=E6=A1=86,=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86=E6=BB=9A=E5=8A=A8=E9=97=AE=E9=A2=98=20(#939)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 4b2213a1719ede21d0d92e61dca3ea7cffa172f7) --- ui/src/workflow/nodes/ai-chat-node/index.vue | 51 ++++++++++++++++--- ui/src/workflow/nodes/base-node/index.vue | 50 ++++++++++++++++-- ui/src/workflow/nodes/question-node/index.vue | 50 +++++++++++++++--- ui/src/workflow/nodes/reply-node/index.vue | 19 ++++++- 4 files changed, 151 insertions(+), 19 deletions(-) diff --git a/ui/src/workflow/nodes/ai-chat-node/index.vue b/ui/src/workflow/nodes/ai-chat-node/index.vue index dc80d08f2..e70865074 100644 --- a/ui/src/workflow/nodes/ai-chat-node/index.vue +++ b/ui/src/workflow/nodes/ai-chat-node/index.vue @@ -115,13 +115,23 @@ - + :preview="false" + :toolbars="[]" + :footers="footers" + > + + - + + + + + { return true } } +const dialogVisible = ref(false) +const cloneContent = ref('') +const footers: any = [null, '=', 0] +function openDialog() { + cloneContent.value = chat_data.value.prompt + dialogVisible.value = true +} +function submitDialog() { + set(props.nodeModel.properties.node_data, 'prompt', cloneContent.value) + dialogVisible.value = false +} const { params: { id } } = app.config.globalProperties.$route as any @@ -266,4 +295,10 @@ onMounted(() => { set(props.nodeModel, 'validate', validate) }) - + diff --git a/ui/src/workflow/nodes/base-node/index.vue b/ui/src/workflow/nodes/base-node/index.vue index 78758516d..38155fa9f 100644 --- a/ui/src/workflow/nodes/base-node/index.vue +++ b/ui/src/workflow/nodes/base-node/index.vue @@ -40,14 +40,32 @@ + class="reply-node-editor" + :footers="footers" + > + + + + + + - + diff --git a/ui/src/workflow/nodes/question-node/index.vue b/ui/src/workflow/nodes/question-node/index.vue index 7d0226138..42e08d748 100644 --- a/ui/src/workflow/nodes/question-node/index.vue +++ b/ui/src/workflow/nodes/question-node/index.vue @@ -116,13 +116,23 @@ - + :preview="false" + :toolbars="[]" + :footers="footers" + > + + + + + + + { return true } } +const dialogVisible = ref(false) +const cloneContent = ref('') +const footers: any = [null, '=', 0] +function openDialog() { + cloneContent.value = form_data.value.prompt + dialogVisible.value = true +} +function submitDialog() { + set(props.nodeModel.properties.node_data, 'prompt', cloneContent.value) + dialogVisible.value = false +} const { params: { id } } = app.config.globalProperties.$route as any @@ -263,4 +293,10 @@ onMounted(() => { set(props.nodeModel, 'validate', validate) }) - + diff --git a/ui/src/workflow/nodes/reply-node/index.vue b/ui/src/workflow/nodes/reply-node/index.vue index 9a234fec1..bbd3c699b 100644 --- a/ui/src/workflow/nodes/reply-node/index.vue +++ b/ui/src/workflow/nodes/reply-node/index.vue @@ -16,7 +16,12 @@ () +const isKeyDown = ref(false) +const wheel = (e: any) => { + if (isKeyDown.value) { + e.preventDefault() + } else { + e.stopPropagation() + return true + } +} const form = { reply_type: 'content', content: '',