From f02cad430f8be3025901359d71f8da8fc69a4193 Mon Sep 17 00:00:00 2001 From: fangxiang Date: Thu, 7 Jul 2022 14:49:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E9=9C=B8=E5=AE=9A=E5=88=B6=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=A4=A9=E6=B0=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SignalSourceDialog.vue | 36 ++++++++++++++++++++------- src/i18n/en-US/index.ts | 2 +- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/components/SignalSourceDialog.vue b/src/components/SignalSourceDialog.vue index a4b114c..9f66ab8 100644 --- a/src/components/SignalSourceDialog.vue +++ b/src/components/SignalSourceDialog.vue @@ -399,15 +399,33 @@ export default defineComponent({ }, ]; - if ( - ($store.state.device_attribute & Protocol.EDeviceAttribute.CustomISV) != - 0 - ) { - signal_source_options.push({ - label: $t.t("weather"), - value: "EwindowType::Weather", - }); - } + const refresh_signal_source_options = () => { + if ( + ($store.state.device_attribute & Protocol.EDeviceAttribute.CustomISV) == + 0 + ) { + signal_source_options.push({ + label: $t.t("weather"), + value: "EwindowType::Weather", + }); + } else { + const index = signal_source_options.findIndex( + (element) => element && element.value == "EwindowType::Weather" + ); + if (index != -1) { + signal_source_options.splice(index, 1); + } + } + }; + + refresh_signal_source_options(); + + watch( + () => $store.state.device_attribute, + (value) => { + refresh_signal_source_options(); + } + ); const tree_nodes = computed({ get: () => $store.state.signal_source_tree, diff --git a/src/i18n/en-US/index.ts b/src/i18n/en-US/index.ts index 553169d..0fd651c 100644 --- a/src/i18n/en-US/index.ts +++ b/src/i18n/en-US/index.ts @@ -157,7 +157,7 @@ export default { "select rootfs upgrade file": "Select Rootfs Upgrade File", "network setting": "Network Setting", "output setting": "Output Setting", - "timing task": "Timing Task", + "timing task": " Timing Task", other: "Other", "auto ip": "Auto IP", "ip address": "Ip Address",