diff --git a/src/types/auto-imports.d.ts b/src/types/auto-imports.d.ts index 5742656..6f8d200 100644 --- a/src/types/auto-imports.d.ts +++ b/src/types/auto-imports.d.ts @@ -2,11 +2,6 @@ export {} declare global { const EffectScope: typeof import('vue')['EffectScope'] - const ElForm: typeof import('element-plus/es')['ElForm'] - 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 NEllipsis: typeof import('naive-ui')['NEllipsis'] const asyncComputed: typeof import('@vueuse/core')['asyncComputed'] const autoResetRef: typeof import('@vueuse/core')['autoResetRef'] const computed: typeof import('vue')['computed'] @@ -273,11 +268,6 @@ import { UnwrapRef } from 'vue' declare module 'vue' { interface ComponentCustomProperties { readonly EffectScope: UnwrapRef - readonly ElForm: UnwrapRef - readonly ElMessage: UnwrapRef - readonly ElMessageBox: UnwrapRef - readonly ElNotification: UnwrapRef - readonly NEllipsis: UnwrapRef readonly asyncComputed: UnwrapRef readonly autoResetRef: UnwrapRef readonly computed: UnwrapRef diff --git a/src/views/monitoring/screenData/components/header.vue b/src/views/monitoring/screenData/components/header.vue new file mode 100644 index 0000000..edbbab4 --- /dev/null +++ b/src/views/monitoring/screenData/components/header.vue @@ -0,0 +1,546 @@ + + + + diff --git a/src/views/monitoring/screenData/components/main.vue b/src/views/monitoring/screenData/components/main.vue index cd77b5e..201f711 100644 --- a/src/views/monitoring/screenData/components/main.vue +++ b/src/views/monitoring/screenData/components/main.vue @@ -136,6 +136,7 @@ import mitt from '@/plugins/bus'; // import socket from '@/utils/socket'; import useStorage from '@/utils/useStorage'; import { useUserStoreHook } from '@/store/modules/user'; +import { randomColor, endTime, debounce } from '@/utils/index'; const sessionStorageIns = useStorage('sessionStorage'); const { perms } = useUserStoreHook(); @@ -274,13 +275,12 @@ onMounted(() => { // clearTimeout(timer.value); // } // }); - +onBeforeUnmount(() => { + clearTimeout(timer.value); +}); onBeforeRouteLeave((to, from) => { - //监听离开页面 //组件注销前清除setTimeout - if (timer.value !== null || timer.value !== undefined) { - clearTimeout(timer.value); - } + clearTimeout(timer.value); }); mitt.on('currentPageEmits', (res: any) => { @@ -439,10 +439,13 @@ function tableMockDatas() { tablePage.total = res.total; // gridOptions.data = res.data; loadingShow.value = false; - asyncTableDatas(); + tbleDataDebounce(); } }); } +const tbleDataDebounce = debounce(() => { + asyncTableDatas(); +}, 10000); function asyncTableDatas() { //获取表格数据 // const params = menuKey.value; diff --git a/src/views/monitoring/screenData/components/menu.vue b/src/views/monitoring/screenData/components/menu.vue index 1e79782..a371bcd 100644 --- a/src/views/monitoring/screenData/components/menu.vue +++ b/src/views/monitoring/screenData/components/menu.vue @@ -121,12 +121,12 @@ function menuUpdateValue(key: string, item: MenuOption) { sessionStorageIns.setUseStorage(props.menuType === '1' ? 'deptId' : 'id', key); sessionStorageIns.setUseStorage('currentPage', 1); if (props.menuType === '1') { - mitt.emit('currentPageEmits', 1); + mitt.emit('currentPageEmit', 1); } if (props.menuType === '2') { sessionStorageIns.setUseStorage('deptId', item.parentId); } - mitt.emit(props.menuType === '1' ? 'menuKey' : 'deviceMenuKey', key); + mitt.emit(props.menuType === '1' ? 'menuMockKeys' : 'deviceMenuKey', key); console.log(key, item); } diff --git a/src/views/monitoring/screenData/index.vue b/src/views/monitoring/screenData/index.vue index 3a03bf6..fe3688f 100644 --- a/src/views/monitoring/screenData/index.vue +++ b/src/views/monitoring/screenData/index.vue @@ -90,7 +90,7 @@ import { useRoute, useRouter, onBeforeRouteLeave } from 'vue-router'; // import { useDateFormat, useNow } from '@vueuse/core'; // import { Filter, Maximize, Settings, Power } from '@vicons/tabler'; -import Header from '../components/header.vue'; +import Header from './components/header.vue'; import Menu from './components/menu.vue'; import Main from './components/main.vue'; import InfoPanel from './components/infoPanel.vue';