update 调整导入模型选择流程类别方式(改为表单内下拉框)

Signed-off-by: 愿丶 <1319542051@qq.com>
This commit is contained in:
愿丶 2024-03-12 15:48:42 +00:00 committed by Gitee
parent f9b8922bed
commit 7666f724df
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -125,12 +125,25 @@
<!-- 部署文件 --> <!-- 部署文件 -->
<el-dialog v-if="uploadDialog.visible" v-model="uploadDialog.visible" :title="uploadDialog.title" width="30%"> <el-dialog v-if="uploadDialog.visible" v-model="uploadDialog.visible" :title="uploadDialog.title" width="30%">
<div v-loading="uploadDialogLoading"> <div v-loading="uploadDialogLoading">
<div class="mb5">
<el-text class="mx-1" size="large"><span class="text-danger">*</span>请选择部署流程分类</el-text>
<el-tree-select
v-model="selectCategory"
:data="categoryOptions"
:props="{ value: 'categoryCode', label: 'categoryName', children: 'children' }"
filterable
value-key="categoryCode"
:render-after-expand="false"
check-strictly
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 accept="application/zip,application/xml,.bpmn" :http-request="handerDeployProcessFile">
<el-icon class="UploadFilled"><upload-filled /></el-icon> <el-icon class="UploadFilled"><upload-filled /></el-icon>
<div class="el-upload__text"><em>点击上传选择BPMN流程文件</em></div> <div class="el-upload__text"><em>点击上传选择BPMN流程文件</em></div>
<div class="el-upload__text">仅支持 .zip.bpmn20.xmlbpmn 格式文件</div> <div class="el-upload__text">仅支持 .zip.bpmn20.xmlbpmn 格式文件</div>
<div class="el-upload__text">PS:如若部署请部署从本项目模型管理导出的数据</div> <div class="el-upload__text">PS:如若部署请部署从本项目模型管理导出的数据</div>
</el-upload> </el-upload>
</div> </div>
</el-dialog> </el-dialog>
@ -232,6 +245,8 @@ const processDefinitionHistoryList = ref<ProcessDefinitionVO[]>([]);
const url = ref<string[]>([]); const url = ref<string[]>([]);
const categoryOptions = ref<CategoryOption[]>([]); const categoryOptions = ref<CategoryOption[]>([]);
const categoryName = ref(''); const categoryName = ref('');
/** 部署文件分类选择 */
const selectCategory = ref();
const uploadDialog = reactive<DialogOption>({ const uploadDialog = reactive<DialogOption>({
visible: false, visible: false,
@ -382,21 +397,21 @@ const handleConvertToModel = async (row: ProcessDefinitionVO) => {
// //
const handerDeployProcessFile = (data: UploadRequestOptions): XMLHttpRequest => { const handerDeployProcessFile = (data: UploadRequestOptions): XMLHttpRequest => {
let formData = new FormData(); let formData = new FormData();
if (queryParams.value.categoryCode === 'ALL') { if (selectCategory.value === 'ALL') {
proxy?.$modal.msgError('顶级节点不可作为分类!'); proxy?.$modal.msgError('顶级节点不可作为分类!');
return; return;
} }
if (!queryParams.value.categoryCode) { if (!selectCategory.value) {
proxy?.$modal.msgError('请选择左侧要上传的分类!'); proxy?.$modal.msgError('请选择左侧要上传的分类!');
return; return;
} }
uploadDialogLoading.value = true uploadDialogLoading.value = true;
formData.append('file', data.file); formData.append('file', data.file);
formData.append('categoryCode', queryParams.value.categoryCode); formData.append('categoryCode', selectCategory.value);
deployProcessFile(formData).then(() => { deployProcessFile(formData).then(() => {
uploadDialog.visible = false; uploadDialog.visible = false;
proxy?.$modal.msgSuccess('部署成功'); proxy?.$modal.msgSuccess('部署成功');
uploadDialogLoading.value = false uploadDialogLoading.value = false;
handleQuery(); handleQuery();
}); });
}; };