|
@@ -16,13 +16,8 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="handleReportOp">查询</el-button>
|
|
|
- <!-- <el-button
|
|
|
- style="width: 100px"
|
|
|
- type="danger"
|
|
|
- @click="exportPDFop"
|
|
|
- :loading="loading"
|
|
|
- >导出 PDF</el-button
|
|
|
- > -->
|
|
|
+ <!-- <el-button style="width: 100px" type="danger" @click="exportPDFop" :loading="loading">导出 PDF
|
|
|
+ </el-button> -->
|
|
|
<el-button style="width: 100px" type="primary" @click="exportWORD" :loading="loading">导出 WORD
|
|
|
</el-button>
|
|
|
</el-form-item>
|
|
@@ -30,7 +25,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="infoBox">
|
|
|
- <div id="pdfDomop" :class="!theme ? 'block' : 'white'"
|
|
|
+ <div id="pdfDom" :class="!theme ? 'block' : 'white'" ref="pdfContent"
|
|
|
:style="!theme ? 'background-color: #040c0b' : 'background-color: #fff'">
|
|
|
<h2 style="
|
|
|
font-weight: bolder;
|
|
@@ -57,23 +52,29 @@
|
|
|
:style="!theme ? 'color: #fff' : 'color: #000'">
|
|
|
1.1 风电场基本信息
|
|
|
</h4>
|
|
|
- <div style="text-indent: 2em;line-height: 30px;font-size: 15px;" v-for="(item, index) in basrMsgArr"
|
|
|
+ <div style="text-indent: 2em; line-height: 30px; font-size: 15px" v-for="(item, index) in basrMsgArr"
|
|
|
:key="index">
|
|
|
- <span style="background: #fff;
|
|
|
- width: 8px;
|
|
|
- height: 8px;
|
|
|
- border-radius: 10px;
|
|
|
- display: inline-block;
|
|
|
- margin: 0 15px 0 15px;" :style="!theme ? 'background: #fff' : 'background: #000'"></span>
|
|
|
- <span style="font-weight: bolder;margin-right: 10px;"
|
|
|
- :style="!theme ? 'color: #fff' : 'color: #000'">{{item.name}}: </span>
|
|
|
<span style="
|
|
|
- text-align: justify;
|
|
|
- line-height: 22px;" :style="!theme ? 'color: #fff' : 'color: #000'">{{ item.value }}</span>
|
|
|
+ background: #fff;
|
|
|
+ width: 8px;
|
|
|
+ height: 8px;
|
|
|
+ border-radius: 10px;
|
|
|
+ display: inline-block;
|
|
|
+ margin: 0 15px 0 15px;
|
|
|
+ " :style="!theme ? 'background: #fff' : 'background: #000'"></span>
|
|
|
+ <span style="font-weight: bolder; margin-right: 10px"
|
|
|
+ :style="!theme ? 'color: #fff' : 'color: #000'">{{ item.name }}:
|
|
|
+ </span>
|
|
|
+ <span style="text-align: justify; line-height: 22px"
|
|
|
+ :style="!theme ? 'color: #fff' : 'color: #000'">{{ item.value }}</span>
|
|
|
</div>
|
|
|
<!-- 筛选标准 -->
|
|
|
- <h3 style="text-indent: 2em; font-weight: bolder; margin-bottom: 10px; margin-top: 10px"
|
|
|
- :style="!theme ? 'color: #fff' : 'color: #000'">
|
|
|
+ <h3 style="
|
|
|
+ text-indent: 2em;
|
|
|
+ font-weight: bolder;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ margin-top: 10px;
|
|
|
+ " :style="!theme ? 'color: #fff' : 'color: #000'">
|
|
|
2.筛选标准
|
|
|
</h3>
|
|
|
<p style="
|
|
@@ -84,23 +85,29 @@
|
|
|
">
|
|
|
本报告依据以下标准对风机进行筛选:
|
|
|
</p>
|
|
|
- <div style="text-indent: 2em;line-height: 30px;font-size: 15px;" v-for="(item, index) in orderMsgArr"
|
|
|
+ <div style="text-indent: 2em; line-height: 30px; font-size: 15px" v-for="(item, index) in orderMsgArr"
|
|
|
:key="index">
|
|
|
- <span style="background: #fff;
|
|
|
- width: 8px;
|
|
|
- height: 8px;
|
|
|
- border-radius: 10px;
|
|
|
- display: inline-block;
|
|
|
- margin: 0 15px 0 15px;" :style="!theme ? 'background: #fff' : 'background: #000'"></span>
|
|
|
- <span style="font-weight: bolder;margin-right: 10px;"
|
|
|
- :style="!theme ? 'color: #fff' : 'color: #000'">{{item.name}}: </span>
|
|
|
<span style="
|
|
|
- text-align: justify;
|
|
|
- line-height: 22px;" :style="!theme ? 'color: #fff' : 'color: #000'">{{ item.value }}</span>
|
|
|
+ background: #fff;
|
|
|
+ width: 8px;
|
|
|
+ height: 8px;
|
|
|
+ border-radius: 10px;
|
|
|
+ display: inline-block;
|
|
|
+ margin: 0 15px 0 15px;
|
|
|
+ " :style="!theme ? 'background: #fff' : 'background: #000'"></span>
|
|
|
+ <span style="font-weight: bolder; margin-right: 10px"
|
|
|
+ :style="!theme ? 'color: #fff' : 'color: #000'">{{ item.name }}:
|
|
|
+ </span>
|
|
|
+ <span style="text-align: justify; line-height: 22px"
|
|
|
+ :style="!theme ? 'color: #fff' : 'color: #000'">{{ item.value }}</span>
|
|
|
</div>
|
|
|
<!-- 风机筛选分析 -->
|
|
|
- <h3 style="text-indent: 2em; font-weight: bolder; margin-bottom: 10px; margin-top: 10px"
|
|
|
- :style="!theme ? 'color: #fff' : 'color: #000'">
|
|
|
+ <h3 style="
|
|
|
+ text-indent: 2em;
|
|
|
+ font-weight: bolder;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ margin-top: 10px;
|
|
|
+ " :style="!theme ? 'color: #fff' : 'color: #000'">
|
|
|
3.风机筛选分析
|
|
|
</h3>
|
|
|
<p style="
|
|
@@ -112,20 +119,20 @@
|
|
|
根据以上标准,对每台风机的运行数据及隐患问题信息进行分析,结果如下:
|
|
|
</p>
|
|
|
<div class="warn-table">
|
|
|
- <el-table class="toolSty" :data="fjsxList1" border style="width: 100%; margin: 10px 0;"
|
|
|
+ <el-table class="toolSty" :data="fjsxList1" border style="width: 100%; margin: 10px 0"
|
|
|
max-height="500" stripe :header-cell-style="{
|
|
|
- padding: '4px',
|
|
|
- fontSize: '12px',
|
|
|
- fontWeight: bold,
|
|
|
- border: '0.5px solid rgba(0,0,0,.5) !important',
|
|
|
+ padding: '4px',
|
|
|
+ fontSize: '12px',
|
|
|
+ fontWeight: bold,
|
|
|
+ border: '0.5px solid rgba(0,0,0,.5) !important',
|
|
|
}" :cell-style="{
|
|
|
- height: '40px',
|
|
|
- padding: '3px',
|
|
|
- fontSize: '12px',
|
|
|
- 'border-top': '0px solid rgba(0,0,0,.5)',
|
|
|
- 'border-bottom': '1px solid rgba(0,0,0,.5)',
|
|
|
- 'border-right': '1px solid rgba(0,0,0,.5)',
|
|
|
- }">
|
|
|
+ height: '40px',
|
|
|
+ padding: '3px',
|
|
|
+ fontSize: '12px',
|
|
|
+ 'border-top': '0px solid rgba(0,0,0,.5)',
|
|
|
+ 'border-bottom': '1px solid rgba(0,0,0,.5)',
|
|
|
+ 'border-right': '1px solid rgba(0,0,0,.5)',
|
|
|
+ }">
|
|
|
<el-table-column prop="turbineId" align="center" label="风机编号" width="60" />
|
|
|
<el-table-column prop="speed" align="center" label="平均风速(m/s)" width="60" />
|
|
|
<el-table-column prop="ratedPowerKw" align="center" label="额定功率(KW)" width="60" />
|
|
@@ -147,18 +154,18 @@
|
|
|
<!-- 温度类隐患 -->
|
|
|
<el-table class="toolSty" :data="fjsxList2" border style="width: 100%; margin: 10px 0"
|
|
|
max-height="500" stripe :header-cell-style="{
|
|
|
- padding: '4px',
|
|
|
- fontSize: '12px',
|
|
|
- fontWeight: bold,
|
|
|
- border: '0.5px solid rgba(0,0,0,.5) !important',
|
|
|
+ padding: '4px',
|
|
|
+ fontSize: '12px',
|
|
|
+ fontWeight: bold,
|
|
|
+ border: '0.5px solid rgba(0,0,0,.5) !important',
|
|
|
}" :cell-style="{
|
|
|
- height: '40px',
|
|
|
- padding: '3px',
|
|
|
- fontSize: '12px',
|
|
|
- 'border-top': '0px solid rgba(0,0,0,.5)',
|
|
|
- 'border-bottom': '1px solid rgba(0,0,0,.5)',
|
|
|
- 'border-right': '1px solid rgba(0,0,0,.5)',
|
|
|
- }">
|
|
|
+ height: '40px',
|
|
|
+ padding: '3px',
|
|
|
+ fontSize: '12px',
|
|
|
+ 'border-top': '0px solid rgba(0,0,0,.5)',
|
|
|
+ 'border-bottom': '1px solid rgba(0,0,0,.5)',
|
|
|
+ 'border-right': '1px solid rgba(0,0,0,.5)',
|
|
|
+ }">
|
|
|
<el-table-column prop="turbineId" align="center" label="风机编号" width="60" fixed />
|
|
|
<el-table-column prop="downtimeCount" align="center" label="故障停机次数" width="60" />
|
|
|
<el-table-column v-for="(item, index) in orderTableColumn2" :key="index" :label="item.name"
|
|
@@ -167,7 +174,7 @@
|
|
|
align="center" width="68">
|
|
|
<template #default="scope">
|
|
|
<span>
|
|
|
- {{ scope.row[res.code] ? scope.row[res.code] : '-' }}
|
|
|
+ {{ scope.row[res.code] ? scope.row[res.code] : "-" }}
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -179,8 +186,37 @@
|
|
|
|
|
|
<h4 style="text-indent: 2em; font-weight: bolder; margin: 10px 0"
|
|
|
:style="!theme ? 'color: #fff' : 'color: #000'">
|
|
|
- 3.1 筛选结果
|
|
|
+ 3.1 分析结果
|
|
|
</h4>
|
|
|
+ <!-- <div style="text-indent: 2em; line-height: 30px; font-size: 15px"
|
|
|
+ v-for="(item, index) in orderResultArr" :key="index">
|
|
|
+ <span style="
|
|
|
+ background: #fff;
|
|
|
+ width: 8px;
|
|
|
+ height: 8px;
|
|
|
+ border-radius: 10px;
|
|
|
+ display: inline-block;
|
|
|
+ margin: 0 15px 0 15px;
|
|
|
+ " :style="!theme ? 'background: #fff' : 'background: #000'"></span>
|
|
|
+ <span style="text-align: justify; margin-right: 10px; line-height: 22px"
|
|
|
+ :style="!theme ? 'color: #fff' : 'color: #000'">{{ item }}</span>
|
|
|
+ </div> -->
|
|
|
+ <div style="text-indent: 2em;line-height: 30px;font-size: 15px;"
|
|
|
+ v-for="(item, index) in orderAnalysisArr" :key="index">
|
|
|
+ <span style="background: #fff;
|
|
|
+ width: 8px;
|
|
|
+ height: 8px;
|
|
|
+ border-radius: 10px;
|
|
|
+ display: inline-block;
|
|
|
+ margin: 0 15px 0 15px;" :style="!theme ? 'background: #fff' : 'background: #000'"></span>
|
|
|
+ <span style="font-weight: bolder;margin-right: 10px;"
|
|
|
+ :style="!theme ? 'color: #fff' : 'color: #000'">{{item.windName}}: </span>
|
|
|
+ <span style="
|
|
|
+ text-align: justify;margin-right: 10px;
|
|
|
+ line-height: 22px;" :style="!theme ? 'color: #fff' : 'color: #000'">{{ item.value }}</span>
|
|
|
+ </div>
|
|
|
+ <p style="font-size: 16px;font-weight: bolder;margin: 10px 0 10px 40px"
|
|
|
+ :style="!theme ? 'color: #fff' : 'color: #000'">根据以上分析,企筛选出的问题风机包括: </p>
|
|
|
<div style="text-indent: 2em;line-height: 30px;font-size: 15px;" v-for="(item, index) in orderResultArr"
|
|
|
:key="index">
|
|
|
<span style="background: #fff;
|
|
@@ -197,34 +233,43 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 风机情况说明 -->
|
|
|
- <h3 style="text-indent: 2em; font-weight: bolder; margin-bottom: 10px; margin-top: 10px"
|
|
|
- :style="!theme ? 'color: #fff' : 'color: #000'">
|
|
|
- 4.风机情况说明
|
|
|
+ <h3 style="
|
|
|
+ text-indent: 2em;
|
|
|
+ font-weight: bolder;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ margin-top: 10px;
|
|
|
+ " :style="!theme ? 'color: #fff' : 'color: #000'">
|
|
|
+ 4.问题风机情况说明
|
|
|
</h3>
|
|
|
<div v-for="(val, key, index) in windSituationReport" :key="index">
|
|
|
<h4 style="text-indent: 2em; font-weight: bolder; margin: 10px 0"
|
|
|
:style="!theme ? 'color: #fff' : 'color: #000'">
|
|
|
- {{`4.${index+1} ${key}` }}
|
|
|
+ {{ `${key}号机组` }}
|
|
|
</h4>
|
|
|
- <div style="text-indent: 2em;line-height: 30px;font-size: 15px;" v-for="(item, index) in val"
|
|
|
+ <div style="text-indent: 2em; line-height: 30px; font-size: 15px" v-for="(item, index) in val"
|
|
|
:key="index">
|
|
|
- <span style="background: #fff;
|
|
|
+ <span style="
|
|
|
+ background: #fff;
|
|
|
width: 8px;
|
|
|
height: 8px;
|
|
|
border-radius: 10px;
|
|
|
display: inline-block;
|
|
|
- margin: 0 15px 0 15px;" :style="!theme ? 'background: #fff' : 'background: #000'"></span>
|
|
|
+ margin: 0 15px 0 15px;
|
|
|
+ " :style="!theme ? 'background: #fff' : 'background: #000'"></span>
|
|
|
<!-- <span style="font-weight: bolder;margin-right: 10px;"
|
|
|
:style="!theme ? 'color: #fff' : 'color: #000'">{{item.name}}: </span> -->
|
|
|
- <span style="
|
|
|
- text-align: justify;
|
|
|
- line-height: 22px;" :style="!theme ? 'color: #fff' : 'color: #000'">{{ item }}</span>
|
|
|
+ <span style="text-align: justify; line-height: 22px"
|
|
|
+ :style="!theme ? 'color: #fff' : 'color: #000'">{{ item }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<!-- 检修建议 -->
|
|
|
- <h3 style="text-indent: 2em; font-weight: bolder; margin-bottom: 10px; margin-top: 10px"
|
|
|
- :style="!theme ? 'color: #fff' : 'color: #000'">
|
|
|
+ <h3 style="
|
|
|
+ text-indent: 2em;
|
|
|
+ font-weight: bolder;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ margin-top: 10px;
|
|
|
+ " :style="!theme ? 'color: #fff' : 'color: #000'">
|
|
|
5.检修建议
|
|
|
</h3>
|
|
|
<p style="
|
|
@@ -238,28 +283,33 @@
|
|
|
<div v-for="(val, key, index) in maintenanceRecommendations" :key="index">
|
|
|
<h4 style="text-indent: 2em; font-weight: bolder; margin: 10px 0"
|
|
|
:style="!theme ? 'color: #fff' : 'color: #000'">
|
|
|
- {{`5.${index+1} ${key}` }}
|
|
|
+ {{ `${key}号机组` }}
|
|
|
</h4>
|
|
|
- <div style="text-indent: 2em;line-height: 30px;font-size: 15px;" v-for="(item, idx) in val"
|
|
|
+ <div style="text-indent: 2em; line-height: 30px; font-size: 15px" v-for="(item, idx) in val"
|
|
|
:key="idx">
|
|
|
- <span style="background: #fff;
|
|
|
+ <span style="
|
|
|
+ background: #fff;
|
|
|
width: 8px;
|
|
|
height: 8px;
|
|
|
border-radius: 10px;
|
|
|
display: inline-block;
|
|
|
- margin: 0 15px 0 15px;" :style="!theme ? 'background: #fff' : 'background: #000'"></span>
|
|
|
+ margin: 0 15px 0 15px;
|
|
|
+ " :style="!theme ? 'background: #fff' : 'background: #000'"></span>
|
|
|
<!-- <span>{{idx+1}}</span> -->
|
|
|
<!-- <span style="font-weight: bolder;margin-right: 10px;"
|
|
|
:style="!theme ? 'color: #fff' : 'color: #000'">{{item.name}}: </span> -->
|
|
|
- <span style="
|
|
|
- text-align: justify;
|
|
|
- line-height: 22px;" :style="!theme ? 'color: #fff' : 'color: #000'">{{ item }}</span>
|
|
|
+ <span style="text-align: justify; line-height: 22px"
|
|
|
+ :style="!theme ? 'color: #fff' : 'color: #000'">{{ item }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<!-- 结论 -->
|
|
|
- <h3 style="text-indent: 2em; font-weight: bolder; margin-bottom: 10px; margin-top: 10px"
|
|
|
- :style="!theme ? 'color: #fff' : 'color: #000'">
|
|
|
+ <h3 style="
|
|
|
+ text-indent: 2em;
|
|
|
+ font-weight: bolder;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ margin-top: 10px;
|
|
|
+ " :style="!theme ? 'color: #fff' : 'color: #000'">
|
|
|
6.结论
|
|
|
</h3>
|
|
|
<p style="
|
|
@@ -268,7 +318,7 @@
|
|
|
text-align: justify;
|
|
|
line-height: 22px;
|
|
|
">
|
|
|
- {{conclusionMsg}}
|
|
|
+ {{ conclusionMsg }}
|
|
|
</p>
|
|
|
<!-- <div style="text-indent: 2em;line-height: 30px;font-size: 15px;"
|
|
|
v-for="(item, idx) in conclusionMsg.resultObj" :key="idx">
|
|
@@ -311,7 +361,6 @@
|
|
|
日期:XXX
|
|
|
</p>
|
|
|
</div> -->
|
|
|
-
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -323,6 +372,8 @@
|
|
|
import Docxtemplater from "docxtemplater";
|
|
|
import PizZip from "pizzip";
|
|
|
import JSZipUtils from "jszip-utils";
|
|
|
+ import html2canvas from 'html2canvas';
|
|
|
+ import jsPDF from 'jspdf';
|
|
|
import {
|
|
|
saveAs
|
|
|
} from "file-saver";
|
|
@@ -346,6 +397,7 @@
|
|
|
reportStation: "",
|
|
|
basrMsgArr: jsonData.basrMsgArr,
|
|
|
orderMsgArr: jsonData.orderMsgArr,
|
|
|
+ orderAnalysisArr: [],
|
|
|
orderResultArr: [],
|
|
|
maintenanceRecommendations: [],
|
|
|
windSituationReport: [],
|
|
@@ -371,7 +423,7 @@
|
|
|
},
|
|
|
|
|
|
mounted() {
|
|
|
- this.funGetStation()
|
|
|
+ this.funGetStation();
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
@@ -381,38 +433,109 @@
|
|
|
// this.renderReportPage({
|
|
|
// data: jsonData.reldata
|
|
|
// });
|
|
|
- that.stationList = []
|
|
|
- that.reportStation = ""
|
|
|
+ that.stationList = [];
|
|
|
+ that.reportStation = "";
|
|
|
apiGetbaseStation().then((res) => {
|
|
|
if (res) {
|
|
|
that.stationList = res.data;
|
|
|
if (that.stationList.length) {
|
|
|
that.reportStation = that.stationList[0].id;
|
|
|
- that.handleReportOp()
|
|
|
+ that.handleReportOp();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- exportPDFop() {
|
|
|
+ async exportPDFop() {
|
|
|
this.loading = true;
|
|
|
- htmlToPdf.getPdf(
|
|
|
- document.querySelector("#pdfDomop"),
|
|
|
- "经济运行分析会报告"
|
|
|
- );
|
|
|
- setTimeout(() => {
|
|
|
- this.loading = false;
|
|
|
- ElMessage.success("打印成功!");
|
|
|
- }, 1000);
|
|
|
+ // htmlToPdf.getPDFfn(
|
|
|
+ // "pdfDom",
|
|
|
+ // "优化建议报告"
|
|
|
+ // );
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.loading = false;
|
|
|
+ // ElMessage.success("打印成功!");
|
|
|
+ // }, 1000);
|
|
|
+ this.generatePDF()
|
|
|
+
|
|
|
+ },
|
|
|
+ async generatePDF() {
|
|
|
+ try {
|
|
|
+ // 获取要转换为PDF的内容
|
|
|
+ const element = this.$refs.pdfContent;
|
|
|
+
|
|
|
+ // 保存当前滚动位置
|
|
|
+ const originalScrollTop = window.scrollY;
|
|
|
+
|
|
|
+ // 将页面滚动到顶部
|
|
|
+ window.scrollTo(0, 0);
|
|
|
+
|
|
|
+ // 设置元素的高度为内容的实际高度
|
|
|
+ const originalHeight = element.style.height;
|
|
|
+ const originalOverflow = element.style.overflow;
|
|
|
+ if (originalHeight) {
|
|
|
+ element.style.height = `${element.scrollHeight}px`;
|
|
|
+ }
|
|
|
+ if (originalOverflow) {
|
|
|
+ element.style.overflow = 'hidden';
|
|
|
+ }
|
|
|
+
|
|
|
+ // 使用html2canvas将HTML内容转换为canvas
|
|
|
+ const canvas = await html2canvas(element, {
|
|
|
+ scale: 2, // 提高分辨率
|
|
|
+ logging: true, // 开启日志记录
|
|
|
+ useCORS: true // 处理跨域图片
|
|
|
+ });
|
|
|
+
|
|
|
+ // 恢复原来的样式
|
|
|
+ element.style.height = originalHeight || '';
|
|
|
+ element.style.overflow = originalOverflow || '';
|
|
|
+
|
|
|
+ // 恢复滚动位置
|
|
|
+ window.scrollTo(0, originalScrollTop);
|
|
|
+
|
|
|
+ // 将canvas转换为Data URL
|
|
|
+ const imgData = canvas.toDataURL('image/png');
|
|
|
+
|
|
|
+ // 创建一个新的jsPDF实例
|
|
|
+ const doc = new jsPDF('p', 'mm', 'a4');
|
|
|
+
|
|
|
+ // 计算图片在PDF中的位置和大小
|
|
|
+ const imgProps = doc.getImageProperties(imgData);
|
|
|
+ const pdfWidth = doc.internal.pageSize.getWidth();
|
|
|
+ const pdfHeight = (imgProps.height * pdfWidth) / imgProps.width;
|
|
|
+
|
|
|
+ // 计算每页的高度
|
|
|
+ const pageHeight = doc.internal.pageSize.getHeight();
|
|
|
+ let heightLeft = pdfHeight;
|
|
|
+
|
|
|
+ // 添加第一页
|
|
|
+ doc.addImage(imgData, 'PNG', 0, 0, pdfWidth, pdfHeight);
|
|
|
+
|
|
|
+ // 添加后续页面
|
|
|
+ while (heightLeft > pageHeight) {
|
|
|
+ heightLeft -= pageHeight;
|
|
|
+ doc.addPage();
|
|
|
+ doc.addImage(imgData, 'PNG', 0, -pdfHeight + heightLeft, pdfWidth, pdfHeight);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 保存PDF文件
|
|
|
+ doc.save('output.pdf');
|
|
|
+ } catch (error) {
|
|
|
+ console.error('Error generating PDF:', error);
|
|
|
+ }
|
|
|
},
|
|
|
exportWORD() {
|
|
|
httpRequest
|
|
|
- .get(`/WarningReport/report?time=${this.reportParamDate}&wpid=${this.reportStation}`)
|
|
|
+ .get(
|
|
|
+ `/WarningReport/report?time=${this.reportParamDate}&wpid=${this.reportStation}`
|
|
|
+ )
|
|
|
.then((tempRes) => {
|
|
|
- this.getWordFn(tempRes)
|
|
|
- }).catch(e => {
|
|
|
+ this.getWordFn(tempRes);
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
this.getWordFn({
|
|
|
- data: jsonData.data
|
|
|
- })
|
|
|
+ data: jsonData.data,
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
// 导出word方法
|
|
@@ -426,66 +549,67 @@
|
|
|
reportTime: tempRes.data.reporttime,
|
|
|
fjsxList1: tempRes.data.xnwtls,
|
|
|
fjsxList2: [],
|
|
|
+ orderAnalysisArr: this.orderAnalysisArr,
|
|
|
orderResultArr: this.orderResultArr,
|
|
|
windSituationReportWord: [],
|
|
|
maintenanceRecommendationsWord: [],
|
|
|
- conclusionResult: `本次分析针对${tempRes.data.stationid.aname}的风机发电能力下降及可靠性隐患进行了全面评估。通过实施短期和长期检修措施,预计将显著提高设备的发电效率和运行可靠性。`
|
|
|
- }
|
|
|
+ conclusionResult: `本次分析针对${tempRes.data.stationid.aname}的风机发电能力下降及可靠性隐患进行了全面评估。通过实施短期和长期检修措施,预计将显著提高设备的发电效率和运行可靠性。`,
|
|
|
+ };
|
|
|
|
|
|
- tempRes.data.kkxwtls.forEach(it => {
|
|
|
+ tempRes.data.kkxwtls.forEach((it) => {
|
|
|
for (const key in it) {
|
|
|
if (Object.prototype.hasOwnProperty.call(it, key)) {
|
|
|
const element = it[key];
|
|
|
if (element === null) {
|
|
|
- it[key] = '-'
|
|
|
+ it[key] = "-";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
- temWordData.fjsxList2 = tempRes.data.kkxwtls
|
|
|
+ });
|
|
|
+ temWordData.fjsxList2 = tempRes.data.kkxwtls;
|
|
|
|
|
|
//4.风机情况说明
|
|
|
- let qksmNum = 0
|
|
|
+ let qksmNum = 0;
|
|
|
for (const key in tempRes.data.qksm) {
|
|
|
if (Object.prototype.hasOwnProperty.call(tempRes.data.qksm, key)) {
|
|
|
const element = tempRes.data.qksm[key];
|
|
|
- let eleArr = []
|
|
|
+ let eleArr = [];
|
|
|
|
|
|
- element.forEach(it => {
|
|
|
+ element.forEach((it) => {
|
|
|
let eleObj = {
|
|
|
- name: it.substring(0, it.indexOf(':')),
|
|
|
- value: it.substring(it.indexOf(':'), it.length)
|
|
|
- }
|
|
|
- eleArr.push(eleObj)
|
|
|
- })
|
|
|
+ name: it.substring(0, it.indexOf(":")),
|
|
|
+ value: it.substring(it.indexOf(":"), it.length),
|
|
|
+ };
|
|
|
+ eleArr.push(eleObj);
|
|
|
+ });
|
|
|
let obj = {
|
|
|
index: qksmNum++,
|
|
|
windName: key,
|
|
|
- windValue: eleArr
|
|
|
- }
|
|
|
- temWordData.windSituationReportWord.push(obj)
|
|
|
+ windValue: eleArr,
|
|
|
+ };
|
|
|
+ temWordData.windSituationReportWord.push(obj);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//5.风机情况说明
|
|
|
- let jxjyNum = 0
|
|
|
+ let jxjyNum = 0;
|
|
|
for (const key in tempRes.data.jxjy) {
|
|
|
if (Object.prototype.hasOwnProperty.call(tempRes.data.jxjy, key)) {
|
|
|
const element = tempRes.data.jxjy[key];
|
|
|
- let eleArr = []
|
|
|
- element.forEach(it => {
|
|
|
+ let eleArr = [];
|
|
|
+ element.forEach((it) => {
|
|
|
let eleObj = {
|
|
|
- name: it.substring(0, it.indexOf(':')),
|
|
|
- value: it.substring(it.indexOf(':'), it.length)
|
|
|
- }
|
|
|
- eleArr.push(eleObj)
|
|
|
- })
|
|
|
+ name: it.substring(0, it.indexOf(":")),
|
|
|
+ value: it.substring(it.indexOf(":"), it.length),
|
|
|
+ };
|
|
|
+ eleArr.push(eleObj);
|
|
|
+ });
|
|
|
let obj = {
|
|
|
index: jxjyNum++,
|
|
|
windName: key,
|
|
|
- windValue: eleArr
|
|
|
- }
|
|
|
- temWordData.maintenanceRecommendationsWord.push(obj)
|
|
|
+ windValue: eleArr,
|
|
|
+ };
|
|
|
+ temWordData.maintenanceRecommendationsWord.push(obj);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -512,9 +636,11 @@
|
|
|
stack: error.stack,
|
|
|
properties: error.properties,
|
|
|
};
|
|
|
- console.log(JSON.stringify({
|
|
|
- error: e
|
|
|
- }));
|
|
|
+ console.log(
|
|
|
+ JSON.stringify({
|
|
|
+ error: e,
|
|
|
+ })
|
|
|
+ );
|
|
|
throw error;
|
|
|
}
|
|
|
// 生成一个代表docxtemplater对象的zip文件(不是一个真实的文件,而是在内存中的表示)
|
|
@@ -530,68 +656,89 @@
|
|
|
handleReportOp() {
|
|
|
if (this.reportParamDate) {
|
|
|
this.OperationName = "";
|
|
|
- this.OperationGs = ""
|
|
|
+ this.OperationGs = "";
|
|
|
this.OperationMonth = "";
|
|
|
- this.basrMsgArr = []
|
|
|
- this.fjsxList1 = []
|
|
|
- this.fjsxList2 = []
|
|
|
- this.orderResultArr = []
|
|
|
- this.windSituationReport = {}
|
|
|
- this.maintenanceRecommendations = {}
|
|
|
- this.conclusionMsg = ""
|
|
|
+ this.basrMsgArr = [];
|
|
|
+ this.fjsxList1 = [];
|
|
|
+ this.fjsxList2 = [];
|
|
|
+ this.orderAnalysisArr = []
|
|
|
+ this.orderResultArr = [];
|
|
|
+ this.windSituationReport = {};
|
|
|
+ this.maintenanceRecommendations = {};
|
|
|
+ this.conclusionMsg = "";
|
|
|
|
|
|
httpRequest
|
|
|
- .get(`/WarningReport/report?time=${this.reportParamDate}&wpid=${this.reportStation}`)
|
|
|
+ .get(
|
|
|
+ `/WarningReport/report?time=${this.reportParamDate}&wpid=${this.reportStation}`
|
|
|
+ )
|
|
|
.then((res) => {
|
|
|
this.renderReportPage(res);
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.renderReportPage({
|
|
|
- data: jsonData.reldata
|
|
|
+ data: jsonData.reldata,
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
|
|
|
renderReportPage(res) {
|
|
|
-
|
|
|
- this.OperationMonth = res.data.reporttime
|
|
|
- let date = this.OperationMonth.split('-')
|
|
|
- this.OperationName = date[0] + '年' + date[1] + '月' + res.data.stationid.aname + '性能及可靠性优化建议报告';
|
|
|
- this.OperationGs = `本报告旨在对${res.data.stationid.aname}内的风机进行综合分析,以筛选出同时存在性能问题和可靠性隐患的风机,为后续的检修与优化提供依据。`
|
|
|
-
|
|
|
- this.basrMsgArr.forEach(it => {
|
|
|
+ this.OperationMonth = res.data.reporttime;
|
|
|
+ let date = this.OperationMonth.split("-");
|
|
|
+ this.OperationName =
|
|
|
+ date[0] +
|
|
|
+ "年" +
|
|
|
+ date[1] +
|
|
|
+ "月" +
|
|
|
+ res.data.stationid.aname +
|
|
|
+ "性能及可靠性优化建议报告";
|
|
|
+ this.OperationGs = `本报告旨在对${res.data.stationid.aname}内的风机进行综合分析,以筛选出同时存在性能问题和可靠性隐患的风机,为后续的检修与优化提供依据。`;
|
|
|
+
|
|
|
+ this.basrMsgArr.forEach((it) => {
|
|
|
if (it.nameEn === "reportDate") {
|
|
|
- it.value = date[0] + '年' + date[1] + '月'
|
|
|
+ it.value = date[0] + "年" + date[1] + "月";
|
|
|
} else {
|
|
|
- it.value = res.data.stationid[it.nameEn]
|
|
|
+ it.value = res.data.stationid[it.nameEn];
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
|
|
|
- this.orderMsgArr.forEach(it => {
|
|
|
- it.value = jsonData.orderMsg[it.nameEn]
|
|
|
- })
|
|
|
+ this.orderMsgArr.forEach((it) => {
|
|
|
+ it.value = jsonData.orderMsg[it.nameEn];
|
|
|
+ });
|
|
|
|
|
|
this.fjsxList1 = res.data.xnwtls;
|
|
|
this.fjsxList2 = res.data.kkxwtls;
|
|
|
// 3.1筛选结果
|
|
|
- for (const key in res.data.FilterResults) {
|
|
|
- if (Object.prototype.hasOwnProperty.call(res.data.FilterResults, key)) {
|
|
|
- const element = res.data.FilterResults[key];
|
|
|
- let obj = {
|
|
|
- windName: key,
|
|
|
- value: element
|
|
|
- }
|
|
|
- this.orderResultArr.push(obj)
|
|
|
+ res.data.Filteranalysis.split(";").forEach((ele) => {
|
|
|
+ let obj = {
|
|
|
+ windName: ele.split(":")[0],
|
|
|
+ value: ele.split(":")[1]
|
|
|
}
|
|
|
- }
|
|
|
+ this.orderAnalysisArr.push(obj);
|
|
|
+ });
|
|
|
+ res.data.FilterResults.split("\n").forEach((ele) => {
|
|
|
+ let obj = {
|
|
|
+ windName: ele.split(":")[0],
|
|
|
+ value: ele.split(":")[1]
|
|
|
+ }
|
|
|
+ this.orderResultArr.push(obj);
|
|
|
+ });
|
|
|
+ // for (const key in res.data.FilterResults) {
|
|
|
+ // if (Object.prototype.hasOwnProperty.call(res.data.FilterResults, key)) {
|
|
|
+ // const element = res.data.FilterResults[key];
|
|
|
+ // let obj = {
|
|
|
+ // windName: key,
|
|
|
+ // value: element
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
// 4风机情况说明
|
|
|
- this.windSituationReport = res.data.qksm
|
|
|
+ this.windSituationReport = res.data.qksm;
|
|
|
// 5检修建议
|
|
|
- this.maintenanceRecommendations = res.data.jxjy
|
|
|
+ this.maintenanceRecommendations = res.data.jxjy;
|
|
|
|
|
|
this.conclusionMsg =
|
|
|
- `本次分析针对${res.data.stationid.aname}的风机发电能力下降及可靠性隐患进行了全面评估。通过实施短期和长期检修措施,预计将显著提高设备的发电效率和运行可靠性。`
|
|
|
+ `本次分析针对${res.data.stationid.aname}的风机发电能力下降及可靠性隐患进行了全面评估。通过实施短期和长期检修措施,预计将显著提高设备的发电效率和运行可靠性。`;
|
|
|
},
|
|
|
},
|
|
|
|
|
@@ -646,12 +793,9 @@
|
|
|
background: #fff;
|
|
|
overflow: scroll;
|
|
|
|
|
|
- #pdfDomop {
|
|
|
+ #pdfDom {
|
|
|
margin: 20px;
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
&.themeLight {
|