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

fix: 报警推送修改

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