文件选择器的url和附件管理的url优化
This commit is contained in:
@@ -13,15 +13,16 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import { ref, defineProps, PropType, watch, onMounted, h } from 'vue';
|
||||
import { successNotification } from '/@/utils/message';
|
||||
import { getBaseURL } from '/@/utils/baseUrl';
|
||||
const props = defineProps({
|
||||
fileData: { type: Object as PropType<any>, required: true },
|
||||
api: { type: Object as PropType<any>, required: true },
|
||||
});
|
||||
const _OtherFileComponent = defineComponent({ template: '<el-icon><Files /></el-icon>' });
|
||||
const FileTypes = [
|
||||
{ tag: 'img', attr: { src: props.fileData.url, draggable: false } },
|
||||
{ tag: 'video', attr: { src: props.fileData.url, controls: false, autoplay: true, muted: true, loop: true } },
|
||||
{ tag: 'audio', attr: { src: props.fileData.url, controls: true, autoplay: false, muted: false, loop: false, volume: 0 } },
|
||||
{ tag: 'img', attr: { src: getBaseURL(props.fileData.url), draggable: false } },
|
||||
{ tag: 'video', attr: { src: getBaseURL(props.fileData.url), controls: false, autoplay: true, muted: true, loop: true } },
|
||||
{ tag: 'audio', attr: { src: getBaseURL(props.fileData.url), controls: true, autoplay: false, muted: false, loop: false, volume: 0 } },
|
||||
{ tag: _OtherFileComponent, attr: { style: { fontSize: '2rem' } } },
|
||||
];
|
||||
const isShow = ref<boolean>(false);
|
||||
|
||||
@@ -12,15 +12,17 @@
|
||||
</template>
|
||||
<template #cell_preview="scope">
|
||||
<div v-if="scope.row.file_type === 0">
|
||||
<el-image style="width: 100%; aspect-ratio: 1 /1 ;" :src="scope.row.url" :preview-src-list="[scope.row.url]"
|
||||
:preview-teleported="true" />
|
||||
<el-image style="width: 100%; aspect-ratio: 1 /1 ;" :src="getBaseURL(scope.row.url)"
|
||||
:preview-src-list="[getBaseURL(scope.row.url)]" :preview-teleported="true" />
|
||||
</div>
|
||||
<div v-if="scope.row.file_type === 1" class="_preview" @click="openPreviewHandle(scope.row.url, 'video')">
|
||||
<div v-if="scope.row.file_type === 1" class="_preview"
|
||||
@click="openPreviewHandle(getBaseURL(scope.row.url), 'video')">
|
||||
<el-icon :size="60">
|
||||
<VideoCamera />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div v-if="scope.row.file_type === 2" class="_preview" @click="openPreviewHandle(scope.row.url, 'video')">
|
||||
<div v-if="scope.row.file_type === 2" class="_preview"
|
||||
@click="openPreviewHandle(getBaseURL(scope.row.url), 'video')">
|
||||
<el-icon :size="60">
|
||||
<Headset />
|
||||
</el-icon>
|
||||
|
||||
Reference in New Issue
Block a user