ZaiZai 6 months ago
parent
commit
18fc079ede
1 changed files with 17 additions and 6 deletions
  1. 17 6
      src/layout/index.vue

+ 17 - 6
src/layout/index.vue

@@ -1,5 +1,5 @@
 <template>
-    <el-container v-loading="!isAppLoading" class="hc-layout-box" :class="[!isNullES(isLayout) && isLayout === 'no' ? 'is-no-layout' : '']">
+    <el-container v-loading="isAppLoadings" class="hc-layout-box" :class="[!isNullES(isLayout) && isLayout === 'no' ? 'is-no-layout' : '']">
         <div v-if="appTheme === 'dark'" class="hc-app-bg-box">
             <img :src="appViewBg" alt="">
         </div>
@@ -112,8 +112,20 @@ watch(() => store.getTheme, (theme) => {
 })
 
 //监听项目信息变化
+const isAppLoadings = ref(true)
 watch(() => isAppLoading.value, (res) => {
-    reloadRouter.value = res
+    if (!website.localModel) {
+        reloadRouter.value = res
+        isAppLoadings.value = !res
+    } else {
+        if (res) {
+            setTimeout(() => {
+                isAppLoadings.value = false
+            }, 1000)
+        } else {
+            isAppLoadings.value = true
+        }
+    }
 }, { immediate:true })
 
 //路由信息
@@ -191,7 +203,9 @@ const cascaderSend = async ({ projectId, contractId }) => {
     if (website.localModel) {
         setTimeout(() => {
             reloadRouter.value = true
-        }, 500)
+        }, 1000)
+    } else {
+        reloadRouter.value = true
     }
 }
 
@@ -221,9 +235,6 @@ const socketData = async (res) => {
 // 项目切换
 const cascaderChange = () => {
     reloadRouter.value = false
-    nextTick(() => {
-        reloadRouter.value = true
-    })
 }
 
 //首页