Browse Source

fix UI updateProcessInstance interface parameter error (#6487)

3.0.0/version-upgrade
wangyizhi 3 years ago committed by GitHub
parent
commit
eb21a1763e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue
  2. 2
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue
  3. 4
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/_source/list.vue
  4. 19
      dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js

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

@ -161,7 +161,7 @@
if (this.type === 'instance') { if (this.type === 'instance') {
this.instanceId = this.$route.params.id this.instanceId = this.$route.params.id
this.definitionCode = this.$route.query.code this.definitionCode = this.$route.query.code || this.code
} else if (this.type === 'definition') { } else if (this.type === 'definition') {
this.definitionCode = this.$route.params.code this.definitionCode = this.$route.params.code
} }
@ -199,7 +199,8 @@
'name', 'name',
'isDetails', 'isDetails',
'projectCode', 'projectCode',
'version' 'version',
'code'
]) ])
}, },
methods: { methods: {
@ -311,12 +312,12 @@
.then((res) => { .then((res) => {
if (this.verifyConditions(res.tasks)) { if (this.verifyConditions(res.tasks)) {
this.loading(true) this.loading(true)
const definitionCode = this.definitionCode const isEdit = !!this.definitionCode
if (definitionCode) { if (isEdit) {
const methodName = this.type === 'instance' ? 'updateInstance' : 'updateDefinition'
const methodParam = this.type === 'instance' ? this.instanceId : this.definitionCode
// Edit // Edit
return this[ return this[methodName](methodParam)
this.type === 'instance' ? 'updateInstance' : 'updateDefinition'
](definitionCode)
.then((res) => { .then((res) => {
this.$message({ this.$message({
message: res.msg, message: res.msg,

2
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue

@ -298,7 +298,7 @@
* edit * edit
*/ */
_reEdit (item) { _reEdit (item) {
this.$router.push({ path: `/projects/${this.projectCode}/instance/list/${item.id}` }) this.$router.push({ path: `/projects/${this.projectCode}/instance/list/${item.id}`, query: { code: item.processDefinitionCode } })
}, },
/** /**
* Rerun * Rerun

4
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/_source/list.vue

@ -149,7 +149,7 @@
this.$emit('on-update') this.$emit('on-update')
}, },
_go (item) { _go (item) {
this.$router.push({ path: `/projects/${this.projectId}/instance/list/${item.processInstanceId}` }) this.$router.push({ path: `/projects/${this.projectCode}/instance/list/${item.processInstanceId}` })
} }
}, },
watch: { watch: {
@ -166,7 +166,7 @@
this.list = this.taskInstanceList this.list = this.taskInstanceList
}, },
computed: { computed: {
...mapState('dag', ['projectId']) ...mapState('dag', ['projectCode'])
}, },
components: { mLog } components: { mLog }
} }

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

@ -318,19 +318,16 @@ export default {
/** /**
* Process instance update * Process instance update
*/ */
updateInstance ({ state }, payload) { updateInstance ({ state }, instanceId) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const data = { io.put(`projects/${state.projectCode}/process-instances/${instanceId}`, {
globalParams: state.globalParams, syncDefine: state.syncDefine,
tasks: state.tasks, globalParams: JSON.stringify(state.globalParams),
tenantId: state.tenantId,
timeout: state.timeout
}
io.put(`projects/${state.projectCode}/process-instances/${payload}`, {
processInstanceJson: JSON.stringify(data),
locations: JSON.stringify(state.locations), locations: JSON.stringify(state.locations),
connects: JSON.stringify(state.connects), taskDefinitionJson: JSON.stringify(state.tasks),
syncDefine: state.syncDefine taskRelationJson: JSON.stringify(state.connects),
tenantCode: state.tenantCode,
timeout: state.timeout
}, res => { }, res => {
resolve(res) resolve(res)
state.isEditDag = false state.isEditDag = false

Loading…
Cancel
Save