From f4b9504cad034ddcdef21c2081d14a4984fcd2d3 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 15 七月 2024 17:14:48 +0800
Subject: [PATCH] 2024-07-15

---
 src/menu/components/table/base-table/index.jsx |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/menu/components/table/base-table/index.jsx b/src/menu/components/table/base-table/index.jsx
index 653881d..4b4394e 100644
--- a/src/menu/components/table/base-table/index.jsx
+++ b/src/menu/components/table/base-table/index.jsx
@@ -219,7 +219,7 @@
   getWrapForms = () => {
     const { wrap, action, columns, cols } = this.state.card
 
-    let _actions = [...action]
+    let _actions = []
 
     cols.forEach(col => {
       if (col.type === 'custom') {
@@ -231,7 +231,7 @@
       }
     })
 
-    return getWrapForm(wrap, _actions, columns)
+    return getWrapForm(wrap, _actions, columns, action)
   }
 
   updateWrap = (res) => {
@@ -259,12 +259,23 @@
     config.cols.forEach(col => {
       if (!col.field) return
       if (['text', 'picture', 'video', 'textarea'].includes(col.type)) {
+        let datatype = `Nvarchar(${col.fieldlength || 50})`
+        let type = 'text'
+
+        if (col.type === 'text') {
+          if (col.textFormat === 'YYYY-MM-DD') {
+            datatype = 'date'
+          } else if (col.textFormat === 'YYYY-MM-DD HH:mm:ss') {
+            datatype = 'datetime'
+          }
+        }
+
         config.columns.push({
-          datatype: `Nvarchar(${col.fieldlength || 50})`,
+          datatype: datatype,
           field: col.field,
           fieldlength: col.fieldlength || 50,
           label: col.label,
-          type: 'text',
+          type: type,
           uuid: col.uuid
         })
       } else if (col.type === 'link') {

--
Gitblit v1.8.0