|
|
@@ -309,7 +309,7 @@
|
|
|
min-width="300"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button
|
|
|
+ <!-- <el-button
|
|
|
@click="handleDownLoadChart(scope.row)"
|
|
|
type="text"
|
|
|
size="small"
|
|
|
@@ -320,7 +320,7 @@
|
|
|
"
|
|
|
>
|
|
|
下载报告
|
|
|
- </el-button>
|
|
|
+ </el-button> -->
|
|
|
<!-- <el-button
|
|
|
@click="abnormalDialog(scope.row, '上传报告')"
|
|
|
type="text"
|
|
|
@@ -481,7 +481,7 @@ import {
|
|
|
import { downloadDocx } from "@/utils/common";
|
|
|
import { getFieldInfo } from "@/api/overview";
|
|
|
import axios from "axios";
|
|
|
-import pLimit from "p-limit";
|
|
|
+// import pLimit from "p-limit";
|
|
|
import { allAnalysisType } from "./js/allAnalysisType";
|
|
|
import { mapMutations, mapState } from "vuex";
|
|
|
import {
|
|
|
@@ -593,7 +593,7 @@ export default {
|
|
|
itemAnalysis,
|
|
|
itemField,
|
|
|
filterAnalysis,
|
|
|
- typeChart
|
|
|
+ typeChart,
|
|
|
) {
|
|
|
try {
|
|
|
if (itemField.analysisTypeName === "环境温度传感器") {
|
|
|
@@ -625,18 +625,18 @@ export default {
|
|
|
filterAnalysis.typeDocxName === "production_indicator_unit"
|
|
|
? "radar"
|
|
|
: urlType,
|
|
|
- }
|
|
|
+ },
|
|
|
);
|
|
|
// 每完成 10% 提示一次(可调)
|
|
|
const percent = Math.floor(
|
|
|
- (this.progress.current / this.progress.total) * 100
|
|
|
+ (this.progress.current / this.progress.total) * 100,
|
|
|
);
|
|
|
if (percent % 5 === 0 && !this._shownPercents?.includes(percent)) {
|
|
|
this._shownPercents = this._shownPercents || [];
|
|
|
this._shownPercents.push(percent);
|
|
|
|
|
|
this.$notify.info(
|
|
|
- `📈 已完成 ${percent}%/${this.progress.current}张,共 ${this.progress.total} 张图表`
|
|
|
+ `📈 已完成 ${percent}%/${this.progress.current}张,共 ${this.progress.total} 张图表`,
|
|
|
);
|
|
|
}
|
|
|
let key = `zn-techcn-replace-tags-${filterAnalysis.typeDocxName}-${typeChart}`;
|
|
|
@@ -685,207 +685,207 @@ export default {
|
|
|
console.error("生成失败:", err);
|
|
|
}
|
|
|
},
|
|
|
- async handleDownLoadChart(row) {
|
|
|
- this.progress.current = 0;
|
|
|
- this.progress.total = 0;
|
|
|
- this.fileDataList = {};
|
|
|
- this.setDownloadDisabled(true);
|
|
|
- this.$notify.warning("开始生成 Word 文档...");
|
|
|
- try {
|
|
|
- await this.getAllAnalysis(row.batchCode);
|
|
|
- await this.getFieldDetail(row.batchCode);
|
|
|
- this.$message.info("开始生成word文档");
|
|
|
- const limit = pLimit(5); // 限制同时并发的请求数量为 5
|
|
|
- const tasks = [];
|
|
|
- for (const itemAnalysis of this.allAnalysis) {
|
|
|
- const filterAnalysis = allAnalysisType.filter(
|
|
|
- (itemType) => itemType.typeName === itemAnalysis.analysisTypeName
|
|
|
- )[0];
|
|
|
+ // async handleDownLoadChart(row) {
|
|
|
+ // this.progress.current = 0;
|
|
|
+ // this.progress.total = 0;
|
|
|
+ // this.fileDataList = {};
|
|
|
+ // this.setDownloadDisabled(true);
|
|
|
+ // this.$notify.warning("开始生成 Word 文档...");
|
|
|
+ // try {
|
|
|
+ // await this.getAllAnalysis(row.batchCode);
|
|
|
+ // await this.getFieldDetail(row.batchCode);
|
|
|
+ // this.$message.info("开始生成word文档");
|
|
|
+ // const limit = pLimit(5); // 限制同时并发的请求数量为 5
|
|
|
+ // const tasks = [];
|
|
|
+ // for (const itemAnalysis of this.allAnalysis) {
|
|
|
+ // const filterAnalysis = allAnalysisType.filter(
|
|
|
+ // (itemType) => itemType.typeName === itemAnalysis.analysisTypeName,
|
|
|
+ // )[0];
|
|
|
|
|
|
- if (itemAnalysis.generalFiles) {
|
|
|
- //这里过滤的是发电机温度的类型 在url 中是否能找到filterFileAddr
|
|
|
- for (const itemField of filterAnalysis.filterFileAddr
|
|
|
- ? itemAnalysis.generalFiles
|
|
|
- .filter((item) => item.fileAddr.endsWith(".json"))
|
|
|
- .filter((item) =>
|
|
|
- item.fileAddr.includes(filterAnalysis.filterFileAddr)
|
|
|
- ) || []
|
|
|
- : itemAnalysis.generalFiles) {
|
|
|
- //静态偏航误差 --通过allAnalysisType.js文件配置实现需求
|
|
|
- if (Array.isArray(filterAnalysis.generalFiles.urlType)) {
|
|
|
- filterAnalysis.generalFiles.urlType.map(
|
|
|
- (itemUrlType, indUrlType) => {
|
|
|
- tasks.push(
|
|
|
- limit(async () => {
|
|
|
- await this.postChartData(
|
|
|
- itemUrlType,
|
|
|
- row,
|
|
|
- itemAnalysis,
|
|
|
- itemField,
|
|
|
- filterAnalysis,
|
|
|
- "generalFiles"
|
|
|
- );
|
|
|
- this.progress.current++;
|
|
|
- })
|
|
|
- );
|
|
|
- }
|
|
|
- );
|
|
|
- } else if (filterAnalysis.typeCode === "fault") {
|
|
|
- if (itemField.fileAddr.includes("turbine_fault_result")) {
|
|
|
- if (itemField.engineTypeCode === "turbine_fault_result") {
|
|
|
- tasks.push(
|
|
|
- limit(async () => {
|
|
|
- await this.postChartData(
|
|
|
- "faultUnitChart",
|
|
|
- row,
|
|
|
- itemAnalysis,
|
|
|
- itemField,
|
|
|
- filterAnalysis,
|
|
|
- "generalFiles"
|
|
|
- );
|
|
|
- this.progress.current++;
|
|
|
- })
|
|
|
- );
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (itemField.engineTypeCode === "total_fault_result") {
|
|
|
- tasks.push(
|
|
|
- limit(async () => {
|
|
|
- await this.postChartData(
|
|
|
- "faultAllChart",
|
|
|
- row,
|
|
|
- itemAnalysis,
|
|
|
- itemField,
|
|
|
- filterAnalysis,
|
|
|
- "generalFiles"
|
|
|
- );
|
|
|
- this.progress.current++;
|
|
|
- })
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (filterAnalysis.typeCode === "production_indicator") {
|
|
|
- //总图全场
|
|
|
- if (
|
|
|
- itemField.fileAddr.includes(
|
|
|
- filterAnalysis.generalFiles.FileTypeFromUrl
|
|
|
- )
|
|
|
- ) {
|
|
|
- tasks.push(
|
|
|
- limit(async () => {
|
|
|
- await this.postChartData(
|
|
|
- filterAnalysis.generalFiles.urlType,
|
|
|
- row,
|
|
|
- itemAnalysis,
|
|
|
- itemField,
|
|
|
- filterAnalysis,
|
|
|
- "generalFiles"
|
|
|
- );
|
|
|
- this.progress.current++;
|
|
|
- // 每完成 10% 提示一次(可调)
|
|
|
- })
|
|
|
- );
|
|
|
- } else {
|
|
|
- tasks.push(
|
|
|
- limit(async () => {
|
|
|
- await this.postChartData(
|
|
|
- "radarChart",
|
|
|
- row,
|
|
|
- itemAnalysis,
|
|
|
- itemField,
|
|
|
- filterAnalysis,
|
|
|
- "generalFiles"
|
|
|
- );
|
|
|
- this.progress.current++;
|
|
|
- })
|
|
|
- );
|
|
|
- }
|
|
|
- } else {
|
|
|
- tasks.push(
|
|
|
- limit(async () => {
|
|
|
- await this.postChartData(
|
|
|
- filterAnalysis.generalFiles.urlType,
|
|
|
- row,
|
|
|
- itemAnalysis,
|
|
|
- itemField,
|
|
|
- filterAnalysis,
|
|
|
- "generalFiles"
|
|
|
- );
|
|
|
- this.progress.current++;
|
|
|
- })
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (itemAnalysis.diagramRelations) {
|
|
|
- for (const itemField of filterAnalysis.filterFileAddr
|
|
|
- ? itemAnalysis.diagramRelations
|
|
|
- .filter((item) => item.fileAddr.endsWith(".json"))
|
|
|
- .filter((item) =>
|
|
|
- item.fileAddr.includes(filterAnalysis.filterFileAddr)
|
|
|
- ) || []
|
|
|
- : itemAnalysis.diagramRelations) {
|
|
|
- const urlType = Array.isArray(
|
|
|
- filterAnalysis.diagramRelations.urlType
|
|
|
- )
|
|
|
- ? this.getFileTypeFromUrl(
|
|
|
- itemField.fileAddr,
|
|
|
- filterAnalysis.diagramRelations.FileTypeFromUrl
|
|
|
- ) === filterAnalysis.diagramRelations.FileTypeFromUrl
|
|
|
- ? filterAnalysis.diagramRelations.urlType[0]
|
|
|
- : filterAnalysis.diagramRelations.urlType[1]
|
|
|
- : filterAnalysis.diagramRelations.urlType;
|
|
|
- tasks.push(
|
|
|
- limit(async () => {
|
|
|
- await this.postChartData(
|
|
|
- urlType,
|
|
|
- row,
|
|
|
- itemAnalysis,
|
|
|
- itemField,
|
|
|
- filterAnalysis,
|
|
|
- "diagramRelations"
|
|
|
- );
|
|
|
- this.progress.current++;
|
|
|
- })
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- this.progress.total = tasks.length;
|
|
|
- await Promise.all(tasks);
|
|
|
+ // if (itemAnalysis.generalFiles) {
|
|
|
+ // //这里过滤的是发电机温度的类型 在url 中是否能找到filterFileAddr
|
|
|
+ // for (const itemField of filterAnalysis.filterFileAddr
|
|
|
+ // ? itemAnalysis.generalFiles
|
|
|
+ // .filter((item) => item.fileAddr.endsWith(".json"))
|
|
|
+ // .filter((item) =>
|
|
|
+ // item.fileAddr.includes(filterAnalysis.filterFileAddr),
|
|
|
+ // ) || []
|
|
|
+ // : itemAnalysis.generalFiles) {
|
|
|
+ // //静态偏航误差 --通过allAnalysisType.js文件配置实现需求
|
|
|
+ // if (Array.isArray(filterAnalysis.generalFiles.urlType)) {
|
|
|
+ // filterAnalysis.generalFiles.urlType.map(
|
|
|
+ // (itemUrlType, indUrlType) => {
|
|
|
+ // tasks.push(
|
|
|
+ // limit(async () => {
|
|
|
+ // await this.postChartData(
|
|
|
+ // itemUrlType,
|
|
|
+ // row,
|
|
|
+ // itemAnalysis,
|
|
|
+ // itemField,
|
|
|
+ // filterAnalysis,
|
|
|
+ // "generalFiles",
|
|
|
+ // );
|
|
|
+ // this.progress.current++;
|
|
|
+ // }),
|
|
|
+ // );
|
|
|
+ // },
|
|
|
+ // );
|
|
|
+ // } else if (filterAnalysis.typeCode === "fault") {
|
|
|
+ // if (itemField.fileAddr.includes("turbine_fault_result")) {
|
|
|
+ // if (itemField.engineTypeCode === "turbine_fault_result") {
|
|
|
+ // tasks.push(
|
|
|
+ // limit(async () => {
|
|
|
+ // await this.postChartData(
|
|
|
+ // "faultUnitChart",
|
|
|
+ // row,
|
|
|
+ // itemAnalysis,
|
|
|
+ // itemField,
|
|
|
+ // filterAnalysis,
|
|
|
+ // "generalFiles",
|
|
|
+ // );
|
|
|
+ // this.progress.current++;
|
|
|
+ // }),
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // if (itemField.engineTypeCode === "total_fault_result") {
|
|
|
+ // tasks.push(
|
|
|
+ // limit(async () => {
|
|
|
+ // await this.postChartData(
|
|
|
+ // "faultAllChart",
|
|
|
+ // row,
|
|
|
+ // itemAnalysis,
|
|
|
+ // itemField,
|
|
|
+ // filterAnalysis,
|
|
|
+ // "generalFiles",
|
|
|
+ // );
|
|
|
+ // this.progress.current++;
|
|
|
+ // }),
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // } else if (filterAnalysis.typeCode === "production_indicator") {
|
|
|
+ // //总图全场
|
|
|
+ // if (
|
|
|
+ // itemField.fileAddr.includes(
|
|
|
+ // filterAnalysis.generalFiles.FileTypeFromUrl,
|
|
|
+ // )
|
|
|
+ // ) {
|
|
|
+ // tasks.push(
|
|
|
+ // limit(async () => {
|
|
|
+ // await this.postChartData(
|
|
|
+ // filterAnalysis.generalFiles.urlType,
|
|
|
+ // row,
|
|
|
+ // itemAnalysis,
|
|
|
+ // itemField,
|
|
|
+ // filterAnalysis,
|
|
|
+ // "generalFiles",
|
|
|
+ // );
|
|
|
+ // this.progress.current++;
|
|
|
+ // // 每完成 10% 提示一次(可调)
|
|
|
+ // }),
|
|
|
+ // );
|
|
|
+ // } else {
|
|
|
+ // tasks.push(
|
|
|
+ // limit(async () => {
|
|
|
+ // await this.postChartData(
|
|
|
+ // "radarChart",
|
|
|
+ // row,
|
|
|
+ // itemAnalysis,
|
|
|
+ // itemField,
|
|
|
+ // filterAnalysis,
|
|
|
+ // "generalFiles",
|
|
|
+ // );
|
|
|
+ // this.progress.current++;
|
|
|
+ // }),
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // tasks.push(
|
|
|
+ // limit(async () => {
|
|
|
+ // await this.postChartData(
|
|
|
+ // filterAnalysis.generalFiles.urlType,
|
|
|
+ // row,
|
|
|
+ // itemAnalysis,
|
|
|
+ // itemField,
|
|
|
+ // filterAnalysis,
|
|
|
+ // "generalFiles",
|
|
|
+ // );
|
|
|
+ // this.progress.current++;
|
|
|
+ // }),
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if (itemAnalysis.diagramRelations) {
|
|
|
+ // for (const itemField of filterAnalysis.filterFileAddr
|
|
|
+ // ? itemAnalysis.diagramRelations
|
|
|
+ // .filter((item) => item.fileAddr.endsWith(".json"))
|
|
|
+ // .filter((item) =>
|
|
|
+ // item.fileAddr.includes(filterAnalysis.filterFileAddr),
|
|
|
+ // ) || []
|
|
|
+ // : itemAnalysis.diagramRelations) {
|
|
|
+ // const urlType = Array.isArray(
|
|
|
+ // filterAnalysis.diagramRelations.urlType,
|
|
|
+ // )
|
|
|
+ // ? this.getFileTypeFromUrl(
|
|
|
+ // itemField.fileAddr,
|
|
|
+ // filterAnalysis.diagramRelations.FileTypeFromUrl,
|
|
|
+ // ) === filterAnalysis.diagramRelations.FileTypeFromUrl
|
|
|
+ // ? filterAnalysis.diagramRelations.urlType[0]
|
|
|
+ // : filterAnalysis.diagramRelations.urlType[1]
|
|
|
+ // : filterAnalysis.diagramRelations.urlType;
|
|
|
+ // tasks.push(
|
|
|
+ // limit(async () => {
|
|
|
+ // await this.postChartData(
|
|
|
+ // urlType,
|
|
|
+ // row,
|
|
|
+ // itemAnalysis,
|
|
|
+ // itemField,
|
|
|
+ // filterAnalysis,
|
|
|
+ // "diagramRelations",
|
|
|
+ // );
|
|
|
+ // this.progress.current++;
|
|
|
+ // }),
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // this.progress.total = tasks.length;
|
|
|
+ // await Promise.all(tasks);
|
|
|
|
|
|
- const engineTypeList = await this.getEngineTypeList(
|
|
|
- this.fieldInfo.engineMillTypes,
|
|
|
- row.batchCode
|
|
|
- );
|
|
|
- this.$notify.success("✅ 图表全部生成完成,开始生成 Word 文档...");
|
|
|
- const wordFilePath = await axios.post(
|
|
|
- "/downLoadChart/chartServer/charts/CopyFileCsv",
|
|
|
- {
|
|
|
- fieldInfo: this.fieldInfo,
|
|
|
- dataTime: `${this.analysisInfo.dataStartTime}-${this.analysisInfo.dataEndTime}`,
|
|
|
- bucketName: "bucket-zhzn",
|
|
|
- objectName: `charts/${row.fieldCode}/${row.batchCode}`,
|
|
|
- engineTypeList: engineTypeList,
|
|
|
- ...this.fileDataList,
|
|
|
- }
|
|
|
- );
|
|
|
- // //下载minio 文件
|
|
|
- downloadDocx(
|
|
|
- wordFilePath.data.data.url,
|
|
|
- wordFilePath.data.data.fileName
|
|
|
- );
|
|
|
- this.$notify.success("🎉 Word 文档生成并已下载!");
|
|
|
- this.setDownloadDisabled(false);
|
|
|
- } catch (error) {
|
|
|
- console.log(error, "error");
|
|
|
- this.$notify.error("🎉 Word 文档生成并下载失败!");
|
|
|
- this.setDownloadDisabled(false);
|
|
|
- }
|
|
|
- },
|
|
|
+ // const engineTypeList = await this.getEngineTypeList(
|
|
|
+ // this.fieldInfo.engineMillTypes,
|
|
|
+ // row.batchCode,
|
|
|
+ // );
|
|
|
+ // this.$notify.success("✅ 图表全部生成完成,开始生成 Word 文档...");
|
|
|
+ // const wordFilePath = await axios.post(
|
|
|
+ // "/downLoadChart/chartServer/charts/CopyFileCsv",
|
|
|
+ // {
|
|
|
+ // fieldInfo: this.fieldInfo,
|
|
|
+ // dataTime: `${this.analysisInfo.dataStartTime}-${this.analysisInfo.dataEndTime}`,
|
|
|
+ // bucketName: "bucket-zhzn",
|
|
|
+ // objectName: `charts/${row.fieldCode}/${row.batchCode}`,
|
|
|
+ // engineTypeList: engineTypeList,
|
|
|
+ // ...this.fileDataList,
|
|
|
+ // },
|
|
|
+ // );
|
|
|
+ // // //下载minio 文件
|
|
|
+ // downloadDocx(
|
|
|
+ // wordFilePath.data.data.url,
|
|
|
+ // wordFilePath.data.data.fileName,
|
|
|
+ // );
|
|
|
+ // this.$notify.success("🎉 Word 文档生成并已下载!");
|
|
|
+ // this.setDownloadDisabled(false);
|
|
|
+ // } catch (error) {
|
|
|
+ // console.log(error, "error");
|
|
|
+ // this.$notify.error("🎉 Word 文档生成并下载失败!");
|
|
|
+ // this.setDownloadDisabled(false);
|
|
|
+ // }
|
|
|
+ // },
|
|
|
async getEngineTypeList(typeList, batchCode) {
|
|
|
return await Promise.all(
|
|
|
- typeList.map((item) => this.getEngineMillList(item, batchCode))
|
|
|
+ typeList.map((item) => this.getEngineMillList(item, batchCode)),
|
|
|
);
|
|
|
},
|
|
|
// 查询
|
|
|
@@ -912,7 +912,7 @@ export default {
|
|
|
this.loading = true;
|
|
|
const res = await windEngineMillPage(paramsData);
|
|
|
const filterMill = uniqueList.filter(
|
|
|
- (item) => item.millTypeCode === res.data.list[0].millTypeCode
|
|
|
+ (item) => item.millTypeCode === res.data.list[0].millTypeCode,
|
|
|
);
|
|
|
return { ...res.data.list[0], ratedPower: filterMill[0].ratedCapacity };
|
|
|
},
|
|
|
@@ -935,7 +935,7 @@ export default {
|
|
|
handleAutoAsstessList() {
|
|
|
window.open(
|
|
|
this.$router.resolve({ path: "/home/performance/autoAssetss" }).href,
|
|
|
- "_blank"
|
|
|
+ "_blank",
|
|
|
);
|
|
|
},
|
|
|
// 创建分析时请求
|
|
|
@@ -1061,7 +1061,7 @@ export default {
|
|
|
if (state === "0") {
|
|
|
// 分析状态为分析中
|
|
|
this.$confirm(
|
|
|
- "当前查看的分析记录为历史分析结果,最新分析记录还未分析完成不展示!"
|
|
|
+ "当前查看的分析记录为历史分析结果,最新分析记录还未分析完成不展示!",
|
|
|
)
|
|
|
.then(() => {
|
|
|
navigateToDetails();
|