Browse Source

Merge pull request #7217 from Naruto-kyun/patch-2

Fix change visibility of multiple header with same index
文翼 1 year ago
parent
commit
f94b9136f4
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/utils/index.js

+ 8 - 1
src/utils/index.js

@@ -300,7 +300,14 @@ export default {
           let colspan = 0
 
           for (let i = r.colspanIndex; i < r.colspanIndex + r.colspanGroup; i++) {
-            const column = allColumns.find(col => col.fieldIndex === i)
+            const underColumns = allColumns.filter(col => col.fieldIndex === i)
+            const column = underColumns[underColumns.length - 1]
+
+            if (underColumns.length > 1) {
+              for (let j = 0; j < underColumns.length - 1; j++) {
+                underColumns[j].visible = column.visible
+              }
+            }
 
             if (column.visible) {
               colspan++