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
2023-12-08 18:57:24 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0ddf864b5e559f00a3fe3227de1421bd3f42766f
0ddf864b
1 parent
a82e63b7
fix
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
39 deletions
doc/App.vue
doc/App.vue
View file @
0ddf864
...
...
@@ -1909,22 +1909,7 @@ export default {
*
* @return {void} No return value.
*/
const saveData = async () => {
// 清空错误提示
let { nodes } = editor.editorState.graph.save();
nodes.forEach((ele: any, idx: number) => {
ele.desc = '';
editor.updateModel(ele); // 更新流程图信息
});
let flow_id = getFlowId(); // flow_id 流程ID
// 未点击任何节点时,提示促使用户点击节点
if (_.isEmpty(state.node_tree)) {
// TAG: 检查节点是否完整
const checkResult = await checkAllFlowNodePropertyAPI({ flow_id: +flow_id })
if (checkResult.code) {
const noticeError = (checkResult) => {
let { nodes, edges } = editor.editorState.graph.save();
let available_keys = _.map(nodes, 'id'); // 画布上存在的有效节点ID
let raw_keys = _.intersection(checkResult.data, available_keys); // 取交集有效ID
...
...
@@ -1945,6 +1930,24 @@ export default {
});
return;
}
}
const saveData = async () => {
// 清空错误提示
let { nodes } = editor.editorState.graph.save();
nodes.forEach((ele: any, idx: number) => {
ele.desc = '';
editor.updateModel(ele); // 更新流程图信息
});
let flow_id = getFlowId(); // flow_id 流程ID
// 未点击任何节点时,提示促使用户点击节点
if (_.isEmpty(state.node_tree)) {
// TAG: 检查节点是否完整
const checkResult = await checkAllFlowNodePropertyAPI({ flow_id: +flow_id })
if (checkResult.code) {
noticeError(checkResult);
} else {
// 保存流程图结构
saveFlowData();
...
...
@@ -1956,32 +1959,11 @@ export default {
return;
}
// TAG: 检查节点是否完整
// 检查点击节点后通过了,但是还有未通过的节点没有点击时
const checkResult = await checkAllFlowNodePropertyAPI({ flow_id: +flow_id })
if (checkResult.code) {
let { nodes, edges } = editor.editorState.graph.save();
let available_keys = _.map(nodes, 'id'); // 画布上存在的有效节点ID
let raw_keys = _.intersection(checkResult.data, available_keys); // 取交集有效ID
let node_keys = Object.keys(state.node_tree); // 现在本地的ID都是有效的值
let result = _.difference(raw_keys, node_keys);
if (result.length) {
ElMessage({
type: 'error',
message: '流程配置不完善,请点击节点红点完善。',
});
let { nodes } = editor.editorState.graph.save();
nodes.forEach((ele: any, idx: number) => {
result.forEach((key: string) => {
if (ele.id === key) {
ele.desc = 'https://cdn.ipadbiz.cn/oa/flow/icons-error1.png';
editor.updateModel(ele); // 更新流程图信息
}
})
});
return;
}
noticeError(checkResult);
}
ElMessageBox.confirm(
...
...
Please
register
or
login
to post a comment