| | |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'method', |
| | | label: this.state.dict['header.form.request.method'], |
| | | initVal: card.method || 'POST', |
| | | required: true, |
| | | options: [{ |
| | | MenuID: 'POST', |
| | | text: 'POST' |
| | | }, { |
| | | MenuID: 'GET', |
| | | text: 'GET' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'icon', |
| | | label: this.state.dict['header.form.icon'], |
| | | initVal: card.icon, |
| | |
| | | initVal: card.class, |
| | | required: false, |
| | | options: [] |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'sql', |
| | | label: this.state.dict['header.form.datasource'], |
| | | initVal: card.sql || '', |
| | | required: false |
| | | } |
| | | ] |
| | | }) |
| | |
| | | handleSubmit = () => { |
| | | this.formRef.handleConfirm().then(res => { |
| | | let _config = this.state.config |
| | | let isupdate = false |
| | | |
| | | if (res.type === 'search') { |
| | | if ((res.values.type === 'select' || res.values.type === 'link') && res.values.resourceType === '1') { |
| | |
| | | if (this.state.operaType === 'add') { |
| | | _config[res.type] = _config[res.type].map(item => { |
| | | if (item.uuid === res.values.uuid) { |
| | | isupdate = true |
| | | return res.values |
| | | } else { |
| | | return item |
| | |
| | | } else { |
| | | _config[res.type] = _config[res.type].map(item => { |
| | | if (item.uuid === res.values.uuid) { |
| | | isupdate = true |
| | | return res.values |
| | | } else { |
| | | return item |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (!isupdate) { // 操作不是修改,添加元素至列表 |
| | | _config[res.type].push(res.values) |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | placeholder={this.state.dict['header.form.action.placeholder']} |
| | | handleList={this.handleList} |
| | | handleMenu={this.handleAction} |
| | | copyElement={this.handleAction} |
| | | /> : null |
| | | } |
| | | </div> |