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" />
6164import { type chatType } from ' @/api/type/application'
6265import { getImgUrl , getAttrsArray , downloadByURL } from ' @/utils/utils'
6366import { onMounted , computed } from ' vue'
67+
6468const props = defineProps <{
6569 application: any
6670 chatRecord: chatType
6771}>()
6872const 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})
7781const 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
8791function 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