fix(1、修改交互列逻辑2、多表头支持列排序):

1、修改交互列逻辑2、多表头支持列排序
This commit is contained in:
wanghaoo 2019-01-16 15:18:20 +08:00
parent 01b4ee4303
commit a1444244b9
3 changed files with 8 additions and 7 deletions

View File

@ -622,7 +622,7 @@ var TableHeader = function (_Component) {
rows.map(function (row, index) { rows.map(function (row, index) {
return _react2["default"].createElement( return _react2["default"].createElement(
"tr", "tr",
{ style: rowStyle, className: filterable && index == rows.length - 1 ? 'filterable' : '' }, { key: index, style: rowStyle, className: filterable && index == rows.length - 1 ? 'filterable' : '' },
row.map(function (da, columIndex, arr) { row.map(function (da, columIndex, arr) {
var thHover = da.drgHover ? " " + clsPrefix + "-thead th-drag-hover" : ""; var thHover = da.drgHover ? " " + clsPrefix + "-thead th-drag-hover" : "";
delete da.drgHover; delete da.drgHover;
@ -640,6 +640,7 @@ var TableHeader = function (_Component) {
//避免key为undefined //避免key为undefined
// if(da.dataindex && da.key ===undefined ){ // if(da.dataindex && da.key ===undefined ){
keyTemp.key = da.key || da.dataindex || index + '-' + columIndex; keyTemp.key = da.key || da.dataindex || index + '-' + columIndex;
// } // }
if (filterable && index == rows.length - 1) { if (filterable && index == rows.length - 1) {
da.children = _this2.filterRenderType(da["filtertype"], da.dataindex, columIndex); da.children = _this2.filterRenderType(da["filtertype"], da.dataindex, columIndex);
@ -660,7 +661,6 @@ var TableHeader = function (_Component) {
thClassName += " " + fixedStyle; thClassName += " " + fixedStyle;
if (!da.fixed) { if (!da.fixed) {
console.log(keyTemp.key);
return _react2["default"].createElement( return _react2["default"].createElement(
"th", "th",
_extends({}, da, keyTemp, { className: thClassName, "data-th-fixed": da.fixed, _extends({}, da, keyTemp, { className: thClassName, "data-th-fixed": da.fixed,

View File

@ -234,7 +234,8 @@ var TableRow = function (_Component) {
indent = _props9.indent, indent = _props9.indent,
indentSize = _props9.indentSize, indentSize = _props9.indentSize,
isHiddenExpandIcon = _props9.isHiddenExpandIcon, isHiddenExpandIcon = _props9.isHiddenExpandIcon,
fixed = _props9.fixed; fixed = _props9.fixed,
hoverKey = _props9.hoverKey;
var showSum = false; var showSum = false;
var className = this.props.className; var className = this.props.className;
@ -289,7 +290,6 @@ var TableRow = function (_Component) {
if (!visible) { if (!visible) {
style.display = 'none'; style.display = 'none';
} }
return _react2["default"].createElement( return _react2["default"].createElement(
'tr', 'tr',
{ {
@ -298,8 +298,9 @@ var TableRow = function (_Component) {
onMouseEnter: this.onMouseEnter, onMouseEnter: this.onMouseEnter,
onMouseLeave: this.onMouseLeave, onMouseLeave: this.onMouseLeave,
className: clsPrefix + ' ' + className + ' ' + clsPrefix + '-level-' + indent, className: clsPrefix + ' ' + className + ' ' + clsPrefix + '-level-' + indent,
style: style, style: style
ref: this.bindElement // key={hoverKey}
, ref: this.bindElement
}, },
cells.length > 0 ? cells : _react2["default"].createElement('td', null) cells.length > 0 ? cells : _react2["default"].createElement('td', null)
); );

View File

@ -1,6 +1,6 @@
{ {
"name": "bee-table", "name": "bee-table",
"version": "1.6.29", "version": "1.6.30",
"description": "Table ui component for react", "description": "Table ui component for react",
"keywords": [ "keywords": [
"react", "react",