Commit 14a03368 authored by 杨思琦's avatar 杨思琦

fix: 报警推送修改

parent d08f83a1
Pipeline #77850 passed with stages
......@@ -15,7 +15,8 @@ class Message {
defaultContent,
webIcon,
title,
infoClasses
infoClasses,
webVoice
} = message) {
this.id = id;
this.infoContent = infoContent;
......@@ -30,6 +31,7 @@ class Message {
this.title = title; // 消息标题
this.defaultContent = defaultContent;
this.infoClasses = infoClasses;
this.webVoice = webVoice;
}
}
......@@ -68,6 +70,7 @@ export const createMessageFromHis = (hisMessage, options = {}) => {
dateTime: hisMessage.hisCreateTime,
infoLevel: hisMessage.infoLevel,
webConfig: hisMessage.web_config,
webVoice: hisMessage.webVoice,
webPath: hisMessage.web_path,
messType: hisMessage.messType,
defaultContent: (_.isString(hisMessage.defaultContent) && hisMessage.defaultContent.replace(new RegExp(/ /g), "").length > 0) ? hisMessage.defaultContent : null,
......@@ -109,6 +112,7 @@ export const createMessageFromReal = (realMesssage, options = {}) => {
dateTime: realMesssage.createTime,
webConfig: realMesssage.web_config,
webPath: realMesssage.web_path,
webVoice: realMesssage.webVoice,
messType: realMesssage.messType || realMesssage.MessType,
defaultContent: (_.isString(realMesssage.defaultContent) && realMesssage.defaultContent.replace(new RegExp(/ /g), "").length > 0) ? realMesssage.defaultContent : null,
webIcon: (_.isString(realMesssage.webIcon) && realMesssage.webIcon.replace(new RegExp(/ /g), "").length > 0) ? realMesssage.webIcon : null,
......
......@@ -425,7 +425,8 @@ class Notifier {
*/
speakMessage = message => {
if (!message) return;
const { version } = message;
const { version, webVoice } = message;
if(webVoice) return this.speakWebVoice(message);
if(version === '3.0') return this.speakDefault(message);
switch(message.infoType) {
case 'SCADA报警':
......@@ -492,6 +493,12 @@ class Notifier {
let msg = `${message.title},${message.title}: ${message.infoContent ?? ''}`
this.speak(msg);
};
speakWebVoice = message => {
const { webVoice } = message;
if(typeof webVoice === "string") {
this.speak(webVoice?.replace(/_/g, ','));
}
}
speak = msg => {
if (!this.speakState) return;
this.speakState.text = msg;
......
......@@ -261,11 +261,9 @@ export const initMicroApps = (url) => {
start(Configuration);
runAfterFirstMounted(() => {
event.emit('loading', false);
if(micro.length <= 3) {
setTimeout(() => {
prefetchApps(micro);
}, 500)
}
setTimeout(() => {
prefetchApps(micro);
}, 5000)
Logger.info('[MainApp] first app mounted');
});
addGlobalUncaughtErrorHandler(event => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment