瀏覽代碼

定点分析

Hwf 8 月之前
父節點
當前提交
00e376e24d

+ 20 - 0
src/api/globalMap/gridPointRainfall.ts

@@ -0,0 +1,20 @@
+import request from '@/utils/request';
+
+export const getRainfallCode = (data) => {
+  return request({
+    url: '/api/gateway/v2/get_rainfall_code',
+    method: 'post',
+    data: {
+      query: {
+        ...data
+      }
+    }
+  });
+};
+
+export const getRainfallInfo = (code) => {
+  return request({
+    url: '/api/rainfall/gdyl/info/' + code,
+    method: 'get'
+  });
+};

二進制
src/assets/images/electronicDisasterMapManage/active.png


二進制
src/assets/images/electronicDisasterMapManage/box1.png


二進制
src/assets/images/electronicDisasterMapManage/box2.png


二進制
src/assets/images/electronicDisasterMapManage/checked1.png


二進制
src/assets/images/electronicDisasterMapManage/checked2.png


二進制
src/assets/images/electronicDisasterMapManage/decoration1.png


二進制
src/assets/images/electronicDisasterMapManage/decoration2.png


二進制
src/assets/images/electronicDisasterMapManage/icon1.png


+ 1 - 1
src/hooks/AMap/useAMap.ts

