Browse Source

Replace taskName with taskCode (#6719)

3.0.0/version-upgrade
wangyizhi 3 years ago committed by GitHub
parent
commit
b226253eec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue
  2. 44
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/dependItemList.vue
  3. 8
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/nodeStatus.vue
  4. 2
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/conditions.vue
  5. 2
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue
  6. 4
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/switch.vue

11
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue

@ -193,7 +193,7 @@
<el-option <el-option
v-for="item in postTasks" v-for="item in postTasks"
:key="item.code" :key="item.code"
:value="item.name" :value="item.code"
:label="item.name" :label="item.name"
></el-option> ></el-option>
</el-select> </el-select>
@ -230,7 +230,7 @@
<el-option <el-option
v-for="item in postTasks" v-for="item in postTasks"
:key="item.code" :key="item.code"
:value="item.name" :value="item.code"
:label="item.name" :label="item.name"
></el-option> ></el-option>
</el-select> </el-select>
@ -694,8 +694,7 @@
return false return false
} }
if ( if (
this.successBranch !== '' && this.successBranch &&
this.successBranch !== null &&
this.successBranch === this.failedBranch this.successBranch === this.failedBranch
) { ) {
this.$message.warning( this.$message.warning(
@ -754,8 +753,8 @@
if (this.$refs.preTasks) { if (this.$refs.preTasks) {
this.$refs.preTasks.setPreNodes() this.$refs.preTasks.setPreNodes()
} }
this.conditionResult.successNode[0] = this.successBranch this.successBranch && (this.conditionResult.successNode[0] = this.successBranch)
this.conditionResult.failedNode[0] = this.failedBranch this.failedBranch && (this.conditionResult.failedNode[0] = this.failedBranch)
this.$emit('addTaskInfo', { this.$emit('addTaskInfo', {
item: { item: {
code: this.nodeData.id, code: this.nodeData.id,

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

@ -23,8 +23,8 @@
<el-select filterable :disabled="isDetails" style="width: 450px" v-model="el.definitionCode" @change="v => _onChangeDefinitionCode(v, $index)" size="small"> <el-select filterable :disabled="isDetails" style="width: 450px" v-model="el.definitionCode" @change="v => _onChangeDefinitionCode(v, $index)" size="small">
<el-option v-for="item in el.definitionList" :key="item.value" :value="item.value" :label="item.label"></el-option> <el-option v-for="item in el.definitionList" :key="item.value" :value="item.value" :label="item.label"></el-option>
</el-select> </el-select>
<el-select filterable :disabled="isDetails" style="width: 450px" v-model="el.depTasks" size="small"> <el-select filterable :disabled="isDetails" style="width: 450px" v-model="el.depTaskCode" size="small">
<el-option v-for="item in el.depTasksList || []" :key="item" :value="item" :label="item"></el-option> <el-option v-for="item in el.depTasksList || []" :key="item.code" :value="item.code" :label="item.name"></el-option>
</el-select> </el-select>
<el-select v-model="el.cycle" :disabled="isDetails" @change="v => _onChangeCycle(v, $index)" size="small"> <el-select v-model="el.cycle" :disabled="isDetails" @change="v => _onChangeCycle(v, $index)" size="small">
<el-option v-for="item in cycleList" :key="item.value" :value="item.value" :label="item.label"></el-option> <el-option v-for="item in cycleList" :key="item.value" :value="item.value" :label="item.label"></el-option>
@ -55,6 +55,13 @@
import _ from 'lodash' import _ from 'lodash'
import { cycleList, dateValueList } from './commcon' import { cycleList, dateValueList } from './commcon'
import disabledState from '@/module/mixin/disabledState' import disabledState from '@/module/mixin/disabledState'
// Depend on all tasks
const DEP_ALL_TASK = {
code: 0,
name: 'ALL'
}
export default { export default {
name: 'dep-list', name: 'dep-list',
data () { data () {
@ -87,7 +94,7 @@
let projectCode = this.projectList[0].value let projectCode = this.projectList[0].value
this._getProcessByProjectCode(projectCode).then(definitionList => { this._getProcessByProjectCode(projectCode).then(definitionList => {
if (!definitionList || definitionList.length === 0) { if (!definitionList || definitionList.length === 0) {
this.$emit('dependItemListEvent', _.concat(this.dependItemList, this._rtNewParams('', [], ['ALL'], projectCode))) this.$emit('dependItemListEvent', _.concat(this.dependItemList, this._rtNewParams('', [], [_.cloneDeep(DEP_ALL_TASK)], projectCode)))
return return
} }
// dependItemList index // dependItemList index
@ -148,7 +155,12 @@
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (is) { if (is) {
this.store.dispatch('dag/getProcessTasksList', { code: codes }).then(res => { this.store.dispatch('dag/getProcessTasksList', { code: codes }).then(res => {
resolve(['ALL'].concat(_.map(res, v => v.name))) resolve([{ ...DEP_ALL_TASK }].concat(_.map(res, v => {
return {
code: v.code,
name: v.name
}
})))
}) })
} else { } else {
this.store.dispatch('dag/getTaskListDefIdAll', { codes: codes }).then(res => { this.store.dispatch('dag/getTaskListDefIdAll', { codes: codes }).then(res => {
@ -163,11 +175,11 @@
_onChangeProjectCode (value, itemIndex) { _onChangeProjectCode (value, itemIndex) {
this._getProcessByProjectCode(value).then(definitionList => { this._getProcessByProjectCode(value).then(definitionList => {
if (!definitionList || definitionList.length === 0) { if (!definitionList || definitionList.length === 0) {
this.$set(this.dependItemList, itemIndex, this._cpOldParams(value, '', [], ['ALL'], { this.$set(this.dependItemList, itemIndex, this._cpOldParams(value, '', [], [_.cloneDeep(DEP_ALL_TASK)], {
cycle: 'day', cycle: 'day',
dateValue: 'today', dateValue: 'today',
state: '', state: '',
depTasks: 'ALL' depTaskCode: DEP_ALL_TASK.code
})) }))
return return
} }
@ -175,8 +187,8 @@
let definitionCode = definitionList[0].value let definitionCode = definitionList[0].value
this._getDependItemList(definitionCode).then(depTasksList => { this._getDependItemList(definitionCode).then(depTasksList => {
let item = this.dependItemList[itemIndex] let item = this.dependItemList[itemIndex]
// init set depTasks All // init set depTaskCode All
item.depTasks = 'ALL' item.depTaskCode = DEP_ALL_TASK.code
// set dependItemList item data // set dependItemList item data
this.$set(this.dependItemList, itemIndex, this._cpOldParams(value, definitionCode, definitionList, depTasksList, item)) this.$set(this.dependItemList, itemIndex, this._cpOldParams(value, definitionCode, definitionList, depTasksList, item))
}) })
@ -186,8 +198,8 @@
// get depItem list data // get depItem list data
this._getDependItemList(value).then(depTasksList => { this._getDependItemList(value).then(depTasksList => {
let item = this.dependItemList[itemIndex] let item = this.dependItemList[itemIndex]
// init set depTasks All // init set depTaskCode All
item.depTasks = 'ALL' item.depTaskCode = DEP_ALL_TASK.code
// set dependItemList item data // set dependItemList item data
this.$set(this.dependItemList, itemIndex, this._rtOldParams(value, item.definitionList, depTasksList, item)) this.$set(this.dependItemList, itemIndex, this._rtOldParams(value, item.definitionList, depTasksList, item))
}) })
@ -203,7 +215,7 @@
definitionCode: value, definitionCode: value,
// dependItem need private definitionList // dependItem need private definitionList
definitionList: definitionList, definitionList: definitionList,
depTasks: 'ALL', depTaskCode: DEP_ALL_TASK.code,
depTasksList: depTasksList, depTasksList: depTasksList,
cycle: 'day', cycle: 'day',
dateValue: 'today', dateValue: 'today',
@ -217,7 +229,7 @@
definitionCode: value, definitionCode: value,
// dependItem need private definitionList // dependItem need private definitionList
definitionList: definitionList, definitionList: definitionList,
depTasks: item.depTasks || 'ALL', depTaskCode: item.depTaskCode || DEP_ALL_TASK.code,
depTasksList: depTasksList, depTasksList: depTasksList,
cycle: item.cycle, cycle: item.cycle,
dateValue: item.dateValue, dateValue: item.dateValue,
@ -231,7 +243,7 @@
projectCode: value, projectCode: value,
definitionList: definitionList, definitionList: definitionList,
definitionCode: definitionCode, definitionCode: definitionCode,
depTasks: item.depTasks || 'ALL', depTaskCode: item.depTaskCode || DEP_ALL_TASK.code,
depTasksList: depTasksList, depTasksList: depTasksList,
cycle: item.cycle, cycle: item.cycle,
dateValue: item.dateValue, dateValue: item.dateValue,
@ -262,10 +274,10 @@
if (definitionList && definitionList.length > 0) { if (definitionList && definitionList.length > 0) {
let definitionCode = definitionList[0].value let definitionCode = definitionList[0].value
this._getDependItemList(definitionCode).then(depTasksList => { this._getDependItemList(definitionCode).then(depTasksList => {
this.$emit('dependItemListEvent', _.concat(this.dependItemList, this._rtNewParams(definitionCode, definitionList, depTasksList || ['ALL'], projectCode))) this.$emit('dependItemListEvent', _.concat(this.dependItemList, this._rtNewParams(definitionCode, definitionList, depTasksList || [_.cloneDeep(DEP_ALL_TASK)], projectCode)))
}) })
} else { } else {
this.$emit('dependItemListEvent', _.concat(this.dependItemList, this._rtNewParams('', [], ['ALL'], projectCode))) this.$emit('dependItemListEvent', _.concat(this.dependItemList, this._rtNewParams('', [], [_.cloneDeep(DEP_ALL_TASK)], projectCode)))
} }
}) })
} else { } else {
@ -275,7 +287,7 @@
this._getDependItemList(codes, false).then(res => { this._getDependItemList(codes, false).then(res => {
_.map(this.dependItemList, (v, i) => { _.map(this.dependItemList, (v, i) => {
this._getProcessByProjectCode(v.projectCode).then(definitionList => { this._getProcessByProjectCode(v.projectCode).then(definitionList => {
this.$set(this.dependItemList, i, this._rtOldParams(v.definitionCode, definitionList, ['ALL'].concat(_.map(res[v.definitionCode] || [], v => v.name)), v)) this.$set(this.dependItemList, i, this._rtOldParams(v.definitionCode, definitionList, [_.cloneDeep(DEP_ALL_TASK)].concat(_.map(res[v.definitionCode] || [], v => ({ code: v.code, name: v.name }))), v))
}) })
}) })
}) })

8
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/nodeStatus.vue

@ -17,8 +17,8 @@
<template> <template>
<div class="dep-list-model"> <div class="dep-list-model">
<div v-for="(el,$index) in dependItemList" :key='$index' class="list" @click="itemIndex = $index"> <div v-for="(el,$index) in dependItemList" :key='$index' class="list" @click="itemIndex = $index">
<el-select style="width: 150px;" size="small" v-model="el.depTasks" :disabled="isDetails"> <el-select style="width: 150px;" size="small" :value="el.depTaskCode || ''" @change="(val) => { el.depTaskCode = val }" :disabled="isDetails">
<el-option v-for="item in prevTasks" :key="item.code" :value="item.name" :label="item.name"> <el-option v-for="item in prevTasks" :key="item.code" :value="item.code" :label="item.name">
</el-option> </el-option>
</el-select> </el-select>
<el-select style="width: 116px;" size="small" v-model="el.status" :disabled="isDetails"> <el-select style="width: 116px;" size="small" v-model="el.status" :disabled="isDetails">
@ -134,13 +134,13 @@
}, },
_rtNewParams () { _rtNewParams () {
return { return {
depTasks: '', depTaskCode: 0,
status: '' status: ''
} }
}, },
_rtOldParams (value, depTasksList, item) { _rtOldParams (value, depTasksList, item) {
return { return {
depTasks: '', depTaskCode: 0,
status: '' status: ''
} }
}, },

2
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/conditions.vue

@ -147,7 +147,7 @@
// Process instance return status display matches by key // Process instance return status display matches by key
_.map(this.dependTaskList, v => _.map(v.dependItemList, v1 => { _.map(this.dependTaskList, v => _.map(v.dependItemList, v1 => {
$(`#${o.id}`).siblings().each(function () { $(`#${o.id}`).siblings().each(function () {
if (v1.depTasks === $(this).text()) { if (v1.depTaskCode === $(this).text()) {
v1.state = $(this).attr('data-dependent-depstate') v1.state = $(this).attr('data-dependent-depstate')
} }
}) })

2
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue

@ -148,7 +148,7 @@
let defaultState = this.isDetails ? 'WAITING' : '' let defaultState = this.isDetails ? 'WAITING' : ''
// Process instance return status display matches by key // Process instance return status display matches by key
_.map(this.dependTaskList, v => _.map(v.dependItemList, v1 => { _.map(this.dependTaskList, v => _.map(v.dependItemList, v1 => {
v1.state = dependentResult[`${v1.definitionId}-${v1.depTasks}-${v1.cycle}-${v1.dateValue}`] || defaultState v1.state = dependentResult[`${v1.definitionId}-${v1.depTaskCode}-${v1.cycle}-${v1.dateValue}`] || defaultState
})) }))
} }
}, },

4
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/switch.vue

@ -35,7 +35,7 @@
</label> </label>
<span class="text-b" style="padding-left: 0">{{$t('Branch flow')}}</span> <span class="text-b" style="padding-left: 0">{{$t('Branch flow')}}</span>
<el-select style="width: 157px;" size="small" v-model="el.nextNode" clearable :disabled="isDetails"> <el-select style="width: 157px;" size="small" v-model="el.nextNode" clearable :disabled="isDetails">
<el-option v-for="item in postTasks" :key="item.code" :value="item.name" :label="item.name"></el-option> <el-option v-for="item in postTasks" :key="item.code" :value="item.code" :label="item.name"></el-option>
</el-select> </el-select>
<span class="operation"> <span class="operation">
<a href="javascript:" class="delete" @click="!isDetails && _removeDep(index)" v-if="index === (dependItemList.length - 1)"> <a href="javascript:" class="delete" @click="!isDetails && _removeDep(index)" v-if="index === (dependItemList.length - 1)">
@ -53,7 +53,7 @@
<div slot="text">{{$t('Branch flow')}}</div> <div slot="text">{{$t('Branch flow')}}</div>
<div slot="content"> <div slot="content">
<el-select style="width: 157px;" size="small" v-model="nextNode" clearable :disabled="isDetails"> <el-select style="width: 157px;" size="small" v-model="nextNode" clearable :disabled="isDetails">
<el-option v-for="item in postTasks" :key="item.code" :value="item.name" :label="item.name"></el-option> <el-option v-for="item in postTasks" :key="item.code" :value="item.code" :label="item.name"></el-option>
</el-select> </el-select>
</div> </div>
</m-list-box> </m-list-box>

Loading…
Cancel
Save