| | |
| | | * 3、设置编辑参数项-formlist |
| | | */ |
| | | handleForm = (card) => { |
| | | const { config } = this.state |
| | | let _inputfields = [] |
| | | |
| | | // 设置下拉菜单可关联字段 |
| | | if (config.groups.length > 0) { |
| | | config.groups.forEach(group => { |
| | | let sublist = group.sublist.filter(item => item.type === 'text' || item.type === 'number') |
| | | _inputfields = [..._inputfields, ...sublist] |
| | | }) |
| | | } else { |
| | | _inputfields = config.fields.filter(item => item.type === 'text' || item.type === 'number') |
| | | } |
| | | 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({ |
| | | visible: true, |
| | | card: card, |
| | |
| | | value: 'false', |
| | | text: this.state.dict['header.form.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'linkSubField', |
| | | label: '关联表单', |
| | | initVal: card.linkSubField || [], |
| | | options: _inputfields |
| | | } |
| | | ] |
| | | }) |