修复updateFlowTemplateDraftApi问题

This commit is contained in:
weibl
2025-11-24 15:18:27 +08:00
parent 89c2bf253f
commit 854b25162d

View File

@@ -112,7 +112,7 @@ const changeVersionFun = () => {
getFlowDetail();
};
const flowDetail = reactive({
const flowDetail = reactive<any>({
uuid: '',
version: '',
comment: '',
@@ -124,11 +124,15 @@ const getFlowDetail = async() => {
const res:any = await queryFlowTemplateDetailApi({ uuid: currentVersion.value.uuid, status: 1 });
if (res.code === 200) {
flowDetail.uuid = res.data.uuid;
flowDetail.version = res.data.templateVersion;
flowDetail.templateName = res.data.templateName;
flowDetail.comment = res.data.comment;
flowDetail.templateType = res.data.templateType;
// flowDetail.uuid = res.data.uuid;
// flowDetail.templateVersion = res.data.templateVersion;
// flowDetail.templateName = res.data.templateName;
// flowDetail.comment = res.data.comment;
// flowDetail.templateType = res.data.templateType;
for (const key in res.data) {
flowDetail[key] = res.data[key];
}
if (res.data.viewContent.length > 50) {
const dataJson = JSON.parse(res.data.viewContent);
@@ -150,7 +154,7 @@ const saveDraftFun = async(callback?: () => void) => {
if (!callback) {
nodeRelation.value = getRelationNodeAndVerifyFlowFun(graph.value.model.collection.cells);
}
const res:any = await updateFlowTemplateDraftApi({ uuid: props.flowUuid, viewContent: JSON.stringify(dataJson), templateContent: JSON.stringify(nodeRelation.value) });
const res:any = await updateFlowTemplateDraftApi({ ...flowDetail, uuid: props.flowUuid, viewContent: JSON.stringify(dataJson), templateContent: JSON.stringify(nodeRelation.value) });
if (!callback) {
if (res.code === 200) {
ElMessage.success('保存成功');