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 { param } from "../../../utils";
import { checkPermi } from "@/utils/permission.js"; import { checkPermi } from "@/utils/permission.js";
import { checkRole } from '@/utils/permission'
export default { export default {
name: "WarningNotify", name: "WarningNotify",
props: { props: {
@ -111,6 +112,26 @@ export default {
level: "warning", level: "warning",
duration: 4000 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){ if(!obj.level){
return; return;
@ -258,6 +279,8 @@ export default {
} else if(info.subEvent==='deviceOfflineRecord'){ } else if(info.subEvent==='deviceOfflineRecord'){
this.activeId = info.content.deviceOfflineRecord.id.toString(); this.activeId = info.content.deviceOfflineRecord.id.toString();
this.modelDeviceVisible = true; this.modelDeviceVisible = true;
} else if(info.subEvent==='externalPlatformOffline'){
} else { } else {
this.activeName = info.eventState this.activeName = info.eventState
request({ request({

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

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

Loading…
Cancel
Save