From d1e131f2df07f0b3d35cf1ec05a2afe591b916ef Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Mon, 19 Jan 2026 22:57:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8E=A7=E5=88=B6=E5=99=A8=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/other/index.vue | 242 +++++++++++++++++++++++++-------- 1 file changed, 183 insertions(+), 59 deletions(-) diff --git a/src/components/other/index.vue b/src/components/other/index.vue index 69d3116..c53444f 100644 --- a/src/components/other/index.vue +++ b/src/components/other/index.vue @@ -422,73 +422,50 @@ :gutter="10" v-for="item in controlList" :key="item.id" - @click="setControl(item)" + class="controller-item" > - - - - - - {{ item.deviceName }} - - {{ - item.errorMessage - }} - - - + + + + + {{ item.deviceName }} + {{ item.errorMessage }} + + + 参数设置 + + - - - - - {{ - switchRes(item.listSwitch, 1, "switchName") - }} - - - - {{ - switchRes(item.listSwitch, 2, "switchName") - }} - - - - {{ - switchRes(item.listSwitch, 3, "switchName") - }} - - - - {{ - switchRes(item.listSwitch, 4, "switchName") - }} - - + + + + + + + {{ switchItem.switchName }} + + + + 设置 + + + @@ -1746,6 +1723,61 @@ function switchRes(list, index, type) { return "开关" + index; } } + +// 获取单个开关图标 +function getSwitchIcon(switchItem: any) { + const isLinkedCtrl = switchItem.isLinkedCtrl || 0; + const isTimingCtrl = switchItem.isTimingCtrl || 0; + const isOpen = switchItem.isOpen || 0; + const hasErrorCode = switchItem.hasErrorCode || 0; + + // 同时开启定时和联动 + if (isTimingCtrl && isLinkedCtrl) { + if (!isOpen) { + return c4_n; + } else { + if (hasErrorCode) { + return c4_d; + } else { + return c4; + } + } + } + // 只开启联动 + if (isLinkedCtrl) { + if (!isOpen) { + return c2_n; + } else { + if (hasErrorCode) { + return c2_d; + } else { + return c2; + } + } + } + // 只开启定时 + if (isTimingCtrl) { + if (!isOpen) { + return c1_n; + } else { + if (hasErrorCode) { + return c1_d; + } else { + return c1; + } + } + } + // 普通开关 + if (!isOpen) { + return c3_n; + } else { + if (hasErrorCode) { + return c3_d; + } else { + return c3; + } + } +} // 控制器弹出层 function setControl(item) { visControl.value = true; @@ -2194,4 +2226,96 @@ defineExpose({ } } } + +// 控制器区域样式 +.controller-item { + margin-bottom: 10px; + + .controller-header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 12px 0; + + .controller-name { + font-size: 30px; + font-weight: 600; + color: #222; + display: flex; + align-items: center; + gap: 10px; + + .error-tag { + font-size: 24px; + font-weight: 400; + color: #bf290e; + background: rgba(191, 41, 14, 0.1); + padding: 4px 12px; + border-radius: 4px; + } + } + + .controller-actions { + .param-setting-link { + font-size: 28px; + color: #1589E9; + cursor: pointer; + transition: opacity 0.2s ease; + + &:active { + opacity: 0.7; + } + } + } + } + + .switch-item { + display: flex; + align-items: center; + justify-content: space-between; + padding: 15px 0; + border-bottom: 1px solid #f5f5f5; + + &:last-child { + border-bottom: none; + } + + .switch-left { + flex: 1; + display: flex; + align-items: center; + gap: 12px; + + .switch-icon { + width: 40px; + height: 40px; + flex-shrink: 0; + } + + .switch-name { + font-size: 28px; + color: #333; + font-weight: 500; + } + } + + .switch-right { + display: flex; + align-items: center; + gap: 20px; + + .switch-setting-link { + font-size: 28px; + color: #1589E9; + cursor: pointer; + white-space: nowrap; + transition: opacity 0.2s ease; + + &:active { + opacity: 0.7; + } + } + } + } +}