接口对接1

main
Lufaneng 1 year ago
parent 0af47c838e
commit 3f7417b6e2

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

Loading…
Cancel
Save