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 { visible, onCancel, webEmis, user, processAuditList, checkProcessInstanceId, successCallBack, type } = props;
const ifreamUrlMap = useRef({
approval: 'approval/info',
myApply: 'process/my-apply',
notice: 'process/my-apply',
hasDone: 'process/my-apply',
draft: 'process/{processId}/draft',
submit: 'process/{processId}/apply'
approval: 'approval/info', //
myApply: 'process/my-apply', //
notice: 'process/my-apply', //
hasDone: 'process/my-apply', //
draft: 'process/{processId}/draft', // 稿
submit: 'process/{processId}/apply' //
})
const [loading, setLoading] = useState(true);
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') {
let data = JSON.parse(event.data);
const { type, isSaveDraft, setIntervalSave, draftId, msg } = data;
console.log(data, msg);
if (msg) {
Notification.success({ title: msg })
}
@ -142,20 +141,25 @@ const WorkFlowModal = (props) => {
<Spin
spinning={loading}
>
{webEmis && processId ? <iframe
id='workflowFrame'
onLoad={() => {
let frameWin = document.getElementById('workflowFrame');
frameWin.contentWindow.postMessage(JSON.stringify(postData), '*');
setLoading(false);
}}
allowTransparency="true"
ref={iframeRef}
src={`${webEmis}/process/${processId}/apply?token=${user.token}`}
width={'100%'}
style={{ height: '100vh' }}
frameBorder="0"
></iframe> : ''}
{
webEmis && processId ?
<iframe
id='workflowFrame'
onLoad={() => {
let frameWin = document.getElementById('workflowFrame');
frameWin.contentWindow.postMessage(JSON.stringify(postData), '*');
setLoading(false);
}}
allowTransparency="true"
ref={iframeRef}
src={`${webEmis}/process/${processId}/apply?token=${user.token}`}
width={'100%'}
style={{ height: '100vh' }}
frameBorder="0"
>
</iframe> : ''
}
</Spin>
</div>
</div>

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

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

Loading…
Cancel
Save