Hwf před 3 dny
rodič
revize
63d7c89991

+ 15 - 3
src/components/NearbyVideos/index.vue

@@ -2,7 +2,7 @@
   <Dialog custom-show type="md" :title="!!title ? title : '附近视频'" draggable hide-footer @close="handleClose">
     <div class="flex-box">
       <div>附近距离</div>
-      <el-select v-model="queryParams.radius" class="custom-select" popper-class="custom-popper" :teleported="false" @change="initData">
+      <el-select v-model="queryParams.radius" class="custom-select" popper-class="custom-popper" :teleported="false" @change="handleChange">
         <el-option v-for="item in radiusOption" :key="item.value" :label="item.label" :value="item.value" />
       </el-select>
     </div>
@@ -54,6 +54,13 @@ const radiusOption = reactive([
   { label: '2000米', value: '2000' }
 ]);
 let loading = ref(false);
+const handleChange = () => {
+  if (!!props.getDataMethod) {
+    initData2();
+  } else {
+    initData();
+  }
+};
 const initData = () => {
   loading.value = true;
   getVideoInfo(queryParams)
@@ -69,8 +76,13 @@ const initData = () => {
 };
 const initData2 = () => {
   loading.value = true;
+  const query = { page: queryParams2.page, pageSize: queryParams2.pageSize, radius: queryParams.radius };
+  if (props.location) {
+    query.longitude = props.location[0];
+    query.latitude = props.location[1];
+  }
   props
-    .getDataMethod({ page: queryParams2.page, pageSize: queryParams2.pageSize, radius: queryParams.radius })
+    .getDataMethod(query)
     .then((res) => {
       total.value = res.totalPages;
       res.data?.list.forEach((item) => {
@@ -85,7 +97,7 @@ const initData2 = () => {
 watch(
   () => props.location,
   () => {
-    if (props.location && props.location.length === 2) {
+    if (!props.getDataMethod && props.location && props.location.length === 2) {
       queryParams.location = `POINT(${props.location[0]} ${props.location[1]})`;
       initData();
     }

+ 17 - 3
src/views/globalMap/RightMenu/PotentialFloodHazard.vue

@@ -48,20 +48,22 @@
           </div>
           <div class="td">易涝点名称</div>
           <div class="td">提供单位</div>
+          <div class="td">视频</div>
         </div>
         <div class="table-content">
-          <div v-for="(item, index) in dataList" :key="index" class="tr" @click="handleShowDialog(item)">
+          <div v-for="(item, index) in dataList" :key="index" class="tr">
             <div class="td">{{ item.area }}</div>
-            <div class="td btn3">
+            <div class="td btn3" @click="handleShowDialog(item)">
               <div class="video-icon"></div>
               {{ item.flood_name }}
             </div>
             <div class="td">{{ item.unit }}</div>
+            <div class="td play-btn" @click="handlePlay(item)">播放</div>
           </div>
         </div>
       </div>
     </div>
-    <NearbyVideos v-if="showNearbyVideos" v-model="showNearbyVideos" :get-data-method="getDataMethod" />
+    <NearbyVideos v-if="showNearbyVideos" v-model="showNearbyVideos" :location="location" :get-data-method="getDataMethod" />
   </div>
 </template>
 
@@ -78,6 +80,7 @@ const queryParams = reactive({
 });
 const dataList = ref([]);
 const showNearbyVideos = ref(false);
+const location = ref([]);
 const getDataMethod = ref(null);
 
 const initData = () => {
@@ -91,11 +94,17 @@ const handleCancel = () => {
 };
 const showMoreVideos = () => {
   getDataMethod.value = getWaterloggedAllVideoInfo;
+  location.value = [];
   showNearbyVideos.value = true;
 };
 const handleShowDialog = (item) => {
   showDetail(item, 4);
 };
+const handlePlay = (row) => {
+  getDataMethod.value = getWaterloggedAllVideoInfo;
+  location.value = [row.lng, row.lat];
+  showNearbyVideos.value = true;
+};
 let timeArr = ref([]);
 onMounted(() => {
   initData();
@@ -257,4 +266,9 @@ onMounted(() => {
   top: 30px;
   left: 160px;
 }
+.play-btn {
+  cursor: pointer;
+  font-size: 36px;
+  color: #00d0ee;
+}
 </style>