Commit f514903e by zhaochengxiang

流程模型详情编辑权限控制

parent 005ce20c
...@@ -602,6 +602,7 @@ const EditModel = (props) => { ...@@ -602,6 +602,7 @@ const EditModel = (props) => {
actionsBtn = <PhysicalModelApprovalBottom actionsBtn = <PhysicalModelApprovalBottom
loading={loadingApprovalData} loading={loadingApprovalData}
data={approvalData} data={approvalData}
modelerData={modelerData}
id={currentApprovalModelId} id={currentApprovalModelId}
taskId={taskId} taskId={taskId}
type={approvalType} type={approvalType}
...@@ -765,7 +766,7 @@ const EditModel = (props) => { ...@@ -765,7 +766,7 @@ const EditModel = (props) => {
export default EditModel; export default EditModel;
const PhysicalModelApprovalBottom = ({ loading, type, data, id, taskId, onChange, onOk, onHistory, onExport, onEdit }) => { const PhysicalModelApprovalBottom = ({ loading, type, data, modelerData, id, taskId, onChange, onOk, onHistory, onExport, onEdit }) => {
const [item, setItem] = useState() const [item, setItem] = useState()
const [waiting, setWaiting] = useState(false) const [waiting, setWaiting] = useState(false)
...@@ -847,12 +848,24 @@ const PhysicalModelApprovalBottom = ({ loading, type, data, id, taskId, onChange ...@@ -847,12 +848,24 @@ const PhysicalModelApprovalBottom = ({ loading, type, data, id, taskId, onChange
}) })
} }
let editTip = '', editDisabled = false;
if (modelerData?.state?.id === '4') {
if (!modelerData?.permitCheckOut) {
editTip = `${modelerData?.holder||''}正在编辑中, 不允许再编辑`;
editDisabled = true;
}
} else if (!modelerData?.editable) {
editDisabled = true;
}
return ( return (
<div className='flex' style={{ width: '100%', justifyContent: 'space-between' }}> <div className='flex' style={{ width: '100%', justifyContent: 'space-between' }}>
<Space> <Space>
<Button type='primary' ghost onClick={onExportClick}>导出</Button> <Button type='primary' ghost onClick={onExportClick}>导出</Button>
<Button type='primary' ghost onClick={onHistoryClick}>历史版本</Button> <Button type='primary' ghost onClick={onHistoryClick}>历史版本</Button>
<Button type='primary' onClick={onEditClick}>编辑</Button> <Tooltip title={editTip}>
<Button type='primary' onClick={onEditClick} disabled={editDisabled}>编辑</Button>
</Tooltip>
</Space> </Space>
<Space> <Space>
<ApprovalTip type={type} /> <ApprovalTip type={type} />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment