From 306eb5f035302baef95995437e2dc735110b6536 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 23 二月 2023 17:38:37 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/mob/modalconfig/index.jsx | 34 ++++++++++++++-------------------- 1 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/mob/modalconfig/index.jsx b/src/mob/modalconfig/index.jsx index 97d305d..570c637 100644 --- a/src/mob/modalconfig/index.jsx +++ b/src/mob/modalconfig/index.jsx @@ -127,7 +127,7 @@ * 3銆佽缃紪杈戝弬鏁伴」-formlist */ handleForm = (_card) => { - const { componentConfig } = this.props + const { componentConfig, btn } = this.props const { config } = this.state let card = fromJS(_card).toJS() let _inputfields = [] @@ -140,35 +140,28 @@ let index = null uniq.set(card.field, true) - let _inputIndex = 1 - let _tabIndex = 1 - let _linkIndex = 1 config.fields.forEach((item, i) => { if (card.uuid === item.uuid) { index = i } - let label = `${item.field || ''}锛�${item.label}锛塦 - if (['text', 'number', 'textarea', 'color'].includes(item.type) && card.field !== item.field) { _inputfields.push({ field: item.field, - label: _inputIndex + '銆�' + label + label: item.label }) - _inputIndex++ } if (card.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) { _tabfields.push({ field: item.field, - label: _tabIndex + '銆�' + label + label: item.label }) - _tabIndex++ } if (item.type === 'switch') { _linksupFields.push({ field: item.field, - label: _linkIndex + '銆�' + label + label: item.label }) } @@ -179,17 +172,14 @@ _linkableFields.push({ field: item.field, - label: _linkIndex + '銆�' + item.label + ' (琛ㄥ崟)' + label: item.label + '-琛ㄥ崟' }) _linksupFields.push({ field: item.field, - label: _linkIndex + '銆�' + label + label: item.label }) - _linkIndex++ } }) - - _tabfields.unshift({field: '', label: '鍘熻〃鍗�'}) if (index !== null) { if (index === 0) { @@ -199,15 +189,19 @@ } } - componentConfig.columns.forEach(col => { + let columns = componentConfig.columns + if (btn.$sub) { + columns = componentConfig.subColumns || [] + } + + columns.forEach(col => { if (col.field && !uniq.has(col.field)) { uniq.set(col.field, true) _linkableFields.push({ field: col.field, - label: _linkIndex + '銆�' + col.label + ' (鏄剧ず鍒�)' + label: col.label + '-鏄剧ず鍒�' }) - _linkIndex++ } }) @@ -220,7 +214,7 @@ standardform, visible: true, card: card, - formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields, componentConfig.columns) + formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields, columns) }) } -- Gitblit v1.8.0