hookehuyr

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

......@@ -1512,6 +1512,33 @@ export default {
if (code) {
state.node_tree = {}; // 清空节点树缓存
editor.closeModel();
// TODO: 节点错误提示测试
// let node_keys = ['start-node']; // 后端返回的未通过的节点key
// let { nodes } = editor.editorState.graph.save();
// if (node_keys.length) {
// ElMessage({
// type: 'error',
// message: '流程配置不完善,请点击节点红点完善。',
// });
// nodes.forEach((ele: any, idx: number) => {
// node_keys.forEach((key: string) => {
// if (ele.id === key) {
// ele.desc = 'https://cdn.ipadbiz.cn/oa/flow/icons-error1.png';
// editor.updateModel(ele); // 更新流程图信息
// }
// })
// });
// } else {
// ElMessage({
// type: 'success',
// message: '保存流程图成功',
// });
// }
ElMessage({
type: 'success',
message: '保存流程图成功',
});
}
}
......@@ -1556,10 +1583,6 @@ export default {
if (paths.length) {
const { code, data } = await saveFlowAPI({ form_id: +form_id, flow_id: +flow_id, data: JSON.stringify({ nodes, edges }) });
if (code) {
ElMessage({
type: 'success',
message: '保存流程图成功',
});
updateFlowId(data); // 更新缓存flow_id
console.log(paths); // 输出满足条件的路径结果数组
}
......@@ -1616,9 +1639,6 @@ export default {
// });
// let flow_id = getFlowId(); // 流程id
// // TODO: 需要一个可以保存多个表单的接口,field字段的结构要重新遍历state.field_extend
// // TODO:只要失焦的话就需要判断表单是否为空,为空需要用户继续填写不能走。
// console.warn(state.node_tree);
// // TAG: 保存表单信息
// 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 }) })
......