hookehuyr

新增测试后端返回未通过的节点ID添加错误提示

...@@ -1512,6 +1512,33 @@ export default { ...@@ -1512,6 +1512,33 @@ export default {
1512 if (code) { 1512 if (code) {
1513 state.node_tree = {}; // 清空节点树缓存 1513 state.node_tree = {}; // 清空节点树缓存
1514 editor.closeModel(); 1514 editor.closeModel();
1515 +
1516 + // TODO: 节点错误提示测试
1517 + // let node_keys = ['start-node']; // 后端返回的未通过的节点key
1518 + // let { nodes } = editor.editorState.graph.save();
1519 + // if (node_keys.length) {
1520 + // ElMessage({
1521 + // type: 'error',
1522 + // message: '流程配置不完善,请点击节点红点完善。',
1523 + // });
1524 + // nodes.forEach((ele: any, idx: number) => {
1525 + // node_keys.forEach((key: string) => {
1526 + // if (ele.id === key) {
1527 + // ele.desc = 'https://cdn.ipadbiz.cn/oa/flow/icons-error1.png';
1528 + // editor.updateModel(ele); // 更新流程图信息
1529 + // }
1530 + // })
1531 + // });
1532 + // } else {
1533 + // ElMessage({
1534 + // type: 'success',
1535 + // message: '保存流程图成功',
1536 + // });
1537 + // }
1538 + ElMessage({
1539 + type: 'success',
1540 + message: '保存流程图成功',
1541 + });
1515 } 1542 }
1516 } 1543 }
1517 1544
...@@ -1556,10 +1583,6 @@ export default { ...@@ -1556,10 +1583,6 @@ export default {
1556 if (paths.length) { 1583 if (paths.length) {
1557 const { code, data } = await saveFlowAPI({ form_id: +form_id, flow_id: +flow_id, data: JSON.stringify({ nodes, edges }) }); 1584 const { code, data } = await saveFlowAPI({ form_id: +form_id, flow_id: +flow_id, data: JSON.stringify({ nodes, edges }) });
1558 if (code) { 1585 if (code) {
1559 - ElMessage({
1560 - type: 'success',
1561 - message: '保存流程图成功',
1562 - });
1563 updateFlowId(data); // 更新缓存flow_id 1586 updateFlowId(data); // 更新缓存flow_id
1564 console.log(paths); // 输出满足条件的路径结果数组 1587 console.log(paths); // 输出满足条件的路径结果数组
1565 } 1588 }
...@@ -1616,9 +1639,6 @@ export default { ...@@ -1616,9 +1639,6 @@ export default {
1616 // }); 1639 // });
1617 1640
1618 // let flow_id = getFlowId(); // 流程id 1641 // let flow_id = getFlowId(); // 流程id
1619 -
1620 - // // TODO: 需要一个可以保存多个表单的接口,field字段的结构要重新遍历state.field_extend
1621 - // // TODO:只要失焦的话就需要判断表单是否为空,为空需要用户继续填写不能走。
1622 // console.warn(state.node_tree); 1642 // console.warn(state.node_tree);
1623 // // TAG: 保存表单信息 1643 // // TAG: 保存表单信息
1624 // const { code, data } = await saveFlowNodePropertyAPI({ flow_id: +flow_id, node_code: state.detailModel.id, data: JSON.stringify({ name: state.node_name, user: state.userTags, field: state.field_extend, property: state.more_attr }) }) 1644 // const { code, data } = await saveFlowNodePropertyAPI({ flow_id: +flow_id, node_code: state.detailModel.id, data: JSON.stringify({ name: state.node_name, user: state.userTags, field: state.field_extend, property: state.more_attr }) })
......