From 343e35d61733028e884bc60963183983154ca093 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 03 十二月 2019 09:14:48 +0800
Subject: [PATCH] 2019-12-03-01

---
 src/tabviews/commontable/index.jsx |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx
index 027f7fb..f20d6af 100644
--- a/src/tabviews/commontable/index.jsx
+++ b/src/tabviews/commontable/index.jsx
@@ -69,10 +69,36 @@
 
       let _search = Utils.mainjointsearchkey(config.search)
       let _arrField = []
+      let _columns = []
+      let _hideCol = []
+      let colMap = new Map()
 
       config.columns.forEach(col => {
         if (col.field) {
           _arrField.push(col.field)
+        }
+        if (col.type === 'colspan' && col.sublist) { // 绛涢�夐殣钘忓垪
+          _hideCol = _hideCol.concat(col.sublist)
+        } else if (col.Hide === 'true') {
+          _hideCol.push(col.uuid)
+        }
+        colMap.set(col.uuid, col)
+      })
+
+      config.columns.forEach(col => {
+        if (_hideCol.includes(col.uuid)) return
+        if (col.type === 'colspan' && col.sublist) {
+          let _col = JSON.parse(JSON.stringify(col))
+          let subColumn = []
+          _col.sublist.forEach(sub => {
+            if (colMap.has(sub)) {
+              subColumn.push(colMap.get(sub))
+            }
+          })
+          _col.subColumn = subColumn
+          _columns.push(_col)
+        } else {
+          _columns.push(col)
         }
       })
 
@@ -81,7 +107,7 @@
         setting: config.setting,
         searchlist: config.search,
         actions: config.action,
-        columns: config.columns,
+        columns: _columns,
         arr_field: _arrField.join(','),
         search: _search ? 'where (' + _search + ')' : '',
         orderColumn: config.setting.orderColumn,

--
Gitblit v1.8.0