feat: 报告标题
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user