fix(web): workflow properties
This commit is contained in:
@@ -31,6 +31,7 @@ const Properties: FC<PropertiesProps> = ({
|
|||||||
const [editIndex, setEditIndex] = useState<number | null>(null)
|
const [editIndex, setEditIndex] = useState<number | null>(null)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
form.resetFields()
|
||||||
if (selectedNode && form) {
|
if (selectedNode && form) {
|
||||||
const { type = 'default', name = '', config } = selectedNode.getData() || {}
|
const { type = 'default', name = '', config } = selectedNode.getData() || {}
|
||||||
const initialValue: Record<string, any> = {}
|
const initialValue: Record<string, any> = {}
|
||||||
|
|||||||
@@ -624,7 +624,7 @@ export const useWorkflowGraph = ({
|
|||||||
let nodeLibraryConfig = [...nodeLibrary]
|
let nodeLibraryConfig = [...nodeLibrary]
|
||||||
.flatMap(category => category.nodes)
|
.flatMap(category => category.nodes)
|
||||||
.find(n => n.type === dragData.type);
|
.find(n => n.type === dragData.type);
|
||||||
nodeLibraryConfig = { config: {}, ...nodeLibraryConfig } as NodeProperties;
|
nodeLibraryConfig = JSON.parse(JSON.stringify({ config: {}, ...nodeLibraryConfig })) as NodeProperties
|
||||||
|
|
||||||
// 创建干净的节点数据,只保留必要的字段
|
// 创建干净的节点数据,只保留必要的字段
|
||||||
const cleanNodeData = {
|
const cleanNodeData = {
|
||||||
|
|||||||
Reference in New Issue
Block a user