Przeglądaj źródła

feat: 碳源投加select区分南北池

sunxiao 5 miesięcy temu
rodzic
commit
4f1b906c09

+ 5 - 1
src/views/control/MedicinalView.vue

@@ -850,7 +850,11 @@ onMounted(async () => {
                 @on-update="onConfirmUpdate"
               >
               </TheResultPanel>
-              <TheEchartPanel v-model:change="isVisibleUpdateInfo" :setVal="dataSourceParams.htfksdOne"></TheEchartPanel>
+              <TheEchartPanel
+                v-model:change="isVisibleUpdateInfo"
+                :htfksdOne="dataSourceParams.htfksdOne"
+                :htfksdTwo="dataSourceParams.htfksdTwo"
+              ></TheEchartPanel>
             </div>
           </div>
         </div>

+ 29 - 10
src/views/control/components/TheEchartPanel.vue

@@ -6,7 +6,7 @@ import { startOfDay } from "date-fns/esm"
 import { controlApi } from "@/api/control"
 import dayjs from 'dayjs';
 
-const props = defineProps(['setVal']);
+const props = defineProps(['htfksdOne','htfksdTwo']);
 const isDomSizeChange = defineModel('change');
 
 let echart = null;
@@ -38,7 +38,8 @@ const selectEnum = {
   9:  '碳源投加量-南池-计算投药量',
   10: '碳源投加量-北池-反馈流量',
   11: '碳源投加量-南池-反馈流量',
-  12: '后反馈设定'
+  12: '北池-后反馈设定',
+  13: '南池-后反馈设定'
 }
 
 let echartOptions = [
@@ -105,7 +106,7 @@ const handleSwitchTab = (index) => {
 const handleSelectOptions = (selectOptionList) => {
   let tempArr = selectOptionList;
   if ( activeIndex.value === 0 ) {
-    if ( selectOptionList.length === 1 && selectOptionList[selectOptionList.length - 1] == 12) {
+    if ( selectOptionList.length === 1 && selectOptionList[selectOptionList.length - 1] == 12 ) {
       selectOptions.value[selectOptions.value.length - 1].disabled = true;
       tempArr = [];
     } else {
@@ -122,7 +123,7 @@ const handleSelectOptions = (selectOptionList) => {
 const initWaterEchart = async () => {
   
   const tempArr = [];
-
+  
   const tempResult = selectValue.value.map(key => {
     const data = echartDataSource.value[key] || [];
 
@@ -155,7 +156,7 @@ const getWaterEchartOptions = ({ data, xAxis = [] }) => {
   
   const series = data.map(item => {
     lengthList.push(item.data.length);
-    if ( item.name === '后反馈设定' ) {
+    if ( item.name === '北池-后反馈设定' ) {
       isOff = true;
     }
     const d1 = item.data.map(item => {
@@ -175,12 +176,16 @@ const getWaterEchartOptions = ({ data, xAxis = [] }) => {
       }
   })
 
-  if ( isOff ) {
-    
-    const data = xAxis.map(time => [time, props.setVal]);
-    
+
+  // 12 13
+  console.log( selectValue.value );
+  console.log( selectValue.value.includes(12) );
+  // console.log( selectValue.value.some(item => item == 12 || item == 13) );
+
+  if ( selectValue.value.includes('12') ) {
+    const data = xAxis.map(time => [time, props.htfksdOne]);
     series.push({
-      name: '后反馈设定',
+      name: '北池-后反馈设定',
       showSymbol: false,
       smooth: true,
       type: 'line',
@@ -192,6 +197,20 @@ const getWaterEchartOptions = ({ data, xAxis = [] }) => {
     });
   }
 
+  if (selectValue.value.includes('13')) {
+    const data = xAxis.map(time => [time, props.htfksdTwo]);
+    series.push({
+      name: '南池-后反馈设定',
+      showSymbol: false,
+      smooth: true,
+      type: 'line',
+      symbolSize: 10,
+      itemStyle: {
+        color: 'red'
+      },
+      data
+    });
+  }
 
   const option = {
     backgroundColor: '#FFF',