Browse Source

fix api error in dependent task (#6238)

2.0.7-release
Wangyizhi1 3 years ago committed by GitHub
parent
commit
070b280f56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 25
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/dependItemList.vue
  2. 2
      dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js

25
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/dependItemList.vue

@ -86,6 +86,10 @@
// add task list
let projectCode = this.projectList[0].value
this._getProcessByProjectCode(projectCode).then(definitionList => {
if (!definitionList || definitionList.length === 0) {
this.$emit('dependItemListEvent', _.concat(this.dependItemList, this._rtNewParams('', [], ['ALL'], projectCode)))
return
}
// dependItemList index
let is = (value) => _.some(this.dependItemList, { definitionCode: value })
let noArr = _.filter(definitionList, v => !is(v.value))
@ -158,6 +162,15 @@
*/
_onChangeProjectCode (value, itemIndex) {
this._getProcessByProjectCode(value).then(definitionList => {
if (!definitionList || definitionList.length === 0) {
this.$set(this.dependItemList, itemIndex, this._cpOldParams(value, '', [], ['ALL'], {
cycle: 'day',
dateValue: 'today',
state: '',
depTasks: 'ALL'
}))
return
}
/* this.$set(this.dependItemList, itemIndex, this._dlOldParams(value, definitionList, item)) */
let definitionCode = definitionList[0].value
this._getDependItemList(definitionCode).then(depTasksList => {
@ -246,10 +259,14 @@
if (!this.projectList.length) return
let projectCode = this.projectList[0].value
this._getProcessByProjectCode(projectCode).then(definitionList => {
let value = definitionList[0].value
this._getDependItemList(value).then(depTasksList => {
this.$emit('dependItemListEvent', _.concat(this.dependItemList, this._rtNewParams(value, definitionList, depTasksList, projectCode)))
})
if (definitionList && definitionList.length > 0) {
let definitionCode = definitionList[0].value
this._getDependItemList(definitionCode).then(depTasksList => {
this.$emit('dependItemListEvent', _.concat(this.dependItemList, this._rtNewParams(definitionCode, definitionList, depTasksList || ['ALL'], projectCode)))
})
} else {
this.$emit('dependItemListEvent', _.concat(this.dependItemList, this._rtNewParams('', [], ['ALL'], projectCode)))
}
})
} else {
// get definitionCode codes

2
dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js

@ -375,7 +375,7 @@ export default {
resolve()
return
}
io.get('projects/list', payload, res => {
io.get('projects/created-and-authed', payload, res => {
state.projectListS = res.data
resolve(res.data)
}).catch(res => {

Loading…
Cancel
Save