From 1b60547cb25f5c0a4371e5be0517adf092f2dc62 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 28 一月 2023 16:08:21 +0800
Subject: [PATCH] 2023-01-28

---
 src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
index 5973e2d..6224ab7 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
@@ -249,7 +249,6 @@
       col.required = col.required || 'true'
       col.type = col.type || 'Nvarchar(50)'
       col.import = col.import || 'true'
-      col.required = col.required || 'true'
 
       if (col.type === 'text' || col.type === 'image') {
         col.type = 'Nvarchar(50)'
@@ -365,7 +364,7 @@
 
     let _columns = JSON.parse(JSON.stringify(verify.columns))
 
-    let _cols = _columns.map(col => col.Column )
+    let _cols = _columns.map(col => col.Column)
 
     columns.forEach(col => {
       if (col.field && !_cols.includes(col.field)) {
@@ -455,6 +454,13 @@
     const { verify } = this.state
 
     columns = columns.map(col => {
+      col.type = col.type || 'Nvarchar(50)'
+      if (col.type === 'text' || col.type === 'image') {
+        col.type = 'Nvarchar(50)'
+      } else if (col.type === 'number') {
+        col.type = 'Decimal(18,2)'
+      }
+
       if (/^Nvarchar/ig.test(col.type)) {
         col.limit = col.type.match(/\d+/) ? col.type.match(/\d+/)[0] : '20000'
       } else if (/^Decimal/ig.test(col.type)) {
@@ -466,6 +472,9 @@
         col.limit = ''
       }
 
+      col.required = col.required || 'true'
+      col.import = col.import || 'true'
+
       return col
     })
 

--
Gitblit v1.8.0