|
@@ -1,15 +1,21 @@
|
|
|
import React from 'react';
|
|
|
import { connect } from 'react-redux';
|
|
|
-import { SHOW_SEARCH, HIDE_SEARCH, GET_SEARCH_RESULT } from '@store/types/diagnosticSearch';
|
|
|
+import {
|
|
|
+ SHOW_SEARCH,
|
|
|
+ HIDE_SEARCH,
|
|
|
+ GET_SEARCH_RESULT,
|
|
|
+ SHOWNODATATEXT,
|
|
|
+} from '@store/types/diagnosticSearch';
|
|
|
import { getSearchResult, getSearchList } from '@store/async-actions/diagnosticSearch';
|
|
|
import DiagResultSearch from '@components/DiagResultSearch';
|
|
|
|
|
|
function mapStateToProps(state) {
|
|
|
- return{
|
|
|
- show: state.diagnosticSearch.show,
|
|
|
- searchValue: state.diagnosticSearch.searchValue,
|
|
|
- searchResult: state.diagnosticSearch.searchResult,
|
|
|
- }
|
|
|
+ return {
|
|
|
+ show: state.diagnosticSearch.show,
|
|
|
+ searchValue: state.diagnosticSearch.searchValue,
|
|
|
+ searchResult: state.diagnosticSearch.searchResult,
|
|
|
+ isShowNoDataInfo: state.diagnosticSearch.isShowNoDataInfo,
|
|
|
+ };
|
|
|
}
|
|
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
@@ -30,7 +36,13 @@ function mapDispatchToProps(dispatch) {
|
|
|
searchResult: []
|
|
|
})
|
|
|
},
|
|
|
- handleChangeValue: (val)=>{
|
|
|
+ handleChangeValue: (val, isClear)=>{
|
|
|
+ if(isClear === 'clear') {
|
|
|
+ dispatch({
|
|
|
+ type: SHOWNODATATEXT,
|
|
|
+ isShowNoDataInfo: false
|
|
|
+ });
|
|
|
+ }
|
|
|
dispatch(getSearchList(val))
|
|
|
}
|
|
|
}
|