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({ return request({
url: '/workflow/processDefinition/deployByFile', url: '/workflow/processDefinition/deployByFile',
method: 'post', method: 'post',
data: data data: data,
headers: {
repeatSubmit: false
}
}); });
} }
@ -109,4 +112,3 @@ export const migrationDefinition = (currentProcessDefinitionId: string, fromProc
method: 'put' method: 'put'
}); });
}; };

View File

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