未验证 提交 3702845c 编写于 作者: K Kirs 提交者: GitHub

fix UI updateProcessInstance interface parameter error (#6487) (#6493)

Co-authored-by: Nwangyizhi <wangyizhi1_yewu@cmss.chinamobile.com>
上级 2460eb6f
......@@ -161,7 +161,7 @@
if (this.type === 'instance') {
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') {
this.definitionCode = this.$route.params.code
}
......@@ -199,7 +199,8 @@
'name',
'isDetails',
'projectCode',
'version'
'version',
'code'
])
},
methods: {
......@@ -311,12 +312,12 @@
.then((res) => {
if (this.verifyConditions(res.tasks)) {
this.loading(true)
const definitionCode = this.definitionCode
if (definitionCode) {
const isEdit = !!this.definitionCode
if (isEdit) {
const methodName = this.type === 'instance' ? 'updateInstance' : 'updateDefinition'
const methodParam = this.type === 'instance' ? this.instanceId : this.definitionCode
// Edit
return this[
this.type === 'instance' ? 'updateInstance' : 'updateDefinition'
](definitionCode)
return this[methodName](methodParam)
.then((res) => {
this.$message({
message: res.msg,
......
......@@ -298,7 +298,7 @@
* edit
*/
_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
......
......@@ -149,7 +149,7 @@
this.$emit('on-update')
},
_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: {
......@@ -166,7 +166,7 @@
this.list = this.taskInstanceList
},
computed: {
...mapState('dag', ['projectId'])
...mapState('dag', ['projectCode'])
},
components: { mLog }
}
......
......@@ -318,19 +318,16 @@ export default {
/**
* Process instance update
*/
updateInstance ({ state }, payload) {
updateInstance ({ state }, instanceId) {
return new Promise((resolve, reject) => {
const data = {
globalParams: state.globalParams,
tasks: state.tasks,
tenantId: state.tenantId,
timeout: state.timeout
}
io.put(`projects/${state.projectCode}/process-instances/${payload}`, {
processInstanceJson: JSON.stringify(data),
io.put(`projects/${state.projectCode}/process-instances/${instanceId}`, {
syncDefine: state.syncDefine,
globalParams: JSON.stringify(state.globalParams),
locations: JSON.stringify(state.locations),
connects: JSON.stringify(state.connects),
syncDefine: state.syncDefine
taskDefinitionJson: JSON.stringify(state.tasks),
taskRelationJson: JSON.stringify(state.connects),
tenantCode: state.tenantCode,
timeout: state.timeout
}, res => {
resolve(res)
state.isEditDag = false
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册