feat: 实时打开webSources

This commit is contained in:
2026-05-27 16:13:45 +08:00
parent 5e89995cfd
commit c7ff047ac8
2 changed files with 11 additions and 2 deletions

View File

@@ -454,7 +454,8 @@
const jsonData = JSON.parse(jsonText) const jsonData = JSON.parse(jsonText)
// console.log('jsonData', jsonData) // console.log('jsonData', jsonData)
if (jsonData.webAddress) { if (jsonData.webAddress) {
// aiMessage.webAddress = JSON.parse(jsonData.webAddress)
aiMessage.webAddress = JSON.parse(jsonData.webAddress)
// contentBody += `<slot slot-name="url"></slot>` // contentBody += `<slot slot-name="url"></slot>`
// aiMessage.loading = false // aiMessage.loading = false
hasUrlEvent = true hasUrlEvent = true

View File

@@ -2,6 +2,7 @@
<div <div
ref="containerRef" ref="containerRef"
class="preview-container flex" class="preview-container flex"
v-loading="urlLoading"
:class="type === 'sketch' ? 'sketch-preview' : 'report-preview'" :class="type === 'sketch' ? 'sketch-preview' : 'report-preview'"
> >
<template v-if="type === 'sketch'"> <template v-if="type === 'sketch'">
@@ -136,7 +137,10 @@
// 当 type 为 sketch 时,自动滚动到最底部 // 当 type 为 sketch 时,自动滚动到最底部
if (props.type === 'sketch') { if (props.type === 'sketch') {
nextTick(() => { nextTick(() => {
containerRef.value?.scrollTo({ top: containerRef.value.scrollHeight, behavior: 'smooth' }) containerRef.value?.scrollTo({
top: containerRef.value.scrollHeight,
behavior: 'smooth'
})
}) })
} }
} }
@@ -194,9 +198,13 @@
markdownContent.value = content markdownContent.value = content
} }
const urlLoading = ref(false)
const setUrls = async (list: string[]) => { const setUrls = async (list: string[]) => {
reportType.value = 'urls' reportType.value = 'urls'
urlList.value = []
urlLoading.value = true
const res = await fetchUrlTitle(list) const res = await fetchUrlTitle(list)
urlLoading.value = false
urlList.value = res urlList.value = res
} }
// watch( // watch(