From 2bc0c7722262d1afe9c6b0f63c51b980f9c679a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cjonyshi=E2=80=9D?= Date: Wed, 5 Dec 2018 11:45:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=A1=8C=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E8=83=BD=E6=8B=96=E6=8B=BD=E9=97=AE=E9=A2=98=E3=80=81=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E8=A1=8C=E8=BF=87=E6=BB=A4=E4=BA=8B=E4=BB=B6=E4=B8=A2?= =?UTF-8?q?=E5=A4=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/FilterType.js | 2 +- src/TableHeader.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/FilterType.js b/src/FilterType.js index 344b8eb..f7f53df 100644 --- a/src/FilterType.js +++ b/src/FilterType.js @@ -281,7 +281,7 @@ class FilterType extends Component { render() { let { rendertype } = this.props; return ( - this.renderControl(rendertype) +
{this.renderControl(rendertype)}
); } } diff --git a/src/TableHeader.js b/src/TableHeader.js index 06964a1..23eb826 100644 --- a/src/TableHeader.js +++ b/src/TableHeader.js @@ -233,9 +233,11 @@ class TableHeader extends Component { //---拖拽列宽代码逻辑----start----- dragAbleMouseDown = (e) => { - Event.stopPropagation(e); + // Event.stopPropagation(e); let event = Event.getEvent(e); if (!this.props.draggable) return; + let th = this.getThDome(event.target); + if(!th)return; event.target.setAttribute('draggable',true);//添加交换列效果 this.drag.option = 'dragAble'; this.currentDome = event.target; @@ -281,7 +283,7 @@ class TableHeader extends Component { let event = Event.getEvent(e); if (!this.props.draggable) return; if(this.drag.option === 'border'){return;} - console.log(this.drag.option+' -------onDragStart----------',event.target); + // console.log(this.drag.option+' -------onDragStart----------',event.target); let th = this.getThDome(event.target); if(!th)return; let currentIndex = parseInt(th.getAttribute("data-line-index")); @@ -318,7 +320,7 @@ class TableHeader extends Component { this.currentDome.setAttribute('draggable',false);//添加交换列效果 let data = this.getCurrentEventData(e); if(!data)return; - console.log(this.drag.option+' -------onDrop----------',event.target); + // console.log(this.drag.option+' -------onDrop----------',event.target); if (!this.currentObj || this.currentObj.key == data.key) return; if(!this.props.onDrop)return; this.props.onDrop(event,{dragSource:this.currentObj,dragTarg:data}); @@ -349,6 +351,7 @@ class TableHeader extends Component { */ getThDome(element){ let _tagName = element.tagName.toLowerCase(); + if(element.getAttribute('data-filter-type') === 'filterContext')return null; if(_tagName === 'i')return null; if(_tagName != 'th'){ return this.getThDome(element.parentElement);