Pārlūkot izejas kodu

健康矩阵-进入单机页面。页面增加风机下拉选择框

wsy 4 gadi atpakaļ
vecāks
revīzija
253eca7da1

+ 90 - 89
package.json

@@ -1,89 +1,90 @@
-{
-  "name": "electronic-map",
-  "version": "0.1.0",
-  "private": true,
-  "scripts": {
-    "serve": "vue-cli-service serve",
-    "build": "vue-cli-service build",
-    "test:unit": "vue-cli-service test:unit",
-    "lint": "vue-cli-service lint"
-  },
-  "dependencies": {
-    "@antv/x6": "^1.24.4",
-    "@arcgis/core": "^4.19.3",
-    "axios": "^0.21.1",
-    "core-js": "^3.6.5",
-    "echarts": "^5.1.1",
-    "echarts-gl": "^2.0.4",
-    "element-plus": "^1.0.2-beta.53",
-    "file-saver": "^2.0.5",
-    "font-awesome": "^4.7.0",
-    "html2canvas": "^1.0.0-rc.7",
-    "jquery": "^3.6.0",
-    "jspdf": "^2.3.1",
-    "stompjs": "^2.3.3",
-    "three": "^0.129.0",
-    "vivus": "^0.4.6",
-    "vue": "^3.0.0",
-    "vue-axios": "^3.2.4",
-    "vue-router": "^4.0.0-0",
-    "vuex": "^4.0.0-0",
-    "xlsx": "^0.17.0"
-  },
-  "devDependencies": {
-    "@vue/cli-plugin-babel": "~4.5.0",
-    "@vue/cli-plugin-eslint": "~4.5.0",
-    "@vue/cli-plugin-router": "~4.5.0",
-    "@vue/cli-plugin-unit-mocha": "~4.5.0",
-    "@vue/cli-plugin-vuex": "~4.5.0",
-    "@vue/cli-service": "~4.5.0",
-    "@vue/compiler-sfc": "^3.0.0",
-    "@vue/test-utils": "^2.0.0-0",
-    "babel-eslint": "^10.1.0",
-    "chai": "^4.1.2",
-    "eslint": "^6.7.2",
-    "eslint-plugin-vue": "^7.0.0",
-    "less": "^3.0.4",
-    "less-loader": "^5.0.0",
-    "sass": "^1.27.0",
-    "sass-loader": "^10.0.4",
-    "script-loader": "^0.7.2",
-    "style-resources-loader": "^1.4.1",
-    "svg-sprite-loader": "^6.0.7",
-    "svgo-loader": "^3.0.0"
-  },
-  "eslintConfig": {
-    "root": true,
-    "env": {
-      "node": true
-    },
-    "extends": [
-      "plugin:vue/vue3-essential",
-      "eslint:recommended"
-    ],
-    "parserOptions": {
-      "parser": "babel-eslint"
-    },
-    "rules": {
-      "no-debugger": "off",
-      "no-console": "off",
-      "no-unused-vars": "off"
-    },
-    "overrides": [
-      {
-        "files": [
-          "**/__tests__/*.{j,t}s?(x)",
-          "**/tests/unit/**/*.spec.{j,t}s?(x)"
-        ],
-        "env": {
-          "mocha": true
-        }
-      }
-    ]
-  },
-  "browserslist": [
-    "> 1%",
-    "last 2 versions",
-    "not dead"
-  ]
-}
+{
+  "name": "electronic-map",
+  "version": "0.1.0",
+  "private": true,
+  "scripts": {
+    "serve": "vue-cli-service serve",
+    "servebig": "node --max-old-space-size=6000  ./node_modules/@vue/cli-service/bin/vue-cli-service.js serve",
+    "build": "vue-cli-service build",
+    "test:unit": "vue-cli-service test:unit",
+    "lint": "vue-cli-service lint"
+  },
+  "dependencies": {
+    "@antv/x6": "^1.24.4",
+    "@arcgis/core": "^4.19.3",
+    "axios": "^0.21.1",
+    "core-js": "^3.6.5",
+    "echarts": "^5.1.1",
+    "echarts-gl": "^2.0.4",
+    "element-plus": "^1.0.2-beta.53",
+    "file-saver": "^2.0.5",
+    "font-awesome": "^4.7.0",
+    "html2canvas": "^1.0.0-rc.7",
+    "jquery": "^3.6.0",
+    "jspdf": "^2.3.1",
+    "stompjs": "^2.3.3",
+    "three": "^0.129.0",
+    "vivus": "^0.4.6",
+    "vue": "^3.0.0",
+    "vue-axios": "^3.2.4",
+    "vue-router": "^4.0.0-0",
+    "vuex": "^4.0.0-0",
+    "xlsx": "^0.17.0"
+  },
+  "devDependencies": {
+    "@vue/cli-plugin-babel": "~4.5.0",
+    "@vue/cli-plugin-eslint": "~4.5.0",
+    "@vue/cli-plugin-router": "~4.5.0",
+    "@vue/cli-plugin-unit-mocha": "~4.5.0",
+    "@vue/cli-plugin-vuex": "~4.5.0",
+    "@vue/cli-service": "~4.5.0",
+    "@vue/compiler-sfc": "^3.0.0",
+    "@vue/test-utils": "^2.0.0-0",
+    "babel-eslint": "^10.1.0",
+    "chai": "^4.1.2",
+    "eslint": "^6.7.2",
+    "eslint-plugin-vue": "^7.0.0",
+    "less": "^3.0.4",
+    "less-loader": "^5.0.0",
+    "sass": "^1.27.0",
+    "sass-loader": "^10.0.4",
+    "script-loader": "^0.7.2",
+    "style-resources-loader": "^1.4.1",
+    "svg-sprite-loader": "^6.0.7",
+    "svgo-loader": "^3.0.0"
+  },
+  "eslintConfig": {
+    "root": true,
+    "env": {
+      "node": true
+    },
+    "extends": [
+      "plugin:vue/vue3-essential",
+      "eslint:recommended"
+    ],
+    "parserOptions": {
+      "parser": "babel-eslint"
+    },
+    "rules": {
+      "no-debugger": "off",
+      "no-console": "off",
+      "no-unused-vars": "off"
+    },
+    "overrides": [
+      {
+        "files": [
+          "**/__tests__/*.{j,t}s?(x)",
+          "**/tests/unit/**/*.spec.{j,t}s?(x)"
+        ],
+        "env": {
+          "mocha": true
+        }
+      }
+    ]
+  },
+  "browserslist": [
+    "> 1%",
+    "last 2 versions",
+    "not dead"
+  ]
+}

+ 70 - 0
src/components/coms/wt-chooser/wt-chooser.vue

@@ -0,0 +1,70 @@
+<template>
+  <div class="query mg-b-8">
+    <div class="query-items">
+      <div class="query-item">
+        <div class="lable">风场:</div>
+        <div class="search-input">
+          <el-select v-model="wpId" clearable placeholder="请选择风场" popper-class="select" @change="getWtList">
+            <el-option v-for="item in wpList" :key="item.id" :label="item.name" :value="item.id">
+            </el-option>
+          </el-select>
+        </div>
+      </div>
+      <div class="query-item">
+        <div class="lable">风机:</div>
+        <div class="search-input">
+          <el-select v-model="wtId" clearable placeholder="请选择风机" popper-class="select" @change="wtChange">
+            <el-option v-for="item in wtList" :key="item.id" :label="item.name" :value="item.id">
+            </el-option>
+          </el-select>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  // 传参
+  props: {
+    wpId: { type: String, default: "MHS_FDC" },
+    wtId: { type: String, default: "MG01_01" },
+  },
+  // 事件
+  emits: {
+  },
+  data() {
+    return {
+      wpList: [],
+      wtList: [],
+    };
+  },
+  created() {
+    this.getWpList();
+    this.getWtList();
+  },
+  methods: {
+    async getWpList() {
+      const { data } = await this.API.requestData({
+        subUrl: "powercompare/windfarmAjax",
+      });
+      this.wpList = data.data;
+    },
+    async getWtList() {
+      const { data } = await this.API.requestData({
+        subUrl: "powercompare/windturbineAjax",
+        data: {
+          wpId: this.wpId,
+        },
+      });
+      this.wtList = data.data;
+    },
+    wtChange() {
+      this.$emit("change", { wtId: this.wtId, wpId: this.wpId });
+    },
+  },
+};
+</script>
+
+<style lang="less">
+</style>

