VideoMonitor.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <div class="video-card">
  3. <div class="common-title gradient-text">视频监控</div>
  4. <div class="more-btn" @click="showVideoMonitorList">{{ '查看更多>>' }}</div>
  5. <div class="card-content video-list">
  6. <div v-for="(item, index) in listData" :key="index" class="video-box">
  7. <HKVideo :dot_data="item" autoplay />
  8. <div class="video-label">
  9. <span class="label">{{ item.name }}</span>
  10. </div>
  11. </div>
  12. </div>
  13. </div>
  14. <VideoMonitorEdit v-if="showListDialog" v-model="showListDialog" :lngLat="lngLat" />
  15. </template>
  16. <script lang="ts" setup name="VideoMonitor">
  17. import { getVideoListByUser } from '@/api/videoMonitor';
  18. import VideoMonitorEdit from './VideoMonitorEdit.vue';
  19. const props = defineProps({
  20. longitude: Number,
  21. latitude: Number
  22. });
  23. let listData = ref([]);
  24. let showListDialog = ref(false);
  25. let lngLat = reactive({
  26. longitude: 110.925176,
  27. latitude: 21.678993
  28. });
  29. const initData = () => {
  30. lngLat.longitude = props.longitude ? props.longitude : 110.925176;
  31. lngLat.latitude = props.latitude ? props.latitude : 21.678993;
  32. getVideoListByUser({
  33. longitude: lngLat.longitude,
  34. latitude: lngLat.latitude,
  35. page: 1,
  36. pageSize: 4
  37. }).then((res) => {
  38. listData.value = res.rows;
  39. });
  40. };
  41. initData();
  42. const showVideoMonitorList = () => {
  43. showListDialog.value = true;
  44. };
  45. </script>
  46. <style lang="scss" scoped>
  47. .video-card {
  48. width: 526px;
  49. height: 309px;
  50. background: url('@/assets/images/video/videoBox1.png') no-repeat;
  51. background-size: 100% 100%;
  52. position: relative;
  53. animation-name: slideLeft;
  54. animation-duration: 1.5s;
  55. .video-list {
  56. display: flex;
  57. flex-wrap: wrap;
  58. padding-top: 47px;
  59. padding-left: 25px;
  60. .video-box {
  61. width: 237px;
  62. height: 116px;
  63. margin-right: 13px;
  64. cursor: pointer;
  65. background: url('@/assets/images/video/videoBg.png') no-repeat;
  66. background-size: 100% 100%;
  67. position: relative;
  68. display: flex;
  69. align-items: center;
  70. justify-content: center;
  71. padding: 5px 4px 5px 5px;
  72. &:nth-child(1),
  73. &:nth-child(2) {
  74. margin-bottom: 10px;
  75. }
  76. &:nth-child(2),
  77. &:nth-child(4) {
  78. margin-right: 0;
  79. }
  80. .video-label {
  81. position: absolute;
  82. bottom: 5px;
  83. right: 3px;
  84. z-index: 901;
  85. display: flex;
  86. .label {
  87. width: 186px;
  88. height: 22px;
  89. line-height: 22px;
  90. font-size: 14px;
  91. white-space: nowrap;
  92. overflow: hidden;
  93. text-overflow: ellipsis;
  94. padding: 0 5px 0 10px;
  95. color: #fff;
  96. background-color: rgba(18, 107, 248, 0.4);
  97. text-align: right;
  98. }
  99. &::before {
  100. content: '';
  101. width: 0;
  102. height: 0;
  103. border-bottom: 22px solid rgba(18, 107, 248, 0.4);
  104. border-left: 22px solid transparent;
  105. }
  106. }
  107. }
  108. :deep(.err_box) {
  109. align-items: flex-start;
  110. padding-top: 15px;
  111. }
  112. }
  113. }
  114. .more-btn {
  115. position: absolute;
  116. top: 22px;
  117. right: 8px;
  118. color: #00e8ff;
  119. font-size: 13px;
  120. cursor: pointer;
  121. z-index: 2;
  122. }
  123. </style>