|
|
@ -17,13 +17,49 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="sql-model"> |
|
|
|
<div class="sql-model"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<m-list-box> |
|
|
|
|
|
|
|
<div slot="text">{{$t('Custom Job')}}</div> |
|
|
|
|
|
|
|
<div slot="content"> |
|
|
|
|
|
|
|
<x-switch |
|
|
|
|
|
|
|
v-model="isCustomTask" |
|
|
|
|
|
|
|
@on-click="_onSwitch" |
|
|
|
|
|
|
|
:disabled="isDetails" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
</x-switch> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</m-list-box> |
|
|
|
|
|
|
|
<m-list-box v-show="isCustomTask"> |
|
|
|
|
|
|
|
<div slot="text">{{$t('Custom Script')}}</div> |
|
|
|
|
|
|
|
<div slot="content"> |
|
|
|
|
|
|
|
<div class="from-mirror"> |
|
|
|
|
|
|
|
<textarea |
|
|
|
|
|
|
|
id="code-shell-mirror" |
|
|
|
|
|
|
|
name="code-shell-mirror" |
|
|
|
|
|
|
|
style="opacity: 0;"> |
|
|
|
|
|
|
|
</textarea> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</m-list-box> |
|
|
|
|
|
|
|
<template v-if="!isCustomTask"> |
|
|
|
|
|
|
|
<m-list-box> |
|
|
|
|
|
|
|
<div slot="text">{{$t('Sqoop Job Name')}}</div> |
|
|
|
|
|
|
|
<div slot="content"> |
|
|
|
|
|
|
|
<x-input |
|
|
|
|
|
|
|
:disabled="isDetails" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
v-model="jobName" |
|
|
|
|
|
|
|
:placeholder="$t('Please enter Job Name(required)')"> |
|
|
|
|
|
|
|
</x-input> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</m-list-box> |
|
|
|
<m-list-box> |
|
|
|
<m-list-box> |
|
|
|
<div slot="text">{{$t('Direct')}}</div> |
|
|
|
<div slot="text">{{$t('Direct')}}</div> |
|
|
|
<div slot="content"> |
|
|
|
<div slot="content"> |
|
|
|
<x-select |
|
|
|
<x-select |
|
|
|
style="width: 130px;" |
|
|
|
style="width: 130px;" |
|
|
|
v-model="modelType" |
|
|
|
v-model="modelType" |
|
|
|
:disabled="isDetails"> |
|
|
|
:disabled="isDetails" |
|
|
|
|
|
|
|
@on-change="_handleModelTypeChange"> |
|
|
|
<x-option |
|
|
|
<x-option |
|
|
|
v-for="city in modelTypeList" |
|
|
|
v-for="city in modelTypeList" |
|
|
|
:key="city.code" |
|
|
|
:key="city.code" |
|
|
@ -33,6 +69,28 @@ |
|
|
|
</x-select> |
|
|
|
</x-select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</m-list-box> |
|
|
|
</m-list-box> |
|
|
|
|
|
|
|
<m-list-box> |
|
|
|
|
|
|
|
<div slot="text" style="width: 110px;">{{$t('Hadoop Custom Params')}}</div> |
|
|
|
|
|
|
|
<div slot="content"> |
|
|
|
|
|
|
|
<m-local-params |
|
|
|
|
|
|
|
ref="refMapColumnHadoopParams" |
|
|
|
|
|
|
|
@on-local-params="_onHadoopCustomParams" |
|
|
|
|
|
|
|
:udp-list="hadoopCustomParams" |
|
|
|
|
|
|
|
:hide="false"> |
|
|
|
|
|
|
|
</m-local-params> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</m-list-box> |
|
|
|
|
|
|
|
<m-list-box> |
|
|
|
|
|
|
|
<div slot="text" style="width: 100px;">{{$t('Sqoop Advanced Parameters')}}</div> |
|
|
|
|
|
|
|
<div slot="content"> |
|
|
|
|
|
|
|
<m-local-params |
|
|
|
|
|
|
|
ref="refMapColumnAdvancedParams" |
|
|
|
|
|
|
|
@on-local-params="_onSqoopAdvancedParams" |
|
|
|
|
|
|
|
:udp-list="sqoopAdvancedParams" |
|
|
|
|
|
|
|
:hide="false"> |
|
|
|
|
|
|
|
</m-local-params> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</m-list-box> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<m-list-box> |
|
|
|
<m-list-box> |
|
|
@ -65,7 +123,9 @@ |
|
|
|
<m-datasource |
|
|
|
<m-datasource |
|
|
|
ref="refSourceDs" |
|
|
|
ref="refSourceDs" |
|
|
|
@on-dsData="_onSourceDsData" |
|
|
|
@on-dsData="_onSourceDsData" |
|
|
|
:data="{ type:sourceMysqlParams.srcType,datasource:sourceMysqlParams.srcDatasource }" |
|
|
|
:data="{type:sourceMysqlParams.srcType, |
|
|
|
|
|
|
|
typeList: [{id: 0, code: 'MYSQL', disabled: false}], |
|
|
|
|
|
|
|
datasource:sourceMysqlParams.srcDatasource }" |
|
|
|
> |
|
|
|
> |
|
|
|
</m-datasource> |
|
|
|
</m-datasource> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -385,7 +445,9 @@ |
|
|
|
<m-datasource |
|
|
|
<m-datasource |
|
|
|
ref="refTargetDs" |
|
|
|
ref="refTargetDs" |
|
|
|
@on-dsData="_onTargetDsData" |
|
|
|
@on-dsData="_onTargetDsData" |
|
|
|
:data="{ type:targetMysqlParams.targetType,datasource:targetMysqlParams.targetDatasource }" |
|
|
|
:data="{ type:targetMysqlParams.targetType, |
|
|
|
|
|
|
|
typeList: [{id: 0, code: 'MYSQL', disabled: false}], |
|
|
|
|
|
|
|
datasource:targetMysqlParams.targetDatasource }" |
|
|
|
> |
|
|
|
> |
|
|
|
</m-datasource> |
|
|
|
</m-datasource> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -474,7 +536,7 @@ |
|
|
|
</x-input> |
|
|
|
</x-input> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</m-list-box> |
|
|
|
</m-list-box> |
|
|
|
|
|
|
|
</template> |
|
|
|
<m-list-box> |
|
|
|
<m-list-box> |
|
|
|
<div slot="text">{{$t('Custom Parameters')}}</div> |
|
|
|
<div slot="text">{{$t('Custom Parameters')}}</div> |
|
|
|
<div slot="content"> |
|
|
|
<div slot="content"> |
|
|
@ -498,16 +560,38 @@ |
|
|
|
import codemirror from '@/conf/home/pages/resource/pages/file/pages/_source/codemirror' |
|
|
|
import codemirror from '@/conf/home/pages/resource/pages/file/pages/_source/codemirror' |
|
|
|
|
|
|
|
|
|
|
|
let editor |
|
|
|
let editor |
|
|
|
|
|
|
|
let shellEditor |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: 'sql', |
|
|
|
name: 'sql', |
|
|
|
data () { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Is Custom Task |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
isCustomTask: false, |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Customer Params |
|
|
|
* Customer Params |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
localParams: [], |
|
|
|
localParams: [], |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Hadoop Custom Params |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
hadoopCustomParams: [], |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Sqoop Advanced Params |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
sqoopAdvancedParams: [], |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* script |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
customShell: '', |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* task name |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
jobName: '', |
|
|
|
/** |
|
|
|
/** |
|
|
|
* mysql query type |
|
|
|
* mysql query type |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -524,6 +608,10 @@ |
|
|
|
* concurrency |
|
|
|
* concurrency |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
concurrency:1, |
|
|
|
concurrency:1, |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* default job type |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
jobType:'TEMPLATE', |
|
|
|
/** |
|
|
|
/** |
|
|
|
* direct model type |
|
|
|
* direct model type |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -535,12 +623,6 @@ |
|
|
|
{ |
|
|
|
{ |
|
|
|
code: "MYSQL" |
|
|
|
code: "MYSQL" |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
|
|
|
|
code:"HDFS" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
code:"HIVE" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
targetTypeList:[ |
|
|
|
targetTypeList:[ |
|
|
@ -620,8 +702,32 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_onSwitch(is){ |
|
|
|
|
|
|
|
if(is) { |
|
|
|
|
|
|
|
this.jobType = 'CUSTOM' |
|
|
|
|
|
|
|
this.isCustomTask = true |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
|
|
this._handlerShellEditor() |
|
|
|
|
|
|
|
}, 200) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.jobType = 'TEMPLATE' |
|
|
|
|
|
|
|
this.isCustomTask = false |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
|
|
this._handlerEditor() |
|
|
|
|
|
|
|
}, 200) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_handleQueryType(o){ |
|
|
|
_handleQueryType(o){ |
|
|
|
this.sourceMysqlParams.srcQueryType = this.srcQueryType |
|
|
|
this.sourceMysqlParams.srcQueryType = this.srcQueryType |
|
|
|
|
|
|
|
this._getTargetTypeList(this.sourceType) |
|
|
|
|
|
|
|
this.targetType = this.targetTypeList[0].code |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_handleModelTypeChange(a){ |
|
|
|
|
|
|
|
this._getSourceTypeList(a.label) |
|
|
|
|
|
|
|
this.sourceType = this.sourceTypeList[0].code |
|
|
|
|
|
|
|
this._handleSourceTypeChange({label: this.sourceType, value: this.sourceType}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_handleSourceTypeChange(a){ |
|
|
|
_handleSourceTypeChange(a){ |
|
|
@ -629,9 +735,50 @@ |
|
|
|
this.targetType = this.targetTypeList[0].code |
|
|
|
this.targetType = this.targetTypeList[0].code |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_getSourceTypeList(data){ |
|
|
|
|
|
|
|
switch(data){ |
|
|
|
|
|
|
|
case 'import': |
|
|
|
|
|
|
|
this.sourceTypeList = [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
code:"MYSQL" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 'export': |
|
|
|
|
|
|
|
this.sourceTypeList = [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
code: "HDFS" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
code: "HIVE" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
this.sourceTypeList = [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
code:"MYSQL" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
code:"HIVE" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
code:"HDFS" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_getTargetTypeList(data){ |
|
|
|
_getTargetTypeList(data){ |
|
|
|
switch(data){ |
|
|
|
switch(data){ |
|
|
|
case 'MYSQL': |
|
|
|
case 'MYSQL': |
|
|
|
|
|
|
|
if (this.srcQueryType === "1") { |
|
|
|
|
|
|
|
this.targetTypeList = [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
code: "HDFS" |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
} else { |
|
|
|
this.targetTypeList = [ |
|
|
|
this.targetTypeList = [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
code: "HIVE" |
|
|
|
code: "HIVE" |
|
|
@ -640,6 +787,7 @@ |
|
|
|
code: "HDFS" |
|
|
|
code: "HDFS" |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'HDFS': |
|
|
|
case 'HDFS': |
|
|
|
this.targetTypeList = [ |
|
|
|
this.targetTypeList = [ |
|
|
@ -670,12 +818,10 @@ |
|
|
|
|
|
|
|
|
|
|
|
_onMapColumnHive (a) { |
|
|
|
_onMapColumnHive (a) { |
|
|
|
this.sourceMysqlParams.mapColumnHive = a |
|
|
|
this.sourceMysqlParams.mapColumnHive = a |
|
|
|
console.log(this.sourceMysqlParams.mapColumnHive) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_onMapColumnJava (a) { |
|
|
|
_onMapColumnJava (a) { |
|
|
|
this.sourceMysqlParams.mapColumnJava = a |
|
|
|
this.sourceMysqlParams.mapColumnJava = a |
|
|
|
console.log(this.sourceMysqlParams.mapColumnJava) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -701,7 +847,8 @@ |
|
|
|
var params = null |
|
|
|
var params = null |
|
|
|
switch(this.sourceType){ |
|
|
|
switch(this.sourceType){ |
|
|
|
case "MYSQL": |
|
|
|
case "MYSQL": |
|
|
|
this.sourceMysqlParams.srcQuerySql = editor ? editor.getValue() : this.sourceMysqlParams.srcQuerySql |
|
|
|
this.sourceMysqlParams.srcQuerySql = this.sourceMysqlParams.srcQueryType === "1" && editor ? |
|
|
|
|
|
|
|
editor.getValue() : this.sourceMysqlParams.srcQuerySql |
|
|
|
params = JSON.stringify(this.sourceMysqlParams) |
|
|
|
params = JSON.stringify(this.sourceMysqlParams) |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "ORACLE": |
|
|
|
case "ORACLE": |
|
|
@ -791,6 +938,21 @@ |
|
|
|
* verification |
|
|
|
* verification |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
_verification () { |
|
|
|
_verification () { |
|
|
|
|
|
|
|
let sqoopParams = { |
|
|
|
|
|
|
|
jobType: this.jobType, |
|
|
|
|
|
|
|
localParams: this.localParams |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (this.jobType === 'CUSTOM') { |
|
|
|
|
|
|
|
if (!shellEditor.getValue()) { |
|
|
|
|
|
|
|
this.$message.warning(`${i18n.$t('Please enter Custom Shell(required)')}`) |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
sqoopParams['customShell'] = shellEditor.getValue() |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (!this.jobName) { |
|
|
|
|
|
|
|
this.$message.warning(`${i18n.$t('Please enter Job Name(required)')}`) |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
switch (this.sourceType) { |
|
|
|
switch (this.sourceType) { |
|
|
|
case "MYSQL": |
|
|
|
case "MYSQL": |
|
|
@ -802,16 +964,22 @@ |
|
|
|
this.$message.warning(`${i18n.$t('Please enter a SQL Statement(required)')}`) |
|
|
|
this.$message.warning(`${i18n.$t('Please enter a SQL Statement(required)')}`) |
|
|
|
return false |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.sourceMysqlParams.srcTable = "" |
|
|
|
|
|
|
|
this.sourceMysqlParams.srcColumnType = "0" |
|
|
|
|
|
|
|
this.sourceMysqlParams.srcColumns = "" |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (this.sourceMysqlParams.srcTable === "") { |
|
|
|
if (this.sourceMysqlParams.srcTable === "") { |
|
|
|
this.$message.warning(`${i18n.$t('Please enter Mysql Table(required)')}`) |
|
|
|
this.$message.warning(`${i18n.$t('Please enter Mysql Table(required)')}`) |
|
|
|
return false |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.sourceMysqlParams.srcQuerySql = "" |
|
|
|
if (this.sourceMysqlParams.srcColumnType === "1" && this.sourceMysqlParams.srcColumns === "") { |
|
|
|
if (this.sourceMysqlParams.srcColumnType === "1" && this.sourceMysqlParams.srcColumns === "") { |
|
|
|
this.$message.warning(`${i18n.$t('Please enter Columns (Comma separated)')}`) |
|
|
|
this.$message.warning(`${i18n.$t('Please enter Columns (Comma separated)')}`) |
|
|
|
return false |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (this.sourceMysqlParams.srcColumnType === "0") { |
|
|
|
|
|
|
|
this.sourceMysqlParams.srcColumns = "" |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
@ -865,17 +1033,19 @@ |
|
|
|
default: |
|
|
|
default: |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
sqoopParams['jobName'] = this.jobName |
|
|
|
|
|
|
|
sqoopParams['hadoopCustomParams'] = this.hadoopCustomParams |
|
|
|
|
|
|
|
sqoopParams['sqoopAdvancedParams'] = this.sqoopAdvancedParams |
|
|
|
|
|
|
|
sqoopParams['concurrency'] = this.concurrency |
|
|
|
|
|
|
|
sqoopParams['modelType'] = this.modelType |
|
|
|
|
|
|
|
sqoopParams['sourceType'] = this.sourceType |
|
|
|
|
|
|
|
sqoopParams['targetType'] = this.targetType |
|
|
|
|
|
|
|
sqoopParams['targetParams'] = this._handleTargetParams() |
|
|
|
|
|
|
|
sqoopParams['sourceParams'] = this._handleSourceParams() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// storage |
|
|
|
// storage |
|
|
|
this.$emit('on-params', { |
|
|
|
this.$emit('on-params', sqoopParams) |
|
|
|
concurrency:this.concurrency, |
|
|
|
|
|
|
|
modelType:this.modelType, |
|
|
|
|
|
|
|
sourceType:this.sourceType, |
|
|
|
|
|
|
|
targetType:this.targetType, |
|
|
|
|
|
|
|
sourceParams:this._handleSourceParams(), |
|
|
|
|
|
|
|
targetParams:this._handleTargetParams(), |
|
|
|
|
|
|
|
localParams:this.localParams |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return true |
|
|
|
return true |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -912,6 +1082,33 @@ |
|
|
|
return editor |
|
|
|
return editor |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Processing code highlighting |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
_handlerShellEditor () { |
|
|
|
|
|
|
|
this._destroyShellEditor() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// shellEditor |
|
|
|
|
|
|
|
shellEditor = codemirror('code-shell-mirror', { |
|
|
|
|
|
|
|
mode: 'shell', |
|
|
|
|
|
|
|
readOnly: this.isDetails |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.keypress = () => { |
|
|
|
|
|
|
|
if (!shellEditor.getOption('readOnly')) { |
|
|
|
|
|
|
|
shellEditor.showHint({ |
|
|
|
|
|
|
|
completeSingle: false |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Monitor keyboard |
|
|
|
|
|
|
|
shellEditor.on('keypress', this.keypress) |
|
|
|
|
|
|
|
shellEditor.setValue(this.customShell) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return shellEditor |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* return localParams |
|
|
|
* return localParams |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -919,6 +1116,20 @@ |
|
|
|
this.localParams = a |
|
|
|
this.localParams = a |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* return hadoopParams |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
_onHadoopCustomParams (a) { |
|
|
|
|
|
|
|
this.hadoopCustomParams = a |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* return sqoopAdvancedParams |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
_onSqoopAdvancedParams (a) { |
|
|
|
|
|
|
|
this.sqoopAdvancedParams = a |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_cacheParams () { |
|
|
|
_cacheParams () { |
|
|
|
this.$emit('on-cache-params', { |
|
|
|
this.$emit('on-cache-params', { |
|
|
|
concurrency:this.concurrency, |
|
|
|
concurrency:this.concurrency, |
|
|
@ -939,6 +1150,13 @@ |
|
|
|
editor = null |
|
|
|
editor = null |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
_destroyShellEditor () { |
|
|
|
|
|
|
|
if (shellEditor) { |
|
|
|
|
|
|
|
shellEditor.toTextArea() // Uninstall |
|
|
|
|
|
|
|
shellEditor.off($('.code-shell-mirror'), 'keypress', this.keypress) |
|
|
|
|
|
|
|
shellEditor.off($('.code-shell-mirror'), 'changes', this.changes) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
// Listening to sqlType |
|
|
|
// Listening to sqlType |
|
|
@ -970,15 +1188,25 @@ |
|
|
|
|
|
|
|
|
|
|
|
// Non-null objects represent backfill |
|
|
|
// Non-null objects represent backfill |
|
|
|
if (!_.isEmpty(o)) { |
|
|
|
if (!_.isEmpty(o)) { |
|
|
|
this.concurrency = o.params.concurrency || 1, |
|
|
|
this.jobType = o.params.jobType |
|
|
|
this.modelType = o.params.modelType, |
|
|
|
this.isCustomTask = false |
|
|
|
this.sourceType = o.params.sourceType, |
|
|
|
if (this.jobType === 'CUSTOM') { |
|
|
|
|
|
|
|
this.customShell = o.params.customShell |
|
|
|
|
|
|
|
this.isCustomTask = true |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.jobName = o.params.jobName |
|
|
|
|
|
|
|
this.hadoopCustomParams = o.params.hadoopCustomParams |
|
|
|
|
|
|
|
this.sqoopAdvancedParams = o.params.sqoopAdvancedParams |
|
|
|
|
|
|
|
this.concurrency = o.params.concurrency || 1 |
|
|
|
|
|
|
|
this.modelType = o.params.modelType |
|
|
|
|
|
|
|
this.sourceType = o.params.sourceType |
|
|
|
this._getTargetTypeList(this.sourceType) |
|
|
|
this._getTargetTypeList(this.sourceType) |
|
|
|
this.targetType = o.params.targetType, |
|
|
|
this.targetType = o.params.targetType |
|
|
|
this._getSourceParams(o.params.sourceParams), |
|
|
|
this._getSourceParams(o.params.sourceParams) |
|
|
|
this._getTargetParams(o.params.targetParams), |
|
|
|
this._getTargetParams(o.params.targetParams) |
|
|
|
this.localParams = o.params.localParams |
|
|
|
this.localParams = o.params.localParams |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
mounted () { |
|
|
|
mounted () { |
|
|
@ -986,6 +1214,10 @@ |
|
|
|
this._handlerEditor() |
|
|
|
this._handlerEditor() |
|
|
|
}, 200) |
|
|
|
}, 200) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
|
|
this._handlerShellEditor() |
|
|
|
|
|
|
|
}, 200) |
|
|
|
|
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
setTimeout(() => { |
|
|
|
this.srcQueryType = this.sourceMysqlParams.srcQueryType |
|
|
|
this.srcQueryType = this.sourceMysqlParams.srcQueryType |
|
|
|
}, 500) |
|
|
|
}, 500) |
|
|
|