lining 3 anni fa
parent
commit
f2c44ea684
67 ha cambiato i file con 38226 aggiunte e 81384 eliminazioni
  1. 6 8
      .env.development
  2. 0 3
      .env.eapi
  3. 6 10
      .env.production
  4. 19 0
      README.md
  5. 2407 1995
      package-lock.json
  6. 5 4
      package.json
  7. 151 79
      src/App.vue
  8. 88 1
      src/api/index.js
  9. BIN
      src/assets/img/controlcenter/warning.png
  10. BIN
      src/assets/img/type/duration.png
  11. 7 0
      src/assets/styles/main.css
  12. 79 150
      src/components/BasicInformationDetail.vue
  13. 7254 0
      src/components/BoosterStation/cl.vue
  14. 0 5930
      src/components/BoosterStation/dwk.vue
  15. 4860 0
      src/components/BoosterStation/dx.vue
  16. 0 4944
      src/components/BoosterStation/hzj.vue
  17. 16341 0
      src/components/BoosterStation/kb.vue
  18. 0 2844
      src/components/BoosterStation/mch.vue
  19. 0 9139
      src/components/BoosterStation/mhs.vue
  20. 0 5432
      src/components/BoosterStation/nss.vue
  21. 0 5304
      src/components/BoosterStation/pl1.vue
  22. 0 3617
      src/components/BoosterStation/pl2.vue
  23. 2 2
      src/components/BoosterStation/previewPicture.vue
  24. 0 4050
      src/components/BoosterStation/qs.vue
  25. 0 2502
      src/components/BoosterStation/sbdl.vue
  26. 0 4403
      src/components/BoosterStation/sbq.vue
  27. 0 12163
      src/components/BoosterStation/xh.vue
  28. 0 10411
      src/components/BoosterStation/xs.vue
  29. 0 40
      src/components/TitleBarCard.vue
  30. 298 235
      src/components/WindturbineDetailPages.vue
  31. 0 731
      src/components/areaCard.vue
  32. 451 396
      src/components/basicDataDetails.vue
  33. 197 170
      src/components/boxSelect.vue
  34. 377 362
      src/components/check/operationRecords.vue
  35. 803 822
      src/components/control/areaCard.vue
  36. 300 278
      src/components/control/controlAllArea.vue
  37. 1 3
      src/components/control/controlArea.vue
  38. 306 0
      src/components/control/parametersContrast.vue
  39. 2 3
      src/components/dataDetails.vue
  40. 834 0
      src/components/eaxyMatrixBlock.vue
  41. 2 7
      src/components/focus/PhotoelectricDetailPages.vue
  42. 221 209
      src/components/focus/agcDetails.vue
  43. 81 16
      src/components/focus/dataDetails.vue
  44. 1 1
      src/components/focus/detailsCharts.vue
  45. 116 88
      src/components/focus/focusArea.vue
  46. 231 262
      src/components/focus/focusCard.vue
  47. 919 715
      src/components/matrixBlock.vue
  48. 9 38
      src/components/modeControl/detailPages.vue
  49. 34 75
      src/components/modeControl/modeControl.vue
  50. 0 562
      src/components/problem/ProblemMatrixCard.vue
  51. 173 104
      src/components/problem/areaCard.vue
  52. 210 129
      src/components/stationSvgDetailPages.vue
  53. 34 6
      src/components/warning/warningArea.vue
  54. 243 184
      src/components/warning/warningCard.vue
  55. 256 0
      src/components/warning/warningRecords.vue
  56. 3 2
      src/main.js
  57. 21 0
      src/store/index.js
  58. 156 198
      src/utils/BackgroundData.js
  59. 569 2006
      src/utils/BoosterStation.js
  60. 29 26
      src/utils/MessageBridge.js
  61. 0 146
      src/utils/PhotoelectricDetailPages.js
  62. 0 11
      src/utils/config.js
  63. 1 11
      src/utils/request.js
  64. 0 10
      src/utils/storage.js
  65. 0 419
      src/utils/warningInfo.js
  66. 114 123
      src/views/StatusBar.vue
  67. 9 5
      src/views/TitleBar.vue

+ 6 - 8
.env.development

@@ -1,8 +1,6 @@
-VUE_APP_API=http://192.168.10.18:8099
-VUE_APP_WARNING=http://192.168.10.18:8070
-VUE_APP_SHARDINGURL=http://192.168.10.18:8075
-VUE_APP_ADAPTERURL=http://192.168.10.18:8011
-VUE_APP_APIS=192.168.10.18:8099
-VUE_APP_SHARDINGURLS=192.168.10.18:8075
-VUE_APP_ADAPTERURLS=192.168.10.18:8011
-VUE_APP_WARNINGS=92.168.10.18:8070
+VUE_APP_API=http://10.83.68.205:8099
+VUE_APP_WARNING=http://10.83.68.205:8075
+VUE_APP_SHARDINGURL=http://10.83.68.205:8075
+VUE_APP_ADAPTERURL=http://10.83.68.205:8011
+VUE_APP_APIS=10.83.68.205:8099
+VUE_APP_ADAPTERURLS=10.83.68.205:8011

+ 0 - 3
.env.eapi

@@ -1,4 +1 @@
 NODE_ENV=eapi
-VUE_APP_API=https://eapi.nxgqt.org
-VUE_APP_IMAGE=https://eapi.nxgqt.org
-VUE_APP_MAP_KEY=df6LUP4BcbGgSGjZLf8sOBSB6a0fktrb

+ 6 - 10
.env.production

@@ -1,10 +1,6 @@
-# VUE_APP_API=http://18.6.30.53:8075
-# VUE_APP_IMAGE=http://18.6.30.53:8075
-VUE_APP_API=http://18.6.30.63:8099
-VUE_APP_WARNING=http://18.6.30.63:8070
-VUE_APP_SHARDINGURL=http://18.6.30.53:8075
-VUE_APP_ADAPTERURL=http://18.6.30.63:8011
-VUE_APP_APIS=18.6.30.63:8099
-VUE_APP_SHARDINGURLS=18.6.30.53:8075
-VUE_APP_ADAPTERURLS=18.6.30.63:8011
-VUE_APP_WARNINGS=18.6.30.63:8070
+VUE_APP_API=http://192.168.2.205:8099
+VUE_APP_WARNING=http://192.168.2.205:8070
+VUE_APP_SHARDINGURL=http://192.168.2.205:8075
+VUE_APP_ADAPTERURL=http://192.168.2.205:8011
+VUE_APP_APIS=192.168.2.205:8099
+VUE_APP_ADAPTERURLS=192.168.2.205:8011

+ 19 - 0
README.md

@@ -0,0 +1,19 @@
+# neic
+
+## Project setup
+```
+npm install
+```
+
+### Compiles and hot-reloads for development
+```
+npm run serve
+```
+
+### Compiles and minifies for production
+```
+npm run build
+```
+
+### Customize configuration
+See [Configuration Reference](https://cli.vuejs.org/config/).

File diff suppressed because it is too large
+ 2407 - 1995
package-lock.json


+ 5 - 4
package.json

@@ -1,5 +1,5 @@
 {
-  "name": "newneic",
+  "name": "neic",
   "version": "0.1.0",
   "private": true,
   "scripts": {
@@ -16,11 +16,12 @@
     "core-js": "^3.6.5",
     "dayjs": "^1.10.6",
     "echarts": "^5.1.2",
-    "element-plus": "^1.0.2-beta.55",
-    "element-ui": "^2.15.3",
+    "element-plus": "^1.1.0-beta.4",
+    "jquery": "^3.6.0",
     "register-service-worker": "^1.7.1",
     "stompjs": "^2.3.3",
-    "vue": "^3.0.0",
+    "vue": "^3.0.11",
+    "vue-grid-layout": "^3.0.0-beta1",
     "vue-router": "^4.0.0-0",
     "vuex": "^4.0.0-0",
     "xlsx": "^0.17.1"

+ 151 - 79
src/App.vue

@@ -4,7 +4,11 @@
     <el-col>
       <el-row>
         <el-col>
-          <ModeControl ref="modeControl" :current="current" @clicks="handleClick"></ModeControl>
+          <ModeControl
+            ref="modeControl"
+            :current="current"
+            @clicks="handleClick"
+          ></ModeControl>
         </el-col>
       </el-row>
       <el-row>
@@ -19,102 +23,170 @@
       </el-row>
     </el-col>
   </div>
-  <StatusBar class="statusBar" />
+  <!-- <div class="Dialog" v-show="state">
+    <div class="D-" @click="none">-</div>
+  </div> -->
+  <StatusBar class="statusBar" @getData="getData" />
   <router-view />
 </template>
 <script>
-  import TitleBar from 'views/TitleBar.vue'
-  import StatusBar from 'views/StatusBar.vue'
-  import MessageBridge from 'utils/MessageBridge'
-  import ModeControl from "components/modeControl/modeControl.vue";
-  import FocusArea from "components/focus/focusArea.vue";
-  import WarningArea from "components/warning/warningArea.vue";
-  export default {
-    components: {
-      TitleBar,
-      StatusBar,
-      ModeControl,
-      FocusArea,
-      WarningArea
+import TitleBar from "views/TitleBar.vue";
+import StatusBar from "views/StatusBar.vue";
+import MessageBridge from "utils/MessageBridge";
+import ModeControl from "components/modeControl/modeControl.vue";
+import FocusArea from "components/focus/focusArea.vue";
+import WarningArea from "components/warning/warningArea.vue";
+import api from "api/index";
+import boxSelect from "components/boxSelect.vue";
+export default {
+  data() {
+    return {
+      state: false,
+    };
+  },
+  components: {
+    TitleBar,
+    StatusBar,
+    ModeControl,
+    FocusArea,
+    WarningArea,
+    boxSelect,
+  },
+  created: function () {
+    this.getStation();
+    this.initData();
+    this.subscribe();
+  },
+  methods: {
+    getData(val) {
+      console.log(val);
+      this.state = val;
     },
-    created: function () {
-      this.initData()
-      this.subscribe()
+    none() {
+      this.state = false;
     },
-    methods: {
-      initData: function () {
+    initData: function () {
+      let mb = MessageBridge.getInstance();
+      let windturbine = [
+        { key: "/topic/windturbine", action: this.windturbineMessage },
+      ];
+      mb.register(windturbine);
+    },
+    windturbineMessage(msg) {
+      let json = JSON.parse(msg);
+      this.$store.commit("windturbinelist", json);
+      // console.log(json);
+    },
+    getStation() {
+      api.getStation().then((res) => {
+        this.$store.commit("stationList", res.data);
+      });
+    },
+    subscribe() {
+      setTimeout(() => {
+        this.subscribe();
+      }, 20000);
+      if (!this.$store.state.observers) {
         let mb = MessageBridge.getInstance();
-        let windturbine = [{ key: "/topic/windturbine", action: this.windturbineMessage }];
+        let windturbine = [
+          { key: "/topic/windturbine", action: this.windturbineMessage },
+        ];
         let popup = [{ key: "/topic/fault-popup", action: this.faultMessage }];
         let title = [{ key: "/topic/title-info", action: this.titleInfos }];
-        // var heartbeat = [{ key: "/topic/heartbeat-data", action: this.heartbeat }];
-        // mb.register(heartbeat);
+        let suggestion = [
+          { key: "/topic/suggestion", action: this.suggestion },
+        ];
+        mb.register(suggestion);
         mb.register(title);
         mb.register(windturbine);
         mb.register(popup);
-      },
-      windturbineMessage(msg) {
-        let json = JSON.parse(msg);
-        this.$store.commit('windturbinelist', json)
-      },
-      faultMessage(msg) {
-        let json = JSON.parse(msg);
-        this.$store.commit('warning', json)
-      },
-      // heartbeat(msg){
-      //   console.log(msg);
-      // },
-      subscribe() {
-        setTimeout(() => {
-          this.subscribe()
-        }, 20000);
-        if (!this.$store.state.observers) {
-          let mb = MessageBridge.getInstance();
-          let windturbine = [{ key: "/topic/windturbine", action: this.windturbineMessage }];
-          let popup = [{ key: "/topic/fault-popup", action: this.faultMessage }];
-          let title = [{ key: "/topic/title-info", action: this.titleInfos }];
-          let suggestion = [{ key: "/topic/suggestion", action: this.suggestion }];
-          mb.register(suggestion);
-          mb.register(title);
-          mb.register(windturbine);
-          mb.register(popup);
-          this.$store.commit('observers', true)
-        }
+        this.$store.commit("observers", true);
       }
     },
-  }
+  },
+};
 </script>
 <style>
-  @import "../src/assets/styles/main.css";
-  body {
-    /* 设置内容不可选中 */
-    -webkit-user-select: none;
-    -moz-user-select: none;
-    -ms-user-select: none;
-    user-select: none;
-  }
+@import "../src/assets/styles/main.css";
+body {
+  /* 设置内容不可选中 */
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
 
-  /* .app{
+/* .app{
     background-color: #000000;
   } */
-  .right {
-    width: 32%;
-    position: absolute;
-    right: 20px;
-    z-index: 99;
-  }
+.Dialog {
+  width: 520px;
+  height: 800px;
+background-color: rgb(250, 249, 249);
+  position: absolute;
+  right: 30px;
+  z-index: 999;
+  bottom: 50px;
+  /* display: none; */
+}
+.D- {
+  width: 30px;
+  height: 30px;
+  background-color: rgb(167, 204, 192);
+  font-size: 30px;
+  position: absolute;
+  top: 5px;
+  right: 10px;
+  line-height: 30px;
+  text-align: center;
+}
+.D-:hover{
+  background-color: #999999;
+}
+.right {
+  width: 32%;
+  position: absolute;
+  right: 20px;
+  z-index: 99;
+}
 
-  .statusBar {
-    width: 100%;
-    position: absolute;
-    bottom: 0;
-    left: 0;
-  }
+.statusBar {
+  width: 100%;
+  position: absolute;
+  bottom: 0;
+  left: 0;
+}
 
-  .titleBar {
-    width: 100%;
-    position: relative;
-    top: 0;
-    left: 0;
-  }
+.titleBar {
+  width: 100%;
+  position: relative;
+  top: 0;
+  left: 0;
+}
+.el-table__body-wrapper::-webkit-scrollbar-thumb {
+  background-color: #999999;
+  border-radius: 8px;
+}
+.el-collapse-item__wrap {
+  background-color: #000000 !important;
+  box-sizing: border-box !important;
+  padding-left: 27px !important;
+}
+.el-collapse-item__header {
+  background-color: rgb(20, 20, 20) !important;
+  font-size: 12px !important;
+  color: #bfbfbf !important;
+  box-sizing: border-box !important;
+  padding-left: 30px !important;
+  margin-bottom: 2px !important;
+}
+.el-collapse {
+  border: none !important;
+}
+.el-collapse-item__header {
+  border: none !important;
+}
+.el-collapse-item__wrap {
+  border: none !important;
+}
 </style>

+ 88 - 1
src/api/index.js

@@ -8,11 +8,27 @@ const login = (data) => {
         data:data,
     });
 };
+//获取场站
+const getStation = () => {
+    return request({
+        baseURL:process.env.VUE_APP_API,
+        url: `/api/station/`,
+        method: "get",
+    });
+};
+//获取AGC场站
+const getAGCStation = () => {
+    return request({
+        baseURL:process.env.VUE_APP_API,
+        url: `/api/station/agc`,
+        method: "get",
+    });
+};
 //刷新报警信息
 const getSnap = (data) => {
     return request({
         baseURL:process.env.VUE_APP_SHARDINGURL,
-        url: `/alarm/snap/page?pagenum=${data.pagenum}&pagesize=${data.pagesize}&category1=${data.category1}&isopened=${data.isopened}&starttime=${data.starttime}&endtime=${data.endtime}`,
+        url: `/alarm/snap/page?pagenum=${data.pagenum}&pagesize=${data.pagesize}&category1=${data.category1}&isopened=${data.isopened}&starttime=${data.starttime}&endtime=${data.endtime}&windturbineId=${data.windturbineId?data.windturbineId:''}`,
         method: "get",
     });
 };
@@ -149,8 +165,71 @@ const getLatest = (data) => {
         method: "get",
     });
 };
+//获取智能模式下场站
+const getControlType = () => {
+    return request({
+        baseURL:process.env.VUE_APP_API,
+        url: `/api/station/status`,
+        method: "get",
+    });
+};
+const uodateControlType = (data) => {
+    return request({
+        baseURL:process.env.VUE_APP_API,
+        url: `/api/station/status/update?stationid=${data.stationid}&type=${data.type}&userName=${data.userName}`,
+        method: "get",
+    });
+};
+//获取UniformCodes数据
+const getUniformCodes = () => {
+    return request({
+        baseURL:process.env.VUE_APP_API,
+        url: `/api/windturbine/uniform-code`,
+        method: "get",
+    });
+};
+const getBoostStation = () => {
+    return request({
+        baseURL:process.env.VUE_APP_API,
+        url: `/api/station/boost-station`,
+        method: "get",
+    });
+};
+//获取风机code名称
+const getWindturbineFdc = () => {
+    return request({
+        baseURL:process.env.VUE_APP_API,
+        url: `/api/windturbine/fdc`,
+        method: "get",
+    });
+};
+const getWindturbineWarning = (data) => {
+    return request({
+        baseURL:process.env.VUE_APP_SHARDINGURL,
+        url: `/alarm/history/page?pagenum=${data.pagenum}&pagesize=${data.pagesize}&windturbineid=${data.windturbineid}&starttime=${data.starttime}&endtime=${data.endtime}`,
+        method: "get",
+    });
+};
+//获取报警历史数据
+const getFaultHistory = (data) => {
+    return request({
+        baseURL:process.env.VUE_APP_SHARDINGURL,
+        url: `/fault/history/listpage?pagenum=${data.pageIndex}&pagesize=${data.pageSize}&stationid=${data.stationid}&keyword=${data.keyword}&starttime=${data.startTime}&endtime=${data.endTime}`,
+        method: "get",
+    });
+};
+
+const stationCompared = (data) => {
+    return request({
+        baseURL:process.env.VUE_APP_API,
+        url: `/api/station/compared?models=${data}`,
+        method: "get",
+    });
+};
 export default {
     login,
+    getStation,
+    getAGCStation,
     getSnap,
     refreshData,
     windturbControl,
@@ -170,4 +249,12 @@ export default {
     getOriginalWindturbinePower,
     controlRecord,
     getLatest,
+    getControlType,
+    uodateControlType,
+    getUniformCodes,
+    getBoostStation,
+    getWindturbineFdc,
+    getWindturbineWarning,
+    getFaultHistory,
+    stationCompared,
 };

BIN
src/assets/img/controlcenter/warning.png


BIN
src/assets/img/type/duration.png


+ 7 - 0
src/assets/styles/main.css

@@ -113,4 +113,11 @@ body,
   }
   .el-notification .el-icon-warning {
     color: #E6A23C !important;
+  }
+  .el-table td.el-table__cell, .el-table th.el-table__cell.is-leaf{
+    border-bottom: 2px solid black !important;
+  }
+  .el-table__body-wrapper::-webkit-scrollbar {
+    width: 10px;
+    height: 10px;
   }

+ 79 - 150
src/components/BasicInformationDetail.vue

@@ -9,65 +9,6 @@
         ></StandAloneImg>
       </el-col>
       <el-col :span="12" class="rights">
-        <!-- <div class="marks" v-if="healthInfo.bj">
-          <div class="healthInfo">健康指数:</div>
-          <div class="healthTable" v-if="healthInfo.other">
-            <div class="healthTitle">
-              <div class="name">名称</div>
-              <div class="level">等级</div>
-              <div class="times">重要报警次数</div>
-              <div class="times">一般报警次数</div>
-            </div>
-            <div :class="showIndex===3?'healthContent_on':'healthContent'" @click="chooseInfo(3)">
-              <div class="contentName">变桨</div>
-              <el-rate class="starLevel" v-model="healthInfo.bj.star" disabled :max="max" void-color="#141414"
-                text-color="#E8A20D">
-              </el-rate>
-              <div class="contentTimes">{{healthInfo.bj.heightCount}}</div>
-              <div class="contentTimess">{{healthInfo.bj.lowCount}}</div>
-            </div>
-            <div :class="showIndex===2?'healthContent_on':'healthContent'" @click="chooseInfo(2)">
-              <div class="contentName">齿轮箱</div>
-              <el-rate class="starLevel" v-model="healthInfo.clx.star" disabled :max="max" void-color="#242424"
-                text-color="#E8A20D">
-              </el-rate>
-              <div class="contentTimes">{{healthInfo.clx.heightCount}}</div>
-              <div class="contentTimess">{{healthInfo.clx.lowCount}}</div>
-            </div>
-            <div :class="showIndex===1?'healthContent_on':'healthContent'" @click="chooseInfo(1)">
-              <div class="contentName">发电机</div>
-              <el-rate class="starLevel" v-model="healthInfo.fdj.star" disabled :max="max" void-color="#141414"
-                text-color="#E8A20D">
-              </el-rate>
-              <div class="contentTimes">{{healthInfo.fdj.heightCount}}</div>
-              <div class="contentTimess">{{healthInfo.fdj.lowCount}}</div>
-            </div>
-            <div :class="showIndex===5?'healthContent_on':'healthContent'" @click="chooseInfo(5)">
-              <div class="contentName">液压</div>
-              <el-rate class="starLevel" v-model="healthInfo.yy.star" disabled :max="max" void-color="#141414"
-                text-color="#E8A20D">
-              </el-rate>
-              <div class="contentTimes">{{healthInfo.yy.heightCount}}</div>
-              <div class="contentTimess">{{healthInfo.yy.lowCount}}</div>
-            </div>
-            <div :class="showIndex===4?'healthContent_on':'healthContent'" @click="chooseInfo(4)">
-              <div class="contentName">偏航</div>
-              <el-rate class="starLevel" v-model="healthInfo.ph.star" disabled :max="max" void-color="#141414"
-                text-color="#E8A20D">
-              </el-rate>
-              <div class="contentTimes">{{healthInfo.ph.heightCount}}</div>
-              <div class="contentTimess">{{healthInfo.ph.lowCount}}</div>
-            </div>
-            <div :class="showIndex===6?'healthContent_on':'healthContent'">
-              <div class="contentName">其他</div>
-              <el-rate class="starLevel" v-model="healthInfo.other.star" disabled :max="max" void-color="#141414"
-                text-color="#E8A20D">
-              </el-rate>
-              <div class="contentTimes">{{healthInfo.other.heightCount}}</div>
-              <div class="contentTimess">{{healthInfo.other.lowCount}}</div>
-            </div>
-          </div>
-        </div> -->
         <div class="titleList">
           <div
             class="titleItem"
@@ -180,7 +121,7 @@
           </div>
         </div>
         <div class="label">
-          <div
+          <!-- <div
             class="button"
             v-if="types === 2"
             @click="sendCommand({ controlType: '1' })"
@@ -214,7 +155,7 @@
             @click="sendCommand({ controlType: '8' })"
           >
             取消维护
-          </div>
+          </div> -->
           <div
             class="button"
             v-if="selectValue !== ''"
@@ -271,11 +212,11 @@
                 'text-align': 'center',
               }"
             >
-              <el-table-column prop="time" label="时间" width="220">
+              <el-table-column prop="alertTime" label="时间" width="220">
               </el-table-column>
               <el-table-column prop="alertText" label="故障信息" width="280">
               </el-table-column>
-              <el-table-column prop="rankName" label="故障级别">
+              <el-table-column prop="rank" label="故障级别">
               </el-table-column>
             </el-table>
           </el-scrollbar>
@@ -329,6 +270,7 @@ export default {
       restaurants: [],
       lockValues: [],
       windDetails: [],
+      showWarningList: [],
       state1: "",
       showIndex: 1,
       starValue: 3,
@@ -398,6 +340,8 @@ export default {
         "需要登录",
       ],
       recordData: [],
+      intervals: "",
+      refreshTimer: "",
     };
   },
   methods: {
@@ -428,9 +372,6 @@ export default {
           this.selectValue =
             msg.data.lockType === 0 ? "" : String(msg.data.lockType);
         }
-        setTimeout(() => {
-          this.getDetial();
-        }, 1000);
       });
     },
     getLocks() {
@@ -475,6 +416,27 @@ export default {
         });
     },
     async getWarning() {
+      await api.getWindturbineWarning({
+          pagenum: 1000,
+          pagesize: 1,
+          windturbineid: this.windturbine.windturbineId,
+          starttime: dayjs(new Date(this.windturbine.ts).getTime()- 172800000).format('YYYY-MM-DD HH:mm:ss'),
+          endtime:  dayjs(new Date(this.windturbine.ts).getTime()).format('YYYY-MM-DD HH:mm:ss'),
+        })
+        .then((msg) => {
+          if (msg.data) {
+            msg.data.records.forEach((item) => {
+                item.alertTime = dayjs(item.alertTime).format("MM-DD HH:mm:ss");
+              });
+            this.warning = msg.data.records;
+            // this.warningDeal() 
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+    warningDeal(){
       let parts = "";
       switch (this.showIndex) {
         case 1:
@@ -493,46 +455,13 @@ export default {
           parts = "yy";
           break;
       }
-      await api
-        .getWarning(
-          this.windturbine.stationId,
-          this.windturbine.windturbineId,
-          parts
-        )
-        .then((msg) => {
-          if (msg.data.code === 200) {
-            msg.data.data &&
-              msg.data.data.forEach((item) => {
-                item.time = dayjs(item.time).format("MM-DD HH:mm:ss");
-              });
-            this.warning = msg.data.data;
-          }
-        })
-        .catch((err) => {
-          console.log(err);
-        });
+      this.warning.forEach(item =>{
+        if(item.category3 === parts){
+          this.showWarningList.push(item)
+        }
+      })
+
     },
-    // chooseInfo(value) {
-    //   this.showIndex = value
-    //   switch (this.showIndex) {
-    //     case 1:
-    //       this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part6")[0]?.param
-    //       break;
-    //     case 2:
-    //       this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part8")[0]?.param
-    //       break;
-    //     case 3:
-    //       this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part7")[0]?.param
-    //       break;
-    //     case 4:
-    //       this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part10")[0]?.param
-    //       break;
-    //     case 5:
-    //       this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === "part9")[0]?.param
-    //       break;
-    //   }
-    //   this.getWarning()
-    // },
     listedChange() {
       switch (this.selectValue) {
         case "8":
@@ -558,25 +487,22 @@ export default {
           break;
       }
     },
-    // labelChange() {
-    //   let values = BackgroundData.getInstance().Marks;
-    //   if (!values.filter(item => item.title = this.windturbine.windturbineId)[0]) {
-    //     this.menuClicked({ type: "marking" })
-    //   }
-    //   BackgroundData.getInstance().updateMarks(this.windturbine, this.state1);
-    // },
 
     start(bi) {
       this.BasicInfo = bi;
       // this.bindData();
       this.refreshData();
       this.getLocks();
-      this.getDetial();
+      this.intervals = setInterval(this.getDetial, 1000);
       this.records();
+      this.getWarning()
       this.refreshTimer = setInterval(this.refreshData, 3000);
     },
     end() {
+      clearInterval(this.intervals);
       clearInterval(this.refreshTimer);
+      this.intervals = null;
+      this.refreshTimer = null;
     },
     /* 刷新数据 */
     refreshData() {
@@ -587,7 +513,7 @@ export default {
 
     /* 获得数据 */
     onMessage(msg) {
-      this.BasicInfo.BasicInfo.forEach((element) => {
+      this.BasicInfo.forEach((element) => {
         element.param.forEach((im) => {
           let val = msg[im.code];
           if (typeof val !== "undefined") {
@@ -608,77 +534,63 @@ export default {
       });
       switch (this.showIndex) {
         case 1:
-          this.showData = this.BasicInfo.BasicInfo.filter(
-            (item) => item.index === "part6"
+          this.showData = this.BasicInfo.filter(
+            (item) => item.index === 6
           )[0]?.param;
           break;
         case 2:
-          this.showData = this.BasicInfo.BasicInfo.filter(
-            (item) => item.index === "part8"
+          this.showData = this.BasicInfo.filter(
+            (item) => item.index === 8
           )[0]?.param;
           break;
         case 3:
-          this.showData = this.BasicInfo.BasicInfo.filter(
-            (item) => item.index === "part7"
+          this.showData = this.BasicInfo.filter(
+            (item) => item.index === 7
           )[0]?.param;
           break;
         case 4:
-          this.showData = this.BasicInfo.BasicInfo.filter(
-            (item) => item.index === "part10"
+          this.showData = this.BasicInfo.filter(
+            (item) => item.index === 10
           )[0]?.param;
           break;
         case 5:
-          this.showData = this.BasicInfo.BasicInfo.filter(
-            (item) => item.index === "part9"
+          this.showData = this.BasicInfo.filter(
+            (item) => item.index === 9
           )[0]?.param;
           break;
       }
     },
-
-    // bindData() {
-    //   this.BasicInfo.BasicInfo.forEach((element) => {
-    //     if (element.tag == "基本信息") {
-    //       this.generalInfo = element.param;
-    //     } else if (element.tag == "温度信息") {
-    //       this.temperatureInfo = element.param;
-    //     } else if (element.tag == "电网信息") {
-    //       this.powerGridInfo = element.param;
-    //     } else if (element.tag == "桨叶信息") {
-    //       this.pitchInfo = element.param;
-    //     }
-    //   });
-    // },
     selectSvg(index) {
       this.showIndex = index;
-      // this.showData = this.BasicInfo.BasicInfo.filter(item => item.index === `part${this.showIndex+5}`)[0]?.param
       switch (this.showIndex) {
         case 1:
-          this.showData = this.BasicInfo.BasicInfo.filter(
-            (item) => item.index === `part6`
+          this.showData = this.BasicInfo.filter(
+            (item) => item.index === 6
           )[0]?.param;
           break;
         case 2:
-          this.showData = this.BasicInfo.BasicInfo.filter(
-            (item) => item.index === "part8"
+          this.showData = this.BasicInfo.filter(
+            (item) => item.index === 8
           )[0]?.param;
           break;
         case 3:
-          this.showData = this.BasicInfo.BasicInfo.filter(
-            (item) => item.index === "part7"
+          this.showData = this.BasicInfo.filter(
+            (item) => item.index === 7
           )[0]?.param;
           break;
         case 4:
-          this.showData = this.BasicInfo.BasicInfo.filter(
-            (item) => item.index === "part10"
+          this.showData = this.BasicInfo.filter(
+            (item) => item.index === 10
           )[0]?.param;
           break;
         case 5:
-          this.showData = this.BasicInfo.BasicInfo.filter(
-            (item) => item.index === "part9"
+          this.showData = this.BasicInfo.filter(
+            (item) => item.index === 9
           )[0]?.param;
           break;
       }
-      this.getWarning();
+      // this.getWarning();
+      // this.warningDeal()
     },
     sendCommand(msg, windturbine) {
       let bd = BackgroundData.getInstance();
@@ -797,6 +709,7 @@ export default {
         offset: 60,
         duration: 3000,
       });
+      this.getLocks();
     },
 
     /* 控制失败 */
@@ -820,6 +733,12 @@ export default {
           : timeValues[1]
         : date.getTime();
       let startTs = timeValues ? timeValues[0] : endTs - 28800000;
+      const loading = this.$loading({
+        lock: true,
+        text: "数据加载中",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
       api
         .getWindturbinePower({
           thingId: windturbineId
@@ -836,8 +755,10 @@ export default {
             this.windDetails = res.data;
             this.partsName = value.name;
             this.display = true;
+            loading.close();
           } else {
             this.windDetails = [];
+            loading.close();
           }
         });
     },
@@ -851,6 +772,12 @@ export default {
           : timeValues[1]
         : date.getTime();
       let startTs = timeValues ? timeValues[0] : endTs - 28800000;
+      const loading = this.$loading({
+        lock: true,
+        text: "数据加载中",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
       api
         .getOriginalWindturbinePower({
           thingId: windturbineId
@@ -866,8 +793,10 @@ export default {
             this.windDetails = res.data;
             this.partsName = value.name;
             this.display = true;
+            loading.close();
           } else {
             this.windDetails = [];
+            loading.close();
           }
         });
     },

File diff suppressed because it is too large
+ 7254 - 0
src/components/BoosterStation/cl.vue


File diff suppressed because it is too large
+ 0 - 5930
src/components/BoosterStation/dwk.vue


File diff suppressed because it is too large
+ 4860 - 0
src/components/BoosterStation/dx.vue


File diff suppressed because it is too large
+ 0 - 4944
src/components/BoosterStation/hzj.vue


File diff suppressed because it is too large
+ 16341 - 0
src/components/BoosterStation/kb.vue


File diff suppressed because it is too large
+ 0 - 2844
src/components/BoosterStation/mch.vue


File diff suppressed because it is too large
+ 0 - 9139
src/components/BoosterStation/mhs.vue


File diff suppressed because it is too large
+ 0 - 5432
src/components/BoosterStation/nss.vue


File diff suppressed because it is too large
+ 0 - 5304
src/components/BoosterStation/pl1.vue


File diff suppressed because it is too large
+ 0 - 3617
src/components/BoosterStation/pl2.vue


+ 2 - 2
src/components/BoosterStation/previewPicture.vue

@@ -95,8 +95,8 @@ export default {
       imgIndex: 0,
       isChange: true,
       // 图片显示默认大小
-      width: "1200px",
-      height: "800px",
+      width: '1450px',
+      height: '103vh',  
       // 可缩小倍数,为空则可无限缩小
       minification: 3,
       // 可放大倍数 为空则可无限放大

File diff suppressed because it is too large
+ 0 - 4050
src/components/BoosterStation/qs.vue


File diff suppressed because it is too large
+ 0 - 2502
src/components/BoosterStation/sbdl.vue


File diff suppressed because it is too large
+ 0 - 4403
src/components/BoosterStation/sbq.vue


File diff suppressed because it is too large
+ 0 - 12163
src/components/BoosterStation/xh.vue


File diff suppressed because it is too large
+ 0 - 10411
src/components/BoosterStation/xs.vue


+ 0 - 40
src/components/TitleBarCard.vue

@@ -1,40 +0,0 @@
-<template>
-    <div>
-        <span class="title">{{title}}</span>
-        <span class="value">{{value}}</span>
-        <span class="title">{{unit}}</span>
-    </div>
-</template>
-
-<script>
-export default {
-  name: 'TitleBarCard',
-  props: {
-    title: String,
-    value: Number,
-    unit: String,
-  },
-  data() {
-    return {
-      
-    };
-  },
-  methods: {
-    handleClose() {},
-  }
-}
-</script>
-
-<style scoped>
-
-span{
-  font-size: 15px;
-  margin-left: 9px;
-}
-.title{
-    color:#FFFFFF;
-}
-.value{
-  color:#50AE56;
-}
-</style>

+ 298 - 235
src/components/WindturbineDetailPages.vue

@@ -1,252 +1,315 @@
 <template>
-	<el-dialog width="75%" @opened="opened()" @closed="closed()" :show-close="false" class="my-info-dialog">
-		<template #title>
-			<div style="margin-top:-10px;color: #FFFFFF;">风机详情</div>
-		</template>
-		<div class="body">
-			<div class="titleList">
-				<div class="chunkdiv">
-					<div class="title">风机号:&emsp;</div>
-					<div>{{ windturbine.windturbineId }}</div>
-				</div>
-				<div class="chunkdiv" @dblclick="dbClicks(baseDate.windSpeed)">
-					<div class="title">{{baseDate.windSpeed.name}}:&emsp;</div>
-					<div>{{baseDate.windSpeed.value}}{{baseDate.windSpeed.unit}}</div>
-				</div>
-				<div class="chunkdiv" @dblclick="dbClicks({code: 'YDPJFS5M',name: '五分钟平均风速'})">
-					<div class="title">五分钟平均风速:&emsp;</div>
-					<div>{{healthInfo?.averageWindSpeed5?.toFixed(2)}}m/s</div>
-				</div>
-				<div class="chunkdiv" @dblclick="dbClicks(theoreticalPower)">
-					<div class="title">理论功率:&emsp;</div>
-					<div>{{healthInfo?.theoreticalPower?.toFixed(2)}}Kw</div>
-				</div>
-				<div class="chunkdiv" @dblclick="dbClicks(baseDate.power)">
-					<div class="title">{{baseDate.power.name}}:&emsp;</div>
-					<div>{{baseDate.power.value}}{{baseDate.power.unit}}</div>
-				</div>
-				<div class="chunkdiv" @dblclick="dbClicks(baseDate.generatorSpeed)">
-					<div class="title">{{baseDate.generatorSpeed.name}}:&emsp;</div>
-					<div>{{baseDate.generatorSpeed.value}}{{baseDate.generatorSpeed.unit}}</div>
-				</div>
-			</div>
-			<BasicInformationDetail ref="BasicInfo" :types="types" @health-click="handleHealth" :windturbine="windturbine"></BasicInformationDetail>
-		</div>
-	</el-dialog>
+  <el-dialog
+    width="75%"
+    @opened="opened()"
+    @closed="closed()"
+    :show-close="false"
+    class="my-info-dialog"
+  >
+    <template #title>
+      <div style="margin-top: -10px; color: #ffffff">风机详情</div>
+    </template>
+    <div class="body">
+      <div class="titleList">
+        <div class="chunkdiv">
+          <div class="title">风机号:&emsp;</div>
+          <!-- <div>{{ windturbine.windturbineId }}</div> -->
+          <div>{{ windturbine.stationId.slice(0,2)}}-{{windturbine.code }}</div>
+        </div>
+        <div class="chunkdiv" @dblclick="dbClicks(baseDate.windSpeed)">
+          <div class="title">{{ baseDate.windSpeed.name }}:&emsp;</div>
+          <div>{{ baseDate.windSpeed.value }}{{ baseDate.windSpeed.unit }}</div>
+        </div>
+        <div
+          class="chunkdiv"
+          @dblclick="dbClicks({ code: 'YDPJFS5M', name: '五分钟平均风速' })"
+        >
+          <div class="title">五分钟平均风速:&emsp;</div>
+          <div>{{ healthInfo?.averageWindSpeed5?.toFixed(2) }}m/s</div>
+        </div>
+        <div class="chunkdiv" @dblclick="dbClicks(theoreticalPower)">
+          <div class="title">理论功率:&emsp;</div>
+          <div>{{ healthInfo?.theoreticalPower?.toFixed(2) }}Kw</div>
+        </div>
+        <div class="chunkdiv" @dblclick="dbClicks(baseDate.power)">
+          <div class="title">{{ baseDate.power.name }}:&emsp;</div>
+          <div>{{ baseDate.power.value }}{{ baseDate.power.unit }}</div>
+        </div>
+        <div class="chunkdiv" @dblclick="dbClicks(baseDate.generatorSpeed)">
+          <div class="title">{{ baseDate.generatorSpeed.name }}:&emsp;</div>
+          <div>
+            {{ baseDate.generatorSpeed.value
+            }}{{ baseDate.generatorSpeed.unit }}
+          </div>
+        </div>
+      </div>
+      <BasicInformationDetail
+        ref="BasicInfo"
+        :types="types"
+        @health-click="handleHealth"
+        :windturbine="windturbine"
+      ></BasicInformationDetail>
+    </div>
+  </el-dialog>
 </template>
 
 <script>
-	// import YawDetail from "./YawDetail.vue";
-	import api from "api/index";
-	import BasicInformationDetail from "./BasicInformationDetail.vue";
-	import UniformCodes from "utils/UniformCodes";
-	import BackgroundData from 'utils/BackgroundData'
-	// import Worning from "./warning.vue"
-	export default {
-		components: {
-			BasicInformationDetail,
-		},
-		props: {
-			windturbine: Object,
-		},
-		data() {
-			return {
-				BasicInfo: {},
-				healthInfo: {},
-				line: "",
-				alarmTime: "",
-				alarmContent: "",
-				alarms: [],
-				count: false,
-				theoreticalPower:{
-					code: "LLGL",
-					name: "理论功率"
-				},
-				typeList: [{
-					type: 0,
-					name: '已经停机',
-				},
-				{
-					type: 1,
-					name: '上电',
-				},
-				{
-					type: 2,
-					name: '待机',
-				},
-				{
-					type: 3,
-					name: '启动',
-				},
-				{
-					type: 4,
-					name: '并网',
-				},
-				{
-					type: 5,
-					name: '故障',
-				},
-				{
-					type: 6,
-					name: '维护',
-				},
-				{
-					type: 7,
-					name: '离线',
-				},
-				],
-				baseDate: {
-					windSpeed: {
-						name: '',
-						num: '',
-						unit: ''
-					},
-					power: {
-						name: '',
-						num: '',
-						unit: ''
-					},
-					generatorSpeed: {
-						name: '',
-						num: '',
-						unit: ''
-					},
-				},
-				types: null,
-			};
-		},
-		created() {
-			this.UniformCodes = new UniformCodes();
-		},
+import api from "api/index";
+import BasicInformationDetail from "./BasicInformationDetail.vue";
+import BackgroundData from "utils/BackgroundData";
+export default {
+  components: {
+    BasicInformationDetail,
+  },
+  props: {
+    windturbine: Object,
+  },
+  data() {
+    return {
+      BasicInfo: {},
+      healthInfo: {},
+      line: "",
+      alarmTime: "",
+      alarmContent: "",
+      alarms: [],
+      count: false,
+      theoreticalPower: {
+        code: "LLGL",
+        name: "理论功率",
+      },
+      typeList: [
+        {
+          type: 0,
+          name: "已经停机",
+        },
+        {
+          type: 1,
+          name: "上电",
+        },
+        {
+          type: 2,
+          name: "待机",
+        },
+        {
+          type: 3,
+          name: "启动",
+        },
+        {
+          type: 4,
+          name: "并网",
+        },
+        {
+          type: 5,
+          name: "故障",
+        },
+        {
+          type: 6,
+          name: "维护",
+        },
+        {
+          type: 7,
+          name: "离线",
+        },
+      ],
+      baseDate: {
+        windSpeed: {
+          name: "",
+          num: "",
+          unit: "",
+        },
+        power: {
+          name: "",
+          num: "",
+          unit: "",
+        },
+        generatorSpeed: {
+          name: "",
+          num: "",
+          unit: "",
+        },
+      },
+      types: null,
+      UniformCodes: {},
+      refreshTimer: '',
+      refreshTimers: '',
+      // station: [],
+    };
+  },
+  created() {
+    // this.UniformCodes = new UniformCodes();
+    this.getUniformCodes();
+    // this.getWindturbineFdc();
+  },
 
-		methods: {
-			opened() {
-				this.line = "";
-				this.alarmTime = "";
-				this.alarmContent = "";
-				this.BasicInfo = this.UniformCodes.getStationInfos(this.windturbine);
-				this.BasicInfo.windturbineId = this.windturbine.windturbineId;
-				// this.dateDeal(this.BasicInfo)
-				this.$refs.BasicInfo.start(this.BasicInfo);
-				this.initData();
-				this.refreshData();
-				this.refreshTimer = setInterval(this.refreshData, 100)
-			},
-			closed() {
-				// todo 切换页面的时候应该让上一个页面停止刷新数据(调用end方法)
-				// this.$refs.svgRef.closed();
-				// this.$refs.BasicInfo.end();
-				// this.$refs.BasicInfo.labelChange();
-				this.$emit('close');
-				//clearInterval(this.refreshTimer);
-			},
-			dateDeal(BasicInfo) {
-				let showInf = {}
-				showInf = BasicInfo.BasicInfo.filter(item => item.tag === "基本信息")[0]
-				this.baseDate.windSpeed = showInf.param.filter(item => item.name === "风速")[0]
-				this.baseDate.power = showInf.param.filter(item => item.name === "有功功率")[0]
-				this.baseDate.generatorSpeed = showInf.param.filter(item => item.name === "发电机转速")[0]
-				this.baseDate.type = showInf.param.filter(item => item.name === "状态")[0].value ? this.typeList.filter(
-					status => status.type === Number(showInf.param.filter(item => item.name === "状态")[0].value))[0]
-					.name : ''
-				console.log(this.baseDate.generatorSpeed.name);
-				this.types = Number(showInf.param.filter(item => item.name === "状态")[0].value)
-				console.log(this.types)
-			},
-			refreshData() {
-				let bg = BackgroundData.getInstance();
-				bg.initWinturbineBaseData(this.BasicInfo, this.onMessage);
-				this.dateDeal(this.BasicInfo)
-				clearInterval(this.refreshTimer);
-				this.refreshTimer = setInterval(this.refreshData, 5000)
-			},
-			initData() {
-				// axiios.get(`http://${config.calcUrl}/windturbine/line/${this.windturbine.windturbineId}`)
-				//   .then(msg => this.line = msg.data);
-				api.getWindWarning(this.windturbine.windturbineId, '1', '50').then(msg => {
-					let vs = msg.data;
-					if (vs.length <= 0) return;
-					this.alarmTime = BackgroundData.getInstance().formatDate(vs[0].lastUpdateTime);
-					this.alarmContent = vs[0].alertText;
-					this.alarms = msg.data;
-					this.$refs.BasicInfo.alarmd(this.alarms);
-					console.log(this.alarms)
-				})
-					.catch(err => {
-						console.log(err);
-					});
-			},
-			dbClicks(value) {
-				this.$refs.BasicInfo.dbClicks(value, this.windturbine.windturbineId)
-			},
-			handleHealth(value){
-				this.healthInfo = value
-			}
-		},
-		watch: {
-			'windturbine': {
-				handler: function (json) {
-					if (json) {
-						this.initData()
-					}
-				}
-			}
-		}
-	};
+  methods: {
+    // getWindturbineFdc() {
+    //   api.getWindturbineFdc().then((res) => {
+    //     this.station = res.data;
+    //   });
+    // },
+    getUniformCodes() {
+      api.getUniformCodes().then((res) => {
+        this.UniformCodes = res.data;
+      });
+    },
+    opened() {
+      this.line = "";
+      this.alarmTime = "";
+      this.alarmContent = "";
+
+      this.BasicInfo = this.uniformCodesDeal(this.windturbine);
+      this.BasicInfo.windturbineId = this.windturbine.windturbineId;
+      // this.dateDeal(this.BasicInfo)
+      this.$refs.BasicInfo.start(this.BasicInfo);
+      this.initData();
+      this.refreshData();
+      this.refreshTimer = setInterval(this.refreshData, 5000);
+    },
+    uniformCodesDeal(windturbine) {
+      let val = this.UniformCodes[windturbine.stationId][windturbine.modelId];
+      let codes = "";
+      val.forEach((element) => {
+        element.param.forEach((itm) => {
+          codes += itm.code + ",";
+        });
+      });
+      val.codes = codes;
+      return val;
+    },
+    closed() {
+      // todo 切换页面的时候应该让上一个页面停止刷新数据(调用end方法)
+      // this.$refs.svgRef.closed();
+      // this.$refs.BasicInfo.end();
+      // this.$refs.BasicInfo.labelChange();
+      this.$refs.BasicInfo.end();
+      this.$emit("close");
+      clearInterval(this.refreshTimer);
+      clearInterval(this.refreshTimers);
+      this.refreshTimers = null
+      this.refreshTimer = null
+    },
+    dateDeal(BasicInfo) {
+      let showInf = {};
+      showInf = BasicInfo.filter((item) => item.tag === "基本信息")[0];
+      this.baseDate.windSpeed = showInf.param.filter(
+        (item) => item.name === "风速"
+      )[0];
+      this.baseDate.power = showInf.param.filter(
+        (item) => item.name === "有功功率"
+      )[0];
+      this.baseDate.generatorSpeed = showInf.param.filter(
+        (item) => item.name === "发电机转速"
+      )[0];
+      this.baseDate.type = showInf.param.filter(
+        (item) => item.name === "状态"
+      )[0].value
+        ? this.typeList.filter(
+            (status) =>
+              status.type ===
+              Number(
+                showInf.param.filter((item) => item.name === "状态")[0].value
+              )
+          )[0].name
+        : "";
+      this.types = Number(
+        showInf.param.filter((item) => item.name === "状态")[0].value
+      );
+    },
+    refreshData() {
+      let bg = BackgroundData.getInstance();
+      bg.initWinturbineBaseData(this.BasicInfo, this.onMessage);
+      this.dateDeal(this.BasicInfo);
+      // clearInterval(this.refreshTimer);
+      // this.refreshTimers = setInterval(this.refreshData, 5000);
+    },
+    initData() {
+      api
+        .getWindWarning(this.windturbine.windturbineId, "1", "50")
+        .then((msg) => {
+          let vs = msg.data;
+          if (vs.length <= 0) return;
+          this.alarmTime = BackgroundData.getInstance().formatDate(
+            vs[0].lastUpdateTime
+          );
+          this.alarmContent = vs[0].alertText;
+          this.alarms = msg.data;
+          this.$refs.BasicInfo.alarmd(this.alarms);
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+    dbClicks(value) {
+      this.$refs.BasicInfo.dbClicks(value, this.windturbine.windturbineId);
+    },
+    handleHealth(value) {
+      this.healthInfo = value;
+    },
+  },
+  watch: {
+    windturbine: {
+      handler: function (json) {
+        if (json) {
+          this.initData();
+        }
+      },
+    },
+  },
+};
 </script>
 <style scoped>
-	.my-info-dialog {
-		box-shadow: 0px 0px 10px #05bb4c;
-	}
+.my-info-dialog {
+  box-shadow: 0px 0px 10px #05bb4c;
+}
 
-	.body {
-		background-color: black;
-		margin-top: -30px;
-		margin-left: -10px;
-		margin-right: -10px;
-		margin-bottom: -30px;
-		border-bottom: 20px solid rgb(36, 36, 36);
-	}
+.body {
+  background-color: black;
+  margin-top: -30px;
+  margin-left: -10px;
+  margin-right: -10px;
+  margin-bottom: -30px;
+  border-bottom: 20px solid rgb(36, 36, 36);
+}
 
-	.chunkdiv {
-		display: flex;
-		flex-direction: row;
-		justify-content: center;
-		align-items: center;
-		width: 17%;
-		background-color: #363636;
-		margin: 1px;
-		padding: 4px 0px;
-		font-size: 12px;
-		color: #FFFFFF;
-		overflow: hidden;
-		white-space: nowrap;
-	}
+.chunkdiv {
+  display: flex;
+  flex-direction: row;
+  justify-content: center;
+  align-items: center;
+  width: 17%;
+  background-color: #363636;
+  margin: 1px;
+  padding: 4px 0px;
+  font-size: 12px;
+  color: #ffffff;
+  overflow: hidden;
+  white-space: nowrap;
+}
 
-	.title {
-		font-size: 12px;
-		color: #B3B3B3;
-	}
+.title {
+  font-size: 12px;
+  color: #b3b3b3;
+}
 
-	table {
-		margin-left: 2px;
-		margin-right: 2px;
-	}
+table {
+  margin-left: 2px;
+  margin-right: 2px;
+}
 
-	/* td {
+/* td {
 		width: 20%;
 	} */
 
-	el-tabs {
-		background-color: black;
-	}
+el-tabs {
+  background-color: black;
+}
 
-	.svg {
-		height: 67vh;
-	}
-	.titleList{
-		display: flex;
-		flex-direction: row;
-		align-items: center;
-	}
+.svg {
+  height: 67vh;
+}
+.titleList {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+}
 </style>

+ 0 - 731
src/components/areaCard.vue

@@ -1,731 +0,0 @@
-/* 自定义tabs */
-<template>
-    <!-- <transition>
-        <div :class='areaClass' @mouseover="hover = false" @mouseleave="hover = false" onselectstart="return false">
-            <div :class="headerClass">
-                <div :class='circleClass'></div>
-                <span class="gy-card-title">{{ title }}</span>
-                <img class="gy-card-decoration01" src="../../assets/img/controlcenter/decoration01.png">
-                <img class="gy-card-decoration02" src="../../assets/img/controlcenter/decoration02.png">
-            </div>
-            <div :class='contentClass'>
-                <el-scrollbar style="height: 100%">
-                    <slot></slot>
-                </el-scrollbar>
-            </div>
-        </div>
-    </transition> -->
-    <div class="body" :style="style">
-        <img class="logo" src="../assets/img/logo.png" alt="">
-        <div class="title">{{ title }}</div>
-        <div style="margin-top: 50px; height: 91%;">
-            <el-scrollbar>
-                <div class="scoll">
-                    <div class="matrix" v-if="faultList.length>0">
-                        <div class="problemTitle">故障</div>
-                        <MatrixBlock @on-click="handleClick" :dataList="faultList"></MatrixBlock>
-                    </div>
-                    <div class="matrix" v-if="maintainList.length>0">
-                        <div class="problemTitle">维护</div>
-                        <MatrixBlock @on-click="handleClick" :dataList="maintainList"></MatrixBlock>
-                    </div>
-                    <div class="matrix" v-if="offlineList.length>0">
-                        <div class="problemTitle">离线</div>
-                        <MatrixBlock @on-click="handleClick" :dataList="offlineList"></MatrixBlock>
-                    </div>
-                    <div class="matrix" v-if="listedList.length>0">
-                        <div class="problemTitle">挂牌</div>
-                        <MatrixBlock @on-click="handleClick" :dataList="listedList"></MatrixBlock>
-                    </div>
-                    <div class="matrix" v-if="listedList.length>0">
-                        <div class="problemTitle">挂牌</div>
-                        <MatrixBlock @on-click="handleClick" :dataList="listedList"></MatrixBlock>
-                    </div>
-                </div>
-            </el-scrollbar>
-        </div>
-    </div>
-</template>
-
-<script>
-    import BackgroundData from 'utils/BackgroundData'
-    // import ProblemMatrixCard from "./problem/ProblemMatrixCard.vue";
-    import MatrixBlock from "./matrixBlock.vue";
-    export default {
-        name: 'gy-card',
-        components: {
-            // ProblemMatrixCard,
-            MatrixBlock
-        },
-        emits: ["parentRun"],
-        props: {
-            title: {
-                type: String,
-                default: '校验区',
-                required: true
-            },
-            height: {
-                type: Number,
-                default: 200,
-            },
-            areaStyle: {
-                type: String,
-                default: 'check',
-                required: true
-            },
-            circleStyle: {
-                type: String,
-                default: 'green',
-                required: true
-            },
-            contentStyle: {
-                type: String,
-                default: '44',
-                required: true
-            },
-            showFlag: {
-                type: Boolean,
-                default: false,
-            }
-        },
-        data() {
-            return {
-                dialogVisible: false,
-                currentWindturbine: {},
-                values: [],
-                hover: false,
-                big: false,
-                current: 0,
-                faultList: [],
-                maintainList: [],
-                offlineList: [],
-                listedList: [],
-                chooseList: [],
-                titleList: [
-                    {
-                        id: 0,
-                        title: '麻黄山',
-                    },
-                    {
-                        id: 1,
-                        title: '牛首山',
-                    },
-                    {
-                        id: 2,
-                        title: '青山',
-                    },
-                    {
-                        id: 3,
-                        title: '石板泉',
-                    },
-                    {
-                        id: 4,
-                        title: '香山',
-                    },
-                ],
-            }
-        },
-        computed: {
-            style() {
-                return `width: 100%; height: 82%;`
-            },
-            areaClass() {
-                if (this.big) {
-                    return `gy-card-area-big`;
-                } else {
-                    return `gy-card-area-${this.areaStyle}`;
-                }
-            },
-            circleClass() {
-                return `gy-card-circle gy-card-circle-${this.circleStyle}`;
-            },
-            contentClass() {
-                if (this.big) {
-                    return `gy-card-content-big`;
-                } else {
-                    return `gy-card-content-${this.contentStyle}`;
-                }
-            },
-            headerClass() {
-                if (this.hover) {
-                    return `gy-card-header-hover`;
-                } else {
-                    return `gy-card-header`;
-                }
-            }
-        },
-        methods: {
-            handleClick(values) {
-                if (values.active) {
-                    let showIndex = null
-                    this.chooseList.forEach((item, index) => {
-                        if (item.windturbineId === values.windturbineId) {
-                            showIndex = index
-                        }
-                    })
-                    this.chooseList.splice(showIndex, 1);
-                } else {
-                    this.chooseList.push(values)
-                }
-            },
-            /* 右键菜单 */
-            contextmenu() {
-                const { remote } = require("electron");
-                let that = this;
-                const menuTemplate = [
-                    {
-                        label: "启动",
-                        click() {
-                            that.menuClicked({ type: "send", controlType: '1' });
-                        },
-                    },
-                    {
-                        label: "停机",
-                        click() {
-                            that.menuClicked({ type: "send", controlType: '2' });
-                        },
-                    },
-                    {
-                        label: "复位",
-                        click() {
-                            that.menuClicked({ type: "send", controlType: '5' });
-                        },
-                    },
-                    {
-                        label: "维护",
-                        click() {
-                            that.menuClicked({ type: "send", controlType: '6' });
-                        },
-                    },
-                    {
-                        label: "取消维护",
-                        click() {
-                            that.menuClicked({ type: "send", controlType: '8' });
-                        },
-                    },
-                    {
-                        label: "挂牌",
-                        submenu: [
-                            {
-                                label: "检修",
-                                click() {
-                                    that.menuClicked({ type: "lock", value: "CheckLock" });
-                                },
-                            },
-                            {
-                                label: "故障维修",
-                                click() {
-                                    that.menuClicked({ type: "lock", value: "FaultLock" });
-                                },
-                            },
-                            {
-                                label: "场内受累检修",
-                                click() {
-                                    that.menuClicked({ type: "lock", value: "StationCheckLock" });
-                                },
-                            },
-                            {
-                                label: "场内受累故障",
-                                click() {
-                                    that.menuClicked({ type: "lock", value: "StationFaulLock" });
-                                },
-                            },
-                            {
-                                label: "场外受累电网",
-                                click() {
-                                    that.menuClicked({
-                                        type: "lock",
-                                        value: "StationPowerLineLock",
-                                    });
-                                },
-                            },
-                            {
-                                label: "场外受累天气",
-                                click() {
-                                    that.menuClicked({ type: "lock", value: "StationWeatherLock" });
-                                },
-                            },
-                        ],
-                    },
-                    {
-                        label: "取消挂牌",
-                        click() {
-                            that.menuClicked({ type: 'lock', value: 'UnLock' });
-                        },
-                    },
-                    // {
-                    //     label: "标注",
-                    //     click() {
-                    //         that.menuClicked({ type: "marking" });
-                    //     },
-                    // },
-                ];
-                const menu = remote.Menu.buildFromTemplate(menuTemplate);
-
-                menu.popup(remote.getCurrentWindow());
-            },
-            menuClicked(msg) {
-                let bd = BackgroundData.getInstance();
-                
-                if (msg.type == "lock") {
-                    // 挂牌
-                    let los = this.getSelectedItems();
-                    for (let id in los) {
-                        los[id].lockType = msg.value;
-                    }
-                    bd.windturbineControl(
-                        los,
-                        true,
-                        '',
-                        this.controlSuccess,
-                        this.controlError
-                    );
-                } else if (msg.type == "send") {
-                    // 发送
-                    let vs = this.getSelectedItems(true);
-                    for (let item in los) {
-                        los[item].controlType = Number(msg.controlType)
-                    }
-                    bd.windturbineControl(
-                        vs,
-                        false,
-                        '',
-                        '',
-                        this.controlSuccess,
-                        this.controlError
-                    );
-                } else if (msg.type == "marking") {
-                    // 标注
-                    let vvs = this.getSelectedItems();
-                    bd.marking(vvs);
-                }
-                this.clearSelected();
-            },
-            /* 获取选中的项目,isControl:是否是控制 */
-            getSelectedItems() {
-                // isControl
-                let ls = new Array();
-                this.$refs.malfunction.outputSelectedItems(ls);
-                return ls;
-            },
-            /* 清除所有选择 */
-            clearSelected() {
-                this.$refs.malfunction.clearSelected();
-            },
-            filter(value, windturbineId) {
-                let array = [];
-                let flag = false;
-                for (let i = 0; i < value.length; i++) {
-                    if (value[i].windturbineId == windturbineId) {
-                        flag = true;
-                        array.push(flag); // 风机是否已经存在
-                        array.push(i); // 风机在values数组的位置
-                        array.push(value[i].active); // 当前风机是否被选中
-                        break;
-                    }
-                }
-                return array;
-            },
-            changeTitle(id) {
-                this.current = id
-                this.$refs.malfunction.dateClick(id)
-            },
-            addCard(val) {
-                let active = false;
-                let array = this.filter(this.values, val.windturbineId);
-                if (!array[0]) {
-                    // 维护
-                    val.active = active;
-                    if (val.modelId.indexOf("105") >= 0) {
-                        val.rollSpeed *= 9.55;
-                    }
-                    this.values.push(val);
-                } else {
-                    val.active = array[2];
-                    this.values.splice(array[1], 1, val);
-                }
-                console.log(this.values)
-            },
-            showWindows(item) {
-                this.dialogVisible = true;
-                this.currentWindturbine = item;
-            }
-        },
-        watch: {
-            "$store.getters.windturbinelist": {
-                deep: true,
-                handler: function (json) {
-                    let vs = {};
-                    this.faultList = []
-                    this.maintainList = []
-                    this.offlineList = []
-                    this.listedList = []
-                    let arr = Object.keys(json).sort()
-                    for (let id of arr) {
-                        let val = json[id];
-                        this.chooseList.forEach(item => {
-                            if (item.windturbineId === val.windturbineId) {
-                                val.active = true
-                            }
-                        })
-                        switch (val.status) {
-                            case 5:
-                                this.faultList.push(val)
-                                break;
-                            case 6:
-                                this.maintainList.push(val)
-                                break;
-                            case 7:
-                                this.offlineList.push(val)
-                                break;
-                        }
-                        if (val.lockValue > 0) {
-                            this.listedList.push(val)
-                        }
-                    }
-                },
-            },
-        },
-    }
-</script>
-
-<style scoped="scoped">
-    .body {
-        border: 1px solid #373737;
-        width: 100%;
-        margin-left: 15px;
-        margin-top: 10px;
-    }
-
-    .body .scoll {
-        height: 91%;
-    }
-
-    .title {
-        color: #ffffff;
-        font-size: 14px;
-        margin-left: 32px;
-        /* margin-top: 12px; */
-        margin-bottom: 10px;
-        width: 570px;
-        height: 50px;
-        display: flex;
-        align-items: center;
-        position: absolute;
-        background-color: #000000;
-    }
-
-    .title::before {
-        z-index: 1;
-        content: '';
-        position: absolute;
-        left: -18px !important;
-        /* top: 30px !important; */
-        width: 5px;
-        height: 5px;
-        background-color: #54B75A;
-        border-radius: 50%;
-    }
-
-    .logo {
-        position: absolute;
-        top: 2px;
-        left: 18px;
-    }
-
-    .matrix {
-        margin-left: 20px;
-        margin-right: 10px;
-        padding-bottom: 20px;
-        border-bottom: 1px solid rgba(31, 31, 31, 1);
-    }
-
-    .problemTitle {
-        font-size: 12px;
-        color: #BFBFBF;
-        margin-top: 20px;
-        margin-bottom: 20px;
-        margin-left: 12px;
-    }
-
-    .gy-card-header {
-        position: relative;
-        height: 40px;
-        background-color: #292929;
-        color: white;
-        box-sizing: border-box;
-    }
-
-    .gy-card-content-89 {
-        position: relative;
-        height: calc(89vh - 50px);
-        background-color: #000000;
-        color: white;
-        box-sizing: border-box;
-        border-radius: 7px;
-    }
-
-    .gy-card-content-44 {
-        position: relative;
-        height: calc(44vh - 50px);
-        background-color: #000000;
-        color: white;
-        box-sizing: border-box;
-        border-radius: 7px;
-    }
-
-    .gy-card-content-37 {
-        position: relative;
-        height: calc(37vh - 50px);
-        background-color: #000000;
-        color: white;
-        box-sizing: border-box;
-        border-radius: 7px;
-    }
-
-    .gy-card-content-25 {
-        position: relative;
-        height: calc(25vh - 50px);
-        background-color: #000000;
-        color: white;
-        box-sizing: border-box;
-        border-radius: 7px;
-    }
-
-    .gy-card-circle {
-        position: relative;
-        top: 7px;
-        display: inline-block;
-        width: 7px;
-        height: 7px;
-        -moz-border-radius: 50%;
-        -webkit-border-radius: 50%;
-        border-radius: 50%;
-    }
-
-    .gy-card-circle-green {
-        background-color: #008000;
-    }
-
-    .gy-card-circle-yellow {
-        background-color: #ffff00;
-    }
-
-    .gy-card-title {
-        position: relative;
-        top: 10px;
-        left: 10px;
-    }
-
-    .gy-card-decoration01 {
-        position: absolute;
-        right: 80px;
-    }
-
-    .gy-card-decoration02 {
-        position: absolute;
-        top: 20px;
-        right: 20px;
-    }
-
-    .gy-card-area-problem {
-        position: relative;
-        height: 89vh;
-        background-color: #292929;
-        border-radius: 7px;
-        margin: 0px;
-        padding-top: 0;
-        padding-left: 10px;
-        padding-right: 10px;
-        padding-bottom: 10px;
-        box-sizing: border-box;
-    }
-
-    .gy-card-area-alarm {
-        position: relative;
-        height: 25vh;
-        margin-top: 10px;
-        background-color: #292929;
-        border-radius: 7px;
-        padding-left: 10px;
-        padding-right: 10px;
-        padding-bottom: 10px;
-        box-sizing: border-box;
-    }
-
-    .gy-card-area-check {
-        position: relative;
-        height: 44vh;
-        background-color: #292929;
-        border-radius: 7px;
-        margin-top: 10px;
-        padding-top: 0;
-        padding-left: 10px;
-        padding-right: 10px;
-        padding-bottom: 10px;
-        box-sizing: border-box;
-    }
-
-    .gy-card-area-control {
-        position: relative;
-        width: 100%;
-        height: 44vh;
-        background-color: #292929;
-        border-radius: 7px;
-        margin: 0px;
-        padding-top: 0;
-        padding-left: 10px;
-        padding-right: 10px;
-        padding-bottom: 10px;
-        box-sizing: border-box;
-    }
-
-    .gy-card-area-label {
-        position: relative;
-        height: 25vh;
-        margin-top: 10px;
-        background-color: #292929;
-        border-radius: 7px;
-        padding-left: 10px;
-        padding-right: 10px;
-        padding-bottom: 10px;
-        box-sizing: border-box;
-    }
-
-    .gy-card-area-recommended {
-        position: relative;
-        height: 37vh;
-        background-color: #292929;
-        border-radius: 7px;
-        padding-left: 10px;
-        padding-right: 10px;
-        padding-bottom: 10px;
-        box-sizing: border-box;
-    }
-
-    .gy-card-header-hover {
-        position: relative;
-        height: 40px;
-        background-color: #292929;
-        color: white;
-        box-sizing: border-box;
-    }
-
-    .gy-card-area-problem:hover {
-        position: relative;
-        height: 89vh;
-        background-color: #292929;
-        border-radius: 7px;
-        margin: 0px;
-        padding-top: 0;
-        padding-left: 10px;
-        padding-right: 10px;
-        padding-bottom: 10px;
-        box-sizing: border-box;
-    }
-
-    .gy-card-area-alarm:hover {
-        position: relative;
-        height: 25vh;
-        margin-top: 10px;
-        background-color: #292929;
-        border-radius: 7px;
-        padding-left: 10px;
-        padding-right: 10px;
-        padding-bottom: 10px;
-        box-sizing: border-box;
-    }
-
-    .gy-card-area-label:hover {
-        position: relative;
-        height: 25vh;
-        margin-top: 10px;
-        background-color: #292929;
-        border-radius: 7px;
-        padding-left: 10px;
-        padding-right: 10px;
-        padding-bottom: 10px;
-        box-sizing: border-box;
-    }
-
-    .gy-card-area-recommended:hover {
-        position: relative;
-        height: 37vh;
-        background-color: #292929;
-        border-radius: 7px;
-        padding-left: 10px;
-        padding-right: 10px;
-        padding-bottom: 10px;
-        box-sizing: border-box;
-    }
-
-
-    .gy-card-area-big {
-        position: fixed;
-        top: 0px;
-        left: 0px;
-        width: 100vw;
-        height: 100vh;
-        background-color: #292929;
-        border-radius: 7px;
-        margin: 0px;
-        padding-top: 0;
-        padding-left: 10px;
-        padding-right: 10px;
-        padding-bottom: 10px;
-        box-sizing: border-box;
-        z-index: 900;
-    }
-
-    .gy-card-content-big {
-        position: relative;
-        height: calc(100vh - 50px);
-        background-color: #000000;
-        color: white;
-        box-sizing: border-box;
-        border-radius: 7px;
-    }
-
-    .el-scrollbar__wrap {
-        overflow: scroll;
-        width: 110%;
-        height: 120%;
-    }
-
-    ::-webkit-scrollbar {
-        width: 0;
-        height: 0;
-    }
-
-    .scroll {
-        color: #ffffff;
-        min-height: 300px;
-        height: 400px;
-    }
-
-
-    .content {
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        width: 80px;
-        color: #ffffff;
-        height: 25px;
-        border: 1px solid blue;
-        margin-right: 10px;
-        margin-bottom: 10px;
-    }
-
-    .content_on {
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        width: 80px;
-        color: #ffffff;
-        height: 25px;
-        border: 1px solid blue;
-        margin-right: 10px;
-        margin-bottom: 10px;
-        background-color: chartreuse;
-    }
-</style>

+ 451 - 396
src/components/basicDataDetails.vue

@@ -1,438 +1,493 @@
 <template>
-    <el-dialog width="50%" @closed="closed()" :show-close="false" class="my-info-dialog">
-        <template #title>
-            <div class="showTitles">
-                <div class="titles">{{partsName}}详情</div>
-                <div class="model">
-                    <div class="selects" v-show="!switchFlag">
-                        <!-- filterable allow-create default-first-option -->
-                        <el-select @change="search()" class="inputs" v-model="selectValue" placeholder="请选择">
-                            <el-option v-for="item in options" :key="item.value" :label="item.label"
-                                :value="item.value">
-                            </el-option>
-                        </el-select>
-                    </div>
-                    <div class="choose">
-                        <div :class="switchFlag?'interval':'interval_on'" @click="switchChange">等间隔</div>
-                        <div :class="switchFlag?'original_on':'original'" @click="switchChange">原始数据</div>
-                    </div>
-                </div>
+  <el-dialog
+    width="50%"
+    @closed="closed()"
+    :show-close="false"
+    class="my-info-dialog"
+  >
+    <template #title>
+      <div class="showTitles">
+        <div class="titles">{{ partsName }}详情</div>
+        <div class="model">
+          <div class="selects" v-show="!switchFlag">
+            <el-select
+              @change="search()"
+              class="inputs"
+              v-model="selectValue"
+              placeholder="请选择"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </div>
+          <div class="choose">
+            <div
+              :class="switchFlag ? 'interval' : 'interval_on'"
+              @click="switchChange"
+            >
+              等间隔
             </div>
-        </template>
-        <div class="bodys">
-            <div class="dataTitle">
-                <div class="operate">
-                    <el-date-picker class="picker" @change="changes" v-model="timeValue" type="datetimerange"
-                        range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
-                    </el-date-picker>
-                    <div class="buttons" @click="search()">查询</div>
-                </div>
-                <div class="buttons" @click="search('flag')">导出</div>
+            <div
+              :class="switchFlag ? 'original_on' : 'original'"
+              @click="switchChange"
+            >
+              原始数据
             </div>
-            <div :id="echartsId" class="showEcharts"></div>
+          </div>
         </div>
-    </el-dialog>
+      </div>
+    </template>
+    <div class="bodys">
+       <div class="dataTitle">
+        <div class="operate">
+          <el-date-picker
+            class="picker"
+            @change="changes"
+            v-model="timeValue"
+            type="datetimerange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+          >
+          </el-date-picker>
+          <div class="buttons" @click="search()">查询</div>
+        </div>
+        <div class="buttons" @click="search('flag')">导出</div>
+      </div>
+      <div :id="echartsId" class="showEcharts"></div> 
+    </div>
+  </el-dialog>
 </template>
 <script>
-    import * as echarts from "echarts";
-    import dayjs from 'dayjs'
-    import XLSX from 'xlsx'
-    export default {
-        props: {
-            datas: {
-                type: Array,
-                default: () => {
-                    return []
-                },
-            },
-            partsName: Object,
-            echartsId: Object,
+import * as echarts from "echarts";
+import dayjs from "dayjs";
+import XLSX from "xlsx";
+export default {
+  props: {
+    datas: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+    partsName: Object,
+    echartsId: Object,
+    calc: {
+      type: Number,
+      default: 1
+    },
+  },
+  updated() {
+    if (this.timeValue.length === 0) {
+      let date = new Date();
+      this.timeValue[0] = date.getTime() - 28800000;
+      this.timeValue[1] = date.getTime();
+    }
+    this.chooseTime = this.timeValue;
+    this.xdata = [];
+    this.values = [];
+    if (this.timeValue[1] - this.timeValue[0] <= 86400000) {
+      this.datas.map((item) => {
+        this.xdata.push(dayjs(item.ts).format("HH:mm"));
+        this.values.push(
+          item.doubleValue
+            ? (item.doubleValue * this.calc).toFixed(2)
+            : item.doubleValue === 0
+            ? item.doubleValue
+            : item.longValue * this.calc
+        );
+      });
+    } else {
+      this.datas.map((item) => {
+        this.xdata.push(dayjs(item.ts).format("MM-DD HH:mm"));
+        this.values.push(
+          item.doubleValue
+            ? (item.doubleValue * this.calc).toFixed(2)
+            : item.doubleValue === 0
+            ? item.doubleValue
+            : item.longValue * this.calc
+        );
+      });
+    }
+    this.$nextTick(() => {
+      this.getEcharts();
+    });
+  },
+  mounted() {},
+  data() {
+    return {
+      xdata: [],
+      values: [],
+      timeValue: [],
+      chooseTime: [],
+      switchFlag: false,
+      selectValue: "60",
+      options: [
+        {
+          value: "60",
+          label: "一分钟",
         },
-        updated() {
-            if (this.timeValue.length === 0) {
-                let date = new Date()
-                this.timeValue[0] = date.getTime() - 28800000
-                this.timeValue[1] = date.getTime()
-            }
-            this.chooseTime = this.timeValue
-            this.xdata = []
-            this.values = []
-            if ((this.timeValue[1] - this.timeValue[0]) <= 86400000) {
-                this.datas.map(item => {
-                    this.xdata.push(dayjs(item.ts).format('HH:mm'))
-                    this.values.push(item.doubleValue ? item.doubleValue.toFixed(2) : item.doubleValue === 0 ? item.doubleValue : item.longValue)
-                })
-                console.log(this.values)
-            } else {
-                this.datas.map(item => {
-                    this.xdata.push(dayjs(item.ts).format('MM-DD HH:mm'))
-                    this.values.push(item.doubleValue ? item.doubleValue.toFixed(2) : item.doubleValue === 0 ? item.doubleValue : item.longValue)
-                })
-            }
-            this.getEcharts()
+        {
+          value: "300",
+          label: "五分钟",
         },
-        mounted() {
-
+        {
+          value: "600",
+          label: "十分钟",
         },
-        data() {
-            return {
-                xdata: [],
-                values: [],
-                timeValue: [],
-                chooseTime: [],
-                switchFlag: false,
-                selectValue: '60',
-                options: [{
-                    value: '60',
-                    label: '一分钟'
-                }, {
-                    value: '300',
-                    label: '五分钟'
-                }, {
-                    value: '600',
-                    label: '十分钟'
-                }, {
-                    value: '1800',
-                    label: '三十分钟'
-                }, {
-                    value: '3600',
-                    label: '一小时'
-                }, {
-                    value: '86400',
-                    label: '一天'
-                }],
-            }
+        {
+          value: "1800",
+          label: "三十分钟",
         },
-        methods: {
-            changes() {
-                let timeValue = []
-                this.timeValue?.forEach(item => {
-                    timeValue.push(dayjs(item).valueOf())
-                })
-                this.chooseTime = timeValue
-            },
-            switchChange() {
-                this.switchFlag = !this.switchFlag
-                this.selectValue = '60'
-                this.search();
-                const loading = this.$loading({
-                    lock: true,
-                    text: '数据加载中',
-                    spinner: 'el-icon-loading',
-                    background: 'rgba(0, 0, 0, 0.7)'
-                });
-                setTimeout(() => {
-                    loading.close();
-                }, 1000);
-            },
-            search(values) {
-                let times = []
-                this.chooseTime.forEach(item => {
-                    times.push(dayjs(item).valueOf())
-                })
-                times.length > 0 ?
-                    this.switchFlag ? this.$emit('original-data', times) : this.$emit('search-data', times, Number(this.selectValue))
-                    :
-                    this.$message({
-                        showClose: true,
-                        message: '请选择查询日期',
-                        center: true,
-                        type: 'error'
-                    });
-                if (values) {
-                    this.$message({
-                        showClose: true,
-                        center: true,
-                        message: '下载中'
-                    });
-                    setTimeout(() => {
-                        this.export()
-                    }, 2000)
-                }
-            },
-            export() {
-                // 数据源
-                let data = []
-                this.datas.forEach(item => {
-                    let values = {
-                        '时间': dayjs(item.ts).format('MM-DD HH:mm:ss'),
-                        '数值': item.doubleValue,
-                    }
-                    data.push(values)
-                })
-                // 下载的路径
-                let fileName = `${this.partsName}.xlsx`
-                let filePath = '/root/' + fileName
-                // 新建workbook
-                const wb = XLSX.utils.book_new()
-                // 新建worksheet,并载入数据
-                const ws = XLSX.utils.json_to_sheet(data)
-                // 设置每列的列宽,10代表10个字符,注意中文占2个字符
-                ws['!cols'] = [
-                    { wch: 30 },
-                    { wch: 30 },
-                ]
-                // 生成xlsx文件(workbook,worksheet数据,sheet命名)
-                XLSX.utils.book_append_sheet(wb, ws, 'Sheet1')
+        {
+          value: "3600",
+          label: "一小时",
+        },
+        {
+          value: "86400",
+          label: "一天",
+        },
+      ],
+    };
+  },
+  methods: {
+    changes() {
+      let timeValue = [];
+      this.timeValue?.forEach((item) => {
+        timeValue.push(dayjs(item).valueOf());
+      });
+      this.chooseTime = timeValue;
+    },
+    switchChange() {
+      this.switchFlag = !this.switchFlag;
+      this.selectValue = "60";
+      this.search();
+      const loading = this.$loading({
+        lock: true,
+        text: "数据加载中",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      setTimeout(() => {
+        loading.close();
+      }, 1000);
+    },
+    search(values) {
+      let times = [];
+      this.chooseTime.forEach((item) => {
+        times.push(dayjs(item).valueOf());
+      });
+      times.length > 0
+        ? this.switchFlag
+          ? this.$emit("original-data", times)
+          : this.$emit("search-data", times, Number(this.selectValue))
+        : this.$message({
+            showClose: true,
+            message: "请选择查询日期",
+            center: true,
+            type: "error",
+          });
+      if (values) {
+        this.$message({
+          showClose: true,
+          center: true,
+          message: "下载中",
+        });
+        setTimeout(() => {
+          this.export();
+        }, 2000);
+      }
+    },
+    export() {
+      // 数据源
+      let data = [];
+      this.datas.forEach((item) => {
+        let values = {
+          时间: dayjs(item.ts).format("MM-DD HH:mm:ss"),
+          数值: item.doubleValue,
+        };
+        data.push(values);
+      });
+      // 下载的路径
+      let fileName = `${this.partsName}.xlsx`;
+      let filePath = "/root/" + fileName;
+      // 新建workbook
+      const wb = XLSX.utils.book_new();
+      // 新建worksheet,并载入数据
+      const ws = XLSX.utils.json_to_sheet(data);
+      // 设置每列的列宽,10代表10个字符,注意中文占2个字符
+      ws["!cols"] = [{ wch: 30 }, { wch: 30 }];
+      // 生成xlsx文件(workbook,worksheet数据,sheet命名)
+      XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
 
-                // 写文件(workbook,xlsx文件路径+文件名)
-                XLSX.writeFile(wb, filePath)
-                this.$message({
-                    showClose: true,
-                    message: '下载成功',
-                    center: true,
-                    type: 'success'
-                });
+      // 写文件(workbook,xlsx文件路径+文件名)
+      XLSX.writeFile(wb, filePath);
+      this.$message({
+        showClose: true,
+        message: "下载成功",
+        center: true,
+        type: "success",
+      });
+    },
+    getEcharts() {
+      let chartDom = document.getElementById(this.echartsId);
+      let myChart = echarts.init(chartDom, "#ffffff");
+      let option;
+      option = {
+        legend: {
+          show: true,
+          data: [this.partsName],
+          right: 56,
+          icon: "circle",
+          itemWidth: 6,
+          inactiveColor: "#606769",
+          textStyle: {
+            color: "#B3BDC0",
+            fontSize: 12,
+          },
+        },
+        xAxis: [
+          {
+            type: "category",
+            boundaryGap: false,
+            axisLabel: {
+              interval:
+                Number((this.xdata.length / 8).toFixed(0)) > 2
+                  ? Number((this.xdata.length / 8).toFixed(0))
+                  : 0,
+              showMinLabel: true,
+              showMaxLabel: true,
+              formatter: "{value}",
+              fontSize: 14,
+              textStyle: {
+                color: "#606769",
+              },
             },
-            getEcharts() {
-                let chartDom = document.getElementById(this.echartsId);
-                let myChart = echarts.init(chartDom, '#ffffff');
-                let option;
-                option = {
-                    legend: {
-                        show: true,
-                        data: [this.partsName],
-                        right: 56,
-                        icon: "circle",
-                        itemWidth: 6,
-                        inactiveColor: '#606769',
-                        textStyle: {
-                            color: '#B3BDC0',
-                            fontSize: 12,
-                        },
-                    },
-                    xAxis: [
-                        {
-                            type: "category",
-                            boundaryGap: false,
-                            axisLabel: {
-                                interval: (Number((this.xdata.length / 8).toFixed(0)) > 2) ? Number((this.xdata.length / 8).toFixed(0)) : 0,
-                                showMinLabel: true,
-                                showMaxLabel: true,
-                                formatter: "{value}",
-                                fontSize: 14,
-                                textStyle: {
-                                    color: '#606769',
-                                },
-                            },
-                            axisLine: {
-                                show: false,
-                            },
-                            data: this.xdata,
-                        },
-                    ],
-                    yAxis: {
-                        type: "value",
-                        axisLabel: {
-                            formatter: "{value}",
-                            fontSize: 14,
-                        },
-                        axisLine: {
-                            show: false,
-                        },
-                        splitLine: {
-                            show: true,
-                            lineStyle: {
-                                color: '#606769',
-                                type: "dashed",
-                            },
-                        },
-                    },
-                    series: [{
-                        // name: this.partsName,
-                        smooth: true,
-                        showSymbol: false,
-                        data: this.values,
-                        type: 'line'
-                    }]
-                };
-                option && myChart.setOption(option);
+            axisLine: {
+              show: false,
             },
-            closed() {
-                this.chooseTime = []
-                this.timeValue = []
-                this.switchFlag = false
-                this.selectValue = '60'
-                this.$emit('closed');
+            data: this.xdata,
+          },
+        ],
+        yAxis: {
+          type: "value",
+          axisLabel: {
+            formatter: "{value}",
+            fontSize: 14,
+          },
+          axisLine: {
+            show: false,
+          },
+          splitLine: {
+            show: true,
+            lineStyle: {
+              color: "#606769",
+              type: "dashed",
             },
+          },
         },
-    }
+        series: [
+          {
+            // name: this.partsName,
+            smooth: true,
+            showSymbol: false,
+            data: this.values,
+            type: "line",
+          },
+        ],
+      };
+      option && myChart.setOption(option);
+    },
+    closed() {
+      this.chooseTime = [];
+      this.timeValue = [];
+      this.switchFlag = false;
+      this.selectValue = "60";
+      this.$emit("closed");
+    },
+  },
+};
 </script>
 
 <style>
-    .showTitles {
-        display: flex;
-        flex-direction: row;
-        align-items: center;
-        justify-content: space-between;
-        margin-top: -10px;
-        font-size: 18px;
-        color: #FFFFFF;
-        height: 40px;
-    }
+.showTitles {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: space-between;
+  margin-top: -10px;
+  font-size: 18px;
+  color: #ffffff;
+  height: 40px;
+}
 
-    .titles {
-        font-size: 16px;
-        color: #FFFFFF;
-    }
+.titles {
+  font-size: 16px;
+  color: #ffffff;
+}
 
-    .el-dialog__body {
-        padding: 30px 10px 10px 10px;
-    }
+.el-dialog__body {
+  padding: 30px 10px 10px 10px;
+}
 
-    .bodys {
-        display: flex;
-        flex-direction: column;
-        align-items: center;
-        background-color: black;
-        width: 100%;
-        margin-top: -30px;
-    }
+.bodys {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  background-color: black;
+  width: 100%;
+  margin-top: -30px;
+}
 
-    .showEcharts {
-        width: 1030px;
-        height: 480px;
-        margin-left: 30px;
-        /* padding-top: 20px; */
-    }
+.showEcharts {
+  width: 1030px;
+  height: 480px;
+  margin-left: 30px;
+  /* padding-top: 20px; */
+}
 
-    .dataTitle {
-        width: 100%;
-        display: flex;
-        flex-direction: row;
-        align-items: center;
-        justify-content: space-between;
-        margin-top: 10px;
-    }
+.dataTitle {
+  width: 100%;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: space-between;
+  margin-top: 10px;
+}
 
-    .picker {
-        margin-left: 20px;
-        margin-right: 16px;
-    }
+.picker {
+  margin-left: 20px;
+  margin-right: 16px;
+}
 
-    .el-date-editor .el-range-input {
-        background-color: rgba(26, 26, 26, 1) !important;
-        border: none;
-        color: #ffffff !important;
-    }
+.el-date-editor .el-range-input {
+  background-color: rgba(26, 26, 26, 1) !important;
+  border: none;
+  color: #ffffff !important;
+}
 
-    .el-input__inner {
-        background-color: rgba(26, 26, 26, 1) !important;
-    }
+.el-input__inner {
+  background-color: rgba(26, 26, 26, 1) !important;
+}
 
-    .el-date-editor .el-range-separator {
-        color: #ffffff !important;
-    }
+.el-date-editor .el-range-separator {
+  color: #ffffff !important;
+}
 
-    .el-date-table td.in-range div,
-    .el-date-table td.in-range div:hover,
-    .el-date-table.is-week-mode .el-date-table__row.current div,
-    .el-date-table.is-week-mode .el-date-table__row:hover div {
-        background-color: #CECEFF !important;
-    }
+.el-date-table td.in-range div,
+.el-date-table td.in-range div:hover,
+.el-date-table.is-week-mode .el-date-table__row.current div,
+.el-date-table.is-week-mode .el-date-table__row:hover div {
+  background-color: #ceceff !important;
+}
 
-    .operate {
-        display: flex;
-        flex-direction: row;
-        align-items: center;
-        justify-content: center;
-        /* margin-right: 65px; */
-    }
+.operate {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: center;
+  /* margin-right: 65px; */
+}
 
-    .buttons {
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        width: 100px;
-        height: 40px;
-        background-color: rgba(26, 26, 26, 1);
-        border: 1px solid rgba(77, 77, 77, 1);
-        color: #ffffff;
-        margin-right: 28px;
-        font-size: 12px;
-    }
+.buttons {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 100px;
+  height: 40px;
+  background-color: rgba(26, 26, 26, 1);
+  border: 1px solid rgba(77, 77, 77, 1);
+  color: #ffffff;
+  margin-right: 28px;
+  font-size: 12px;
+}
 
-    .model {
-        display: flex;
-        flex-direction: row;
-        align-items: center;
-        color: rgba(240, 240, 240, 1);
-        font-size: 12px;
-    }
+.model {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  color: rgba(240, 240, 240, 1);
+  font-size: 12px;
+}
 
-    .el-switch {
-        width: 453px;
-    }
+.el-switch {
+  width: 453px;
+}
 
-    .el-switch__label {
-        color: #999999 !important;
-    }
+.el-switch__label {
+  color: #999999 !important;
+}
 
-    .el-switch__label.is-active {
-        color: rgba(37, 116, 219, 1) !important;
-    }
+.el-switch__label.is-active {
+  color: rgba(37, 116, 219, 1) !important;
+}
 
-    .selects {
-        margin-right: 16px;
-    }
+.selects {
+  margin-right: 16px;
+}
 
-    .choose {
-        width: 160px;
-        height: 25px;
-        display: flex;
-        flex-direction: row;
-        align-items: center;
-        color: #FFFFFF;
-    }
+.choose {
+  width: 160px;
+  height: 25px;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  color: #ffffff;
+}
 
-    .interval {
-        width: 50%;
-        height: 100%;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        border: 1px solid rgba(77, 77, 77, 1);
-        border-top-left-radius: 12.5px;
-        border-bottom-left-radius: 12.5px;
-    }
+.interval {
+  width: 50%;
+  height: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  border: 1px solid rgba(77, 77, 77, 1);
+  border-top-left-radius: 12.5px;
+  border-bottom-left-radius: 12.5px;
+}
 
-    .interval_on {
-        width: 50%;
-        height: 100%;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        background-color: rgba(29, 106, 235, 1);
-        border: 1px solid rgba(29, 106, 235, 1);
-        border-top-left-radius: 12.5px;
-        border-bottom-left-radius: 12.5px;
-    }
+.interval_on {
+  width: 50%;
+  height: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  background-color: rgba(29, 106, 235, 1);
+  border: 1px solid rgba(29, 106, 235, 1);
+  border-top-left-radius: 12.5px;
+  border-bottom-left-radius: 12.5px;
+}
 
-    .original {
-        width: 50%;
-        height: 100%;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        border: 1px solid rgba(77, 77, 77, 1);
-        border-top-right-radius: 12.5px;
-        border-bottom-right-radius: 12.5px;
-    }
+.original {
+  width: 50%;
+  height: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  border: 1px solid rgba(77, 77, 77, 1);
+  border-top-right-radius: 12.5px;
+  border-bottom-right-radius: 12.5px;
+}
 
-    .original_on {
-        width: 50%;
-        height: 100%;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        background-color: rgba(29, 106, 235, 1);
-        border: 1px solid rgba(29, 106, 235, 1);
-        border-top-right-radius: 12.5px;
-        border-bottom-right-radius: 12.5px;
-    }
+.original_on {
+  width: 50%;
+  height: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  background-color: rgba(29, 106, 235, 1);
+  border: 1px solid rgba(29, 106, 235, 1);
+  border-top-right-radius: 12.5px;
+  border-bottom-right-radius: 12.5px;
+}
 
-    .inputs {
-        border: none;
-        width: 110px !important;
-    }
+.inputs {
+  border: none;
+  width: 110px !important;
+}
 </style>

+ 197 - 170
src/components/boxSelect.vue

@@ -1,180 +1,207 @@
 <template>
-    <div class="box-select__container" @mousedown.left="mouseDown" @mousemove.stop="mouseMove" :class="uuid">
-        <div class="box-select__coordinate" :style="style" ref="selectContainer"></div>
-        <slot></slot>
-    </div>
+  <div
+    class="box-select__container"
+    @mousedown.left="mouseDown"
+    @mousemove.stop="mouseMove"
+    :class="uuid"
+  >
+    <div
+      class="box-select__coordinate"
+      :style="style"
+      ref="selectContainer"
+    ></div>
+    <slot></slot>
+  </div>
 </template>
 
 <script>
-    import { debounce, isNumber } from "lodash"
-    import { ref, onUnmounted, nextTick, shallowRef } from "vue"
-
-    /**
-     * @description 判断元素是否在范围内
-     * @param {Object} dom dom元素
-     */
-    const isWithinRange = (dom, top, bottom, left, right) => {
-        const eleRect = dom.getBoundingClientRect()
-        return !(
-            eleRect.top > bottom ||
-            eleRect.bottom < top ||
-            eleRect.right < left ||
-            eleRect.left > right
-        )
-    }
-
-    export default {
-        name: "BoxSelect",
-        /**
-         * @member props
-         * @property  {String} [node] 要框选的元素,可以是元素名,也可以是class名, 也可以是id名
-         * @property  {String} [selectedClass] 已选中元素附加的class名
-         */
-        props: {
-            node: {
-                required: true,
-                type: String
-            },
-            selectedClass: {
-                type: String,
-                default: 'box-select__hypocritical'
-            }
-        },
-        // 鼠标按下
-        emits: ["mouseUp", "mouseDown"],
-        setup(props, { emit }) {
-            let top = 0,
-                left = 0,
-                width = 0,
-                height = 0,
-                startX = 0,
-                startY = 0,
-                timer = null,
-                // 记录是框选还是点击
-                mouseOn = false
-
-            const style = ref({}),
-                selectContainer = ref(null),
-                // 给当前框容器加一个唯一识别符, 以保证所选择到的元素都是当前容器的. 否则会选择到容器外同名的元素
-                uuid = shallowRef("uuid_" + new Date().valueOf())
-
-            const query = (className = '') => {
-                let domName = `.${uuid.value} ${props.node}`
-                className && (domName += `.${className}`)
-                return Array.from(document.querySelectorAll(domName) || [])
-            }
-
-            const classOperation = (ele, method = 'add', className = '') => ele.classList[method](className)
-
-            const setStyle = (styles = {}, newStyles = {}) => {
-                Object.keys(styles).map((item) => {
-                    newStyles[item] = styles[item] + (isNumber(styles[item]) ? "px" : '')
-                })
-                style.value = newStyles
-            }
-
-            const getAreaWithinElements = () => {
-                const {
-                    bottom,
-                    left,
-                    right,
-                    top
-                } = selectContainer.value.getBoundingClientRect()
-
-                // 所有可框选元素
-                const elements = query()
-                // 已选中元素
-                const selectedElements = elements.filter(item => classOperation(item, 'contains', props.selectedClass))
-                // 未选中元素
-                const unselectedElements = elements.filter(item => !classOperation(item, 'contains', props.selectedClass))
-
-                selectedElements.map(item => {
-                    const withinRange = isWithinRange(item, top, bottom, left, right)
-                    withinRange &&
-                        classOperation(item, 'contains', props.selectedClass) &&
-                        classOperation(item, 'remove', props.selectedClass)
-                })
-
-                unselectedElements.map((item) =>
-                    isWithinRange(item, top, bottom, left, right) &&
-                    classOperation(item, 'add', props.selectedClass))
-
-                return query(props.selectedClass)
-            }
-
-            const mouseDown = debounce((event) => {
-                timer = setTimeout(() => {
-                    mouseOn = true
-                    startX = event.clientX
-                    startY = event.clientY
-                    emit("mouseDown")
-                }, 300)
-                // 重置本次框选的元素列表
-                setStyle({ left, startX, top: startY, width: 0, height: 0, display: "block" })
-            })
-
-            const mouseMove = debounce((event) => {
-                if (!mouseOn) return false
-                const _width = event.clientX - startX
-                const _height = event.clientY - startY
-
-                top = _height > 0 ? startY : event.clientY
-                left = _width > 0 ? startX : event.clientX
-                width = Math.abs(_width)
-                height = Math.abs(_height)
-                setStyle({ left, top, width, height })
-            })
-
-            const mouseUp = debounce((event) => {
-                timer && clearTimeout(timer)
-                // 判断是否鼠标左键
-                if (event.which !== 1) return false
-                // 判断是框选还是点击
-                if (!mouseOn) return false
-                mouseOn = false
-                setStyle({ display: "none" })
-                // 获得已选中的元素
-                const selectedEles = getAreaWithinElements()
-                // 响应事件,并传递本次框选的元素列表
-                emit("mouseUp", selectedEles)
-            })
-
-            nextTick(() => document.addEventListener("mouseup", mouseUp))
-            onUnmounted(() => document.removeEventListener("mouseup", mouseUp))
-
-            return {
-                mouseUp,
-                mouseDown,
-                mouseMove,
-                timer,
-                style,
-                selectContainer,
-                uuid
+import { debounce, isNumber } from "lodash";
+import { ref, onUnmounted, nextTick, shallowRef } from "vue";
+
+/**
+ * @description 判断元素是否在范围内
+ * @param {Object} dom dom元素
+ */
+const isWithinRange = (dom, top, bottom, left, right) => {
+  const eleRect = dom.getBoundingClientRect();
+  return !(
+    eleRect.top > bottom ||
+    eleRect.bottom < top ||
+    eleRect.right < left ||
+    eleRect.left > right
+  );
+};
+
+export default {
+  name: "BoxSelect",
+  /**
+   * @member props
+   * @property  {String} [node] 要框选的元素,可以是元素名,也可以是class名, 也可以是id名
+   * @property  {String} [selectedClass] 已选中元素附加的class名
+   */
+  props: {
+    node: {
+      required: true,
+      type: String,
+    },
+    selectedClass: {
+      type: String,
+      default: "box-select__hypocritical",
+    },
+  },
+  // 鼠标按下
+  emits: ["mouseUp", "mouseDown"],
+  setup(props, { emit }) {
+    let top = 0,
+      left = 0,
+      width = 0,
+      height = 0,
+      startX = 0,
+      startY = 0,
+      timer = null,
+      // 记录是框选还是点击
+      mouseOn = false;
+
+    const style = ref({}),
+      selectContainer = ref(null),
+      // 给当前框容器加一个唯一识别符, 以保证所选择到的元素都是当前容器的. 否则会选择到容器外同名的元素
+      uuid = shallowRef("uuid_" + new Date().valueOf());
+
+    const query = (className = "") => {
+      let domName = `.${uuid.value} ${props.node}`;
+      className && (domName += `.${className}`);
+      return Array.from(document.querySelectorAll(domName) || []);
+    };
+
+    const classOperation = (ele, method = "add", className = "") =>
+      ele.classList[method](className);
+
+    const setStyle = (styles = {}, newStyles = {}) => {
+      Object.keys(styles).map((item) => {
+        newStyles[item] = styles[item] + (isNumber(styles[item]) ? "px" : "");
+      });
+      style.value = newStyles;
+    };
+
+    const getAreaWithinElements = () => {
+      const { bottom, left, right, top } =
+        selectContainer.value.getBoundingClientRect();
+
+      // 所有可框选元素
+      const elements = query();
+      // // 已选中元素
+      // const selectedElements = elements.filter((item) =>
+      //   classOperation(item, "contains", props.selectedClass)
+      // );
+      // // 未选中元素
+      // const unselectedElements = elements.filter(
+      //   (item) => !classOperation(item, "contains", props.selectedClass)
+      // );
+      // 本次框选元素
+      let selctList = []
+        for (const i in elements[0].children) {
+          if(Number(i) || i === '0'){
+            let val = elements[0].children[i]
+            const withinRange = isWithinRange(val, top, bottom, left, right);
+            if(withinRange){
+                selctList.push(val)
             }
+          }
         }
-    }
+      emit('selectList', selctList);
+      // selectedElements.map((item) => {
+      //     const withinRange = isWithinRange(item, top, bottom, left, right);
+      //     withinRange &&
+      //       classOperation(item, "add", props.selectedClass)
+      //   });
+      //   unselectedElements.map(
+      //     (item) =>
+      //       isWithinRange(item, top, bottom, left, right) &&
+      //       classOperation(item, "add", props.selectedClass)
+      //   );
+
+      // return query(props.selectedClass);
+    };
+
+    const mouseDown = debounce((event) => {
+      timer = setTimeout(() => {
+        mouseOn = true;
+        startX = event.clientX;
+        startY = event.clientY;
+        emit("mouseDown");
+      }, 300);
+      // 重置本次框选的元素列表
+      setStyle({
+        left,
+        startX,
+        top: startY,
+        width: 0,
+        height: 0,
+        display: "block",
+      });
+    });
+
+    const mouseMove = debounce((event) => {
+      if (!mouseOn) return false;
+      const _width = event.clientX - startX;
+      const _height = event.clientY - startY;
+
+      top = _height > 0 ? startY : event.clientY;
+      left = _width > 0 ? startX : event.clientX;
+      width = Math.abs(_width);
+      height = Math.abs(_height);
+      setStyle({ left, top, width, height });
+    });
+
+    const mouseUp = debounce((event) => {
+      timer && clearTimeout(timer);
+      // 判断是否鼠标左键
+      if (event.which !== 1) return false;
+      // 判断是框选还是点击
+      if (!mouseOn) return false;
+      mouseOn = false;
+      setStyle({ display: "none" });
+      // 获得已选中的元素
+      const selectedEles = getAreaWithinElements();
+      // 响应事件,并传递本次框选的元素列表
+      emit("mouseUp", selectedEles);
+    });
+
+    nextTick(() => document.addEventListener("mouseup", mouseUp));
+    onUnmounted(() => document.removeEventListener("mouseup", mouseUp));
+
+    return {
+      mouseUp,
+      mouseDown,
+      mouseMove,
+      timer,
+      style,
+      selectContainer,
+      uuid,
+    };
+  },
+};
 </script>
 
 <style lang="scss">
-    .box-select__container {
-        background-color: #ffffff;
-        height: 50vh;
-    }
-
-    .box-select__coordinate {
-        position: fixed;
-        z-index: 11;
-        left: 0;
-        top: 0;
-        width: 0;
-        height: 0;
-        background: rgba(0, 0, 0, .5);
-        border: 1px solid rgba(0, 0, 0, 1);
-        opacity: 0.6;
-        pointer-events: none;
-    }
-
-    .box-select__hypocritical {
-        background-color: blue;
-    }
+.box-select__container {
+  // height: 50vh;
+}
+
+.box-select__coordinate {
+  position: fixed;
+  z-index: 11;
+  left: 0;
+  top: 0;
+  width: 0;
+  height: 0;
+  // background: rgb(250, 12, 12);
+  border: 1px solid blue;
+  opacity: 0.6;
+  pointer-events: none;
+}
+
+.box-select__hypocritical {
+  background-color: blue;
+}
 </style>

+ 377 - 362
src/components/check/operationRecords.vue

@@ -1,393 +1,408 @@
 <template>
-    <el-dialog width="50%" @open="opened()" @closed="closed()" :show-close="false" class="my-info-dialog">
-        <template #title>
-            <div class="showTitles">
-                <div class="titles">校验记录详情</div>
-            </div>
-        </template>
-        <div class="bodys">
-            <!-- <el-cascader ref="cascaderHandle" :options="options" :props="{ checkStrictly: true }" clearable @change="handleChange">
-            </el-cascader> -->
-            <div class="left">
-                <el-scrollbar>
-                    <el-input placeholder="输入关键字进行过滤" v-model="filterText">
-                    </el-input>
-                    <el-tree class="filter-tree" :data="showData" :props="defaultProps" :filter-node-method="filterNode"
-                        node-key="id" :default-expanded-keys="[0]" ref="tree" @node-click="handleChange">
-                    </el-tree>
-                </el-scrollbar>
-            </div>
-            <div class="rights">
-                <div class="dateBar">
-                    <el-date-picker class="pickers" @change="changes" v-model="timeValue" type="datetimerange"
-                        range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
-                    </el-date-picker>
-                    <div class="buttons" @click="getControlRecord()">查询</div>
-                </div>
-                <el-scrollbar style="height:86%;">
-                    <div class="tables">
-                        <el-table :data="recordData" class="table" style=" width:100%" height="49vh" :header-cell-style="{
-                            background: 'rgb(30,30,30)',
-                            color: 'rgb(220,220,220)',
-                            padding: '4px',
-                            fontSize: '14px',
-                            'border-bottom': 'solid 1px rgba(77, 77, 77, 1)',
-                          }" :cell-style="{
-                            height: '40px',
-                            background: 'rgb(30,30,30)',
-                            color: 'rgb(220,220,220)',
-                            padding: '3px',
-                            fontSize: '12px',
-                            'border-bottom': '1px solid #000000'
-                          }">
-                            <el-table-column prop="time" label="日期" width="120" align="center">
-                            </el-table-column>
-                            <el-table-column prop="windturbineId" label="风机号" width="120" align="center">
-                            </el-table-column>
-                            <el-table-column prop="controls" label="控制命令" width="120" align="center">
-                            </el-table-column>
-                            <el-table-column prop="result" label="操作结果" align="center">
-                            </el-table-column>
-                            <el-table-column prop="userName" label="操作人" width="120" align="center">
-                            </el-table-column>
-                        </el-table>
-                    </div>
-                </el-scrollbar>
-                <div class="paginations">
-                    <el-pagination :hide-on-single-page="true" :page-size="currentPage" background
-                        layout="prev, pager, next" :total="total" @current-change="handleCurrentChange">
-                    </el-pagination>
-                </div>
-            </div>
+  <el-dialog
+    width="50%"
+    @open="opened()"
+    @closed="closed()"
+    :show-close="false"
+    class="my-info-dialog"
+  >
+    <template #title>
+      <div class="showTitles">
+        <div class="titles">校验记录详情</div>
+      </div>
+    </template>
+    <div class="bodys">
+      <div class="left">
+        <el-scrollbar>
+          <el-input placeholder="输入关键字进行过滤" v-model="filterText">
+          </el-input>
+          <el-tree
+            class="filter-tree"
+            :data="showData"
+            :props="defaultProps"
+            :filter-node-method="filterNode"
+            node-key="id"
+            :default-expanded-keys="[0]"
+            ref="tree"
+            @node-click="handleChange"
+          >
+          </el-tree>
+        </el-scrollbar>
+      </div>
+      <div class="rights">
+        <div class="dateBar">
+          <el-date-picker
+            class="pickers"
+            @change="changes"
+            v-model="timeValue"
+            type="datetimerange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+          >
+          </el-date-picker>
+          <div class="buttons" @click="getControlRecord()">查询</div>
         </div>
-
-    </el-dialog>
+        <el-scrollbar style="height: 86%">
+          <div class="tables">
+            <el-table
+              :data="recordData"
+              class="table"
+              style="width: 100%"
+              height="49vh"
+              :header-cell-style="{
+                background: 'rgb(30,30,30)',
+                color: 'rgb(220,220,220)',
+                padding: '4px',
+                fontSize: '14px',
+                'border-bottom': 'solid 1px rgba(77, 77, 77, 1)',
+              }"
+              :cell-style="{
+                height: '40px',
+                background: 'rgb(30,30,30)',
+                color: 'rgb(220,220,220)',
+                padding: '3px',
+                fontSize: '12px',
+                'border-bottom': '1px solid #000000',
+              }"
+            >
+              <el-table-column
+                prop="time"
+                label="日期"
+                width="120"
+                align="center"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="showName"
+                label="风机号"
+                width="120"
+                align="center"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="controls"
+                label="控制命令"
+                width="100"
+                align="center"
+              >
+              </el-table-column>
+              <el-table-column prop="result" label="操作结果" align="center">
+              </el-table-column>
+              <el-table-column
+                prop="userName"
+                label="操作人"
+                width="160"
+                align="center"
+              >
+              </el-table-column>
+            </el-table>
+          </div>
+        </el-scrollbar>
+        <div class="paginations">
+          <el-pagination
+            :hide-on-single-page="true"
+            :page-size="currentPage"
+            background
+            layout="prev, pager, next"
+            :total="total"
+            @current-change="handleCurrentChange"
+          >
+          </el-pagination>
+        </div>
+      </div>
+    </div>
+  </el-dialog>
 </template>
 <script>
-    import dayjs from 'dayjs'
-    import api from "api/index";
-    export default {
-        props: {
-
+import dayjs from "dayjs";
+import api from "api/index";
+export default {
+  props: {},
+  updated() {
+    if (this.timeValue.length === 0) {
+      let date = new Date();
+      this.timeValue[0] = date.getTime() - 28800000;
+      this.timeValue[1] = date.getTime() + 3600000;
+    }
+  },
+  mounted() {},
+  data() {
+    return {
+      currentPage: 10,
+      filterText: "",
+      pageIndex: 1,
+      station: [],
+      datas: {},
+      chooseStation: {},
+      timeValue: [],
+      showData: [
+        {
+          id: 0,
+          windturbineId: "全部",
+          stationId: "",
+          children: [],
         },
-        updated() {
-            if (this.timeValue.length === 0) {
-                let date = new Date()
-                this.timeValue[0] = date.getTime() - 28800000
-                this.timeValue[1] = date.getTime() + 3600000
-            }
+      ],
+      defaultProps: {
+        children: "children",
+        label: "windturbineId",
+      },
+      recordData: [],
+      total: "",
+      controlErorCodes: [
+        "控制成功",
+        "控制命令发送失败",
+        "无效的控制地址",
+        "被控设备异常",
+        "无效的控制功能",
+        "网络连接错误,检查场站通信",
+        "控制结果读取超时",
+        "未知错误",
+        "控制命令错误",
+        "收到无法识别数据",
+        "未读取到数据包",
+        "未知错误",
+        "风机操作过频繁",
+        "风机被挂牌",
+        "风机操作与风机状态不符",
+        "需要登录",
+      ],
+    };
+  },
+  methods: {
+    // getWindturbineFdc() {
+    //   api.getWindturbineFdc().then((res) => {
+    //     this.station = res.data;
+    //     this.getControlRecord();
+    //   });
+    // },
+    dataDeal() {
+      let stationList = this.$store.state.stationList;
+      this.showData[0].children = [];
+      stationList.forEach((item, index) => {
+        let obj = {};
+        obj.id = index + 1;
+        obj.windturbineId = item.address;
+        obj.stationId = item.code;
+        obj.children = [];
+        this.showData[0].children.push(obj);
+      });
+      this.datas = this.$store.state.windturbinelist
+        ? this.$store.state.windturbinelist
+        : {};
+      let arr = Object.keys(this.datas).sort();
+      for (let id of arr) {
+        let item = this.datas[id];
+        this.showData[0].children
+          .filter((val) => val.stationId === item.stationId)[0]
+          .children.push(item);
+      }
+    },
+    handleChange(value) {
+      this.chooseStation = value;
+      this.pageIndex = 1;
+      this.getControlRecord(value);
+    },
+    closed() {
+      this.pageIndex = 1;
+      this.chooseStation = {};
+      this.showData = [
+        {
+          id: 0,
+          windturbineId: "全部",
+          stationId: "",
+          children: [],
         },
-        mounted() {
+      ];
+      let stationList = this.$store.state.stationList;
+      stationList.forEach((item, index) => {
+        let obj = {};
+        obj.id = index + 1;
+        obj.windturbineId = item.address;
+        obj.stationId = item.code;
+        obj.children = [];
+        this.showData[0].children.push(obj);
+      });
 
-        },
-        data() {
-            return {
-                currentPage: 10,
-                filterText: '',
-                pageIndex: 1,
-                datas: {},
-                chooseStation: {},
-                timeValue: [],
-                showData: [
-                    {
-                        id: 0,
-                        windturbineId: '全部',
-                        stationId: "",
-                        children: [
-                            {
-                                id: 1,
-                                windturbineId: '麻黄山',
-                                stationId: "MHS_FDC",
-                                children: []
-                            }, {
-                                id: 2,
-                                windturbineId: '牛首山',
-                                stationId: "NSS_FDC",
-                                children: []
-                            }, {
-                                id: 3,
-                                windturbineId: '青山',
-                                stationId: "QS_FDC",
-                                children: []
-                            }, {
-                                id: 4,
-                                windturbineId: '石板泉',
-                                stationId: "SBQ_FDC",
-                                children: []
-                            }, {
-                                id: 5,
-                                windturbineId: '香山',
-                                stationId: "XS_FDC",
-                                children: []
-                            },
-                        ]
-                    },
-                ],
-                defaultProps: {
-                    children: 'children',
-                    label: 'windturbineId'
-                },
-                recordData: [],
-                total: '',
-                controlErorCodes: [
-                    "控制成功",
-                    "控制命令发送失败",
-                    "无效的控制地址",
-                    "被控设备异常",
-                    "无效的控制功能",
-                    "网络连接错误,检查场站通信",
-                    "控制结果读取超时",
-                    "未知错误",
-                    "控制命令错误",
-                    "收到无法识别数据",
-                    "未读取到数据包",
-                    "未知错误",
-                    "风机操作过频繁",
-                    "风机被挂牌",
-                    "风机操作与风机状态不符",
-                    "需要登录",
-                ],
+      this.$emit("closed");
+    },
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.windturbineId.indexOf(value) !== -1;
+    },
+    handleCurrentChange(val) {
+      this.pageIndex = val;
+      this.getControlRecord();
+    },
+    opened() {
+      let date = new Date();
+      this.timeValue[0] = date.getTime() - 28800000;
+      this.timeValue[1] = date.getTime() + 3600000;
+      this.getControlRecord();
+    },
+    getControlRecord() {
+      api
+        .controlRecord({
+          stationId: this.chooseStation.stationId
+            ? this.chooseStation.stationId
+            : "",
+          userName: "",
+          windturbineId: this.chooseStation.id
+            ? ""
+            : this.chooseStation.stationId
+            ? this.chooseStation.windturbineId
+            : "",
+          startTime: dayjs(this.timeValue[0]).format("YYYY/MM/DD HH:mm:ss"),
+          endTime: dayjs(this.timeValue[1]).format("YYYY/MM/DD HH:mm:ss"),
+          pageSize: this.currentPage,
+          pageIndex: this.pageIndex,
+        })
+        .then((res) => {
+          if (res) {
+            let types = {
+              Start: "启动",
+              Stop: "停止",
+              Reset: "复位",
+              Maintain: "维护",
+              UnMaintain: "取消维护",
+              Lock: "挂牌",
+              UnLock: "取消挂牌",
             };
-        },
-        methods: {
-            dataDeal() {
-                this.datas = this.$store.state.windturbinelist ? this.$store.state.windturbinelist : {}
-                let arr = Object.keys(this.datas).sort()
-                for (let id of arr) {
-                    let item = this.datas[id];
-                    switch (item.windturbineId.slice(0, 2)) {
-                        case 'MG':
-                            this.showData[0].children[0].children.push(item)
-                            break;
-                        case 'NG':
-                            this.showData[0].children[1].children.push(item)
-                            break;
-                        case 'QG':
-                            this.showData[0].children[2].children.push(item)
-                            break;
-                        case 'SG':
-                            this.showData[0].children[3].children.push(item)
-                            break;
-                        case 'XG':
-                            this.showData[0].children[4].children.push(item)
-                            break;
-                    }
-                }
-                console.log(this.showData);
-            },
-            handleChange(value) {
-                this.chooseStation = value
-                this.pageIndex = 1
-                this.getControlRecord(value)
-            },
-            closed() {
-                this.pageIndex = 1
-                this.chooseStation = {}
-                this.showData = [
-                    {
-                        id: 0,
-                        windturbineId: '全部',
-                        stationId: "",
-                        children: [
-                            {
-                                id: 1,
-                                windturbineId: '麻黄山',
-                                stationId: "MHS_FDC",
-                                children: []
-                            }, {
-                                id: 2,
-                                windturbineId: '牛首山',
-                                stationId: "NSS_FDC",
-                                children: []
-                            }, {
-                                id: 3,
-                                windturbineId: '青山',
-                                stationId: "QS_FDC",
-                                children: []
-                            }, {
-                                id: 4,
-                                windturbineId: '石板泉',
-                                stationId: "SBQ_FDC",
-                                children: []
-                            }, {
-                                id: 5,
-                                windturbineId: '香山',
-                                stationId: "XS_FDC",
-                                children: []
-                            },
-                        ]
-                    },
-                ],
-                this.$emit('closed');
-            },
-            filterNode(value, data) {
-                if (!value) return true;
-                return data.windturbineId.indexOf(value) !== -1;
-            },
-            handleCurrentChange(val) {
-                this.pageIndex = val
-                this.getControlRecord()
-            },
-            opened(){
-                let date = new Date()
-                this.timeValue[0] = date.getTime() - 28800000
-                this.timeValue[1] = date.getTime() + 3600000
-                this.getControlRecord()
-            },
-            getControlRecord() {
-                api.controlRecord({
-                    stationId: this.chooseStation.stationId ? this.chooseStation.stationId : "",
-                    userName: "",
-                    windturbineId: this.chooseStation.id ? "" : this.chooseStation.stationId ? this.chooseStation.windturbineId : "",
-                    startTime: dayjs(this.timeValue[0]).format('YYYY/MM/DD HH:mm:ss'),
-                    endTime: dayjs(this.timeValue[1]).format('YYYY/MM/DD HH:mm:ss'),
-                    pageSize: this.currentPage,
-                    pageIndex: this.pageIndex,
-                }).then(res => {
-                    if (res) {
-                        let types = {
-                            Start: '启动',
-                            Stop: '停止',
-                            Reset: '复位',
-                            Maintain: '维护',
-                            UnMaintain: '取消维护',
-                            Lock: '挂牌',
-                            UnLock: '取消挂牌',
-
-                        }
-                        res.data.dataList.forEach(item => {
-                            item.time = dayjs(item.time).format('MM-DD HH:mm:ss')
-                            item.result = this.controlErorCodes[item.errorCode]
-                            item.controls = types[item.controlType]
-                        })
-                        this.total = res.data.total
-                        this.recordData = res.data.dataList
-                    }
-                })
-            },
-        },
-        watch: {
-            filterText(val) {
-                this.$refs.tree.filter(val);
-            }
-        },
-    }
+            res.data.dataList.forEach((item) => {
+              item.time = dayjs(item.time).format("MM-DD HH:mm:ss");
+              item.result = this.controlErorCodes[item.errorCode];
+              item.controls = types[item.controlType];
+              item.showName = item.windturbineId;
+            });
+            this.total = res.data.total;
+            this.recordData = res.data.dataList;
+          }
+        });
+    },
+  },
+  watch: {
+    filterText(val) {
+      this.$refs.tree.filter(val);
+    },
+  },
+};
 </script>
 
 <style scoped>
-    .showTitles {
-        display: flex;
-        flex-direction: row;
-        align-items: center;
-        justify-content: space-between;
-        margin-top: -10px;
-        font-size: 18px;
-        color: #FFFFFF;
-        height: 40px;
-    }
+.showTitles {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: space-between;
+  margin-top: -10px;
+  font-size: 18px;
+  color: #ffffff;
+  height: 40px;
+}
 
-    .titles {
-        font-size: 16px;
-        color: #FFFFFF;
-    }
+.titles {
+  font-size: 16px;
+  color: #ffffff;
+}
 
-    .el-dialog__body {
-        padding: 30px 10px 10px 10px;
-    }
+.el-dialog__body {
+  padding: 30px 10px 10px 10px;
+}
 
-    .bodys {
-        display: flex;
-        flex-direction: row;
-        background-color: black;
-        width: 100%;
-        margin-top: -30px;
-        height: 60vh;
-    }
+.bodys {
+  display: flex;
+  flex-direction: row;
+  background-color: black;
+  width: 100%;
+  margin-top: -30px;
+  height: 60vh;
+}
 
-    .left {
-        width: 20%;
-        height: 100%;
-        background-color: rgba(77, 77, 77, 1);
-        border-right: 2px solid #000000;
-    }
+.left {
+  width: 20%;
+  height: 100%;
+  background-color: rgba(77, 77, 77, 1);
+  border-right: 2px solid #000000;
+}
 
-    .rights {
-        width: 80%;
-        height: 100%;
-        background-color: rgba(77, 77, 77, 1);
-    }
+.rights {
+  width: 80%;
+  height: 100%;
+  background-color: rgba(77, 77, 77, 1);
+}
 
-    .el-tree {
-        color: #FFFFFF !important;
-        background-color: rgba(77, 77, 77, 1) !important;
-    }
+.el-tree {
+  color: #ffffff !important;
+  background-color: rgba(77, 77, 77, 1) !important;
+}
 
-    .el-tree-node:focus>.el-tree-node__content {
-        background-color: #000000 !important;
-    }
+.el-tree-node:focus > .el-tree-node__content {
+  background-color: #000000 !important;
+}
 
-    .el-tree-node__content:hover {
-        background-color: #000000 !important;
-    }
+.el-tree-node__content:hover {
+  background-color: #000000 !important;
+}
 
-    .dateBar {
-        display: flex;
-        flex-direction: row;
-        align-items: center;
-        justify-content: space-between;
-        margin-left: 20px;
-    }
+.dateBar {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: space-between;
+  margin-left: 20px;
+}
 
-    .pickers {
-        margin-left: 20px;
-    }
+.pickers {
+  margin-left: 20px;
+}
 
-    .tables {
-        margin-top: 20px;
-        width: 95%;
-        margin-left: 3%;
-    }
+.tables {
+  margin-top: 20px;
+  width: 95%;
+  margin-left: 3%;
+}
 
-    .table {
-        background-color: rgba(77, 77, 77, 1) !important;
-    }
+.table {
+  background-color: rgba(77, 77, 77, 1) !important;
+}
 
-    .el-table td,
-    .el-table th.is-leaf {
-        border-bottom: 1px solid rgba(77, 77, 77, 1) !important;
-    }
+.el-table td,
+.el-table th.is-leaf {
+  border-bottom: 1px solid rgba(77, 77, 77, 1) !important;
+}
 
-    .el-table__header {
-        width: 100% !important;
-    }
+.el-table__header {
+  width: 100% !important;
+}
 
-    .el-table__body-wrapper {
-        background-color: rgba(77, 77, 77, 1) !important;
-    }
+.el-table__body-wrapper {
+  background-color: rgba(77, 77, 77, 1) !important;
+}
 
-    .el-table::before {
-        width: 0;
-    }
+.el-table::before {
+  width: 0;
+}
 
-    tr {
-        line-height: 1.5;
-        background: #1e1e1e;
-        margin-bottom: 2px;
-        border-radius: 5px;
-    }
+tr {
+  line-height: 1.5;
+  background: #1e1e1e;
+  margin-bottom: 2px;
+  border-radius: 5px;
+}
 
-    .table-main {
-        font-size: 14px;
-        width: 600px;
-        text-align: center;
-        background: #000000;
-        margin: 5px;
-        border-collapse: separate;
-        border-spacing: 0px 5px;
-    }
+.table-main {
+  font-size: 14px;
+  width: 600px;
+  text-align: center;
+  background: #000000;
+  margin: 5px;
+  border-collapse: separate;
+  border-spacing: 0px 5px;
+}
 
-    .paginations {
-        display: flex;
-        flex-direction: row-reverse;
-    }
+.paginations {
+  display: flex;
+  flex-direction: row-reverse;
+}
 </style>

File diff suppressed because it is too large
+ 803 - 822
src/components/control/areaCard.vue


+ 300 - 278
src/components/control/controlAllArea.vue

@@ -3,7 +3,7 @@
     <div class="body">
       <img class="logo" src="../../assets/img/logo.png" alt="" />
       <div class="titleBar">
-        <div class="title">设备区</div>
+        <div class="title" @click="parametersContrast()">设备区</div>
         <el-select
           @change="listedChange()"
           class="inputs"
@@ -19,43 +19,96 @@
           </el-option>
         </el-select>
       </div>
-      <div style="margin-top: 20px; margin-left: 35px; height: 85%">
-        <el-scrollbar>
-          <div class="scoll">
-            <div class="matrix" v-if="showList.length > 0">
-              <!-- <div class="problemTitle">待启动</div> -->
-              <MatrixBlock
-                @choose-click="handleClick"
-                @on-click="handleDetails"
-                :dataList="showList"
-              >
-              </MatrixBlock>
+      <div
+        class="content"
+        style="
+          margin-top: 20px;
+          margin-left: 35px;
+          height: 85%;
+          overflow-y: auto;
+        "
+      >
+        <!-- <el-scrollbar>
+          <div class="scoll"> -->
+        <div class="matrix" v-if="showList.length > 0">
+          <!-- 简单矩阵 -->
+          <box-select
+            node=".box"
+            @selectList="selectList"
+            v-if="selectValue === '0'"
+            v-for="(item, index) in allList" :key="index"
+          >
+            <div class="box1">
+              {{ key }}
+            </div>
+            <EaxyMatrxBlock
+              @choose-click="handleClick"
+              @on-click="handleDetails"
+              :dataList="item"
+            >
+            </EaxyMatrxBlock>
+          </box-select>
+          <!-- 全部矩阵 -->
+          <box-select
+            node=".box"
+            @selectList="selectList"
+            v-else-if="selectValue === '1'"
+            v-for="(item, key) of allList"
+          >
+            <div class="box1">
+              {{ key }}
             </div>
-          </div>
-        </el-scrollbar>
+            <MatrixBlock
+              @choose-click="handleClick"
+              @on-click="handleDetails"
+              :dataList="item"
+            >
+            </MatrixBlock>
+          </box-select>
+          <!-- 其他 -->
+          <box-select node=".box" @selectList="selectList" v-else>
+            <MatrixBlock
+              @choose-click="handleClick"
+              @on-click="handleDetails"
+              :dataList="showList"
+            >
+            </MatrixBlock>
+          </box-select>
+        </div>
+        <!-- </div>
+        </el-scrollbar> -->
       </div>
     </div>
+
     <WindturbineDetailPages
       v-model="dialogVisible"
       :showSvg="showSvg"
       @close="handleClose"
-      :svgWeb="svgWeb"
       :windturbine="currentWindturbine"
     ></WindturbineDetailPages>
+    <ParametersContrast
+      :chooseList="chooseList"
+      v-model="parametersDisplay"
+    ></ParametersContrast>
   </div>
 </template>
 
 <script>
 import WindturbineDetailPages from "../WindturbineDetailPages.vue";
 import MatrixBlock from "../matrixBlock.vue";
+import EaxyMatrxBlock from "../eaxyMatrixBlock.vue";
 import BackgroundData from "utils/BackgroundData";
-import MessageBridge from "utils/MessageBridge";
 import api from "api/index";
+import boxSelect from "components/boxSelect.vue";
+import ParametersContrast from "./parametersContrast.vue";
 export default {
   name: "ProblemArea",
   components: {
     WindturbineDetailPages,
     MatrixBlock,
+    boxSelect,
+    ParametersContrast,
+    EaxyMatrxBlock,
   },
   props: {
     current: {
@@ -67,6 +120,8 @@ export default {
   },
   data() {
     return {
+      allNames: [],
+      allList: {},
       dataList: [],
       showList: [],
       chooseList: [],
@@ -74,48 +129,32 @@ export default {
       currentWindturbine: {},
       dialogVisible: false,
       showSvg: false,
-      svgWeb: "",
+      parametersDisplay: false,
       windturbinelist: {},
       options: [
         {
           value: "0",
-          label: "问题设备",
+          label: "简单矩阵",
         },
         {
           value: "1",
-          label: "故障",
+          label: "全部设备",
         },
         {
           value: "2",
-          label: "维护",
+          label: "故障",
         },
         {
           value: "3",
-          label: "离线",
+          label: "维护",
         },
         {
           value: "4",
-          label: "挂牌",
+          label: "离线",
         },
         {
           value: "5",
-          label: "麻黄山",
-        },
-        {
-          value: "6",
-          label: "牛首山",
-        },
-        {
-          value: "7",
-          label: "青山",
-        },
-        {
-          value: "8",
-          label: "石板泉",
-        },
-        {
-          value: "9",
-          label: "香山",
+          label: "挂牌",
         },
       ],
       selectValue: "0",
@@ -141,12 +180,50 @@ export default {
   },
   computed: {},
   created: function () {
-    this.initData();
     this.controls();
     this.getLocks();
   },
   methods: {
+    selectList(val) {
+      val.forEach((item) => {
+        this.handleClick(this.windturbinelist[item.id]);
+      });
+    },
     controls() {
+      this.options = [
+        {
+          value: "0",
+          label: "简单矩阵",
+        },
+        {
+          value: "1",
+          label: "全部设备",
+        },
+        {
+          value: "2",
+          label: "故障",
+        },
+        {
+          value: "3",
+          label: "维护",
+        },
+        {
+          value: "4",
+          label: "离线",
+        },
+        {
+          value: "5",
+          label: "挂牌",
+        },
+      ];
+      let stationList = this.$store.state.stationList;
+      stationList.forEach((item, index) => {
+        let obj = {};
+        obj.value = String(index + 6);
+        obj.label = item.address;
+        obj.stationId = item.code;
+        this.options.push(obj);
+      });
       let json = this.$store.state.windturbinelist;
       this.dataList = [];
       this.showList = [];
@@ -161,51 +238,32 @@ export default {
         this.dataList.push(val);
         switch (Number(this.selectValue)) {
           case 0:
-            if (
-              val.status === 5 ||
-              val.status === 6 ||
-              val.status === 7 ||
-              val.lockValue > 0
-            ) {
-              this.showList.push(val);
-            }
+            this.showList.push(val);
             break;
           case 1:
-            val.status === 5 ? this.showList.push(val) : "";
+            this.showList.push(val);
+
             break;
           case 2:
-            val.status === 6 ? this.showList.push(val) : "";
+            val.status === 5 ? this.showList.push(val) : "";
             break;
           case 3:
-            val.status === 7 ? this.showList.push(val) : "";
+            val.status === 6 ? this.showList.push(val) : "";
             break;
           case 4:
-            val.lockValue > 0 ? this.showList.push(val) : "";
+            val.status === 7 ? this.showList.push(val) : "";
             break;
           case 5:
-            val.windturbineId.substring(0, 2) === "MG"
-              ? this.showList.push(val)
-              : "";
-            break;
-          case 6:
-            val.windturbineId.substring(0, 2) === "NG"
-              ? this.showList.push(val)
-              : "";
-            break;
-          case 7:
-            val.windturbineId.substring(0, 2) === "QG"
-              ? this.showList.push(val)
-              : "";
-            break;
-          case 8:
-            val.windturbineId.substring(0, 2) === "SG"
-              ? this.showList.push(val)
-              : "";
+            val.lockValue > 0 ? this.showList.push(val) : "";
             break;
-          case 9:
-            val.windturbineId.substring(0, 2) === "XG"
-              ? this.showList.push(val)
-              : "";
+          default:
+            if (
+              val.stationId ===
+              this.options.filter((ops) => ops?.value === this.selectValue)[0]
+                .stationId
+            ) {
+              this.showList.push(val);
+            }
             break;
         }
       }
@@ -227,102 +285,6 @@ export default {
         }
       });
     },
-    initData: function () {
-      let mb = MessageBridge.getInstance();
-      let vss = [
-        { key: "/topic/voice-control", action: this.windturbineMessage },
-      ];
-      mb.register(vss);
-    },
-    windturbineMessage(msg) {
-      if (this.$store.state.current === 2) {
-        let arr = [];
-        if (msg === "CLOSE") {
-          arr.push(msg);
-        } else {
-          arr = msg.split("-");
-        }
-        this.dialogVisible = false;
-        this.showSvg = false;
-        this.svgWeb = "";
-        if (arr[0] === "OPEN_FJ") {
-          this.currentWindturbine = this.windturbinelist[arr[1]];
-          this.dialogVisible = true;
-        } else if (arr[0] === "CLOSE") {
-          this.dialogVisible = false;
-        } else if (arr[0] === "OPEN_SYZ") {
-          this.showSvg = true;
-          this.dialogVisible = true;
-          this.svgWeb = arr[1];
-        } else if (
-          arr[0] === "CONTROL_START" ||
-          arr[0] === "CONTROL_STOP" ||
-          arr[0] === "CONTROL_MAINTAIN"
-        ) {
-          let windControlList = [];
-          let mss = {};
-          arr.forEach((item) => {
-            if (
-              item ===
-              (this.windturbinelist[item]
-                ? this.windturbinelist[item].windturbineId
-                : "")
-            ) {
-              switch (arr[0]) {
-                case "CONTROL_START":
-                  this.windturbinelist[item].controlType = "1";
-                  break;
-                case "CONTROL_STOP":
-                  this.windturbinelist[item].controlType = "2";
-                  break;
-                case "CONTROL_MAINTAIN":
-                  this.windturbinelist[item].controlType = "6";
-                  break;
-                case "CONTROL_UNMAINTAIN":
-                  this.windturbinelist[item].controlType = "8";
-                  break;
-              }
-              windControlList.push(this.windturbinelist[item]);
-            }
-          });
-          mss.type = "send";
-          this.sendCommand(mss, windControlList);
-        } else if (
-          arr[0] === "CONTROL_LOCK_OVERHAUL" ||
-          arr[0] === "CONTROL_LOCK_MAINTAIN" ||
-          arr[0] === "CONTROL_LOCK_LNVOLVED_OVERHAUL" ||
-          arr[0] === "CONTROL_LOCK_LNVOLVED_MAINTAIN" ||
-          arr[0] === "CONTROL_LOCK_LNVOLVED_PG" ||
-          arr[0] === "CONTROL_LOCK_LNVOLVED_WEATHER" ||
-          arr[0] === "CONTROL_UNLOCK"
-        ) {
-          let windturbine = this.windturbinelist[arr[1]];
-          switch (arr[0]) {
-            case "CONTROL_LOCK_OVERHAUL":
-              this.sendLock({ value: "CheckLock" }, windturbine);
-              break;
-            case "CONTROL_LOCK_MAINTAIN":
-              this.sendLock({ value: "FaultLock" }, windturbine);
-              break;
-            case "CONTROL_LOCK_LNVOLVED_OVERHAUL":
-              this.sendLock({ value: "StationCheckLock" }, windturbine);
-              break;
-            case "CONTROL_LOCK_LNVOLVED_MAINTAIN":
-              this.sendLock({ value: "StationFaulLock" }, windturbine);
-              break;
-            case "CONTROL_LOCK_LNVOLVED_PG":
-              this.sendLock({ value: "StationPowerLineLock" }, windturbine);
-              break;
-            case "CONTROL_LOCK_LNVOLVED_WEATHER":
-              this.sendLock({ value: "StationWeatherLock" }, windturbine);
-              break;
-            case "CONTROL_UNLOCK":
-              this.sendLock({ value: "UnLock" }, windturbine);
-              break;
-          }
-        }
-      }
-    },
     /* 右键菜单 */
     contextmenu() {
       const remote = require("electron").remote;
@@ -389,39 +351,45 @@ export default {
               that.sendLock({ value: "UnLock" });
             },
           },
-        ];
-      } else {
-        menuTemplate = [
           {
-            label: "启动",
+            label: "参数对比",
             click() {
-              that.sendCommand({ controlType: "1" });
-            },
-          },
-          {
-            label: "停机",
-            click() {
-              that.sendCommand({ controlType: "2" });
-            },
-          },
-          {
-            label: "复位",
-            click() {
-              that.sendCommand({ controlType: "5" });
-            },
-          },
-          {
-            label: "维护",
-            click() {
-              that.sendCommand({ controlType: "6" });
-            },
-          },
-          {
-            label: "取消维护",
-            click() {
-              that.sendCommand({ controlType: "8" });
+              that.parametersContrast();
             },
           },
+        ];
+      } else {
+        menuTemplate = [
+          // {
+          //   label: "启动",
+          //   click() {
+          //     that.sendCommand({ controlType: "1", deviceType: "Manual" });
+          //   },
+          // },
+          // {
+          //   label: "停机",
+          //   click() {
+          //     that.sendCommand({ controlType: "2", deviceType: "Manual" });
+          //   },
+          // },
+          // {
+          //   label: "复位",
+          //   click() {
+          //     that.sendCommand({ controlType: "5", deviceType: "Manual" });
+          //   },
+          // },
+          // {
+          //   label: "维护",
+          //   click() {
+          //     that.sendCommand({ controlType: "6", deviceType: "Manual" });
+          //   },
+          // },
+          // {
+          //   label: "取消维护",
+          //   click() {
+          //     that.sendCommand({ controlType: "8", deviceType: "Manual" });
+          //   },
+          // },
           {
             label: "挂牌",
             submenu: [
@@ -469,6 +437,12 @@ export default {
               that.sendLock({ value: "UnLock" });
             },
           },
+          {
+            label: "参数对比",
+            click() {
+              that.parametersContrast();
+            },
+          },
           // {
           //     label: "标注",
           //     click() {
@@ -520,6 +494,8 @@ export default {
             lockType: item.lockType,
             userName: `system_${bd.LoginUser.name}`,
             userId: 0,
+            auto: false,
+            deviceType: msg.deviceType,
           };
           pairs[ct.windturbineId] = ct;
         });
@@ -577,10 +553,6 @@ export default {
       }
     },
 
-    /* 清除所有选择 */
-    clearSelected() {
-      this.chooseList = [];
-    },
     /* 控制成功 */
     controlSuccess(msg) {
       let bd = BackgroundData.getInstance();
@@ -648,55 +620,56 @@ export default {
     listedChange() {
       this.chooseList = [];
       this.showList = [];
+      if (Number(this.selectValue) >= 6) {
+        console.log(
+          this.options.filter((ops) => ops?.value === this.selectValue)[0]
+            .stationId
+        );
+        this.$store.commit(
+          "currentStation",
+          this.options.filter((ops) => ops?.value === this.selectValue)[0]
+            .stationId
+        );
+      } else {
+        this.$store.commit("currentStation", "");
+      }
+      console.log(this.$store.state.currentStation);
       this.dataList.forEach((val) => {
         val.active = false;
         switch (Number(this.selectValue)) {
           case 0:
-            if (
-              val.status === 5 ||
-              val.status === 6 ||
-              val.status === 7 ||
-              val.lockValue > 0
-            ) {
-              this.showList.push(val);
-            }
+            this.showList.push(val);
             break;
           case 1:
-            val.status === 5 ? this.showList.push(val) : "";
+            // if (
+            //   val.status === 5 ||
+            //   val.status === 6 ||
+            //   val.status === 7 ||
+            //   val.lockValue > 0
+            // ) {
+            this.showList.push(val);
+            // }
             break;
           case 2:
-            val.status === 6 ? this.showList.push(val) : "";
+            val.status === 5 ? this.showList.push(val) : "";
             break;
           case 3:
-            val.status === 7 ? this.showList.push(val) : "";
+            val.status === 6 ? this.showList.push(val) : "";
             break;
           case 4:
-            val.lockValue > 0 ? this.showList.push(val) : "";
+            val.status === 7 ? this.showList.push(val) : "";
             break;
           case 5:
-            val.windturbineId.substring(0, 2) === "MG"
-              ? this.showList.push(val)
-              : "";
-            break;
-          case 6:
-            val.windturbineId.substring(0, 2) === "NG"
-              ? this.showList.push(val)
-              : "";
-            break;
-          case 7:
-            val.windturbineId.substring(0, 2) === "QG"
-              ? this.showList.push(val)
-              : "";
-            break;
-          case 8:
-            val.windturbineId.substring(0, 2) === "SG"
-              ? this.showList.push(val)
-              : "";
+            val.lockValue > 0 ? this.showList.push(val) : "";
             break;
-          case 9:
-            val.windturbineId.substring(0, 2) === "XG"
-              ? this.showList.push(val)
-              : "";
+          default:
+            if (
+              val.stationId ===
+              this.options.filter((ops) => ops?.value === this.selectValue)[0]
+                .stationId
+            ) {
+              this.showList.push(val);
+            }
             break;
         }
       });
@@ -710,6 +683,11 @@ export default {
       this.showSvg = false;
       this.getLocks();
     },
+    parametersContrast() {
+      if (this.chooseList.length > 0) {
+        this.parametersDisplay = true;
+      }
+    },
   },
   watch: {
     "$store.getters.windturbinelist": {
@@ -719,8 +697,10 @@ export default {
         this.dataList = [];
         this.showList = [];
         let arr = Object.keys(json).sort();
+        let newArr = [];
         for (let id of arr) {
           let val = json[id];
+          newArr.push(val);
           this.chooseList.forEach((item) => {
             if (item.windturbineId === val.windturbineId) {
               val.active = true;
@@ -732,56 +712,83 @@ export default {
             )[0]?.value;
           }
           this.dataList.push(val);
-          switch (Number(this.selectValue)) {
-            case 0:
-              if (
-                val.status === 5 ||
-                val.status === 6 ||
-                val.status === 7 ||
-                val.lockValue > 0
-              ) {
-                this.showList.push(val);
-              }
-              break;
-            case 1:
-              val.status === 5 ? this.showList.push(val) : "";
-              break;
-            case 2:
-              val.status === 6 ? this.showList.push(val) : "";
-              break;
-            case 3:
-              val.status === 7 ? this.showList.push(val) : "";
+          switch (this.selectValue) {
+            case "0":
+              this.showList.push(val);
               break;
-            case 4:
-              val.lockValue > 0 ? this.showList.push(val) : "";
+
+            case "1":
+              this.showList.push(val);
               break;
-            case 5:
-              val.windturbineId.substring(0, 2) === "MG"
-                ? this.showList.push(val)
-                : "";
+            case "2":
+              if (val.status === 5) {
+                this.showList.push(val);
+              }
               break;
-            case 6:
-              val.windturbineId.substring(0, 2) === "NG"
-                ? this.showList.push(val)
-                : "";
+            case "3":
+              if (val.status === 6) {
+                this.showList.push(val);
+              }
               break;
-            case 7:
-              val.windturbineId.substring(0, 2) === "QG"
-                ? this.showList.push(val)
-                : "";
+            case "4":
+              if (val.status === 7) {
+                this.showList.push(val);
+              }
               break;
-            case 8:
-              val.windturbineId.substring(0, 2) === "SG"
-                ? this.showList.push(val)
-                : "";
+            case "5":
+              if (val.lockValue > 0) {
+                this.showList.push(val);
+              }
               break;
-            case 9:
-              val.windturbineId.substring(0, 2) === "XG"
-                ? this.showList.push(val)
-                : "";
+
+            default:
+              if (
+                val.stationId ===
+                this.options.filter((ops) => ops?.value === this.selectValue)[0]
+                  .stationId
+              ) {
+                this.showList.push(val);
+              }
               break;
           }
         }
+        // -----------------------------------------
+        // if(this.selectValue === 0){
+        let arr1 = [];
+        let arr2 = [];
+        let arr3 = [];
+        let arr4 = [];
+        this.allList = {};
+        newArr.forEach((item) => {
+          let Fid = item.projectId;
+          if (Fid.indexOf("CL") != -1) {
+            arr1.push(item);
+          } else if (Fid.indexOf("KB") != -1) {
+            arr2.push(item);
+          } else if (Fid.indexOf("DX") != -1) {
+            arr3.push(item);
+          } else if (Fid.indexOf("SY") != -1) {
+            arr4.push(item);
+          }
+        });
+
+        // 获取场站
+        // this.allNames = [];
+        let stationList = this.$store.state.stationList;
+        stationList.forEach((item, index) => {
+          if (item.stationName.indexOf("崇礼") != -1) {
+            this.allList[item.stationName] = arr1;
+          } else if (item.stationName.indexOf("康保") != -1) {
+            this.allList[item.stationName] = arr2;
+          } else if (item.stationName.indexOf("代县") != -1) {
+            this.allList[item.stationName] = arr3;
+          } else if (item.stationName.indexOf("寿阳") != -1) {
+            this.allList[item.stationName] = arr4;
+          }
+        });
+        // console.log(this.allNames);
+        console.log(this.allList);
+
         let checkoutList = BackgroundData.getInstance().checkouts;
         checkoutList.forEach((item) => {
           let showIndex = null;
@@ -864,4 +871,19 @@ export default {
   top: 2px;
   left: 12px;
 }
+.content::-webkit-scrollbar {
+  /*隐藏滚轮*/
+  display: none;
+}
+.box1 {
+  width: 99%;
+  height: 40px;
+  background-color: rgb(30, 30, 30);
+  margin-top: 2px;
+  text-align: left;
+  line-height: 40px;
+  color: #fff;
+  box-sizing: border-box;
+    padding-left: 20px;
+}
 </style>

+ 1 - 3
src/components/control/controlArea.vue

@@ -6,7 +6,6 @@
 
 <script>
   import AreaCard from "./areaCard.vue";
-  import BackgroundData from 'utils/BackgroundData'
   export default {
     name: "ProblemArea",
     components: {
@@ -28,8 +27,7 @@
       };
     },
     computed: {},
-    created: function () {
-      console.log(this.current);
+    created() {
     },
     methods: {
       control(current){

+ 306 - 0
src/components/control/parametersContrast.vue

@@ -0,0 +1,306 @@
+<template>
+  <el-dialog
+    width="65%"
+    @opened="opened()"
+    @closed="closed()"
+    :show-close="false"
+    class="my-info-dialog"
+  >
+    <template #title>
+      <div style="margin-top: -10px; color: #ffffff">参数对比</div>
+    </template>
+    <div class="body">
+      <div class="title" v-if="labelList.length > 0">
+        <div class="labelList">
+          <div
+            :class="items?.type ? 'label_on' : 'label'"
+            v-for="(items, index) in labelList"
+            :key="index"
+            @click="handleClick(items)"
+          >
+            {{ items.name }}
+          </div>
+        </div>
+      </div>
+
+      <div class="titleList" v-if="dataList.length > 0">
+        <el-table
+          :data="dataList"
+          class="table"
+          height="43vh"
+          width="100%"
+          :header-cell-style="{
+            background: '#000000',
+            color: 'rgb(220,220,220)',
+            padding: '4px',
+            fontSize: '14px',
+            'border-bottom': 'solid 1px black',
+          }"
+          :cell-style="{
+            height: '45px',
+            background: 'rgb(30,30,30)',
+            color: 'rgb(220,220,220)',
+            'line-height': '0px',
+            fontSize: '12px',
+            'border-bottom': '1px solid #000000',
+          }"
+        >
+          <el-table-column
+            v-for="(item, index) in titleList"
+            :key="index"
+            min-width="170"
+            align="center"
+            :label="item.name"
+            @click="showPercent(item)"
+          >
+            <template #default="scope" @click="showPercent(item)">
+              <span @click="showPercent(item)">
+                <div
+                  class="cell"
+                  style="
+                    display: flex;
+                    align-items: center;
+                    justify-content: center;
+                  "
+                >
+                  <div
+                    class="left"
+                    v-if="item.showFlag && index !== 0"
+                    :style="`width:${
+                      (scope?.row.filter((val) => val.name === item.name)[0]
+                        ?.value /
+                        item.maxValue) *
+                      95
+                    }%;position: absolute;left: 10px;`"
+                  ></div>
+                  <div style="position: absolute">
+                    {{
+                      index === 0
+                        ? scope?.row.filter((val) => val.name === item.name)[0]
+                            ?.value
+                        : scope?.row
+                            .filter((val) => val.name === item.name)[0]
+                            ?.value?.toFixed(2)
+                    }}
+                  </div>
+                </div>
+              </span>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
+  </el-dialog>
+</template>
+<script>
+import api from "api/index";
+export default {
+  props: {
+    chooseList: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+  },
+  data() {
+    return {
+      dataList: [],
+      labelList: [],
+      allData: {},
+      arrList: [],
+      titleList: [],
+    };
+  },
+  methods: {
+    opened() {
+      this.dataList = [];
+      this.getCompared();
+    },
+    getCompared() {
+      this.labelList = [
+        {
+          name: "全部",
+        },
+      ];
+      let arr = [];
+      this.chooseList.forEach((item) => {
+        let obj = `${item.stationId}.${item.modelId}`;
+        arr.push(obj);
+      });
+      let list = Array.from(new Set(arr));
+      let params = list.join(",");
+      api.stationCompared(params).then((res) => {
+        if (res) {
+          this.arrList = res.data[list[0]];
+          this.allData = res.data;
+          this.labelList = [...this.labelList, ...res.data[list[0]]];
+          this.labelList.forEach((item) => {
+            item.type = true;
+          });
+          this.titleList = this.labelList.map((item) => {
+            return {
+              ...item,
+            };
+          });
+          this.titleList[0].name = "风机";
+          this.getLatest(0);
+        }
+      });
+    },
+    getLatest(index) {
+      let list = [];
+      let arr = this.arrList.map((item) => {
+        return {
+          ...item,
+        };
+      });
+      arr.map((item) => {
+        if (this.labelList.filter((val) => val.name === item.name)[0]?.type) {
+          list.push(item.code);
+        }
+      });
+      arr.unshift({
+        name: "风机",
+        value: this.chooseList[index].windturbineId,
+      });
+      let params = list.join(",");
+      api
+        .nitWinturbineBaseData({
+          thingType: "windturbine",
+          thingId: this.chooseList[index].windturbineId,
+          uniformCodes: params,
+        })
+        .then((res) => {
+          if (res) {
+            arr.forEach((item) => {
+              if (item.type) {
+                item.value = res.data[item.code]?.value;
+              }
+            });
+            this.dataList.push(arr);
+            if (index < this.chooseList.length - 1) {
+              index++;
+              this.getLatest(index);
+            } else {
+              this.titleList.forEach((item, index) => {
+                if (index > 0) {
+                  let datas = [];
+                  this.dataList.map((items) => {
+                    datas.push(
+                      items.filter((val) => item.name === val.name)[0]?.value
+                    );
+                  });
+                  item.maxValue = Math.max.apply(
+                    null,
+                    datas.map((v) => v)
+                  );
+                  item.showFlag = false;
+                }
+              });
+            }
+          }
+        });
+    },
+    closed() {
+      this.labelList = [];
+      this.dataList = [];
+      this.allData = {};
+      this.arrList = [];
+    },
+    handleClick(value) {
+      this.dataList = [];
+      this.titleList = [];
+      if (value.name === "全部") {
+        if (value.type) {
+          this.labelList.forEach((item) => {
+            item.type = false;
+          });
+        } else {
+          this.labelList.forEach((item) => {
+            item.type = true;
+          });
+        }
+      } else {
+        value.type = !value.type;
+      }
+      this.labelList.forEach((item) => {
+        if (item.type) {
+          item.name === "全部" ? (item.name = "风机") : "";
+          this.titleList.push(item);
+        }
+      });
+      this.getLatest(0);
+    },
+    showPercent(item) {
+      item.showFlag = !item.showFlag;
+    },
+  },
+};
+</script>
+<style scoped>
+.body {
+  display: flex;
+  flex-direction: column;
+  width: 100%;
+  height: 62vh;
+}
+.title {
+  height: 300px;
+}
+.labelList {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: wrap;
+}
+.label {
+  border: 1px solid #999999;
+  padding: 2px 4px;
+  margin: 0 10px 10px 0;
+  color: #999999;
+}
+.label_on {
+  border: 1px solid rgba(37, 116, 219, 1);
+  background-color: rgba(37, 116, 219, 1);
+  color: #ffffff;
+  padding: 2px 4px;
+  margin: 0 10px 10px 0;
+}
+.titleList {
+  width: 100%;
+}
+.left {
+  height: 20px;
+  background: linear-gradient(
+    to right,
+    rgba(37, 116, 219, 1),
+    rgba(37, 116, 219, 0.6)
+  );
+}
+.table {
+  background-color: #000000 !important;
+}
+
+.el-table td,
+.el-table th.is-leaf {
+  border-bottom: 1px solid #000000 !important;
+}
+
+.el-table__header {
+  width: 100% !important;
+}
+
+.el-table__body-wrapper {
+  background-color: #000000 !important;
+}
+
+.el-table::before {
+  width: 0;
+}
+.el-table__body-wrapper is-scrolling-left {
+  height: 90% !important;
+}
+/* .el-table--scrollable-y ::-webkit-scrollbar {
+  display: none;
+} */
+</style>

File diff suppressed because it is too large
+ 2 - 3
src/components/dataDetails.vue


+ 834 - 0
src/components/eaxyMatrixBlock.vue

@@ -0,0 +1,834 @@
+<template>
+  <div class="box" style="display: flex; flex-direction: row; flex-wrap: wrap">
+    <div
+      :class="
+        item.active
+          ? 'box-' + item.status
+          : item.flashing && item.status === 5
+          ? 'unbox-flashing-' + item.status
+          : 'unbox-' + item.status
+      "
+      :id="item.windturbineId"
+      v-for="(item, index) in dataList"
+      :key="index"
+      @dblclick="sendMsg(item)"
+     
+    >
+
+      {{ item.windturbineId }}
+    </div>
+  </div>
+</template>
+<script>
+import dayjs from "dayjs";
+export default {
+  components: {},
+  props: {
+    dataList: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+    area: String,
+  },
+  mounted() {},
+  updated() {},
+  methods: {
+    handleDeal(val) {
+      let data = dayjs(val).format("YYYY-MM-DD HH:mm:ss");
+      this.showVlaues = this.timeFn(data);
+      // return `该状态共持续:`
+    },
+
+    timeFn(d1) {
+      //di作为一个变量传进来
+      //如果时间格式是正确的,那下面这一步转化时间格式就可以不用了
+      var dateBegin = new Date(d1.replace(/-/g, "/")); //将-转化为/,使用new Date
+      var dateEnd = new Date(); //获取当前时间
+      var dateDiff = dateEnd.getTime() - dateBegin.getTime(); //时间差的毫秒数
+      var dayDiff = Math.floor(dateDiff / (24 * 3600 * 1000)); //计算出相差天数
+      var leave1 = dateDiff % (24 * 3600 * 1000); //计算天数后剩余的毫秒数
+      var hours = Math.floor(leave1 / (3600 * 1000)); //计算出小时数
+      //计算相差分钟数
+      var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数
+      var minutes = Math.floor(leave2 / (60 * 1000)); //计算相差分钟数
+      //计算相差秒数
+      var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数
+      var seconds = Math.round(leave3 / 1000);
+      return `持续时长:${dayDiff !== 0 ? dayDiff + "天" : ""}${
+        hours !== 0 ? hours + "小时" : ""
+      }${minutes !== 0 ? minutes + "分钟" : ""}${
+        seconds !== 0 ? seconds + "秒" : ""
+      }`;
+    },
+
+    sendMsg: function (itm) {
+      // this.dialogVisible = true;
+      this.$emit("on-click", itm);
+      // this.currentWindturbine = itm;
+    },
+    handleClose() {
+      this.dialogVisible = false;
+      this.showSvg = false;
+    },
+  },
+  data() {
+    return {
+      dialogVisible: false,
+      showSvg: false,
+      currentWindturbine: {},
+      showVlaues: "",
+      // station: [],
+      options: {
+        8: "检修",
+        7: "故障维修",
+        2: "场内受累检修",
+        3: "场内受累故障",
+        4: "场外受累电网",
+        5: "场外受累天气",
+      },
+    };
+  },
+};
+</script>
+<style scoped>
+.lock {
+  width: 10px;
+  height: 10px;
+  position: relative;
+  right: 2px;
+  top: -15px;
+}
+
+.durationImg {
+  width: 15px;
+  height: 15px;
+  position: relative;
+  right: 5px;
+  top: -15px;
+}
+.durationImgs {
+  width: 15px;
+  height: 15px;
+  position: relative;
+  right: 5px;
+  top: -15px;
+}
+.lock-on {
+  width: 0px;
+  height: 0px;
+  opacity: 0;
+}
+
+.locks:hover .lock-on {
+  position: fixed;
+  display: flex;
+  align-items: center;
+  width: 80px;
+  height: 30px;
+  border: 1px solid #999999;
+  background-color: #999999;
+  opacity: 1;
+  color: #ffffff;
+  z-index: 999;
+}
+
+.duration {
+  width: 15px;
+  height: 15px;
+  position: relative;
+  visibility: hidden;
+}
+.unbox-1:hover .duration {
+  visibility: visible;
+}
+.unbox-2:hover .duration {
+  visibility: visible;
+}
+.unbox-3:hover .duration {
+  visibility: visible;
+}
+.unbox-4:hover .duration {
+  visibility: visible;
+}
+.unbox-5:hover .duration {
+  visibility: visible;
+}
+.unbox-6:hover .duration {
+  visibility: visible;
+}
+.unbox-7:hover .duration {
+  visibility: visible;
+}
+
+.lock_input {
+  width: 140px;
+  background-color: #292929;
+  height: 40px;
+  color: #ffffff;
+}
+.lock_inputs {
+  width: 200px;
+  background-color: #292929;
+  height: 40px;
+  color: #ffffff;
+}
+.box-0 {
+  width: 135px;
+  height: 20px;
+  color: #ffffff;
+  border: 1px solid rgba(255, 255, 255, 1);
+  background-color: rgba(255, 255, 255, 0.05);
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-right: 5px;
+  margin-top: 10px;
+  box-shadow: 0px 0px 6px #ffffff;
+}
+
+.unbox-0 {
+  width: 117px;
+  height: 50px;
+  color: #ffffff;
+  font-size: 12px;
+  border: 1px solid rgba(255, 255, 255, 1);
+  background-color: rgba(255, 255, 255, 0.2);
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-right: 5px;
+  margin-top: 10px;
+  border-radius: 0.37vh;
+}
+
+.left-0 {
+  width: 35%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(255, 255, 255, 1);
+  font-weight: 600;
+  line-height: 20px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.unleft-0 {
+  width: 35%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(255, 255, 255, 1);
+  font-weight: 600;
+  line-height: 20px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.right-0 {
+  width: 69%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(255, 255, 255, 1);
+  line-height: 15px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+
+.unright-0 {
+  width: 69%;
+  height: 100%;
+  font-size: 12px;
+  /* color: rgba(255, 255, 255, 1); */
+  line-height: 15px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  font-size: 12px;
+  color: rgba(255, 255, 255, 1);
+}
+
+.box-1 {
+  width: 135px;
+  height: 50px;
+  /* color: #ffffff; */
+  border: 1px solid rgba(197, 48, 200, 1);
+  background-color: rgba(197, 48, 200, 0.05);
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-right: 5px;
+  margin-top: 10px;
+  box-shadow: 0px 0px 6px #ef3af2;
+}
+
+.unbox-1 {
+  width: 117px;
+  height: 20px;
+  color: rgba(197, 48, 200, 1);
+  font-size: 12px;
+  justify-content: center;
+  border: 1px solid rgba(197, 48, 200, 1);
+  background-color: rgba(197, 48, 200, 0.2);
+  display: flex;
+  align-items: center;
+  margin-right: 5px;
+  margin-top: 10px;
+  border-radius: 0.37vh;
+}
+
+.left-1 {
+  width: 35%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(197, 48, 200, 1);
+  font-weight: 600;
+  line-height: 20px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.unleft-1 {
+  width: 35%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(197, 48, 200, 1);
+  font-weight: 600;
+  line-height: 20px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.right-1 {
+  width: 69%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(197, 48, 200, 1);
+  line-height: 15px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+
+.unright-1 {
+  width: 69%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(197, 48, 200, 1);
+  line-height: 15px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+
+.box-2 {
+  width: 135px;
+  height: 50px;
+  color: #ffffff;
+  border: 1px solid rgba(05, 187, 76, 1);
+  background-color: rgba(05, 187, 76, 0.05);
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-right: 5px;
+  margin-top: 10px;
+  box-shadow: 0px 0px 6px #09e45e;
+}
+
+.unbox-2 {
+  width: 117px;
+  height: 20px;
+  color: rgba(05, 187, 76, 1);
+  font-size: 12px;
+  border: 1px solid rgba(05, 187, 76, 1);
+  background-color: rgba(05, 187, 76, 0.2);
+  display: flex;
+  align-items: center;
+  margin-right: 5px;
+  margin-top: 10px;
+  justify-content: center;
+  border-radius: 0.37vh;
+}
+
+.left-2 {
+  width: 35%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(05, 187, 76, 1);
+  font-weight: 600;
+  line-height: 20px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.unleft-2 {
+  width: 35%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(05, 187, 76, 1);
+  font-weight: 600;
+  line-height: 20px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.right-2 {
+  width: 69%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(05, 187, 76, 1);
+  line-height: 15px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+
+.unright-2 {
+  width: 69%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(05, 187, 76, 1);
+  line-height: 15px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+
+.box-3 {
+  width: 135px;
+  height: 50px;
+  color: #ffffff;
+  border: 1px solid rgba(05, 187, 76, 1);
+  background-color: rgba(05, 187, 76, 0.05);
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-right: 5px;
+  margin-top: 10px;
+  box-shadow: 0px 0px 6px #09e45e;
+}
+
+.unbox-3 {
+  width: 117px;
+  height: 20px;
+  color: rgba(05, 187, 76, 1);
+  font-size: 12px;
+  border: 1px solid rgba(05, 187, 76, 1);
+  background-color: rgba(05, 187, 76, 0.2);
+  display: flex;
+  align-items: center;
+  margin-right: 5px;
+  margin-top: 10px;
+  justify-content: center;
+  border-radius: 0.37vh;
+}
+
+.left-3 {
+  width: 35%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(05, 187, 76, 1);
+  font-weight: 600;
+  line-height: 20px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.unleft-3 {
+  width: 35%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(05, 187, 76, 1);
+  font-weight: 600;
+  line-height: 20px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.right-3 {
+  width: 69%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(05, 187, 76, 1);
+  line-height: 15px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+
+.unright-3 {
+  width: 69%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(05, 187, 76, 1);
+  line-height: 15px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+
+.box-4 {
+  width: 135px;
+  height: 50px;
+  color: #ffffff;
+  border: 1px solid rgba(75, 85, 174, 1);
+  background-color: rgba(75, 85, 174, 0.05);
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-right: 5px;
+  margin-top: 10px;
+  box-shadow: 0px 0px 6px #6876f2;
+}
+
+.unbox-4 {
+  width: 117px;
+  height: 20px;
+  /* color: #ffffff; */
+  border: 1px solid rgba(75, 85, 174, 1);
+  background-color: rgba(75, 85, 174, 0.2);
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-right: 5px;
+  margin-top: 10px;
+  font-size: 12px;
+  color: rgba(75, 85, 174, 1);
+  border-radius: 0.37vh;
+}
+
+.left-4 {
+  width: 35%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(75, 85, 174, 1);
+  font-weight: 600;
+  line-height: 20px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.unleft-4 {
+  width: 35%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(75, 85, 174, 1);
+  font-weight: 600;
+  line-height: 20px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.right-4 {
+  width: 69%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(75, 85, 174, 1);
+  line-height: 15px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+
+.unright-4 {
+  width: 69%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(75, 85, 174, 1);
+  line-height: 15px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+
+.box-5 {
+  width: 133px;
+  height: 48px;
+  color: #ffffff;
+  border: 2px solid rgba(186, 50, 55, 1);
+  background-color: rgba(186, 50, 55, 0.05);
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-right: 5px;
+  margin-top: 10px;
+  box-shadow: 0px 0px 6px #ff1313;
+}
+
+@keyframes fade {
+  from {
+    opacity: 1;
+  }
+  50% {
+    opacity: 0.6;
+  }
+  to {
+    opacity: 1;
+  }
+}
+@-webkit-keyframes fade {
+  from {
+    opacity: 1;
+  }
+  50% {
+    opacity: 0.6;
+  }
+  to {
+    opacity: 1;
+  }
+}
+
+.unbox-flashing-5 {
+  width: 117px;
+  height: 20px;
+  color: #ffffff;
+  border: 1px solid rgba(186, 50, 55, 1);
+  background-color: rgba(186, 50, 55, 0.2);
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-right: 5px;
+  margin-top: 10px;
+  animation: fade 1600ms infinite;
+  -webkit-animation: fade 1600ms infinite;
+  border-radius: 0.37vh;
+}
+
+.unbox-5 {
+  width: 117px;
+  height: 20px;
+  color: rgba(186, 50, 55, 1);
+  font-size: 12px;
+  border: 1px solid rgba(186, 50, 55, 1);
+  background-color: rgba(186, 50, 55, 0.2);
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-right: 5px;
+  margin-top: 10px;
+  border-radius: 0.37vh;
+}
+
+.left-5 {
+  width: 35%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(186, 50, 55, 1);
+  font-weight: 600;
+  line-height: 20px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.unleft-5 {
+  width: 35%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(186, 50, 55, 1);
+  font-weight: 600;
+  line-height: 20px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.right-5 {
+  width: 69%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(186, 50, 55, 1);
+  line-height: 15px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+
+.unright-5 {
+  width: 69%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(186, 50, 55, 1);
+  line-height: 15px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+
+.box-6 {
+  width: 135px;
+  height: 50px;
+  color: #ffffff;
+  border: 1px solid rgba(225, 125, 36, 1);
+  background-color: rgba(225, 125, 36, 0.05);
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-right: 5px;
+  margin-top: 10px;
+  box-shadow: 0px 0px 6px #f28627;
+}
+
+.unbox-6 {
+  width: 117px;
+  height: 20px;
+  color: rgba(225, 125, 36, 1);
+  font-size: 12px;
+  border: 1px solid rgba(225, 125, 36, 1);
+  background-color: rgba(225, 125, 36, 0.2);
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-right: 5px;
+  margin-top: 10px;
+  border-radius: 0.37vh;
+}
+
+.left-6 {
+  width: 35%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(225, 125, 36, 1);
+  font-weight: 600;
+  line-height: 20px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.unleft-6 {
+  width: 35%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(225, 125, 36, 1);
+  font-weight: 600;
+  line-height: 20px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.right-6 {
+  width: 69%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(225, 125, 36, 1);
+  line-height: 15px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+
+.unright-6 {
+  width: 69%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(225, 125, 36, 1);
+  line-height: 15px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+
+.box-7 {
+  width: 135px;
+  height: 50px;
+  color: #ffffff;
+  border: 1px solid rgba(96, 103, 105, 1);
+  background-color: rgba(96, 103, 105, 0.05);
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-right: 5px;
+  margin-top: 10px;
+  box-shadow: 0px 0px 6px #ffffff;
+}
+
+.unbox-7 {
+  width: 117px;
+  height: 20px;
+  color: rgba(96, 103, 105, 1);
+  font-size: 12px;
+  border: 1px solid rgba(96, 103, 105, 1);
+  background-color: rgba(96, 103, 105, 0.2);
+  display: flex;
+  flex-direction: row;
+  justify-content: center;
+  margin-right: 5px;
+  margin-top: 10px;
+  border-radius: 0.37vh;
+}
+
+.left-7 {
+  width: 35%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(96, 103, 105, 1);
+  font-weight: 600;
+  line-height: 20px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.unleft-7 {
+  width: 35%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(96, 103, 105, 1);
+  font-weight: 600;
+  line-height: 20px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.right-7 {
+  width: 69%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(96, 103, 105, 1);
+  line-height: 15px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+
+.unright-7 {
+  width: 69%;
+  height: 100%;
+  font-size: 12px;
+  color: rgba(96, 103, 105, 1);
+  line-height: 15px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+</style>

+ 2 - 7
src/components/focus/PhotoelectricDetailPages.vue

@@ -4,7 +4,6 @@
 			<div class="showTitle">
 				<img class="titleImg" src="../../assets/img/controlcenter/daraTrue.png" alt="">
 				<div class="titles">{{stationName}}</div>
-				<!-- <div class="icon">(麻黄山)</div> -->
 			</div>
 		</template>
 		<div class="body">
@@ -91,10 +90,6 @@
 </template>
 
 <script>
-	// import UniformCodes from "../../assets/script/UniformCodes";
-	// import { config } from '../../config';
-	// import axios from 'axios';
-	// import BackgroundData from "../../assets/script/BackgroundData"
 	import MultipleLineChart from "./multiple-line-chart.vue";
 	import dayjs from 'dayjs'
 	export default {
@@ -145,13 +140,13 @@
 				}
 				PowerSet.forEach(item => {
 					this.chartData.value[0].value.push({
-						text: dayjs(item.ts).format('hh:mm'),
+						text: dayjs(item.ts).format('HH:mm'),
 						value: parseFloat((item.doubleValue).toFixed(2))
 					})
 				})
 				ActualPower.forEach(item => {
 					this.chartData.value[1].value.push({
-						text: dayjs(item.ts).format('hh:mm'),
+						text: dayjs(item.ts).format('HH:mm'),
 						value: parseFloat((item.doubleValue).toFixed(2))
 					})
 				})

+ 221 - 209
src/components/focus/agcDetails.vue

@@ -1,220 +1,232 @@
 <template>
-    <el-dialog width="90%" @open="opened()" @closed="closed()" :fullscreen="true" :show-close="true" class="dialogs">
-        <template #title>
-            <div class="showTitles">
-                <div class="titles">AGC监控</div>
-            </div>
-        </template>
-        <div class="bodyy">
-            <DataDetails ref="detailst" :allDate="allDate" :allChartDate="allChartDate" :station="station"
-                @handleClick="handleClicks"></DataDetails>
-            <DetailsCharts v-model="detailsDisplay" :showData="showData" @closeds="closeds"></DetailsCharts>
-        </div>
-    </el-dialog>
+  <el-dialog
+    width="90%"
+    @open="opened()"
+    @closed="closed()"
+    :fullscreen="true"
+    :show-close="true"
+    class="dialogs"
+  >
+    <template #title>
+      <div class="showTitles">
+        <div class="titles">AGC监控</div>
+      </div>
+    </template>
+    <div class="bodyy">
+      <DataDetails
+        ref="detailst"
+        :allDate="allDate"
+        :allChartDate="allChartDate"
+        :station="station"
+        @handleClick="handleClicks"
+      ></DataDetails>
+      <DetailsCharts
+        v-model="detailsDisplay"
+        :showData="showData"
+        @closeds="closeds"
+      ></DetailsCharts>
+    </div>
+  </el-dialog>
 </template>
 <script>
-    import DataDetails from './dataDetails'
-    import DetailsCharts from './detailsCharts'
-    import { Photoelectric } from "utils/PhotoelectricDetailPages";
-    import api from "api/index";
-    export default {
-        components: {
-            DataDetails,
-            DetailsCharts
-        },
-        data() {
-            return {
-                station: [
-                    {
-                        id: 'MHS_BT',
-                        name: '麻黄山第二风电场',
-                        names: '麻黄山',
-                    },
-
-                    {
-                        id: 'NSS_BT',
-                        name: '牛首山第二风电场',
-                        names: '牛首山',
-                    },
-                    {
-                        id: 'QS_BT',
-                        name: '麻黄山第六风电场',
-                        names: '青山',
-                    },
-                    {
-                        id: 'XN6_BT',
-                        name: '星能第六风电场',
-                        names: '石板泉一期',
-                    },
-                    {
-                        id: 'N5_BT',
-                        name: '牛首山第五风电场',
-                        names: '二三四期',
-                    },
-                    {
-                        id: 'XS_BT',
-                        name: '香山第五风电场',
-                        names: '香山',
-                    },
-                    {
-                        id: 'SL_BT',
-                        name: '宋堡第六风电场',
-                        names: '青山三期',
-                    },
-                ],
-                allDate: {},
-                allChartDate: [],
-                detailsDisplay: false,
-                showData: {},
-            };
-        },
-        mounted() {
-
-        },
-        updated() {
-            this.getLatest(0)
-            this.getChartData(0)
-        },
-        methods: {
-            getLatest(index) {
-                let dialogData = {}
-                let thisKey = Photoelectric[this.station[index].id];
-                let array = []
-                thisKey.forEach(item => { item.value ? array.push(item.value) : '' })
-                let params = array.join(',')
-                api.getLatest(params).then(res => {
-                    for (let v in res.data) {
-                        thisKey.forEach(item => {
-                            let calc = item.calc ? item.calc : 1;
-                            if (item.value === v) {
-                                dialogData[item.tag] = {
-                                    name: item.name,
-                                    value: res.data[v].doubleValue ? res.data[v].doubleValue === 0 ? '0' : (res.data[v].doubleValue * calc).toFixed(2) : (res.data[v].booleanValue ? 1 : 0)
-                                }
-                            }
-                        })
-                    }
-                    this.allDate[this.station[index].id] = dialogData
-                    this.allDate[this.station[index].id].InstalledCapacity = Photoelectric[this.station[index].id].find(ele => {
-                        return ele.tag == 'InstalledCapacity'
-                    });
-                    index++
-                    if (index >= this.station.length) {
-                        setTimeout(() => {
-                            this.getLatest(0)
-                        }, 3000);
-                    } else {
-                        this.getLatest(index)
-                    }
-                })
-            },
-            getChartData(index) {
-                let thisKey = Photoelectric[this.station[index].id];
-                let date = new Date()
-                let endTs = date.getTime();
-                let starTs = endTs - 28800000;
-                let chartData = {
-                    value: []
-                }
-                const PowerSet = thisKey.find(ele => {
-                    return ele.tag == 'PowerSet'
+import DataDetails from "./dataDetails";
+import DetailsCharts from "./detailsCharts";
+import api from "api/index";
+import dayjs from "dayjs";
+export default {
+  components: {
+    DataDetails,
+    DetailsCharts,
+  },
+  data() {
+    return {
+      station: [],
+      allDate: {},
+      allChartDate: [],
+      detailsDisplay: false,
+      showData: {},
+      intervals: '',
+    };
+  },
+  created() {
+    this.getAGCStation();
+  },
+  updated() {},
+  methods: {
+    getAGCStation() {
+      api.getAGCStation().then((res) => {
+        this.station = res.data;
+      });
+    },
+    getLatest(index) {
+      let dialogData = {};
+      let thisKey = this.station[index].tags;
+      let array = [];
+      thisKey.forEach((item) => {
+        item.value ? array.push(item.value) : "";
+      });
+      let params = array.join(",");
+      api.getLatest(params).then((res) => {
+        for (let v in res.data) {
+          thisKey.forEach((item) => {
+            let calc = item.calc ? item.calc : 1;
+            if (item.value === v) {
+              dialogData[item.tag] = {
+                name: item.name,
+                value: res.data[v].doubleValue
+                  ? res.data[v].doubleValue === 0
+                    ? 0
+                    : Number((res.data[v].doubleValue * calc).toFixed(2))
+                  : Number(res.data[v].booleanValue)
+                  ? 1
+                  : 0,
+                  tag: item.value,
+                  calc: item.calc
+              };
+            }
+          });
+        }
+        this.allDate[this.station[index].id] = dialogData;
+        this.allDate[this.station[index].id].InstalledCapacity = this.station[
+          index
+        ].tags.find((ele) => {
+          return ele.tag == "InstalledCapacity";
+        });
+        index++;
+        if (index >= this.station.length) {
+         this.intervals =  setTimeout(() => {
+            this.getLatest(0);
+          }, 3000);
+        } else {
+          this.getLatest(index);
+        }
+      });
+    },
+    getChartData(index) {
+      let thisKey = this.station[index].tags;
+      let endTs = new Date().getTime();
+      let starTs = new Date(new Date(new Date().toLocaleDateString()).getTime()).getTime();
+      let chartData = {
+        value: [],
+      };
+      const PowerSet = thisKey.find((ele) => {
+        return ele.tag == "PowerSet";
+      });
+      const ActualPower = thisKey.find((ele) => {
+        return ele.tag == "ActualPower";
+      });
+      let PowerSetData = [],
+        ActualPowerData = [];
+      if(this.allDate["DX_BT"]?.PowerSet?.value){
+        api.getPower({
+          tagName: PowerSet.value,
+          startTs: starTs,
+          endTs: endTs,
+          interval: 60,
+        })
+        .then((res1) => {
+          api
+            .getPower({
+              tagName: ActualPower.value,
+              startTs: starTs,
+              endTs: endTs,
+              interval: 60,
+            })
+            .then((res2) => {
+              res2.data.forEach((item) => {
+                ActualPowerData.push({
+                  ts: item.ts,
+                  doubleValue: item.doubleValue * ActualPower.calc,
                 });
-                const ActualPower = thisKey.find(ele => {
-                    return ele.tag == 'ActualPower'
+              });
+              if (ActualPower.value === "HB_GD_DXF_DQ_P1_L1_001_AI0232") {
+                res2.data.forEach((item) => {
+                  PowerSetData.push({
+                    ts: item.ts,
+                    doubleValue: this.allDate["DX_BT"]?.PowerSet?.value,
+                  });
                 });
-                let PowerSetData = [],
-                    ActualPowerData = [];
-                api.getPower({
-                    tagName: PowerSet.value,
-                    startTs: starTs,
-                    endTs: endTs,
-                    interval: 60,
-                }).then(res1 => {
-                    api.getPower({
-                        tagName: ActualPower.value,
-                        startTs: starTs,
-                        endTs: endTs,
-                        interval: 60,
-                    }).then(res2 => {
-                        res1.data.forEach(item => {
-                            PowerSetData.push({
-                                ts: item.ts,
-                                doubleValue: item.doubleValue * PowerSet.calc
-                            })
-                        })
-                        res2.data.forEach(item => {
-                            ActualPowerData.push({
-                                ts: item.ts,
-                                doubleValue: item.doubleValue * ActualPower.calc
-                            })
-                        })
-                        chartData.value[0] = {
-                            title: "有功设定限值(MW)",
-                            yAxisIndex: 0,
-                            value: []
-                        };
-                        chartData.value[1] = {
-                            title: "实发有功(MW)",
-                            yAxisIndex: 0,
-                            value: []
-                        }
-                        PowerSetData.forEach(item => {
-                            chartData.value[0].value.push({
-                                text: dayjs(item.ts).format('hh:mm'),
-                                value: parseFloat((item.doubleValue).toFixed(2))
-                            })
-                        })
-                        ActualPowerData.forEach(item => {
-                            chartData.value[1].value.push({
-                                text: dayjs(item.ts).format('hh:mm'),
-                                value: parseFloat((item.doubleValue).toFixed(2))
-                            })
-                        })
-                        chartData.id = this.station[index].id
-                        this.allChartDate.push(chartData)
-                        console.log(this.allChartDate);
-                        index++
-                        if (index >= this.station.length) {
-                            this.$refs.detailst.totleErtcher()
-                            setTimeout(() => {
-                                this.allChartDate = []
-                                this.getChartData(0)
-                            }, 60000);
-                        } else {
-                            this.getChartData(index)
-                        }
-                    })
-                })
-            },
-            opened() {
-
-            },
-            closed() {
-
-            },
-            handleClicks(id) {
-                this.showData = this.allChartDate.find(ele => {
-                    return ele.id == id
+              } else {
+                res1.data.forEach((item) => {
+                  PowerSetData.push({
+                    ts: item.ts,
+                    doubleValue: item.doubleValue * PowerSet.calc,
+                  });
+                });
+              }
+              chartData.value[0] = {
+                title: "有功设定限值(MW)",
+                yAxisIndex: 0,
+                value: [],
+              };
+              chartData.value[1] = {
+                title: "实发有功(MW)",
+                yAxisIndex: 0,
+                value: [],
+              };
+              PowerSetData.forEach((item) => {
+                chartData.value[0].value.push({
+                  text: dayjs(item.ts).format("HH:mm"),
+                  value: parseFloat(Number(item.doubleValue).toFixed(2)),
                 });
-                this.showData.name = this.station.find(ele => {
-                    return ele.id == id
+              });
+              ActualPowerData.forEach((item) => {
+                chartData.value[1].value.push({
+                  text: dayjs(item.ts).format("HH:mm"),
+                  value: parseFloat(Number(item.doubleValue).toFixed(2)),
                 });
-                this.detailsDisplay = true
-            },
-            closeds() {
-                this.detailsDisplay = false
-            },
-        },
-    }
+              });
+              chartData.id = this.station[index].id;
+              this.allChartDate.push(chartData);
+              index++;
+              if (index >= this.station.length) {
+                this.$refs.detailst.totleErtcher();
+                setTimeout(() => {
+                  this.allChartDate = [];
+                  this.getChartData(0);
+                }, 60000);
+              } else {
+                this.getChartData(index);
+              }
+            });
+        });
+      }else{
+        setTimeout(() => {
+          this.getChartData(0);
+        }, 100);
+      }
+    },
+    opened() {
+      this.getLatest(0);
+      this.getChartData(0);
+    },
+    closed() {
+      clearInterval(this.intervals);
+      this.intervals = null;
+    },
+    handleClicks(id) {
+      this.showData = this.allChartDate.find((ele) => {
+        return ele.id == id;
+      });
+      this.showData.name = this.station.find((ele) => {
+        return ele.id == id;
+      });
+      this.detailsDisplay = true;
+    },
+    closeds() {
+      this.detailsDisplay = false;
+    },
+  },
+};
 </script>
 
 <style scoped>
-    .bodyy {
-        display: flex;
-        flex-direction: row;
-        background-color: black;
-        width: 100%;
-        margin-top: -30px;
-        height: 91vh;
-    }
+.bodyy {
+  display: flex;
+  flex-direction: row;
+  background-color: black;
+  width: 100%;
+  margin-top: -30px;
+  min-height: 90vh;
+}
 </style>

+ 81 - 16
src/components/focus/dataDetails.vue

@@ -3,43 +3,43 @@
         <div :class="index<3?'showContents':'showContents'" v-for="(item, index) in station" :key="index">
             <div class="stationName">
                 <div class="titleName">{{item.name}}</div>
-                <div class="titleNames">({{item.names}})</div>
-                <img v-if="allDate[item.id]?.Status?.value === 0" class="statusIcons"
+                <div class="titleNames" v-if="item.schedulingName">({{item.schedulingName}})</div>
+                <img v-if="(!allDate[item.id]?.Status?.value) || allDate[item.id]?.Status?.value === 0" class="statusIcons"
                     src="../../assets/img/controlcenter/daraTrue.png">
                 <img v-else class="statusIcons"
                     src="../../assets/img/controlcenter/dataFalse.png">
-                <div class="titleNames" v-if="allDate[item.id]?.Status?.value !== 0">
+                <div class="titleNames" v-if="allDate[item.id]?.Status?.value && allDate[item.id]?.Status?.value!== 0">
                     {{((1-this.allDate[item.id]?.PowerSet?.value/this.allDate[item.id]?.InstalledCapacity?.value)*100).toFixed(2)}}%
                 </div>
             </div>
             <div class="dataList">
-                <div class="data">
+                <div class="data" @dblclick="dbClicks(allDate[item.id]?.PowerSet,'有功设定限值')">
                     <div class="name">有功设定限值:</div>
                     <div :class="index<3?'nums':'nums'">{{allDate[item.id]?.PowerSet?.value??0}}</div>
                     <div class="unit">MW</div>
                 </div>
-                <div class="data">
+                <div class="data" @dblclick="dbClicks(allDate[item.id]?.ActualPower,'实发有功')">
                     <div class="name">实发有功:</div>
                     <div :class="index<3?'nums':'nums'">{{allDate[item.id]?.ActualPower?.value??0}}</div>
                     <div class="unit">MW</div>
                 </div>
-                <div class="data">
+                <div class="data" @dblclick="dbClicks(allDate[item.id]?.AgcUp,'AGC可调上限')">
                     <div class="name">AGC可调上限:</div>
                     <div :class="index<3?'nums':'nums'">{{allDate[item.id]?.AgcUp?.value??0}}</div>
                     <div class="unit">MW</div>
                 </div>
-                <div class="data">
+                <div class="data" @dblclick="dbClicks(allDate[item.id]?.TheoryPower,'理论功率')">
                     <div class="name">理论功率:</div>
                     <div :class="index<3?'nums':'nums'">{{allDate[item.id]?.TheoryPower?.value??0}}</div>
                     <div class="unit">MW</div>
                 </div>
-                <div class="data">
+                <div class="data" @dblclick="dbClicks(allDate[item.id]?.AgcLower,'AGC可调下限')">
                     <div class="name">AGC可调下限:</div>
                     <div :class="index<3?'nums':'nums'">{{allDate[item.id]?.AgcLower?.value??0}}</div>
                     <div class="unit">MW</div>
                 </div>
 
-                <div class="data">
+                <div class="data" @dblclick="dbClicks(allDate[item.id]?.ForecastPower,'预测功率')">
                     <div class="name">预测功率:</div>
                     <div :class="index<3?'nums':'nums'">{{allDate[item.id]?.ForecastPower?.value??0}}</div>
                     <div class="unit">MW</div>
@@ -87,17 +87,27 @@
                     </div>
                 </div>
             </div>
-            <div :id="item.id" class="echarts" @click="handleClick(item.id)"></div>
+            <div :id="item.id" class="echarts" @dblclick="handleClick(item.id)"></div>
         </div>
-        
+
+        <Details @closed="closed()" v-model="display" :partsName='partsName' echartsId="modelEcharts" :datas="modelDetails" :calc="this.modelData.calc"
+        @search-data="search" @original-data="originalData"></Details>
     </div>
     
 </template>
 <script>
     import * as echarts from "echarts";
+    import Details from "../basicDataDetails.vue";
+    import api from "api/index";
     export default {
+        components: {
+            Details
+        },
         data() {
             return {
+                display: false,
+                modelData: {},
+                partsName: '',
             };
         },
         props: {
@@ -125,8 +135,53 @@
 
         },
         methods: {
+            dbClicks(data, partsName, timeValues) {
+                this.modelData = data
+                let date = new Date()
+                let endTs = timeValues ? (timeValues[1] > date.getTime()) ? date.getTime() : timeValues[1] : date.getTime();
+                let startTs = timeValues ? timeValues[0] : endTs - 28800000;
+                data.tag&&api.getPower({
+                    tagName: data.tag,
+                    startTs: startTs,
+                    endTs: endTs,
+                    interval: 60,
+                }).then(res => {
+                    if (res.data.length > 0) {
+                        this.partsName = partsName
+                        this.display = true;
+                        this.modelDetails = res.data
+                    } else {
+                        this.modelDetails = []
+                    }
+                })
+            },
+            original(data, partsName, timeValues) {
+                this.modelData = data
+                let date = new Date()
+                let endTs = timeValues ? (timeValues[1] > date.getTime()) ? date.getTime() : timeValues[1] : date.getTime();
+                let startTs = timeValues ? timeValues[0] : endTs - 28800000;
+                api.getOriginalPower({
+                    tagName: data.tag,
+                    startTs: startTs,
+                    endTs: endTs,
+                }).then(res => {
+                    if (res.data.length > 0) {
+                        this.partsName = partsName
+                        this.display = true;
+                        this.modelDetails = res.data
+                    } else {
+                        this.modelDetails = []
+                    }
+                })
+            },
+            search(values, interval) {
+                this.interval = interval
+                this.dbClicks(this.modelData, this.partsName, values)
+            },
+            originalData(values) {
+                this.original(this.modelData, this.partsName, values)
+            },
             totleErtcher() {
-                console.log(this.allDate);
                 this.allChartDate.forEach(item => {
                     let chartDom = document.getElementById(item.id);
                     let myChart = echarts.init(chartDom, '#ffffff');
@@ -237,8 +292,18 @@
             },
             closed() {
                 this.detailsDisplay = false 
+                this.display = false;
             }
         },
+        watch:{
+            allChartDate: {
+                handler: function (json) {
+                    if (json) {
+                    this.totleErtcher() 
+                    }
+                },
+            },
+        }
     }
 </script>
 
@@ -267,7 +332,7 @@
     }
 
     .showContents {
-        width: 23.7%;
+        width: 40%;
         display: flex;
         flex-direction: column;
         border: 1px solid rgba(77, 77, 77, 1);
@@ -313,10 +378,10 @@
     }
 
     .echarts {
-        width: 110%;
-        height: 290px;
+        width: 100%;
+        height: 500px;
         margin-left: 10px;
-        padding-top: 20px;
+        padding-top: -20px;
     }
 
     .dataList {

+ 1 - 1
src/components/focus/detailsCharts.vue

@@ -4,7 +4,7 @@
             <div class="showTitles">
                 <div class="stationName">
                     <div class="titleName">{{showData?.name?.name}}</div>
-                    <div class="titleNames">({{showData?.name?.names}})</div>
+                    <div class="titleNames" v-if="showData?.name?.names">({{showData?.name?.names}})</div>
                 </div>
             </div>
         </template>

+ 116 - 88
src/components/focus/focusArea.vue

@@ -1,101 +1,129 @@
 <template>
-    <div class="body">
-        <img class="logo" src="../../assets/img/logo.png" alt="">
-        <div class="title">关注区</div>
-        <div class="agc" @click="showAGC">AGC监控</div>
-        <div style="margin-top: 50px; margin-left: 10px; height: 24vh;">
-            <el-scrollbar>
-                <div class="scoll" style="margin-left: 5px;">
-                    <FocusCard></FocusCard>
-                </div>
-            </el-scrollbar>
+  <div class="body">
+    <img class="logo" src="../../assets/img/logo.png" alt="" />
+    <div class="title">关注区</div>
+    <div class="agc" @click="showAGC">AGC监控</div>
+    <div class="booster" @click="showBooster">升压站监控</div>
+    <div style="margin-top: 50px; margin-left: 10px; height: 24vh">
+      <el-scrollbar>
+        <div class="scoll" style="margin-left: 5px">
+          <FocusCard></FocusCard>
         </div>
-        <AGCDetails v-model="display"></AGCDetails>
+      </el-scrollbar>
     </div>
-
+    <AGCDetails v-model="display"></AGCDetails>
+    <StationSvgDetailPages
+    v-model="displayBooster"
+    @close="close"
+  >
+  </StationSvgDetailPages>
+  </div>
 </template>
 <script>
-    import FocusCard from "./focusCard.vue";
-    import AGCDetails from "./agcDetails.vue";
-    
-    // import boxSelect from "components/boxSelect.vue";
-    export default {
-        data() {
-            return {
-                display: false,
-                
-            };
-        },
-        components: {
-            FocusCard,
-            AGCDetails
-            // boxSelect,
-        },
-        methods: {
-            showAGC() {
-                this.display = true
-            },
-            
-        },
-    }
+import FocusCard from "./focusCard.vue";
+import AGCDetails from "./agcDetails.vue";
+import StationSvgDetailPages from "../stationSvgDetailPages.vue";
+export default {
+  data() {
+    return {
+      display: false,
+      displayBooster: false,
+    };
+  },
+  components: {
+    FocusCard,
+    AGCDetails,
+    StationSvgDetailPages
+  },
+  methods: {
+    showAGC() {
+      this.display = true;
+    },
+    showBooster(){
+      this.displayBooster = true;
+    },
+    close() {
+      this.displayBooster = false;
+    },
+  },
+};
 </script>
 <style scoped>
-    .body {
-        border: 1px solid #373737;
-        width: 100%;
-        margin-left: 15px;
-        margin-top: 10px;
-        height: 30.5vh
-    }
+.box {
+  width: 100px;
+  height: 20px;
+
+  margin-top: 30px;
+}
+.body {
+  border: 1px solid #373737;
+  width: 100%;
+  margin-left: 15px;
+  margin-top: 10px;
+  height: 30.5vh;
+}
 
-    .body .scoll {
-        height: 91%;
-    }
+.body .scoll {
+  height: 91%;
+}
 
-    .title {
-        color: #ffffff;
-        font-size: 14px;
-        margin-left: 32px;
-        /* margin-top: 12px; */
-        margin-bottom: 10px;
-        /* width: 570px; */
-        width: 29vw;
-        height: 50px;
-        display: flex;
-        align-items: center;
-        position: absolute;
-        background-color: #000000;
-    }
+.title {
+  color: #ffffff;
+  font-size: 14px;
+  margin-left: 32px;
+  /* margin-top: 12px; */
+  margin-bottom: 10px;
+  /* width: 570px; */
+  width: 29vw;
+  height: 50px;
+  display: flex;
+  align-items: center;
+  position: absolute;
+  background-color: #000000;
+}
 
-    .title::before {
-        z-index: 1;
-        content: '';
-        position: absolute;
-        left: -18px !important;
-        /* top: 30px !important; */
-        width: 5px;
-        height: 5px;
-        background-color: rgba(230, 191, 65, 1);
-        border-radius: 50%;
-    }
+.title::before {
+  z-index: 1;
+  content: "";
+  position: absolute;
+  left: -18px !important;
+  /* top: 30px !important; */
+  width: 5px;
+  height: 5px;
+  background-color: rgba(230, 191, 65, 1);
+  border-radius: 50%;
+}
 
-    .logo {
-        position: absolute;
-        top: 2px;
-        left: 12px;
-    }
+.logo {
+  position: absolute;
+  top: 2px;
+  left: 12px;
+}
 
-    .agc {
-        position: absolute;
-        color: #ffffff;
-        font-size: 14px;
-        right: 0;
-        top: 23px;
-        width: 80px;
-        height: 30px;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        background-color: rgba(37, 116, 219, 1);
-    }
+.agc {
+  position: absolute;
+  color: #ffffff;
+  font-size: 14px;
+  right: 0;
+  top: 23px;
+  width: 80px;
+  height: 30px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  background-color: rgba(37, 116, 219, 1);
+}
+.booster{
+  position: absolute;
+  color: #ffffff;
+  font-size: 14px;
+  right: 100px;
+  top: 23px;
+  width: 80px;
+  height: 30px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  background-color: rgba(37, 116, 219, 1);
+}
 </style>

+ 231 - 262
src/components/focus/focusCard.vue

@@ -1,272 +1,241 @@
 /* 推荐区 */
 <template>
-	<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
-		<div class="area" v-for="(vl , index) in values" :key="vl" @dblclick="sendMsg(vl,flase,index)">
-			<img class="imgs" src="../../assets/img/RecommendedArea/background.png" alt="">
-			<div class="content">{{vl.showType}}</div>
-			<div class="">{{vl.name}}</div>
-			<div class="">{{vl.createTime}}</div>
-		</div>
-	</div>
-	<PhotoelectricDetailPages ref="photo" @closed="closed()" :data="dialogData.data"
-		:stationName="dialogData.stationName" v-model="dialogVisible">
-	</PhotoelectricDetailPages>
-	<WindturbineDetailPages v-model="windVisible" :windturbine="currentWindturbine" @close="close">
-	</WindturbineDetailPages>
-	<StationSvgDetailPages v-model="svgVisible" :stationName="stationNames" :svgWeb="svgWeb" @close="close">
-	</StationSvgDetailPages>
+  <div style="display: flex; justify-content: flex-start; flex-wrap: wrap">
+    <div
+      class="area"
+      v-for="(vl, index) in values"
+      :key="vl"
+      @dblclick="sendMsg(vl, flase, index)"
+    >
+      <img
+        class="imgs"
+        src="../../assets/img/RecommendedArea/background.png"
+        alt=""
+      />
+      <div class="content">{{ vl.showType }}</div>
+      <div class="">{{ vl.name }}</div>
+      <div class="">{{ vl.createTime }}</div>
+    </div>
+  </div>
+  <PhotoelectricDetailPages
+    ref="photo"
+    @closed="closed()"
+    :data="dialogData.data"
+    :stationName="dialogData.stationName"
+    v-model="dialogVisible"
+  >
+  </PhotoelectricDetailPages>
+  <WindturbineDetailPages
+    v-model="windVisible"
+    :windturbine="currentWindturbine"
+    @close="close"
+  >
+  </WindturbineDetailPages>
+  <StationSvgDetailPages
+    v-model="svgVisible"
+    :svgWeb="svgWeb"
+    @close="close"
+  >
+  </StationSvgDetailPages>
 </template>
 
 <script>
-	import BackgroundData from "utils/BackgroundData"
-	import { Photoelectric } from "utils/PhotoelectricDetailPages";
-	import PhotoelectricDetailPages from "./PhotoelectricDetailPages.vue"
-	import MessageBridge from 'utils/MessageBridge'
-	import StationSvgDetailPages from "../stationSvgDetailPages.vue";
-	import WindturbineDetailPages from "../WindturbineDetailPages.vue";
-	import api from "api/index";
-	import axios from 'axios';
-	import dayjs from 'dayjs'
-	export default {
-		name: "RecommendedArea",
-		props: ["datas"],
-		data() {
-			return {
-				values: [],
-				currentWindturbine: {},
-				dialogVisible: false,
-				svgVisible: false,
-				windVisible: false,
-				svgWeb: '',
-				stationNames: '',
-				dialogData: {
-					data: {
-						PowerSet: '',
-						AgcUp: '',
-						AgcLower: '',
-						ActualPower: '',
-						TheoryPower: '',
-						ForecastPower: '',
-						AgcIn: '',
-						AgcFar: '',
-						SumLock: '',
-						SubLock: '',
-					}
-				},
-				dataMsg: [],
-				interval: '',
-				arrKey: [],
-				timeIndex: 0
-			};
-		},
-		components: {
-			PhotoelectricDetailPages,
-			StationSvgDetailPages,
-			WindturbineDetailPages,
-		},
-		created() {
-			this.datacontrol();
-			// this.initData();
-		},
-		methods: {
-			datacontrol() {
-				let mb = MessageBridge.getInstance();
-				let vss = [{ key: "/topic/voice-control", action: this.windturbineMessage }];
-				let attention = [{ key: "/topic/attention", action: this.attention }];
-				mb.register(attention);
-				mb.register(vss);
-			},
-			attention(msg) {
-				let list = JSON.parse(msg)
-				let types = {
-					ElectricityRestrictions: '限电',
-					Offline: '离线',
-					Accident: '故障',
-				}
-				list.forEach(item => {
-					item.createTime = dayjs(item.time).format('YYYY-MM-DD HH:mm:ss')
-					item.showType = types[item.type]
-				})
-				this.values = list
-			},
-			windturbineMessage(msg) {
-				let bd = BackgroundData.getInstance();
-				let arr = []
-				if (msg === 'CLOSE') {
-					arr.push(msg)
-				} else {
-					arr = msg.split('-')
-				}
-				this.dialogVisible = false
-				this.svgWeb = ''
-				if (arr[0] === 'OPEN_AGC' && arr[1] !== 'GS') {
-					let data = bd.Recommends
-					for (let v in data) {
-						if (arr[1] === data[v].stationID) {
-							this.sendMsg(data[v],true)
-						}
-					}
-				} else if (arr[0] === 'CLOSE') {
-					this.dialogVisible = false
-					this.svgVisible = false
-				}
-			},
-			closed() {
-				clearInterval(this.interval);
-			},
-			close() {
-				this.svgVisible = false;
-			},
-			initData() {
-				setInterval(this.refreshData, 2000);
-			},
-			refreshData() {
-				let bd = BackgroundData.getInstance();
-				let list = new Array();
-				let thisKey = ''
-				for (let v in bd.Recommends) {
-					thisKey += v + ',';
-				}
-				axios.get(process.env.VUE_APP_ADAPTERURL + `/ts/latest?keys=` + thisKey)
-					.then(msg => {
-						for (let v in msg.data) {
-							if (msg.data[v].doubleValue ? (msg.data[v].doubleValue > 0) : (msg.data[v].booleanValue)) {
-								bd.Recommends[v].isActive = true
-							}
-						}
-						for (let rec in bd.Recommends) {
-							if (bd.Recommends[rec].isActive) {
-								list.push(bd.Recommends[rec])
-							}
-						}
-						list.forEach(item => {
-							item.createTime = dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss')
-						})
-						this.values = list
-					})
-			},
-			sendMsg: function (vl, types ,index) {
-				if (vl.attentionType === 'Station' && vl.type === 'Accident') {
-					this.svgVisible = true;
-					this.svgWeb = vl.stationId;
-					this.stationNames = vl.name
-				} else if ((vl.attentionType === 'Station' && vl.type === 'ElectricityRestrictions') ||types) {
-					let that = this;
-					that.timeIndex = 0;
-					that.ajaxDetail(vl, index);
-					that.interval = window.setInterval(function () {
-						that.ajaxDetail(vl, index);
-					}, 3000);
-					that.dialogVisible = true;
-					that.dialogData.stationName = vl.name;
-				} else if (vl.attentionType === 'WindTurbine') {
-					this.windVisible = true;
-					this.currentWindturbine = this.$store.state.windturbinelist[vl.id];
-				}
+import PhotoelectricDetailPages from "./PhotoelectricDetailPages.vue";
+import MessageBridge from "utils/MessageBridge";
+import StationSvgDetailPages from "../stationSvgDetailPages.vue";
+import WindturbineDetailPages from "../WindturbineDetailPages.vue";
+import api from "api/index";
+import dayjs from "dayjs";
+export default {
+  name: "RecommendedArea",
+  props: ["datas"],
+  data() {
+    return {
+      values: [],
+      currentWindturbine: {},
+      dialogVisible: false,
+      svgVisible: false,
+      windVisible: false,
+      svgWeb: "",
+      station: [],
+      dialogData: {
+        data: {
+          PowerSet: "",
+          AgcUp: "",
+          AgcLower: "",
+          ActualPower: "",
+          TheoryPower: "",
+          ForecastPower: "",
+          AgcIn: "",
+          AgcFar: "",
+          SumLock: "",
+          SubLock: "",
+        },
+      },
+      interval: "",
+      intervalTimer: "",
+      timeIndex: 0,
+    };
+  },
+  components: {
+    PhotoelectricDetailPages,
+    StationSvgDetailPages,
+    WindturbineDetailPages,
+  },
+  created() {
+    this.datacontrol();
+    this.getAGCStation();
+  },
+  methods: {
+    getAGCStation() {
+      api.getAGCStation().then((res) => {
+        this.station = res.data;
+      });
+    },
+    datacontrol() {
+      let mb = MessageBridge.getInstance();
+      let attention = [{ key: "/topic/attention", action: this.attention }];
+      mb.register(attention);
+    },
+    attention(msg) {
+      let list = JSON.parse(msg);
+      let types = {
+        ElectricityRestrictions: "限电",
+        Offline: "离线",
+        Accident: "故障",
+        LowCurveFollowingRate: "跟随率低",
+      };
+      list.forEach((item) => {
+        item.createTime = dayjs(item.time).format("YYYY-MM-DD HH:mm:ss");
+        item.showType = types[item.type];
+      });
+      this.values = list;
+    },
+    closed() {
+      clearInterval(this.intervalTimer);
+      this.intervalTimer = null
+    },
+    close() {
+      this.svgVisible = false;
+    },
 
-			},
-			ajaxDetail(data, index) {
-				let thisKey = Photoelectric[data.id];
-				let array = []
-				thisKey.forEach(item => { item.value ? array.push(item.value) : '' })
-				let params = array.join(',')
-				api.getLatest(params).then(res => {
-					if (res) {
-						console.log(res, this.dialogData.data, thisKey);
-						for (let v in res.data) {
-							thisKey.forEach(item => {
-								let calc = item.calc ? item.calc : 1;
-								if (item.value === v) {
-									this.dialogData.data[item.tag] = {
-										name: item.name,
-										value: res.data[v].doubleValue ? res.data[v].doubleValue === 0 ? '0' : (res.data[v].doubleValue * calc).toFixed(2) : (res.data[v].booleanValue ? 1 : 0)
-									}
-									console.log(this.dialogData.data);
-								}
-							})
-						}
-					}
-				})
-				if (this.timeIndex == 0) {//一分钟执行一次
-					let date = new Date()
-					let endTs = date.getTime();
-					let starTs = endTs - 28800000;
-					const PowerSet = thisKey.find(ele => {
-						return ele.tag == 'PowerSet'
-					});
-					const ActualPower = thisKey.find(ele => {
-						return ele.tag == 'ActualPower'
-					});
-					let PowerSetData = [],
-						ActualPowerData = [];
-					api.getPower({
-						tagName: PowerSet.value,
-						startTs: starTs,
-						endTs: endTs,
-						interval: 60,
-					}).then(res1 => {
-						api.getPower({
-							tagName: ActualPower.value,
-							startTs: starTs,
-							endTs: endTs,
-							interval: 60,
-						}).then(res2 => {
-							res1.data.forEach(item => {
-								PowerSetData.push({
-									ts: item.ts,
-									doubleValue: item.doubleValue * PowerSet.calc
-								})
-							})
-							res2.data.forEach(item => {
-								ActualPowerData.push({
-									ts: item.ts,
-									doubleValue: item.doubleValue * ActualPower.calc
-								})
-							})
-							this.$refs.photo.initData(PowerSetData, ActualPowerData);
-						});
-					});
-				} else if (this.timeIndex == 20) {
-					this.timeIndex = -1;
-				}
-				this.timeIndex++;
-			},
-		},
-	};
+    sendMsg: function (vl, types, index) {
+      if (vl.attentionType === "Station" && vl.type === "Accident") {
+        this.svgVisible = true;
+        this.svgWeb = vl.stationId;
+      } else if (
+        (vl.attentionType === "Station" &&
+          vl.type === "ElectricityRestrictions") ||
+        types
+      ) {
+        let that = this;
+        that.timeIndex = 0;
+        that.ajaxDetail(vl, index);
+        that.intervalTimer = window.setInterval(function () {
+          that.ajaxDetail(vl, index);
+        }, 3000);
+        that.dialogVisible = true;
+        that.dialogData.stationName = this.station.filter(
+          (item) => item.id === vl.id
+        )[0].name;
+      } else if (vl.attentionType === "WindTurbine") {
+        this.windVisible = true;
+        this.currentWindturbine = this.$store.state.windturbinelist[vl.id];
+      }
+    },
+    ajaxDetail(data, index) {
+      let thisKey = this.station.filter((item) => item.id === data.id)[0].tags;
+      let array = [];
+      thisKey.forEach((item) => {
+        item.value ? array.push(item.value) : "";
+      });
+      let params = array.join(",");
+      api.getLatest(params).then((res) => {
+        if (res) {
+          for (let v in res.data) {
+            thisKey.forEach((item) => {
+              let calc = item.calc ? item.calc : 1;
+              if (item.value === v) {
+                this.dialogData.data[item.tag] = {
+                  name: item.name,
+                  value: res.data[v].doubleValue
+                    ? res.data[v].doubleValue === 0? 0 : Number((res.data[v].doubleValue * calc).toFixed(2))
+                    : res.data[v].booleanValue? 1: 0,
+                };
+              }
+            });
+          }
+        }
+      });
+      if (this.timeIndex == 0) {
+        //一分钟执行一次
+        let date = new Date();
+        let endTs = date.getTime();
+        let starTs = endTs - 28800000;
+        const PowerSet = thisKey.find((ele) => {
+          return ele.tag == "PowerSet";
+        });
+        const ActualPower = thisKey.find((ele) => {
+          return ele.tag == "ActualPower";
+        });
+        let PowerSetData = [],
+          ActualPowerData = [];
+        api
+          .getPower({
+            tagName: PowerSet.value,
+            startTs: starTs,
+            endTs: endTs,
+            interval: 60,
+          })
+          .then((res1) => {
+            api
+              .getPower({
+                tagName: ActualPower.value,
+                startTs: starTs,
+                endTs: endTs,
+                interval: 60,
+              })
+              .then((res2) => {
+                res1.data.forEach((item) => {
+                  PowerSetData.push({
+                    ts: item.ts,
+                    doubleValue: item.doubleValue * PowerSet.calc,
+                  });
+                });
+                res2.data.forEach((item) => {
+                  ActualPowerData.push({
+                    ts: item.ts,
+                    doubleValue: item.doubleValue * ActualPower.calc,
+                  });
+                });
+                this.$refs.photo.initData(PowerSetData, ActualPowerData);
+              });
+          });
+      } else if (this.timeIndex == 20) {
+        this.timeIndex = -1;
+      }
+      this.timeIndex++;
+    },
+  },
+};
 </script>
 <style scoped>
-	/* table {
-		background-image: url("../../assets/img/RecommendedArea/background.png");
-		text-align: center;
-		font-size: 12px;
-		background-size: 110px;
-		margin-left: 10px;
-		margin-top: 10px;
-		padding-top: 10px;
-		background-repeat: no-repeat;
-		color: #ffffff;
-	} */
-	.imgs {
-		/* width: 70px;
-		height: 66px; */
-	}
+.area {
+  display: flex;
+  flex-direction: column;
+  font-size: 12px;
+  color: #ffffff;
+  width: 130px;
+  align-items: center;
+  margin-bottom: 10px;
+}
 
-	.area {
-		display: flex;
-		flex-direction: column;
-		font-size: 12px;
-		color: #ffffff;
-		width: 130px;
-		align-items: center;
-		margin-bottom: 10px;
-	}
-
-	.content {
-		margin-top: -70px;
-		width: 25px;
-		height: 34px;
-		margin-bottom: 20px;
-		display: flex;
-		align-items: center;
-	}
+.content {
+  margin-top: -70px;
+  width: 25px;
+  height: 34px;
+  margin-bottom: 20px;
+  display: flex;
+  align-items: center;
+}
 </style>

File diff suppressed because it is too large
+ 919 - 715
src/components/matrixBlock.vue


+ 9 - 38
src/components/modeControl/detailPages.vue

@@ -3,7 +3,7 @@
 		<template #title>
 			<div class="showTitle">
 				<img class="titleImg" src="../../assets/img/controlcenter/daraTrue.png" alt="">
-				<div class="titles">国电电力宁夏新能源开发有限公司</div>
+				<div class="titles">国电电力河北新能源开发有限公司</div>
 			</div>
 		</template>
 		<div class="body">
@@ -67,7 +67,6 @@
 			},
 		},
 		created() {
-			// this.initData()
 		},
 		mounted() {
 			this.initData()
@@ -119,12 +118,12 @@
 			},
 			async getDate() {
 				await this.getPower({
-					PowerSet: 'JSFW.NX_GD_FDC_XX_XX_XXX_XXX_CI0135',
-					name: 'PowerSet',
+					PowerSet: 'HB_GD_QYG_JS_XX_XX_XXX_CI0125',
+					name: 'ActualPower',
 				})
 				await this.getPower({
-					ActualPower: 'JSFW.NX_GD_FDC_XX_XX_XXX_XXX_CI0192',
-					name: 'ActualPower',
+					ActualPower: 'HB_GD_QYG_JS_XX_XX_XXX_CI0180',
+					name: 'theoryPower',
 				})
 				this.timer = setTimeout(() => {
 					this.getDate()
@@ -135,7 +134,6 @@
 				let endTs = date.getTime();
 				let startTs = endTs - 28800000;
 				let names = values.name
-				// 	this.powerLineChartData = this.chartData;
 				api.getPower({
 					tagName: values.PowerSet ? values.PowerSet : values.ActualPower,
 					startTs: startTs,
@@ -143,11 +141,11 @@
 					interval: 60,
 				}).then(res => {
 					if (res) {
-						if (names === 'PowerSet') {
+						if (names === 'ActualPower') {
 							let list = []
 							res.data.forEach(item => {
 								list.push({
-									text: dayjs(item.ts).format('hh:mm'),
+									text: dayjs(item.ts).format('HH:mm'),
 									value: parseFloat((item.doubleValue).toFixed(2))
 								})
 								this.chartData.value[0].value = list
@@ -156,13 +154,12 @@
 							let list = []
 							res.data.forEach(item => {
 								list.push({
-									text: dayjs(item.ts).format('hh:mm'),
-									value: (parseFloat((item.doubleValue).toFixed(2)) / 1000)
+									text: dayjs(item.ts).format('HH:mm'),
+									value: (parseFloat((item.doubleValue).toFixed(2)/1000))
 								})
 								this.chartData.value[1].value = list
 							})
 						}
-						// this.powerLineChartData = this.chartData;
 						this.totleErtcher(this.chartData)
 					}
 				})
@@ -270,32 +267,6 @@
 				clearInterval(this.timer);
 				//勿删,传递关闭方法
 			},
-			// initData(PowerSet, ActualPower) {
-			// 	// this.chartData.units = ["(MW)", "(MW)"];
-			// 	this.chartData.value[0] = {
-			// 		title: "有功设定限值(MW)",
-			// 		yAxisIndex: 0,
-			// 		value: []
-			// 	};
-			// 	this.chartData.value[1] = {
-			// 		title: "实发有功(MW)",
-			// 		yAxisIndex: 0,
-			// 		value: []
-			// 	}
-			// 	PowerSet.forEach(item => {
-			// 		this.chartData.value[0].value.push({
-			// 			text: dayjs(item.ts).format('hh:mm'),
-			// 			value: parseFloat((item.doubleValue).toFixed(2))
-			// 		})
-			// 	})
-			// 	ActualPower.forEach(item => {
-			// 		this.chartData.value[1].value.push({
-			// 			text: dayjs(item.ts).format('hh:mm'),
-			// 			value: parseFloat((item.doubleValue).toFixed(2))
-			// 		})
-			// 	})
-			// 	this.powerLineChartData = this.chartData;
-			// }
 		},
 	};
 </script>

+ 34 - 75
src/components/modeControl/modeControl.vue

@@ -7,45 +7,49 @@
         </div>
         <div style="display: flex;flex-direction: row;z-index: 2;">
             <div class="showData">
-                <div class="dataBox" @dblclick="dbClicks(showDate.healthIndex,'健康指数')">
+                <!-- allHealthIndex:0,
+                allResourceIndex:0,
+                healthIndex:0,
+                resourceIndex:0, -->
+                <div class="dataBox" @dblclick="dbClicks($store.state.currentStation?showDate?.stationOverviewInfos[$store.state.currentStation]?.healthIndex:showDate.healthIndex,'健康指数')">
                     <div class="dataTitle">健康指数</div>
-                    <div class="datas">{{showDate.healthIndex?.value.toFixed(0)}}</div>
+                    <div class="datas">{{$store.state.currentStation?healthIndex.toFixed(0):allHealthIndex.toFixed(0)}}%</div>
                 </div>
-                <div class="dataBox" @dblclick="dbClicks(showDate.resourceIndex,'资源指数')">
+                <div class="dataBox" @dblclick="dbClicks($store.state.currentStation?showDate?.stationOverviewInfos[$store.state.currentStation]?.resourceIndex:showDate.resourceIndex,'资源指数')">
                     <div class="dataTitle">资源指数</div>
-                    <div class="datas">{{showDate.resourceIndex?.value.toFixed(0)}}</div>
+                    <div class="datas">{{$store.state.currentStation?resourceIndex.toFixed(0):allResourceIndex.toFixed(0)}}%</div>
                 </div>
             </div>
             <div>
                 <div id="mainEcharts" @dblclick="dbClick()" class="echarts"></div>
                 <div class="powerContent">
-                    <div class="power" @dblclick="dbClicks(showDate.realTimePower,'实际功率')">
+                    <div class="power" @dblclick="dbClicks($store.state.currentStation?showDate?.stationOverviewInfos[$store.state.currentStation]?.realTimePower:showDate.realTimePower,'实际功率')">
                         <div class="powerTitle">实际功率</div>
                         <div class="powerDatas" style="background-color: rgba(75, 85, 174, 1);">
-                            {{showDate.realTimePower?.value.toFixed(2)}}</div>
+                            {{$store.state.currentStation?showDate?.stationOverviewInfos[$store.state.currentStation]?.realTimePower?.value.toFixed(2):showDate.realTimePower?.value.toFixed(2)}}</div>
                     </div>
-                    <div class="power1" @dblclick="dbClicks(showDate.theoreticalPower,'理论功率')">
+                    <div class="power1" @dblclick="dbClicks($store.state.currentStation?showDate?.stationOverviewInfos[$store.state.currentStation]?.theoreticalPower:showDate.theoreticalPower,'理论功率')">
                         <div class="powerTitle">理论功率</div>
                         <div class="powerDatas" style="background-color: rgba(05, 187, 76, 1);">
-                            {{showDate.theoreticalPower?.value.toFixed(2)}}</div>
+                            {{$store.state.currentStation?showDate?.stationOverviewInfos[$store.state.currentStation]?.theoreticalPower?.value.toFixed(2):showDate.theoreticalPower?.value.toFixed(2)}}</div>
                     </div>
-                    <div class="power2" @dblclick="dbClicks(showDate.agcPowerSet,'AGC有功设定')">
+                    <div class="power2" @dblclick="dbClicks($store.state.currentStation?showDate?.stationOverviewInfos[$store.state.currentStation]?.agcPowerSet:showDate.agcPowerSet,'AGC有功设定')">
                         <div class="powerTitle">AGC有功设定</div>
                         <div class="powerDatas" style="background-color: rgba(186, 50, 55, 1);">
-                            {{showDate.agcPowerSet?.value.toFixed(2)}}</div>
+                            {{$store.state.currentStation?showDate?.stationOverviewInfos[$store.state.currentStation]?.agcPowerSet?.value.toFixed(2):showDate.agcPowerSet?.value.toFixed(2)}}</div>
                     </div>
                 </div>
             </div>
             <div class="showData">
-                <div class="dataBox-right" @dblclick="dbClicks(showDate.windEnergyRate,'风能利用率')">
+                <div class="dataBox-right" @dblclick="dbClicks($store.state.currentStation?showDate?.stationOverviewInfos[$store.state.currentStation]?.windEnergyRate:showDate.windEnergyRate,'风能利用率')">
                     <div class="dataTitle">风能利用率</div>
                     <div class="datas" v-if="showDate.windEnergyRate?.value <= 100">
-                        {{showDate.windEnergyRate?.value.toFixed(2)}}%</div>
+                        {{$store.state.currentStation?showDate?.stationOverviewInfos[$store.state.currentStation]?.windEnergyRate?.value.toFixed(2):showDate.windEnergyRate?.value.toFixed(2)}}%</div>
                 </div>
-                <div class="dataBox-right" @dblclick="dbClicks(showDate.curveFollowingRate,'曲线跟随率')">
+                <div class="dataBox-right" @dblclick="dbClicks($store.state.currentStation?showDate?.stationOverviewInfos[$store.state.currentStation]?.curveFollowingRate:showDate.curveFollowingRate,'曲线跟随率')">
                     <div class="dataTitle">曲线跟随率</div>
                     <div class="datas" v-if="showDate.curveFollowingRate?.value <= 100">
-                        {{showDate.curveFollowingRate?.value.toFixed(2)}}%</div>
+                        {{$store.state.currentStation?showDate?.stationOverviewInfos[$store.state.currentStation]?.curveFollowingRate?.value.toFixed(2):showDate.curveFollowingRate?.value.toFixed(2)}}%</div>
                 </div>
             </div>
         </div>
@@ -87,6 +91,10 @@
                 partsName: '',
                 modelData: {},
                 interval: 60,
+                allHealthIndex:0,
+                allResourceIndex:0,
+                healthIndex:0,
+                resourceIndex:0,
             };
         },
         created() {
@@ -105,35 +113,16 @@
         methods: {
             initData() {
                 let mb = MessageBridge.getInstance();
-                let vss = [{ key: "/topic/voice-control", action: this.windturbineMessage }];
                 let vs = [{ key: "/topic/title-info", action: this.getEchartss }];
                 mb.register(vs);
-                mb.register(vss);
-            },
-            windturbineMessage(msg) {
-                let arr = []
-                if (msg === 'CLOSE') {
-                    arr.push(msg)
-                } else {
-                    arr = msg.split('-')
-                }
-                this.dialogVisible = false
-                this.showSvg = false
-                this.svgWeb = ''
-                console.log(arr);
-                if (arr[0] === 'OPEN_PAGE_MANUAL') {
-                    this.ChangeBar(2)
-                } else if (arr[0] === 'OPEN_PAGE_AUTOMATIC') {
-                    this.ChangeBar(0)
-                } else if (arr[0] === 'OPEN_PAGE_RECOMMENDATION') {
-                    this.ChangeBar(1)
-                } else if (msg === 'OPEN_AGC-GS') {
-                    this.dbClick()
-                }
             },
             getEchartss(msg) {
                 this.showDate = JSON.parse(msg)
                 this.getEcharts()
+                this.allHealthIndex = (this.showDate.healthIndex?.value/this.showDate.healthIndexMax)*100
+                this.allResourceIndex = (this.showDate.resourceIndex?.value/this.showDate.resourceIndexMax)*100
+                this.healthIndex = this.$store.state.currentStation?(this.showDate.stationOverviewInfos[this.$store.state.currentStation].healthIndex?.value/this.showDate.stationOverviewInfos[this.$store.state.currentStation].healthIndexMax)*100:0
+                this.resourceIndex = this.$store.state.currentStation?(this.showDate.stationOverviewInfos[this.$store.state.currentStation].resourceIndex?.value/this.showDate.stationOverviewInfos[this.$store.state.currentStation].resourceIndexMax)*100:0
             },
             getEcharts() {
                 let chartDom = document.getElementById('mainEcharts');
@@ -142,7 +131,7 @@
                 option = {
                     series: [{
                         type: 'gauge',
-                        max: 664,
+                        max: 600,
                         splitNumber: 8,
                         anchor: {
                             show: true,
@@ -190,16 +179,6 @@
                             itemStyle: {
                                 color: 'rgba(75, 85, 174, 1)'
                             },
-                            // title: {
-                            //     color: '#999999',
-                            //     offsetCenter: ['-70%', '90%']
-                            // },
-                            // detail: {
-                            //     width: 50,
-                            //     height: 12,
-                            //     fontSize: 18,
-                            //     offsetCenter: ['-70%', '110%']
-                            // }
                         },
                         {
                             value: 137.63,
@@ -207,16 +186,6 @@
                             itemStyle: {
                                 color: 'rgba(05, 187, 76, 1)'
                             },
-                            // title: {
-                            //     color: '#999999',
-                            //     offsetCenter: ['0%', '90%']
-                            // },
-                            // detail: {
-                            //     width: 50,
-                            //     height: 12,
-                            //     fontSize: 18,
-                            //     offsetCenter: ['0%', '110%']
-                            // }
                         },
                         {
                             value: 132.04,
@@ -224,17 +193,6 @@
                             itemStyle: {
                                 color: 'rgba(186, 50, 55, 1)'
                             },
-                            // title: {
-                            //     color: '#999999',
-                            //     offsetCenter: ['70%', '90%']
-                            // },
-                            // detail: {
-                            //     align: 'center',
-                            //     width: 50,
-                            //     height: 12,
-                            //     fontSize: 18,
-                            //     offsetCenter: ['70%', '110%']
-                            // }
                         }
                         ],
                         title: false,
@@ -253,15 +211,14 @@
                         //     }
                     }]
                 };
-                option.series[0].data[0].value = Number(this.showDate.realTimePower?.value);
-                option.series[0].data[1].value = Number(this.showDate.theoreticalPower?.value);
-                option.series[0].data[2].value = Number(this.showDate.agcPowerSet?.value);
+                option.series[0].data[0].value = this.$store.state.currentStation?Number(this.showDate?.stationOverviewInfos[this.$store.state.currentStation]?.realTimePower?.value) : Number(this.showDate.realTimePower?.value);
+                option.series[0].data[1].value = this.$store.state.currentStation?Number(this.showDate?.stationOverviewInfos[this.$store.state.currentStation]?.theoreticalPower?.value) : Number(this.showDate.theoreticalPower?.value);
+                option.series[0].data[2].value = this.$store.state.currentStation?Number(this.showDate?.stationOverviewInfos[this.$store.state.currentStation]?.agcPowerSet?.value) : Number(this.showDate.agcPowerSet?.value);
                 myChart.setOption(option, true);
             },
             ChangeBar(values) {
                 let bd = BackgroundData.getInstance();
                 // let mb = MessageBridge.getInstance();
-                // let vss = { key: "/topic/voice-control" };
                 // let popup = { key: "/topic/fault-popup" };
                 // mb.unregister(popup);
                 // mb.unregister(vss);
@@ -283,6 +240,7 @@
                         this.current = values
                         this.$router.push(`/ManualPage?current=${values}`)
                     } else if (values === 1) {
+                        this.$store.commit('currentStation', '')
                         this.$store.commit('current', values)
                         if (this.current === 0) {
                             this.current = values
@@ -291,6 +249,7 @@
                             this.$router.push(`/?current=${values}`)
                         }
                     } else if (values === 0) {
+                        this.$store.commit('currentStation', '')
                         this.$store.commit('current', values)
                         if (this.current === 2) {
                             this.current = values
@@ -299,7 +258,7 @@
                             this.current = values
                         }
                     }
-                }else{
+                }else if(values === 2){
                     this.$router.push(`/ManualPage?current=${values}`)
                 }
             },
@@ -312,7 +271,7 @@
                 let date = new Date()
                 let endTs = timeValues ? (timeValues[1] > date.getTime()) ? date.getTime() : timeValues[1] : date.getTime();
                 let startTs = timeValues ? timeValues[0] : endTs - 28800000;
-                api.getPower({
+                data.tag&&api.getPower({
                     tagName: data.tag,
                     startTs: startTs,
                     endTs: endTs,

+ 0 - 562
src/components/problem/ProblemMatrixCard.vue

@@ -1,562 +0,0 @@
-<template>
-  <div class="main" v-if="values.length > 0">
-    <div>{{ title }}</div>
-    <div class="content">
-      <div class="card" v-for="(item, index) in values" :key="index" :class="
-          item.active
-            ? 'card-select-' + item.status
-            : 'card-unselect-' + item.status
-        " @click="onSelectHandler(item)" @dblclick="sendMsg(item)">
-        <div class="card-left" :class="
-            item.active
-              ? 'card-left-select-' + item.status
-              : 'card-left-unselect-' + item.status
-          ">
-          <div>{{ item.windturbineId.slice(0, 2) }}</div>
-          <div>{{ item.windturbineId.slice(5) }}</div>
-        </div>
-        <div class="card-right" :class="
-            item.active
-              ? 'card-right-select-' + item.status
-              : 'card-right-unselect-' + item.status
-          ">
-          <div class="rightrow">{{ item.windSpeed.toFixed(2) }} m/s</div>
-          <div class="rightrow">{{ item.power.toFixed(2) }} kw</div>
-          <div class="rightrow">{{ item.rollSpeed.toFixed(2) }} rpm</div>
-        </div>
-      </div>
-    </div>
-    <div class="bottom"></div>
-  </div>
-  <!-- <WindturbineDetailPages v-model="dialogVisible" :windturbine="currentWindturbine"></WindturbineDetailPages> -->
-</template>
-
-<script>
-  // import WindturbineDetailPages from "../WindturbineDetailPages.vue";
-  export default {
-    name: "ControlMatrixCard",
-    props: {
-      // dateClick,
-      title: String,
-      type: Number,
-      datas: Object,
-      flag: {
-        type: Boolean,
-        default: false,
-      }
-    },
-    data() {
-      return {
-        values: [],
-        dialogVisible: false,
-        currentWindturbine: {},
-        cacheFlag: false,
-      };
-    },
-    components: {
-      // WindturbineDetailPages,
-    },
-    methods: {
-      
-      // 点击卡片事件
-      onSelectHandler(item) {
-        item.active = !item.active;
-      },
-      sendMsg: function (itm) {
-        if (this.flag) {
-          this.$emit("showWindows", itm);
-        } else {
-          this.dialogVisible = true;
-          this.currentWindturbine = itm;
-        }
-      },
-      filter(value, windturbineId) {
-        let array = [];
-        let flag = false;
-        for (let i = 0; i < value.length; i++) {
-          if (value[i].windturbineId == windturbineId) {
-            flag = true;
-            array.push(flag); // 风机是否已经存在
-            array.push(i); // 风机在values数组的位置
-            array.push(value[i].active); // 当前风机是否被选中
-            break;
-          }
-        }
-        return array;
-      },
-      addCard(val) {
-        let active = false;
-        let array = this.filter(this.values, val.windturbineId);
-        if (!array[0]) {
-          // 维护
-          val.active = active;
-          if (val.modelId.indexOf("105") >= 0) {
-            val.rollSpeed *= 9.55;
-          }
-          this.values.push(val);
-        } else {
-          val.active = array[2];
-          this.values.splice(array[1], 1, val);
-        }
-      },
-      /* 获取选中的项目 */
-      getSelectedItems() {
-        let ls = new Array();
-        this.values.forEach((item) => {
-          if (item.active) {
-            ls.push(item);
-          }
-        });
-        return ls;
-      },
-      /* 将选中的项目填充到数组中 */
-      outputSelectedItems(ls) {
-        this.values.forEach((item) => {
-          if (item.active && !this.isHas(item, ls)) {
-            ls.push(item);
-          }
-        });
-      },
-
-      /* 清除选中的项目 */
-      clearSelected() {
-        this.values.forEach((item) => (item.active = false));
-      },
-
-      isHas(item, ls) {
-        for (let id in ls) {
-          if (ls[id].windturbineId == item.windturbineId) {
-            return true;
-          }
-        }
-        return false;
-      },
-
-      clear(vs) {
-        let ll = new Array();
-        this.values.forEach((item) => {
-          let it = vs[item.windturbineId];
-          if (typeof it === "undefined") {
-            ll.push(item);
-          }
-        });
-        for (let v1 in ll) {
-          let ind = this.values.indexOf(ll[v1]);
-          if (ind < 0) continue;
-          this.values.splice(ind, 1);
-        }
-      },
-      dateClick(type){
-        console.log(this.cacheDate);
-        let vs = {};
-        let address = ''
-          switch (type) {
-            case 0:
-              address = 'MG'
-              break;
-            case 1:
-              address = 'NG'
-              break;
-            case 2:
-              address = 'QG'
-              break;
-            case 3:
-              address = 'SG'
-              break;
-            case 4:
-              address = 'XG'
-              break;
-          }
-          let arr = Object.keys(this.cacheDate).sort()
-          for (let id of arr) {
-            let val = this.cacheDate[id];
-            if (val.windturbineId.substring(0, 2) === address) {
-                this.addCard(val);
-                vs[val.windturbineId] = 0;
-              }
-          }
-          this.clear(vs);
-      },
-    },
-    watch: {
-      "$store.getters.windturbinelist": {
-        deep: true,
-        handler: function (json) {
-          let vs = {};
-          let address = ''
-          switch (this.type) {
-            case 0:
-              address = 'MG'
-              break;
-            case 1:
-              address = 'NG'
-              break;
-            case 2:
-              address = 'QG'
-              break;
-            case 3:
-              address = 'SG'
-              break;
-            case 4:
-              address = 'XG'
-              break;
-          }
-          if (this.flag && !this.cacheFlag){
-            this.cacheDate = json
-            this.cacheFlag = true
-          }
-          let arr = Object.keys(json).sort()
-          for (let id of arr) {
-            let val = json[id];
-            if (this.flag) {
-              if (val.windturbineId.substring(0, 2) === address) {
-                this.addCard(val);
-                vs[val.windturbineId] = 0;
-              }
-            } else {
-              if (val.status == this.type) {
-                this.addCard(val);
-                vs[val.windturbineId] = 0;
-              }
-              if (this.type < 0 && val.lockValue) {
-                this.addCard(val);
-                vs[val.windturbineId] = 0;
-              }
-            }
-          }
-          // console.log(this.values);
-          this.clear(vs);
-        },
-      },
-    },
-  };
-</script>
-
-<style scoped>
-  .rightrow {
-    margin-right: 3px;
-  }
-
-  .content {
-    display: flex;
-    flex-direction: row;
-    flex-wrap: wrap;
-  }
-
-  .bottom {
-    background-color: #292929;
-    width: 100%;
-    height: 2px;
-    margin-top: 5px;
-  }
-
-  .main {
-    margin: 0 5px 15px 5px;
-  }
-
-  /*  最外层卡片 */
-  .card {
-    width: 112px;
-    height: 49px;
-    font-size: 12px;
-    margin-left: 3px;
-    margin-top: 4px;
-    display: flex;
-    flex-direction: row;
-    cursor: pointer;
-    /* border: 2px solid rgb(75, 85, 174); */
-  }
-
-  /*  卡片左边部分 */
-  .card-left {
-    width: 25px;
-    margin: 3px;
-    font-size: 14px;
-    display: flex;
-    flex-direction: column;
-    justify-content: space-around;
-    align-items: center;
-    /* background-color: rgb(75, 85, 174); */
-  }
-
-  /* 卡片右边部分 */
-  .card-right {
-    display: flex;
-    flex: 1;
-    flex-direction: column;
-    justify-content: space-around;
-    align-items: flex-end;
-    padding-right: 3px;
-    /* border-left: 2px dashed rgb(75, 85, 174); */
-  }
-
-  /* ***********颜色************ */
-  /* *********************** */
-  /*  最外层卡片选中和未选中 */
-  .card-select-0 {
-    border: 2px solid rgb(255, 255, 255, 0.5);
-  }
-
-  .card-unselect-0 {
-    border: 2px solid rgb(255, 255, 255);
-  }
-
-  /*  左边卡片选中和未选中 */
-  .card-left-select-0 {
-    background-color: rgb(255, 255, 255, 0.5);
-    color: rgb(0, 0, 0, 0.5);
-  }
-
-  .card-left-unselect-0 {
-    background-color: rgb(255, 255, 255, .5);
-    color: rgb(0, 0, 0);
-  }
-
-  /*  右边卡片选中和未选中 */
-  .card-right-select-0 {
-    border-left: 2px dashed rgb(255, 255, 255, 0.5);
-  }
-
-  .card-right-unselect-0 {
-    border-left: 2px dashed rgb(255, 255, 255, .5);
-    background-color: rgb(255, 255, 255, .15);
-  }
-
-  /* ***********颜色************ */
-  /* *********************** */
-  /*  最外层卡片选中和未选中 */
-  .card-select-1 {
-    border: 2px solid rgb(197, 48, 200, 0.5);
-  }
-
-  .card-unselect-1 {
-    border: 2px solid rgb(197, 48, 200);
-  }
-
-  .card-select-1 {
-    border: 2px solid rgb(197, 48, 200, 0.5);
-  }
-
-  /*  左边卡片选中和未选中 */
-  .card-left-select-1 {
-    background-color: rgb(197, 48, 200, 0.5);
-  }
-
-  .card-left-unselect-1 {
-    background-color: rgb(197, 48, 200, .5);
-  }
-
-  /*  右边卡片选中和未选中 */
-  .card-right-select-1 {
-    border-left: 2px dashed rgb(197, 48, 200, 0.5);
-  }
-
-  .card-right-unselect-1 {
-    border-left: 2px dashed rgb(197, 48, 200, .5);
-    background-color: rgb(197, 48, 200, .15);
-  }
-
-  /* ***********颜色************ */
-  /* *********************** */
-  /*  最外层卡片选中和未选中 */
-  .card-select-2 {
-    border: 2px solid rgb(05, 187, 76, 0.5);
-  }
-
-  .card-unselect-2 {
-    border: 2px solid rgb(05, 187, 76);
-  }
-
-  .card-select-2 {
-    border: 2px solid rgb(05, 187, 76, 0.5);
-  }
-
-  /*  左边卡片选中和未选中 */
-  .card-left-select-2 {
-    background-color: rgb(05, 187, 76, 0.5);
-  }
-
-  .card-left-unselect-2 {
-    background-color: rgb(05, 187, 76, .5);
-  }
-
-  /*  右边卡片选中和未选中 */
-  .card-right-select-2 {
-    border-left: 2px dashed rgb(05, 187, 76, 0.5);
-  }
-
-  .card-right-unselect-2 {
-    border-left: 2px dashed rgb(05, 187, 76, .5);
-    background-color: rgb(05, 187, 76, .15);
-  }
-
-  /* ***********颜色************ */
-  /* *********************** */
-  /*  最外层卡片选中和未选中 */
-  .card-select-3 {
-    border: 2px solid rgb(05, 187, 76, 0.5);
-  }
-
-  .card-unselect-3 {
-    border: 2px solid rgb(05, 187, 76);
-  }
-
-  .card-select-3 {
-    border: 2px solid rgb(05, 187, 76, 0.5);
-  }
-
-  /*  左边卡片选中和未选中 */
-  .card-left-select-3 {
-    background-color: rgb(05, 187, 76, 0.5);
-  }
-
-  .card-left-unselect-3 {
-    background-color: rgb(05, 187, 76, .5);
-  }
-
-  /*  右边卡片选中和未选中 */
-  .card-right-select-3 {
-    border-left: 2px dashed rgb(05, 187, 76, 0.5);
-  }
-
-  .card-right-unselect-3 {
-    border-left: 2px dashed rgb(05, 187, 76, .5);
-    background-color: rgb(05, 187, 76, .15);
-  }
-
-  /* ***********颜色************ */
-  /* *********************** */
-  /*  最外层卡片选中和未选中 */
-  .card-select-4 {
-    border: 2px solid rgb(75, 85, 174, 0.5);
-  }
-
-  .card-unselect-4 {
-    border: 2px solid rgb(75, 85, 174);
-  }
-
-  .card-select-4 {
-    border: 2px solid rgb(75, 85, 174, 0.5);
-  }
-
-  /*  左边卡片选中和未选中 */
-  .card-left-select-4 {
-    background-color: rgb(75, 85, 174, 0.5);
-  }
-
-  .card-left-unselect-4 {
-    background-color: rgb(75, 85, 174, .5);
-  }
-
-  /*  右边卡片选中和未选中 */
-  .card-right-select-4 {
-    border-left: 2px dashed rgb(75, 85, 174, 0.5);
-  }
-
-  .card-right-unselect-4 {
-    border-left: 2px dashed rgb(75, 85, 174, .5);
-    background-color: rgb(75, 85, 174, .15);
-  }
-
-  /* ***********颜色************ */
-  /* *********************** *
-/*  最外层卡片选中和未选中 */
-  .card-select-5 {
-    border: 2px solid rgb(186, 50, 55, 0.5);
-  }
-
-  .card-unselect-5 {
-    border: 2px solid rgb(186, 50, 55);
-  }
-
-  .card-select-5 {
-    border: 2px solid rgb(186, 50, 55, 0.5);
-  }
-
-  /*  左边卡片选中和未选中 */
-  .card-left-select-5 {
-    background-color: rgb(186, 50, 55, 0.5);
-  }
-
-  .card-left-unselect-5 {
-    background-color: rgb(186, 50, 55, .5);
-  }
-
-  /*  右边卡片选中和未选中 */
-  .card-right-select-5 {
-    border-left: 2px dashed rgb(186, 50, 55, 0.5);
-  }
-
-  .card-right-unselect-5 {
-    border-left: 2px dashed rgb(186, 50, 55, .5);
-    background-color: rgb(186, 50, 55, .15);
-  }
-
-  /* ***********颜色************ */
-  /* *********************** *
-/*  最外层卡片选中和未选中 */
-  .card-select-6 {
-    border: 2px solid rgb(225, 125, 36, 0.5);
-  }
-
-  .card-unselect-6 {
-    border: 2px solid rgb(225, 125, 36);
-  }
-
-  .card-select-6 {
-    border: 2px solid rgb(225, 125, 36, 0.5);
-  }
-
-  /*  左边卡片选中和未选中 */
-  .card-left-select-6 {
-    background-color: rgb(225, 125, 36, 0.5);
-  }
-
-  .card-left-unselect-6 {
-    background-color: rgb(225, 125, 36, .5);
-  }
-
-  /*  右边卡片选中和未选中 */
-  .card-right-select-6 {
-    border-left: 2px dashed rgb(225, 125, 36, 0.5);
-  }
-
-  .card-right-unselect-6 {
-    border-left: 2px dashed rgb(225, 125, 36, .5);
-    background-color: rgb(225, 125, 36, .15);
-  }
-
-  /* ***********颜色************ */
-  /* *********************** *
-/*  最外层卡片选中和未选中 */
-  .card-select-7 {
-    border: 2px solid rgb(96, 103, 105, 0.5);
-  }
-
-  .card-unselect-7 {
-    border: 2px solid rgb(96, 103, 105);
-  }
-
-  .card-select-7 {
-    border: 2px solid rgb(96, 103, 105, 0.5);
-  }
-
-  /*  左边卡片选中和未选中 */
-  .card-left-select-7 {
-    background-color: rgb(96, 103, 105, 0.5);
-  }
-
-  .card-left-unselect-7 {
-    background-color: rgb(96, 103, 105, .5);
-  }
-
-  /*  右边卡片选中和未选中 */
-  .card-right-select-7 {
-    border-left: 2px dashed rgb(96, 103, 105, 0.5);
-  }
-
-  .card-right-unselect-7 {
-    border-left: 2px dashed rgb(96, 103, 105, .5);
-    background-color: rgb(96, 103, 105, .15);
-  }
-</style>

+ 173 - 104
src/components/problem/areaCard.vue

@@ -2,48 +2,89 @@
 <template>
   <div class="body" :style="style">
     <img class="logo" src="../../assets/img/logo.png" alt="" />
-    <div class="title">{{ title }}</div>
-    <div style="margin-top: 50px; height: 94%" @contextmenu="contextmenu">
-      <el-scrollbar>
-        <div class="scoll">
-          <div class="matrix" v-if="faultList.length > 0">
-            <div class="problemTitle">故障</div>
-            <MatrixBlock
-              area="problem"
-              @problem-click="handleClick"
-              @on-click="handleDetails"
-              :dataList="faultList"
-            ></MatrixBlock>
-          </div>
-          <div class="matrix" v-if="maintainList.length > 0">
-            <div class="problemTitle">维护</div>
-            <MatrixBlock
-              area="problem"
-              @problem-click="handleClick"
-              @on-click="handleDetails"
-              :dataList="maintainList"
-            ></MatrixBlock>
-          </div>
-          <div class="matrix" v-if="offlineList.length > 0">
-            <div class="problemTitle">离线</div>
-            <MatrixBlock
-              area="problem"
-              @problem-click="handleClick"
-              @on-click="handleDetails"
-              :dataList="offlineList"
-            ></MatrixBlock>
-          </div>
-          <div class="matrix" v-if="listedList.length > 0">
-            <div class="problemTitle">挂牌</div>
-            <MatrixBlock
-              area="problem"
-              @problem-click="handleClick"
-              @on-click="handleDetails"
-              :dataList="listedList"
-            ></MatrixBlock>
-          </div>
-        </div>
-      </el-scrollbar>
+    <div class="Title">{{ title }}</div>
+    <div class="content" @contextmenu="contextmenu">
+      <!-- <el-scrollbar>
+        <div class="scoll"> -->
+      <el-collapse v-model="activeNames">
+        <el-collapse-item name="1">
+          <template v-slot:title>
+            <div class="tit1">
+              <div class="title">故障</div>
+              <span class="num">{{ faultList.length }}</span>
+            </div>
+          </template>
+          <MatrixBlock
+            area="problem"
+            @problem-click="handleClick"
+            @on-click="handleDetails"
+            :dataList="faultList"
+          ></MatrixBlock>
+        </el-collapse-item>
+
+        <el-collapse-item name="2">
+          <template v-slot:title>
+            <div class="tit1">
+            <div class="title">维护</div>
+            <span class="num">{{ maintainList.length }}</span>
+            </div>
+          </template>
+          <MatrixBlock
+            area="problem"
+            @problem-click="handleClick"
+            @on-click="handleDetails"
+            :dataList="maintainList"
+          ></MatrixBlock>
+        </el-collapse-item>
+
+        <el-collapse-item name="3">
+          <template v-slot:title>
+              <div class="tit1">
+            <div class="title">离线</div>
+            <span class="num">{{ offlineList.length }}</span>
+             </div>
+          </template>
+          <MatrixBlock
+            area="problem"
+            @problem-click="handleClick"
+            @on-click="handleDetails"
+            :dataList="offlineList"
+          ></MatrixBlock>
+        </el-collapse-item>
+
+        <el-collapse-item name="4">
+          <template v-slot:title>
+             <div class="tit1">
+            <div class="title">挂牌</div>
+            <span class="num">{{ listedList.length }}</span>
+              </div>
+          </template>
+          <MatrixBlock
+            area="problem"
+            @problem-click="handleClick"
+            @on-click="handleDetails"
+            :dataList="listedList"
+          ></MatrixBlock>
+        </el-collapse-item>
+
+        <el-collapse-item name="5">
+          <template v-slot:title>
+               <div class="tit1">
+            <div class="title">风速功率不匹配</div>
+            <span class="num1">{{ unpaidList.length }}</span>
+               </div>
+          </template>
+          <MatrixBlock
+            area="problem"
+            @problem-click="handleClick"
+            @on-click="handleDetails"
+            :dataList="unpaidList"
+          ></MatrixBlock>
+        </el-collapse-item>
+      </el-collapse>
+
+      <!-- </div>
+      </el-scrollbar> -->
     </div>
   </div>
   <WindturbineDetailPages
@@ -79,6 +120,7 @@ export default {
   },
   data() {
     return {
+      activeNames: ["1", "2", "3", "4", "5"],
       dialogVisible: false,
       currentWindturbine: {},
       values: [],
@@ -87,32 +129,11 @@ export default {
       big: false,
       current: 0,
       faultList: [],
+      unpaidList: [],
       maintainList: [],
       offlineList: [],
       listedList: [],
       chooseList: [],
-      titleList: [
-        {
-          id: 0,
-          title: "麻黄山",
-        },
-        {
-          id: 1,
-          title: "牛首山",
-        },
-        {
-          id: 2,
-          title: "青山",
-        },
-        {
-          id: 3,
-          title: "石板泉",
-        },
-        {
-          id: 4,
-          title: "香山",
-        },
-      ],
       currentWindturbine: {},
       showSvg: false,
       controlErorCodes: [
@@ -147,11 +168,16 @@ export default {
   methods: {
     deal() {
       let json = this.$store.state.windturbinelist;
+      console.log(json);
+
+      this.unpaidList = [];
       this.faultList = [];
       this.maintainList = [];
       this.offlineList = [];
       this.listedList = [];
+
       let arr = Object.keys(json).sort();
+
       for (let id of arr) {
         let val = json[id];
         this.chooseList.forEach((item) => {
@@ -160,6 +186,11 @@ export default {
           }
         });
         switch (val.status) {
+          case 4:
+            if (val.undeliveredStatus >= 3) {
+              this.unpaidList.push(val);
+            }
+            break;
           case 5:
             this.faultList.push(val);
             break;
@@ -183,6 +214,12 @@ export default {
       });
     },
     handleClick(values) {
+      let flashingList = this.$store.state.faultList;
+      if (values.flashing) {
+        flashingList.filter(
+          (item) => values.windturbineId === item.windturbineId
+        )[0].flashing = false;
+      }
       if (values.active) {
         let showIndex = null;
         this.chooseList.forEach((item, index) => {
@@ -221,6 +258,13 @@ export default {
               item.active = !item.active;
             }
           });
+      flag
+        ? ""
+        : this.unpaidList.forEach((item) => {
+            if (item.windturbineId === values.windturbineId) {
+              item.active = !item.active;
+            }
+          });
     },
     /* 右键菜单 */
     contextmenu() {
@@ -329,7 +373,6 @@ export default {
           bd.removeCheckouts(val);
         }
       }
-      console.log(msg);
       let mss = ""; // 信息
       let iserror = false; // 是否有控制错误的风机
       for (let v in msg.data) {
@@ -368,40 +411,10 @@ export default {
         duration: 3000,
       });
     },
-    filter(value, windturbineId) {
-      let array = [];
-      let flag = false;
-      for (let i = 0; i < value.length; i++) {
-        if (value[i].windturbineId == windturbineId) {
-          flag = true;
-          array.push(flag); // 风机是否已经存在
-          array.push(i); // 风机在values数组的位置
-          array.push(value[i].active); // 当前风机是否被选中
-          break;
-        }
-      }
-      return array;
-    },
     changeTitle(id) {
       this.current = id;
       this.$refs.malfunction.dateClick(id);
     },
-    addCard(val) {
-      let active = false;
-      let array = this.filter(this.values, val.windturbineId);
-      if (!array[0]) {
-        // 维护
-        val.active = active;
-        if (val.modelId.indexOf("105") >= 0) {
-          val.rollSpeed *= 9.55;
-        }
-        this.values.push(val);
-      } else {
-        val.active = array[2];
-        this.values.splice(array[1], 1, val);
-      }
-      console.log(this.values);
-    },
     handleDetails(itm) {
       this.dialogVisible = true;
       this.currentWindturbine = itm;
@@ -416,10 +429,13 @@ export default {
     "$store.getters.windturbinelist": {
       deep: true,
       handler: function (json) {
-        this.faultList = [];
         this.maintainList = [];
         this.offlineList = [];
         this.listedList = [];
+        this.faultList = [];
+        this.unpaidList = [];
+        let faultRecord = [];
+        let flashingList = this.$store.state.faultList || [];
         let arr = Object.keys(json).sort();
         for (let id of arr) {
           let val = json[id];
@@ -428,13 +444,30 @@ export default {
               val.active = true;
             }
           });
+          if (val.status === 5) {
+            let obj = flashingList.find(
+              (fs) => fs.windturbineId === val.windturbineId
+            );
+            if (obj) {
+              val.flashing = obj.flashing ? true : obj.flashing;
+            } else {
+              val.flashing = true;
+            }
+          }
+
           if (val.lockValue === 9) {
             val.lockValues = this.lockValues.filter(
               (item) => val.windturbineId === item.windturbineID
             )[0]?.value;
           }
           switch (val.status) {
+            case 4:
+              if (val.undeliveredStatus >= 3) {
+                this.unpaidList.push(val);
+              }
+              break;
             case 5:
+              faultRecord.push(val);
               this.faultList.push(val);
               break;
             case 6:
@@ -448,7 +481,7 @@ export default {
             this.listedList.push(val);
           }
         }
-        console.log(this.faultList);
+        this.$store.commit("faultList", faultRecord);
       },
     },
   },
@@ -456,6 +489,36 @@ export default {
 </script>
 
 <style scoped="scoped">
+.title{
+  flex-grow: 1;
+}
+.tit1{
+  width: 92%;
+  display: flex;
+  align-items: center;
+}
+.num {
+  color: #fff;
+  display: inline-block;
+  width: 30px;
+  height: 30px;
+  background-color: rgba(75, 85, 174, 1);
+  border-radius: 50%;
+  line-height: 30px;
+  text-align: center;
+  box-sizing: border-box;
+}
+.num1 {
+  margin-left: 439px;
+  color: #fff;
+  display: inline-block;
+  width: 30px;
+  height: 30px;
+  background-color: rgba(75, 85, 174, 1);
+  border-radius: 50%;
+  line-height: 30px;
+  text-align: center;
+}
 .body {
   border: 1px solid #373737;
   width: 100%;
@@ -467,7 +530,7 @@ export default {
   height: 91%;
 }
 
-.title {
+.Title {
   color: #ffffff;
   font-size: 14px;
   margin-left: 32px;
@@ -482,7 +545,7 @@ export default {
   background-color: #000000;
 }
 
-.title::before {
+.Title::before {
   z-index: 1;
   content: "";
   position: absolute;
@@ -493,6 +556,15 @@ export default {
   background-color: #54b75a;
   border-radius: 50%;
 }
+.content {
+  overflow-y: auto;
+  margin-top: 50px;
+  height: 94%;
+}
+.content::-webkit-scrollbar {
+  /*隐藏滚轮*/
+  display: none;
+}
 
 .logo {
   position: absolute;
@@ -508,10 +580,7 @@ export default {
 }
 
 .problemTitle {
-  font-size: 12px;
-  color: #bfbfbf;
-  margin-top: 20px;
-  margin-bottom: 20px;
-  margin-left: 12px;
+  /* box-sizing: border-box; */
+  /* padding-left: 20px; */
 }
 </style>

+ 210 - 129
src/components/stationSvgDetailPages.vue

@@ -1,144 +1,225 @@
 <template>
-	<el-dialog width="75%" @closed="closed()" :show-close="false" class="my-info-dialog">
-		<template #title>
-			<div style="margin-top:-10px;color: #FFFFFF;">{{stationName}}</div>
-		</template>
-		<div>
-			<nss ref="svgRef" v-if="svgWeb=='NSS_FDC'||svgWeb=='NSS_SYZ'" />
-			<mhs ref="svgRef" v-if="svgWeb=='MHS_FDC'||svgWeb=='MHS_SYZ'" />
-			<qs ref="svgRef" v-if="svgWeb=='QS_FDC'||svgWeb=='QS_SYZ'" />
-			<sbq ref="svgRef" v-if="svgWeb=='SBQ_FDC'||svgWeb=='SBQ_SYZ'" />
-			<xs ref="svgRef" v-if="svgWeb=='XS_FDC'||svgWeb=='XS_SYZ'" />
-			<pl1 ref="svgRef" v-if="svgWeb=='PL1_GDC'||svgWeb=='PL_SYZ'" />
-			<pl2 ref="svgRef" v-if="svgWeb=='PL2_GDC'||svgWeb=='PL2_SYZ'" />
-			<dwk ref="svgRef" v-if="svgWeb=='DWK_GDC'||svgWeb=='DWK_SYZ'" />
-			<mch ref="svgRef" v-if="svgWeb=='MCH_GDC'||svgWeb=='MCH_SYZ'" />
-			<xh ref="svgRef" v-if="svgWeb=='XH_GDC'||svgWeb=='XH_SYZ'" />
-			<sbdl ref="svgRef" v-if="svgWeb=='QS3_FDC'||svgWeb=='QS3_SYZ'" />
-		</div>
-	</el-dialog>
+  <el-dialog
+    width="85%"
+    @opened="opened()"
+    @closed="closed()"
+    :show-close="false"
+    class="my-info-dialog"
+  >
+    <template #title>
+      <!-- <div style="margin-top:-10px;color: #FFFFFF;">{{stationName}}</div> -->
+      <div class="titleList">
+        <div v-for="(item, index) in stationList" :key="index">
+          <div
+            v-if="item?.id !== currentStation"
+            :class="
+              index === 0
+                ? 'controlTypesLeft'
+                : index === stationList.length - 1
+                ? 'controlTypesRight'
+                : 'controlTypes'
+            "
+            @click="handleTypeChange(item)"
+          >
+            {{ item.stationName }}
+          </div>
+          <div
+            v-else
+            :class="
+              index === 0
+                ? 'onControlTypesLeft'
+                : index === stationList.length - 1
+                ? 'onControlTypesRight'
+                : 'onControlTypes'
+            "
+            @click="handleTypeChange(item)"
+          >
+            {{ item.stationName }}
+          </div>
+        </div>
+      </div>
+    </template>
+    <div>
+      <Cl ref="svgRef" v-if="currentStation == 'CL_FDC' || currentStation == 'CL_SYZ'" />
+      <KB ref="svgRef" v-if="currentStation == 'KB_FDC' || currentStation == 'KB_SYZ'" />
+      <DX ref="svgRef" v-if="currentStation == 'DX_FDC' || currentStation == 'DX_SYZ'" />
+    </div>
+  </el-dialog>
 </template>
 
 <script>
-	// import YawDetail from "./YawDetail.vue";
-	import api from "api/index";
-	import UniformCodes from "utils/UniformCodes";
-	import Dwk from "./BoosterStation/dwk.vue";
-	import Sbdl from "./BoosterStation/sbdl.vue";
-	import Nss from "./BoosterStation/nss.vue";
-	import Mhs from "./BoosterStation/mhs.vue";
-	import Qs from "./BoosterStation/qs.vue";
-	import Pl1 from "./BoosterStation/pl1.vue";
-	import Pl2 from "./BoosterStation/pl2.vue";
-	import Mch from "./BoosterStation/mch.vue";
-	import Xs from "./BoosterStation/xs.vue";
-	import Xh from "./BoosterStation/xh.vue";
-	import Sbq from "./BoosterStation/sbq.vue";
-	import BackgroundData from 'utils/BackgroundData'
-	// import Worning from "./warning.vue"
-	export default {
-		components: {
-			Dwk,
-			Sbdl,
-			Nss,
-			Mhs,
-			Qs,
-			Pl1,
-			Pl2,
-			Mch,
-			Xs,
-			Xh,
-			Sbq
-		},
-		props: {
-			svgWeb: {
-				type: String,
-				default: '',
-			},
-			stationName: {
-				type: String,
-				default: '',
-			},
-		},
-		data() {
-			return {
-				BasicInfo: {},
-				line: "",
-				alarmTime: "",
-				alarmContent: "",
-				alarms: [],
-				count: false,
-				
-				
-				types: null,
-			};
-		},
-		created() {
-			this.UniformCodes = new UniformCodes();
-		},
+import Cl from "./BoosterStation/cl.vue";
+import KB from "./BoosterStation/kb.vue";
+import DX from "./BoosterStation/dx.vue";
+export default {
+  components: {
+    Cl,
+    KB,
+    DX,
+  },
+  props: {
+    svgWeb: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {
+      BasicInfo: {},
+      line: "",
+      currentStation: "",
+      alarmTime: "",
+      alarmContent: "",
+      alarms: [],
+      count: false,
+      stationList: [],
+      types: null,
+    };
+  },
+  created() {},
 
-		methods: {
-			closed() {
-				// todo 切换页面的时候应该让上一个页面停止刷新数据(调用end方法)
-				// this.$refs.svgRef.closed();
-				// this.$refs.BasicInfo.end();
-				// this.$refs.BasicInfo.labelChange();
-				this.$emit('close');
-				//clearInterval(this.refreshTimer);
-			},
-			
-			dbClicks(value) {
-				this.$refs.BasicInfo.dbClicks(value, this.windturbine.windturbineId)
-			},
-		},
-	};
+  methods: {
+    closed() {
+      // todo 切换页面的时候应该让上一个页面停止刷新数据(调用end方法)
+      this.$refs.svgRef.closed();
+      // this.$refs.BasicInfo.end();
+      // this.$refs.BasicInfo.labelChange();
+      this.$emit("close");
+      //clearInterval(this.refreshTimer);
+    },
+    opened() {
+      this.currentStation = this.svgWeb?this.svgWeb:this.$store.state.stationList[0].id;
+      this.stationList = this.$store.state.stationList;
+	  this.$nextTick(() => {
+           this.$refs.svgRef.opened();
+        });
+    },
+    dbClicks(value) {
+      this.$refs.BasicInfo.dbClicks(value, this.windturbine.windturbineId);
+    },
+    handleTypeChange(val) {
+      this.currentStation = val.id;
+	  this.$nextTick(() => {
+           this.$refs.svgRef.opened();
+        });
+    },
+  },
+};
 </script>
 <style scoped>
-	.my-info-dialog {
-		box-shadow: 0px 0px 10px #05bb4c;
-	}
+.my-info-dialog {
+  box-shadow: 0px 0px 10px #05bb4c;
+}
 
-	.body {
-		background-color: black;
-		margin-top: -30px;
-		margin-left: -10px;
-		margin-right: -10px;
-		margin-bottom: -30px;
-		border-bottom: 20px solid rgb(36, 36, 36);
-	}
+.body {
+  background-color: black;
+  margin-top: -30px;
+  margin-left: -10px;
+  margin-right: -10px;
+  margin-bottom: -30px;
+  border-bottom: 20px solid rgb(36, 36, 36);
+}
 
-	.chunkdiv {
-		display: flex;
-		/* justify-content: center; */
-		background-color: #363636;
-		margin: 1px;
-		padding: 4px 2px;
-		font-size: 12px;
-		color: #FFFFFF;
-		overflow: hidden;
-		white-space: nowrap;
-		padding-left: 32px;
-	}
+.chunkdiv {
+  display: flex;
+  /* justify-content: center; */
+  background-color: #363636;
+  margin: 1px;
+  padding: 4px 2px;
+  font-size: 12px;
+  color: #ffffff;
+  overflow: hidden;
+  white-space: nowrap;
+  padding-left: 32px;
+}
 
-	.title {
-		font-size: 12px;
-		color: #B3B3B3;
-	}
+.title {
+  font-size: 12px;
+  color: #b3b3b3;
+}
 
-	table {
-		margin-left: 2px;
-		margin-right: 2px;
-	}
+.titleList {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-top: -10px;
+  color: #ffffff;
+}
 
-	td {
-		width: 20%;
-	}
+table {
+  margin-left: 2px;
+  margin-right: 2px;
+}
 
-	el-tabs {
-		background-color: black;
-	}
+td {
+  width: 20%;
+}
 
-	.svg {
-		height: 67vh;
-	}
+el-tabs {
+  background-color: black;
+}
+
+.svg {
+  height: 67vh;
+}
+
+.controlTypes {
+  width: 110px;
+  height: 30px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  border: 1px solid rgba(51, 51, 51, 1);
+}
+.controlTypesLeft {
+  width: 110px;
+  height: 30px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  border: 1px solid rgba(51, 51, 51, 1);
+  border-top-left-radius: 15px;
+  border-bottom-left-radius: 15px;
+}
+.controlTypesRight {
+  width: 110px;
+  height: 30px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  border: 1px solid rgba(51, 51, 51, 1);
+  border-top-right-radius: 15px;
+  border-bottom-right-radius: 15px;
+}
+.onControlTypes {
+  width: 110px;
+  height: 30px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  border: 1px solid rgba(51, 51, 51, 1);
+  background-color: rgba(37, 116, 219, 1);
+}
+.onControlTypesLeft {
+  width: 110px;
+  height: 30px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  /* border: 1px solid rgba(37, 116, 219, 1); */
+  border-top-left-radius: 15px;
+  border-bottom-left-radius: 15px;
+  background-color: rgba(37, 116, 219, 1);
+}
+.onControlTypesRight {
+  width: 110px;
+  height: 30px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  /* border: 1px solid rgba(37, 116, 219, 1); */
+  border-top-right-radius: 15px;
+  border-bottom-right-radius: 15px;
+  background-color: rgba(37, 116, 219, 1);
+}
 </style>

+ 34 - 6
src/components/warning/warningArea.vue

@@ -2,6 +2,7 @@
     <div class="body">
         <img class="logo" src="../../assets/img/logo.png" alt="">
         <div class="title">告警区</div>
+        <div class="record" @click="showRecord">告警记录</div>
         <div style="margin-top: 50px; margin-left: 10px; height: 19vh;">
             <!-- <el-scrollbar>
                 <div class="scoll" style="margin-left: 5px;">
@@ -11,14 +12,27 @@
             <WarningCard></WarningCard>
         </div>
     </div>
+    <WarningRecords v-model="display"></WarningRecords>
 </template>
 <script>
-    import WarningCard from "./warningCard.vue";
-    export default {
-        components: {
-            WarningCard,
-        },
-    }
+import WarningCard from "./warningCard.vue";
+import WarningRecords from "./warningRecords.vue";
+export default {
+    components: {
+        WarningCard,
+        WarningRecords,
+    },
+    data() {
+        return {
+            display: false,
+        }
+    },
+    methods: {
+        showRecord(){
+            this.display = true
+        }
+    },
+}
 </script>
 <style scoped>
     .body {
@@ -60,6 +74,20 @@
         border-radius: 50%;
     }
 
+    .record {
+        position: absolute;
+        color: #ffffff;
+        font-size: 14px;
+        right: 0;
+        top: 23px;
+        width: 80px;
+        height: 30px;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        background-color: rgba(37, 116, 219, 1);
+    }
+
     .logo {
         position: absolute;
         top: 2px;

+ 243 - 184
src/components/warning/warningCard.vue

@@ -1,191 +1,250 @@
 /* 告警区 */
 <template>
-	<div style="padding-left: 5px; padding-right: 5px">
-		<el-table :data="values" class="table" height="20vh" :header-cell-style="{
-          background: '#000000',
-          color: 'rgb(220,220,220)',
-          padding: '4px',
-          fontSize: '14px',
-          'border-bottom': 'solid 1px black',
-        }" :cell-style="{
-          background: 'rgb(30,30,30)',
-          color: 'rgb(220,220,220)',
-          padding: '3px',
-          fontSize: '12px',
-        }" @row-dblclick="itemDblclick">
-			<el-table-column prop="lastUpdateTime" align="center" label="时间" width="150">
-			</el-table-column>
-			<el-table-column prop="alertText" align="center" label="描述" width="280">
-			</el-table-column>
-			<el-table-column prop="isSelected" align="center" label="确认">
-				<template v-slot="scope">
-					<input type="checkbox" v-model="scope.row.isSelected" @click="itemChecked(scope.row)" />
-				</template>
-			</el-table-column>
-		</el-table>
-	</div>
-	<WindturbineDetailPages v-model="dialogVisible" :windturbine="currentWindturbine" @close="close"></WindturbineDetailPages>
-		<StationSvgDetailPages v-model="svgVisible"
-		:stationName="stationName" :svgWeb="svgWeb" @close="close"></StationSvgDetailPages>
+  <div style="padding-left: 5px; padding-right: 5px">
+    <el-table
+      :data="values"
+      class="table"
+      height="20vh"
+      :header-cell-style="{
+        background: '#000000',
+        color: 'rgb(220,220,220)',
+        padding: '4px',
+        fontSize: '14px',
+        'border-bottom': 'solid 1px black',
+      }"
+      :cell-style="{
+        background: 'rgb(30,30,30)',
+        color: 'rgb(220,220,220)',
+        padding: '3px',
+        fontSize: '12px',
+      }"
+      @row-dblclick="itemDblclick"
+    >
+      <el-table-column
+        prop="lastUpdateTime"
+        align="center"
+        label="时间"
+        width="150"
+      >
+      </el-table-column>
+      
+      <el-table-column prop="stationName" align="center" label="场站名称" width="100">
+      </el-table-column>
+      <el-table-column width="60" align="end">
+        <template #default="scope">
+          <span>
+            <img
+              class="titleImg"
+              v-if="scope.row.category1 === 'SYZ'"
+              src="../../assets/img/controlcenter/warning.png"
+              alt=""
+            />
+          </span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="alertText" align="center" label="描述" width="200">
+      </el-table-column>
+      <el-table-column prop="isSelected" align="center" label="确认">
+        <template v-slot="scope">
+          <input
+            type="checkbox"
+            v-model="scope.row.isSelected"
+            @click="itemChecked(scope.row)"
+          />
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+  <WindturbineDetailPages
+    v-model="dialogVisible"
+    :windturbine="currentWindturbine"
+    @close="close"
+  ></WindturbineDetailPages>
+  <StationSvgDetailPages
+    v-model="svgVisible"
+    :svgWeb="svgWeb"
+    @close="close"
+  ></StationSvgDetailPages>
 </template>
 
 <script>
-	import MessageBridge from "utils/MessageBridge";
-	import WindturbineDetailPages from "../WindturbineDetailPages.vue";
-	import BackgroundData from "utils/BackgroundData";
-	import api from "api/index";
-	import StationSvgDetailPages from "../stationSvgDetailPages.vue";
+import MessageBridge from "utils/MessageBridge";
+import WindturbineDetailPages from "../WindturbineDetailPages.vue";
+import BackgroundData from "utils/BackgroundData";
+import api from "api/index";
+import StationSvgDetailPages from "../stationSvgDetailPages.vue";
 
-	export default {
-		name: "AlarmArea",
-		components: {
-			WindturbineDetailPages,
-			// Sbdl,
-			StationSvgDetailPages,
-		},
-		created: function () {
-			this.initData()
-			this.faultMessage()
-		},
-		props: {},
-		data() {
-			return {
-				values: ["-"],
-				dialogVisible: false,
-				showSvg: false,
-				svgVisible: false,
-				svgWeb: '',
-				stationName: '',
-				currentWindturbine: {},
-			};
-		},
-		methods: {
-			initData() {
-				let mb = MessageBridge.getInstance();
-				let vs = [{
-					key: "/topic/fault-popup",
-					action: this.faultMessage
-				}];
-				mb.register(vs);
-			},
-			faultMessage(json) {
-				let val = json?JSON.parse(json):this.$store.state.warning
-				if (Object.keys(val).length>0) {
-					let sleected = {};
-					this.values.forEach((it) => {
-						if (it.isSelected) {
-							sleected[it.id] = 0;
-						}
-					});
-					this.values = new Array();
-					for (let v in val) {
-						let vl = val[v];
-						if (vl.stationId != "QS_FDC" && vl.category1 == "FJ") {
-							vl.alertText = vl.windturbineName + "-" + vl.alertText;
-						}
-						if (sleected[vl.id] == 0 && BackgroundData.getInstance().LoginUser) {
-							vl.isSelected = true;
-						}
-						if(vl.category1!=="GF" && vl.objectId.indexOf("GDC") < 0){
-							this.values.push(vl);
-						}
-					}
-				}
-			},
-			/* 行双击 */
-			itemDblclick(row) {
-				if (row.category1 === "FJ") {
-					this.dialogVisible = true;
-					this.showSvg = false;
-					this.currentWindturbine = row;
-				} else if(row.category1 === "SYZ"){
-					this.svgVisible = true;
-					this.svgWeb = row.stationId;
-					this.stationName = row.stationName
-				}
-			},
-			close() {
-				this.dialogVisible = false;
-				this.svgVisible = false
-			},
-			/* 报警确认 */
-			itemChecked(row) {
-				if (row.isSelected == true) {
-					row.isSelected = false;
-					return;
-				}
-				let bd = BackgroundData.getInstance();
-				if (!bd.LoginUser) {
-					this.$notify({
-						title: "请登录",
-						message: "确认报警需要先登录!",
-						type: "warning",
-						position: "bottom-right",
-						offset: 60,
-						duration: 3000,
-					});
-					row.isSelected = false;
-					return;
-				}
-				row.isSelected = true;
-				this.confirm(row);
-			},
-			confirm(item) {
-				api.sendWarning({
-					snapID: item.snapIDString,
-					faultID: item.idString,
-					userName: BackgroundData.getInstance().LoginUser.name,
-				}).then(msg => {
-					let mms = msg.data > 0 ? "报警确认成功!" : "报警确认出现错误!";
-					let tp = msg.data > 0 ? "success" : "error";
-					msg.data === 0 ? (item.isSelected = false) : '';
-					this.$notify({
-						title: "报警",
-						message: mms,
-						type: tp,
-						position: "bottom-right",
-						offset: 60,
-						duration: 3000,
-					});
-				})
-			},
-		},
-	};
+export default {
+  name: "AlarmArea",
+  components: {
+    WindturbineDetailPages,
+    // Sbdl,
+    StationSvgDetailPages,
+  },
+  created() {
+    this.initData();
+    this.faultMessage();
+  },
+  mounted() {},
+  props: {},
+  data() {
+    return {
+      values: [],
+      dialogVisible: false,
+      showSvg: false,
+      svgVisible: false,
+      svgWeb: "",
+      currentWindturbine: {},
+    };
+  },
+  methods: {
+    compare(property) {
+      return function (a, b) {
+        var value1 = a[property];
+        var value2 = b[property];
+        if (value1 < value2) {
+          return 1;
+        } else if (value1 > value2) {
+          return -1;
+        } else {
+          return 0;
+        }
+      };
+    },
+    initData() {
+      let mb = MessageBridge.getInstance();
+      let vs = [
+        {
+          key: "/topic/fault-popup",
+          action: this.faultMessage,
+        },
+      ];
+      mb.register(vs);
+    },
+    faultMessage(json) {
+      let val = json ? JSON.parse(json) : this.$store.state.warning;
+      if (Object.keys(val).length > 0) {
+        let sleected = {};
+        this.values.forEach((it) => {
+          if (it.isSelected) {
+            sleected[it.id] = 0;
+          }
+        });
+        let values = [];
+        for (let v in val) {
+          let vl = val[v];
+          if (sleected[vl.id] == 0 && BackgroundData.getInstance().LoginUser) {
+            vl.isSelected = true;
+          }
+          if (vl.category1 !== "GF" && vl.objectId.indexOf("GDC") < 0) {
+            values.push(vl);
+          }
+        }
+        this.values = values.sort(this.compare("category1"));
+      }
+    },
+    /* 行双击 */
+    itemDblclick(row) {
+      if (row.category1 === "FJ") {
+        this.dialogVisible = true;
+        this.showSvg = false;
+        this.currentWindturbine = row;
+      } else if (row.category1 === "SYZ") {
+        this.svgVisible = true;
+        this.svgWeb = row.stationId;
+      }
+    },
+    close() {
+      this.dialogVisible = false;
+      this.svgVisible = false;
+    },
+    /* 报警确认 */
+    itemChecked(row) {
+      if (row.isSelected == true) {
+        row.isSelected = false;
+        return;
+      }
+      let bd = BackgroundData.getInstance();
+      if (!bd.LoginUser) {
+        this.$notify({
+          title: "请登录",
+          message: "确认报警需要先登录!",
+          type: "warning",
+          position: "bottom-right",
+          offset: 60,
+          duration: 3000,
+        });
+        row.isSelected = false;
+        return;
+      }
+      row.isSelected = true;
+      this.confirm(row);
+    },
+    confirm(item) {
+      api
+        .sendWarning({
+          snapID: item.snapIDString,
+          faultID: item.idString,
+          userName: BackgroundData.getInstance().LoginUser.name,
+        })
+        .then((msg) => {
+          let mms = msg.data > 0 ? "报警确认成功!" : "报警确认出现错误!";
+          let tp = msg.data > 0 ? "success" : "error";
+          msg.data === 0 ? (item.isSelected = false) : "";
+          this.$notify({
+            title: "报警",
+            message: mms,
+            type: tp,
+            position: "bottom-right",
+            offset: 60,
+            duration: 3000,
+          });
+        });
+    },
+  },
+};
 </script>
 <style scoped>
-	.el-table::before {
-		width: 0;
-	}
+.el-table::before {
+  width: 0;
+}
 
-	.table {
-		background-color: #000000;
-	}
+.table {
+  background-color: #000000;
+}
 
-	:deep(.el-table__body-wrapper::-webkit-scrollbar) {
-		width: 8px;
-		height: 0px;
-		background-color: black;
-	}
+.titleImg {
+  width: 20px;
+  height: 20px;
+  margin-left: 22px;
+  display: flex;
+}
 
-	:deep(.el-table__body-wrapper::-webkit-scrollbar-thumb) {
-		background-color: #292929;
-		border-radius: 6px;
-	}
+:deep(.el-table__body-wrapper::-webkit-scrollbar) {
+  width: 8px;
+  height: 0px;
+  background-color: black;
+}
 
-	:deep(.el-table td, .el-table th) {
-		border-bottom: 2px solid black;
-	}
-	.el-table__body-wrapper{
-		background-color: black;
-	}
-	tr {
-		line-height: 1.5;
-		background: #1e1e1e;
-		margin-bottom: 2px;
-		border-radius: 5px;
-	}
+:deep(.el-table__body-wrapper::-webkit-scrollbar-thumb) {
+  background-color: #292929;
+  border-radius: 6px;
+}
 
-	/* .ToolBar {
+:deep(.el-table td, .el-table th) {
+  border-bottom: 2px solid black;
+}
+.el-table__body-wrapper {
+  background-color: black;
+}
+tr {
+  line-height: 1.5;
+  background: #1e1e1e;
+  margin-bottom: 2px;
+  border-radius: 5px;
+}
+
+/* .ToolBar {
   position: absolute;
   right: 12px;
   width: 586px;
@@ -196,13 +255,13 @@
   margin: 5px;
   background: #1e1e1e;
 } */
-	.table-main {
-		font-size: 14px;
-		width: 600px;
-		text-align: center;
-		background: #000000;
-		margin: 5px;
-		border-collapse: separate;
-		border-spacing: 0px 5px;
-	}
+.table-main {
+  font-size: 14px;
+  width: 600px;
+  text-align: center;
+  background: #000000;
+  margin: 5px;
+  border-collapse: separate;
+  border-spacing: 0px 5px;
+}
 </style>

+ 256 - 0
src/components/warning/warningRecords.vue

@@ -0,0 +1,256 @@
+<template>
+  <el-dialog
+    width="60%"
+    @open="opened()"
+    @closed="closed()"
+    :show-close="false"
+    class="my-info-dialog"
+  >
+    <template #title>
+      <div class="showTitles">
+        <div class="titles">报警记录</div>
+      </div>
+    </template>
+    <div class="recordBody">
+      <div class="operate">
+        <el-date-picker
+          class="picker"
+          @change="changes"
+          v-model="timeValue"
+          type="datetimerange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+        >
+        </el-date-picker>
+        <div class="showTitle">场站:</div>
+        <el-select
+          class="selects"
+          clearable
+          v-model="selectValue"
+          placeholder="请选择"
+        >
+          <el-option
+            v-for="item in stationList"
+            :key="item.id"
+            :label="item.stationName"
+            :value="item.id"
+          >
+          </el-option>
+        </el-select>
+        <div class="showTitle">搜索:</div>
+        <el-input class="inputs" placeholder="请输入" v-model="filterText"></el-input>
+        <div class="buttons" @click="search()">查询</div>
+      </div>
+      <div class="warningList">
+        <el-table
+          :data="recordData"
+          class="table"
+          height="55vh"
+          :header-cell-style="{
+            background: '#000000',
+            color: 'rgb(220,220,220)',
+            padding: '4px',
+            fontSize: '14px',
+            'border-bottom': 'solid 1px black',
+          }"
+          :cell-style="{
+            height: '45px',
+            background: 'rgb(30,30,30)',
+            color: 'rgb(220,220,220)',
+            padding: '3px',
+            fontSize: '12px',
+            'border-bottom': '1px solid #000000',
+          }"
+          @row-dblclick="itemDblclick"
+        >
+          <el-table-column
+            prop="faultTime"
+            align="center"
+            label="故障时间"
+            width="280"
+          >
+          </el-table-column>
+          
+          <el-table-column
+            prop="categoryName"
+            align="center"
+            label="故障类型"
+          >
+          </el-table-column>
+
+          <el-table-column
+            prop="stationName"
+            align="center"
+            label="场站名称"
+          >
+          </el-table-column>
+          
+          <el-table-column width="80"  align="end">
+            <template #default="scope">
+              <span>
+                <img
+                  class="titleImg"
+                  v-if="scope.row.category1 === 'SYZ'"
+                  src="../../assets/img/controlcenter/warning.png"
+                  alt=""
+                />
+              </span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="alertText"
+            align="center"
+            label="描述"
+            width="520"
+          >
+          </el-table-column>
+        </el-table>
+        
+      </div>
+      <div class="paginations">
+          <el-pagination
+            background
+            layout="prev, pager, next"
+            :total="total"
+            @current-change="handleCurrentChange"
+            :hide-on-single-page="true"
+            :page-size="currentPage"
+            >
+          </el-pagination>
+        </div>
+    </div>
+  </el-dialog>
+</template>
+<script>
+import dayjs from "dayjs";
+import api from "api/index";
+export default {
+  data() {
+    return {
+      timeValue: [],
+      chooseTime: [],
+      recordData: [],
+      pageIndex: 1,
+      currentPage: 10,
+      total: 10,
+      selectValue: "",
+      filterText: "",
+      stationList: [],
+    };
+  },
+  updated() {},
+  methods: {
+    faultHistory() {
+      api
+        .getFaultHistory({
+          startTime: dayjs(this.timeValue[0]).format("YYYY-MM-DD HH:mm:ss"),
+          endTime: dayjs(this.timeValue[1]).format("YYYY-MM-DD HH:mm:ss"),
+          stationid: this.selectValue,
+          keyword: this.filterText,
+          pageSize: this.currentPage,
+          pageIndex: this.pageIndex,
+        })
+        .then((res) => {
+          this.recordData = res.data.records;
+          this.total = res.data.total
+        });
+    },
+    changes() {
+      let timeValue = [];
+      this.timeValue?.forEach((item) => {
+        timeValue.push(dayjs(item).valueOf());
+      });
+      this.chooseTime = timeValue;
+    },
+    search() {
+      this.faultHistory();
+    },
+    opened() {
+      if (this.timeValue.length === 0) {
+        let date = new Date();
+        this.timeValue[0] = date.getTime() - 86400000;
+        this.timeValue[1] = date.getTime();
+      }
+      this.chooseTime = this.timeValue;
+      this.faultHistory();
+      this.stationList = this.$store.state.stationList
+      console.log(this.stationList);
+    },
+    closed() {
+      this.chooseTime = [];
+      this.pageIndex = 1;
+    },
+    handleCurrentChange(val) {
+      this.pageIndex = val;
+      this.faultHistory();
+    },
+  },
+};
+</script>
+<style scoped>
+.recordBody {
+  display: flex;
+  flex-direction: column;
+  align-items: baseline;
+  background-color: black;
+  width: 100%;
+  margin-top: -30px;
+  padding-top: 10px;
+}
+.warningList {
+  width: 100%;
+  height: 60vh;
+}
+.paginations {
+  display: flex;
+  flex-direction: row-reverse;
+  background-color: #000000;
+  margin-top: -60px;
+  z-index: 2;
+  width: 100%;
+  padding-bottom: 30px;
+}
+.selects {
+  border: none;
+  width: 174px !important;
+}
+.inputs {
+  border: none;
+  width: 174px !important;
+  margin-right: 20px;
+}
+.showTitle{
+  margin-left: 20px;
+  margin-right: 10px;
+  color: #ffffff;
+  font-size: 16px;
+}
+.titleImg {
+  width: 20px;
+  height: 20px;
+  margin-left: 22px;
+  display: flex;
+}
+.table {
+  background-color: #000000 !important;
+}
+
+.el-table td,
+.el-table th.is-leaf {
+  border-bottom: 1px solid #000000 !important;
+}
+
+.el-table__header {
+  width: 100% !important;
+}
+
+.el-table__body-wrapper {
+  background-color: #000000 !important;
+}
+
+.el-table::before {
+  width: 0;
+}
+
+</style>

+ 3 - 2
src/main.js

@@ -5,8 +5,9 @@ import router from './router'
 import store from './store'
 import * as echarts from 'echarts';
 import ElementPlus from 'element-plus';
-import 'element-plus/lib/theme-chalk/index.css';
-import locale from 'element-ui/lib/locale/lang/zh-CN'
+import 'element-plus/dist/index.css';
+// import 'element-plus/lib/theme-chalk/index.css';
+import locale from 'element-plus/lib/locale/lang/zh-cn';
 const app = createApp(App)
 app.config.globalProperties.$echarts = echarts
 app.use(store)

+ 21 - 0
src/store/index.js

@@ -8,10 +8,13 @@ const store = createStore({
                windturbinelist: Object,  // 服务器推送的风机详细信息
                warning: Object,
                suggestion: [],
+               stationList: [],
                observers: true,
                titleInfo: Object,
                token: "",
                current: 1,
+               faultList: [],
+               currentStation: "",
           }
      },
 
@@ -26,6 +29,15 @@ const store = createStore({
           token(state) {
                return state.token;
           },
+          stationList(state) {
+               return state.stationList;
+          },
+          faultList(state) {
+               return state.faultList;
+          },
+          currentStation(state) {
+               return state.currentStation;
+          },
      },
 
      // 数据更新 使用: this.$store.commit('函数名','val')
@@ -39,6 +51,9 @@ const store = createStore({
           suggestion(state, data) {
                state.suggestion = data;
           },
+          stationList(state, data) {
+               state.stationList = data;
+          },
           observers(state, data) {
                state.observers = data;
           },
@@ -51,6 +66,12 @@ const store = createStore({
           token(state, data) {
                state.token = data;
           },
+          faultList(state, data) {
+               state.faultList = data;
+          },
+          currentStation(state, data) {
+               state.currentStation = data;
+          },
      }
 })
 

+ 156 - 198
src/utils/BackgroundData.js

@@ -1,107 +1,106 @@
-// import axios from 'axios';
 import api from "api/index";
 export default class BackgroundData {
     /* 当前登录用户 */
     LoginUser;
     /* 标题栏数据 */
-    TopPoint = [
-        {
-            pointName: "TotalPower",// 实时总功率
-            pointTag: "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0135",
-            value: 0
-        }, {
-            pointName: "DailyPowerGeneration",// 日发电量
-            pointTag: "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0088",
-            value: 0
-        }, {
-            pointName: "GridPower",// 上网电量
-            pointTag: "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0136",
-            value: 0
-        }, {
-            pointName: "MonthlyPowerGeneration",// 月发电量
-            pointTag: "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0146",
-            value: 0
-        }, {
-            pointName: "AnnualPowerGeneration",// 年发电量
-            pointTag: "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0037",
-            value: 0
-        },
-    ];
+    // TopPoint = [
+    //     {
+    //         pointName: "TotalPower",// 实时总功率
+    //         pointTag: "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0135",
+    //         value: 0
+    //     }, {
+    //         pointName: "DailyPowerGeneration",// 日发电量
+    //         pointTag: "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0088",
+    //         value: 0
+    //     }, {
+    //         pointName: "GridPower",// 上网电量
+    //         pointTag: "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0136",
+    //         value: 0
+    //     }, {
+    //         pointName: "MonthlyPowerGeneration",// 月发电量
+    //         pointTag: "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0146",
+    //         value: 0
+    //     }, {
+    //         pointName: "AnnualPowerGeneration",// 年发电量
+    //         pointTag: "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0037",
+    //         value: 0
+    //     },
+    // ];
     /* 推荐区数据 */
-    Recommends = {
-        "DWK": {
-            stationName: "大武口光伏电站",
-            content: "通讯中断",
-            createTime: this.formatDate(new Date("2021-04-15 8:17:59"), 'YY-MM-DD hh:mm'),
-            isActive: false,
-            stationID: 'DWK_AGC',
-            values:'DWK'
-        },
-        "NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0263": {
-            stationName: "牛首山风电场",
-            id: 'NSS_BT',
-            content: "限电",
-            createTime: new Date(),
-            isActive: false,
-            stationID: 'NSS_AGC',
-            values:'NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0263'
-        },
-        "QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0263": {
-            stationName: "青山风电场",
-            content: "限电",
-            createTime: new Date(),
-            isActive: false,
-            stationID: 'QS_AGC',
-            id: 'QS_BT',
-            values:'QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0263'
-        },
+    // Recommends = {
+    //     "DWK": {
+    //         stationName: "大武口光伏电站",
+    //         content: "通讯中断",
+    //         createTime: this.formatDate(new Date("2021-04-15 8:17:59"), 'YY-MM-DD hh:mm'),
+    //         isActive: false,
+    //         stationID: 'DWK_AGC',
+    //         values:'DWK'
+    //     },
+    //     "NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0263": {
+    //         stationName: "牛首山风电场",
+    //         id: 'NSS_BT',
+    //         content: "限电",
+    //         createTime: new Date(),
+    //         isActive: false,
+    //         stationID: 'NSS_AGC',
+    //         values:'NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0263'
+    //     },
+    //     "QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0263": {
+    //         stationName: "青山风电场",
+    //         content: "限电",
+    //         createTime: new Date(),
+    //         isActive: false,
+    //         stationID: 'QS_AGC',
+    //         id: 'QS_BT',
+    //         values:'QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0263'
+    //     },
 
-        "SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0263": {
-            stationName: "星能第六风电场",
-            content: "限电",
-            createTime: new Date(),
-            isActive: false,
-            stationID: 'XNL_AGC',
-            id: 'XN6_BT',
-            values:'SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0263'
-        },
-        "MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0263": {
-            stationName: "麻黄山风电场",
-            id: 'MHS_BT',
-            content: "限电",
-            createTime: new Date(),
-            isActive: false,
-            stationID: 'MHS_AGC',
-            values:'MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0263'
-        },
-        "XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0263": {
-            stationName: "香山风电场",
-            content: "限电",
-            createTime: new Date(),
-            isActive: false,
-            stationID: 'XS_AGC',
-            id: 'XS_BT',
-            values:'XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0263'
-        },
-        "SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI026X": {
-            stationName: "牛首山第五风电场",
-            content: "限电",
-            createTime: new Date(),
-            isActive: false,
-            stationID: 'NW_AGC',
-            id: 'N5_BT',
-            values:'SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI026X'
-        },
-        "SLAGC.NX_GD_QSF_DQ_P1_L1_001_DI0165": {
-            stationName: "宋堡第六风电场",
-            content: "限电",
-            createTime: new Date(),
-            isActive: false,
-            stationID: 'QS3_AGC',
-            id: 'SL_BT',
-            values:'SLAGC.NX_GD_QSF_DQ_P1_L1_001_DI0165'
-        },
-    };
+    //     "SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0263": {
+    //         stationName: "星能第六风电场",
+    //         content: "限电",
+    //         createTime: new Date(),
+    //         isActive: false,
+    //         stationID: 'XNL_AGC',
+    //         id: 'XN6_BT',
+    //         values:'SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0263'
+    //     },
+    //     "MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0263": {
+    //         stationName: "麻黄山风电场",
+    //         id: 'MHS_BT',
+    //         content: "限电",
+    //         createTime: new Date(),
+    //         isActive: false,
+    //         stationID: 'MHS_AGC',
+    //         values:'MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0263'
+    //     },
+    //     "XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0263": {
+    //         stationName: "香山风电场",
+    //         content: "限电",
+    //         createTime: new Date(),
+    //         isActive: false,
+    //         stationID: 'XS_AGC',
+    //         id: 'XS_BT',
+    //         values:'XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0263'
+    //     },
+    //     "SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI026X": {
+    //         stationName: "牛首山第五风电场",
+    //         content: "限电",
+    //         createTime: new Date(),
+    //         isActive: false,
+    //         stationID: 'NW_AGC',
+    //         id: 'N5_BT',
+    //         values:'SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI026X'
+    //     },
+    //     "SLAGC.NX_GD_QSF_DQ_P1_L1_001_DI0165": {
+    //         stationName: "宋堡第六风电场",
+    //         content: "限电",
+    //         createTime: new Date(),
+    //         isActive: false,
+    //         stationID: 'QS3_AGC',
+    //         id: 'SL_BT',
+    //         values:'SLAGC.NX_GD_QSF_DQ_P1_L1_001_DI0165'
+    //     },
+    // };
     /* 隐患数据 */
     HiddenProblems = new Array();
     /* 缺陷数据 */
@@ -118,9 +117,9 @@ export default class BackgroundData {
     MarkIndex = 0;
 
     constructor() {
-        this.refreshTPData = this.refreshTPData.bind(this);
-        this.onTPMessage = this.onTPMessage.bind(this);
-        this.refreshAlarmData = this.refreshAlarmData.bind(this);
+        // this.refreshTPData = this.refreshTPData.bind(this);
+        // this.onTPMessage = this.onTPMessage.bind(this);
+        // this.refreshAlarmData = this.refreshAlarmData.bind(this);
         this.onHiddenProblemsMessage = this.onHiddenProblemsMessage.bind(this);
         this.formatDate = this.formatDate.bind(this);
         this.onDefectsMessage = this.onDefectsMessage.bind(this);
@@ -131,29 +130,23 @@ export default class BackgroundData {
         this.windturbineControl = this.windturbineControl.bind(this);
         this.marking = this.marking.bind(this);
         this.removeMarked = this.removeMarked.bind(this);
-        this.initWinturbineBaseData = this.initWinturbineBaseData.bind(this);
-        this.refreshTPData();
-        this.refreshAlarmData();
+        // this.initWinturbineBaseData = this.initWinturbineBaseData.bind(this);
+        // this.refreshTPData();
+        // this.refreshAlarmData();
         this.refreshRecommendData();
-        this.refreshTPTimer = setInterval(this.refreshTPData, 3000);// 标题栏数据
-        this.refreshAlarmTimer = setInterval(this.refreshAlarmData, 10000);// 报警数据
+        // this.refreshTPTimer = setInterval(this.refreshTPData, 3000);// 标题栏数据
+        // this.refreshAlarmTimer = setInterval(this.refreshAlarmData, 10000);// 报警数据
         this.refreshRecommendTimer = setInterval(this.refreshRecommendData, 3000);// 推荐数据
     }
 
     /* 数据刷新 */
-    refreshTPData() {
-        // http://192.168.10.18:8011/ts
-        let val = '';
-        for (let v in this.TopPoint) {
-            val += this.TopPoint[v].pointTag + ',';
-        }
-        api.refreshData(val).then(this.onTPMessage)
-        // axios.get(process.env.VUE_APP_ADAPTERURL+`/ts/latest?keys=${val}`)
-        //     .then(this.onTPMessage)
-        //     .catch(err =>
-        //         console.log(err)
-        //     );
-    }
+    // refreshTPData() {
+    //     let val = '';
+    //     for (let v in this.TopPoint) {
+    //         val += this.TopPoint[v].pointTag + ',';
+    //     }
+    //     api.refreshData(val).then(this.onTPMessage)
+    // }
 
     /* 刷新推荐信息 */
     refreshRecommendData() {
@@ -161,12 +154,7 @@ export default class BackgroundData {
         for (let v in this.Recommends) {
             val += v + ',';
         }
-        api.refreshData(val).then(this.onRDMessage)
-        // axios.get(process.env.VUE_APP_ADAPTERURL+`/ts/latest?keys=${val}`)
-        //     .then(this.onRDMessage)
-        //     .catch(err =>
-        //         console.log(err)
-        //     );
+        // api.refreshData(val).then(this.onRDMessage)
     }
 
     /* 刷新报警信息 */
@@ -177,30 +165,30 @@ export default class BackgroundData {
         let tm = enddt.getTime();
         enddt = new Date(tm + 900000);
         let startdt = new Date(tm - 86400000);
-        api.getSnap({
-            pagenum:'1',
-            pagesize:'500',
-            category1:'custom',
-            isopened:'1',
-            starttime:this.formatDate(startdt),
-            endtime:this.formatDate(enddt),
-        }).then(this.onHiddenProblemsMessage)
-        api.getSnap({
-            pagenum:'1',
-            pagesize:'500',
-            category1:'windturbine',
-            isopened:'1',
-            starttime:this.formatDate(startdt),
-            endtime:this.formatDate(enddt),
-        }).then(this.onHiddenProblemsMessage)
-        api.getSnap({
-            pagenum:'1',
-            pagesize:'500',
-            category1:'SYZ',
-            isopened:'1',
-            starttime:this.formatDate(startdt),
-            endtime:this.formatDate(enddt),
-        }).then(this.onHiddenProblemsMessage)
+        // api.getSnap({
+        //     pagenum:'1',
+        //     pagesize:'500',
+        //     category1:'custom',
+        //     isopened:'1',
+        //     starttime:this.formatDate(startdt),
+        //     endtime:this.formatDate(enddt),
+        // }).then(this.onHiddenProblemsMessage)
+        // api.getSnap({
+        //     pagenum:'1',
+        //     pagesize:'500',
+        //     category1:'windturbine',
+        //     isopened:'1',
+        //     starttime:this.formatDate(startdt),
+        //     endtime:this.formatDate(enddt),
+        // }).then(this.onHiddenProblemsMessage)
+        // api.getSnap({
+        //     pagenum:'1',
+        //     pagesize:'500',
+        //     category1:'SYZ',
+        //     isopened:'1',
+        //     starttime:this.formatDate(startdt),
+        //     endtime:this.formatDate(enddt),
+        // }).then(this.onHiddenProblemsMessage)
     }
 
     /* 获得故障数据 */
@@ -244,33 +232,33 @@ export default class BackgroundData {
     }
 
     /* 获得标题栏数据 */
-    onTPMessage(msg) {
-        if (!msg.data) return;
-        for (let v in this.TopPoint) {
-            let val = this.TopPoint[v];
-            val.value = msg.data[val.pointTag].doubleValue;
-        }
-    }
+    // onTPMessage(msg) {
+    //     if (!msg.data) return;
+    //     for (let v in this.TopPoint) {
+    //         let val = this.TopPoint[v];
+    //         val.value = msg.data[val.pointTag].doubleValue;
+    //     }
+    // }
 
     /* 获得推荐信息数据 */
     onRDMessage(msg) {
         if (!msg.data) return;
-        for (let v in msg.data) {
-            let isact = false;
-            if (!msg.data[v].doubleValue) {
-                isact = msg.data[v].booleanValue
-            } else {
-                isact = msg.data[v].doubleValue != 0;
-            }
-            if (isact && !this.Recommends[v].isActive) {
-                this.Recommends[v].createTime = this.formatDate(new Date(), 'YY-MM-DD hh:mm');
-            }
-            this.Recommends[v].isActive = isact;
-        }
+        // for (let v in msg.data) {
+        //     let isact = false;
+        //     if (!msg.data[v].doubleValue) {
+        //         isact = msg.data[v].booleanValue
+        //     } else {
+        //         isact = msg.data[v].doubleValue != 0;
+        //     }
+        //     if (isact && !this.Recommends[v].isActive) {
+        //         this.Recommends[v].createTime = this.formatDate(new Date(), 'YY-MM-DD hh:mm');
+        //     }
+        //     this.Recommends[v].isActive = isact;
+        // }
     }
 
     /* 格式化时间 */
-    formatDate(time, format = 'YY-MM-DD hh:mm:ss') {
+    formatDate(time, format = 'YY-MM-DD HH:mm:ss') {
         let date = new Date(time);
 
         let year = date.getFullYear(),
@@ -302,13 +290,6 @@ export default class BackgroundData {
         return false;
     }
 
-    /* 登录 */
-    // login(uname, psd, action) {
-    //     axios.get(process.env.VUE_APP_API+`/api/user/login?userName=${uname}&psd=${psd}`)
-    //         .then(action)
-    //         .catch(err => action("登录出现错误:" + err.message));
-    // }
-
     /* 风机控制 */
     windturbineControl(windturbines, isLockOrUnlock, automatic, test ,success, error) {
         let pairs = {};
@@ -329,14 +310,6 @@ export default class BackgroundData {
         api.windturbControl(pairs).then(res =>{
             success(res);
         })
-        // axios.post(process.env.VUE_APP_API+`/api/control/send?isLockOrUnlock=${isLockOrUnlock}`, pairs)
-        //     .then(msg => {
-        //         success(msg);
-        //     })
-        //     .catch(err => {
-        //         error(err);
-        //     });
-        console.log(isLockOrUnlock);
     }
 
     /* 系统控制风机,自动下发命令 */
@@ -360,14 +333,6 @@ export default class BackgroundData {
         api.windturbControl(pairs).then(res =>{
             success(res);
         })
-        // axios.post(process.env.VUE_APP_API+`/api/control/send?isLockOrUnlock=false`, pairs)
-        //     .then(msg => {
-        //         console.log(msg);
-        //     })
-        //     .catch(err => {
-        //         this.showdialog("错误", "风机控制出现错误", err.message);
-        //         console.log(err);
-        //     });
     }
 
     /* 标记 */
@@ -429,13 +394,6 @@ export default class BackgroundData {
         }).catch(err => {
             console.log(err);
         });
-        // axios.get(process.env.VUE_APP_ADAPTERURL+`/ts/latest?thingType=windturbine&thingId=${info.windturbineId}&uniformCodes=${info.codes}`)
-        //     .then(msg => {
-        //         action(msg.data);
-        //     })
-        //     .catch(err => {
-        //         console.log(err);
-        //     });
     }
 
     /* 单例 */

File diff suppressed because it is too large
+ 569 - 2006
src/utils/BoosterStation.js


+ 29 - 26
src/utils/MessageBridge.js

@@ -18,9 +18,9 @@ export default class MessageBridge {
     this.flagArr = new Array();
     this.flag = (new Date()).getTime();
     this.windFlag = (new Date()).getTime();
-    this.reconnect()
+    // this.reconnect()
     this.calcSocket = new WebSocket(`ws://${process.env.VUE_APP_APIS}/wisdom_service`, this.onmessage, ["/topic/suggestion", "/topic/sync-command-result", "/topic/fault-count",
-      "/topic/alarm-count", "/topic/fault-popup", "/topic/popup-remove", "/topic/heartbeat-data", "/topic/voice-control", "/topic/title-info", "/topic/attention"]);
+      "/topic/alarm-count", "/topic/fault-popup", "/topic/popup-remove", "/topic/heartbeat-data", "/topic/title-info", "/topic/attention"]);
     this.adapterSocket = new WebSocket(`ws://${process.env.VUE_APP_ADAPTERURLS}/wisdom`, this.onmessage, ["/topic/windturbine", "/topic/pv"]);
   }
 
@@ -56,7 +56,9 @@ export default class MessageBridge {
     }
     for (let i in this.observers) {
       if (this.observers[i].key == destination) {
+       if(list.filter(item => item.key  === this.observers[i].key).length <= 2 ) {
         list.push(this.observers[i]);
+       }
       }
     }
     return list;
@@ -74,32 +76,33 @@ export default class MessageBridge {
   /* 取消注册消息 */
   unregister(msgs) {
     let showIndex = null
-    this.observers.forEach((item, index) => {
-      if (item.key === msgs.key) {
-        showIndex = index
-      }
-    })
-    this.observers.splice(showIndex, 1);
-  }
-
-  reconnect() {
-    setTimeout(() => {
-      if ((this.observers.filter(item => item.key === "/topic/windturbine").length === 0) || (this.observers.filter(item => item.key === "/topic/suggestion").length === 0) || (this.observers.filter(item => item.key === "/topic/title-info").length === 0)) {
-        store.commit('observers', false)
-      }
-      this.reconnect()
-    }, 10000);
-    if (((new Date()).getTime() - this.windFlag) > 20000) {
-      console.log('心跳检测失败1,尝试重新连接');
-      this.adapterSocket.disconnect()
-      this.adapterSocket.connect()
-    }
-    if (((new Date()).getTime() - this.flag) > 20000) {
-      console.log('心跳检测失败,尝试重新连接');
-      this.calcSocket.disconnect()
-      this.calcSocket.connect()
+    let status = this.observers.filter(item => item.key === msgs.key).length
+    if(status){
+      this.observers.forEach((item, index) => {
+        if (item.key === msgs.key) {
+          showIndex = index
+        }
+      })
+      this.observers.splice(showIndex, 1);
     }
   }
+
+  // reconnect() {
+  //   setTimeout(() => {
+  //     if ((this.observers.filter(item => item.key === "/topic/windturbine").length === 0) || (this.observers.filter(item => item.key === "/topic/suggestion").length === 0) || (this.observers.filter(item => item.key === "/topic/title-info").length === 0)) {
+  //       store.commit('observers', false)
+  //     }
+  //     this.reconnect()
+  //   }, 10000);
+  //   if (((new Date()).getTime() - this.windFlag) > 20000) {
+  //     this.adapterSocket.disconnect()
+  //     this.adapterSocket.connect()
+  //   }
+  //   if (((new Date()).getTime() - this.flag) > 20000) {
+  //     this.calcSocket.disconnect()
+  //     this.calcSocket.connect()
+  //   }
+  // }
 }
 
 class WebSocket {

+ 0 - 146
src/utils/PhotoelectricDetailPages.js

@@ -1,146 +0,0 @@
-// import axios from 'axios';
-// import {config} from '../../config';
-
-export const Photoelectric = {
-		'MHS_BT':[
-			{name:"有功设定限值", tag:"PowerSet", value:"MHSDQ.NX_GD_MHSF_DQ_P1_L1_001_AI0296", calc:"1"},
-			{name:"AGC可调上限", tag:"AgcUp", value:"MHSDQ.NX_GD_MHSF_DQ_P1_L1_001_AI0294", calc:"0.1"},
-			{name:"AGC可调下限", tag:"AgcLower", value:"MHSDQ.NX_GD_MHSF_DQ_P1_L1_001_AI0295", calc:"0.01"},
-			{name:"实发有功", tag:"ActualPower", value:"MHSDQ.NX_GD_MHSF_DQ_P1_L1_001_AI0013", calc:"0.833"},
-			{name:"理论功率", tag:"TheoryPower", value:"MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0193", calc:"0.001"},
-			{name:"预测功率", tag:"ForecastPower", value:"MHSFGL.NX_GD_MHSF_YC_P1_L1_001_CDQ001", calc:"1"},
-			{name:"AGC投入", tag:"AgcIn", value:"MHSDQ.NX_GD_MHSF_DQ_P1_L1_001_DI1207"},
-			{name:"AGC远方", tag:"AgcFar", value:"MHSDQ.NX_GD_MHSF_DQ_P1_L1_001_DI1208"},
-			{name:"有功增闭锁", tag:"SumLock", value:"MHSDQ.NX_GD_MHSF_DQ_P1_L1_001_DI1209"},
-			{name:"有功减闭锁", tag:"SubLock", value:"MHSDQ.NX_GD_MHSF_DQ_P1_L1_001_DI1210"},
-			{name:"状态", tag:"Status", value:"MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0263"},
-			{name:"装机容量", tag:"InstalledCapacity", value:"69.5"},
-		],
-		'QS_BT':[
-			{name:"有功设定限值", tag:"PowerSet", value:"QSDQ.NX_GD_QSF_DQ_P1_L1_001_AI1281", calc:"1"},
-			{name:"AGC可调上限", tag:"AgcUp", value:"QSDQ.NX_GD_QSF_DQ_P1_L1_001_AI1284", calc:"1"},
-			{name:"AGC可调下限", tag:"AgcLower", value:"QSDQ.NX_GD_QSF_DQ_P1_L1_001_AI1285", calc:"0.1"},
-			{name:"实发有功", tag:"ActualPower", value:"QSDQ.NX_GD_QSF_DQ_P1_L1_001_AI1282", calc:"1"},
-			{name:"理论功率", tag:"TheoryPower", value:"QSFCJSFW.NX_GD_QSF_FJ_P1_XXX_XXX_CI0192", calc:"0.001"},
-			{name:"预测功率", tag:"ForecastPower", value:"QSFGL.NX_GD_QSF_YC_P1_L1_001_CDQ001", calc:"1"},
-			{name:"AGC投入", tag:"AgcIn", value:"QSDQ.NX_GD_QSF_DQ_P1_L1_001_DI2442"},
-			{name:"AGC远方", tag:"AgcFar", value:"QSDQ.NX_GD_QSF_DQ_P1_L1_001_DI2443"},
-			{name:"有功增闭锁", tag:"SumLock", value:"QSDQ.NX_GD_QSF_DQ_P1_L1_001_DI2444"},
-			{name:"有功减闭锁", tag:"SubLock", value:"QSDQ.NX_GD_QSF_DQ_P1_L1_001_DI2445"},
-			{name:"状态", tag:"Status", value:"QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0263"},
-			{name:"装机容量", tag:"InstalledCapacity", value:"99"},
-		],
-		'NSS_BT':[
-			{name:"有功设定限值", tag:"PowerSet", value:"NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_AI1019", calc:"1"},
-			{name:"AGC可调上限", tag:"AgcUp", value:"NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_AI1010", calc:"0.001"},
-			{name:"AGC可调下限", tag:"AgcLower", value:"NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_AI1011", calc:"0.001"},
-			{name:"实发有功", tag:"ActualPower", value:"NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_AI1009", calc:"0.001"},
-			{name:"理论功率", tag:"TheoryPower", value:"NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0193", calc:"0.001"},
-			{name:"预测功率", tag:"ForecastPower", value:"NSSFGL.NX_GD_NSSF_YC_P1_L1_001_CDQ001", calc:"0.001"},
-			{name:"AGC投入", tag:"AgcIn", value:"NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI1547"},
-			{name:"AGC远方", tag:"AgcFar", value:"NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI1556"},
-			{name:"有功增闭锁", tag:"SumLock", value:"NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI1567"},
-			{name:"有功减闭锁", tag:"SubLock", value:"NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI1568"},
-			{name:"状态", tag:"Status", value:"NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0263"},
-			{name:"装机容量", tag:"InstalledCapacity", value:"148.5"},
-		],
-		"XN6_BT":[
-			{name:"有功设定限值", tag:"PowerSet", value:"SBQXLDQ.NX_GD_SBQF_DQ_P1_L1_001_AI0818", calc:"1"},
-			{name:"AGC可调上限", tag:"AgcUp", value:"SBQXLDQ.NX_GD_SBQF_DQ_P1_L1_001_AI0819", calc:"0.1"},
-			{name:"AGC可调下限", tag:"AgcLower", value:"SBQXLDQ.NX_GD_SBQF_DQ_P1_L1_001_AI0820", calc:"0.1"},
-			{name:"实发有功", tag:"ActualPower", value:"SBQXLDQ.NX_GD_SBQF_DQ_P1_L1_001_AI0012", calc:"0.001"},
-			{name:"理论功率", tag:"TheoryPower", value:"SBQFCJSFW.NX_GD_SBQF_FJ_P1_XXX_XXX_CI0192", calc:"0.001"},
-			{name:"预测功率", tag:"ForecastPower", value:"SBQFGL.NX_GD_SBQF_YC_P1_L1_001_CDQ001", calc:"1"},
-			{name:"AGC投入", tag:"AgcIn", value:"SBQXLDQ.NX_GD_SBQF_DQ_P1_L1_001_DI3831"},
-			{name:"AGC远方", tag:"AgcFar", value:"SBQXLDQ.NX_GD_SBQF_DQ_P1_L1_001_DI3832"},
-			{name:"有功增闭锁", tag:"SumLock", value:"SBQXLDQ.NX_GD_SBQF_DQ_P1_L1_001_DI3833"},
-			{name:"有功减闭锁", tag:"SubLock", value:"SBQXLDQ.NX_GD_SBQF_DQ_P1_L1_001_DI3834"},
-			{name:"状态", tag:"Status", value:"SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0263"},
-			{name:"装机容量", tag:"InstalledCapacity", value:"49.5"},
-		],
-		'N5_BT':[
-			{name:"有功设定限值", tag:"PowerSet", value:"SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_AI0818", calc:"1"},
-			{name:"AGC可调上限", tag:"AgcUp", value:"SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_AI0819", calc:"1"},
-			{name:"AGC可调下限", tag:"AgcLower", value:"SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_AI0820", calc:"1"},
-			{name:"实发有功", tag:"ActualPower", value:"SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_AI0817", calc:"1"},
-			{name:"理论功率", tag:"TheoryPower", value:"SBQFCJSFW.NX_GD_SBQF_FJ_P2_XXX_XXX_CI0192,SBQFCJSFW.NX_GD_SBQF_FJ_P3_XXX_XXX_CI0192,SBQFCJSFW.NX_GD_SBQF_FJ_P4_XXX_XXX_CI0192", calc:"0.001"},
-			{name:"预测功率", tag:"ForecastPower", value:"SBQFGL.NX_GD_SBQF_YC_P1_L1_001_CDQ001", calc:"1"},
-			{name:"AGC投入", tag:"AgcIn", value:"SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_DI3831"},
-			{name:"AGC远方", tag:"AgcFar", value:"SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_DI3832"},
-			{name:"有功增闭锁", tag:"SumLock", value:"SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_DI3833"},
-			{name:"有功减闭锁", tag:"SubLock", value:"SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_DI3834"},
-			{name:"状态", tag:"Status", value:"SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI026X"},
-			{name:"装机容量", tag:"InstalledCapacity", value:"149"},
-		],
-		'XS_BT':[
-			{name:"有功设定限值", tag:"PowerSet", value:"XSDQ.NX_GD_XSF_DQ_P1_L1_001_AI0411", calc:"1"},
-			{name:"AGC可调上限", tag:"AgcUp", value:"XSDQ.NX_GD_XSF_DQ_P1_L1_001_AI0412", calc:"1"},
-			{name:"AGC可调下限", tag:"AgcLower", value:"XSDQ.NX_GD_XSF_DQ_P1_L1_001_AI0413", calc:"1"},
-			{name:"实发有功", tag:"ActualPower", value:"XSDQ.NX_GD_XSF_DQ_P1_L1_001_AI0415", calc:"1"},
-			{name:"理论功率", tag:"TheoryPower", value:"XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0193", calc:"0.001"},
-			{name:"预测功率", tag:"ForecastPower", value:"XSFGL.NX_G D_XSF_YC_P1_L1_001_CDQ001", calc:"1"},
-			{name:"AGC投入", tag:"AgcIn", value:"XSDQ.NX_GD_XSF_DQ_P1_L1_001_DI1749"},
-			{name:"AGC远方", tag:"AgcFar", value:"XSDQ.NX_GD_XSF_DQ_P1_L1_001_DI1750"},
-			{name:"有功增闭锁", tag:"SumLock", value:"XSDQ.NX_GD_XSF_DQ_P1_L1_001_DI1753"},
-			{name:"有功减闭锁", tag:"SubLock", value:"XSDQ.NX_GD_XSF_DQ_P1_L1_001_DI1754"},
-			{name:"状态", tag:"Status", value:"XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0263"},
-			{name:"装机容量", tag:"InstalledCapacity", value:"99"},
-		],
-		'SL_BT':[
-			{name:"有功设定限值", tag:"PowerSet", value:"SLAGC.NX_GD_QSF_DQ_P1_L1_001_AI0052", calc:"1"},
-			{name:"AGC可调上限", tag:"AgcUp", value:"SLAGC.NX_GD_QSF_DQ_P1_L1_001_AI0053", calc:"1"},
-			{name:"AGC可调下限", tag:"AgcLower", value:"SLAGC.NX_GD_QSF_DQ_P1_L1_001_AI0054", calc:"1"},
-			{name:"实发有功", tag:"ActualPower", value:"SLDQ.NX_GD_QSF_DQ_P1_L1_001_AI0013", calc:"1"},
-			{name:"理论功率", tag:"TheoryPower", value:"QSFCJSFW.NX_GD_QSF_FJ_P3_XXX_XXX_CI0192", calc:"0.001"},
-			{name:"预测功率", tag:"ForecastPower", value:"SLFGL.NX_GD_QSF_YC_P1_L1_001_LCDQ01", calc:"1"},
-			{name:"AGC投入", tag:"AgcIn", value:"SLAGC.NX_GD_QSF_DQ_P1_L1_001_DI0142"},
-			{name:"AGC远方", tag:"AgcFar", value:"SLAGC.NX_GD_QSF_DQ_P1_L1_001_DI0143"},
-			{name:"有功增闭锁", tag:"SumLock", value:"SLAGC.NX_GD_QSF_DQ_P1_L1_001_DI0162"},
-			{name:"有功减闭锁", tag:"SubLock", value:"SLAGC.NX_GD_QSF_DQ_P1_L1_001_DI0163"},
-			{name:"状态", tag:"Status", value:"SLAGC.NX_GD_QSF_DQ_P1_L1_001_DI0165"},
-			{name:"装机容量", tag:"InstalledCapacity", value:"49.5"},
-		],
-		"DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0263":[
-			{name:"有功设定限值", tag:"PowerSet" , value:"DWKDQ.NX_GD_DWKG_DQ_P1_L1_001_AI0837"},
-			{name:"AGC可调上限", tag:"AgcUp" , value:"DWKDQ.NX_GD_DWKG_DQ_P1_L1_001_AI0838"},
-			{name:"AGC可调下限", tag:"AgcLower" , value:"DWKDQ.NX_GD_DWKG_DQ_P1_L1_001_AI0839"},
-			{name:"实发有功", tag:"ActualPower" , value:"DWKDQ.NX_GD_DWKG_DQ_P1_L1_001_AI0842" , calc:"0.01"},
-			{name:"理论功率", tag:"TheoryPower" , value:"DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0192"},
-			{name:"预测功率", tag:"ForecastPower" , value:"DWKGGL.NX_GD_DWKG_YC_P1_L1_001_CDQ001"},
-			{name:"AGC投入", tag:"AgcIn", value:"DWKDQ.NX_GD_DWKG_DQ_P1_L1_001_DI0761"},
-			{name:"AGC远方", tag:"AgcFar", value:"DWKDQ.NX_GD_DWKG_DQ_P1_L1_001_DI0767"},
-			{name:"有功增闭锁" ,tag:"SumLock", value:""},
-			{name:"有功减闭锁" ,tag:"SubLock", value:""},
-		],
-		'PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0263':[
-			{name:"有功设定限值", tag:"PowerSet", value:"PLSJ1.NX_GD_PLG_DQ_P1_L1_001_AI0838"},
-			{name:"AGC可调上限", tag:"AgcUp", value:"PLSJ1.NX_GD_PLG_DQ_P1_L1_001_AI0836"},
-			{name:"AGC可调下限", tag:"AgcLower", value:"PLSJ1.NX_GD_PLG_DQ_P1_L1_001_AI0837"},
-			{name:"实发有功", tag:"ActualPower", value:"PLSJ1.NX_GD_PLG_DQ_P1_L1_001_AI0835"},
-			{name:"理论功率", tag:"TheoryPower", value:"PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0192"},
-			{name:"预测功率", tag:"ForecastPower", value:"PLGGL.NX_GD_PLG_YC_P1_L1_001_CDQ0001"},
-			{name:"AGC投入", tag:"AgcIn", value:""},
-			{name:"AGC远方", tag:"AgcFar", value:""},
-			{name:"有功增闭锁", tag:"SumLock", value:""},
-			{name:"有功减闭锁", tag:"SubLock", value:""},
-		],
-		'XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0263':[
-			{name:"有功设定限值", tag:"PowerSet", value:"XHDQ.NX_GD_XHG_DQ_P1_L1_001_AI0204"},
-			{name:"AGC可调上限", tag:"AgcUp", value:"XHDQ.NX_GD_XHG_DQ_P1_L1_001_AI0194"},
-			{name:"AGC可调下限", tag:"AgcLower", value:"XHDQ.NX_GD_XHG_DQ_P1_L1_001_AI0195"},
-			{name:"实发有功", tag:"ActualPower", value:"XHDQ.NX_GD_XHG_DQ_P1_L1_001_AI0193"},
-			{name:"理论功率", tag:"TheoryPower", value:"XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0192"},
-			{name:"预测功率", tag:"ForecastPower", value:"XHGGL.NX_GD_XHG_YC_P1_L1_001_CDQ001"},
-			{name:"AGC投入", tag:"AgcIn", value:"XHDQ.NX_GD_XHG_DQ_P1_L1_001_DI0099"},
-			{name:"AGC远方", tag:"AgcFar", value:"XHDQ.NX_GD_XHG_DQ_P1_L1_001_DI0100"},
-			{name:"有功增闭锁", tag:"SumLock", value:""},
-			{name:"有功减闭锁", tag:"SubLock", value:""},
-		],
-	// constructor(){
-	// 	this.getDatas = this.getDatas.bind(this);
-	// 	this.getTags=this.getTags.bind(this);
-	// }
-	// getDatas(){
-	// 	return this.tags;
-	// }
-}

+ 0 - 11
src/utils/config.js

@@ -1,11 +0,0 @@
-export const config = {
-    shardingUrl:"192.168.10.18:8075",// 报警地址
-    calcUrl:"192.168.10.18:8099",// 大后台地址
-    adapterUrl:"192.168.10.18:8011",// 数据适配器地址
-};
-
-// export const config = {
-//     shardingUrl:"18.6.30.53:8075",// 报警地址
-//     calcUrl:"18.6.30.63:8099",// 大后台地址
-//     adapterUrl:"18.6.30.63:8011",// 数据适配器地址
-// };

+ 1 - 11
src/utils/request.js

@@ -2,20 +2,10 @@ import axios from "axios";
 import store from '../store/index'
 // import { getToken } from "@/utils/storage";
 const service = axios.create();
-// import { Loading } from 'element-ui';
-// import { Message  } from 'element-ui';
 service.defaults.timeout = 50000;
-// service.defaults.baseURL = `${process.env.VUE_APP_API}`
+service.defaults.baseURL = `${process.env.VUE_APP_API}`
 service.interceptors.request.use(
 	config => {
-		// 加载开始
-		// this.$loading({
-		// 	lock: true,
-		// 	text: 'Loading',
-		// 	spinner: 'el-icon-loading',
-		// 	background: 'rgba(0, 0, 0, 0.7)'
-		// });
-		// Loading.start(),
 		config.headers = {
             // 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
             Authorization: store.state.token,

+ 0 - 10
src/utils/storage.js

@@ -1,17 +1,7 @@
 import Cookies from "js-cookie";
 // import storage from "good-storage";
-// const user = 'userInfo'
 // const token = 'token'
 const TokenKey = "Authorization";
-// 获取user
-// const getUser = () => {
-//     return getStorageSync(user)
-// }
-
-// 设置user
-// export const setUser = key => {
-//     return setStorageSync(user, key)
-// }
 
 // 获取token
 export function getToken() {

+ 0 - 419
src/utils/warningInfo.js

@@ -1,419 +0,0 @@
-export default class warningInfo {
-    warning =[
-        {"SNAPID":"1","COUNT":"35","TIME":"1057.617","WINDTURBINEID":"XG01_11","ALERTTEXT":"三相电流不平衡","CATEGORY":"1"}
-        ,
-        {"SNAPID":"2","COUNT":"163","TIME":"748.783","WINDTURBINEID":"NG01_01","ALERTTEXT":"三相电流不平衡","CATEGORY":"1"}
-        ,
-        {"SNAPID":"3","COUNT":"70","TIME":"639.417","WINDTURBINEID":"NG01_87","ALERTTEXT":"三相电流不平衡","CATEGORY":"1"}
-        ,
-        {"SNAPID":"4","COUNT":"242","TIME":"627.867","WINDTURBINEID":"SG01_101","ALERTTEXT":"三相电流不平衡","CATEGORY":"1"}
-        ,
-        {"SNAPID":"5","COUNT":"137","TIME":"622.933","WINDTURBINEID":"MG01_42","ALERTTEXT":"三相电流不平衡","CATEGORY":"1"}
-        ,
-        {"SNAPID":"6","COUNT":"369","TIME":"590.8","WINDTURBINEID":"MG01_43","ALERTTEXT":"三相电流不平衡","CATEGORY":"1"}
-        ,
-        {"SNAPID":"7","COUNT":"140","TIME":"584.617","WINDTURBINEID":"NG01_42","ALERTTEXT":"三相电流不平衡","CATEGORY":"1"}
-        ,
-        {"SNAPID":"8","COUNT":"126","TIME":"536.833","WINDTURBINEID":"XG01_30","ALERTTEXT":"三相电流不平衡","CATEGORY":"1"}
-        ,
-        {"SNAPID":"9","COUNT":"1","TIME":"5.25","WINDTURBINEID":"NG01_88","ALERTTEXT":"主轴温升速度大于1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"10","COUNT":"1","TIME":"5.25","WINDTURBINEID":"XG01_31","ALERTTEXT":"主轴温升速度大于1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"11","COUNT":"1","TIME":"5.25","WINDTURBINEID":"NG01_12","ALERTTEXT":"主轴温升速度大于1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"12","COUNT":"1","TIME":"5.25","WINDTURBINEID":"NG01_85","ALERTTEXT":"主轴温升速度大于1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"13","COUNT":"1","TIME":"5.25","WINDTURBINEID":"NG01_01","ALERTTEXT":"主轴温升速度大于1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"14","COUNT":"15","TIME":"955.75","WINDTURBINEID":"XG01_29","ALERTTEXT":"主轴温度温差大于8度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"15","COUNT":"15","TIME":"900.55","WINDTURBINEID":"XG01_30","ALERTTEXT":"主轴温度温差大于8度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"16","COUNT":"18","TIME":"858.033","WINDTURBINEID":"SG01_75","ALERTTEXT":"主轴温度温差大于8度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"17","COUNT":"38","TIME":"850.3","WINDTURBINEID":"SG01_95","ALERTTEXT":"主轴温度温差大于8度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"18","COUNT":"14","TIME":"836.05","WINDTURBINEID":"SG01_67","ALERTTEXT":"主轴温度温差大于8度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"19","COUNT":"12","TIME":"829.35","WINDTURBINEID":"XG01_28","ALERTTEXT":"主轴温度温差大于8度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"20","COUNT":"17","TIME":"825.15","WINDTURBINEID":"SG01_72","ALERTTEXT":"主轴温度温差大于8度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"21","COUNT":"9","TIME":"154.517","WINDTURBINEID":"SG01_71","ALERTTEXT":"主轴温度高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"22","COUNT":"1","TIME":"1.4","WINDTURBINEID":"SG01_71","ALERTTEXT":"主轴齿轮箱侧温度传感器异常值","CATEGORY":"1"}
-        ,
-        {"SNAPID":"23","COUNT":"34","TIME":"1073.15","WINDTURBINEID":"QG01_71","ALERTTEXT":"停机收浆超时","CATEGORY":"2"}
-        ,
-        {"SNAPID":"24","COUNT":"36","TIME":"1061.417","WINDTURBINEID":"QG01_70","ALERTTEXT":"停机收浆超时","CATEGORY":"2"}
-        ,
-        {"SNAPID":"25","COUNT":"33","TIME":"1056.85","WINDTURBINEID":"QG01_75","ALERTTEXT":"停机收浆超时","CATEGORY":"2"}
-        ,
-        {"SNAPID":"26","COUNT":"34","TIME":"1046.15","WINDTURBINEID":"QG01_82","ALERTTEXT":"停机收浆超时","CATEGORY":"2"}
-        ,
-        {"SNAPID":"27","COUNT":"33","TIME":"1045.117","WINDTURBINEID":"QG01_67","ALERTTEXT":"停机收浆超时","CATEGORY":"2"}
-        ,
-        {"SNAPID":"28","COUNT":"36","TIME":"1023.117","WINDTURBINEID":"QG01_81","ALERTTEXT":"停机收浆超时","CATEGORY":"2"}
-        ,
-        {"SNAPID":"29","COUNT":"35","TIME":"1021.033","WINDTURBINEID":"QG01_86","ALERTTEXT":"停机收浆超时","CATEGORY":"2"}
-        ,
-        {"SNAPID":"30","COUNT":"36","TIME":"1015.933","WINDTURBINEID":"QG01_77","ALERTTEXT":"停机收浆超时","CATEGORY":"2"}
-        ,
-        {"SNAPID":"31","COUNT":"26","TIME":"850.133","WINDTURBINEID":"NG01_15","ALERTTEXT":"单机发电机U2绕组温度传感器异常值","CATEGORY":"2"}
-        ,
-        {"SNAPID":"32","COUNT":"39","TIME":"960.167","WINDTURBINEID":"NG01_15","ALERTTEXT":"单机发电机U2绕组温度预警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"33","COUNT":"7","TIME":"8.917","WINDTURBINEID":"MG01_13","ALERTTEXT":"单机发电机U2绕组温度预警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"34","COUNT":"22","TIME":"67.733","WINDTURBINEID":"MG01_17","ALERTTEXT":"单机发电机V2绕组温度传感器异常值","CATEGORY":"2"}
-        ,
-        {"SNAPID":"35","COUNT":"20","TIME":"1069.233","WINDTURBINEID":"NG01_73","ALERTTEXT":"单机发电机V2绕组温度预警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"36","COUNT":"34","TIME":"476.533","WINDTURBINEID":"MG01_17","ALERTTEXT":"单机发电机V2绕组温度预警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"37","COUNT":"21","TIME":"1063.15","WINDTURBINEID":"NG01_73","ALERTTEXT":"单机发电机V2绕组超限报警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"38","COUNT":"40","TIME":"437.183","WINDTURBINEID":"MG01_17","ALERTTEXT":"单机发电机V2绕组超限报警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"39","COUNT":"51","TIME":"476.3","WINDTURBINEID":"SG01_26","ALERTTEXT":"单机发电机W2绕组温度传感器异常值","CATEGORY":"2"}
-        ,
-        {"SNAPID":"40","COUNT":"33","TIME":"315.733","WINDTURBINEID":"NG01_07","ALERTTEXT":"单机发电机W2绕组温度传感器异常值","CATEGORY":"2"}
-        ,
-        {"SNAPID":"41","COUNT":"45","TIME":"132.017","WINDTURBINEID":"NG01_73","ALERTTEXT":"单机发电机W2绕组温度传感器异常值","CATEGORY":"2"}
-        ,
-        {"SNAPID":"42","COUNT":"33","TIME":"486","WINDTURBINEID":"SG01_26","ALERTTEXT":"单机发电机W2绕组温度预警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"43","COUNT":"13","TIME":"462.183","WINDTURBINEID":"SG01_31","ALERTTEXT":"单机发电机W2绕组温度预警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"44","COUNT":"107","TIME":"448.767","WINDTURBINEID":"NG01_07","ALERTTEXT":"单机发电机W2绕组温度预警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"45","COUNT":"75","TIME":"400.95","WINDTURBINEID":"NG01_73","ALERTTEXT":"单机发电机W2绕组温度预警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"46","COUNT":"31","TIME":"171.75","WINDTURBINEID":"NG01_05","ALERTTEXT":"单机发电机W2绕组温度预警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"47","COUNT":"33","TIME":"482.1","WINDTURBINEID":"SG01_26","ALERTTEXT":"单机发电机W2绕组超限报警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"48","COUNT":"14","TIME":"449.267","WINDTURBINEID":"SG01_31","ALERTTEXT":"单机发电机W2绕组超限报警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"49","COUNT":"108","TIME":"436.333","WINDTURBINEID":"NG01_07","ALERTTEXT":"单机发电机W2绕组超限报警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"50","COUNT":"74","TIME":"383.517","WINDTURBINEID":"NG01_73","ALERTTEXT":"单机发电机W2绕组超限报警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"51","COUNT":"30","TIME":"122.85","WINDTURBINEID":"NG01_05","ALERTTEXT":"单机发电机W2绕组超限报警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"52","COUNT":"1","TIME":"1.4","WINDTURBINEID":"SG01_79","ALERTTEXT":"单机发电机W2绕组超限报警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"53","COUNT":"1","TIME":"1.217","WINDTURBINEID":"SG01_70","ALERTTEXT":"单机发电机W2绕组超限报警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"54","COUNT":"1","TIME":"73.083","WINDTURBINEID":"SG01_94","ALERTTEXT":"单机发电机轴a温度预警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"55","COUNT":"1","TIME":"26.85","WINDTURBINEID":"SG01_30","ALERTTEXT":"单机发电机轴a温度预警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"56","COUNT":"9","TIME":"153.8","WINDTURBINEID":"SG01_71","ALERTTEXT":"单机发电机轴b温度超限报警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"57","COUNT":"1","TIME":"42.983","WINDTURBINEID":"SG01_15","ALERTTEXT":"单机发电机轴b温度预警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"58","COUNT":"18","TIME":"36.767","WINDTURBINEID":"NG01_29","ALERTTEXT":"单机变桨电池柜温度1温度传感器异常值","CATEGORY":"2"}
-        ,
-        {"SNAPID":"59","COUNT":"1","TIME":"1.7","WINDTURBINEID":"SG01_17","ALERTTEXT":"单机变桨电池柜温度2预警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"60","COUNT":"263","TIME":"85.617","WINDTURBINEID":"NG01_11","ALERTTEXT":"单机变桨电池柜温度3温度传感器异常值","CATEGORY":"2"}
-        ,
-        {"SNAPID":"61","COUNT":"298","TIME":"98.25","WINDTURBINEID":"NG01_11","ALERTTEXT":"单机变桨电池柜温度3超限报警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"62","COUNT":"13","TIME":"716.05","WINDTURBINEID":"NG01_02","ALERTTEXT":"单机变桨电池柜温度3预警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"63","COUNT":"2","TIME":"75.2","WINDTURBINEID":"SG01_26","ALERTTEXT":"单机变桨电池柜温度3预警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"64","COUNT":"2","TIME":"11.217","WINDTURBINEID":"SG01_17","ALERTTEXT":"单机变桨电池柜温度3预警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"65","COUNT":"367","TIME":"1143","WINDTURBINEID":"NG01_05","ALERTTEXT":"单机风向标故障","CATEGORY":"2"}
-        ,
-        {"SNAPID":"66","COUNT":"432","TIME":"1136.383","WINDTURBINEID":"NG01_02","ALERTTEXT":"单机风向标故障","CATEGORY":"2"}
-        ,
-        {"SNAPID":"67","COUNT":"23","TIME":"954.583","WINDTURBINEID":"NG01_18","ALERTTEXT":"单机风向标故障","CATEGORY":"2"}
-        ,
-        {"SNAPID":"68","COUNT":"923","TIME":"902.1","WINDTURBINEID":"NG01_37","ALERTTEXT":"单机风向标故障","CATEGORY":"2"}
-        ,
-        {"SNAPID":"69","COUNT":"16","TIME":"887.617","WINDTURBINEID":"XG01_41","ALERTTEXT":"单机风向标故障","CATEGORY":"2"}
-        ,
-        {"SNAPID":"70","COUNT":"379","TIME":"341.567","WINDTURBINEID":"SG01_47","ALERTTEXT":"单机风向标故障","CATEGORY":"2"}
-        ,
-        {"SNAPID":"71","COUNT":"818","TIME":"334.3","WINDTURBINEID":"NG01_33","ALERTTEXT":"单机风向标故障","CATEGORY":"2"}
-        ,
-        {"SNAPID":"72","COUNT":"399","TIME":"317.85","WINDTURBINEID":"SG01_45","ALERTTEXT":"单机风向标故障","CATEGORY":"2"}
-        ,
-        {"SNAPID":"73","COUNT":"355","TIME":"310.467","WINDTURBINEID":"SG01_50","ALERTTEXT":"单机风向标故障","CATEGORY":"2"}
-        ,
-        {"SNAPID":"74","COUNT":"9","TIME":"154.15","WINDTURBINEID":"SG01_71","ALERTTEXT":"单机齿轮箱油温超限报警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"75","COUNT":"2","TIME":"1.683","WINDTURBINEID":"SG01_25","ALERTTEXT":"单机齿轮箱油温超限报警","CATEGORY":"1"}
-        ,
-        {"SNAPID":"76","COUNT":"13","TIME":"91.167","WINDTURBINEID":"QG01_75","ALERTTEXT":"发电机转速超速","CATEGORY":"1"}
-        ,
-        {"SNAPID":"77","COUNT":"10","TIME":"80.05","WINDTURBINEID":"QG01_79","ALERTTEXT":"发电机转速超速","CATEGORY":"1"}
-        ,
-        {"SNAPID":"78","COUNT":"8","TIME":"76.15","WINDTURBINEID":"QG01_76","ALERTTEXT":"发电机转速超速","CATEGORY":"1"}
-        ,
-        {"SNAPID":"79","COUNT":"6","TIME":"73.933","WINDTURBINEID":"QG01_78","ALERTTEXT":"发电机转速超速","CATEGORY":"1"}
-        ,
-        {"SNAPID":"80","COUNT":"14","TIME":"73.4","WINDTURBINEID":"QG01_73","ALERTTEXT":"发电机转速超速","CATEGORY":"1"}
-        ,
-        {"SNAPID":"81","COUNT":"11","TIME":"799.283","WINDTURBINEID":"NG01_45","ALERTTEXT":"发电机轴A损坏或碳刷室温度过高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"82","COUNT":"11","TIME":"598.717","WINDTURBINEID":"NG01_33","ALERTTEXT":"发电机轴A损坏或碳刷室温度过高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"83","COUNT":"14","TIME":"465.75","WINDTURBINEID":"SG01_116","ALERTTEXT":"发电机轴A损坏或碳刷室温度过高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"84","COUNT":"14","TIME":"438.967","WINDTURBINEID":"NG01_46","ALERTTEXT":"发电机轴A损坏或碳刷室温度过高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"85","COUNT":"6","TIME":"419.033","WINDTURBINEID":"NG01_20","ALERTTEXT":"发电机轴A损坏或碳刷室温度过高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"86","COUNT":"13","TIME":"413.517","WINDTURBINEID":"NG01_42","ALERTTEXT":"发电机轴A损坏或碳刷室温度过高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"87","COUNT":"3","TIME":"5.267","WINDTURBINEID":"SG01_30","ALERTTEXT":"发电机轴a每分钟温升超过1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"88","COUNT":"1","TIME":"4.617","WINDTURBINEID":"SG01_05","ALERTTEXT":"发电机轴a每分钟温升超过1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"89","COUNT":"1","TIME":"4.617","WINDTURBINEID":"SG01_13","ALERTTEXT":"发电机轴a每分钟温升超过1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"90","COUNT":"1","TIME":"4.617","WINDTURBINEID":"SG01_18","ALERTTEXT":"发电机轴a每分钟温升超过1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"91","COUNT":"1","TIME":"4.617","WINDTURBINEID":"SG01_32","ALERTTEXT":"发电机轴a每分钟温升超过1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"92","COUNT":"1","TIME":"4.617","WINDTURBINEID":"SG01_14","ALERTTEXT":"发电机轴a每分钟温升超过1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"93","COUNT":"1","TIME":"4.617","WINDTURBINEID":"SG01_04","ALERTTEXT":"发电机轴a每分钟温升超过1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"94","COUNT":"5","TIME":"119.283","WINDTURBINEID":"NG01_01","ALERTTEXT":"发电机轴承温升大于40度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"95","COUNT":"2","TIME":"89.4","WINDTURBINEID":"SG01_15","ALERTTEXT":"发电机轴承温升大于40度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"96","COUNT":"1","TIME":"81.217","WINDTURBINEID":"SG01_30","ALERTTEXT":"发电机轴承温升大于40度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"97","COUNT":"22","TIME":"26.933","WINDTURBINEID":"NG01_01","ALERTTEXT":"发电机轴承温升速度大于1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"98","COUNT":"1","TIME":"11","WINDTURBINEID":"NG01_25","ALERTTEXT":"发电机轴承温升速度大于1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"99","COUNT":"1","TIME":"10.283","WINDTURBINEID":"NG01_76","ALERTTEXT":"发电机轴承温升速度大于1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"100","COUNT":"2","TIME":"9.467","WINDTURBINEID":"NG01_05","ALERTTEXT":"发电机轴承温升速度大于1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"101","COUNT":"2","TIME":"77.067","WINDTURBINEID":"SG01_15","ALERTTEXT":"发电机轴承温度高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"102","COUNT":"1","TIME":"66.133","WINDTURBINEID":"SG01_30","ALERTTEXT":"发电机轴承温度高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"103","COUNT":"3","TIME":"43.65","WINDTURBINEID":"SG01_29","ALERTTEXT":"发电机轴承温度高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"104","COUNT":"1","TIME":"1.733","WINDTURBINEID":"SG01_07","ALERTTEXT":"发电机轴承温度高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"105","COUNT":"2","TIME":"253","WINDTURBINEID":"SG01_71","ALERTTEXT":"变桨电容电压低","CATEGORY":"1"}
-        ,
-        {"SNAPID":"106","COUNT":"1","TIME":"1.167","WINDTURBINEID":"NG01_06","ALERTTEXT":"变桨电容电压低","CATEGORY":"1"}
-        ,
-        {"SNAPID":"107","COUNT":"2","TIME":"252.767","WINDTURBINEID":"SG01_71","ALERTTEXT":"变桨电容电压高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"108","COUNT":"1","TIME":"1","WINDTURBINEID":"SG01_84","ALERTTEXT":"变桨电容电压高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"109","COUNT":"9","TIME":"1235.967","WINDTURBINEID":"MG01_03","ALERTTEXT":"变桨通信不良","CATEGORY":"2"}
-        ,
-        {"SNAPID":"110","COUNT":"13","TIME":"1217.117","WINDTURBINEID":"MG01_04","ALERTTEXT":"变桨通信不良","CATEGORY":"2"}
-        ,
-        {"SNAPID":"111","COUNT":"13","TIME":"1199.65","WINDTURBINEID":"MG01_05","ALERTTEXT":"变桨通信不良","CATEGORY":"2"}
-        ,
-        {"SNAPID":"112","COUNT":"9","TIME":"1156.35","WINDTURBINEID":"MG01_23","ALERTTEXT":"变桨通信不良","CATEGORY":"2"}
-        ,
-        {"SNAPID":"113","COUNT":"12","TIME":"1156.183","WINDTURBINEID":"MG01_15","ALERTTEXT":"变桨通信不良","CATEGORY":"2"}
-        ,
-        {"SNAPID":"114","COUNT":"8","TIME":"1155.367","WINDTURBINEID":"MG01_02","ALERTTEXT":"变桨通信不良","CATEGORY":"2"}
-        ,
-        {"SNAPID":"115","COUNT":"9","TIME":"1151.533","WINDTURBINEID":"MG01_25","ALERTTEXT":"变桨通信不良","CATEGORY":"2"}
-        ,
-        {"SNAPID":"116","COUNT":"1","TIME":"1.45","WINDTURBINEID":"SG01_20","ALERTTEXT":"叶轮转速超速","CATEGORY":"1"}
-        ,
-        {"SNAPID":"117","COUNT":"1","TIME":"1.4","WINDTURBINEID":"SG01_71","ALERTTEXT":"夏季单机齿轮箱油温温度传感器异常值","CATEGORY":"1"}
-        ,
-        {"SNAPID":"118","COUNT":"1","TIME":"1.217","WINDTURBINEID":"SG01_30","ALERTTEXT":"大风引起震动","CATEGORY":"1"}
-        ,
-        {"SNAPID":"119","COUNT":"271","TIME":"1100.55","WINDTURBINEID":"MG01_07","ALERTTEXT":"断轴或联轴器打滑","CATEGORY":"2"}
-        ,
-        {"SNAPID":"120","COUNT":"299","TIME":"1032.717","WINDTURBINEID":"SG01_30","ALERTTEXT":"断轴或联轴器打滑","CATEGORY":"2"}
-        ,
-        {"SNAPID":"121","COUNT":"701","TIME":"755.233","WINDTURBINEID":"SG01_66","ALERTTEXT":"断轴或联轴器打滑","CATEGORY":"2"}
-        ,
-        {"SNAPID":"122","COUNT":"654","TIME":"722.317","WINDTURBINEID":"XG01_29","ALERTTEXT":"断轴或联轴器打滑","CATEGORY":"2"}
-        ,
-        {"SNAPID":"123","COUNT":"343","TIME":"705.417","WINDTURBINEID":"QG01_79","ALERTTEXT":"断轴或联轴器打滑","CATEGORY":"2"}
-        ,
-        {"SNAPID":"124","COUNT":"1","TIME":"1.483","WINDTURBINEID":"SG01_26","ALERTTEXT":"机端过电压","CATEGORY":"2"}
-        ,
-        {"SNAPID":"125","COUNT":"11","TIME":"5.017","WINDTURBINEID":"NG01_44","ALERTTEXT":"机组逆功率","CATEGORY":"2"}
-        ,
-        {"SNAPID":"126","COUNT":"10","TIME":"3.667","WINDTURBINEID":"MG01_21","ALERTTEXT":"机组逆功率","CATEGORY":"2"}
-        ,
-        {"SNAPID":"127","COUNT":"2","TIME":"2.233","WINDTURBINEID":"NG01_37","ALERTTEXT":"机组逆功率","CATEGORY":"2"}
-        ,
-        {"SNAPID":"128","COUNT":"3","TIME":"2","WINDTURBINEID":"NG01_96","ALERTTEXT":"机组逆功率","CATEGORY":"2"}
-        ,
-        {"SNAPID":"129","COUNT":"8","TIME":"153.583","WINDTURBINEID":"SG01_71","ALERTTEXT":"机舱温度高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"130","COUNT":"12","TIME":"32.683","WINDTURBINEID":"SG01_79","ALERTTEXT":"机舱温度高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"131","COUNT":"225","TIME":"81.35","WINDTURBINEID":"NG01_85","ALERTTEXT":"机舱震动幅度超限","CATEGORY":"1"}
-        ,
-        {"SNAPID":"132","COUNT":"102","TIME":"31.733","WINDTURBINEID":"XG01_10","ALERTTEXT":"机舱震动幅度超限","CATEGORY":"1"}
-        ,
-        {"SNAPID":"133","COUNT":"74","TIME":"28.95","WINDTURBINEID":"XG01_19","ALERTTEXT":"机舱震动幅度超限","CATEGORY":"1"}
-        ,
-        {"SNAPID":"134","COUNT":"92","TIME":"28.883","WINDTURBINEID":"NG01_78","ALERTTEXT":"机舱震动幅度超限","CATEGORY":"1"}
-        ,
-        {"SNAPID":"135","COUNT":"64","TIME":"24.15","WINDTURBINEID":"SG01_01","ALERTTEXT":"机舱震动幅度超限","CATEGORY":"1"}
-        ,
-        {"SNAPID":"136","COUNT":"63","TIME":"23.983","WINDTURBINEID":"XG01_25","ALERTTEXT":"机舱震动幅度超限","CATEGORY":"1"}
-        ,
-        {"SNAPID":"137","COUNT":"63","TIME":"23.983","WINDTURBINEID":"XG01_25","ALERTTEXT":"机舱震动幅度超限","CATEGORY":"1"}
-        ,
-        {"SNAPID":"138","COUNT":"63","TIME":"22.55","WINDTURBINEID":"SG01_19","ALERTTEXT":"机舱震动幅度超限","CATEGORY":"1"}
-        ,
-        {"SNAPID":"139","COUNT":"63","TIME":"21.25","WINDTURBINEID":"XG01_08","ALERTTEXT":"机舱震动幅度超限","CATEGORY":"1"}
-        ,
-        {"SNAPID":"140","COUNT":"2","TIME":"11.183","WINDTURBINEID":"NG01_70","ALERTTEXT":"桨叶角度差","CATEGORY":"1"}
-        ,
-        {"SNAPID":"141","COUNT":"3","TIME":"9.567","WINDTURBINEID":"SG01_71","ALERTTEXT":"桨叶角度差","CATEGORY":"1"}
-        ,
-        {"SNAPID":"142","COUNT":"2","TIME":"8.417","WINDTURBINEID":"NG01_61","ALERTTEXT":"桨叶角度差","CATEGORY":"1"}
-        ,
-        {"SNAPID":"143","COUNT":"2","TIME":"8.1","WINDTURBINEID":"NG01_73","ALERTTEXT":"桨叶角度差","CATEGORY":"1"}
-        ,
-        {"SNAPID":"144","COUNT":"2","TIME":"8.083","WINDTURBINEID":"NG01_78","ALERTTEXT":"桨叶角度差","CATEGORY":"1"}
-        ,
-        {"SNAPID":"145","COUNT":"2","TIME":"7.2","WINDTURBINEID":"NG01_28","ALERTTEXT":"桨叶角度差","CATEGORY":"1"}
-        ,
-        {"SNAPID":"146","COUNT":"16","TIME":"939.983","WINDTURBINEID":"XG01_02","ALERTTEXT":"桨叶角过小","CATEGORY":"1"}
-        ,
-        {"SNAPID":"147","COUNT":"15","TIME":"931.35","WINDTURBINEID":"XG01_09","ALERTTEXT":"桨叶角过小","CATEGORY":"1"}
-        ,
-        {"SNAPID":"148","COUNT":"6","TIME":"879.167","WINDTURBINEID":"XG01_14","ALERTTEXT":"桨叶角过小","CATEGORY":"1"}
-        ,
-        {"SNAPID":"149","COUNT":"14","TIME":"868.917","WINDTURBINEID":"XG01_04","ALERTTEXT":"桨叶角过小","CATEGORY":"1"}
-        ,
-        {"SNAPID":"150","COUNT":"6","TIME":"849.1","WINDTURBINEID":"XG01_15","ALERTTEXT":"桨叶角过小","CATEGORY":"1"}
-        ,
-        {"SNAPID":"151","COUNT":"1","TIME":"103.55","WINDTURBINEID":"SG01_15","ALERTTEXT":"石板泉发电机轴承温度超过70度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"152","COUNT":"1","TIME":"101.083","WINDTURBINEID":"SG01_30","ALERTTEXT":"石板泉发电机轴承温度超过70度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"153","COUNT":"1","TIME":"95.117","WINDTURBINEID":"SG01_29","ALERTTEXT":"石板泉发电机轴承温度超过70度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"154","COUNT":"1","TIME":"59.733","WINDTURBINEID":"SG01_07","ALERTTEXT":"石板泉发电机轴承温度超过70度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"155","COUNT":"113","TIME":"63.85","WINDTURBINEID":"NG01_17","ALERTTEXT":"风机偏航过程震动","CATEGORY":"1"}
-        ,
-        {"SNAPID":"156","COUNT":"22","TIME":"7.05","WINDTURBINEID":"NG01_27","ALERTTEXT":"风机偏航过程震动","CATEGORY":"1"}
-        ,
-        {"SNAPID":"157","COUNT":"16","TIME":"6.3","WINDTURBINEID":"NG01_06","ALERTTEXT":"风机偏航过程震动","CATEGORY":"1"}
-        ,
-        {"SNAPID":"158","COUNT":"15","TIME":"6.05","WINDTURBINEID":"NG01_55","ALERTTEXT":"风机偏航过程震动","CATEGORY":"1"}
-        ,
-        {"SNAPID":"159","COUNT":"15","TIME":"5.367","WINDTURBINEID":"NG01_85","ALERTTEXT":"风机偏航过程震动","CATEGORY":"1"}
-        ,
-        {"SNAPID":"160","COUNT":"5","TIME":"75.95","WINDTURBINEID":"SG01_94","ALERTTEXT":"风机轴a轴b温差大","CATEGORY":"1"}
-        ,
-        {"SNAPID":"161","COUNT":"1","TIME":"1.2","WINDTURBINEID":"SG01_06","ALERTTEXT":"风机轴a轴b温差大","CATEGORY":"1"}
-        ,
-        {"SNAPID":"162","COUNT":"229","TIME":"74.883","WINDTURBINEID":"NG01_22","ALERTTEXT":"风速突变","CATEGORY":"1"}
-        ,
-        {"SNAPID":"163","COUNT":"51","TIME":"60.333","WINDTURBINEID":"QG01_78","ALERTTEXT":"风速突变","CATEGORY":"1"}
-        ,
-        {"SNAPID":"164","COUNT":"39","TIME":"59.017","WINDTURBINEID":"QG01_77","ALERTTEXT":"风速突变","CATEGORY":"1"}
-        ,
-        {"SNAPID":"165","COUNT":"42","TIME":"58.783","WINDTURBINEID":"QG01_77","ALERTTEXT":"风速突变","CATEGORY":"1"}
-        ,
-        {"SNAPID":"166","COUNT":"44","TIME":"58.333","WINDTURBINEID":"QG01_76","ALERTTEXT":"风速突变","CATEGORY":"1"}
-        ,
-        {"SNAPID":"167","COUNT":"38","TIME":"57.917","WINDTURBINEID":"QG01_76","ALERTTEXT":"风速突变","CATEGORY":"1"}
-        ,
-        {"SNAPID":"168","COUNT":"31","TIME":"56.983","WINDTURBINEID":"QG01_79","ALERTTEXT":"风速突变","CATEGORY":"1"}
-        ,
-        {"SNAPID":"169","COUNT":"37","TIME":"55.767","WINDTURBINEID":"QG01_79","ALERTTEXT":"风速突变","CATEGORY":"1"}
-        ,
-        {"SNAPID":"170","COUNT":"69","TIME":"94.183","WINDTURBINEID":"XG01_21","ALERTTEXT":"齿轮箱油温度高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"171","COUNT":"2","TIME":"80.2","WINDTURBINEID":"XG01_06","ALERTTEXT":"齿轮箱油温度高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"172","COUNT":"8","TIME":"39.45","WINDTURBINEID":"XG01_04","ALERTTEXT":"齿轮箱油温度高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"173","COUNT":"4","TIME":"12.9","WINDTURBINEID":"XG01_18","ALERTTEXT":"齿轮箱油温度高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"174","COUNT":"2","TIME":"1.65","WINDTURBINEID":"SG01_25","ALERTTEXT":"齿轮箱油温度高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"175","COUNT":"98","TIME":"717.85","WINDTURBINEID":"XG01_09","ALERTTEXT":"齿轮箱温控阀故障或换热器效率低","CATEGORY":"2"}
-        ,
-        {"SNAPID":"176","COUNT":"145","TIME":"636.117","WINDTURBINEID":"XG01_05","ALERTTEXT":"齿轮箱温控阀故障或换热器效率低","CATEGORY":"2"}
-        ,
-        {"SNAPID":"177","COUNT":"220","TIME":"611.05","WINDTURBINEID":"XG01_01","ALERTTEXT":"齿轮箱温控阀故障或换热器效率低","CATEGORY":"2"}
-        ,
-        {"SNAPID":"178","COUNT":"177","TIME":"552.133","WINDTURBINEID":"XG01_08","ALERTTEXT":"齿轮箱温控阀故障或换热器效率低","CATEGORY":"2"}
-        ,
-        {"SNAPID":"179","COUNT":"127","TIME":"466.717","WINDTURBINEID":"XG01_06","ALERTTEXT":"齿轮箱温控阀故障或换热器效率低","CATEGORY":"2"}
-        ,
-        {"SNAPID":"180","COUNT":"103","TIME":"419.083","WINDTURBINEID":"XG01_13","ALERTTEXT":"齿轮箱温控阀故障或换热器效率低","CATEGORY":"2"}
-        ,
-        {"SNAPID":"181","COUNT":"26","TIME":"838.017","WINDTURBINEID":"XG01_09","ALERTTEXT":"齿轮箱轴承温升超过40度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"182","COUNT":"15","TIME":"820.867","WINDTURBINEID":"XG01_25","ALERTTEXT":"齿轮箱轴承温升超过40度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"183","COUNT":"17","TIME":"676.2","WINDTURBINEID":"XG01_08","ALERTTEXT":"齿轮箱轴承温升超过40度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"184","COUNT":"17","TIME":"658.5","WINDTURBINEID":"XG01_06","ALERTTEXT":"齿轮箱轴承温升超过40度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"185","COUNT":"39","TIME":"626.133","WINDTURBINEID":"XG01_12","ALERTTEXT":"齿轮箱轴承温升超过40度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"186","COUNT":"16","TIME":"27.183","WINDTURBINEID":"XG01_04","ALERTTEXT":"齿轮箱轴承温升速度超过1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"187","COUNT":"25","TIME":"26.8","WINDTURBINEID":"SG01_90","ALERTTEXT":"齿轮箱轴承温升速度超过1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"188","COUNT":"10","TIME":"26.517","WINDTURBINEID":"MG01_19","ALERTTEXT":"齿轮箱轴承温升速度超过1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"189","COUNT":"27","TIME":"25.717","WINDTURBINEID":"SG01_103","ALERTTEXT":"齿轮箱轴承温升速度超过1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"190","COUNT":"18","TIME":"25.467","WINDTURBINEID":"XG01_21","ALERTTEXT":"齿轮箱轴承温升速度超过1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"191","COUNT":"14","TIME":"25.35","WINDTURBINEID":"MG01_22","ALERTTEXT":"齿轮箱轴承温升速度超过1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"192","COUNT":"21","TIME":"23.4","WINDTURBINEID":"QG01_79","ALERTTEXT":"齿轮箱轴承温升速度超过1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"193","COUNT":"16","TIME":"23.317","WINDTURBINEID":"SG01_107","ALERTTEXT":"齿轮箱轴承温升速度超过1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"194","COUNT":"13","TIME":"21.65","WINDTURBINEID":"SG01_97","ALERTTEXT":"齿轮箱轴承温升速度超过1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"195","COUNT":"21","TIME":"20.483","WINDTURBINEID":"NG01_01","ALERTTEXT":"齿轮箱轴承温升速度超过1.5","CATEGORY":"1"}
-        ,
-        {"SNAPID":"196","COUNT":"17","TIME":"947.717","WINDTURBINEID":"XG01_25","ALERTTEXT":"齿轮箱轴承温差大于8度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"197","COUNT":"17","TIME":"947.717","WINDTURBINEID":"XG01_25","ALERTTEXT":"齿轮箱轴承温差大于8度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"198","COUNT":"14","TIME":"852.633","WINDTURBINEID":"XG01_35","ALERTTEXT":"齿轮箱轴承温差大于8度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"199","COUNT":"39","TIME":"756.067","WINDTURBINEID":"NG01_89","ALERTTEXT":"齿轮箱轴承温差大于8度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"200","COUNT":"29","TIME":"615.25","WINDTURBINEID":"XG01_09","ALERTTEXT":"齿轮箱轴承温差大于8度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"201","COUNT":"26","TIME":"604","WINDTURBINEID":"SG01_90","ALERTTEXT":"齿轮箱轴承温差大于8度","CATEGORY":"1"}
-        ,
-        {"SNAPID":"202","COUNT":"10","TIME":"328.7","WINDTURBINEID":"XG01_21","ALERTTEXT":"齿轮箱轴承温度高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"203","COUNT":"2","TIME":"80.667","WINDTURBINEID":"XG01_06","ALERTTEXT":"齿轮箱轴承温度高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"204","COUNT":"1","TIME":"72.733","WINDTURBINEID":"SG01_103","ALERTTEXT":"齿轮箱轴承温度高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"205","COUNT":"1","TIME":"71.067","WINDTURBINEID":"SG01_97","ALERTTEXT":"齿轮箱轴承温度高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"206","COUNT":"9","TIME":"60.95","WINDTURBINEID":"XG01_28","ALERTTEXT":"齿轮箱轴承温度高","CATEGORY":"1"}
-        ,
-        {"SNAPID":"207","COUNT":"9","TIME":"154.183","WINDTURBINEID":"SG01_71","ALERTTEXT":"齿轮箱高速轴轴温大于90度","CATEGORY":"1"}
-        
-        ]
-        
-}

+ 114 - 123
src/views/StatusBar.vue

@@ -2,10 +2,16 @@
 <template>
   <div class="status-bar" onselectstart="return false">
     <el-row>
-      <el-col :span="18" style="margin-top: 8px">
-        <span style="color: white; margin-left: 20px">系统时间:</span>
-        <span style="color: white">{{ currentTime }}</span>
+      <el-col :span="22" style="margin-top: 8px">
+        <div class="Bbox">
+          <span style="color: white; margin-left: 20px">系统时间:</span>
+          <span style="color: white">{{ currentTime }}</span>
+          <!-- <div class="bottom-right" @click="block">
+            <span>新增报警数量</span>
+          </div> -->
+        </div>
       </el-col>
+
       <!-- <el-col :span="6" style="margin-top: 8px">
         <el-popover placement="top-start" :width="580" trigger="hover" class="popoverBack" :show-arrow="false">
           <template #reference>
@@ -96,90 +102,75 @@
 </template>
 
 <script>
-  import BackgroundData from "utils/BackgroundData";
-  import WarningInfo from "utils/warningInfo";
-  export default {
-    data() {
-      return {
-        hiddenDangerNum: 0,
-        defectNum: 0,
-        malfunctionNum: 0,
-        accidentNum: 0,
-        statusTimer: "",
-        currentTime: "",
-        hiddenDangerData: new Array(),
-        defectData: new Array(),
-        malfunctionData: new Array(),
-        accidentData: new Array(),
-        // 定时器
-				timer: "",
-      };
-    },
-    mounted() {
-      let that = this;
-      this.statusTimer = setInterval(function () {
-        that.currentTime =
-          new Date().getFullYear() +
-          "-" +
-          that.appendZero(new Date().getMonth() + 1) +
-          "-" +
-          that.appendZero(new Date().getDate()) +
-          " " +
-          that.appendZero(new Date().getHours()) +
-          ":" +
-          that.appendZero(new Date().getMinutes()) +
-          ": " +
-          that.appendZero(new Date().getSeconds());
-      }, 1000);
-    },
-    beforeDestory() {
-      clearInterval(this.statusTimer);
-      this.statusTimer = null;
-    },
-    created() {
-      // this.WarningInfo = new WarningInfo();
-      // this.datas()
-      // this.refreshData()
+export default {
+  data() {
+    return {
+    
+      // hiddenDangerNum: 0,
+      // defectNum: 0,
+      // malfunctionNum: 0,
+      // accidentNum: 0,
+      statusTimer: "",
+      currentTime: "",
+      // hiddenDangerData: new Array(),
+      // defectData: new Array(),
+      // malfunctionData: new Array(),
+      // accidentData: new Array(),
+      // 定时器
+      timer: "",
+    };
+  },
+  mounted() {
+    let that = this;
+    this.statusTimer = setInterval(function () {
+      that.currentTime =
+        new Date().getFullYear() +
+        "-" +
+        that.appendZero(new Date().getMonth() + 1) +
+        "-" +
+        that.appendZero(new Date().getDate()) +
+        " " +
+        that.appendZero(new Date().getHours()) +
+        ":" +
+        that.appendZero(new Date().getMinutes()) +
+        ": " +
+        that.appendZero(new Date().getSeconds());
+    }, 1000);
+  },
+  beforeDestory() {
+    clearInterval(this.statusTimer);
+    this.statusTimer = null;
+  },
+  created() {
+    // this.refreshData()
+  },
+  methods: {
+    appendZero(obj) {
+      if (obj < 10) {
+        return "0" + obj;
+      } else {
+        return obj;
+      }
     },
-    methods: {
-      // datas() {
-      //   this.WarningInfo.warning.forEach(item => {
-      //     if (item.CATEGORY === "1") {
-      //       this.hiddenDangerData.push(item)
-      //     } else {
-      //       this.defectData.push(item)
-      //     }
-      //   })
-      //   console.log( this.hiddenDangerData,this.defectData)
-      // },
-      appendZero(obj) {
-        if (obj < 10) {
-          return "0" + obj;
-        } else {
-          return obj;
-        }
-      },
-      // refreshData() {
-      //   let bd = BackgroundData.getInstance();
-      //   this.hiddenDangerNum = bd.HiddenProblems.length;
-      //   this.defectNum = bd.Defects.length;
-      //   this.malfunctionNum = bd.Failure.length;
-      //   this.accidentNum = bd.Accidents.length;
-      //   // this.hiddenDangerData = bd.HiddenProblems;
-      //   // this.defectData = bd.Defects;
-      //   this.malfunctionData = bd.Failure;
-      //   this.accidentData = bd.Accidents;
-      //   this.timer = setTimeout(() => {
-      //     clearInterval(this.timer);
-      //     this.refreshData()
-      //   }, 5000);
-      // },
+    block() {
+      this.$emit("getData", true);
     },
-  };
+  },
+};
 </script>
 
 <style scoped>
-  /* :deep(.el-table__body-wrapper::-webkit-scrollbar) {
+.bottom-right {
+  display: inline-block;
+  position: absolute;
+  right: 0;
+  color: blue;
+}
+.Bbox {
+  display: block;
+  position: relative;
+}
+/* :deep(.el-table__body-wrapper::-webkit-scrollbar) {
     width: 8px;
     background-color: black;
   }
@@ -193,54 +184,54 @@
     border-bottom: 1px solid rgb(36, 36, 36);
   } */
 
-  span {
-    font-size: 13px;
-  }
+span {
+  font-size: 13px;
+}
 
-  .status-bar {
-    height: 4vh;
-    background-color: #191919;
+.status-bar {
+  height: 4vh;
+  background-color: #191919;
 
-    margin-bottom: 0;
-    margin-left: 0;
-    margin-right: 0;
-  }
+  margin-bottom: 0;
+  margin-left: 0;
+  margin-right: 0;
+}
 
-  .status-list {
-    position: relative;
-    display: inline-block;
-    box-sizing: border-box;
-    color: white;
-  }
+.status-list {
+  position: relative;
+  display: inline-block;
+  box-sizing: border-box;
+  color: white;
+}
 
-  .status-label {
-    margin-left: 10px;
-    margin-right: 10px;
-  }
+.status-label {
+  margin-left: 10px;
+  margin-right: 10px;
+}
 
-  .status-img {
-    position: relative;
-    top: 4px;
-    margin-left: 20px;
-    width: 20px;
-  }
+.status-img {
+  position: relative;
+  top: 4px;
+  margin-left: 20px;
+  width: 20px;
+}
 
-  .status-label.hidden-danger {
-    color: #e6d541;
-  }
+.status-label.hidden-danger {
+  color: #e6d541;
+}
 
-  .status-label.defect {
-    color: #e69641;
-  }
+.status-label.defect {
+  color: #e69641;
+}
 
-  .status-label.malfunction {
-    color: #d541e6;
-  }
+.status-label.malfunction {
+  color: #d541e6;
+}
 
-  .status-label.accident {
-    color: #af3e3d;
-  }
-  .popoverBack{
-    background-color: #000000;
-  }
+.status-label.accident {
+  color: #af3e3d;
+}
+.popoverBack {
+  background-color: #000000;
+}
 </style>

+ 9 - 5
src/views/TitleBar.vue

@@ -41,7 +41,6 @@
           <div class="titleinfo" @dblclick="dbClicks(titleInfo.dailyPowerGeneration,'日发电量')">
             <ul>
               <li>
-                <!-- <TitleBarCard title="装机容量" unit="MW" :value="installedCapacity"></TitleBarCard> -->
                 <span class="showTitle">日发电量</span>
                 <span class="showvalue">{{titleInfo.dailyPowerGeneration?.value?.toFixed(2)}}</span>
                 <span class="showTitle">万kW/h</span>
@@ -51,7 +50,6 @@
           <div class="titleinfo" @dblclick="dbClicks(titleInfo.powerLossFault,'故障损失')">
             <ul>
               <li>
-                <!-- <TitleBarCard title="实时功率" unit="MW" :value="totalPower"></TitleBarCard> -->
                 <span class="showTitle">故障损失</span>
                 <span
                   :class="titleInfo.powerLossFault?(titleInfo.powerLossFault.trend === 'Counterpoise'?'showvalue':titleInfo.powerLossFault.trend === 'Rise'?'showvalue-up':'showvalue-down'):''">{{titleInfo.powerLossFault?.value.toFixed(2)}}</span>
@@ -62,7 +60,6 @@
           <div class="titleinfo" @dblclick="dbClicks(titleInfo.powerLossRestrictions,'限电损失')">
             <ul>
               <li>
-                <!-- <TitleBarCard title="日发电量" unit="kWh" :value="dailyPowerGeneration"></TitleBarCard> -->
                 <span class="showTitle">限电损失</span>
                 <span
                   :class="titleInfo.powerLossRestrictions?(titleInfo.powerLossRestrictions.trend === 'Counterpoise'?'showvalue':titleInfo.powerLossRestrictions.trend === 'Rise'?'showvalue-up':'showvalue-down'):''">{{titleInfo.powerLossRestrictions?.value.toFixed(2)}}</span>
@@ -136,7 +133,6 @@
 </template>
 
 <script>
-  import TitleBarCard from "components/TitleBarCard.vue";
   import BackgroundData from "utils/BackgroundData";
   import MessageBridge from 'utils/MessageBridge'
   import DataDetails from "components/basicDataDetails.vue";
@@ -145,7 +141,6 @@
   export default {
     name: "TitleBar",
     components: {
-      TitleBarCard,
       DataDetails
     },
     data() {
@@ -192,7 +187,13 @@
     },
     created() {
       // this.refreshTimer = setInterval(this.refreshData, 2000);
+      if(sessionStorage.getItem("ms_username") && sessionStorage.getItem("ms_password")){
+        this.form.name = sessionStorage.getItem("ms_username") 
+        this.form.psd = sessionStorage.getItem("ms_password")
+        this.login()
+      }
       this.initData()
+      
     },
     methods: {
       initData() {
@@ -256,8 +257,11 @@
           this.loginMessage = msg.message;
           return;
         }
+        sessionStorage.setItem("ms_username", this.form.name);
+        sessionStorage.setItem("ms_password", this.form.psd);
         let user = msg.data;
         this.$store.commit('token', user.token)
+
         BackgroundData.getInstance().LoginUser = user;
         this.usreName = user.name;
         this.dialogVisible = false;