|
@@ -2,49 +2,49 @@
|
|
|
<div>
|
|
|
<el-form-item label="视频上传">
|
|
|
<div class="upload_video" id="upload_video">
|
|
|
- <el-upload
|
|
|
- class="upload-demo"
|
|
|
- ref="upload"
|
|
|
- action="#"
|
|
|
- :http-request="uploadVideoToTxPcdn"
|
|
|
- accept=".mp4"
|
|
|
- :limit="1"
|
|
|
- :on-remove="handleRemove"
|
|
|
- :on-change="handleChange"
|
|
|
- :auto-upload="false"
|
|
|
- :key="uploadKey"
|
|
|
- >
|
|
|
- <el-button slot="trigger" size="small" type="primary" >选取视频</el-button>
|
|
|
- <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">点击上传</el-button>
|
|
|
- <!-- 仅当showControl为true时显示视频库选取按钮 -->
|
|
|
- <el-button v-if="showControl" style="margin-left: 10px;" size="small" type="success" @click="openVideoLibrary">视频库选取</el-button>
|
|
|
- <!-- 线路一 -->
|
|
|
- <div class="progress-container">
|
|
|
- <span class="progress-label">线路一</span>
|
|
|
- <el-progress
|
|
|
- style="margin-top: 5px;"
|
|
|
- class="progress"
|
|
|
- :text-inside="true"
|
|
|
- :stroke-width="18"
|
|
|
- :percentage="txProgress"
|
|
|
- status="success">
|
|
|
- </el-progress>
|
|
|
- </div>
|
|
|
+ <!-- <el-upload-->
|
|
|
+ <!-- class="upload-demo"-->
|
|
|
+ <!-- ref="upload"-->
|
|
|
+ <!-- action="#"-->
|
|
|
+ <!-- :http-request="uploadVideoToTxPcdn"-->
|
|
|
+ <!-- accept=".mp4"-->
|
|
|
+ <!-- :limit="1"-->
|
|
|
+ <!-- :on-remove="handleRemove"-->
|
|
|
+ <!-- :on-change="handleChange"-->
|
|
|
+ <!-- :auto-upload="false"-->
|
|
|
+ <!-- :key="uploadKey"-->
|
|
|
+ <!-- >-->
|
|
|
+ <!-- <el-button slot="trigger" size="small" type="primary" >选取视频</el-button>-->
|
|
|
+ <!-- <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">点击上传</el-button>-->
|
|
|
+ <!-- 仅当showControl为true时显示视频库选取按钮 -->
|
|
|
+ <el-button v-if="showControl" size="small" type="success" @click="openVideoLibrary">视频库选取</el-button>
|
|
|
+ <!-- 线路一 -->
|
|
|
+ <!-- <div class="progress-container">-->
|
|
|
+ <!-- <span class="progress-label">线路一</span>-->
|
|
|
+ <!-- <el-progress-->
|
|
|
+ <!-- style="margin-top: 5px;"-->
|
|
|
+ <!-- class="progress"-->
|
|
|
+ <!-- :text-inside="true"-->
|
|
|
+ <!-- :stroke-width="18"-->
|
|
|
+ <!-- :percentage="txProgress"-->
|
|
|
+ <!-- status="success">-->
|
|
|
+ <!-- </el-progress>-->
|
|
|
+ <!-- </div>-->
|
|
|
|
|
|
- <!-- 线路二 -->
|
|
|
- <div class="progress-container">
|
|
|
- <span class="progress-label">线路二</span>
|
|
|
- <el-progress
|
|
|
- style="margin-top: 5px;"
|
|
|
- class="progress"
|
|
|
- :text-inside="true"
|
|
|
- :stroke-width="18"
|
|
|
- :percentage="hwProgress"
|
|
|
- status="success">
|
|
|
- </el-progress>
|
|
|
- </div>
|
|
|
- <div slot="tip" class="el-upload__tip">只能上传mp4文件,且不超过500M</div>
|
|
|
- </el-upload>
|
|
|
+ <!-- <!– 线路二 –>-->
|
|
|
+ <!-- <div class="progress-container">-->
|
|
|
+ <!-- <span class="progress-label">线路二</span>-->
|
|
|
+ <!-- <el-progress-->
|
|
|
+ <!-- style="margin-top: 5px;"-->
|
|
|
+ <!-- class="progress"-->
|
|
|
+ <!-- :text-inside="true"-->
|
|
|
+ <!-- :stroke-width="18"-->
|
|
|
+ <!-- :percentage="hwProgress"-->
|
|
|
+ <!-- status="success">-->
|
|
|
+ <!-- </el-progress>-->
|
|
|
+ <!-- </div>-->
|
|
|
+ <!-- <div slot="tip" class="el-upload__tip">只能上传mp4文件,且不超过500M</div>-->
|
|
|
+ <!-- </el-upload>-->
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="视频播放">
|
|
@@ -54,13 +54,13 @@
|
|
|
<div v-if="fileSize">文件大小(MB): {{ (fileSize / (1024 * 1024)).toFixed(2) }} MB</div>
|
|
|
</el-form-item>
|
|
|
<!-- 仅当showControl为true时显示播放线路选择器 -->
|
|
|
- <el-form-item v-if="showControl" label="播放线路">
|
|
|
- <el-radio-group v-model="localUploadType">
|
|
|
- <el-radio :label="1" >线路一</el-radio>
|
|
|
- <el-radio :label="2" >线路二</el-radio>
|
|
|
- <!-- <el-radio :label="3" >线路三</el-radio>-->
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
+ <!-- <el-form-item v-if="showControl" label="播放线路">-->
|
|
|
+ <!-- <el-radio-group v-model="localUploadType">-->
|
|
|
+ <!-- <el-radio :label="1" >线路一</el-radio>-->
|
|
|
+ <!-- <el-radio :label="2" >线路二</el-radio>-->
|
|
|
+ <!-- <!– <el-radio :label="3" >线路三</el-radio>–>-->
|
|
|
+ <!-- </el-radio-group>-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
|
|
|
<!-- 视频库选择对话框 -->
|
|
|
<el-dialog title="视频库选择" :visible.sync="libraryOpen" width="900px" append-to-body>
|
|
@@ -75,6 +75,26 @@
|
|
|
@keyup.enter.native="handleLibraryQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="类型">
|
|
|
+ <el-select v-model="libraryQueryParams.typeId" @change="changeCateType" placeholder="请选择素材类型" clearable size="small">
|
|
|
+ <el-option
|
|
|
+ v-for="item in typeOptions"
|
|
|
+ :key="item.dictValue"
|
|
|
+ :label="item.dictLabel"
|
|
|
+ :value="item.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="子类型">
|
|
|
+ <el-select v-model="libraryQueryParams.typeSubId" placeholder="请选择素材子类型" clearable size="small">
|
|
|
+ <el-option
|
|
|
+ v-for="item in typeSubOptions"
|
|
|
+ :key="item.dictValue"
|
|
|
+ :label="item.dictLabel"
|
|
|
+ :value="item.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleLibraryQuery">搜索</el-button>
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetLibraryQuery">重置</el-button>
|
|
@@ -129,6 +149,7 @@ import { uploadObject } from "@/utils/cos.js";
|
|
|
import { uploadToOBS } from "@/utils/obs.js";
|
|
|
import Pagination from "@/components/Pagination";
|
|
|
import { listVideoResource } from '@/api/course/videoResource';
|
|
|
+import { getCateListByPid, getCatePidList } from '@/api/course/userCourseCategory'
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
@@ -179,6 +200,14 @@ export default {
|
|
|
type: Number,
|
|
|
default: 0,
|
|
|
},
|
|
|
+ isTranscode: {
|
|
|
+ type: Number,
|
|
|
+ default: null,
|
|
|
+ },
|
|
|
+ transcodeFileKey: {
|
|
|
+ type: String,
|
|
|
+ default: "",
|
|
|
+ },
|
|
|
|
|
|
// 使用一个变量控制显示,默认为true显示所有控制项
|
|
|
showControl: {
|
|
@@ -211,10 +240,15 @@ export default {
|
|
|
libraryList: [],
|
|
|
selectedVideo: null,
|
|
|
libraryQueryParams: {
|
|
|
+ isTranscode:1,
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- resourceName: null
|
|
|
- }
|
|
|
+ resourceName: null,
|
|
|
+ typeId: null,
|
|
|
+ typeSubId: null,
|
|
|
+ },
|
|
|
+ typeOptions: [],
|
|
|
+ typeSubOptions: []
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -230,9 +264,25 @@ export default {
|
|
|
// 打开视频库对话框
|
|
|
openVideoLibrary() {
|
|
|
this.libraryOpen = true;
|
|
|
+ this.getRootTypeList()
|
|
|
this.selectedVideo = null;
|
|
|
this.getLibraryList();
|
|
|
},
|
|
|
+ getRootTypeList() {
|
|
|
+ getCatePidList().then(response => {
|
|
|
+ this.typeOptions = response.data
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async changeCateType(val) {
|
|
|
+ this.libraryQueryParams.typeSubId = null
|
|
|
+ this.typeSubOptions = []
|
|
|
+ if (!val) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ await getCateListByPid(val).then(response => {
|
|
|
+ this.typeSubOptions = response.data
|
|
|
+ })
|
|
|
+ },
|
|
|
handleChange(file, fileList) {
|
|
|
this.fileList = fileList;
|
|
|
this.getVideoDuration(file.raw);
|
|
@@ -351,7 +401,9 @@ export default {
|
|
|
this.libraryQueryParams = {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- resourceName: null
|
|
|
+ resourceName: null,
|
|
|
+ typeId: null,
|
|
|
+ typeSubId: null
|
|
|
};
|
|
|
this.handleLibraryQuery();
|
|
|
},
|
|
@@ -385,6 +437,8 @@ export default {
|
|
|
this.$emit("update:fileKey", this.selectedVideo.fileKey);
|
|
|
this.$emit("update:uploadType", this.selectedVideo.uploadType);
|
|
|
this.$emit("video-duration", this.selectedVideo.duration);
|
|
|
+ this.$emit("update:isTranscode", this.selectedVideo.isTranscode);
|
|
|
+ this.$emit("update:transcodeFileKey", this.selectedVideo.transcodeFileKey);
|
|
|
|
|
|
// 设置预览URL
|
|
|
this.$emit("update:videoUrl", this.selectedVideo.videoUrl);
|