|
|
@@ -302,13 +302,13 @@
|
|
|
min-width="300"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <!-- <el-button
|
|
|
+ <el-button
|
|
|
@click="handleDownLoadChart(scope.row)"
|
|
|
type="text"
|
|
|
size="small"
|
|
|
>
|
|
|
下载报告
|
|
|
- </el-button> -->
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
@click="abnormalDialog(scope.row, '上传报告')"
|
|
|
type="text"
|
|
|
@@ -476,6 +476,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ fileDataList: {},
|
|
|
fieldInfo: {}, //风场信息
|
|
|
firstLoad: false, // 是否是第一次加载
|
|
|
fieldCodeList: [],
|
|
|
@@ -549,17 +550,52 @@ export default {
|
|
|
// console.log(row.fieldCode, "row");
|
|
|
// await this.getAllAnalysis(row.batchCode);
|
|
|
// await this.getFieldDetail(row.batchCode);
|
|
|
- // const res = await axios.post(
|
|
|
- // "/downLoadChart/chartServer/charts/yawErrorLine",
|
|
|
+
|
|
|
+ // const diagramRelations = [
|
|
|
// {
|
|
|
- // fieldEngineCode: "WOG00623", //lineChartFen
|
|
|
- // bucketName: "",
|
|
|
- // // row.fieldCode + "/" + row.batchCode + "/" + item.analysisTypeCode, //桶名称
|
|
|
- // objectName: "", //在 MinIO 中的文件名
|
|
|
- // fieldInfo: this.fieldInfo,
|
|
|
+ // batchCode: "WOF039800012-WOB000001",
|
|
|
+ // analysisTypeCode: "production_indicator",
|
|
|
+ // analysisTypeName: "机组指标",
|
|
|
// fileAddr:
|
|
|
+ // "http://192.168.50.233:6900/wof039800012/WOF039800012-WOB000001/production_indicator/manual/WT2000%252F93-production-indicator.csv",
|
|
|
+ // autoAnalysis: null,
|
|
|
+ // createTime: "2025-01-21 16:35:46",
|
|
|
+ // engineTypeCode: "WEM00012",
|
|
|
+ // },
|
|
|
+ // // {
|
|
|
+ // // batchCode: "WOF039800012-WOB000001",
|
|
|
+ // // analysisTypeCode: "production_indicator",
|
|
|
+ // // analysisTypeName: "机组指标",
|
|
|
+ // // fileAddr:
|
|
|
+ // // "http://192.168.50.233:6900/wof039800012/WOF039800012-WOB000001/production_indicator/manual/WT2000%252F100-production-indicator.csv",
|
|
|
+ // // autoAnalysis: null,
|
|
|
+ // // createTime: "2025-01-21 16:35:46",
|
|
|
+ // // engineTypeCode: "WEM00013",
|
|
|
+ // // },
|
|
|
+ // // {
|
|
|
+ // // batchCode: "WOF039800012-WOB000001",
|
|
|
+ // // analysisTypeCode: "production_indicator",
|
|
|
+ // // analysisTypeName: "机组指标",
|
|
|
+ // // fileAddr:
|
|
|
+ // // "http://192.168.50.233:6900/wof039800012/WOF039800012-WOB000001/production_indicator/manual/WT2000%252F110-production-indicator.csv",
|
|
|
+ // // autoAnalysis: null,
|
|
|
+ // // createTime: "2025-01-21 16:35:46",
|
|
|
+ // // engineTypeCode: "WEM00018",
|
|
|
+ // // },
|
|
|
+ // ];
|
|
|
+ // diagramRelations.map(async (item) => {
|
|
|
+ // const res = await axios.post(
|
|
|
+ // "/downLoadChart/chartServer/charts/radarChart",
|
|
|
+ // {
|
|
|
+ // fieldEngineCode: item.fieldEngineCode ? item.fieldEngineCode : "", //lineChartFen
|
|
|
+ // bucketName: "bucket-zhzn",
|
|
|
+ // // row.fieldCode + "/" + row.batchCode + "/" + item.analysisTypeCode, //桶名称
|
|
|
+ // objectName: "charts/111.jpg", //在 MinIO 中的文件名
|
|
|
+ // fieldInfo: this.fieldInfo,
|
|
|
+ // fileAddr: item.fileAddr,
|
|
|
+ // chartType: "radar",
|
|
|
// // "http://192.168.50.233:6900/wof039800012/WOF039800012-WOB000001/wind_speed_frequency/manual/wind_Speed_Frequency%2302.json", //barChart url:bar
|
|
|
- // // "http://192.168.50.233:6900/wof039800012/WOF039800012-WOB000001/cp/manual/%2320.json", //lineChartFen url:line
|
|
|
+ // // "http://192.168.50.233:6900/wof039800012/WOF039800012-WOB000001/cp_windspeed/manual/%2319.json", //lineChartFen url:line
|
|
|
// // "http://192.168.50.233:6900/wof039800012/WOF039800012-WOB000001/cp/manual/WEM00013.json", //lineAndChartLine url:lineAndChildLine
|
|
|
// // "http://192.168.50.233:6900/wof039800012/WOF039800012-WOB000001/data_integrity_second/manual/Data_Integrity_Of_Second_Analyst.json", //HeatmapCharts url:heatmap
|
|
|
// // "http://192.168.50.233:6900/wof039800012/WOF039800012-WOB000001/speed_torque/manual/total_3D_WEM00012.json", //3DDrawingChart url:3DDrawingChart
|
|
|
@@ -574,25 +610,49 @@ export default {
|
|
|
// // "http://192.168.50.233:6900/wof039800012/WOF039800012-WOB000001/tsr_trend/manual/%2302.json", //boxMarkersCharts
|
|
|
// // "http://192.168.50.233:6900/wof039800012/WOF039800012-WOB000001/temperature_large_components/manual/GeneratorTemperature/%2321.json", //generatorTemperature
|
|
|
// // "http://192.168.50.233:6900/wof039800012/WOF039800012-WOB000001/wind_direction_frequency/manual/wind_direction_frequency%2318.json", //windRoseChart
|
|
|
- // "http://192.168.50.233:6900/wof039800012/WOF039800012-WOB000001/yaw_error/manual/%2320.json", //yawErrorLine
|
|
|
- // }
|
|
|
- // );
|
|
|
- // // this.allAnalysis.map(async (item, ind) => {
|
|
|
+ // // "http://192.168.50.233:6900/wof039800012/WOF039800012-WOB000001/yaw_error/manual/%2320.json", //yawErrorLine
|
|
|
+ // // "http://192.168.50.233:6900/wof039800012/WOF039800012-WOB000001/fault/manual/total_fault_result.csv", //faultAllChart //全场故障
|
|
|
+ // // "http://192.168.50.233:6900/wof039800012/WOF039800012-WOB000001/fault/manual/turbine_fault_result.csv", //faultUnitChart //机组故障
|
|
|
+ // // "http://192.168.50.233:6900/wof039800012/WOF039800012-WOB000001/yaw_error/manual/yaw_error_result.csv", //静态偏航总图 //yawErrorBarSumChart
|
|
|
+ // // "http://192.168.50.233:6900/wof039800012/WOF039800012-WOB000001/production_indicator/manual/production_indicator_total.csv", //全场指标 productionIndicatorTotal
|
|
|
+ // }
|
|
|
+ // );
|
|
|
+ // });
|
|
|
|
|
|
- // // console.log(res, "res linechart");
|
|
|
- // // });
|
|
|
+ // await axios.post("/downLoadChart/chartServer/charts/CopyFileCsv", {
|
|
|
+ // fieldInfo: this.fieldInfo,
|
|
|
+ // rows: [
|
|
|
+ // {
|
|
|
+ // Qdr: "-70352582.72",
|
|
|
+ // Qp: "70352582.72",
|
|
|
+ // Rdr: "0",
|
|
|
+ // Thc: "1675.06",
|
|
|
+ // },
|
|
|
+ // ],
|
|
|
+ // "zn-techcn-replace-tags-production_indicator_unit-generalFiles": [
|
|
|
+ // "http://192.168.50.233:6900/bucket-zhzn/charts/#03.jpg",
|
|
|
+ // "http://192.168.50.233:6900/bucket-zhzn/charts/#05.jpg",
|
|
|
+ // "http://192.168.50.233:6900/bucket-zhzn/charts/#06.jpg",
|
|
|
+ // "http://192.168.50.233:6900/bucket-zhzn/charts/#08.jpg",
|
|
|
+ // "http://192.168.50.233:6900/bucket-zhzn/charts/#09.jpg",
|
|
|
+ // "http://192.168.50.233:6900/bucket-zhzn/charts/#14.jpg",
|
|
|
+ // "http://192.168.50.233:6900/bucket-zhzn/charts/#17.jpg",
|
|
|
+ // ],
|
|
|
+ // });
|
|
|
// },
|
|
|
- //获取 风机信息
|
|
|
+
|
|
|
+ // 获取 风机信息
|
|
|
+
|
|
|
async handleDownLoadChart(row) {
|
|
|
await this.getAllAnalysis(row.batchCode);
|
|
|
await this.getFieldDetail(row.batchCode);
|
|
|
+
|
|
|
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
|
|
|
@@ -602,20 +662,105 @@ export default {
|
|
|
item.fileAddr.includes(filterAnalysis.filterFileAddr)
|
|
|
) || []
|
|
|
: itemAnalysis.generalFiles) {
|
|
|
- tasks.push(
|
|
|
- limit(() =>
|
|
|
- this.postChartData(
|
|
|
- filterAnalysis.generalFiles.urlType,
|
|
|
- row,
|
|
|
- itemAnalysis,
|
|
|
- itemField,
|
|
|
- filterAnalysis
|
|
|
+ //静态偏航误差 --通过allAnalysisType.js文件配置实现需求
|
|
|
+ if (Array.isArray(filterAnalysis.generalFiles.urlType)) {
|
|
|
+ filterAnalysis.generalFiles.urlType.map(
|
|
|
+ (itemUrlType, indUrlType) => {
|
|
|
+ tasks.push(
|
|
|
+ limit(() =>
|
|
|
+ this.postChartData(
|
|
|
+ itemUrlType,
|
|
|
+ row,
|
|
|
+ itemAnalysis,
|
|
|
+ itemField,
|
|
|
+ filterAnalysis,
|
|
|
+ "generalFiles"
|
|
|
+ )
|
|
|
+ )
|
|
|
+ );
|
|
|
+ }
|
|
|
+ );
|
|
|
+ } else if (filterAnalysis.typeCode === "fault") {
|
|
|
+ if (itemField.fileAddr.includes("turbine_fault_result")) {
|
|
|
+ if (itemField.engineTypeCode === "turbine_fault_result") {
|
|
|
+ tasks.push(
|
|
|
+ limit(() =>
|
|
|
+ this.postChartData(
|
|
|
+ "faultUnitChart",
|
|
|
+ row,
|
|
|
+ itemAnalysis,
|
|
|
+ itemField,
|
|
|
+ filterAnalysis,
|
|
|
+ "generalFiles"
|
|
|
+ )
|
|
|
+ )
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (itemField.engineTypeCode === "total_fault_result") {
|
|
|
+ tasks.push(
|
|
|
+ limit(() =>
|
|
|
+ this.postChartData(
|
|
|
+ "faultAllChart",
|
|
|
+ row,
|
|
|
+ itemAnalysis,
|
|
|
+ itemField,
|
|
|
+ filterAnalysis,
|
|
|
+ "generalFiles"
|
|
|
+ )
|
|
|
+ )
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (filterAnalysis.typeCode === "production_indicator") {
|
|
|
+ //总图全场
|
|
|
+ if (
|
|
|
+ itemField.fileAddr.includes(
|
|
|
+ filterAnalysis.generalFiles.FileTypeFromUrl
|
|
|
)
|
|
|
- )
|
|
|
- );
|
|
|
+ ) {
|
|
|
+ tasks.push(
|
|
|
+ limit(() =>
|
|
|
+ this.postChartData(
|
|
|
+ filterAnalysis.generalFiles.urlType,
|
|
|
+ row,
|
|
|
+ itemAnalysis,
|
|
|
+ itemField,
|
|
|
+ filterAnalysis,
|
|
|
+ "generalFiles"
|
|
|
+ )
|
|
|
+ )
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ tasks.push(
|
|
|
+ limit(() =>
|
|
|
+ this.postChartData(
|
|
|
+ "radarChart",
|
|
|
+ row,
|
|
|
+ itemAnalysis,
|
|
|
+ itemField,
|
|
|
+ filterAnalysis,
|
|
|
+ "generalFiles"
|
|
|
+ )
|
|
|
+ )
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ tasks.push(
|
|
|
+ limit(() =>
|
|
|
+ this.postChartData(
|
|
|
+ filterAnalysis.generalFiles.urlType,
|
|
|
+ row,
|
|
|
+ itemAnalysis,
|
|
|
+ itemField,
|
|
|
+ filterAnalysis,
|
|
|
+ "generalFiles"
|
|
|
+ )
|
|
|
+ )
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
if (itemAnalysis.diagramRelations) {
|
|
|
for (const itemField of filterAnalysis.filterFileAddr
|
|
|
? itemAnalysis.diagramRelations
|
|
|
@@ -634,7 +779,7 @@ export default {
|
|
|
? filterAnalysis.diagramRelations.urlType[0]
|
|
|
: filterAnalysis.diagramRelations.urlType[1]
|
|
|
: filterAnalysis.diagramRelations.urlType;
|
|
|
- console.log("urlType", filterAnalysis.typeName, urlType);
|
|
|
+ // console.log("urlType", filterAnalysis.typeName, urlType);
|
|
|
tasks.push(
|
|
|
limit(() =>
|
|
|
this.postChartData(
|
|
|
@@ -642,36 +787,42 @@ export default {
|
|
|
row,
|
|
|
itemAnalysis,
|
|
|
itemField,
|
|
|
- filterAnalysis
|
|
|
+ filterAnalysis,
|
|
|
+ "diagramRelations"
|
|
|
)
|
|
|
)
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
await Promise.all(tasks);
|
|
|
+
|
|
|
+ await axios.post("/downLoadChart/chartServer/charts/CopyFileCsv", {
|
|
|
+ fieldInfo: this.fieldInfo,
|
|
|
+ ...this.fileDataList,
|
|
|
+ });
|
|
|
+
|
|
|
+ console.log("生成成功:", this.fileDataList);
|
|
|
console.log("全部图表生成请求已完成");
|
|
|
},
|
|
|
|
|
|
- async postChartData(urlType, row, itemAnalysis, itemField, filterAnalysis) {
|
|
|
+ async postChartData(
|
|
|
+ urlType,
|
|
|
+ row,
|
|
|
+ itemAnalysis,
|
|
|
+ itemField,
|
|
|
+ filterAnalysis,
|
|
|
+ typeChart
|
|
|
+ ) {
|
|
|
try {
|
|
|
- console.log(
|
|
|
- filterAnalysis.filterFileAddr +
|
|
|
- "/" +
|
|
|
- itemField.fieldEngineName +
|
|
|
- ".png",
|
|
|
- "filterAnalysis.filterFileAddr"
|
|
|
- );
|
|
|
const objectname =
|
|
|
itemAnalysis.analysisTypeCode === "temperature_large_components"
|
|
|
? filterAnalysis.filterFileAddr +
|
|
|
"/" +
|
|
|
itemField.fieldEngineName +
|
|
|
- ".png"
|
|
|
- : urlType + itemField.fieldEngineName + ".png" ||
|
|
|
- urlType + itemField.engineTypeCode + ".png";
|
|
|
- console.log(objectname, "objectname");
|
|
|
+ ".jpg"
|
|
|
+ : urlType + itemField.fieldEngineName + ".jpg" ||
|
|
|
+ urlType + itemField.engineTypeCode + ".jpg";
|
|
|
const res = await axios.post(
|
|
|
`/downLoadChart/chartServer/charts/${urlType}`,
|
|
|
{
|
|
|
@@ -682,14 +833,59 @@ export default {
|
|
|
objectname,
|
|
|
fieldInfo: this.fieldInfo,
|
|
|
fileAddr: itemField.fileAddr,
|
|
|
+ chartType:
|
|
|
+ filterAnalysis.typeDocxName === "production_indicator_unit"
|
|
|
+ ? "radar"
|
|
|
+ : urlType,
|
|
|
}
|
|
|
);
|
|
|
- console.log("生成成功:", res);
|
|
|
+ let key = `zn-techcn-replace-tags-${filterAnalysis.typeDocxName}-${typeChart}`;
|
|
|
+ if (urlType === "yawErrorBarSumChart") {
|
|
|
+ key = `zn-techcn-replace-tags-${filterAnalysis.typeDocxName}-generalFiles2`;
|
|
|
+
|
|
|
+ if (!this.fileDataList["yawErrorRows"]) {
|
|
|
+ this.$set(this.fileDataList, "yawErrorRows", []); // Vue 2 中响应式设置对象属性
|
|
|
+ }
|
|
|
+ this.fileDataList["yawErrorRows"] = res?.data?.data?.data;
|
|
|
+ } else if (urlType === "yawErrorChart") {
|
|
|
+ key = `zn-techcn-replace-tags-${filterAnalysis.typeDocxName}-generalFiles1`;
|
|
|
+ }
|
|
|
+ if (filterAnalysis.typeDocxName === "production_indicator_all") {
|
|
|
+ if (!this.fileDataList["rows"]) {
|
|
|
+ this.$set(this.fileDataList, "rows", []); // Vue 2 中响应式设置对象属性
|
|
|
+ }
|
|
|
+ this.fileDataList["rows"] = res?.data?.data?.data;
|
|
|
+ }
|
|
|
+ //
|
|
|
+ if (itemField.engineTypeCode === "total_fault_result") {
|
|
|
+ if (!this.fileDataList["faultRows"]) {
|
|
|
+ this.$set(this.fileDataList, "faultRows", []); // Vue 2 中响应式设置对象属性
|
|
|
+ }
|
|
|
+ this.fileDataList["faultRows"] = res?.data?.data?.data;
|
|
|
+ }
|
|
|
+ if (itemField.engineTypeCode === "turbine_fault_result") {
|
|
|
+ if (!this.fileDataList["windTurbineRows"]) {
|
|
|
+ this.$set(this.fileDataList, "windTurbineRows", []); // Vue 2 中响应式设置对象属性
|
|
|
+ }
|
|
|
+ this.fileDataList["windTurbineRows"] = res?.data?.data?.data;
|
|
|
+ }
|
|
|
+ if (filterAnalysis.typeDocxName === "production_indicator_unit") {
|
|
|
+ if (!this.fileDataList[key]) {
|
|
|
+ this.$set(this.fileDataList, key, []); // Vue 2 中响应式设置对象属性
|
|
|
+ }
|
|
|
+ res?.data?.data?.imageUrls.map((imgval) => {
|
|
|
+ this.fileDataList[key].push(imgval);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ if (!this.fileDataList[key]) {
|
|
|
+ this.$set(this.fileDataList, key, []); // Vue 2 中响应式设置对象属性
|
|
|
+ }
|
|
|
+ this.fileDataList[key].push(res?.data?.data?.imageUrl);
|
|
|
+ }
|
|
|
} catch (err) {
|
|
|
console.error("生成失败:", err);
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
getFileTypeFromUrl(url, keyword) {
|
|
|
return url.includes(keyword) ? keyword : "Unknown";
|
|
|
},
|