Browse Source

表单流程优化

dev
巴林闲侠 2 years ago
parent
commit
0444a15533
  1. 12
      web/client/src/components/workflow/approval.jsx
  2. 34
      web/client/src/components/workflow/index.jsx
  3. 22
      web/client/src/sections/workOrder/containers/jobOrder.jsx

12
web/client/src/components/workflow/approval.jsx

@ -10,12 +10,12 @@ import './index.less'
const WorkFlowApprovalModal = (props) => { const WorkFlowApprovalModal = (props) => {
const { visible, onCancel, webEmis, user, processAuditList, checkProcessInstanceId, successCallBack, type } = props; const { visible, onCancel, webEmis, user, processAuditList, checkProcessInstanceId, successCallBack, type } = props;
const ifreamUrlMap = useRef({ const ifreamUrlMap = useRef({
approval: 'approval/info', approval: 'approval/info', //
myApply: 'process/my-apply', myApply: 'process/my-apply', //
notice: 'process/my-apply', notice: 'process/my-apply', //
hasDone: 'process/my-apply', hasDone: 'process/my-apply', //
draft: 'process/{processId}/draft', draft: 'process/{processId}/draft', // 稿
submit: 'process/{processId}/apply' submit: 'process/{processId}/apply' //
}) })
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(true);
const [ifreamUrl, setIfreamUrl] = useState(''); const [ifreamUrl, setIfreamUrl] = useState('');

34
web/client/src/components/workflow/index.jsx

@ -79,7 +79,6 @@ const WorkFlowModal = (props) => {
if (event && event.data && typeof (event.data) == 'string') { if (event && event.data && typeof (event.data) == 'string') {
let data = JSON.parse(event.data); let data = JSON.parse(event.data);
const { type, isSaveDraft, setIntervalSave, draftId, msg } = data; const { type, isSaveDraft, setIntervalSave, draftId, msg } = data;
console.log(data, msg);
if (msg) { if (msg) {
Notification.success({ title: msg }) Notification.success({ title: msg })
} }
@ -142,20 +141,25 @@ const WorkFlowModal = (props) => {
<Spin <Spin
spinning={loading} spinning={loading}
> >
{webEmis && processId ? <iframe {
id='workflowFrame' webEmis && processId ?
onLoad={() => { <iframe
let frameWin = document.getElementById('workflowFrame'); id='workflowFrame'
frameWin.contentWindow.postMessage(JSON.stringify(postData), '*'); onLoad={() => {
setLoading(false); let frameWin = document.getElementById('workflowFrame');
}} frameWin.contentWindow.postMessage(JSON.stringify(postData), '*');
allowTransparency="true" setLoading(false);
ref={iframeRef} }}
src={`${webEmis}/process/${processId}/apply?token=${user.token}`} allowTransparency="true"
width={'100%'} ref={iframeRef}
style={{ height: '100vh' }} src={`${webEmis}/process/${processId}/apply?token=${user.token}`}
frameBorder="0" width={'100%'}
></iframe> : ''} style={{ height: '100vh' }}
frameBorder="0"
>
</iframe> : ''
}
</Spin> </Spin>
</div> </div>
</div> </div>

22
web/client/src/sections/workOrder/containers/jobOrder.jsx

@ -46,17 +46,17 @@ const JobOrder = (props) => {
}).then(res => { }).then(res => {
setFormStateRequestingIndex(false) setFormStateRequestingIndex(false)
if (res) { if (res) {
// if (res.deleted) { if (res.deleted) {
// Notification.error({ title: '退' }) Notification.error({ title: '该表单流程已删除,请尝试退出账号重新登录或联系项企管理员' })
// } else if (res.isEdited) { } else if (res.isEdited) {
// Notification.error({ title: '退' }) Notification.error({ title: '该表单流程已修改,请尝试退出账号重新登录或联系项企管理员' })
// } else if (!res.isEnable) { } else if (!res.isEnable) {
// Notification.error({ title: '退' }) Notification.error({ title: '该表单流程已停用,请尝试退出账号重新登录或联系项企管理员' })
// } else } else
if (res.id) { if (res.id) {
setLaunchProcessId(res.id) setLaunchProcessId(res.id)
setWorkflowModalVisible(true) setWorkflowModalVisible(true)
} }
} else { } else {
Notification.error({ title: `获取指定流程失败` }); Notification.error({ title: `获取指定流程失败` });
} }

Loading…
Cancel
Save