Skip to content

Commit 121a6d8

Browse files
YunaiVgitee-org
authored andcommitted
!661 BPM:流程清理
Merge pull request !661 from Lesan/feature/bpm-流程清理
2 parents c8447fe + 1af93e5 commit 121a6d8

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/api/bpm/model/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,7 @@ export const deleteModel = async (id: number) => {
7272
export const deployModel = async (id: number) => {
7373
return await request.post({ url: '/bpm/model/deploy?id=' + id })
7474
}
75+
76+
export const cleanModel = async (id: number) => {
77+
return await request.delete({ url: '/bpm/model/clean?id=' + id })
78+
}

src/views/bpm/model/CategoryDraggableModel.vue

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,14 @@
203203
>
204204
{{ scope.row.processDefinition.suspensionState === 1 ? '停用' : '启用' }}
205205
</el-dropdown-item>
206+
<el-dropdown-item
207+
type="danger"
208+
command="handleClean"
209+
v-if="checkPermi(['bpm:model:delete'])"
210+
:disabled="!isManagerUser(scope.row)"
211+
>
212+
清理
213+
</el-dropdown-item>
206214
<el-dropdown-item
207215
type="danger"
208216
command="handleDelete"
@@ -285,6 +293,9 @@ const handleModelCommand = (command: string, row: any) => {
285293
case 'handleChangeState':
286294
handleChangeState(row)
287295
break
296+
case 'handleClean':
297+
handleClean(row)
298+
break
288299
default:
289300
break
290301
}
@@ -318,6 +329,19 @@ const handleDelete = async (row: any) => {
318329
} catch {}
319330
}
320331
332+
/** 清理按钮操作 */
333+
const handleClean = async (row: any) => {
334+
try {
335+
// 清理的二次确认
336+
await message.confirm('是否确认清理流程名字为"' + row.name + '"的数据项?')
337+
// 发起清理
338+
await ModelApi.cleanModel(row.id)
339+
message.success('清理成功')
340+
// 刷新列表
341+
emit('success')
342+
} catch {}
343+
}
344+
321345
/** 更新状态操作 */
322346
const handleChangeState = async (row: any) => {
323347
const state = row.processDefinition.suspensionState

0 commit comments

Comments
 (0)