diff --git a/src/types/auto-imports.d.ts b/src/types/auto-imports.d.ts index 6f8d200..acba637 100644 --- a/src/types/auto-imports.d.ts +++ b/src/types/auto-imports.d.ts @@ -2,6 +2,9 @@ export {} declare global { const EffectScope: typeof import('vue')['EffectScope'] + const ElMessage: typeof import('element-plus/es')['ElMessage'] + const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] + const ElNotification: typeof import('element-plus/es')['ElNotification'] const asyncComputed: typeof import('@vueuse/core')['asyncComputed'] const autoResetRef: typeof import('@vueuse/core')['autoResetRef'] const computed: typeof import('vue')['computed'] @@ -268,6 +271,9 @@ import { UnwrapRef } from 'vue' declare module 'vue' { interface ComponentCustomProperties { readonly EffectScope: UnwrapRef + readonly ElMessage: UnwrapRef + readonly ElMessageBox: UnwrapRef + readonly ElNotification: UnwrapRef readonly asyncComputed: UnwrapRef readonly autoResetRef: UnwrapRef readonly computed: UnwrapRef diff --git a/src/views/monitoring/components/menu.vue b/src/views/monitoring/components/menu.vue index 0714389..b2f9960 100644 --- a/src/views/monitoring/components/menu.vue +++ b/src/views/monitoring/components/menu.vue @@ -58,7 +58,7 @@ onMounted(() => { function menuApi() { //获取表格左侧菜单 getMenu().then((res: any) => { - if (res.code === 200) { + if (res.code === 200 && res.data.length != 0) { menuDeptKey.value = routerType.value === '1' ? deptId.value @@ -71,13 +71,17 @@ function menuApi() { sessionStorageIns.setUseStorage('deptId', menuDeptKey.value); mitt.emit('menuKey', menuDeptKey.value); emit('tableMenuData', res.data); + } else { + menuDeptKey.value = 0; + selectedKey.value = menuDeptKey.value; + sessionStorageIns.setUseStorage('deptId', menuDeptKey.value); } }); } function comMenuApi() { //获取组态左侧菜单 getMenuData().then((res: any) => { - if (res.code === 200) { + if (res.code === 200 && res.data.length != 0) { menuIdKey.value = routerType.value === '1' ? id.value @@ -91,6 +95,11 @@ function comMenuApi() { sessionStorageIns.setUseStorage('deptId', routerType.value === '1' ? deptId.value : parentId); mitt.emit('deviceMenuKey', menuIdKey.value); emit('tableMenuData', res.data); + } else { + menuIdKey.value = 0; + selectedKey.value = menuIdKey.value; + sessionStorageIns.setUseStorage('id', menuIdKey.value); + sessionStorageIns.setUseStorage('deptId', menuIdKey.value); } }); } diff --git a/src/views/monitoring/screenData/components/header.vue b/src/views/monitoring/screenData/components/header.vue index edbbab4..e3d0d1b 100644 --- a/src/views/monitoring/screenData/components/header.vue +++ b/src/views/monitoring/screenData/components/header.vue @@ -1,6 +1,6 @@