fix conflict pr 6997 (#7571)

Co-authored-by: shangeyao <sgy960921>
This commit is contained in:
Assert 2021-12-27 12:03:27 +08:00 committed by GitHub
parent 77343b2976
commit e172015cd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 5 deletions

View File

@ -69,7 +69,6 @@ public class DependentTaskProcessor extends BaseTaskProcessor {
DependResult result;
ProcessInstance processInstance;
TaskDefinition taskDefinition;
private MasterConfig masterConfig = SpringApplicationContext.getBean(MasterConfig.class);;

View File

@ -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)

View File

@ -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,

View File

@ -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 => {

View File

@ -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

View File

@ -122,5 +122,6 @@ export default {
// Operating state
isDetails: false,
startup: {},
taskInstances: []
taskInstances: [],
dependResult: {}
}