feat: url link
This commit is contained in:
@@ -52,27 +52,34 @@
|
||||
</template>
|
||||
<div v-else class="reportBorder">
|
||||
<div class="report">
|
||||
<div v-if="false" class="report-content-null">
|
||||
<!-- <div v-if="false" class="report-content-null">
|
||||
<img :src="reportNull" alt="" />
|
||||
</div>
|
||||
<div v-else class="report-content">
|
||||
<div class="downBtnBox">
|
||||
<div class="downBtn" @click="handleDownloadMd">
|
||||
<div class="icon">
|
||||
<SvgIcon name="reportDown" size="16"></SvgIcon>
|
||||
</div> -->
|
||||
<template v-if="reportType === 'report'">
|
||||
<div class="report-content">
|
||||
<div class="downBtnBox">
|
||||
<div class="downBtn" @click="handleDownloadMd">
|
||||
<div class="icon">
|
||||
<SvgIcon name="reportDown" size="16"></SvgIcon>
|
||||
</div>
|
||||
<span>{{ $t('agent.Download') }}</span>
|
||||
</div>
|
||||
<span>{{ $t('agent.Download') }}</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<VueMarkdown
|
||||
:custom-attrs="customAttrs"
|
||||
:markdown="markdownContent"
|
||||
:rehype-plugins="[rehypeRaw]"
|
||||
>
|
||||
</VueMarkdown>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<VueMarkdown
|
||||
:custom-attrs="customAttrs"
|
||||
:markdown="markdownContent"
|
||||
:rehype-plugins="[rehypeRaw]"
|
||||
>
|
||||
</VueMarkdown>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="url-list">
|
||||
<div class="url-item" v-for="item in urlList" :key="item"></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -92,6 +99,9 @@
|
||||
import { VueMarkdown } from '@crazydos/vue-markdown'
|
||||
import type { CustomAttrs } from '@crazydos/vue-markdown'
|
||||
import rehypeRaw from 'rehype-raw'
|
||||
import { useWebsiteTitle } from '@/utils/useWebTitle'
|
||||
|
||||
const { titles, loading, fetchAll } = useWebsiteTitle()
|
||||
|
||||
const { t } = useI18n()
|
||||
const emits = defineEmits(['deleteSketch'])
|
||||
@@ -125,17 +135,29 @@
|
||||
|
||||
const sessionId = ref('')
|
||||
const markdownContent = ref('')
|
||||
const setSessionId = (id: string) => {
|
||||
|
||||
const urlList = ref([])
|
||||
const reportType = ref<'report' | 'urls'>('report')
|
||||
const setSessionId = (id: string) => {
|
||||
console.log('setSessionId-----', id)
|
||||
reportType.value = 'report'
|
||||
sessionId.value = id
|
||||
}
|
||||
const setUrls = (list: string[]) => {
|
||||
console.log('setUrls-----', list)
|
||||
reportType.value = 'urls'
|
||||
urlList.value = [
|
||||
'https://furnitureindustrynews.substack.com/p/what-2026-really-looks-like-for-furniture',
|
||||
'https://furnitureindustrynews.substack.com/p/what-2026-really-looks-like-for-furniture',
|
||||
'https://furnitureindustrynews.substack.com/p/what-2026-really-looks-like-for-furniture'
|
||||
]
|
||||
fetchAll(list)
|
||||
}
|
||||
watch(
|
||||
() => sessionId.value,
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
markdownContent.value = localStorage.getItem(`reportsContent_${newVal}`)
|
||||
console.log('markdownContent-----', markdownContent.value);
|
||||
|
||||
console.log(`报告key值:reportsContent_${newVal}`, markdownContent.value)
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -143,9 +165,7 @@ const setSessionId = (id: string) => {
|
||||
// 图片加载完成时触发
|
||||
const handleImageLoad = (index: number) => {
|
||||
loadedStatus[index] = true
|
||||
if (index === props.sketchList.length - 1) {
|
||||
showLoading.value = false
|
||||
}
|
||||
showLoading.value = false
|
||||
}
|
||||
|
||||
// 获取当前显示的图片源
|
||||
@@ -209,6 +229,8 @@ const setSessionId = (id: string) => {
|
||||
watch(
|
||||
() => props.sketchList,
|
||||
(val) => {
|
||||
console.log('sketchList-----', val);
|
||||
|
||||
if (val.length > 0) {
|
||||
showLoading.value = false
|
||||
}
|
||||
@@ -223,7 +245,8 @@ const setSessionId = (id: string) => {
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
setSessionId
|
||||
setSessionId,
|
||||
setUrls
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -289,6 +312,7 @@ const setSessionId = (id: string) => {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
height: 100%;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
@@ -348,6 +372,7 @@ const setSessionId = (id: string) => {
|
||||
white-space: pre-wrap;
|
||||
overflow-y: auto;
|
||||
margin: 2rem;
|
||||
padding: 0 8.8rem 8.8rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user