This is an automated email from the ASF dual-hosted git repository.

songjian pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new d1f5bbfcae [Fix]fix the search bar echoes abnormally (#9835)
d1f5bbfcae is described below

commit d1f5bbfcae3659c885a20e4ea9f0e05001f2db42
Author: labbomb <[email protected]>
AuthorDate: Thu Apr 28 19:49:58 2022 +0800

    [Fix]fix the search bar echoes abnormally (#9835)
---
 .../src/views/projects/workflow/components/dag/dag-toolbar.tsx      | 2 ++
 .../src/views/projects/workflow/components/dag/use-node-search.ts   | 6 ++++++
 .../src/views/projects/workflow/components/dag/use-task-edit.ts     | 2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git 
a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-toolbar.tsx
 
b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-toolbar.tsx
index fb35486d14..c1155efa48 100644
--- 
a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-toolbar.tsx
+++ 
b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-toolbar.tsx
@@ -84,6 +84,7 @@ export default defineComponent({
      * Node search and navigate
      */
     const {
+      searchSelectValue,
       navigateTo,
       toggleSearchInput,
       searchInputVisible,
@@ -315,6 +316,7 @@ export default defineComponent({
           >
             <NSelect
               size='small'
+              value={searchSelectValue.value}
               options={nodesDropdown.value}
               onFocus={reQueryNodes}
               onUpdateValue={navigateTo}
diff --git 
a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-node-search.ts
 
b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-node-search.ts
index c5a81abc09..62e0f129c2 100644
--- 
a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-node-search.ts
+++ 
b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-node-search.ts
@@ -26,6 +26,8 @@ interface Options {
  * Node search and navigate
  */
 export function useNodeSearch(options: Options) {
+  const searchSelectValue = ref('')
+
   const { graph } = options
 
   /**
@@ -46,6 +48,8 @@ export function useNodeSearch(options: Options) {
       label: node.getData().taskName,
       value: node.id
     }))
+    const filterSelect = nodesDropdown.value.findIndex(item => item.value === 
searchSelectValue.value)
+    filterSelect === -1 && (searchSelectValue.value = '')
   }
 
   /**
@@ -53,6 +57,7 @@ export function useNodeSearch(options: Options) {
    * @param {string} code
    */
   function navigateTo(code: string) {
+    searchSelectValue.value = code
     if (!graph.value) return
     const cell = graph.value.getCellById(code)
     graph.value.scrollToCell(cell, { animation: { duration: 600 } })
@@ -61,6 +66,7 @@ export function useNodeSearch(options: Options) {
   }
 
   return {
+    searchSelectValue,
     navigateTo,
     toggleSearchInput,
     searchInputVisible,
diff --git 
a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-task-edit.ts
 
b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-task-edit.ts
index 770f52a532..c90d03dced 100644
--- 
a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-task-edit.ts
+++ 
b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-task-edit.ts
@@ -106,7 +106,7 @@ export function useTaskEdit(options: Options) {
 
   /**
    * Remove task
-   * @param {number} code
+   * @param {number} codes
    */
   function removeTasks(codes: number[]) {
     processDefinition.value.taskDefinitionList =

Reply via email to