瀏覽代碼

[Fix][Next-UI] Fix the jumping problem of close button on dag page. (#9494)

Amy0104 3 年之前
父節點
當前提交
8a2fbd205e
共有 1 個文件被更改,包括 16 次插入1 次删除
  1. 16 1
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-toolbar.tsx

+ 16 - 1
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-toolbar.tsx

@@ -140,7 +140,22 @@ export default defineComponent({
      * Back to the entrance
      */
     const onClose = () => {
-      router.go(-1)
+      if (history.state.back !== '/login') {
+        router.go(-1)
+        return
+      }
+      if (history.state.current.includes('workflow/definitions')) {
+        router.push({
+          path: `/projects/${route.params.projectCode}/workflow-definition`
+        })
+        return
+      }
+      if (history.state.current.includes('workflow/instances')) {
+        router.push({
+          path: `/projects/${route.params.projectCode}/workflow/instances`
+        })
+        return
+      }
     }
 
     /**