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

提交代码

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