LAPTOP-PVOO9257\Lenovo 1 місяць тому
батько
коміт
2684c55dbb
1 змінених файлів з 22 додано та 31 видалено
  1. 22 31
      src/components/RightPanel/JieChuWangQS/index.vue

+ 22 - 31
src/components/RightPanel/JieChuWangQS/index.vue

@@ -15,7 +15,6 @@ export default {
     return {
       queryType: "b.totalworkmax,b.totalworkmin,b.totalworkavg",
       selectedType: "ZHZG",
-      dcbh: '9/11#-9#                      ',
     };
   },
   methods: {
@@ -56,7 +55,7 @@ export default {
       };
       axios
         .post("/EchartRouter/getGlCurrent", {
-          dcbh: this.dcbh, //val.dcbh
+          dcbh: 1, //val.dcbh
           value: this.queryType,
         })
         .then((res) => {
@@ -90,11 +89,13 @@ export default {
         myChart1.setOption(changshow);
       }
     },
+
     showtubiaoBD() {
       xuanzhong = "BD";
       changshow = option3.tubiao1;
       myChart1.setOption(changshow);
     },
+
     showtubiaoGL() {
       xuanzhong = "GL";
       changshow = option3.tubiao3;
@@ -129,26 +130,6 @@ 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";
@@ -173,7 +154,7 @@ export default {
         },
         grid: {
           right: 45,
-          bottom: "3%",
+          bottom: "16%",
           containLabel: true,
         },
         xAxis: {
@@ -520,23 +501,33 @@ export default {
         myChart1.setOption(changshow);
       }
     });
-    const val = {
-      dcbh: '9/11#-9#                      '
-    }
-    setTimeout(() => {
-      this.getDefaultData(val)
-    }, 1000)
   },
   watch: {
     "$store.state.defaultPoint": function (val) {
-      if (val.type !== "功率") return;
+      if (val.type !== "gl") return;
       this.dataarr = {
         riqi: [],
         totalworkmax: [],
         totalworkmin: [],
         totalworkavg: [],
       };
-      this.getDefaultData(val)
+      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();
+        });
     },
   },
 };