From 26d0fa42ea8c63a87e8ef93d0915f75f46fb1f9c Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 24 三月 2022 11:09:53 +0800
Subject: [PATCH] 2022-03-24

---
 src/templates/sharecomponent/fieldscomponent/index.jsx |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/src/templates/sharecomponent/fieldscomponent/index.jsx b/src/templates/sharecomponent/fieldscomponent/index.jsx
index 85b0013..26c4cf0 100644
--- a/src/templates/sharecomponent/fieldscomponent/index.jsx
+++ b/src/templates/sharecomponent/fieldscomponent/index.jsx
@@ -126,7 +126,6 @@
           initval: initval,
           type: item.type,
           resourceType: '0',
-          setAll: 'false',
           options: [],
           orderType: 'asc',
           match: _match,
@@ -189,7 +188,6 @@
           initval: item.type === 'number' ? 0 : '',
           type: item.type,
           resourceType: '0',
-          setAll: 'false',
           span: span,
           labelwidth: 33.3,
           options: [],
@@ -200,6 +198,27 @@
           required: 'true'
         }
 
+        if (item.type === 'text' && item.length >= 256) {
+          newcard.type = 'textarea'
+          newcard.fieldlength = item.length
+          if (lastItem && lastItem.type === newcard.type) {
+            newcard.span = lastItem.span
+            newcard.labelwidth = lastItem.labelwidth
+          } else if (lastItem) {
+            newcard.span = 24
+            if (lastItem.span === 12) {
+              newcard.labelwidth = 16.2
+            } else if (lastItem.span === 8) {
+              newcard.labelwidth = 10.5
+            } else if (lastItem.span === 8) {
+              newcard.labelwidth = 7.7
+            }
+          } else {
+            newcard.span = 24
+            newcard.labelwidth = 16.2
+          }
+        }
+
         items.push(newcard)
         keys.push(item.field.toLowerCase())
       })

--
Gitblit v1.8.0