浏览代码

[Feat 0000] QHCurve增加配置选项

houzekong 1 月之前
父节点
当前提交
fa99cee0b0

+ 1 - 2
src/views/vent/home/configurable/components/content.vue

@@ -65,7 +65,7 @@
           <BlastDelta class="content__module" :pos-monitor="config.data" :canvasSize="{ width: 250, height: 200 }" />
         </template>
         <template v-if="config.name === 'qh_curve'">
-          <QHCurve class="content__module" :mainfan="config.data" />
+          <QHCurve class="content__module" :mainfan="config.data" :fan1-prop="config.config.fan1Prop" :fan2-prop="config.config.fan2Prop" />
         </template>
         <template v-if="config.name === 'measure_detail'">
           <MeasureDetail
@@ -261,7 +261,6 @@
         case 'chart': {
           const cfg = chart.shift();
           if (!cfg) break;
-          debugger;
           const data = getData(refData, cfg.readFrom, cfg.parser);
 
           arr.push({

+ 7 - 5
src/views/vent/home/configurable/components/preset/QHCurve.vue

@@ -12,10 +12,11 @@
 <script lang="ts" setup>
   import { ref, reactive, nextTick, defineProps, watch } from 'vue';
   import * as echarts from 'echarts';
+  import { get } from 'lodash-es';
   //   import { useGlobSetting } from '/@/hooks/setting';
   //   const { sysOrgCode } = useGlobSetting();
 
-  const props = defineProps<{ mainfan: Record<string, any> }>();
+  const props = defineProps<{ mainfan: Record<string, any>; /** QH */ fan1Prop: [string, string]; fan2Prop: [string, string] }>();
   const selectDataObj = ref({
     dataQ: 0,
     dataH: 0,
@@ -33,16 +34,17 @@
   function changeSelect(selectData) {
     let objParam;
     if (!selectData) return;
+    if (!selectData.readData) return;
     const fan2Active = selectData.readData.Fan2StartStatus && selectData.readData.Fan2StartStatus == '1';
     if (fan2Active) {
       objParam = {
-        dataQ: selectData.readData.Fan2m3 || 0,
-        dataH: Math.abs(Number(selectData.readData.Fan2FanPre || 0)),
+        dataQ: get(selectData, props.fan2Prop[0], 0),
+        dataH: Math.abs(Number(get(selectData, props.fan2Prop[1], 0))),
       };
     } else {
       objParam = {
-        dataQ: selectData.readData.Fan1m3 || 0,
-        dataH: Math.abs(Number(selectData.readData.Fan1FanPre || 0)),
+        dataQ: get(selectData, props.fan1Prop[0], 0),
+        dataH: Math.abs(Number(get(selectData, props.fan1Prop[1], 0))),
       };
     }