From f3425493ed4e77ea683930e314e46cb51f5151a2 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期二, 26 十一月 2024 15:29:22 +0800 Subject: [PATCH] update 优化 全代码规范化处理 --- src/views/workflow/processInstance/index.vue | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/views/workflow/processInstance/index.vue b/src/views/workflow/processInstance/index.vue index 4f994af..084cf13 100644 --- a/src/views/workflow/processInstance/index.vue +++ b/src/views/workflow/processInstance/index.vue @@ -52,7 +52,7 @@ <el-col :span="1.5"> <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete">鍒犻櫎</el-button> </el-col> - <right-toolbar v-model:showSearch="showSearch" @query-table="handleQuery"></right-toolbar> + <right-toolbar v-model:show-search="showSearch" @query-table="handleQuery"></right-toolbar> </el-row> </template> @@ -167,6 +167,8 @@ const loading = ref(true); // 閫変腑鏁扮粍 const ids = ref<Array<any>>([]); +// 閫変腑涓氬姟id鏁扮粍 +const businessKeys = ref<Array<any>>([]); // 闈炲崟涓鐢� const single = ref(true); // 闈炲涓鐢� @@ -257,6 +259,7 @@ // 澶氶�夋閫変腑鏁版嵁 const handleSelectionChange = (selection: ProcessInstanceVO[]) => { ids.value = selection.map((item: any) => item.id); + businessKeys.value = selection.map((item: any) => item.businessKey); single.value = selection.length !== 1; multiple.value = !selection.length; }; @@ -281,14 +284,14 @@ /** 鍒犻櫎鎸夐挳鎿嶄綔 */ const handleDelete = async (row: any) => { - const id = row.id || ids.value; - await proxy?.$modal.confirm('鏄惁纭鍒犻櫎id涓恒��' + id + '銆戠殑鏁版嵁椤癸紵'); + const businessKey = row.businessKey || businessKeys.value; + await proxy?.$modal.confirm('鏄惁纭鍒犻櫎涓氬姟id涓恒��' + businessKey + '銆戠殑鏁版嵁椤癸紵'); loading.value = true; if ('running' === tab.value) { - await deleteRunAndHisInstance(id).finally(() => (loading.value = false)); + await deleteRunAndHisInstance(businessKey).finally(() => (loading.value = false)); getProcessInstanceRunningList(); } else { - await deleteFinishAndHisInstance(id).finally(() => (loading.value = false)); + await deleteFinishAndHisInstance(businessKey).finally(() => (loading.value = false)); getProcessInstanceFinishList(); } proxy?.$modal.msgSuccess('鍒犻櫎鎴愬姛'); @@ -308,7 +311,7 @@ loading.value = true; if ('running' === tab.value) { let param = { - processInstanceId: row.id, + businessKey: row.businessKey, deleteReason: deleteReason.value }; await deleteRunInstance(param).finally(() => (loading.value = false)); -- Gitblit v1.9.3