Browse Source

单机性能分析模块上传

yangxiao 3 years atrás
parent
commit
55a521757a
2 changed files with 77 additions and 285 deletions
  1. 2 2
      src/views/cutAnalyse/index.vue
  2. 75 283
      src/views/singleAnalysis/index.vue

+ 2 - 2
src/views/cutAnalyse/index.vue

@@ -21,11 +21,11 @@
 				</div>
 			</div>
 			<div class="query-actions">
-				<button class="btn green" @click="search()">搜索</button>
+				<button class="btn green" @click="search()">查询</button>
 			</div>
 		</div>
     <div class="df-table">
-      <ComTable height="100vh" :data="tableData"></ComTable>
+      <ComTable height="78vh" :data="tableData"></ComTable>
     </div>
     <el-dialog title="切入切出风速整合历史" v-model="dialogShow" width="85%" top="10vh" custom-class="modal" :close-on-click-modal="true" @closed="dialogType = ''">
       <ComTable height="100vh" :data="tableHistoryData"></ComTable>

+ 75 - 283
src/views/singleAnalysis/index.vue

@@ -21,14 +21,15 @@
 				</div>
 			</div>
 			<div class="query-actions">
-				<button class="btn green" @click="search()">搜索</button>
+				<button class="btn green" @click="search()">查询</button>
+				<button class="btn green" @click="exportExcel">导出</button>
 			</div>
 		</div>
     <div class="df-table">
-      <ComTable height="100vh" :data="tableData"></ComTable>
+      <ComTable height="78vh" :data="tableData"></ComTable>
     </div>
     <el-dialog title="切入切出风速整合历史" v-model="dialogShow" width="85%" top="10vh" custom-class="modal" :close-on-click-modal="true" @closed="dialogType = ''">
-      <ComTable height="100vh" :data="tableHistoryData"></ComTable>
+      test
     </el-dialog>
   </div>
 </template>
