From d59f518f466274b2caeb2e01c10c92deafe7c93b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 09 二月 2022 11:48:29 +0800 Subject: [PATCH] 2022-02-09 --- src/templates/sharecomponent/fieldscomponent/index.jsx | 28 +++++++++++++++++++++++----- 1 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/templates/sharecomponent/fieldscomponent/index.jsx b/src/templates/sharecomponent/fieldscomponent/index.jsx index e0c0088..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, @@ -146,7 +145,7 @@ Hide: 'false', IsSort: item.type === 'picture' ? 'false' : 'true', type: item.type, - Width: 120 + Width: item.type === 'number' ? 80 : 120 } if (item.type === 'number') { @@ -181,16 +180,14 @@ if (lastItem && lastItem.span) { span = lastItem.span } - selectCards.forEach(item => { // 寰幆娣诲姞鏂板瀛楁 let newcard = { uuid: Utils.getuuid(), label: item.label, field: item.field, - initval: '', + initval: item.type === 'number' ? 0 : '', type: item.type, resourceType: '0', - setAll: 'false', span: span, labelwidth: 33.3, options: [], @@ -201,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