+ 859 - 852
src/views/HealthControl/Health10.vue

@@ -1,852 +1,859 @@
-<template>
-  <div class="health-10">
-    <el-row :gutter="20" class="table-panel">
-      <el-col :span="6">
-        <panel :title="'等级评价'" :showLine="false">
-          <Table :data="top5Table" :canScroll="false" />
-        </panel>
-      </el-col>
-      <el-col :span="6">
-        <panel :title="'健康报告'" :showLine="false">
-          <Table :data="dateTable" :canScroll="false" />
-        </panel>
-      </el-col>
-      <el-col :span="12" class="wrong-list">
-        <panel :title="'故障信息'" :showLine="false">
-          <div class="data-list" style="display: flex">
-            <Table :data="top10TableLeft" :canScroll="false" />
-            <Table :data="top10TableRight" :canScroll="false" />
-          </div>
-        </panel>
-      </el-col>
-    </el-row>
-    <el-row :gutter="20" class="table-chart">
-      <el-col :span="12">
-        <panel :title="'八大部件'" :showLine="false">
-          <div class="table">
-            <table style="width: 100%" border="0" cellspacing="0">
-              <thead>
-                <tr>
-                  <th rowspan="1" class="type1" style="width: 50px"></th>
-                  <th rowspan="1" class="type1" style="width: 105px">健康度</th>
-                  <th rowspan="2" class="type1" style="width: 400px">
-                    MTBF(H/H)
-                  </th>
-                  <th rowspan="1" class="type1" style="width: 180px"></th>
-                  <th rowspan="1" class="type1" style="width: 100px">
-                    MTTR(H)
-                  </th>
-                </tr>
-              </thead>
-            </table>
-            <el-scrollbar>
-              <div style="height: calc(100vh - 174px)">
-                <table style="width: 100%" border="0" cellspacing="0">
-                  <tbody>
-                    <tr v-for="(item, index) of partsArray" :key="index">
-                      <td style="width: 50px">
-                        {{ item[1] }}
-                      </td>
-                      <td style="width: 105px">
-                        <div
-                          :style="
-                            'background-color: ' +
-                            item[0] +
-                            ';width:10px;height:10px;margin:0 auto;'
-                          "
-                        ></div>
-                      </td>
-                      <td style="width: 400px">
-                        <div class="percent-item">
-                          {{ item[3] }}%
-                          <div class="percent-bar" style="margin-right: 4px">
-                            <div
-                              class="percent-value"
-                              :style="'width:' + item[3] + '%'"
-                            ></div>
-                          </div>
-                          <!-- 剩余9999/建个故障9999 -->
-                          {{ item[4] }}
-                        </div>
-                      </td>
-                      <td style="width: 200px">
-                        <table-line-chart :height="'20px'" :list="item[8]" />
-                      </td>
-                      <td style="width: #00bf4d">
-                        {{ item[6] }}
-                      </td>
-                    </tr>
-                  </tbody>
-                </table>
-              </div>
-            </el-scrollbar>
-          </div>
-        </panel>
-      </el-col>
-      <el-col :span="12">
-        <div class="chart-title">
-          <div class="title-panel" style="">
-            <span style="text-align: left; padding-left: 20px; font-size: 12px"
-              >故障信息
-            </span>
-            <span class="des-title"
-              >预计损失电量<span class="num">73824.0</span
-              ><span class="unit">Kwh</span></span
-            >
-            <span class="des-title"
-              >预计检修时长<span class="num">29.33</span
-              ><span class="unit">H</span></span
-            >
-          </div>
-          <img-line-chart
-            height="270px"
-          />
-        </div>
-      </el-col>
-    </el-row>
-    <div class="fc-info mg-b-16">
-      <panel :title="'曲线'" :showLine="false">
-        <zoom-line-chart
-          height="35vh"
-          :list="powerChartData.value"
-          :units="powerChartData.units"
-        />
-      </panel>
-    </div>
-    <HealthReport
-      :show="healthReportShow"
-      :params="{ wtId: this.wtId, recorddate: this.recorddate }"
-      @closed="
-        (res) => {
-          this.healthReportShow = false;
-        }
-      "
-    />
-  </div>
-</template>
-
-<script>
-// import NormalLineChart from "../../components/chart/line/normal-line-chart.vue";
-// import SvgIcon from "../../components/coms/icon/svg-icon.vue";SvgIcon,
-import Panel from "../../components/coms/panel/panel.vue";
-import Table from "../../components/coms/table/table.vue";
-import TableLineChart from "../../components/chart/line/table-line-chart.vue";
-// import StrightLineChart from "../../components/chart/line/stright-line-chart.vue";
-import ImgLineChart from "../../components/chart/line/img-line-chart.vue";
-import ZoomLineChart from "../../components/chart/line/zoom-line-chart.vue";
-import HealthReport from "@com/other/healthReport/index.vue";
-
-export default {
-  setup() {},
-  components: {
-    Panel,
-    Table,
-    TableLineChart,
-    ImgLineChart,
-    ZoomLineChart,
-    HealthReport
-  },
-  data() {
-    const that = this;
-    return {
-      top5Table: {
-        column: [
-          {
-            name: "排名",
-            field: "index",
-            width: "10%",
-          },
-          {
-            name: "日期",
-            field: "date",
-            width: "45%",
-          },
-          {
-            name: "等级",
-            field: "rank",
-            width: "45%",
-          },
-        ],
-        data: [],
-      },
-      dateTable: {
-        column: [
-          {
-            name: "排名",
-            field: "index",
-            width: "10%",
-          },
-          {
-            name: "日期",
-            field: "date",
-            width: "60%",
-          },
-          {
-            name: "健康情况",
-            field: "",
-            width: "30%",
-            template() {
-              return "<div style='border: 1px solid #182238;background: #303f6e;width: 70%;margin: 0 auto;color:#FFF;cursor: pointer;'>查看报告</div>";
-            },
-            click(e,row) {
-              that.recorddate = row.date;
-              that.healthReportShow = true;
-            },
-          },
-        ],
-        data: [],
-      },
-      top10TableLeft: {
-        column: [
-          {
-            name: "排名",
-            field: "index",
-            width: "8%",
-          },
-          {
-            name: "故障名称",
-            field: "warnDesc",
-          },
-          {
-            name: "故障时间",
-            field: "startTime",
-            width: "35%",
-          },
-          {
-            name: "修复时间",
-            field: "stopTime",
-          },
-          {
-            name: "时长",
-            field: "stopHours",
-          },
-        ],
-        data: [],
-      },
-      top10TableRight: {
-        column: [
-          {
-            name: "排名",
-            field: "index",
-            width: "8%",
-          },
-          {
-            name: "故障名称",
-            field: "warnDesc",
-          },
-          {
-            name: "故障时间",
-            field: "startTime",
-            width: "35%",
-          },
-          {
-            name: "修复时间",
-            field: "stopTime",
-          },
-          {
-            name: "时长",
-            field: "stopHours",
-          },
-        ],
-        data: [],
-      },
-      partsArray: [],
-      tableData4: {
-        column: [
-          {
-            name: " ",
-            field: "name",
-            width: "8%",
-          },
-          {
-            name: "故障名称",
-            field: "v1",
-            template: function (data) {
-              return (
-                "<div style='overflow: hidden;text-overflow:ellipsis;white-space: nowrap;'>" +
-                data +
-                "</div>"
-              );
-            },
-          },
-          {
-            name: "故障时间",
-            field: "v2",
-            width: "35%",
-          },
-          {
-            name: "修复时间",
-            field: "v3",
-          },
-          {
-            name: "时长",
-            field: "v4",
-          },
-        ],
-        data: [
-          {
-            name: "1",
-            v1: "风机叶轮刹车系统",
-            v2: "2018-05-31 16:28:38",
-            v3: "2018-05-31",
-            v4: "0.09",
-          },
-          {
-            name: "2",
-            v1: "风机叶轮刹车系统",
-            v2: "2018-05-31 16:28:38",
-            v3: "2018-05-31",
-            v4: "0.09",
-          },
-          {
-            name: "3",
-            v1: "风机叶轮刹车系统",
-            v2: "2018-05-31 16:28:38",
-            v3: "2018-05-31",
-            v4: "0.09",
-          },
-          {
-            name: "4",
-            v1: "风机叶轮刹车系统",
-            v2: "2018-05-31 16:28:38",
-            v3: "2018-05-31",
-            v4: "0.09",
-          },
-          {
-            name: "5",
-            v1: "风机叶轮刹车系统",
-            v2: "2018-05-31 16:28:38",
-            v3: "2018-05-31",
-            v4: "0.09",
-          },
-        ],
-      },
-      // 月发电量对比
-      weatherChart: {
-        units: ["功率", "风速"],
-        value: [
-          {
-            title: "应发功率",
-            yAxisIndex: 1,
-            value: [
-              {
-                text: "05-02 00:00",
-                value: 11,
-                weather: "sun",
-                direction: "n",
-              },
-              {
-                text: "05-04 00:00",
-                value: 11,
-                weather: "rain",
-                direction: "s",
-              },
-              {
-                text: "05-06 00:00",
-                value: 13,
-                weather: "sun",
-                direction: "w",
-              },
-              {
-                text: "05-08 00:00",
-                value: 12,
-                weather: "cloud",
-                direction: "e",
-              },
-              {
-                text: "05-10 00:00",
-                value: 13,
-                weather: "sun",
-                direction: "nw",
-              },
-              {
-                text: "05-12 00:00",
-                value: 12,
-                weather: "sun",
-                direction: "ne",
-              },
-              {
-                text: "05-14 00:00",
-                value: 11,
-                weather: "cloud",
-                direction: "sw",
-              },
-              {
-                text: "05-16 00:00",
-                value: 11,
-                weather: "sun",
-                direction: "se",
-              },
-              {
-                text: "05-18 00:00",
-                value: 13,
-                weather: "rain",
-                direction: "n",
-              },
-              {
-                text: "05-20 00:00",
-                value: 11,
-                weather: "cloud",
-                direction: "n",
-              },
-              {
-                text: "05-22 00:00",
-                value: 12,
-                weather: "sun",
-                direction: "n",
-              },
-            ],
-          },
-          {
-            title: "实际功率",
-            yAxisIndex: 1,
-            value: [
-              {
-                text: "05-02 00:00",
-                value: 1,
-              },
-              {
-                text: "05-04 00:00",
-                value: 3,
-              },
-              {
-                text: "05-06 00:00",
-                value: 4,
-              },
-              {
-                text: "05-08 00:00",
-                value: 1,
-              },
-              {
-                text: "05-10 00:00",
-                value: 3,
-              },
-              {
-                text: "05-12 00:00",
-                value: 5,
-              },
-              {
-                text: "05-14 00:00",
-                value: 1,
-              },
-              {
-                text: "05-16 00:00",
-                value: 5,
-              },
-              {
-                text: "05-18 00:00",
-                value: 4,
-              },
-              {
-                text: "05-20 00:00",
-                value: 1,
-              },
-              {
-                text: "05-22 00:00",
-                value: 3,
-              },
-            ],
-          },
-        ],
-      },
-      powerChartData: {
-        units: [""],
-        value: [
-          {
-            title: "",
-            yAxisIndex: 0,
-            value: [],
-          },
-        ],
-      },
-      healthReportShow: false,
-    };
-  },
-
-  created() {
-    this.wpId = this.$route.params.wpId;
-    this.wtId = this.$route.params.wtId;
-    this.getTop5();
-    this.renderDateTable();
-    this.getTop10();
-    this.getMtbfByBj();
-    this.getFindPowerChar();
-    this.getWeather();
-  },
-
-  methods: {
-    // 获取等级评价
-    getTop5() {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: "healthsub/gadaytop5",
-        data: {
-          wtId: that.wtId,
-        },
-        success(res) {
-          let top5TableData = [];
-          let index = 1;
-          for (let key in res.data) {
-            let ele = res.data[key];
-            top5TableData.push({
-              index,
-              date: ele[1],
-              rank: ele[2],
-              wpId: ele[3],
-              wtId: ele[4],
-            });
-            index++;
-          }
-          that.top5Table.data = top5TableData;
-        },
-      });
-    },
-
-    // 渲染健康报告表格
-    renderDateTable(day = 5) {
-      let tableData = [];
-      for (let i = 0; i < day; i++) {
-        tableData.push({
-          index: i + 1,
-          date: new Date(
-            new Date().getTime() - 3600 * 1000 * 24 * (i + 1)
-          ).formatDate("yyyy-MM-dd hh:mm:ss"),
-          wtId: this.wtId,
-        });
-      }
-      this.dateTable.data = tableData;
-    },
-
-    // 获取等级评价
-    getTop10() {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: "healthsub/queryStopTop10",
-        data: {
-          wtId: that.wtId,
-        },
-        success(res) {
-          let leftData = [];
-          let rightData = [];
-
-          res.data.forEach((ele, index) => {
-            const item = {
-              index: index + 1,
-              warnDesc: ele.warnDesc,
-              startTime: new Date(ele.startTime).formatDate(
-                "yyyy-MM-dd hh:mm:ss"
-              ),
-              stopTime: new Date(ele.stopTime).formatDate(
-                "yyyy-MM-dd hh:mm:ss"
-              ),
-              stopHours: ele.stopHours,
-            };
-            if (index < 5) {
-              leftData.push(item);
-            } else {
-              rightData.push(item);
-            }
-          });
-
-          that.top10TableLeft.data = leftData;
-          that.top10TableRight.data = rightData;
-        },
-      });
-    },
-
-    // 获取八大部件
-    getMtbfByBj() {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: "healthsub/getWtMttrandMtbfByBj",
-        data: {
-          wtId: that.wtId,
-        },
-        success(res) {
-          let partsArray = [];
-          for (let key in res.data) {
-            let linChartData = [];
-            res.data[key][2].split(",").forEach((ele, index) => {
-              linChartData.push({
-                text: index + 1,
-                value: ele,
-              });
-            });
-            res.data[key].push(linChartData);
-            partsArray.push(res.data[key]);
-          }
-          that.partsArray = partsArray;
-        },
-      });
-    },
-
-    // 获取发电曲线
-    getFindPowerChar() {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: "healthsub/findPowerChar",
-        data: {
-          wtId: that.wtId,
-        },
-        success(res) {
-          let chartUnits = ["(WM)", "(m/s)"];
-          let chartData = [
-            {
-              title: "理论功率",
-              yAxisIndex: 0,
-              value: [],
-            },
-            {
-              title: "实际功率",
-              yAxisIndex: 0,
-              value: [],
-            },
-            {
-              title: "实时风速",
-              yAxisIndex: 1,
-              value: [],
-            },
-          ];
-
-          res.data.timearr.forEach((time, index) => {
-            chartData[0].value.push({
-              text: new Date(time).formatDate("MM-dd hh:mm"),
-              value: res.data.llgl[index],
-            });
-            chartData[1].value.push({
-              text: new Date(time).formatDate("MM-dd hh:mm"),
-              value: res.data.sjgl[index],
-            });
-            chartData[2].value.push({
-              text: new Date(time).formatDate("MM-dd hh:mm"),
-              value: res.data.ssfs[index],
-            });
-          });
-          that.powerChartData.value = chartData;
-          that.powerChartData.units = chartUnits;
-        },
-      });
-    },
-
-    // 获取天气信息
-    getWeather() {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: "healthsub/getWeatherRealDay5Info",
-        data: {
-          wpId: that.wpId,
-        },
-        success(res) {
-          console.log(123123, res);
-          let weatherChart = [];
-
-          let chartUnits = ["(m/s)", "(℃)"];
-          let chartData = [
-            {
-              title: "风速",
-              yAxisIndex: 0,
-              value: [],
-            },
-            {
-              title: "温度",
-              yAxisIndex: 1,
-              value: [],
-            },
-          ];
-
-          res.data.ls.forEach((item) => {
-            chartData[0].value.push({
-              text: "05-02 00:00",
-              value: 11,
-              weather: "sun",
-              direction: "n",
-            });
-          });
-        },
-      });
-    },
-  },
-};
-</script>
-
-<style lang="less">
-.health-10 {
-  font-size: 12px;
-  .com-table {
-    tbody tr td {
-      padding: 0;
-      height: 30px;
-    }
-  }
-
-  .table {
-    tbody {
-      td {
-        padding: 0;
-        height: 30px;
-      }
-      tr:nth-child(2n) td {
-        background-color: fade(@gray, 20%);
-
-        &.item {
-          background-color: transparent;
-        }
-      }
-    }
-
-    th {
-      background: fade(@gray, 40);
-      font-size: 12px;
-      font-weight: 400;
-      line-height: 24px;
-      color: @gray-l;
-      border: 2px solid #07140f;
-
-      &.type1 {
-        border-left: 0;
-        border-right: 0;
-      }
-    }
-    td {
-      color: @gray-l;
-      text-align: center;
-      height: 26px;
-      line-height: 26px;
-
-      &.item {
-        width: 100px;
-        div {
-          color: @white;
-          background: fade(@gray, 20);
-          margin: 2px;
-          border: 1px solid transparent;
-        }
-      }
-    }
-
-    .percent-item {
-      display: flex;
-      align-items: center;
-      justify-content: center;
-      height: 30px;
-
-      .percent-bar {
-        height: 12px;
-        width: 170px;
-        background: transparent;
-        border: 1px solid @gray-l;
-        margin-left: 8px;
-
-        .percent-value {
-          height: calc(100% - 4px);
-          background: @green;
-          margin: 2px;
-        }
-      }
-    }
-
-    .score {
-      width: 100px;
-      div {
-        background: fade(@gray, 20);
-      }
-    }
-  }
-  .panel-header {
-    margin-bottom: 0;
-    .panel-title {
-      text-align: center;
-    }
-  }
-  .fc-info {
-    .panel-header {
-      margin-bottom: 8px;
-    }
-    .panel-title {
-      text-align: left;
-      padding-left: 20px;
-    }
-  }
-  .table-chart {
-    height: 312px;
-    .panel-title {
-      text-align: left;
-      padding-left: 20px;
-    }
-    .chart-title {
-      // color: rgba(255, 255, 255, 0.75);
-      color: @gray-l;
-      .title-panel {
-        height: 30px;
-        line-height: 30px;
-        margin-bottom: 8px;
-        background-color: #1e2524;
-        .des-title {
-          padding-left: 100px;
-        }
-        .num {
-          padding-left: 20px;
-          color: #05bb4c;
-          font-weight: 600;
-        }
-        .unit {
-          padding-left: 20px;
-        }
-      }
-    }
-  }
-  .table-panel .wrong-list {
-    .panel-title {
-      text-align: left;
-      padding-left: 20px;
-    }
-  }
-
-  .percent-item {
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    height: 34px;
-
-    .percent-bar {
-      height: 12px;
-      width: 170px;
-      background: transparent;
-      border: 1px solid @gray-l;
-      margin-left: 8px;
-
-      .percent-value {
-        height: calc(100% - 4px);
-        background: @green;
-        margin: 2px;
-      }
-    }
-  }
-  .score {
-    width: 100px;
-    div {
-      background: fade(@gray, 20);
-    }
-  }
-  .data-list {
-    .dot {
-      width: 12px;
-      height: 12px;
-      margin: auto;
-
-      &.green {
-        background: @green;
-      }
-
-      &.yellow {
-        background: @yellow;
-      }
-    }
-  }
-}
-</style>
+<template>
+  <div class="health-10">
+    <wt-chooser @change="switchWt" :wpId="wpId" :wtId="wtId"></wt-chooser>
+    <el-row :gutter="20" class="table-panel">
+      <el-col :span="6">
+        <panel :title="'等级评价'" :showLine="false">
+          <Table :data="top5Table" :canScroll="false" />
+        </panel>
+      </el-col>
+      <el-col :span="6">
+        <panel :title="'健康报告'" :showLine="false">
+          <Table :data="dateTable" :canScroll="false" />
+        </panel>
+      </el-col>
+      <el-col :span="12" class="wrong-list">
+        <panel :title="'故障信息'" :showLine="false">
+          <div class="data-list" style="display: flex">
+            <Table :data="top10TableLeft" :canScroll="false" />
+            <Table :data="top10TableRight" :canScroll="false" />
+          </div>
+        </panel>
+      </el-col>
+    </el-row>
+    <el-row :gutter="20" class="table-chart">
+      <el-col :span="12">
+        <panel :title="'八大部件'" :showLine="false">
+          <div class="table">
+            <table style="width: 100%" border="0" cellspacing="0">
+              <thead>
+                <tr>
+                  <th rowspan="1" class="type1" style="width: 50px"></th>
+                  <th rowspan="1" class="type1" style="width: 105px">健康度</th>
+                  <th rowspan="2" class="type1" style="width: 400px">
+                    MTBF(H/H)
+                  </th>
+                  <th rowspan="1" class="type1" style="width: 180px"></th>
+                  <th rowspan="1" class="type1" style="width: 100px">
+                    MTTR(H)
+                  </th>
+                </tr>
+              </thead>
+            </table>
+            <el-scrollbar>
+              <div style="height: calc(100vh - 174px)">
+                <table style="width: 100%" border="0" cellspacing="0">
+                  <tbody>
+                    <tr v-for="(item, index) of partsArray" :key="index">
+                      <td style="width: 50px">
+                        {{ item[1] }}
+                      </td>
+                      <td style="width: 105px">
+                        <div
+                          :style="
+                            'background-color: ' +
+                            item[0] +
+                            ';width:10px;height:10px;margin:0 auto;'
+                          "
+                        ></div>
+                      </td>
+                      <td style="width: 400px">
+                        <div class="percent-item">
+                          {{ item[3] }}%
+                          <div class="percent-bar" style="margin-right: 4px">
+                            <div
+                              class="percent-value"
+                              :style="'width:' + item[3] + '%'"
+                            ></div>
+                          </div>
+                          <!-- 剩余9999/建个故障9999 -->
+                          {{ item[4] }}
+                        </div>
+                      </td>
+                      <td style="width: 200px">
+                        <table-line-chart :height="'20px'" :list="item[8]" />
+                      </td>
+                      <td style="width: #00bf4d">
+                        {{ item[6] }}
+                      </td>
+                    </tr>
+                  </tbody>
+                </table>
+              </div>
+            </el-scrollbar>
+          </div>
+        </panel>
+      </el-col>
+      <el-col :span="12">
+        <div class="chart-title">
+          <div class="title-panel" style="">
+            <span style="text-align: left; padding-left: 20px; font-size: 12px"
+              >故障信息
+            </span>
+            <span class="des-title"
+              >预计损失电量<span class="num">73824.0</span
+              ><span class="unit">Kwh</span></span
+            >
+            <span class="des-title"
+              >预计检修时长<span class="num">29.33</span
+              ><span class="unit">H</span></span
+            >
+          </div>
+          <img-line-chart
+            height="270px"
+          />
+        </div>
+      </el-col>
+    </el-row>
+    <div class="fc-info mg-b-16">
+      <panel :title="'曲线'" :showLine="false">
+        <zoom-line-chart
+          height="35vh"
+          :list="powerChartData.value"
+          :units="powerChartData.units"
+        />
+      </panel>
+    </div>
+    <HealthReport
+      :show="healthReportShow"
+      :params="{ wtId: this.wtId, recorddate: this.recorddate }"
+      @closed="
+        (res) => {
+          this.healthReportShow = false;
+        }
+      "
+    />
+  </div>
+</template>
+
+<script>
+import Panel from "../../components/coms/panel/panel.vue";
+import Table from "../../components/coms/table/table.vue";
+import TableLineChart from "../../components/chart/line/table-line-chart.vue";
+import ImgLineChart from "../../components/chart/line/img-line-chart.vue";
+import ZoomLineChart from "../../components/chart/line/zoom-line-chart.vue";
+import HealthReport from "@com/other/healthReport/index.vue";
+import WtChooser from "@com/coms/wt-chooser/wt-chooser.vue"
+
+export default {
+  setup() {},
+  components: {
+    Panel,
+    Table,
+    TableLineChart,
+    ImgLineChart,
+    ZoomLineChart,
+    HealthReport,
+    WtChooser
+  },
+  data() {
+    const that = this;
+    return {
+      top5Table: {
+        column: [
+          {
+            name: "排名",
+            field: "index",
+            width: "10%",
+          },
+          {
+            name: "日期",
+            field: "date",
+            width: "45%",
+          },
+          {
+            name: "等级",
+            field: "rank",
+            width: "45%",
+          },
+        ],
+        data: [],
+      },
+      dateTable: {
+        column: [
+          {
+            name: "排名",
+            field: "index",
+            width: "10%",
+          },
+          {
+            name: "日期",
+            field: "date",
+            width: "60%",
+          },
+          {
+            name: "健康情况",
+            field: "",
+            width: "30%",
+            template() {
+              return "<div style='border: 1px solid #182238;background: #303f6e;width: 70%;margin: 0 auto;color:#FFF;cursor: pointer;'>查看报告</div>";
+            },
+            click(e,row) {
+              that.recorddate = row.date;
+              that.healthReportShow = true;
+            },
+          },
+        ],
+        data: [],
+      },
+      top10TableLeft: {
+        column: [
+          {
+            name: "排名",
+            field: "index",
+            width: "8%",
+          },
+          {
+            name: "故障名称",
+            field: "warnDesc",
+          },
+          {
+            name: "故障时间",
+            field: "startTime",
+            width: "35%",
+          },
+          {
+            name: "修复时间",
+            field: "stopTime",
+          },
+          {
+            name: "时长",
+            field: "stopHours",
+          },
+        ],
+        data: [],
+      },
+      top10TableRight: {
+        column: [
+          {
+            name: "排名",
+            field: "index",
+            width: "8%",
+          },
+          {
+            name: "故障名称",
+            field: "warnDesc",
+          },
+          {
+            name: "故障时间",
+            field: "startTime",
+            width: "35%",
+          },
+          {
+            name: "修复时间",
+            field: "stopTime",
+          },
+          {
+            name: "时长",
+            field: "stopHours",
+          },
+        ],
+        data: [],
+      },
+      partsArray: [],
+      tableData4: {
+        column: [
+          {
+            name: " ",
+            field: "name",
+            width: "8%",
+          },
+          {
+            name: "故障名称",
+            field: "v1",
+            template: function (data) {
+              return (
+                "<div style='overflow: hidden;text-overflow:ellipsis;white-space: nowrap;'>" +
+                data +
+                "</div>"
+              );
+            },
+          },
+          {
+            name: "故障时间",
+            field: "v2",
+            width: "35%",
+          },
+          {
+            name: "修复时间",
+            field: "v3",
+          },
+          {
+            name: "时长",
+            field: "v4",
+          },
+        ],
+        data: [
+          {
+            name: "1",
+            v1: "风机叶轮刹车系统",
+            v2: "2018-05-31 16:28:38",
+            v3: "2018-05-31",
+            v4: "0.09",
+          },
+          {
+            name: "2",
+            v1: "风机叶轮刹车系统",
+            v2: "2018-05-31 16:28:38",
+            v3: "2018-05-31",
+            v4: "0.09",
+          },
+          {
+            name: "3",
+            v1: "风机叶轮刹车系统",
+            v2: "2018-05-31 16:28:38",
+            v3: "2018-05-31",
+            v4: "0.09",
+          },
+          {
+            name: "4",
+            v1: "风机叶轮刹车系统",
+            v2: "2018-05-31 16:28:38",
+            v3: "2018-05-31",
+            v4: "0.09",
+          },
+          {
+            name: "5",
+            v1: "风机叶轮刹车系统",
+            v2: "2018-05-31 16:28:38",
+            v3: "2018-05-31",
+            v4: "0.09",
+          },
+        ],
+      },
+      // 月发电量对比
+      weatherChart: {
+        units: ["功率", "风速"],
+        value: [
+          {
+            title: "应发功率",
+            yAxisIndex: 1,
+            value: [
+              {
+                text: "05-02 00:00",
+                value: 11,
+                weather: "sun",
+                direction: "n",
+              },
+              {
+                text: "05-04 00:00",
+                value: 11,
+                weather: "rain",
+                direction: "s",
+              },
+              {
+                text: "05-06 00:00",
+                value: 13,
+                weather: "sun",
+                direction: "w",
+              },
+              {
+                text: "05-08 00:00",
+                value: 12,
+                weather: "cloud",
+                direction: "e",
+              },
+              {
+                text: "05-10 00:00",
+                value: 13,
+                weather: "sun",
+                direction: "nw",
+              },
+              {
+                text: "05-12 00:00",
+                value: 12,
+                weather: "sun",
+                direction: "ne",
+              },
+              {
+                text: "05-14 00:00",
+                value: 11,
+                weather: "cloud",
+                direction: "sw",
+              },
+              {
+                text: "05-16 00:00",
+                value: 11,
+                weather: "sun",
+                direction: "se",
+              },
+              {
+                text: "05-18 00:00",
+                value: 13,
+                weather: "rain",
+                direction: "n",
+              },
+              {
+                text: "05-20 00:00",
+                value: 11,
+                weather: "cloud",
+                direction: "n",
+              },
+              {
+                text: "05-22 00:00",
+                value: 12,
+                weather: "sun",
+                direction: "n",
+              },
+            ],
+          },
+          {
+            title: "实际功率",
+            yAxisIndex: 1,
+            value: [
+              {
+                text: "05-02 00:00",
+                value: 1,
+              },
+              {
+                text: "05-04 00:00",
+                value: 3,
+              },
+              {
+                text: "05-06 00:00",
+                value: 4,
+              },
+              {
+                text: "05-08 00:00",
+                value: 1,
+              },
+              {
+                text: "05-10 00:00",
+                value: 3,
+              },
+              {
+                text: "05-12 00:00",
+                value: 5,
+              },
+              {
+                text: "05-14 00:00",
+                value: 1,
+              },
+              {
+                text: "05-16 00:00",
+                value: 5,
+              },
+              {
+                text: "05-18 00:00",
+                value: 4,
+              },
+              {
+                text: "05-20 00:00",
+                value: 1,
+              },
+              {
+                text: "05-22 00:00",
+                value: 3,
+              },
+            ],
+          },
+        ],
+      },
+      powerChartData: {
+        units: [""],
+        value: [
+          {
+            title: "",
+            yAxisIndex: 0,
+            value: [],
+          },
+        ],
+      },
+      healthReportShow: false,
+    };
+  },
+
+  created() {
+    this.init();
+  },
+
+  methods: {
+    init(){
+      this.wpId = this.$route.params.wpId;
+      this.wtId = this.$route.params.wtId;
+      this.getTop5();
+      this.renderDateTable();
+      this.getTop10();
+      this.getMtbfByBj();
+      this.getFindPowerChar();
+      this.getWeather();
+    },
+    switchWt(data){
+      this.$router.push(`/health/health10/${data.wpId}/${data.wtId}`);
+      this.init();
+    },
+    // 获取等级评价
+    getTop5() {
+      let that = this;
+      that.API.requestData({
+        method: "POST",
+        subUrl: "healthsub/gadaytop5",
+        data: {
+          wtId: that.wtId,
+        },
+        success(res) {
+          let top5TableData = [];
+          let index = 1;
+          for (let key in res.data) {
+            let ele = res.data[key];
+            top5TableData.push({
+              index,
+              date: ele[1],
+              rank: ele[2],
+              wpId: ele[3],
+              wtId: ele[4],
+            });
+            index++;
+          }
+          that.top5Table.data = top5TableData;
+        },
+      });
+    },
+
+    // 渲染健康报告表格
+    renderDateTable(day = 5) {
+      let tableData = [];
+      for (let i = 0; i < day; i++) {
+        tableData.push({
+          index: i + 1,
+          date: new Date(
+            new Date().getTime() - 3600 * 1000 * 24 * (i + 1)
+          ).formatDate("yyyy-MM-dd hh:mm:ss"),
+          wtId: this.wtId,
+        });
+      }
+      this.dateTable.data = tableData;
+    },
+
+    // 获取等级评价
+    getTop10() {
+      let that = this;
+      that.API.requestData({
+        method: "POST",
+        subUrl: "healthsub/queryStopTop10",
+        data: {
+          wtId: that.wtId,
+        },
+        success(res) {
+          let leftData = [];
+          let rightData = [];
+
+          res.data.forEach((ele, index) => {
+            const item = {
+              index: index + 1,
+              warnDesc: ele.warnDesc,
+              startTime: new Date(ele.startTime).formatDate(
+                "yyyy-MM-dd hh:mm:ss"
+              ),
+              stopTime: new Date(ele.stopTime).formatDate(
+                "yyyy-MM-dd hh:mm:ss"
+              ),
+              stopHours: ele.stopHours,
+            };
+            if (index < 5) {
+              leftData.push(item);
+            } else {
+              rightData.push(item);
+            }
+          });
+
+          that.top10TableLeft.data = leftData;
+          that.top10TableRight.data = rightData;
+        },
+      });
+    },
+
+    // 获取八大部件
+    getMtbfByBj() {
+      let that = this;
+      that.API.requestData({
+        method: "POST",
+        subUrl: "healthsub/getWtMttrandMtbfByBj",
+        data: {
+          wtId: that.wtId,
+        },
+        success(res) {
+          let partsArray = [];
+          for (let key in res.data) {
+            let linChartData = [];
+            res.data[key][2].split(",").forEach((ele, index) => {
+              linChartData.push({
+                text: index + 1,
+                value: ele,
+              });
+            });
+            res.data[key].push(linChartData);
+            partsArray.push(res.data[key]);
+          }
+          that.partsArray = partsArray;
+        },
+      });
+    },
+
+    // 获取发电曲线
+    getFindPowerChar() {
+      let that = this;
+      that.API.requestData({
+        method: "POST",
+        subUrl: "healthsub/findPowerChar",
+        data: {
+          wtId: that.wtId,
+        },
+        success(res) {
+          let chartUnits = ["(WM)", "(m/s)"];
+          let chartData = [
+            {
+              title: "理论功率",
+              yAxisIndex: 0,
+              value: [],
+            },
+            {
+              title: "实际功率",
+              yAxisIndex: 0,
+              value: [],
+            },
+            {
+              title: "实时风速",
+              yAxisIndex: 1,
+              value: [],
+            },
+          ];
+
+          res.data.timearr.forEach((time, index) => {
+            chartData[0].value.push({
+              text: new Date(time).formatDate("MM-dd hh:mm"),
+              value: res.data.llgl[index],
+            });
+            chartData[1].value.push({
+              text: new Date(time).formatDate("MM-dd hh:mm"),
+              value: res.data.sjgl[index],
+            });
+            chartData[2].value.push({
+              text: new Date(time).formatDate("MM-dd hh:mm"),
+              value: res.data.ssfs[index],
+            });
+          });
+          that.powerChartData.value = chartData;
+          that.powerChartData.units = chartUnits;
+        },
+      });
+    },
+
+    // 获取天气信息
+    getWeather() {
+      let that = this;
+      that.API.requestData({
+        method: "POST",
+        subUrl: "healthsub/getWeatherRealDay5Info",
+        data: {
+          wpId: that.wpId,
+        },
+        success(res) {
+          console.log(123123, res);
+          let weatherChart = [];
+
+          let chartUnits = ["(m/s)", "(℃)"];
+          let chartData = [
+            {
+              title: "风速",
+              yAxisIndex: 0,
+              value: [],
+            },
+            {
+              title: "温度",
+              yAxisIndex: 1,
+              value: [],
+            },
+          ];
+
+          res.data.ls.forEach((item) => {
+            chartData[0].value.push({
+              text: "05-02 00:00",
+              value: 11,
+              weather: "sun",
+              direction: "n",
+            });
+          });
+        },
+      });
+    },
+  },
+};
+</script>
+
+<style lang="less">
+.health-10 {
+  font-size: 12px;
+  .com-table {
+    tbody tr td {
+      padding: 0;
+      height: 30px;
+    }
+  }
+
+  .table {
+    tbody {
+      td {
+        padding: 0;
+        height: 30px;
+      }
+      tr:nth-child(2n) td {
+        background-color: fade(@gray, 20%);
+
+        &.item {
+          background-color: transparent;
+        }
+      }
+    }
+
+    th {
+      background: fade(@gray, 40);
+      font-size: 12px;
+      font-weight: 400;
+      line-height: 24px;
+      color: @gray-l;
+      border: 2px solid #07140f;
+
+      &.type1 {
+        border-left: 0;
+        border-right: 0;
+      }
+    }
+    td {
+      color: @gray-l;
+      text-align: center;
+      height: 26px;
+      line-height: 26px;
+
+      &.item {
+        width: 100px;
+        div {
+          color: @white;
+          background: fade(@gray, 20);
+          margin: 2px;
+          border: 1px solid transparent;
+        }
+      }
+    }
+
+    .percent-item {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      height: 30px;
+
+      .percent-bar {
+        height: 12px;
+        width: 170px;
+        background: transparent;
+        border: 1px solid @gray-l;
+        margin-left: 8px;
+
+        .percent-value {
+          height: calc(100% - 4px);
+          background: @green;
+          margin: 2px;
+        }
+      }
+    }
+
+    .score {
+      width: 100px;
+      div {
+        background: fade(@gray, 20);
+      }
+    }
+  }
+  .panel-header {
+    margin-bottom: 0;
+    .panel-title {
+      text-align: center;
+    }
+  }
+  .fc-info {
+    .panel-header {
+      margin-bottom: 8px;
+    }
+    .panel-title {
+      text-align: left;
+      padding-left: 20px;
+    }
+  }
+  .table-chart {
+    height: 312px;
+    .panel-title {
+      text-align: left;
+      padding-left: 20px;
+    }
+    .chart-title {
+      // color: rgba(255, 255, 255, 0.75);
+      color: @gray-l;
+      .title-panel {
+        height: 30px;
+        line-height: 30px;
+        margin-bottom: 8px;
+        background-color: #1e2524;
+        .des-title {
+          padding-left: 100px;
+        }
+        .num {
+          padding-left: 20px;
+          color: #05bb4c;
+          font-weight: 600;
+        }
+        .unit {
+          padding-left: 20px;
+        }
+      }
+    }
+  }
+  .table-panel .wrong-list {
+    .panel-title {
+      text-align: left;
+      padding-left: 20px;
+    }
+  }
+
+  .percent-item {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    height: 34px;
+
+    .percent-bar {
+      height: 12px;
+      width: 170px;
+      background: transparent;
+      border: 1px solid @gray-l;
+      margin-left: 8px;
+
+      .percent-value {
+        height: calc(100% - 4px);
+        background: @green;
+        margin: 2px;
+      }
+    }
+  }
+  .score {
+    width: 100px;
+    div {
+      background: fade(@gray, 20);
+    }
+  }
+  .data-list {
+    .dot {
+      width: 12px;
+      height: 12px;
+      margin: auto;
+
+      &.green {
+        background: @green;
+      }
+
+      &.yellow {
+        background: @yellow;
+      }
+    }
+  }
+}
+</style>

