|
@@ -32,7 +32,7 @@ export function expandAllNodes(projects) {
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- return _getEndSpanRows(tableData);
|
|
|
+ return _getStandaloneSpanRows(tableData);
|
|
|
}
|
|
|
|
|
|
// 合并行数据
|
|
@@ -108,15 +108,40 @@ function _calcMaxStandaloneCnt(box) {
|
|
|
}
|
|
|
|
|
|
// 计算每条记录末端所占的行数
|
|
|
-function _getEndSpanRows(tableData) {
|
|
|
+function _getStandaloneSpanRows(tableData) {
|
|
|
tableData.map((td, index) => {
|
|
|
let previous = tableData[index - 1]
|
|
|
- if (td.maxCnt > 1 && previous.spanRows < 2) {
|
|
|
- td.spanRows = td.maxCnt
|
|
|
- } else if (index > 0 && previous.spanRows > 1) {
|
|
|
- td.spanRows = 0
|
|
|
+ // 主机合并
|
|
|
+ if (td.maxCnt > 1 && td.hpCnt < td.maxCnt && previous.hpSpanRows < 2) {
|
|
|
+ td.hpSpanRows = td.maxCnt
|
|
|
+ } else if (index > 0 && previous.hpSpanRows > 1) {
|
|
|
+ td.hpSpanRows = 0
|
|
|
} else {
|
|
|
- td.spanRows = 1
|
|
|
+ td.hpSpanRows = 1
|
|
|
+ }
|
|
|
+ // 新风机合并
|
|
|
+ if (td.maxCnt > 1 && td.dhCnt < td.maxCnt && previous.dhSpanRows < 2) {
|
|
|
+ td.dhSpanRows = td.maxCnt
|
|
|
+ } else if (index > 0 && previous.dhSpanRows > 1) {
|
|
|
+ td.dhSpanRows = 0
|
|
|
+ } else {
|
|
|
+ td.dhSpanRows = 1
|
|
|
+ }
|
|
|
+ // 换热站合并
|
|
|
+ if (td.maxCnt > 1 && td.hexCnt < td.maxCnt && previous.hexSpanRows < 2) {
|
|
|
+ td.hexSpanRows = td.maxCnt
|
|
|
+ } else if (index > 0 && previous.hexSpanRows > 1) {
|
|
|
+ td.hexSpanRows = 0
|
|
|
+ } else {
|
|
|
+ td.hexSpanRows = 1
|
|
|
+ }
|
|
|
+ // 末端合并
|
|
|
+ if (td.maxCnt > 1 && previous.cbSpanRows < 2) {
|
|
|
+ td.cbSpanRows = td.maxCnt
|
|
|
+ } else if (index > 0 && previous.cbSpanRows > 1) {
|
|
|
+ td.cbSpanRows = 0
|
|
|
+ } else {
|
|
|
+ td.cbSpanRows = 1
|
|
|
}
|
|
|
tableData[index] = td
|
|
|
return td
|