|
@@ -1,9 +1,24 @@
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
|
+import { computed } from 'vue';
|
|
|
|
+
|
|
|
|
+import { calcPercentage } from '@/utils';
|
|
import { DevParamChillerUnit } from '@/constants/device-params';
|
|
import { DevParamChillerUnit } from '@/constants/device-params';
|
|
|
|
|
|
import type { DevWorkCardProps } from '@/types';
|
|
import type { DevWorkCardProps } from '@/types';
|
|
|
|
|
|
-defineProps<DevWorkCardProps<DevParamChillerUnit>>();
|
|
|
|
|
|
+const props = defineProps<DevWorkCardProps<DevParamChillerUnit>>();
|
|
|
|
+
|
|
|
|
+const coolingCapacityPercent = computed(() => {
|
|
|
|
+ const currentCooling = props.realTimeData?.[DevParamChillerUnit.制冷量] as number;
|
|
|
|
+ const maxCooling = props.deviceDetail.nominalCoolingcapacity;
|
|
|
|
+ return calcPercentage(currentCooling, maxCooling);
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+const activePowerPercent = computed(() => {
|
|
|
|
+ const currentPower = props.realTimeData?.[DevParamChillerUnit.有功功率] as number;
|
|
|
|
+ const maxPower = props.deviceDetail.powerRating;
|
|
|
|
+ return calcPercentage(currentPower, maxPower);
|
|
|
|
+});
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -14,7 +29,7 @@ defineProps<DevWorkCardProps<DevParamChillerUnit>>();
|
|
<div class="device-card-label">{{ $t('deviceWorkStatus.chillerUnit.coolingCapacity') }} (kW)</div>
|
|
<div class="device-card-label">{{ $t('deviceWorkStatus.chillerUnit.coolingCapacity') }} (kW)</div>
|
|
<ProgressTextBar
|
|
<ProgressTextBar
|
|
:text="realTimeData?.[DevParamChillerUnit.制冷量]"
|
|
:text="realTimeData?.[DevParamChillerUnit.制冷量]"
|
|
- :percent="0"
|
|
|
|
|
|
+ :percent="coolingCapacityPercent"
|
|
:data-param-code="DevParamChillerUnit.制冷量"
|
|
:data-param-code="DevParamChillerUnit.制冷量"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
@@ -22,7 +37,7 @@ defineProps<DevWorkCardProps<DevParamChillerUnit>>();
|
|
<div class="device-card-label">{{ $t('deviceWorkStatus.chillerUnit.activePower') }} (kW)</div>
|
|
<div class="device-card-label">{{ $t('deviceWorkStatus.chillerUnit.activePower') }} (kW)</div>
|
|
<ProgressTextBar
|
|
<ProgressTextBar
|
|
:text="realTimeData?.[DevParamChillerUnit.有功功率]"
|
|
:text="realTimeData?.[DevParamChillerUnit.有功功率]"
|
|
- :percent="0"
|
|
|
|
|
|
+ :percent="activePowerPercent"
|
|
:data-param-code="DevParamChillerUnit.有功功率"
|
|
:data-param-code="DevParamChillerUnit.有功功率"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
@@ -30,7 +45,7 @@ defineProps<DevWorkCardProps<DevParamChillerUnit>>();
|
|
<div class="device-card-label">{{ $t('deviceWorkStatus.chillerUnit.loadRate') }}</div>
|
|
<div class="device-card-label">{{ $t('deviceWorkStatus.chillerUnit.loadRate') }}</div>
|
|
<ProgressTextBar
|
|
<ProgressTextBar
|
|
:text="realTimeData?.[DevParamChillerUnit.负载率]"
|
|
:text="realTimeData?.[DevParamChillerUnit.负载率]"
|
|
- :percent="0"
|
|
|
|
|
|
+ :percent="realTimeData?.[DevParamChillerUnit.负载率] || 0"
|
|
:data-param-code="DevParamChillerUnit.负载率"
|
|
:data-param-code="DevParamChillerUnit.负载率"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|