fix: 修复历史记录不显示图片的缺陷
--bug=1050151 --user=王孝刚 【应用】演示界面、全屏嵌入、浮窗嵌入历史记录和对话日志中不显示上传的图片 https://www.tapd.cn/57709429/s/1627628
This commit is contained in:
parent
672cb7dd34
commit
adad526a4f
@ -20,7 +20,10 @@
|
|||||||
<template v-for="(item, index) in document_list" :key="index">
|
<template v-for="(item, index) in document_list" :key="index">
|
||||||
<el-card shadow="never" style="--el-card-padding: 8px" class="download-file cursor">
|
<el-card shadow="never" style="--el-card-padding: 8px" class="download-file cursor">
|
||||||
<div class="download-button flex align-center" @click="downloadFile(item)">
|
<div class="download-button flex align-center" @click="downloadFile(item)">
|
||||||
<el-icon class="mr-4"><Download /></el-icon>点击下载文件
|
<el-icon class="mr-4">
|
||||||
|
<Download />
|
||||||
|
</el-icon>
|
||||||
|
点击下载文件
|
||||||
</div>
|
</div>
|
||||||
<div class="show flex align-center">
|
<div class="show flex align-center">
|
||||||
<img :src="getImgUrl(item && item?.name)" alt="" width="24" />
|
<img :src="getImgUrl(item && item?.name)" alt="" width="24" />
|
||||||
@ -61,6 +64,7 @@
|
|||||||
import { type chatType } from '@/api/type/application'
|
import { type chatType } from '@/api/type/application'
|
||||||
import { getImgUrl, getAttrsArray, downloadByURL } from '@/utils/utils'
|
import { getImgUrl, getAttrsArray, downloadByURL } from '@/utils/utils'
|
||||||
import { onMounted, computed } from 'vue'
|
import { onMounted, computed } from 'vue'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
application: any
|
application: any
|
||||||
chatRecord: chatType
|
chatRecord: chatType
|
||||||
@ -68,20 +72,20 @@ const props = defineProps<{
|
|||||||
const document_list = computed(() => {
|
const document_list = computed(() => {
|
||||||
if (props.chatRecord?.upload_meta) {
|
if (props.chatRecord?.upload_meta) {
|
||||||
return props.chatRecord.upload_meta?.document_list || []
|
return props.chatRecord.upload_meta?.document_list || []
|
||||||
} else if (props.chatRecord.execution_details?.length > 0) {
|
|
||||||
return props.chatRecord.execution_details[0]?.document_list || []
|
|
||||||
} else {
|
|
||||||
return []
|
|
||||||
}
|
}
|
||||||
|
const startNode = props.chatRecord.execution_details?.find(
|
||||||
|
(detail) => detail.type === 'start-node'
|
||||||
|
)
|
||||||
|
return startNode?.document_list || []
|
||||||
})
|
})
|
||||||
const image_list = computed(() => {
|
const image_list = computed(() => {
|
||||||
if (props.chatRecord?.upload_meta) {
|
if (props.chatRecord?.upload_meta) {
|
||||||
return props.chatRecord.upload_meta?.image_list || []
|
return props.chatRecord.upload_meta?.image_list || []
|
||||||
} else if (props.chatRecord.execution_details?.length > 0) {
|
|
||||||
return props.chatRecord.execution_details[0]?.image_list || []
|
|
||||||
} else {
|
|
||||||
return []
|
|
||||||
}
|
}
|
||||||
|
const startNode = props.chatRecord.execution_details?.find(
|
||||||
|
(detail) => detail.type === 'start-node'
|
||||||
|
)
|
||||||
|
return startNode?.image_list || []
|
||||||
})
|
})
|
||||||
|
|
||||||
function downloadFile(item: any) {
|
function downloadFile(item: any) {
|
||||||
@ -94,21 +98,26 @@ onMounted(() => {})
|
|||||||
.download-file {
|
.download-file {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: 43px;
|
height: 43px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
border: 1px solid var(--el-color-primary);
|
border: 1px solid var(--el-color-primary);
|
||||||
|
|
||||||
.download-button {
|
.download-button {
|
||||||
display: block;
|
display: block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 26px;
|
line-height: 26px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.show {
|
.show {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.show {
|
.show {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.download-button {
|
.download-button {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user