refactor: 按功能分类重组 components 目录结构
This commit is contained in:
53
README.md
53
README.md
@@ -95,34 +95,49 @@ AI 集成:
|
|||||||
|
|
||||||
```
|
```
|
||||||
src/
|
src/
|
||||||
├── components/ # Vue 组件 (20+)
|
├── components/ # Vue 组件 (按功能分类)
|
||||||
│ ├── 核心面板
|
│ ├── base/ # 基础 UI 组件
|
||||||
|
│ │ ├── BaseButton.vue
|
||||||
|
│ │ ├── BaseIcon.vue
|
||||||
|
│ │ ├── BaseInput.vue
|
||||||
|
│ │ └── BaseModal.vue
|
||||||
|
│ ├── layout/ # 布局组件
|
||||||
|
│ │ ├── GlobalSidebar.vue # 侧边导航
|
||||||
|
│ │ └── HomePage.vue # 首页
|
||||||
|
│ ├── panels/ # 功能面板 (核心)
|
||||||
│ │ ├── WriterPanel.vue # AI 写作
|
│ │ ├── WriterPanel.vue # AI 写作
|
||||||
│ │ ├── AnalysisPanel.vue # 范式库
|
│ │ ├── MimicWriterPanel.vue # 以稿写稿
|
||||||
│ │ ├── ParadigmWriterPanel.vue # 范式写作
|
│ │ ├── ParadigmWriterPanel.vue # 范式写作
|
||||||
|
│ │ ├── OutlineWriterPanel.vue # 提纲写作
|
||||||
|
│ │ ├── ArticleEditorPanel.vue # 文章修改 ⭐
|
||||||
|
│ │ ├── ArticleFusionPanel.vue # 文章融合
|
||||||
│ │ ├── ArticleRewritePanel.vue # 范式润色 ⭐
|
│ │ ├── ArticleRewritePanel.vue # 范式润色 ⭐
|
||||||
|
│ │ ├── AnalysisPanel.vue # 范式库
|
||||||
│ │ ├── ComparePanel.vue # 对照检查
|
│ │ ├── ComparePanel.vue # 对照检查
|
||||||
│ │ └── DiffAnnotationPanel.vue # 差异标注
|
│ │ ├── DiffAnnotationPanel.vue # 差异标注
|
||||||
│ ├── 管理面板
|
|
||||||
│ │ ├── DocumentsPanel.vue # 文稿库
|
│ │ ├── DocumentsPanel.vue # 文稿库
|
||||||
│ │ ├── MaterialsPanel.vue # 素材库
|
│ │ ├── MaterialsPanel.vue # 素材库
|
||||||
│ │ └── SettingsPanel.vue # 设置
|
│ │ └── SettingsPanel.vue # 设置
|
||||||
│ ├── 弹窗组件
|
│ ├── modals/ # 弹窗组件
|
||||||
│ │ ├── ParadigmSelectorModal.vue # 范式选择器
|
│ │ ├── DocumentSelectorModal.vue
|
||||||
│ │ ├── RequirementParserPanel.vue # 需求解析 ⭐
|
│ │ ├── MaterialSelectorModal.vue
|
||||||
│ │ └── DocumentSelectorModal.vue # 文稿选择器
|
│ │ └── ParadigmSelectorModal.vue
|
||||||
│ ├── 基础组件
|
│ ├── editors/ # 编辑器组件
|
||||||
│ │ ├── BaseButton.vue
|
│ │ ├── MainContent.vue # 主内容区
|
||||||
│ │ ├── BaseInput.vue
|
│ │ └── MarkdownEditor.vue # Markdown 编辑器
|
||||||
│ │ └── BaseModal.vue
|
│ ├── results/ # 结果展示组件
|
||||||
│ └── 其他
|
│ │ ├── FusionResultPanel.vue
|
||||||
│ ├── GlobalSidebar.vue # 侧边导航
|
│ │ ├── OutlineResultPanel.vue
|
||||||
│ ├── MainContent.vue # 主内容区
|
│ │ └── DocumentVersionPanel.vue
|
||||||
│ └── MarkdownEditor.vue # Markdown 编辑器
|
│ ├── specialized/ # 特殊功能组件
|
||||||
|
│ │ └── RequirementParserPanel.vue # 需求解析 ⭐
|
||||||
|
│ └── icons/ # 图标组件
|
||||||
|
│ └── IconLibrary.vue
|
||||||
│
|
│
|
||||||
├── stores/ # Pinia 状态管理
|
├── stores/ # Pinia 状态管理
|
||||||
│ ├── app.js # 主应用 store (219 行)
|
│ ├── app.js # 主应用 store
|
||||||
│ └── paradigm.js # 范式管理 store (267 行) ⭐
|
│ ├── database.js # 数据库 store
|
||||||
|
│ └── paradigm.js # 范式管理 store ⭐
|
||||||
│
|
│
|
||||||
├── config/ # 配置文件
|
├── config/ # 配置文件
|
||||||
│ ├── paradigms.js # 范式定义 (20+ 预设)
|
│ ├── paradigms.js # 范式定义 (20+ 预设)
|
||||||
|
|||||||
38
src/App.vue
38
src/App.vue
@@ -58,25 +58,25 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { useAppStore } from './stores/app'
|
import { useAppStore } from './stores/app'
|
||||||
import GlobalSidebar from './components/GlobalSidebar.vue'
|
import GlobalSidebar from './components/layout/GlobalSidebar.vue'
|
||||||
import HomePage from './components/HomePage.vue'
|
import HomePage from './components/layout/HomePage.vue'
|
||||||
import WriterPanel from './components/WriterPanel.vue'
|
import WriterPanel from './components/panels/WriterPanel.vue'
|
||||||
import AnalysisPanel from './components/AnalysisPanel.vue'
|
import AnalysisPanel from './components/panels/AnalysisPanel.vue'
|
||||||
import DocumentsPanel from './components/DocumentsPanel.vue'
|
import DocumentsPanel from './components/panels/DocumentsPanel.vue'
|
||||||
import MaterialsPanel from './components/MaterialsPanel.vue'
|
import MaterialsPanel from './components/panels/MaterialsPanel.vue'
|
||||||
import SettingsPanel from './components/SettingsPanel.vue'
|
import SettingsPanel from './components/panels/SettingsPanel.vue'
|
||||||
import MainContent from './components/MainContent.vue'
|
import MainContent from './components/editors/MainContent.vue'
|
||||||
import ComparePanel from './components/ComparePanel.vue'
|
import ComparePanel from './components/panels/ComparePanel.vue'
|
||||||
import DocumentVersionPanel from './components/DocumentVersionPanel.vue'
|
import DocumentVersionPanel from './components/results/DocumentVersionPanel.vue'
|
||||||
import DiffAnnotationPanel from './components/DiffAnnotationPanel.vue'
|
import DiffAnnotationPanel from './components/panels/DiffAnnotationPanel.vue'
|
||||||
import ArticleRewritePanel from './components/ArticleRewritePanel.vue'
|
import ArticleRewritePanel from './components/panels/ArticleRewritePanel.vue'
|
||||||
import ParadigmWriterPanel from './components/ParadigmWriterPanel.vue'
|
import ParadigmWriterPanel from './components/panels/ParadigmWriterPanel.vue'
|
||||||
import MimicWriterPanel from './components/MimicWriterPanel.vue'
|
import MimicWriterPanel from './components/panels/MimicWriterPanel.vue'
|
||||||
import ArticleFusionPanel from './components/ArticleFusionPanel.vue'
|
import ArticleFusionPanel from './components/panels/ArticleFusionPanel.vue'
|
||||||
import FusionResultPanel from './components/FusionResultPanel.vue'
|
import FusionResultPanel from './components/results/FusionResultPanel.vue'
|
||||||
import OutlineWriterPanel from './components/OutlineWriterPanel.vue'
|
import OutlineWriterPanel from './components/panels/OutlineWriterPanel.vue'
|
||||||
import OutlineResultPanel from './components/OutlineResultPanel.vue'
|
import OutlineResultPanel from './components/results/OutlineResultPanel.vue'
|
||||||
import ArticleEditorPanel from './components/ArticleEditorPanel.vue'
|
import ArticleEditorPanel from './components/panels/ArticleEditorPanel.vue'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const currentPage = computed(() => appStore.currentPage)
|
const currentPage = computed(() => appStore.currentPage)
|
||||||
|
|||||||
@@ -588,11 +588,11 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref, watch } from 'vue'
|
import { computed, ref, watch } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import { useParadigmStore } from '../stores/paradigm'
|
import { useParadigmStore } from '../../stores/paradigm'
|
||||||
import { buildPrompt } from '../utils/promptBuilder.js'
|
import { buildPrompt } from '../../utils/promptBuilder.js'
|
||||||
import { marked } from 'marked'
|
import { marked } from 'marked'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const paradigmStore = useParadigmStore()
|
const paradigmStore = useParadigmStore()
|
||||||
@@ -847,7 +847,7 @@ const saveDocument = async () => {
|
|||||||
if (!currentDocument.value) return
|
if (!currentDocument.value) return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { updateDocument } = await import('../db/index.js')
|
const { updateDocument } = await import('../../db/index.js')
|
||||||
await updateDocument(currentDocument.value.id, {
|
await updateDocument(currentDocument.value.id, {
|
||||||
title: documentTitle.value,
|
title: documentTitle.value,
|
||||||
content: documentContent.value
|
content: documentContent.value
|
||||||
@@ -871,7 +871,7 @@ const changeDocStatus = async (status) => {
|
|||||||
if (!currentDocument.value) return
|
if (!currentDocument.value) return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { updateDocument } = await import('../db/index.js')
|
const { updateDocument } = await import('../../db/index.js')
|
||||||
await updateDocument(currentDocument.value.id, { status })
|
await updateDocument(currentDocument.value.id, { status })
|
||||||
currentDocument.value.status = status
|
currentDocument.value.status = status
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -53,8 +53,8 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const currentPage = computed(() => appStore.currentPage)
|
const currentPage = computed(() => appStore.currentPage)
|
||||||
@@ -98,11 +98,11 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import { useDatabaseStore } from '../stores/database'
|
import { useDatabaseStore } from '../../stores/database'
|
||||||
import { useParadigmStore } from '../stores/paradigm'
|
import { useParadigmStore } from '../../stores/paradigm'
|
||||||
import { getParadigmList } from '../config/paradigms'
|
import { getParadigmList } from '../../config/paradigms'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const dbStore = useDatabaseStore()
|
const dbStore = useDatabaseStore()
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, watch } from 'vue'
|
import { ref, computed, watch } from 'vue'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: Boolean
|
visible: Boolean
|
||||||
@@ -114,7 +114,7 @@ const filteredDocuments = computed(() => {
|
|||||||
// 加载文稿
|
// 加载文稿
|
||||||
const loadDocuments = async () => {
|
const loadDocuments = async () => {
|
||||||
try {
|
try {
|
||||||
const { getAllDocuments } = await import('../db/index.js')
|
const { getAllDocuments } = await import('../../db/index.js')
|
||||||
documents.value = await getAllDocuments()
|
documents.value = await getAllDocuments()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('加载文稿失败:', error)
|
console.error('加载文稿失败:', error)
|
||||||
@@ -70,8 +70,8 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { useDatabaseStore } from '../stores/database'
|
import { useDatabaseStore } from '../../stores/database'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: Boolean
|
visible: Boolean
|
||||||
@@ -112,9 +112,9 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, watch } from 'vue'
|
import { ref, computed, watch } from 'vue'
|
||||||
import { getParadigmList } from '../config/paradigms.js'
|
import { getParadigmList } from '../../config/paradigms.js'
|
||||||
import { useParadigmStore } from '../stores/paradigm.js'
|
import { useParadigmStore } from '../../stores/paradigm.js'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
|
|
||||||
const paradigmStore = useParadigmStore()
|
const paradigmStore = useParadigmStore()
|
||||||
|
|
||||||
@@ -172,12 +172,12 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted, onUnmounted, computed, watch } from 'vue'
|
import { ref, reactive, onMounted, onUnmounted, computed, watch } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import { useDatabaseStore } from '../stores/database.js'
|
import { useDatabaseStore } from '../../stores/database.js'
|
||||||
import { useParadigmStore } from '../stores/paradigm.js'
|
import { useParadigmStore } from '../../stores/paradigm.js'
|
||||||
import { getParadigmList } from '../config/paradigms.js'
|
import { getParadigmList } from '../../config/paradigms.js'
|
||||||
import RequirementParserPanel from './RequirementParserPanel.vue'
|
import RequirementParserPanel from '../specialized/RequirementParserPanel.vue'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const { analysisText, isAnalyzing } = storeToRefs(appStore)
|
const { analysisText, isAnalyzing } = storeToRefs(appStore)
|
||||||
@@ -265,17 +265,17 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, watch, onMounted } from 'vue'
|
import { ref, computed, watch, onMounted } from 'vue'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import { useDatabaseStore } from '../stores/database'
|
import { useDatabaseStore } from '../../stores/database'
|
||||||
import {
|
import {
|
||||||
splitIntoSentencesWithPosition,
|
splitIntoSentencesWithPosition,
|
||||||
computeDiff,
|
computeDiff,
|
||||||
getDiffStats
|
getDiffStats
|
||||||
} from '../utils/textDiff'
|
} from '../../utils/textDiff'
|
||||||
import { saveDocumentVersion, updateDocument } from '../db/index.js'
|
import { saveDocumentVersion, updateDocument } from '../../db/index.js'
|
||||||
import DocumentSelectorModal from './DocumentSelectorModal.vue'
|
import DocumentSelectorModal from '../modals/DocumentSelectorModal.vue'
|
||||||
import MaterialSelectorModal from './MaterialSelectorModal.vue'
|
import MaterialSelectorModal from '../modals/MaterialSelectorModal.vue'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const dbStore = useDatabaseStore()
|
const dbStore = useDatabaseStore()
|
||||||
@@ -99,8 +99,8 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const { articleFusionState } = storeToRefs(appStore)
|
const { articleFusionState } = storeToRefs(appStore)
|
||||||
@@ -347,14 +347,14 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, watch } from 'vue'
|
import { ref, computed, watch } from 'vue'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import { useParadigmStore } from '../stores/paradigm'
|
import { useParadigmStore } from '../../stores/paradigm'
|
||||||
import { splitIntoSentencesWithPosition, computeDiff } from '../utils/textDiff'
|
import { splitIntoSentencesWithPosition, computeDiff } from '../../utils/textDiff'
|
||||||
import { updateDocument, saveDocumentVersion } from '../db/index.js'
|
import { updateDocument, saveDocumentVersion } from '../../db/index.js'
|
||||||
import ParadigmSelectorModal from './ParadigmSelectorModal.vue'
|
import ParadigmSelectorModal from '../modals/ParadigmSelectorModal.vue'
|
||||||
import DocumentSelectorModal from './DocumentSelectorModal.vue'
|
import DocumentSelectorModal from '../modals/DocumentSelectorModal.vue'
|
||||||
import RequirementParserPanel from './RequirementParserPanel.vue'
|
import RequirementParserPanel from '../specialized/RequirementParserPanel.vue'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const paradigmStore = useParadigmStore()
|
const paradigmStore = useParadigmStore()
|
||||||
@@ -764,16 +764,16 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, watch } from 'vue'
|
import { ref, computed, watch } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import { useDatabaseStore } from '../stores/database'
|
import { useDatabaseStore } from '../../stores/database'
|
||||||
import { updateDocument, saveDocumentVersion, getDocumentById } from '../db/index.js'
|
import { updateDocument, saveDocumentVersion, getDocumentById } from '../../db/index.js'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
import { SECTION_TYPES, getSectionTypeById, getSectionTypeClasses } from '../config/sectionTypes'
|
import { SECTION_TYPES, getSectionTypeById, getSectionTypeClasses } from '../../config/sectionTypes'
|
||||||
import { getLogicParadigmById, buildLogicPrompt } from '../config/logicParadigms'
|
import { getLogicParadigmById, buildLogicPrompt } from '../../config/logicParadigms'
|
||||||
import { computeDiff, applySelectedChanges as applyDiffChanges, getDiffStats, splitIntoSentencesWithPosition } from '../utils/textDiff'
|
import { computeDiff, applySelectedChanges as applyDiffChanges, getDiffStats, splitIntoSentencesWithPosition } from '../../utils/textDiff'
|
||||||
import MaterialSelectorModal from './MaterialSelectorModal.vue'
|
import MaterialSelectorModal from '../modals/MaterialSelectorModal.vue'
|
||||||
import DocumentSelectorModal from './DocumentSelectorModal.vue'
|
import DocumentSelectorModal from '../modals/DocumentSelectorModal.vue'
|
||||||
import ParadigmSelectorModal from './ParadigmSelectorModal.vue'
|
import ParadigmSelectorModal from '../modals/ParadigmSelectorModal.vue'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const dbStore = useDatabaseStore()
|
const dbStore = useDatabaseStore()
|
||||||
@@ -194,12 +194,12 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, watch, onMounted, onUnmounted } from 'vue'
|
import { ref, computed, watch, onMounted, onUnmounted } from 'vue'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import { computePreciseDiff, getPreciseDiffStats } from '../utils/preciseDiff.js'
|
import { computePreciseDiff, getPreciseDiffStats } from '../../utils/preciseDiff.js'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
import { Document, Packer, Paragraph, TextRun } from 'docx'
|
import { Document, Packer, Paragraph, TextRun } from 'docx'
|
||||||
import { saveAs } from 'file-saver'
|
import { saveAs } from 'file-saver'
|
||||||
import DocumentSelectorModal from './DocumentSelectorModal.vue'
|
import DocumentSelectorModal from '../modals/DocumentSelectorModal.vue'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
|
|
||||||
@@ -120,10 +120,10 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted } from 'vue'
|
import { ref, computed, onMounted } from 'vue'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import { useDatabaseStore } from '../stores/database.js'
|
import { useDatabaseStore } from '../../stores/database.js'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const dbStore = useDatabaseStore()
|
const dbStore = useDatabaseStore()
|
||||||
@@ -178,7 +178,7 @@ const getCountByStatus = (status) => {
|
|||||||
// 加载文稿列表
|
// 加载文稿列表
|
||||||
const loadDocuments = async () => {
|
const loadDocuments = async () => {
|
||||||
try {
|
try {
|
||||||
const { getAllDocuments } = await import('../db/index.js')
|
const { getAllDocuments } = await import('../../db/index.js')
|
||||||
documents.value = await getAllDocuments()
|
documents.value = await getAllDocuments()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('加载文稿失败:', error)
|
console.error('加载文稿失败:', error)
|
||||||
@@ -206,7 +206,7 @@ const toggleVersionPanel = () => {
|
|||||||
// 创建新文稿
|
// 创建新文稿
|
||||||
const createNewDocument = async () => {
|
const createNewDocument = async () => {
|
||||||
try {
|
try {
|
||||||
const { createDocument } = await import('../db/index.js')
|
const { createDocument } = await import('../../db/index.js')
|
||||||
const id = await createDocument({
|
const id = await createDocument({
|
||||||
title: '未命名文稿',
|
title: '未命名文稿',
|
||||||
content: '',
|
content: '',
|
||||||
@@ -236,7 +236,7 @@ const duplicateDocument = async () => {
|
|||||||
if (!doc) return
|
if (!doc) return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { createDocument } = await import('../db/index.js')
|
const { createDocument } = await import('../../db/index.js')
|
||||||
await createDocument({
|
await createDocument({
|
||||||
title: doc.title + ' (副本)',
|
title: doc.title + ' (副本)',
|
||||||
content: doc.content,
|
content: doc.content,
|
||||||
@@ -261,7 +261,7 @@ const deleteSelectedDocument = async () => {
|
|||||||
if (!selectedDocId.value) return
|
if (!selectedDocId.value) return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { deleteDocument } = await import('../db/index.js')
|
const { deleteDocument } = await import('../../db/index.js')
|
||||||
await deleteDocument(selectedDocId.value)
|
await deleteDocument(selectedDocId.value)
|
||||||
selectedDocId.value = null
|
selectedDocId.value = null
|
||||||
showDeleteConfirm.value = false
|
showDeleteConfirm.value = false
|
||||||
@@ -301,10 +301,10 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, computed, onMounted } from 'vue'
|
import { ref, reactive, computed, onMounted } from 'vue'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import { REFERENCE_TYPES } from '../config/references.js'
|
import { REFERENCE_TYPES } from '../../config/references.js'
|
||||||
import { getDimensionSetList } from '../config/dimensionSets.js'
|
import { getDimensionSetList } from '../../config/dimensionSets.js'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
|
|
||||||
@@ -370,7 +370,7 @@ const getTypeIcon = (type) => {
|
|||||||
// 加载素材列表
|
// 加载素材列表
|
||||||
const loadMaterials = async () => {
|
const loadMaterials = async () => {
|
||||||
try {
|
try {
|
||||||
const { getAllReferences } = await import('../db/index.js')
|
const { getAllReferences } = await import('../../db/index.js')
|
||||||
materials.value = await getAllReferences()
|
materials.value = await getAllReferences()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('加载素材失败:', error)
|
console.error('加载素材失败:', error)
|
||||||
@@ -442,7 +442,7 @@ const saveMaterial = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { addReference, updateReference } = await import('../db/index.js')
|
const { addReference, updateReference } = await import('../../db/index.js')
|
||||||
|
|
||||||
const materialData = {
|
const materialData = {
|
||||||
type: editForm.type,
|
type: editForm.type,
|
||||||
@@ -483,7 +483,7 @@ const deleteMaterial = async () => {
|
|||||||
if (!selectedId.value) return
|
if (!selectedId.value) return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { deleteReference } = await import('../db/index.js')
|
const { deleteReference } = await import('../../db/index.js')
|
||||||
await deleteReference(selectedId.value)
|
await deleteReference(selectedId.value)
|
||||||
selectedId.value = null
|
selectedId.value = null
|
||||||
showDeleteConfirm.value = false
|
showDeleteConfirm.value = false
|
||||||
@@ -190,9 +190,9 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
import DocumentSelectorModal from './DocumentSelectorModal.vue'
|
import DocumentSelectorModal from '../modals/DocumentSelectorModal.vue'
|
||||||
import { marked } from 'marked'
|
import { marked } from 'marked'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
@@ -229,8 +229,8 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const { outlineWriterState } = storeToRefs(appStore)
|
const { outlineWriterState } = storeToRefs(appStore)
|
||||||
@@ -306,7 +306,7 @@ import {
|
|||||||
addOutlineMaterial,
|
addOutlineMaterial,
|
||||||
updateOutlineMaterial,
|
updateOutlineMaterial,
|
||||||
deleteOutlineMaterial
|
deleteOutlineMaterial
|
||||||
} from '../db/index.js'
|
} from '../../db/index.js'
|
||||||
|
|
||||||
const materials = computed(() => outlineWriterState.value.materials)
|
const materials = computed(() => outlineWriterState.value.materials)
|
||||||
const showMaterialModal = computed({
|
const showMaterialModal = computed({
|
||||||
@@ -183,10 +183,10 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted, onUnmounted } from 'vue'
|
import { ref, computed, onMounted, onUnmounted } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import { useParadigmStore } from '../stores/paradigm.js'
|
import { useParadigmStore } from '../../stores/paradigm.js'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
import { getParadigmList } from '../config/paradigms.js'
|
import { getParadigmList } from '../../config/paradigms.js'
|
||||||
import { marked } from 'marked'
|
import { marked } from 'marked'
|
||||||
import { Document, Packer, Paragraph, TextRun, HeadingLevel } from 'docx'
|
import { Document, Packer, Paragraph, TextRun, HeadingLevel } from 'docx'
|
||||||
import { saveAs } from 'file-saver'
|
import { saveAs } from 'file-saver'
|
||||||
@@ -211,9 +211,9 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted, computed } from 'vue'
|
import { ref, reactive, onMounted, computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import { modelProviders } from '../utils/config.js'
|
import { modelProviders } from '../../utils/config.js'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const { selectedProviderId, currentProvider } = storeToRefs(appStore)
|
const { selectedProviderId, currentProvider } = storeToRefs(appStore)
|
||||||
@@ -250,7 +250,7 @@ const currentProviderStatus = computed(() => {
|
|||||||
// 加载统计数据
|
// 加载统计数据
|
||||||
const loadStats = async () => {
|
const loadStats = async () => {
|
||||||
try {
|
try {
|
||||||
const { getAllDocuments, getAllReferences, getAllParadigms, exportDatabase } = await import('../db/index.js')
|
const { getAllDocuments, getAllReferences, getAllParadigms, exportDatabase } = await import('../../db/index.js')
|
||||||
|
|
||||||
stats.documents = (await getAllDocuments()).length
|
stats.documents = (await getAllDocuments()).length
|
||||||
stats.materials = (await getAllReferences()).length
|
stats.materials = (await getAllReferences()).length
|
||||||
@@ -273,7 +273,7 @@ const formatSize = (bytes) => {
|
|||||||
// 导出数据
|
// 导出数据
|
||||||
const exportData = async () => {
|
const exportData = async () => {
|
||||||
try {
|
try {
|
||||||
const { exportAsJSON } = await import('../db/index.js')
|
const { exportAsJSON } = await import('../../db/index.js')
|
||||||
const data = await exportAsJSON()
|
const data = await exportAsJSON()
|
||||||
|
|
||||||
const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' })
|
const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' })
|
||||||
@@ -363,11 +363,11 @@ const executeConfirmAction = async () => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (confirmAction.value === 'clearDocuments') {
|
if (confirmAction.value === 'clearDocuments') {
|
||||||
const { clearDocuments } = await import('../db/index.js')
|
const { clearDocuments } = await import('../../db/index.js')
|
||||||
await clearDocuments()
|
await clearDocuments()
|
||||||
showToastMessage('文稿已清空')
|
showToastMessage('文稿已清空')
|
||||||
} else if (confirmAction.value === 'resetDatabase') {
|
} else if (confirmAction.value === 'resetDatabase') {
|
||||||
const { resetDatabase } = await import('../db/index.js')
|
const { resetDatabase } = await import('../../db/index.js')
|
||||||
await resetDatabase()
|
await resetDatabase()
|
||||||
showToastMessage('数据库已重置')
|
showToastMessage('数据库已重置')
|
||||||
}
|
}
|
||||||
@@ -195,8 +195,8 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const {
|
const {
|
||||||
@@ -170,9 +170,9 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch, computed, defineProps, defineEmits } from 'vue'
|
import { ref, watch, computed, defineProps, defineEmits } from 'vue'
|
||||||
import { getDocumentVersions, saveDocumentVersion, updateDocument } from '../db/index.js'
|
import { getDocumentVersions, saveDocumentVersion, updateDocument } from '../../db/index.js'
|
||||||
import { computeDiff, getDiffStats } from '../utils/textDiff.js'
|
import { computeDiff, getDiffStats } from '../../utils/textDiff.js'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: Boolean,
|
visible: Boolean,
|
||||||
@@ -142,9 +142,9 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import { marked } from 'marked'
|
import { marked } from 'marked'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const { articleFusionState } = storeToRefs(appStore)
|
const { articleFusionState } = storeToRefs(appStore)
|
||||||
@@ -53,9 +53,9 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import { marked } from 'marked'
|
import { marked } from 'marked'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const { outlineWriterState } = storeToRefs(appStore)
|
const { outlineWriterState } = storeToRefs(appStore)
|
||||||
@@ -276,16 +276,16 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useAppStore } from '../stores/app'
|
import { useAppStore } from '../../stores/app'
|
||||||
import { useParadigmStore } from '../stores/paradigm'
|
import { useParadigmStore } from '../../stores/paradigm'
|
||||||
import DeepSeekAPI from '../api/deepseek'
|
import DeepSeekAPI from '../../api/deepseek'
|
||||||
import IconLibrary from './icons/IconLibrary.vue'
|
import IconLibrary from '../icons/IconLibrary.vue'
|
||||||
import {
|
import {
|
||||||
buildRequirementParserPrompt,
|
buildRequirementParserPrompt,
|
||||||
parseParadigmConfig,
|
parseParadigmConfig,
|
||||||
buildParadigmObject,
|
buildParadigmObject,
|
||||||
validateParadigm
|
validateParadigm
|
||||||
} from '../utils/requirementParser'
|
} from '../../utils/requirementParser'
|
||||||
|
|
||||||
const emit = defineEmits(['close', 'paradigm-created'])
|
const emit = defineEmits(['close', 'paradigm-created'])
|
||||||
|
|
||||||
Reference in New Issue
Block a user