From 8f5b71cc29ecbc511a3b2d96f1e6c7e75c4deddd Mon Sep 17 00:00:00 2001 From: wang-liang0615 Date: Fri, 22 Dec 2023 15:33:53 +0800 Subject: [PATCH] pref(cmdb-ui):ci detail history merge row method --- cmdb-ui/src/modules/cmdb/views/ci/modules/CiDetail.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmdb-ui/src/modules/cmdb/views/ci/modules/CiDetail.vue b/cmdb-ui/src/modules/cmdb/views/ci/modules/CiDetail.vue index 84af7f3..c9abc1f 100644 --- a/cmdb-ui/src/modules/cmdb/views/ci/modules/CiDetail.vue +++ b/cmdb-ui/src/modules/cmdb/views/ci/modules/CiDetail.vue @@ -276,15 +276,16 @@ export default { }, mergeRowMethod({ row, _rowIndex, column, visibleData }) { const fields = ['created_at', 'username'] - const cellValue = row[column.property] - if (cellValue && fields.includes(column.property)) { + const cellValue1 = row['created_at'] + const cellValue2 = row['username'] + if (cellValue1 && cellValue2 && fields.includes(column.property)) { const prevRow = visibleData[_rowIndex - 1] let nextRow = visibleData[_rowIndex + 1] - if (prevRow && prevRow[column.property] === cellValue) { + if (prevRow && prevRow['created_at'] === cellValue1 && prevRow['username'] === cellValue2) { return { rowspan: 0, colspan: 0 } } else { let countRowspan = 1 - while (nextRow && nextRow[column.property] === cellValue) { + while (nextRow && nextRow['created_at'] === cellValue1 && nextRow['username'] === cellValue2) { nextRow = visibleData[++countRowspan + _rowIndex] } if (countRowspan > 1) {