feat: 接收到webaddress时自动展开

This commit is contained in:
2026-06-04 15:11:20 +08:00
parent c7ff047ac8
commit 0d865da77e
3 changed files with 146 additions and 7 deletions

View File

@@ -129,6 +129,16 @@
}
)
watch(
() => props.type,
(val) => {
if (val === 'sketch') {
fetchedUrlSet.value = new Set()
urlList.value = []
}
}
)
watch(
() => props.sketchList,
() => {
@@ -199,13 +209,16 @@
}
const urlLoading = ref(false)
const fetchedUrlSet = ref<Set<string>>(new Set())
const setUrls = async (list: string[]) => {
reportType.value = 'urls'
urlList.value = []
const newUrls = [...new Set(list.filter((url) => !fetchedUrlSet.value.has(url)))]
if (newUrls.length === 0) return
urlLoading.value = true
const res = await fetchUrlTitle(list)
const res = await fetchUrlTitle(newUrls)
urlLoading.value = false
urlList.value = res
newUrls.forEach((url) => fetchedUrlSet.value.add(url))
urlList.value = [...urlList.value, ...res]
}
// watch(
// () => sessionId.value,