| | |
| | | value: 'false', |
| | | text: this.state.dict['header.form.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'required', |
| | | label: this.state.dict['header.form.field.required'], |
| | | initVal: card.required || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: this.state.dict['header.form.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: this.state.dict['header.form.false'] |
| | | }] |
| | | } |
| | | ] |
| | | }) |
| | |
| | | handleSubmit = () => { |
| | | this.formRef.handleConfirm().then(res => { |
| | | let _config = JSON.parse(JSON.stringify(this.state.config)) |
| | | |
| | | console.log(res) |
| | | if ((res.type === 'select' || res.type === 'link') && res.resourceType === '1') { |
| | | let sql = 'select ' + res.valueField + ',' + res.valueText + ' from (' + res.dataSource + ')' |
| | | if (res.orderBy) { |
| | |
| | | res.dataSourceSql = Utils.formatOptions(sql) |
| | | } |
| | | |
| | | _config.fields = _config.fields.map(item => { |
| | | if (item.uuid === res.uuid) { |
| | | return res |
| | | } else { |
| | | return item |
| | | } |
| | | }) |
| | | if (_config.groups.length > 0) { |
| | | _config.groups.forEach(group => { |
| | | group.sublist = group.sublist.map(item => { |
| | | if (item.uuid === res.uuid) { |
| | | return res |
| | | } else { |
| | | return item |
| | | } |
| | | }) |
| | | }) |
| | | } else { |
| | | _config.fields = _config.fields.map(item => { |
| | | if (item.uuid === res.uuid) { |
| | | return res |
| | | } else { |
| | | return item |
| | | } |
| | | }) |
| | | } |
| | | |
| | | _config.fields = _config.fields.filter(item => !item.origin) |
| | | |
| | | this.setState({ |
| | |
| | | cancelText: this.state.dict['header.cancel'], |
| | | onOk() { |
| | | let _config = JSON.parse(JSON.stringify(_this.state.config)) |
| | | _config.fields = _config.fields.filter(item => { |
| | | if (item.uuid === card.uuid) { |
| | | return false |
| | | } else { |
| | | return true |
| | | } |
| | | }) |
| | | |
| | | if (_config.groups.length > 0) { |
| | | _config.groups.forEach(group => { |
| | | group.sublist = group.sublist.filter(item => !(item.uuid === card.uuid)) |
| | | }) |
| | | } else { |
| | | _config.fields = _config.fields.filter(item => !(item.uuid === card.uuid)) |
| | | } |
| | | |
| | | _this.setState({ |
| | | config: _config, |
| | | loading: true |
| | |
| | | valueText: '', |
| | | orderBy: '', |
| | | orderType: 'asc', |
| | | readonly: 'false' |
| | | readonly: 'false', |
| | | required: 'false' |
| | | } |
| | | }) |
| | | _config.groups[_config.groups.length - 1].sublist = [..._config.groups[_config.groups.length - 1].sublist, ..._additems] |
| | |
| | | valueText: '', |
| | | orderBy: '', |
| | | orderType: 'asc', |
| | | readonly: 'false' |
| | | readonly: 'false', |
| | | required: 'false' |
| | | } |
| | | |
| | | items.push(newcard) |