From b1114dea0c3a379e7995cec5d940d8e113947f73 Mon Sep 17 00:00:00 2001 From: jason <2667446@qq.com> Date: Mon, 9 Jun 2025 17:46:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20[BPM=20=E5=B7=A5=E4=BD=9C=E6=B5=81]=20-?= =?UTF-8?q?=20=E6=B5=81=E7=A8=8B=E6=A8=A1=E5=9E=8B=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E3=80=81=E6=B8=85=E7=90=86=E7=AD=89=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/category-draggable-model.vue | 72 +++++++++++++++++-- 1 file changed, 68 insertions(+), 4 deletions(-) diff --git a/apps/web-antd/src/views/bpm/model/modules/category-draggable-model.vue b/apps/web-antd/src/views/bpm/model/modules/category-draggable-model.vue index bd0ef836f..3e96a6c65 100644 --- a/apps/web-antd/src/views/bpm/model/modules/category-draggable-model.vue +++ b/apps/web-antd/src/views/bpm/model/modules/category-draggable-model.vue @@ -24,7 +24,13 @@ import { } from 'ant-design-vue'; import { deleteCategory } from '#/api/bpm/category'; -import { deployModel, updateModelSortBatch } from '#/api/bpm/model'; +import { + cleanModel, + deleteModel, + deployModel, + updateModelSortBatch, + updateModelState, +} from '#/api/bpm/model'; import { DictTag } from '#/components/dict-tag'; import { $t } from '#/locales'; import { DICT_TYPE } from '#/utils'; @@ -225,11 +231,11 @@ async function handleDeploy(row: any) { function handleModelCommand(command: string, row: any) { switch (command) { case 'handleChangeState': { - console.warn('停用/启用待实现', row); + handleChangeState(row); break; } case 'handleClean': { - console.warn('清理待实现', row); + handleClean(row); break; } case 'handleCopy': { @@ -241,7 +247,7 @@ function handleModelCommand(command: string, row: any) { break; } case 'handleDelete': { - console.warn('删除待实现', row); + handleDelete(row); break; } case 'handleReport': { @@ -253,6 +259,64 @@ function handleModelCommand(command: string, row: any) { } } } + +/** 更新状态操作 */ +function handleChangeState(row: any) { + const state = row.processDefinition.suspensionState; + const newState = state === 1 ? 2 : 1; + const statusState = state === 1 ? '停用' : '启用'; + confirm({ + beforeClose: async ({ isConfirm }) => { + if (!isConfirm) return; + // 发起更新状态 + await updateModelState(row.id, newState); + return true; + }, + content: `确认要${statusState}流程: "${row.name}" 吗?`, + icon: 'question', + }).then(async () => { + message.success(`${statusState} 流程: "${row.name}" 成功`); + // 刷新列表 + emit('success'); + }); +} + +/** 清理流程操作 */ +function handleClean(row: any) { + confirm({ + beforeClose: async ({ isConfirm }) => { + if (!isConfirm) return; + // 发起清理操作 + await cleanModel(row.id); + return true; + }, + content: `确认要清理流程: "${row.name}" 吗?`, + icon: 'question', + }).then(async () => { + message.success(`清理流程: "${row.name}" 成功`); + // 刷新列表 + emit('success'); + }); +} + +/** 删除流程操作 */ +function handleDelete(row: any) { + confirm({ + beforeClose: async ({ isConfirm }) => { + if (!isConfirm) return; + // 发起删除操作 + await deleteModel(row.id); + return true; + }, + content: `确认要删除流程: "${row.name}" 吗?`, + icon: 'question', + }).then(async () => { + message.success(`删除流程: "${row.name}" 成功`); + // 刷新列表 + emit('success'); + }); +} + /** 更新 modelList 模型列表 */ const updateModelList = useDebounceFn(() => { const newModelList = props.categoryInfo.modelList;