feat:修复流程图导入导出。

1.分为增量和覆盖导入两种,会根据导出的id,对覆盖导入的更新原有的流程表单,增量是保留原表单的新增一个允许同名同code的新流程(或者原来没有的新增也可)。两种导入都可以对新增导入进行处理。
This commit is contained in:
lvjunzhao
2025-01-15 11:31:18 +08:00
parent 22b8d2c3a1
commit 3993b98f57
2 changed files with 12 additions and 4 deletions

View File

@ -49,10 +49,15 @@
action: '', action: '',
headers: { Authorization: '' }, headers: { Authorization: '' },
}); });
const props = defineProps({
coverType: {
type: Boolean
},
});
async function open() { async function open() {
data.visible = true; data.visible = true;
data.action = getAppEnvConfig().VITE_GLOB_API_URL + '/workflow/schema/import'; data.action = getAppEnvConfig().VITE_GLOB_API_URL + '/workflow/schema/import?cover='+props.coverType;
data.headers.Authorization = `Bearer ${getToken()}`; data.headers.Authorization = `Bearer ${getToken()}`;
} }
function close() { function close() {
@ -68,7 +73,7 @@
message.success(t(`{name}导入成功!`, { name: info.file.name })); message.success(t(`{name}导入成功!`, { name: info.file.name }));
close(); close();
} else { } else {
message.error(t('导入流程失败!')); message.error(t('导入流程失败!'+ info.file.response.msg));
} }
} else if (info.file.status === 'error') { } else if (info.file.status === 'error') {
message.error(t(`{name}上传失败.`, { name: info.file.name })); message.error(t(`{name}上传失败.`, { name: info.file.name }));

View File

@ -27,8 +27,11 @@
<History :schemaId="schemaId" <History :schemaId="schemaId"
><a-button v-auth="'design:history'">{{ t('历史记录') }}</a-button></History ><a-button v-auth="'design:history'">{{ t('历史记录') }}</a-button></History
> >
<ImportFlow <ImportFlow :coverType="false"
><a-button v-auth="'design:importFlow'">{{ t('导入流程') }}</a-button></ImportFlow ><a-button v-auth="'design:importFlow'">{{ t('增量导入流程') }}</a-button></ImportFlow
>
<ImportFlow :coverType="true"
><a-button v-auth="'design:importFlow'">{{ t('覆盖导入流程') }}</a-button></ImportFlow
> >
<a-button v-auth="'design:exportFlow'" @click.stop="handleDownByData">{{ <a-button v-auth="'design:exportFlow'" @click.stop="handleDownByData">{{
t('导出流程') t('导出流程')