windAndFloodPreventionView.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <div class="container">
  3. <div class="title">
  4. {{ name }}
  5. </div>
  6. <div class="box">
  7. <div class="card-header">
  8. <i class="icon-line" />
  9. <div class="text">视频</div>
  10. </div>
  11. <HKVideo
  12. v-if="!!video1"
  13. :dot_data="video1"
  14. autoplay
  15. style="height: 200px"
  16. />
  17. </div>
  18. <div class="box">
  19. <div class="card-header">
  20. <i class="icon-line" />
  21. <div class="text">周边视频</div>
  22. </div>
  23. <el-table
  24. :data="videoList"
  25. header-cell-class-name="common-table-header"
  26. :row-class-name="getTableRowClass"
  27. table-layout="auto"
  28. class="common-table"
  29. >
  30. <el-table-column label="序号" type="index" align="center" />
  31. <el-table-column label="视频名称" prop="name" align="center" />
  32. <!-- <el-table-column-->
  33. <!-- label="距离"-->
  34. <!-- prop="distance"-->
  35. <!-- align="center"-->
  36. <!-- width="60px"-->
  37. <!-- />-->
  38. <el-table-column label="操作" align="center" width="50px">
  39. <template #default="scope">
  40. <div
  41. class="btn"
  42. :style="{ color: video1 === scope.row ? '#000' : '#1d92ff' }"
  43. @click="switchVideo(scope.row)"
  44. >
  45. 切换
  46. </div>
  47. </template>
  48. </el-table-column>
  49. </el-table>
  50. </div>
  51. </div>
  52. </template>
  53. <script setup lang="ts">
  54. import { ref } from "vue";
  55. import { ElTable, ElTableColumn } from "element-plus";
  56. import {
  57. getVideoInfo,
  58. getVideoInfo2
  59. } from "@/api/disasterRiskMonitor/rainfall";
  60. const route = useRoute();
  61. const latitude = ref(route.query.latitude);
  62. const longitude = ref(route.query.longitude);
  63. const name = ref(decodeURIComponent(route.query.name));
  64. // const queryParams = reactive({
  65. // location: "",
  66. // radius: "2000"
  67. // });
  68. const queryParams = reactive({
  69. radius: "2000",
  70. page: 1,
  71. pageSize: 10,
  72. longitude: "",
  73. latitude: ""
  74. });
  75. const videoList = ref();
  76. const getTableRowClass = ({ rowIndex }) => {
  77. return rowIndex % 2 === 0 ? "" : "common-table-tr";
  78. };
  79. // queryParams.location = "POINT(" + longitude.value + " " + latitude.value + ")";
  80. const getVideo = () => {
  81. getVideoInfo2(queryParams).then(res => {
  82. res.data.list.forEach(item => {
  83. item.video_code = item.indexcode;
  84. item.distance = (Math.ceil(item.distance * 100) / 100).toFixed(2);
  85. });
  86. videoList.value = res.data.list;
  87. video1.value = res.data.list[0];
  88. });
  89. };
  90. getVideo();
  91. const video1 = ref();
  92. const switchVideo = row => {
  93. video1.value = row;
  94. };
  95. </script>
  96. <style scoped lang="scss">
  97. .container {
  98. height: 100vh;
  99. padding: 8px 16px;
  100. .box {
  101. background-color: #ffffff;
  102. border: 1px solid #eaedf7;
  103. box-shadow: 0 0 4px 0 #4554661a;
  104. border-radius: 4px;
  105. background-image: linear-gradient(
  106. to bottom,
  107. #f3f7fd 0%,
  108. #f7fafe 20px,
  109. #fcfdff 50px,
  110. #ffffff 50px,
  111. #ffffff 100%
  112. );
  113. .icon-line {
  114. display: inline-block;
  115. width: 6px;
  116. height: 16px;
  117. background: url("@/assets/images/line.jpg") no-repeat;
  118. background-size: 100% 100%;
  119. margin-right: 3px;
  120. }
  121. padding: 10px 16px;
  122. margin-bottom: 10px;
  123. .box-item {
  124. display: flex;
  125. align-items: center;
  126. height: 30px;
  127. .box-tag {
  128. flex: 1;
  129. display: flex;
  130. justify-content: center;
  131. align-items: center;
  132. }
  133. .tag-active {
  134. background-color: #5f9ff2;
  135. border-radius: 4px;
  136. color: #ffffff;
  137. }
  138. }
  139. }
  140. }
  141. /* 移除表单容器背景 */
  142. :deep(.van-cell-group) {
  143. background: transparent !important;
  144. }
  145. /* 移除每个表单项的背景 */
  146. :deep(.van-cell) {
  147. background: transparent !important;
  148. }
  149. /* 移除内嵌容器的边距和阴影 */
  150. :deep(.van-cell-group--inset) {
  151. margin: 0;
  152. box-shadow: none;
  153. &::after {
  154. border: none !important; /* 移除默认边框 */
  155. }
  156. }
  157. :deep(.van-field--disabled) {
  158. .van-field__label,
  159. .van-field__control {
  160. color: rgba(12, 12, 12, 0.93) !important; /* 设置文字颜色为黑色 */
  161. -webkit-text-fill-color: #4a4848 !important; /* 适配 iOS 设备 */
  162. }
  163. /* 移除禁用蒙层 */
  164. .van-field__disabled-mask {
  165. display: none !important;
  166. }
  167. }
  168. .title {
  169. font-size: 18px;
  170. font-weight: bold;
  171. line-height: 32px;
  172. width: 100%;
  173. text-align: center;
  174. margin-bottom: 8px;
  175. }
  176. .card-header {
  177. display: flex;
  178. align-items: center;
  179. gap: 6px;
  180. margin-bottom: 10px;
  181. }
  182. </style>