| | |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | formlist: PropTypes.any, |
| | | card: PropTypes.object, |
| | | billCodes: PropTypes.array |
| | | card: PropTypes.object |
| | | } |
| | | |
| | | state = { |
| | |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | let formlist = JSON.parse(JSON.stringify(this.props.formlist)) |
| | | console.log(formlist) |
| | | |
| | | let type = formlist.filter(cell => cell.key === 'type')[0].initVal |
| | | let resourceType = formlist.filter(cell => cell.key === 'resourceType')[0].initVal |
| | | let _options = ['label', 'field', 'initval', 'type', 'readonly', 'required'] // 默认显示项 |
| | |
| | | if (type === 'link') { // 关联类型、增加关联字段 |
| | | _options = [..._options, 'linkField'] |
| | | } |
| | | console.log(type) |
| | | if (type === 'funcvar') { |
| | | _options = ['label', 'field', 'linkfield'] |
| | | |
| | | if (type === 'funcvar') { // 设置为函数变量时,不需要其他信息 |
| | | _options = ['label', 'field', 'type'] |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | } |
| | | |
| | | if (value === 'funcvar') { |
| | | _options = ['label', 'field', 'linkfield'] |
| | | _options = ['label', 'field', 'type'] |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | } |
| | | } else if ((values.type === 'multiselect' || values.type === 'select' || values.type === 'link') && values.resourceType === '1') { |
| | | values.options = [] |
| | | } |
| | | |
| | | if (!values.type) { |
| | | values.type = 'funcvar' |
| | | } else if (values.type === 'funcvar') { // 函数变量为只读元素 |
| | | values.readonly = 'true' |
| | | } |
| | | |
| | | if (isvalid) { |
| | | resolve(values) |
| | | } else { |