1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- import React,{Component} from 'react';
- import BlockInp from '@containers/BlockInpContainer';
- import {connect} from "react-redux";
- import {setOtherHisModule} from '@store/async-actions/fetchModules';
- class OtherHistory extends Component{
- constructor(props){
- super(props);
- //this.getRecord = this.getRecord.bind(this);
- }
- /*getRecord(){
- //空白聚焦其他史时,获取上次记录
- const {setInitData,value} = this.props;
- if(!value){
- setInitData();
- }
- }*/
- render(){
- const {value,isRead}=this.props;
- return <BlockInp title='其他史' boxMark='3' value={value} isRead={isRead}></BlockInp>;
- }
- }
- function mapStateToProps(state){
- const {otherHistory} = state;
- return {
- value:otherHistory.saveText[0],
- }
- }
- function mapDispatchToProps(dispatch,store){
- return {
- setInitData(){
- //先获取最近记录,没有的话显示模板
- dispatch(setOtherHisModule());
- },
- }
- }
- const OtherHistoryCont = connect(
- mapStateToProps,
- mapDispatchToProps
- )(OtherHistory);
- export default OtherHistoryCont;
|