提交 49bed1bc authored 作者: wtj's avatar wtj

提交代码

上级 d0cb361e
......@@ -22,6 +22,7 @@ class FormEdit extends React.Component {
recordId: this.props.location.state.recordId,
recordKey: this.props.location.state.recordKey,
options:{},
isView:this.props.location.state.isView
};
columns = [];
......@@ -109,7 +110,7 @@ class FormEdit extends React.Component {
render() {
const { getFieldDecorator } = this.props.form;
const { formItem, formData, isAdd ,options} = this.state;
const { formItem, formData, isAdd ,options,isView} = this.state;
return (
<PageHeaderWrapper title="">
......@@ -126,7 +127,7 @@ class FormEdit extends React.Component {
span={24}
style={{ textAlign: 'center', paddingTop: '200px', paddingBottom: '50px' }}
>
<ButtonDiy className={'primaryBlue'} handleClick={this.onSubmit} name={'保存'} />
{!isView?<ButtonDiy className={'primaryBlue'} handleClick={this.onSubmit} name={'保存'} />:''}
<ButtonDiy className={'defaultRed'} handleClick={this.goBack} name={'返回'} />
</Col>
</Row>
......
......@@ -79,13 +79,18 @@ const CreateForm = Form.create()(props => {
isAdd,
handleModalVisible,
formItem,
getItem
getItem,
isView
} = props;
//通过回调
const okHandle = () => {
form.validateFields((err, fieldsValue) => {
if (err) return;
if(isView){
handleModalVisible();
return;
}
formItem.map((item, index) => {
if (item.type.indexOf('DATE') > -1) {
for (let d in fieldsValue) {
......@@ -146,7 +151,7 @@ class FormList extends React.Component {
groups:{},
showDiv:'',
showMobileDiv:'',
isView:false
};
columns = [];
......@@ -178,6 +183,31 @@ class FormList extends React.Component {
formData: record,
modalVisible: true,
isAdd: false,
isView:false
});
} else {
router.push({
pathname: '/admin/ddl/dataObj/formEdit',
state: {
id: this.state.objId,
recordId: record[this.state.primaryKey],
recordKey: this.state.primaryKey,
isAdd: false,
isView:false
},
});
}
};
view = record => {
if (this.state.formItem.length < 10) {
this.getOptions()
this.setState({
formData: record,
modalVisible: true,
isAdd: false,
isView:true
});
} else {
router.push({
......@@ -186,7 +216,8 @@ class FormList extends React.Component {
id: this.state.objId,
recordId: record[this.state.primaryKey],
recordKey: this.state.primaryKey,
isAdd: false
isAdd: false,
isView:true
},
});
}
......@@ -208,7 +239,7 @@ class FormList extends React.Component {
});
};
view = record => {
viewProcess = record => {
const {dispatch}= this.props;
dispatch({
type: 'formList/getAppId',
......@@ -546,6 +577,7 @@ class FormList extends React.Component {
objId: this.state.objId,
isAdd: isAdd,
isSelf: true,
isView:false
},
callback: () => {
message.success('操作成功');
......@@ -571,11 +603,12 @@ class FormList extends React.Component {
modalVisible: true,
formData: {},
isAdd: true,
isView:false
});
} else {
router.push({
pathname: '/admin/ddl/dataObj/formEdit',
state: { id: this.state.objId,isAdd: true }
state: { id: this.state.objId,isAdd: true,isView:false }
});
}
};
......@@ -861,7 +894,7 @@ class FormList extends React.Component {
};
if(!isSelect&&!rights.includes('edit')&&!rights.includes('delete')){
if(!isSelect&&!rights.includes('edit')&&!rights.includes('delete')&&!rights.includes("view")){
const column = {
title: '操作',
fixed: 'right',
......@@ -890,9 +923,11 @@ class FormList extends React.Component {
type="vertical"/></> : <><a
onClick={callback.bind(this, record, this.columns)}>选择</a><Divider
type="vertical"/></> : ''}
{rights && !rights.includes('view') ? '' : <><a
onClick={this.view.bind(this, record)}>查看详情</a><Divider type="vertical"/></>}
{rights && !rights.includes('edit') ? '' : <><a
onClick={this.modify.bind(this, record)}>编辑</a><Divider type="vertical"/></>}
{record.process_biz_key?<><a onClick={this.view.bind(this, record)}>查看</a><Divider type="vertical"/></>:''}
{record.process_biz_key?<><a onClick={this.viewProcess.bind(this, record)}>查看流程详情</a><Divider type="vertical"/></>:''}
{rights && !rights.includes('delete') ? '' : <> <Popconfirm
title="确定删除该数据?"
onConfirm={this.delete.bind(this, record)}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论