| | |
| | | import React, { Component } from 'react' |
| | | import { MessageFilled } from '@ant-design/icons' |
| | | import { notification } from 'antd' |
| | | import { MessageFilled, CloseOutlined } from '@ant-design/icons' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Api from '@/api' |
| | | // import MKEmitter from '@/utils/events.js' |
| | | |
| | | import './sysmessage.scss' |
| | | |
| | | class SysMessage extends Component { |
| | | state = { |
| | | |
| | | visible: false, |
| | | notices: [] |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | |
| | | } |
| | | |
| | | open = () => { |
| | | let menu = { |
| | | MenuID: 'message_page_id', |
| | | MenuName: '系统消息', |
| | | type: 'SysMessage' |
| | | getMsgList = () => { |
| | | let param = { |
| | | func: 's_get_kei' |
| | | } |
| | | |
| | | MKEmitter.emit('modifyTabs', menu) |
| | | Api.getSystemConfig(param).then(result => { |
| | | if (result.status) { |
| | | let notices = result.data |
| | | |
| | | this.setState({ notices }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | open = () => { |
| | | // let menu = { |
| | | // MenuID: 'message_page_id', |
| | | // MenuName: '系统消息', |
| | | // type: 'SysMessage' |
| | | // } |
| | | |
| | | // MKEmitter.emit('modifyTabs', menu) |
| | | this.setState({ visible: true }) |
| | | } |
| | | |
| | | render() { |
| | | return ( |
| | | const { visible } = this.state |
| | | |
| | | return (<> |
| | | <MessageFilled className="mk-msg-icon" data-title="23" onClick={this.open} /> |
| | | ) |
| | | <div className={'mk-msg-wrap' + (visible ? ' visible' : '')}> |
| | | <div className="title"> |
| | | 系统消息 |
| | | <CloseOutlined /> |
| | | </div> |
| | | <div>list</div> |
| | | </div> |
| | | </>) |
| | | } |
| | | } |
| | | |