Преглед изворни кода

色阶和统计值合并,默认展示交通流向

yang1998 пре 5 дана
родитељ
комит
09f82eda04

+ 4 - 4
src/store/eventInteraction.js

@@ -23,7 +23,7 @@ export const useEventInteractionStore = defineStore("eventInteractionStore", ()
   const currentMapScale = ref(0);
 
   //是否打开风险统计
-  const isDangerStatistic = ref(true);
+  const isDangerStatistic = ref(false);
 
   //是否打开病例撒点
   const isCaseShow = ref(false);
@@ -32,7 +32,7 @@ export const useEventInteractionStore = defineStore("eventInteractionStore", ()
   watch(
     () => commonStore.activeIndex,
     (val) => {
-      isDangerStatistic.value = val === 0
+      // isDangerStatistic.value = val === 0
     }
   );
 
@@ -93,10 +93,10 @@ export const useEventInteractionStore = defineStore("eventInteractionStore", ()
       console.log(val);
       if(commonStore.activeIndex === 0){
         if(val){
-          isDangerStatistic.value = false
+          // isDangerStatistic.value = false
           changeStreet(val, true, true)
         }else {
-          isDangerStatistic.value = true
+          // isDangerStatistic.value = true
           initDistrict()
         }
       }

+ 10 - 2
src/utils/map/baseMethod.js

@@ -14,6 +14,7 @@ import {
 import {analogData, districtArr, getGroupLayers, getLayerInfo} from '@/utils/mapService/local-data.js';
 import { useRoute } from 'vue-router';
 import {useEventInteractionStore} from "@/store/eventInteraction.js";
+import {useCommonStore} from "@/store/common.js";
 
 export function initDistrict() {
   ClearMap();
@@ -561,7 +562,8 @@ export const handleDangerStatistic = (isAll, bol) => {
 export function initShanghaiMap() {
   initDistrict()
   addPointSearch();
-  handleDangerStatistic(false, true)
+  // handleDangerStatistic(false, true)
+  handleJtlxPoints(true)
 }
 
 export function viewComplete() {
@@ -766,10 +768,16 @@ export function handleChinaCasePoint(bol) {
 
 //病例功能
 export function handleCase(bol) {
+
   handleCasePoint(bol)
   handleCaseRelPoints(bol)
   if(!bol){
-    handleJtlxPoints(bol)
+
+    //判断是否回到了首屏
+    const commonStore = useCommonStore();
+    if(commonStore.activeIndex !== 0){
+      handleJtlxPoints(bol)
+    }
   }
 }
 

+ 4 - 1
src/views/index.vue

@@ -70,7 +70,7 @@ import {
   watch,
 } from "vue";
 import {useRiskTableStore} from "@/store/riskTable.js";
-import {initDistrict} from "@/utils/map/baseMethod.js";
+import {handleJtlxPoints, initDistrict} from "@/utils/map/baseMethod.js";
 let userStore = useUserStore();
 let commonStore = useCommonStore();
 let riskTableStore = useRiskTableStore();
@@ -120,6 +120,9 @@ function setActive(index, item) {
   if(index === 0){
     initDistrict()
   }
+
+
+  handleJtlxPoints(index === 0)
 }
 </script>
 <style lang="scss" scoped>

+ 4 - 1
src/views/left/modules/components/dialog/MapTools.vue

@@ -10,6 +10,7 @@
 import { ref, onMounted } from 'vue'
 import {setDistrictResult} from "@/utils/map/AddLayer.js";
 import {useEventInteractionStore} from "@/store/eventInteraction.js";
+import {handleJtlxPoints} from "@/utils/map/baseMethod.js";
 const eventInteractionStore = useEventInteractionStore()
 
 // 公共路径
@@ -100,7 +101,9 @@ const selectTool = name => {
         "count": 36
       }]
     setDistrictResult(activeTool.value === "色阶图",  data)
-    eventInteractionStore.isDangerStatistic = activeTool.value !== "色阶图"
+    eventInteractionStore.isDangerStatistic = activeTool.value === "色阶图"
+
+    handleJtlxPoints(activeTool.value !== "色阶图")
   }
 }