diff --git a/mocks/scene/getById b/mocks/scene/getById index f64453f..a579637 100644 --- a/mocks/scene/getById +++ b/mocks/scene/getById @@ -4,7 +4,7 @@ "data": { "id": "mock-scene-1", "label": "模拟场景A", - "json": "{\"x\":0,\"y\":0,\"scale\":1,\"pens\":[{\"id\":\"3afaff2\",\"name\":\"area\",\"tags\":[\"area\",\"area-12\"],\"label\":\"A3afaff2\",\"x\":254,\"y\":52,\"width\":183,\"height\":195,\"lineWidth\":1,\"area\":{\"type\":12,\"points\":[\"a6667c8\",\"702ccfa\",\"9fc0ba3\",\"984da11\"],\"routes\":[]},\"locked\":4,\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[],\"rotate\":0},{\"id\":\"8b37b4f\",\"name\":\"area\",\"tags\":[\"area\",\"area-11\"],\"label\":\"A8b37b4f\",\"x\":44,\"y\":49,\"width\":193,\"height\":195,\"lineWidth\":1,\"area\":{\"type\":11,\"points\":[\"21b74c90\",\"00f32a0\",\"7f201a25\",\"8de717e\"],\"routes\":[]},\"locked\":4,\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[],\"rotate\":0},{\"id\":\"5d96dd3d\",\"name\":\"area\",\"tags\":[\"area\",\"area-1\"],\"label\":\"A5d96dd3d\",\"x\":451,\"y\":126,\"width\":196,\"height\":125,\"lineWidth\":1,\"area\":{\"type\":1,\"points\":[\"5170c043\"],\"routes\":[]},\"locked\":4,\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[],\"rotate\":0},{\"x\":88,\"y\":88,\"width\":24,\"height\":24,\"lineWidth\":2,\"iconSize\":4,\"image\":\"\",\"canvasLayer\":3,\"id\":\"21b74c90\",\"name\":\"point\",\"tags\":[\"point\",\"point-1\"],\"label\":\"P21b74c90\",\"point\":{\"type\":1},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5}],\"rotate\":0},{\"x\":188,\"y\":88,\"width\":24,\"height\":24,\"lineWidth\":2,\"iconSize\":4,\"image\":\"\",\"canvasLayer\":3,\"id\":\"00f32a0\",\"name\":\"point\",\"tags\":[\"point\",\"point-2\"],\"label\":\"P00f32a0\",\"point\":{\"type\":2},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5}],\"rotate\":0},{\"x\":288,\"y\":88,\"width\":24,\"height\":24,\"lineWidth\":2,\"iconSize\":4,\"image\":\"\",\"canvasLayer\":3,\"id\":\"a6667c8\",\"name\":\"point\",\"tags\":[\"point\",\"point-3\"],\"label\":\"Pa6667c8\",\"point\":{\"type\":3},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5}],\"rotate\":0},{\"x\":388,\"y\":88,\"width\":24,\"height\":24,\"lineWidth\":2,\"iconSize\":4,\"image\":\"\",\"canvasLayer\":3,\"id\":\"702ccfa\",\"name\":\"point\",\"tags\":[\"point\",\"point-4\"],\"label\":\"P702ccfa\",\"point\":{\"type\":4},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5}],\"rotate\":0},{\"x\":76,\"y\":170,\"width\":48,\"height\":60,\"lineWidth\":3,\"iconSize\":10,\"image\":\"/point/11-dark.png\",\"canvasLayer\":3,\"id\":\"7f201a25\",\"name\":\"point\",\"tags\":[\"point\",\"point-11\"],\"label\":\"P7f201a25\",\"point\":{\"type\":11},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5}],\"rotate\":0},{\"x\":176,\"y\":170,\"width\":48,\"height\":60,\"lineWidth\":3,\"iconSize\":10,\"image\":\"/point/12-dark.png\",\"canvasLayer\":3,\"id\":\"8de717e\",\"name\":\"point\",\"tags\":[\"point\",\"point-12\"],\"label\":\"P8de717e\",\"point\":{\"type\":12},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5}],\"rotate\":0},{\"x\":276,\"y\":170,\"width\":48,\"height\":60,\"lineWidth\":3,\"iconSize\":10,\"image\":\"/point/13-dark.png\",\"canvasLayer\":3,\"id\":\"9fc0ba3\",\"name\":\"point\",\"tags\":[\"point\",\"point-13\"],\"label\":\"P9fc0ba3\",\"point\":{\"type\":13},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5}],\"rotate\":0},{\"x\":376,\"y\":170,\"width\":48,\"height\":60,\"lineWidth\":3,\"iconSize\":10,\"image\":\"/point/14-dark.png\",\"canvasLayer\":3,\"id\":\"984da11\",\"name\":\"point\",\"tags\":[\"point\",\"point-14\"],\"label\":\"P984da11\",\"point\":{\"type\":14},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5}],\"rotate\":0},{\"x\":476,\"y\":170,\"width\":48,\"height\":60,\"lineWidth\":3,\"iconSize\":10,\"image\":\"/point/15-dark.png\",\"canvasLayer\":3,\"id\":\"5170c043\",\"name\":\"point\",\"tags\":[\"point\",\"point-15\"],\"label\":\"P5170c043\",\"point\":{\"type\":15},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5}],\"rotate\":0},{\"x\":576,\"y\":170,\"width\":48,\"height\":60,\"lineWidth\":3,\"iconSize\":10,\"image\":\"/point/16-dark.png\",\"canvasLayer\":3,\"id\":\"d292734\",\"name\":\"point\",\"tags\":[\"point\",\"point-16\"],\"label\":\"Pd292734\",\"point\":{\"type\":16},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5}],\"rotate\":0}],\"origin\":{\"x\":0,\"y\":0},\"center\":{\"x\":0,\"y\":0},\"paths\":{},\"template\":\"4c2a10f\",\"locked\":4,\"version\":\"1.0.78\",\"dataPoints\":[],\"robotGroups\":[{\"id\":\"mock-robot-group-1\",\"label\":\"模拟机器人组A\",\"robots\":[\"mock-robot-1\",\"mock-robot-2\",\"mock-robot-3\"]},{\"sid\":\"mock-scene-1\",\"id\":\"mock-robot-group-2\",\"label\":\"模拟机器人组B\",\"robots\":[\"mock-robot-4\"]}],\"robots\":[{\"gid\":\"mock-robot-group-1\",\"id\":\"mock-robot-1\",\"label\":\"模拟机器人A\",\"brand\":\"模拟品牌A\",\"type\":1,\"ip\":\"127.0.1.1\"},{\"gid\":\"mock-robot-group-1\",\"id\":\"mock-robot-2\",\"label\":\"模拟机器人B\",\"brand\":\"模拟品牌A\",\"type\":2,\"ip\":\"127.0.1.2\"},{\"gid\":\"mock-robot-group-1\",\"id\":\"mock-robot-3\",\"label\":\"模拟机器人C\",\"brand\":\"模拟品牌A\",\"type\":3,\"ip\":\"127.0.1.3\"},{\"gid\":\"mock-robot-group-2\",\"id\":\"mock-robot-4\",\"label\":\"模拟机器人D\",\"brand\":\"模拟品牌B\",\"type\":1,\"ip\":\"127.0.2.1\"}],\"theme\":\"dark\",\"background\":\"#1e2430\",\"color\":\"#bdc7db\"}" + "json": "{\"x\":0,\"y\":0,\"scale\":1,\"pens\":[{\"height\":0,\"lineName\":\"line\",\"lineWidth\":2,\"name\":\"line\",\"type\":1,\"width\":100,\"x\":100,\"y\":100,\"anchors\":[{\"x\":0,\"y\":0,\"id\":\"c\",\"start\":true,\"lineLength\":100,\"connectTo\":\"21b74c90\"},{\"x\":1,\"y\":0,\"id\":\"5e82ddd8\",\"connectTo\":\"00f32a0\"}],\"id\":\"57e55945\",\"fontSize\":14,\"lineHeight\":1.5,\"length\":100,\"ex\":200,\"ey\":100,\"rotate\":0,\"tags\":[\"route\"],\"route\":{\"type\":\"line\"},\"label\":\"undefined → undefined\"},{\"id\":\"3afaff2\",\"name\":\"area\",\"tags\":[\"area\",\"area-12\"],\"label\":\"A3afaff2\",\"x\":254,\"y\":52,\"width\":183,\"height\":195,\"lineWidth\":1,\"area\":{\"type\":12,\"points\":[\"a6667c8\",\"702ccfa\",\"9fc0ba3\",\"984da11\"],\"routes\":[]},\"locked\":4,\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[],\"rotate\":0},{\"id\":\"8b37b4f\",\"name\":\"area\",\"tags\":[\"area\",\"area-11\"],\"label\":\"A8b37b4f\",\"x\":44,\"y\":49,\"width\":193,\"height\":195,\"lineWidth\":1,\"area\":{\"type\":11,\"points\":[\"21b74c90\",\"00f32a0\",\"7f201a25\",\"8de717e\"],\"routes\":[]},\"locked\":4,\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[],\"rotate\":0},{\"id\":\"5d96dd3d\",\"name\":\"area\",\"tags\":[\"area\",\"area-1\"],\"label\":\"A5d96dd3d\",\"x\":451,\"y\":126,\"width\":196,\"height\":125,\"lineWidth\":1,\"area\":{\"type\":1,\"points\":[\"5170c043\"],\"routes\":[]},\"locked\":4,\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[],\"rotate\":0},{\"x\":88,\"y\":88,\"width\":24,\"height\":24,\"lineWidth\":2,\"iconSize\":4,\"image\":\"\",\"canvasLayer\":3,\"id\":\"21b74c90\",\"name\":\"point\",\"tags\":[\"point\",\"point-1\"],\"label\":\"P21b74c90\",\"point\":{\"type\":1},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5,\"penId\":\"21b74c90\",\"id\":\"c\"}],\"rotate\":0,\"connectedLines\":[{\"lineId\":\"57e55945\",\"lineAnchor\":\"4d6a84f\"}]},{\"x\":188,\"y\":88,\"width\":24,\"height\":24,\"lineWidth\":2,\"iconSize\":4,\"image\":\"\",\"canvasLayer\":3,\"id\":\"00f32a0\",\"name\":\"point\",\"tags\":[\"point\",\"point-2\"],\"label\":\"P00f32a0\",\"point\":{\"type\":2},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5,\"penId\":\"00f32a0\",\"id\":\"c\"}],\"rotate\":0,\"connectedLines\":[{\"lineId\":\"57e55945\",\"lineAnchor\":\"5e82ddd8\"}]},{\"x\":288,\"y\":88,\"width\":24,\"height\":24,\"lineWidth\":2,\"iconSize\":4,\"image\":\"\",\"canvasLayer\":3,\"id\":\"a6667c8\",\"name\":\"point\",\"tags\":[\"point\",\"point-3\"],\"label\":\"Pa6667c8\",\"point\":{\"type\":3},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5,\"penId\":\"a6667c8\",\"id\":\"c\"}],\"rotate\":0},{\"x\":388,\"y\":88,\"width\":24,\"height\":24,\"lineWidth\":2,\"iconSize\":4,\"image\":\"\",\"canvasLayer\":3,\"id\":\"702ccfa\",\"name\":\"point\",\"tags\":[\"point\",\"point-4\"],\"label\":\"P702ccfa\",\"point\":{\"type\":4},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5,\"penId\":\"702ccfa\",\"id\":\"c\"}],\"rotate\":0},{\"x\":76,\"y\":170,\"width\":48,\"height\":60,\"lineWidth\":3,\"iconSize\":10,\"image\":\"/point/11-dark.png\",\"canvasLayer\":3,\"id\":\"7f201a25\",\"name\":\"point\",\"tags\":[\"point\",\"point-11\"],\"label\":\"P7f201a25\",\"point\":{\"type\":11},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5,\"penId\":\"7f201a25\",\"id\":\"c\"}],\"rotate\":0},{\"x\":176,\"y\":170,\"width\":48,\"height\":60,\"lineWidth\":3,\"iconSize\":10,\"image\":\"/point/12-dark.png\",\"canvasLayer\":3,\"id\":\"8de717e\",\"name\":\"point\",\"tags\":[\"point\",\"point-12\"],\"label\":\"P8de717e\",\"point\":{\"type\":12},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5,\"penId\":\"8de717e\",\"id\":\"c\"}],\"rotate\":0},{\"x\":276,\"y\":170,\"width\":48,\"height\":60,\"lineWidth\":3,\"iconSize\":10,\"image\":\"/point/13-dark.png\",\"canvasLayer\":3,\"id\":\"9fc0ba3\",\"name\":\"point\",\"tags\":[\"point\",\"point-13\"],\"label\":\"P9fc0ba3\",\"point\":{\"type\":13},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5,\"penId\":\"9fc0ba3\",\"id\":\"c\"}],\"rotate\":0},{\"x\":376,\"y\":170,\"width\":48,\"height\":60,\"lineWidth\":3,\"iconSize\":10,\"image\":\"/point/14-dark.png\",\"canvasLayer\":3,\"id\":\"984da11\",\"name\":\"point\",\"tags\":[\"point\",\"point-14\"],\"label\":\"P984da11\",\"point\":{\"type\":14},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5,\"penId\":\"984da11\",\"id\":\"c\"}],\"rotate\":0},{\"x\":476,\"y\":170,\"width\":48,\"height\":60,\"lineWidth\":3,\"iconSize\":10,\"image\":\"/point/15-dark.png\",\"canvasLayer\":3,\"id\":\"5170c043\",\"name\":\"point\",\"tags\":[\"point\",\"point-15\"],\"label\":\"P5170c043\",\"point\":{\"type\":15},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5,\"penId\":\"5170c043\",\"id\":\"c\"}],\"rotate\":0},{\"x\":576,\"y\":170,\"width\":48,\"height\":60,\"lineWidth\":3,\"iconSize\":10,\"image\":\"/point/16-dark.png\",\"canvasLayer\":3,\"id\":\"d292734\",\"name\":\"point\",\"tags\":[\"point\",\"point-16\"],\"label\":\"Pd292734\",\"point\":{\"type\":16},\"fontSize\":14,\"lineHeight\":1.5,\"anchors\":[{\"x\":0.5,\"y\":0.5,\"penId\":\"d292734\",\"id\":\"c\"}],\"rotate\":0}],\"origin\":{\"x\":0,\"y\":0},\"center\":{\"x\":0,\"y\":0},\"paths\":{},\"template\":\"4c2a10f\",\"theme\":\"dark\",\"background\":\"#1e2430\",\"color\":\"#bdc7db\",\"locked\":4,\"version\":\"1.0.78\",\"dataPoints\":[],\"robotGroups\":[{\"id\":\"mock-robot-group-1\",\"label\":\"模拟机器人组A\",\"robots\":[\"mock-robot-1\",\"mock-robot-2\",\"mock-robot-3\"]},{\"sid\":\"mock-scene-1\",\"id\":\"mock-robot-group-2\",\"label\":\"模拟机器人组B\",\"robots\":[\"mock-robot-4\"]}],\"robots\":[{\"gid\":\"mock-robot-group-1\",\"id\":\"mock-robot-1\",\"label\":\"模拟机器人A\",\"brand\":\"模拟品牌A\",\"type\":1,\"ip\":\"127.0.1.1\"},{\"gid\":\"mock-robot-group-1\",\"id\":\"mock-robot-2\",\"label\":\"模拟机器人B\",\"brand\":\"模拟品牌A\",\"type\":2,\"ip\":\"127.0.1.2\"},{\"gid\":\"mock-robot-group-1\",\"id\":\"mock-robot-3\",\"label\":\"模拟机器人C\",\"brand\":\"模拟品牌A\",\"type\":3,\"ip\":\"127.0.1.3\"},{\"gid\":\"mock-robot-group-2\",\"id\":\"mock-robot-4\",\"label\":\"模拟机器人D\",\"brand\":\"模拟品牌B\",\"type\":1,\"ip\":\"127.0.2.1\"}]}" }, "message": "模拟提示" } diff --git a/src/_ant.scss b/src/_ant.scss index a1738fe..d02ef42 100644 --- a/src/_ant.scss +++ b/src/_ant.scss @@ -394,8 +394,20 @@ padding: 0; border-color: get-color(item_bg-hover); + & > .ant-list-item-action { + visibility: hidden; + + & > li { + padding: 0; + } + } + &:hover { background-color: get-color(item_bg-hover); + + & > .ant-list-item-action { + visibility: visible; + } } &.selected { diff --git a/src/apis/map/type.ts b/src/apis/map/type.ts index fed0f4d..f1525ba 100644 --- a/src/apis/map/type.ts +++ b/src/apis/map/type.ts @@ -30,6 +30,8 @@ export interface MapRouteInfo { type: MapRouteType; // 线路类型 direction?: -1 | 1; // 方向 pass?: MapRoutePassType; // 可通行类型 + c1?: Point; // 控制点A + c2?: Point; // 控制点B } //#endregion @@ -41,4 +43,5 @@ export interface MapAreaInfo { } //#endregion -export type MapRect = Record<'x' | 'y' | 'width' | 'height', number>; +export type Point = Record<'x' | 'y', number>; +export type Rect = Record<'x' | 'y' | 'width' | 'height', number>; diff --git a/src/assets/icons/_icon.scss b/src/assets/icons/_icon.scss index c37388e..1d28edc 100644 --- a/src/assets/icons/_icon.scss +++ b/src/assets/icons/_icon.scss @@ -24,6 +24,7 @@ $icons: ( redo, register, robot, + route, save, search, trash_fill, diff --git a/src/assets/icons/dark/route.png b/src/assets/icons/dark/route.png new file mode 100644 index 0000000..c6bce44 Binary files /dev/null and b/src/assets/icons/dark/route.png differ diff --git a/src/assets/icons/dark/trash_fill.png b/src/assets/icons/dark/trash_fill.png index db41ba6..421db5c 100644 Binary files a/src/assets/icons/dark/trash_fill.png and b/src/assets/icons/dark/trash_fill.png differ diff --git a/src/assets/themes/editor-dark.json b/src/assets/themes/editor-dark.json index e379b6f..f5b99cc 100644 --- a/src/assets/themes/editor-dark.json +++ b/src/assets/themes/editor-dark.json @@ -13,6 +13,12 @@ "stroke": "#595959", "strokeActive": "#FCC947" }, + "route": { + "stroke-0": "#8C8C8C", + "stroke-1": "#49AA19", + "stroke-2": "#D89614", + "stroke-10": "#E63A3A" + }, "area": { "stroke-1": "#9ACDFF99", "fill-1": "#9ACDFF33", @@ -21,6 +27,5 @@ "stroke-12": "#0DBB8A99", "fill-12": "#0DBB8A33", "strokeActive": "#FCC947" - }, - "line": "#8C8C8C" + } } diff --git a/src/components/card/point-edit-card.vue b/src/components/card/point-edit-card.vue index 36848ea..0db86f2 100644 --- a/src/components/card/point-edit-card.vue +++ b/src/components/card/point-edit-card.vue @@ -1,5 +1,5 @@