From 3fed0db3eb1168b16150b674d87b3d8e9779e5cc Mon Sep 17 00:00:00 2001 From: fangxiang Date: Wed, 14 Sep 2022 15:13:00 +0800 Subject: [PATCH] =?UTF-8?q?special=5Fvideo=E7=9A=84layout=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=A2=9E=E5=8A=A0=E6=97=8B=E8=BD=AC=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/ClientConnection.ts | 12 ++++++ .../SpecialVideoGridSettingDialog.vue | 37 +++++++++++++++++++ src/entities/ApplicationConfigEntity.ts | 1 + src/i18n/zh-CN/index.ts | 2 +- 4 files changed, 51 insertions(+), 1 deletion(-) diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index be5881d..0033d98 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -696,6 +696,18 @@ export default class ClientConnection { ); } + public setSpecialVideoLayoutRotation(rotation: string) { + this.ws?.send( + JSON.stringify( + new Protocol.SetApplicationConfigRequestEntity( + 0, + "special_video_layout_rotation", + rotation + ) + ) + ); + } + public setWebsocketPort(port: number) { this.ws?.send( JSON.stringify( diff --git a/src/components/SpecialVideoGridSettingDialog.vue b/src/components/SpecialVideoGridSettingDialog.vue index 921b53a..5fae070 100644 --- a/src/components/SpecialVideoGridSettingDialog.vue +++ b/src/components/SpecialVideoGridSettingDialog.vue @@ -51,6 +51,16 @@ + + + + + + @@ -104,12 +114,21 @@ export default defineComponent({ const select_options = ["1X3", "1X4", "3X1", "4X1"]; const row_values = [1, 1, 3, 4]; const col_values = [3, 4, 1, 1]; + const rotation_options = ref(["0", "90", "180"]); + const rotation = ref("0"); + + rotation.value = + GlobalData.getInstance()?.applicationConfig + ?.special_video_layout_rotation ?? "0"; return { show_dialog, loading, layout, select_options, + rotation_options, + rotation, + showDialog() { show_dialog.value = true; @@ -134,6 +153,10 @@ export default defineComponent({ if (!v) { layout.value = "1X4"; } + + rotation.value = + GlobalData.getInstance()?.applicationConfig + ?.special_video_layout_rotation ?? "0"; }, resetData() { loading.value = false; @@ -148,6 +171,20 @@ export default defineComponent({ GlobalData.getInstance() .getCurrentClient() ?.setWallRowCol(row_values[index], col_values[index]); + switch (rotation.value) { + case "0": + case "90": + case "180": + GlobalData.getInstance() + .getCurrentClient() + ?.setSpecialVideoLayoutRotation(rotation.value ?? "0"); + break; + default: + GlobalData.getInstance() + .getCurrentClient() + ?.setSpecialVideoLayoutRotation("0"); + break; + } } show_dialog.value = false; diff --git a/src/entities/ApplicationConfigEntity.ts b/src/entities/ApplicationConfigEntity.ts index e26ac80..a2559be 100644 --- a/src/entities/ApplicationConfigEntity.ts +++ b/src/entities/ApplicationConfigEntity.ts @@ -35,4 +35,5 @@ export default class ApplicationConfigEntity { device_hdmi_output_count = 1; video_suffix_filter: string | null = ""; image_suffix_filter: string | null = ""; + special_video_layout_rotation: string | undefined = "0"; } diff --git a/src/i18n/zh-CN/index.ts b/src/i18n/zh-CN/index.ts index 760fcd4..8b4dd8a 100644 --- a/src/i18n/zh-CN/index.ts +++ b/src/i18n/zh-CN/index.ts @@ -598,7 +598,7 @@ export default { "主机名只能由数字、字母和_-组成", "Custom ISV": "优霸定制", "are you sure power off device": "确定关机吗", - "are you sure to change the http port": "确定重启吗", + "are you sure to change the http port": "确定修改HTTP端口吗", "the new http port takes effect after the software is restarted": "新的Http端口将在重启软件后生效", "are you sure to change the control port": "确定要修改控制端口吗",