2025-05-17 22:53:30 +08:00
2025-04-20 00:49:14 +08:00
2025-05-17 16:56:01 +08:00
2025-05-05 23:21:31 +08:00
2025-05-17 22:53:30 +08:00
2025-04-20 00:49:14 +08:00
2025-04-30 00:17:09 +08:00
2025-04-20 00:49:14 +08:00
2025-04-20 00:49:14 +08:00
2025-04-20 00:49:14 +08:00
2025-05-01 01:07:16 +08:00
2025-04-28 20:04:46 +08:00
2025-04-20 00:49:14 +08:00
2025-05-08 19:42:45 +08:00
2025-05-02 00:35:53 +08:00
2025-05-11 18:46:59 +08:00
2025-05-17 13:08:29 +08:00
2025-04-27 00:05:18 +08:00
2025-04-20 00:49:14 +08:00
2025-04-20 00:49:14 +08:00
fix
2025-05-13 22:37:34 +08:00

场景接口

获取场景

POST /scene/getById

请求体: { id: string }

响应体: SceneDetail

示例:

{
  "code": 200,
  "success": true,
  "data": {
    "id": "mock-scene-1",
    "label": "模拟场景A",
    "json": "{\"x\":0,\"y\":0,\"scale\":1,\"pens\":[{\"id\":\"1417882e\",\"name\":\"area\",\"tags\":[\"area\",\"area-11\"],\"label\":\"测试互斥区\",\"x\":275,\"y\":54,\"width\":178,\"height\":107,\"lineWidth\":1,\"area\":{\"type\":11,\"points\":[\"083f10\",\"3a350276\"],\"routes\":[\"4781a31f\",\"fc86102\",\"6f33b86\"]},\"locked\":4,\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[],\"rotate\":0},{\"id\":\"f236e4b\",\"name\":\"area\",\"tags\":[\"area\",\"area-1\"],\"label\":\"测试库区\",\"x\":281,\"y\":246,\"width\":292,\"height\":152,\"lineWidth\":1,\"area\":{\"type\":1,\"points\":[\"343a2f0\"],\"routes\":[]},\"locked\":4,\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[],\"rotate\":0},{\"id\":\"de62ae3\",\"name\":\"area\",\"tags\":[\"area\",\"area-12\"],\"label\":\"测试非互斥区\",\"x\":63,\"y\":67,\"width\":203,\"height\":325,\"lineWidth\":1,\"area\":{\"type\":12,\"points\":[\"776fa1bf\",\"ea84ca\",\"51b95527\",\"200e2898\"],\"routes\":[]},\"locked\":4,\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[],\"rotate\":0},{\"x\":100,\"y\":100,\"width\":24,\"height\":24,\"lineWidth\":2,\"iconSize\":4,\"image\":\"\",\"canvasLayer\":3,\"id\":\"776fa1bf\",\"name\":\"point\",\"tags\":[\"point\"],\"label\":\"测试普通点\",\"point\":{\"type\":1},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"penId\":\"776fa1bf\",\"id\":\"t\",\"x\":0.5,\"y\":0},{\"penId\":\"776fa1bf\",\"id\":\"b\",\"x\":0.5,\"y\":1},{\"penId\":\"776fa1bf\",\"id\":\"l\",\"x\":0,\"y\":0.5},{\"penId\":\"776fa1bf\",\"id\":\"r\",\"x\":1,\"y\":0.5}],\"rotate\":0,\"connectedLines\":[{\"lineId\":\"3de9971\",\"lineAnchor\":\"42f48978\",\"anchor\":\"r\"},{\"lineId\":\"142dbab5\",\"lineAnchor\":\"70b09d5\",\"anchor\":\"b\"}]},{\"x\":200,\"y\":100,\"width\":24,\"height\":24,\"lineWidth\":2,\"iconSize\":4,\"image\":\"\",\"canvasLayer\":3,\"id\":\"ea84ca\",\"name\":\"point\",\"tags\":[\"point\"],\"label\":\"测试等待点\",\"point\":{\"type\":2,\"actions\":[\"343a2f0\"]},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"penId\":\"ea84ca\",\"id\":\"t\",\"x\":0.5,\"y\":0},{\"penId\":\"ea84ca\",\"id\":\"b\",\"x\":0.5,\"y\":1},{\"penId\":\"ea84ca\",\"id\":\"l\",\"x\":0,\"y\":0.5},{\"penId\":\"ea84ca\",\"id\":\"r\",\"x\":1,\"y\":0.5}],\"rotate\":0,\"connectedLines\":[{\"lineId\":\"3de9971\",\"lineAnchor\":\"60110d7\",\"anchor\":\"l\"},{\"lineId\":\"4781a31f\",\"lineAnchor\":\"73e75ced\",\"anchor\":\"r\"}]},{\"x\":300,\"y\":100,\"width\":24,\"height\":24,\"lineWidth\":2,\"iconSize\":4,\"image\":\"\",\"canvasLayer\":3,\"id\":\"083f10\",\"name\":\"point\",\"tags\":[\"point\"],\"label\":\"测试避让点\",\"point\":{\"type\":3},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"penId\":\"083f10\",\"id\":\"t\",\"x\":0.5,\"y\":0},{\"penId\":\"083f10\",\"id\":\"b\",\"x\":0.5,\"y\":1},{\"penId\":\"083f10\",\"id\":\"l\",\"x\":0,\"y\":0.5},{\"penId\":\"083f10\",\"id\":\"r\",\"x\":1,\"y\":0.5}],\"rotate\":0,\"connectedLines\":[{\"lineId\":\"4781a31f\",\"lineAnchor\":\"4c98bb6\",\"anchor\":\"l\"},{\"lineId\":\"fc86102\",\"lineAnchor\":\"19ec7bcb\",\"anchor\":\"r\"}]},{\"x\":400,\"y\":100,\"width\":24,\"height\":24,\"lineWidth\":2,\"iconSize\":4,\"image\":\"\",\"canvasLayer\":3,\"id\":\"3a350276\",\"name\":\"point\",\"tags\":[\"point\"],\"label\":\"测试临时避让点\",\"point\":{\"type\":4},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"penId\":\"3a350276\",\"id\":\"t\",\"x\":0.5,\"y\":0},{\"penId\":\"3a350276\",\"id\":\"b\",\"x\":0.5,\"y\":1},{\"penId\":\"3a350276\",\"id\":\"l\",\"x\":0,\"y\":0.5},{\"penId\":\"3a350276\",\"id\":\"r\",\"x\":1,\"y\":0.5}],\"rotate\":0,\"connectedLines\":[{\"lineId\":\"fc86102\",\"lineAnchor\":\"ef8cad\",\"anchor\":\"l\"},{\"lineId\":\"6f33b86\",\"lineAnchor\":\"2a73e4b\",\"anchor\":\"r\"}]},{\"x\":100,\"y\":300,\"width\":48,\"height\":60,\"lineWidth\":3,\"iconSize\":10,\"image\":\"/point/11-dark.png\",\"canvasLayer\":3,\"id\":\"51b95527\",\"name\":\"point\",\"tags\":[\"point\"],\"label\":\"测试电梯点\",\"point\":{\"type\":11},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"penId\":\"51b95527\",\"id\":\"t\",\"x\":0.5,\"y\":0},{\"penId\":\"51b95527\",\"id\":\"b\",\"x\":0.5,\"y\":1},{\"penId\":\"51b95527\",\"id\":\"l\",\"x\":0,\"y\":0.5},{\"penId\":\"51b95527\",\"id\":\"r\",\"x\":1,\"y\":0.5}],\"rotate\":0,\"connectedLines\":[{\"lineId\":\"7a48284\",\"lineAnchor\":\"4275bcb\",\"anchor\":\"r\"},{\"lineId\":\"142dbab5\",\"lineAnchor\":\"9167210\",\"anchor\":\"t\"},{\"lineId\":\"a3ad044\",\"lineAnchor\":\"d02372d\",\"anchor\":\"b\"},{\"lineId\":\"71734a6\",\"lineAnchor\":\"f004754\",\"anchor\":\"b\"}]},{\"x\":200,\"y\":300,\"width\":48,\"height\":60,\"lineWidth\":3,\"iconSize\":10,\"image\":\"/point/12-dark.png\",\"canvasLayer\":3,\"id\":\"200e2898\",\"name\":\"point\",\"tags\":[\"point\"],\"label\":\"测试自动门点\",\"point\":{\"type\":12},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"penId\":\"200e2898\",\"id\":\"t\",\"x\":0.5,\"y\":0},{\"penId\":\"200e2898\",\"id\":\"b\",\"x\":0.5,\"y\":1},{\"penId\":\"200e2898\",\"id\":\"l\",\"x\":0,\"y\":0.5},{\"penId\":\"200e2898\",\"id\":\"r\",\"x\":1,\"y\":0.5}],\"rotate\":0,\"connectedLines\":[{\"lineId\":\"7a48284\",\"lineAnchor\":\"1fe7246\",\"anchor\":\"l\"},{\"lineId\":\"83bc37\",\"lineAnchor\":\"a99e85a\",\"anchor\":\"r\"}]},{\"x\":300,\"y\":300,\"width\":48,\"height\":60,\"lineWidth\":3,\"iconSize\":10,\"image\":\"/point/13-dark.png\",\"canvasLayer\":3,\"id\":\"e94941e\",\"name\":\"point\",\"tags\":[\"point\"],\"label\":\"测试充电点\",\"point\":{\"type\":13,\"robots\":[\"mock-robot-1\",\"mock-robot-3\"]},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"penId\":\"e94941e\",\"id\":\"t\",\"x\":0.5,\"y\":0},{\"penId\":\"e94941e\",\"id\":\"b\",\"x\":0.5,\"y\":1},{\"penId\":\"e94941e\",\"id\":\"l\",\"x\":0,\"y\":0.5},{\"penId\":\"e94941e\",\"id\":\"r\",\"x\":1,\"y\":0.5}],\"rotate\":0,\"connectedLines\":[{\"lineId\":\"83bc37\",\"lineAnchor\":\"1daa737f\",\"anchor\":\"l\"},{\"lineId\":\"b52b5a\",\"lineAnchor\":\"c416385\",\"anchor\":\"r\"}]},{\"x\":400,\"y\":300,\"width\":48,\"height\":60,\"lineWidth\":3,\"iconSize\":10,\"image\":\"/point/14-dark.png\",\"canvasLayer\":3,\"id\":\"5bdd329\",\"name\":\"point\",\"tags\":[\"point\"],\"label\":\"测试停靠点\",\"point\":{\"type\":14,\"robots\":[\"mock-robot-4\"]},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"penId\":\"5bdd329\",\"id\":\"t\",\"x\":0.5,\"y\":0},{\"penId\":\"5bdd329\",\"id\":\"b\",\"x\":0.5,\"y\":1},{\"penId\":\"5bdd329\",\"id\":\"l\",\"x\":0,\"y\":0.5},{\"penId\":\"5bdd329\",\"id\":\"r\",\"x\":1,\"y\":0.5}],\"rotate\":0,\"connectedLines\":[{\"lineId\":\"b52b5a\",\"lineAnchor\":\"794362b4\",\"anchor\":\"l\"},{\"lineId\":\"610d367\",\"lineAnchor\":\"e17e57e\",\"anchor\":\"r\"}]},{\"x\":500,\"y\":300,\"width\":48,\"height\":60,\"lineWidth\":3,\"iconSize\":10,\"image\":\"/point/15-dark.png\",\"canvasLayer\":3,\"id\":\"343a2f0\",\"name\":\"point\",\"tags\":[\"point\"],\"label\":\"测试动作点\",\"point\":{\"type\":15},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"penId\":\"343a2f0\",\"id\":\"t\",\"x\":0.5,\"y\":0},{\"penId\":\"343a2f0\",\"id\":\"b\",\"x\":0.5,\"y\":1},{\"penId\":\"343a2f0\",\"id\":\"l\",\"x\":0,\"y\":0.5},{\"penId\":\"343a2f0\",\"id\":\"r\",\"x\":1,\"y\":0.5}],\"rotate\":0,\"connectedLines\":[{\"lineId\":\"6f33b86\",\"lineAnchor\":\"48a214cc\",\"anchor\":\"t\"},{\"lineId\":\"610d367\",\"lineAnchor\":\"34153c1c\",\"anchor\":\"l\"}]},{\"x\":100,\"y\":500,\"width\":48,\"height\":60,\"lineWidth\":3,\"iconSize\":10,\"image\":\"/point/16-dark.png\",\"canvasLayer\":3,\"id\":\"b6c6cfb\",\"name\":\"point\",\"tags\":[\"point\"],\"label\":\"测试禁行点\",\"point\":{\"type\":16},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"penId\":\"b6c6cfb\",\"id\":\"t\",\"x\":0.5,\"y\":0},{\"penId\":\"b6c6cfb\",\"id\":\"b\",\"x\":0.5,\"y\":1},{\"penId\":\"b6c6cfb\",\"id\":\"l\",\"x\":0,\"y\":0.5},{\"penId\":\"b6c6cfb\",\"id\":\"r\",\"x\":1,\"y\":0.5}],\"rotate\":0,\"connectedLines\":[{\"lineId\":\"a3ad044\",\"lineAnchor\":\"5657322\",\"anchor\":\"t\"},{\"lineId\":\"71734a6\",\"lineAnchor\":\"b23aeab\",\"anchor\":\"t\"}]},{\"height\":0,\"lineName\":\"line\",\"lineWidth\":2,\"name\":\"line\",\"type\":1,\"width\":76,\"x\":124,\"y\":112,\"anchors\":[{\"x\":0,\"y\":0,\"id\":\"42f48978\",\"lineLength\":76,\"connectTo\":\"776fa1bf\",\"anchorId\":\"r\"},{\"x\":1,\"y\":0,\"id\":\"60110d7\",\"connectTo\":\"ea84ca\",\"anchorId\":\"l\"}],\"id\":\"3de9971\",\"fontSize\":14,\"lineHeight\":1.5,\"length\":76,\"ex\":200,\"ey\":112,\"rotate\":0,\"tags\":[\"route\"],\"route\":{\"type\":\"line\",\"pass\":1},\"iconSize\":10},{\"height\":0,\"lineName\":\"line\",\"lineWidth\":2,\"name\":\"line\",\"type\":1,\"width\":76,\"x\":224,\"y\":112,\"anchors\":[{\"x\":0,\"y\":0,\"id\":\"73e75ced\",\"lineLength\":76,\"connectTo\":\"ea84ca\",\"anchorId\":\"r\"},{\"x\":1,\"y\":0,\"id\":\"4c98bb6\",\"connectTo\":\"083f10\",\"anchorId\":\"l\"}],\"id\":\"4781a31f\",\"fontSize\":14,\"lineHeight\":1.5,\"length\":76,\"ex\":300,\"ey\":112,\"rotate\":0,\"tags\":[\"route\"],\"route\":{\"type\":\"line\",\"pass\":1},\"iconSize\":10},{\"height\":0,\"lineName\":\"line\",\"lineWidth\":2,\"name\":\"line\",\"type\":1,\"width\":76,\"x\":324,\"y\":112,\"anchors\":[{\"x\":0,\"y\":0,\"id\":\"19ec7bcb\",\"lineLength\":76,\"connectTo\":\"083f10\",\"anchorId\":\"r\"},{\"x\":1,\"y\":0,\"id\":\"ef8cad\",\"connectTo\":\"3a350276\",\"anchorId\":\"l\"}],\"id\":\"fc86102\",\"fontSize\":14,\"lineHeight\":1.5,\"length\":76,\"ex\":400,\"ey\":112,\"rotate\":0,\"tags\":[\"route\"],\"route\":{\"type\":\"line\",\"pass\":0},\"iconSize\":10},{\"height\":188,\"lineName\":\"bezier3\",\"lineWidth\":2,\"name\":\"line\",\"type\":1,\"width\":100,\"x\":424,\"y\":112,\"anchors\":[{\"x\":0,\"y\":0,\"id\":\"2a73e4b\",\"lineLength\":261.42706298828125,\"connectTo\":\"3a350276\",\"anchorId\":\"r\",\"next\":{\"connectTo\":\"3a350276\",\"x\":1,\"y\":0},\"curvePoints\":[{\"x\":429.628698846413,\"y\":112.00131527398665,\"step\":0.019125793415749503},{\"x\":435.0421177914929,\"y\":112.0105221918932,\"step\":0.038251586831499006},{\"x\":440.2444545181759,\"y\":112.0355123976396,\"step\":0.057377380247248505},{\"x\":445.23990670939816,\"y\":112.08417753514566,\"step\":0.07650317366299801},{\"x\":450.03267204809555,\"y\":112.16440924833132,\"step\":0.09562896707874752},{\"x\":454.62694821720453,\"y\":112.28409918111657,\"step\":0.11475476049449702},{\"x\":459.0269328996611,\"y\":112.45113897742122,\"step\":0.13388055391024653},{\"x\":463.2368237784013,\"y\":112.6734202811652,\"step\":0.15300634732599602},{\"x\":467.2608185363613,\"y\":112.95883473626844,\"step\":0.17213214074174552},{\"x\":471.10311485647725,\"y\":113.3152739866508,\"step\":0.191257934157495},{\"x\":474.76791042168526,\"y\":113.75062967623222,\"step\":0.2103837275732445},{\"x\":478.2594029149214,\"y\":114.2727934489326,\"step\":0.229509520988994},{\"x\":481.58179001912174,\"y\":114.88965694867184,\"step\":0.24863531440474348},{\"x\":484.73926941722266,\"y\":115.60911181936983,\"step\":0.267761107820493},{\"x\":487.73603879215995,\"y\":116.43904970494648,\"step\":0.2868869012362425},{\"x\":490.57629582686997,\"y\":117.38736224932177,\"step\":0.306012694651992},{\"x\":493.26423820428863,\"y\":118.46194109641547,\"step\":0.3251384880677415},{\"x\":495.80406360735225,\"y\":119.67067789014757,\"step\":0.344264281483491},{\"x\":498.1999697189969,\"y\":121.02146427443796,\"step\":0.36339007489924047},{\"x\":500.45615422215866,\"y\":122.52219189320655,\"step\":0.38251586831498996},{\"x\":502.5768147997735,\"y\":124.18075239037323,\"step\":0.40164166173073945},{\"x\":504.5661491347779,\"y\":126.00503740985792,\"step\":0.42076745514648894},{\"x\":506.4283549101077,\"y\":128.0029385955805,\"step\":0.43989324856223844},{\"x\":508.1676298086991,\"y\":130.1823475914609,\"step\":0.45901904197798793},{\"x\":509.7881715134881,\"y\":132.55115604141903,\"step\":0.4781448353937374},{\"x\":511.2941777074111,\"y\":135.11725558937476,\"step\":0.4972706288094869},{\"x\":512.6898460734039,\"y\":137.88853787924805,\"step\":0.5163964222252364},{\"x\":513.979374294403,\"y\":140.87289455495875,\"step\":0.5355222156409859},{\"x\":515.166960053344,\"y\":144.07821726042678,\"step\":0.5546480090567354},{\"x\":516.2568010331636,\"y\":147.51239763957207,\"step\":0.5737738024724849},{\"x\":517.2530949167974,\"y\":151.1833273363145,\"step\":0.5928995958882344},{\"x\":518.160039387182,\"y\":155.09889799457397,\"step\":0.6120253893039839},{\"x\":518.981832127253,\"y\":159.26700125827045,\"step\":0.6311511827197334},{\"x\":519.722670819947,\"y\":163.69552877132372,\"step\":0.6502769761354829},{\"x\":520.3867531481998,\"y\":168.39237217765378,\"step\":0.6694027695512323},{\"x\":520.9782767949476,\"y\":173.36542312118053,\"step\":0.6885285629669818},{\"x\":521.5014394431267,\"y\":178.62257324582387,\"step\":0.7076543563827313},{\"x\":521.960438775673,\"y\":184.17171419550368,\"step\":0.7267801497984808},{\"x\":522.3594724755227,\"y\":190.02073761413982,\"step\":0.7459059432142303},{\"x\":522.7027382256118,\"y\":196.1775351456523,\"step\":0.7650317366299798},{\"x\":522.9944337088766,\"y\":202.649998433961,\"step\":0.7841575300457293},{\"x\":523.2387566082532,\"y\":209.44601912298575,\"step\":0.8032833234614788},{\"x\":523.4399046066776,\"y\":216.57348885664655,\"step\":0.8224091168772283},{\"x\":523.6020753870861,\"y\":224.04029927886322,\"step\":0.8415349102929778},{\"x\":523.7294666324146,\"y\":231.85434203355572,\"step\":0.8606607037087273},{\"x\":523.8262760255993,\"y\":240.02350876464396,\"step\":0.8797864971244768},{\"x\":523.8967012495764,\"y\":248.5556911160478,\"step\":0.8989122905402263},{\"x\":523.944939987282,\"y\":257.45878073168717,\"step\":0.9180380839559757},{\"x\":523.9751899216521,\"y\":266.740669255482,\"step\":0.9371638773717252},{\"x\":523.991648735623,\"y\":276.4092483313521,\"step\":0.9562896707874747},{\"x\":523.9985141121307,\"y\":286.4724096032176,\"step\":0.9754154642032242},{\"x\":523.9999837341114,\"y\":296.93804471499806,\"step\":0.9945412576189737}]},{\"x\":1,\"y\":1,\"id\":\"48a214cc\",\"connectTo\":\"343a2f0\",\"anchorId\":\"t\",\"prev\":{\"connectTo\":\"343a2f0\",\"x\":1,\"y\":0}}],\"id\":\"6f33b86\",\"fontSize\":14,\"lineHeight\":1.5,\"length\":261.42706298828125,\"ex\":524,\"ey\":300,\"rotate\":0,\"tags\":[\"route\"],\"route\":{\"type\":\"bezier3\",\"pass\":1},\"iconSize\":10},{\"height\":0,\"lineName\":\"line\",\"lineWidth\":2,\"name\":\"line\",\"type\":1,\"width\":52,\"x\":148,\"y\":330,\"anchors\":[{\"x\":0,\"y\":0,\"id\":\"4275bcb\",\"lineLength\":52,\"connectTo\":\"51b95527\",\"anchorId\":\"r\"},{\"x\":1,\"y\":0,\"id\":\"1fe7246\",\"connectTo\":\"200e2898\",\"anchorId\":\"l\"}],\"id\":\"7a48284\",\"fontSize\":14,\"lineHeight\":1.5,\"length\":52,\"ex\":200,\"ey\":330,\"rotate\":0,\"tags\":[\"route\"],\"route\":{\"type\":\"line\",\"direction\":-1,\"pass\":0},\"iconSize\":10},{\"height\":0,\"lineName\":\"line\",\"lineWidth\":2,\"name\":\"line\",\"type\":1,\"width\":52,\"x\":248,\"y\":330,\"anchors\":[{\"x\":0,\"y\":0,\"id\":\"a99e85a\",\"lineLength\":52,\"connectTo\":\"200e2898\",\"anchorId\":\"r\"},{\"x\":1,\"y\":0,\"id\":\"1daa737f\",\"connectTo\":\"e94941e\",\"anchorId\":\"l\"}],\"id\":\"83bc37\",\"fontSize\":14,\"lineHeight\":1.5,\"length\":52,\"ex\":300,\"ey\":330,\"rotate\":0,\"tags\":[\"route\"],\"route\":{\"type\":\"line\",\"direction\":-1,\"pass\":2},\"iconSize\":10},{\"height\":0,\"lineName\":\"line\",\"lineWidth\":2,\"name\":\"line\",\"type\":1,\"width\":52,\"x\":348,\"y\":330,\"anchors\":[{\"x\":0,\"y\":0,\"id\":\"c416385\",\"lineLength\":52,\"connectTo\":\"e94941e\",\"anchorId\":\"r\"},{\"x\":1,\"y\":0,\"id\":\"794362b4\",\"connectTo\":\"5bdd329\",\"anchorId\":\"l\"}],\"id\":\"b52b5a\",\"fontSize\":14,\"lineHeight\":1.5,\"length\":52,\"ex\":400,\"ey\":330,\"rotate\":0,\"tags\":[\"route\"],\"route\":{\"type\":\"line\",\"direction\":-1,\"pass\":2},\"iconSize\":10},{\"height\":0,\"lineName\":\"line\",\"lineWidth\":2,\"name\":\"line\",\"type\":1,\"width\":52,\"x\":448,\"y\":330,\"anchors\":[{\"x\":0,\"y\":0,\"id\":\"e17e57e\",\"lineLength\":52,\"connectTo\":\"5bdd329\",\"anchorId\":\"r\"},{\"x\":1,\"y\":0,\"id\":\"34153c1c\",\"connectTo\":\"343a2f0\",\"anchorId\":\"l\"}],\"id\":\"610d367\",\"fontSize\":14,\"lineHeight\":1.5,\"length\":52,\"ex\":500,\"ey\":330,\"rotate\":0,\"tags\":[\"route\"],\"route\":{\"type\":\"line\",\"direction\":-1,\"pass\":2},\"iconSize\":10},{\"height\":176,\"lineName\":\"bezier3\",\"lineWidth\":2,\"name\":\"line\",\"type\":1,\"width\":30.771470449097436,\"x\":111.06455012865847,\"y\":124,\"anchors\":[{\"x\":0.03039990802158661,\"y\":0,\"id\":\"70b09d5\",\"lineLength\":184.74794006347656,\"connectTo\":\"776fa1bf\",\"anchorId\":\"b\",\"next\":{\"connectTo\":\"776fa1bf\",\"x\":-0.2945764370816521,\"y\":0.2840909090909091},\"curvePoints\":[{\"x\":111.36422292283041,\"y\":128.0087911028092,\"step\":0.027063901217421298},{\"x\":111.06455012865847,\"y\":131.92376469453697,\"step\":0.054127802434842595},{\"x\":111.07671816392144,\"y\":135.75657674797324,\"step\":0.08119170365226389},{\"x\":111.37646357505673,\"y\":139.51888323590805,\"step\":0.10825560486968519},{\"x\":111.93952290850163,\"y\":143.2223401311311,\"step\":0.1353195060871065},{\"x\":112.74163271069344,\"y\":146.87860340643246,\"step\":0.1623834073045278},{\"x\":113.7585295280695,\"y\":150.49932903460197,\"step\":0.1894473085219491},{\"x\":114.96594990706711,\"y\":154.09617298842957,\"step\":0.2165112097393704},{\"x\":116.33963039412362,\"y\":157.6807912407052,\"step\":0.2435751109567917},{\"x\":117.8553075356763,\"y\":161.2648397642187,\"step\":0.270639012174213},{\"x\":119.4887178781626,\"y\":164.85997453176012,\"step\":0.2977029133916343},{\"x\":121.21559796801965,\"y\":168.4778515161192,\"step\":0.3247668146090556},{\"x\":123.01168435168493,\"y\":172.130126690086,\"step\":0.3518307158264769},{\"x\":124.85271357559566,\"y\":175.82845602645028,\"step\":0.3788946170438982},{\"x\":126.71442218618925,\"y\":179.58449549800218,\"step\":0.4059585182613195},{\"x\":128.57254672990288,\"y\":183.40990107753134,\"step\":0.4330224194787408},{\"x\":130.40282375317406,\"y\":187.31632873782797,\"step\":0.4600863206961621},{\"x\":132.18098980243994,\"y\":191.31543445168168,\"step\":0.4871502219135834},{\"x\":133.882781424138,\"y\":195.41887419188268,\"step\":0.5142141231310047},{\"x\":135.48393516470537,\"y\":199.63830393122066,\"step\":0.541278024348426},{\"x\":136.96018757057954,\"y\":203.98537964248564,\"step\":0.5683419255658473},{\"x\":138.28727518819778,\"y\":208.4717572984675,\"step\":0.5954058267832686},{\"x\":139.44093456399736,\"y\":213.1090928719562,\"step\":0.6224697280006899},{\"x\":140.39690224441563,\"y\":217.90904233574162,\"step\":0.6495336292181112},{\"x\":141.13091477588995,\"y\":222.88326166261362,\"step\":0.6765975304355325},{\"x\":141.6187087048576,\"y\":228.04340682536218,\"step\":0.7036614316529538},{\"x\":141.8360205777559,\"y\":233.4011337967773,\"step\":0.7307253328703751},{\"x\":141.7585869410222,\"y\":238.9680985496487,\"step\":0.7577892340877964},{\"x\":141.36214434109382,\"y\":244.7559570567664,\"step\":0.7848531353052177},{\"x\":140.62242932440802,\"y\":250.77636529092035,\"step\":0.811917036522639},{\"x\":139.51517843740217,\"y\":257.04097922490035,\"step\":0.8389809377400603},{\"x\":138.01612822651362,\"y\":263.56145483149646,\"step\":0.8660448389574816},{\"x\":136.10101523817963,\"y\":270.3494480834985,\"step\":0.8931087401749029},{\"x\":133.74557601883757,\"y\":277.4166149536964,\"step\":0.9201726413923242},{\"x\":130.9255471149247,\"y\":284.77461141488004,\"step\":0.9472365426097455},{\"x\":127.6166650728784,\"y\":292.4350934398394,\"step\":0.9743004438271669}]},{\"x\":0.4203715221454731,\"y\":1,\"id\":\"9167210\",\"connectTo\":\"51b95527\",\"anchorId\":\"t\",\"prev\":{\"connectTo\":\"51b95527\",\"x\":2.0452532476616665,\"y\":0.4318181818181818}}],\"id\":\"142dbab5\",\"fontSize\":14,\"lineHeight\":1.5,\"length\":184.74794006347656,\"ex\":141.8360205777559,\"ey\":300,\"rotate\":0,\"tags\":[\"route\"],\"route\":{\"type\":\"bezier3\",\"c1\":{\"x\":-10,\"y\":50},\"c2\":{\"x\":-50,\"y\":100},\"pass\":10,\"direction\":-1},\"iconSize\":10},{\"height\":140,\"lineName\":\"line\",\"lineWidth\":2,\"name\":\"line\",\"type\":1,\"width\":0,\"x\":124,\"y\":360,\"anchors\":[{\"x\":0,\"y\":0,\"id\":\"d02372d\",\"lineLength\":140,\"connectTo\":\"51b95527\",\"anchorId\":\"b\"},{\"x\":0,\"y\":1,\"id\":\"5657322\",\"connectTo\":\"b6c6cfb\",\"anchorId\":\"t\"}],\"id\":\"a3ad044\",\"fontSize\":14,\"lineHeight\":1.5,\"length\":140,\"ex\":124,\"ey\":500,\"rotate\":0,\"tags\":[\"route\"],\"route\":{\"type\":\"line\",\"pass\":10},\"iconSize\":10},{\"height\":140,\"lineName\":\"line\",\"lineWidth\":2,\"name\":\"line\",\"type\":1,\"width\":0,\"x\":124,\"y\":360,\"anchors\":[{\"x\":0,\"y\":0,\"id\":\"f004754\",\"lineLength\":140,\"connectTo\":\"51b95527\",\"anchorId\":\"b\"},{\"x\":0,\"y\":1,\"id\":\"b23aeab\",\"connectTo\":\"b6c6cfb\",\"anchorId\":\"t\"}],\"id\":\"71734a6\",\"fontSize\":14,\"lineHeight\":1.5,\"length\":140,\"ex\":124,\"ey\":500,\"rotate\":0,\"tags\":[\"route\"],\"route\":{\"type\":\"line\"},\"iconSize\":10}],\"origin\":{\"x\":0,\"y\":0},\"center\":{\"x\":0,\"y\":0},\"paths\":{},\"template\":\"b3f1f88\",\"theme\":\"dark\",\"background\":\"#1e2430\",\"color\":\"#bdc7db\",\"locked\":0,\"robotGroups\":[{\"id\":\"5e69b45\",\"label\":\"测试机器人组A\",\"robots\":[\"mock-robot-1\",\"mock-robot-2\",\"mock-robot-3\"]},{\"id\":\"26b26411\",\"label\":\"测试机器人组B\",\"robots\":[\"mock-robot-4\",\"mock-robot-5\"]}],\"robots\":[{\"id\":\"mock-robot-1\",\"label\":\"模拟机器人A\",\"brand\":\"模拟品牌A\",\"type\":1,\"ip\":\"127.0.1.1\",\"gid\":\"5e69b45\"},{\"id\":\"mock-robot-2\",\"label\":\"模拟机器人B\",\"brand\":\"模拟品牌A\",\"type\":2,\"ip\":\"127.0.1.2\",\"gid\":\"5e69b45\"},{\"id\":\"mock-robot-3\",\"label\":\"模拟机器人C\",\"brand\":\"模拟品牌A\",\"type\":3,\"ip\":\"127.0.1.3\",\"gid\":\"5e69b45\"},{\"id\":\"mock-robot-4\",\"label\":\"模拟机器人D\",\"brand\":\"模拟品牌B\",\"type\":1,\"ip\":\"127.0.2.1\",\"gid\":\"26b26411\"},{\"id\":\"mock-robot-5\",\"label\":\"模拟机器人E\",\"brand\":\"模拟品牌B\",\"type\":2,\"ip\":\"127.0.2.2\",\"gid\":\"26b26411\"}],\"version\":\"1.0.78\",\"dataPoints\":[]}"
  },
  "message": "模拟提示"
}

