Browse Source

修改判断条件

develop
fuguobin 8 months ago
parent
commit
a1978be096
  1. 4
      src/permission.ts
  2. 10
      src/types/auto-imports.d.ts
  3. 2
      src/views/monitoring/screen/components/main.vue

4
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) {

10
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<typeof import('vue')['EffectScope']>
readonly ElForm: UnwrapRef<typeof import('element-plus/es')['ElForm']>
readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']>
readonly ElMessageBox: UnwrapRef<typeof import('element-plus/es')['ElMessageBox']>
readonly ElNotification: UnwrapRef<typeof import('element-plus/es')['ElNotification']>
readonly NEllipsis: UnwrapRef<typeof import('naive-ui')['NEllipsis']>
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>
readonly computed: UnwrapRef<typeof import('vue')['computed']>

2
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);
}

Loading…
Cancel
Save