feat: 报告初步显示

This commit is contained in:
2026-03-13 17:23:56 +08:00
parent 570701b927
commit 430d3fb7f1
5 changed files with 256 additions and 77 deletions

View File

@@ -16,7 +16,7 @@
class="img-item"
/>
</div>
<div class="message-context" v-show="content.thinking">
<div class="message-context" v-show="content.thinkingText?.length > 0">
<div class="thinking">
<div
class="thinking-header flex align-center"
@@ -37,15 +37,16 @@
:markdown="content.text"
:rehype-plugins="[rehypeRaw]"
>
<template v-slot:s-ReportCard="" {children:children,...attrs}>
<ReportCard
:report="{ title: attrs.title, content: attrs.content }"
@click="handleClickReport(content)"
/>
<template v-slot:s-card="{ children: children, ...attrs }">
<Card :title="attrs.title" @click.native="handleClickReport" />
</template>
</VueMarkdown>
</div>
<div class="operate flex" :class="{ 'is-user': content.isUser }">
<div
v-show="!content.thinking"
class="operate flex"
:class="{ 'is-user': content.isUser }"
>
<template v-if="content.isUser">
<SvgIcon name="copy" size="16" color="#000" @click.stop="handleCopyText" />
</template>
@@ -81,11 +82,12 @@
import gsap from 'gsap'
import userThumb from '@/assets/images/user-thumb.jpg'
import agentThumb from '@/assets/images/agent-thumb.png'
import ReportCard from './ReportCard.vue'
import UrlCard from './UrlCard.vue'
import Card from './ReportCard.vue'
import Url from './UrlCard.vue'
import { VueMarkdown } from '@crazydos/vue-markdown'
import type { CustomAttrs } from '@crazydos/vue-markdown'
import rehypeRaw from 'rehype-raw'
import MyEvent from '@/utils/myEvent'
const { t } = useI18n()
@@ -94,6 +96,14 @@
isLast: Boolean
}>()
watch(
() => props.content,
(newVal) => {
console.log('newVal-----', newVal)
},
{ immediate: true }
)
const emit = defineEmits(['regenerate'])
const imageList = computed(() => {
@@ -200,7 +210,8 @@
props.content.thinkingCollapsed = !props.content.thinkingCollapsed
}
const handleClickReport = (data) => {
const handleClickReport = () => {
MyEvent.emit('openReport', props.content.sessionId)
// 点击显示报告
}
const handleClickUrls = (data) => {