Explorar o código

Merge branch 'feature/bpm' of https://gitee.com/yudaocode/yudao-ui-admin-vue3 into feature/bpm

YunaiV hai 7 meses
pai
achega
b82959118e
Modificáronse 2 ficheiros con 28 adicións e 0 borrados
  1. 4 0
      src/api/bpm/model/index.ts
  2. 24 0
      src/views/bpm/model/CategoryDraggableModel.vue

+ 4 - 0
src/api/bpm/model/index.ts

@@ -72,3 +72,7 @@ export const deleteModel = async (id: number) => {
 export const deployModel = async (id: number) => {
   return await request.post({ url: '/bpm/model/deploy?id=' + id })
 }
+
+export const cleanModel = async (id: number) => {
+  return await request.delete({ url: '/bpm/model/clean?id=' + id })
+}

+ 24 - 0
src/views/bpm/model/CategoryDraggableModel.vue

@@ -203,6 +203,14 @@
                   >
                     {{ scope.row.processDefinition.suspensionState === 1 ? '停用' : '启用' }}
                   </el-dropdown-item>
+                  <el-dropdown-item
+                    type="danger"
+                    command="handleClean"
+                    v-if="checkPermi(['bpm:model:delete'])"
+                    :disabled="!isManagerUser(scope.row)"
+                  >
+                    清理
+                  </el-dropdown-item>
                   <el-dropdown-item
                     type="danger"
                     command="handleDelete"
@@ -285,6 +293,9 @@ const handleModelCommand = (command: string, row: any) => {
     case 'handleChangeState':
       handleChangeState(row)
       break
+    case 'handleClean':
+      handleClean(row)
+      break
     default:
       break
   }
@@ -318,6 +329,19 @@ const handleDelete = async (row: any) => {
   } catch {}
 }
 
+/** 清理按钮操作 */
+const handleClean = async (row: any) => {
+  try {
+    // 清理的二次确认
+    await message.confirm('是否确认清理流程名字为"' + row.name + '"的数据项?')
+    // 发起清理
+    await ModelApi.cleanModel(row.id)
+    message.success('清理成功')
+    // 刷新列表
+    emit('success')
+  } catch {}
+}
+
 /** 更新状态操作 */
 const handleChangeState = async (row: any) => {
   const state = row.processDefinition.suspensionState