fix:树形表,onRowHover方法返回参数异常
This commit is contained in:
parent
1a16da2e16
commit
16b7080ab6
|
@ -1501,14 +1501,17 @@ var Table = function (_Component) {
|
||||||
this.lastScrollLeft = e.target.scrollLeft;
|
this.lastScrollLeft = e.target.scrollLeft;
|
||||||
};
|
};
|
||||||
|
|
||||||
Table.prototype.handleRowHover = function handleRowHover(isHover, key, event, currentIndex) {
|
Table.prototype.handleRowHover = function handleRowHover(isHover, key, event, currentIndex, propsRecord) {
|
||||||
//增加新的API,设置是否同步Hover状态,提高性能,避免无关的渲染
|
//增加新的API,设置是否同步Hover状态,提高性能,避免无关的渲染
|
||||||
var _props10 = this.props,
|
var _props10 = this.props,
|
||||||
syncHover = _props10.syncHover,
|
syncHover = _props10.syncHover,
|
||||||
onRowHover = _props10.onRowHover,
|
onRowHover = _props10.onRowHover,
|
||||||
data = _props10.data;
|
data = _props10.data;
|
||||||
|
//fix:树形表,onRowHover返回参数异常
|
||||||
|
|
||||||
var record = data[currentIndex];
|
var isTreeType = this.isTreeType;
|
||||||
|
|
||||||
|
var record = isTreeType ? propsRecord : data[currentIndex];
|
||||||
// 固定列、或者含有hoverdom时情况下同步hover状态
|
// 固定列、或者含有hoverdom时情况下同步hover状态
|
||||||
if (this.columnManager.isAnyColumnsFixed() && syncHover) {
|
if (this.columnManager.isAnyColumnsFixed() && syncHover) {
|
||||||
this.hoverKey = key;
|
this.hoverKey = key;
|
||||||
|
|
|
@ -523,12 +523,13 @@ var TableRow = function (_Component) {
|
||||||
onHover = _props7.onHover,
|
onHover = _props7.onHover,
|
||||||
hoverKey = _props7.hoverKey,
|
hoverKey = _props7.hoverKey,
|
||||||
fixedIndex = _props7.fixedIndex,
|
fixedIndex = _props7.fixedIndex,
|
||||||
syncHover = _props7.syncHover;
|
syncHover = _props7.syncHover,
|
||||||
|
record = _props7.record;
|
||||||
|
|
||||||
if (syncHover) {
|
if (syncHover) {
|
||||||
this.setState({ hovered: true });
|
this.setState({ hovered: true });
|
||||||
}
|
}
|
||||||
onHover(true, hoverKey, e, fixedIndex);
|
onHover(true, hoverKey, e, fixedIndex, record);
|
||||||
};
|
};
|
||||||
|
|
||||||
TableRow.prototype.onMouseLeave = function onMouseLeave(e) {
|
TableRow.prototype.onMouseLeave = function onMouseLeave(e) {
|
||||||
|
@ -536,12 +537,13 @@ var TableRow = function (_Component) {
|
||||||
onHover = _props8.onHover,
|
onHover = _props8.onHover,
|
||||||
hoverKey = _props8.hoverKey,
|
hoverKey = _props8.hoverKey,
|
||||||
fixedIndex = _props8.fixedIndex,
|
fixedIndex = _props8.fixedIndex,
|
||||||
syncHover = _props8.syncHover;
|
syncHover = _props8.syncHover,
|
||||||
|
record = _props8.record;
|
||||||
|
|
||||||
if (syncHover) {
|
if (syncHover) {
|
||||||
this.setState({ hovered: false });
|
this.setState({ hovered: false });
|
||||||
}
|
}
|
||||||
onHover(false, hoverKey, e, fixedIndex);
|
onHover(false, hoverKey, e, fixedIndex, record);
|
||||||
};
|
};
|
||||||
|
|
||||||
TableRow.prototype.render = function render() {
|
TableRow.prototype.render = function render() {
|
||||||
|
|
|
@ -38353,14 +38353,17 @@
|
||||||
this.lastScrollLeft = e.target.scrollLeft;
|
this.lastScrollLeft = e.target.scrollLeft;
|
||||||
};
|
};
|
||||||
|
|
||||||
Table.prototype.handleRowHover = function handleRowHover(isHover, key, event, currentIndex) {
|
Table.prototype.handleRowHover = function handleRowHover(isHover, key, event, currentIndex, propsRecord) {
|
||||||
//增加新的API,设置是否同步Hover状态,提高性能,避免无关的渲染
|
//增加新的API,设置是否同步Hover状态,提高性能,避免无关的渲染
|
||||||
var _props10 = this.props,
|
var _props10 = this.props,
|
||||||
syncHover = _props10.syncHover,
|
syncHover = _props10.syncHover,
|
||||||
onRowHover = _props10.onRowHover,
|
onRowHover = _props10.onRowHover,
|
||||||
data = _props10.data;
|
data = _props10.data;
|
||||||
|
//fix:树形表,onRowHover返回参数异常
|
||||||
|
|
||||||
var record = data[currentIndex];
|
var isTreeType = this.isTreeType;
|
||||||
|
|
||||||
|
var record = isTreeType ? propsRecord : data[currentIndex];
|
||||||
// 固定列、或者含有hoverdom时情况下同步hover状态
|
// 固定列、或者含有hoverdom时情况下同步hover状态
|
||||||
if (this.columnManager.isAnyColumnsFixed() && syncHover) {
|
if (this.columnManager.isAnyColumnsFixed() && syncHover) {
|
||||||
this.hoverKey = key;
|
this.hoverKey = key;
|
||||||
|
@ -39019,12 +39022,13 @@
|
||||||
onHover = _props7.onHover,
|
onHover = _props7.onHover,
|
||||||
hoverKey = _props7.hoverKey,
|
hoverKey = _props7.hoverKey,
|
||||||
fixedIndex = _props7.fixedIndex,
|
fixedIndex = _props7.fixedIndex,
|
||||||
syncHover = _props7.syncHover;
|
syncHover = _props7.syncHover,
|
||||||
|
record = _props7.record;
|
||||||
|
|
||||||
if (syncHover) {
|
if (syncHover) {
|
||||||
this.setState({ hovered: true });
|
this.setState({ hovered: true });
|
||||||
}
|
}
|
||||||
onHover(true, hoverKey, e, fixedIndex);
|
onHover(true, hoverKey, e, fixedIndex, record);
|
||||||
};
|
};
|
||||||
|
|
||||||
TableRow.prototype.onMouseLeave = function onMouseLeave(e) {
|
TableRow.prototype.onMouseLeave = function onMouseLeave(e) {
|
||||||
|
@ -39032,12 +39036,13 @@
|
||||||
onHover = _props8.onHover,
|
onHover = _props8.onHover,
|
||||||
hoverKey = _props8.hoverKey,
|
hoverKey = _props8.hoverKey,
|
||||||
fixedIndex = _props8.fixedIndex,
|
fixedIndex = _props8.fixedIndex,
|
||||||
syncHover = _props8.syncHover;
|
syncHover = _props8.syncHover,
|
||||||
|
record = _props8.record;
|
||||||
|
|
||||||
if (syncHover) {
|
if (syncHover) {
|
||||||
this.setState({ hovered: false });
|
this.setState({ hovered: false });
|
||||||
}
|
}
|
||||||
onHover(false, hoverKey, e, fixedIndex);
|
onHover(false, hoverKey, e, fixedIndex, record);
|
||||||
};
|
};
|
||||||
|
|
||||||
TableRow.prototype.render = function render() {
|
TableRow.prototype.render = function render() {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1303,10 +1303,12 @@ class Table extends Component {
|
||||||
this.lastScrollLeft = e.target.scrollLeft;
|
this.lastScrollLeft = e.target.scrollLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
handleRowHover(isHover, key,event,currentIndex) {
|
handleRowHover(isHover, key,event,currentIndex, propsRecord) {
|
||||||
//增加新的API,设置是否同步Hover状态,提高性能,避免无关的渲染
|
//增加新的API,设置是否同步Hover状态,提高性能,避免无关的渲染
|
||||||
let { syncHover,onRowHover,data } = this.props;
|
let { syncHover,onRowHover,data } = this.props;
|
||||||
const record = data[currentIndex];
|
//fix:树形表,onRowHover返回参数异常
|
||||||
|
let { isTreeType } = this;
|
||||||
|
const record = isTreeType ? propsRecord : data[currentIndex];
|
||||||
// 固定列、或者含有hoverdom时情况下同步hover状态
|
// 固定列、或者含有hoverdom时情况下同步hover状态
|
||||||
if(this.columnManager.isAnyColumnsFixed() && syncHover ){
|
if(this.columnManager.isAnyColumnsFixed() && syncHover ){
|
||||||
this.hoverKey = key;
|
this.hoverKey = key;
|
||||||
|
|
|
@ -413,20 +413,20 @@ class TableRow extends Component{
|
||||||
}
|
}
|
||||||
|
|
||||||
onMouseEnter(e) {
|
onMouseEnter(e) {
|
||||||
const { onHover, hoverKey,fixedIndex,syncHover } = this.props;
|
const { onHover, hoverKey,fixedIndex,syncHover,record } = this.props;
|
||||||
if(syncHover){
|
if(syncHover){
|
||||||
this.setState({ hovered: true });
|
this.setState({ hovered: true });
|
||||||
}
|
}
|
||||||
onHover(true, hoverKey,e,fixedIndex);
|
onHover(true, hoverKey,e,fixedIndex,record);
|
||||||
}
|
}
|
||||||
|
|
||||||
onMouseLeave(e) {
|
onMouseLeave(e) {
|
||||||
|
|
||||||
const { onHover, hoverKey ,fixedIndex,syncHover} = this.props;
|
const { onHover, hoverKey ,fixedIndex,syncHover,record} = this.props;
|
||||||
if(syncHover){
|
if(syncHover){
|
||||||
this.setState({ hovered: false });
|
this.setState({ hovered: false });
|
||||||
}
|
}
|
||||||
onHover(false, hoverKey,e,fixedIndex);
|
onHover(false, hoverKey,e,fixedIndex,record);
|
||||||
}
|
}
|
||||||
|
|
||||||
set =(fn)=> {
|
set =(fn)=> {
|
||||||
|
|
Loading…
Reference in New Issue