From 76427d51a079a5fd1f45bf7188249e7a4647ae05 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 14 九月 2020 10:37:25 +0800
Subject: [PATCH] 2020-09-14

---
 src/templates/sharecomponent/tablecomponent/index.jsx |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/src/templates/sharecomponent/tablecomponent/index.jsx b/src/templates/sharecomponent/tablecomponent/index.jsx
index 543f4ee..72431bb 100644
--- a/src/templates/sharecomponent/tablecomponent/index.jsx
+++ b/src/templates/sharecomponent/tablecomponent/index.jsx
@@ -59,10 +59,9 @@
     }
 
     param.LText = Utils.formatOptions(param.LText)
-    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
+    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
     param.secretkey = Utils.encrypt(param.LText, param.timestamp)
-
-    param.open_key = Utils.encrypt(param.secretkey, param.timestamp, true) // 浜戠鏁版嵁楠岃瘉
+    param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 浜戠鏁版嵁楠岃瘉
 
     Api.getSystemConfig(param).then(res => {
       if (res.status) {
@@ -97,23 +96,19 @@
             columns: res.FDName.map(item => {
               let _type = item.FieldType.toLowerCase()
               let _decimal = 0
+              let _length = 50
               if (/^nvarchar/.test(_type)) {
+                try { // 瀛樺湪max
+                  _length = +_type.match(/\d+/)[0] || 50
+                } catch {
+                  _length = 2048
+                }
                 _type = 'text'
               } else if (/^int/.test(_type)) {
                 _type = 'number'
               } else if (/^decimal/.test(_type)) {
                 _decimal = _type.split(',')[1]
                 _decimal = parseInt(_decimal)
-                if (_decimal > 4) {
-                  _decimal = 4
-                }
-                _type = 'number'
-              } else if (/^decimal/.test(_type)) {
-                _decimal = _type.split(',')[1]
-                _decimal = parseInt(_decimal)
-                if (_decimal > 4) {
-                  _decimal = 4
-                }
                 _type = 'number'
               } else if (/^datetime/.test(_type)) {
                 _type = 'datetime'
@@ -128,7 +123,8 @@
                 label: item.FieldDec,
                 type: _type,
                 datatype: _type,
-                decimal: _decimal
+                decimal: _decimal,
+                length: _length,
               }
             })
           }
@@ -173,7 +169,9 @@
             columns: res.FDName.map(item => {
               let _type = item.FieldType.toLowerCase()
               let _decimal = 0
+              let _length = 50
               if (/^nvarchar/.test(_type)) {
+                _length = +_type.match(/\d+/)[0] || 50
                 _type = 'text'
               } else if (/^int/.test(_type)) {
                 _type = 'number'
@@ -194,7 +192,8 @@
                 label: item.FieldDec,
                 type: _type,
                 datatype: _type,
-                decimal: _decimal
+                decimal: _decimal,
+                length: _length
               }
             })
           }

--
Gitblit v1.8.0