保存场景

POST /scene/saveById

请求体: { id: string; json: string }

响应体: 无

获取组场景

POST /scene/getByGroupId

请求体: { id: string; sid: string }

响应体: GroupSceneDetail

示例:

{
  "code": 200,
  "success": true,
  "data": {
    "id": "mock-group-scene-1",
    "label": "模拟组场景A",
    "group": {
      "sid": "mock-scene-1",
      "id": "mock-robot-group",
      "label": "模拟机器人组",
      "robots": ["mock-robot-1", "mock-robot-2"]
    },
    "robots": [
      {
        "id": "mock-robot-1",
        "label": "模拟机器人A",
        "brand": "模拟品牌A",
        "type": 1,
        "ip": "127.0.1.1",
        "isConnected": true,
        "state": 4,
        "canOrder": true,
        "canStop": true,
        "canControl": true
      },
      {
        "id": "mock-robot-2",
        "label": "模拟机器人B",
        "brand": "模拟品牌A",
        "type": 2,
        "ip": "127.0.1.2"
      }
    ]
  },
  "message": "模拟提示"
}

保存组场景

POST /scene/saveByGroupId

请求体: { id: string; sid: string; json: string }

响应体: 无

机器人接口

获取所有机器人

POST /robot/getAll

请求体: 无

