Browse Source

升压站报警、scada报警下拉选框修改、接口传参修改

Koishi 3 years ago
parent
commit
5f8e337b42

+ 7 - 0
src/store/index.js

@@ -12,6 +12,7 @@ const state = {
   menuData: [],
   windturbineMap: {},
   moudleName: "",
+  tqmapName: "",
 };
 
 //改变状态的方法
@@ -30,6 +31,9 @@ const mutations = {
   },
   changeModuleName(state, newData) {
     state.moudleName = newData;
+  },
+  changeTqmapName(state, newData) {
+    state.tqmapName = newData;
   }
 };
 
@@ -45,6 +49,9 @@ const actions = {
   },
   changeModuleName(context, str) {
     context.commit("changeModuleName", str);
+  },
+  changeTqmapName(context, str) {
+    context.commit("changeTqmapName", str);
   }
 };
 

+ 72 - 44
src/views/Home/Home.vue

@@ -5,7 +5,7 @@
         <Row type="flex" class="weather">
           <Col :span="24">
             <com-panel
-              :title="tqmap.name || '---'"
+              :title="$store.state.tqmapName || tqmap.name || '------'"
               :sub-title="nowTime + ' 实况'"
               icon="fa fa-map-marker"
             >
@@ -104,7 +104,11 @@
               @click="
                 showDoneChart({
                   data: DayPower,
-                  dialogTitle: planBtnName.indexOf('电站') !== -1 || planBtnName.indexOf('光电厂') !== -1 ? '日照强度' : '日发电量',
+                  dialogTitle:
+                    planBtnName.indexOf('电站') !== -1 ||
+                    planBtnName.indexOf('光电厂') !== -1
+                      ? '日照强度'
+                      : '日发电量',
                   dialogType: 'doneLineChart',
                 })
               "
@@ -528,8 +532,14 @@
             <row align="middle">
               <div class="situation-item fengji">
                 <div class="icon fengji-icon svg-icon svg-icon-white">
-                  <svg-icon class="" :svgid="wpId === '-2' || wpId.indexOf('GDC') !== -1 ?  'svg-photovoltaic' : 'svg-风机'" />
-				  
+                  <svg-icon
+                    class=""
+                    :svgid="
+                      wpId === '-2' || wpId.indexOf('GDC') !== -1
+                        ? 'svg-photovoltaic'
+                        : 'svg-风机'
+                    "
+                  />
                 </div>
                 <div class="info">
                   <div class="title green">接入设备</div>
