import React, { Component } from "react"; import { connect } from "react-redux"; import style from "./index.less"; import logo from "../../common/images/logoa.png"; import setup from "../../common/images/setup.png"; import close from '../../common/images/icon_close.png'; import ok from '../../common/images/confirm.png' import emergIcon from '../../common/images/emergency.png' import {Notify} from '@commonComp'; // import Emergency from '@components/Emergency'; import Emergency from '@containers/Emergency'; import {getAllHis} from '@store/async-actions/fetchModules.js'; import {timestampToTime} from '@utils/tools.js'; class Banner extends Component { constructor(props){ super(props) this.state = { mode: props.typeConfig, zIndex:204, emergency:true, emergencyBox:false }; this.showConfigModal = this.showConfigModal.bind(this); this.closeConfigModal = this.closeConfigModal.bind(this); this.changeType = this.changeType.bind(this); this.confirmType = this.confirmType.bind(this); this.showHisModal = this.showHisModal.bind(this); this.handleHisClose = this.handleHisClose.bind(this); } showConfigModal(){ this.setState({ mode:this.props.typeConfig, zIndex:206 }); this.props.showConfigModal() } closeConfigModal(){ this.props.closeConfigModal(); this.setState({ zIndex:204 }) } changeType(typeConfig){ this.setState({ mode:typeConfig }); } confirmType(){ const {typeConfig,confirmType} = this.props; const mode = this.state.mode; if(mode==typeConfig){ this.closeConfigModal() return; } confirmType&&confirmType(mode); this.closeConfigModal() this.setState({ zIndex:204 }) } /*componentDidUpdate(){ const {failed} = this.props; if(failed){ //弹窗提醒 Notify.error("模式切换失败,请稍后再试"); } }*/ showHisModal(){ const {getAllRecord} = this.props; const item = { current:1 } getAllRecord&&getAllRecord(item); this.setState({ emergencyBox:true, zIndex:206 }) } handleHisClose(){ this.setState({ emergencyBox:false, zIndex:204 }) } render() { const {visible,disVisible,copyVisible} = this.props; const {mode,zIndex,emergency,emergencyBox} = this.state; const {showConfigModal, closeConfigModal, changeType, confirmType} = this; return (
模式切换(模式说明:切换模式会清空当前所有的数据)