From b2f28052471d1b7960fbb491916377141bf449c5 Mon Sep 17 00:00:00 2001 From: miao <2514145421@qq.com> Date: Tue, 7 Mar 2023 17:35:35 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AD=94=E5=A2=99=EF=BC=9A=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=BF=BB=E8=AF=91,=E4=BF=AE=E5=A4=8D=E8=99=9A=E6=8B=9F?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E9=80=89=E4=B8=AD=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=A7=92=E5=BA=A6=E5=9D=90=E6=A0=87=E4=BC=9A=E4=B9=B1=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E7=AA=97=E5=8F=A3=EF=BC=8C=E6=B7=BB=E5=8A=A0=E9=AD=94?= =?UTF-8?q?=E5=A2=99=E7=9A=84=E6=98=BE=E7=A4=BA=E5=99=A8=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=AE=BD=E9=AB=98=E4=BF=A1=E6=81=AF=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E6=97=B6=E6=81=A2=E5=A4=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=99=A8=E5=88=97=E8=A1=A8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/ClientConnection.ts | 11 +++ src/components/ControlPanelDialog.vue | 61 ++++++++++------ src/entities/ApplicationConfigEntity.ts | 97 +++++++++++++------------ src/i18n/en-US/index.ts | 5 +- src/i18n/zh-CN/index.ts | 4 + 5 files changed, 108 insertions(+), 70 deletions(-) diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index 3108288..6e4fa17 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -710,6 +710,17 @@ export default class ClientConnection { ) ); } + public setMagicWallList(list:any) { + this.ws?.send( + JSON.stringify( + new Protocol.SetApplicationConfigRequestEntity( + 0, + "magic_list", + typeof (list) == 'string' ? list : JSON.stringify(list) + ) + ) + ); + } public setConfigure(k: string, v: string) { this.ws?.send( diff --git a/src/components/ControlPanelDialog.vue b/src/components/ControlPanelDialog.vue index 6fecdb7..8af61d6 100644 --- a/src/components/ControlPanelDialog.vue +++ b/src/components/ControlPanelDialog.vue @@ -124,9 +124,22 @@ min="0" v-model="test_monitor_wall[current_index].angle" @keydown="testLog($event)" - oninput="if(value<0)value=0;if(value>360)value=360;" hint="" @update:model-value="changeAngle()" + :rules="[ + (val) => + (val != null && + val != undefined && + val.toString().length > 0) || + $t('Please type something'), + (val) => + parseInt(val) >= 0 || + $t('the number must be greater than 0'), + (val) => + parseInt(val) <= 360 || + $t('the number must be greater than 360'), + ]" + lazy-rules >