From bf74b4280fa7c98ea3ec5c5c995bfe0d2f3710d1 Mon Sep 17 00:00:00 2001
From: songjianet <1778651752@qq.com>
Date: Thu, 10 Nov 2022 17:28:20 +0800
Subject: [PATCH] [Feature][UI] Joint debugging of the interface of the mvp
version of the dynamic task component. (#12859)
* [Feature][UI] Joint debugging of the interface of the mvp version of the dynamic task component.
* [Feature][UI] Joint debugging of the interface of the mvp version of the dynamic task component.
* [Feature][UI] Joint debugging of the interface of the mvp version of the dynamic task component.
---
.../src/service/modules/dynamic-dag/index.ts | 39 ++++++
.../components/dynamic-dag/dag-sidebar.tsx | 4 +-
.../workflow/components/dynamic-dag/index.tsx | 20 +++-
.../components/dynamic-dag/task/index.tsx | 8 +-
.../dynamic-dag/task/use-task-form.ts | 113 ++----------------
.../components/dynamic-dag/use-sidebar.ts | 14 ++-
6 files changed, 83 insertions(+), 115 deletions(-)
create mode 100644 dolphinscheduler-ui/src/service/modules/dynamic-dag/index.ts
diff --git a/dolphinscheduler-ui/src/service/modules/dynamic-dag/index.ts b/dolphinscheduler-ui/src/service/modules/dynamic-dag/index.ts
new file mode 100644
index 0000000000..c52e763d79
--- /dev/null
+++ b/dolphinscheduler-ui/src/service/modules/dynamic-dag/index.ts
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { axios } from '@/service/service'
+
+export function queryDynamicTaskCategories(): any {
+ return axios({
+ url: '/dynamic/taskCategories',
+ method: 'get'
+ })
+}
+
+export function queryDynamicTaskResourceList(categories: string): any {
+ return axios({
+ url: `/dynamic/${categories}/taskTypes`,
+ method: 'get'
+ })
+}
+
+export function queryDynamicTaskResource(url: string): any {
+ return axios({
+ url,
+ method: 'get'
+ })
+}
\ No newline at end of file
diff --git a/dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/dag-sidebar.tsx b/dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/dag-sidebar.tsx
index cf933a1bd8..b44da1d183 100644
--- a/dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/dag-sidebar.tsx
+++ b/dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/dag-sidebar.tsx
@@ -42,10 +42,10 @@ const DagSidebar = defineComponent({
return (