功能细化
This commit is contained in:
@@ -91,16 +91,18 @@
|
||||
</quill-editor>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item prop="sort" label-width="0"> -->
|
||||
<div
|
||||
<div v-if="this.dataForm.id">
|
||||
<div
|
||||
class="flexbox videoBox"
|
||||
v-for="(item, index) in video_audio_url"
|
||||
:key="index"
|
||||
|
||||
>
|
||||
<div style="width:120px">视频/音频ID</div>
|
||||
<div style="width:120px">视频/音频ID</div>
|
||||
<div style="width:300px; margin-right:10px; margin-left:10px">
|
||||
<el-input
|
||||
style=""
|
||||
v-model="item.url"
|
||||
v-model="item.video"
|
||||
placeholder="请输入视频/音频ID"
|
||||
></el-input>
|
||||
</div>
|
||||
@@ -125,9 +127,9 @@
|
||||
<el-button @click="delItem(index)" plain type="danger" size="mini">删除</el-button>
|
||||
</div>
|
||||
<!-- </el-form-item> -->
|
||||
<div style="text-align:center">
|
||||
<div style="text-align:center" >
|
||||
<el-button @click="addItem">添加一条音/视频</el-button>
|
||||
</div>
|
||||
</div></div>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="handlereset">取消</el-button>
|
||||
@@ -238,11 +240,12 @@ export default {
|
||||
// ]
|
||||
},
|
||||
video_audio_url: [
|
||||
{url:'454545',type:0}
|
||||
{ video: "" ,type:0,id:0}
|
||||
],
|
||||
obj:{ url: "" ,type:0},
|
||||
obj:{ video: "" ,type:0,id:0},
|
||||
splitsTypeList: [],
|
||||
dataRule: {}
|
||||
dataRule: {},
|
||||
chapterId:null,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
@@ -256,9 +259,9 @@ export default {
|
||||
// console.log(this.video_audio_url,'删除后的')
|
||||
},
|
||||
addItem() {
|
||||
var jj = {...this.obj}
|
||||
|
||||
this.video_audio_url.push({...jj});
|
||||
// var jj = {...this.obj}
|
||||
console.log(this.video_audio_url.length,'this.dataForm.video_audio_url--------')
|
||||
this.video_audio_url.push({'chapterId':this.chapterId, ...this.obj});
|
||||
console.log(this.video_audio_url,'this.dataForm.video_audio_url')
|
||||
},
|
||||
contentUploadSuccess(res, file) {
|
||||
@@ -295,10 +298,11 @@ export default {
|
||||
this.dataForm.courseId = courseid ? courseid : "";
|
||||
this.dataForm.catalogueId = catalogue_id ? catalogue_id : "";
|
||||
this.visible = true;
|
||||
if(this.dataForm.video_audio_url && this.dataForm.video_audio_url.length > 0){
|
||||
this.video_audio_url = {...this.dataForm.video_audio_url}
|
||||
this.chapterId = this.dataForm.id
|
||||
if(this.dataForm.videoList && this.dataForm.videoList.length > 0){
|
||||
this.video_audio_url = [...this.dataForm.videoList]
|
||||
}else{
|
||||
this.video_audio_url = []
|
||||
// this.video_audio_url = []
|
||||
}
|
||||
if (this.dataForm.imgUrl && this.dataForm.imgUrl != "") {
|
||||
var img = {
|
||||
@@ -334,10 +338,11 @@ export default {
|
||||
content: this.dataForm.content,
|
||||
sort: this.dataForm.sort,
|
||||
isAudition: this.dataForm.isAudition,
|
||||
video_audio_url:this.video_audio_url,
|
||||
videoList:this.video_audio_url,
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
// this.video_audio_url = []
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
@@ -373,7 +378,8 @@ export default {
|
||||
console.log(file);
|
||||
},
|
||||
handlereset() {
|
||||
(this.fileList = []), (this.fileListNovel = []), (this.visible = false);
|
||||
// this.video_audio_url = []
|
||||
(this.fileList = []), (this.fileListNovel = []), (this.visible = false),(this.video_audio_url = []);
|
||||
},
|
||||
handlePreview(file) {
|
||||
console.log(file);
|
||||
|
||||
Reference in New Issue
Block a user