|
@ -1,18 +1,52 @@ |
|
|
<template> |
|
|
<template> |
|
|
|
|
|
<!-- 分区部分 --> |
|
|
|
|
|
<div> |
|
|
|
|
|
<div class="light-area"> |
|
|
|
|
|
<div class="light-area-tab"></div> |
|
|
|
|
|
<span class="light-area-text"> 设备分区 </span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<!-- 照明区域按钮部分 --> |
|
|
|
|
|
<div class="area"> |
|
|
|
|
|
<template v-if="!showAllButtonsArea"> |
|
|
|
|
|
<button |
|
|
|
|
|
v-for="(button, index) in limitedButtons1" |
|
|
|
|
|
:key="index" |
|
|
|
|
|
:class="{ btn: true, selected: button.selected }" |
|
|
|
|
|
@click="changeArea(button)"> |
|
|
|
|
|
{{ button.name }} |
|
|
|
|
|
</button> |
|
|
|
|
|
<div style="margin-top: 10px"> |
|
|
|
|
|
<span @click="showAllButtonsArea = true" class="openzm"><down-outlined /> 展开</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
</template> |
|
|
|
|
|
<template v-else> |
|
|
|
|
|
<button |
|
|
|
|
|
v-for="(button, index) in props.treeData" |
|
|
|
|
|
:key="index" |
|
|
|
|
|
:class="{ btn: true, selected: button.selected }" |
|
|
|
|
|
@click="changeArea(button)"> |
|
|
|
|
|
{{ button.name }} |
|
|
|
|
|
</button> |
|
|
|
|
|
<div style="margin-top: 10px"> |
|
|
|
|
|
<span @click="showAllButtonsArea = false" class="openzm"><up-outlined /> 回缩</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
</template> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
<!-- 设备部分 --> |
|
|
<!-- 设备部分 --> |
|
|
<div> |
|
|
<div> |
|
|
<div class="circuit-area"> |
|
|
<div class="circuit-area"> |
|
|
<div class="circuit-tab"></div> |
|
|
<div class="circuit-tab"></div> |
|
|
<span class="circuit-text">{{ props.type }}</span> |
|
|
<span class="circuit-text">{{ props.type }}</span> |
|
|
<div class="btn2"> |
|
|
<div class="btn2"> |
|
|
<a-badge :offset="[-10, 2]" :count="lockList.length"> |
|
|
<!-- <a-badge :offset="[-10, 2]" :count="lockList.length"> |
|
|
<button |
|
|
<button |
|
|
class="openPlan" |
|
|
class="openPlan" |
|
|
:class="{ enabled2: isPlanEnabled2, disabled2: !isPlanEnabled2 }" |
|
|
:class="{ enabled2: isPlanEnabled2, disabled2: !isPlanEnabled2 }" |
|
|
@click="togglePlan2"> |
|
|
@click="togglePlan2"> |
|
|
{{ isPlanEnabled2 ? '启用开关' : '禁用开关' }} |
|
|
{{ isPlanEnabled2 ? '启用开关' : '禁用开关' }} |
|
|
</button> |
|
|
</button> |
|
|
</a-badge> |
|
|
</a-badge> --> |
|
|
<a-switch |
|
|
<a-switch |
|
|
v-model:checked="selectAllCheckbox" |
|
|
v-model:checked="selectAllCheckbox" |
|
|
:disabled="singleSelection" |
|
|
:disabled="singleSelection" |
|
@ -35,9 +69,9 @@ |
|
|
:class="{ btn: true, selected: button.selected }" |
|
|
:class="{ btn: true, selected: button.selected }" |
|
|
class="zmhlbtn" |
|
|
class="zmhlbtn" |
|
|
@click="changeLine(button)"> |
|
|
@click="changeLine(button)"> |
|
|
<div v-if="button.lockStatus" class="btn-back"> |
|
|
<!-- <div v-if="button.lockStatus" class="btn-back"> |
|
|
<stop-outlined /> |
|
|
<stop-outlined /> |
|
|
</div> |
|
|
</div> --> |
|
|
{{ button.name }} |
|
|
{{ button.name }} |
|
|
</button> |
|
|
</button> |
|
|
<div style="margin-top: 10px"> |
|
|
<div style="margin-top: 10px"> |
|
@ -147,9 +181,13 @@ |
|
|
<div class="btn-item"> |
|
|
<div class="btn-item"> |
|
|
<div class="left">控制模式</div> |
|
|
<div class="left">控制模式</div> |
|
|
<div class="right"> |
|
|
<div class="right"> |
|
|
<span>{{ item.stateBefore.autoStatus.label.replace('模式', '') }}</span> |
|
|
<span>{{ |
|
|
|
|
|
item.stateBefore.autoStatus.label ? item.stateBefore.autoStatus.label : '--' |
|
|
|
|
|
}}</span> |
|
|
<img src="/asset/image/bulbLogo/22406.png" alt="" /> |
|
|
<img src="/asset/image/bulbLogo/22406.png" alt="" /> |
|
|
<span>{{ item.stateAfter.autoStatus.label.replace('模式', '') }}</span></div |
|
|
<span>{{ |
|
|
|
|
|
item.stateAfter.autoStatus.label ? item.stateAfter.autoStatus.label : '--' |
|
|
|
|
|
}}</span></div |
|
|
> |
|
|
> |
|
|
</div> |
|
|
</div> |
|
|
<div class="btn-item"> |
|
|
<div class="btn-item"> |
|
@ -297,6 +335,29 @@ |
|
|
*/ |
|
|
*/ |
|
|
const emit = defineEmits(['reset', 'reload', 'resetAll']); |
|
|
const emit = defineEmits(['reset', 'reload', 'resetAll']); |
|
|
|
|
|
|
|
|
|
|
|
// 设备分区业务 ===================================================================== |
|
|
|
|
|
|
|
|
|
|
|
// 按钮区展开与收起状态 |
|
|
|
|
|
const showAllButtonsArea = ref(false); |
|
|
|
|
|
// 被选中的分区 默认为1 用于选中样式渲染 |
|
|
|
|
|
const selectedButton = ref<string | undefined>('1'); |
|
|
|
|
|
|
|
|
|
|
|
// 分区切换 |
|
|
|
|
|
const changeArea = (button: any) => { |
|
|
|
|
|
// 当前选中按钮 |
|
|
|
|
|
selectedButton.value = button.id; |
|
|
|
|
|
// 设置当前选中的回路 |
|
|
|
|
|
buttons2.value = button.childList; |
|
|
|
|
|
// 重置按钮状态 |
|
|
|
|
|
emit('reset'); |
|
|
|
|
|
// 设置选中按钮状态 |
|
|
|
|
|
button.selected = true; |
|
|
|
|
|
// 当前选中回路 - 置空 |
|
|
|
|
|
resetMode(); |
|
|
|
|
|
}; |
|
|
|
|
|
// 默认最多展示8个按钮 |
|
|
|
|
|
const limitedButtons1 = computed(() => props.treeData.slice(0, 8)); |
|
|
|
|
|
|
|
|
// 照明回路业务 ====================================================================== |
|
|
// 照明回路业务 ====================================================================== |
|
|
|
|
|
|
|
|
// 开关启用/禁用状态 |
|
|
// 开关启用/禁用状态 |
|
@ -374,7 +435,6 @@ |
|
|
const selectAllCheckbox = ref(false); |
|
|
const selectAllCheckbox = ref(false); |
|
|
// 全选切换事件(switch) |
|
|
// 全选切换事件(switch) |
|
|
const toggleAllSelection = () => { |
|
|
const toggleAllSelection = () => { |
|
|
let arr = []; |
|
|
|
|
|
// 全选 |
|
|
// 全选 |
|
|
if (selectAllCheckbox.value) { |
|
|
if (selectAllCheckbox.value) { |
|
|
buttons2.value.forEach((item: any, index: number) => { |
|
|
buttons2.value.forEach((item: any, index: number) => { |
|
@ -383,7 +443,6 @@ |
|
|
thisButton2.value = item; |
|
|
thisButton2.value = item; |
|
|
} |
|
|
} |
|
|
item.selected = true; |
|
|
item.selected = true; |
|
|
arr.push(item.id); |
|
|
|
|
|
}); |
|
|
}); |
|
|
// 全不选 |
|
|
// 全不选 |
|
|
} else { |
|
|
} else { |
|
@ -618,6 +677,8 @@ |
|
|
const refresh = (reload = false) => { |
|
|
const refresh = (reload = false) => { |
|
|
// 关闭执行弹窗 |
|
|
// 关闭执行弹窗 |
|
|
executeVisible.value = false; |
|
|
executeVisible.value = false; |
|
|
|
|
|
// 设置当前选中的序列 |
|
|
|
|
|
selectedButton.value = '1'; |
|
|
// 重置选中样式 和 按钮选中状态 |
|
|
// 重置选中样式 和 按钮选中状态 |
|
|
emit('reset'); |
|
|
emit('reset'); |
|
|
// 如果是中途刷新,需要将所有修改改回 |
|
|
// 如果是中途刷新,需要将所有修改改回 |
|
|