|
|
@@ -74,6 +74,8 @@
|
|
|
striped: false,
|
|
|
pagination: false,
|
|
|
maxHeight: 200,
|
|
|
+ showSummary: true,
|
|
|
+ summaryFunc: handleSummary,
|
|
|
dataSource: tableData.value,
|
|
|
columns: columns,
|
|
|
});
|
|
|
@@ -139,6 +141,24 @@
|
|
|
await setDetailTableData([]);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 合计行加载方法
|
|
|
+ function handleSummary(tableData: any[]) {
|
|
|
+ console.log(tableData);
|
|
|
+ let totalSum = 0;
|
|
|
+ let totalProportion = 0;
|
|
|
+ tableData.forEach(item => {
|
|
|
+ totalSum += item.sum;
|
|
|
+ totalProportion += parseFloat(parseFloat(item.proportion.split('%')[0]).toFixed(2));
|
|
|
+ });
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ type: '合计',
|
|
|
+ sum: totalSum,
|
|
|
+ proportion: totalProportion + '%',
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
@@ -155,4 +175,18 @@
|
|
|
::v-deep(.ant-row) {
|
|
|
max-height: 460px;
|
|
|
}
|
|
|
+
|
|
|
+ ::v-deep(.ant-table-body) {
|
|
|
+ height: auto !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ ::v-deep(.ant-table-footer) {
|
|
|
+ padding: 0 !important;
|
|
|
+
|
|
|
+ .ant-table-tbody {
|
|
|
+ background-color: #f6f8fa !important;
|
|
|
+ font-weight: 600 !important;
|
|
|
+ color: #000a18 !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|