fix(web): 移除节点未移除节点数据

This commit is contained in:
v-zhangjc9
2025-07-10 14:28:32 +08:00
parent f707a0d2b5
commit f70b3b2a32
3 changed files with 16 additions and 6 deletions

View File

@@ -47,7 +47,6 @@ export function inputsFormColumns(
}))
let incomerIds = getAllIncomerNodeById(nodeId, nodes, edges)
console.log(incomerIds, nodes, edges)
let incomerVariables: InputFormOptionsGroup[] = []
for (const incomerId of incomerIds) {
let nodeData = data[incomerId] ?? {}
@@ -195,7 +194,7 @@ const AmisNode: (props: AmisNodeProps) => JSX.Element = ({
columnSchema,
}) => {
const {removeNode} = useFlowStore()
const {getDataById, setDataById} = useDataStore()
const {getDataById, setDataById, removeDataById} = useDataStore()
const {id} = nodeProps
// @ts-ignore
const nodeData = getDataById(id)
@@ -291,6 +290,10 @@ const AmisNode: (props: AmisNodeProps) => JSX.Element = ({
)
setEditDrawerOpen(true)
}, [nodeData])
const remove = useCallback(() => {
removeNode(id)
removeDataById(id)
}, [])
return (
<AmisNodeContainerDiv className="w-64">
<Drawer
@@ -331,7 +334,7 @@ const AmisNode: (props: AmisNodeProps) => JSX.Element = ({
size="small"
icon={<DeleteFilled/>}
block
onClick={() => removeNode(id)}
onClick={() => remove()}
/>,
]}
>