bugfix: 卡片传值

This commit is contained in:
2026-03-24 13:59:16 +08:00
parent 21a0acfff9
commit 86911e5f6b
5 changed files with 10 additions and 12 deletions

View File

@@ -580,7 +580,10 @@
// 找到每个 sessionId 对应的最后一项插入sketch卡片
const sessionLastIndexMap = new Map<string, number>()
ancestorsList.forEach((item, index) => {
sessionLastIndexMap.set(item.sessionId, index)
console.log('item', item)
if (item.image_url) {
sessionLastIndexMap.set(item.sessionId, index)
}
})
sessionLastIndexMap.forEach((lastIndex) => {
ancestorsList[lastIndex].text += '<slot slot-name="sketch"></slot>'

View File

@@ -33,7 +33,6 @@
watch(
() => props.messageList,
(val) => {
console.log('messageList',val)
scrollToBottom()
},
{ deep: true }

View File

@@ -1,15 +1,15 @@
<template>
<div class="report-card" :class="{ 'is-url': isUrl, 'is-sketch': isSketch }">
<div class="report-card-header">
<span v-if="!isUrl && !isSketch">{{ report.title }}</span>
<span v-if="!isUrl && !isSketch">{{ title || '' }}</span>
<div v-else class="web-sources flex align-center">
<span>{{ report.title }}</span>
<span>{{ title || '' }}</span>
<img src="@/assets/images/link.png" class="link-icon" />
</div>
</div>
<div class="report-card-content">
<span v-if="!isUrl && !isSketch">{{ report.content || 'markdown.md' }}</span>
<span v-else>{{ report.content }}</span>
<span v-if="!isUrl && !isSketch">{{ content || 'markdown.md' }}</span>
<span v-else>{{ content || '' }}</span>
</div>
</div>
</template>
@@ -26,10 +26,6 @@
content?: string
isUrl?: boolean
isSketch?: boolean
report: {
title: ''
content: ''
}
}>(),
{
isUrl: false,

View File

@@ -1,5 +1,5 @@
<template>
<ReportCard is-sketch :report="{title: 'Sketches Results', content: 'JPG file'}"/>
<ReportCard is-sketch title="Sketches Results" content="JPG file"/>
</template>
<script setup lang="ts">

View File

@@ -1,5 +1,5 @@
<template>
<ReportCard is-url :report="{title: 'WebSources', content: 'Destination URL'}"/>
<ReportCard is-url title="WebSources" content="Destination URL"/>
</template>
<script setup lang="ts">