Browse Source

健康报告功能

lizaixun 3 years ago
parent
commit
bac43c5550

+ 13 - 0
src/assets/css/healthManagement/healthAssessment.scss

@@ -0,0 +1,13 @@
+.box{
+    width: 100%;
+    display: flex;
+    justify-content: space-around;
+     align-items: center;
+     overflow: hidden;
+  }
+.searchBar{
+    margin-top: 1%;
+}
+.box-card{
+    width: 100%;
+}

+ 7 - 0
src/assets/css/healthManagement/healthAssessmentDetailed.scss

@@ -0,0 +1,7 @@
+.box{
+    width: 100%;
+    // display: flex;
+    justify-content: space-around;
+     align-items: center;
+     overflow: hidden;
+}

+ 110 - 0
src/assets/js/healthManagement/healthAssessment.js

@@ -0,0 +1,110 @@
+// import {formatDate} from '../../utils/fomatDate';
+export default {
+    data(){
+        return {
+            pdfTitle: '因子评价报告',
+            pdfSelector: '单机性能分析',
+            formInline: {
+                windfarm: "",
+                project: "",
+                line: "",
+            },
+            value:'',
+            value2:'',
+            options:[],
+            options2:[],
+            time:'',
+            fanData:'',
+            tableData: [],
+            timedate: [
+            // {beginDate:'2021-01-01'},
+            // {endDate:'2021-01-04'}
+            ],
+            beginDate:'',
+            endDate:'',
+            updateTime:'',
+            updateTime1:'',
+            recodedate:'',
+            
+        }
+    },
+    filters: { 
+        rounding (value) {
+            return value.toFixed(2)
+        }
+        
+    },
+    created(){
+        this.API.get('/powercompare/windfarmAjax').then((res) => {
+            this.options = res.data;
+        })
+        this.getHealthForm();
+    },
+    methods:{
+        queryApData() {
+             this.getHealthForm();
+        },
+        formatDate(time) {
+            let date = new Date(time.recodedate);
+            return this.BASE.getBzDate(date, 0);
+        },
+        handleEdit(a,b){
+          console.log(b)
+          let date = new Date(b.recodedate);
+          this.recodedate = this.BASE.getBzDate(date, 0);
+          this.$router.push({
+            path:'/healthAssessmentDetailed',
+            query:{
+              data:b,
+              recorddate: this.recodedate,
+            }
+          })
+        },
+        headStyle() {
+          return "text-align:center"
+        },
+        changeTableSort(column){
+          this.orderByColumn = column.prop;
+          if(column.order == "descending"){
+            this.isAsc = 'desc';
+          }else if(column.order == "ascending"){
+            this.isAsc = "asc";
+          }
+          this.performance();
+        },
+        getFCData(){
+            this.API.get('/powercompare/windturbineAjax?wpId=' + this.value).then((res) => {
+                this.options2 = res.data;
+            })
+        },
+        getHealthForm(){
+            var newData = new Date();
+            this.updateTime = this.BASE.getBzDate(newData.getTime(), 0);
+            this.updateTime1 = this.BASE.getBzDate(newData.getTime(), -1);
+            if(this.timedate == ''){
+                this.timedate[0] = this.updateTime1;
+                this.timedate[1] = this.updateTime;
+                this.beginDate = this.timedate[0];
+                this.endDate = this.timedate[1];
+            }else{
+                this.beginDate = this.timedate[0];
+                this.endDate = this.timedate[1];
+            }
+            var healthForm = new URLSearchParams();
+            healthForm.append('wtId',this.value2);
+            healthForm.append('beginDate',this.beginDate);
+            healthForm.append('endDate',this.endDate);
+            this.API.post('/report/getReportList',healthForm).then((res) =>{
+                console.log(res.data)
+                if(res.data == ''){
+
+                }else{
+                    this.tableData.push(res.data[0])
+                    console.log(this.tableData)
+                }
+                
+
+            })
+        },
+    }
+}

+ 243 - 0
src/assets/js/healthManagement/healthAssessmentDetailed.js

@@ -0,0 +1,243 @@
+export default {
+    data(){
+        return {
+            tjdiv:'',
+            tableDataAll:[],
+            fdjtable:[],
+            clxtable:[],
+            zktable:[],
+            bjtable:[],
+            wtid:'',
+            textData:'',
+            recorddate:'',
+            qxpclChart:'',
+            qxpclData:[],
+            qxpcljzzData:[],
+            xqxpcldata:[],
+            fdlChart:[],
+            clxChart:[],
+            bjChart:[],
+            zkChart:[],
+            fdlData:[],
+            clxData:[],
+            bjData:[],
+            zkData:[],
+            xfdldata:[],
+            xclxdata:[],
+            xbjdata:[],
+            xzkdata:[],
+            //推荐检修风速
+            windspeed:'',
+            //结论
+            conclusion:'',
+            //高频
+            highfrequency:'',
+            //中频
+            intermediatefrequency:'',
+            //低频
+            lowfrequency:'',
+            //推荐工具器
+            tools:'',
+            //平均消缺时长
+            mainhour:'',
+            //推荐检修方法
+            mainmethod:'',
+            //推荐检修日期
+            maindate:'',
+            //报告出具时间
+            bgcjdate:'',
+            //风机
+            wtName:'',
+            //评级操作
+            djpgjb:'',
+            //推荐处理方法
+            approach:'',
+            // 推荐检修理由
+            mainreason:'',
+            //echart数值大小
+            max:'',
+            
+
+        }
+    },
+    created(){
+        this.getData();
+        this.KeyparameterData();
+    },
+    methods:{
+        headStyle() {
+          return "text-align:center"
+        },
+        KeyparameterData(){
+            this.fdjtable.push({name:'发电机轴A温度',edz:'76',yxfw:'0-95',qz:'0.035'});
+            this.fdjtable.push({name:'发电机轴B温度',edz:'76',yxfw:'0-95',qz:'0.035'});
+            this.fdjtable.push({name:'发电机U相绕组温度',edz:'120',yxfw:'0-150',qz:'0.038'});
+            this.fdjtable.push({name:'发电机V相绕组温度',edz:'120',yxfw:'0-150',qz:'0.427'});
+            this.fdjtable.push({name:'发电机W相绕组温度',edz:'120',yxfw:'0-150',qz:'0.465'});
+            this.fdjtable.push({name:'发电机冷却风',edz:'56',yxfw:'0-70',qz:'0'});
+            this.clxtable.push({name:'齿轮箱输入轴1油温',edz:'76',yxfw:'0-95',qz:'0.0114'});
+            this.clxtable.push({name:'齿轮箱输入轴2油温',edz:'76',yxfw:'0-95',qz:'0.4537'});
+            this.clxtable.push({name:'齿轮箱入口油温',edz:'64',yxfw:'0-80',qz:'0.0218'});
+            this.clxtable.push({name:'齿轮箱油温',edz:'31',yxfw:'10-14-76-80',qz:'0.5131'});
+            this.bjtable.push({name:'变浆电容器温度1',edz:'52',yxfw:'0-65',qz:'0.0069'});
+            this.bjtable.push({name:'变浆电容器温度2',edz:'52',yxfw:'0-65',qz:'0.0069'});
+            this.bjtable.push({name:'变浆电容器温度3',edz:'52',yxfw:'0-65',qz:'0.0069'});
+            this.bjtable.push({name:'变浆电容电压1',edz:'58',yxfw:'53-56-60-63',qz:'0.2724'});
+            this.bjtable.push({name:'变浆电容电压2',edz:'58',yxfw:'53-56-60-63',qz:'0.2724'});
+            this.bjtable.push({name:'变浆电容电压3',edz:'58',yxfw:'53-56-60-63',qz:'0.2724'});
+            this.bjtable.push({name:'变浆电流器温度1',edz:'60',yxfw:'0-75',qz:'0.0128'});
+            this.bjtable.push({name:'变浆电流器温度2',edz:'60',yxfw:'0-75',qz:'0.0128'});
+            this.bjtable.push({name:'变浆电流器温度3',edz:'60',yxfw:'0-75',qz:'0.0128'});
+            this.bjtable.push({name:'电机温度1',edz:'110',yxfw:'0-135',qz:'0.0083'});
+            this.bjtable.push({name:'电机温度2',edz:'110',yxfw:'0-135',qz:'0.0083'});
+            this.bjtable.push({name:'电机温度3',edz:'110',yxfw:'0-135',qz:'0.0083'});
+            this.bjtable.push({name:'变浆控制柜温度1',edz:'52',yxfw:'0-65',qz:'0.0033'});
+            this.bjtable.push({name:'变浆控制柜温度2',edz:'52',yxfw:'0-65',qz:'0.0033'});
+            this.bjtable.push({name:'变浆控制柜温度3',edz:'52',yxfw:'0-65',qz:'0.0033'});
+            this.zktable.push({name:'塔底柜温度',edz:'40',yxfw:'0-50',qz:'0.75'});
+            this.zktable.push({name:'塔顶机舱柜温度',edz:'60',yxfw:'0-75',qz:'0.25'});
+            
+
+        },
+        changeTableSort(column){
+          this.orderByColumn = column.prop;
+          if(column.order == "descending"){
+            this.isAsc = 'desc';
+          }else if(column.order == "ascending"){
+            this.isAsc = "asc";
+          }
+        }, 
+        getData(){
+            this.qxpclData = [];
+            this.qxpcljzzData = [];
+            this.fdlData = [];
+            this.wtid = this.$route.query.data.wtid;
+            this.recorddate = this.$route.query.recorddate;
+            console.log(this.recorddate)
+            var healthForm = new URLSearchParams();
+            healthForm.append('wtId',this.wtid);
+            healthForm.append('recorddate',this.recorddate);
+            this.API.post('/report/healthReport',healthForm).then((res) =>{
+                console.log(res.data)
+                this.qxpclChart = res.data.sub;
+                if(res.data.main.gztop3name == '健康指标未达到推荐级别,故不在推荐范围之内'){
+                    this.tjdiv = false;
+                }else{
+                    this.tjdiv = true;
+                }
+                for(let i=0;i<this.qxpclChart.length;i++){
+                    this.djpgjb = this.qxpclChart[0].djpgjb;
+                    this.qxpclData.push(this.qxpclChart[i].qxpcl);
+                    this.qxpcljzzData.push(this.qxpclChart[i].qxpcljzz);
+                    let datechart = new Date(this.qxpclChart[i].recodedate);
+                    this.xqxpcldata.push(this.BASE.getBzDate(datechart, 0));
+                    this.$nextTick(function() {
+                        this.getChartDataImport('chartHistogram')
+                    })
+                }
+                this.conclusion = res.data.main.gztop3name;
+                this.highfrequency = res.data.main.top1type;
+                this.intermediatefrequency = res.data.main.top2type;
+                this.lowfrequency = res.data.main.top3type;
+                this.windspeed = res.data.main.speed;
+                this.tools = res.data.main.tools;
+                this.mainhour = res.data.main.mainhour;
+                this.mainmethod = res.data.main.mainmethod;
+                this.maindate = res.data.main.maindate;
+                let date = new Date(this.maindate);
+                this.maindate = this.BASE.getBzDate(date, 0);
+                this.bgcjdate = res.data.main.recodedate;
+                let datebg = new Date(this.bgcjdate);
+                this.bgcjdate = this.BASE.getBzDate(datebg, 0);
+                this.approach = res.data.main.approach;
+                this.mainreason = res.data.main.mainreason;
+            })
+            var healthFormCharts = new URLSearchParams();
+            healthFormCharts.append('wtId',this.wtid);
+            healthFormCharts.append('partId','fdj');
+            healthFormCharts.append('recorddate',this.recorddate);
+            this.API.post('/report/healthReportChart',healthFormCharts).then((res) =>{
+                this.fdlChart = res.data;
+                for(let i=0;i<this.fdlChart.length;i++){
+                    this.fdlData.push(this.fdlChart[i].value);
+                    let datefdlchart = new Date(this.fdlChart[i].recorddate);
+                    this.xfdldata.push(this.BASE.getBzDate(datefdlchart, 0));
+                    this.$nextTick(function() {
+                        this.getChartDataImport2('chartHistogram2')
+                    })
+                }
+            })
+            var gearboxCharts = new URLSearchParams();
+            gearboxCharts.append('wtId',this.wtid);
+            gearboxCharts.append('partId','clx');
+            gearboxCharts.append('recorddate',this.recorddate);
+            this.API.post('/report/healthReportChart',gearboxCharts).then((res) =>{
+                this.clxChart = res.data;
+                for(let i=0;i<this.clxChart.length;i++){
+                    this.clxData.push(this.clxChart[i].value);
+                    let dateclxchart = new Date(this.clxChart[i].recorddate);
+                    this.xclxdata.push(this.BASE.getBzDate(dateclxchart, 0));
+                    this.$nextTick(function() {
+                        this.getChartDataImport3('chartHistogram3')
+                    })
+                }
+            })
+            var PitchCharts = new URLSearchParams();
+            PitchCharts.append('wtId',this.wtid);
+            PitchCharts.append('partId','bj');
+            PitchCharts.append('recorddate',this.recorddate);
+            this.API.post('/report/healthReportChart',PitchCharts).then((res) =>{
+                this.bjChart = res.data;
+                for(let i=0;i<this.bjChart.length;i++){
+                    this.bjData.push(this.bjChart[i].value);
+                    let datebjchart = new Date(this.bjChart[i].recorddate);
+                    this.xbjdata.push(this.BASE.getBzDate(datebjchart, 0));
+                    this.$nextTick(function() {
+                        this.getChartDataImport4('chartHistogram4')
+                    })
+                }
+            })
+            var mastercontrolCharts = new URLSearchParams();
+            mastercontrolCharts.append('wtId',this.wtid);
+            mastercontrolCharts.append('partId','zk');
+            mastercontrolCharts.append('recorddate',this.recorddate);
+            this.API.post('/report/healthReportChart',mastercontrolCharts).then((res) =>{
+                this.zkChart = res.data;
+                console.log(this.zkChart)
+                for(let i=0;i<this.zkChart.length;i++){
+                    this.wtName = this.zkChart[0].wtname;
+                    this.zkData.push(this.zkChart[i].value);
+                    let datezkchart = new Date(this.zkChart[i].recorddate);
+                    this.xzkdata.push(this.BASE.getBzDate(datezkchart, 0))
+                    this.$nextTick(function() {
+                        this.getChartDataImport5('chartHistogram5')
+                    })
+                }
+            })
+        },
+        getChartDataImport(){
+            this.ECLZX.getHealthCurve("chartHistogram",['曲线偏差率', '基准值'],
+            this.xqxpcldata,this.qxpclData,this.qxpcljzzData);
+        },
+        getChartDataImport2(){
+            this.max = 5;
+            this.ECLZX.getHealthTrendChart("chartHistogram2",['发电量健康走势'],
+            this.xfdldata,this.max,this.fdlData);
+        },
+         getChartDataImport3(){
+            this.max = 1;
+            this.ECLZX.getHealthTrendChart("chartHistogram3",['齿轮箱健康走势'],
+            this.xclxdata,this.max,this.clxData);
+        },
+        getChartDataImport4(){
+            this.max = 5;
+            this.ECLZX.getHealthTrendChart("chartHistogram4",['变桨健康走势'],
+            this.xbjdata,this.max,this.bjData);
+        },
+        getChartDataImport5(){
+            this.max = 5;
+            this.ECLZX.getHealthTrendChart("chartHistogram5",['主控健康走势'],
+            this.xzkdata,this.max,this.zkData);
+        },
+    }
+}

