3.4.3 页面查询视频 课程计划结点信息已包括媒资信息,可在页面获取信息后显示: [mw_shl_code=applescript,true]<el‐button style="font‐size: 12px;" type="text" on‐click={ () => this.querymedia(data.id) }> {data.mediaFileOriginalName} 选择视频</el‐button> [/mw_shl_code] 效果如下:

选择视频后立即刷新课程计划树,在提交成功后,添加查询课程计划代码:this.findTeachplan(),完整代码如下:


[mw_shl_code=applescript,true]choosemedia(mediaId,fileOriginalName,mediaUrl){
    this.mediaFormVisible = false;    
//保存课程计划与视频对应关系   
let teachplanMedia = {};  
  teachplanMedia.teachplanId = this.activeTeachplanId; 
   teachplanMedia.mediaId = mediaId;   
teachplanMedia.mediaFileOriginalName = fileOriginalName;  
  teachplanMedia.mediaUrl = mediaUrl;   
teachplanMedia.courseId = this.courseid;  
  //保存媒资信息到课程数据库   
courseApi.savemedia(teachplanMedia).then(res=>{   
     if(res.success){    
       this.$message.success("选择视频成功")   
       //查询课程计划    
      this.findTeachplan()     
   }else{    
    this.$message.error(res.message)    
    }    })    }, 
[/mw_shl_code]