fix -- 修复因查询xml接口修改,导致其他页面无法加载流程图和表单的bug

This commit is contained in:
konbai
2022-01-22 17:51:19 +08:00
parent dc9ddaeba9
commit 680b27d380
3 changed files with 22 additions and 19 deletions

View File

@@ -117,13 +117,13 @@
<!-- 发起流程 --> <!-- 发起流程 -->
<el-dialog :title="title" :visible.sync="open" width="60%" append-to-body> <el-dialog :title="title" :visible.sync="open" width="60%" append-to-body>
<el-table v-loading="processLoading" fit :data="definitionList" border > <el-table v-loading="processLoading" fit :data="definitionList" border >
<el-table-column label="流程名称" align="center" prop="name" /> <el-table-column label="流程名称" align="center" prop="processName" />
<el-table-column label="流程版本" align="center"> <el-table-column label="流程版本" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag size="medium" >v{{ scope.row.version }}</el-tag> <el-tag size="medium" >v{{ scope.row.version }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="流程分类" align="center" prop="category" /> <el-table-column label="流程分类" align="center" prop="categoryCode" />
<el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@@ -265,19 +265,20 @@ export default {
}, },
listDefinition(){ listDefinition(){
listDefinition(this.queryParams).then(response => { listDefinition(this.queryParams).then(response => {
this.definitionList = response.data.records; this.definitionList = response.rows;
this.processTotal = response.data.total; this.processTotal = response.total;
this.processLoading = false; this.processLoading = false;
}); });
}, },
/** 发起流程申请 */ /** 发起流程申请 */
handleStartProcess(row){ handleStartProcess(row){
this.$router.push({ path: '/task/record/index', this.$router.push({
path: '/task/record/index',
query: { query: {
definitionId: row.definitionId,
deployId: row.deploymentId, deployId: row.deploymentId,
procDefId:row.id,
finished: true finished: true
} }
}) })
}, },
/** 取消流程申请 */ /** 取消流程申请 */

View File

@@ -227,7 +227,7 @@ export default {
instanceId: "", // 流程实例编号 instanceId: "", // 流程实例编号
deployId: "", // 流程定义编号 deployId: "", // 流程定义编号
taskId: "" ,// 流程任务编号 taskId: "" ,// 流程任务编号
procDefId: "", // 流程编号 definitionId: "", // 流程编号
vars: "", vars: "",
targetKey:"" targetKey:""
}, },
@@ -251,14 +251,13 @@ export default {
}, },
created() { created() {
this.taskForm.deployId = this.$route.query && this.$route.query.deployId; this.taskForm.deployId = this.$route.query && this.$route.query.deployId;
this.taskForm.definitionId = this.$route.query && this.$route.query.definitionId;
this.taskForm.taskId = this.$route.query && this.$route.query.taskId; this.taskForm.taskId = this.$route.query && this.$route.query.taskId;
this.taskForm.procInsId = this.$route.query && this.$route.query.procInsId; this.taskForm.procInsId = this.$route.query && this.$route.query.procInsId;
this.taskForm.instanceId = this.$route.query && this.$route.query.procInsId; this.taskForm.instanceId = this.$route.query && this.$route.query.procInsId;
// 初始化表单
this.taskForm.procDefId = this.$route.query && this.$route.query.procDefId;
// 回显流程记录 // 回显流程记录
this.getFlowViewer(this.taskForm.procInsId); this.getFlowViewer(this.taskForm.procInsId);
this.getModelDetail(this.taskForm.deployId); this.getModelDetail(this.taskForm.definitionId);
// 流程任务重获取变量表单 // 流程任务重获取变量表单
if (this.taskForm.taskId){ if (this.taskForm.taskId){
this.processVariables( this.taskForm.taskId) this.processVariables( this.taskForm.taskId)
@@ -307,11 +306,11 @@ export default {
this.getList(); this.getList();
}, },
/** xml 文件 */ /** xml 文件 */
getModelDetail(deployId) { getModelDetail(definitionId) {
// 发送请求获取xml // 发送请求获取xml
readXml(deployId).then(res => { readXml(definitionId).then(res => {
this.xmlData = res.data this.xmlData = res.data
this.loadIndex = deployId this.loadIndex = definitionId
}) })
}, },
getFlowViewer(procInsId) { getFlowViewer(procInsId) {
@@ -491,10 +490,10 @@ export default {
const formData = data.formData; const formData = data.formData;
formData.disabled = true; formData.disabled = true;
formData.formBtns = false; formData.formBtns = false;
if (this.taskForm.procDefId) { if (this.taskForm.definitionId) {
variables.variables = formData; variables.variables = formData;
// 启动流程并将表单数据加入流程变量 // 启动流程并将表单数据加入流程变量
definitionStart(this.taskForm.procDefId, JSON.stringify(variables)).then(res => { definitionStart(this.taskForm.definitionId, JSON.stringify(variables)).then(res => {
this.$modal.msgSuccess(res.msg); this.$modal.msgSuccess(res.msg);
this.goBack(); this.goBack();
}) })

View File

@@ -141,14 +141,17 @@ export default {
}); });
}, },
// 跳转到处理页面 // 跳转到处理页面
handleProcess(row){ handleProcess(row) {
this.$router.push({ path: '/task/record/index', this.$router.push({
path: '/task/record/index',
query: { query: {
definitionId: row.procDefId,
procInsId: row.procInsId, procInsId: row.procInsId,
deployId: row.deployId, deployId: row.deployId,
taskId: row.taskId, taskId: row.taskId,
finished: true finished: true
}}) }
})
}, },
// 取消按钮 // 取消按钮
cancel() { cancel() {