feat: 状态调整

This commit is contained in:
李如威 2025-09-23 16:37:06 +08:00
parent 94db0b4d2a
commit d144a97b6d
3 changed files with 14 additions and 21 deletions

View File

@ -48,7 +48,6 @@ const ClientPage = () => {
<Popconfirm key='3' title="是否删除节点?" okText="删除" cancelText="取消" onConfirm={async () => await onDelete(record)}> <Popconfirm key='3' title="是否删除节点?" okText="删除" cancelText="取消" onConfirm={async () => await onDelete(record)}>
<Button type="link" danger style={{ padding: '0 0', border: 'none' }}>删除</Button> <Button type="link" danger style={{ padding: '0 0', border: 'none' }}>删除</Button>
</Popconfirm> </Popconfirm>
] ]
} }

View File

@ -81,21 +81,17 @@ const FlowDetail = () => {
} }
}) })
controlRef?.current?.updateNode(id); controlRef?.current?.updateNode(id);
setNodes(temp);
} }
const onAdd = (type) => { const onAdd = (type) => {
setNodes([ controlRef?.current?.addNodes({
...nodes, id: 'temp_' + new Date().getTime() + '_' + nodes.length,
{ position: { x: nodes.length * 5, y: 0 },
id: 'temp_' + new Date().getTime() + '_' + nodes.length, data: { label: type, style: { backgroundColor: COLORS[type] }, position: POSITION[type] },
position: { x: nodes.length * 5, y: 0 }, sourcePosition: 'right',
data: { label: type, style: { backgroundColor: COLORS[type] }, position: POSITION[type] }, targetPosition: 'left',
sourcePosition: 'right', type: type,
targetPosition: 'left', detail: { title: type }
type: type, })
detail: { title: type}
},
]);
} }
const onNodeClick = (_, record) => { const onNodeClick = (_, record) => {
if (record?.type === 'first') return; if (record?.type === 'first') return;

View File

@ -89,13 +89,11 @@ export default () => {
dataIndex: 'last_status', dataIndex: 'last_status',
title: '最后执行结果', title: '最后执行结果',
valueType: 'select', valueType: 'select',
fieldProps: { valueEnum: {
options: [ 'RUNNING': { text: "执行中", status: 'processing' },
{ value: 'RUNNING', "label": "执行中" }, 'SUCCESS': { text: "成功", status: 'success' },
{ value: 'SUCCESS', "label": "成功" }, 'FAILED': { text: "失败", status: 'error' },
{ value: 'FAILED', "label": "失败" }, 'CANCELLED': { text: "取消", status: 'default' }
{ value: 'CANCELLED', "label": "取消" }
]
} }
}, },
{ {