修改文件预览组件的文件下载方式为接口方式下载,解决了下载时整个页面闪烁的问题;优化相册样式。

This commit is contained in:
Zhou Mingfa 2024-04-11 20:24:59 +08:00
parent 2e0cb6a96d
commit 9100dc1225
3 changed files with 8 additions and 8 deletions

View File

@ -24,7 +24,6 @@
<script setup>
import { ref } from 'vue';
import { getDownload } from '/@/lib/axios';
import { fileApi } from '/src/api/support/file-api';
import { smartSentry } from '/@/lib/smart-sentry';
import { SmartLoading } from '/@/components/framework/smart-loading';
@ -62,7 +61,7 @@
setVisible(true);
return;
}
window.open(fileItem.fileUrl);
fileApi.downLoadFile(fileItem.fileKey);
}
//

View File

@ -22,8 +22,9 @@
v-for="(item, index) in fileList"
:key="index"
:src="item.fileUrl"
:style="{ display: type === 'text' ? 'none' : '' }"
:style="{ display: type === 'text' ? 'none' : '', padding: '2px', height: '100px' }"
:width="width"
@click="preview(item, index)"
/>
</a-image-preview-group>
</a-space>
@ -31,7 +32,7 @@
</template>
<script setup>
import { ref } from 'vue';
import { getDownload } from '/@/lib/axios';
import { fileApi } from '/src/api/support/file-api';
let props = defineProps({
fileList: {
@ -48,7 +49,7 @@
// image
width: {
type: Number,
default: 150,
default: 100,
},
// html <br/>
separator: {
@ -64,7 +65,7 @@
previewCurrent.value = index;
visible.value = true;
} else {
window.open(file.fileUrl);
fileApi.downLoadFile(file.fileKey);
}
}

View File

@ -45,7 +45,7 @@
<a-table rowKey="feedbackId" :dataSource="tableData" :columns="tableColumns" :pagination="false" :loading="tableLoading" size="small" bordered>
<template #bodyCell="{ text, column }">
<template v-if="column.dataIndex === 'feedbackAttachment'">
<FilePreview :fileList="text" />
<FilePreview :fileList="text" type="picture" />
</template>
<template v-if="column.dataIndex === 'userType'">
<span>{{ $smartEnumPlugin.getDescByValue('USER_TYPE_ENUM', text) }}</span>