|
@@ -6,12 +6,12 @@ import BodyContainer from "@components/BodyContainer";
|
|
|
import {ConfirmModal} from '@commonComp';
|
|
|
import store from '@store';
|
|
|
|
|
|
-import {HIDEDROP,SETMINSCREEN,SETSYSTEMCONFIG,SETPRE,SETREADDITEMS} from '@store/types/homePage.js';
|
|
|
+import {HIDEDROP,SETMINSCREEN,SETSYSTEMCONFIG,SETPRE,SETREADDITEMS,RESET_SELECT_TAG} from '@store/types/homePage.js';
|
|
|
import {billing} from '@store/async-actions/pushMessage';
|
|
|
-import {CLEAR_SEARCH} from '@types/mainSuit';
|
|
|
-import {CURRENT_CLEAR} from '@types/currentIll';
|
|
|
-import {OTHERHIS_CLEAR} from '@types/otherHistory';
|
|
|
-import {CHECKBODY_CLEAR} from '@types/checkBody';
|
|
|
+import {CLEAR_SEARCH,DELETE_MAIN_SELECTED_TAGS} from '@types/mainSuit';
|
|
|
+import {CURRENT_CLEAR,DELETE_CURRENT_SELECTED_TAGS} from '@types/currentIll';
|
|
|
+import {OTHERHIS_CLEAR,DELETE_OTHER_SELECTED_TAGS} from '@types/otherHistory';
|
|
|
+import {CHECKBODY_CLEAR,DELETE_CHECK_SELECTED_TAGS} from '@types/checkBody';
|
|
|
import style from './index.less';
|
|
|
import {getInitModules,getChronic,getSystemConfig} from '@store/async-actions/homePage.js';
|
|
|
import {getPreMsg} from '@store/async-actions/patInfo.js';
|
|
@@ -19,6 +19,7 @@ import {tellPred} from '@store/async-actions/preIcss.js';
|
|
|
import { getUrlArgObject,parseNameVal,pushAllDataList } from "@utils/tools";
|
|
|
import $ from 'jquery';
|
|
|
import loading from '@common/images/loading.gif';
|
|
|
+
|
|
|
class HomePage extends Component {
|
|
|
constructor() {
|
|
|
super();
|
|
@@ -56,13 +57,14 @@ class HomePage extends Component {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- hidePops(e){
|
|
|
- const {hideAllDrop,handleClear } = this.props;
|
|
|
- if(!this.isBar){ //onMousrdown的目标为滚动条时,标签填写单不关闭
|
|
|
- hideAllDrop(); //隐藏填写单
|
|
|
- handleClear&&handleClear(); //清空搜索结果
|
|
|
- }
|
|
|
-
|
|
|
+ hidePops(){
|
|
|
+ const {hideAllDrop,handleClear,resetSelect } = this.props;
|
|
|
+ //重置选中范围
|
|
|
+ resetSelect();
|
|
|
+ if(!this.isBar){ //onMousrdown的目标为滚动条时,标签填写单不关闭
|
|
|
+ hideAllDrop(); //隐藏填写单
|
|
|
+ handleClear&&handleClear(); //清空搜索结果
|
|
|
+ }
|
|
|
}
|
|
|
setElem(e){
|
|
|
//onMousedown的目标为滚动条时,标签填写单不关闭
|
|
@@ -71,11 +73,18 @@ class HomePage extends Component {
|
|
|
}else{
|
|
|
this.isBar = false;
|
|
|
}
|
|
|
+ }
|
|
|
+ handleKeyUp(e){
|
|
|
+ const {deleteLabels} = this.props;
|
|
|
+ //删除选中标签
|
|
|
+ if(e.keyCode==8||e.keyCode==46){ //backspace或del都可删除
|
|
|
+ deleteLabels();
|
|
|
+ }
|
|
|
}
|
|
|
render() {
|
|
|
const {flag,showPre,noReferRecord,referRecord} = this.props;
|
|
|
return <div className={style['home-page']}
|
|
|
- onClick={this.hidePops} onmousedown={this.setElem.bind(this)}>
|
|
|
+ onClick={this.hidePops} onmousedown={this.setElem.bind(this)} onkeyup={this.handleKeyUp.bind(this)}>
|
|
|
<BannerContainer />
|
|
|
{/* <InfoTitle /> */}
|
|
|
<BodyContainer></BodyContainer>
|
|
@@ -95,6 +104,12 @@ const mapStateToProps = function (state) {
|
|
|
showPre:state.homePage.showPre
|
|
|
}
|
|
|
};
|
|
|
+const boxMap = {
|
|
|
+ '1':DELETE_MAIN_SELECTED_TAGS,
|
|
|
+ '2':DELETE_CURRENT_SELECTED_TAGS,
|
|
|
+ '3':DELETE_OTHER_SELECTED_TAGS,
|
|
|
+ '4':DELETE_CHECK_SELECTED_TAGS
|
|
|
+};
|
|
|
const mapDispatchToProps = function (dispatch) {
|
|
|
return {
|
|
|
clearAddItems(){
|
|
@@ -103,7 +118,9 @@ const mapDispatchToProps = function (dispatch) {
|
|
|
})
|
|
|
},
|
|
|
referRecord(){
|
|
|
- pushAllDataList(1,'push',store.getState().homePage.preData,'preIcss');
|
|
|
+ const state = store.getState();
|
|
|
+ const {homePage} = state;
|
|
|
+ pushAllDataList(1,'push',homePage.preData,'preIcss');
|
|
|
dispatch(billing())
|
|
|
dispatch({type:SETPRE,show:false});
|
|
|
tellPred()
|
|
@@ -145,7 +162,33 @@ const mapDispatchToProps = function (dispatch) {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
+ deleteLabels(){ //选中删除标签
|
|
|
+ const state = store.getState();
|
|
|
+ const {homePage} = state;
|
|
|
+ const start = homePage.select_start;
|
|
|
+ const end = homePage.select_end;
|
|
|
+ const boxMark = homePage.select_boxMark;
|
|
|
+ if(!boxMark)return;
|
|
|
+ dispatch({
|
|
|
+ type:boxMap[boxMark],
|
|
|
+ start,
|
|
|
+ end,
|
|
|
+ boxMark
|
|
|
+ });
|
|
|
+ //删除后清楚选中标记
|
|
|
+ //setTimeout(()=>{
|
|
|
+ dispatch({
|
|
|
+ type:RESET_SELECT_TAG
|
|
|
+ });
|
|
|
+ //})
|
|
|
+
|
|
|
+ },
|
|
|
+ resetSelect(){
|
|
|
+ dispatch({
|
|
|
+ type:RESET_SELECT_TAG
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
|