|
@@ -3,18 +3,25 @@
|
|
|
<div class="audit-container">
|
|
<div class="audit-container">
|
|
|
<!-- 左侧 - 文件展示区域 -->
|
|
<!-- 左侧 - 文件展示区域 -->
|
|
|
<div class="file-preview">
|
|
<div class="file-preview">
|
|
|
- <video-player v-if="recordData.suffix === 'mp4'" :options="playerOptions" @ready="playerReadied"></video-player>
|
|
|
|
|
- <div v-else-if="recordData.suffix === 'ppt'" class="preview-placeholder">
|
|
|
|
|
- <file-ppt-filled style="font-size: 48px; color: #d24638" />
|
|
|
|
|
- <p>PPT文件预览</p>
|
|
|
|
|
|
|
+ <!-- <img src="/src/assets/images/flw/REVOKE.png" /> -->
|
|
|
|
|
+ <video-player
|
|
|
|
|
+ v-if="recordData.suffix === 'mp4'"
|
|
|
|
|
+ :source="activeVideoSource"
|
|
|
|
|
+ @ready="playerReadied"
|
|
|
|
|
+ ></video-player>
|
|
|
|
|
+ <div v-else-if="['pdf', 'word', 'ppt', 'doc'].includes(recordData.suffix.toLowerCase())" class="preview-iframe">
|
|
|
|
|
+ <iframe
|
|
|
|
|
+ :src="`https://docs.google.com/gview?url=${sysConfig.FILE_URL + recordData.fileUrl}&embedded=true`"
|
|
|
|
|
+ frameborder="0"
|
|
|
|
|
+ ></iframe>
|
|
|
</div>
|
|
</div>
|
|
|
- <div v-else-if="recordData.suffix === 'word'" class="preview-placeholder">
|
|
|
|
|
- <file-word-filled style="font-size: 48px; color: #2b579a" />
|
|
|
|
|
- <p>Word文件预览</p>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div v-else-if="recordData.suffix === 'pdf'" class="preview-placeholder">
|
|
|
|
|
- <file-pdf-filled style="font-size: 48px; color: #f40f02" />
|
|
|
|
|
- <p>PDF文件预览</p>
|
|
|
|
|
|
|
+ <!-- 图片预览 -->
|
|
|
|
|
+ <div v-else-if="['jpg', 'jpeg', 'png', 'gif'].includes(recordData.suffix.toLowerCase())" class="image-viewer">
|
|
|
|
|
+ <img
|
|
|
|
|
+ :src="sysConfig.FILE_URL + recordData.fileUrl"
|
|
|
|
|
+ :alt="recordData.fileName"
|
|
|
|
|
+ style="max-width: 100%; max-height: 100%; object-fit: contain"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
<div v-else class="preview-placeholder">
|
|
<div v-else class="preview-placeholder">
|
|
|
<file-unknown-filled style="font-size: 48px; color: #999" />
|
|
<file-unknown-filled style="font-size: 48px; color: #999" />
|
|
@@ -28,7 +35,7 @@
|
|
|
<p><strong>上传人:</strong>{{ detailData.resourceCreaterUserName || '--' }}</p>
|
|
<p><strong>上传人:</strong>{{ detailData.resourceCreaterUserName || '--' }}</p>
|
|
|
<p><strong>所属院系:</strong>{{ detailData?.collegeAllIdName || '--' }}</p>
|
|
<p><strong>所属院系:</strong>{{ detailData?.collegeAllIdName || '--' }}</p>
|
|
|
<p><strong>所属专业:</strong>{{ detailData?.majorIdName || '--' }}</p>
|
|
<p><strong>所属专业:</strong>{{ detailData?.majorIdName || '--' }}</p>
|
|
|
- <p><strong>资源类型:</strong>{{ detailData?.courseTypeName || '--' }}</p>
|
|
|
|
|
|
|
+ <p><strong>资源类型:</strong>{{ detailData?.resourceTypeName || '--' }}</p>
|
|
|
<p><strong>资源格式:</strong>{{ detailData?.suffix || '--' }}</p>
|
|
<p><strong>资源格式:</strong>{{ detailData?.suffix || '--' }}</p>
|
|
|
<p><strong>视频时长:</strong>{{ detailData?.duration || '--' }}</p>
|
|
<p><strong>视频时长:</strong>{{ detailData?.duration || '--' }}</p>
|
|
|
<p><strong>视频大小:</strong>{{ detailData?.FILESIZE || '--' }}<span v-if="detailData?.FILESIZE">b</span></p>
|
|
<p><strong>视频大小:</strong>{{ detailData?.FILESIZE || '--' }}<span v-if="detailData?.FILESIZE">b</span></p>
|
|
@@ -47,6 +54,8 @@
|
|
|
<script setup>
|
|
<script setup>
|
|
|
import { ref, defineProps, defineEmits, computed } from 'vue'
|
|
import { ref, defineProps, defineEmits, computed } from 'vue'
|
|
|
import resourceAuditApi from '@/api/resourceAudit.js'
|
|
import resourceAuditApi from '@/api/resourceAudit.js'
|
|
|
|
|
+ import VideoPlayer from './VideoPlayer.vue'
|
|
|
|
|
+ import sysConfig from '@/config/index'
|
|
|
// import videoPlayer from 'vue-video-player'
|
|
// import videoPlayer from 'vue-video-player'
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
recordData: {
|
|
recordData: {
|
|
@@ -69,13 +78,23 @@
|
|
|
const visibles = ref(true)
|
|
const visibles = ref(true)
|
|
|
|
|
|
|
|
const playerOptions = computed(() => ({
|
|
const playerOptions = computed(() => ({
|
|
|
|
|
+ autoplay: false, // 禁止自动播放
|
|
|
|
|
+ controls: true, // 显示控制条
|
|
|
|
|
+ fluid: true, // 流体布局
|
|
|
|
|
+ preload: 'auto', // 预加载
|
|
|
sources: [
|
|
sources: [
|
|
|
{
|
|
{
|
|
|
type: 'video/mp4',
|
|
type: 'video/mp4',
|
|
|
- src: props.recordData.filePath // 视频文件路径
|
|
|
|
|
|
|
+ src: sysConfig.FILE_URL + props.recordData.fileUrl
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
- poster: props.recordData.posterPath // 封面图片路径
|
|
|
|
|
|
|
+ techOrder: ['html5'], // 优先使用html5播放
|
|
|
|
|
+ // poster: sysConfig.FILE_URL + props.recordData.posterPath
|
|
|
|
|
+ poster: 'http://192.168.1.245:10005/education/upload/20250702/21d8bc591e499136c393c13cf5343f6c.jpeg'
|
|
|
|
|
+ }))
|
|
|
|
|
+ const activeVideoSource = computed(() => ({
|
|
|
|
|
+ type: `video/mp4`,
|
|
|
|
|
+ src: sysConfig.FILE_URL + props.recordData.fileUrl
|
|
|
}))
|
|
}))
|
|
|
const handleCancel = () => {
|
|
const handleCancel = () => {
|
|
|
emit('close')
|
|
emit('close')
|
|
@@ -166,4 +185,14 @@
|
|
|
.ant-modal-footer {
|
|
.ant-modal-footer {
|
|
|
display: none !important; /* 检查是否被覆盖 */
|
|
display: none !important; /* 检查是否被覆盖 */
|
|
|
}
|
|
}
|
|
|
|
|
+ .preview-iframe {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ min-height: 500px;
|
|
|
|
|
+ }
|
|
|
|
|
+ .preview-iframe iframe {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ border: none;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|