Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
vue-flow-editor
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2024-02-21 19:04:32 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
764aa02549f259861e293a89d496cbe13e233841
764aa025
1 parent
981e2e2e
fix 主屏幕的流程保存后,预览界面流程需要更新节点信息
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
2 deletions
doc/App.vue
doc/App.vue
View file @
764aa02
...
...
@@ -519,7 +519,7 @@
<vue-flow-editor-form
ref="editor1"
:height="state.window_height"
:data="
f
lowData"
:data="
rawF
lowData"
:miniMap="showMiniMap"
:onRef="onRef1"
:multipleSelect="showMultipleSelect"
...
...
@@ -796,6 +796,8 @@ export default {
// TAG: 接口获取流程图数据
const flowData = ref<any>(null);
const rawFlowData = ref<any>(null); // 预览数据
const getFlowData = async (flow_id: any) => {
flowData.value = null;
state.reloadLoading = true; // 打开loading
...
...
@@ -810,12 +812,14 @@ export default {
// 没有流程图数据
if (!nodes.length && !edges.length) {
flowData.value = AppData; // 设置默认的数据
rawFlowData.value = AppData; // 设置默认的数据
} else {
flowData.value = { nodes, edges }; // 获取已存在的数据
rawFlowData.value = _.cloneDeep({ nodes, edges }); // 获取已存在的数据
// 内部刷新graph数据
nextTick(() => {
editor.editorState.graph.read(flowData.value)
editor1.editorState.graph.read(rawFlowData.value)
});
}
...
...
@@ -1467,6 +1471,22 @@ export default {
}
}
}
let editor1: {
clearStates(arg0: any): () => void
openModel: () => void
closeModel: () => void
openPreview1: () => void
addNode: (arg0: any) => void
updateModel: (arg0: any) => void
editorState: {
graph: {
addItem: any
removeItem: any
save: () => { nodes: any; edges: any }
read: any
}
}
}
/**
* 双击节点回调
...
...
@@ -1852,6 +1872,7 @@ export default {
type: 'success',
message: '保存流程图成功',
});
rawFlowData.value = flowData.value;
}
} else {
ElNotification.error('缺少一条从开始节点到结束节点的完整流程!');
...
...
@@ -2284,7 +2305,10 @@ export default {
}
const openPreview = () => {
// 打开弹框
state.dialogPreviewVisible = true;
// 获取最新数据
getFlowData(flow_id);
// 创建一个resize事件
const resizeEvent = new Event('resize');
...
...
@@ -2341,6 +2365,7 @@ export default {
rules,
formRef,
flowData,
rawFlowData,
showGrid: true, // 是否开启网格
showMiniMap: false, // 是否开启缩略图
...
...
@@ -2399,6 +2424,7 @@ export default {
handleDrawerClosed,
onRef: (e: any) => (editor = e),
onRef1: (e: any) => (editor1 = e),
staticPath,
}
},
...
...
Please
register
or
login
to post a comment