videoSubLevl

This commit is contained in:
shijing 2022-04-21 09:35:12 +08:00
parent 132244b49e
commit f44a15d560
2 changed files with 53 additions and 13 deletions

View File

@ -45,9 +45,10 @@
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
:disabled="!checkPermission(['video_update'])"
type="primary" type="primary"
size="small" size="small"
icon="el-icon-view" icon="el-icon-edit"
@click="handleEdit(scope)" @click="handleEdit(scope)"
/> />
<el-button <el-button
@ -94,7 +95,7 @@
style="width: 100%" style="width: 100%"
></el-cascader> ></el-cascader>
</el-form-item> </el-form-item>
<form ref="vcExample"> <form ref="vcExample" v-if="dialogType === 'new'">
<input <input
type="file" type="file"
style="display: none" style="display: none"
@ -108,7 +109,7 @@
@change="setVcExampleCoverName()" @change="setVcExampleCoverName()"
/> />
</form> </form>
<div class="row" style="padding: 10px"> <div class="row" v-if="dialogType === 'new'" style="padding: 10px">
<el-button type="primary" @click="vcExampleAddVideo">{{ <el-button type="primary" @click="vcExampleAddVideo">{{
vcExampleVideoName || "添加视频" vcExampleVideoName || "添加视频"
}}</el-button> }}</el-button>
@ -120,7 +121,7 @@
> >
</div> </div>
<div class="row" id="resultBox"> <div class="row" v-if="dialogType === 'new'" id="resultBox">
<!-- 上传信息组件 --> <!-- 上传信息组件 -->
<div class="uploaderMsgBox" v-for="uploaderInfo in uploaderInfos"> <div class="uploaderMsgBox" v-for="uploaderInfo in uploaderInfos">
<div v-if="uploaderInfo.videoInfo"> <div v-if="uploaderInfo.videoInfo">
@ -312,14 +313,16 @@ export default {
}, },
//编辑视频 //编辑视频
handleEdit(scope) { handleEdit(scope) {
this.$router.push({name: "Index", params: {fileid: scope.row.fileid, id: scope.row.id}}) // this.$router.push({name: "Index", params: {fileid: scope.row.fileid, id: scope.row.id}})
/*this.VideoContent = Object.assign({}, scope.row); // copy obj this.VideoContent = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit"; this.dialogType = "edit";
this.dialogVisible = true; this.dialogVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["Forms"].clearValidate(); this.$refs["Forms"].clearValidate();
});*/ });
console.log(scope.row)
debugger;
}, },
setVcExampleVideoName: function () { setVcExampleVideoName: function () {
this.vcExampleVideoName = this.$refs.vcExampleVideo.files[0].name; this.vcExampleVideoName = this.$refs.vcExampleVideo.files[0].name;
@ -412,13 +415,15 @@ export default {
if (valid) { if (valid) {
const isEdit = this.dialogType === "edit"; const isEdit = this.dialogType === "edit";
if (isEdit) { 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.fileid = this.uploaderInfos[i].fileId;
this.VideoContent.coverurl = this.uploaderInfos[i].coverUrl; this.VideoContent.coverurl = this.uploaderInfos[i].coverUrl;
this.VideoContent.mediaurl = this.uploaderInfos[i].videoUrl; this.VideoContent.mediaurl = this.uploaderInfos[i].videoUrl;
} }*/
// console.log(this.VideoContent) console.log(this.VideoContent)
updatevideo(this.VideoContent.id, this.VideoContent).then((res) => { updatevideo(this.VideoContent.id, this.VideoContent).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
this.getList(); this.getList();

View File

@ -24,8 +24,22 @@
<span class="mune">{{o.name}}</span> <span class="mune">{{o.name}}</span>
</el-link> </el-link>
</el-col> </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> </div>
</el-row> </el-row>
<!--<el-divider style="margin: 0!important;"></el-divider>-->
<el-row id="videoListWrap" style="margin-top:50px;" :gutter="10"> <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-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"> <el-card :body-style="{ padding: '0px' }" shadow="always" class="cardDiv">
@ -75,6 +89,8 @@
type:null, type:null,
videoList: "", videoList: "",
typeOptions: [], typeOptions: [],
hasLowerLevel:false,
subTypeOptions:[],
}; };
}, },
computed: {}, computed: {},
@ -95,7 +111,7 @@
let bigHeight = document.getElementsByClassName('app-main')[0].clientHeight; let bigHeight = document.getElementsByClassName('app-main')[0].clientHeight;
let topHeight = document.getElementsByClassName('typesButtons')[0].clientHeight; let topHeight = document.getElementsByClassName('typesButtons')[0].clientHeight;
debugger; debugger;
console.log(topHeight) console.log(topHeight);
debugger; debugger;
let domHeight = bigHeight-170-topHeight; let domHeight = bigHeight-170-topHeight;
document.getElementById('videoListWrap').style.height = domHeight + 'px'; document.getElementById('videoListWrap').style.height = domHeight + 'px';
@ -116,6 +132,21 @@
getListtype(a) { getListtype(a) {
this.type = a.id; 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) => { getVideoList({category: a.id, pageoff: true}).then((response) => {
if (response.data) { if (response.data) {
this.videoList = response.data; this.videoList = response.data;
@ -123,7 +154,6 @@
this.listLoading = false; this.listLoading = false;
}); });
}, },
getTypeData(){ getTypeData(){
getVideoList({category: this.type, pageoff: true}).then((response) => { getVideoList({category: this.type, pageoff: true}).then((response) => {
if (response.data) { if (response.data) {
@ -134,8 +164,10 @@
}, },
//视频类型 //视频类型
getTypeAll() { getTypeAll() {
getDictList({type__code: "data_video"}).then((res) => { getDictList({type__code: "data_video",is_used:true}).then((res) => {
this.typeOptions = genTree(res.data); this.typeOptions = genTree(res.data);
console.log(this.typeOptions);
debugger;
}); });
}, },
@ -163,6 +195,9 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.el-divider--horizontal{
margin: 6px 0 0 0!important;
}
.typeItemWrap{ .typeItemWrap{
margin-top: 6px; margin-top: 6px;
width:fit-content; width:fit-content;