@@ -978,13 +988,24 @@ export default {
         success(res) {
           that.powerData = [
             {
-              title: that.wpId === '-2' || that.wpId.indexOf('GDC') !== -1 ? "日照强度" : "风速",
+              title:
+                that.wpId === "-2" || that.wpId.indexOf("GDC") !== -1
+                  ? "日照强度"
+                  : "风速",
               value: res.data.jczbmap.ssfs,
-              dialogTitle: that.wpId == 0 ? '详情' : that.wpId === '-2' || that.wpId.indexOf('GDC') !== -1 ? "日照强度详情" : "风速详情",
+              dialogTitle:
+                that.wpId == 0
+                  ? "详情"
+                  : that.wpId === "-2" || that.wpId.indexOf("GDC") !== -1
+                  ? "日照强度详情"
+                  : "风速详情",
               subUrl: "genreset/findGLDetail",
               targetName: "ssfs",
               dialogType: "powerLineChart",
-              max: that.wpId === '-2' || that.wpId.indexOf('GDC') !== -1 ? 1200 : 40,
+              max:
+                that.wpId === "-2" || that.wpId.indexOf("GDC") !== -1
+                  ? 1200
+                  : 40,
             },
             {
               title: "保证功率",
@@ -1084,18 +1105,19 @@ export default {
         },
         success(res) {
           let rdlKey = ["value1", "value2", "value3", "speed"];
-		  let dw = {
-			  units:"",
-			  title:""
-		  };
-		  that.wpId === '-2' || that.wpId.indexOf('GDC') !== -1 ? 
-		  dw={
-			  units:"(w/㎡)",
-			  title:"日照"
-		  } : dw={
-			  units:"(m/s)",
-			  title:"风速"
-		  };
+          let dw = {
+            units: "",
+            title: "",
+          };
+          that.wpId === "-2" || that.wpId.indexOf("GDC") !== -1
+            ? (dw = {
+                units: "(w/㎡)",
+                title: "日照",
+              })
+            : (dw = {
+                units: "(m/s)",
+                title: "风速",
+              });
           let DayPower = {
             units: ["(万kWh)", dw.units],
             value: [
@@ -1157,7 +1179,7 @@ export default {
               value: [],
             },
             {
-              title: that.wpId === '-2' ? "日照强度" : "平均风速",
+              title: that.wpId === "-2" ? "日照强度" : "平均风速",
               smooth: true,
               value: [],
             },
@@ -1255,8 +1277,8 @@ export default {
       this.changeShowType(wpId, planBtnName);
     },
     changeShowBackType(wpId, planBtnName) {
-		this.historyWpId = wpId;
-		this.historyPlanBtnName = planBtnName;
+      this.historyWpId = wpId;
+      this.historyPlanBtnName = planBtnName;
       this.changeShowType(this.historyWpId, this.historyPlanBtnName);
     },
     // 打开弹窗
@@ -1313,17 +1335,23 @@ export default {
       this.dialogTitle = res.dialogTitle;
       this.dialogType = res.dialogType;
 
-	  let hour = this.nowTime.split(":")[0];
-	  let minute = this.nowTime.split(":")[1] < 30 ? minute = 1 : minute = 2;
-	  let valueLength = (hour * 2) + 1 + minute;
-	  
-	  res.data.value && res.data.value.forEach((ele,index)=>{
-		  if(this.wpId === '0'){
-			  ele.title.indexOf('电场') !== -1 ? ele.title+='[风速]' : ele.title;
-			  ele.title.indexOf('电站') !== -1 ? ele.title+='[日照]' : ele.title;
-		  }
-		  ele.value.splice(valueLength,48)
-	  })
+      let hour = this.nowTime.split(":")[0];
+      let minute =
+        this.nowTime.split(":")[1] < 30 ? (minute = 1) : (minute = 2);
+      let valueLength = hour * 2 + 1 + minute;
+
+      res.data.value &&
+        res.data.value.forEach((ele, index) => {
+          if (this.wpId === "0") {
+            ele.title.indexOf("电场") !== -1
+              ? (ele.title += "[风速]")
+              : ele.title;
+            ele.title.indexOf("电站") !== -1
+              ? (ele.title += "[日照]")
+              : ele.title;
+          }
+          ele.value.splice(valueLength, 48);
+        });
       this.powerLineChartData = res.data.value;
       if (res.dialogTitle === "详情") {
         this.powerLineChartYAxises = [
@@ -1340,7 +1368,7 @@ export default {
             unit: "(w/㎡)",
           },
         ];
-      }else if(res.dialogTitle === "风速详情") {
+      } else if (res.dialogTitle === "风速详情") {
         this.powerLineChartYAxises = [
           {
             min: 0,
@@ -1349,16 +1377,16 @@ export default {
             unit: "(m/s)",
           },
         ];
-      }else if(res.dialogTitle === "日照强度详情") {
-	    this.powerLineChartYAxises = [
-		  {
-		    min: 0,
-		    name: "日照",
-		    position: "right",
-		    unit: "(w/㎡)",
-		  },
-	    ];
-	  }else {
+      } else if (res.dialogTitle === "日照强度详情") {
+        this.powerLineChartYAxises = [
+          {
+            min: 0,
+            name: "日照",
+            position: "right",
+            unit: "(w/㎡)",
+          },
+        ];
+      } else {
         this.powerLineChartYAxises = [
           {
             min: 0,

+ 10 - 9
src/views/Home/components/map.vue

@@ -199,14 +199,14 @@
         @clickFj="clickFj"
         @changePeriod="changePeriod"
       ></XHGDC>
-	  
-	  <!-- 海子井 -->
-	  <HZJGDC
-	    v-if="mapName === 'HZJ_GDC'"
-	    :data="sourceMap"
-	    @clickFj="clickFj"
-	    @changePeriod="changePeriod"
-	  ></HZJGDC>
+
+      <!-- 海子井 -->
+      <HZJGDC
+        v-if="mapName === 'HZJ_GDC'"
+        :data="sourceMap"
+        @clickFj="clickFj"
+        @changePeriod="changePeriod"
+      ></HZJGDC>
     </div>
   </div>
 </template>
@@ -253,7 +253,7 @@ export default {
     DWKGDC,
     PLGDC,
     XHGDC,
-	HZJGDC,
+    HZJGDC,
     SvgIcon,
   },
   props: {
@@ -338,6 +338,7 @@ export default {
       this.currentMode = "NX";
       this.mapName = "nx";
       this.mapIndex = -1;
+      this.$store.dispatch("changeTqmapName", "");
       this.$emit("mapClickBack", wpId, planBtnName);
     },
     clickLabel(wpId, planBtnName) {

+ 1 - 0
src/views/Home/components/map/svg-map-nx.vue

@@ -1159,6 +1159,7 @@ export default {
   // 函数
   methods: {
     clickLabel(wpId, planBtnName) {
+      this.$store.dispatch("changeTqmapName", planBtnName);
       this.$emit("clickLabel", wpId, planBtnName);
     },
     popupHide: function () {

+ 1 - 3
src/views/NewPages/alarm-center-1.vue

@@ -607,6 +607,7 @@ export default {
           enddate: enddate,
         },
       });
+
       ////////
       this.tableData = [];
       const resData = data.data;
@@ -649,7 +650,6 @@ export default {
           map[k] = resData[i][k];
         }
       }
-      console.log("map", map);
       // nmap为新的map 整理数据结构
       const nmap = {};
       for (let kv in map) {
@@ -662,7 +662,6 @@ export default {
         }
         nmap[kv] = nchildMap;
       }
-      console.log("nmap", nmap);
       windNum = Object.keys(nmap);
       var cascaderOptions = [];
       var root = {}; // 原始根节点
@@ -702,7 +701,6 @@ export default {
         }
       }
       this.cascaderOptions = cascaderOptions;
-      console.log(123123, cascaderOptions);
     },
     fx() {
       this.startdate = new Date(this.startdate).formatDate("yyyy-MM-dd");