响应体: Array

示例:

{
  "code": 200,
  "success": true,
  "data": [
    {
      "id": "mock-robot-1",
      "label": "模拟机器人A",
      "brand": "模拟品牌A",
      "type": 1,
      "ip": "127.0.1.1"
    },
    {
      "id": "mock-robot-2",
      "label": "模拟机器人B",
      "brand": "模拟品牌A",
      "type": 2,
      "ip": "127.0.1.2"
    },
    {
      "id": "mock-robot-3",
      "label": "模拟机器人C",
      "brand": "模拟品牌A",
      "type": 3,
      "ip": "127.0.1.3"
    },
    {
      "id": "mock-robot-4",
      "label": "模拟机器人D",
      "brand": "模拟品牌B",
      "type": 1,
      "ip": "127.0.2.1"
    },
    {
      "id": "mock-robot-5",
      "label": "模拟机器人E",
      "brand": "模拟品牌B",
      "type": 2,
      "ip": "127.0.2.2"
    },
    {
      "id": "mock-robot-6",
      "label": "模拟机器人F",
      "brand": "模拟品牌B",
      "type": 3,
      "ip": "127.0.2.3"
    }
  ],
  "message": "模拟提示"
}

注册机器人

POST /robot/register

请求体: RobotDetail

示例

