Merge branch 'dev-zhao' into 'dev'

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

See merge request itc-framework/ma/2024/front!26
This commit is contained in:
890147
2025-02-08 07:56:12 +00:00
2 changed files with 25 additions and 7 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 + (getAppEnvConfig().VITE_GLOB_API_URL_PREFIX|| '') + '/workflow/schema/import?cover='+props.coverType;
data.headers.Authorization = `Bearer ${getToken()}`; data.headers.Authorization = `Bearer ${getToken()}`;
} }
function close() { function close() {
@ -65,13 +70,13 @@
} }
if (info.file.status === 'done') { if (info.file.status === 'done') {
if (info.file && info.file.response && info.file.response.code == 0) { if (info.file && info.file.response && info.file.response.code == 0) {
message.success(t(`{name}导入成功!`, { name: info.file.name })); message.success(`${info.file.name}导入成功!`);
close(); close();
} else { } else {
message.error(t('导入流程失败!')); message.error('导入流程失败!'+ 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(`${info.file.name}上传失败.`);
} }
} }
</script> </script>

View File

@ -27,9 +27,22 @@
<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-tooltip placement="topLeft">
> <template #title>
<span>新增导入会保留原id流程新增新流程并不会验证code和name是否相同如果旧流程还绑定中导入新流程也是绑定状态的话会导致page查询注入workflow出错</span>
</template>
<a-button v-auth="'design:importFlow'">{{ t('新增导入流程') }}</a-button>
</a-tooltip>
</ImportFlow>
<ImportFlow :coverType="true">
<a-tooltip placement="topLeft">
<template #title>
<span>覆盖导入同样支持新增流程导入会有保存验证保存出错请确认报错信息</span>
</template>
<a-button v-auth="'design:importFlow'">{{ t('覆盖导入流程') }}</a-button>
</a-tooltip>
</ImportFlow>
<a-button v-auth="'design:exportFlow'" @click.stop="handleDownByData">{{ <a-button v-auth="'design:exportFlow'" @click.stop="handleDownByData">{{
t('导出流程') t('导出流程')
}}</a-button> }}</a-button>