From f082dd2a1f3ebf8fca0eca9632ef1aaa7b84e7d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=E9=AD=8F?= Date: Fri, 8 Aug 2025 16:11:55 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E7=8E=AF=E5=A2=83=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dialoguePanel/DialoguePanel.vue | 27 ++++++++++--------- .../dialogue/components/DialogueSession.vue | 2 +- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/components/dialoguePanel/DialoguePanel.vue b/src/components/dialoguePanel/DialoguePanel.vue index 9b52a5d..5eb70d5 100644 --- a/src/components/dialoguePanel/DialoguePanel.vue +++ b/src/components/dialoguePanel/DialoguePanel.vue @@ -117,7 +117,7 @@ const processMarkedContent = (content: string) => { }); }; -const tooltip = document.createElement("div"); +const tooltipRef = ref(null); const generateContent = (content: string) => { if (!content) return ''; @@ -136,24 +136,24 @@ const generateContent = (content: string) => { } const showTooltip = (content: string, event: MouseEvent) => { const curId = (event.target as HTMLElement)?.id; - tooltip.className = "mark-number-tooltip"; - tooltip.innerHTML = generateContent(content) || ''; + tooltipRef.value.className = "mark-number-tooltip"; + tooltipRef.value.innerHTML = generateContent(content) || ''; const markedDiv = document.getElementById(curId); const curRect = markedDiv?.getBoundingClientRect(); - tooltip.style.borderRadius = '8px'; - tooltip.style.padding = '16px'; - tooltip.style.boxShadow = '0 4px 16px 0 rgba(0,0,0,0.2)'; + tooltipRef.value.style.borderRadius = '8px'; + tooltipRef.value.style.padding = '16px'; + tooltipRef.value.style.boxShadow = '0 4px 16px 0 rgba(0,0,0,0.2)'; setTimeout(() => { - document.body.appendChild(tooltip); + document.body.appendChild(tooltipRef.value); setTimeout(()=>{ // console.log('当前元素位置:', curRect); - // console.log('tooltip位置:', tooltip.getBoundingClientRect()); - tooltip.style.left = `${curRect.left + curRect.width / 2 }px`; - tooltip.style.top = `${curRect.y - tooltip.getBoundingClientRect().height - 4 }px`; + // console.log('tooltip位置:', tooltipRef.value.getBoundingClientRect()); + tooltipRef.value.style.left = `${curRect.left + curRect.width / 2 }px`; + tooltipRef.value.style.top = `${curRect.y - tooltipRef.value.getBoundingClientRect().height - 4 }px`; },0) }, 10); - tooltip.addEventListener('click', (e) => { + tooltipRef.value.addEventListener('click', (e) => { e.stopPropagation(); const downloadBtn = (e.target as HTMLElement).closest('.download-btn'); if (downloadBtn) { @@ -178,7 +178,7 @@ const handleMouseOver = _.debounce((event)=>{ },100) const handleMouseMove=(event)=>{ if (!event.target.className.includes('mark-number') && !event.target.className.includes('mark-number-tooltip')) { - if(tooltip) tooltip.remove(); + if(tooltipRef) tooltipRef.value.remove(); } } const processContent = (content: string) => { @@ -679,6 +679,9 @@ const handleFileClick = () => { :isWorkFlowDebug="props.isWorkFlowDebug" :flowdata="props.flowdata" /> + +
+
{ if (!file) return; - const url = `${window.origin}/wtd/api/doc/download?docId=${file.documentId}`; + const url = `${window.origin}/witchaind/api/doc/download?docId=${file.documentId}`; downloadFun(url); }; -- Gitee