|
68 | 68 |
|
69 | 69 | <el-space wrap> |
70 | 70 | <template v-for="(f, i) in data.document_list" :key="i"> |
71 | | - <el-card shadow="never" style="--el-card-padding: 8px" class="file cursor"> |
| 71 | + <el-card |
| 72 | + shadow="never" |
| 73 | + style="--el-card-padding: 8px" |
| 74 | + class="file cursor" |
| 75 | + @click="downloadFile(f)" |
| 76 | + > |
72 | 77 | <div class="flex align-center"> |
73 | 78 | <img :src="getImgUrl(f && f?.name)" alt="" width="24" /> |
74 | | - <div class="ml-4 ellipsis" :title="f && f?.name"> |
| 79 | + <div class="ml-4 ellipsis" :title="getFileName(f)"> |
75 | 80 | {{ f && f?.name }} |
76 | 81 | </div> |
77 | 82 | </div> |
|
86 | 91 | <template v-for="(f, i) in data.image_list" :key="i"> |
87 | 92 | <el-image |
88 | 93 | :src="f.url" |
89 | | - alt="" |
| 94 | + :alt="getFileName(f)" |
| 95 | + :title="getFileName(f)" |
90 | 96 | fit="cover" |
91 | 97 | style="width: 40px; height: 40px; display: block" |
92 | 98 | class="border-r-6" |
| 99 | + :preview-src-list="data.image_list.map((img: any) => img.url)" |
| 100 | + :initial-index="i" |
| 101 | + :zoom-rate="1.2" |
| 102 | + :max-scale="7" |
| 103 | + :min-scale="0.2" |
93 | 104 | /> |
94 | 105 | </template> |
95 | 106 | </el-space> |
|
109 | 120 | </el-space> |
110 | 121 | </div> |
111 | 122 | <div v-if="data.video_list?.length > 0"> |
112 | | - <p class="mb-8 color-secondary">{{ $t('common.fileUpload.image') }}:</p> |
| 123 | + <p class="mb-8 color-secondary">{{ $t('common.fileUpload.video') }}:</p> |
113 | 124 |
|
114 | 125 | <el-space wrap> |
115 | 126 | <template v-for="(f, i) in data.video_list" :key="i"> |
|
124 | 135 | </el-space> |
125 | 136 | </div> |
126 | 137 | <div v-if="data.other_list?.length > 0"> |
127 | | - <p class="mb-8 color-secondary">{{ $t('common.fileUpload.document') }}:</p> |
| 138 | + <p class="mb-8 color-secondary">{{ $t('common.fileUpload.other') }}:</p> |
128 | 139 |
|
129 | 140 | <el-space wrap> |
130 | 141 | <template v-for="(f, i) in data.other_list" :key="i"> |
131 | | - <el-card shadow="never" style="--el-card-padding: 8px" class="file cursor"> |
| 142 | + <el-card |
| 143 | + shadow="never" |
| 144 | + style="--el-card-padding: 8px" |
| 145 | + class="file cursor" |
| 146 | + @click="downloadFile(f)" |
| 147 | + > |
132 | 148 | <div class="flex align-center"> |
133 | 149 | <img :src="getImgUrl(f && f?.name)" alt="" width="24" /> |
134 | | - <div class="ml-4 ellipsis" :title="f && f?.name"> |
| 150 | + <div class="ml-4 ellipsis" :title="getFileName(f)"> |
135 | 151 | {{ f && f?.name }} |
136 | 152 | </div> |
137 | 153 | </div> |
|
222 | 238 | </h5> |
223 | 239 | <div class="p-8-12 border-t-dashed lighter pre-wrap"> |
224 | 240 | <template v-if="Array.isArray(data.question)"> |
225 | | - <div v-for="(item, qIndex) in data.question" :key="qIndex"> |
| 241 | + <!-- 先显示图片列表 --> |
| 242 | + <template v-for="(item, qIndex) in getImageList(data.question)" :key="qIndex"> |
226 | 243 | <el-image |
227 | | - v-if="item.type === 'image_url'" |
228 | 244 | :src="item.image_url?.url || item.image_url" |
229 | | - alt="" |
| 245 | + :alt="getFileName(item)" |
| 246 | + :title="getFileName(item)" |
230 | 247 | fit="cover" |
231 | | - style="width: 40px; height: 40px; display: block" |
232 | | - class="border-r-6 mb-8" |
| 248 | + style="width: 40px; height: 40px" |
| 249 | + class="border-r-6 mb-8 mr-8" |
| 250 | + :preview-src-list="getImageList(data.question).map((img: any) => img.image_url?.url || img.image_url)" |
| 251 | + :initial-index="qIndex" |
| 252 | + :zoom-rate="1.2" |
| 253 | + :max-scale="7" |
| 254 | + :min-scale="0.2" |
| 255 | + /> |
| 256 | + </template> |
| 257 | + <!-- 再显示视频和文本 --> |
| 258 | + <div v-for="(item, qIndex) in data.question" :key="qIndex"> |
| 259 | + <span |
| 260 | + style="display:none" |
| 261 | + v-if="item.type === 'image_url'" |
233 | 262 | /> |
234 | 263 | <video |
235 | 264 | v-else-if="item.type === 'video_url'" |
|
354 | 383 | <!-- 文档内容提取 --> |
355 | 384 | <template v-if="data.type === WorkflowType.DocumentExtractNode"> |
356 | 385 | <div class="card-never border-r-6"> |
| 386 | + <h5 class="p-8-12"> |
| 387 | + {{ $t('common.fileUpload.document') }} |
| 388 | + </h5> |
| 389 | + <div class="p-8-12 border-t-dashed lighter"> |
| 390 | + <div v-if="data.document_list?.length > 0"> |
| 391 | + <el-space wrap> |
| 392 | + <template v-for="(doc, i) in data.document_list" :key="i"> |
| 393 | + <el-card |
| 394 | + shadow="never" |
| 395 | + style="--el-card-padding: 8px" |
| 396 | + class="file cursor" |
| 397 | + :title="getFileName(doc)" |
| 398 | + @click="downloadFile(doc)" |
| 399 | + > |
| 400 | + <div class="flex align-center"> |
| 401 | + <img :src="getImgUrl(doc && doc?.name)" alt="" width="24" /> |
| 402 | + <div class="ml-4 ellipsis" :title="getFileName(doc)"> |
| 403 | + {{ doc && doc?.name }} |
| 404 | + </div> |
| 405 | + </div> |
| 406 | + </el-card> |
| 407 | + </template> |
| 408 | + </el-space> |
| 409 | + </div> |
| 410 | + <div v-else>-</div> |
| 411 | + </div> |
| 412 | + </div> |
| 413 | + <div class="card-never border-r-6 mt-8"> |
357 | 414 | <h5 class="p-8-12 flex align-center"> |
358 | 415 | <span class="mr-4"> {{ $t('common.param.outputParam') }}</span> |
359 | 416 |
|
|
592 | 649 | <el-image |
593 | 650 | v-if="h.type === 'image_url'" |
594 | 651 | :src="h.image_url.url" |
595 | | - alt="" |
| 652 | + :alt="getFileName(h)" |
| 653 | + :title="getFileName(h)" |
596 | 654 | fit="cover" |
597 | 655 | style="width: 40px; height: 40px; display: inline-block" |
598 | 656 | class="border-r-6 mr-8" |
| 657 | + :zoom-rate="1.2" |
| 658 | + :max-scale="7" |
| 659 | + :min-scale="0.2" |
599 | 660 | /> |
600 | 661 |
|
601 | 662 | <span v-else>{{ h.text }}<br /></span> |
|
622 | 683 | <template v-for="(f, i) in data.image_list" :key="i"> |
623 | 684 | <el-image |
624 | 685 | :src="f.url || (f.file_id ? `./oss/file/${f.file_id}` : '')" |
625 | | - alt="" |
| 686 | + :alt="getFileName(f)" |
| 687 | + :title="getFileName(f)" |
626 | 688 | fit="cover" |
627 | 689 | style="width: 40px; height: 40px; display: block" |
628 | 690 | class="border-r-6" |
| 691 | + :preview-src-list="data.image_list.map((img: any) => img.url || (img.file_id ? `./oss/file/${img.file_id}` : ''))" |
| 692 | + :initial-index="i" |
| 693 | + :zoom-rate="1.2" |
| 694 | + :max-scale="7" |
| 695 | + :min-scale="0.2" |
629 | 696 | /> |
630 | 697 | </template> |
631 | 698 | </el-space> |
|
803 | 870 | </div> |
804 | 871 | </div> |
805 | 872 | </template> |
| 873 | + <!-- 文生视频 --> |
806 | 874 | <template v-if="data.type == WorkflowType.TextToVideoGenerateNode"> |
807 | 875 | <div class="card-never border-r-6 mt-8"> |
808 | 876 | <h5 class="p-8-12"> |
|
837 | 905 | </div> |
838 | 906 | </div> |
839 | 907 | </template> |
840 | | - |
| 908 | + <!-- 图生视频 --> |
841 | 909 | <template v-if="data.type == WorkflowType.ImageToVideoGenerateNode"> |
842 | 910 | <div class="card-never border-r-6 mt-8"> |
843 | 911 | <h5 class="p-8-12"> |
|
863 | 931 | <div v-if="typeof data.first_frame_url === 'string'"> |
864 | 932 | <el-image |
865 | 933 | :src="data.first_frame_url" |
866 | | - alt="" |
| 934 | + :alt="getFileName(data)" |
| 935 | + :title="getFileName(data)" |
867 | 936 | fit="cover" |
868 | 937 | style="width: 40px; height: 40px; display: block" |
869 | 938 | class="border-r-6" |
| 939 | + :zoom-rate="1.2" |
| 940 | + :max-scale="7" |
| 941 | + :min-scale="0.2" |
870 | 942 | /> |
871 | 943 | </div> |
872 | 944 | <div v-else-if="Array.isArray(data.first_frame_url)"> |
873 | 945 | <el-space wrap> |
874 | 946 | <template v-for="(f, i) in data.first_frame_url" :key="i"> |
875 | 947 | <el-image |
876 | 948 | :src="f.url" |
877 | | - alt="" |
| 949 | + :alt="getFileName(f)" |
| 950 | + :title="getFileName(f)" |
878 | 951 | fit="cover" |
879 | 952 | style="width: 40px; height: 40px; display: block" |
880 | 953 | class="border-r-6" |
| 954 | + :preview-src-list="data.first_frame_url.map((img: any) => img.url)" |
| 955 | + :initial-index="i" |
| 956 | + :zoom-rate="1.2" |
| 957 | + :max-scale="7" |
| 958 | + :min-scale="0.2" |
881 | 959 | /> |
882 | 960 | </template> |
883 | 961 | </el-space> |
|
892 | 970 | <div v-if="typeof data.last_frame_url === 'string'"> |
893 | 971 | <el-image |
894 | 972 | :src="data.last_frame_url" |
895 | | - alt="" |
| 973 | + :alt="getFileName(data)" |
| 974 | + :title="getFileName(data)" |
896 | 975 | fit="cover" |
897 | 976 | style="width: 40px; height: 40px; display: block" |
898 | 977 | class="border-r-6" |
| 978 | + :zoom-rate="1.2" |
| 979 | + :max-scale="7" |
| 980 | + :min-scale="0.2" |
899 | 981 | /> |
900 | 982 | </div> |
901 | 983 | <div v-else-if="Array.isArray(data.last_frame_url)"> |
902 | 984 | <el-space wrap> |
903 | 985 | <template v-for="(f, i) in data.last_frame_url" :key="i"> |
904 | 986 | <el-image |
905 | 987 | :src="f.url" |
906 | | - alt="" |
| 988 | + :alt="getFileName(f)" |
| 989 | + :title="getFileName(f)" |
907 | 990 | fit="cover" |
908 | 991 | style="width: 40px; height: 40px; display: block" |
909 | 992 | class="border-r-6" |
| 993 | + :preview-src-list="data.last_frame_url.map((img: any) => img.url)" |
| 994 | + :initial-index="i" |
| 995 | + :zoom-rate="1.2" |
| 996 | + :max-scale="7" |
| 997 | + :min-scale="0.2" |
910 | 998 | /> |
911 | 999 | </template> |
912 | 1000 | </el-space> |
@@ -1422,6 +1510,33 @@ const isKnowLedge = computed(() => props.type === 'knowledge') |
1422 | 1510 | const currentLoopNode = ref(0) |
1423 | 1511 | const currentParagraph = ref(0) |
1424 | 1512 | const currentWriteContent = ref(0) |
| 1513 | +
|
| 1514 | +const getImageList = (questions: any) => { |
| 1515 | + const imageList: any[] = [] |
| 1516 | + questions.forEach((question: any) => { |
| 1517 | + if (question.type === 'image_url') { |
| 1518 | + imageList.push(question) |
| 1519 | + } |
| 1520 | + }) |
| 1521 | + return imageList |
| 1522 | +} |
| 1523 | +
|
| 1524 | +const getFileName = (file: any) => { |
| 1525 | + if (file) { |
| 1526 | + return file?.file_name || file?.name || file?.image_url?.details || JSON.stringify(file) |
| 1527 | + } else { |
| 1528 | + return '' |
| 1529 | + } |
| 1530 | +} |
| 1531 | +
|
| 1532 | +// 下载文件 |
| 1533 | +const downloadFile = (file: any) => { |
| 1534 | + if (file) { |
| 1535 | + window.open(file.url || `./oss/file/${file.file_id || file.id}`, '_blank') |
| 1536 | + } else { |
| 1537 | + console.error('下载文件失败,原因:链接未知,file =', file) |
| 1538 | + } |
| 1539 | +} |
1425 | 1540 | </script> |
1426 | 1541 | <style lang="scss" scoped> |
1427 | 1542 | .execution-detail-card { |
|
0 commit comments