|
|
|
@ -169,25 +169,6 @@ |
|
|
|
|
<p>视频请上传MP4格式,大小不超过150M;office文件大小不要超过10M</p> |
|
|
|
|
</template> |
|
|
|
|
</Upload> |
|
|
|
|
<!-- <el-upload :before-upload="beforeUpload" |
|
|
|
|
:on-remove="handleRemove" |
|
|
|
|
:on-error="uploadError" |
|
|
|
|
:before-remove="beforeRemove" |
|
|
|
|
:limit="1" |
|
|
|
|
:on-exceed="handleExceed" |
|
|
|
|
:action="this.api.fileupload" |
|
|
|
|
:file-list="uploadList" |
|
|
|
|
:headers="headers" |
|
|
|
|
:http-request="handleRequest" |
|
|
|
|
name="file"> |
|
|
|
|
<el-button size="small"><img src="@/assets/img/upload.png" |
|
|
|
|
alt=""> 上传资源</el-button> |
|
|
|
|
<div slot="tip" |
|
|
|
|
class="el-upload__tip">视频请上传MP4格式,大小不超过150M;office文件大小不要超过10M</div> |
|
|
|
|
</el-upload> |
|
|
|
|
<el-progress v-if="showProgress" |
|
|
|
|
:stroke-width="3" |
|
|
|
|
:percentage="progressPercent"></el-progress> --> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="小节名称"> |
|
|
|
|
<el-input placeholder="请输入小节名称" |
|
|
|
@ -216,24 +197,6 @@ |
|
|
|
|
@onSuccess="uploadSuccess"> |
|
|
|
|
<div slot="tip"></div> |
|
|
|
|
</Upload> |
|
|
|
|
|
|
|
|
|
<!-- <el-upload :before-upload="beforeUpload" |
|
|
|
|
:on-remove="handleRemove" |
|
|
|
|
:on-error="uploadError" |
|
|
|
|
:before-remove="beforeRemove" |
|
|
|
|
:limit="1" |
|
|
|
|
:on-exceed="handleExceed" |
|
|
|
|
:action="this.api.fileupload" |
|
|
|
|
:file-list="uploadList" |
|
|
|
|
:headers="headers" |
|
|
|
|
:http-request="handleRequest" |
|
|
|
|
name="file"> |
|
|
|
|
<el-button size="small"><img src="@/assets/img/upload.png" |
|
|
|
|
alt=""> 上传资源</el-button> |
|
|
|
|
</el-upload> |
|
|
|
|
<el-progress v-if="showProgress" |
|
|
|
|
:stroke-width="3" |
|
|
|
|
:percentage="progressPercent"></el-progress> --> |
|
|
|
|
</div> |
|
|
|
|
<span slot="footer" |
|
|
|
|
class="dialog-footer"> |
|
|
|
@ -277,7 +240,7 @@ |
|
|
|
|
style="transform: scale(1) rotate(0deg);margin-top: -1px; max-height: 100%; max-width: 100%;"> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div v-show="iframeSrc" |
|
|
|
|
<div v-show="iframeSrc || videoSrc" |
|
|
|
|
class="el-image-viewer__wrapper" |
|
|
|
|
:class="{active: iframeSrc}" |
|
|
|
|
style="z-index: 2000"> |
|
|
|
@ -293,6 +256,16 @@ |
|
|
|
|
id="fileIframe" |
|
|
|
|
:src="iframeSrc" |
|
|
|
|
frameborder="0"></iframe> |
|
|
|
|
<video v-if="videoSrc" |
|
|
|
|
class="video" |
|
|
|
|
width="1200" |
|
|
|
|
height="600" |
|
|
|
|
autoplay |
|
|
|
|
controls> |
|
|
|
|
<source :src="videoSrc" |
|
|
|
|
type="video/mp4"> |
|
|
|
|
您的浏览器不支持 video 标签。 |
|
|
|
|
</video> |
|
|
|
|
<template v-if="showMask"> |
|
|
|
|
<div class="mask" |
|
|
|
|
style="width: 200px;height: 30px;top: 53px;right: 320px"></div> |
|
|
|
@ -412,6 +385,7 @@ export default { |
|
|
|
|
fileUrl: "", |
|
|
|
|
originalFileName: "", |
|
|
|
|
fileType: "", |
|
|
|
|
videoSrc: '', |
|
|
|
|
playAuth: "", |
|
|
|
|
player: null, |
|
|
|
|
previewImg: "", |
|
|
|
@ -548,6 +522,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
uploadSuccess (file) { |
|
|
|
|
this.uploading = false |
|
|
|
|
this.fileId = '' |
|
|
|
|
this.fileType = file.format |
|
|
|
|
this.fileUrl = file.url |
|
|
|
|
this.fileName = file.name |
|
|
|
@ -802,18 +777,18 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 下载资源 |
|
|
|
|
download (row) { |
|
|
|
|
const { fileType } = row |
|
|
|
|
const { fileType, fileId } = row |
|
|
|
|
// 下载ppt |
|
|
|
|
if (fileType === 'pptx') { |
|
|
|
|
this.downloadFile(row.name, row.fileUrl) |
|
|
|
|
} else if (fileType === 'mp4') { |
|
|
|
|
// 下载视频,先生成视频,再拿到视频地址去下载 |
|
|
|
|
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => { |
|
|
|
|
const player = new Aliplayer({ |
|
|
|
|
} else if (fileId) { |
|
|
|
|
// 阿里云点播视频,先生成视频,再拿到视频地址去下载(现在已经去掉视频点播的方法,但是还需要兼容历史数据) |
|
|
|
|
this.$get(`${this.api.getPlayAuth}/${fileId}`).then(res => { |
|
|
|
|
new Aliplayer({ |
|
|
|
|
id: "playerDownload", |
|
|
|
|
width: "100%", |
|
|
|
|
autoplay: false, |
|
|
|
|
vid: row.fileId, |
|
|
|
|
vid: fileId, |
|
|
|
|
playauth: res.data.playAuth, |
|
|
|
|
encryptType: 1 //当播放私有加密流时需要设置。 |
|
|
|
|
}, player => { |
|
|
|
@ -826,22 +801,26 @@ export default { |
|
|
|
|
}, |
|
|
|
|
preview (row) { |
|
|
|
|
if (this.transferType(row.fileType) == "视频") { |
|
|
|
|
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => { |
|
|
|
|
this.playAuth = res.data.playAuth; |
|
|
|
|
if (this.player) { |
|
|
|
|
this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth); |
|
|
|
|
} else { |
|
|
|
|
this.player = new Aliplayer({ |
|
|
|
|
id: "player", |
|
|
|
|
width: "100%", |
|
|
|
|
autoplay: false, |
|
|
|
|
vid: row.fileId, |
|
|
|
|
playauth: this.playAuth, |
|
|
|
|
encryptType: 1 //当播放私有加密流时需要设置。 |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
// 阿里云视频点播 |
|
|
|
|
if (row.fileId) { |
|
|
|
|
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => { |
|
|
|
|
this.playAuth = res.data.playAuth; |
|
|
|
|
if (this.player) { |
|
|
|
|
this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth); |
|
|
|
|
} else { |
|
|
|
|
this.player = new Aliplayer({ |
|
|
|
|
id: "player", |
|
|
|
|
width: "100%", |
|
|
|
|
autoplay: false, |
|
|
|
|
vid: row.fileId, |
|
|
|
|
playauth: this.playAuth, |
|
|
|
|
encryptType: 1 //当播放私有加密流时需要设置。 |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}).catch(res => { }); |
|
|
|
|
} else { |
|
|
|
|
this.videoSrc = row.fileUrl |
|
|
|
|
} |
|
|
|
|
} else if (this.transferType(row.fileType) == "图片") { |
|
|
|
|
this.previewImg = row.fileUrl; |
|
|
|
|
} else if (row.fileType == "pdf") { |
|
|
|
@ -984,6 +963,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
closeIframe () { |
|
|
|
|
this.iframeSrc = ""; |
|
|
|
|
this.videoSrc = '' |
|
|
|
|
this.showMask = false; |
|
|
|
|
this.showMask1 = false; |
|
|
|
|
this.showMask2 = false; |
|
|
|
|