|
@@ -5,6 +5,7 @@ import style from './index.less';
|
|
import {setPosition,deepClone,filterArr,handleEnter,isIE,windowEventHandler,filterDataArr,getIds,getPageCoordinate} from '@utils/tools.js';
|
|
import {setPosition,deepClone,filterArr,handleEnter,isIE,windowEventHandler,filterDataArr,getIds,getPageCoordinate} from '@utils/tools.js';
|
|
import {Notify} from '@commonComp';
|
|
import {Notify} from '@commonComp';
|
|
import ScrollArea from 'react-scrollbar';
|
|
import ScrollArea from 'react-scrollbar';
|
|
|
|
+import SearchBox from '@containers/SearchBox'
|
|
import $ from 'jquery';
|
|
import $ from 'jquery';
|
|
/****
|
|
/****
|
|
* 标签组合下拉,选中的项目展开
|
|
* 标签组合下拉,选中的项目展开
|
|
@@ -359,8 +360,9 @@ class SpreadDrop extends Component{
|
|
}
|
|
}
|
|
}*/
|
|
}*/
|
|
render(){
|
|
render(){
|
|
- const {placeholder,value,show,data,order} = this.props;
|
|
|
|
|
|
+ const {placeholder,value,show,data,order,type,tagType,ikey} = this.props;
|
|
const {tmpDom,left} = this.state
|
|
const {tmpDom,left} = this.state
|
|
|
|
+ const clickIndx = ikey.split('-')[1];//展开下拉的index
|
|
if(!show&&tmpDom){
|
|
if(!show&&tmpDom){
|
|
$(tmpDom).parent().prev().attr({"contentEditable":true})
|
|
$(tmpDom).parent().prev().attr({"contentEditable":true})
|
|
}
|
|
}
|
|
@@ -379,8 +381,8 @@ class SpreadDrop extends Component{
|
|
onInput={this.onChange}
|
|
onInput={this.onChange}
|
|
onkeydown={handleEnter}
|
|
onkeydown={handleEnter}
|
|
>{value||placeholder}</div>
|
|
>{value||placeholder}</div>
|
|
- <ListItems parDiv={this.$list} data={data} order={order} left={left}
|
|
|
|
- show={show} handleSelect={this.handleSelect} handleConfirm={this.handleConfirm} handleClear={this.handleClear} {...this.state}></ListItems>
|
|
|
|
|
|
+ <ListItems parDiv={this.$list} data={data} order={order} left={left} boxMark={type} tagType={tagType}
|
|
|
|
+ show={show} cliIndex={clickIndx} handleSelect={this.handleSelect} handleConfirm={this.handleConfirm} handleClear={this.handleClear} {...this.state}></ListItems>
|
|
</div>
|
|
</div>
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -424,7 +426,7 @@ class ListItems extends Component{
|
|
}
|
|
}
|
|
}
|
|
}
|
|
render (){
|
|
render (){
|
|
- const {handleClear,handleConfirm,order,parDiv} = this.props;
|
|
|
|
|
|
+ const {handleClear,handleConfirm,order,parDiv,boxMark,tagType,show,cliIndex} = this.props;
|
|
return <div className={style["drop-list"]} ref={parDiv} style={this.getStyle()} contentEditable="false" onClick={(e)=>{e.stopPropagation();}}>
|
|
return <div className={style["drop-list"]} ref={parDiv} style={this.getStyle()} contentEditable="false" onClick={(e)=>{e.stopPropagation();}}>
|
|
<p className={style['orderTips']}>按{order?'从左到右从上到下':'点击'}顺序成文</p>
|
|
<p className={style['orderTips']}>按{order?'从左到右从上到下':'点击'}顺序成文</p>
|
|
{this.getLabels()}
|
|
{this.getLabels()}
|
|
@@ -432,6 +434,11 @@ class ListItems extends Component{
|
|
<span className={style['clear']} onClick={handleClear}>清空选项</span>
|
|
<span className={style['clear']} onClick={handleClear}>清空选项</span>
|
|
<span className={style['confirm']} onClick={handleConfirm}>确定</span>
|
|
<span className={style['confirm']} onClick={handleConfirm}>确定</span>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ {boxMark==1 && tagType==11 && <div className="search">
|
|
|
|
+ <div className={style["line"]}></div>
|
|
|
|
+ <SearchBox show={show} cliIndex={cliIndex}/>
|
|
|
|
+ </div>}
|
|
</div>
|
|
</div>
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -526,11 +533,29 @@ class ListItem extends Component{
|
|
return <li onClick={(e)=>this.handleClick(e,it,i)} className={this.getClass(it.id)} title={it.name.length>8?it.name:''}>{it.name&&it.name.length>8?it.name.slice(0,8)+'...':it.name}</li>
|
|
return <li onClick={(e)=>this.handleClick(e,it,i)} className={this.getClass(it.id)} title={it.name.length>8?it.name:''}>{it.name&&it.name.length>8?it.name.slice(0,8)+'...':it.name}</li>
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- render(){
|
|
|
|
|
|
+
|
|
|
|
+ getMainData(){//主诉添加症状-带搜索框
|
|
const {datas,isSpecialPos} = this.props;
|
|
const {datas,isSpecialPos} = this.props;
|
|
|
|
+ return datas&&datas.map((it,i)=>{
|
|
|
|
+ /*if(isSpecialPos){
|
|
|
|
+ return <li onClick={(e)=>this.handleClick(e,it,i)} className={this.getClass(it.id)}>{it.name}</li>
|
|
|
|
+ }*/
|
|
|
|
+ return <li onClick={(e)=>this.handleClick(e,it,i)}
|
|
|
|
+ className={this.getClass(it.id)}
|
|
|
|
+ title={it.name.length>8?it.name:''}
|
|
|
|
+ style={{'width':'85px','display':'inline-block'}}>
|
|
|
|
+ {it.name&&it.name.length>8?it.name.slice(0,8)+'...':it.name}
|
|
|
|
+ </li>
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ render(){
|
|
|
|
+ const {datas,isSpecialPos,boxMark,tagType,listIndex} = this.props;
|
|
const pos = isSpecialPos?style['independent']:'';
|
|
const pos = isSpecialPos?style['independent']:'';
|
|
- return <ul className={classNames(style['row'],pos)} onBlur={(e)=>e.stopPropagation()}>
|
|
|
|
- {this.getData()}
|
|
|
|
|
|
+ const ifMainSear = boxMark==1 && tagType==11?true:false;
|
|
|
|
+ const main = ifMainSear&&listIndex==1?style['mainUl']:'';//伴字ul不设置宽度
|
|
|
|
+ return <ul className={classNames(style['row'],pos,main)} onBlur={(e)=>e.stopPropagation()}>
|
|
|
|
+ {ifMainSear?this.getMainData():this.getData()}
|
|
</ul>
|
|
</ul>
|
|
}
|
|
}
|
|
}
|
|
}
|