fix: 修复已发流程列表删除多个问题

rf
tony 2022-12-26 09:47:53 +08:00
parent 5dce8b6182
commit 7dc7f92c2d
4 changed files with 12 additions and 50 deletions

View File

@ -53,10 +53,12 @@ public class FlowInstanceController {
} }
@ApiOperation(value = "删除流程实例") @ApiOperation(value = "删除流程实例")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete/{instanceIds}")
public AjaxResult delete(@ApiParam(value = "流程实例ID", required = true) @RequestParam String instanceId, public AjaxResult delete(@ApiParam(value = "流程实例ID", required = true) @PathVariable String[] instanceIds,
@ApiParam(value = "删除原因") @RequestParam(required = false) String deleteReason) { @ApiParam(value = "删除原因") @RequestParam(required = false) String deleteReason) {
flowInstanceService.delete(instanceId,deleteReason); for (String instanceId : instanceIds) {
flowInstanceService.delete(instanceId,deleteReason);
}
return AjaxResult.success(); return AjaxResult.success();
} }
} }

View File

@ -65,7 +65,7 @@ export function updateDeployment(data) {
// 删除流程定义 // 删除流程定义
export function delDeployment(id) { export function delDeployment(id) {
return request({ return request({
url: '/flowable/instance/delete/?instanceId=' + id, url: '/flowable/instance/delete/' + id,
method: 'delete' method: 'delete'
}) })
} }

View File

@ -46,16 +46,6 @@
v-hasPermi="['system:deployment:remove']" v-hasPermi="['system:deployment:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:deployment:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -279,7 +269,7 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.procInsId)
this.single = selection.length!==1 this.single = selection.length!==1
this.multiple = !selection.length this.multiple = !selection.length
}, },
@ -356,13 +346,12 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
// const ids = row.procInsId || this.ids;// const ids = row.procInsId || this.ids;//
const ids = row.procInsId;
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", { this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(function() { }).then(() => {
return delDeployment(ids); return delDeployment(ids);
}).then(() => { }).then(() => {
this.getList(); this.getList();
@ -376,7 +365,7 @@ export default {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(function() { }).then(() => {
return exportDeployment(queryParams); return exportDeployment(queryParams);
}).then(response => { }).then(response => {
this.download(response.msg); this.download(response.msg);

View File

@ -185,29 +185,13 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.taskId)
this.single = selection.length !== 1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加流程定义";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getDeployment(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改流程定义";
});
},
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.taskId || this.ids;
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", { this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
@ -219,19 +203,6 @@ export default {
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}) })
}, },
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有流程定义数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return exportDeployment(queryParams);
}).then(response => {
this.download(response.msg);
})
}
} }
}; };
</script> </script>