Merge branch 'zcwy-master' into dev0515

This commit is contained in:
zhangsir
2024-06-14 16:19:56 +08:00

View File

@@ -173,6 +173,7 @@
<div v-for="(item, index) in catalogTree" :key="index" :name="index"> <div v-for="(item, index) in catalogTree" :key="index" :name="index">
<el-menu <el-menu
ref="menu" ref="menu"
:default-openeds="defaultOpeneds"
:default-active="activeId" :default-active="activeId"
:unique-opened="true" :unique-opened="true"
class="el-menu-vertical-demo" class="el-menu-vertical-demo"
@@ -185,8 +186,8 @@
<div style="margin-right: 23px;font-weight: 700;font-size: 16px;">({{ item.children.filter(item=>item.status == 9).length }}/{{ item.children.length }})</div> <div style="margin-right: 23px;font-weight: 700;font-size: 16px;">({{ item.children.filter(item=>item.status == 9).length }}/{{ item.children.length }})</div>
</div> </div>
</template> </template>
<el-menu-item-group> <el-menu-item-group v-for="(ele, i) in item.children" :key="i">
<div class="units-info" :class="{'units-active':contentData.id == ele.id}" v-for="(ele, i) in item.children" :key="i" @click="showRes(ele,i,index)"> <div class="units-info" :class="{'units-active':contentData.id == ele.id}" @click="showRes(ele,i,index,item)">
<el-menu-item :index="ele.id" style="padding: 0;padding-left: 10px;"> <el-menu-item :index="ele.id" style="padding: 0;padding-left: 10px;">
<div style="display: flex;justify-content: space-between;"> <div style="display: flex;justify-content: space-between;">
<div style="font-size: 16px;" :title="ele.contentName">{{i+1}}. {{ ele.contentName.slice(0, 15)+(ele.contentName.length > 15 ? '...' : '') }}</div> <div style="font-size: 16px;" :title="ele.contentName">{{i+1}}. {{ ele.contentName.slice(0, 15)+(ele.contentName.length > 15 ? '...' : '') }}</div>
@@ -354,8 +355,9 @@
}, },
data() { data() {
return { return {
KeyIndex: '',
activeId: '', activeId: '',
isFalse: false,
defaultOpeneds: [],
sendEventProgress: 0, sendEventProgress: 0,
trueFalse: true, trueFalse: true,
audiences:'', audiences:'',
@@ -491,12 +493,15 @@
this.stopStudyTime(); this.stopStudyTime();
}, },
methods: { methods: {
handleOpen(key, keyPath) { handleOpen(key,path){
console.log(key, keyPath,'handleOpen'); // console.log(key,path,'handleOpen')
this.KeyIndex = key; if(this.isFalse){
this.defaultOpeneds = [key]
}
this.isFalse = false
}, },
handleClose(key, keyPath) { handleClose(key,path){
console.log(key, keyPath,'handleClose'); // console.log(key,path,'handleClose')
}, },
toUserHome(tea){ toUserHome(tea){
this.$router.push({path:this.$xpage.getHomePath(tea.teacherId)}) this.$router.push({path:this.$xpage.getHomePath(tea.teacherId)})
@@ -636,7 +641,7 @@
window.open(url, '_blank'); window.open(url, '_blank');
}, },
//替换播放区域 //替换播放区域
changePlayRes(r){ changePlayRes(r,item){
if(this.appendStudyOtherHandle!=null){ if(this.appendStudyOtherHandle!=null){
window.clearTimeout(this.appendStudyOtherHandle); window.clearTimeout(this.appendStudyOtherHandle);
@@ -648,6 +653,10 @@
this.resType = r.contentType; this.resType = r.contentType;
this.contentData = r; this.contentData = r;
this.activeId = this.contentData.id this.activeId = this.contentData.id
if(item){
this.isFalse = true
this.handleOpen(item.section.id,[item.section.id])
}
this.contentData.name = this.courseInfo.name; this.contentData.name = this.courseInfo.name;
this.saveStudyDuration(); this.saveStudyDuration();
@@ -782,7 +791,7 @@
//console.log(h,$this.controlHeight,'$this.controlHeight'); //console.log(h,$this.controlHeight,'$this.controlHeight');
}) })
}, },
showRes(r, i, index) { //i:子节下标index:章下标 showRes(r, i, index,item) { //i:子节下标index:章下标
// 无权限查看不能点击 // 无权限查看不能点击
if(!this.isCrowd){ if(!this.isCrowd){
return return
@@ -830,7 +839,7 @@
} }
} }
} }
this.changePlayRes(r); this.changePlayRes(r,item);
}, },
loadScorePraiseAndTrample() { loadScorePraiseAndTrample() {
//加载是否请过分 //加载是否请过分