diff --git a/dolphinscheduler-ui/src/views/projects/workflow/instance/detail/index.tsx b/dolphinscheduler-ui/src/views/projects/workflow/instance/detail/index.tsx index 88992c3c41..95f895c211 100644 --- a/dolphinscheduler-ui/src/views/projects/workflow/instance/detail/index.tsx +++ b/dolphinscheduler-ui/src/views/projects/workflow/instance/detail/index.tsx @@ -33,6 +33,7 @@ import { Location } from '../../components/dag/types' import Styles from './index.module.scss' +import { useGraphAutoLayout } from '../../components/dag/use-graph-auto-layout' interface SaveData { saveForm: SaveForm @@ -53,10 +54,18 @@ export default defineComponent({ const definition = ref() const instance = ref() + const dagInstanceRef = ref() const refresh = () => { queryProcessInstanceById(id, projectCode).then((res: any) => { instance.value = res + if (!res.dagData.processDefinition.locations) { + setTimeout(() => { + const graph = dagInstanceRef.value + const { submit } = useGraphAutoLayout({ graph }) + submit() + }, 1000) + } if (res.dagData) { definition.value = res.dagData } @@ -109,6 +118,7 @@ export default defineComponent({ ]} >