|
|
|
@ -466,7 +466,17 @@ const toggleCircuit = (circuitName) => {
|
|
|
|
if (!info.value.disable) return ElMessage.warning('请切换至手动模式')
|
|
|
|
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
|
|
|
|
ElMessageBox.confirm(
|
|
|
|
|
|
|
|
`确认${circuit.is_open ? '关' : '开'}灯?`,
|
|
|
|
|
|
|
|
'提示',
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
confirmButtonText: '确认',
|
|
|
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
|
|
|
type: 'warning',
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
).then(() => {
|
|
|
|
|
|
|
|
circuit.is_open = !circuit.is_open
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -506,8 +516,18 @@ const openGlobalBrightnessDialog = () => {
|
|
|
|
// 全开灯光
|
|
|
|
// 全开灯光
|
|
|
|
const openLightSettings = () => {
|
|
|
|
const openLightSettings = () => {
|
|
|
|
if (!info.value.disable) return ElMessage.warning('请切换至手动模式')
|
|
|
|
if (!info.value.disable) return ElMessage.warning('请切换至手动模式')
|
|
|
|
info.value.loops.forEach(circuit => {
|
|
|
|
ElMessageBox.confirm(
|
|
|
|
circuit.is_open = true
|
|
|
|
`确认全开?`,
|
|
|
|
|
|
|
|
'提示',
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
confirmButtonText: '确认',
|
|
|
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
|
|
|
type: 'warning',
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
).then(() => {
|
|
|
|
|
|
|
|
info.value.loops.forEach(circuit => {
|
|
|
|
|
|
|
|
circuit.is_open = true
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// dimmingChannels.value.forEach(channel => {
|
|
|
|
// dimmingChannels.value.forEach(channel => {
|
|
|
|
// channel.brightness = 100
|
|
|
|
// channel.brightness = 100
|
|
|
|
@ -517,8 +537,18 @@ const openLightSettings = () => {
|
|
|
|
// 全关灯光
|
|
|
|
// 全关灯光
|
|
|
|
const turnOffAll = () => {
|
|
|
|
const turnOffAll = () => {
|
|
|
|
if (!info.value.disable) return ElMessage.warning('请切换至手动模式')
|
|
|
|
if (!info.value.disable) return ElMessage.warning('请切换至手动模式')
|
|
|
|
info.value.loops.forEach(circuit => {
|
|
|
|
ElMessageBox.confirm(
|
|
|
|
circuit.is_open = false
|
|
|
|
`确认全关?`,
|
|
|
|
|
|
|
|
'提示',
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
confirmButtonText: '确认',
|
|
|
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
|
|
|
type: 'warning',
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
).then(() => {
|
|
|
|
|
|
|
|
info.value.loops.forEach(circuit => {
|
|
|
|
|
|
|
|
circuit.is_open = false
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// dimmingChannels.value.forEach(channel => {
|
|
|
|
// dimmingChannels.value.forEach(channel => {
|
|
|
|
// channel.brightness = 0
|
|
|
|
// channel.brightness = 0
|
|
|
|
@ -558,14 +588,13 @@ const changeMode = () => {
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
type: 'warning',
|
|
|
|
type: 'warning',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
).then(() => {
|
|
|
|
.then(() => {
|
|
|
|
info.value.disable = !info.value.disable
|
|
|
|
info.value.disable = !info.value.disable
|
|
|
|
// ElMessage({
|
|
|
|
// ElMessage({
|
|
|
|
// type: 'success',
|
|
|
|
// type: 'success',
|
|
|
|
// message: `切换${info.value.disable ? '手动' : '自动'}成功`,
|
|
|
|
// message: `切换${info.value.disable ? '手动' : '自动'}成功`,
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let timeInterval = null
|
|
|
|
let timeInterval = null
|
|
|
|
|