From c06808ae4133dff12d5ee86f658dd2965cabc2e3 Mon Sep 17 00:00:00 2001 From: wanghaoo Date: Mon, 7 Jan 2019 15:01:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=A4=A7=E6=95=B0=E6=8D=AE=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E4=B8=8B=E5=A2=9E=E5=8A=A0=E6=A0=91=E7=8A=B6=E8=A1=A8?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=EF=BC=8C=E5=8E=BB=E6=8E=89console):?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/Table.css | 2 +- build/Table.js | 6 +----- build/lib/bigData.js | 30 +++++++++++++++--------------- package.json | 2 +- 4 files changed, 18 insertions(+), 22 deletions(-) diff --git a/build/Table.css b/build/Table.css index 2864ca3..c93b9cd 100644 --- a/build/Table.css +++ b/build/Table.css @@ -396,7 +396,7 @@ .u-table-thead-th-drag-gap .online { height: 100%; width: 1px; - background: transparent; + background: #e9e9e9; margin: 0 auto; } .u-table-thead-th-drag-gap .online-hover { background: #000000; } diff --git a/build/Table.js b/build/Table.js index 9d9f295..b6f3962 100644 --- a/build/Table.js +++ b/build/Table.js @@ -292,11 +292,7 @@ var Table = function (_Component) { this.firstDid = true; //避免重复update } -<<<<<<< HEAD // console.log('this.scrollTop**********',this.scrollTop); -======= - console.log('this.scrollTop**********', this.scrollTop); ->>>>>>> d5f55ca081b922fb7a34cb4bddf74a797256d50b }; Table.prototype.componentDidUpdate = function componentDidUpdate() { @@ -1166,7 +1162,7 @@ var Table = function (_Component) { (0, _componentClasses2["default"])(this.contentTable).remove(new RegExp('^' + clsPrefix + '-scroll-position-.+$')).add(clsPrefix + '-scroll-position-' + position); } } - console.log('lastScrollTop--' + this.lastScrollTop + '--eventScrollTop--' + e.target.scrollTop); + // console.log('lastScrollTop--'+this.lastScrollTop+'--eventScrollTop--'+ e.target.scrollTop); if (scroll.y && this.lastScrollTop != e.target.scrollTop) { if (fixedColumnsBodyLeft && e.target !== fixedColumnsBodyLeft) { fixedColumnsBodyLeft.scrollTop = e.target.scrollTop; diff --git a/build/lib/bigData.js b/build/lib/bigData.js index bb7d174..a9d74ec 100644 --- a/build/lib/bigData.js +++ b/build/lib/bigData.js @@ -115,14 +115,9 @@ function bigData(Table) { var data = this.props.data; var rs = false; -<<<<<<< HEAD var len = data.length > 30 ? 30 : data.length; //取前三十个看看是否有children属性,有则为树形结构 for (var i = 0; i < len; i++) { -======= - //取前三十个看看是否有children属性,有则为树形结构 - for (var i = 0; i < 30; i++) { ->>>>>>> d5f55ca081b922fb7a34cb4bddf74a797256d50b if (data[i].children) { rs = true; break; @@ -259,11 +254,7 @@ function bigData(Table) { lazyLoad.preHeight = this.getSumHeight(0, startIndex); lazyLoad.sufHeight = this.getSumHeight(endIndex, data.length); } -<<<<<<< HEAD // console.log('*******ScrollTop*****'+scrollTop); -======= - console.log('*******ScrollTop*****' + scrollTop); ->>>>>>> d5f55ca081b922fb7a34cb4bddf74a797256d50b return _react2["default"].createElement(Table, _extends({}, this.props, { data: data.slice(startIndex, endIndex), lazyLoad: lazyLoad, @@ -357,7 +348,7 @@ function bigData(Table) { index += 1; } } - console.log('currentIndex****', index); + // console.log('currentIndex****',index); var isOrder = index - currentIndex > 0 ? true : false; if (index < 0) index = 0; //如果之前的索引和下一次的不一样则重置索引和滚动的位置 @@ -384,12 +375,12 @@ function bigData(Table) { var treeIndex = index; index = _this.cachedRowParentIndex[treeIndex]; if (index === undefined) { - console.log('index is undefined********' + treeIndex); + // console.log('index is undefined********'+treeIndex); index = _this5.getParentIndex(treeIndex); - console.log("getParentIndex****" + index); + // console.log("getParentIndex****"+index); } } - console.log('parentIndex*********', index); + // console.log('parentIndex*********',index); // 如果rowsInView 小于 缓存的数据则重新render // 向下滚动 下临界值超出缓存的endIndex则重新渲染 if (rowsInView + index > endIndex - rowDiff && isOrder) { @@ -415,7 +406,12 @@ function bigData(Table) { _this5.endIndex = endIndex; _this5.setState({ needRender: !needRender }); } - console.log("===================", "**index**" + index, " **startIndex**" + _this5.startIndex, "**endIndex**" + _this5.endIndex); + // console.log( + // "===================", + // "**index**" + index, + // " **startIndex**" + this.startIndex, + // "**endIndex**" + this.endIndex + // ); } // 向上滚动,当前的index是否已经加载(currentIndex),若干上临界值小于startIndex则重新渲染 if (!isOrder && index < startIndex + rowDiff) { @@ -428,7 +424,11 @@ function bigData(Table) { _this5.endIndex = _this5.startIndex + loadCount; _this5.setState({ needRender: !needRender }); } - console.log("**index**" + index, "**startIndex**" + _this5.startIndex, "**endIndex**" + _this5.endIndex); + // console.log( + // "**index**" + index, + // "**startIndex**" + this.startIndex, + // "**endIndex**" + this.endIndex + // ); } } } diff --git a/package.json b/package.json index 95e4247..3bf729e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bee-table", - "version": "1.6.26", + "version": "1.6.27", "description": "Table ui component for react", "keywords": [ "react",