2017-06-03 20:34:07 +08:00
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
import PropTypes from 'prop-types';
|
2019-07-26 09:47:18 +08:00
|
|
|
|
import { Event,EventUtil} from "./lib/utils";
|
2016-12-26 16:52:39 +08:00
|
|
|
|
import TableCell from './TableCell';
|
|
|
|
|
import ExpandIcon from './ExpandIcon';
|
|
|
|
|
|
2017-01-11 17:01:50 +08:00
|
|
|
|
const propTypes = {
|
2016-12-26 16:52:39 +08:00
|
|
|
|
onDestroy: PropTypes.func,
|
|
|
|
|
onRowClick: PropTypes.func,
|
|
|
|
|
onRowDoubleClick: PropTypes.func,
|
|
|
|
|
record: PropTypes.object,
|
2017-01-11 17:01:50 +08:00
|
|
|
|
clsPrefix: PropTypes.string,
|
2016-12-26 16:52:39 +08:00
|
|
|
|
expandIconColumnIndex: PropTypes.number,
|
|
|
|
|
onHover: PropTypes.func,
|
|
|
|
|
columns: PropTypes.array,
|
|
|
|
|
height: PropTypes.oneOfType([
|
|
|
|
|
PropTypes.string,
|
|
|
|
|
PropTypes.number,
|
|
|
|
|
]),
|
|
|
|
|
visible: PropTypes.bool,
|
|
|
|
|
index: PropTypes.number,
|
|
|
|
|
hoverKey: PropTypes.any,
|
|
|
|
|
expanded: PropTypes.bool,
|
|
|
|
|
expandable: PropTypes.any,
|
|
|
|
|
onExpand: PropTypes.func,
|
|
|
|
|
needIndentSpaced: PropTypes.bool,
|
|
|
|
|
className: PropTypes.string,
|
|
|
|
|
indent: PropTypes.number,
|
|
|
|
|
indentSize: PropTypes.number,
|
|
|
|
|
expandIconAsCell: PropTypes.bool,
|
|
|
|
|
expandRowByClick: PropTypes.bool,
|
|
|
|
|
store: PropTypes.object.isRequired,
|
2019-04-25 13:53:39 +08:00
|
|
|
|
rowDraggAble: PropTypes.bool,
|
|
|
|
|
onDragRow: PropTypes.func,
|
2019-07-16 11:30:02 +08:00
|
|
|
|
onDragRowStart: PropTypes.func,
|
2020-07-23 09:38:08 +08:00
|
|
|
|
syncRowHeight:PropTypes.bool
|
2017-01-11 17:01:50 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const defaultProps = {
|
|
|
|
|
onRowClick() {},
|
2019-12-13 17:22:14 +08:00
|
|
|
|
// onRowDoubleClick() {},
|
2017-01-11 17:01:50 +08:00
|
|
|
|
onDestroy() {},
|
|
|
|
|
expandIconColumnIndex: 0,
|
|
|
|
|
expandRowByClick: false,
|
|
|
|
|
onHover() {},
|
2019-01-03 16:21:24 +08:00
|
|
|
|
className:'',
|
2019-04-25 13:53:39 +08:00
|
|
|
|
setRowParentIndex:()=>{},
|
|
|
|
|
rowDraggAble:false,
|
|
|
|
|
// onDragRow:()=>{}
|
2020-07-23 09:38:08 +08:00
|
|
|
|
syncRowHeight:false
|
2017-01-11 17:01:50 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class TableRow extends Component{
|
|
|
|
|
constructor(props){
|
|
|
|
|
super(props);
|
2018-05-02 15:35:06 +08:00
|
|
|
|
this._timeout = null;
|
2017-01-11 17:01:50 +08:00
|
|
|
|
this.state = {
|
|
|
|
|
hovered: false,
|
|
|
|
|
};
|
|
|
|
|
this.onRowClick = this.onRowClick.bind(this);
|
|
|
|
|
this.onRowDoubleClick = this.onRowDoubleClick.bind(this);
|
|
|
|
|
this.onMouseEnter = this.onMouseEnter.bind(this);
|
|
|
|
|
this.onMouseLeave = this.onMouseLeave.bind(this);
|
2018-12-18 13:59:48 +08:00
|
|
|
|
this.expandHeight = 0;
|
2019-04-25 13:53:39 +08:00
|
|
|
|
this.event = false;
|
2019-06-19 13:21:15 +08:00
|
|
|
|
this.cacheCurrentIndex = null;
|
2019-08-07 10:32:05 +08:00
|
|
|
|
this.canBeTouch = true //受否允许拖动该行
|
2017-01-11 17:01:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-12-26 16:52:39 +08:00
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
2019-04-25 13:53:39 +08:00
|
|
|
|
const { store, hoverKey,treeType,rowDraggAble } = this.props;
|
2016-12-26 16:52:39 +08:00
|
|
|
|
this.unsubscribe = store.subscribe(() => {
|
|
|
|
|
if (store.getState().currentHoverKey === hoverKey) {
|
|
|
|
|
this.setState({ hovered: true });
|
|
|
|
|
} else if (this.state.hovered === true) {
|
|
|
|
|
this.setState({ hovered: false });
|
|
|
|
|
}
|
|
|
|
|
});
|
2018-12-18 13:59:48 +08:00
|
|
|
|
|
|
|
|
|
this.setRowHeight()
|
2019-01-03 16:21:24 +08:00
|
|
|
|
if(treeType){
|
|
|
|
|
this.setRowParentIndex();
|
|
|
|
|
}
|
2019-04-25 13:53:39 +08:00
|
|
|
|
}
|
2019-08-05 17:23:38 +08:00
|
|
|
|
|
2019-04-25 13:53:39 +08:00
|
|
|
|
/**
|
|
|
|
|
* 事件初始化
|
|
|
|
|
*/
|
|
|
|
|
initEvent=()=>{
|
|
|
|
|
let events = [
|
2019-06-19 13:21:15 +08:00
|
|
|
|
{key:'touchstart', fun:this.onTouchStart},//手指触摸到一个 DOM 元素时触发
|
|
|
|
|
{key:'touchmove', fun:this.onTouchMove}, //手指在一个 DOM 元素上滑动时触发
|
|
|
|
|
{key:'touchend', fun:this.onTouchEnd}, //手指从一个 DOM 元素上移开时触发
|
|
|
|
|
|
2019-04-25 13:53:39 +08:00
|
|
|
|
{key:'dragstart',fun:this.onDragStart},//用户开始拖动元素时触发
|
|
|
|
|
{key:'dragover', fun:this.onDragOver},//当某被拖动的对象在另一对象容器范围内拖动时触发此事件
|
2019-08-05 17:23:38 +08:00
|
|
|
|
{key:'drop', fun:this.onDrop}, //在一个拖动过程中,释放鼠标键时触发此事件
|
2019-04-25 13:53:39 +08:00
|
|
|
|
{key:'dragenter', fun:this.onDragEnter},
|
|
|
|
|
{key:'dragleave', fun:this.onDragLeave},
|
|
|
|
|
];
|
|
|
|
|
this.eventListen(events,'',this.element);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 事件移除,提供性能以及内存泄漏等问题。
|
|
|
|
|
*/
|
|
|
|
|
removeDragAbleEvent=()=>{
|
|
|
|
|
let events = [
|
2019-06-19 13:21:15 +08:00
|
|
|
|
{key:'touchstart', fun:this.onTouchStart},//手指触摸到一个 DOM 元素时触发
|
|
|
|
|
{key:'touchmove', fun:this.onTouchMove}, //手指在一个 DOM 元素上滑动时触发
|
|
|
|
|
{key:'touchend', fun:this.onTouchEnd}, //手指从一个 DOM 元素上移开时触发
|
2019-04-25 13:53:39 +08:00
|
|
|
|
|
2019-06-19 13:21:15 +08:00
|
|
|
|
{key:'dragstart',fun:this.onDragStart},//用户开始拖动元素时触发
|
|
|
|
|
{key:'dragover', fun:this.onDragOver},//当某被拖动的对象在另一对象容器范围内拖动时触发此事件
|
2019-08-05 17:23:38 +08:00
|
|
|
|
{key:'drop', fun:this.onDrop}, //在一个拖动过程中,释放鼠标键时触发此事件
|
2019-04-25 13:53:39 +08:00
|
|
|
|
{key:'dragenter', fun:this.onDragEnter},
|
|
|
|
|
{key:'dragleave', fun:this.onDragLeave},
|
|
|
|
|
];
|
|
|
|
|
this.eventListen(events,'remove',this.element);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 事件绑定和移除函数
|
|
|
|
|
*/
|
|
|
|
|
eventListen(events,type,eventSource){
|
|
|
|
|
for (let i = 0; i < events.length; i++) {
|
|
|
|
|
const _event = events[i];
|
|
|
|
|
if(type === "remove"){
|
|
|
|
|
EventUtil.removeHandler(eventSource,_event.key,_event.fun);
|
|
|
|
|
}else{
|
|
|
|
|
EventUtil.addHandler(eventSource,_event.key,_event.fun);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 开始调整交换列的事件
|
|
|
|
|
*/
|
|
|
|
|
onDragStart = (e) => {
|
2019-07-16 11:30:02 +08:00
|
|
|
|
let {onDragRowStart} = this.props;
|
2020-09-11 14:48:13 +08:00
|
|
|
|
if (!this.props.rowDraggAble || this.notRowDrag) return;
|
2019-04-25 13:53:39 +08:00
|
|
|
|
let event = Event.getEvent(e) ,
|
|
|
|
|
target = Event.getTarget(event);
|
2020-07-13 21:14:33 +08:00
|
|
|
|
if (target.tagName === 'TD') {
|
|
|
|
|
target = target.parentNode;
|
|
|
|
|
}
|
|
|
|
|
this.currentIndex = target.getAttribute("data-row-key");
|
2021-01-04 16:48:00 +08:00
|
|
|
|
|
|
|
|
|
// 拖拽其实index
|
|
|
|
|
this.props.contentTable.startI = target.getAttribute("data-row-index");
|
2020-07-13 21:14:33 +08:00
|
|
|
|
this._dragCurrent = target;
|
|
|
|
|
event.dataTransfer.effectAllowed = "move";
|
|
|
|
|
event.dataTransfer.setData("Text", this.currentIndex);
|
|
|
|
|
onDragRowStart && onDragRowStart(this.currentIndex);
|
2019-04-25 13:53:39 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onDragOver = (e) => {
|
|
|
|
|
let event = Event.getEvent(e);
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
};
|
2019-08-05 17:23:38 +08:00
|
|
|
|
|
2019-04-25 13:53:39 +08:00
|
|
|
|
/**
|
|
|
|
|
* 在一个拖动过程中,释放鼠标键时触发此事件。【目标事件】
|
|
|
|
|
* @memberof TableHeader
|
|
|
|
|
*/
|
|
|
|
|
onDrop = (e) => {
|
2021-01-04 16:48:00 +08:00
|
|
|
|
let {onDragRow, contentTable} = this.props;
|
2019-04-25 13:53:39 +08:00
|
|
|
|
let event = Event.getEvent(e) ,
|
2019-06-19 13:21:15 +08:00
|
|
|
|
_target = Event.getTarget(event),
|
|
|
|
|
target = _target.parentNode;
|
2020-09-24 15:48:20 +08:00
|
|
|
|
event.preventDefault()
|
|
|
|
|
event.stopPropagation();
|
2019-04-26 17:54:19 +08:00
|
|
|
|
let currentKey = event.dataTransfer.getData("text");
|
|
|
|
|
let targetKey = target.getAttribute("data-row-key");
|
|
|
|
|
|
2019-08-05 17:23:38 +08:00
|
|
|
|
if(!targetKey || targetKey === currentKey)return;
|
2019-04-25 13:53:39 +08:00
|
|
|
|
if(target.nodeName.toUpperCase() === "TR"){
|
2019-08-05 17:23:38 +08:00
|
|
|
|
this.synchronizeTableTr(currentKey,null);
|
2019-04-26 17:54:19 +08:00
|
|
|
|
this.synchronizeTableTr(targetKey,null);
|
2019-04-25 13:53:39 +08:00
|
|
|
|
}
|
2019-04-26 17:54:19 +08:00
|
|
|
|
onDragRow && onDragRow(currentKey,targetKey);
|
2019-04-25 13:53:39 +08:00
|
|
|
|
};
|
|
|
|
|
|
2019-06-19 13:21:15 +08:00
|
|
|
|
/**
|
|
|
|
|
* 获取当前触摸的Dom节点
|
|
|
|
|
*/
|
|
|
|
|
getTouchDom = (event) => {
|
|
|
|
|
let currentLocation = event.changedTouches[0];
|
|
|
|
|
let realTarget = document.elementFromPoint(currentLocation.clientX, currentLocation.clientY);
|
|
|
|
|
return realTarget;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 开始调整交换行的事件
|
|
|
|
|
*/
|
|
|
|
|
onTouchStart = (e) => {
|
2019-08-07 10:32:05 +08:00
|
|
|
|
e.stopPropagation()
|
2019-07-16 11:30:02 +08:00
|
|
|
|
let {onDragRowStart} = this.props;
|
2019-06-19 13:21:15 +08:00
|
|
|
|
let event = Event.getEvent(e) ,
|
|
|
|
|
_target = Event.getTarget(event),
|
|
|
|
|
target = _target.parentNode;
|
2019-08-26 15:03:04 +08:00
|
|
|
|
|
2019-08-07 10:32:05 +08:00
|
|
|
|
if (target.tagName === 'TR') {
|
2019-08-26 15:03:04 +08:00
|
|
|
|
|
2019-08-07 10:32:05 +08:00
|
|
|
|
this.currentIndex = target.getAttribute("data-row-key");
|
|
|
|
|
|
|
|
|
|
onDragRowStart && onDragRowStart(this.currentIndex);
|
|
|
|
|
}else{
|
2019-08-26 15:03:04 +08:00
|
|
|
|
|
2019-08-07 10:32:05 +08:00
|
|
|
|
this.canBeTouch = false
|
2019-08-05 17:23:38 +08:00
|
|
|
|
}
|
2019-08-07 10:32:05 +08:00
|
|
|
|
|
2019-06-19 13:21:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onTouchMove = (e) => {
|
2019-08-26 15:03:04 +08:00
|
|
|
|
|
2019-08-07 10:32:05 +08:00
|
|
|
|
if (!this.canBeTouch) return;
|
|
|
|
|
e.stopPropagation()
|
2019-06-19 13:21:15 +08:00
|
|
|
|
let event = Event.getEvent(e);
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
let touchTarget = this.getTouchDom(event),
|
|
|
|
|
target = touchTarget.parentNode,
|
|
|
|
|
targetKey = target.getAttribute("data-row-key");
|
|
|
|
|
if(!targetKey || targetKey === this.currentIndex)return;
|
|
|
|
|
if(target.nodeName.toUpperCase() === "TR"){
|
|
|
|
|
if(this.cacheCurrentIndex !== targetKey){ //模拟 touchenter toucheleave 事件
|
|
|
|
|
this.cacheCurrentIndex && this.synchronizeTableTr(this.cacheCurrentIndex,null); //去掉虚线
|
|
|
|
|
this.synchronizeTableTr(targetKey,true); //添加虚线
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 手指移开时触发
|
|
|
|
|
*/
|
|
|
|
|
onTouchEnd = (e) => {
|
2019-08-26 15:03:04 +08:00
|
|
|
|
|
2019-08-07 10:32:05 +08:00
|
|
|
|
if(!this.canBeTouch){
|
|
|
|
|
this.canBeTouch = true
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
e.stopPropagation()
|
2019-06-19 13:21:15 +08:00
|
|
|
|
let {onDragRow} = this.props;
|
|
|
|
|
let event = Event.getEvent(e),
|
|
|
|
|
currentKey = this.currentIndex, //拖拽行的key
|
|
|
|
|
touchTarget = this.getTouchDom(event), //当前触摸的DOM节点
|
|
|
|
|
target = touchTarget.parentNode, //目标位置的行
|
|
|
|
|
targetKey = target.getAttribute("data-row-key"); //目标位置的行key
|
2019-08-05 17:23:38 +08:00
|
|
|
|
if(!targetKey || targetKey === currentKey)return;
|
2019-06-19 13:21:15 +08:00
|
|
|
|
if(target.nodeName.toUpperCase() === "TR"){
|
|
|
|
|
this.synchronizeTableTr(currentKey,null);
|
|
|
|
|
this.synchronizeTableTr(targetKey,null);
|
|
|
|
|
}
|
2019-08-05 17:23:38 +08:00
|
|
|
|
|
2019-06-19 13:21:15 +08:00
|
|
|
|
onDragRow && onDragRow(currentKey,targetKey);
|
|
|
|
|
}
|
2019-04-26 17:54:19 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*同步当前拖拽到阴影
|
|
|
|
|
* @memberof TableRow
|
|
|
|
|
*/
|
|
|
|
|
synchronizeTableTrShadow = ()=>{
|
2019-08-05 17:23:38 +08:00
|
|
|
|
let {contentTable,index} = this.props;
|
2019-04-26 17:54:19 +08:00
|
|
|
|
|
2019-06-19 13:21:15 +08:00
|
|
|
|
let cont = contentTable.querySelector('.u-table-scroll table tbody').getElementsByTagName("tr")[index],
|
|
|
|
|
trs = cont.getBoundingClientRect(),
|
|
|
|
|
fixed_left_trs = contentTable.querySelector('.u-table-fixed-left table tbody'),
|
|
|
|
|
fixed_right_trs = contentTable.querySelector('.u-table-fixed-right table tbody');
|
|
|
|
|
fixed_left_trs = fixed_left_trs && fixed_left_trs.getElementsByTagName("tr")[index].getBoundingClientRect();
|
|
|
|
|
fixed_right_trs = fixed_right_trs && fixed_right_trs.getElementsByTagName("tr")[index].getBoundingClientRect()
|
2019-08-05 17:23:38 +08:00
|
|
|
|
|
2019-04-26 17:54:19 +08:00
|
|
|
|
let div = document.createElement("div");
|
2019-06-19 13:21:15 +08:00
|
|
|
|
let style = "wdith:"+(trs.width + (fixed_left_trs ? fixed_left_trs.width : 0) + (fixed_right_trs ? fixed_right_trs.width : 0))+"px";
|
|
|
|
|
style += ";height:"+ trs.height+"px";
|
|
|
|
|
style += ";classname:"+ cont.className;
|
2019-04-26 17:54:19 +08:00
|
|
|
|
div.setAttribute("style",style);
|
|
|
|
|
return div;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2019-04-25 13:53:39 +08:00
|
|
|
|
/**
|
|
|
|
|
* 同步自己,也需要同步当前行的行显示
|
|
|
|
|
*/
|
|
|
|
|
synchronizeTableTr = (currentIndex,type)=>{
|
2019-06-19 13:21:15 +08:00
|
|
|
|
if(type){ //同步 this.cacheCurrentIndex
|
2019-08-05 17:23:38 +08:00
|
|
|
|
this.cacheCurrentIndex = currentIndex;
|
|
|
|
|
}
|
|
|
|
|
let {contentTable} = this.props;
|
2019-04-25 13:53:39 +08:00
|
|
|
|
let _table_trs = contentTable.querySelector('.u-table-scroll table tbody'),
|
|
|
|
|
_table_fixed_left_trs = contentTable.querySelector('.u-table-fixed-left table tbody'),
|
|
|
|
|
_table_fixed_right_trs = contentTable.querySelector('.u-table-fixed-right table tbody');
|
2019-08-05 17:23:38 +08:00
|
|
|
|
|
2019-04-28 15:02:03 +08:00
|
|
|
|
_table_trs = _table_trs?_table_trs:contentTable.querySelector('.u-table table tbody');
|
2019-04-25 13:53:39 +08:00
|
|
|
|
|
|
|
|
|
this.synchronizeTrStyle(_table_trs,currentIndex,type);
|
|
|
|
|
if(_table_fixed_left_trs){
|
|
|
|
|
this.synchronizeTrStyle(_table_fixed_left_trs,currentIndex,type);
|
|
|
|
|
}
|
|
|
|
|
if(_table_fixed_right_trs){
|
|
|
|
|
this.synchronizeTrStyle(_table_fixed_right_trs,currentIndex,type);
|
|
|
|
|
}
|
2017-01-11 17:01:50 +08:00
|
|
|
|
}
|
2016-12-26 16:52:39 +08:00
|
|
|
|
|
2019-04-25 13:53:39 +08:00
|
|
|
|
/**
|
|
|
|
|
* 设置同步的style
|
|
|
|
|
*/
|
|
|
|
|
synchronizeTrStyle = (_elementBody,id,type)=>{
|
|
|
|
|
let {contentTable} = this.props,
|
|
|
|
|
trs = _elementBody.getElementsByTagName("tr"),
|
2019-08-05 17:23:38 +08:00
|
|
|
|
currentObj;
|
2019-04-25 13:53:39 +08:00
|
|
|
|
for (let index = 0; index < trs.length; index++) {
|
|
|
|
|
const element = trs[index];
|
|
|
|
|
if(element.getAttribute("data-row-key") == id){
|
|
|
|
|
currentObj = element;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-01-04 16:48:00 +08:00
|
|
|
|
if(type == 'down'){
|
2020-07-16 09:57:18 +08:00
|
|
|
|
currentObj && currentObj.setAttribute("style","border-bottom:2px solid #02B1FD");
|
2021-01-04 16:48:00 +08:00
|
|
|
|
}else if(type){
|
|
|
|
|
currentObj && currentObj.setAttribute("style","border-top:2px solid #02B1FD");
|
2019-04-25 13:53:39 +08:00
|
|
|
|
}else{
|
|
|
|
|
currentObj && currentObj.setAttribute("style","");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onDragEnter = (e) => {
|
2021-01-04 16:48:00 +08:00
|
|
|
|
const {contentTable} = this.props;
|
2019-04-25 13:53:39 +08:00
|
|
|
|
let event = Event.getEvent(e) ,
|
|
|
|
|
_target = Event.getTarget(event),target = _target.parentNode;
|
|
|
|
|
let currentIndex = target.getAttribute("data-row-key");
|
2021-01-04 16:48:00 +08:00
|
|
|
|
let dragEnterIndex = target.getAttribute("data-row-index");
|
2019-04-25 13:53:39 +08:00
|
|
|
|
if(!currentIndex || currentIndex === this.currentIndex)return;
|
2021-01-04 16:48:00 +08:00
|
|
|
|
const dragType = parseInt(dragEnterIndex) > parseInt(contentTable.startI) ? 'down' : 'top'
|
|
|
|
|
|
|
|
|
|
contentTable.dragType = dragType;
|
2019-04-25 13:53:39 +08:00
|
|
|
|
if(target.nodeName.toUpperCase() === "TR"){
|
2021-01-04 16:48:00 +08:00
|
|
|
|
this.synchronizeTableTr(currentIndex,dragType);
|
2019-04-25 13:53:39 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2019-08-05 17:23:38 +08:00
|
|
|
|
|
2019-04-25 13:53:39 +08:00
|
|
|
|
onDragLeave = (e) => {
|
|
|
|
|
let event = Event.getEvent(e) ,
|
|
|
|
|
_target = Event.getTarget(event),target = _target.parentNode;
|
|
|
|
|
let currentIndex = target.getAttribute("data-row-key");
|
|
|
|
|
if(!currentIndex || currentIndex === this.currentIndex)return;
|
2019-08-05 17:23:38 +08:00
|
|
|
|
if(target.nodeName.toUpperCase() === "TR"){
|
2019-04-25 13:53:39 +08:00
|
|
|
|
this.synchronizeTableTr(currentIndex,null);
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-12-18 18:14:09 +08:00
|
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps) {
|
2020-07-23 09:38:08 +08:00
|
|
|
|
const { rowDraggAble,syncRowHeight } = this.props;
|
2019-04-25 13:53:39 +08:00
|
|
|
|
if(!this.event){
|
|
|
|
|
this.event = true;
|
|
|
|
|
if(rowDraggAble){
|
|
|
|
|
this.initEvent();
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-01-03 16:21:24 +08:00
|
|
|
|
if(this.props.treeType){
|
|
|
|
|
this.setRowParentIndex();
|
2018-12-18 18:14:09 +08:00
|
|
|
|
}
|
2020-09-29 09:45:11 +08:00
|
|
|
|
// if(syncRowHeight){
|
|
|
|
|
// this.setRowHeight()
|
|
|
|
|
// }
|
|
|
|
|
this.setRowHeight()
|
2018-12-18 18:14:09 +08:00
|
|
|
|
}
|
2019-08-05 17:23:38 +08:00
|
|
|
|
|
2016-12-26 16:52:39 +08:00
|
|
|
|
componentWillUnmount() {
|
2019-04-25 13:53:39 +08:00
|
|
|
|
const { record, onDestroy, index,rowDraggAble } = this.props;
|
2016-12-26 16:52:39 +08:00
|
|
|
|
onDestroy(record, index);
|
|
|
|
|
if (this.unsubscribe) {
|
|
|
|
|
this.unsubscribe();
|
|
|
|
|
}
|
2019-04-25 13:53:39 +08:00
|
|
|
|
if(rowDraggAble){
|
|
|
|
|
this.removeDragAbleEvent();
|
|
|
|
|
}
|
2017-01-11 17:01:50 +08:00
|
|
|
|
}
|
2016-12-26 16:52:39 +08:00
|
|
|
|
|
2018-12-18 13:59:48 +08:00
|
|
|
|
|
|
|
|
|
setRowHeight() {
|
2019-01-05 00:09:35 +08:00
|
|
|
|
const { setRowHeight , expandedContentHeight=0,fixed,fixedIndex} = this.props
|
2018-12-18 18:14:09 +08:00
|
|
|
|
if (!setRowHeight || !this.element || fixed) return
|
2019-01-03 16:21:24 +08:00
|
|
|
|
setRowHeight(this.element.clientHeight + expandedContentHeight, fixedIndex)
|
2018-12-18 13:59:48 +08:00
|
|
|
|
}
|
2019-01-03 16:21:24 +08:00
|
|
|
|
setRowParentIndex(){
|
|
|
|
|
const {index,setRowParentIndex,fixedIndex,rootIndex} = this.props;
|
|
|
|
|
setRowParentIndex(rootIndex<0?index:rootIndex,fixedIndex);
|
2018-12-18 13:59:48 +08:00
|
|
|
|
|
2019-01-03 16:21:24 +08:00
|
|
|
|
}
|
2019-08-05 17:23:38 +08:00
|
|
|
|
|
2016-12-26 16:52:39 +08:00
|
|
|
|
onRowClick(event) {
|
2019-07-16 18:16:53 +08:00
|
|
|
|
// fix: 解决 onRowClick 回调函数中,事件对象属性均为 null 的问题
|
|
|
|
|
// 异步访问事件属性
|
|
|
|
|
// 调用 event.persist() 会从事件池中移除该合成函数并允许对该合成事件的引用被保留下来。
|
|
|
|
|
event.persist();
|
2016-12-26 16:52:39 +08:00
|
|
|
|
const {
|
|
|
|
|
record,
|
|
|
|
|
index,
|
|
|
|
|
onRowClick,
|
|
|
|
|
expandable,
|
|
|
|
|
expandRowByClick,
|
|
|
|
|
expanded,
|
|
|
|
|
onExpand,
|
2019-12-11 17:40:10 +08:00
|
|
|
|
fixedIndex,
|
|
|
|
|
onRowDoubleClick
|
2016-12-26 16:52:39 +08:00
|
|
|
|
} = this.props;
|
|
|
|
|
if (expandable && expandRowByClick) {
|
2019-02-25 14:40:28 +08:00
|
|
|
|
onExpand(!expanded, record, fixedIndex,event);
|
2016-12-26 16:52:39 +08:00
|
|
|
|
}
|
2019-12-13 17:22:14 +08:00
|
|
|
|
if(!onRowDoubleClick){
|
2019-12-11 17:40:10 +08:00
|
|
|
|
onRowClick(record, fixedIndex, event);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2019-08-05 17:23:38 +08:00
|
|
|
|
this.set((e)=> {
|
2019-02-25 14:40:28 +08:00
|
|
|
|
onRowClick(record, fixedIndex, event);
|
2018-05-02 15:35:06 +08:00
|
|
|
|
});
|
2017-01-11 17:01:50 +08:00
|
|
|
|
}
|
2016-12-26 16:52:39 +08:00
|
|
|
|
|
|
|
|
|
onRowDoubleClick(event) {
|
2019-02-25 14:40:28 +08:00
|
|
|
|
const { record, index, onRowDoubleClick,fixedIndex } = this.props;
|
2018-05-02 15:35:06 +08:00
|
|
|
|
this.clear();
|
2019-12-13 17:22:14 +08:00
|
|
|
|
onRowDoubleClick && onRowDoubleClick(record, fixedIndex, event);
|
2017-01-11 17:01:50 +08:00
|
|
|
|
}
|
2016-12-26 16:52:39 +08:00
|
|
|
|
|
2019-02-18 14:22:20 +08:00
|
|
|
|
onMouseEnter(e) {
|
2019-10-29 17:14:58 +08:00
|
|
|
|
const { onHover, hoverKey,fixedIndex,syncHover,record } = this.props;
|
2019-02-25 14:40:28 +08:00
|
|
|
|
if(syncHover){
|
|
|
|
|
this.setState({ hovered: true });
|
|
|
|
|
}
|
2019-10-29 17:14:58 +08:00
|
|
|
|
onHover(true, hoverKey,e,fixedIndex,record);
|
2017-01-11 17:01:50 +08:00
|
|
|
|
}
|
2016-12-26 16:52:39 +08:00
|
|
|
|
|
2019-02-18 14:22:20 +08:00
|
|
|
|
onMouseLeave(e) {
|
|
|
|
|
|
2019-10-29 17:14:58 +08:00
|
|
|
|
const { onHover, hoverKey ,fixedIndex,syncHover,record} = this.props;
|
2019-02-25 14:40:28 +08:00
|
|
|
|
if(syncHover){
|
|
|
|
|
this.setState({ hovered: false });
|
|
|
|
|
}
|
2019-10-29 17:14:58 +08:00
|
|
|
|
onHover(false, hoverKey,e,fixedIndex,record);
|
2017-01-11 17:01:50 +08:00
|
|
|
|
}
|
2016-12-26 16:52:39 +08:00
|
|
|
|
|
2020-09-11 14:48:13 +08:00
|
|
|
|
stopRowDrag = (isStop) => {
|
|
|
|
|
const {rowDraggAble} = this.props;
|
|
|
|
|
const {notRowDrag} = this.state;
|
|
|
|
|
if(rowDraggAble && isStop!== notRowDrag) {
|
|
|
|
|
this.setState({
|
|
|
|
|
notRowDrag: isStop
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-02 15:35:06 +08:00
|
|
|
|
set =(fn)=> {
|
|
|
|
|
this.clear();
|
2019-08-05 17:23:38 +08:00
|
|
|
|
this._timeout = window.setTimeout(fn, 300);
|
2018-05-02 15:35:06 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
clear =(event)=> {
|
2019-08-05 17:23:38 +08:00
|
|
|
|
if (this._timeout) {
|
|
|
|
|
window.clearTimeout(this._timeout);
|
2018-05-02 15:35:06 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-12-18 13:59:48 +08:00
|
|
|
|
|
|
|
|
|
bindElement = (el)=> {
|
|
|
|
|
this.element = el
|
|
|
|
|
}
|
2019-08-05 17:23:38 +08:00
|
|
|
|
|
2016-12-26 16:52:39 +08:00
|
|
|
|
render() {
|
|
|
|
|
const {
|
2021-03-25 20:14:16 +08:00
|
|
|
|
clsPrefix, columns, record, height, visible, index,onPaste, isPre, isSuf,
|
2020-07-13 21:14:33 +08:00
|
|
|
|
expandIconColumnIndex, expandIconAsCell, expanded, useDragHandle,rowDraggAble,
|
2019-04-23 16:04:02 +08:00
|
|
|
|
expandable, onExpand, needIndentSpaced, indent, indentSize,isHiddenExpandIcon,fixed,bodyDisplayInRow
|
2020-10-30 13:57:05 +08:00
|
|
|
|
,expandedIcon,collapsedIcon, hoverKey,lazyStartIndex,lazyEndIndex, expandIconCellWidth, getCellClassName
|
2016-12-26 16:52:39 +08:00
|
|
|
|
} = this.props;
|
2020-09-11 14:48:13 +08:00
|
|
|
|
const {notRowDrag} = this.state;
|
2021-03-25 20:14:16 +08:00
|
|
|
|
const isEmptyTr = isPre || isSuf
|
2018-12-16 22:22:45 +08:00
|
|
|
|
let showSum = false;
|
2016-12-26 16:52:39 +08:00
|
|
|
|
let { className } = this.props;
|
|
|
|
|
if (this.state.hovered) {
|
2017-01-11 17:01:50 +08:00
|
|
|
|
className += ` ${clsPrefix}-hover`;
|
2016-12-26 16:52:39 +08:00
|
|
|
|
}
|
2018-12-16 22:22:45 +08:00
|
|
|
|
//判断是否为合计行
|
|
|
|
|
if(className.indexOf('sumrow')>-1){
|
|
|
|
|
showSum = true;
|
|
|
|
|
}
|
2016-12-26 16:52:39 +08:00
|
|
|
|
const cells = [];
|
|
|
|
|
|
|
|
|
|
const expandIcon = (
|
|
|
|
|
<ExpandIcon
|
|
|
|
|
expandable={expandable}
|
2017-01-11 17:01:50 +08:00
|
|
|
|
clsPrefix={clsPrefix}
|
2016-12-26 16:52:39 +08:00
|
|
|
|
onExpand={onExpand}
|
|
|
|
|
needIndentSpaced={needIndentSpaced}
|
|
|
|
|
expanded={expanded}
|
|
|
|
|
record={record}
|
2019-05-08 23:02:28 +08:00
|
|
|
|
expandedIcon={expandedIcon}
|
|
|
|
|
collapsedIcon={collapsedIcon}
|
2018-01-31 19:46:40 +08:00
|
|
|
|
isHiddenExpandIcon={isHiddenExpandIcon}
|
2016-12-26 16:52:39 +08:00
|
|
|
|
/>
|
|
|
|
|
);
|
2019-07-11 20:52:45 +08:00
|
|
|
|
let isExpandIconAsCell = expandIconAsCell ? `${clsPrefix}-expand-columns-in-body` : '';
|
2019-08-26 15:03:04 +08:00
|
|
|
|
var expandIndexInThisTable
|
|
|
|
|
if(this.props.fixed === 'right'){
|
|
|
|
|
expandIndexInThisTable = expandIconColumnIndex - this.props.leftColumnsLength-this.props.centerColumnsLength
|
|
|
|
|
}else {
|
|
|
|
|
expandIndexInThisTable = expandIconColumnIndex
|
|
|
|
|
}
|
2016-12-26 16:52:39 +08:00
|
|
|
|
for (let i = 0; i < columns.length; i++) {
|
2020-07-22 10:21:27 +08:00
|
|
|
|
if (expandIconAsCell && i === 0) {
|
|
|
|
|
showSum ? cells.push(<td width={expandIconCellWidth}></td>) :
|
2016-12-26 16:52:39 +08:00
|
|
|
|
cells.push(
|
|
|
|
|
<td
|
2019-07-11 20:52:45 +08:00
|
|
|
|
className={`${clsPrefix}-expand-icon-cell ${isExpandIconAsCell}`}
|
2019-03-19 15:51:23 +08:00
|
|
|
|
key={`rc-table-expand-icon-cell-${i}`}
|
2019-12-11 17:09:59 +08:00
|
|
|
|
width={expandIconCellWidth}
|
2016-12-26 16:52:39 +08:00
|
|
|
|
>
|
|
|
|
|
{expandIcon}
|
|
|
|
|
</td>
|
|
|
|
|
);
|
|
|
|
|
}
|
2020-02-11 16:57:57 +08:00
|
|
|
|
// bugfix 设置expandRowByClick,无法显示箭头,去掉 expandRowByClick 判断
|
|
|
|
|
const isColumnHaveExpandIcon = (expandIconAsCell || showSum)
|
2019-08-26 15:03:04 +08:00
|
|
|
|
? false : (i === expandIndexInThisTable);
|
2016-12-26 16:52:39 +08:00
|
|
|
|
cells.push(
|
|
|
|
|
<TableCell
|
2017-01-11 17:01:50 +08:00
|
|
|
|
clsPrefix={clsPrefix}
|
2016-12-26 16:52:39 +08:00
|
|
|
|
record={record}
|
|
|
|
|
indentSize={indentSize}
|
|
|
|
|
indent={indent}
|
2018-12-26 16:55:06 +08:00
|
|
|
|
index={index}
|
2016-12-26 16:52:39 +08:00
|
|
|
|
column={columns[i]}
|
2019-03-19 15:51:23 +08:00
|
|
|
|
key={index + "_"+(columns[i].key || columns[i].dataIndex || i)}
|
2018-09-12 14:14:05 +08:00
|
|
|
|
fixed= {fixed}
|
2018-12-16 22:22:45 +08:00
|
|
|
|
showSum={showSum}
|
2018-01-31 19:46:40 +08:00
|
|
|
|
expandIcon={(isColumnHaveExpandIcon) ? expandIcon : null}
|
2019-04-23 16:04:02 +08:00
|
|
|
|
bodyDisplayInRow = {bodyDisplayInRow}
|
2019-07-02 16:35:33 +08:00
|
|
|
|
lazyStartIndex={lazyStartIndex}
|
|
|
|
|
lazyEndIndex={lazyEndIndex}
|
2020-07-09 10:42:37 +08:00
|
|
|
|
onPaste={onPaste}
|
2020-09-11 14:48:13 +08:00
|
|
|
|
stopRowDrag={this.stopRowDrag}
|
2020-07-09 11:15:08 +08:00
|
|
|
|
col={i}
|
2020-10-30 13:57:05 +08:00
|
|
|
|
getCellClassName = {getCellClassName}
|
2016-12-26 16:52:39 +08:00
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|
2019-09-06 14:47:42 +08:00
|
|
|
|
const style = { height ,...record?record.style:undefined};
|
2016-12-26 16:52:39 +08:00
|
|
|
|
if (!visible) {
|
|
|
|
|
style.display = 'none';
|
|
|
|
|
}
|
2019-08-27 17:04:32 +08:00
|
|
|
|
if(record && record._checked){
|
2019-08-27 16:39:40 +08:00
|
|
|
|
className += ' selected';
|
|
|
|
|
}
|
2020-09-11 14:48:13 +08:00
|
|
|
|
|
|
|
|
|
if(rowDraggAble && !useDragHandle && !notRowDrag) {
|
|
|
|
|
className += ' row-dragg-able'
|
|
|
|
|
}
|
2019-08-05 17:23:38 +08:00
|
|
|
|
return (
|
2016-12-26 16:52:39 +08:00
|
|
|
|
<tr
|
2020-09-11 14:48:13 +08:00
|
|
|
|
draggable={rowDraggAble && !useDragHandle && !notRowDrag}
|
2016-12-26 16:52:39 +08:00
|
|
|
|
onClick={this.onRowClick}
|
|
|
|
|
onDoubleClick={this.onRowDoubleClick}
|
|
|
|
|
onMouseEnter={this.onMouseEnter}
|
|
|
|
|
onMouseLeave={this.onMouseLeave}
|
2017-01-11 17:01:50 +08:00
|
|
|
|
className={`${clsPrefix} ${className} ${clsPrefix}-level-${indent}`}
|
2016-12-26 16:52:39 +08:00
|
|
|
|
style={style}
|
2019-05-22 18:20:13 +08:00
|
|
|
|
data-row-key={record && record.key?record.key:hoverKey}
|
2021-01-04 16:48:00 +08:00
|
|
|
|
data-row-index={this.props.index}
|
2019-01-16 15:15:26 +08:00
|
|
|
|
// key={hoverKey}
|
2018-12-18 13:59:48 +08:00
|
|
|
|
ref={this.bindElement}
|
2016-12-26 16:52:39 +08:00
|
|
|
|
>
|
2021-03-25 20:14:16 +08:00
|
|
|
|
{cells.length > 0 ? cells : isEmptyTr ?
|
|
|
|
|
<td className="loading-td">
|
|
|
|
|
<div className={`loading-div ${ isPre ? 'pre' : 'suf' }`}>
|
|
|
|
|
<img
|
|
|
|
|
alt=''
|
|
|
|
|
src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDJweCIgaGVpZ2h0PSI0MXB4IiB2aWV3Qm94PSIwIDAgNDIgNDEiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUzLjIgKDcyNjQzKSAtIGh0dHBzOi8vc2tldGNoYXBwLmNvbSAtLT4KICAgIDx0aXRsZT53aW5kb3U8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8bGluZWFyR3JhZGllbnQgeDE9IjQ5Ljc3NzAwMDElIiB5MT0iOTkuOTg4NjY2NyUiIHgyPSI0OS43NzcwMDAxJSIgeTI9IjIyLjc5MTY5ODQlIiBpZD0ibGluZWFyR3JhZGllbnQtMSI+CiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiM4MkQ5MDAiIG9mZnNldD0iMCUiPjwvc3RvcD4KICAgICAgICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI0ZGRkZGRiIgc3RvcC1vcGFjaXR5PSIwIiB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C9jaXJjbGU+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgIC
|
|
|
|
|
</div>
|
|
|
|
|
</td> : <td style={{width: 0,padding: 0}}>
|
|
|
|
|
</td>}
|
2016-12-26 16:52:39 +08:00
|
|
|
|
</tr>
|
|
|
|
|
);
|
2017-01-11 17:01:50 +08:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
TableRow.propTypes = propTypes;
|
|
|
|
|
TableRow.defaultProps = defaultProps;
|
2016-12-26 16:52:39 +08:00
|
|
|
|
|
|
|
|
|
export default TableRow;
|