mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-12-02 12:17:43 +08:00
parent
77343b2976
commit
e172015cd3
@ -69,7 +69,6 @@ public class DependentTaskProcessor extends BaseTaskProcessor {
|
||||
|
||||
DependResult result;
|
||||
|
||||
ProcessInstance processInstance;
|
||||
TaskDefinition taskDefinition;
|
||||
|
||||
private MasterConfig masterConfig = SpringApplicationContext.getBean(MasterConfig.class);;
|
||||
|
@ -226,7 +226,8 @@
|
||||
'setIsEditDag',
|
||||
'setName',
|
||||
'setLocations',
|
||||
'resetLocalParam'
|
||||
'resetLocalParam',
|
||||
'setDependResult'
|
||||
]),
|
||||
/**
|
||||
* Toggle full screen
|
||||
@ -562,6 +563,7 @@
|
||||
.then((res) => {
|
||||
this.$message(this.$t('Refresh status succeeded'))
|
||||
const { taskList } = res.data
|
||||
const list = res.list
|
||||
if (taskList) {
|
||||
this.taskInstances = taskList
|
||||
taskList.forEach((taskInstance) => {
|
||||
@ -572,6 +574,13 @@
|
||||
})
|
||||
})
|
||||
}
|
||||
if (list) {
|
||||
list.forEach((dependent) => {
|
||||
if (dependent.dependentResult) {
|
||||
this.setDependResult(JSON.parse(dependent.dependentResult))
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading(false)
|
||||
|
@ -65,6 +65,7 @@
|
||||
import mListBox from './_source/listBox'
|
||||
import mDependItemList from './_source/dependItemList'
|
||||
import disabledState from '@/module/mixin/disabledState'
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'dependent',
|
||||
@ -140,7 +141,7 @@
|
||||
},
|
||||
created () {
|
||||
let o = this.backfillItem
|
||||
let dependentResult = $(`#${o.id}`).data('dependent-result') || {}
|
||||
let dependentResult = this.dependResult || {}
|
||||
// Does not represent an empty object backfill
|
||||
if (!_.isEmpty(o)) {
|
||||
this.relation = _.cloneDeep(o.dependence.relation) || 'AND'
|
||||
@ -148,7 +149,7 @@
|
||||
let defaultState = this.isDetails ? 'WAITING' : ''
|
||||
// Process instance return status display matches by key
|
||||
_.map(this.dependTaskList, v => _.map(v.dependItemList, v1 => {
|
||||
v1.state = dependentResult[`${v1.definitionId}-${v1.depTaskCode}-${v1.cycle}-${v1.dateValue}`] || defaultState
|
||||
v1.state = dependentResult[`${v1.definitionCode}-${v1.depTaskCode}-${v1.cycle}-${v1.dateValue}`] || defaultState
|
||||
}))
|
||||
}
|
||||
},
|
||||
@ -157,6 +158,9 @@
|
||||
destroyed () {
|
||||
},
|
||||
computed: {
|
||||
...mapState('dag', [
|
||||
'dependResult'
|
||||
]),
|
||||
cacheDependent () {
|
||||
return {
|
||||
relation: this.relation,
|
||||
|
@ -37,6 +37,13 @@ export default {
|
||||
io.get(`projects/${state.projectCode}/process-instances/${payload}/tasks`, {
|
||||
processInstanceId: payload
|
||||
}, res => {
|
||||
res.list = _.map(res.data.taskList, v => {
|
||||
return _.cloneDeep({
|
||||
code: v.taskCode,
|
||||
taskType: v.taskType,
|
||||
dependentResult: v.dependentResult
|
||||
})
|
||||
})
|
||||
state.taskInstances = res.data.taskList
|
||||
resolve(res)
|
||||
}).catch(e => {
|
||||
|
@ -110,6 +110,13 @@ export default {
|
||||
state.isDetails = payload
|
||||
},
|
||||
|
||||
/**
|
||||
* set depend result
|
||||
*/
|
||||
setDependResult (state, payload) {
|
||||
state.dependResult = Object.assign(state.dependResult, {}, payload)
|
||||
},
|
||||
|
||||
/**
|
||||
* reset params
|
||||
*/
|
||||
@ -129,6 +136,7 @@ export default {
|
||||
state.runFlag = (payload && payload.runFlag) || ''
|
||||
state.locations = (payload && payload.locations) || {}
|
||||
state.connects = (payload && payload.connects) || []
|
||||
state.dependResult = (payload && payload.dependResult) || {}
|
||||
},
|
||||
/**
|
||||
* add task
|
||||
|
@ -122,5 +122,6 @@ export default {
|
||||
// Operating state
|
||||
isDetails: false,
|
||||
startup: {},
|
||||
taskInstances: []
|
||||
taskInstances: [],
|
||||
dependResult: {}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user