videoSubLevl
This commit is contained in:
parent
132244b49e
commit
f44a15d560
|
@ -45,9 +45,10 @@
|
|||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
:disabled="!checkPermission(['video_update'])"
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-view"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEdit(scope)"
|
||||
/>
|
||||
<el-button
|
||||
|
@ -94,7 +95,7 @@
|
|||
style="width: 100%"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<form ref="vcExample">
|
||||
<form ref="vcExample" v-if="dialogType === 'new'">
|
||||
<input
|
||||
type="file"
|
||||
style="display: none"
|
||||
|
@ -108,7 +109,7 @@
|
|||
@change="setVcExampleCoverName()"
|
||||
/>
|
||||
</form>
|
||||
<div class="row" style="padding: 10px">
|
||||
<div class="row" v-if="dialogType === 'new'" style="padding: 10px">
|
||||
<el-button type="primary" @click="vcExampleAddVideo">{{
|
||||
vcExampleVideoName || "添加视频"
|
||||
}}</el-button>
|
||||
|
@ -120,7 +121,7 @@
|
|||
>
|
||||
</div>
|
||||
|
||||
<div class="row" id="resultBox">
|
||||
<div class="row" v-if="dialogType === 'new'" id="resultBox">
|
||||
<!-- 上传信息组件 -->
|
||||
<div class="uploaderMsgBox" v-for="uploaderInfo in uploaderInfos">
|
||||
<div v-if="uploaderInfo.videoInfo">
|
||||
|
@ -312,14 +313,16 @@ export default {
|
|||
},
|
||||
//编辑视频
|
||||
handleEdit(scope) {
|
||||
this.$router.push({name: "Index", params: {fileid: scope.row.fileid, id: scope.row.id}})
|
||||
/*this.VideoContent = Object.assign({}, scope.row); // copy obj
|
||||
// this.$router.push({name: "Index", params: {fileid: scope.row.fileid, id: scope.row.id}})
|
||||
this.VideoContent = Object.assign({}, scope.row); // copy obj
|
||||
this.dialogType = "edit";
|
||||
this.dialogVisible = true;
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs["Forms"].clearValidate();
|
||||
});*/
|
||||
});
|
||||
console.log(scope.row)
|
||||
debugger;
|
||||
},
|
||||
setVcExampleVideoName: function () {
|
||||
this.vcExampleVideoName = this.$refs.vcExampleVideo.files[0].name;
|
||||
|
@ -412,13 +415,15 @@ export default {
|
|||
if (valid) {
|
||||
const isEdit = this.dialogType === "edit";
|
||||
if (isEdit) {
|
||||
for (var i = 0; i < this.uploaderInfos.length; i++) {
|
||||
console.log(this.VideoContent);
|
||||
debugger;
|
||||
/* for (var i = 0; i < this.uploaderInfos.length; i++) {
|
||||
this.VideoContent.fileid = this.uploaderInfos[i].fileId;
|
||||
|
||||
this.VideoContent.coverurl = this.uploaderInfos[i].coverUrl;
|
||||
this.VideoContent.mediaurl = this.uploaderInfos[i].videoUrl;
|
||||
}
|
||||
// console.log(this.VideoContent)
|
||||
}*/
|
||||
console.log(this.VideoContent)
|
||||
updatevideo(this.VideoContent.id, this.VideoContent).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.getList();
|
||||
|
|
|
@ -24,8 +24,22 @@
|
|||
<span class="mune">{{o.name}}</span>
|
||||
</el-link>
|
||||
</el-col>
|
||||
<el-col v-if="hasLowerLevel">
|
||||
<el-divider style="margin: 0!important;"></el-divider>
|
||||
</el-col>
|
||||
<el-col
|
||||
v-if="hasLowerLevel"
|
||||
class="typeItemWrap"
|
||||
style=""
|
||||
v-for="p in subTypeOptions"
|
||||
:key="p.id">
|
||||
<el-link :underline="false" @click="getListSub(p)">
|
||||
<span class="mune">{{p.name}}</span>
|
||||
</el-link>
|
||||
</el-col>
|
||||
</div>
|
||||
</el-row>
|
||||
<!--<el-divider style="margin: 0!important;"></el-divider>-->
|
||||
<el-row id="videoListWrap" style="margin-top:50px;" :gutter="10">
|
||||
<el-col :xs="12" :sm="8" :lg="6" :xl="4" v-for="o in videoList" :key="o.id" style="margin-bottom: 10px">
|
||||
<el-card :body-style="{ padding: '0px' }" shadow="always" class="cardDiv">
|
||||
|
@ -75,6 +89,8 @@
|
|||
type:null,
|
||||
videoList: "",
|
||||
typeOptions: [],
|
||||
hasLowerLevel:false,
|
||||
subTypeOptions:[],
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
|
@ -95,7 +111,7 @@
|
|||
let bigHeight = document.getElementsByClassName('app-main')[0].clientHeight;
|
||||
let topHeight = document.getElementsByClassName('typesButtons')[0].clientHeight;
|
||||
debugger;
|
||||
console.log(topHeight)
|
||||
console.log(topHeight);
|
||||
debugger;
|
||||
let domHeight = bigHeight-170-topHeight;
|
||||
document.getElementById('videoListWrap').style.height = domHeight + 'px';
|
||||
|
@ -116,6 +132,21 @@
|
|||
|
||||
getListtype(a) {
|
||||
this.type = a.id;
|
||||
debugger;
|
||||
console.log(a);
|
||||
debugger;
|
||||
if(a.children){
|
||||
this.hasLowerLevel = true;
|
||||
this.subTypeOptions = a.children;
|
||||
}
|
||||
getVideoList({category: a.id, pageoff: true}).then((response) => {
|
||||
if (response.data) {
|
||||
this.videoList = response.data;
|
||||
}
|
||||
this.listLoading = false;
|
||||
});
|
||||
},
|
||||
getListSub(a){
|
||||
getVideoList({category: a.id, pageoff: true}).then((response) => {
|
||||
if (response.data) {
|
||||
this.videoList = response.data;
|
||||
|
@ -123,7 +154,6 @@
|
|||
this.listLoading = false;
|
||||
});
|
||||
},
|
||||
|
||||
getTypeData(){
|
||||
getVideoList({category: this.type, pageoff: true}).then((response) => {
|
||||
if (response.data) {
|
||||
|
@ -134,8 +164,10 @@
|
|||
},
|
||||
//视频类型
|
||||
getTypeAll() {
|
||||
getDictList({type__code: "data_video"}).then((res) => {
|
||||
getDictList({type__code: "data_video",is_used:true}).then((res) => {
|
||||
this.typeOptions = genTree(res.data);
|
||||
console.log(this.typeOptions);
|
||||
debugger;
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -163,6 +195,9 @@
|
|||
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.el-divider--horizontal{
|
||||
margin: 6px 0 0 0!important;
|
||||
}
|
||||
.typeItemWrap{
|
||||
margin-top: 6px;
|
||||
width:fit-content;
|
||||
|
|
Loading…
Reference in New Issue