| | |
| | | |
| | | /** 头部组件 */ |
| | | |
| | | import React from 'react'; |
| | | import React, { useEffect } from 'react'; |
| | | import { Layout, Menu, Dropdown, Icon, Row, Col, message } from 'antd'; |
| | | const { Header } = Layout; |
| | | import './index.scss'; |
| | |
| | | |
| | | export default function MenuView({ }) { |
| | | |
| | | var loginUser = window.localStorage.getItem('loginUser') || '{}'; |
| | | loginUser = JSON.parse(loginUser); |
| | | console.log(loginUser) |
| | | return ( |
| | | <Header style={{ background: '#fff', padding: 0, boxShadow: 'inset 0 -1px 0 0 #E5E5E5' }}> |
| | | { |
| | | (loginUser && Object.keys(loginUser).length) && |
| | | <Row type="flex" align="middle" justify="end" > |
| | | <Col style={{ marginRight: 40 }}> |
| | | {loginUser.trueName} |
| | | <Dropdown overlay={menu}> |
| | | <a className="ant-dropdown-link" onClick={e => e.preventDefault()}> |
| | | 登陆人<Icon type="down" /> |
| | | [{loginUser.dept} | {loginUser.post}]<Icon type="caret-down" /> |
| | | </a> |
| | | </Dropdown> |
| | | </Col> |
| | | </Row> |
| | | } |
| | | </Header> |
| | | ); |
| | | } |
| | |
| | | /** 通知列表 */ |
| | | 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.documentContent || '' |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | 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">[查看全部]</span> |
| | | </div> |
| | | } |
| | | |
| | | render() { |
| | | let { content } = this.state; |
| | | |
| | | return ( |
| | | <div className="notify-list-main"> |
| | | { |
| | | content && |
| | | <Alert |
| | | // message="Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text" |
| | | message={this.renderDom()} |
| | | type="warning" |
| | | closable={false} |
| | | // onClose={onClose} |
| | | /> |
| | | } |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | |
| | | /** 工作制度 */ |
| | | import React, { ReactNode, ReactEventHandler, Component } from 'react'; |
| | | import { Button } from 'antd'; |
| | | import TableView from '../../../common/TableView'; |
| | | import SearchFormView from '../../../common/SearchFormView'; |
| | | import moment from 'moment'; |
| | |
| | | { title: '通知内容', dataIndex: 'documentContent' }, |
| | | { title: '接受情况', dataIndex: 'groupType', render: (cur, item) => <span>{item.readNumber || 0}/{item.noticeNumber || 0}</span> }, |
| | | { title: '通知时间', dataIndex: 'createTime', render: (cur, item) => cur !== "" && cur != null ? moment(cur).format("YYYY-MM-DD HH:mm") : "" }, |
| | | { title: '操作', render: (text, record) => <a href="" onClick={() => this.cancle(record.id)}>查看</a> } |
| | | { title: '操作', render: (text, record) => <a onClick={() => this.cancle(record.id)}>查看</a> } |
| | | ]; |
| | | } |
| | | |
| | |
| | | |
| | | // 将token放入缓存 |
| | | window.localStorage.setItem('token', res.token); |
| | | window.localStorage.setItem('loginUser', JSON.stringify(res)); //登录的用户信息 |
| | | |
| | | // 获取登录用户的菜单权限 |
| | | fetch({ |
| | | url: `api/resource/getResource`, |
| | | }).then(res => { |
| | |
| | | this.props.history.push({ pathname: "/index" }); |
| | | } |
| | | }) |
| | | |
| | | |
| | | } |
| | | |
| | | render() { |