From da64ab0923bf8817fc8599a6e37b953ce38f64c8 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 27 八月 2023 18:37:36 +0800 Subject: [PATCH] 2023-08-27 --- src/menu/components/form/tab-form/index.jsx | 48 +++++++++--------------------------------------- 1 files changed, 9 insertions(+), 39 deletions(-) diff --git a/src/menu/components/form/tab-form/index.jsx b/src/menu/components/form/tab-form/index.jsx index f3dd1bd..18b4656 100644 --- a/src/menu/components/form/tab-form/index.jsx +++ b/src/menu/components/form/tab-form/index.jsx @@ -24,7 +24,6 @@ const FormAction = asyncComponent(() => import('../formaction')) const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent')) -const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent')) const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent')) const { confirm } = Modal @@ -91,26 +90,6 @@ }] } - if (card.config) { - let config = fromJS(card.config).toJS() - - _card.wrap = config.wrap - _card.wrap.name = card.name - _card.style = config.style - - _card.setting = config.setting - _card.columns = config.columns - _card.scripts = config.scripts - - _card.subcards = config.subcards.map(scard => { - scard.uuid = Utils.getuuid() - scard.fields = scard.fields.map(elem => { - elem.uuid = Utils.getuuid() - return elem - }) - return scard - }) - } this.setState({ group: _card.subcards[0] || null }) @@ -441,25 +420,22 @@ let _linkableFields = [] let _linksupFields = [] let standardform = null - - let uniq = new Map() let index = null - uniq.set(_form.field, true) group.fields.forEach((item, i) => { if (_form.uuid === item.uuid) { index = i } - if (!item.field) return + if (!item.field || _form.field === item.field) return - if (['text', 'number', 'textarea', 'color'].includes(item.type) && _item.field !== item.field) { + if (['text', 'number', 'textarea', 'color'].includes(item.type)) { _inputfields.push({ field: item.field, label: item.label }) } - if (_form.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) { + if (item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) { _tabfields.push({ field: item.field, label: item.label @@ -482,14 +458,10 @@ if (item.type === 'multiselect' || (item.type === 'checkcard' && item.multiple === 'true')) return - if (!uniq.has(item.field)) { - uniq.set(item.field, true) - - _linkableFields.push({ - field: item.field, - label: item.label + '-琛ㄥ崟' - }) - } + _linkableFields.push({ + field: item.field, + label: item.label + '-琛ㄥ崟' + }) }) if (index !== null) { @@ -500,10 +472,9 @@ } } + let _fields = _linkableFields.map(cell => cell.field) card.columns.forEach(col => { - if (col.field && !uniq.has(col.field)) { - uniq.set(col.field, true) - + if (col.field && !_fields.includes(col.field)) { _linkableFields.push({ field: col.field, label: col.label + '-鏄剧ず鍒�' @@ -744,7 +715,6 @@ <CopyComponent type="tabform" card={card}/> <PasteComponent config={card} options={['formgroup', 'simpleform']} updateConfig={this.pasteForm} /> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> - <UserComponent config={card}/> <DeleteOutlined className="close" title="鍒犻櫎缁勪欢" onClick={() => this.props.deletecomponent(card.uuid)} /> {card.wrap.datatype !== 'static' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : null} {card.wrap.datatype === 'static' ? <SettingOutlined style={{color: '#eeeeee', cursor: 'not-allowed'}}/> : null} -- Gitblit v1.8.0