|
@@ -23,22 +23,22 @@ const renderMenu = ({ dataID, source, dispatch, elements, togglePopver, id, flow
|
|
|
payload: els
|
|
|
})
|
|
|
}
|
|
|
- const edit = () => {
|
|
|
- togglePopver(false)
|
|
|
- // dispatch({
|
|
|
- // type: Actions.OPEN_MODAL,
|
|
|
- // payload: {
|
|
|
- // id: node.id,
|
|
|
- // type: 'relation'
|
|
|
- // }
|
|
|
- // })
|
|
|
- }
|
|
|
- const remove = () => {
|
|
|
- dispatch({
|
|
|
- type: Actions.REMOVE_FLOW_NODE,
|
|
|
- payload: node
|
|
|
- })
|
|
|
- }
|
|
|
+ // const edit = () => {
|
|
|
+ // togglePopver(false)
|
|
|
+ // dispatch({
|
|
|
+ // type: Actions.OPEN_MODAL,
|
|
|
+ // payload: {
|
|
|
+ // id: node.id,
|
|
|
+ // type: 'relation'
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // const remove = () => {
|
|
|
+ // dispatch({
|
|
|
+ // type: Actions.REMOVE_FLOW_NODE,
|
|
|
+ // payload: node
|
|
|
+ // })
|
|
|
+ // }
|
|
|
|
|
|
const addAuditor = async () => {
|
|
|
const uid = buildUUID()
|
|
@@ -128,7 +128,7 @@ export function CommonEdge(props) {
|
|
|
|
|
|
const [visible, setVisible] = useState(false)
|
|
|
const { flowState, dispatch } = useContext(FlowContext)
|
|
|
- const { elements, flowInstance, dataID } = flowState
|
|
|
+ const { elements, flowInstance, dataID, readPretty } = flowState
|
|
|
const nodes = useStoreState(store => store.nodes)
|
|
|
const markerEnd = getMarkerEnd(arrowHeadType, markerEndId)
|
|
|
|
|
@@ -160,12 +160,14 @@ export function CommonEdge(props) {
|
|
|
setVisible(isShow)
|
|
|
}
|
|
|
|
|
|
- const onEdgeClick = (evt, id) => {
|
|
|
+ const onEdgeClick = () => {
|
|
|
togglePopver(true)
|
|
|
// evt.stopPropagation()
|
|
|
// alert(`remove ${id}`)
|
|
|
}
|
|
|
|
|
|
+ console.log(readPretty)
|
|
|
+
|
|
|
return (
|
|
|
<>
|
|
|
<path id={id} style={style} className={styles.flowPath} d={d} markerEnd={markerEnd} />
|
|
@@ -175,29 +177,31 @@ export function CommonEdge(props) {
|
|
|
x={edgeCenterX - foreignObjectSize / 2}
|
|
|
y={edgeCenterY - foreignObjectSize / 2}>
|
|
|
<div className={styles.addIcon}>
|
|
|
- <Popover
|
|
|
- content={renderMenu({
|
|
|
- elements,
|
|
|
- dispatch,
|
|
|
- source,
|
|
|
- togglePopver,
|
|
|
- id,
|
|
|
- flowInstance,
|
|
|
- dataID
|
|
|
- })}
|
|
|
- trigger="click"
|
|
|
- placement="right"
|
|
|
- visible={visible}
|
|
|
- destroyTooltipOnHide
|
|
|
- onVisibleChange={togglePopver}
|
|
|
- overlayClassName="flow-popover">
|
|
|
- <Button
|
|
|
- icon={<PlusOutlined />}
|
|
|
- shape="circle"
|
|
|
- size="small"
|
|
|
- onClick={event => onEdgeClick(event, id)}
|
|
|
- />
|
|
|
- </Popover>
|
|
|
+ {!readPretty ? (
|
|
|
+ <Popover
|
|
|
+ content={renderMenu({
|
|
|
+ elements,
|
|
|
+ dispatch,
|
|
|
+ source,
|
|
|
+ togglePopver,
|
|
|
+ id,
|
|
|
+ flowInstance,
|
|
|
+ dataID
|
|
|
+ })}
|
|
|
+ trigger="click"
|
|
|
+ placement="right"
|
|
|
+ visible={visible}
|
|
|
+ destroyTooltipOnHide
|
|
|
+ onVisibleChange={togglePopver}
|
|
|
+ overlayClassName="flow-popover">
|
|
|
+ <Button
|
|
|
+ icon={<PlusOutlined />}
|
|
|
+ shape="circle"
|
|
|
+ size="small"
|
|
|
+ onClick={event => onEdgeClick(event, id)}
|
|
|
+ />
|
|
|
+ </Popover>
|
|
|
+ ) : null}
|
|
|
</div>
|
|
|
</foreignObject>
|
|
|
</>
|