| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | const { data, BData } = this.props |
| | | let action = fromJS(this.props.action).toJS() |
| | | const { data, BData, action } = this.props |
| | | |
| | | let datatype = {} |
| | | let readtype = {} |
| | |
| | | let intercepts = [] |
| | | let _inputfields = [] |
| | | |
| | | if (action.groups.length > 0) { |
| | | action.groups.forEach(group => { |
| | | if (action.groups && action.groups.length > 0) { |
| | | let groups = fromJS(action.groups).toJS() |
| | | groups.forEach(group => { |
| | | if (group.sublist.length === 0) return |
| | | |
| | | if (!group.default) { |
| | |
| | | formlist.push(...group.sublist) |
| | | }) |
| | | } else { |
| | | formlist = action.fields |
| | | formlist = fromJS(action.fields).toJS() |
| | | } |
| | | |
| | | let linkFields = {} // 关联菜单 |
| | |
| | | |
| | | if (item.type === 'linkMain') { |
| | | newval = BData && BData[item.field] ? BData[item.field] : '' |
| | | } else if (_readin && !/^date/.test(item.type) && this.props.data && this.props.data.hasOwnProperty(item.field)) { |
| | | newval = this.props.data[item.field] |
| | | } else if (_readin && !/^date/.test(item.type) && data && data.hasOwnProperty(item.field)) { |
| | | newval = data[item.field] |
| | | } else if (item.type === 'date') { // 时间搜索 |
| | | if (_readin && this.props.data && this.props.data.hasOwnProperty(item.field)) { |
| | | newval = this.props.data[item.field] |
| | | if (_readin && data && data.hasOwnProperty(item.field)) { |
| | | newval = data[item.field] |
| | | } |
| | | if (newval) { |
| | | newval = moment(newval, 'YYYY-MM-DD') |
| | |
| | | newval = null |
| | | } |
| | | } else if (item.type === 'datemonth') { |
| | | if (_readin && this.props.data && this.props.data.hasOwnProperty(item.field)) { |
| | | newval = this.props.data[item.field] |
| | | if (_readin && data && data.hasOwnProperty(item.field)) { |
| | | newval = data[item.field] |
| | | } |
| | | if (newval) { |
| | | newval = moment(newval, 'YYYY-MM') |
| | |
| | | newval = null |
| | | } |
| | | } else if (item.type === 'datetime') { |
| | | if (_readin && this.props.data && this.props.data.hasOwnProperty(item.field)) { |
| | | newval = this.props.data[item.field] |
| | | if (_readin && data && data.hasOwnProperty(item.field)) { |
| | | newval = data[item.field] |
| | | } |
| | | if (newval) { |
| | | newval = moment(newval, 'YYYY-MM-DD HH:mm:ss') |
| | |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} className="ant-advanced-search-form main-form-field" id="main-form-box"> |
| | | <Form {...formItemLayout} className="main-form-field" id="main-form-box"> |
| | | <Row className={'cols' + cols} gutter={24}>{this.getFields()}</Row> |
| | | </Form> |
| | | ) |