From a339757596181cf1ca29e5ab2d33fbee26af4646 Mon Sep 17 00:00:00 2001 From: liuguancen Date: Thu, 2 Apr 2026 12:01:27 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=89=8D=E7=AB=AF]=20=E7=A0=94=E8=AF=BB?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=94=B9=E9=80=A0=E4=B8=BA=E4=B8=89=E6=A0=8F?= =?UTF-8?q?=E5=B8=83=E5=B1=80=EF=BC=9A=E6=96=87=E4=BB=B6=E6=A0=91+?= =?UTF-8?q?=E9=A2=84=E8=A7=88+=E9=97=AE=E7=AD=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chat_web_front/src/App.vue | 2 +- .../src/components/Introduction.vue | 37 +- chat_web_front/src/components/Literatures.vue | 21 +- .../src/components/ReadingCreate.vue | 38 +- chat_web_front/src/router/index.ts | 10 - .../src/views/reading/fileDetail.vue | 883 ---------- chat_web_front/src/views/reading/fileList.vue | 766 -------- chat_web_front/src/views/reading/index.vue | 1540 ++++++++++++----- 8 files changed, 1138 insertions(+), 2159 deletions(-) delete mode 100644 chat_web_front/src/views/reading/fileDetail.vue delete mode 100644 chat_web_front/src/views/reading/fileList.vue diff --git a/chat_web_front/src/App.vue b/chat_web_front/src/App.vue index 51e6122..498f295 100644 --- a/chat_web_front/src/App.vue +++ b/chat_web_front/src/App.vue @@ -1,6 +1,6 @@ diff --git a/chat_web_front/src/components/Introduction.vue b/chat_web_front/src/components/Introduction.vue index 6dcad70..7d04a24 100644 --- a/chat_web_front/src/components/Introduction.vue +++ b/chat_web_front/src/components/Introduction.vue @@ -59,11 +59,11 @@ import {copyToClip} from "@/utils"; import {ElMessage} from "element-plus"; import {fileGuidInfo} from "@/api"; -import {onMounted, ref} from "vue"; +import {computed, inject, ref, type Ref} from "vue"; import MarkdownIt from "markdown-it"; import {transforMd} from "@/utils/markdown"; -const state=history.state; +const selectedFile = inject('selectedFile') as Ref; const emits=defineEmits(["refreshAbs","refreshCon"]); const mardown=new MarkdownIt(); @@ -73,18 +73,29 @@ const refreshAbs=()=>{ const refreshCon=()=>{ emits('refreshCon'); } -const historyParams=history.state; -const articleAbstract=ref(historyParams.articleAbstract); -const articleKeywords=ref(historyParams.articleKeywords); -const articleParagraph=ref(historyParams.articleParagraph); -//总结提炼 -onMounted(async () => { - if(articleKeywords.value&&(articleKeywords.value.indexOf('关键词:')>-1||articleKeywords.value.indexOf('关键词:')>-1)){ - articleKeywords.value=articleKeywords.value.substring(articleKeywords.value.indexOf('关键词:')+4,articleKeywords.value.length); - articleKeywords.value=articleKeywords.value.substring(articleKeywords.value.indexOf('关键词:')+4,articleKeywords.value.length); +const articleAbstract=ref(''); +const articleKeywords=ref(''); +const articleParagraph=ref(''); + +// 监听选中文件变化,更新导读内容 +import {watch} from "vue"; +watch(() => selectedFile.value, (newFile) => { + if (newFile) { + articleAbstract.value = newFile.articleAbstract || ''; + let kw = newFile.articleKeywords || ''; + if (kw && (kw.indexOf('关键词:') > -1 || kw.indexOf('关键词:') > -1)) { + kw = kw.substring(kw.indexOf('关键词:') + 4, kw.length); + kw = kw.substring(kw.indexOf('关键词:') + 4, kw.length); + } + articleKeywords.value = kw; + articleParagraph.value = newFile.articleParagraph || ''; + } else { + articleAbstract.value = ''; + articleKeywords.value = ''; + articleParagraph.value = ''; } -}) +}, {immediate: true}); const copyText=(text)=>{ copyToClip(text); ElMessage.success("复制成功"); @@ -95,7 +106,7 @@ const refreshGuide=async (type:string)=>{ let param = { type: type, context: fileBox.innerText, - fileId: historyParams.fileId, + fileId: selectedFile.value?.fileId, } if(type==='6'){ articleAbstract.value='' diff --git a/chat_web_front/src/components/Literatures.vue b/chat_web_front/src/components/Literatures.vue index a087468..2a095a9 100644 --- a/chat_web_front/src/components/Literatures.vue +++ b/chat_web_front/src/components/Literatures.vue @@ -27,9 +27,9 @@ diff --git a/chat_web_front/src/components/ReadingCreate.vue b/chat_web_front/src/components/ReadingCreate.vue index f5a6c12..ed89db3 100644 --- a/chat_web_front/src/components/ReadingCreate.vue +++ b/chat_web_front/src/components/ReadingCreate.vue @@ -47,7 +47,7 @@ - - \ No newline at end of file diff --git a/chat_web_front/src/views/reading/fileList.vue b/chat_web_front/src/views/reading/fileList.vue deleted file mode 100644 index 2918240..0000000 --- a/chat_web_front/src/views/reading/fileList.vue +++ /dev/null @@ -1,766 +0,0 @@ - - - - - \ No newline at end of file diff --git a/chat_web_front/src/views/reading/index.vue b/chat_web_front/src/views/reading/index.vue index 5754ed8..6d53906 100644 --- a/chat_web_front/src/views/reading/index.vue +++ b/chat_web_front/src/views/reading/index.vue @@ -1,565 +1,1167 @@