Browse Source

Merge branch 'yx' of http://61.161.152.110:10101/r/electronic-map into yx

yangxiao 3 years ago
parent
commit
e1b00978e6

+ 426 - 0
src/components/coms/table/table-qc.vue

@@ -0,0 +1,426 @@
+<template>
+  <table class="com-table">
+    <thead>
+      <tr>
+        <th v-for="(col, index) of data.column" :key="index" :class="{ light: col.is_light }" :style="{ width: col.width }" @click="onSort(col)">
+          {{ col.name }}
+        </th>
+      </tr>
+    </thead>
+    <el-scrollbar>
+      <tbody :style="{ height: height }">
+        <tr v-for="(row, index) of tableData" :key="index">
+          <td
+            v-for="(col, i) of data.column"
+            :key="i"
+            :style="{ width: col.width }"
+            :class="{ light: hoverRow == row || hoverCol == col, num: col.is_num, 'always-light': col.is_light || row.is_light }"
+            @mouseenter="hover(row, col)"
+            @mouseleave="leave()"
+          >
+            <component :is="col.type ? col.type : 'div'" v-bind="col.props" v-html="template(col, row[col.field])" @click="onClick(col, row)"> </component>
+          </td>
+        </tr>
+      </tbody>
+    </el-scrollbar>
+    <el-pagination class="mg-t-8" v-if="pageable" @current-change="handleCurrentChange" :current-page="currentPage4" :page-size="pageSize" layout="total, prev, pager, next, jumper" :total="data.total"> </el-pagination>
+    <el-dialog :title="dialogTitle" v-model="dialogShow" width="70%" top="10vh" custom-class="modal" :close-on-click-modal="true">
+      <div class="chart" id="chartDiv" height="500px"></div>
+    </el-dialog>
+  </table>
+</template>
+
+<script>
+import * as echarts from "echarts";
+export default {
+  // 名称
+  name: "ComTable",
+  // 使用组件
+  components: {},
+  // 传入参数
+  props: {
+    data: Object,
+    // hover 样式
+    showHover: {
+      type: Boolean,
+      default: true,
+    },
+    // 列高亮
+    showColHover: {
+      type: Boolean,
+      default: false,
+    },
+    canScroll: {
+      type: Boolean,
+      default: true,
+    },
+    pageSize: {
+      type: Number,
+      default: 0,
+    },
+    height: {
+      type: String,
+      default: "",
+    },
+  },
+  // 自定义事件
+  emits: {
+    // 分页事件
+    onPagging: null,
+  },
+  // 数据
+  data() {
+    return {
+      hoverRow: -1,
+      hoverCol: -1,
+      sortCol: "",
+      sortType: "",
+      currentPage: 1,
+      dialogShow: false,
+      dialogTitle:"",
+      dialogData:{},
+    };
+  },
+  computed: {
+    tableData() {
+      let that = this;
+      if (this.sortCol == "") {
+        return this.data.data;
+      } else {
+        let data = this.data.data;
+
+        data.sort((a, b) => {
+          let rev = 1;
+          if (that.sortType == "ASC") rev = 1;
+          else if (that.sortType == "DESC") rev = -1;
+
+          if (a[that.sortCol] > b[that.sortCol]) return rev * 1;
+          if (a[that.sortCol] < b[that.sortCol]) return rev * -1;
+          return 0;
+        });
+        return data;
+      }
+    },
+    pageable() {
+      return this.pageSize != 0;
+    },
+    pages() {
+      if (this.pageable) return parseInt(this.data.total / this.pageSize) + 1;
+      else return 0;
+    },
+    startRow() {
+      if (this.pageable) return (this.currentPage - 1) * this.pageSize;
+      else return 0;
+    },
+    endRow() {
+      if (this.pageable) return this.currentPage * this.pageSize;
+      else return this.data.data.length;
+    },
+  },
+  // 函数
+  methods: {
+    clearCheckBox(time){
+      this.$nextTick(()=>{
+        setTimeout(()=>{
+          const domArray = document.querySelectorAll(".curCheckBox");
+          for(let i=0;i<domArray.length;i++){
+            domArray[i].checked=false;
+          }
+        },(time || 300));
+      });
+    },
+    onClick(col, data) {
+      this.dialogShow = true;
+      this.dialogTitle="曲线偏差率排行";
+      const date = new Date();
+      let year = date.getFullYear();
+      let month = date.getMonth() + 1;
+      let pdate = this.$parent.date.split("-");
+      if(pdate && pdate.length>1){
+        year = pdate[0];
+        month = pdate[1];
+      }
+
+      let that = this;
+      that.API.requestData({
+        method: "POST",
+        subUrl:"/leaderboard/curveMonthchatAjax",
+        data: {
+          wtId  : data.fj,
+          month : month,
+          type  :"zybz",
+          year  : year
+        },
+        success (res) {
+          if (res.code === 200) {
+            const linedata1 = [];
+            const linedata2 = [];
+            
+            res.data.datas.forEach((item, index) => {
+              linedata1.push(item['value2']);
+              linedata2.push(item['value3']);
+            });
+            
+            that.dialogShow = true;
+            that.dialogTitle="曲线偏差率排行";
+            that.initChart(linedata1,linedata2);
+          }
+        }
+      });
+    },
+    initChart(data1,data2){
+      let myChart = echarts.init(document.getElementById('chartDiv'));
+      let option = {
+        "color": [
+            "#05bb4c",
+            "#4b55ae",
+        ],
+        tooltip: {
+            trigger: 'axis'
+        },
+        "legend": {
+            "show": true,
+            "data": [
+                "最优功率",
+                "保证功率",
+            ],
+            "right": 56,
+            "icon": "circle",
+            "itemWidth": 6,
+            "inactiveColor": "#606769",
+            "textStyle": {
+                "color": "#B3BDC0",
+                "fontSize": 12
+            }
+        },
+        "grid": {
+            "top": 32,
+            "left": 40,
+            "right": 40,
+            "bottom": 24
+        },
+        "xAxis": [
+            {
+                "type": "category",
+                "boundaryGap": false,
+                "axisLabel": {
+                    "formatter": "{value}",
+                    "fontSize": 9.35925925925926,
+                    "textStyle": {
+                        "color": "#606769"
+                    }
+                },
+                "axisLine": {
+                    "show": false
+                },
+                "data": ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25"]
+            }
+        ],
+        "yAxis": [
+            {
+                "type": "value",
+                "name": "(W)",
+                "axisLabel": {
+                    "formatter": "{value}",
+                    "fontSize": 9.35925925925926
+                },
+                "axisLine": {
+                    "show": false
+                },
+                "splitLine": {
+                    "show": true,
+                    "lineStyle": {
+                        "color": "#606769",
+                        "type": "dashed"
+                    }
+                }
+            }
+        ],
+        "series": [
+            {
+                "name": "最优功率",
+                "type": "line",
+                "smooth": true,
+                "showSymbol": false,
+                "zlevel": 0,
+                "lineStyle": {
+                    "normal": {
+                        "color": "#05bb4c",
+                        "width": 1
+                    },
+                    "emphasis": {
+                        "color": "#05bb4c"
+                    }
+                },
+                "areaStyle": {
+                    "normal": {
+                        "color": {
+                            "colorStops": [
+                                {
+                                    "offset": 0,
+                                    "color": "rgba(5,187,76,0.3)"
+                                },
+                                {
+                                    "offset": 1,
+                                    "color": "rgba(5,187,76,0.1)"
+                                }
+                            ],
+                            "x": 0,
+                            "y": 0,
+                            "x2": 0,
+                            "y2": 1,
+                            "type": "linear",
+                            "global": false
+                        },
+                        "shadowColor": "rgba(5,187,76,0.1)",
+                        "shadowBlur": 10
+                    },
+                    "emphasis": {
+                        "color": {
+                            "colorStops": [
+                                {
+                                    "offset": 0,
+                                    "color": "rgba(5,187,76,0.3)"
+                                },
+                                {
+                                    "offset": 1,
+                                    "color": "rgba(5,187,76,0.1)"
+                                }
+                            ],
+                            "x": 0,
+                            "y": 0,
+                            "x2": 0,
+                            "y2": 1,
+                            "type": "linear",
+                            "global": false
+                        },
+                        "shadowColor": "rgba(5,187,76,0.1)",
+                        "shadowBlur": 10
+                    }
+                },
+
+                "yAxisIndex": 0,
+                "data": data1
+            },
+            {
+                "name": "保证功率",
+                "type": "line",
+                "smooth": true,
+                "showSymbol": false,
+                "zlevel": 2,
+                "lineStyle": {
+                    "normal": {
+                        "color": "#606769",
+                        "width": 1
+                    },
+                    "emphasis": {
+                        "color": "#fa8c16"
+                    }
+                },
+                "areaStyle": {
+                    "normal": {
+                        "color": "transparent",
+                        "shadowColor": "rgba(250,140,22,0.1)",
+                        "shadowBlur": 10
+                    },
+                    "emphasis": {
+                        "color": {
+                            "colorStops": [
+                                {
+                                    "offset": 0,
+                                    "color": "rgba(250,140,22,0.3)"
+                                },
+                                {
+                                    "offset": 1,
+                                    "color": "rgba(250,140,22,0.1)"
+                                }
+                            ],
+                            "x": 0,
+                            "y": 0,
+                            "x2": 0,
+                            "y2": 1,
+                            "type": "linear",
+                            "global": false
+                        },
+                        "shadowColor": "rgba(250,140,22,0.1)",
+                        "shadowBlur": 10
+                    }
+                },
+
+                "yAxisIndex": 0,
+                "data": data2
+            }
+        ]
+      };
+      myChart.clear();
+      myChart && myChart && myChart.setOption(option);
+      this.resize = function() {
+        myChart.resize();
+      };
+      window.addEventListener("resize", this.resize);
+      myChart.resize();
+    },
+    onSort(col) {
+      if (col.sortable == true) {
+        this.sortCol = col.field;
+        switch (this.sortType) {
+          case "":
+            this.sortType = "DESC";
+            break;
+          case "DESC":
+            this.sortType = "ASC";
+            break;
+          case "ASC":
+            this.sortType = "";
+            break;
+        }
+      }
+    },
+    template(col, data) {
+      if (!col.template) return data;
+      else return col.template(data);
+    },
+    hover(row, col) {
+      if (this.showHover) {
+        this.hoverRow = row;
+        if (this.showColHover) this.hoverCol = col;
+      }
+    },
+    leave() {
+      this.hoverRow = -1;
+      this.hoverCol = -1;
+    },
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.$emit("onPagging", {
+        pageIndex: this.currentPage,
+        pageSize: this.pageSize,
+        start: this.startRow,
+        end: this.endRow,
+      });
+    },
+  },
+  // 生命周期钩子
+  beforeCreate() {
+    // 创建前
+  },
+  created() {
+    // 创建后
+  },
+  beforeMount() {
+    // 渲染前
+  },
+  mounted() {
+    // 渲染后
+  },
+  beforeUpdate() {},
+  updated() {},
+};
+</script>
+
+<style lang="less">
+.chart {
+  width: 1000px;
+  height: 500px;
+}
+</style>

