123456789101112131415161718192021222324252627282930313233343536 |
- import {connect} from 'react-redux';
- import ScaleTable from '@components/ScaleTable';
- import {getFormulaResult} from '@store/async-actions/fetchModules.js';
- import {SET_SCALE_INFO,SAVE_TABLE_RESULT} from '@store/types/pushMessage';
- function mapStateToProps (state){//console.log(state);
- return {
- scaleInfo: state.pushMessage.scaleInfo,//量表内容
- formulaResult:state.pushMessage.formulaResult //计算结果
- }
- }
- function mapDispatchToProps (dispatch){
- return {
- getResult(obj){//计算结果
- const {params,allDatas,result} = obj;
- dispatch(getFormulaResult(params));
- dispatch({
- type:SET_SCALE_INFO,
- data:allDatas,
- id:params.id //量表id
- })
- // 前端计算的值
- /*if(result&&result.text){
- dispatch({
- type:SAVE_TABLE_RESULT,
- id:params.scaleId,
- data:result
- })
- }*/
- }
- }
- }
- const ScaleTableContainer = connect(mapStateToProps,mapDispatchToProps)(ScaleTable);
- export default ScaleTableContainer;
|