From 37d5dfa7decddd1c27bd09df24a8a558339baf9e Mon Sep 17 00:00:00 2001 From: chndfang Date: Wed, 4 Jun 2025 18:43:50 +0800 Subject: [PATCH] feat: change robot register --- README.md | 26 ++++++++++-------- mocks/robot/getAll | 12 ++++---- mocks/robot/register | 2 +- mocks/scene/getByGroupId | 4 +-- src/_ant.scss | 17 ++++++++++++ src/apis/robot/constant.ts | 2 +- src/apis/robot/type.ts | 6 ++-- src/assets/icons/light/redo.png | Bin 567 -> 592 bytes src/assets/icons/light/save.png | Bin 644 -> 662 bytes src/assets/icons/light/trash.png | Bin 759 -> 747 bytes src/assets/icons/light/undo.png | Bin 559 -> 596 bytes src/components/modal/robot-add-modal.vue | 8 ++++-- src/components/modal/robot-register-modal.vue | 21 ++++++++++++++ 13 files changed, 71 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index bd2a45d..7a03904 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ GroupSceneDetail { "id": "mock-robot-1", "label": "模拟机器人A", - "brand": "模拟品牌A", + "brand": 1, "type": 1, "ip": "127.0.1.1", "isConnected": true, @@ -95,7 +95,7 @@ GroupSceneDetail { "id": "mock-robot-2", "label": "模拟机器人B", - "brand": "模拟品牌A", + "brand": 1, "type": 2, "ip": "127.0.1.2" } @@ -128,7 +128,7 @@ RobotRealtimeInfo [JSON] { "id": "mock-robot-1", "label": "模拟机器人A", - "brand": "模拟品牌A", + "brand": 1, "type": 1, "ip": "127.0.1.1", "isConnected": true, @@ -169,42 +169,42 @@ Array { "id": "mock-robot-1", "label": "模拟机器人A", - "brand": "模拟品牌A", + "brand": 1, "type": 1, "ip": "127.0.1.1" }, { "id": "mock-robot-2", "label": "模拟机器人B", - "brand": "模拟品牌A", + "brand": 1, "type": 2, "ip": "127.0.1.2" }, { "id": "mock-robot-3", "label": "模拟机器人C", - "brand": "模拟品牌A", + "brand": 1, "type": 3, "ip": "127.0.1.3" }, { "id": "mock-robot-4", "label": "模拟机器人D", - "brand": "模拟品牌B", + "brand": 1, "type": 1, "ip": "127.0.2.1" }, { "id": "mock-robot-5", "label": "模拟机器人E", - "brand": "模拟品牌B", + "brand": 1, "type": 2, "ip": "127.0.2.2" }, { "id": "mock-robot-6", "label": "模拟机器人F", - "brand": "模拟品牌B", + "brand": 1, "type": 3, "ip": "127.0.2.3" } @@ -250,7 +250,7 @@ RobotInfo "data": { "id": "mock-robot-0", "label": "模拟机器人-注册", - "brand": "模拟品牌A", + "brand": 1, "type": 1, "ip": "127.0.0.0" }, @@ -372,7 +372,7 @@ interface RobotInfo { label: string; // 机器人名称 brand: RobotBrand; // 机器人品牌 type: RobotType; // 机器人类型 - ip: string; // 机器人ip + ip?: string; // 机器人ip(仅真实机器人) battery?: number; // 机器人电量 isConnected?: boolean; // 机器人连接状态 state?: RobotState; // 机器人状态 @@ -387,6 +387,8 @@ export interface RobotDetail extends RobotInfo { chargeBattery?: number; // 充电电量 taskBattery?: number; // 任务电量 swapBattery?: number; // 交换电量 + length?: number; // 空载长(仅仿真机器人) + width?: number; // 空载宽(仅仿真机器人) } export interface RobotRealtimeInfo extends RobotInfo { x: number; // 坐标x @@ -397,7 +399,7 @@ export interface RobotRealtimeInfo extends RobotInfo { } enum RobotBrand { - '先工' = 1, + 仙工 = 1, } enum RobotType { 叉车机器人 = 1, diff --git a/mocks/robot/getAll b/mocks/robot/getAll index 57067c9..61c9933 100644 --- a/mocks/robot/getAll +++ b/mocks/robot/getAll @@ -5,42 +5,42 @@ { "id": "mock-robot-1", "label": "模拟机器人A", - "brand": "模拟品牌A", + "brand": 1, "type": 1, "ip": "127.0.1.1" }, { "id": "mock-robot-2", "label": "模拟机器人B", - "brand": "模拟品牌A", + "brand": 1, "type": 2, "ip": "127.0.1.2" }, { "id": "mock-robot-3", "label": "模拟机器人C", - "brand": "模拟品牌A", + "brand": 1, "type": 3, "ip": "127.0.1.3" }, { "id": "mock-robot-4", "label": "模拟机器人D", - "brand": "模拟品牌B", + "brand": 1, "type": 1, "ip": "127.0.2.1" }, { "id": "mock-robot-5", "label": "模拟机器人E", - "brand": "模拟品牌B", + "brand": 1, "type": 2, "ip": "127.0.2.2" }, { "id": "mock-robot-6", "label": "模拟机器人F", - "brand": "模拟品牌B", + "brand": 1, "type": 3, "ip": "127.0.2.3" } diff --git a/mocks/robot/register b/mocks/robot/register index 23972f9..da10ace 100644 --- a/mocks/robot/register +++ b/mocks/robot/register @@ -4,7 +4,7 @@ "data": { "id": "mock-robot-0", "label": "模拟机器人-注册", - "brand": "模拟品牌A", + "brand": 1, "type": 1, "ip": "127.0.0.0" }, diff --git a/mocks/scene/getByGroupId b/mocks/scene/getByGroupId index c242237..4b42358 100644 --- a/mocks/scene/getByGroupId +++ b/mocks/scene/getByGroupId @@ -17,7 +17,7 @@ { "id": "mock-robot-1", "label": "模拟机器人A", - "brand": "模拟品牌A", + "brand": 1, "type": 1, "ip": "127.0.1.1", "isConnected": true, @@ -29,7 +29,7 @@ { "id": "mock-robot-2", "label": "模拟机器人B", - "brand": "模拟品牌A", + "brand": 1, "type": 2, "ip": "127.0.1.2" } diff --git a/src/_ant.scss b/src/_ant.scss index f0fa6c5..ebc24a8 100644 --- a/src/_ant.scss +++ b/src/_ant.scss @@ -371,6 +371,23 @@ } } + .ant-input-number-group-wrapper { + width: 100%; + + & > .ant-input-number-wrapper { + & > .ant-input-number { + border-radius: 2px 0 0 2px; + } + + & > .ant-input-number-group-addon { + color: get-color(text1); + background-color: get-color(fill3); + border-color: get-color(neutral5); + border-radius: 0 2px 2px 0; + } + } + } + .ant-layout { background-color: get-color(page_bg); diff --git a/src/apis/robot/constant.ts b/src/apis/robot/constant.ts index da29310..a5b694d 100644 --- a/src/apis/robot/constant.ts +++ b/src/apis/robot/constant.ts @@ -1,7 +1,7 @@ import { isNumber } from 'lodash-es'; export enum RobotBrand { - '先工' = 1, + 仙工 = 1, } export const ROBOT_BRAND_OPTIONS = >( Object.entries(RobotBrand).filter(([, v]) => isNumber(v)) diff --git a/src/apis/robot/type.ts b/src/apis/robot/type.ts index ca47c70..eecef87 100644 --- a/src/apis/robot/type.ts +++ b/src/apis/robot/type.ts @@ -13,7 +13,7 @@ export interface RobotInfo { label: string; // 机器人名称 brand: RobotBrand; // 机器人品牌 type: RobotType; // 机器人类型 - ip?: string; // 机器人ip + ip?: string; // 机器人ip(仅真实机器人) battery?: number; // 机器人电量 isConnected?: boolean; // 机器人连接状态 state?: RobotState; // 机器人状态 @@ -29,8 +29,8 @@ export interface RobotDetail extends RobotInfo { chargeBattery?: number; // 充电电量 taskBattery?: number; // 任务电量 swapBattery?: number; // 交换电量 - length?: number; // 空载长 - width?: number; // 空载宽 + length?: number; // 空载长(仅仿真机器人) + width?: number; // 空载宽(仅仿真机器人) } export interface RobotRealtimeInfo extends RobotInfo { diff --git a/src/assets/icons/light/redo.png b/src/assets/icons/light/redo.png index da8e4197ce388af6b3080fa34721ba58e8091edf..0df859adbcb98bdb3c4fba108e0f6e9564b86a5a 100644 GIT binary patch delta 555 zcmV+`0@VGt1kePKFnoKmnitP=Ev^ zfCJ6}IDkGgy_t}1+D+2*ax=*#n>9q>OGFMFr!Qh4Y5@4|BCzMFZic7<0Dotnm9#NI)Bu3*$q=;w zBtz5$kOWa1Kr}=Q0G)zdJrR*3ul2>W?wn@_g>3=A@vCmoTr2G^$C;G947+`I;}ie` z=6y?QYk=!+$Q@b%YI7dHFFP?`tN{LqXCEPa>W!dAiN)RMpOgI|1LygBD1~nOi>(wc=?G%W(Z-U(B)BA3m7A22%~s)3~es5!bG6aOaALW3e{>iQvN@|EiO zxzSVSz+0E|XO882WhP`FJeL720`&U_=Kuy5Q7AdUl7D$L0CJHua$mF=?G#saE7W25 zK0{%-i*GliQ&o`&0igbea*d{#fnY9_oDJqkkM;PuuG2tAe{r)CObw~IAO>$zRtKk^ zn*!ME*J@(Qw)_9Vn^er^v1hFS*dQ8Q^0<8Qv->@B>GnK3SlBfHIDXMxdAajAvt%sI?l~Pe2S9_l z-ILlSz#mC3wE)qa$8S>#QQ42Gc~rc6uOkel^UC@_YPtW$ITUp0VM!Z z2lZ1!b(~+*On=Jvj+6lMiAa^#Xv$9kP<5#Fy;W_h9HCjH{1iaGcv1h`;o#iRQn9EO zt&~EK*&CncJaFF6&jZ!Yk1gV@0Z1V#9$lV7;XYF4A*J)JRr8&}E0@t5NoUE-9JIMY zT4@ciapNmNZ**Uxz;8G!0g#KNQM&UaFIimS%(9iB8-J5Zp&~H`fckfZZ8VD+2>QaB zy`ehNQ|E#I+D`Y-rt(-zu+@QPaFVKZaPGM|fPQ>wdp$RIdVg?|vJ9SjwibXnNGUdX zbWZ-K-!rG)f%@hSTMK9bsGW1u=NiDKau;6KBG4k>RG_7hQ$Y9d76G?}&I$eih1^v! U+d8sg01E&B07*qoM6N<$f@Q1nC;$Ke diff --git a/src/assets/icons/light/save.png b/src/assets/icons/light/save.png index b982128edea42502a68320ba81576dd61ed2aa87..a7eef35731f8085c3500dff4deb7abbeb1873f79 100644 GIT binary patch delta 624 zcmV-$0+0QK1(pSnF@I1=L_t(&L+x3OF$FOY{$2-kKn3W43eW)+paN8Y3XBR+0V<#a zI-mpIH- z0N~#>fUgw3eE=xzC4lo3#*uq|%sCH{`@Atg;a>pk#xl%Ye}4iX3WU!BHLurDiE&2 z>HEw$9UU)Y;mP`43jmJ{f^Y$#i`c1hTco&}0D>S~073$WzQ-ma$uBCfrwHH_z`ZuG zQviIMiX5wH&3}3(icRDD5(K|7nf$BRDF9@UYXsA-d0wXKBeR$REJ57K`ji5I0scOK z6AmwAN}&ak$&b#4eZ0w8xyPu?i;*oc-7|)Og+1ZE|cv58%{8K4-}}t@njS zj@T1ovuXI2HSO~R-*s`UCng_i&W+e+cW)G{b)iSTEAiM-T&)U*)I8-_6TZ&^HedQ7 zM|?ZRCrduFy5wiPQP?;0u)@sarLiXt3Ip^nX#lcSn8{%F7We~tU8gZ{Q1#gW0000< KMNUMnLSTZ*$s%w7 delta 606 zcmV-k0-^nu1%w5VF@HWuL_t(&L+zO@PXsX#hTlsN2m}IwKp+qZ1OkCT@Y4|p1OkCT zAP@)y0)apv$dha@rPuEEW81w;+T?O~*>-l`ndyA4wBu{Flo1~u{x?=!f_EgeI4&lTzzmi@heI%X>-T|1ulz()PO0aPMODc$v2F@Bu z-iJ2{gbx5Ve(g}kK2b6D>OQ+GkUHjxu-p|5!Uw>WKFmK#!cJMY&f7`=_~;q(Q6PK( zuzfs^S9e9A^;o)1o6Toc(D@p?SpXwB)0EM=tiAJjs{AY%{kivl%@(fQn$}^4Rj3@ z+E5h}!i^H{so1FAN)~SPYY0$H+-S={hG1sbz{Sv|D1VW9=q#FeavshOphYrQ)s5D! z2VAc=y9PRd6dSK`iMs~61_}$BZbG$9Xz9k59S7V#ZB$K6!EU$JTelW%01Q@0UCi1@ zHMX(2YXFetB22r@8P!&y(?IXXUbWimzHF1W2^K)t!yRY2ecIrJX2}6ZC{x{#J{v<5 znx#feAy?+<8vRbumAu607*qoM6N<$f~{Z}WdHyG diff --git a/src/assets/icons/light/trash.png b/src/assets/icons/light/trash.png index 82098eb1d3e5c0c3dfe739a4db7bc0a96c0dd050..a00ba951d2c2256f6aabe21854bd995caa8397c0 100644 GIT binary patch literal 747 zcmVPx%rAb6VR9HvtnC(&AFc5}!I|v;>2e}FY6#x~4s~|}QKm|Yr&;dyWIVuRLAlE^z zgT?QS)+5Q5AjZvu+QF%jJn(Fa2W*37&$+`qrI z%7Y^ElZZ}@FZ;pF7sh9*0iTJ;`mzl(pB)MiA$~NxY)3@j4i;hqSo5uc1}nwi3=tU! zk|_qP5r1#MAemyo8u9lA43cRs#43K&xR2i3Ux^4}@3CUrsE_zfk||jSMFeF89@TZp z%-?&^i3n;aobsTn^kn5hh2i zC4k*WE)iKgYApeTzW(MWnp6)>T_3a?l&(PnN2*VA7CTV`P!nOt%tuzJ#E6E=*+HS` zK?fM`80Ql6R|1#y_~3-((Ut8YO9A7$rN;FXRyygy`}jf6@k&n8dgG$6TQkCLiLyRB zIYLxvP#<#T0X1*V6Bb~29B_*cV2eEHK>`l7@!a_Fa-R@H^n2JKbXStaxM35Z#ZA5L d{SVmc$v5J-nmB*I4fg;5002ovPDHLkV1k4}OK$)G literal 759 zcmVPx%u}MThRA@u(nW0l2F%ZQcGZhsGL{qN1Xrq5^@a z==?f_IYRFCZF2X~Z_3V`fK9Udb~i7Zdv^4-+bVR@SOcp*rHvmfLq$3MN|Lea{LL&hjp1Vc~ z4LdQiKnp-GtBm;J%x$t(3&04gIF5{rdBR#P03)n2;+!-032V)jP!Fp(4vdUxvX--n z>ym=EiNqFiDCxsw;af>pONJZ(?y9O>Os?aII|0Hj-Kkhmq}@N*R5Nbk~hR|cGxdU_RY zQEjB(6o7NYmj^E1NLvq9jy}~&XG$pDWGx*&Gdj0v>?)yjo7(}P%Z9s&>*$0xr49gf znOYYo7eL)o&vm37em_j9na;X7zkeckwl%7|H;^ApLsp&q*#gg27{!_4=0qfCEH~ z&6fQ^&vl+G;{4(zX1Z7w0CULzAlA+V5r=tf=d+u*jv~}b{Q`t9n-!wXhr`fv*Uzmz p8F0&CC*xiK>?F(!M)p1fe*hwxt}#FizkL7z002ovPDHLkV1i%ENm&2@ diff --git a/src/assets/icons/light/undo.png b/src/assets/icons/light/undo.png index 236f52b1248a8e97f7d6e2dc494300b20548b35b..55f8fd81796336059196f44164390512d6e923d3 100644 GIT binary patch delta 559 zcmV+~0?_@h1k?nOFn%$@tnCjYGWh(7X%5b9pQRFD5hL6Chh&)ULFlU=6iBK91k>K~SdY=Ok;dSK+VMrWy{nr}l zSRI&y1mFl?;(!0#k%#lZ@7V;HI2Q@_rfDQ2_JhWezKi$2k*dUVl0XSEqMcAKyH>u4 zz?>uq8O}sMo<-!iRDpiJFPz4{4^WR#p&uLVdrk=1gk2I-+y{PQ=eCqUA5O?hY!Z|9 z4b4pwHNICTPyjW1g`{;FnDeOh#i^WDd?bl|8VF%X+;{!g7SU84n1cl12wzB?c#;I~ z#F7gcO(RZpi+{$EzKhSll_S6(=Tw4>*iR_Wl3s@rn3Dvd#CGdl(&HEcF%qTc0qPMd zxV6*1?-N3O!hSf_mmIVTWGgnq+u&<5yz}8Hr=j3V+~v!1t>#fJe0wH9bzK02;6R z?R+#{mkc5I2G2TMjB2N+@ca~$-Kc?P3h+F`GTG6h(6q6)x=$Zm=@1GHCou=%?aywY zr@AMByN8q{FqM+Y=QILU+?+V1DbN%!dZ2}n(Sc_3rhwUn#s~ZWnVeZMa?0ZW00000 MNkvXXt^-0~g6QY#m;e9( diff --git a/src/components/modal/robot-add-modal.vue b/src/components/modal/robot-add-modal.vue index ec7892d..1b9ec74 100644 --- a/src/components/modal/robot-add-modal.vue +++ b/src/components/modal/robot-add-modal.vue @@ -1,5 +1,5 @@