From ab2196c56c9b22b0d8b0e046ca21542720de82c8 Mon Sep 17 00:00:00 2001 From: Lufaneng Date: Sun, 7 Sep 2025 00:25:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=93=8D=E4=BD=9C=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/HandleControl/index.vue | 55 +++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 13 deletions(-) diff --git a/src/views/HandleControl/index.vue b/src/views/HandleControl/index.vue index 07650d7..a7c4e7b 100644 --- a/src/views/HandleControl/index.vue +++ b/src/views/HandleControl/index.vue @@ -466,7 +466,17 @@ const toggleCircuit = (circuitName) => { if (!info.value.disable) return ElMessage.warning('请切换至手动模式') const circuit = info.value.loops.find(c => c.name === circuitName) if (circuit) { - circuit.is_open = !circuit.is_open + ElMessageBox.confirm( + `确认${circuit.is_open ? '关' : '开'}灯?`, + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + } + ).then(() => { + circuit.is_open = !circuit.is_open + }) } } @@ -506,8 +516,18 @@ const openGlobalBrightnessDialog = () => { // 全开灯光 const openLightSettings = () => { if (!info.value.disable) return ElMessage.warning('请切换至手动模式') - info.value.loops.forEach(circuit => { - circuit.is_open = true + ElMessageBox.confirm( + `确认全开?`, + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + } + ).then(() => { + info.value.loops.forEach(circuit => { + circuit.is_open = true + }) }) // dimmingChannels.value.forEach(channel => { // channel.brightness = 100 @@ -517,8 +537,18 @@ const openLightSettings = () => { // 全关灯光 const turnOffAll = () => { if (!info.value.disable) return ElMessage.warning('请切换至手动模式') - info.value.loops.forEach(circuit => { - circuit.is_open = false + ElMessageBox.confirm( + `确认全关?`, + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + } + ).then(() => { + info.value.loops.forEach(circuit => { + circuit.is_open = false + }) }) // dimmingChannels.value.forEach(channel => { // channel.brightness = 0 @@ -558,14 +588,13 @@ const changeMode = () => { cancelButtonText: '取消', type: 'warning', } - ) - .then(() => { - info.value.disable = !info.value.disable - // ElMessage({ - // type: 'success', - // message: `切换${info.value.disable ? '手动' : '自动'}成功`, - // }) - }) + ).then(() => { + info.value.disable = !info.value.disable + // ElMessage({ + // type: 'success', + // message: `切换${info.value.disable ? '手动' : '自动'}成功`, + // }) + }) } let timeInterval = null