Browse Source

修改字段

develop
fuguobin 9 months ago
parent
commit
dfb4d761a0
  1. 4
      src/permission.ts
  2. 2
      src/views/monitoring/screen/components/main.vue

4
src/permission.ts

@ -54,8 +54,8 @@ router.beforeEach(async (to, from, next) => {
//登录后连接webSocket //登录后连接webSocket
const userStorageInfo = sessionStorage.getItem('userInfo'); const userStorageInfo = sessionStorage.getItem('userInfo');
const userInfo = JSON.parse(userStorageInfo === null ? '' : userStorageInfo); const userInfo = JSON.parse(userStorageInfo === null ? '' : userStorageInfo);
const wsUrl = `ws://${window.location.host}/ws/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地址 const wsUrl = `ws://10.10.10.56:9010/websocket/${userInfo.userName}`; //websocket地址
socket.initialize(wsUrl); socket.initialize(wsUrl);
next({ ...to, replace: true }); next({ ...to, replace: true });
} catch (error) { } catch (error) {

2
src/views/monitoring/screen/components/main.vue

@ -303,7 +303,7 @@ mitt.on('tableMessage', (res: any) => {
if ($table) { if ($table) {
console.log('tableRef--', tableRef.value); console.log('tableRef--', tableRef.value);
res.data.map((item: any) => { res.data.map((item: any) => {
const index = tableArray.findIndex(obj => obj.id === item.id); const index = tableArray.findIndex(obj => obj.assetInfo.id === item.assetInfo.id);
if (index !== -1) { if (index !== -1) {
tableArray.splice(index, 1, item); tableArray.splice(index, 1, item);
} }

Loading…
Cancel
Save