From a1978be096a9001934b4bc16c20d4bc8e56fc19d Mon Sep 17 00:00:00 2001 From: fuguobin Date: Fri, 15 Mar 2024 08:48:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=A4=E6=96=AD=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/permission.ts | 4 ++-- src/types/auto-imports.d.ts | 10 ++++++++++ src/views/monitoring/screen/components/main.vue | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/permission.ts b/src/permission.ts index 11876cf..1bee866 100644 --- a/src/permission.ts +++ b/src/permission.ts @@ -54,8 +54,8 @@ router.beforeEach(async (to, from, next) => { //登录后连接webSocket const userStorageInfo = sessionStorage.getItem('userInfo'); const userInfo = JSON.parse(userStorageInfo === null ? '' : userStorageInfo); - // const wsUrl = `ws://${window.location.host}/ws/websocket/${userInfo.userName}`; //websocket地址 - const wsUrl = `ws://10.10.10.56:9010/websocket/${userInfo.userName}`; //websocket地址 + const wsUrl = `ws://${window.location.host}/ws/websocket/${userInfo.userName}`; //websocket地址 + // const wsUrl = `ws://10.10.10.56:9010/websocket/${userInfo.userName}`; //websocket地址 socket.initialize(wsUrl); next({ ...to, replace: true }); } catch (error) { diff --git a/src/types/auto-imports.d.ts b/src/types/auto-imports.d.ts index 6f8d200..5742656 100644 --- a/src/types/auto-imports.d.ts +++ b/src/types/auto-imports.d.ts @@ -2,6 +2,11 @@ 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'] @@ -268,6 +273,11 @@ 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/screen/components/main.vue b/src/views/monitoring/screen/components/main.vue index 0fde07a..8ef22ff 100644 --- a/src/views/monitoring/screen/components/main.vue +++ b/src/views/monitoring/screen/components/main.vue @@ -303,7 +303,7 @@ mitt.on('tableMessage', (res: any) => { if ($table) { console.log('tableRef--', tableRef.value); res.data.map((item: any) => { - const index = tableArray.findIndex(obj => obj.assetInfo.id === item.assetInfo.id); + const index = tableArray.findIndex(obj => obj.assetInfo.id === item.assetInfo.id && obj.areaid === item.areaid); if (index !== -1) { tableArray.splice(index, 1, item); }