Sfoglia il codice sorgente

概述总览 在离开时隐藏所有企业,而非进入时隐藏所有企业

任一存 1 anno fa
parent
commit
fce4967e8b
1 ha cambiato i file con 12 aggiunte e 4 eliminazioni
  1. 12 4
      src/views/General.vue

+ 12 - 4
src/views/General.vue

@@ -219,7 +219,7 @@ export default {
       })
     })
 
-    // 自动选中第一个条目
+    // 第一次进入时,选中第一个条目
     function selectFirstItemAuto() {
       onClickCorpItem(corpListRaw.value[0].id)
     }
@@ -260,7 +260,7 @@ export default {
         corpListMap.get(decade).push(element)
       })
     }, 500, false), {
-      immediate: true,
+      // immediate: true,
     })
 
     /**
@@ -385,6 +385,14 @@ export default {
     }
     window.handleClickEnterprise = onClickCorpItem
 
+    onUnmounted(() => {
+      for (let index = 0; index < corpListRaw.value.length; index++) {
+        const element = corpListRaw.value[index]
+        window.gUnityInst.SendMessage('Panel1', 'HideEnterprise', element.id) //隐藏某个企业
+        window.gUnityInst.SendMessage('Panel1', 'HideEnterpriseName', element.id) //隐藏某个企业名称
+      }
+    })
+
     // loading mask相关
     const isShowLoadingMask = ref(true)
     onMounted(() => {
@@ -393,7 +401,7 @@ export default {
       }, 200)
     })
 
-    // 从宇宙跳到 总览
+    // 从宇宙跳到 总览
     onMounted(async () => {
       const url = window.location.href
       if (url.includes('id=')) {
@@ -401,7 +409,7 @@ export default {
         // console.log('ppppppppppppppppp', id)
         setTimeout(() => {
           onClickCorpItem(Number(id))
-        }, 1000)
+        }, 500)
       }
     })