Merge pull request 'edit' (#225) from lyc-dev into main
This commit is contained in:
commit
d1454a288f
|
@ -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]
|
||||
if(res.rows.length){
|
||||
Object.assign(curFile, fileList.value[0])
|
||||
curFileId.value = fileList.value[0].id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue