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',