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

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

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