diff --git a/src/containers/analysis/history/AnalysisHistoryContainer.js b/src/containers/analysis/history/AnalysisHistoryContainer.js index 3f3e52c..00e94e5 100644 --- a/src/containers/analysis/history/AnalysisHistoryContainer.js +++ b/src/containers/analysis/history/AnalysisHistoryContainer.js @@ -96,7 +96,8 @@ export const AnalysisHistoryContainer = props => { const [params, setParams] = useState({ stDate: moment().subtract(1, 'day').format('YYYY-MM-DD'), endDate: moment().subtract(-1, 'day').format('YYYY-MM-DD'), - search1: '' + search1: '', + groupId: searchData.groupId }); const excelHeaders = [ @@ -213,11 +214,12 @@ export const AnalysisHistoryContainer = props => { setParams({ stDate: searchParams.stDate, endDate: searchParams.endDate, - search1: searchParams.search1 + search1: searchParams.search1, + groupId: searchData.groupId }); - } - // handlerSearch(); - }, []); + } + handlerSearch(); + }, [searchData]); const onKeyPress = e => { if (e.key == 'Enter') { @@ -228,20 +230,20 @@ export const AnalysisHistoryContainer = props => { useEffect(() => { }, [params]); const handlerSearch = () => { - + console.log("----",params); dispatch(Actions.list.request({ searchParams: params })); }; const handlerInput = (type, val) => { if (type === 'search1') { - setParams({ ...params, search1: val }); + setParams({ ...params, search1: val}); } if (type === 'searchDate') { if (val.length == 2) { setParams({ ...params, stDate: moment(val[0]).format('YYYY-MM-DD'), - endDate: moment(val[1]).format('YYYY-MM-DD') + endDate: moment(val[1]).format('YYYY-MM-DD'), }); } }