流程的挂起与激活

This commit is contained in:
YunaiV
2022-01-03 12:26:04 +08:00
parent f8b34d5b6d
commit db54147697
13 changed files with 135 additions and 48 deletions

View File

@ -23,6 +23,18 @@ export function updateModel(data) {
})
}
// 任务状态修改
export function updateModelState(id, state) {
return request({
url: '/bpm/model/update-state',
method: 'put',
data: {
id,
state
}
})
}
export function createModel(data) {
return request({
url: '/bpm/model/create',

View File

@ -65,7 +65,6 @@ export function updateJobStatus(jobId, status) {
})
}
// 定时任务立即执行一次
export function runJob(jobId) {
return request({

View File

@ -2,8 +2,8 @@
<div class="app-container">
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="定义编号" align="center" prop="id" />
<el-table-column label="定义名称" align="center" prop="name" width="200">
<el-table-column label="定义编号" align="center" prop="id" width="400" />
<el-table-column label="定义名称" align="center" prop="name" width="100">
<template slot-scope="scope">
<el-button type="text" @click="handleBpmnDetail(scope.row)">
<span>{{ scope.row.name }}</span>

View File

@ -69,7 +69,7 @@
<el-table-column label="激活状态" align="center" prop="processDefinition.version" width="80">
<template slot-scope="scope">
<el-switch v-if="scope.row.processDefinition" v-model="scope.row.processDefinition.suspensionState"
:active-value="1" :inactive-value="2" @change="handleStatusChange(scope.row)" />
:active-value="1" :inactive-value="2" @change="handleChangeState(scope.row)" />
</template>
</el-table-column>
<el-table-column label="部署时间" align="center" prop="deploymentTime" width="180">
@ -104,7 +104,7 @@
</template>
<script>
import {deleteModel, deployModel, getModelPage, getModel} from "@/api/bpm/model";
import {deleteModel, deployModel, getModelPage, getModel, updateModelState} from "@/api/bpm/model";
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import {getForm} from "@/api/bpm/form";
import {decodeFields} from "@/utils/formGenerator";
@ -250,7 +250,23 @@ export default {
key: row.key
}
});
}
},
/** 更新状态操作 */
handleChangeState(row) {
const id = row.id;
let state = row.processDefinition.suspensionState;
let statusState = state === 1 ? '激活' : '挂起';
this.$confirm('是否确认' + statusState + '流程名字为"' + row.name + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return updateModelState(id, state);
}).then(() => {
this.getList();
this.msgSuccess(statusState + "成功");
})
},
}
};
</script>