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