+ 215 - 0
src/components/coms/table/table-unpage.vue

@@ -0,0 +1,215 @@
+<template>
+  <table class="com-table">
+    <thead>
+      <tr>
+        <th v-for="(col, index) of data.column" :key="index" :class="{ light: col.is_light }" :style="{ width: col.width }" @click="onSort(col)">
+          {{ col.name }}
+        </th>
+      </tr>
+    </thead>
+    <el-scrollbar>
+      <tbody :style="{ height: height }">
+        <tr v-for="(row, index) of tableData" :key="index">
+          <td
+            v-for="(col, i) of data.column"
+            :key="i"
+            :style="{ width: col.width }"
+            :class="{ light: hoverRow == row || hoverCol == col, num: col.is_num, 'always-light': col.is_light || row.is_light }"
+            @mouseenter="hover(row, col)"
+            @mouseleave="leave()"
+          >
+            <component :is="col.type ? col.type : 'div'" v-bind="col.props" v-html="template(col, row[col.field])" @click="onClick(col, row)"> </component>
+          </td>
+        </tr>
+      </tbody>
+    </el-scrollbar>
+  </table>
+</template>
+
+<script>
+export default {
+  // 名称
+  name: "ComTable",
+  // 使用组件
+  components: {},
+  // 传入参数
+  props: {
+    /**
+             * {
+                    column: [{
+                        name: "风机名称",
+                        field: "name",
+                        type:'div',
+                        width:'', // 宽度
+                        is_num: false, // 是否为数字
+                        is_light: false, // 是否高亮
+                        template:function(){ }
+                        click:function(){} //点击事件
+                        sortable:fasle // 排序
+                        // 新增用于在表格中使用动态三方组件
+                        type:'el-tag', // * 新增 用于传入三方组件名称 实现三方组件引入  component :is 方式实现
+                        props:{}, // * 新增 用户传入三方组件的 props 与type同时使用
+                    },{
+                        name: "冷却风温度",
+                        field: "lqf",
+                        is_num: true,
+                        is_light: false
+                    }],
+                    data: [{
+                        name: "1E01",
+                        lqf: 15.78,
+                        is_light: false
+                    }],
+                    total:200
+                }
+             */
+    data: Object,
+    // hover 样式
+    showHover: {
+      type: Boolean,
+      default: true,
+    },
+    // 列高亮
+    showColHover: {
+      type: Boolean,
+      default: false,
+    },
+    canScroll: {
+      type: Boolean,
+      default: true,
+    },
+    pageSize: {
+      type: Number,
+      default: 0,
+    },
+    height: {
+      type: String,
+      default: "",
+    },
+  },
+  // 自定义事件
+  emits: {
+    // 分页事件
+    onPagging: null,
+  },
+  // 数据
+  data() {
+    return {
+      hoverRow: -1,
+      hoverCol: -1,
+      sortCol: "",
+      sortType: "",
+      currentPage: 1,
+    };
+  },
+  computed: {
+    tableData() {
+      let that = this;
+      if (this.sortCol == "") {
+        return this.data.data;
+      } else {
+        let data = this.data.data;
+
+        data.sort((a, b) => {
+          let rev = 1;
+          if (that.sortType == "ASC") rev = 1;
+          else if (that.sortType == "DESC") rev = -1;
+
+          if (a[that.sortCol] > b[that.sortCol]) return rev * 1;
+          if (a[that.sortCol] < b[that.sortCol]) return rev * -1;
+          return 0;
+        });
+        return data;
+      }
+    },
+    pageable() {
+      return this.pageSize != 0;
+    },
+    pages() {
+      if (this.pageable) return parseInt(this.data.total / this.pageSize) + 1;
+      else return 0;
+    },
+    startRow() {
+      if (this.pageable) return (this.currentPage - 1) * this.pageSize;
+      else return 0;
+    },
+    endRow() {
+      if (this.pageable) return this.currentPage * this.pageSize;
+      else return this.data.data.length;
+    },
+  },
+  // 函数
+  methods: {
+    clearCheckBox(time){
+      this.$nextTick(()=>{
+        setTimeout(()=>{
+          const domArray = document.querySelectorAll(".curCheckBox");
+          for(let i=0;i<domArray.length;i++){
+            domArray[i].checked=false;
+          }
+        },(time || 300));
+      });
+    },
+    onClick(col, data) {
+      if (col.click) col.click(event, data);
+    },
+    onSort(col) {
+      if (col.sortable == true) {
+        this.sortCol = col.field;
+        switch (this.sortType) {
+          case "":
+            this.sortType = "DESC";
+            break;
+          case "DESC":
+            this.sortType = "ASC";
+            break;
+          case "ASC":
+            this.sortType = "";
+            break;
+        }
+      }
+    },
+    template(col, data) {
+      if (!col.template) return data;
+      else return col.template(data);
+    },
+    hover(row, col) {
+      if (this.showHover) {
+        this.hoverRow = row;
+        if (this.showColHover) this.hoverCol = col;
+      }
+    },
+    leave() {
+      this.hoverRow = -1;
+      this.hoverCol = -1;
+    },
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.$emit("onPagging", {
+        pageIndex: this.currentPage,
+        pageSize: this.pageSize,
+        start: this.startRow,
+        end: this.endRow,
+      });
+    },
+  },
+  // 生命周期钩子
+  beforeCreate() {
+    // 创建前
+  },
+  created() {
+    // 创建后
+  },
+  beforeMount() {
+    // 渲染前
+  },
+  mounted() {
+    // 渲染后
+  },
+  beforeUpdate() {},
+  updated() {},
+};
+</script>
+
+<style lang="less">
+</style>

