接口对接1

main
Lufaneng 1 year ago
parent 0af47c838e
commit 3f7417b6e2

@ -133,7 +133,7 @@
</el-icon> </el-icon>
切换模式 切换模式
</div> </div>
<el-button class="mode-button active">手动</el-button> <el-button class="mode-button active" @click="info.disable = !info.disable">{{ info.disable ? '手动' : '自动' }}</el-button>
</div> </div>
<!-- 灯控设置 --> <!-- 灯控设置 -->
@ -423,6 +423,7 @@ const updateTime = () => {
// //
const toggleCircuit = (circuitName) => { const toggleCircuit = (circuitName) => {
if (!info.value.disable) return ElMessage.warning('请切换至手动模式')
const circuit = info.value.loops.find(c => c.name === circuitName) const circuit = info.value.loops.find(c => c.name === circuitName)
if (circuit) { if (circuit) {
circuit.is_open = !circuit.is_open circuit.is_open = !circuit.is_open
@ -431,6 +432,7 @@ const toggleCircuit = (circuitName) => {
// //
const openBrightnessDialog = (channelName) => { const openBrightnessDialog = (channelName) => {
if (!info.value.disable) return ElMessage.warning('请切换至手动模式')
selectedChannelName.value = channelName selectedChannelName.value = channelName
const channel = info.value.loops.find(c => c.name === channelName) const channel = info.value.loops.find(c => c.name === channelName)
if (channel) { if (channel) {
@ -455,6 +457,7 @@ const confirmBrightness = () => {
// //
const openGlobalBrightnessDialog = () => { const openGlobalBrightnessDialog = () => {
if (!info.value.disable) return ElMessage.warning('请切换至手动模式')
selectedChannelName.value = null selectedChannelName.value = null
currentBrightness.value = 50 currentBrightness.value = 50
brightnessDialogVisible.value = true brightnessDialogVisible.value = true
@ -462,6 +465,7 @@ const openGlobalBrightnessDialog = () => {
// //
const openLightSettings = () => { const openLightSettings = () => {
if (!info.value.disable) return ElMessage.warning('请切换至手动模式')
info.value.loops.forEach(circuit => { info.value.loops.forEach(circuit => {
circuit.is_open = true circuit.is_open = true
}) })
@ -472,6 +476,7 @@ const openLightSettings = () => {
// //
const turnOffAll = () => { const turnOffAll = () => {
if (!info.value.disable) return ElMessage.warning('请切换至手动模式')
info.value.loops.forEach(circuit => { info.value.loops.forEach(circuit => {
circuit.is_open = false circuit.is_open = false
}) })

Loading…
Cancel
Save