From c62724a2cdbafa3c660538955acbedafa5a01871 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 01 六月 2024 15:25:21 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/mob/modalconfig/index.jsx | 98 +----------------------------------------------- 1 files changed, 3 insertions(+), 95 deletions(-) diff --git a/src/mob/modalconfig/index.jsx b/src/mob/modalconfig/index.jsx index 803af96..8ef83d0 100644 --- a/src/mob/modalconfig/index.jsx +++ b/src/mob/modalconfig/index.jsx @@ -38,7 +38,6 @@ originConfig: null, // 鍘熷鑿滃崟 sqlVerifing: false, // sql楠岃瘉 showField: false, // 鏄剧ず琛ㄥ崟瀛楁鍊� - standardform: null, saving: false } @@ -59,7 +58,6 @@ componentDidMount () { window.GLOB.formId = '' - MKEmitter.addListener('submitStyle', this.getStyle) MKEmitter.addListener('completeSave', this.completeSave) } @@ -70,30 +68,11 @@ this.setState = () => { return } - MKEmitter.removeListener('submitStyle', this.getStyle) MKEmitter.removeListener('completeSave', this.completeSave) } completeSave = () => { this.setState({saving: false}) - } - - getStyle = (comIds, style) => { - const { config } = this.state - - if (comIds[0] !== 'form') return - - let Index = config.fields.findIndex(n => n.uuid === comIds[1]) - - if (Index === -1) return - - let _config = fromJS(config).toJS() - - _config.fields[Index].style = style - - this.setState({ - config: _config - }) } /** @@ -127,89 +106,18 @@ handleForm = (_card) => { const { componentConfig, btn } = this.props const { config } = this.state + let card = fromJS(_card).toJS() - let _inputfields = [] - let _tabfields = [] - let _linkableFields = [] - let _linksupFields = [] - let standardform = null - let index = null - - config.fields.forEach((item, i) => { - if (card.uuid === item.uuid) { - index = i - } - - if (!item.field || card.field === item.field) return - - if (['text', 'number', 'textarea', 'color'].includes(item.type)) { - _inputfields.push({ - field: item.field, - label: item.label - }) - } - if (item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) { - _tabfields.push({ - field: item.field, - label: item.label - }) - } - - if (item.type === 'switch' || item.type === 'check') { - _linksupFields.push({ - field: item.field, - label: item.label - }) - } - - if (!['select', 'link', 'radio', 'checkcard'].includes(item.type)) return - - _linksupFields.push({ - field: item.field, - label: item.label - }) - - if (item.type === 'checkcard' && item.multiple === 'true') return - - _linkableFields.push({ - field: item.field, - label: item.label + '-琛ㄥ崟' - }) - }) - - if (index !== null) { - if (index === 0) { - standardform = config.fields[index + 1] || null - } else { - standardform = config.fields[index - 1] || null - } - } let columns = componentConfig.columns if (btn.$sub) { columns = componentConfig.subColumns || [] } - let _fields = _linkableFields.map(cell => cell.field) - columns.forEach(col => { - if (col.field && !_fields.includes(col.field)) { - _linkableFields.push({ - field: col.field, - label: col.label + '-鏄剧ず鍒�' - }) - } - }) - - if (card.linkSubField && card.linkSubField.length > 0) { - let fields = _inputfields.map(item => item.field) - card.linkSubField = card.linkSubField.filter(item => fields.includes(item)) - } - this.setState({ - standardform, visible: true, card: card, - formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields, columns) + formlist: getModalForm(card, config.fields, columns) }) } @@ -488,7 +396,7 @@ card={card} formlist={this.state.formlist} inputSubmit={this.handleSubmit} - standardform={this.state.standardform} + fields={config.fields} wrappedComponentRef={(inst) => this.formRef = inst} /> </Modal> -- Gitblit v1.8.0