|
@@ -59,6 +59,7 @@ async function getPieChartData(params: AreaChartParams) {
|
|
|
const lineStatus = ref(false);
|
|
|
const lineMessage = ref("加载中...");
|
|
|
const lineChartData = ref<AreaLineData>();
|
|
|
+let curveDataKey = ref("");
|
|
|
const curveData = ref<number[][]>();
|
|
|
const swCurveData = ref<number[][]>();
|
|
|
const klCurveData = ref<number[][]>();
|
|
@@ -83,12 +84,17 @@ async function getLineChartData(params: AreaChartParams) {
|
|
|
}
|
|
|
async function getLineChartDataSub(result: Ref<number[][] | undefined>, params: AreaChartParams) {
|
|
|
let tempData: AreaLineData;
|
|
|
- getAreaBoardLines(params).then(({data}) => {
|
|
|
- tempData = data;
|
|
|
- result.value = [];
|
|
|
- result.value?.push(tempData?.curve || []);
|
|
|
- result.value?.push(tempData?.num || []);
|
|
|
- });
|
|
|
+ getAreaBoardLines(params)
|
|
|
+ .then(({data}) => {
|
|
|
+ tempData = data;
|
|
|
+ result.value = [];
|
|
|
+ result.value?.push(tempData?.curve || []);
|
|
|
+ result.value?.push(tempData?.num || []);
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ result.value = [[], []];
|
|
|
+ console.log(error.message);
|
|
|
+ });
|
|
|
}
|
|
|
/**
|
|
|
* 筛选条件
|
|
@@ -115,12 +121,16 @@ watchEffect(() => {
|
|
|
// 折线图数据
|
|
|
dataParams.device_id = 0;
|
|
|
getLineChartData(dataParams);
|
|
|
+ curveDataKey.value = curveData.toString();
|
|
|
dataParams.device_id = 1;
|
|
|
getLineChartDataSub(swCurveData, dataParams);
|
|
|
+ curveDataKey.value += swCurveData.toString();
|
|
|
dataParams.device_id = 6;
|
|
|
getLineChartDataSub(klCurveData, dataParams);
|
|
|
+ curveDataKey.value += klCurveData.toString();
|
|
|
dataParams.device_id = 7;
|
|
|
getLineChartDataSub(zzlCurveData, dataParams);
|
|
|
+ curveDataKey.value += zzlCurveData.toString();
|
|
|
});
|
|
|
</script>
|
|
|
|
|
@@ -220,7 +230,7 @@ watchEffect(() => {
|
|
|
<template v-if="lineStatus">
|
|
|
<line-chart
|
|
|
id="lineChart1"
|
|
|
- :key="dataParams?.toString()"
|
|
|
+ :key="curveDataKey"
|
|
|
:dataSets="curveData || [[], []]"
|
|
|
:dataSW="swCurveData || [[], []]"
|
|
|
:dataKL="klCurveData || [[], []]"
|