@@ -16,7 +16,7 @@ export function useAMap(options) {
       version: !!options.version ? options.version : '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
       plugins: options.plugins
         ? options.plugins
-        : ['AMap.Scale', 'AMap.RangingTool', 'AMap.MouseTool', 'AMap.PolygonEditor', 'AMap.MarkerCluster', 'AMap.DistrictSearch', 'AMap.MoveAnimation']
+        : ['AMap.Scale', 'AMap.RangingTool', 'AMap.MouseTool', 'AMap.PolygonEditor', 'AMap.MarkerCluster', 'AMap.DistrictSearch', 'AMap.MoveAnimation', 'AMap.Driving', 'AMap.Geocoder']
     }).then((res) => {
       AMap = res;
       map = new AMap.Map(options.el ? options.el : 'aMap', {

+ 11 - 0
src/types/components.d.ts

@@ -39,6 +39,7 @@ declare module 'vue' {
     ElForm: typeof import('element-plus/es')['ElForm']
     ElFormItem: typeof import('element-plus/es')['ElFormItem']
     ElIcon: typeof import('element-plus/es')['ElIcon']
+    ElImage: typeof import('element-plus/es')['ElImage']
     ElInput: typeof import('element-plus/es')['ElInput']
     ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
     ElMenu: typeof import('element-plus/es')['ElMenu']
@@ -46,16 +47,24 @@ declare module 'vue' {
     ElOption: typeof import('element-plus/es')['ElOption']
     ElPagination: typeof import('element-plus/es')['ElPagination']
     ElPopover: typeof import('element-plus/es')['ElPopover']
+    ElRadio: typeof import('element-plus/es')['ElRadio']
+    ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
     ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
     ElSelect: typeof import('element-plus/es')['ElSelect']
+    ElSlider: typeof import('element-plus/es')['ElSlider']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
     ElTable: typeof import('element-plus/es')['ElTable']
     ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
     ElTag: typeof import('element-plus/es')['ElTag']
     ElText: typeof import('element-plus/es')['ElText']
+    ElTimeline: typeof import('element-plus/es')['ElTimeline']
+    ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
     ElTooltip: typeof import('element-plus/es')['ElTooltip']
+    ElTree: typeof import('element-plus/es')['ElTree']
+    ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
+    ElUpload: typeof import('element-plus/es')['ElUpload']
     ExcelEditor: typeof import('./../components/ExcelEditor/index.vue')['default']
     FileUpload: typeof import('./../components/FileUpload/index.vue')['default']
     FooterSection: typeof import('./../components/FooterSection/index.vue')['default']
@@ -66,6 +75,8 @@ declare module 'vue' {
     HikvisionPlayer: typeof import('./../components/HKVideo/hikvision-player.vue')['default']
     HKVideo: typeof import('./../components/HKVideo/index.vue')['default']
     IconSelect: typeof import('./../components/IconSelect/index.vue')['default']
+    IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default']
+    IEpCaretTop: typeof import('~icons/ep/caret-top')['default']
     IFrame: typeof import('./../components/iFrame/index.vue')['default']
     ImagePreview: typeof import('./../components/ImagePreview/index.vue')['default']
     ImageUpload: typeof import('./../components/ImageUpload/index.vue')['default']

+ 6 - 2
src/views/comprehensiveGuarantee/electronicDisasterMapManage/index.vue

@@ -58,7 +58,6 @@
               <div class="text2">{{ item.address }}</div>
               <div class="text3" @click="handleRoutes(item)">路线</div>
             </div>
-
           </div>
         </div>
       </div>
@@ -194,7 +193,7 @@ let checked1 = ref(false);
 let distance = ref('');
 let queryParams = reactive({
   keyword: '',
-  dataType: ''
+  dataType: '2'
 });
 let total = ref(0);
 let dataList = ref([]);
@@ -563,6 +562,7 @@ const initData = () => {
   getEventActiveList().then((res) => {
     eventList.value = res.data;
   });
+  getList();
 };
 onMounted(() => {
   initData();
@@ -656,6 +656,10 @@ onUnmounted(() => {
     left: 10px;
     width: 240px;
     background-color: #213567;
+    //&::after {
+    //  content: '';
+    //  display: inline-block;
+    //}
     .list-header {
       display: flex;
       align-items: center;

+ 41 - 0
src/views/globalMap/RightMenu/FixedPointAnalysis.vue

@@ -0,0 +1,41 @@
+<template>
+  <Dialog custom-show title="定点分析" :height="'1000px'" hide-footer @close="handleClose"></Dialog>
+</template>
+
+<script lang="ts" setup name="Fireproofing">
+
+import AMapLoader from '@amap/amap-jsapi-loader';
+import { getRainfallCode, getRainfallInfo } from '@/api/globalMap/gridPointRainfall';
+
+interface Props {
+  modelValue: boolean;
+  location?: string | number[];
+}
+const props = withDefaults(defineProps<Props>(), {});
+const emits = defineEmits(['update:modelValue']);
+let address = ref('');
+const handleClose = () => {
+  emits('update:modelValue', false);
+};
+let AMap, geocoder;
+onMounted(() => {
+  AMapLoader.load({
+    key: '30d3d8448efd68cb0b284549fd41adcf', // 申请好的Web端开发者Key,首次调用 load 时必填
+    version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
+    plugins: ['AMap.PlaceSearch', 'AMap.ContextMenu', 'AMap.PolygonEditor', 'AMap.Geocoder'] // 插件列表
+  }).then((res) => {
+    AMap = res;
+    geocoder = new AMap.Geocoder({
+      // city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode
+      city: '010'
+    });
+    geocoder.getAddress(props.location, (status, result) => {
+      if (status === 'complete' && result.info === 'OK') {
+        address.value = result.regeocode.formattedAddress;
+      }
+    });
+  });
+});
+</script>
+
+<style lang="scss" scoped></style>

+ 20 - 2
src/views/globalMap/RightMenu/GridPointRainfall.vue

@@ -8,6 +8,7 @@
 <script lang="ts" setup name="GridPointRainfall">
 import { option9 } from '@/views/globalMap/RightMenu/echartOptions';
 import AMapLoader from '@amap/amap-jsapi-loader';
+import { getRainfallCode, getRainfallInfo } from '@/api/globalMap/gridPointRainfall';
 
 interface Props {
   modelValue: boolean;
@@ -38,8 +39,25 @@ onMounted(() => {
       }
     });
   });
-  chartOption.value.series[0].data = [820, 932, 901, 934, 1290, 1330];
-  chartOption.value.series[1].data = ['', '', '', '', '', 1330, 901, 934, 1290, 1330, 1320];
+  getRainfallCode({
+    longitude: props.location[0],
+    latitude: props.location[1]
+  }).then((res) => {
+    getRainfallInfo(res.rows[0].code).then((res2) => {
+      const data = res2.data.rainfallHistory;
+      const data2 = res2.data.rainfallFuture;
+      const data3 = [];
+      data.forEach(() => {
+        data3.push('');
+      });
+      data3[data3.length - 1] = data[data2.length - 1].value;
+      data2.forEach((item) => {
+        data3.push(item.hour);
+      });
+      chartOption.value.series[0].data = res2.data.rainfallHistory;
+      chartOption.value.series[1].data = data3;
+    });
+  });
 });
 </script>
 

+ 12 - 2
src/views/globalMap/RightMenu/index.vue

@@ -42,6 +42,8 @@
         <UAV v-if="menuState.showMenu && menuState.menuData[menuState.activeIndex]?.name === '无人机'" @handle-menu="handleMenu" />
         <!--实时标绘-->
         <OnlinePlotting v-if="menuState.showMenu && menuState.menuData[menuState.activeIndex]?.name === '实时标绘'" />
+        <!--定点分析-->
+        <FixedPointAnalysis v-if="menuState.showMenu && menuState.menuData[menuState.activeIndex]?.name === '定点分析'" :location="location2" />
         <!--雨情监测-->
         <RainMonitor v-if="menuState.showMenu && menuState.menuData[menuState.activeIndex]?.name === '雨情监测'" />
         <!--铁塔运行监测-->
@@ -92,6 +94,7 @@ import Reservoir from './Reservoir.vue';
 import SpatialAnalysis from './SpatialAnalysis.vue';
 import LayerAnalysis from './LayerAnalysis.vue';
 import OnlinePlotting from './OnlinePlotting/index.vue';
+import FixedPointAnalysis from './FixedPointAnalysis.vue';
 import UAV from './UAV.vue';
 import WarningInfo from './WarningInfo.vue';
 import { PointType } from '@/api/globalMap/type';
@@ -157,6 +160,7 @@ const clickMenu = (index) => {
   menuState.activeIndex = index;
 };
 let location = ref([]);
+let location2 = ref([]);
 // 显示菜单
 const handleMenu = (name, data) => {
   let index = menuState.menuData.findIndex((item) => {
@@ -172,9 +176,8 @@ const handleMenu = (name, data) => {
     clickMenu(index);
   }
 };
-
 // 新增菜单 type 1 新增 2 删除
-const updateMenu = (type, menu) => {
+const updateMenu = (type, menu, location?: any) => {
   if (type === '1') {
     if (menu.name === '图层分析') {
       let index = menuState.menuData.findIndex((item) => {
@@ -193,6 +196,13 @@ const updateMenu = (type, menu) => {
       menuState.menuData.splice(index, 1);
       menuState.activeIndex = 0;
     }
+  } else if (type === '4') {
+    let index = menuState.menuData.findIndex((item) => item.name === menu.name);
+    if (index > -1) {
+      menuState.menuData.splice(index, 1);
+      menuState.activeIndex = 0;
+    }
+    location2.value = location;
   }
 };
 const getMenuState = () => {

+ 9 - 1
src/views/globalMap/index.vue

@@ -59,7 +59,10 @@ let leftMenuRef = ref(null);
 //  vectorgraph satellite imageMap 废弃:logical satellite2 satellite3
 let activeMap = ref('satellite');
 // 附近视频菜单数据
-let tempMenu = ref({});
+let tempMenu = ref({
+  name: '',
+  checked: false
+});
 const communicationSupport = reactive({
   show: false,
   data: {}
@@ -275,6 +278,11 @@ const handleClickMap = (e) => {
     showNearbyVideos.value = true;
   } else if (!!tempMenu.value && tempMenu.value.name === '格点雨量') {
     showRainfall.value = true;
+  } else if (!!tempMenu.value && tempMenu.value.name === '定点分析') {
+    const item = deepClone(tempMenu.value);
+    tempMenu.value = {};
+    map.off('click', handleClickMap);
+    rightMenuRef.value.updateMenu(item.checked ? '1' : '2', item, location.value);
   }
 };
 let showWarehouse = ref(false);