Skip to content

Commit adad526

Browse files
committed
fix: 修复历史记录不显示图片的缺陷
--bug=1050151 --user=王孝刚 【应用】演示界面、全屏嵌入、浮窗嵌入历史记录和对话日志中不显示上传的图片 https://www.tapd.cn/57709429/s/1627628
1 parent 672cb7d commit adad526

File tree

1 file changed

+18
-9
lines changed
  • ui/src/components/ai-chat/component/question-content

1 file changed

+18
-9
lines changed

ui/src/components/ai-chat/component/question-content/index.vue

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
<template v-for="(item, index) in document_list" :key="index">
2121
<el-card shadow="never" style="--el-card-padding: 8px" class="download-file cursor">
2222
<div class="download-button flex align-center" @click="downloadFile(item)">
23-
<el-icon class="mr-4"><Download /></el-icon>点击下载文件
23+
<el-icon class="mr-4">
24+
<Download />
25+
</el-icon>
26+
点击下载文件
2427
</div>
2528
<div class="show flex align-center">
2629
<img :src="getImgUrl(item && item?.name)" alt="" width="24" />
@@ -61,27 +64,28 @@
6164
import { type chatType } from '@/api/type/application'
6265
import { getImgUrl, getAttrsArray, downloadByURL } from '@/utils/utils'
6366
import { onMounted, computed } from 'vue'
67+
6468
const props = defineProps<{
6569
application: any
6670
chatRecord: chatType
6771
}>()
6872
const document_list = computed(() => {
6973
if (props.chatRecord?.upload_meta) {
7074
return props.chatRecord.upload_meta?.document_list || []
71-
} else if (props.chatRecord.execution_details?.length > 0) {
72-
return props.chatRecord.execution_details[0]?.document_list || []
73-
} else {
74-
return []
7575
}
76+
const startNode = props.chatRecord.execution_details?.find(
77+
(detail) => detail.type === 'start-node'
78+
)
79+
return startNode?.document_list || []
7680
})
7781
const image_list = computed(() => {
7882
if (props.chatRecord?.upload_meta) {
7983
return props.chatRecord.upload_meta?.image_list || []
80-
} else if (props.chatRecord.execution_details?.length > 0) {
81-
return props.chatRecord.execution_details[0]?.image_list || []
82-
} else {
83-
return []
8484
}
85+
const startNode = props.chatRecord.execution_details?.find(
86+
(detail) => detail.type === 'start-node'
87+
)
88+
return startNode?.image_list || []
8589
})
8690
8791
function downloadFile(item: any) {
@@ -94,21 +98,26 @@ onMounted(() => {})
9498
.download-file {
9599
width: 200px;
96100
height: 43px;
101+
97102
&:hover {
98103
color: var(--el-color-primary);
99104
border: 1px solid var(--el-color-primary);
105+
100106
.download-button {
101107
display: block;
102108
text-align: center;
103109
line-height: 26px;
104110
}
111+
105112
.show {
106113
display: none;
107114
}
108115
}
116+
109117
.show {
110118
display: block;
111119
}
120+
112121
.download-button {
113122
display: none;
114123
}

0 commit comments

Comments
 (0)