Browse Source

外部平台离线通知

develop
lau572 2 weeks ago
parent
commit
ad70a44840
  1. 23
      ruoyi-ui/src/views/JiHeExpressway/components/WarningNotify.vue
  2. 5
      ruoyi-ui/src/views/websocket.vue

23
ruoyi-ui/src/views/JiHeExpressway/components/WarningNotify.vue

@ -20,6 +20,7 @@ import { WarningType as warningTypeMapping, DirectionTypes as gzDirectionMapping
import { param } from "../../../utils";
import { checkPermi } from "@/utils/permission.js";
import { checkRole } from '@/utils/permission'
export default {
name: "WarningNotify",
props: {
@ -111,6 +112,26 @@ export default {
level: "warning",
duration: 4000
}
} else if(checkRole(["admin"]) && para.subEvent === 'externalPlatformOffline'){
if (para.content.type == '1'){
para.content.content = 'GIS+BIM系统异常'
} else if(para.content.type == '2'){
para.content.content = '数字孪生系统异常'
} else if(para.content.type == '3'){
para.content.content = '收费运营系统异常'
} else if(para.content.type == '4'){
para.content.content = '桥梁监测系统异常'
} else {
para.content.content = '光纤在线检测系统异常'
}
obj = {
content: para.content.content,
time:'',
type: "externalPlatformOffline",
level: "danger",
duration: 0
}
}
if(!obj.level){
return;
@ -258,6 +279,8 @@ export default {
} else if(info.subEvent==='deviceOfflineRecord'){
this.activeId = info.content.deviceOfflineRecord.id.toString();
this.modelDeviceVisible = true;
} else if(info.subEvent==='externalPlatformOffline'){
} else {
this.activeName = info.eventState
request({

5
ruoyi-ui/src/views/websocket.vue

@ -31,13 +31,13 @@ export default {
// websocket
this.socket.initialize({
// url: 'ws://' + location.hostname + ':' + port + path,
//url: 'wss://' + locatoin.hostname + ':' + window.location.port + '/ws' || 80 + '/ws',
url: 'wss://' + locatoin.hostname + ':' + window.location.port + '/ws' || 80 + '/ws',
// url: "ws://10.168.66.196:7789" + path,
// url: 'ws://10.168.77.128:7789/ws',
// url: "ws://10.7.179.15" + ":" + port + path,
// url: "ws://10.168.64.171" + ":" + port + path,
// url: 'ws://10.168.78.127'+ ':' + port + path,
url: 'ws://127.0.0.1'+ ':' + 7789 + '/ws',
// url: 'ws://127.0.0.1'+ ':' + 7789 + '/ws',
password: password,
tokenSN: this.token,
heartRate: interval,
@ -107,6 +107,7 @@ export default {
case "0":
case "3":
case "2":
case "externalPlatformOffline":
case "trafficFlowDataEarlyWarning":
this.$emit("newEvent", params);
break;

Loading…
Cancel
Save