From 07f7a378c0c3b03af8cd95614c790bb19eaa7b94 Mon Sep 17 00:00:00 2001 From: chndfang Date: Sat, 3 May 2025 00:28:22 +0800 Subject: [PATCH] temp --- mocks/robot/getAll | 22 ++++++++-------- mocks/scene/getById | 30 ++++++---------------- src/_ant.scss | 37 +++++++++++++++++++++++++++ src/_icon.scss | 32 ++++++++++++++++++----- src/apis/robot/type.ts | 4 +-- src/assets/icons/_icon.scss | 2 +- src/assets/icons/dark/control.png | Bin 0 -> 971 bytes src/assets/icons/dark/trash_fill.png | Bin 0 -> 767 bytes src/components/robot-group.vue | 29 ++++++++++++++++----- src/pages/scene-editor.vue | 4 +-- 10 files changed, 108 insertions(+), 52 deletions(-) create mode 100644 src/assets/icons/dark/control.png create mode 100644 src/assets/icons/dark/trash_fill.png diff --git a/mocks/robot/getAll b/mocks/robot/getAll index 57067c9..6cb99cb 100644 --- a/mocks/robot/getAll +++ b/mocks/robot/getAll @@ -3,46 +3,44 @@ "success": true, "data": [ { + "gid": "mock-robot-group-1", "id": "mock-robot-1", "label": "模拟机器人A", "brand": "模拟品牌A", - "type": 1, - "ip": "127.0.1.1" + "type": 1 }, { + "gid": "mock-robot-group-1", "id": "mock-robot-2", "label": "模拟机器人B", "brand": "模拟品牌A", - "type": 2, - "ip": "127.0.1.2" + "type": 2 }, { + "gid": "mock-robot-group-1", "id": "mock-robot-3", "label": "模拟机器人C", "brand": "模拟品牌A", - "type": 3, - "ip": "127.0.1.3" + "type": 3 }, { + "gid": "mock-robot-group-2", "id": "mock-robot-4", "label": "模拟机器人D", "brand": "模拟品牌B", - "type": 1, - "ip": "127.0.2.1" + "type": 1 }, { "id": "mock-robot-5", "label": "模拟机器人E", "brand": "模拟品牌B", - "type": 2, - "ip": "127.0.2.2" + "type": 2 }, { "id": "mock-robot-6", "label": "模拟机器人F", "brand": "模拟品牌B", - "type": 3, - "ip": "127.0.2.3" + "type": 3 } ], "message": "模拟提示" diff --git a/mocks/scene/getById b/mocks/scene/getById index f912358..c51cffc 100644 --- a/mocks/scene/getById +++ b/mocks/scene/getById @@ -10,25 +10,25 @@ "label": "模拟机器人组A", "robots": [ { + "gid": "mock-robot-group-1", "id": "mock-robot-1", "label": "模拟机器人A", "brand": "模拟品牌A", - "type": 1, - "ip": "127.0.1.1" + "type": 1 }, { + "gid": "mock-robot-group-1", "id": "mock-robot-2", "label": "模拟机器人B", "brand": "模拟品牌A", - "type": 2, - "ip": "127.0.1.2" + "type": 2 }, { + "gid": "mock-robot-group-1", "id": "mock-robot-3", "label": "模拟机器人C", "brand": "模拟品牌A", - "type": 3, - "ip": "127.0.1.3" + "type": 3 } ] }, @@ -37,25 +37,11 @@ "label": "模拟机器人组B", "robots": [ { + "gid": "mock-robot-group-2", "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" + "type": 1 } ] } diff --git a/src/_ant.scss b/src/_ant.scss index b12a982..af9a954 100644 --- a/src/_ant.scss +++ b/src/_ant.scss @@ -35,6 +35,43 @@ border-color: get-color(warning); box-shadow: 0 2px 0 0 get-color(0000000a); } + + &.icon-btn { + background-color: transparent; + border: none; + box-shadow: none; + + &.ant-btn-sm { + padding: 0; + } + } + } + + .ant-checkbox { + &::after { + display: none; + } + + & > .ant-checkbox-inner { + background-color: get-color(141414); + border-color: get-color(434343); + border-radius: 2px; + } + + &.ant-checkbox-checked:not(.ant-checkbox-disabled) > .ant-checkbox-inner { + background-color: get-color(primary); + border-color: get-color(primary); + + &::after { + border-color: get-color(141414); + } + } + } + + .ant-checkbox-wrapper { + align-items: center; + font: 400 14px/22px Roboto; + color: get-color(ffffffa6); } .ant-collapse.ant-collapse-ghost { diff --git a/src/_icon.scss b/src/_icon.scss index 79604ca..d40d68d 100644 --- a/src/_icon.scss +++ b/src/_icon.scss @@ -2,13 +2,14 @@ @use 'asset/icons/icon' as *; @include themed { + i { + &.bg-1 { + background-color: get-color(ffffffd9); + } + } + .icon { - display: inline-block; - width: 1em; - height: 1em; - font-size: 18px; - line-height: 1; - vertical-align: top; + @extend %icon; @each $icon in $icons { &.#{$icon} { @@ -16,4 +17,23 @@ } } } + + .mask { + @extend %icon; + + @each $icon in $icons { + &.#{$icon} { + mask: get-icon($icon); + } + } + } +} + +%icon { + display: inline-block; + width: 1em; + height: 1em; + font-size: 24px; + line-height: 1; + vertical-align: top; } diff --git a/src/apis/robot/type.ts b/src/apis/robot/type.ts index 73f1c5a..36defc8 100644 --- a/src/apis/robot/type.ts +++ b/src/apis/robot/type.ts @@ -7,15 +7,15 @@ export interface RobotGroup { } export interface RobotInfo { + gid?: string; // 机器人组id id: string; // 机器人id label: string; // 机器人名称 brand: RobotBrand; // 机器人品牌 type: RobotType; // 机器人类型 - ip: string; // 机器人ip } export interface RobotDetail extends RobotInfo { - group?: string; // 机器人组id + ip: string; // 机器人ip isSimulative?: boolean; // 是否仿真机器人 battery?: number; // 机器人电量 minBattery?: number; // 最小电量 diff --git a/src/assets/icons/_icon.scss b/src/assets/icons/_icon.scss index 26f002b..f7c5150 100644 --- a/src/assets/icons/_icon.scss +++ b/src/assets/icons/_icon.scss @@ -1 +1 @@ -$icons: (dropdown, edit, exit); +$icons: (control, dropdown, edit, exit, trash_fill); diff --git a/src/assets/icons/dark/control.png b/src/assets/icons/dark/control.png new file mode 100644 index 0000000000000000000000000000000000000000..5a9e5789ab4dbba5949f7933df3f79c894077e88 GIT binary patch literal 971 zcmV;+12p`JP)Px&g-Jv~RA@u(T1!$CK@iP%0WY9?^#JM~JOH{!4*>4L1Au$r0O($H5AMYSh zTp*1%k=2otR8MzRS7VGpZitxauF996m#=Dothr&${g+t*sOnn=2*BxFftn3~s=gGF z6LWkIz}XxiW&xn84@KmQh&(W-Z$#t`fS;{FGzVbLe-aUb@OCXC+W`2tnKcEVs*E@z zADvGQ)A=m`%t#Y!4dA_qEE;!(odeiu;ynqX)k6PjoqGU2@~ZkmL^eg_x%Gi(p(_y~ z3ta&C-YR2FGN7ujMPzqH^G1K!%*OyePX#gwfKeug)zeBxCR1xQ0E_y*8&;JVgp|4u z;JjvmDgZ$y_%p zttIIw+xiAe9fxCOu{k7->@yHcXfgx2CZ^QjQFKfRG5XyNN3Mz4yxpPP z^}tsVd2&ZhdDb@8-`5u+enFAz>em5cwrXYLe5pX=2Ci1(h!FH#$&^~wWD5{W^9a*ew=&{!67rR0I|ban;c zw>|&JD40aRce^<=m6nS$;Oh6*&?_mSz-CLssbrmM02bM$p;xl8JPx%xk*GpRA@u(S<7)$F%awy01_YoAOOSN5P;!s2*7X$0x;Z-12EkA++74<0&o$4 z6EFb`HPr4at9x_7LM!KA^}8=Bzz+cTR*qZ%&{W7QO}q2r zz)k_YCHW=ey@)7y4Z?aY0R9P}h&%-F(unMnqWfF{$aaxC0G<}MH3fe+?$QEx*)?lG zM9MtRWXQJn9+AAZjCufmZQGMhd&eY|<>vALd?-$oDbwjk>R6dlXI_g9wb31}Hbpqi3Q3-Z>p9dRKJcHOZss<|qJdrwXFAzLI>i{y{{V#a~8MM4kh9 zZ`ey|qbLAPpK|n?27`pC3z5aUiW1f@H)pdIgRJ$N0Mhn7qZw)wa_d8uXkqw zSW5Sjr(poAR;sh0^&M!s zSVSHJ_*6x&WXPK-uJ&&+k_BMpZU%tIWLQS8!DIngvU@t1R*sLx26r$mm`G zmIRmt*Z_c(jP3v?-pGP;)muK-5@q-1n20Ivm( z0!Yc|E&%_L)uRAXGI|7nCxu5qq-696fH?}etANv8sF1@7LSIxPe=n&yeYj}*48MVE xic^z#BtPaly8xIgvQfJW1JOv$wQuhk_yb-BV?Y94R~`TW002ovPDHLkV1ggWQ9l3x literal 0 HcmV?d00001 diff --git a/src/components/robot-group.vue b/src/components/robot-group.vue index 99223df..5bbeefa 100644 --- a/src/components/robot-group.vue +++ b/src/components/robot-group.vue @@ -1,7 +1,7 @@ @@ -30,15 +40,20 @@ const isAllSelected = computed(() => robots.value.every(({ id }) => sel - {{ $t('全选') }} + {{ $t('全选') }} + + + + + - - + +