Skip to content

Commit

Permalink
Merge pull request #14 from Dragon-Wong/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
WeiYe-Jing authored Jun 8, 2020
2 parents abd42e2 + 229810b commit 7c62564
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/PowershellEditor/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default {
lint: true
})
this.powershellEditor.setValue(this.value)
this.powershellEditor.setValue(this.value ? this.value : '')
this.powershellEditor.on('change', cm => {
this.$emit('changed', cm.getValue())
this.$emit('input', cm.getValue())
Expand Down
2 changes: 1 addition & 1 deletion src/components/PythonEditor/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default {
lint: true
})
this.pythonEditor.setValue(this.value)
this.pythonEditor.setValue(this.value ? this.value : '')
this.pythonEditor.on('change', cm => {
this.$emit('changed', cm.getValue())
this.$emit('input', cm.getValue())
Expand Down
2 changes: 1 addition & 1 deletion src/components/ShellEditor/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default {
lint: true
})
this.shellEditor.setValue(this.value)
this.shellEditor.setValue(this.value ? this.value : '')
this.shellEditor.on('change', cm => {
this.$emit('changed', cm.getValue())
this.$emit('input', cm.getValue())
Expand Down
20 changes: 20 additions & 0 deletions src/views/datax/jobInfo/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ import PythonEditor from '@/components/PythonEditor'
import PowershellEditor from '@/components/PowershellEditor'
import * as datasourceApi from '@/api/datax-jdbcDatasource'
import * as jobProjectApi from '@/api/datax-job-project'
import { isJSON } from '@/utils/validate'
export default {
name: 'JobInfo',
Expand Down Expand Up @@ -554,6 +555,15 @@ export default {
})
},
createData() {
if (this.temp.glueType === 'BEAN' && !isJSON(this.jobJson)) {
this.$notify({
title: 'Fail',
message: 'json格式错误',
type: 'error',
duration: 2000
})
return
}
this.$refs['dataForm'].validate((valid) => {
if (valid) {
if (this.temp.childJobId) {
Expand Down Expand Up @@ -620,6 +630,16 @@ export default {
})
},
updateData() {
this.jobJson = typeof (this.jobJson) !== 'string' ? JSON.stringify(this.jobJson) : this.jobJson
if (this.temp.glueType === 'BEAN' && !isJSON(this.jobJson)) {
this.$notify({
title: 'Fail',
message: 'json格式错误',
type: 'error',
duration: 2000
})
return
}
this.$refs['dataForm'].validate((valid) => {
if (valid) {
if (this.temp.childJobId) {
Expand Down

0 comments on commit 7c62564

Please sign in to comment.