优化排序

This commit is contained in:
wanghaoo 2018-10-12 16:31:41 +08:00
parent 751cc03387
commit 39e729a4ab
8 changed files with 20 additions and 22 deletions

View File

@ -28,7 +28,6 @@ const columns13 = [
key: "b", key: "b",
width: 200, width: 200,
sumCol: true, sumCol: true,
order:'ascend',
sorter: (a, b) => a.c - b.c, sorter: (a, b) => a.c - b.c,
sorterClick:(data,type)=>{//排序的回调函数 sorterClick:(data,type)=>{//排序的回调函数
//type value is up or down //type value is up or down

File diff suppressed because one or more lines are too long

4
dist/demo.css vendored
View File

@ -8596,10 +8596,6 @@ ul {
display: block; display: block;
width: 14px; width: 14px;
cursor: pointer; } cursor: pointer; }
.u-table-thead th .bee-table-column-sorter > .bee-table-column-sorter-flat {
display: none; }
.u-table-thead th:hover .bee-table-column-sorter > .bee-table-column-sorter-flat {
display: block; }
.u-table-thead th .bee-table-column-sorter-down.on .uf-triangle-down, .u-table-thead th .bee-table-column-sorter-down.on .uf-triangle-down,
.u-table-thead th .bee-table-column-sorter-down.on .uf-triangle-up, .u-table-thead th .bee-table-column-sorter-down.on .uf-triangle-up,
.u-table-thead th .bee-table-column-sorter-up.on .uf-triangle-down, .u-table-thead th .bee-table-column-sorter-up.on .uf-triangle-down,

2
dist/demo.css.map vendored

File diff suppressed because one or more lines are too long

7
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -171,7 +171,7 @@ class Table extends Component {
this.syncFixedTableRowHeight(); this.syncFixedTableRowHeight();
} }
//如果contentDomWidth为0则需要重新计算适应模态框中表格; //如果contentDomWidth为0则需要重新计算适应模态框中表格;
if(this.contentDomWidth == 0){ if(this.contentDomWidth == 0 && this.preContentDomWidth !== this.contentDomWidth){
this.computeTableWidth(); this.computeTableWidth();
} }
@ -190,8 +190,10 @@ class Table extends Component {
let numSetWidthParam = parseInt(setWidthParam); let numSetWidthParam = parseInt(setWidthParam);
this.contentWidth = numSetWidthParam; this.contentWidth = numSetWidthParam;
} else { } else {
this.preContentDomWidth = this.contentDomWidth;
//计算总表格宽度、根据表格宽度和各列的宽度和比较,重置最后一列 //计算总表格宽度、根据表格宽度和各列的宽度和比较,重置最后一列
this.contentDomWidth = this.contentTable.getBoundingClientRect().width//表格容器宽度 this.contentDomWidth = this.contentTable.getBoundingClientRect().width//表格容器宽度
this.contentWidth = this.contentDomWidth;//默认与容器宽度一样 this.contentWidth = this.contentDomWidth;//默认与容器宽度一样
if (typeof (setWidthParam) == 'string' && setWidthParam.indexOf('%')) { if (typeof (setWidthParam) == 'string' && setWidthParam.indexOf('%')) {
this.contentWidth = this.contentWidth * parseInt(setWidthParam) / 100 this.contentWidth = this.contentWidth * parseInt(setWidthParam) / 100

View File

@ -304,20 +304,20 @@ $table-move-in-color: $bg-color-base;
width: 14px; width: 14px;
cursor: pointer; cursor: pointer;
} }
& > .bee-table-column-sorter-flat{ // & > .bee-table-column-sorter-flat{
display: none; // display: none;
} // }
} }
&:hover{ // &:hover{
.bee-table-column-sorter { // .bee-table-column-sorter {
& > .bee-table-column-sorter-flat{ // & > .bee-table-column-sorter-flat{
display: block; // display: block;
} // }
} // }
} // }
.bee-table-column-sorter-down.on .uf-triangle-down, .bee-table-column-sorter-down.on .uf-triangle-down,
.bee-table-column-sorter-down.on .uf-triangle-up, .bee-table-column-sorter-down.on .uf-triangle-up,
.bee-table-column-sorter-up.on .uf-triangle-down, .bee-table-column-sorter-up.on .uf-triangle-down,