1 文件已重命名
6个文件已修改
1个文件已删除
2个文件已添加
| | |
| | | const TreePage = asyncComponent(() => import('@/tabviews/treepage')) |
| | | const Iframe = asyncComponent(() => import('@/tabviews/iframe')) |
| | | const RoleManage = asyncComponent(() => import('@/tabviews/rolemanage')) |
| | | const SysMessage = asyncComponent(() => import('@/tabviews/sysmessage')) |
| | | |
| | | if (sessionStorage.getItem('lang') === 'zh-CN') { |
| | | moment.locale('zh-cn') |
| | |
| | | return (<Home MenuID={view.MenuID} MenuName={view.MenuName}/>) |
| | | } else if (view.type === 'RolePermission') { |
| | | return (<RoleManage MenuID={view.MenuID}/>) |
| | | } else if (view.type === 'SysMessage') { |
| | | return (<SysMessage />) |
| | | } else if (view.type === 'CommonTable') { |
| | | return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param} changeTemp={this.changeTemp}/>) |
| | | } else if (view.type === 'TreePage') { |
| | |
| | | const Resetpwd = asyncComponent(() => import('@/components/resetPassword')) |
| | | const QrCode = asyncComponent(() => import('@/components/qrcode')) |
| | | const LoginForm = asyncSpinComponent(() => import('./loginform')) |
| | | const SysMessage = asyncComponent(() => import('./sysmessage')) |
| | | const SysIcon = asyncComponent(() => import('./sysmessage/icon')) |
| | | |
| | | class Header extends Component { |
| | | state = { |
| | |
| | | <SearchOutlined className="search-menu" /> |
| | | </Dropdown> : null |
| | | } |
| | | {window.GLOB.SysNotice ? <SysMessage /> : null} |
| | | {window.GLOB.SysNotice ? <SysIcon /> : null} |
| | | {/* 头像、用户名 */} |
| | | <Dropdown className="header-setting" overlay={menu}> |
| | | <div> |
New file |
| | |
| | | import React, { Component } from 'react' |
| | | import { notification } from 'antd' |
| | | import { MessageFilled } from '@ant-design/icons' |
| | | |
| | | import Api from '@/api' |
| | | import MKEmitter from '@/utils/events.js' |
| | | |
| | | class SysIcon extends Component { |
| | | state = { |
| | | notices: [] |
| | | } |
| | | |
| | | componentDidMount () { |
| | | setTimeout(() => { |
| | | this.getMsgList() |
| | | }, 2000) |
| | | } |
| | | |
| | | getMsgList = () => { |
| | | let param = { |
| | | func: 's_get_kei' |
| | | } |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | if (result.status) { |
| | | let notices = result.data || [] |
| | | |
| | | this.setState({ notices }) |
| | | MKEmitter.emit('sysMessageChange', notices) |
| | | |
| | | setTimeout(() => { |
| | | this.getMsgList() |
| | | }, 600000) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | open = () => { |
| | | MKEmitter.emit('sysMessageOpen') |
| | | } |
| | | |
| | | render() { |
| | | const { notices } = this.state |
| | | |
| | | return ( |
| | | <MessageFilled className="mk-msg-icon" data-title={notices.length ? notices.length : ''} onClick={this.open} /> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default SysIcon |
New file |
| | |
| | | import React, { Component } from 'react' |
| | | import { CloseOutlined } from '@ant-design/icons' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | |
| | | import './index.scss' |
| | | |
| | | class SysMessage extends Component { |
| | | state = { |
| | | visible: false, |
| | | notices: [] |
| | | } |
| | | |
| | | componentDidMount() { |
| | | MKEmitter.addListener('sysMessageChange', this.sysMessageChange) |
| | | MKEmitter.addListener('sysMessageOpen', this.sysMessageOpen) |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('sysMessageChange', this.sysMessageChange) |
| | | MKEmitter.removeListener('sysMessageOpen', this.sysMessageOpen) |
| | | } |
| | | |
| | | sysMessageChange = (notices) => { |
| | | this.setState({ notices }) |
| | | } |
| | | |
| | | sysMessageOpen = () => { |
| | | this.setState({ visible: true }) |
| | | } |
| | | |
| | | close = () => { |
| | | this.setState({ visible: false }) |
| | | } |
| | | |
| | | render() { |
| | | const { visible, notices } = this.state |
| | | |
| | | return ( |
| | | <div className={'mk-msg-wrap' + (visible ? ' visible' : '')}> |
| | | <div className="title"> |
| | | 系统消息 |
| | | <CloseOutlined onClick={this.close}/> |
| | | </div> |
| | | <div className="msg-list">{notices.map((item, index) => { |
| | | return <div className="msg-item" key={index}> |
| | | {item.remark} |
| | | </div> |
| | | })}</div> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default SysMessage |
File was renamed from src/components/header/sysmessage.scss |
| | |
| | | color: rgba(0, 0, 0, 0.85); |
| | | } |
| | | } |
| | | .msg-list { |
| | | .msg-item { |
| | | height: 80px; |
| | | background: rgba(0, 0, 0, 0.05); |
| | | margin: 10px 0px; |
| | | padding: 5px; |
| | | border-radius: 2px; |
| | | } |
| | | } |
| | | } |
| | | .mk-msg-wrap.visible { |
| | | z-index: 3000; |
| | |
| | | const TreePage = asyncComponent(() => import('@/tabviews/treepage')) |
| | | const Iframe = asyncComponent(() => import('@/tabviews/iframe')) |
| | | const RoleManage = asyncComponent(() => import('@/tabviews/rolemanage')) |
| | | const SysMessage = asyncComponent(() => import('@/tabviews/sysmessage')) |
| | | |
| | | if (sessionStorage.getItem('lang') === 'zh-CN') { |
| | | moment.locale('zh-cn') |
| | |
| | | return (<Home MenuID={view.MenuID} MenuName={view.MenuName}/>) |
| | | } else if (view.type === 'RolePermission') { |
| | | return (<RoleManage MenuID={view.MenuID}/>) |
| | | } else if (view.type === 'SysMessage') { |
| | | return (<SysMessage />) |
| | | } else if (view.type === 'CommonTable') { |
| | | return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param} changeTemp={this.changeTemp}/>) |
| | | } else if (view.type === 'TreePage') { |
| | |
| | | margin-bottom: 0!important; |
| | | } |
| | | } |
| | | .extend-card:last-child:not(:only-child) { |
| | | position: sticky; |
| | | bottom: 0; |
| | | z-index: 1; |
| | | .card-item-box { |
| | | margin-top: 0!important; |
| | | margin-bottom: 0!important; |
| | | } |
| | | } |
| | | div:last-child { |
| | | .card-item-box { |
| | | border-bottom: none!important; |
| | |
| | | margin-bottom: 0!important; |
| | | } |
| | | } |
| | | .extend-card:last-child:not(:only-child) { |
| | | position: sticky; |
| | | bottom: 0; |
| | | z-index: 1; |
| | | .card-item-box { |
| | | margin-top: 0!important; |
| | | margin-bottom: 0!important; |
| | | } |
| | | } |
| | | div:last-child { |
| | | .sub-card-wrap { |
| | | .card-item-box { |
| | |
| | | |
| | | const Tabview = asyncComponent(() => import('@/components/tabview')) |
| | | const Breadview = asyncComponent(() => import('@/components/breadview')) |
| | | const SysMessage = asyncComponent(() => import('@/components/header/sysmessage/index')) |
| | | |
| | | class Main extends Component { |
| | | state = { |
| | |
| | | if (!this.state.userId) return null |
| | | |
| | | return ( |
| | | <> |
| | | <div className="mk-main-view"> |
| | | <Header key="header"/> |
| | | {navBar === 'shutter' ? <Sidemenu key="sidemenu"/> : null} |
| | | {navBar === 'shutter' || navBar === 'menu_board_navigation' ? |
| | | <Tabview key="tabview"/> : |
| | | <Breadview key="breadview"/>} |
| | | {window.GLOB.systemType === 'production' ? <QueryLog /> : null} |
| | | <ImgScale /> |
| | | </div> |
| | | {window.GLOB.systemType === 'production' ? <QueryLog /> : null} |
| | | {window.GLOB.SysNotice ? <SysMessage /> : null} |
| | | </> |
| | | ) |
| | | } |
| | | } |