Browse Source

处理流程 35%

dev
巴林闲侠 2 years ago
parent
commit
4a3f6d91a9
  1. 2
      api/.vscode/launch.json
  2. 45
      web/client/src/components/workflow/approval.jsx
  3. 3
      web/client/src/components/workflow/index.jsx
  4. 8
      web/client/src/sections/workOrder/containers/jobOrder.jsx
  5. 17
      web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx

2
api/.vscode/launch.json

@ -61,7 +61,7 @@
// "--clickHouseIot iot", // "--clickHouseIot iot",
// //
"--clickHouseAnxincloud Anxinyun101", "--clickHouseAnxincloud Anxinyun101",
"--clickHousePepEmis pepca9", "--clickHousePepEmis pepca10",
"--clickHouseProjectManage peppm8", "--clickHouseProjectManage peppm8",
"--clickHouseVcmp video_access_dev", "--clickHouseVcmp video_access_dev",
"--clickHouseDataAlarm default", "--clickHouseDataAlarm default",

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

@ -10,11 +10,46 @@ import { IconClose } from '@douyinfe/semi-icons';
import './index.less' import './index.less'
const WorkFlowApprovalModal = (props) => { const WorkFlowApprovalModal = (props) => {
const { visible, onCancel, webEmis, user, postData } = props; const { visible, onCancel, webEmis, user, processAuditList, checkProcessInstanceId, successCallBack } = props;
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(true);
const [processData, setProcessData] = useState({});
const iframeRef = React.createRef(); const iframeRef = React.createRef();
useEffect(() => {
window.receiveMessageFromIndex = function (event) {
if (event && event.data && typeof (event.data) == 'string') {
let data = JSON.parse(event.data);
const { type, msg } = data;
if (msg) {
console.log(msg);
Notification.success({ title: msg })
}
if (type == 'submitSuccess' && successCallBack) {
successCallBack();
setLoading(false);
}
}
}
//message
window.addEventListener('message', receiveMessageFromIndex, false);
return () => {
window.removeEventListener('message', receiveMessageFromIndex, false);
}
}, [])
useEffect(() => {
console.log('iframeRef.current', iframeRef.current);
if (checkProcessInstanceId && processAuditList.length && iframeRef.current) {
const corProcessData = processAuditList.find(p => p.processInstanceId == checkProcessInstanceId)
if (corProcessData) {
iframeRef.current.contentWindow.postMessage(JSON.stringify({
...corProcessData
}), '*');
}
}
}, [checkProcessInstanceId, iframeRef])
console.log(iframeRef);
return ( return (
<div> <div>
<Modal <Modal
@ -49,9 +84,9 @@ const WorkFlowApprovalModal = (props) => {
id='workflowFrame' id='workflowFrame'
onLoad={() => { onLoad={() => {
let frameWin = document.getElementById('workflowFrame'); let frameWin = document.getElementById('workflowFrame');
frameWin.contentWindow.postMessage(JSON.stringify({ // frameWin.contentWindow.postMessage(JSON.stringify({
}), '*'); // }), '*');
setLoading(false); setLoading(false);
}} }}
allowTransparency="true" allowTransparency="true"

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

@ -105,6 +105,9 @@ const WorkFlowModal = (props) => {
} }
//message //message
window.addEventListener('message', receiveMessageFromIndex, false); window.addEventListener('message', receiveMessageFromIndex, false);
return () => {
window.removeEventListener('message', receiveMessageFromIndex, false);
}
}, []) }, [])
console.log(webEmis, processId); console.log(webEmis, processId);

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

@ -78,21 +78,21 @@ const JobOrder = (props) => {
}) })
} }
</div> </div>
{/* <WorkflowModal <WorkflowModal
visible={workflowModalVisible} visible={workflowModalVisible}
title={''} title={''}
processId={launchProcessId} processId={launchProcessId}
onCancel={() => { setWorkflowModalVisible(false) }} onCancel={() => { setWorkflowModalVisible(false) }}
successCallBack={() => { setWorkflowModalVisible(false) }} successCallBack={() => { setWorkflowModalVisible(false) }}
/> */} />
{/* <WorkFlowViewModal {/* <WorkFlowViewModal
visible={workflowModalVisible} visible={workflowModalVisible}
processId={launchProcessId} processId={launchProcessId}
/> */} /> */}
{<WorkflowApprovalModal {/* {<WorkflowApprovalModal
visible={workflowModalVisible} visible={workflowModalVisible}
onCancel={() => { setWorkflowModalVisible(false) }} onCancel={() => { setWorkflowModalVisible(false) }}
/>} />} */}
</div> </div>
) )
} }

17
web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx

@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import { ApiTable, EmisApiTable, EmisRequest } from '$utils' import { ApiTable, EmisApiTable, EmisRequest } from '$utils'
import { Skeleton, Button, Pagination, Form, Popconfirm, Table, Toast } from '@douyinfe/semi-ui'; import { Skeleton, Button, Pagination, Form, Popconfirm, Table, Toast } from '@douyinfe/semi-ui';
import { IconSearch } from '@douyinfe/semi-icons'; import { IconSearch } from '@douyinfe/semi-icons';
import { SkeletonScreen, WorkflowModal } from "$components"; import { SkeletonScreen, WorkflowModal, WorkflowApprovalModal } from "$components";
import moment from "moment"; import moment from "moment";
@ -28,8 +28,8 @@ const Rest = (props) => {
const [tableData, setTableData] = useState([]); // const [tableData, setTableData] = useState([]); //
const [loading, setLoading] = useState(true); // const [loading, setLoading] = useState(true); //
const [workflowModalVisible, setWorkflowModalVisible] = useState(false) const [workflowModalVisible, setWorkflowModalVisible] = useState(false)
const [processInstanceId, setProcessInstanceId] = useState(null) const [checkProcessInstanceId, setCheckProcessInstanceId] = useState(null)
const [processData, setProcessData] = useState([])
useEffect(() => { useEffect(() => {
@ -80,9 +80,8 @@ const Rest = (props) => {
title: '操作', title: '操作',
dataIndex: 'hadle', dataIndex: 'hadle',
render: (text, record, index) => <div style={{ width: 60, color: "#1890ff", cursor: "pointer" }} onClick={() => { render: (text, record, index) => <div style={{ width: 60, color: "#1890ff", cursor: "pointer" }} onClick={() => {
setProcessInstanceId(record.processInstanceId) setCheckProcessInstanceId(record.processInstanceId)
setWorkflowModalVisible(true) setWorkflowModalVisible(true)
}}>查看详情</div> }}>查看详情</div>
}] }]
@ -134,8 +133,6 @@ const Rest = (props) => {
查询 查询
</Button> </Button>
</Form> </Form>
</div> </div>
</div> </div>
@ -184,10 +181,10 @@ const Rest = (props) => {
</div> </div>
</div> </div>
</div> </div>
<WorkflowModal <WorkflowApprovalModal
visible={workflowModalVisible} visible={workflowModalVisible}
title={''} processAuditList={tableData}
processId={processInstanceId} checkProcessInstanceId={checkProcessInstanceId}
onCancel={() => { setWorkflowModalVisible(false) }} onCancel={() => { setWorkflowModalVisible(false) }}
successCallBack={() => { setWorkflowModalVisible(false) }} successCallBack={() => { setWorkflowModalVisible(false) }}
/> />

Loading…
Cancel
Save