OtherHistory.jsx 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import React,{Component} from 'react';
  2. import BlockInp from '@containers/BlockInpContainer';
  3. import {connect} from "react-redux";
  4. import {setOtherHisModule} from '@store/async-actions/fetchModules';
  5. class OtherHistory extends Component{
  6. constructor(props){
  7. super(props);
  8. //this.getRecord = this.getRecord.bind(this);
  9. }
  10. /*getRecord(){
  11. //空白聚焦其他史时,获取上次记录
  12. const {setInitData,value} = this.props;
  13. if(!value){
  14. setInitData();
  15. }
  16. }*/
  17. render(){
  18. const {value,isRead}=this.props;
  19. return <BlockInp title='其他史' boxMark='3' value={value} isRead={isRead}></BlockInp>;
  20. }
  21. }
  22. function mapStateToProps(state){
  23. const {otherHistory} = state;
  24. return {
  25. value:otherHistory.saveText[0],
  26. }
  27. }
  28. function mapDispatchToProps(dispatch,store){
  29. return {
  30. setInitData(){
  31. //先获取最近记录,没有的话显示模板
  32. dispatch(setOtherHisModule());
  33. },
  34. }
  35. }
  36. const OtherHistoryCont = connect(
  37. mapStateToProps,
  38. mapDispatchToProps
  39. )(OtherHistory);
  40. export default OtherHistoryCont;