Explorar el Código

fix:修改功率图表

开发 hace 1 mes
padre
commit
83666233e1
Se han modificado 1 ficheros con 29 adiciones y 20 borrados
  1. 29 20
      src/components/RightPanel/JieChuWangQS/index.vue

+ 29 - 20
src/components/RightPanel/JieChuWangQS/index.vue

@@ -15,6 +15,7 @@ export default {
     return {
       queryType: "b.totalworkmax,b.totalworkmin,b.totalworkavg",
       selectedType: "ZHZG",
+      dcbh: '9/11#-9#                      ',
     };
   },
   methods: {
@@ -55,7 +56,7 @@ export default {
       };
       axios
         .post("/EchartRouter/getGlCurrent", {
-          dcbh: 1, //val.dcbh
+          dcbh: this.dcbh, //val.dcbh
           value: this.queryType,
         })
         .then((res) => {
@@ -89,13 +90,11 @@ export default {
         myChart1.setOption(changshow);
       }
     },
-
     showtubiaoBD() {
       xuanzhong = "BD";
       changshow = option3.tubiao1;
       myChart1.setOption(changshow);
     },
-
     showtubiaoGL() {
       xuanzhong = "GL";
       changshow = option3.tubiao3;
@@ -130,6 +129,26 @@ export default {
       option.series[2].data = this.dataarr.totalworkavg;
       myChart1.setOption(option);
     },
+    getDefaultData(val) {
+      this.dcbh = val.dcbh;
+      axios
+        .post("/EchartRouter/getGlCurrent", {
+          dcbh: val.dcbh,
+          value: this.queryType,
+        })
+        .then((res) => {
+          let sortdata = res.rows; //.sort(this.compare('riqi'));
+          for (let i = 0; i < sortdata.length; i++) {
+            this.dataarr.riqi.push(
+              this.DateToStr(this.ConvertDateByCNZdate(sortdata[i]["time"]))
+            );
+            this.dataarr.totalworkmax.push(sortdata[i]["totalworkmax"]);
+            this.dataarr.totalworkmin.push(sortdata[i]["totalworkmin"]);
+            this.dataarr.totalworkavg.push(sortdata[i]["totalworkavg"]);
+          }
+          this.refreshData();
+        });
+    },
   },
   mounted() {
     /*     document.getElementById("bdfcglbh1031").className = "bodongfocus";
@@ -501,6 +520,12 @@ export default {
         myChart1.setOption(changshow);
       }
     });
+    const val = {
+      dcbh: '9/11#-9#                      '
+    }
+    setTimeout(() => {
+      this.getDefaultData(val)
+    }, 1000)
   },
   watch: {
     "$store.state.defaultPoint": function (val) {
@@ -511,23 +536,7 @@ export default {
         totalworkmin: [],
         totalworkavg: [],
       };
-      axios
-        .post("/EchartRouter/getGlCurrent", {
-          dcbh: 1, //val.dcbh
-          value: this.queryType,
-        })
-        .then((res) => {
-          let sortdata = res.rows; //.sort(this.compare('riqi'));
-          for (let i = 0; i < sortdata.length; i++) {
-            this.dataarr.riqi.push(
-              this.DateToStr(this.ConvertDateByCNZdate(sortdata[i]["time"]))
-            );
-            this.dataarr.totalworkmax.push(sortdata[i]["totalworkmax"]);
-            this.dataarr.totalworkmin.push(sortdata[i]["totalworkmin"]);
-            this.dataarr.totalworkavg.push(sortdata[i]["totalworkavg"]);
-          }
-          this.refreshData();
-        });
+      this.getDefaultData(val)
     },
   },
 };