|
@@ -94,7 +94,7 @@
|
|
</div>
|
|
</div>
|
|
<div class="echarts-box">
|
|
<div class="echarts-box">
|
|
<PredictionCurve v-if="shownChart === 'default'" :chart="curveConfig" />
|
|
<PredictionCurve v-if="shownChart === 'default'" :chart="curveConfig" />
|
|
- <echartLine1 v-if="shownChart === 'predict'" :echartDataSg="echartDataSg1" :lengedDataName="echartDataSg1.lengedDataName" :maxY="maxY" />
|
|
|
|
|
|
+ <echartLine1 v-if="shownChart === 'predict'" :echartDataSg="echartDataSg1" :lengedDataName="echartDataSg1.lengedDataName" :maxY="maxY" :minY="minY" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="right-echartbox">
|
|
<div class="right-echartbox">
|
|
@@ -118,6 +118,7 @@
|
|
import warnZb from './warnZb.vue';
|
|
import warnZb from './warnZb.vue';
|
|
import PredictionCurve from './predictionCurve.vue';
|
|
import PredictionCurve from './predictionCurve.vue';
|
|
import { Modal, Input } from 'ant-design-vue';
|
|
import { Modal, Input } from 'ant-design-vue';
|
|
|
|
+ import {getMaxY,getMinY} from '../common.data'
|
|
// import { deviceControlApi } from '/@/api/vent/index';
|
|
// import { deviceControlApi } from '/@/api/vent/index';
|
|
|
|
|
|
let props = defineProps({
|
|
let props = defineProps({
|
|
@@ -127,6 +128,7 @@
|
|
const globalConfig = inject('globalConfig');
|
|
const globalConfig = inject('globalConfig');
|
|
const shownChart = ref('default');
|
|
const shownChart = ref('default');
|
|
let maxY = ref<any>(0);
|
|
let maxY = ref<any>(0);
|
|
|
|
+ let minY=ref<any>(0)
|
|
let selectSj = ref<any[]>([]);
|
|
let selectSj = ref<any[]>([]);
|
|
let selectData = ref('');
|
|
let selectData = ref('');
|
|
let selectList = reactive<any[]>([]);
|
|
let selectList = reactive<any[]>([]);
|
|
@@ -222,25 +224,27 @@
|
|
});
|
|
});
|
|
let echartDataSgList = reactive<any[]>([]);
|
|
let echartDataSgList = reactive<any[]>([]);
|
|
|
|
|
|
- function getmaxY() {
|
|
|
|
- maxY.value = echartDataSg1.yData.reduce((acr, cur) => {
|
|
|
|
- return acr > cur ? acr : cur;
|
|
|
|
- });
|
|
|
|
- maxY.value =
|
|
|
|
- maxY.value.toString().indexOf('.') == -1 ? maxY.value.toString() : maxY.value.toString().substring(0, maxY.value.toString().indexOf('.'));
|
|
|
|
- if (maxY.value.length < 2 && Number(maxY.value) < 1) {
|
|
|
|
- maxY.value = 1;
|
|
|
|
- } else if (maxY.value.length < 2 && Number(maxY.value) >= 1) {
|
|
|
|
- maxY.value = 10;
|
|
|
|
- } else if (maxY.value.length < 3) {
|
|
|
|
- maxY.value = (Number(maxY.value[0]) + 1) * 10;
|
|
|
|
- } else if (maxY.value.length < 4) {
|
|
|
|
- maxY.value = (Number(maxY.value[0]) + 1) * 100;
|
|
|
|
- } else if (maxY.value.length < 5) {
|
|
|
|
- maxY.value = (Number(maxY.value[0]) + 1) * 1000;
|
|
|
|
- } else if (maxY.value.length < 6) {
|
|
|
|
- maxY.value = (Number(maxY.value[0]) + 1) * 10000;
|
|
|
|
- }
|
|
|
|
|
|
+ function getmax() {
|
|
|
|
+ getMaxY(echartDataSg1.yData)
|
|
|
|
+ getMinY(echartDataSg1.yData)
|
|
|
|
+ // maxY.value = echartDataSg1.yData.reduce((acr, cur) => {
|
|
|
|
+ // return acr > cur ? acr : cur;
|
|
|
|
+ // });
|
|
|
|
+ // maxY.value =
|
|
|
|
+ // maxY.value.toString().indexOf('.') == -1 ? maxY.value.toString() : maxY.value.toString().substring(0, maxY.value.toString().indexOf('.'));
|
|
|
|
+ // if (maxY.value.length < 2 && Number(maxY.value) < 1) {
|
|
|
|
+ // maxY.value = 1;
|
|
|
|
+ // } else if (maxY.value.length < 2 && Number(maxY.value) >= 1) {
|
|
|
|
+ // maxY.value = 10;
|
|
|
|
+ // } else if (maxY.value.length < 3) {
|
|
|
|
+ // maxY.value = (Number(maxY.value[0]) + 1) * 10;
|
|
|
|
+ // } else if (maxY.value.length < 4) {
|
|
|
|
+ // maxY.value = (Number(maxY.value[0]) + 1) * 100;
|
|
|
|
+ // } else if (maxY.value.length < 5) {
|
|
|
|
+ // maxY.value = (Number(maxY.value[0]) + 1) * 1000;
|
|
|
|
+ // } else if (maxY.value.length < 6) {
|
|
|
|
+ // maxY.value = (Number(maxY.value[0]) + 1) * 10000;
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
//密闭参数选项切换
|
|
//密闭参数选项切换
|
|
function btnClick(item, ind) {
|
|
function btnClick(item, ind) {
|
|
@@ -273,7 +277,7 @@
|
|
],
|
|
],
|
|
monitorData: echartDataSg1.yData,
|
|
monitorData: echartDataSg1.yData,
|
|
};
|
|
};
|
|
- getmaxY();
|
|
|
|
|
|
+ getmax();
|
|
break;
|
|
break;
|
|
case 'C₂H₄':
|
|
case 'C₂H₄':
|
|
echartDataSgList.forEach((el) => {
|
|
echartDataSgList.forEach((el) => {
|
|
@@ -293,7 +297,7 @@
|
|
],
|
|
],
|
|
monitorData: echartDataSg1.yData,
|
|
monitorData: echartDataSg1.yData,
|
|
};
|
|
};
|
|
- getmaxY();
|
|
|
|
|
|
+ getmax();
|
|
break;
|
|
break;
|
|
case 'CO':
|
|
case 'CO':
|
|
echartDataSgList.forEach((el) => {
|
|
echartDataSgList.forEach((el) => {
|
|
@@ -313,7 +317,7 @@
|
|
],
|
|
],
|
|
monitorData: echartDataSg1.yData,
|
|
monitorData: echartDataSg1.yData,
|
|
};
|
|
};
|
|
- getmaxY();
|
|
|
|
|
|
+ getmax();
|
|
break;
|
|
break;
|
|
case 'CH₄':
|
|
case 'CH₄':
|
|
echartDataSgList.forEach((el) => {
|
|
echartDataSgList.forEach((el) => {
|
|
@@ -333,7 +337,7 @@
|
|
],
|
|
],
|
|
monitorData: echartDataSg1.yData,
|
|
monitorData: echartDataSg1.yData,
|
|
};
|
|
};
|
|
- getmaxY();
|
|
|
|
|
|
+ getmax();
|
|
break;
|
|
break;
|
|
case 'CO₂':
|
|
case 'CO₂':
|
|
echartDataSgList.forEach((el) => {
|
|
echartDataSgList.forEach((el) => {
|
|
@@ -353,7 +357,7 @@
|
|
],
|
|
],
|
|
monitorData: echartDataSg1.yData,
|
|
monitorData: echartDataSg1.yData,
|
|
};
|
|
};
|
|
- getmaxY();
|
|
|
|
|
|
+ getmax();
|
|
break;
|
|
break;
|
|
case 'C₂H₂':
|
|
case 'C₂H₂':
|
|
echartDataSgList.forEach((el) => {
|
|
echartDataSgList.forEach((el) => {
|
|
@@ -373,7 +377,7 @@
|
|
],
|
|
],
|
|
monitorData: echartDataSg1.yData,
|
|
monitorData: echartDataSg1.yData,
|
|
};
|
|
};
|
|
- getmaxY();
|
|
|
|
|
|
+ getmax();
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -501,7 +505,7 @@
|
|
// }
|
|
// }
|
|
// echartDataSgList.push(v);
|
|
// echartDataSgList.push(v);
|
|
// });
|
|
// });
|
|
- getmaxY();
|
|
|
|
|
|
+ getmax();
|
|
} else {
|
|
} else {
|
|
topContent.temperature = 0;
|
|
topContent.temperature = 0;
|
|
// topContent.position = '--';
|
|
// topContent.position = '--';
|