videoListComponent.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <div class="videoListComponent">
  3. <title-page-img-components :propsData="propsData"></title-page-img-components>
  4. <div class="max-big-for-box">
  5. <H5PlayerVideo style="margin:20px 0 0;"
  6. v-for="(item,index) in videoList" :key="index" :videoProps="item"></H5PlayerVideo>
  7. <img v-if="!videoList[0]" class="null-img" src="@/assets/ZDimages/null-data-1.png">
  8. </div>
  9. <div class="pagination-max-box">
  10. <p class="null-pagination-p"></p>
  11. <pagination v-show="videoTotal>0"
  12. :total="videoTotal"
  13. layout="prev, pager, next"
  14. :page.sync="videoQueryParams.page"
  15. :limit.sync="videoQueryParams.pageSize"
  16. @pagination="videoInitialize"
  17. />
  18. <p class="null-pagination-p"></p>
  19. </div>
  20. </div>
  21. </template>
  22. <script>
  23. import titlePageImgComponents from '@/components/titlePageImgComponents.vue'
  24. import { iotCameraFindByCondition } from "@/api/index";
  25. import H5PlayerVideo from '@/components/H5PlayerVideo/H5PlayerVideo.vue';
  26. export default {
  27. name: 'videoListComponent',
  28. components: {
  29. titlePageImgComponents,
  30. H5PlayerVideo
  31. },
  32. data () {
  33. return {
  34. propsData:{
  35. title:'视频监控',
  36. },
  37. width:435,
  38. height:245,
  39. videoType:false,
  40. //视频数据
  41. videoQueryParams:{
  42. page:1,
  43. pageSize:4,
  44. },
  45. videoTotal:0,
  46. videoList:[],
  47. floorId:null,
  48. }
  49. },
  50. created(){
  51. },
  52. mounted(){
  53. },
  54. methods:{
  55. //查询实验室摄像头
  56. initialize(item){
  57. this.$set(this,'floorId',item.floorId);
  58. this.$set(this.videoQueryParams,'page',1);
  59. this.$nextTick(()=>{
  60. this.videoInitialize();
  61. })
  62. },
  63. videoInitialize() {
  64. let self = this;
  65. self.$set(self, 'videoType', false);
  66. self.$set(self, 'videoList', []);
  67. // type 1.楼栋 2.楼层 3.楼道 4.实验室
  68. let obj = {
  69. page:this.videoQueryParams.page,
  70. pageSize:this.videoQueryParams.pageSize,
  71. buildId:'',
  72. floorId:this.floorId,
  73. passageway:'',
  74. subIds:[],
  75. protocol:window.location.href.indexOf('https') !== -1?'wss':'ws',
  76. };
  77. iotCameraFindByCondition(obj).then(response => {
  78. let list = [];
  79. for(let i=0;i<response.data.records.length;i++){
  80. list.push(
  81. {
  82. width: this.width, //(宽度:非必传-默认600)
  83. height: this.height, //(高度:非必传-默认338)
  84. url: response.data.records[i].streamUrl,
  85. }
  86. )
  87. }
  88. this.$set(this,'videoList',list)
  89. this.$set(this,'videoTotal',response.data.total);
  90. this.$nextTick(()=>{
  91. setTimeout(function(){
  92. self.$set(self, 'videoType', true);
  93. },1000);
  94. })
  95. });
  96. },
  97. },
  98. }
  99. </script>
  100. <style scoped lang="scss">
  101. .videoListComponent{
  102. height: 1330px;
  103. width: 476px;
  104. .max-big-for-box{
  105. height: 1180px;
  106. width: 476px;
  107. padding:0 20px;
  108. /*overflow-y: scroll;*/
  109. overflow: hidden;
  110. background: linear-gradient(180deg, rgba(4, 117, 129, 0.2) 0%, rgba(0, 15, 22, 0) 100%);
  111. .null-img{
  112. display: block;
  113. width:200px;
  114. margin:270px auto;
  115. }
  116. }
  117. .pagination-max-box{
  118. display: flex;
  119. .null-pagination-p{
  120. flex:1;
  121. }
  122. }
  123. .max-big-for-box::-webkit-scrollbar {
  124. width: 6px; /*高宽分别对应横竖滚动条的尺寸*/
  125. height: 6px;
  126. }
  127. .max-big-for-box::-webkit-scrollbar-thumb {
  128. border-radius: 5px;
  129. -webkit-box-shadow: inset 0 0 5px #07B4C7;
  130. background: #07B4C7;
  131. }
  132. .max-big-for-box::-webkit-scrollbar-track {
  133. -webkit-box-shadow: inset 0 0 5px #013138;
  134. border-radius: 0;
  135. background: #013138;
  136. }
  137. }
  138. </style>