修改控制

This commit is contained in:
jingna 2026-06-26 13:54:57 +08:00
parent 5b38bf9c91
commit 1eb94aed9b

View File

@ -8,7 +8,7 @@ const { state, bootstrap } = usePlatformStore()
const inputStates = computed(() => {
if (!state.realtime?.switch) {
return [false, false, false, false, false, false, false, false, false, false, false, false]
return [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
}
return Array.from({ length: 12 }, (_, i) => {
const key = `di${i + 1}`
@ -18,7 +18,7 @@ const inputStates = computed(() => {
const outputStates = computed(() => {
if (!state.realtime?.switch) {
return [false, false, false, false, false, false, false, false, false, false, false, false]
return [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
}
return Array.from({ length: 12 }, (_, i) => {
const key = `do${i + 1}`
@ -89,9 +89,9 @@ onMounted(() => {
</div>
<div class="state-grid">
<div v-for="(state, index) in inputStates" :key="`input-${index}`" class="state-item">
<img v-if="state" src="@/assets/images/menuicon/off.png" style="width: 34px; height: 36px;"
<img v-if="state === 1" src="@/assets/images/menuicon/on.png" style="width: 34px; height: 36px;"
alt="">
<img v-else src="@/assets/images/menuicon/on.png" alt=""
<img v-else src="@/assets/images/menuicon/off.png" alt=""
style="width: 34px; height: 36px;">
<div class="label">开入{{ index + 1 }}</div>
</div>
@ -104,9 +104,9 @@ onMounted(() => {
</div>
<div class="state-grid">
<div v-for="(state, index) in outputStates" :key="`output-${index}`" class="state-item" >
<img v-if="state" src="@/assets/images/menuicon/off2.png" @click="outputChange(state,index)" style="width: 46px; height: 24px;cursor: pointer;"
<img v-if="state === 1" src="@/assets/images/menuicon/on2.png" @click="outputChange(state,index)" style="width: 46px; height: 24px;cursor: pointer;"
alt="">
<img v-else src="@/assets/images/menuicon/on2.png" @click="outputChange(state,index)" style="width: 46px; height: 24px;cursor: pointer;"
<img v-else src="@/assets/images/menuicon/off2.png" @click="outputChange(state,index)" style="width: 46px; height: 24px;cursor: pointer;"
alt="">
<div class="label">开出{{ index + 1 }}</div>
</div>