|
@@ -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))),
|
|
|
};
|
|
|
}
|
|
|
|