From b3507de614d724b689010fd4049b255fefbfb561 Mon Sep 17 00:00:00 2001 From: fangxiang Date: Wed, 22 Dec 2021 19:44:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=9F=B3=E9=87=8F=E8=B0=83?= =?UTF-8?q?=E8=8A=82=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/ClientConnection.ts | 10 +++- src/components/EditVolumeDialog.vue | 72 ++++++++++++++++++++++++++ src/components/ModeDialog.vue | 1 - src/components/PlanDialog.vue | 1 - src/components/Window.vue | 45 ++++++++++++---- src/entities/MultimediaWindowEntity.ts | 4 ++ src/entities/WSProtocol.ts | 30 +++++++++++ src/i18n/zh-CN/index.ts | 3 ++ src/pages/WallPage.vue | 31 ++++++++++- 9 files changed, 184 insertions(+), 13 deletions(-) create mode 100644 src/components/EditVolumeDialog.vue diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index ff9dcab..a4c5ab8 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -426,7 +426,6 @@ export default class ClientConnection { public async addMode(group_uuid?: string, name?: string, index?: number) { try { - console.log(index); return await this.doRpc( new Protocol.AddModeRequestEntity(0, name, group_uuid, index) ); @@ -626,6 +625,15 @@ export default class ClientConnection { console.error(e); } } + public async setWindowVolume(window_id: number, volume: number) { + try { + return await this.doRpc( + new Protocol.SetWindowVolumeRequestEntity(window_id, volume, 0) + ); + } catch (e) { + console.error(e); + } + } public restartDevice(delay_ms?: number) { this.ws?.send( diff --git a/src/components/EditVolumeDialog.vue b/src/components/EditVolumeDialog.vue new file mode 100644 index 0000000..0622902 --- /dev/null +++ b/src/components/EditVolumeDialog.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/src/components/ModeDialog.vue b/src/components/ModeDialog.vue index ecc1c0b..104709d 100644 --- a/src/components/ModeDialog.vue +++ b/src/components/ModeDialog.vue @@ -257,7 +257,6 @@ export default defineComponent({ tree_nodes, showDialog(options: any) { if (options) { - console.log(options); type.value = options.type ?? 1; if (type.value == 2) { name.value = options.data?.name ?? null; diff --git a/src/components/PlanDialog.vue b/src/components/PlanDialog.vue index fdc0c75..9f2e749 100644 --- a/src/components/PlanDialog.vue +++ b/src/components/PlanDialog.vue @@ -520,7 +520,6 @@ export default defineComponent({ timing_cycle.value = $t.t("disable"); week_days.value = EWeekDays.EWeekAll; if (type.value == 2) { - console.log(options); name.value = options.data?.name ?? $t.t("new plan 1"); selected.value = options.data?.item_data?.group_uuid ?? null; uuid.value = options.data?.item_data?.uuid ?? null; diff --git a/src/components/Window.vue b/src/components/Window.vue index f3ba5f8..1ae883e 100644 --- a/src/components/Window.vue +++ b/src/components/Window.vue @@ -13,11 +13,28 @@ @mouseup="onMouseLeave" > - + {{ $t("edit volume") }} + + + {{ $t("mute") }} + + {{ $t("close this window") }} @@ -25,6 +42,7 @@ @@ -34,6 +52,7 @@ {{ $t("close all windwos") }} @@ -46,7 +65,7 @@
+