添加链接提示

This commit is contained in:
joylink_fanyuhong 2024-11-12 15:18:07 +08:00
parent 33292ca9b8
commit cfcf0e06d1
2 changed files with 39 additions and 2 deletions

View File

@ -157,7 +157,7 @@ export function cancelSubscribe(lineNetApp: IGraphicApp) {
}
let monitorDestinations: string[] = [];
export function handleSubscribe(lineNetApp: IGraphicApp) {
function handleSubscribe(lineNetApp: IGraphicApp) {
const lineNetStore = useLineNetStore();
lineNetApp.enableWsMassaging({
wsUrl: `${getWebsocketUrl()}`,

View File

@ -7,7 +7,7 @@ import {
cancelSubscribe,
} from 'src/drawApp/lineNetApp';
import { markRaw } from 'vue';
import { QTable } from 'quasar';
import { Notify, QTable } from 'quasar';
import { state } from 'src/protos/system_warn_message';
export interface AlarmInfo {
id: string;
@ -91,6 +91,43 @@ export const useLineNetStore = defineStore('lineNet', {
});
},
setConnectInfo(data: state.WarnLineMessage) {
let tip = '';
data.msgs.forEach((item: state.WarnMessage) => {
if (this.connectInfo) {
this.connectInfo.msgs.forEach((elem) => {
if (elem.lineId === item.lineId) {
if (elem.occRealConned && !item.occRealConned) {
tip =
tip +
`<div>${elem.lineId}号线路与卡斯柯的实时连接已断开;</div>`;
}
if (elem.occUnrealConned && !item.occUnrealConned) {
tip =
tip +
`<div>${elem.lineId}号线路与卡斯柯的非实时连接已断开</div>`;
}
}
});
}
});
if (tip) {
const msgNotify = Notify.create({
type: 'negative',
timeout: 0,
position: 'top',
html: true,
message: tip,
actions: [
{
icon: 'close',
color: 'white',
handler: () => {
msgNotify();
},
},
],
});
}
this.connectInfo = data;
const allConnectAmount = data.msgs.reduce((pre, cur) => {
let addValue = 0;