|
@@ -9,6 +9,7 @@ import { addApprovalNode } from '@/services/api/project'
|
|
|
import styles from './index.less'
|
|
|
import 'antd/lib/button/style/css'
|
|
|
import consts from '@/utils/consts'
|
|
|
+import useLoading from '../../hooks/useLoading'
|
|
|
const foreignObjectSize = 50
|
|
|
|
|
|
export enum SectorType {
|
|
@@ -16,7 +17,8 @@ export enum SectorType {
|
|
|
CONDITION = 'condition'
|
|
|
}
|
|
|
|
|
|
-const renderMenu = ({ dataID, source, dispatch, elements, togglePopver, id, flowInstance }) => {
|
|
|
+const RenderMenu = ({ dataID, source, dispatch, elements, togglePopver, id, flowInstance }) => {
|
|
|
+ const { run: showLoading } = useLoading()
|
|
|
const setElements = els => {
|
|
|
dispatch({
|
|
|
type: Actions.SET_ELEMENTS,
|
|
@@ -69,6 +71,7 @@ const renderMenu = ({ dataID, source, dispatch, elements, togglePopver, id, flow
|
|
|
node: null
|
|
|
}
|
|
|
})
|
|
|
+ showLoading()
|
|
|
togglePopver(false)
|
|
|
setTimeout(() => {
|
|
|
flowInstance?.fitView()
|
|
@@ -166,8 +169,6 @@ export function CommonEdge(props) {
|
|
|
// alert(`remove ${id}`)
|
|
|
}
|
|
|
|
|
|
- console.log(readPretty)
|
|
|
-
|
|
|
return (
|
|
|
<>
|
|
|
<path id={id} style={style} className={styles.flowPath} d={d} markerEnd={markerEnd} />
|
|
@@ -179,7 +180,7 @@ export function CommonEdge(props) {
|
|
|
<div className={styles.addIcon}>
|
|
|
{!readPretty ? (
|
|
|
<Popover
|
|
|
- content={renderMenu({
|
|
|
+ content={RenderMenu({
|
|
|
elements,
|
|
|
dispatch,
|
|
|
source,
|