From 8402367d826ae742dedc2c6cfbe51fbab57a1fcf Mon Sep 17 00:00:00 2001 From: Amy0104 <97265214+Amy0104@users.noreply.github.com> Date: Tue, 15 Mar 2022 17:09:58 +0800 Subject: [PATCH] =?UTF-8?q?[Fix][UI=20Next][V1.0.0-Alpha]=20Fix=20some=20t?= =?UTF-8?q?ypes=20missing=20when=20direct=20was=20e=E2=80=A6=20(#8898)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Fix][UI Next][V1.0.0-Alpha] Fix some types missing when direct was export in sqoop task node. * Fix][UI Next][V1.0.0-Alpha] Remove watch in use sqoop file. --- .../task/components/node/fields/use-sqoop-source-type.ts | 3 ++- .../task/components/node/fields/use-sqoop-target-type.ts | 3 ++- .../projects/task/components/node/fields/use-sqoop.ts | 7 +------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-source-type.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-source-type.ts index 6398a17440..37833795eb 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-source-type.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-source-type.ts @@ -87,7 +87,8 @@ export function useSourceType(model: { [field: string]: any }): IJsonItem[] { watch( () => model.modelType, (modelType: ModelType) => { - getSourceTypesByModelType(modelType) + sourceTypes.value = getSourceTypesByModelType(modelType) + model.sourceType = sourceTypes.value[0].value } ) diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-target-type.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-target-type.ts index 5bf052a043..606dfdf676 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-target-type.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-target-type.ts @@ -92,7 +92,8 @@ export function useTargetType(model: { [field: string]: any }): IJsonItem[] { watch( () => [model.sourceType, model.srcQueryType], ([sourceType, srcQueryType]) => { - getTargetTypesBySourceType(sourceType, srcQueryType) + targetTypes.value = getTargetTypesBySourceType(sourceType, srcQueryType) + model.targetType = targetTypes.value[0].value } ) diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop.ts index a1a074c76a..39040f63b1 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop.ts @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { watch, computed, unref } from 'vue' +import { computed, unref } from 'vue' import { useI18n } from 'vue-i18n' import { useCustomParams, useSourceType, useTargetType } from '.' import type { IJsonItem, ModelType } from '../types' @@ -24,11 +24,6 @@ export function useSqoop(model: { [field: string]: any }): IJsonItem[] { const customSpan = computed(() => (model.isCustomTask ? 24 : 0)) const unCustomSpan = computed(() => (model.isCustomTask ? 0 : 24)) - watch( - () => model.srcQueryType, - () => {} - ) - return [ { type: 'switch',