|
@@ -1,5 +1,5 @@
|
|
|
import React, { useMemo, useEffect, useState, useRef } from 'react';
|
|
|
-import { Steps, Popover, Alert } from 'antd';
|
|
|
+import { Steps, Popover, Alert, Spin } from 'antd';
|
|
|
import styles from './Index.less';
|
|
|
import { queryDDProcessesForecast } from '@/services/boom';
|
|
|
import { connect } from 'dva';
|
|
@@ -20,6 +20,7 @@ function AuditFlow(props) {
|
|
|
cc_userids = [],
|
|
|
} = props;
|
|
|
const [flow, setFlow] = useState({ workflowActivityRules: [] });
|
|
|
+ const [loading, setLoading] = useState(false);
|
|
|
const timerRef = useRef({
|
|
|
id: '',
|
|
|
status: false,
|
|
@@ -130,6 +131,7 @@ function AuditFlow(props) {
|
|
|
if (!timerRef.current.status) {
|
|
|
// 上锁
|
|
|
timerRef.current.status = true;
|
|
|
+ setLoading(true);
|
|
|
try {
|
|
|
let flow = await queryDDProcessesForecast({
|
|
|
processCode,
|
|
@@ -139,6 +141,7 @@ function AuditFlow(props) {
|
|
|
});
|
|
|
setFlow(flow);
|
|
|
} catch (error) {}
|
|
|
+ setLoading(false);
|
|
|
setTimeout(() => {
|
|
|
// 延时解锁
|
|
|
timerRef.current.status = false;
|
|
@@ -158,7 +161,7 @@ function AuditFlow(props) {
|
|
|
}, [processCode, formComponentValues]);
|
|
|
|
|
|
return (
|
|
|
- <>
|
|
|
+ <Spin spinning={loading}>
|
|
|
<div className={styles.top}>
|
|
|
<Steps current={current} progressDot={customDot} direction={direction}>
|
|
|
{flow.workflowActivityRules.map(item => (
|
|
@@ -168,7 +171,7 @@ function AuditFlow(props) {
|
|
|
</Steps>
|
|
|
</div>
|
|
|
{status !== undefined && renderAlert()}
|
|
|
- </>
|
|
|
+ </Spin>
|
|
|
);
|
|
|
}
|
|
|
|