2024-11-13 02:37:16 +00:00
|
|
|
<template>
|
|
|
|
|
<!-- 问题内容 -->
|
|
|
|
|
<div class="item-content mb-16 lighter">
|
|
|
|
|
<div class="avatar">
|
|
|
|
|
<el-image
|
|
|
|
|
v-if="application.user_avatar"
|
|
|
|
|
:src="application.user_avatar"
|
|
|
|
|
alt=""
|
|
|
|
|
fit="cover"
|
2024-11-13 03:37:36 +00:00
|
|
|
style="width: 32px; height: 32px; display: block"
|
2024-11-13 02:37:16 +00:00
|
|
|
/>
|
|
|
|
|
<AppAvatar v-else>
|
2024-11-13 03:37:36 +00:00
|
|
|
<img src="@/assets/user-icon.svg" style="width: 50%" alt="" />
|
2024-11-13 02:37:16 +00:00
|
|
|
</AppAvatar>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<div class="text break-all pre-wrap">
|
2024-11-18 10:08:12 +00:00
|
|
|
<div class="mb-8" v-if="document_list.length">
|
|
|
|
|
<el-space wrap>
|
|
|
|
|
<template v-for="(item, index) in document_list" :key="index">
|
|
|
|
|
<el-card shadow="never" style="--el-card-padding: 8px" class="file cursor">
|
|
|
|
|
<div class="flex align-center">
|
|
|
|
|
<img :src="getImgUrl(item && item?.name)" alt="" width="24" />
|
|
|
|
|
<div class="ml-4 ellipsis" :title="item && item?.name">
|
|
|
|
|
{{ item && item?.name }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-card>
|
|
|
|
|
</template>
|
|
|
|
|
</el-space>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mb-8" v-if="image_list.length">
|
|
|
|
|
<el-space wrap>
|
|
|
|
|
<template v-for="(item, index) in image_list" :key="index">
|
2024-11-18 11:10:39 +00:00
|
|
|
<div class="file cursor border-r-4" v-if="item.url">
|
2024-11-18 10:08:12 +00:00
|
|
|
<el-image
|
|
|
|
|
:src="item.url"
|
|
|
|
|
:zoom-rate="1.2"
|
|
|
|
|
:max-scale="7"
|
|
|
|
|
:min-scale="0.2"
|
|
|
|
|
:preview-src-list="getAttrsArray(image_list, 'url')"
|
|
|
|
|
alt=""
|
|
|
|
|
fit="cover"
|
|
|
|
|
style="width: 170px; height: 170px; display: block"
|
|
|
|
|
class="border-r-4"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-space>
|
|
|
|
|
</div>
|
2024-11-13 02:37:16 +00:00
|
|
|
{{ chatRecord.problem_text }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { type chatType } from '@/api/type/application'
|
2024-11-18 10:08:12 +00:00
|
|
|
import { getImgUrl, getAttrsArray } from '@/utils/utils'
|
|
|
|
|
import { onMounted, computed } from 'vue'
|
2024-11-13 06:48:01 +00:00
|
|
|
const props = defineProps<{
|
2024-11-13 02:37:16 +00:00
|
|
|
application: any
|
|
|
|
|
chatRecord: chatType
|
|
|
|
|
}>()
|
2024-11-18 10:08:12 +00:00
|
|
|
const document_list = computed(() => {
|
2024-11-18 11:10:39 +00:00
|
|
|
if (props.chatRecord?.upload_meta) {
|
|
|
|
|
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 []
|
|
|
|
|
}
|
2024-11-18 10:08:12 +00:00
|
|
|
})
|
|
|
|
|
const image_list = computed(() => {
|
2024-11-18 11:10:39 +00:00
|
|
|
if (props.chatRecord?.upload_meta) {
|
|
|
|
|
return props.chatRecord.upload_meta?.image_list || []
|
|
|
|
|
} else if (props.chatRecord.execution_details?.length > 0) {
|
|
|
|
|
return props.chatRecord.execution_details[0]?.image_list || []
|
2024-11-18 10:08:12 +00:00
|
|
|
} else {
|
|
|
|
|
return []
|
|
|
|
|
}
|
|
|
|
|
})
|
2024-11-13 06:48:01 +00:00
|
|
|
|
|
|
|
|
onMounted(() => {
|
2024-11-21 04:54:43 +00:00
|
|
|
// console.log(props.chatRecord.execution_details)
|
|
|
|
|
// if (props.chatRecord.execution_details?.length > 0) {
|
|
|
|
|
// props.chatRecord.execution_details[0].image_list?.forEach((image: any) => {
|
|
|
|
|
// console.log('image', image.name, image.url)
|
|
|
|
|
// })
|
|
|
|
|
// }
|
2024-11-13 06:48:01 +00:00
|
|
|
})
|
2024-11-13 02:37:16 +00:00
|
|
|
</script>
|
2024-11-18 10:08:12 +00:00
|
|
|
<style lang="scss" scoped></style>
|