From f895e8af9e6a393f71fec0dc26fdf1b9b6616cb4 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 11 十二月 2020 18:53:04 +0800 Subject: [PATCH] 2020-12-11 --- src/templates/modalconfig/index.jsx | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx index 10f9a33..5bb6f03 100644 --- a/src/templates/modalconfig/index.jsx +++ b/src/templates/modalconfig/index.jsx @@ -259,6 +259,7 @@ let card = fromJS(_card).toJS() const { config } = this.state let _inputfields = [] + let _tabfields = [] let _linkableFields = [] let _linksupFields = [{ value: '', @@ -269,21 +270,20 @@ // 璁剧疆涓嬫媺鑿滃崟鍙叧鑱斿瓧娈�(涓婄骇涓庝笅绾�) if (config.groups.length > 0) { config.groups.forEach(group => { - let sublist = group.sublist.filter(item => item.type === 'text' || item.type === 'number') - _inputfields = [..._inputfields, ...sublist] - - let suplist = group.sublist.filter(item => item.type === 'select' || item.type === 'link' || item.type === 'radio') - _formfields = [..._formfields, ...suplist] + _formfields = [..._formfields, ...group.sublist] }) } else { - _inputfields = config.fields.filter(item => item.type === 'text' || item.type === 'number') - - _formfields = config.fields.filter(item => item.type === 'select' || item.type === 'link' || item.type === 'radio') + _formfields = config.fields } + + _inputfields = _formfields.filter(item => item.type === 'text' || item.type === 'number') + _tabfields = _formfields.filter(item => card.field !== item.field && ['text', 'number', 'select', 'link'].includes(item.type)) + _tabfields.unshift({field: '', text: '鍘熻〃鍗�'}) let uniq = new Map() uniq.set(card.field, true) _formfields.forEach(item => { + if (item.type !== 'select' && item.type !== 'link' && item.type !== 'radio') return if (item.field && !uniq.has(item.field)) { uniq.set(item.field, true) @@ -341,7 +341,7 @@ this.setState({ visible: true, card: card, - formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields, !!this.props.editTab) + formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields, !!this.props.editTab) }) } -- Gitblit v1.8.0