Browse Source

提交修改船舶bug

zk 1 year ago
parent
commit
e6462f0858
2 changed files with 99 additions and 74 deletions
  1. 97 74
      src/views/home/Header.vue
  2. 2 0
      src/views/home/Tab.vue

+ 97 - 74
src/views/home/Header.vue

@@ -101,84 +101,107 @@ import { GetUserPrivilege } from "@/utils/user";
   }) 
   
   function handleToggleLayer(index) {
-    subList.data[index].status = !subList.data[index].status
-    if(subList.data[index].status===true) {
-      switch(index) {
-        case 0:
-          ueCallFlyToHD()
-          setTimeout(() => {
-            ueCallShowHangdaoLine()
-          }, 1000);
-          break
-        case 1:
-          ueCallCloseWarningReturn()
-          waterDeepShow.value = true
-          break
-        case 2:
-          ueCallfullExtent()
-          setTimeout(() => {
-            ueCallBoatRealtime()
-          }, 1000);
-          break
-        case 3:
-          ueCallFlyToSP()
-          bus.on('fly_Action', (data) => {
-            if(data.isOk=='true') {
-              ueCallOpenVideoFusion()
-              bus.off('fly_Action')
-            }
-          })
-          break
-        case 4:
-          bus.emit('toggle_sxdx', true)
-          clickWeeather.value=true
-          break
-        case 5:
-          if (clickWeeather.value) {
-            miForChangeShow.value = true
-            subList.data[index].status = true
-            ueCallShowAllMi()
-          }else {
-            subList.data[index].status = false
+      if (clickHead.value===true || index==2 || index==6)
+      {
+          subList.data[index].status = !subList.data[index].status
+          if(subList.data[index].status===true) {
+              switch(index) {
+                  case 0:
+                      ueCallFlyToHD()
+                      setTimeout(() => {
+                          ueCallShowHangdaoLine()
+                      }, 1000);
+                      break
+                  case 1:
+                      ueCallCloseWarningReturn()
+                      waterDeepShow.value = true
+                      break
+                  case 2:
+                      ueCallfullExtent()
+                      setTimeout(() => {
+                          ueCallBoatRealtime()
+                      }, 1000);
+                      break
+                  case 3:
+                      ueCallFlyToSP()
+                      bus.on('fly_Action', (data) => {
+                          if(data.isOk=='true') {
+                              ueCallOpenVideoFusion()
+                              bus.off('fly_Action')
+                          }
+                      })
+                      break
+                  case 4:
+                      bus.emit('toggle_sxdx', true)
+                      clickWeeather.value=true
+                      break
+                  case 5:
+                      if (clickWeeather.value) {
+                          miForChangeShow.value = true
+                          subList.data[index].status = true
+                          ueCallShowAllMi()
+                      }else {
+                          subList.data[index].status = false
+                      }
+                      break
+                  case 6:
+                      ueCallFlyToZrcb()
+                      break
+              }
+          }
+          else {
+              switch(index) {
+                  case 0:
+                      ueCallCloseHangdaoLine()
+                      break
+                  case 1:
+                      ueCallShowWarningReturn()
+                      waterDeepShow.value = false
+                      break
+                  case 2:
+                      ueCallClearBoatTime()
+                      break
+                  case 3:
+                      ueCallCloseVideoFusion()
+                      break
+                  case 4:
+                      clickWeeather.value=false
+                      miForChangeShow.value = false
+                      subList.data[index+1].status = false
+                      ueCallCloseMi()
+                      bus.emit('toggle_sxdx', false)
+                      break
+                  case 5:
+                      miForChangeShow.value = false
+                      ueCallCloseMi()
+                      break
+                  case 6:
+                      ueCallfullExtent()
+                      break
+              }
           }
-          break
-        case 6:
-          ueCallFlyToZrcb()
-          break
-      }
-    } else {
-      switch(index) {
-        case 0:
-          ueCallCloseHangdaoLine()
-          break
-        case 1:
-          ueCallShowWarningReturn()
-          waterDeepShow.value = false
-          break
-        case 2:
-          ueCallClearBoatTime()
-          break
-        case 3:
-          ueCallCloseVideoFusion()
-          break
-        case 4:
-          clickWeeather.value=false
-          miForChangeShow.value = false
-          subList.data[index+1].status = false
-          ueCallCloseMi()
-          bus.emit('toggle_sxdx', false)
-          break
-        case 5:
-          miForChangeShow.value = false
-          ueCallCloseMi()
-          break
-        case 6:
-          ueCallfullExtent()
-          break
       }
-    }
+
   }
+
+  bus.on('clickKaKou', (data) => {
+      if(data ) {
+          subList.data.filter(i=>i.name!='船舶').forEach(i=>{
+              i.status = false
+          })
+               clickHead.value=false
+          console.log('点击了卡口操作,设置false')
+      }else {
+          console.log('退出了卡口操作,true')
+              clickHead.value=true
+
+      }
+  })
+
   const clickWeeather = ref(false)
+
+  const clickHead = ref(true)
+
   const temperature = ref('8')
   const time = useDateFormat(useNow(), 'HH:mm')
   const date = useDateFormat(useNow(), 'YYYY.MM.DD')

+ 2 - 0
src/views/home/Tab.vue

@@ -90,8 +90,10 @@ export default {
   function changePage(name) {
     if (name === "AccessMonitor"){
       ueCallFlyToHsx()
+      bus.emit('clickKaKou', true)
     }else {
       ueCallfullExtent()
+      bus.emit('clickKaKou', false)
     }
 
     router.push({