From f0bf8c399c354c22227f8f1a76ed806098db59c0 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 21 五月 2024 16:51:02 +0800
Subject: [PATCH] 2024-05-21

---
 src/menu/components/table/normal-table/index.jsx |   56 +++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 37 insertions(+), 19 deletions(-)

diff --git a/src/menu/components/table/normal-table/index.jsx b/src/menu/components/table/normal-table/index.jsx
index 6bdefb2..d53420d 100644
--- a/src/menu/components/table/normal-table/index.jsx
+++ b/src/menu/components/table/normal-table/index.jsx
@@ -278,11 +278,11 @@
   }
 
   getWrapForms = () => {
-    const { wrap, action, columns, cols } = this.state.card
+    const { card } = this.state
 
     let _actions = []
 
-    cols.forEach(col => {
+    card.cols.forEach(col => {
       if (col.type === 'custom') {
         col.elements.forEach(cell => {
           if (cell.eleType !== 'button') return
@@ -292,7 +292,7 @@
       }
     })
 
-    return getWrapForm(wrap, _actions, columns, action)
+    return getWrapForm(card.wrap, _actions, card.columns, card.action, card.supNodes || [], card.uuid)
   }
 
   updateWrap = (res) => {
@@ -311,26 +311,44 @@
     res.borderRadius = card.wrap.borderRadius || 0
     res.resetContrl = card.wrap.resetContrl || 'init'
 
-    this.updateComponent({...card, wrap: res})
+    let _card = {...card, wrap: res}
+
+    if (res.supNodes) {
+      _card.supNodes = res.supNodes
+      _card.supNodes = _card.supNodes.map(item => {
+        item.componentId = item.nodes[item.nodes.length - 1]
+        return item
+      })
+
+      delete res.supNodes
+    } else {
+      delete _card.supNodes
+    }
+
+    this.updateComponent(_card)
   }
 
   updatecolumn = (config) => {
     config.absFields = []
-    config.cols.forEach(col => {
-      if (col.type === 'number') {
-        if (col.format === 'abs') {
-          config.absFields.push(col.field)
-        }
-      } else if (col.type === 'colspan' && col.subcols) {
-        col.subcols.forEach(scol => {
-          if (scol.type === 'number') {
-            if (scol.format === 'abs') {
-              config.absFields.push(scol.field)
-            }
+    config.hasExtend = false
+    config.parCtrl = false
+    let mapCol = (cols) => {
+      cols.forEach(col => {
+        if (col.type === 'number') {
+          if (col.format === 'abs') {
+            config.absFields.push(col.field)
           }
-        })
-      }
-    })
+        } else if (col.type === 'extend') {
+          config.hasExtend = true
+          if (col.supField) {
+            config.parCtrl = true
+          }
+        } else if (col.type === 'colspan' && col.subcols) {
+          mapCol(col.subcols)
+        }
+      })
+    }
+    mapCol(config.cols)
 
     if (config.absFields.length) {
       config.absFields = Array.from(new Set(config.absFields))
@@ -389,7 +407,7 @@
         </Popover>
         {appType !== 'mob' ? <SearchComponent config={card} updatesearch={this.updateComponent}/> : null}
         <ActionComponent config={card} setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/>
-        <ColumnComponent config={card} updatecolumn={this.updateComponent}/>
+        <ColumnComponent config={card} updatecolumn={this.updatecolumn}/>
         <div className="component-name">
           <div className="center">
             <div className="title" onDoubleClick={() => {

--
Gitblit v1.8.0