index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <div class="app-container">
  3. <el-card class="mb20">
  4. <mx-condition ref="condition" :query-params="queryParams" :require-fields="requireFields" @query="handleQuery"
  5. @invalid="handleInvalidQuery"
  6. ></mx-condition>
  7. </el-card>
  8. <el-card class="box-card">
  9. <mx-table :prop-defines="propDefines" :rows="rows">
  10. <template #play="{row}">
  11. <el-button type="text" icon="el-icon-video-camera" @click="handleVideoPlay(row)">
  12. 播放
  13. </el-button>
  14. </template>
  15. </mx-table>
  16. <pagination
  17. :total="total"
  18. :page.sync="pageForm.pageNum"
  19. :limit.sync="pageForm.pageSize"
  20. @pagination="togglePage"
  21. />
  22. </el-card>
  23. <el-dialog :title="videoItem.resourcesName" v-if="videoDialog" :visible.sync="videoDialog" width="800px"
  24. :append-to-body="true">
  25. <mx-video :ali-id-type="videoItem.aliIdType" :src="videoItem.resourcesUrl||videoItem.videoId"></mx-video>
  26. </el-dialog>
  27. </div>
  28. </template>
  29. <script>
  30. import MxSearchGroup from '@/components/MxSearch/mx-search-group'
  31. import MxCondition from '@/components/MxCondition/mx-condition'
  32. import { getAiSubjectVideos } from '@/api/webApi/webVideo'
  33. export default {
  34. components: { MxSearchGroup, MxCondition },
  35. data() {
  36. return {
  37. pageForm: {
  38. pageNum: 1,
  39. pageSize: 20
  40. },
  41. rows:[],
  42. propDefines:{
  43. resourcesName:{
  44. label:'名称'
  45. },
  46. subjectName:{
  47. label:'科目'
  48. },
  49. play:{
  50. label:'操作',
  51. slot:'play'
  52. }
  53. },
  54. total: 0,
  55. queryParams: {
  56. v2Subject: '',
  57. },
  58. subjectName:'',
  59. videoDialog: false,
  60. videoItem: {},
  61. requireFields:['v2Subject']
  62. }
  63. },
  64. methods: {
  65. handleInvalidQuery() {
  66. },
  67. handleVideoPlay(row) {
  68. this.videoItem = row
  69. this.videoDialog = true
  70. },
  71. getList() {
  72. getAiSubjectVideos(
  73. {
  74. ...this.pageForm,
  75. subjectId:this.queryParams.v2Subject
  76. }).then(res => {
  77. this.rows = res.rows.map(item => {
  78. item.subjectName = this.subjectName
  79. return item
  80. })
  81. this.total = res.total
  82. console.log(res)
  83. })
  84. },
  85. togglePage(){
  86. this.getList()
  87. },
  88. handleQuery(model) {
  89. console.log(this.$refs.condition.conditions[0].list)
  90. this.subjectName = this.$refs.condition.conditions[0].list.find(item => item.code == model.v2Subject).label
  91. console.log(this.subjectName)
  92. this.getList()
  93. }
  94. }
  95. }
  96. </script>
  97. <style scoped>
  98. </style>