|
@@ -4,42 +4,19 @@
|
|
|
<div class="user-info-container">
|
|
<div class="user-info-container">
|
|
|
<a-card :bordered="false" class="boxShadow cardBox mr-3 flex-3">
|
|
<a-card :bordered="false" class="boxShadow cardBox mr-3 flex-3">
|
|
|
<div class="video-info">
|
|
<div class="video-info">
|
|
|
- <div
|
|
|
|
|
- v-if="videoFormat == 'jpg' || videoFormat == 'bmp' || videoFormat == 'png' || videoFormat == 'jpeg'"
|
|
|
|
|
- style="width: 100%; height: 600px"
|
|
|
|
|
- >
|
|
|
|
|
- <a-image width="100%" height="600px" :src="fileSrc(resSrc)" :preview="true" />
|
|
|
|
|
- </div>
|
|
|
|
|
- <div
|
|
|
|
|
- v-if="
|
|
|
|
|
- videoFormat == 'mkv' ||
|
|
|
|
|
- videoFormat == 'mp4' ||
|
|
|
|
|
- videoFormat == 'wmv' ||
|
|
|
|
|
- videoFormat == 'avi' ||
|
|
|
|
|
- videoFormat == 'flv' ||
|
|
|
|
|
- videoFormat == 'mpeg' ||
|
|
|
|
|
- videoFormat == 'mpg' ||
|
|
|
|
|
- videoFormat == 'rmvb' ||
|
|
|
|
|
- videoFormat == 'mov'
|
|
|
|
|
- "
|
|
|
|
|
- style="width: 100%; height: 600px"
|
|
|
|
|
- >
|
|
|
|
|
- <video :src="fileSrc(resSrc)" controls style="width: 100%; height: 100%" />
|
|
|
|
|
- </div>
|
|
|
|
|
- <div
|
|
|
|
|
- v-if="
|
|
|
|
|
- videoFormat == 'docx' ||
|
|
|
|
|
- videoFormat == 'doc' ||
|
|
|
|
|
- videoFormat == 'ppt' ||
|
|
|
|
|
- videoFormat == 'pptx' ||
|
|
|
|
|
- videoFormat == 'xls' ||
|
|
|
|
|
- videoFormat == 'xlsx' ||
|
|
|
|
|
- videoFormat == 'pdf'
|
|
|
|
|
- "
|
|
|
|
|
- style="width: 100%; height: 600px"
|
|
|
|
|
- >
|
|
|
|
|
- <FilePreviewer v-if="resSrc" :fileUrl="fileSrc(resSrc)" :fileName="resName" :fileType="fileType" />
|
|
|
|
|
- <div v-if="!resSrc">暂无数据</div>
|
|
|
|
|
|
|
+ <div style="height: 600px">
|
|
|
|
|
+ <div v-if="isImageFile(resSrc)" style="width: 100%; height: 100%">
|
|
|
|
|
+ <a-image width="100%" height="100%" :src="fileSrc(resSrc)" :preview="true" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-if="isVideoFile(resSrc)" style="width: 100%; height: 100%">
|
|
|
|
|
+ <video :src="fileSrc(resSrc)" controls style="width: 100%; height: 100%" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-if="isDocumentFile(resSrc)" style="width: 100%; height: 100%">
|
|
|
|
|
+ <FilePreviewer v-if="resSrc" :fileUrl="fileSrc(resSrc)" :fileName="resName" :fileType="fileType" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="imgBox" v-if="unknownFile">
|
|
|
|
|
+ <a-image height="100%" :src="unknownFile" :preview="false" />
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 用户信息部分 -->
|
|
<!-- 用户信息部分 -->
|
|
|
<div class="user-info" style="display: flex; flex-direction: column">
|
|
<div class="user-info" style="display: flex; flex-direction: column">
|
|
@@ -148,6 +125,7 @@
|
|
|
import FilePreviewer from './FilePreviewer.vue'
|
|
import FilePreviewer from './FilePreviewer.vue'
|
|
|
import EventBus from '@/utils/EventBus'
|
|
import EventBus from '@/utils/EventBus'
|
|
|
import tool from '@/utils/tool'
|
|
import tool from '@/utils/tool'
|
|
|
|
|
+ import { isVideoFile, isImageFile, isDocumentFile } from '@/utils/fileUtil'
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
@@ -220,6 +198,12 @@
|
|
|
itemData.value = data
|
|
itemData.value = data
|
|
|
}
|
|
}
|
|
|
const fileSrc = computed(() => (e) => sysConfig.FILE_URL + e)
|
|
const fileSrc = computed(() => (e) => sysConfig.FILE_URL + e)
|
|
|
|
|
+ const imageUrl = new URL(`@/assets/images/fileImg/file.png`, import.meta.url).href
|
|
|
|
|
+ const unknownFile = computed((e) => {
|
|
|
|
|
+ if (!isImageFile(resSrc.value) && !isVideoFile(resSrc.value) && !isDocumentFile(resSrc.value)) {
|
|
|
|
|
+ return imageUrl
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
const getData = (item) => {
|
|
const getData = (item) => {
|
|
|
detail({ id: item.id })
|
|
detail({ id: item.id })
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
@@ -511,4 +495,10 @@
|
|
|
.flex-1 {
|
|
.flex-1 {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
}
|
|
}
|
|
|
|
|
+ .imgBox {
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|