|
@@ -399,6 +399,7 @@ class ListItems extends Component{
|
|
|
let isSpecialPos = false; //是否特殊位置(单行在上面,如无殊)
|
|
|
let isExclu = false; //是否与其他互斥
|
|
|
let isRadio; //是否为单选列,默认多选列
|
|
|
+ let isSingle = data.length == 1?true:false; //是否为单列,无伴的情况
|
|
|
const list = data&&data.map((it,i)=>{
|
|
|
isSpecialPos = (+it.formPosition === 1);
|
|
|
isExclu = (+it.exclusionType===1);
|
|
@@ -410,6 +411,7 @@ class ListItems extends Component{
|
|
|
}
|
|
|
return <ListItem datas={detail}
|
|
|
isRadio={isRadio}
|
|
|
+ isSingle={isSingle}
|
|
|
joint={it.joint}
|
|
|
listIndex={i}
|
|
|
isSpecialPos={isSpecialPos}
|
|
@@ -422,7 +424,7 @@ class ListItems extends Component{
|
|
|
clickConfirm(){
|
|
|
const {handleConfirm} = this.props;
|
|
|
this.child&&this.child.reset();//重置搜索框中的数据
|
|
|
- handleConfirm();
|
|
|
+ handleConfirm();
|
|
|
}
|
|
|
getStyle(){
|
|
|
const {show,left} = this.props;
|
|
@@ -440,7 +442,7 @@ class ListItems extends Component{
|
|
|
<span className={style['clear']} onClick={handleClear}>清空选项</span>
|
|
|
<span className={style['confirm']} onClick={this.clickConfirm}>确定</span>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
{boxMark==1 && tagType==11 && <div className="search">
|
|
|
<div className={style["line"]}></div>
|
|
|
<SearchBox show={show} cliIndex={cliIndex} onSelect={handleConfirm} onRef={(child)=>{this.child = child;}}/>
|
|
@@ -543,8 +545,8 @@ class ListItem extends Component{
|
|
|
getMainData(){//主诉添加症状-带搜索框
|
|
|
const {datas,isSpecialPos} = this.props;
|
|
|
return datas&&datas.map((it,i)=>{
|
|
|
- return <li onClick={(e)=>this.handleClick(e,it,i)}
|
|
|
- className={this.getClass(it.id)}
|
|
|
+ return <li onClick={(e)=>this.handleClick(e,it,i)}
|
|
|
+ className={this.getClass(it.id)}
|
|
|
title={it.name.length>4?it.name:''}
|
|
|
style={{'width':'55px','display':'inline-block'}}>
|
|
|
{it.name&&it.name.length>4?it.name.slice(0,4)+'...':it.name}
|
|
@@ -553,10 +555,11 @@ class ListItem extends Component{
|
|
|
}
|
|
|
|
|
|
render(){
|
|
|
- const {datas,isSpecialPos,boxMark,tagType,listIndex} = this.props;
|
|
|
+ const {datas,isSpecialPos,boxMark,tagType,listIndex,isSingle} = this.props;
|
|
|
const pos = isSpecialPos?style['independent']:'';
|
|
|
const ifMainSear = boxMark==1 && tagType==11?true:false;
|
|
|
- const main = ifMainSear&&listIndex==1?style['mainUl']:'';//伴字ul不设置宽度
|
|
|
+ // 单列直接设置宽度,多列则第二列设置(伴字ul不设置宽度)
|
|
|
+ const main = ifMainSear&&!isSingle&&listIndex==1?style['mainUl']:(ifMainSear&&isSingle?style['mainUl']:'');
|
|
|
return <ul className={classNames(style['row'],pos,main)} onBlur={(e)=>e.stopPropagation()}>
|
|
|
{ifMainSear?this.getMainData():this.getData()}
|
|
|
</ul>
|