feat: 添加文稿版本管理、差异对比高亮和多项功能优化

- 修复AI重写输出过滤(过滤thinking/draft标签)
- 添加文稿保存与版本管理功能
- 新增插入差异功能(差异对比模式)
- 实现版本历史侧边抽屉(DocumentVersionPanel)
- 添加版本对比差异高亮显示
- 调整文稿编辑区高度适应屏幕
- 新增MarkdownEditor组件(暂未启用)
This commit is contained in:
empty
2026-01-09 02:44:13 +08:00
parent 5a22477075
commit e153e10d48
8 changed files with 1547 additions and 5 deletions

View File

@@ -8,18 +8,32 @@
<!-- 左侧面板 -->
<WriterPanel v-if="currentPage === 'writer'" />
<AnalysisPanel v-else-if="currentPage === 'analysis'" />
<DocumentsPanel v-else-if="currentPage === 'documents'" />
<DocumentsPanel
v-else-if="currentPage === 'documents'"
@toggle-version-panel="toggleVersionPanel"
@document-selected="handleDocumentSelected"
/>
<MaterialsPanel v-else-if="currentPage === 'materials'" />
<SettingsPanel v-else-if="currentPage === 'settings'" />
<!-- 右侧主内容区 -->
<MainContent />
<!-- 版本历史面板仅文稿管理页面显示 -->
<DocumentVersionPanel
v-if="currentPage === 'documents'"
:visible="showVersionPanel"
:document-id="selectedDocumentId"
:current-content="selectedDocumentContent"
@close="showVersionPanel = false"
@restore="handleVersionRestore"
/>
</template>
</div>
</template>
<script setup>
import { computed } from 'vue'
import { ref, computed } from 'vue'
import { useAppStore } from './stores/app'
import WriterPanel from './components/WriterPanel.vue'
import AnalysisPanel from './components/AnalysisPanel.vue'
@@ -28,7 +42,33 @@ import MaterialsPanel from './components/MaterialsPanel.vue'
import SettingsPanel from './components/SettingsPanel.vue'
import MainContent from './components/MainContent.vue'
import ComparePanel from './components/ComparePanel.vue'
import DocumentVersionPanel from './components/DocumentVersionPanel.vue'
const appStore = useAppStore()
const currentPage = computed(() => appStore.currentPage)
// 版本历史面板状态
const showVersionPanel = ref(false)
const selectedDocumentId = ref(null)
const selectedDocumentContent = ref('')
// 切换版本面板
const toggleVersionPanel = () => {
showVersionPanel.value = !showVersionPanel.value
}
// 处理文稿选择
const handleDocumentSelected = (doc) => {
selectedDocumentId.value = doc?.id || null
selectedDocumentContent.value = doc?.content || ''
}
// 处理版本恢复
const handleVersionRestore = (content) => {
selectedDocumentContent.value = content
// 刷新 MainContent 显示
if (appStore.currentDocument) {
appStore.currentDocument.content = content
}
}
</script>