update 修改流程定义删除

This commit is contained in:
gssong 2024-04-08 22:43:37 +08:00
parent b4b0eba228
commit 905426ad45
2 changed files with 13 additions and 5 deletions

View File

@ -50,11 +50,11 @@ export const definitionXml = (processDefinitionId: string): AxiosPromise<definit
/**
*
* @param processDefinitionId id
* @param deploymentId id
* @param processDefinitionId id
* @returns
*/
export const deleteProcessDefinition = (deploymentId: string, processDefinitionId: string) => {
export const deleteProcessDefinition = (deploymentId: string | string[], processDefinitionId: string | string[]) => {
return request({
url: `/workflow/processDefinition/${deploymentId}/${processDefinitionId}`,
method: 'delete'

View File

@ -41,6 +41,7 @@
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-button type="danger" icon="Delete" :disabled="multiple" @click="handleDelete">删除</el-button>
<el-button type="primary" icon="UploadFilled" @click="uploadDialog.visible = true">部署流程文件</el-button>
</el-card>
</div>
@ -277,7 +278,9 @@ type CategoryOption = {
};
const loading = ref(true);
const ids = ref<Array<string | number>>([]);
const ids = ref<Array<any>>([]);
const deploymentIds = ref<Array<any>>([]);
const keys = ref<Array<any>>([]);
const single = ref(true);
const multiple = ref(true);
const showSearch = ref(true);
@ -368,6 +371,8 @@ const resetQuery = () => {
//
const handleSelectionChange = (selection: any) => {
ids.value = selection.map((item: any) => item.id);
deploymentIds.value = selection.map((item: any) => item.deploymentId);
keys.value = selection.map((item: any) => item.key);
single.value = selection.length !== 1;
multiple.value = !selection.length;
};
@ -414,9 +419,12 @@ const clickPreviewXML = async (id: string) => {
};
/** 删除按钮操作 */
const handleDelete = async (row: ProcessDefinitionVO) => {
await proxy?.$modal.confirm('是否确认删除流程定义key为【' + row.key + '】的数据项?');
const id = row.id || ids.value;
const deployIds = row.deploymentId || deploymentIds.value;
const defKeys = row.key || keys.value;
await proxy?.$modal.confirm('是否确认删除流程定义KEY为【' + keys.value + '】的数据项?');
loading.value = true;
await deleteProcessDefinition(row.deploymentId, row.id).finally(() => (loading.value = false));
await deleteProcessDefinition(deployIds, id).finally(() => (loading.value = false));
await getList();
proxy?.$modal.msgSuccess('删除成功');
};