|
|
@ -65,7 +65,7 @@ |
|
|
|
<m-datasource |
|
|
|
<m-datasource |
|
|
|
ref="refSourceDs" |
|
|
|
ref="refSourceDs" |
|
|
|
@on-dsData="_onSourceDsData" |
|
|
|
@on-dsData="_onSourceDsData" |
|
|
|
:data="{ type:'MYSQL',datasource:srcDatasource }" |
|
|
|
:data="{ type:sourceMysqlParams.srcType,datasource:sourceMysqlParams.srcDatasource }" |
|
|
|
> |
|
|
|
> |
|
|
|
</m-datasource> |
|
|
|
</m-datasource> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -186,8 +186,8 @@ |
|
|
|
<div slot="content"> |
|
|
|
<div slot="content"> |
|
|
|
<div class="from-mirror"> |
|
|
|
<div class="from-mirror"> |
|
|
|
<textarea |
|
|
|
<textarea |
|
|
|
id="code-sql-mirror" |
|
|
|
id="code-sqoop-mirror" |
|
|
|
name="code-sql-mirror" |
|
|
|
name="code-sqoop-mirror" |
|
|
|
style="opacity: 0;"> |
|
|
|
style="opacity: 0;"> |
|
|
|
</textarea> |
|
|
|
</textarea> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -385,7 +385,7 @@ |
|
|
|
<m-datasource |
|
|
|
<m-datasource |
|
|
|
ref="refTargetDs" |
|
|
|
ref="refTargetDs" |
|
|
|
@on-dsData="_onTargetDsData" |
|
|
|
@on-dsData="_onTargetDsData" |
|
|
|
:data="{ type:type,datasource:targetDatasource }" |
|
|
|
:data="{ type:targetMysqlParams.targetType,datasource:targetMysqlParams.targetDatasource }" |
|
|
|
> |
|
|
|
> |
|
|
|
</m-datasource> |
|
|
|
</m-datasource> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -556,7 +556,8 @@ |
|
|
|
targetType:"HDFS", |
|
|
|
targetType:"HDFS", |
|
|
|
|
|
|
|
|
|
|
|
sourceMysqlParams:{ |
|
|
|
sourceMysqlParams:{ |
|
|
|
srcDatasource:-1, |
|
|
|
srcType:"MYSQL", |
|
|
|
|
|
|
|
srcDatasource:"", |
|
|
|
srcTable:"", |
|
|
|
srcTable:"", |
|
|
|
srcQueryType:"1", |
|
|
|
srcQueryType:"1", |
|
|
|
srcQuerySql:'', |
|
|
|
srcQuerySql:'', |
|
|
@ -588,7 +589,8 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
targetMysqlParams:{ |
|
|
|
targetMysqlParams:{ |
|
|
|
targetDatasource:-1, |
|
|
|
targetType:"MYSQL", |
|
|
|
|
|
|
|
targetDatasource:"", |
|
|
|
targetTable:"", |
|
|
|
targetTable:"", |
|
|
|
targetColumns:"", |
|
|
|
targetColumns:"", |
|
|
|
fieldsTerminated:"", |
|
|
|
fieldsTerminated:"", |
|
|
@ -680,6 +682,7 @@ |
|
|
|
* return data source |
|
|
|
* return data source |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
_onSourceDsData (o) { |
|
|
|
_onSourceDsData (o) { |
|
|
|
|
|
|
|
this.sourceMysqlParams.srcType = o.type |
|
|
|
this.sourceMysqlParams.srcDatasource = o.datasource |
|
|
|
this.sourceMysqlParams.srcDatasource = o.datasource |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -687,6 +690,7 @@ |
|
|
|
* return data source |
|
|
|
* return data source |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
_onTargetDsData (o) { |
|
|
|
_onTargetDsData (o) { |
|
|
|
|
|
|
|
this.targetMysqlParams.targetType = o.type |
|
|
|
this.targetMysqlParams.targetDatasource = o.datasource |
|
|
|
this.targetMysqlParams.targetDatasource = o.datasource |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -697,7 +701,7 @@ |
|
|
|
var params = null |
|
|
|
var params = null |
|
|
|
switch(this.sourceType){ |
|
|
|
switch(this.sourceType){ |
|
|
|
case "MYSQL": |
|
|
|
case "MYSQL": |
|
|
|
this.sourceMysqlParams.srcQuerySql = editor.getValue() |
|
|
|
this.sourceMysqlParams.srcQuerySql = editor ? editor.getValue() : this.sourceMysqlParams.srcQuerySql |
|
|
|
params = JSON.stringify(this.sourceMysqlParams) |
|
|
|
params = JSON.stringify(this.sourceMysqlParams) |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "ORACLE": |
|
|
|
case "ORACLE": |
|
|
@ -879,7 +883,9 @@ |
|
|
|
* Processing code highlighting |
|
|
|
* Processing code highlighting |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
_handlerEditor () { |
|
|
|
_handlerEditor () { |
|
|
|
editor = codemirror('code-sql-mirror', { |
|
|
|
this._destroyEditor() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
editor = codemirror('code-sqoop-mirror', { |
|
|
|
mode: 'sql', |
|
|
|
mode: 'sql', |
|
|
|
readOnly: this.isDetails |
|
|
|
readOnly: this.isDetails |
|
|
|
}) |
|
|
|
}) |
|
|
@ -892,9 +898,15 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.changes = () => { |
|
|
|
|
|
|
|
this._cacheParams() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Monitor keyboard |
|
|
|
// Monitor keyboard |
|
|
|
editor.on('keypress', this.keypress) |
|
|
|
editor.on('keypress', this.keypress) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
editor.on('changes', this.changes) |
|
|
|
|
|
|
|
|
|
|
|
editor.setValue(this.sourceMysqlParams.srcQuerySql) |
|
|
|
editor.setValue(this.sourceMysqlParams.srcQuerySql) |
|
|
|
|
|
|
|
|
|
|
|
return editor |
|
|
|
return editor |
|
|
@ -906,6 +918,27 @@ |
|
|
|
_onLocalParams (a) { |
|
|
|
_onLocalParams (a) { |
|
|
|
this.localParams = a |
|
|
|
this.localParams = a |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_cacheParams () { |
|
|
|
|
|
|
|
this.$emit('on-cache-params', { |
|
|
|
|
|
|
|
concurrency:this.concurrency, |
|
|
|
|
|
|
|
modelType:this.modelType, |
|
|
|
|
|
|
|
sourceType:this.sourceType, |
|
|
|
|
|
|
|
targetType:this.targetType, |
|
|
|
|
|
|
|
sourceParams:this._handleSourceParams(), |
|
|
|
|
|
|
|
targetParams:this._handleTargetParams(), |
|
|
|
|
|
|
|
localParams:this.localParams |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_destroyEditor () { |
|
|
|
|
|
|
|
if (editor) { |
|
|
|
|
|
|
|
editor.toTextArea() // Uninstall |
|
|
|
|
|
|
|
editor.off($('.code-sqoop-mirror'), 'keypress', this.keypress) |
|
|
|
|
|
|
|
editor.off($('.code-sqoop-mirror'), 'changes', this.changes) |
|
|
|
|
|
|
|
editor = null |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
// Listening to sqlType |
|
|
|
// Listening to sqlType |
|
|
@ -927,11 +960,12 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
//Watch the cacheParams |
|
|
|
//Watch the cacheParams |
|
|
|
cacheParams (val) { |
|
|
|
cacheParams (val) { |
|
|
|
this.$emit('on-cache-params', val); |
|
|
|
this._cacheParams() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
created () { |
|
|
|
created () { |
|
|
|
|
|
|
|
this._destroyEditor() |
|
|
|
let o = this.backfillItem |
|
|
|
let o = this.backfillItem |
|
|
|
|
|
|
|
|
|
|
|
// Non-null objects represent backfill |
|
|
|
// Non-null objects represent backfill |
|
|
@ -963,11 +997,28 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
if (editor) { |
|
|
|
if (editor) { |
|
|
|
editor.toTextArea() // Uninstall |
|
|
|
editor.toTextArea() // Uninstall |
|
|
|
editor.off($('.code-sql-mirror'), 'keypress', this.keypress) |
|
|
|
editor.off($('.code-sqoop-mirror'), 'keypress', this.keypress) |
|
|
|
|
|
|
|
editor.off($('.code-sqoop-mirror'), 'changes', this.changes) |
|
|
|
|
|
|
|
editor = null |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
|
|
|
|
cacheParams () { |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
concurrency:this.concurrency, |
|
|
|
|
|
|
|
modelType:this.modelType, |
|
|
|
|
|
|
|
sourceType:this.sourceType, |
|
|
|
|
|
|
|
targetType:this.targetType, |
|
|
|
|
|
|
|
localParams:this.localParams, |
|
|
|
|
|
|
|
sourceMysqlParams:this.sourceMysqlParams, |
|
|
|
|
|
|
|
sourceHdfsParams:this.sourceHdfsParams, |
|
|
|
|
|
|
|
sourceHiveParams:this.sourceHiveParams, |
|
|
|
|
|
|
|
targetHdfsParams:this.targetHdfsParams, |
|
|
|
|
|
|
|
targetMysqlParams:this.targetMysqlParams, |
|
|
|
|
|
|
|
targetHiveParams:this.targetHiveParams |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
components: { mListBox, mDatasource, mLocalParams} |
|
|
|
components: { mListBox, mDatasource, mLocalParams} |
|
|
|
} |
|
|
|
} |
|
|
|