From 905426ad454dbc2d1ec2ee912927b9518f04db4b Mon Sep 17 00:00:00 2001 From: gssong <1742057357@qq.com> Date: 星期一, 08 四月 2024 22:43:37 +0800 Subject: [PATCH] update 修改流程定义删除 --- src/api/workflow/processDefinition/index.ts | 4 ++-- src/views/workflow/processDefinition/index.vue | 14 +++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/api/workflow/processDefinition/index.ts b/src/api/workflow/processDefinition/index.ts index 605012a..c063120 100644 --- a/src/api/workflow/processDefinition/index.ts +++ b/src/api/workflow/processDefinition/index.ts @@ -50,11 +50,11 @@ /** * 鍒犻櫎娴佺▼瀹氫箟 - * @param processDefinitionId 娴佺▼瀹氫箟id * @param deploymentId 閮ㄧ讲id + * @param processDefinitionId 娴佺▼瀹氫箟id * @returns */ -export const deleteProcessDefinition = (deploymentId: string, processDefinitionId: string) => { +export const deleteProcessDefinition = (deploymentId: string | string[], processDefinitionId: string | string[]) => { return request({ url: `/workflow/processDefinition/${deploymentId}/${processDefinitionId}`, method: 'delete' diff --git a/src/views/workflow/processDefinition/index.vue b/src/views/workflow/processDefinition/index.vue index 376182b..52e15a8 100644 --- a/src/views/workflow/processDefinition/index.vue +++ b/src/views/workflow/processDefinition/index.vue @@ -41,6 +41,7 @@ <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> <div v-show="showSearch" class="mb-[10px]"> <el-card shadow="hover"> + <el-button type="danger" icon="Delete" :disabled="multiple" @click="handleDelete">鍒犻櫎</el-button> <el-button type="primary" icon="UploadFilled" @click="uploadDialog.visible = true">閮ㄧ讲娴佺▼鏂囦欢</el-button> </el-card> </div> @@ -277,7 +278,9 @@ }; const loading = ref(true); -const ids = ref<Array<string | number>>([]); +const ids = ref<Array<any>>([]); +const deploymentIds = ref<Array<any>>([]); +const keys = ref<Array<any>>([]); const single = ref(true); const multiple = ref(true); const showSearch = ref(true); @@ -368,6 +371,8 @@ // 澶氶�夋閫変腑鏁版嵁 const handleSelectionChange = (selection: any) => { ids.value = selection.map((item: any) => item.id); + deploymentIds.value = selection.map((item: any) => item.deploymentId); + keys.value = selection.map((item: any) => item.key); single.value = selection.length !== 1; multiple.value = !selection.length; }; @@ -414,9 +419,12 @@ }; /** 鍒犻櫎鎸夐挳鎿嶄綔 */ const handleDelete = async (row: ProcessDefinitionVO) => { - await proxy?.$modal.confirm('鏄惁纭鍒犻櫎娴佺▼瀹氫箟key涓恒��' + row.key + '銆戠殑鏁版嵁椤癸紵'); + const id = row.id || ids.value; + const deployIds = row.deploymentId || deploymentIds.value; + const defKeys = row.key || keys.value; + await proxy?.$modal.confirm('鏄惁纭鍒犻櫎娴佺▼瀹氫箟KEY涓恒��' + keys.value + '銆戠殑鏁版嵁椤癸紵'); loading.value = true; - await deleteProcessDefinition(row.deploymentId, row.id).finally(() => (loading.value = false)); + await deleteProcessDefinition(deployIds, id).finally(() => (loading.value = false)); await getList(); proxy?.$modal.msgSuccess('鍒犻櫎鎴愬姛'); }; -- Gitblit v1.9.3