|
@@ -600,90 +600,91 @@ export default {
|
|
|
console.log(itemField, "itemField");
|
|
console.log(itemField, "itemField");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const chartFileStem =
|
|
|
|
|
- (itemField.fieldEngineName &&
|
|
|
|
|
- String(itemField.fieldEngineName).trim()) ||
|
|
|
|
|
- itemField.engineTypeCode ||
|
|
|
|
|
- itemField.fieldEngineCode ||
|
|
|
|
|
- "chart";
|
|
|
|
|
const objectname =
|
|
const objectname =
|
|
|
itemAnalysis.analysisTypeCode === "temperature_large_components"
|
|
itemAnalysis.analysisTypeCode === "temperature_large_components"
|
|
|
- ? `${filterAnalysis.filterFileAddr}/${chartFileStem}.jpg`
|
|
|
|
|
|
|
+ ? filterAnalysis.filterFileAddr + "/" + itemField.fieldEngineName ||
|
|
|
|
|
+ itemField.engineTypeCode + ".jpg"
|
|
|
: itemField.engineTypeCode
|
|
: itemField.engineTypeCode
|
|
|
- ? `${urlType}${itemField.engineTypeCode}.jpg`
|
|
|
|
|
- : `${urlType}${chartFileStem}.jpg`;
|
|
|
|
|
-
|
|
|
|
|
- const res = await axios.post(
|
|
|
|
|
- `/downLoadChart/chartServer/charts/${urlType}`,
|
|
|
|
|
- {
|
|
|
|
|
- fieldEngineCode: itemField.fieldEngineCode,
|
|
|
|
|
- bucketName: "bucket-zhzn",
|
|
|
|
|
- engineTypeCode: itemField.machineTypeCode,
|
|
|
|
|
- objectName:
|
|
|
|
|
- `charts/${row.fieldCode}/${row.batchCode}/${itemAnalysis.analysisTypeCode}/` +
|
|
|
|
|
- objectname,
|
|
|
|
|
- fieldInfo: this.fieldInfo,
|
|
|
|
|
- fileAddr: itemField.fileAddr,
|
|
|
|
|
- chartType:
|
|
|
|
|
- filterAnalysis.typeDocxName === "production_indicator_unit"
|
|
|
|
|
- ? "radar"
|
|
|
|
|
- : urlType,
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ ? urlType + itemField.engineTypeCode + ".jpg"
|
|
|
|
|
+ : urlType + itemField.fieldEngineName + ".jpg";
|
|
|
|
|
+ console.log(
|
|
|
|
|
+ objectname,
|
|
|
|
|
+ "objectname",
|
|
|
|
|
+ itemAnalysis.analysisTypeName,
|
|
|
|
|
+ itemField.engineTypeCode,
|
|
|
|
|
+ itemAnalysis,
|
|
|
);
|
|
);
|
|
|
- // 每完成 10% 提示一次(可调)
|
|
|
|
|
- const percent = Math.floor(
|
|
|
|
|
- (this.progress.current / this.progress.total) * 100,
|
|
|
|
|
- );
|
|
|
|
|
- if (percent % 5 === 0 && !this._shownPercents?.includes(percent)) {
|
|
|
|
|
- this._shownPercents = this._shownPercents || [];
|
|
|
|
|
- this._shownPercents.push(percent);
|
|
|
|
|
|
|
+ // const res = await axios.post(
|
|
|
|
|
+ // `/downLoadChart/chartServer/charts/${urlType}`,
|
|
|
|
|
+ // {
|
|
|
|
|
+ // fieldEngineCode: itemField.fieldEngineCode,
|
|
|
|
|
+ // bucketName: "bucket-zhzn",
|
|
|
|
|
+ // engineTypeCode: itemField.machineTypeCode,
|
|
|
|
|
+ // objectName:
|
|
|
|
|
+ // `charts/${row.fieldCode}/${row.batchCode}/${itemAnalysis.analysisTypeCode}/` +
|
|
|
|
|
+ // objectname,
|
|
|
|
|
+ // fieldInfo: this.fieldInfo,
|
|
|
|
|
+ // fileAddr: itemField.fileAddr,
|
|
|
|
|
+ // chartType:
|
|
|
|
|
+ // filterAnalysis.typeDocxName === "production_indicator_unit"
|
|
|
|
|
+ // ? "radar"
|
|
|
|
|
+ // : urlType,
|
|
|
|
|
+ // },
|
|
|
|
|
+ // );
|
|
|
|
|
+ // // 每完成 10% 提示一次(可调)
|
|
|
|
|
+ // const percent = Math.floor(
|
|
|
|
|
+ // (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} 张图表`,
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
- let key = `zn-techcn-replace-tags-${filterAnalysis.typeDocxName}-${typeChart}`;
|
|
|
|
|
- if (urlType === "yawErrorBarSumChart") {
|
|
|
|
|
- key = `zn-techcn-replace-tags-${filterAnalysis.typeDocxName}-generalFiles2`;
|
|
|
|
|
|
|
+ // this.$notify.info(
|
|
|
|
|
+ // `📈 已完成 ${percent}%/${this.progress.current}张,共 ${this.progress.total} 张图表`,
|
|
|
|
|
+ // );
|
|
|
|
|
+ // }
|
|
|
|
|
+ // 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);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 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) {
|
|
} catch (err) {
|
|
|
console.error("生成失败:", err);
|
|
console.error("生成失败:", err);
|
|
|
}
|
|
}
|
|
@@ -698,7 +699,7 @@ export default {
|
|
|
await this.getAllAnalysis(row.batchCode);
|
|
await this.getAllAnalysis(row.batchCode);
|
|
|
await this.getFieldDetail(row.batchCode);
|
|
await this.getFieldDetail(row.batchCode);
|
|
|
this.$message.info("开始生成word文档");
|
|
this.$message.info("开始生成word文档");
|
|
|
- const limit = pLimit(1); // 限制同时并发的请求数量为 5
|
|
|
|
|
|
|
+ const limit = pLimit(5); // 限制同时并发的请求数量为 5
|
|
|
const tasks = [];
|
|
const tasks = [];
|
|
|
for (const itemAnalysis of this.allAnalysis) {
|
|
for (const itemAnalysis of this.allAnalysis) {
|
|
|
const filterAnalysis = allAnalysisType.filter(
|
|
const filterAnalysis = allAnalysisType.filter(
|