mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-09-17 19:06:39 +08:00
修改文件预览组件的文件下载方式为接口方式下载,解决了下载时整个页面闪烁的问题;优化相册样式。
This commit is contained in:
parent
2e0cb6a96d
commit
9100dc1225
@ -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);
|
||||
}
|
||||
|
||||
// 判断图片类型
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user