update 流程部署支持多选

This commit is contained in:
LiuHao 2024-03-18 11:52:44 +08:00
parent a9cd5684b2
commit 5dcfee4c07
2 changed files with 34 additions and 18 deletions

View File

@ -93,7 +93,10 @@ export function deployProcessFile(data: any) {
return request({
url: '/workflow/processDefinition/deployByFile',
method: 'post',
data: data
data: data,
headers: {
repeatSubmit: false
}
});
}
@ -109,4 +112,3 @@ export const migrationDefinition = (currentProcessDefinitionId: string, fromProc
method: 'put'
});
};

View File

@ -138,7 +138,14 @@
style="width: 240px"
/>
</div>
<el-upload class="upload-demo" drag accept="application/zip,application/xml,.bpmn" :http-request="handerDeployProcessFile">
<el-upload
class="upload-demo"
drag
multiple
accept="application/zip,application/xml,.bpmn"
:before-upload="handlerBeforeUpload"
:http-request="handerDeployProcessFile"
>
<el-icon class="UploadFilled"><upload-filled /></el-icon>
<div class="el-upload__text"><em>点击上传选择BPMN流程文件</em></div>
<div class="el-upload__text">仅支持 .zip.bpmn20.xmlbpmn 格式文件</div>
@ -394,25 +401,32 @@ const handleConvertToModel = async (row: ProcessDefinitionVO) => {
proxy?.$modal.msgSuccess('操作成功');
};
//
const handerDeployProcessFile = (data: UploadRequestOptions): XMLHttpRequest => {
let formData = new FormData();
//
const handlerBeforeUpload = () => {
if (selectCategory.value === 'ALL') {
proxy?.$modal.msgError('顶级节点不可作为分类!');
return;
return false;
}
if (!selectCategory.value) {
proxy?.$modal.msgError('请选择左侧要上传的分类!');
return;
return false;
}
};
//
const handerDeployProcessFile = (data: UploadRequestOptions): XMLHttpRequest => {
let formData = new FormData();
uploadDialogLoading.value = true;
formData.append('file', data.file);
formData.append('categoryCode', selectCategory.value);
deployProcessFile(formData).then(() => {
deployProcessFile(formData)
.then(() => {
uploadDialog.visible = false;
proxy?.$modal.msgSuccess('部署成功');
uploadDialogLoading.value = false;
handleQuery();
})
.finally(() => {
uploadDialogLoading.value = false;
});
return;
};
</script>