From 081764b4b1b548af8e4d534aa34cce79fe84bea7 Mon Sep 17 00:00:00 2001 From: chndfang Date: Fri, 9 May 2025 00:17:02 +0800 Subject: [PATCH] temp --- mocks/scene/getById | 2 +- src/_ant.scss | 12 ++++ src/apis/map/type.ts | 5 +- src/assets/icons/_icon.scss | 1 + src/assets/icons/dark/route.png | Bin 0 -> 812 bytes src/assets/icons/dark/trash_fill.png | Bin 767 -> 859 bytes src/assets/themes/editor-dark.json | 9 ++- src/components/card/point-edit-card.vue | 4 +- src/components/robot-groups.vue | 28 +++++++- src/services/editor.service.ts | 81 ++++++++++++++++++++++-- 10 files changed, 126 insertions(+), 16 deletions(-) create mode 100644 src/assets/icons/dark/route.png 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 0000000000000000000000000000000000000000..c6bce446768259045aff931dbd70d23bd109452b GIT binary patch literal 812 zcmV+{1JnG8P)Px%=1D|BRA@u(n6YxxKoExibwQ|@@CK%)AZ}?Qb(Exu)!ean%4gDcEWnxq_MNr96>JzvK3U z>H;_yew}J0N+^D+RYH#E9}v@z1i;8@8jU=eEv1BHvK5Pl@O( z7R=1=?Gy8~G61d@48VAq0C;PknCI02SoQ#L$fn&ggGvCb=|ITq0Rp)2L+qsLA3Gf2 zQUFpTgeV`|ZkcYL@+ll(rF{Yd;ECNb$CUtZy}$>@yz@bfbfbd0N;t| zSD_hjJl`TFCn;98`$XbjB;LIuq7Q`uI0Jv5u4kh|JU)x|A?3bn#0%YjiRfct0B(PH z2Jn*8%GCY_@j~~v!b+%jIqY!A-KElz7#(E9YtO*!+BoHOiyZRB_TIHhKL_2MB z+^msT3NRDS)LAmA#SRl@wpB-dX8>p5*K0SmHZvP*h0k{wM`pEgRLC27X#gQ~w)h$c zV2I23vqji(n*dBd?FrpEM{1tm}?<lg?xmE7|Du`0aQj_`Vh;ea@#r`;|NXd0000N<5Z(15XSoBr1G@vF1NkD#CleJ!uE2H$ zaVj8vN=P51R6weNxP!O@>ztWrGgL$wga8l=O7Un$yb25M+qa*$6vBZ&c;NoS5x_?? zcx2#U8F+f0-x1LS2nIbs%xFos@>;xx-Vu~SE9aMVANtak9e+ZVj3NEC3`aMs&+S?inB~wrT@t-o>u92C}@`BQ+uegKMU z3e+k(eoPq_NgR3kRbT0KF#TRWB3e5V!!@s?FG(C-dYxndm>}X8OBH3wD3Z-@SzZ~7 zUyW*7lnD~5HTHfrQycj)ke5Ss^tXU$FSOLlYZ6E2jelL5m-h&GX9`FyP2^ZicFTY^ z`nAhjlbEnUQ(#JWN1ikk9L<2io-izJRt zee>UY4u8}Kot;D3s7&Vw=t0I}vw~VTI%W&y0dVwgb@Y1zFe+Ul`XR?cmD!zSc-O#c zKOn5@VCzv8qiINywzb)Yoz7IJ_r8;Ol|qhLptinV00P!iZw6Maw5Z-p-+|N!r_W`C zODxsswHR{DlrHUWVuT04vZb*AxR?z1yut%uk$=@{?wV4qRpbVSn#giwbYsH;V3Po< z0P6vOC8I+Dm}Rv-s5D8fO=`2U4VVF}Ij|mPc3JJy^BiZmGCGU_x2*03frwZ#It+kY zR`&zIl+i%|I%IV}08AMj4!|LW`yk-T=wJY;Yd;P|5L&?OF4Xw925|$}>+dB1f&~%H zIWar19wXKu3k>jH&5i)}8eWgfj|_MOX|G2Po`Juo`TIZ?={wE<0000B5+DE|0K?r7fZ=Wkz;FiwFx-s; zFx>gvT?AkPa1nqLFaZoT)b1;-&FN2j-V%Ghxaa<30kCTZ7Y6p0 z0TFo(;01uY10XH|oRYlhwb7MAE9YPJURs^IB6-|vs~5m`0Dlj9FKwJV>}8=Bzz+cT zR*qZ%&{W7QO}q2rz)k_YCHW=ey@)7y4Z?aY0R9P}h&%-F(unMnqWfF{$aaxC0G<}M zH3fe+?$QEx*)?lGM9MtRWXQJn9+AAZjCufmZQGMhd&eY|<>vALd?-$oDbwjk>R6dl zXI_g9wb31Oya^wD#?Q5%HonU25!$0=Ol45OrSnWf<@}$22*O=jKO} zXGIsX*i5z1EC8=}X8~AB_mbqvTny;@;G1E5QjErs+IY2D!w$d(QxPDU6!K=l)cOVi zq@Sl@0Dr4is>e9R7J03$eSsy_HQwg1z_cF27t$8SVphGWC2*Rddl6# z7YDtoEb -import { MAP_POINT_TYPES, MapAreaType, type MapPen, type MapPointInfo, MapPointType, type MapRect } from '@api/map'; +import { MAP_POINT_TYPES, MapAreaType, type MapPen, type MapPointInfo, MapPointType, type Rect } from '@api/map'; import type { RobotInfo } from '@api/robot'; import type { PointBindModalRef } from '@common/modal/point-bind-modal.vue'; import type { RobotBindModalRef } from '@common/modal/robot-bind-modal.vue'; @@ -27,7 +27,7 @@ const point = computed(() => { return v; }); -const rect = computed(() => { +const rect = computed(() => { if (isNil(pen.value)) return null; return editor.value.getPenRect(pen.value); }); diff --git a/src/components/robot-groups.vue b/src/components/robot-groups.vue index 2113510..ed5c0ea 100644 --- a/src/components/robot-groups.vue +++ b/src/components/robot-groups.vue @@ -46,7 +46,7 @@ watch( () => selected.clear(), ); -const isAllSelected = computed(() => robots.value.every(({ id }) => selected.has(id))); +const isAllSelected = computed(() => selected.size > 0 && robots.value.every(({ id }) => selected.has(id))); const selectAll = (checked: boolean) => { if (checked) { robots.value.forEach(({ id }) => selected.add(id)); @@ -90,6 +90,19 @@ const toDeleteGroup = (id: RobotGroup['id']) => //#endregion //#region 机器人操作 +const toRemoveRobot = (id: RobotInfo['id']) => + Modal.confirm({ + class: 'confirm', + title: t('您确定要从场景中移除该机器人吗?'), + centered: true, + cancelText: t('返回'), + okText: t('移除'), + onOk: () => { + editor.value.removeRobots([id]); + selected.delete(id); + }, + }); + const toRemoveRobots = () => Modal.confirm({ class: 'confirm', @@ -198,11 +211,20 @@ const toRemoveRobots = () =>