@@ -56,231 +57,120 @@ export default {
       tableData: {
         column: [
           {
-            name: "机",
-            field: "windturbineid",
+            name: "机组编号",
+            field: "windturbineName",
             is_num: false,
             is_light: false,
             sortable: true
           },
           {
-            name: "总小风切入",
-            field: "inputsmall",
+            name: "实际发电量(万千瓦时)",
+            field: "fdl",
             is_num: false,
             is_light: false,
             sortable: true
           },
           {
-            name: "总小风切入合格率",
-            field: "inputsmallratio",
+            name: "理论发电量(万千瓦时)",
+            field: "llfdl",
             is_num: false,
             is_light: false,
             sortable: true
           },
           {
-            name: "总大风切入",
-            field: "inputbig",
+            name: "设备利用小时数(小时)",
+            field: "lyxs",
             is_num: false,
             is_light: false,
             sortable: true
           },
           {
-            name: "总大风切入合格率",
-            field: "inputbigratio",
+            name: "设备可利用率(%)",
+            field: "sbklyl",
             is_num: false,
             is_light: false,
             sortable: true
           },
           {
-            name: "总小风切出",
-            field: "outputsmall",
+            name: "等效可用系数(%)",
+            field: "tjxs",
             is_num: false,
             is_light: false,
             sortable: true
           },
           {
-            name: "总小风切出合格率",
-            field: "outputsmallratio",
+            name: "平均风速(m/s)",
+            field: "fs",
             is_num: false,
             is_light: false,
             sortable: true
           },
           {
-            name: "总大风切出",
-            field: "outputbig",
+            name: "小风切入风速(m/s)",
+            field: "xfqr",
             is_num: false,
             is_light: false,
             sortable: true
           },
           {
-            name: "总大风切出合格率",
-            field: "outputbigmaxratio",
+            name: "有效风时数(小时)",
+            field: "yxfss",
             is_num: false,
             is_light: false,
             sortable: true
           },
           {
-            name: "日小风切入",
-            field: "dayinputsmall",
+            name: "故障损失电量(万千瓦时)",
+            field: "gzss",
             is_num: false,
             is_light: false,
             sortable: true
           },
           {
-            name: "日小风切入合格率",
-            field: "dayinputsmallratio",
+            name: "调度限电损失电量(万千瓦时)",
+            field: "xdss",
             is_num: false,
             is_light: false,
             sortable: true
           },
           {
-            name: "日小风切出",
-            field: "dayoutputsmall",
+            name: "计划检修损失电量(万千瓦时)",
+            field: "jxss",
             is_num: false,
             is_light: false,
             sortable: true
           },
           {
-            name: "日小风切出合格率",
-            field: "dayoutputsmallratio",
+            name: "性能未达标损失电量(万千瓦时)",
+            field: "xnss",
             is_num: false,
             is_light: false,
             sortable: true
           },
           {
-            name: "日大风切入",
-            field: "dayinputbig",
+            name: "受累损失电量(万千瓦时)",
+            field: "slss",
             is_num: false,
             is_light: false,
             sortable: true
           },
           {
-            name: "日大风切入合格率",
-            field: "dayinputbigratio",
+            name: "故障停用时间(小时)",
+            field: "gzxs",
             is_num: false,
             is_light: false,
             sortable: true
           },
           {
-            name: "日大风切出",
-            field: "dayoutputbig",
+            name: "检修停用时间(小时)",
+            field: "jxxs",
             is_num: false,
             is_light: false,
             sortable: true
           },
           {
-            name: "日大风切出合格率",
-            field: "dayoutputbigratio",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "月小风切入",
-            field: "monthinputsmall",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "月小风切入合格率",
-            field: "monthinputsmallratio",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "月大风切入",
-            field: "monthinputbig",
-            is_num: false,
-            is_light: false,
-          },
-          {
-            name: "月大风切入合格率",
-            field: "monthinputbigratio",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "月小风切出",
-            field: "monthoutputsmall",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "月小风切出合格率",
-            field: "monthoutputsmallratio",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "月大风切出",
-            field: "monthoutputbig",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "月大风切出合格率",
-            field: "monthoutputbigratio",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "年小风切入",
-            field: "yearinputsmall",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "年小风切入合格率",
-            field: "yearinputsmallratio",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "年大风切入",
-            field: "yearinputbig",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "年大风切入合格率",
-            field: "yearinputbigratio",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "年小风切出",
-            field: "yearoutputsmall",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "年小风切出合格率",
-            field: "yearoutputsmallratio",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "年大风切出",
-            field: "yearoutputbig",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "年大风切出合格率",
-            field: "yearoutputbigratio",
+            name: "机组功率一致性系数(%)",
+            field: "glyzxxs",
             is_num: false,
             is_light: false,
             sortable: true
@@ -291,7 +181,7 @@ export default {
             is_num: false,
             is_light: false,
             template() {
-								return "<el-button type='text' style='cursor: pointer;'>历史</el-button>";
+								return "<el-button type='text' style='cursor: pointer;'>详情</el-button>";
 						},
             click(e, row){
               that.getOutputspeedHistoryList(row)
@@ -300,137 +190,6 @@ export default {
         ],
         data: [],
       },
-      tableHistoryData: {
-        column: [
-          {
-            name: "风机",
-            field: "windturbineid",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "日期",
-            field: "time",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "总小风切入",
-            field: "inputsmall",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "总大风切入",
-            field: "inputbig",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "总小风切出",
-            field: "outputsmall",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "总大风切出",
-            field: "outputbig",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "日小风切入",
-            field: "dayinputsmall",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "日小风切出",
-            field: "dayoutputsmall",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "日大风切入",
-            field: "dayinputbig",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "日大风切出",
-            field: "dayoutputbig",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "月小风切入",
-            field: "monthinputsmall",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "月大风切入",
-            field: "monthinputbig",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "月小风切出",
-            field: "monthoutputsmall",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "月大风切出",
-            field: "monthoutputbig",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "年小风切入",
-            field: "yearinputsmall",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "年大风切入",
-            field: "yearinputbig",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "年小风切出",
-            field: "yearoutputsmall",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          },
-          {
-            name: "年大风切出",
-            field: "yearoutputbig",
-            is_num: false,
-            is_light: false,
-            sortable: true
-          }
-        ],
-        data: [],
-      },
     };
   },
 
@@ -459,13 +218,19 @@ export default {
       }else{
         that.API.requestData({
           method: "POST",
-          subUrl: "outputspeed/outputSpeedlist",
+          subUrl: "singleanalysis/singleanalysisMain",
           data:{
             wpId,
             isAsc:that.isAsc,
-            recorddate:that.recorddate
+            year:new Date(that.recorddate).getFullYear(),
+            month:(new Date(that.recorddate).getMonth() + 1)
           },
           success(res) {
+            res.data.forEach(ele=>{
+              for(let key in ele){
+                ele[key] = ele[key] || 0;
+              }
+            });
             that.tableData.data = res.data;
           }
         });
@@ -496,7 +261,34 @@ export default {
 
     search(){
       this.getOutputSpeedList(this.wpId);
-    }
+    },
+
+        // 导出excel
+    exportExcel () {
+      let that = this;
+      const { export_json_to_excel } = require('@tools/excel/Export2Excel.js'); // 注意这个Export2Excel路径      
+      
+      // const tHeader = ['点名', '描述']; // 上面设置Excel的表格第一行的标题       
+      // const filterVal = ['id', 'name']; // 上面的index、nickName、name是tableData里对象的属性key值   
+      
+      let tHeader = []; // 上面设置Excel的表格第一行的标题       
+      let filterVal = []; // 上面的index、nickName、name是tableData里对象的属性key值
+
+      that.tableData.column.forEach(ele=>{
+        if(ele.name !== "操作"){
+          tHeader.push(ele.name);
+          filterVal.push(ele.field);
+        }
+      });
+
+      const list = that.tableData.data; //把要导出的数据tableData存到list 
+      const data = that.formatJson(filterVal, list);
+      export_json_to_excel(tHeader, data, '导出的Excel'); // 最后一个是表名字
+    },
+
+    formatJson (filterVal, jsonData) {
+      return jsonData.map(v => filterVal.map(j => v[j]));
+    },
   },
 
   created() {