edit #225

Merged
lyc merged 1 commits from lyc-dev into main 2025-01-15 16:08:27 +08:00
1 changed files with 9 additions and 6 deletions
Showing only changes of commit 5ff9a5387a - Show all commits

View File

@ -8,6 +8,7 @@
</template>
<div class="dialog-content" v-loading="loading">
<div class="content-list">
<el-empty description="暂无数据" v-if="!fileList.length" />
<el-radio-group v-model="curFileId">
<el-row>
<el-col :span="12" v-for="item in fileList" :key="item.id">
@ -51,7 +52,7 @@
<i class="iconfont icon-guanbi" @click="prevVisible = false"></i>
</div>
</template>
<div style="height: calc(100vh - 120px)">
<div style="height: calc(100vh - 120px); text-align: center;">
<template v-if="getFileSuffix(prevItem.fileUrl) == 'pdf'">
<iframe :src="prevItem.fileUrl" frameborder="0" width="100%" height="100%"></iframe>
</template>
@ -97,7 +98,7 @@ const props = defineProps({
const isPrev = (item) => {
return computed(() => {
return ['pdf', 'png', 'jpg', 'jpeg', 'gif'].includes(getFileSuffix(item.fileUrl))
return ['pdf', 'png', 'jpg', 'jpeg', 'gif', 'webp'].includes(getFileSuffix(item.fileUrl))
})
}
@ -135,12 +136,14 @@ const fileList = ref([])
const curFile = reactive({})
const getList = () => {
docList({
userId: userInfo.userId,
dataset_id: dataset_id.value
createUser: userInfo.userId,
datasetId: dataset_id.value
}).then((res) => {
fileList.value = [...res.rows]
Object.assign(curFile, fileList.value[0])
curFileId.value = fileList.value[0].id
if(res.rows.length){
Object.assign(curFile, fileList.value[0])
curFileId.value = fileList.value[0].id
}
})
}