Commit 7be1624e authored by 邓晓峰's avatar 邓晓峰

fix: message bug

parent c2a85c3f
Pipeline #21671 skipped with stages
......@@ -23,6 +23,7 @@ class NoticeList extends React.Component {
super(props);
this.emptyText = props.emptyText;
this.confirmRead = props.confirmRead;
this.handlerSysDetail = props.handlerSysDetail
this.loadMore = props.loadMore;
this.hasMore = props.hasMore;
this.container = React.createRef();
......@@ -124,7 +125,7 @@ class NoticeList extends React.Component {
break;
case 'sysType':
messageTemplate = (
<Notice message={item} confirmRead={this.confirmRead} config={this.props.config}/>
<Notice message={item} confirmRead={this.confirmRead} config={this.props.config} handlerSysDetail={this.handlerSysDetail}/>
);
break;
default:
......
......@@ -28,7 +28,6 @@ export class AlarmContent {
const Alarm = ({ message, confirmRead, config }) => {
const alarmContent = (config.mqtt_mess.MessageLevel === "2.0" && isJSON(message.infoContent)) ? JSON.parse(message.infoContent): message.infoContent;
const goPath = item => {
debugger
confirmRead(false, [message.id]);
const widgetID = 'widget_city_综合运营_管网监控_实时监控_报警监控';
const webPath = 'product/scada/AlertMonitoring/AlertMonitoring';
......@@ -41,6 +40,8 @@ const Alarm = ({ message, confirmRead, config }) => {
});
};
const alarmValue = alarmContent && alarmContent.alarmValue && alarmContent.alarmValue.split(' ');
let alarmTitle = alarmContent && alarmContent.alarmValue && alarmContent.title.split(' ');
alarmTitle = alarmTitle[1];
return (
<div
className={classNames(styles.scada, commonStyles.messageContainer)}
......@@ -63,7 +64,7 @@ const Alarm = ({ message, confirmRead, config }) => {
<div className={commonStyles.content}>
<p>
<i>{alarmContent.alarmType}</i>
{alarmContent.alarmDevice}
{alarmTitle}
</p>
<p>{alarmContent.alarmContent}</p>
<p>
......
......@@ -16,15 +16,19 @@ export class NoticeContent {
}
}
const Notice = ({ message, confirmRead, config }) => {
const Notice = ({ message, confirmRead, config, handlerSysDetail }) => {
// eslint-disable-next-line no-debugger
const noticeContent =
config.mqtt_mess.MessageLevel === '2.0' && isJSON(message.infoContent)
? JSON.parse(message.infoContent)
: message.infoContent;
const goPath = item => {
// eslint-disable-next-line no-debugger
debugger
// eslint-disable-next-line no-debugger
confirmRead(false, [message.id]);
handlerSysDetail && handlerSysDetail(message);
};
return (
<div
......@@ -49,7 +53,8 @@ const Notice = ({ message, confirmRead, config }) => {
<i>{noticeContent.noticeType}</i>
{noticeContent.noticeTitle}
</p>
<p dangerouslySetInnerHTML={{ __html: noticeContent.noticeContent }}></p>
{/* eslint-disable-next-line react/no-danger */}
<p dangerouslySetInnerHTML={{ __html: noticeContent.noticeContent }} />
<p className={commonStyles.messageTime}>{message.time}</p>
</div>
</div>
......
......@@ -283,7 +283,7 @@ class Notifier {
const userInfo = this.getUserInfo();
const infoType = this.getMessageType(parseMessage.infoType);
let state = null;
debugger
if (
_.isEmpty(parseMessage.tousers) ||
userInfo.OID == parseMessage.tousers ||
......@@ -375,6 +375,7 @@ class Notifier {
} else if (message.infoLevel === PLATFORM_LEVEL) {
console.log(messString);
} else if(message.infoLevel === SYS_LEVEL) {
debugger
this.renderSysNoticePlatform(Object.assign(message, { messContent }))
} else {
state.lang = 'zh';
......@@ -489,6 +490,8 @@ class Notifier {
}
renderSysNoticePlatform(message) {
debugger
this.renderSysElement = null;
this.renderSysElement = this.renderSysPlatform && this.renderSysPlatform(message)
}
......
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