提交 9e589049 authored 作者: wtj's avatar wtj

表单详情 查看的时候 disable表单元素

上级 b4693f28
......@@ -779,7 +779,7 @@ class FormList extends React.Component {
}
getItem = (isQuery,form, item, isAdd, formData, labelCol, wrapperCol) => {
const {groups} =this.state;
const {groups,isView} =this.state;
//如果隐藏的话 就用隐藏域放置
if(item.isHidden){
......@@ -814,7 +814,7 @@ class FormList extends React.Component {
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
})(<Select style={{ width: '70%' }} placeholder="请选择" allowClear>
})(<Select disabled={isView} style={{ width: '70%' }} placeholder="请选择" allowClear>
{ops.map((r) => <Option value={r[item.referenceCodeName]}
key={r[item.referenceCodeName]}>{r[item.referenceNameName]}</Option>)}
......@@ -827,7 +827,7 @@ class FormList extends React.Component {
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
})(<Select style={{ width: '70%' }} placeholder="请选择" allowClear>
})(<Select disabled={isView} style={{ width: '70%' }} placeholder="请选择" allowClear>
<Option value={'0'} key={'0'}>审核通过</Option>
<Option value={'2'} key={'2'}>审核未通过</Option>
</Select>)}
......@@ -842,7 +842,7 @@ class FormList extends React.Component {
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : (formData[item.name]&&this.isJSON(formData[item.name])?JSON.parse(formData[item.name]):null),
rules: [{ required: !item.isNull }],
})(<UploadCom />)}
})(<UploadCom disabled={isView} />)}
</FormItem>
);
} else if(isQuery&&item.isGroupQuery!=null&&item.isGroupQuery){ //如果是查询 并且是组合查询
......@@ -853,7 +853,7 @@ class FormList extends React.Component {
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
})(<Select style={{ width: '70%' }} placeholder="请选择" allowClear>
})(<Select disabled={isView} style={{ width: '70%' }} placeholder="请选择" allowClear>
{ops.map((r) => <Option value={r.value}
key={r.value}>{r.value}</Option>)}
</Select>)}
......@@ -865,7 +865,7 @@ class FormList extends React.Component {
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
})(<Input style={{ width: '70%' }} placeholder="请输入"/>)}
})(<Input disabled={isView} style={{ width: '70%' }} placeholder="请输入"/>)}
</FormItem>
);
} else if (number.indexOf(item.type) > -1) {
......@@ -882,7 +882,7 @@ class FormList extends React.Component {
callback(errors)
}],
})(<Input placeholder="请输入"/>)}
})(<Input disabled={isView} placeholder="请输入"/>)}
</FormItem>
);
} else if (isQuery&&data.indexOf(item.type) > -1) {
......@@ -893,7 +893,7 @@ class FormList extends React.Component {
initialValue: formData == null ? null : moment(formData[item.name]),
rules: [{ required: !item.isNull }],
})(
<RangePicker format={item.dataFormatStrWeb==null?"YYYY-MM-DD HH:mm:ss":item.dataFormatStrWeb}
<RangePicker disabled={isView} format={item.dataFormatStrWeb==null?"YYYY-MM-DD HH:mm:ss":item.dataFormatStrWeb}
style={{ width: '95%' }} />)}
</FormItem>
);
......@@ -910,6 +910,7 @@ class FormList extends React.Component {
format={item.dataFormatStrWeb==null?"YYYY-MM-DD HH:mm:ss":item.dataFormatStrWeb}
style={{ width: '100%' }}
placeholder="请输入"
disabled={isView}
/>,
)}
</FormItem>
......@@ -920,7 +921,7 @@ class FormList extends React.Component {
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
})(<Input style={{ width: '70%' }} placeholder="请输入"/>)}
})(<Input disabled={isView} style={{ width: '70%' }} placeholder="请输入"/>)}
</FormItem>
);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论