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/formtabconfig/index.jsx | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/templates/formtabconfig/index.jsx b/src/templates/formtabconfig/index.jsx index 6ccf8df..ef2cbd8 100644 --- a/src/templates/formtabconfig/index.jsx +++ b/src/templates/formtabconfig/index.jsx @@ -426,6 +426,7 @@ const { menu } = this.props const { config } = this.state let _inputfields = [] + let _tabfields = [] let _linkableFields = [] let _linksupFields = [{ value: '', @@ -435,12 +436,12 @@ // 璁剧疆涓嬫媺鑿滃崟鍙叧鑱斿瓧娈� 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') - _formfields = [..._formfields, ...suplist] + _formfields = [..._formfields, ...group.sublist] }) + + _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: '鍘熻〃鍗�'}) if (card.linkSubField && card.linkSubField.length > 0) { let fields = _inputfields.map(item => item.field) @@ -451,6 +452,7 @@ uniq.set(card.field, true) _formfields.forEach(item => { + if (item.type !== 'select' && item.type !== 'link') return if (item.field && !uniq.has(item.field)) { uniq.set(item.field, true) @@ -481,7 +483,7 @@ this.setState({ modaltype: 'search', card: card, - formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields, false).map(item => { + formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields, false).map(item => { if (item.key === 'type') { item.options = item.options.filter(option => !['switch', 'checkbox', 'radio', 'checkcard', 'hint'].includes(option.value)) } -- Gitblit v1.8.0