feat(workflow): 添加流程定义取消发布功能

- 在流程定义表格中添加取消发布按钮
- 实现取消发布接口调用和确认弹窗逻辑
- 添加取消发布后的页面状态更新和提示信息
- 优化发布确认弹窗的字符串拼接格式
This commit is contained in:
yangwj 2026-07-02 10:29:21 +08:00
parent f8a79a724d
commit b695dbf2d5

View File

@ -215,6 +215,17 @@
>
发布流程
</el-button>
<el-button
v-hasPermi="['workflow:definition:publish']"
link
type="primary"
v-if="scope.row.isPublish == 1"
size="small"
icon="CircleCheck"
@click="handleUnPublish(scope.row)"
>
取消发布
</el-button>
</div>
</template>
</el-table-column>
@ -335,6 +346,7 @@ import {
importDef,
unPublishList,
publish,
unPublish,
add,
edit,
getInfo,
@ -517,10 +529,10 @@ const handleDelete = async (row?: Partial<FlowDefinitionVo>) => {
const handlePublish = async (row?: Partial<FlowDefinitionVo>) => {
await modal.confirm(
'是否确认发布流程定义编码为【' +
row.flowCode +
'】版本为【' +
row.version +
'】的数据项?,发布后会将已发布流程定义改为失效!'
row.flowCode +
'】版本为【' +
row.version +
'】的数据项?,发布后会将已发布流程定义改为失效!'
);
setLoading(true);
await publish(row.id).finally(() => setLoading(false));
@ -528,6 +540,21 @@ const handlePublish = async (row?: Partial<FlowDefinitionVo>) => {
await handleQuery();
modal.msgSuccess('发布成功');
};
/** 取消发布流程定义 */
const handleUnPublish = async (row?: Partial<FlowDefinitionVo>) => {
await modal.confirm(
'是否确认取消发布流程定义编码为【' +
row.flowCode +
'】版本为【' +
row.version +
'】的数据项?,取消发布后,此流程定义将不再显示在流程定义列表!'
);
setLoading(true);
await unPublish(row.id).finally(() => setLoading(false));
activeName.value = '1';
await handleQuery();
modal.msgSuccess('取消发布成功');
}
/** 挂起/激活 */
const handleProcessDefState = async (row: Partial<FlowDefinitionVo>, status: number | string | boolean) => {
let msg: string;