|
@@ -6,7 +6,7 @@ import SearchDrop from '@components/SearchDrop';
|
|
|
import CommonSymptom from '@components/CommonSymptom';
|
|
|
import chooseType from '@containers/eleType.js';
|
|
|
import config from "@config/index";
|
|
|
-import {isIE,getPageCoordinate,windowEventHandler} from "@utils/tools.js"
|
|
|
+import {isIE,getPageCoordinate,windowEventHandler,filterDataArr} from "@utils/tools.js"
|
|
|
import $ from 'jquery';
|
|
|
|
|
|
class MainSuit extends Component{
|
|
@@ -112,7 +112,15 @@ class MainSuit extends Component{
|
|
|
|
|
|
|
|
|
handleSearchSelect(item){
|
|
|
- const {clearSearch,insertSearch,datas,span} = this.props;
|
|
|
+ const {clearSearch,insertSearch,datas,span,saveText} = this.props;
|
|
|
+ let mainText = filterDataArr(saveText);//主诉字数
|
|
|
+ const itemL = item.name.length;
|
|
|
+ let lengths = mainText.length + itemL;
|
|
|
+ if(lengths>config.limited){
|
|
|
+ Notify.info(config.limitText);
|
|
|
+ clearSearch && clearSearch();
|
|
|
+ return
|
|
|
+ }
|
|
|
clearTimeout(this.state.timer);
|
|
|
if(datas.length==0){//没有使用模板时点击搜索结构要展开模板
|
|
|
insertSearch &&insertSearch({item,span});
|
|
@@ -210,7 +218,7 @@ class MainSuit extends Component{
|
|
|
}
|
|
|
|
|
|
handleBlur(e){//隐藏常见症状下拉、存自由输入的值
|
|
|
- const {freeText,saveText,datas} = this.props;
|
|
|
+ const {freeText,saveText,datas,clearSearch} = this.props;
|
|
|
const that = this;
|
|
|
let data = this.state.inpText;
|
|
|
if(!isIE()){
|
|
@@ -224,9 +232,10 @@ class MainSuit extends Component{
|
|
|
freeText && freeText(data);
|
|
|
}
|
|
|
}
|
|
|
- // 延时关闭常见症状下拉,不延时会影响选中
|
|
|
+ // 延时关闭常见症状下拉、清空搜索结果,不延时会影响选中
|
|
|
clearTimeout(this.state.clearTimer);
|
|
|
const clearTimer = setTimeout(function(){
|
|
|
+ clearSearch && clearSearch();
|
|
|
that.setState({
|
|
|
symptom:false
|
|
|
})
|