+ 15 - 3
src/router/index.js

@@ -1,6 +1,6 @@
 import { createRouter, createWebHashHistory } from 'vue-router'
 import Home from '../views/Home/Home.vue'
-
+ 
 const routes = [{
   path: '/',
   redirect: '/monitor/home'
@@ -541,6 +541,18 @@ const routes = [{
   component: () =>
     import('../views/Decision/slgl/xqjsl.vue')
 },
+// 曲线排行榜
+{
+    path:'/qxpclfx',
+    name:'qxpclfx',
+    component:()=> import('../views/nxfx/qxpclfx.vue')
+},
+// 等级评估(单机等级评估管理-量化评级)
+{
+    path:'/djpg',
+    name:'djpg',
+    component:()=> import('../views/HealthControl/gradeassessment.vue')
+},
 {
   path: "/new/powerforecast2",
   name: "powerforecast2",
@@ -580,9 +592,9 @@ const router = createRouter({
     base: '/zhfx/',
     routes
 })
-
+ 
 router.beforeEach((to, from, next) => {
     next()
 })
-
+ 
 export default router

+ 192 - 231
src/views/HealthControl/dayinfo.vue

@@ -1,31 +1,22 @@
 <template>
   <div class="health-day-info">
     <div class="header">
-      <span class="herder-info">
-        风机编号:麻黄山24号风机
-      </span>
-      <span class="herder-info">
-        风机编号:麻黄山24号风机
-      </span>
-      <span class="herder-info">
-        基础指标
-      </span>
+      <span class="herder-info" :width="800" v-for="item of gridDatas" :key="item">风机编号:{{item.windturbineid}}</span>
+      <span class="herder-info">基础指标</span>
     </div>
     <div class="body">
       <div class="left">
         <table class="table-form">
           <tr>
-            <td class="white">量化评级:AA</td>
-            <td class="white">量化评级:AA</td>
+            <td class="white" v-for="item of gridDatas" :key="item">量化评级:{{item.level}}</td>
           </tr>
           <tr>
-            <td class="white">综合排名:1</td>
-            <td class="white">综合排名:1</td>
+            <td class="white" v-for="item of gridDatas" :key="item">综合排名:{{item.rank}}</td>
           </tr>
         </table>
 
         <div class="chart-body">
-          <normal-radar-chart :height="'500px'" :value="radarValue" />
+          <normal-radar-chart :height="'500px'" :value="chartDatas" />
         </div>
       </div>
       <div class="left">
@@ -33,210 +24,16 @@
           <tr>
             <td class="white">类型</td>
             <td class="white">指标</td>
-            <td class="white">麻黄山24号风机</td>
-            <td class="white">麻黄山26号风机</td>
-            <td class="white" colspan="2">排名</td>
+            <td class="white" v-for="item of gridDatas" :key="item">{{item.windturbineid}}</td>
+            <td class="white" :colspan="gridDatas.length">排名</td>
             <td class="white" colspan="2">评分</td>
           </tr>
-          <tr>
-            <td class="white"></td>
-            <td class="white">发电量</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white"></td>
-            <td class="white">理论发电量</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white"></td>
-            <td class="white">平均功率</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white"></td>
-            <td class="white">故障损失电量</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white"></td>
-            <td class="white">限电损失电量</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white"></td>
-            <td class="white">维护损失电量</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white"></td>
-            <td class="white">故障时间</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white"></td>
-            <td class="white">维护时间</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white"></td>
-            <td class="white">运行时间</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white"></td>
-            <td class="white">停机时间</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white">性能</td>
-            <td class="white">平均切入风速</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white">性能</td>
-            <td class="white">性能损失电量</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white">性能</td>
-            <td class="white">拟合优度</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white">性能</td>
-            <td class="white">功率一致性系数</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white">可靠性管理</td>
-            <td class="white">利用小时</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white">可靠性管理</td>
-            <td class="white">设备可利用率</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white">可靠性管理</td>
-            <td class="white">等效可利用率</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white">可靠性管理</td>
-            <td class="white">有效风时数</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white">可靠性管理</td>
-            <td class="white">平均风速</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-          </tr>
-          <tr>
-            <td class="white">可靠性管理</td>
-            <td class="white">静风频率</td>
-            <td class="white">187.99</td>
-            <td class="white">187.99</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
-            <td class="white">0</td>
+          <tr v-for="item of column" :key="item">
+            <td class="white">{{item.type}}</td>
+            <td class="white">{{item.name}}</td>
+            <td class="white" v-for="row of gridDatas" :key="row">{{row[item.field]}}</td>
+            <td class="white" v-for="row of gridDatas" :key="row">{{row[item.rank]}}</td>
+            <td class="white" v-for="row of gridDatas" :key="row">{{row[item.score]}}</td>
           </tr>
         </table>
       </div>
@@ -248,31 +45,195 @@
 import NormalRadarChart from "../../components/chart/radar/normal-radar-chart.vue";
 export default {
   components: { NormalRadarChart },
+  props: {
+    gridDatas: {},
+    chartDatas: {}
+  },
   data() {
     return {
       value: "",
-      radarValue: [
+      column: [
         {
-          indicator: ["平均切入风速", "性能损失电量", "拟合优度", "功率一致性系数", "利用小时", "设备可利用率", "等效可利用系数", "有效风时数", "平均风速", "静风频率"],
-          data: [
-            {
-              value: [44200, 14200, 20000, 35000, 50000, 38000, 44200, 14200, 20000, 35000],
-              name: "NAME",
-            },
-          ],
+          name: "发电量",
+          field: "dayfdl",
+          rank: "monthfdl"
         },
         {
-          indicator: ["平均切入风速", "性能损失电量", "拟合优度", "功率一致性系数", "利用小时", "设备可利用率", "等效可利用系数", "有效风时数", "平均风速", "静风频率"],
+          name: "理论发电量",
+          field: "dayllfdl",
+          rank: "monthllfdl",
+          score: "yearllfdl"
+        },
+        {
+          name: "平均功率",
+          field: "daygl",
+          rank: "monthgl",
+          score: "yeargl"
+        },
+        {
+          name: "故障损失电量",
+          field: "daygzssdl",
+          rank: "monthgzssdl",
+          score: "yeargzssdl"
+        },
+        {
+          name: "限电损失电量",
+          field: "dayxdssdl",
+          rank: "monthxdssdl",
+          score: "yearxdssdl"
+        },
+        {
+          name: "维护损失电量",
+          field: "daywhssdl",
+          rank: "monthwhssdl",
+          score: "yearwhssdl"
+        },
+        {
+          name: "故障时间",
+          field: "daygzsj",
+          rank: "monthgzsj",
+          score: "yeargzsj"
+        },
+        {
+          name: "维护时间",
+          field: "daywhsj",
+          rank: "monthwhsj",
+          score: "yearwhsj"
+        },
+        {
+          name: "运行时间",
+          field: "dayyxsj",
+          rank: "monthyxsj",
+          score: "yearyxsj"
+        },
+        {
+          name: "停机时间",
+          field: "daytjsj",
+          rank: "monthtjsj",
+          score: "yeartjsj"
+        },
+        {
+          name: "平均切入风速",
+          field: "dayxfqr",
+          type: "性能",
+          rank: "monthxfqr",
+          score: "yearxfqr"
+        },
+        {
+          name: "性能损失电量",
+          field: "dayxnssdl",
+          type: "性能",
+          rank: "monthxnssdl",
+          score: "yearxnssdl"
+        },
+        {
+          name: "拟合优度",
+          field: "daynhyd",
+          type: "性能",
+          rank: "monthnhyd",
+          score: "yearnhyd"
+        },
+        {
+          name: "功率一致性系数",
+          field: "dayglyzxxs",
+          type: "性能",
+          rank: "monthglyzxxs",
+          score: "yearglyzxxs"
+        },
+        {
+          name: "利用小时",
+          field: "daylyxs",
+          type: "可靠性管理",
+          rank: "monthlyxs",
+          score: "yearlyxs"
+        },
+        {
+          name: "设备可利用率",
+          field: "daysbklyl",
+          type: "可靠性管理",
+          rank: "monthsbklyl",
+          score: "yearsbklyl"
+        },
+        {
+          name: "等效可利用率",
+          field: "daydxkyxs",
+          type: "可靠性管理",
+          rank: "monthdxkyxs",
+          score: "yeardxkyxs"
+        },
+        {
+          name: "有效风时数",
+          field: "dayyxfss",
+          type: "可靠性管理",
+          rank: "monthyxfss",
+          score: "yearyxfss"
+        },
+        {
+          name: "平均风速",
+          field: "dayfs",
+          type: "资源",
+          rank: "monthfs",
+          score: "yearfs"
+        },
+        {
+          name: "静风频率",
+          field: "dayjfpl",
+          type: "资源",
+          rank: "monthjfpl",
+          score: "yearjfpl"
+        }
+      ],
+      radarValue: [
+        {
+          indicator: [
+            "平均切入风速",
+            "性能损失电量",
+            "拟合优度",
+            "功率一致性系数",
+            "利用小时",
+            "设备可利用率",
+            "等效可利用系数",
+            "有效风时数",
+            "平均风速",
+            "静风频率"
+          ],
           data: [
             {
-              value: [44210, 14200, 10000, 36000, 50000, 38400, 42200, 14200, 20000, 35000],
-              name: "NAME",
+              value: [
+                44200,
+                14200,
+                20000,
+                35000,
+                50000,
+                38000,
+                44200,
+                14200,
+                20000,
+                35000
+              ],
+              name: "NAME1"
             },
-          ],
-        },
-      ],
+                        {
+              value: [
+                35000,
+                44200,
+                14200,
+                20000,
+                35000,
+                50000,
+                38000,
+                44200,
+                14200,
+                20000,
+                
+              ],
+              name: "NAME2"
+            }
+          ]
+        }
+      ]
     };
-  },
+  }
 };
 </script>
 

+ 278 - 0
src/views/HealthControl/gradeHistory.vue

@@ -0,0 +1,278 @@
+<template>
+  <div>
+    <div class="query mg-b-8">
+      <div class="query-items">
+        <div class="query-item" v-if="option.shows == 'd'">
+          <div class="lable">日期:</div>
+          <div class="search-input">
+            <el-date-picker
+              v-model="option.date"
+              type="date"
+              placeholder="选择日期"
+              popper-class="date-select"
+              value-format="YYYY-MM-DD"
+            ></el-date-picker>
+          </div>
+        </div>
+        <div class="query-item" v-if="option.shows == 'm'">
+          <div class="lable">年月:</div>
+          <div class="search-input">
+            <el-date-picker
+              v-model="option.date"
+              type="month"
+              placeholder="选择年月"
+              popper-class="date-select"
+              value-format="YYYY-MM"
+            ></el-date-picker>
+          </div>
+        </div>
+        <div class="query-item" v-if="option.shows == 'y'">
+          <div class="lable">年:</div>
+          <div class="search-input">
+            <el-date-picker
+              v-model="option.date"
+              type="year"
+              placeholder="选择年"
+              popper-class="date-select"
+              value-format="YYYY"
+            ></el-date-picker>
+          </div>
+        </div>
+        <div class="query-actions">
+          <button class="btn green" @click="getTable">查询</button>
+        </div>
+      </div>
+    </div>
+    <div class="table-box">
+      <Table
+        ref="curRef"
+        :data="hisData"
+        height="70vh"
+        v-loading="tableLoading"
+        element-loading-text="拼命加载中.."
+        element-loading-background="rgba(0, 0, 0, 0.8)"
+      ></Table>
+    </div>
+  </div>
+</template>
+<script>
+import Table from "@/components/coms/table/table-unpage.vue";
+export default {
+  name: "gradeHistory",
+  components: { Table },
+  props: {
+    gridDatas: {},
+    option: Object
+  },
+  data() {
+    return {
+      tableLoading: false,
+      hisData: {
+        column: [
+          {
+            name: "风机编号",
+            field: "windturbineid",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "日期",
+            field: "recorddate",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id",
+            template: function(data) {
+              return new Date(data).formatDate("yyyy-MM-dd");
+            }
+          },
+          {
+            name: "发电量(kWh)",
+            field: "dayfdl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "理论发电量(kWh)",
+            field: "dayllfdl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "平均风速(m/s)",
+            field: "dayfs",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "平均功率(kW)",
+            field: "daygl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "故障损失电量(kWh)",
+            field: "daygzssdl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "限电损失电量(kWh)",
+            field: "dayxdssdl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "维护损失电量(kWh)",
+            field: "daywhssdl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "性能损失电量(kWh)",
+            field: "dayxnssdl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "利用小时数(h)",
+            field: "daylyxs",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "拟合优度(%)",
+            field: "daynhyd",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "设备可利用率(%)",
+            field: "daysbklyl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "等效可用系数(%)",
+            field: "daydxkyxs",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "有效风时数(h)",
+            field: "dayyxfss",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "平均切入风速(m/s)",
+            field: "dayxfqr",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "静风频率(%)",
+            field: "dayjfpl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "功率一致性系数(%)",
+            field: "dayglyzxxs",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          }
+        ],
+        data: [{ a: "aaa" }]
+      }
+    };
+  },
+  created() {
+    this.getTable();
+  },
+  beforeUpdate() {},
+  methods: {
+    getTable() {
+      let that = this;
+      let subUrl = "";
+      const data = {
+        wtId: this.option["windturbineid"]
+      };
+      if ("d" == this.option.shows) {
+        subUrl = "/benchmarking/gadayhistlist";
+        data["recorddate"] = this.option["date"];
+      }
+      if ("m" == this.option.shows) {
+        subUrl = "/benchmarking/gamonthhistlist";
+        const dateStr = this.option["date"].split("-");
+        if (dateStr.length > 1) {
+          data["year"] = dateStr[0];
+          data["month"] = dateStr[1];
+        }
+      }
+      if ("y" == this.option.shows) {
+        subUrl = "/benchmarking/gayearhistlist";
+        data["year"] = this.option["date"];
+      }
+      that.tableLoading = true;
+      that.API.requestData({
+        timeout: 60000,
+        method: "POST",
+        subUrl: subUrl,
+        data: data,
+        success(res) {
+          that.tableLoading = false;
+          if (res.code === 200) {
+            var data = [];
+            res.data.forEach((item, index) => {
+              item["index"] = index;
+              data[index] = item;
+            });
+            that.hisData.data = data;
+          }
+        },
+        Error(res) {
+          console.log("tag", res);
+        }
+      });
+    }
+  }
+};
+</script>
+
+<style lang="less">
+</style>

+ 652 - 0
src/views/HealthControl/gradeassessment.vue

@@ -0,0 +1,652 @@
+<template>
+  <div>
+    <div class="query mg-b-8">
+      <div class="query-items">
+        <div
+          class="newspan"
+          v-for="(item, index) of optionData"
+          :key="index"
+          :class="{ active: cur == index }"
+          @click="handleOpen(item, index)"
+        >{{ item }}</div>
+      </div>
+    </div>
+    <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="value1" clearable placeholder="请选择" popper-class="select">
+              <el-option
+                v-for="item in ChangZhan"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              ></el-option>
+            </el-select>
+          </div>
+        </div>
+        <div class="query-item" v-if="shows == 'd'">
+          <div class="lable">日期:</div>
+          <div class="search-input">
+            <el-date-picker
+              v-model="date"
+              type="date"
+              placeholder="选择日期"
+              popper-class="date-select"
+              value-format="YYYY-MM-DD"
+            ></el-date-picker>
+          </div>
+        </div>
+        <div class="query-item" v-if="shows == 'm'">
+          <div class="lable">年月:</div>
+          <div class="search-input">
+            <el-date-picker
+              v-model="date"
+              type="month"
+              placeholder="选择年月"
+              popper-class="date-select"
+              value-format="YYYY-MM"
+            ></el-date-picker>
+          </div>
+        </div>
+        <div class="query-item" v-if="shows == 'y'">
+          <div class="lable">年:</div>
+          <div class="search-input">
+            <el-date-picker
+              v-model="date"
+              type="year"
+              placeholder="选择年"
+              popper-class="date-select"
+              value-format="YYYY"
+            ></el-date-picker>
+          </div>
+        </div>
+        <div class="query-actions">
+          <button class="btn green" @click="handleSubmit">查询</button>
+          <button class="btn green" @click="contrast">对比</button>
+        </div>
+      </div>
+    </div>
+    <div class="table-box">
+      <div class="title">{{ showTitle }}</div>
+      <ComTable
+        ref="curRef"
+        :data="tableData"
+        :pageSize="20"
+        :pageable=false
+        height="73vh"
+        v-loading="tableLoading"
+        element-loading-text="拼命加载中.."
+        element-loading-background="rgba(0, 0, 0, 0.8)"
+      ></ComTable>
+    </div>
+    <el-dialog :title="dialogTitle" v-model="dialogVisible" width="70%" top="10vh" custom-class="modal">
+      <dayinfo :gridDatas="dialogData1" :chartDatas="dialogData2" />
+    </el-dialog>
+    <el-dialog :title="'历史数据查询>>'+hisDialogTitle" v-model="hisDialogVisible" width="70%" top="10vh" custom-class="modal">
+      <gradeHistory :option="hisOption" ref="gradeHistory"/>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import ComTable from "@/components/coms/table/table-unpage.vue";
+import Dayinfo from "./dayinfo.vue";
+import GradeHistory from "./gradeHistory.vue";
+
+export default {
+  name: "gradeassessment",
+  components: { ComTable, Dayinfo, GradeHistory },
+  data() {
+    let that = this;
+    return {
+      cur: 0,
+      optionData: [
+        "风机日信息量化评级管理",
+        "风机月信息量化评级管理",
+        "风机年信息量化评级管理"
+      ],
+      dialogTitle: "日信息对比",
+      dialogVisible: false,
+      hisDialogVisible: false,
+      hisDialogTitle:"",
+      ChangZhan: [],
+      value1: "XS_FDC",
+      date: "",
+      shows: "d",
+      showTitle: "风机日信息量化评级管理",
+      tableLoading: true,
+      dataIds: new Set(),
+      dialogData1: [],
+      dialogData2: [],
+      hisOption:{},
+      tableData: {
+        column: [
+          {
+            name: "",
+            field: "fj",
+            is_num: false,
+            is_light: false,
+            sortable: false,
+            template: () => {
+              return "<input class='check curCheckBox checkItem' type='CheckBox'/>";
+            },
+            click: function(event, data) {
+              if (event.target.checked == false) {
+                that.dataIds.delete(data.id);
+              }
+              if (event.target.checked) {
+                if (that.dataIds.size < 2) {
+                  that.dataIds.add(data.id);
+                } else {
+                  event.target.checked = false;
+                }
+              }
+            }
+          },
+          {
+            name: "风机编号",
+            field: "windturbineid",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "等級",
+            field: "level",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+
+          {
+            name: "综合排名",
+            field: "rank",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "发电量(kWh)",
+            field: "dayfdl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "理论发电量(kWh)",
+            field: "dayllfdl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "平均风速(m/s)",
+            field: "dayfs",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "平均功率(kW)",
+            field: "daygl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "故障损失电量(kWh)",
+            field: "daygzssdl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "限电损失电量(kWh)",
+            field: "dayxdssdl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "维护损失电量(kWh)",
+            field: "daywhssdl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "性能损失电量(kWh)",
+            field: "dayxnssdl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "利用小时数(h)",
+            field: "daylyxs",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "拟合优度(%)",
+            field: "daynhyd",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "设备可利用率(%)",
+            field: "daysbklyl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "等效可用系数(%)",
+            field: "daydxkyxs",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "有效风时数(h)",
+            field: "dayyxfss",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "平均切入风速(m/s)",
+            field: "dayxfqr",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "静风频率(%)",
+            field: "dayjfpl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "功率一致性系数(%)",
+            field: "dayglyzxxs",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "操作",
+            field: "sjbz",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id",
+            template: () => {
+              return "<a href='javascript:void(0);' value='xq'>详情</a>&nbsp;<a href='javascript:void(0);' value='ls'>历史</a>";
+            },
+            click: function(event, data) {
+              if('xq' == event.target.getAttribute("value")){
+                that.dialogVisible = true;
+                that.dialogData1 = [data];
+                const service1 = {
+                  name: data.windturbineid,
+                  value: [
+                    data["yearxfqr"],
+                    data["yearxnssdl"],
+                    data["yearnhyd"],
+                    data["yearglyzxxs"],
+                    data["yearlyxs"],
+                    data["yearsbklyl"],
+                    data["yeardxkyxs"],
+                    data["yearyxfss"],
+                    data["yearfs"],
+                    data["yearjfpl"]
+                  ]
+                };
+                const chartData = [
+                  {
+                    indicator: [
+                      "平均切入风速",
+                      "性能损失电量",
+                      "拟合优度",
+                      "功率一致性系数",
+                      "利用小时",
+                      "设备可利用率",
+                      "等效可利用系数",
+                      "有效风时数",
+                      "平均风速",
+                      "静风频率"
+                    ],
+                    data: [service1]
+                  }
+                ];
+                that.dialogData2 = chartData;
+              }
+              if('ls' == event.target.getAttribute("value")){
+                that.hisOption["shows"] = that.shows;
+                that.hisOption["date"] = that.date;
+                that.hisOption["windturbineid"] = data.windturbineid;
+                that.hisDialogTitle = data.windturbineid;
+                that.hisDialogVisible = true;
+                that.$refs.gradeHistory.getTable();
+              }
+            }
+          }
+        ],
+        data: []
+      },
+      tableId: ""
+    };
+  },
+  created() {
+    this.ChangZhanVal();
+    this.date = this.getDate(0);
+    this.getTable(this.date);
+  },
+  methods: {
+    clearCheckBox() {
+      this.$refs.curRef.clearCheckBox();
+      this.dataIds = new Set();
+    },
+    // 获取表格数据
+    getTable(date) {
+      let that = this;
+      let subUrl = "";
+      const data = {
+        isAsc: "asc",
+        wpId: this.value1
+      };
+      if ("d" == this.shows) {
+        subUrl = "/benchmarking/gadaylistByPage";
+        data["recorddate"] = date;
+      }
+      if ("m" == this.shows) {
+        subUrl = "/benchmarking/gamonthlistByPage";
+        const dateStr = date.split("-");
+        if (dateStr.length > 1) {
+          data["year"] = dateStr[0];
+          data["month"] = dateStr[1];
+        }
+      }
+      if ("y" == this.shows) {
+        subUrl = "/benchmarking/gayearlistByPage";
+        data["year"] = date;
+      }
+      that.tableLoading = true;
+      that.API.requestData({
+        timeout: 60000,
+        method: "POST",
+        subUrl: subUrl,
+        data: data,
+        success(res) {
+          that.tableLoading = false;
+          if (res.code === 200) {
+            var data = [];
+            res.data.list.forEach((item, index) => {
+              item["index"] = index;
+              data[index] = item;
+            });
+            that.tableData.data = data;
+          }
+        },
+        Error(res) {
+          console.log("tag", res);
+        }
+      });
+    },
+    //   tab
+    handleOpen(vl, index) {
+      this.$nextTick(() => {
+        this.cur = index;
+        this.showTitle = vl;
+        if (index == 0) {
+          this.date = this.getDate(0);
+          this.shows = "d";
+          this.dialogTitle = "日信息对比";
+        }
+        if (index == 1) {
+          this.date = this.getDate(1);
+          this.shows = "m";
+          this.dialogTitle = "月信息对比";
+        }
+        if (index == 2) {
+          this.date = this.getDate(2);
+          this.shows = "y";
+          this.dialogTitle = "年信息对比";
+        }
+      });
+    },
+    // 场站
+    ChangZhanVal() {
+      var that = this;
+      that.API.requestData({
+        method: "GET",
+        baseURL: "http://10.155.32.4:9001/",
+        subUrl: "benchmarking/wplist",
+        success(res) {
+          that.ChangZhan = res.data;
+          that.value1 = res.data[0].id;
+        }
+      });
+    },
+    // 查询
+    handleSubmit() {
+      this.clearCheckBox();
+      this.getTable(this.date);
+    },
+    // 日信息对比
+    contrast() {
+      var that = this;
+      if (that.dataIds.size == 2) {
+        that.dialogVisible = true;
+        const tmpArr = Array.from(that.dataIds);
+        const data = {
+          gaid1: tmpArr[0],
+          gaid2: tmpArr[1]
+        };
+
+        that.API.requestData({
+          method: "GET",
+          subUrl: "/benchmarking/wtinfo",
+          data: data,
+          success(res) {
+            that.dialogData1 = [res.data.gaid1, res.data.gaid2];
+          }
+        });
+        that.API.requestData({
+          method: "GET",
+          subUrl: "/benchmarking/wtchart",
+          data: data,
+          success(res) {
+            const data1 = res.data.gaid1;
+            const data2 = res.data.gaid2;
+            const chartData = [
+              {
+                indicator: [
+                  "平均切入风速",
+                  "性能损失电量",
+                  "拟合优度",
+                  "功率一致性系数",
+                  "利用小时",
+                  "设备可利用率",
+                  "等效可利用系数",
+                  "有效风时数",
+                  "平均风速",
+                  "静风频率"
+                ],
+                data: []
+              }
+            ];
+            if (data1) {
+              chartData[0].data.push(that.getChartData(data1));
+            }
+            if (data2) {
+              chartData[0].data.push(that.getChartData(data2));
+            }
+            that.dialogData2 = chartData;
+          }
+        });
+      }
+      this.clearCheckBox();
+    },
+    getChartData(resData) {
+      const chartData = {};
+      const rowMap = {};
+      resData.forEach(function(rowData, index) {
+        rowMap[rowData["name"]] = rowData["data1"];
+      });
+      chartData["name"] = resData[resData.length - 1]["name"];
+      chartData["value"] = [];
+      chartData["value"].push(rowMap["平均切入风速"]);
+      chartData["value"].push(rowMap["性能损失电量"]);
+      chartData["value"].push(rowMap["拟合优度"]);
+      chartData["value"].push(rowMap["功率一致性系数"]);
+      chartData["value"].push(rowMap["利用小时"]);
+      chartData["value"].push(rowMap["设备可利用率"]);
+      chartData["value"].push(rowMap["等效可利用系数"]);
+      chartData["value"].push(rowMap["有效风时数"]);
+      chartData["value"].push(rowMap["平均风速"]);
+      chartData["value"].push(rowMap["静风频率"]);
+      return chartData;
+    },
+    // 获取日期
+    getDate(vl) {
+      var date = new Date();
+      var year = date.getFullYear(),
+        month = date.getMonth() + 1,
+        day = date.getDate() - 1;
+      month >= 1 && month <= 9 ? (month = "0" + month) : "";
+      day >= 0 && day <= 9 ? (day = "0" + day) : "";
+      if (vl == 0) {
+        return year + "-" + month + "-" + day;
+      }
+      if (vl == 1) {
+        return year + "-" + month;
+      }
+      if (vl == 2) {
+        return year + "";
+      }
+    }
+  }
+};
+</script>
+<style scoped>
+.newsDiv {
+  color: rgba(255, 255, 255, 0.75);
+  background-color: rgba(255, 255, 255, 0.1);
+  margin-bottom: 8px;
+  line-height: 3.4259vh;
+  padding: 0 15px;
+}
+.newspan {
+  line-height: 30px;
+  cursor: pointer;
+  padding: 0 1vw;
+  margin: 0 2px;
+  color: #9ca5a8;
+  transition: color 0.2s ease-in-out;
+  position: relative;
+}
+.newspan:hover {
+  background: linear-gradient(
+    to top,
+    rgba(5, 187, 76, 0.5),
+    rgba(5, 187, 76, 0)
+  );
+  color: white;
+  position: relative;
+}
+.newspan:hover::after {
+  content: "";
+  position: absolute;
+  width: 100%;
+  height: 0.463vh;
+  border: 0.093vh solid #05bb4c;
+  border-top: 0;
+  left: 0;
+  bottom: 0;
+  box-sizing: border-box;
+}
+.active {
+  background: linear-gradient(
+    to top,
+    rgba(5, 187, 76, 0.5),
+    rgba(5, 187, 76, 0)
+  );
+  color: white;
+  position: relative;
+}
+.active::after {
+  content: "";
+  position: absolute;
+  width: 100%;
+  height: 0.463vh;
+  border: 0.093vh solid #05bb4c;
+  border-top: 0;
+  left: 0;
+  bottom: 0;
+  box-sizing: border-box;
+}
+.title {
+  background: rgba(255, 255, 255, 0.1);
+  margin-bottom: 8px;
+  padding: 1vh;
+}
+</style>
+<style lang="less">
+.decision-page-2 {
+  .content .project-table {
+    tbody {
+      height: calc(100vh - 24.5vh);
+    }
+  }
+  .project-table {
+    overflow: auto;
+    tbody {
+      height: 239px;
+    }
+
+    th,
+    td {
+      color: #b2bdc0;
+
+      &:nth-child(1) {
+        width: 50px;
+      }
+
+      &:nth-child(2) {
+        width: 50px;
+      }
+    }
+  }
+
+  .action {
+    text-decoration: underline;
+    color: @green;
+    cursor: pointer;
+  }
+}
+</style>

+ 23 - 18
src/views/layout/Menu.vue

@@ -170,7 +170,7 @@ export default {
                 {
                   text: "曲线偏差率分析",
                   icon: "svg-wind-site",
-                  path: "/nxfx4",
+                  path: "/qxpclfx",
                 },
                 {
                   text: "单机性能分析",
@@ -312,6 +312,11 @@ export default {
               path: "/health",
               children: [
                 {
+                  text: "量化评级",
+                  icon: "svg-wind-site",
+                  path: "/djpg",
+                },
+                {
                   text: "健康推荐",
                   icon: "svg-wind-site",
                   path: "/health",
@@ -547,38 +552,38 @@ export default {
   },
 };
 </script>
-
+ 
 <style lang="less">
 .menu {
   padding-top: 1.481vh;
-
+ 
   .menu-list {
     margin: 0;
     padding: 0;
     list-style: none;
-
+ 
     .menu-item {
       padding: 1.481vh 0;
       text-align: center;
-
+ 
       .menu-icon {
         display: flex;
         justify-content: center;
       }
-
+ 
       &.active i {
         color: #05bb4c;
         transition: color 1s;
       }
     }
   }
-
+ 
   i {
     font-size: 2.222vh;
     color: rgba(255, 255, 255, 50%);
   }
 }
-
+ 
 .sub-menu {
   position: absolute;
   top: 0;
@@ -589,19 +594,19 @@ export default {
   background: fade(#192a26, 75);
   border-right: 1px solid fade(@green, 50);
   box-shadow: inset 11px 0px 20px 0px fade(#021412, 60);
-
+ 
   .menu-list {
     margin: 0;
     padding: 0;
     list-style: none;
-
+ 
     .menu-item {
       display: flex;
       text-align: center;
       line-height: 1.5;
       padding: 8px 0;
       background: #121d1c;
-
+ 
       a {
         display: flex;
         width: 100%;
@@ -609,7 +614,7 @@ export default {
         padding: 0 1.4815vh;
         font-size: @fontsize-s;
         text-decoration: unset;
-
+ 
         .menu-icon {
           display: flex;
           align-items: center;
@@ -622,10 +627,10 @@ export default {
           }
         }
       }
-
+ 
       &.active {
         background: #323e70;
-
+ 
         .menu-icon {
           display: flex;
           svg use {
@@ -633,21 +638,21 @@ export default {
           }
         }
       }
-
+ 
       .sub-menu-text {
         margin-left: 1.1111vh;
         color: @gray-l;
       }
-
+ 
       & + .menu-item {
         border-top: 1px solid fade(@darkgray, 40);
       }
     }
   }
-
+ 
   i {
     font-size: 2.222vh;
     color: rgba(255, 255, 255, 50%);
   }
 }
-</style>
+</style>

+ 324 - 0
src/views/nxfx/qxpclfx.vue

@@ -0,0 +1,324 @@
+<template>
+  <div>
+    <div class="query mg-b-8">
+      <div class="query-items">
+        <div
+          class="newspan"
+          v-for="(item, index) of optionData"
+          :key="index"
+          :class="{ active: cur == index }"
+          @click="handleOpen(item, index)"
+        >
+          {{ item }}
+        </div>
+      </div>
+    </div>
+    <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="value1"
+              clearable
+              placeholder="请选择"
+              popper-class="select"
+            >
+              <el-option
+                v-for="item in ChangZhan"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </div>
+        <div class="query-item" v-if="shows == true">
+          <div class="lable">年月:</div>
+          <div class="search-input">
+            <el-date-picker
+              v-model="date"
+              type="month"
+              placeholder="选择年月"
+              popper-class="date-select"
+              value-format="YYYY-MM"
+            >
+            </el-date-picker>
+          </div>
+        </div>
+        <div class="query-item" v-else>
+          <div class="lable">日期:</div>
+          <div class="search-input">
+            <el-date-picker
+              v-model="date2"
+              type="date"
+              placeholder="选择日期"
+              popper-class="date-select"
+              value-format="YYYY-MM-DD"
+            >
+            </el-date-picker>
+          </div>
+        </div>
+        <div class="query-actions">
+          <button class="btn green" @click="handleSubmit">查询</button>
+        </div>
+      </div>
+    </div>
+    <div class="table-box">
+      <div class="title">{{ showTitle }}</div>
+      <ComTable
+        :data="tableData"
+        :pageSize="20"
+        height="73vh"
+        v-loading="tableLoading"
+        element-loading-text="拼命加载中.."
+        element-loading-background="rgba(0, 0, 0, 0.8)"
+      ></ComTable>
+    </div>
+  </div>
+</template>
+<script>
+import ComTable from "@/components/coms/table/table-qc.vue";
+import thermometerVue from "../../components/chart/bar/thermometer.vue";
+export default {
+  name: "qxpclfx",
+  components: { ComTable },
+  data() {
+    return {
+      cur: 0,
+      optionData: ["月曲线偏差率排行榜", "日曲线偏差率排行榜"],
+      ChangZhan: [],
+      value1: "XS_FDC",
+      date: "",
+      date2: "",
+      shows: true,
+      showTitle: "月曲线偏差率排行榜",
+      tableLoading: true,
+      tableData: {
+        column: [
+          {
+            name: "风机",
+            field: "fj",
+            is_num: false,
+            is_light: false,
+            sortable: thermometerVue
+          },
+          {
+            name: "实际 / 保证(%)",
+            field: "sjbz",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "实际 / 最优(%)",
+            field: "sjzy",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "最优 / 保证(%)",
+            field: "zybz",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "环比",
+            field: "hb",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "同比",
+            field: "tb",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          },
+          {
+            name: "比标杆风机",
+            field: "bbgfj",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            id: "id"
+          }
+        ],
+        data: []
+      },
+      tableId: ""
+    };
+  },
+  created() {
+    this.ChangZhanVal();
+    this.date = this.getDate(1);
+    this.date2 = this.getDate(2);
+    this.getTable(this.date);
+  },
+  methods: {
+    // 获取表格数据
+    getTable(date) {
+      let that = this;
+      that.tableLoading = true;
+      that.API.requestData({
+        timeout:60000,
+        method: "POST",
+        subUrl: "/leaderboard/curvefittingmainList",
+        data: {
+          isAsc: "asc",
+          wpId: that.value1,
+          recorddate: date
+        },
+        success(res) {
+          that.tableLoading = false;
+          if (res.code === 200) {
+            // that.tableData.data = res.data
+            var data = [];
+            res.data.forEach((item, index) => {
+              data[index] = {
+                fj: item.windturbineid,
+                sjbz: item.deviationrate2,
+                sjzy: item.deviationrate1,
+                zybz: item.deviationrate3,
+                hb: item.monthdeviationrate,
+                tb: item.yeardeviationrate,
+                bbgfj: item.standarddeviationrate
+              };
+            });
+            that.tableData.data = data;
+          }
+        },
+        Error(res) {
+          console.log("tag", res);
+        }
+      });
+    },
+    //   tab
+    handleOpen(vl, index) {
+      this.$nextTick(() => {
+        this.cur = index;
+        this.showTitle = vl;
+        if (index == 0) {
+          this.getDate(1);
+          this.shows = true;
+        } else {
+          this.getDate(2);
+          this.shows = false;
+        }
+      });
+    },
+    // 场站
+    ChangZhanVal() {
+      var that = this;
+      that.API.requestData({
+        method: "GET",
+        baseURL: "http://10.155.32.4:9001/",
+        subUrl: "benchmarking/wplist",
+        success(res) {
+          that.ChangZhan = res.data;
+          that.value1 = res.data[0].id;
+        }
+      });
+    },
+    // 查询
+    handleSubmit() {
+      if (this.shows == true) {
+        // alert(this.date);
+        this.getTable(this.date);
+      } else {
+        // alert(this.date2);
+        this.getTable(this.date2);
+      }
+    },
+    // 获取日期
+    getDate(vl) {
+      //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
+      var date = new Date();
+      var year = date.getFullYear(),
+        month = date.getMonth() + 1,
+        day = date.getDate() - 1;
+      month >= 1 && month <= 9 ? (month = "0" + month) : "";
+      day >= 0 && day <= 9 ? (day = "0" + day) : "";
+      var begin = year + "-" + month;
+      var end = year + "-" + month + "-" + day;
+      if (vl == 1) {
+        return begin;
+      } else if (vl == 2) {
+        return end;
+      }
+    },
+  }
+};
+</script>
+<style scoped>
+.newsDiv {
+  color: rgba(255, 255, 255, 0.75);
+  background-color: rgba(255, 255, 255, 0.1);
+  margin-bottom: 8px;
+  line-height: 3.4259vh;
+  padding: 0 15px;
+}
+.newspan {
+  line-height: 30px;
+  cursor: pointer;
+  padding: 0 1vw;
+  margin: 0 2px;
+  color: #9ca5a8;
+  transition: color 0.2s ease-in-out;
+  position: relative;
+}
+.newspan:hover {
+  background: linear-gradient(
+    to top,
+    rgba(5, 187, 76, 0.5),
+    rgba(5, 187, 76, 0)
+  );
+  color: white;
+  position: relative;
+}
+.newspan:hover::after {
+  content: "";
+  position: absolute;
+  width: 100%;
+  height: 0.463vh;
+  border: 0.093vh solid #05bb4c;
+  border-top: 0;
+  left: 0;
+  bottom: 0;
+  box-sizing: border-box;
+}
+.active {
+  background: linear-gradient(
+    to top,
+    rgba(5, 187, 76, 0.5),
+    rgba(5, 187, 76, 0)
+  );
+  color: white;
+  position: relative;
+}
+.active::after {
+  content: "";
+  position: absolute;
+  width: 100%;
+  height: 0.463vh;
+  border: 0.093vh solid #05bb4c;
+  border-top: 0;
+  left: 0;
+  bottom: 0;
+  box-sizing: border-box;
+}
+.title {
+  background: rgba(255, 255, 255, 0.1);
+  margin-bottom: 8px;
+  padding: 1vh;
+}
+</style>