Browse Source

[BUG][#857]repair cross-project dependency delete bug (#858)

(修复跨项目流依赖删除异常)
pull/2/head
黄聪 5 years ago committed by dailidong
parent
commit
e271fb81ec
  1. 13
      escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/dependItemList.vue
  2. 13
      escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue
  3. 4
      escheduler-ui/src/js/conf/home/pages/dag/definitionDetails.vue
  4. 4
      escheduler-ui/src/js/conf/home/pages/dag/index.vue
  5. 4
      escheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue

13
escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/dependItemList.vue

@ -1,6 +1,6 @@
<template>
<div class="dep-list-model">
<div v-for="(el,$index) in dependItemList" class="list" @click="itemIndex = $index">
<div v-for="(el,$index) in dependItemList" :key='$index' class="list" @click="itemIndex = $index">
<x-select filterable :style="{width:isInstance ? '450px' : '450px'}" :disabled="isDetails" v-model="el.projectId" @on-change="_onChangeProjectId">
<x-option v-for="item in projectList" :key="item.value" :value="item.value" :label="item.label">
</x-option>
@ -58,7 +58,8 @@
mixins: [disabledState],
props: {
dependItemList: Array,
index: Number
index: Number,
dependTaskList:Array
},
model: {
prop: 'dependItemList',
@ -77,9 +78,10 @@
let value = noArr[0] && noArr[0].value || null
let val = value || this.definitionList[0].value
// add task list
let projectId = this.projectList[0].value
this._getDependItemList(val).then(depTasksList => {
this.$nextTick(() => {
this.$emit('dependItemListEvent', _.concat(this.dependItemList, this._rtNewParams(val, depTasksList)))
this.$emit('dependItemListEvent', _.concat(this.dependItemList, this._rtNewParams(val, depTasksList,projectId)))
})
})
// remove tooltip
@ -89,10 +91,9 @@
* remove task
*/
_remove (i) {
this.dependItemList.splice(i, 1)
this.dependTaskList[this.index].dependItemList.splice(i,1)
this._removeTip()
if (!this.dependItemList.length) {
if (!this.dependItemList.length || this.dependItemList.length === 0) {
this.$emit('on-delete-all', {
index: this.index
})

13
escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue

@ -22,7 +22,7 @@
v-if="dependTaskList.length">
{{relation === 'AND' ? $t('and') : $t('or')}}
</span>
<div class="dep-list" v-for="(el,$index) in dependTaskList">
<div class="dep-list" v-for="(el,$index) in dependTaskList" :key='$index'>
<span class="dep-line-pie"
v-if="el.dependItemList.length"
@click="!isDetails && _setRelation($index)">
@ -37,8 +37,10 @@
&#xe611;
</i>
<m-depend-item-list
:dependTaskList='dependTaskList'
v-model="el.dependItemList"
@on-delete-all="_onDeleteAll"
@getDependTaskList="getDependTaskList"
:index="$index">
</m-depend-item-list>
</div>
@ -84,11 +86,18 @@
$('body').find('.tooltip.fade.top.in').remove()
},
_onDeleteAll (i) {
this._deleteDep(i)
this.dependTaskList.map((item,i)=>{
if(item.dependItemList.length === 0){
this.dependTaskList.splice(i,1)
}
})
},
_setGlobalRelation () {
this.relation = this.relation === 'AND' ? 'OR' : 'AND'
},
getDependTaskList(i){
// console.log('getDependTaskList',i)
},
_setRelation (i) {
this.dependTaskList[i].relation = this.dependTaskList[i].relation === 'AND' ? 'OR' : 'AND'
},

4
escheduler-ui/src/js/conf/home/pages/dag/definitionDetails.vue

@ -25,7 +25,7 @@
props: {},
methods: {
...mapMutations('dag', ['resetParams', 'setIsDetails']),
...mapActions('dag', ['getProcessList','getProcessByProjectId','getProjectList', 'getResourcesList', 'getProcessDetails']),
...mapActions('dag', ['getProcessList','getProjectList', 'getResourcesList', 'getProcessDetails']),
...mapActions('security', ['getTenantList','getWorkerGroupsAll']),
/**
* init
@ -42,8 +42,6 @@
this.getProcessList(),
// get project
this.getProjectList(),
// get process definition by project id
this.getProcessByProjectId(),
// get resource
this.getResourcesList(),
// get worker group list

4
escheduler-ui/src/js/conf/home/pages/dag/index.vue

@ -24,7 +24,7 @@
props: {},
methods: {
...mapMutations('dag', ['resetParams']),
...mapActions('dag', ['getProcessList','getProcessByProjectId','getProjectList', 'getResourcesList']),
...mapActions('dag', ['getProcessList','getProjectList', 'getResourcesList']),
...mapActions('security', ['getTenantList','getWorkerGroupsAll']),
/**
* init
@ -39,8 +39,6 @@
this.getProcessList(),
// get project
this.getProjectList(),
// get process definition by project id
this.getProcessByProjectId(),
// get resource
this.getResourcesList(),
// get worker group list

4
escheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue

@ -27,7 +27,7 @@
props: {},
methods: {
...mapMutations('dag', ['setIsDetails', 'resetParams']),
...mapActions('dag', ['getProcessList','getProcessByProjectId','getProjectList', 'getResourcesList', 'getInstancedetail']),
...mapActions('dag', ['getProcessList','getProjectList', 'getResourcesList', 'getInstancedetail']),
...mapActions('security', ['getTenantList','getWorkerGroupsAll']),
/**
* init
@ -44,8 +44,6 @@
this.getProcessList(),
// get project
this.getProjectList(),
// get process definition by project id
this.getProcessByProjectId(),
// get resources
this.getResourcesList(),
// get worker group list

Loading…
Cancel
Save