Browse Source

健康报告功能

lizaixun 4 years ago
parent
commit
b1aadd49b1

+ 1 - 0
src/App.vue

@@ -89,6 +89,7 @@
           </el-submenu>
           <el-submenu index="5">
             <template slot="title">健康管理</template>
+            <el-menu-item index="/healthAssessment">健康评价报告</el-menu-item>
           </el-submenu>
           <el-submenu index="6">
             <template slot="title">智能报警</template>

+ 11 - 0
src/router/index.js

@@ -265,6 +265,17 @@ const routes = [{
 		component: () => import('../views/betweenValues/InterValueLineTable.vue')
 	}
 	,
+	{
+		path: '/healthAssessmentReport',
+		name: 'healthAssessmentReport',
+		component: () => import('../views/HealthManagement/HealthAssessmentReport.vue')
+	}
+	,
+	{
+		path: '/healthAssessment',
+		name: 'healthAssessment',
+		component: () => import('../views/HealthManagement/HealthAssessment.vue')
+	}
 	
 ]
 

+ 169 - 0
src/views/HealthManagement/HealthAssessment.vue

@@ -0,0 +1,169 @@
+<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
+                        value-format="yyyy-MM-dd"
+                        v-model="time"
+                        type="date"
+                        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',padding:'1px' }" 
+                :header-cell-style="{ textAlign:'center',background:'#F5F7FA'}"
+                @sort-change="changeTableSort"
+                @row-click="tableDatawindturbineName"
+                :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
+                prop="gztop3name"
+                label="推荐检修"
+                width="300">
+                </el-table-column>
+            </el-table>
+        </div>
+    </div>
+</template>
+<script>
+import {formatDate} from '../../utils/fomatDate';
+export default {
+    data(){
+        return {
+            pdfTitle: '因子评价报告',
+            pdfSelector: '单机性能分析',
+            formInline: {
+                windfarm: "",
+                project: "",
+                line: "",
+            },
+            value:'',
+            value2:'',
+            options:[],
+            options2:[],
+            time:'',
+            fanData:'',
+            tableData: []
+            
+        }
+    },
+    filters: { 
+    //方法一: yyyy-MM-dd hh:mm
+        
+    },
+    created(){
+        this.$http.get('/powercompare/windfarmAjax').then((res) => {
+            this.options = res.data.data;
+        })
+        // this.getHealthForm();
+    },
+    methods:{
+        queryApData() {
+             this.getHealthForm();
+        },
+        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.$http.get('/powercompare/windturbineAjax?wpId=' + this.value).then((res) => {
+                this.options2 = res.data.data;
+            })
+        },
+        tableDatawindturbineName(val){
+          this.fanData = val;
+        //   console.log(this.fanData)
+          this.$router.push({
+            path:'/healthAssessmentReport',
+            query:{
+              data:this.fanData,
+              recorddate: this.time,
+            }
+          })
+        },
+        getHealthForm(){
+            // console.log(this.value2)
+            // console.log(this.time)
+            var healthForm = new URLSearchParams();
+            healthForm.append('wtId',this.value2);
+            healthForm.append('recorddate',this.time);
+            this.$http.post('/report/healthReport',healthForm).then((res) =>{
+                console.log(res.data.data.main)
+                this.tableData.push(res.data.data.main)
+            })
+        },
+    }
+}
+</script>
+<style lang="scss" scoped>
+    .box{
+		width: 100%;
+		display: flex;
+		justify-content: space-around;
+ 		align-items: center;
+ 		overflow: hidden;
+  	}
+    .searchBar{
+        margin-top: 1%;
+    }
+    .box-card{
+        width: 100%;
+    }
+</style>

File diff suppressed because it is too large
+ 682 - 0
src/views/HealthManagement/HealthAssessmentReport.vue