From a94b0a4d15b26ecf8fe99f0a1c3e60d60b97766d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 15 八月 2023 14:22:03 +0800
Subject: [PATCH] 2023-08-15

---
 src/menu/components/table/base-table/index.jsx |   52 +++++++++++++++++-----------------------------------
 1 files changed, 17 insertions(+), 35 deletions(-)

diff --git a/src/menu/components/table/base-table/index.jsx b/src/menu/components/table/base-table/index.jsx
index 30ad6c2..653881d 100644
--- a/src/menu/components/table/base-table/index.jsx
+++ b/src/menu/components/table/base-table/index.jsx
@@ -99,39 +99,6 @@
     MKEmitter.removeListener('completeSave', this.completeSave)
   }
 
-  // updateFix = (card) => {
-  //   let fixs = {}
-
-  //   card.cols.forEach(col => {
-  //     if (!col.field) return
-  //     if (col.postfix || col.prefix) {
-  //       fixs[col.field] = col
-  //     }
-  //   })
-
-  //   card.cols.forEach(col => {
-  //     if (col.type === 'custom') {
-  //       col.elements.forEach(cell => {
-  //         if (cell.datatype === 'dynamic') {
-  //           cell.height = ''
-  //           cell.innerHeight = 'auto'
-
-  //           if (fixs[cell.field]) {
-  //             if (!cell.prefix && fixs[cell.field].prefix) {
-  //               cell.prefix = fixs[cell.field].prefix
-  //             }
-  //             if (!cell.postfix && fixs[cell.field].postfix) {
-  //               cell.postfix = fixs[cell.field].postfix
-  //             }
-  //           }
-  //         }
-  //       })
-  //     }
-  //   })
-
-  //   return card
-  // }
-
   completeSave = () => {
     const { card } = this.state
 
@@ -255,8 +222,13 @@
     let _actions = [...action]
 
     cols.forEach(col => {
-      if (col.type !== 'action') return
-      _actions.push(...col.elements)
+      if (col.type === 'custom') {
+        col.elements.forEach(cell => {
+          if (cell.eleType !== 'button') return
+
+          _actions.push(cell)
+        })
+      }
     })
 
     return getWrapForm(wrap, _actions, columns)
@@ -275,6 +247,8 @@
     res.drawerPlacement = card.wrap.drawerPlacement || 'right'
     res.searchRatio = card.wrap.searchRatio || 6
     res.searchLwidth = card.wrap.searchLwidth !== undefined ? card.wrap.searchLwidth : 33.3
+    res.borderRadius = card.wrap.borderRadius || 0
+    res.resetContrl = card.wrap.resetContrl || 'init'
 
     this.updateComponent({...card, wrap: res})
   }
@@ -334,6 +308,14 @@
       config.absFields = null
     }
 
+    if (!config.setting.primaryKey && config.columns.length > 0) {
+      config.columns.forEach(col => {
+        if (col.field.toLowerCase() === 'id') {
+          config.setting.primaryKey = col.field
+        }
+      })
+    }
+
     this.updateComponent(config)
   }
 

--
Gitblit v1.8.0