提交 b4693f28 authored 作者: wtj's avatar wtj

提交表单修改 隐藏字段用隐藏域放置

上级 a9166226
......@@ -102,23 +102,23 @@ const CreateForm = Form.create()(props => {
}
}
}else if (number.includes(item.type)) {
for (let d in fieldsValue) {
if (item.name === d&&fieldsValue[d]=="") {
fieldsValue[d]=null
break
}
}
}
});
let params = { ...fieldsValue };
handleAdd(params, isAdd);
});
};
//需要获取动态表单
return (
<Modal
......@@ -391,11 +391,11 @@ class FormList extends React.Component {
componentWillReceiveProps(nextProps){
const b = nextProps.value||{}
const a = this.props.value||{}
const jsonb=JSON.stringify(b)
const jsona=JSON.stringify(a)
this.custom=Base16Encode(jsonb)
if(jsona!=jsonb){
let params= {
......@@ -403,13 +403,13 @@ class FormList extends React.Component {
pageSize: b.pageSize?b.pageSize:this.state.data.pagination.pageSize,
query: JSON.stringify(this.state.formValues),
};
if(nextProps.value.columns!=null&&nextProps.value.columns.length>0){
this.columns=nextProps.value.columns
}
if( nextProps.value.getPage){
this.getPage(params,null,nextProps.value.getPage);
}else{
......@@ -780,6 +780,18 @@ class FormList extends React.Component {
}
getItem = (isQuery,form, item, isAdd, formData, labelCol, wrapperCol) => {
const {groups} =this.state;
//如果隐藏的话 就用隐藏域放置
if(item.isHidden){
return (
<FormItem >
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
})(<Input type='hidden' placeholder="请输入"/>)}
</FormItem>
);
}
if (item.isPrimaryKey) {
if (isAdd) {
return (<></>);
......@@ -919,7 +931,7 @@ class FormList extends React.Component {
form,
get,
} = this.props;
const { querys } = this.state
if (querys.length == 0) {
return '';
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论