{
  "isSimulative": 1,
  "gid": "26b26411",
  "label": "测试机器人",
  "brand": 1,
  "type": 2,
  "ip": "127.0.0.1",
  "minBattery": 0,
  "chargeBattery": 40,
  "taskBattery": 60,
  "swapBattery": 20,
  "maxBattery": 100
}

响应体: RobotInfo

示例

{
  "code": 200,
  "success": true,
  "data": {
    "id": "mock-robot-0",
    "label": "模拟机器人-注册",
    "brand": "模拟品牌A",
    "type": 1,
    "ip": "127.0.0.0"
  },
  "message": "模拟提示"
}

批量抢占控制权

POST /robot/seizeByIds

请求体: { ids: string[] }

响应体: string[]

示例

{
  "code": 200,
  "success": true,
  "data": ["mock-robot-1", "mock-robot-2"],
  "message": "模拟提示"
}

同步组文件

POST /robot/syncByGroupId

请求体: { id: string; sid: string }

响应体: 无

数据结构

  1. 场景相关
interface SceneDetail {
  id: string; // 场景id
  label: string; // 场景名称
  json?: string; // 场景JSON
}

interface GroupSceneDetail {
  id: string; // 组场景id
  label: string; // 组场景名称
  json?: string; // 组场景JSON
  group: RobotGroup; // 机器人组
  robots?: Array<RobotInfo>; // 组场景机器人
}
  1. 机器人相关