+ 5 - 0
src/jsonData/menu.json

@@ -241,6 +241,11 @@
       "url": null,
       "children": [
         {
+          "name": "健康评价报告",
+          "url": "/healthAssessment",
+          "children": []
+        },
+        {
           "name": "等级评估",
           "url": "/a",
           "children": []

+ 9 - 0
src/router/lzx.js

@@ -47,4 +47,13 @@ export default [
     path:'/fiveLossRates',
     component: r => require.ensure([], () => r(require('@views/lossBenchmarking/fiveLossRates')), 'lossBenchmarking')
   },
+  { // 健康评价报告
+    path:'/healthAssessment',
+    component: r => require.ensure([], () => r(require('@views/healthManagement/healthAssessment')), 'healthManagement')
+  },
+  { // 健康评价报告
+    path:'/healthAssessmentDetailed',
+    component: r => require.ensure([], () => r(require('@views/healthManagement/healthAssessmentDetailed')), 'healthManagement')
+  },
+  
 ]

+ 152 - 0
src/tools/echartsToolLzx.js

@@ -634,6 +634,156 @@ export function getFiveLossSectorRight(id, chartsAName2, getChartDataValue2) {
   myChart.setOption(option, true);
 }
 
+//健康报告近一周曲线偏差率对比
+export function getHealthCurve(id, legend, xqxpcldata,qxpclData,qxpcljzzData) {
+  if (xqxpcldata === undefined) {
+    message.error("没有找到报表数据,请检查!");
+    return;
+  }
+  if (qxpclData === undefined) {
+    message.error("没有找到报表数据,请检查!");
+    return;
+  }
+  if (qxpcljzzData === undefined) {
+    message.error("没有找到报表数据,请检查!");
+    return;
+  }
+  var myChart = EC.init(document.getElementById(id));
+  let option = {
+    tooltip: {
+        trigger: 'axis',
+        axisPointer: {
+            type: 'cross',
+            crossStyle: {
+                color: '#999'
+            }
+        }
+    },
+    legend: {
+        orient: 'vertical',
+        left: 'center',
+        bottom:'bottom',
+        data: legend
+    },
+    xAxis: {
+        type: 'category',
+        data: xqxpcldata,
+        splitLine: {
+            show: true,
+        }
+    },
+    yAxis: {
+        type: 'value',
+        axisLine:{       //y轴
+            show: true
+        },
+        splitLine: {     //网格线
+            show: true
+        },
+        max:10,
+        axisLabel: {
+            formatter: '{value} .00'
+        }
+        
+    },
+    series: [{
+        name: '曲线偏差率',
+        data: qxpclData,
+        type: 'line',
+        symbol: 'triangle',
+        symbolSize: 20,
+        lineStyle: {
+            color: '#CC0400',
+            width: 4,
+        },
+        itemStyle: {
+            borderWidth: 3,
+            color: '#CC0400'
+        }
+    },
+    {
+        name: '基准值',
+        data: qxpcljzzData,
+        type: 'line',
+        symbol: 'circle',
+        symbolSize: 20,
+        lineStyle: {
+            color: '#0072C5',
+            width: 4,
+        },
+        itemStyle: {
+            borderWidth: 3,
+            color: '#0072C5'
+        }
+    }]
+};
+  myChart.setOption(option, true);
+}
+
+//健康报告健康走势图
+export function getHealthTrendChart(id,legend,xfdldata,max,fdlData) {
+  console.log(legend)
+  if (xfdldata === undefined) {
+    message.error("没有找到报表数据,请检查!");
+    return;
+  }
+  if (fdlData === undefined) {
+    message.error("没有找到报表数据,请检查!");
+    return;
+  }
+  var myChart = EC.init(document.getElementById(id));
+  let option = {
+    tooltip: {
+        trigger: 'axis',
+        axisPointer: {
+            type: 'cross',
+            crossStyle: {
+                color: '#999'
+            }
+        }
+    },
+    legend: {
+        orient: 'vertical',
+        left: 'center',
+        bottom:'bottom',
+        data: legend
+    },
+    xAxis: {
+        type: 'category',
+        data: xfdldata,
+        splitLine: {
+            show: true,
+        }
+    },
+    yAxis: {
+        type: 'value',
+        axisLine:{       //y轴
+            show: true
+        },
+        axisTick:{       //y轴刻度线
+            show: true
+        },
+        splitLine: {     //网格线
+            show: true
+        },
+        max:max,
+        axisLabel: {
+            formatter: '{value} .00'
+        }
+    },
+    series: [{
+        name: '发电量健康走势',
+        symbol: "none",
+        data: fdlData,
+        type: 'line',
+        lineStyle: {
+            color: '#99CDFF',
+            width: 2,
+        },
+    }]
+};
+  myChart.setOption(option, true);
+}
 
 
 
@@ -648,5 +798,7 @@ export default {
   getCurveDeviationRate,
   getFiveLossSectorLeft,
   getFiveLossSectorRight,
+  getHealthCurve,
+  getHealthTrendChart,
   color,
 }

+ 109 - 0
src/views/healthManagement/healthAssessment.vue

@@ -0,0 +1,109 @@
+<template>
+    <div class="box" id="pdfDom">
+        <div class="searchBar">
+           <el-form :inline="true" :model="formInline" class="demo-form-inline">
+            <el-row :gutter="1">
+                <el-form-item label="查询条件">
+                </el-form-item>
+                <el-form-item label="风场:">
+                <el-select v-model="value"  placeholder="请选择" @change="getFCData">
+                <el-option
+                    v-for="item in options"
+                    :key="item.name"
+                    :label="item.name"
+                    :value="item.id">
+                </el-option>
+                </el-select>
+                </el-form-item>
+                <el-form-item label="风机:">
+                    <el-select v-model="value2"  
+                     placeholder="请选择">
+                    <el-option
+                        v-for="item in options2"
+                        :key="item.name"
+                        :label="item.name"
+                        :value="item.id"
+                    >
+                    </el-option>
+                    </el-select>
+                    </el-form-item>
+                   <el-form-item label="选择时间:">
+                    <el-date-picker
+                        v-model="timedate"
+                        value-format="yyyy-MM-dd"
+                        type="daterange"
+                        range-separator="至"
+                        start-placeholder="开始日期"
+                        end-placeholder="结束日期"
+                        format="yyyy-MM-dd"
+                    >
+                    </el-date-picker>
+                    </el-form-item>
+                <el-form-item>
+                <el-button type="primary" @click="queryApData" :plain="true"
+                    >查询</el-button
+                >
+                </el-form-item>
+                <el-form-item>
+                <el-button type="primary" @click="toExcel()">导出</el-button>
+                </el-form-item>
+                <el-form-item>
+                <el-button type="primary" v-on:click="getPdf('单机性能分析')">导出pdf</el-button>
+                </el-form-item>
+            </el-row>
+            </el-form>
+            <el-table
+                id="callthepolicetable"
+                :row-style="{ height: '10px' }" 
+                :cell-style="{ textAlign: 'center'}" 
+                :header-cell-style="{ textAlign:'center',background:'#F5F7FA'}"
+                @sort-change="changeTableSort"
+                :data="tableData"
+                align="center"
+                border
+                style="width:100%;margin-top:2%;cursor: pointer;">
+                <el-table-column
+                prop="wtid"
+                label="风机"
+                width="300">
+                </el-table-column>
+                 <el-table-column
+                :formatter="formatDate"
+                 prop="recodedate"
+                label="日期"
+                width="300">
+                </el-table-column>
+                <el-table-column
+                prop="gztop3name"
+                label="推荐情况"
+                width="300">
+                </el-table-column>
+                <el-table-column
+                prop="mainreason"
+                label="等级评估"
+                width="300">
+                </el-table-column>
+                <el-table-column
+                prop="mainreason"
+                label="等级评估"
+                width="300">
+                </el-table-column>
+                <el-table-column
+                    prop="address"
+                    label="操作"
+                    width="300">
+                    <template slot-scope="scope">
+                        <el-button size="mini"  @click="handleEdit(scope.$index, scope.row)">详情</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </div>
+    </div>
+</template>
+<script>
+    import healthAssessment from "@assets/js/healthManagement/healthAssessment";
+    export default healthAssessment;
+</script>
+<style lang="scss" scoped>
+    @import "@assets/css/healthManagement/healthAssessment.scss";
+</style>

File diff suppressed because it is too large
+ 177 - 0
src/views/healthManagement/healthAssessmentDetailed.vue