index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <div style="height: calc(100vh - 120px);">
  3. <el-row style="height: 100%;" :gutter="20">
  4. <el-col :xl="6" :lg="6" style="height: 100%;border-right: 2px solid #55ffff;overflow-y: auto;"
  5. class="classTree hidden-md-and-down">
  6. <el-tree :data="data" node-key="Id" @node-click="handleNodeClick">
  7. <span class="custom-tree-node" slot-scope="{ node, data }">
  8. <span>{{ data.VName }}</span>
  9. <span v-if="data.lookstatus != undefined">
  10. <span v-if="data.lookstatus != '0'" style="color: #F56C6C;">
  11. (已完成)
  12. </span>
  13. </span>
  14. <span v-if="data.allNum != undefined && data.allNum > 0" style="color:#409EFF">
  15. (共计:{{data.allNum}},已看完:{{data.studyNum}})
  16. </span>
  17. </span>
  18. </el-tree>
  19. </el-col>
  20. <el-col :xl="18" :lg="18" :md="24" :sm="24" :xs="24" style="height: 100%;position: relative;">
  21. <div style="position: absolute;top: 0px;left: 20px;z-index: 99;" class="hidden-lg-and-up" @click="treeSee">
  22. <i class="el-icon-s-unfold" style="font-size: 20px;" ></i>
  23. </div>
  24. <div style="width: 100%;height: 100%;position: relative;" v-if="videoPath == null">
  25. <img src="../../../assets/images/hysy.jpg"
  26. style="width: 40%;margin-top: 60px;position: absolute;left: 50%;transform: translateX(-50%);"
  27. alt="" />
  28. </div>
  29. <div style="width: 100%;height: 100%;" v-else>
  30. <div class="flex-ac-jc" style="height: 60px;font-weight: bold;font-size: 20px;">
  31. {{classInfo.VName}}
  32. </div>
  33. <div style="height: calc(100% - 100px)">
  34. <play-video ref="video" :path="videoPath"
  35. :lastTime="classInfo.lookstatus == '0'?Number(classInfo.fenzhong):0" :classInfo="classInfo"
  36. :isFinish="classInfo.lookstatus == '0'?false : true" @seeOver="seeOver"></play-video>
  37. </div>
  38. <div class="flex-ac" style="height: 40px;color: #F56C6C;font-weight: bold;font-size: 16px;">
  39. 注:切换视频将从0开始计时!!
  40. </div>
  41. </div>
  42. </el-col>
  43. </el-row>
  44. <el-drawer title="课程讲解" append-to-body :visible.sync="treeShow" :direction="'ltr'">
  45. <el-tree :data="data" node-key="Id" @node-click="handleNodeClick">
  46. <span class="custom-tree-node" slot-scope="{ node, data }">
  47. <span>{{ data.VName }}</span>
  48. <span v-if="data.lookstatus != undefined">
  49. <span v-if="data.lookstatus != '0'" style="color: #F56C6C;">
  50. (已完成)
  51. </span>
  52. </span>
  53. <span v-if="data.allNum != undefined && data.allNum > 0" style="color:#409EFF">
  54. (共计:{{data.allNum}},已看完:{{data.studyNum}})
  55. </span>
  56. </span>
  57. </el-tree>
  58. </el-drawer>
  59. </div>
  60. </template>
  61. <script>
  62. import playVideo from "./video.vue"
  63. import {
  64. getClassList,
  65. saveRecord
  66. } from "@/api/jianliyuan/index"
  67. export default {
  68. name: "Xuexi",
  69. props: {
  70. classData: {
  71. type: Object,
  72. default: null
  73. }
  74. },
  75. components: {
  76. playVideo
  77. },
  78. data() {
  79. return {
  80. data: [],
  81. defaultProps: {
  82. children: 'children',
  83. label: 'VName'
  84. },
  85. videoPath: null,
  86. baseUrl: process.env.VUE_APP_BASE_API,
  87. classInfo: null,
  88. treeShow: false,
  89. }
  90. },
  91. created() {
  92. this.getList(this.classData)
  93. },
  94. methods: {
  95. handleNodeClick(data) {
  96. if (data.VPath != undefined) {
  97. this.classInfo = null
  98. this.videoPath = this.baseUrl + data.VPath
  99. this.classInfo = data
  100. this.classInfo.personid = this.classData.personid
  101. }
  102. },
  103. //查询已报名继续教育课程列表
  104. getList(v) {
  105. getClassList({
  106. classIdList: v.classIdList,
  107. personId: v.personid
  108. }).then(res => {
  109. for (let i in res.data) {
  110. let obj = {
  111. VName: i,
  112. Id: i,
  113. allNum: res.data[i].filter(obj => obj.lookstatus != undefined).length,
  114. studyNum: res.data[i].filter(obj => obj.lookstatus != undefined && obj
  115. .lookstatus != '0').length,
  116. children: res.data[i]
  117. }
  118. this.data.push(obj)
  119. }
  120. })
  121. },
  122. //视频观看完成
  123. seeOver(e) {
  124. if (e == true) {
  125. this.data = []
  126. this.getList(this.classData)
  127. }
  128. },
  129. treeSee(){
  130. console.log(1)
  131. this.treeShow = true
  132. }
  133. }
  134. }
  135. </script>
  136. <style scoped lang="scss">
  137. </style>