Browse Source

地图功能

gr 3 weeks ago
parent
commit
c803396b01
1 changed files with 15 additions and 2 deletions
  1. 15 2
      src/views/home/cpns/PanelHxhs.vue

+ 15 - 2
src/views/home/cpns/PanelHxhs.vue

@@ -174,13 +174,14 @@
 </template>
 
 <script setup>
-import { ref, onMounted, watch, onBeforeUnmount, computed } from 'vue';
+import { ref, onMounted, watch, onBeforeUnmount, computed, onBeforeMount } from 'vue';
 import { routePlanAll, saveRoute, searchQJCList } from "@/service/panelHxhs.js";
 import { geometryMeshEffect, getPathCube, showAndRedrawPath } from "@/utils/map/addTool.js";
 import { InspectPathCube } from '@/utils/map/addLayer';
 import useLayoutStore from '@/store/layout'
 import { useMapStore } from "@/store/map.js";
 import { riskTypes } from '@/utils/options';
+import { useDateFormat } from '@vueuse/core';
 
 const currentStep = ref(0)
 let currentPath = []; // 当前规划路径
@@ -188,13 +189,25 @@ let allPathArr = []; // 所有路径
 let autoHeight = false //手动规划
 const layoutStore = useLayoutStore();
 const mapStore = useMapStore();
+
 const form = ref({
   taskType: '01',
   uavType: '01',
   dataType: '02',
   height1: 60,
   height2: 80,
-  radius: 5
+  radius: 5,
+  startDate: '',
+  endDate: '',
+  startTime: '',
+  endTime: '',
+})
+
+onBeforeMount(() => {
+  form.value.startDate = useDateFormat(new Date(), 'YYYY-MM-DD').value
+  form.value.endDate = useDateFormat(new Date().getTime()+24*60*60*1000, 'YYYY-MM-DD').value
+  form.value.startTime = useDateFormat(new Date(), 'HH:mm').value
+  form.value.endTime = useDateFormat(new Date().getTime()+60*60*1000, 'HH:mm').value
 })
 
 const portOptions = []