import React from 'react';
import Message from "./Message.jsx";
import "antd/dist/antd.css";
import "../../assets/css/App.css";
import MessageDialog from './MessageDialog.jsx';
import headMes from "../../assets/images/header-message.png";
import headMes2 from "../../assets/images/header-message2.png";
import {Tooltip} from "antd";
class MessBox extends React.Component {
constructor(props) {
super(props);
this.state = {
messageCount: 0,
dataSource:[],
visible:true,
}
}
componentWillUnmount() {
if (this.messageTimer) {
clearInterval(this.messageTimer);
this.messageTimer = null;
}
this.setState = (state, callback) => {
return;
};
}
// 消息列表
showMessage = (event) => {
event.stopPropagation();
this.messageRef.show();
};
/**
* 消息定时器任务
* @author changeBy: DYK
* @param ref
* @param stutus
*/
onMessageRef = (ref) => {
this.messageRef = ref;
if (this.messageTimer) {
clearInterval(this.messageTimer);
}
this.messageTimer = setInterval(() => {
ref.recordData();
}, 60000);
};
onMessageDialogRef = (ref) =>{
this.onMessageDialog = ref
}
render() {
let showMessagePopUp = window.sessionStorage ? window.sessionStorage.getItem("showMessagePopUp") : "Y";
let content = "";
let showMessagePopUpFlag="N";
this.state.dataSource.map((item, index) => {
if (item.showDialog == 'Y') {
showMessagePopUpFlag="Y";
}
})
//头菜单
if (this.props.position == "top") {
content = (
{/*changeBy: DYK*/}
0 ? "flex" : "none"
}}>
{
this.state.messageCount && this.state.messageCount > 99 ? "99+" : this.state.messageCount
}
{/*{this.state.localeProvider && this.state.localeProvider.MoreEditMessageNotification ? this.setMessage('MoreEditMessageNotification', 'descripts') : "消息提醒"} */}
)
}
else {
//侧菜单
content = (
0 ? "flex" : "none"
}}>
{
this.state.messageCount && this.state.messageCount > 99 ? "99+" : this.state.messageCount
}
{/*{this.state.localeProvider && this.state.localeProvider.MoreEditMessageNotification ? this.setMessage('MoreEditMessageNotification', 'descripts') : "消息提醒"} */}
)
}
return content
}
}
export default MessBox