interface RobotGroup {
  sid?: string; // 场景id
  id: string; // 机器人组id
  label: string; // 机器人组名称
  robots?: Array<string>; // 机器人列表
}

interface RobotInfo {
  gid?: string; // 机器人组id
  id: string; // 机器人id
  label: string; // 机器人名称
  brand: RobotBrand; // 机器人品牌
  type: RobotType; // 机器人类型
  ip: string; // 机器人ip
  battery?: number; // 机器人电量
  isConnected?: boolean; // 机器人连接状态
  state?: RobotState; // 机器人状态
  canOrder?: boolean; // 接单状态
  canStop?: boolean; // 急停状态
  canControl?: boolean; // 控制状态
}
export interface RobotDetail extends RobotInfo {
  isSimulative?: 0 | 1; // 是否仿真机器人
  minBattery?: number; // 最小电量
  maxBattery?: number; // 最大电量
  chargeBattery?: number; // 充电电量
  taskBattery?: number; // 任务电量
  swapBattery?: number; // 交换电量
}

enum RobotBrand {
  '先工' = 1,
}
enum RobotType {
  叉车机器人 = 1,
  AMR机器人,
  料箱机器人,
}
enum RobotState {
  任务执行中 = 1,
  充电中,
  停靠中,
  空闲中,
}
  1. 地图相关
