userCourseWatchLog.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <div class="apcontainer">
  3. <div class="list">
  4. <div class="item" v-for="(item,index) in courseWatchLogList" :key="index">
  5. <div class="left">
  6. <img :src="item.thumbnail" />
  7. <div class="box">
  8. <div class="title">{{item.courseName}}</div>
  9. <div class="text">播放时长:{{item.duration}}</div>
  10. <div class="text">创建时间:{{item.createTime}}</div>
  11. <div class="text">记录编号:{{item.logId}}</div>
  12. </div>
  13. </div>
  14. <div class="right">
  15. {{type(item.logType)}}
  16. </div>
  17. </div>
  18. </div>
  19. <!-- <el-table border v-loading="loading" :data="courseWatchLogList">
  20. <el-table-column label="记录编号" align="center" prop="logId" />
  21. <el-table-column label="用户账号" align="center" prop="userName" />
  22. <el-table-column label="会员昵称" align="center" prop="fsNickName">
  23. <template slot-scope="scope">
  24. <div style="display: flex;white-space: nowrap">
  25. <div style="margin: auto">
  26. {{scope.row.fsNickName}}
  27. </div>
  28. <el-popover
  29. placement="right"
  30. title=""
  31. trigger="hover">
  32. <img slot="reference" :src="scope.row.fsAvatar" style="width: 30px;height: 30px">
  33. <img :src="scope.row.fsAvatar" style="max-width: 200px;max-height: 200px">
  34. </el-popover>
  35. </div>
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="项目" align="center" prop="projectName" />
  39. <el-table-column label="课程名称" align="center" prop="courseName" />
  40. <el-table-column label="小节名称" align="center" prop="videoName" />
  41. <el-table-column label="记录类型" align="center" prop="logType">
  42. <template slot-scope="scope">
  43. <dict-tag :options="logTypeOptions" :value="scope.row.logType"/>
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="播放时长" align="center" prop="duration" />
  47. <el-table-column label="创建时间" align="center" prop="createTime" />
  48. <el-table-column label="更新时间" align="center" prop="updateTime" />
  49. <el-table-column label="完课时间" align="center" prop="finishTime" />
  50. <el-table-column label="营期时间" align="center" prop="campPeriodTime" />
  51. </el-table>
  52. <pagination
  53. v-show="total>0"
  54. :total="total"
  55. :page.sync="queryParams.pageNum"
  56. :limit.sync="queryParams.pageSize"
  57. @pagination="getList"
  58. /> -->
  59. </div>
  60. </template>
  61. <script>
  62. import { listCourseWatchLog } from "@/api/course/courseWatchLog";
  63. import { getQwExternalContactWatchLogList } from "@/api/qw/im";
  64. import {mapState} from "vuex";
  65. export default {
  66. name: "CourseWatchLog",
  67. data() {
  68. return {
  69. activeName:"00",
  70. logTypeOptions:[],
  71. // 遮罩层
  72. loading: true,
  73. // 总条数
  74. total: 0,
  75. // 短链课程看课记录表格数据
  76. courseWatchLogList: [],
  77. // 查询参数
  78. queryParams: {
  79. pageNum: 1,
  80. pageSize: 3,
  81. qwExternalContactId:null,
  82. // logType: null,
  83. },
  84. };
  85. },
  86. computed: {
  87. ...mapState({
  88. companyUserId: state => state.user.user.userId,
  89. }),
  90. type(){
  91. return (val) => { // 闭包函数,接收 val
  92. if (val) {
  93. if(val==3){
  94. return '待看课';
  95. }else{
  96. let str=this.logTypeOptions.find(item => Number(item.dictValue) == val)
  97. return str?str.dictLabel:'-';
  98. }
  99. }else{
  100. return '-';
  101. }
  102. }
  103. }
  104. },
  105. created() {
  106. this.getDicts("sys_course_watch_log_type").then(response => {
  107. this.logTypeOptions = response.data;
  108. });
  109. this.queryParams.companyUserId = this.companyUserId
  110. },
  111. methods: {
  112. getUserWatchLog(id) {
  113. this.queryParams.qwExternalContactId = id
  114. this.getList()
  115. },
  116. /** 查询短链课程看课记录列表 */
  117. getList() {
  118. this.loading = true;
  119. if(this.queryParams.logType == "10"){
  120. this.queryParams.logType = null;
  121. }
  122. getQwExternalContactWatchLogList(this.queryParams).then(response => {
  123. this.courseWatchLogList = response.rows;
  124. this.total = response.total;
  125. this.loading = false;
  126. });
  127. },
  128. }
  129. };
  130. </script>
  131. <style scoped lang="scss">
  132. .apcontainer {
  133. /* padding: 10px; */
  134. padding-top: 20px;
  135. /* font-size: 12px; */
  136. .list{
  137. .item{
  138. display: flex;
  139. align-items:flex-start;
  140. justify-content: space-between;
  141. margin-bottom: 12px;
  142. .left{
  143. flex:1;
  144. display: flex;
  145. align-items: center;
  146. img{
  147. width: 86px;
  148. height: 86px;
  149. border-radius: 4px 4px 4px 4px;
  150. }
  151. .box{
  152. height: 86px;
  153. margin-left: 10px;
  154. display: flex;
  155. flex-direction: column;
  156. align-items: flex-start;
  157. justify-content: space-between;
  158. .title{
  159. font-weight: 400;
  160. font-size: 14px;
  161. color: #202124;
  162. }
  163. .text{
  164. font-weight: 400;
  165. font-size: 12px;
  166. color: #84868C;
  167. }
  168. }
  169. }
  170. .right{
  171. font-weight: 400;
  172. font-size: 12px;
  173. color: #FC4B0E;
  174. }
  175. }
  176. }
  177. }
  178. </style>