Browse Source

提交修改

杨宽 3 years ago
parent
commit
6ce97d56c4
1 changed files with 55 additions and 34 deletions
  1. 55 34
      src/views/WindSite/pages/DraughtFanList.vue

+ 55 - 34
src/views/WindSite/pages/DraughtFanList.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="draught-fan-list">
     <div class="btn-group-tabs">
-        <BtnGroup2 :btnGroups="btnGroupsss" :rowIndex="rowIndex" :index="selectIndex" @select="select"></BtnGroup2>
+      <BtnGroup2 :btnGroups="btnGroupsss" :rowIndex="rowIndex" :index="selectIndex" @select="select"></BtnGroup2>
     </div>
     <div class="df-table">
       <table-2 :data="data" :height="'100%'" @headerClick="headerClick"></table-2>
@@ -216,7 +216,7 @@ export default {
   methods: {
     // 请求服务
     requestData(showLoading) {
-      if(this.wpId.indexOf("GDC") != -1 ){
+      if (this.wpId.indexOf("GDC") != -1) {
         this.requestDataGDC(showLoading);
         return 0;
       }
@@ -226,7 +226,7 @@ export default {
         method: "POST",
         subUrl: "monitorwt/findWtInfoList",
         data: {
-          wpId: that.wpId
+          wpId: that.wpId,
         },
         success(res) {
           res.data.forEach((ele) => {
@@ -237,157 +237,176 @@ export default {
             }
           });
           that.data = {
-            data:res.data,
+            data: res.data,
             column: [
               {
                 name: "风机名称",
                 field: "code",
+                width: 100,
                 is_num: false,
                 is_light: false,
               },
               {
                 name: "冷却风温度",
                 field: "FDJLQFWD",
+                width: 100,
                 is_num: true,
                 is_light: false,
               },
               {
                 name: "有功功率",
                 field: "FJGL",
+                width: 100,
                 is_num: true,
                 is_light: false,
               },
               {
                 name: "液压油温度",
                 field: "YYYW",
+                width: 100,
                 is_num: true,
                 is_light: false,
               },
               {
                 name: "Pcspp温度",
                 field: "PCS_WD",
+                width: 100,
                 is_num: true,
                 is_light: false,
               },
               {
                 name: "U1绕组温度",
                 field: "U1YZWD",
+                width: 100,
                 is_num: true,
                 is_light: false,
               },
               {
                 name: "U2绕组温度",
                 field: "U2YZWD",
+                width: 100,
                 is_num: true,
                 is_light: false,
               },
               {
                 name: "V1绕组温度",
                 field: "V1YZWD",
+                width: 100,
                 is_num: true,
                 is_light: false,
               },
               {
                 name: "V2绕组温度",
                 field: "V2YZWD",
+                width: 100,
                 is_num: true,
                 is_light: false,
               },
               {
                 name: "W1绕组温度",
                 field: "W1YZWD",
+                width: 100,
                 is_num: true,
                 is_light: false,
               },
               {
                 name: "W2绕组温度",
                 field: "W2YZWD",
+                width: 100,
                 is_num: true,
                 is_light: false,
               },
               {
                 name: "轴承A温度",
                 field: "FDJZCAWD",
+                width: 100,
                 is_num: true,
                 is_light: false,
               },
               {
                 name: "轴承B温度",
                 field: "FDJZCBWD",
+                width: 100,
                 is_num: true,
                 is_light: false,
               },
               {
                 name: "齿轮箱温度",
                 field: "CLXWD",
+                width: 100,
                 is_num: true,
                 is_light: false,
               },
               {
                 name: "齿轮箱轴1温度",
                 field: "CLXSRZ1WD",
+                width: 100,
                 is_num: true,
                 is_light: false,
               },
               {
                 name: "齿轮箱轴2温度",
                 field: "CLXSRZ2WD",
+                width: 100,
                 is_num: true,
                 is_light: false,
               },
               {
                 name: "机舱温度",
                 field: "JCWD",
+                width: 100,
                 is_num: true,
                 is_light: false,
               },
               {
                 name: "滑环温度",
                 field: "FDJHHWD",
+                width: 100,
                 is_num: true,
                 is_light: false,
               },
               {
                 name: "环境温度",
                 field: "JCWWD",
+                width: 100,
                 is_num: true,
                 is_light: false,
               },
-            ]
+            ],
           };
         },
       });
     },
     // 光伏电站列表
-    async requestDataGDC(showLoading){
-      let res = await  this.API.requestData({
+    async requestDataGDC(showLoading) {
+      let res = await this.API.requestData({
         showLoading,
         method: "POST",
         subUrl: "monitorinverter/findInverterInfoList",
         data: {
-          wpId: this.wpId
-        }
+          wpId: this.wpId,
+        },
       });
       let column = [
-        {name: "逆变器",field: "code"},
-        {name: "光照强度",field: "JSSSFS"},
-        {name: "有功功率",field: "AI130"},
-        {name: "功率因数",field: "AI067"},
-        {name: "机内温度",field: "AIG071"},
-        {name: "逆变效率",field: "AIG072"},
-        {name: "日发电量",field: "RFDL"},
-        {name: "月发电量",field: "YFDL"},
-        {name: "年发电量",field: "NFDL"},
-        {name: "累计发电量",field: "AIG064"},
+        { name: "逆变器", field: "code" },
+        { name: "光照强度", field: "JSSSFS" },
+        { name: "有功功率", field: "AI130" },
+        { name: "功率因数", field: "AI067" },
+        { name: "机内温度", field: "AIG071" },
+        { name: "逆变效率", field: "AIG072" },
+        { name: "日发电量", field: "RFDL" },
+        { name: "月发电量", field: "YFDL" },
+        { name: "年发电量", field: "NFDL" },
+        { name: "累计发电量", field: "AIG064" },
       ];
-      this.data = {data:res.data.data,column:column};
+      this.data = { data: res.data.data, column: column };
     },
-    getWp () {
+    getWp() {
       let that = this;
       that.API.requestData({
         method: "GET",
         subUrl: "powercompare/windfarmAllAjax",
-        success (res) {
+        success(res) {
           let btnGroups = [
             {
               icon: "svg-wind-site",
@@ -419,7 +438,7 @@ export default {
       });
     },
 
-    renderBtnActiveIndex () {
+    renderBtnActiveIndex() {
       this.btnGroupsss.forEach((pEle, pIndex) => {
         pEle.btns.forEach((cEle, cIndex) => {
           if (cEle.code === this.wpId) {
@@ -430,14 +449,14 @@ export default {
       });
     },
 
-    select (res) {
+    select(res) {
       this.$router.replace({
         path: `/monitor/windsite/draughtfanlist/${res.code}`,
       });
     },
 
     headerClick(param) {
-      this.data.column.forEach(item => {
+      this.data.column.forEach((item) => {
         item.sortable = false;
       });
       this.data.column[param.index].sortable = true;
@@ -447,11 +466,13 @@ export default {
   created() {
     let that = this;
     that.wpId = that.$route.params.wpId;
-     that.getWp();
+    that.getWp();
     that.$nextTick(() => {
       that.requestData(false);
       that.timmer = setInterval(() => {
-        that.requestData(false);
+        that.$nextTick(() => {
+          that.requestData(false);
+        });
       }, that.$store.state.websocketTimeSec);
     });
   },
@@ -461,8 +482,9 @@ export default {
   unmounted() {
     clearInterval(this.timmer);
     this.timmer = null;
-  },  watch: {
-    $route (res) {
+  },
+  watch: {
+    $route(res) {
       this.wpId = res.params.wpId;
       if (res.params.wpId) {
         this.requestData(false);
@@ -471,7 +493,6 @@ export default {
     },
   },
 };
-
 </script>
 
 <style lang="less">
@@ -481,10 +502,10 @@ export default {
   display: flex;
   flex-direction: column;
 
-.btn-group-tabs {
-  display: flex;
-  flex-direction: row;
-}
+  .btn-group-tabs {
+    display: flex;
+    flex-direction: row;
+  }
 
   .df-table {
     border: 0.093vh solid fade(@darkgray, 50%);