interface MapPen {
  id: string; // 唯一标识
  name: string; // 唯一名称(用于识别图元,包含点位-point、线路-line、区域-area
  x: number; // 横坐标
  y: number; // 纵坐标
  width: number; // 宽度
  height: number; // 高度

  label?: string; // 展示名称
  desc?: string; // 描述

  point?: MapPointInfo; // 点位信息
  route?: MapRouteInfo; // 线路信息
  area?: MapAreaInfo; // 区域信息

  attrs?: Record<string, unknown>; // 额外属性
  activeAttrs?: Array<string>; // 已激活的额外属性
}

interface MapPointInfo {
  type: MapPointType; // 点位类型
  robots?: Array<RobotInfo['id']>; // 绑定机器人id集合
  actions?: Array<string>; // 绑定动作点id集合
  isBlock?: boolean; // 是否禁行
  isForbidAvoid?: boolean; // 是否禁止避让
}
interface MapRouteInfo {
  type: MapRouteType; // 线路类型
  direction?: -1 | 1; // 方向
  pass?: MapRoutePassType; // 可通行类型
  c1?: Point; // 控制点A
  c2?: Point; // 控制点B
}
interface MapAreaInfo {
  type: MapAreaType; // 区域类型
  points?: Array<string>; // 绑定点位id集合
  routes?: Array<string>; // 绑定线路id集合
}

