|
@@ -1,10 +1,5 @@
|
|
|
<template>
|
|
|
- <el-container
|
|
|
- v-loading="isLoading"
|
|
|
- class="hc-layout-box"
|
|
|
- :class="[!isNullES(isLayout) && isLayout === 'no' ? 'is-no-layout' : '']"
|
|
|
- element-loading-text="获取数据中..."
|
|
|
- >
|
|
|
+ <el-container v-loading="!isAppLoading" class="hc-layout-box" :class="[!isNullES(isLayout) && isLayout === 'no' ? 'is-no-layout' : '']" element-loading-text="获取数据中...">
|
|
|
<el-header class="hc-layout-header">
|
|
|
<div class="hc-layout-header-logo" :style="`width: ${isCollapse ? '0px' : '200px'};`" @click="logoClick">
|
|
|
<!-- <img id="logo-icon" :src="appLogoIcon" alt=""> -->
|
|
@@ -51,11 +46,12 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
|
|
|
-import { useAppStore } from '~src/store'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
-import { initButtons } from '~sto/app'
|
|
|
import { getObjValue, isNullES, useClick } from 'js-fast-way'
|
|
|
import { HcSocket } from '~src/plugins/HcSocket'
|
|
|
+import { useAppStore } from '~src/store'
|
|
|
+import { initButtons } from '~sto/app'
|
|
|
+import { useProject } from '~sto/useProject'
|
|
|
import website from '~src/config'
|
|
|
|
|
|
//初始组合式
|
|
@@ -63,15 +59,8 @@ const router = useRouter()
|
|
|
const useRoutes = useRoute()
|
|
|
const store = useAppStore()
|
|
|
|
|
|
-const reloadRouter = ref(!website.localModel)
|
|
|
-
|
|
|
-const isLoading = computed(() => {
|
|
|
- if (website.localModel) {
|
|
|
- return !reloadRouter.value
|
|
|
- } else {
|
|
|
- return false
|
|
|
- }
|
|
|
-})
|
|
|
+const reloadRouter = ref(false)
|
|
|
+const { isAppLoading } = useProject()
|
|
|
|
|
|
//子组件
|
|
|
import HcTopMenuBar from './modules/HcTopMenu.vue'
|
|
@@ -102,6 +91,11 @@ watch(() => [
|
|
|
isLayout.value = layout ?? layout2
|
|
|
}, { deep: true })
|
|
|
|
|
|
+//监听项目信息变化
|
|
|
+watch(() => isAppLoading.value, (res) => {
|
|
|
+ reloadRouter.value = res
|
|
|
+}, { immediate:true })
|
|
|
+
|
|
|
//路由信息
|
|
|
const routerMenuLoad = ({ key }) => {
|
|
|
menuBarKey.value = key
|