From e8a7beb5455d0c9f50f93004b600dd2781ad6bfd Mon Sep 17 00:00:00 2001 From: baoshiwei <baoshiwei@shlanbao.cn> Date: 星期一, 30 六月 2025 09:36:56 +0800 Subject: [PATCH] feat(空调控制): 实现空调控制功能并优化 SVG 数据加载- 新增 AirCondConstants 类,定义空调控制常量 - 修改 AirConditionerServiceImpl,使用常量替代硬编码值 - 更新 MQTT 消息发送逻辑,使用常量定义主题 - 优化 SVG 数据加载和处理逻辑,改进标签值更新方式 - 调整域名地址配置,支持生产环境 API --- zhitan-vue/src/views/powerquality/load/index.vue | 22 +++++++++++++++++++--- 1 files changed, 19 insertions(+), 3 deletions(-) diff --git a/zhitan-vue/src/views/powerquality/load/index.vue b/zhitan-vue/src/views/powerquality/load/index.vue index a386abe..7525bff 100644 --- a/zhitan-vue/src/views/powerquality/load/index.vue +++ b/zhitan-vue/src/views/powerquality/load/index.vue @@ -57,10 +57,10 @@ </el-form> </div> <div class="display-buttons"> - <div class="display-btn" @click="activeKey = 1" :class="{ 'active-display-btn': activeKey === 1 }"> + <div class="display-btn" @click="switchBtnType(1)" :class="{ 'active-display-btn': activeKey === 1 }"> 鍥惧舰 </div> - <div class="display-btn" @click="activeKey = 2" :class="{ 'active-display-btn': activeKey === 2 }"> + <div class="display-btn" @click="switchBtnType(2)" :class="{ 'active-display-btn': activeKey === 2 }"> 鏁版嵁 </div> </div> @@ -117,6 +117,7 @@ import { useRoute } from "vue-router" const { period } = proxy.useDict("period") import useSettingsStore from "@/store/modules/settings" +import {ElMessage} from "element-plus"; const settingsStore = useSettingsStore() watch( () => settingsStore.sideTheme, @@ -151,7 +152,9 @@ } }) queryParams.value.meterId = res.data.length > 0 ? res.data[0].code : "" - getList() + if (res.data.length > 0) { + getList() + } } }) } @@ -168,9 +171,22 @@ queryParams.value.dataTime = proxy.dayjs(new Date()).format("YYYY-MM-DD") getElectricityMeter({ nodeId: queryParams.value.nodeId }) } + +function switchBtnType(e) { + activeKey.value = e + if (e === 1) { + getList() + } +} + const LineChartRef = ref() function getList() { + if (!queryParams.value.meterId) { + ElMessage.error("璇烽�夋嫨鐢佃〃") + return + } loading.value = true + let params = { nodeId: queryParams.value.nodeId, timeType: queryParams.value.timeType, -- Gitblit v1.9.3