bugfix: 卡片传值
This commit is contained in:
@@ -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>'
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
watch(
|
||||
() => props.messageList,
|
||||
(val) => {
|
||||
console.log('messageList',val)
|
||||
scrollToBottom()
|
||||
},
|
||||
{ deep: true }
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user