|
1 | 1 | import React from "react"; |
2 | 2 | import {FlowData} from "@/components/Flow/flow/data"; |
3 | | - |
| 3 | +import {Divider} from "antd"; |
| 4 | +import {ProDescriptions} from "@ant-design/pro-components"; |
| 5 | +import moment from "moment"; |
| 6 | +import FlowHistoryLine from "@/components/Flow/flow/FlowHistoryLine"; |
| 7 | +import "./FlowHistoryLine.scss"; |
4 | 8 |
|
5 | 9 | interface FlowHistoryProps { |
6 | 10 | flowData:FlowData |
7 | 11 | } |
8 | 12 |
|
9 | 13 | const FlowHistory:React.FC<FlowHistoryProps> = (props)=>{ |
10 | 14 |
|
| 15 | + const flowData = props.flowData; |
| 16 | + |
| 17 | + const flowRecord = flowData.getCurrentFlowRecord(); |
| 18 | + |
11 | 19 | return ( |
12 | 20 | <> |
13 | | - Flow History |
| 21 | + <Divider> |
| 22 | + <span className="Divider-title">基本信息</span> |
| 23 | + </Divider> |
| 24 | + <div className="flowApprovalHistory"> |
| 25 | + <ProDescriptions |
| 26 | + className="proDescriptions" |
| 27 | + column={2} |
| 28 | + bordered |
| 29 | + labelStyle={{ |
| 30 | + textAlign: "center", |
| 31 | + width: "180px", |
| 32 | + }} |
| 33 | + contentStyle={{ |
| 34 | + width: "300px", |
| 35 | + }} |
| 36 | + > |
| 37 | + <ProDescriptions.Item |
| 38 | + span={2} |
| 39 | + label={"标题"} |
| 40 | + > |
| 41 | + <span dangerouslySetInnerHTML={{ __html: flowRecord.title }} ></span> |
| 42 | + </ProDescriptions.Item> |
| 43 | + <ProDescriptions.Item |
| 44 | + span={1} |
| 45 | + label={"发起人"} |
| 46 | + > |
| 47 | + {flowRecord.createOperator.name} |
| 48 | + </ProDescriptions.Item> |
| 49 | + <ProDescriptions.Item |
| 50 | + span={1} |
| 51 | + label={"发起时间"} |
| 52 | + > |
| 53 | + {moment(flowRecord.createTime).format("YYYY-MM-DD HH:mm:ss")} |
| 54 | + </ProDescriptions.Item> |
| 55 | + |
| 56 | + <ProDescriptions.Item |
| 57 | + span={1} |
| 58 | + label={"状态"} |
| 59 | + > |
| 60 | + {flowRecord.flowStatus === 'RUNNING' && '进行中'} |
| 61 | + {flowRecord.flowStatus === 'FINISH' && '已结束'} |
| 62 | + </ProDescriptions.Item> |
| 63 | + <ProDescriptions.Item |
| 64 | + span={1} |
| 65 | + label={"流程状态"} |
| 66 | + > |
| 67 | + {flowRecord.recodeType === 'TODO' && '待办'} |
| 68 | + {flowRecord.recodeType === 'DONE' && '已办'} |
| 69 | + {flowRecord.recodeType === 'TRANSFER' && '已转办'} |
| 70 | + </ProDescriptions.Item> |
| 71 | + <ProDescriptions.Item |
| 72 | + span={1} |
| 73 | + label={"是否延期"} |
| 74 | + > |
| 75 | + {flowRecord.postponedCount > 0 ? '延期' : '未延期'} |
| 76 | + </ProDescriptions.Item> |
| 77 | + <ProDescriptions.Item |
| 78 | + span={1} |
| 79 | + label={"是否干预"} |
| 80 | + > |
| 81 | + {flowRecord.interfere ? '干预' : '未干预'} |
| 82 | + </ProDescriptions.Item> |
| 83 | + <ProDescriptions.Item |
| 84 | + span={1} |
| 85 | + label={"是否已读"} |
| 86 | + > |
| 87 | + {flowRecord.read ? '已读' : '未读'} |
| 88 | + </ProDescriptions.Item> |
| 89 | + <ProDescriptions.Item |
| 90 | + span={1} |
| 91 | + label={"超时时间"} |
| 92 | + > |
| 93 | + {flowRecord.timeoutTime == 0 ? '未设置' : moment(flowRecord.timeoutTime).format("YYYY-MM-DD HH:mm:ss")} |
| 94 | + </ProDescriptions.Item> |
| 95 | + <ProDescriptions.Item |
| 96 | + span={1} |
| 97 | + label={"节点名称"} |
| 98 | + > |
| 99 | + {flowData.getNode(flowRecord.nodeCode)?.name} |
| 100 | + </ProDescriptions.Item> |
| 101 | + </ProDescriptions> |
| 102 | + <div className="flowApprovalHistory-RecordLine"> |
| 103 | + <Divider> |
| 104 | + <span className="Divider-title">流程历史</span> |
| 105 | + </Divider> |
| 106 | + <div className="record-line"> |
| 107 | + <FlowHistoryLine flowData={flowData}/> |
| 108 | + </div> |
| 109 | + </div> |
| 110 | + </div> |
14 | 111 | </> |
15 | 112 | ) |
16 | 113 | } |
|
0 commit comments