From 3ecc98d6ba3fe31b9694bad348cbbb08c1b0dd81 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 22 五月 2024 22:52:02 +0800 Subject: [PATCH] 2024-05-22 --- src/menu/components/form/step-form/index.jsx | 31 +++++-------------------------- 1 files changed, 5 insertions(+), 26 deletions(-) diff --git a/src/menu/components/form/step-form/index.jsx b/src/menu/components/form/step-form/index.jsx index 8704f5e..700588a 100644 --- a/src/menu/components/form/step-form/index.jsx +++ b/src/menu/components/form/step-form/index.jsx @@ -42,8 +42,7 @@ visible: false, editform: null, formlist: null, - sqlVerifing: false, - standardform: null + sqlVerifing: false } UNSAFE_componentWillMount () { @@ -447,23 +446,17 @@ * @description 琛ㄥ崟缂栬緫 */ handleForm = (_item) => { - const { card, group, appType } = this.state + const { card, group } = this.state let _form = fromJS(_item).toJS() let _inputfields = [] let _tabfields = [] let _linkableFields = [] let _linksupFields = [] - let standardform = null - let index = null group.fields.forEach((item, i) => { - if (_form.uuid === item.uuid) { - index = i - } - if (!item.field || _form.field === item.field) return - if (['text', 'number', 'textarea', 'color'].includes(item.type)) { + if (['text', 'number', 'textarea', 'select'].includes(item.type)) { _inputfields.push({ field: item.field, label: item.label @@ -499,14 +492,6 @@ }) }) - if (index !== null) { - if (index === 0) { - standardform = group.fields[index + 1] || null - } else { - standardform = group.fields[index - 1] || null - } - } - let _fields = _linkableFields.map(cell => cell.field) card.columns.forEach(col => { if (col.field && !_fields.includes(col.field)) { @@ -522,13 +507,7 @@ _form.linkSubField = _form.linkSubField.filter(item => fields.includes(item)) } - if (appType !== 'mob' && !_form.span && standardform && standardform.span) { - _form.span = standardform.span - _form.labelwidth = standardform.labelwidth - } - this.setState({ - standardform, visible: true, editform: _form, formlist: getModalForm(_form, _inputfields, _tabfields, _linkableFields, _linksupFields, card.columns) @@ -544,7 +523,7 @@ handleSubmit = () => { let _config = fromJS(this.state.group).toJS() - this.formRef.handleConfirm(_config.fields).then(res => { + this.formRef.handleConfirm().then(res => { _config.fields = _config.fields.map(item => { delete item.focus @@ -803,7 +782,7 @@ card={this.state.editform} formlist={this.state.formlist} inputSubmit={this.handleSubmit} - standardform={this.state.standardform} + fields={group.fields} wrappedComponentRef={(inst) => this.formRef = inst} /> </Modal> -- Gitblit v1.8.0