소스 검색

上报 雨量接口

yangyuxuan 1 개월 전
부모
커밋
54febff127

+ 30 - 1
src/api/disasterRiskMonitor/rainfall.ts

@@ -11,7 +11,7 @@ export const getPointInfo = (pointType: string) => {
   });
 };
 
-// 地质灾害隐患点详情
+// 地质灾害隐患点详情1
 export const getMidmapDzzhDetails = (id: string) => {
   return request({
     url: "/api/gateway/v2/get_point_info_midmap_dzzh",
@@ -24,6 +24,17 @@ export const getMidmapDzzhDetails = (id: string) => {
   });
 };
 
+// 地质灾害隐患点详情2
+export const getMidmapDzzhDetails2 = (id: string) => {
+  return request({
+    url: "/api/rainfall/dzzh/info",
+    method: "get",
+    params: {
+      id: id
+    }
+  });
+};
+
 //地质灾害隐患点列表查询
 export function getGeologicalDisaster(data) {
   return request({
@@ -76,3 +87,21 @@ export const getChemicalcompanyDetails = (id: string) => {
     }
   });
 };
+
+// 危化企业列表查询
+export function getChemicalcompany(data) {
+  return request({
+    url: "/api/rainfall/chemical_company/list",
+    method: "get",
+    params: data
+  });
+}
+
+// 危化企业视频查询
+export function getChemicalcompanyVideo(data) {
+  return request({
+    url: "/api/rainfall/chemical_company/get_video_list",
+    method: "get",
+    params: { video_unit_indexcode: data }
+  });
+}

+ 103 - 34
src/views/disasterRiskMonitor/hazardousChemicalEnterprises.vue

@@ -64,27 +64,33 @@
         >
           <el-table-column
             label="位置"
-            prop="name"
+            prop="formatted_address"
             align="center"
           />
           <el-table-column
             label="雨量"
-            prop="latitude"
+            prop="rainfall"
             align="center"
             width="80px"
           />
           <el-table-column
             label="类型"
-            prop="type"
+            prop="weather_warning_type"
             align="center"
-            width="60px"
-          />
+            width="70px"
+          >
+            <template #default="scope">
+              <div style="display: flex; justify-content: center">
+                <img :src="iconStatus(scope.row)" style="width: 40px" alt="" />
+              </div>
+            </template>
+          </el-table-column>
           <el-table-column label="操作" align="center" width="50px">
             <template #default="scope">
               <div
                 class="btn"
-                @click="showDetails(scope.row)"
                 style="color: #1d92ff"
+                @click="showDetails(scope.row)"
               >
                 查看
               </div>
@@ -100,10 +106,35 @@
 import { reactive, ref } from "vue";
 import searchImg from "@/assets/images/search.png";
 import { ElTable, ElTableColumn } from "element-plus";
-import { getPointInfo } from "@/api/disasterRiskMonitor/rainfall";
-import {useDict} from "@/utils/dict";
+import {
+  getChemicalcompany,
+  getPointInfo,
+  getRainhouseSites
+} from "@/api/disasterRiskMonitor/rainfall";
+import { useDict } from "@/utils/dict";
+import { deepClone } from "@/utils";
+import rainWhite from "@/assets/images/map/warningInfo/ic_rainstorm_white.png";
+import rainBlue from "@/assets/images/map/warningInfo/ic_rainstorm_blue.png";
+import rainYellow from "@/assets/images/map/warningInfo/ic_rainstorm_yellow.png";
+import rainOrange from "@/assets/images/map/warningInfo/ic_rainstorm_orange.png";
+import rainRed from "@/assets/images/map/warningInfo/ic_rainstorm_red.png";
+import tempWhite from "@/assets/images/map/warningInfo/ic_temperature_white.png";
+import tempBlue from "@/assets/images/map/warningInfo/ic_temperature_blue.png";
+import tempYellow from "@/assets/images/map/warningInfo/ic_temperature_yellow.png";
+import tempOrange from "@/assets/images/map/warningInfo/ic_temperature_orange.png";
+import tempRed from "@/assets/images/map/warningInfo/ic_temperature_red.png";
+import thunWhite from "@/assets/images/map/warningInfo/ic_thunderstorm_white.png";
+import thunBlue from "@/assets/images/map/warningInfo/ic_thunderstorm_blue.png";
+import thunYellow from "@/assets/images/map/warningInfo/ic_thunderstorm_yellow.png";
+import thunOrange from "@/assets/images/map/warningInfo/ic_thunderstorm_orange.png";
+import thunRed from "@/assets/images/map/warningInfo/ic_thunderstorm_red.png";
+import thphoonWhite from "@/assets/images/map/warningInfo/ic_typhoon_white.png";
+import thphoonBlue from "@/assets/images/map/warningInfo/ic_typhoon_blue.png";
+import thphoonYellow from "@/assets/images/map/warningInfo/ic_typhoon_yellow.png";
+import thphoonOrange from "@/assets/images/map/warningInfo/ic_typhoon_orange.png";
+import thphoonRed from "@/assets/images/map/warningInfo/ic_typhoon_red.png";
 
-const { district_type } = toRefs<any>(useDict('district_type'));
+const { district_type } = toRefs<any>(useDict("district_type"));
 const router = useRouter();
 let detailsData = ref({
   dataList: []
@@ -117,11 +148,12 @@ const option1 = reactive([
   { text: "24h", value: "24" }
 ]);
 const queryParams = reactive({
-  value1: "1",
-  value2: "24",
-  type: "",
-  level: "",
-  area: ""
+  area_name: "",
+  history_time: "24",
+  future_time: "",
+  page: "",
+  pageSize: "",
+  keyword: ""
 });
 const handleClickMenu = (value1, value2) => {
   queryParams.value1 = value1;
@@ -136,32 +168,69 @@ const showDetails = row => {
     query: {
       latitude: row.latitude,
       longitude: row.longitude,
-      name: encodeURIComponent(row.name)
+      name: row.company_name,
+      videoCode: row.video_unit_indexcode
     }
   });
 };
 const getData = () => {
-  getPointInfo("11").then(res => {
-    res.data.list.forEach(item => {
-      detailsData.value.dataList.push(item);
-    });
-  });
-  getPointInfo("12").then(res => {
-    res.data.list.forEach(item => {
-      detailsData.value.dataList.push(item);
-    });
-  });
-  getPointInfo("13").then(res => {
-    res.data.list.forEach(item => {
-      detailsData.value.dataList.push(item);
-    });
-  });
-  getPointInfo("14").then(res => {
-    res.data.list.forEach(item => {
-      detailsData.value.dataList.push(item);
-    });
+  let temp = deepClone(queryParams);
+  temp.area_name = temp.area_name[0];
+  getChemicalcompany(temp).then(res => {
+    detailsData.value.dataList = res.data;
   });
 };
+const iconStatus = row => {
+  if (row.weather_warning_type === "暴雨预警") {
+    if (row.weather_warninglevel === "5") {
+      return rainWhite;
+    } else if (row.weather_warninglevel === "4") {
+      return rainBlue;
+    } else if (row.weather_warninglevel === "3") {
+      return rainYellow;
+    } else if (row.weather_warninglevel === "2") {
+      return rainOrange;
+    } else {
+      return rainRed;
+    }
+  } else if (row.weather_warning_type === "高温预警") {
+    if (row.weather_warninglevel === "5") {
+      return tempWhite;
+    } else if (row.weather_warninglevel === "4") {
+      return tempBlue;
+    } else if (row.weather_warninglevel === "3") {
+      return tempYellow;
+    } else if (row.weather_warninglevel === "2") {
+      return tempOrange;
+    } else {
+      return tempRed;
+    }
+  } else if (row.weather_warning_type === "雷雨大风") {
+    if (row.weather_warninglevel === "5") {
+      return thunWhite;
+    } else if (row.weather_warninglevel === "4") {
+      return thunBlue;
+    } else if (row.weather_warninglevel === "3") {
+      return thunYellow;
+    } else if (row.weather_warninglevel === "2") {
+      return thunOrange;
+    } else {
+      return thunRed;
+    }
+  } else {
+    if (row.weather_warninglevel === "5") {
+      return thphoonWhite;
+    } else if (row.weather_warninglevel === "4") {
+      return thphoonBlue;
+    } else if (row.weather_warninglevel === "3") {
+      return thphoonYellow;
+    } else if (row.weather_warninglevel === "2") {
+      return thphoonOrange;
+    } else {
+      return thphoonRed;
+    }
+  }
+};
 getData();
 </script>
 

+ 21 - 16
src/views/disasterRiskMonitor/hazardousChemicalEnterprisesView.vue

@@ -29,12 +29,12 @@
       >
         <el-table-column label="序号" type="index" align="center" />
         <el-table-column label="视频名称" prop="name" align="center" />
-        <el-table-column
-          label="距离"
-          prop="distance"
-          align="center"
-          width="60px"
-        />
+<!--        <el-table-column-->
+<!--          label="距离"-->
+<!--          prop="distance"-->
+<!--          align="center"-->
+<!--          width="60px"-->
+<!--        />-->
         <el-table-column label="操作" align="center" width="50px">
           <template #default="scope">
             <div class="btn" @click="switchVideo(scope.row)" :style="{color: video1 === scope.row ? '#000' : '#1d92ff'}">切换</div>
@@ -48,30 +48,35 @@
 <script setup lang="ts">
 import { ref } from "vue";
 import { ElTable, ElTableColumn } from "element-plus";
-import { getVideoInfo } from "@/api/disasterRiskMonitor/rainfall";
+import {getChemicalcompanyVideo, getVideoInfo} from "@/api/disasterRiskMonitor/rainfall";
 
 const route = useRoute();
 const latitude = ref(route.query.latitude);
 const longitude = ref(route.query.longitude);
-const name = ref(decodeURIComponent(route.query.name));
+const name = ref(route.query.name);
+const videoCode = ref(route.query.videoCode);
 const queryParams = reactive({
   location: "",
   radius: "2000"
 });
-const videoList = ref();
+const videoList = ref([]);
 const getTableRowClass = ({ rowIndex }) => {
   return rowIndex % 2 === 0 ? "" : "common-table-tr";
 };
 queryParams.location = "POINT(" + longitude.value + " " + latitude.value + ")";
 const getVideo = () => {
-  getVideoInfo(queryParams).then(res => {
-    res.data.list.forEach(item => {
-      item.video_code = item.indexcode;
-      item.distance = (Math.ceil(item.distance * 100) / 100).toFixed(2);
-    });
-    videoList.value = res.data.list;
-    video1.value = res.data.list[0];
+  getChemicalcompanyVideo(videoCode.value).then(res => {
+    videoList.value = res.data;
+    video1.value = res.data[0];
   });
+  // getVideoInfo(queryParams).then(res => {
+  //   res.data.list.forEach(item => {
+  //     item.video_code = item.indexcode;
+  //     item.distance = (Math.ceil(item.distance * 100) / 100).toFixed(2);
+  //   });
+  //   videoList.value = res.data.list;
+  //   video1.value = res.data.list[0];
+  // });
 };
 getVideo();
 const video1 = ref();

+ 3 - 3
src/views/disasterRiskMonitor/rainfallMonitoringView.vue

@@ -62,7 +62,7 @@
 import { ref } from "vue";
 import { ElTable, ElTableColumn } from "element-plus";
 import {
-  getMidmapDzzhDetails,
+  getMidmapDzzhDetails, getMidmapDzzhDetails2,
   getVideoInfo
 } from "@/api/disasterRiskMonitor/rainfall";
 
@@ -83,8 +83,8 @@ const getTableRowClass = ({ rowIndex }) => {
   return rowIndex % 2 === 0 ? "" : "common-table-tr";
 };
 const getInform = () => {
-  getMidmapDzzhDetails(informId.value).then(res => {
-    detailsData.value = res.rows[0];
+  getMidmapDzzhDetails2(informId.value).then(res => {
+    detailsData.value = res.data;
     queryParams.location =
       "POINT(" +
       detailsData.value.longitude +

+ 2 - 2
src/views/event/ReportPage.vue

@@ -95,10 +95,10 @@
       </div>
     </div>
     <div class="button-container">
+      <van-button class="cancel-btn" @click="handleCancel">取消</van-button>
       <van-button class="confirm-btn" type="primary" @click="handleSubmit"
-        >确定</van-button
+      >确定</van-button
       >
-      <van-button class="cancel-btn" @click="handleCancel">取消</van-button>
     </div>
   </div>
 </template>

+ 5 - 0
src/views/event/ViewPage.vue

@@ -5,6 +5,11 @@
       <div class="form-item">
         <div class="common-form-content">
           <div class="common-form-item">
+            <div class="label-box">
+              <div class="box">
+                <div style="margin-bottom: 10px">合计</div>
+              </div>
+            </div>
             <!-- 其他字段绑定到对应索引的表单数据 -->
             <div class="label-box">
               <div class="box">

+ 1 - 1
src/views/event/detail.vue

@@ -98,7 +98,7 @@
               <div
                 v-show="eventInfo.casualties === ''"
                 class="event-data-item-value blue"
-                @click="viewPage"
+                @click="reportPage"
               >
                 去上报
               </div>