export type Point = Record<'x' | 'y', number>;
export type Rect = Record<'x' | 'y' | 'width' | 'height', number>;
export type AnchorPosition = 't' | 'b' | 'l' | 'r';

enum MapPointType {
  普通点 = 1,
  等待点,
  避让点,
  临时避让点,

  电梯点 = 11,
  自动门点,
  充电点,
  停靠点,
  动作点,
  禁行点,

  障碍点 = 99, // 待优化,后续将单独抽离
}

enum MapRouteType {
  直线 = 'line',
  三阶贝塞尔曲线 = 'bezier3',
}
enum MapRoutePassType {
  ,

  仅空载可通行,
  仅载货可通行,

  禁行 = 10,
}

enum MapAreaType {
  库区 = 1,

  互斥区 = 11,
  非互斥区,
}

场景文件格式

  1. 场景文件格式为json格式包含以下字段 template: string; // 模板id只读 locked: number; // 锁定状态(后端无需处理) version: string; // 版本号(后端无需处理) x: number; // 地图在画布中的横坐标 y: number; // 地图在画布中的纵坐标 scale: number; // 地图缩放比例 origin: { x: number; y: number; }; // 地图原点坐标 center: { x: number; y: number; }; // 地图中心点坐标 pens: Array; // 地图元素(包含点位、线路、区域) robots: Array; // 场景中的机器人 robotGroups: Array; // 场景中的机器人组
Description
No description provided
Readme 29 MiB
Languages
TypeScript 33.1%
Vue 32.2%
HTML 15%
Batchfile 8.3%
SCSS 7.9%
Other 3.5%