|
@ -116,12 +116,15 @@ export default { |
|
|
}, |
|
|
}, |
|
|
// 总计 |
|
|
// 总计 |
|
|
setTableTotal(gridApi) { |
|
|
setTableTotal(gridApi) { |
|
|
|
|
|
// 设置页码器 |
|
|
|
|
|
let _pageData = this.getCurrentPageData(gridApi) |
|
|
|
|
|
this.pageTotal = this.allPageData.length |
|
|
|
|
|
// 设置底部汇总 |
|
|
if(!this.BottomFixedItem || this.BottomFixedItem.length <= 0)return |
|
|
if(!this.BottomFixedItem || this.BottomFixedItem.length <= 0)return |
|
|
let result = [{}] |
|
|
let result = [{}] |
|
|
this.BottomFixedItem.forEach(item=>{ |
|
|
this.BottomFixedItem.forEach(item=>{ |
|
|
result[0][item] = 0 |
|
|
result[0][item] = 0 |
|
|
}) |
|
|
}) |
|
|
let _pageData = this.getCurrentPageData(gridApi) |
|
|
|
|
|
_pageData.forEach((item,key) => { |
|
|
_pageData.forEach((item,key) => { |
|
|
for(let o in item){ |
|
|
for(let o in item){ |
|
|
if(this.BottomFixedItem.indexOf(o) >= 0){ |
|
|
if(this.BottomFixedItem.indexOf(o) >= 0){ |
|
@ -129,7 +132,6 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
console.log(132,result) |
|
|
|
|
|
// 平均值的特殊处理 |
|
|
// 平均值的特殊处理 |
|
|
if(this.averageFixedItem){ |
|
|
if(this.averageFixedItem){ |
|
|
for(let i in result[0]){ |
|
|
for(let i in result[0]){ |
|
@ -138,7 +140,6 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
this.pageTotal = this.allPageData.length |
|
|
|
|
|
this.gridApi.setPinnedBottomRowData(result); |
|
|
this.gridApi.setPinnedBottomRowData(result); |
|
|
}, |
|
|
}, |
|
|
// 设置表格高度 |
|
|
// 设置表格高度 |
|
@ -151,6 +152,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
// 更新table值 |
|
|
// 更新table值 |
|
|
updateTableData(data){ |
|
|
updateTableData(data){ |
|
|
|
|
|
this.currentPage = 1 |
|
|
this.gridApi.setRowData(data) |
|
|
this.gridApi.setRowData(data) |
|
|
this.setTableTotal(this.gridApi) |
|
|
this.setTableTotal(this.gridApi) |
|
|
this.gridApi.resetRowHeights(); |
|
|
this.gridApi.resetRowHeights(); |
|
|