From 28c8b74e7bb06b630f0c9742dd03d3113531f736 Mon Sep 17 00:00:00 2001 From: empty Date: Thu, 8 Jan 2026 10:26:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=BC=BA'=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E5=88=B0=E5=86=99=E4=BD=9C'=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=88=86=E6=9E=90=E7=BB=93=E6=9E=9C=E4=B8=8E?= =?UTF-8?q?=E6=A1=88=E4=BE=8B=E7=9A=84=E8=87=AA=E5=8A=A8=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MainContent.vue | 16 ++++++++++++++-- src/stores/app.js | 21 ++++++++++++++++----- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/components/MainContent.vue b/src/components/MainContent.vue index 4a874da..9b11d40 100644 --- a/src/components/MainContent.vue +++ b/src/components/MainContent.vue @@ -239,13 +239,25 @@ const copyAnalysis = () => { // 应用到写作 const applyToWriting = () => { if (analysisResult.value) { + // 1. 将原文添加为参考案例 + appStore.addReferenceFromAnalysis( + `参考范文_${analysisResult.value.paradigm}`, + appStore.analysisText + ) + + // 2. 将风格分析结果应用到自定义要求中 + appStore.customConstraint = `请模仿以下风格分析进行创作:\n${analysisResult.value.analysis}` + + // 3. 应用范式预设(可选,如果有匹配的预设) const paradigm = getParadigmDetails() if (paradigm) { inputTask.value = paradigm.prompt selectedTags.value = [...paradigm.constraints] - appStore.switchPage('writer') - alert(`已应用"${paradigm.name}"到写作任务`) } + + // 4. 切换页面 + appStore.switchPage('writer') + alert(`已将分析结果及原文应用到写作工坊`) } } diff --git a/src/stores/app.js b/src/stores/app.js index c44ab9d..b9c0ad4 100644 --- a/src/stores/app.js +++ b/src/stores/app.js @@ -26,18 +26,27 @@ export const useAppStore = defineStore('app', () => { const analysisText = ref('') const analysisResult = ref(null) const isAnalyzing = ref(false) - + const styleAnalysis = ref('') // 存储具体的风格分析内容 + // UI状态 const showPromptDebug = ref(false) const showRefInput = ref(false) const newRefTitle = ref('') const newRefContent = ref('') - + + // 方法 + const addReferenceFromAnalysis = (title, content) => { + references.value.push({ + title: title || `参考范文_${new Date().toLocaleDateString()}`, + content: content + }) + } + // 切换页面 const switchPage = (page) => { currentPage.value = page } - + return { // 状态 currentPage, @@ -52,12 +61,14 @@ export const useAppStore = defineStore('app', () => { analysisText, analysisResult, isAnalyzing, + styleAnalysis, showPromptDebug, showRefInput, newRefTitle, newRefContent, - + // 方法 - switchPage + switchPage, + addReferenceFromAnalysis } })