解析条件表达式

需求是
!(1||2||3)&&5&&(4||5&&6||7||(8||9||10&&11||12&&(13&&14||15)))||8

解析成 流程图  我用了Gojs
"nodeDataArray": [

{ "key": 1, "category": "Auto", "text": "描述1" },
{ "key": 2, "category": "Auto", "text": "描述2" },

{ "key": 11, "category": "Auto", "text": "描述11" }, // red表示非
{ "key": 12, "category": "Auto", "text": "描述12" },
{ "key": 13, "category": "DesiredEvent", "text": "且" },
{ "key": 14, "category": "Auto", "text": "描述14", red: true },
{ "key": 15, "category": "Auto", "text": "描述15", red: true },
{ "key": 16, "category": "Auto", "text": "描述16", red: true },
{ "key": 17, "category": "Auto", "text": "描述17", red: true },
{ "key": 18, "category": "Auto", "text": "描述18", red: true },
{ "key": 19, "category": "Auto", "text": "描述19" },
{ "key": 20, "category": "Auto", "text": "描述20" },
{ "key": 21, "category": "Auto", "text": "描述21" },
{ "key": 22, "category": "Auto", "text": "描述22" },
{ "key": 23, "category": "Auto", "text": "描述23" },
{ "key": 24, "category": "Auto", "text": "描述24" },
{ "key": 25, "category": "Auto", "text": "描述25" },
{ "key": 26, "category": "Auto", "text": "描述26" },
{ "key": 27, "category": "Auto", "text": "描述27" },
{ "key": 28, "category": "Auto", "text": "描述28" },

],
"linkDataArray": [
{ "from": 20, "to": 2 },
{ "from": 2, "to": 1 },
{ "from": 1, "to": 11 },
{ "from": 1, "to": 12 },

{ "from": 11, "to": 13 },
{ "from": 12, "to": 13 },

{ "from": 13, "to": 14 },
{ "from": 13, "to": 15 },
{ "from": 13, "to": 16 },
{ "from": 13, "to": 17 },
{ "from": 13, "to": 18 },

{ "from": 14, "to": 19 },
{ "from": 15, "to": 19 },
{ "from": 16, "to": 19 },
{ "from": 17, "to": 19 },
{ "from": 18, "to": 19 },

{ "from": 19, "to": 21 },
{ "from": 21, "to": 22 },
{ "from": 22, "to": 23 },
{ "from": 23, "to": 24 },
{ "from": 24, "to": 25 },
{ "from": 25, "to": 26 },
{ "from": 26, "to": 27 },
{ "from": 27, "to": 28 },
]
#前端#
全部评论
大家有没有做过类似的需求的?我现在遇到的问题是【组合】与【组合】之间的【且】不知到怎么连线
点赞 回复 分享
发布于 2019-11-21 15:59

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务