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",
//
"--clickHouseAnxincloud Anxinyun101",
"--clickHousePepEmis pepca9",
"--clickHousePepEmis pepca10",
"--clickHouseProjectManage peppm8",
"--clickHouseVcmp video_access_dev",
"--clickHouseDataAlarm default",

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

@ -10,11 +10,46 @@ import { IconClose } from '@douyinfe/semi-icons';
import './index.less'
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 [processData, setProcessData] = useState({});
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 (
<div>
<Modal
@ -49,9 +84,9 @@ const WorkFlowApprovalModal = (props) => {
id='workflowFrame'
onLoad={() => {
let frameWin = document.getElementById('workflowFrame');
frameWin.contentWindow.postMessage(JSON.stringify({
}), '*');
// frameWin.contentWindow.postMessage(JSON.stringify({
// }), '*');
setLoading(false);
}}
allowTransparency="true"

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

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

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

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

Loading…
Cancel
Save