| | |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | setting: PropTypes.object, // 页面设置 |
| | | formlist: PropTypes.any, // 表单信息 |
| | | card: PropTypes.any, // 按钮信息 |
| | |
| | | formlist: null, // 表单信息 |
| | | requireOptions: [{ |
| | | value: 'notRequired', |
| | | text: this.props.dict['header.form.notRequired'] |
| | | text: '不选择行' |
| | | }, { |
| | | value: 'requiredSgl', |
| | | text: this.props.dict['header.form.requiredSgl'] |
| | | text: '选择单行' |
| | | }, { |
| | | value: 'required', |
| | | text: this.props.dict['header.form.required'] |
| | | text: '选择多行' |
| | | }, { |
| | | value: 'requiredOnce', |
| | | text: this.props.dict['header.form.requiredOnce'] |
| | | text: '多行拼接' |
| | | }], |
| | | insertUpdateOptions: [{ |
| | | value: 'insert', |
| | | text: this.props.dict['header.form.action.insert'] |
| | | text: '添加' |
| | | }, { |
| | | value: 'update', |
| | | text: this.props.dict['header.form.action.update'] |
| | | text: '修改' |
| | | }, { |
| | | value: 'audit', |
| | | text: this.props.dict['header.form.action.audit'] |
| | | text: '审核' |
| | | }], |
| | | deleteOptions: [{ |
| | | value: 'LogicDelete', |
| | |
| | | text: '物理删除' |
| | | }, { |
| | | value: 'custom', |
| | | text: this.props.dict['header.form.custom'] |
| | | text: '自定义' |
| | | }], |
| | | interTypeOptions: [{ |
| | | value: 'system', |
| | | text: this.props.dict['model.interface.system'] |
| | | text: '系统' |
| | | }, { |
| | | value: 'inner', |
| | | text: this.props.dict['model.interface.inner'] |
| | | text: '内部' |
| | | }, { |
| | | value: 'outer', |
| | | text: this.props.dict['model.interface.outer'] |
| | | text: '外部' |
| | | }, { |
| | | value: 'custom', |
| | | text: '自定义' |
| | |
| | | _fieldval.intertype = 'system' |
| | | _fieldval.Ot = 'notRequired' |
| | | |
| | | _fieldval.label = this.props.dict['model.form.excelIn'] |
| | | _fieldval.label = '导入Excel' |
| | | _fieldval.class = 'dgreen' |
| | | this.record.Ot = 'notRequired' |
| | | this.record.label = this.props.dict['model.form.excelIn'] |
| | | this.record.label = '导入Excel' |
| | | this.record.class = 'dgreen' |
| | | } else if (value === 'excelOut') { |
| | | _fieldval.intertype = 'system' |
| | | _fieldval.label = this.props.dict['model.form.excelOut'] |
| | | _fieldval.label = '导出Excel' |
| | | _fieldval.class = 'dgreen' |
| | | _fieldval.execSuccess = 'never' |
| | | this.record.Ot = 'notRequired' |
| | | this.record.label = this.props.dict['model.form.excelOut'] |
| | | this.record.label = '导出Excel' |
| | | this.record.class = 'dgreen' |
| | | this.record.execSuccess = 'never' |
| | | |
| | |
| | | } |
| | | |
| | | if (value === 'excelIn') { |
| | | _fieldval.label = this.props.dict['model.form.excelIn'] |
| | | _fieldval.label = '导入Excel' |
| | | _fieldval.class = 'border-dgreen' |
| | | } else if (value === 'excelOut') { |
| | | _fieldval.label = this.props.dict['model.form.excelOut'] |
| | | _fieldval.label = '导出Excel' |
| | | _fieldval.class = 'dgreen' |
| | | _fieldval.control = '' |
| | | this.record.control = '' |
| | |
| | | } |
| | | |
| | | getFields() { |
| | | const { dict } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const fields = [] |
| | | |
| | |
| | | |
| | | if (item.type === 'text') { |
| | | rules = [ |
| | | { required: item.required, message: dict['form.required.input'] + item.label + '!' } |
| | | { required: item.required, message: '请输入' + item.label + '!' } |
| | | ] |
| | | |
| | | if (item.key === 'innerFunc') { |
| | |
| | | content = <Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} /> |
| | | } else if (item.type === 'number') { |
| | | rules = [ |
| | | { required: item.required, message: dict['form.required.input'] + item.label + '!' } |
| | | { required: item.required, message: '请输入' + item.label + '!' } |
| | | ] |
| | | |
| | | content = <InputNumber min={item.min} max={item.max} precision={item.precision} onPressEnter={this.handleSubmit}/> |
| | | } else if (item.type === 'select') { |
| | | rules = [ |
| | | { required: item.required, message: dict['form.required.select'] + item.label + '!' } |
| | | { required: item.required, message: '请选择' + item.label + '!' } |
| | | ] |
| | | |
| | | content = <Select |
| | |
| | | </Select> |
| | | } else if (item.type === 'radio') { |
| | | rules = [ |
| | | { required: item.required, message: dict['form.required.select'] + item.label + '!' } |
| | | { required: item.required, message: '请选择' + item.label + '!' } |
| | | ] |
| | | |
| | | content = <Radio.Group onChange={(e) => {this.optionChange(item.key, e.target.value)}}> |
| | |
| | | } else if (item.type === 'cascader') { |
| | | initVal = item.initVal || [] |
| | | rules = [ |
| | | { required: item.required, message: dict['form.required.select'] + item.label + '!' } |
| | | { required: item.required, message: '请选择' + item.label + '!' } |
| | | ] |
| | | |
| | | content = <Cascader options={item.options || []} expandTrigger="hover" placeholder=""/> |
| | | } else if (item.type === 'icon') { |
| | | rules = [ |
| | | { required: item.required, message: dict['form.required.select'] + item.label + '!' } |
| | | { required: item.required, message: '请选择' + item.label + '!' } |
| | | ] |
| | | |
| | | content = <MkEditIcon options={['edit', 'hint', 'direction', 'normal', 'data']} allowClear/> |
| | |
| | | span = 24 |
| | | className = 'textarea' |
| | | rules = [ |
| | | { required: item.readonly ? false : item.required, message: dict['form.required.input'] + item.label + '!' } |
| | | { required: item.readonly ? false : item.required, message: '请输入' + item.label + '!' } |
| | | ] |
| | | |
| | | content = <TextArea rows={2} readOnly={item.readonly}/> |