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 | 29 +++++++++++------------------ 1 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/views/workflow/processInstance/index.vue b/src/views/workflow/processInstance/index.vue index 764ca2f..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> @@ -81,7 +81,7 @@ </el-table-column> <el-table-column align="center" prop="startTime" label="鍚姩鏃堕棿" width="160"></el-table-column> <el-table-column v-if="tab === 'finish'" align="center" prop="endTime" label="缁撴潫鏃堕棿" width="160"></el-table-column> - <el-table-column label="鎿嶄綔" align="center" :width="tab === 'finish' ? '130' : '160'"> + <el-table-column label="鎿嶄綔" align="center" :width="130"> <template #default="scope"> <el-row v-if="tab === 'running'" :gutter="10" class="mb8"> <el-col :span="1.5"> @@ -97,22 +97,12 @@ </el-popover> </el-col> <el-col :span="1.5"> - <el-button - link - type="primary" - size="small" - icon="Sort" - @click="getProcessDefinitionHitoryList(scope.row.processDefinitionId, scope.row.processDefinitionKey)" - >鍒囨崲鐗堟湰</el-button - > + <el-button link type="primary" size="small" icon="Delete" @click="handleDelete(scope.row)">鍒犻櫎</el-button> </el-col> </el-row> <el-row :gutter="10" class="mb8"> <el-col :span="1.5"> <el-button link type="primary" size="small" icon="View" @click="handleView(scope.row)">鏌ョ湅</el-button> - </el-col> - <el-col :span="1.5"> - <el-button link type="primary" size="small" icon="Delete" @click="handleDelete(scope.row)">鍒犻櫎</el-button> </el-col> </el-row> </template> @@ -177,6 +167,8 @@ const loading = ref(true); // 閫変腑鏁扮粍 const ids = ref<Array<any>>([]); +// 閫変腑涓氬姟id鏁扮粍 +const businessKeys = ref<Array<any>>([]); // 闈炲崟涓鐢� const single = ref(true); // 闈炲涓鐢� @@ -267,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; }; @@ -291,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('鍒犻櫎鎴愬姛'); @@ -318,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