| | |
| | | import React, { Component } from 'react' |
| | | import { CloseOutlined } from '@ant-design/icons' |
| | | import { CloseOutlined, SoundOutlined } from '@ant-design/icons' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | |
| | |
| | | |
| | | sysMessageChange = (notices) => { |
| | | this.setState({ notices }) |
| | | |
| | | if (notices.length === 0) { |
| | | this.setState({ visible: false }) |
| | | } |
| | | } |
| | | |
| | | sysMessageOpen = () => { |
| | |
| | | this.setState({ visible: false }) |
| | | } |
| | | |
| | | toMenu = () => { |
| | | let menu = { |
| | | MenuID: '1731250110643ivgpv9gdgiif5lggh4e', |
| | | MenuName: '内部邮箱', |
| | | type: 'CustomPage', |
| | | param: {$BID: ''} |
| | | } |
| | | |
| | | if (window.GLOB.mkThdMenus.has(menu.MenuID)) { |
| | | menu.MenuName = window.GLOB.mkThdMenus.get(menu.MenuID).MenuName |
| | | } |
| | | |
| | | MKEmitter.emit('modifyTabs', menu) |
| | | |
| | | this.setState({ visible: false }) |
| | | } |
| | | |
| | | render() { |
| | | const { visible, notices } = this.state |
| | | |
| | | return ( |
| | | <div className={'mk-msg-wrap' + (visible ? ' visible' : '')}> |
| | | <div className="title"> |
| | | 系统消息 |
| | | <SoundOutlined /> |
| | | <CloseOutlined onClick={this.close}/> |
| | | </div> |
| | | <div className="msg-list">{notices.map((item, index) => { |
| | | return <div className="msg-item" key={index}> |
| | | {item.remark} |
| | | return <div className={'msg-item ' + (item.urgent_type === 'Y' ? 'red' : '')} key={index} onClick={this.toMenu}> |
| | | <span>{item.createstaff}</span><span className="time">{item.time}</span> |
| | | <span>{item.title}</span> |
| | | </div> |
| | | })}</div> |
| | | <span className="jump" onClick={this.toMenu}>详情 ></span> |
| | | </div> |
| | | ) |
| | | } |