Browse Source

[Fix][UI Next][V1.0.0-Alpha]Fix the default value of custom template incorrect in DATAX. (#9163)

3.0.0/version-upgrade
Amy0104 3 years ago committed by GitHub
parent
commit
327a60efd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datax.ts
  2. 5
      dolphinscheduler-ui-next/src/views/projects/task/components/node/format-data.ts
  3. 25
      dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-datax.ts
  4. 2
      dolphinscheduler-ui-next/src/views/projects/task/components/node/types.ts

8
dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datax.ts

@ -205,8 +205,7 @@ export function useDataX(model: { [field: string]: any }): IJsonItem[] {
const customParameterSpan = ref(0)
const initConstants = () => {
if (model.customConfigSwitch) {
model.customConfig = 1
if (model.customConfig) {
sqlEditorSpan.value = 0
jsonEditorSpan.value = 24
datasourceSpan.value = 0
@ -215,7 +214,6 @@ export function useDataX(model: { [field: string]: any }): IJsonItem[] {
jobSpeedSpan.value = 0
customParameterSpan.value = 24
} else {
model.customConfig = 0
sqlEditorSpan.value = 24
jsonEditorSpan.value = 0
datasourceSpan.value = 12
@ -244,7 +242,7 @@ export function useDataX(model: { [field: string]: any }): IJsonItem[] {
}
watch(
() => model.customConfigSwitch,
() => model.customConfig,
() => {
initConstants()
}
@ -253,7 +251,7 @@ export function useDataX(model: { [field: string]: any }): IJsonItem[] {
return [
{
type: 'switch',
field: 'customConfigSwitch',
field: 'customConfig',
name: t('project.node.datax_custom_template')
},
{

5
dolphinscheduler-ui-next/src/views/projects/task/components/node/format-data.ts

@ -227,7 +227,7 @@ export function formatParams(data: INodeData): {
}
if (data.taskType === 'DATAX') {
taskParams.customConfig = data.customConfig
taskParams.customConfig = data.customConfig ? 1 : 0
if (taskParams.customConfig === 0) {
taskParams.dsType = data.dsType
taskParams.dataSource = data.dataSource
@ -484,6 +484,9 @@ export function formatModel(data: ITaskData) {
if (data.taskParams?.udfs) {
params.udfs = data.taskParams.udfs?.split(',')
}
if (data.taskParams?.customConfig !== void 0) {
params.customConfig = data.taskParams.customConfig === 1 ? true : false
}
return params
}

25
dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-datax.ts

@ -44,26 +44,11 @@ export function useDataX({
workerGroup: 'default',
delayTime: 0,
timeout: 30,
customConfig: data?.taskParams?.customConfig
? data?.taskParams?.customConfig
: 0,
customConfigSwitch: data?.taskParams?.customConfig !== 0,
dsType: data?.taskParams?.dsType ? data?.taskParams?.dsType : 'MYSQL',
dataSource: data?.taskParams?.dataSource,
dtType: data?.taskParams?.dtType ? data?.taskParams?.dtType : 'MYSQL',
dataTarget: data?.taskParams?.dataTarget,
sql: data?.taskParams?.sql,
targetTable: data?.taskParams?.targetTable,
preStatements: data?.taskParams?.preStatements
? data?.taskParams?.preStatements
: [],
postStatements: data?.taskParams?.postStatements
? data?.taskParams?.postStatements
: [],
jobSpeedByte: data?.taskParams?.jobSpeedByte,
jobSpeedRecord: data?.taskParams?.jobSpeedRecord,
xms: data?.taskParams?.xms,
xmx: data?.taskParams?.xmx
customConfig: false,
dsType: 'MYSQL',
dtType: 'MYSQL',
preStatements: [],
postStatements: []
} as INodeData)
let extra: IJsonItem[] = []

2
dolphinscheduler-ui-next/src/views/projects/task/components/node/types.ts

@ -299,6 +299,7 @@ interface INodeData
| 'sparkParameters'
| 'conditionResult'
| 'udfs'
| 'customConfig'
>,
ISqoopTargetData,
ISqoopSourceData,
@ -336,6 +337,7 @@ interface INodeData
successBranch?: number
failedBranch?: number
udfs?: string[]
customConfig?: boolean
}
interface ITaskData

Loading…
Cancel
Save