feat: 报告标题

This commit is contained in:
2026-03-27 16:49:29 +08:00
parent f1585770db
commit 23a15d2a5f
4 changed files with 27 additions and 11 deletions

View File

@@ -163,10 +163,17 @@
const markdownContent = ref('')
const urlList = ref([])
const reportType = ref<'report' | 'urls'>('report')
const reportTitle = ref('')
const setSessionId = (id: string) => {
reportType.value = 'report'
sessionId.value = id
}
const setReportTitle = (title: string) => {
reportTitle.value = title
}
const setUrls = async (list: string[]) => {
reportType.value = 'urls'
const res = await fetchUrlTitle(list)
@@ -246,7 +253,7 @@
const url = URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = `report-${Date.now()}.md`
link.download = reportTitle.value ?? `report-${Date.now()}.md`
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
@@ -299,7 +306,8 @@
defineExpose({
setSessionId,
setUrls
setUrls,
setReportTitle
})
</script>