+ 298 - 289
src/views/HealthControl/healthLineChart2.vue

@@ -1,289 +1,298 @@
-<template>
-  <div class="health-7">
-    <div class="power-info mg-b-16">
-      <div class="info-tab">
-        <div
-          class="tab"
-          v-for="(item, index) in infoList"
-          :key="index"
-          :class="item.active ? 'active' : ''"
-          @click="onClickInfo(item)"
-        >
-          <i class="svg-icon svg-icon svg-icon-sm">
-            <svg-icon :svgid="item.svgid" />
-          </i>
-          <span> {{ item.title }} </span>
-        </div>
-        <div class="empty"></div>
-      </div>
-      <div class="info-chart">
-        <panel class="info-chart-panel" :title="'健康趋势'">
-          <vertival-bar-line-chart :height="'310px'" :bardata="bardata" :lineData="lineData"/>
-        </panel>
-      </div>
-    </div>
-    <div class="fc-info mg-b-16">
-      <panel :title="'健康走势图'" :showLine="false">
-        <normal-line-chart :height="'150px'" />
-      </panel>
-    </div>
-    <div class="data-list">
-      <Table :data="tableData" :canScroll="true" />
-    </div>
-  </div>
-</template>
-
-<script>
-import VertivalBarLineChart from "../../components/chart/combination/vertival-bar-line-chart.vue";
-import NormalLineChart from "../../components/chart/line/normal-line-chart.vue";
-import SvgIcon from "../../components/coms/icon/svg-icon.vue";
-import Panel from "../../components/coms/panel/panel.vue";
-import Table from "../../components/coms/table/table.vue";
-export default {
-  setup() {},
-  components: { SvgIcon, Panel, VertivalBarLineChart, NormalLineChart, Table },
-  data() {
-    return {
-      infoList: [
-        // {title: '24小时健康趋势', svgid: 'svg-24-houre', active: false, type: 'houre'},
-        { title: "7日健康趋势", svgid: "svg-h-day", active: true, type: "day" },
-        { title: "30日健康趋势", svgid: "svg-h-month", active: false, type: "month"},
-      ],
-      tableData: {
-        column: [
-          { name: "部件名称",field: "name" },
-          { name: "MTBF(h)",field: "v1", is_num: true },
-          { name: "MTTR(h)",field: "v2", is_num: true },
-          { name: "损失电量(kw/h)",field: "v3",is_num: true },
-          { name: "当前状态",field: "v4",
-            template: function(data) {
-              if (data == 1) return "<div class='dot green'></div>";
-              else if (data == 2) return "<div class='dot purple'></div>";
-              else if (data == 3) return "<div class='dot yellow'></div>";
-              else if (data == 4) return "<div class='dot orange'></div>";
-            },
-          },
-        ],
-        data: [],
-      },
-      bardata: { area: [], legend: [], data: [] }, // 损失电量分析echart数值
-      lineData: [],
-      wtId: undefined,
-      wpId: undefined,
-      hisValue: {},  //健康走势图
-    };
-  },
-  created() {
-    this.wtId = this.$route.params.wtId;
-    this.wpId = this.$route.params.wpId;
-    this.requestCoulometry(2)
-    this.requestHisValue()
-    this.requestMttrrand()
-  },
-  methods:{
-     // 未确认缺陷按钮下的健康趋势选项
-    onClickInfo(item) {
-      this.infoList.forEach((element) => {
-        if (item.type == element.type) {
-          item.active = true;
-          switch (item.type) {
-            case "day":
-              this.requestCoulometry(2);
-              break;
-            case "month":
-              this.requestCoulometry(3);
-          }
-        } else {
-          element.active = false;
-        }
-      });
-    },
-    // 损失电量分析  type:1 表示24小时健康趋势,2 表示七天健康趋势 3 表示30天健康趋势
-    requestCoulometry(type) {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        timeout: 8000,
-        subUrl: "recommen/findAllChartjz",
-        data: { wpId: 0, type: type },
-        success(res) {
-          if (res.code == 200) {
-            that.bardata.legend = ["优数量", "良数量", "差数量"];
-            that.lineData = res.data.lvchart;
-            that.bardata.area = res.data.datechart;
-            that.bardata.data[2] = res.data.cslchart;
-            that.bardata.data[1] = res.data.lslchart;
-            that.bardata.data[0] = res.data.yslchart;
-          }
-        },
-      });
-    },
-    //风机健康走势图
-    requestHisValue(){
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: "healthsub/findWtHisValueForBj",
-        data: { wtId: that.wtId },
-        success(res) {
-          if(res.code == 200){
-            let data = res.data;
-            data.time = data.time.slice(0, 65)
-            that.hisValue = data
-          }
-        },
-      });
-    },
-    //部件健康情况
-    requestMttrrand(){
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: "healthsub/getWtMttrandMtbfByBj",
-        data: { wtId: that.wtId },
-        success(res) {
-          if(res.code == 200){
-            let data = res.data;
-            that.tableData.data = [
-              {name:data.clx[1], v1:data.clx[4], v2:data.clx[5], v3:data.clx[6], v4:data.clx[0]},
-              {name:data.fdj[1], v1:data.fdj[4], v2:data.fdj[5], v3:data.fdj[6], v4:data.fdj[0]},
-              {name:data.bj[1], v1:data.bj[4], v2:data.bj[5], v3:data.bj[6], v4:data.bj[0]},
-              {name:data.zk[1], v1:data.zk[4], v2:data.zk[5], v3:data.zk[6], v4:data.zk[0]},
-              {name:data.zz[1], v1:data.zz[4], v2:data.zz[5], v3:data.zz[6], v4:data.zz[0]},
-              {name:data.ph[1], v1:data.ph[4], v2:data.ph[5], v3:data.ph[6], v4:data.ph[0]},
-              {name:data.jc[1], v1:data.jc[4], v2:data.jc[5], v3:data.jc[6], v4:data.jc[0]},
-              {name:data.bpq[1], v1:data.bpq[4], v2:data.bpq[5], v3:data.bpq[6], v4:data.bpq[0]},
-            ]
-          }
-        },
-      });
-    }
-  }
-};
-</script>
-
-<style lang="less">
-.health-7 {
-  // 电量健康情况
-  .power-info {
-    display: flex;
-    .info-tab {
-      flex: 0 0 156px;
-      display: flex;
-      flex-direction: column;
-      height: 350px;
-      margin-right: 1.4815vh;
-
-      .tab {
-        position: relative;
-        flex: 0 0 auto;
-        text-align: center;
-        line-height: 33px;
-        margin-right: 8px;
-        color: @gray-l;
-        font-size: 12px;
-        background: fade(@gray, 20);
-        border: 1px solid fade(@gray, 20);
-
-        display: flex;
-        align-items: center;
-
-        i {
-          margin: 0 1.4815vh;
-          svg use {
-            fill: @gray-l;
-          }
-        }
-
-        &:hover,
-        &.active {
-          background: fade(@green, 20);
-          border: 1px solid @green;
-          color: @green;
-          cursor: pointer;
-          i {
-            svg use {
-              fill: @green;
-            }
-          }
-        }
-
-        &.active::after {
-          box-sizing: content-box;
-          width: 0px;
-          height: 0px;
-          position: absolute;
-          right: -19px;
-          padding: 0;
-          border-bottom: 9px solid @green;
-          border-top: 9px solid transparent;
-          border-left: 9px solid transparent;
-          border-right: 9px solid transparent;
-          display: block;
-          content: "";
-          z-index: 10;
-          transform: rotate(90deg);
-        }
-
-        &.active::before {
-          box-sizing: content-box;
-          width: 0px;
-          height: 0px;
-          position: absolute;
-          right: -17px;
-          padding: 0;
-          border-bottom: 9px solid #063319;
-          border-top: 9px solid transparent;
-          border-left: 9px solid transparent;
-          border-right: 9px solid transparent;
-          display: block;
-          content: "";
-          z-index: 12;
-          transform: rotate(90deg);
-        }
-
-        & + .tab {
-          margin-top: 0.7407vh;
-        }
-
-        &:last-child {
-          text-align: center;
-          justify-content: center;
-        }
-      }
-
-      .empty {
-        flex: 1 0 auto;
-      }
-    }
-
-    .info-chart {
-      flex: 1 0 auto;
-    }
-  }
-
-  .data-list {
-    .dot {
-      width: 12px;
-      height: 12px;
-      margin: auto;
-
-      &.green {
-        background: @green;
-      }
-
-      &.purple {
-        background: @purple;
-      }
-
-      &.yellow {
-        background: @yellow;
-      }
-
-      &.orange {
-        background: @orange;
-      }
-    }
-  }
-}
-</style>
+<template>
+  <div class="health-7">
+    <wt-chooser @change="switchWt" :wpId="wpId" :wtId="wtId"></wt-chooser>
+    <div class="power-info mg-b-16">
+      <div class="info-tab">
+        <div
+          class="tab"
+          v-for="(item, index) in infoList"
+          :key="index"
+          :class="item.active ? 'active' : ''"
+          @click="onClickInfo(item)"
+        >
+          <i class="svg-icon svg-icon svg-icon-sm">
+            <svg-icon :svgid="item.svgid" />
+          </i>
+          <span> {{ item.title }} </span>
+        </div>
+        <div class="empty"></div>
+      </div>
+      <div class="info-chart">
+        <panel class="info-chart-panel" :title="'健康趋势'">
+          <vertival-bar-line-chart :height="'310px'" :bardata="bardata" :lineData="lineData"/>
+        </panel>
+      </div>
+    </div>
+    <div class="fc-info mg-b-16">
+      <panel :title="'健康走势图'" :showLine="false">
+        <normal-line-chart :height="'150px'" />
+      </panel>
+    </div>
+    <div class="data-list">
+      <Table :data="tableData" :canScroll="true" />
+    </div>
+  </div>
+</template>
+
+<script>
+import VertivalBarLineChart from "../../components/chart/combination/vertival-bar-line-chart.vue";
+import NormalLineChart from "../../components/chart/line/normal-line-chart.vue";
+import SvgIcon from "../../components/coms/icon/svg-icon.vue";
+import Panel from "../../components/coms/panel/panel.vue";
+import Table from "../../components/coms/table/table.vue";
+import WtChooser from "@com/coms/wt-chooser/wt-chooser.vue"
+export default {
+  setup() {},
+  components: { SvgIcon, Panel, VertivalBarLineChart, NormalLineChart, Table, WtChooser },
+  data() {
+    return {
+      infoList: [
+        // {title: '24小时健康趋势', svgid: 'svg-24-houre', active: false, type: 'houre'},
+        { title: "7日健康趋势", svgid: "svg-h-day", active: true, type: "day" },
+        { title: "30日健康趋势", svgid: "svg-h-month", active: false, type: "month"},
+      ],
+      tableData: {
+        column: [
+          { name: "部件名称",field: "name" },
+          { name: "MTBF(h)",field: "v1", is_num: true },
+          { name: "MTTR(h)",field: "v2", is_num: true },
+          { name: "损失电量(kw/h)",field: "v3",is_num: true },
+          { name: "当前状态",field: "v4",
+            template: function(data) {
+              if (data == 1) return "<div class='dot green'></div>";
+              else if (data == 2) return "<div class='dot purple'></div>";
+              else if (data == 3) return "<div class='dot yellow'></div>";
+              else if (data == 4) return "<div class='dot orange'></div>";
+            },
+          },
+        ],
+        data: [],
+      },
+      bardata: { area: [], legend: [], data: [] }, // 损失电量分析echart数值
+      lineData: [],
+      wtId: undefined,
+      wpId: undefined,
+      hisValue: {},  //健康走势图
+    };
+  },
+  created() {
+    this.init();
+  },
+  methods:{
+    init(){
+      this.wtId = this.$route.params.wtId;
+      this.wpId = this.$route.params.wpId;
+      this.requestCoulometry(2);
+      this.requestHisValue();
+      this.requestMttrrand();
+    },
+    switchWt(data){
+      this.$router.push(`/health/health10/${data.wpId}/${data.wtId}`);
+      this.init();
+    },
+     // 未确认缺陷按钮下的健康趋势选项
+    onClickInfo(item) {
+      this.infoList.forEach((element) => {
+        if (item.type == element.type) {
+          item.active = true;
+          switch (item.type) {
+            case "day":
+              this.requestCoulometry(2);
+              break;
+            case "month":
+              this.requestCoulometry(3);
+          }
+        } else {
+          element.active = false;
+        }
+      });
+    },
+    // 损失电量分析  type:1 表示24小时健康趋势,2 表示七天健康趋势 3 表示30天健康趋势
+    requestCoulometry(type) {
+      let that = this;
+      that.API.requestData({
+        method: "POST",
+        timeout: 8000,
+        subUrl: "recommen/findAllChartjz",
+        data: { wpId: 0, type: type },
+        success(res) {
+          if (res.code == 200) {
+            that.bardata.legend = ["优数量", "良数量", "差数量"];
+            that.lineData = res.data.lvchart;
+            that.bardata.area = res.data.datechart;
+            that.bardata.data[2] = res.data.cslchart;
+            that.bardata.data[1] = res.data.lslchart;
+            that.bardata.data[0] = res.data.yslchart;
+          }
+        },
+      });
+    },
+    //风机健康走势图
+    requestHisValue(){
+      let that = this;
+      that.API.requestData({
+        method: "POST",
+        subUrl: "healthsub/findWtHisValueForBj",
+        data: { wtId: that.wtId },
+        success(res) {
+          if(res.code == 200){
+            let data = res.data;
+            data.time = data.time.slice(0, 65)
+            that.hisValue = data
+          }
+        },
+      });
+    },
+    //部件健康情况
+    requestMttrrand(){
+      let that = this;
+      that.API.requestData({
+        method: "POST",
+        subUrl: "healthsub/getWtMttrandMtbfByBj",
+        data: { wtId: that.wtId },
+        success(res) {
+          if(res.code == 200){
+            let data = res.data;
+            that.tableData.data = [
+              {name:data.clx[1], v1:data.clx[4], v2:data.clx[5], v3:data.clx[6], v4:data.clx[0]},
+              {name:data.fdj[1], v1:data.fdj[4], v2:data.fdj[5], v3:data.fdj[6], v4:data.fdj[0]},
+              {name:data.bj[1], v1:data.bj[4], v2:data.bj[5], v3:data.bj[6], v4:data.bj[0]},
+              {name:data.zk[1], v1:data.zk[4], v2:data.zk[5], v3:data.zk[6], v4:data.zk[0]},
+              {name:data.zz[1], v1:data.zz[4], v2:data.zz[5], v3:data.zz[6], v4:data.zz[0]},
+              {name:data.ph[1], v1:data.ph[4], v2:data.ph[5], v3:data.ph[6], v4:data.ph[0]},
+              {name:data.jc[1], v1:data.jc[4], v2:data.jc[5], v3:data.jc[6], v4:data.jc[0]},
+              {name:data.bpq[1], v1:data.bpq[4], v2:data.bpq[5], v3:data.bpq[6], v4:data.bpq[0]},
+            ]
+          }
+        },
+      });
+    }
+  }
+};
+</script>
+
+<style lang="less">
+.health-7 {
+  // 电量健康情况
+  .power-info {
+    display: flex;
+    .info-tab {
+      flex: 0 0 156px;
+      display: flex;
+      flex-direction: column;
+      height: 350px;
+      margin-right: 1.4815vh;
+
+      .tab {
+        position: relative;
+        flex: 0 0 auto;
+        text-align: center;
+        line-height: 33px;
+        margin-right: 8px;
+        color: @gray-l;
+        font-size: 12px;
+        background: fade(@gray, 20);
+        border: 1px solid fade(@gray, 20);
+
+        display: flex;
+        align-items: center;
+
+        i {
+          margin: 0 1.4815vh;
+          svg use {
+            fill: @gray-l;
+          }
+        }
+
+        &:hover,
+        &.active {
+          background: fade(@green, 20);
+          border: 1px solid @green;
+          color: @green;
+          cursor: pointer;
+          i {
+            svg use {
+              fill: @green;
+            }
+          }
+        }
+
+        &.active::after {
+          box-sizing: content-box;
+          width: 0px;
+          height: 0px;
+          position: absolute;
+          right: -19px;
+          padding: 0;
+          border-bottom: 9px solid @green;
+          border-top: 9px solid transparent;
+          border-left: 9px solid transparent;
+          border-right: 9px solid transparent;
+          display: block;
+          content: "";
+          z-index: 10;
+          transform: rotate(90deg);
+        }
+
+        &.active::before {
+          box-sizing: content-box;
+          width: 0px;
+          height: 0px;
+          position: absolute;
+          right: -17px;
+          padding: 0;
+          border-bottom: 9px solid #063319;
+          border-top: 9px solid transparent;
+          border-left: 9px solid transparent;
+          border-right: 9px solid transparent;
+          display: block;
+          content: "";
+          z-index: 12;
+          transform: rotate(90deg);
+        }
+
+        & + .tab {
+          margin-top: 0.7407vh;
+        }
+
+        &:last-child {
+          text-align: center;
+          justify-content: center;
+        }
+      }
+
+      .empty {
+        flex: 1 0 auto;
+      }
+    }
+
+    .info-chart {
+      flex: 1 0 auto;
+    }
+  }
+
+  .data-list {
+    .dot {
+      width: 12px;
+      height: 12px;
+      margin: auto;
+
+      &.green {
+        background: @green;
+      }
+
+      &.purple {
+        background: @purple;
+      }
+
+      &.yellow {
+        background: @yellow;
+      }
+
+      &.orange {
+        background: @orange;
+      }
+    }
+  }
+}
+</style>