| | |
| | | /** 通知列表 */ |
| | | import React, { ReactNode, ReactEventHandler, Component } from 'react'; |
| | | import { Alert } from 'antd'; |
| | | import fetch from '../../../api/request'; |
| | | |
| | | import './index.scss'; |
| | | |
| | |
| | | this.config = { |
| | | }; |
| | | this.state = { |
| | | content: '' |
| | | }; |
| | | } |
| | | |
| | | componentWillMount() { } |
| | | componentWillMount() { |
| | | fetch({ |
| | | url: `api/document/getNewNotice` |
| | | }).then(res => { |
| | | console.log('res', res); |
| | | this.setState({ |
| | | content: res.documentTitle || '' |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | componentDidMount() { } |
| | | |
| | |
| | | } |
| | | |
| | | renderDom = () => { |
| | | let { content } = this.state; |
| | | return <div className="notify-list-main-dom"> |
| | | <span className="notify-list-main-dom-msg">最新通知:公司本部从XX时间开始,调整省略很长很长的内容调整省略很长很长的内容公司本部从XX时间开始,调整省略很长很长的内容调整省略很长很长的内容公司本部从XX时间开始,调整省略很长很长的内容调整省略很长很长的内容</span> |
| | | <span className="notify-list-main-dom-msg">最新通知:{content}</span> |
| | | <span className="notify-list-main-dom-fuc" onClick={this.onClick}>[查看全部]</span> |
| | | </div> |
| | | } |
| | | |
| | | render() { |
| | | let { content } = this.state; |
| | | |
| | | return ( |
| | | <div className="notify-list-main"> |
| | | <Alert |
| | | // message="Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text" |
| | | message={this.renderDom()} |
| | | type="warning" |
| | | closable={false} |
| | | // onClose={onClose} |
| | | /> |
| | | { |
| | | content && |
| | | <Alert |
| | | // message="Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text" |
| | | message={this.renderDom()} |
| | | type="warning" |
| | | closable={false} |
| | | /> |
| | | } |
| | | </div> |
| | | ) |
| | | } |