From 9e628ba59d186f24d6feab5f19f50c3ef935a041 Mon Sep 17 00:00:00 2001 From: hhhero Date: Wed, 10 Jul 2024 00:11:00 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96]AI:=20?= =?UTF-8?q?=E5=86=99=E4=BD=9C=E6=B7=BB=E5=8A=A0=E9=A2=84=E8=A7=88header?= =?UTF-8?q?=EF=BC=8C=E8=B0=83=E6=95=B4=E7=94=9F=E6=88=90=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E5=B8=83=E5=B1=80=EF=BC=8C=E5=B0=86=E5=8F=B3?= =?UTF-8?q?=E8=BE=B9=E9=93=BA=E6=BB=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ai/writer/components/Left.vue | 10 ++- src/views/ai/writer/components/Right.vue | 49 ++++++++--- src/views/ai/writer/index/index.vue | 101 ++++++++++++----------- 3 files changed, 100 insertions(+), 60 deletions(-) diff --git a/src/views/ai/writer/components/Left.vue b/src/views/ai/writer/components/Left.vue index e7851649..b09982b0 100644 --- a/src/views/ai/writer/components/Left.vue +++ b/src/views/ai/writer/components/Left.vue @@ -91,7 +91,7 @@
- 重置 + 重置 生成
@@ -120,8 +120,10 @@ defineProps<{ const emits = defineEmits<{ (e: 'submit', params: Partial) (e: 'example', param: 'write' | 'reply') + (e: 'reset') }>() +/** 点击示例的时候,将定义好的文章作为示例展示出来 **/ const example = (type: 'write' | 'reply') => { formData.value = { ...initData, @@ -129,7 +131,11 @@ const example = (type: 'write' | 'reply') => { } emits('example', type) } - +/** 重置,将表单值作为初选值 **/ +const reset = () => { + formData.value = {...initData} + emits('reset') +} const selectedTab = ref(AiWriteTypeEnum.WRITING) const tabs: { text: string diff --git a/src/views/ai/writer/components/Right.vue b/src/views/ai/writer/components/Right.vue index 4b27ef8c..393a055b 100644 --- a/src/views/ai/writer/components/Right.vue +++ b/src/views/ai/writer/components/Right.vue @@ -1,24 +1,37 @@