7 Revize c2d6e568ba ... b55685b8a2

Autor SHA1 Zpráva Datum
  wangcong b55685b8a2 feat(views): 优化设备工况卡片数值小数位的精度 před 1 týdnem
  wangshun 0213b025d5 perf(views): 修复“选择网关参数”步骤分组显示异常问题 před 1 týdnem
  wangcong b72dec41a4 chore(utils): 添加禁止选择超过今天的日期的函数 před 1 týdnem
  wangshun 4cdc380c9d perf(views): 修复"设备详情"编辑功能导致列表查询异常问题 před 1 týdnem
  wangshun 0a20f9d212 perf(views): 修复“选择网关参数”步骤取消参数勾选显示异常问题 před 1 týdnem
  wangcong 519b0e5f13 perf(views): 优化“设备工况”模块参数的历史数据曲线 před 1 týdnem
  wangshun 1c09e21411 perf(views): 添加"算法管理"模块COP算法功能 před 1 týdnem

+ 8 - 0
src/api/index.ts

@@ -33,6 +33,7 @@ import type {
   CoolingStatisticsResult,
   CustomParameters,
   DeviceBindQuery,
+  DeviceCop,
   DeviceGroup,
   DeviceGroupItem,
   DeviceGroupListQuery,
@@ -579,6 +580,13 @@ export const getDeviceListOptions = async (deviceId: number) => {
   return data;
 };
 
+export const updateDeviceCop = async (params: DeviceCop[]) => {
+  await request(apiBiz('/device/update'), {
+    method: 'POST',
+    body: JSON.stringify(params),
+  });
+};
+
 // 设备工况
 
 export const getDevWorkTypeCount = async (deviceGroupId: number, deviceTypes: number[]) => {

+ 31 - 0
src/types/index.ts

@@ -2104,6 +2104,31 @@ export interface AlgorithmConfigInfo extends AlgorithmForm {
   chilledWaterOutletTempRangeList: TemperatureRangeItem[];
   chilledWaterOutletTempRange?: string;
   chilledWaterOutletTempSet: string;
+  deviceCOPList: DeviceCopItem[];
+  deviceCopUpdateDTOS: { deviceId: number; enableCopSet: boolean }[];
+}
+
+export interface DeviceCopItem {
+  id: number;
+  createTime: string;
+  updateTime: string;
+  createUserId: number;
+  updateUserId: number;
+  deviceName: string;
+  groupId: number;
+  deviceType: number;
+  userId: number;
+  brand: string;
+  model: string;
+  productionDate: string;
+  status: number;
+  deleted: number;
+  runningStatus: number;
+  errorStatus: number;
+  orgId: number;
+  deviceDetail: string;
+  addingToAlg: boolean;
+  enableCopSet: boolean;
 }
 
 export interface OrgDeviceLimit {
@@ -2457,3 +2482,9 @@ export interface CharacterParams {
   roleName: string;
   orgId?: number;
 }
+
+export interface DeviceCop {
+  id: number;
+  enableCopSet: boolean;
+  deviceName?: string;
+}

+ 19 - 0
src/utils/index.ts

@@ -8,6 +8,7 @@ import { fetchWithTimeout } from './fetch';
 
 import type { SorterResult } from 'ant-design-vue/es/table/interface';
 import type { GlobalToken } from 'ant-design-vue/es/theme';
+import type { Dayjs } from 'dayjs';
 import type { ApiResponse, PageSorts } from '@/types';
 
 export const request = async <T>(url: string, init: RequestInit = {}, timeout?: number): Promise<T> => {
@@ -272,3 +273,21 @@ export const isEmptyVal = (value: unknown) => {
 export const isNotEmptyVal = (value: unknown) => {
   return value !== undefined && value !== null;
 };
+
+export const disabledDate = (current: Dayjs) => {
+  return current > dayjs().endOf('day');
+};
+
+export const getFixedNum = (value: number | string | null | undefined, decimalPlaces: number = 2) => {
+  if (value === undefined || value === null || value === '') {
+    return '-';
+  }
+
+  const num = Number(value);
+
+  if (isNaN(num)) {
+    return '-';
+  }
+
+  return num.toFixed(decimalPlaces);
+};

+ 48 - 3
src/views/algorithm-manage/AlgorithmEditing.vue

@@ -14,7 +14,14 @@ import MonthSetting from './MonthSetting.vue';
 import SetInterval from './SetInterval.vue';
 
 import type { FormInstance, Rule } from 'ant-design-vue/es/form';
-import type { AlgorithmConfigInfo, AlgorithmForm, ChillersItem, TemperatureRange, TemperatureRangeItem } from '@/types';
+import type {
+  AlgorithmConfigInfo,
+  AlgorithmForm,
+  ChillersItem,
+  DeviceCop,
+  TemperatureRange,
+  TemperatureRangeItem,
+} from '@/types';
 
 const { dictData: algTempCtrlMinStep, getDictData: getAlgTempCtrlMinStep } = useDictData(DictCode.AlgTempCtrlMinStep);
 const { dictData: algTempHumCollectPeriod, getDictData: getAlgTempHumCollectPeriod } = useDictData(
@@ -46,6 +53,7 @@ const temperatureRangeList = ref<TemperatureRange[]>([]);
 const chillersList = ref<ChillersItem[]>([]);
 const algorithmId = ref<number>();
 const groupId = ref<number>();
+const deviceCopItem = ref<DeviceCop[]>([]);
 const algorithmForm = ref<AlgorithmForm>({
   enabled: false,
   sendCtrlCmd: true,
@@ -97,6 +105,7 @@ const rules: Record<string, Rule[]> = {
 const editorAlgorithmChange = (info: AlgorithmConfigInfo) => {
   temperatureRangeList.value = [];
   chillersList.value = [];
+  deviceCopItem.value = [];
   const {
     id: algId,
     enabled,
@@ -125,7 +134,17 @@ const editorAlgorithmChange = (info: AlgorithmConfigInfo) => {
     chilledWaterOutletTempRangeList,
     chilledWaterOutletTempSet,
     devGroupId,
+    deviceCOPList,
   } = info;
+  deviceCOPList.forEach((item) => {
+    const { id, enableCopSet, deviceName } = item;
+    deviceCopItem.value.push({
+      id,
+      enableCopSet,
+      deviceName,
+    });
+  });
+
   groupId.value = devGroupId;
   algorithmId.value = algId;
   Object.assign(algorithmForm.value, {
@@ -271,14 +290,23 @@ const addAlgorithm = async () => {
           upper,
         });
       });
-
+      const deviceCopList: { deviceId: number; enableCopSet: boolean }[] = [];
+      deviceCopItem.value.forEach((item) => {
+        const { id, enableCopSet } = item;
+        deviceCopList.push({
+          deviceId: id,
+          enableCopSet,
+        });
+      });
       await addAlgorithmConfigUpdate({
         ...algorithmForm.value,
         id: algorithmId.value,
         chillers: chillersList.value,
         chilledWaterOutletTempRangeList: timeList,
         chilledWaterOutletTempSet: monthSettingRefs.value ? monthSettingRefs.value.stringConversion() : '',
+        deviceCopUpdateDTOS: deviceCopList,
       });
+
       if (groupId.value) {
         emit('confirmClick', groupId.value);
       }
@@ -499,7 +527,7 @@ onMounted(() => {
               <ASwitch class="analysis-margin" v-model:checked="algorithmForm.analysis" />
               <div @click="analysisEditor" class="editor-style">{{ $t('common.editor') }}</div>
             </AFlex>
-            <AFlex align="center">
+            <AFlex align="center" class="system-functions">
               <div class="div-width">{{ $t('algorithmManage.dynamicAdjustment') }}</div>
               <AFlex align="center" class="adjustment-div">
                 <div class="adjustment-text">{{ $t('algorithmManage.freezingSetValue') }}</div>
@@ -509,6 +537,15 @@ onMounted(() => {
                 <div @click="setEditor" class="editor-style editor-left">{{ $t('common.editor') }}</div>
               </AFlex>
             </AFlex>
+            <AFlex align="center">
+              <div class="div-width">{{ t('algorithmManage.copAlgorithm') }}</div>
+              <AFlex align="center" class="adjustment-div" wrap="wrap">
+                <AFlex v-for="item in deviceCopItem" :key="item.id" class="adjustment-right">
+                  <div>{{ item.deviceName }}:&nbsp;&nbsp;&nbsp;</div>
+                  <ASwitch v-model:checked="item.enableCopSet" />
+                </AFlex>
+              </AFlex>
+            </AFlex>
           </div>
         </ACollapsePanel>
       </ACollapse>
@@ -586,6 +623,14 @@ onMounted(() => {
 </template>
 
 <style lang="scss" scoped>
+.system-functions {
+  margin-bottom: 16px;
+}
+
+.adjustment-right {
+  margin-right: 40px;
+}
+
 .button-width {
   width: 128px;
   height: 40px;

+ 16 - 0
src/views/algorithm-manage/AlgorithmManage.vue

@@ -258,6 +258,18 @@ const cancelClick = () => {
               </div>
             </AFlex>
           </AFlex>
+
+          <AFlex class="intelligent-style">
+            <div class="intelligent-width">{{ t('algorithmManage.copAlgorithm') }}</div>
+            <AFlex align="center" class="adjustment-div">
+              <AFlex v-for="item in algorithmConfigInfo?.deviceCOPList" :key="item.id" class="adjustment-right">
+                <div>{{ item.deviceName }}:&nbsp;&nbsp;&nbsp;</div>
+                <div>
+                  {{ item.enableCopSet ? t('common.open') : t('common.turnOff') }}
+                </div>
+              </AFlex>
+            </AFlex>
+          </AFlex>
         </ACollapsePanel>
       </ACollapse>
     </div>
@@ -269,6 +281,10 @@ const cancelClick = () => {
   width: 160px;
 }
 
+.adjustment-right {
+  margin-right: 40px;
+}
+
 .adjustment-left {
   margin-left: 40px;
 }

+ 42 - 15
src/views/create-device/GatewayParameters.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { onMounted, ref, useTemplateRef } from 'vue';
+import { computed, onMounted, ref, useTemplateRef } from 'vue';
 import { message } from 'ant-design-vue';
 
 import ConfirmModal from '@/components/ConfirmModal.vue';
@@ -413,14 +413,30 @@ const gatewayDevDelete = (index: number) => {
 };
 
 const handleOk = () => {
-  monitorAssociationGatewayList.value = mergeArrays(
-    monitorAssociationGatewayList.value,
-    monitorChooselistEquipment.value,
-  );
-  controlAssociationGatewayList.value = mergeArrays(
-    controlAssociationGatewayList.value,
-    controlChooselistEquipment.value,
-  );
+  if (monitorChooselistEquipment.value.length) {
+    monitorAssociationGatewayList.value = mergeArrays(
+      monitorAssociationGatewayList.value,
+      monitorChooselistEquipment.value,
+    );
+  } else {
+    monitorAssociationGatewayList.value = monitorAssociationGatewayList.value.filter(
+      (item) =>
+        !(item.gatewayId === gatewayId && item.linkId === linkId && item.gatewayLinkProtocolId === groupNumberId),
+    );
+  }
+
+  if (controlChooselistEquipment.value.length) {
+    controlAssociationGatewayList.value = mergeArrays(
+      controlAssociationGatewayList.value,
+      controlChooselistEquipment.value,
+    );
+  } else {
+    controlAssociationGatewayList.value = controlAssociationGatewayList.value.filter(
+      (item) =>
+        !(item.gatewayId === gatewayId && item.linkId === linkId && item.gatewayLinkProtocolId === groupNumberId),
+    );
+  }
+
   const dataList = [...monitorAssociationGatewayList.value, ...controlAssociationGatewayList.value];
 
   groupingList.value = Array.from(new Set(dataList.map((item) => item.groupName))).map((groupName, index) => ({
@@ -769,12 +785,6 @@ const finish = async () => {
   deviceGateways.value = [];
   deviceParamGroupRels.value = [];
 
-  groupingList.value.forEach((item) => {
-    deviceParamGroups.value.push({
-      groupName: item.groupName,
-      deviceId,
-    });
-  });
   customizationData.value.forEach((item) => {
     const {
       customFormula,
@@ -786,6 +796,10 @@ const finish = async () => {
       deviceParamCode,
       paramGroupName,
     } = item;
+    deviceParamGroups.value.push({
+      groupName: paramGroupName,
+      deviceId,
+    });
     customParameters.value.push({
       customFormula,
       unit,
@@ -812,6 +826,10 @@ const finish = async () => {
       unit,
       gatewayLinkProtocolId,
     } = item;
+    deviceParamGroups.value.push({
+      groupName,
+      deviceId,
+    });
     deviceGateways.value.push({
       deviceId,
       gatewayId,
@@ -833,6 +851,15 @@ const finish = async () => {
     });
   });
 
+  const uniqueList = computed(() => {
+    const map = new Map<string, DeviceParamGroups>();
+    deviceParamGroups.value.forEach((item) => {
+      map.set(item.groupName, item); // 始终覆盖,保留最后一次
+    });
+    return Array.from(map.values());
+  });
+  deviceParamGroups.value = uniqueList.value;
+
   await addDeviceBind({
     deviceParamGroups: deviceParamGroups.value,
     deviceGateways: deviceGateways.value,

+ 1 - 1
src/views/device-work-status/DevWorkParamData.vue

@@ -143,7 +143,7 @@ const option = computed<EChartsOption>(() => {
         tableHtml += `<tr><th>${time}</th></tr>`;
 
         tempParms.forEach((param) => {
-          tableHtml += `<tr><td>${param.marker}${param.seriesName}</td><td>${param.value[1]}${unitText}</td></tr>`;
+          tableHtml += `<tr><td>${param.marker}${param.seriesName}</td><td>${param.value[1] ?? '-'}${unitText}</td></tr>`;
         });
 
         tableHtml += '</table>';

+ 2 - 1
src/views/device-work-status/DeviceWorkStatus.vue

@@ -6,6 +6,7 @@ import { useInfiniteScroll } from '@vueuse/core';
 import SvgIcon from '@/components/SvgIcon.vue';
 import { useRequest } from '@/hooks/request';
 import { getDevWorkRealTimeData, getDevWorkTypeCount, queryDevicesList } from '@/api';
+import { getFixedNum } from '@/utils';
 import { DeviceRunningStatus, DeviceStatusQuery } from '@/constants';
 import { DevParamChillerUnit, DevParamCtrlCabinet } from '@/constants/device-params';
 
@@ -267,7 +268,7 @@ const handleDevCardClick = (devId: number, e: Event) => {
                 "
               >
                 <div class="device-cop-value" :data-param-code="DevParamChillerUnit.COP">
-                  {{ deviceRealTimeData[item.id][DevParamChillerUnit.COP] }}
+                  {{ getFixedNum(deviceRealTimeData[item.id][DevParamChillerUnit.COP]) }}
                 </div>
                 <!-- <div class="device-cop-level">中</div> -->
               </template>

+ 40 - 34
src/views/device-work-status/device-card/ChillerUnit.vue

@@ -2,7 +2,7 @@
 import { computed } from 'vue';
 
 import { t } from '@/i18n';
-import { calcPercentage, isNotEmptyVal } from '@/utils';
+import { calcPercentage, getFixedNum, isNotEmptyVal } from '@/utils';
 import { DevParamChillerUnit } from '@/constants/device-params';
 
 import type { DevWorkCardProps } from '@/types';
@@ -23,9 +23,9 @@ const coolingCapacityTip = computed(() => {
   const isNominalCoolingcapacityNotEmpty = isNotEmptyVal(nominalCoolingcapacity);
   const percent = isCoolingcapacityNotEmpty && isNominalCoolingcapacityNotEmpty ? coolingCapacityPercent.value : '-';
 
-  return `${t('deviceWorkStatus.chillerUnit.coolingCapacityPercentage')}: ${percent}%
-${t('deviceWorkStatus.chillerUnit.coolingCapacity')}: ${coolingCapacity ?? '-'}kW
-${t('deviceWorkStatus.chillerUnit.coolingCapacityNominal')}: ${nominalCoolingcapacity ?? '-'}kW`;
+  return `${t('deviceWorkStatus.chillerUnit.coolingCapacityPercentage')}: ${getFixedNum(percent, 1)}%
+${t('deviceWorkStatus.chillerUnit.coolingCapacity')}: ${getFixedNum(coolingCapacity, 1)}kW
+${t('deviceWorkStatus.chillerUnit.coolingCapacityNominal')}: ${getFixedNum(nominalCoolingcapacity, 1)}kW`;
 });
 
 const activePowerPercent = computed(() => {
@@ -42,9 +42,9 @@ const activePowerTip = computed(() => {
   const isPowerRatingNotEmpty = isNotEmptyVal(powerRating);
   const percent = isActivePowerNotEmpty && isPowerRatingNotEmpty ? activePowerPercent.value : '-';
 
-  return `${t('deviceWorkStatus.chillerUnit.activePowerPercentage')}: ${percent}%
-${t('deviceWorkStatus.chillerUnit.activePower')}: ${activePower ?? '-'}kW
-${t('deviceList.ratedPower')}: ${powerRating ?? '-'}kW`;
+  return `${t('deviceWorkStatus.chillerUnit.activePowerPercentage')}: ${getFixedNum(percent, 1)}%
+${t('deviceWorkStatus.chillerUnit.activePower')}: ${getFixedNum(activePower, 1)}kW
+${t('deviceList.ratedPower')}: ${getFixedNum(powerRating, 1)}kW`;
 });
 
 const showEvapCondTempPre = computed(() => {
@@ -67,7 +67,7 @@ const showDisSucTemp = computed(() => {
           <ATooltip overlay-class-name="hvac-tooltip">
             <template #title>{{ coolingCapacityTip }}</template>
             <ProgressTextBar
-              :text="realTimeData?.[DevParamChillerUnit.制冷量]"
+              :text="getFixedNum(realTimeData?.[DevParamChillerUnit.制冷量], 1)"
               :percent="coolingCapacityPercent"
               :data-param-code="DevParamChillerUnit.制冷量"
             />
@@ -82,7 +82,7 @@ const showDisSucTemp = computed(() => {
           <ATooltip overlay-class-name="hvac-tooltip">
             <template #title>{{ activePowerTip }}</template>
             <ProgressTextBar
-              :text="realTimeData?.[DevParamChillerUnit.有功功率]"
+              :text="getFixedNum(realTimeData?.[DevParamChillerUnit.有功功率], 1)"
               :percent="activePowerPercent"
               :data-param-code="DevParamChillerUnit.有功功率"
             />
@@ -91,7 +91,7 @@ const showDisSucTemp = computed(() => {
         <div>
           <div class="device-card-label">{{ $t('deviceWorkStatus.chillerUnit.loadRate') }}</div>
           <ProgressTextBar
-            :text="realTimeData?.[DevParamChillerUnit.负载率] + '%'"
+            :text="getFixedNum(realTimeData?.[DevParamChillerUnit.负载率], 1) + '%'"
             :percent="realTimeData?.[DevParamChillerUnit.负载率] || 0"
             :data-param-code="DevParamChillerUnit.负载率"
           />
@@ -107,9 +107,9 @@ const showDisSucTemp = computed(() => {
           <ATooltip>
             <template #title>
               {{ $t('deviceWorkStatus.chillerUnit.evapWaterTempIn') }}:
-              {{ realTimeData?.[DevParamChillerUnit.冷冻水回水温度] }}°C
+              {{ getFixedNum(realTimeData?.[DevParamChillerUnit.冷冻水回水温度]) }}°C
             </template>
-            {{ realTimeData?.[DevParamChillerUnit.冷冻水回水温度] }}°C
+            {{ getFixedNum(realTimeData?.[DevParamChillerUnit.冷冻水回水温度]) }}°C
           </ATooltip>
         </div>
         <div
@@ -120,9 +120,9 @@ const showDisSucTemp = computed(() => {
           <ATooltip>
             <template #title>
               {{ $t('deviceWorkStatus.chillerUnit.evapWaterTempOut') }}:
-              {{ realTimeData?.[DevParamChillerUnit.冷冻水出水温度] }}°C
+              {{ getFixedNum(realTimeData?.[DevParamChillerUnit.冷冻水出水温度]) }}°C
             </template>
-            {{ realTimeData?.[DevParamChillerUnit.冷冻水出水温度] }}°C
+            {{ getFixedNum(realTimeData?.[DevParamChillerUnit.冷冻水出水温度]) }}°C
           </ATooltip>
         </div>
         <div
@@ -133,9 +133,9 @@ const showDisSucTemp = computed(() => {
           <ATooltip>
             <template #title>
               {{ $t('deviceWorkStatus.chillerUnit.condWaterTempIn') }}:
-              {{ realTimeData?.[DevParamChillerUnit.冷却水回水温度] }}°C
+              {{ getFixedNum(realTimeData?.[DevParamChillerUnit.冷却水回水温度]) }}°C
             </template>
-            {{ realTimeData?.[DevParamChillerUnit.冷却水回水温度] }}°C
+            {{ getFixedNum(realTimeData?.[DevParamChillerUnit.冷却水回水温度]) }}°C
           </ATooltip>
         </div>
         <div
@@ -146,9 +146,9 @@ const showDisSucTemp = computed(() => {
           <ATooltip>
             <template #title>
               {{ $t('deviceWorkStatus.chillerUnit.condWaterTempOut') }}:
-              {{ realTimeData?.[DevParamChillerUnit.冷却水出水温度] }}°C
+              {{ getFixedNum(realTimeData?.[DevParamChillerUnit.冷却水出水温度]) }}°C
             </template>
-            {{ realTimeData?.[DevParamChillerUnit.冷却水出水温度] }}°C
+            {{ getFixedNum(realTimeData?.[DevParamChillerUnit.冷却水出水温度]) }}°C
           </ATooltip>
         </div>
         <template v-if="showEvapCondTempPre">
@@ -159,9 +159,10 @@ const showDisSucTemp = computed(() => {
           >
             <ATooltip>
               <template #title>
-                {{ $t('deviceWorkStatus.chillerUnit.evapPre') }}: {{ realTimeData?.[DevParamChillerUnit.蒸发压力] }}kPa
+                {{ $t('deviceWorkStatus.chillerUnit.evapPre') }}:
+                {{ getFixedNum(realTimeData?.[DevParamChillerUnit.蒸发压力]) }}kPa
               </template>
-              {{ realTimeData?.[DevParamChillerUnit.蒸发压力] }}kPa
+              {{ getFixedNum(realTimeData?.[DevParamChillerUnit.蒸发压力]) }}kPa
             </ATooltip>
           </div>
           <div
@@ -171,9 +172,10 @@ const showDisSucTemp = computed(() => {
           >
             <ATooltip>
               <template #title>
-                {{ $t('deviceWorkStatus.chillerUnit.evapTemp') }}: {{ realTimeData?.[DevParamChillerUnit.蒸发温度] }}°C
+                {{ $t('deviceWorkStatus.chillerUnit.evapTemp') }}:
+                {{ getFixedNum(realTimeData?.[DevParamChillerUnit.蒸发温度]) }}°C
               </template>
-              {{ realTimeData?.[DevParamChillerUnit.蒸发温度] }}°C
+              {{ getFixedNum(realTimeData?.[DevParamChillerUnit.蒸发温度]) }}°C
             </ATooltip>
           </div>
           <div
@@ -183,9 +185,10 @@ const showDisSucTemp = computed(() => {
           >
             <ATooltip>
               <template #title>
-                {{ $t('deviceWorkStatus.chillerUnit.condPre') }}: {{ realTimeData?.[DevParamChillerUnit.冷凝压力] }}kPa
+                {{ $t('deviceWorkStatus.chillerUnit.condPre') }}:
+                {{ getFixedNum(realTimeData?.[DevParamChillerUnit.冷凝压力]) }}kPa
               </template>
-              {{ realTimeData?.[DevParamChillerUnit.冷凝压力] }}kPa
+              {{ getFixedNum(realTimeData?.[DevParamChillerUnit.冷凝压力]) }}kPa
             </ATooltip>
           </div>
           <div
@@ -195,9 +198,10 @@ const showDisSucTemp = computed(() => {
           >
             <ATooltip>
               <template #title>
-                {{ $t('deviceWorkStatus.chillerUnit.condTemp') }}: {{ realTimeData?.[DevParamChillerUnit.冷凝温度] }}°C
+                {{ $t('deviceWorkStatus.chillerUnit.condTemp') }}:
+                {{ getFixedNum(realTimeData?.[DevParamChillerUnit.冷凝温度]) }}°C
               </template>
-              {{ realTimeData?.[DevParamChillerUnit.冷凝温度] }}°C
+              {{ getFixedNum(realTimeData?.[DevParamChillerUnit.冷凝温度]) }}°C
             </ATooltip>
           </div>
         </template>
@@ -209,9 +213,10 @@ const showDisSucTemp = computed(() => {
           >
             <ATooltip>
               <template #title>
-                {{ $t('deviceWorkStatus.chillerUnit.disTemp') }}: {{ realTimeData?.[DevParamChillerUnit.排气温度] }}°C
+                {{ $t('deviceWorkStatus.chillerUnit.disTemp') }}:
+                {{ getFixedNum(realTimeData?.[DevParamChillerUnit.排气温度], 1) }}°C
               </template>
-              {{ realTimeData?.[DevParamChillerUnit.排气温度] }}°C
+              {{ getFixedNum(realTimeData?.[DevParamChillerUnit.排气温度], 1) }}°C
             </ATooltip>
           </div>
           <div
@@ -221,9 +226,10 @@ const showDisSucTemp = computed(() => {
           >
             <ATooltip>
               <template #title>
-                {{ $t('deviceWorkStatus.chillerUnit.sucTemp') }}: {{ realTimeData?.[DevParamChillerUnit.吸气温度] }}°C
+                {{ $t('deviceWorkStatus.chillerUnit.sucTemp') }}:
+                {{ getFixedNum(realTimeData?.[DevParamChillerUnit.吸气温度], 1) }}°C
               </template>
-              {{ realTimeData?.[DevParamChillerUnit.吸气温度] }}°C
+              {{ getFixedNum(realTimeData?.[DevParamChillerUnit.吸气温度], 1) }}°C
             </ATooltip>
           </div>
         </template>
@@ -235,7 +241,7 @@ const showDisSucTemp = computed(() => {
         <div class="device-card-value" :data-param-code="DevParamChillerUnit.冷冻水出水温度设定值反馈">
           {{
             isNotEmptyVal(realTimeData?.[DevParamChillerUnit.冷冻水出水温度设定值反馈])
-              ? realTimeData?.[DevParamChillerUnit.冷冻水出水温度设定值反馈] + '°C'
+              ? getFixedNum(realTimeData?.[DevParamChillerUnit.冷冻水出水温度设定值反馈], 1) + '°C'
               : '-'
           }}
         </div>
@@ -243,7 +249,7 @@ const showDisSucTemp = computed(() => {
       <div>
         <div class="device-card-label">{{ $t('deviceWorkStatus.chillerUnit.todayPowerConsumption') }} (kWh)</div>
         <div class="device-card-value device-card-no-history">
-          {{ realTimeData?.[DevParamChillerUnit.今日耗电量] ?? '-' }}
+          {{ getFixedNum(realTimeData?.[DevParamChillerUnit.今日耗电量], 1) }}
         </div>
       </div>
       <div>
@@ -251,7 +257,7 @@ const showDisSucTemp = computed(() => {
         <div class="device-card-value device-card-no-history">
           {{
             isNotEmptyVal(realTimeData?.[DevParamChillerUnit.本月耗电量])
-              ? realTimeData?.[DevParamChillerUnit.本月耗电量] + $t('common.tenThousand')
+              ? getFixedNum(realTimeData?.[DevParamChillerUnit.本月耗电量]) + $t('common.tenThousand')
               : '-'
           }}
         </div>
@@ -356,7 +362,7 @@ const showDisSucTemp = computed(() => {
 
   &.dis-temp {
     top: 52px;
-    right: 71px;
+    right: 65px;
   }
 
   &.suc-temp {

+ 4 - 4
src/views/device-work-status/device-card/CoolingPump.vue

@@ -2,7 +2,7 @@
 import { computed } from 'vue';
 
 import ProgressTextBar from '@/components/ProgressTextBar.vue';
-import { calcPercentage } from '@/utils';
+import { calcPercentage, getFixedNum } from '@/utils';
 import { DevParamCoolingPump } from '@/constants/device-params';
 
 import type { DevWorkCardProps } from '@/types';
@@ -36,7 +36,7 @@ const frequencyFbPercent = computed(() => {
         <div>
           <div class="device-card-label">{{ $t('deviceWorkStatus.coolingTower.activePower') }} (kW)</div>
           <ProgressTextBar
-            :text="realTimeData?.[DevParamCoolingPump.有功功率]"
+            :text="getFixedNum(realTimeData?.[DevParamCoolingPump.有功功率], 1)"
             :percent="activePowerPercent"
             :data-param-code="DevParamCoolingPump.有功功率"
           />
@@ -44,7 +44,7 @@ const frequencyFbPercent = computed(() => {
         <div>
           <div class="device-card-label">{{ $t('deviceWorkStatus.coolingTower.frequencyFb') }} (Hz)</div>
           <ProgressTextBar
-            :text="realTimeData?.[DevParamCoolingPump.频率反馈]"
+            :text="getFixedNum(realTimeData?.[DevParamCoolingPump.频率反馈], 0)"
             :percent="frequencyFbPercent"
             :data-param-code="DevParamCoolingPump.频率反馈"
           />
@@ -55,7 +55,7 @@ const frequencyFbPercent = computed(() => {
       <div>
         <div class="device-card-label">{{ $t('deviceWorkStatus.coolingTower.runHours') }} (H)</div>
         <div class="device-card-value device-card-no-history">
-          {{ realTimeData?.[DevParamCoolingPump.运行时间] ?? '-' }}
+          {{ getFixedNum(realTimeData?.[DevParamCoolingPump.运行时间]) }}
         </div>
       </div>
     </div>

+ 4 - 4
src/views/device-work-status/device-card/CoolingTower.vue

@@ -2,7 +2,7 @@
 import { computed } from 'vue';
 
 import ProgressTextBar from '@/components/ProgressTextBar.vue';
-import { calcPercentage } from '@/utils';
+import { calcPercentage, getFixedNum } from '@/utils';
 import { DevParamCoolingTower } from '@/constants/device-params';
 
 import type { DevWorkCardProps } from '@/types';
@@ -36,7 +36,7 @@ const frequencyFbPercent = computed(() => {
         <div>
           <div class="device-card-label">{{ $t('deviceWorkStatus.coolingTower.activePower') }} (kW)</div>
           <ProgressTextBar
-            :text="realTimeData?.[DevParamCoolingTower.有功功率]"
+            :text="getFixedNum(realTimeData?.[DevParamCoolingTower.有功功率], 1)"
             :percent="activePowerPercent"
             :data-param-code="DevParamCoolingTower.有功功率"
           />
@@ -44,7 +44,7 @@ const frequencyFbPercent = computed(() => {
         <div>
           <div class="device-card-label">{{ $t('deviceWorkStatus.coolingTower.frequencyFb') }} (Hz)</div>
           <ProgressTextBar
-            :text="realTimeData?.[DevParamCoolingTower.频率反馈]"
+            :text="getFixedNum(realTimeData?.[DevParamCoolingTower.频率反馈], 0)"
             :percent="frequencyFbPercent"
             :data-param-code="DevParamCoolingTower.频率反馈"
           />
@@ -55,7 +55,7 @@ const frequencyFbPercent = computed(() => {
       <div>
         <div class="device-card-label">{{ $t('deviceWorkStatus.coolingTower.runHours') }} (H)</div>
         <div class="device-card-value device-card-no-history">
-          {{ realTimeData?.[DevParamCoolingTower.运行时间] ?? '-' }}
+          {{ getFixedNum(realTimeData?.[DevParamCoolingTower.运行时间]) }}
         </div>
       </div>
     </div>

+ 7 - 6
src/views/device-work-status/device-card/CtrlCabinet.vue

@@ -1,4 +1,5 @@
 <script setup lang="ts">
+import { getFixedNum } from '@/utils';
 import { DevParamCtrlCabinet } from '@/constants/device-params';
 
 import type { DevWorkCardProps } from '@/types';
@@ -14,19 +15,19 @@ defineProps<DevWorkCardProps<DevParamCtrlCabinet>>();
         <div>
           <div class="device-card-label">{{ $t('deviceWorkStatus.ctrlCabinet.chilledWaterMainTempOut') }} (°C)</div>
           <div class="device-card-value" :data-param-code="DevParamCtrlCabinet.冷冻总管出水温度">
-            {{ realTimeData?.[DevParamCtrlCabinet.冷冻总管出水温度] ?? '-' }}
+            {{ getFixedNum(realTimeData?.[DevParamCtrlCabinet.冷冻总管出水温度]) }}
           </div>
         </div>
         <div>
           <div class="device-card-label">{{ $t('deviceWorkStatus.ctrlCabinet.chilledWaterMainTempIn') }} (°C)</div>
           <div class="device-card-value" :data-param-code="DevParamCtrlCabinet.冷冻总管回水温度">
-            {{ realTimeData?.[DevParamCtrlCabinet.冷冻总管回水温度] ?? '-' }}
+            {{ getFixedNum(realTimeData?.[DevParamCtrlCabinet.冷冻总管回水温度]) }}
           </div>
         </div>
         <div>
           <div class="device-card-label">{{ $t('deviceWorkStatus.ctrlCabinet.chilledWaterMainPreOut') }} (bar)</div>
           <div class="device-card-value" :data-param-code="DevParamCtrlCabinet.冷冻总管出水压力">
-            {{ realTimeData?.[DevParamCtrlCabinet.冷冻总管出水压力] ?? '-' }}
+            {{ getFixedNum(realTimeData?.[DevParamCtrlCabinet.冷冻总管出水压力]) }}
           </div>
         </div>
       </div>
@@ -35,19 +36,19 @@ defineProps<DevWorkCardProps<DevParamCtrlCabinet>>();
       <div>
         <div class="device-card-label">{{ $t('deviceWorkStatus.ctrlCabinet.chilledWaterMainPreIn') }} (bar)</div>
         <div class="device-card-value" :data-param-code="DevParamCtrlCabinet.冷冻总管回水压力">
-          {{ realTimeData?.[DevParamCtrlCabinet.冷冻总管回水压力] ?? '-' }}
+          {{ getFixedNum(realTimeData?.[DevParamCtrlCabinet.冷冻总管回水压力]) }}
         </div>
       </div>
       <div>
         <div class="device-card-label">{{ $t('deviceWorkStatus.ctrlCabinet.coolingWaterMainTempOut') }} (°C)</div>
         <div class="device-card-value" :data-param-code="DevParamCtrlCabinet.冷却总管出水温度">
-          {{ realTimeData?.[DevParamCtrlCabinet.冷却总管出水温度] ?? '-' }}
+          {{ getFixedNum(realTimeData?.[DevParamCtrlCabinet.冷却总管出水温度]) }}
         </div>
       </div>
       <div>
         <div class="device-card-label">{{ $t('deviceWorkStatus.ctrlCabinet.coolingWaterMainTempIn') }} (°C)</div>
         <div class="device-card-value" :data-param-code="DevParamCtrlCabinet.冷却总管回水温度">
-          {{ realTimeData?.[DevParamCtrlCabinet.冷却总管回水温度] ?? '-' }}
+          {{ getFixedNum(realTimeData?.[DevParamCtrlCabinet.冷却总管回水温度]) }}
         </div>
       </div>
     </div>

+ 2 - 2
src/views/equipment-details/EquipmentDetails.vue

@@ -386,8 +386,6 @@ const obtainDeviceDetails = (value: boolean) => {
   }
 
   handleRequest(async () => {
-    gatewayData.value = [];
-    gatewayRemoteData.value = [];
     const { deviceQueryVo, gatewayInfoVos, protocolParamDeviceInfoVos, protocolParamCustomDevVos } =
       await equipmentDetails(deviceId);
     const {
@@ -521,6 +519,8 @@ const obtainDeviceDetails = (value: boolean) => {
       id,
     });
     if (value) {
+      gatewayData.value = [];
+      gatewayRemoteData.value = [];
       if (gatewayInfoVos.length) {
         gatewayList.value = gatewayInfoVos;
       } else {