|
@@ -2,7 +2,7 @@ import React,{Component} from 'react';
|
|
|
import classNames from 'classnames';
|
|
|
import config from '@config/index.js';
|
|
|
import style from './index.less';
|
|
|
-import {deepClone,filterArr,handleEnter,isIE,getPageCoordinate,windowEventHandler} from '@utils/tools.js';
|
|
|
+import {deepClone,filterArr,handleEnter,isIE,getPageCoordinate,windowEventHandler,filterDataArr} from '@utils/tools.js';
|
|
|
import {Notify} from '@commonComp';
|
|
|
import ReactDom from "react-dom";
|
|
|
import {getIds} from '@common/js/func.js';
|
|
@@ -112,7 +112,7 @@ class SpreadDrop extends Component{
|
|
|
onChange(e){
|
|
|
const {mainSaveText,ikey,type,handleLabelChange} = this.props;
|
|
|
const {labelVal,editable} = this.state;
|
|
|
- let mainText = filterArr(mainSaveText);//主诉字数
|
|
|
+ let mainText = filterDataArr(mainSaveText);//主诉字数
|
|
|
if(editable){//避免IE中点击标签也会触发
|
|
|
let val = e.target.innerText;
|
|
|
if(+type==1){// 主诉字数达到上限时不允许输入
|
|
@@ -310,7 +310,7 @@ class SpreadDrop extends Component{
|
|
|
}
|
|
|
return style['tag'];
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
componentDidMount(){
|
|
|
if(isIE()){
|
|
|
$(this.$div.current).onIe8Input(function(e){
|
|
@@ -336,7 +336,7 @@ class SpreadDrop extends Component{
|
|
|
onInput={this.onChange}
|
|
|
onkeydown={handleEnter}
|
|
|
>{value||placeholder}</div>
|
|
|
- <ListItems data={data} left={boxLeft}
|
|
|
+ <ListItems data={data} left={boxLeft}
|
|
|
top={boxTop} show={show} handleSelect={this.handleSelect} handleConfirm={this.handleConfirm} handleClear={this.handleClear} {...this.state}></ListItems>
|
|
|
</div>
|
|
|
}
|
|
@@ -380,7 +380,7 @@ class ListItems extends Component{
|
|
|
display:show?'block':'none'
|
|
|
}
|
|
|
}
|
|
|
- render (){
|
|
|
+ render (){
|
|
|
const {handleClear,handleConfirm} = this.props;
|
|
|
const domNode = document.getElementById('root');
|
|
|
return ReactDom.createPortal(
|
|
@@ -394,6 +394,7 @@ class ListItems extends Component{
|
|
|
,domNode)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
class ListItem extends Component{
|
|
|
constructor(props){
|
|
|
super(props);
|
|
@@ -402,7 +403,6 @@ class ListItem extends Component{
|
|
|
e.stopPropagation();
|
|
|
// window.event? window.event.cancelBubble = true : e.stopPropagation();
|
|
|
const {handleClick,isExclu,isRadio,data,exists,noneIds,withs,joint,listIndex} = this.props;
|
|
|
-
|
|
|
const index=listIndex+''+i;
|
|
|
//列单选处理
|
|
|
if(isRadio){
|
|
@@ -444,14 +444,16 @@ class ListItem extends Component{
|
|
|
}
|
|
|
}
|
|
|
render(){
|
|
|
- const {datas,isSpecialPos} = this.props;
|
|
|
+ const {data,isSpecialPos} = this.props;
|
|
|
const pos = isSpecialPos?style['independent']:'';
|
|
|
return <ul className={classNames(style['row'],pos)} onBlur={(e)=>e.stopPropagation()}>
|
|
|
- {datas&&datas.map((it,i)=>{
|
|
|
- return <li onClick={(e)=>this.handleClick(e,it,i)}
|
|
|
- className={this.getClass(it.id)}>{it.labelPrefix}{it.name}{it.labelSuffix}</li>
|
|
|
+ {data&&data.map((it,i)=>{
|
|
|
+ /*return <li onClick={(e)=>this.handleClick(e,it,i)}
|
|
|
+ className={this.getClass(it.id)}>{it.labelPrefix}{it.name}{it.labelSuffix}</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>
|
|
|
})}
|
|
|
</ul>;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
export default SpreadDrop;
|