|
@@ -1,5 +1,10 @@
|
|
|
<template>
|
|
|
- <el-container class="hc-layout-box" :class="[!isNullES(isLayout) && isLayout === 'no' ? 'is-no-layout' : '']">
|
|
|
+ <el-container
|
|
|
+ v-loading="isLoading"
|
|
|
+ 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=""> -->
|
|
@@ -45,19 +50,28 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
|
|
|
+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 website from '~src/config'
|
|
|
|
|
|
//初始组合式
|
|
|
const router = useRouter()
|
|
|
const useRoutes = useRoute()
|
|
|
const store = useAppStore()
|
|
|
|
|
|
-const reloadRouter = ref(true)
|
|
|
+const reloadRouter = ref(!website.localModel)
|
|
|
+
|
|
|
+const isLoading = computed(() => {
|
|
|
+ if (website.localModel) {
|
|
|
+ return !reloadRouter.value
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+})
|
|
|
|
|
|
//子组件
|
|
|
import HcTopMenuBar from './modules/HcTopMenu.vue'
|
|
@@ -126,7 +140,14 @@ let socket
|
|
|
const taskCount = ref(0)
|
|
|
const cascaderSend = async ({ projectId, contractId }) => {
|
|
|
await useClick()
|
|
|
- if (isNullES(contractId)) return
|
|
|
+ if (isNullES(contractId)) {
|
|
|
+ //本地模式
|
|
|
+ if (website.localModel) {
|
|
|
+ window.$message?.error('项目信息不存在,请联系管理员')
|
|
|
+ reloadRouter.value = false
|
|
|
+ }
|
|
|
+ return
|
|
|
+ }
|
|
|
//链接webSocket
|
|
|
if (!isNullES(socket)) socket.close()
|
|
|
socket = new HcSocket({ projectId, contractId, userId: userId.value }, ({ data }) => {
|
|
@@ -135,6 +156,12 @@ const cascaderSend = async ({ projectId, contractId }) => {
|
|
|
taskCount.value = res.data ?? 0
|
|
|
}
|
|
|
})
|
|
|
+ //本地模式
|
|
|
+ if (website.localModel) {
|
|
|
+ setTimeout(() => {
|
|
|
+ reloadRouter.value = true
|
|
|
+ }, 500)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//用户信息
|