|
@@ -1,17 +1,479 @@
|
|
|
<!--
|
|
|
* @Author: your name
|
|
|
* @Date: 2025-01-10 09:10:39
|
|
|
- * @LastEditTime: 2025-01-10 09:14:38
|
|
|
+ * @LastEditTime: 2025-01-16 16:46:39
|
|
|
* @LastEditors: bogon
|
|
|
* @Description: In User Settings Edit
|
|
|
* @FilePath: /performance-test/src/views/overview/components/tsr_trend/index.vue
|
|
|
-->
|
|
|
+
|
|
|
<template>
|
|
|
- <div>叶尖速比时序分析</div>
|
|
|
+ <div class="type-variable">
|
|
|
+ <!-- 叶尖速比时序分析--只有分图不存在总图 -->
|
|
|
+ <div class="left">
|
|
|
+ <FilterChart
|
|
|
+ :windList="windEngineGroupList"
|
|
|
+ @getEnfineList="getEnfineList"
|
|
|
+ @handlePrevious="handlePrevious"
|
|
|
+ @handleNext="handleNext"
|
|
|
+ ></FilterChart>
|
|
|
+ <el-alert type="info" :closable="false">
|
|
|
+ <template v-slot:title>
|
|
|
+ <div style="display: flex; align-items: center">
|
|
|
+ <i
|
|
|
+ class="el-icon-info"
|
|
|
+ style="font-size: 20px; margin-right: 5px"
|
|
|
+ ></i>
|
|
|
+ <h3>分析说明:</h3>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div style="font-size: 12px; margin-top: 10px">
|
|
|
+ 分析风力发电机组的Cp值对于优化其性能和增强效率至关重要:通过测量和分析Cp,可以直观了解风机的效率。Cp值越接近贝兹极限,说明风机的设计和运行越高效。
|
|
|
+ </div>
|
|
|
+ <div style="font-size: 12px; margin-top: 10px">
|
|
|
+ Cp的分析也是监测风机性能的重要手段。如果Cp值出现异常下降,可能预示着机械故障、叶片磨损或其他维护需求。
|
|
|
+ </div>
|
|
|
+ </el-alert>
|
|
|
+ <div class="charts" v-if="diagramRelationsDatas">
|
|
|
+ <template v-for="(itemChart, indChart) in diagramRelationsDatas">
|
|
|
+ <BoxMarkersCharts
|
|
|
+ :key="itemChart.fieldEngineCode"
|
|
|
+ @getResult="getResult"
|
|
|
+ @changeRequestNum="changeRequestNum"
|
|
|
+ :result="requestResult"
|
|
|
+ :index="indChart"
|
|
|
+ :ref="itemChart.fieldEngineCode"
|
|
|
+ :fileAddr="itemChart.fileAddr"
|
|
|
+ :chartData="chartData"
|
|
|
+ >
|
|
|
+ </BoxMarkersCharts>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <el-empty description="暂无分析记录" v-else></el-empty>
|
|
|
+ <el-tabs value="first">
|
|
|
+ <el-tab-pane label="意见描述" name="first">
|
|
|
+ <TinymceEditor
|
|
|
+ ref="editor"
|
|
|
+ v-model="comment"
|
|
|
+ @input="handleEditorInput($event)"
|
|
|
+ @onClick="onClick"
|
|
|
+ >
|
|
|
+ </TinymceEditor>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ <el-row type="flex" class="row-bg" justify="end">
|
|
|
+ <el-col :span="2" style="margin: 20px">
|
|
|
+ <el-button type="primary" size="small">提交评论</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <div class="right">
|
|
|
+ <DicCard
|
|
|
+ :batchCode="initBatchCode"
|
|
|
+ :analysisTypeCode="analysisTypeCode"
|
|
|
+ :commentDescriptionVos="commentDescriptionVos"
|
|
|
+ >
|
|
|
+ </DicCard>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import DicCard from "@/views/overview/components/dicCard/index.vue";
|
|
|
+import FilterChart from "@/views/overview/components/filterChart/index.vue";
|
|
|
+import BoxMarkersCharts from "@/views/performance/components/chartsCom/BoxMarkersCharts.vue";
|
|
|
+import TinymceEditor from "@/components/Tinymce.vue";
|
|
|
+import { analysisDetail, queryAnalysisedEngine } from "@/api/performance";
|
|
|
+
|
|
|
export default {
|
|
|
name: "tsrTrend",
|
|
|
+ components: {
|
|
|
+ DicCard,
|
|
|
+ FilterChart,
|
|
|
+ BoxMarkersCharts,
|
|
|
+ TinymceEditor,
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ initBatchCode: {
|
|
|
+ default: "",
|
|
|
+ type: String,
|
|
|
+ },
|
|
|
+ analysisTypeCode: {
|
|
|
+ default: "",
|
|
|
+ type: String,
|
|
|
+ },
|
|
|
+ batchCodeList: {
|
|
|
+ default: "",
|
|
|
+ type: Array,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ form: {
|
|
|
+ value2: "",
|
|
|
+ },
|
|
|
+ chartData: {
|
|
|
+ analysisTypeCode: "叶尖速比时序分析",
|
|
|
+ engineCode: "WEM00026",
|
|
|
+ engineTypeName: "",
|
|
|
+ xaixs: "时间",
|
|
|
+ yaixs: "叶尖速比",
|
|
|
+ data: [
|
|
|
+ {
|
|
|
+ engineName: "#01",
|
|
|
+ engineCode: "WOG00935",
|
|
|
+ title: "机组-#01",
|
|
|
+ xData: [
|
|
|
+ "2023-10-01",
|
|
|
+ "2023-10-01",
|
|
|
+ "2023-10-01",
|
|
|
+ "2023-10-02",
|
|
|
+ "2023-10-02",
|
|
|
+ "2023-10-02",
|
|
|
+ "2023-10-02",
|
|
|
+ "2023-10-02",
|
|
|
+ "2023-12-06",
|
|
|
+ "2023-12-06",
|
|
|
+ "2023-12-06",
|
|
|
+ "2023-12-06",
|
|
|
+ "2023-12-06",
|
|
|
+ "2023-12-31",
|
|
|
+ "2023-12-31",
|
|
|
+ "2023-12-31",
|
|
|
+ "2023-12-31",
|
|
|
+ "2023-12-31",
|
|
|
+ "2023-12-31",
|
|
|
+ ],
|
|
|
+ yData: [
|
|
|
+ 15.543049499999999, 13.862719824324321, 13.497911407894735,
|
|
|
+ 14.247794979227915, 14.967381000000001, 12.827075038461539,
|
|
|
+ 13.432265000000001,
|
|
|
+ ],
|
|
|
+ color: "lightgray",
|
|
|
+ width: 2,
|
|
|
+ type: "box_plot",
|
|
|
+ medians: {
|
|
|
+ x: [
|
|
|
+ "2023-10-01",
|
|
|
+ "2023-10-02",
|
|
|
+ "2023-10-03",
|
|
|
+ "2023-10-04",
|
|
|
+ "2023-10-05",
|
|
|
+ "2023-10-06",
|
|
|
+ "2023-10-07",
|
|
|
+ "2023-10-08",
|
|
|
+ "2023-10-09",
|
|
|
+ "2023-10-10",
|
|
|
+ "2023-10-11",
|
|
|
+ "2023-10-12",
|
|
|
+ "2023-10-13",
|
|
|
+ "2023-10-14",
|
|
|
+ "2023-10-15",
|
|
|
+ "2023-10-16",
|
|
|
+ "2023-10-17",
|
|
|
+ "2023-10-18",
|
|
|
+ "2023-10-19",
|
|
|
+ "2023-10-20",
|
|
|
+ "2023-10-21",
|
|
|
+ "2023-10-22",
|
|
|
+ "2023-10-23",
|
|
|
+ "2023-10-24",
|
|
|
+ "2023-10-25",
|
|
|
+ "2023-10-26",
|
|
|
+ "2023-10-27",
|
|
|
+ "2023-10-28",
|
|
|
+ "2023-10-29",
|
|
|
+ "2023-10-30",
|
|
|
+ "2023-10-31",
|
|
|
+ "2023-11-01",
|
|
|
+ "2023-11-02",
|
|
|
+ "2023-11-03",
|
|
|
+ "2023-11-04",
|
|
|
+ "2023-11-05",
|
|
|
+ "2023-11-06",
|
|
|
+ "2023-11-07",
|
|
|
+ "2023-11-08",
|
|
|
+ "2023-11-09",
|
|
|
+ "2023-11-10",
|
|
|
+ "2023-11-11",
|
|
|
+ "2023-11-12",
|
|
|
+ "2023-11-13",
|
|
|
+ "2023-11-14",
|
|
|
+ "2023-11-15",
|
|
|
+ "2023-11-16",
|
|
|
+ "2023-11-17",
|
|
|
+ "2023-11-18",
|
|
|
+ "2023-11-19",
|
|
|
+ "2023-11-20",
|
|
|
+ "2023-11-21",
|
|
|
+ "2023-11-22",
|
|
|
+ "2023-11-23",
|
|
|
+ "2023-11-24",
|
|
|
+ "2023-11-25",
|
|
|
+ "2023-11-26",
|
|
|
+ "2023-11-27",
|
|
|
+ "2023-11-28",
|
|
|
+ "2023-11-29",
|
|
|
+ "2023-11-30",
|
|
|
+ "2023-12-01",
|
|
|
+ "2023-12-02",
|
|
|
+ "2023-12-03",
|
|
|
+ "2023-12-04",
|
|
|
+ "2023-12-05",
|
|
|
+ "2023-12-06",
|
|
|
+ "2023-12-07",
|
|
|
+ "2023-12-08",
|
|
|
+ "2023-12-09",
|
|
|
+ "2023-12-10",
|
|
|
+ "2023-12-11",
|
|
|
+ "2023-12-12",
|
|
|
+ "2023-12-13",
|
|
|
+ "2023-12-14",
|
|
|
+ "2023-12-15",
|
|
|
+ "2023-12-16",
|
|
|
+ "2023-12-18",
|
|
|
+ "2023-12-19",
|
|
|
+ "2023-12-24",
|
|
|
+ "2023-12-25",
|
|
|
+ "2023-12-26",
|
|
|
+ "2023-12-27",
|
|
|
+ "2023-12-28",
|
|
|
+ "2023-12-29",
|
|
|
+ "2023-12-30",
|
|
|
+ "2023-12-31",
|
|
|
+ ],
|
|
|
+ y: [
|
|
|
+ 12.061625714285714, 12.395244357750359, 11.442673266175094,
|
|
|
+ 10.36922885625, 11.26786431617647, 12.788870794117651,
|
|
|
+ 11.760086202205983, 12.355811707317073, 11.887048926997425,
|
|
|
+ 11.56872207295834, 12.827075038461539, 12.827075038461539,
|
|
|
+ 11.671397888696765, 11.369452874999999, 11.667242439889808,
|
|
|
+ 12.20136406097561, 11.633858755813954, 12.664707, 12.5063981625,
|
|
|
+ 9.904450346153844, 11.961112166666664, 14.713409602941177,
|
|
|
+ 13.520430445945946, 13.520430445945946, 13.164629644736843,
|
|
|
+ 11.945121375, 13.164629644736843, 13.164629644736843,
|
|
|
+ 12.536452761102844, 13.314179153846153, 12.827075038461539,
|
|
|
+ 11.369452874999999, 13.164629644736843, 14.293026471428572,
|
|
|
+ 13.520430445945946, 11.420851848214285, 10.97608045539225,
|
|
|
+ 11.746974608695654, 12.08018303574669, 12.20136406097561,
|
|
|
+ 13.520430445945946, 11.910854542081818, 11.209977141891892,
|
|
|
+ 11.772826225352112, 12.26579435260202, 11.850547264285714,
|
|
|
+ 8.194810411764706, 9.570488812499999, 11.45028304109589,
|
|
|
+ 13.520430445945946, 13.324327156249998, 11.683638147887326,
|
|
|
+ 11.547232852941178, 11.690498094778956, 11.8731628125,
|
|
|
+ 11.50377658039225, 12.559168830392247, 11.814091821757081,
|
|
|
+ 11.182666105361738, 12.199092772058824, 10.883732578125,
|
|
|
+ 11.209977141891892, 13.691575135135134, 13.895997572333401,
|
|
|
+ 13.164629644736843, 13.520430445945946, 11.418212162100799,
|
|
|
+ 10.782115418918918, 10.472739292609424, 10.116320835365855,
|
|
|
+ 10.659461724999998, 10.421998468750001, 9.713248529513232,
|
|
|
+ 10.232523066441793, 8.379173986952123, 8.798638547368421,
|
|
|
+ 6.52254407794278, 10.26608825, 10.1317656, 9.950841214285715,
|
|
|
+ 10.403152178571428, 10.310370442307692, 12.5063981625,
|
|
|
+ 12.5063981625, 11.116798366666666, 11.167968899999998,
|
|
|
+ 10.4579787094475,
|
|
|
+ ],
|
|
|
+ mode: "markers",
|
|
|
+ color: "orange",
|
|
|
+ size: 3,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ windEngineGroupList: [], //批次风机列表
|
|
|
+ fieldEngineCodes: [], //选中风机
|
|
|
+ comment: "",
|
|
|
+ options: [],
|
|
|
+ generalFilesDatas: [], //总图
|
|
|
+ diagramRelationsDatas: [], //分图,
|
|
|
+ requestResult: [], // 请求结果
|
|
|
+ requestRecord: [],
|
|
|
+ commentDescriptionVos: [], //评论列表
|
|
|
+ editableTabs: [],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ initBatchCode(newVal) {
|
|
|
+ if (newVal) {
|
|
|
+ this.fetchData(); // 调用合并后的函数
|
|
|
+ }
|
|
|
+ },
|
|
|
+ analysisTypeCode(newVal) {
|
|
|
+ if (newVal) {
|
|
|
+ this.fetchData(); // 调用合并后的函数
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ if (this.initBatchCode && this.analysisTypeCode) {
|
|
|
+ this.fetchData(); // 调用合并后的函数
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async handleComment() {
|
|
|
+ try {
|
|
|
+ await analysisCommentEdit({
|
|
|
+ batchCode: this.initBatchCode,
|
|
|
+ analysisTypeCode: this.analysisTypeCode,
|
|
|
+ commentList: this.editableTabs.map((item) => {
|
|
|
+ return {
|
|
|
+ commentTypeCode: item.commentTypeCode,
|
|
|
+ comment: item.commentTypeName === "分析评论" ? this.comment : "",
|
|
|
+ };
|
|
|
+ }),
|
|
|
+ });
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "保存成功",
|
|
|
+ });
|
|
|
+ this.comment = "";
|
|
|
+ this.getAnalysisDetail();
|
|
|
+ } catch (e) {
|
|
|
+ console.error(e);
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getResult({ index, result }) {
|
|
|
+ console.log(index, result);
|
|
|
+ this.$set(this.requestResult, index, result);
|
|
|
+ // this.requestResult[index] = result
|
|
|
+ this.requestRecord[index] = result;
|
|
|
+ },
|
|
|
+ changeRequestNum(index) {
|
|
|
+ if (index <= 1) {
|
|
|
+ this.$set(this.requestRecord, index, "start");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (index > 1) {
|
|
|
+ if (
|
|
|
+ this.requestRecord.every((item) =>
|
|
|
+ ["success", "error"].includes(item)
|
|
|
+ )
|
|
|
+ ) {
|
|
|
+ this.$set(this.requestRecord, index, "start");
|
|
|
+ this.$set(this.requestResult, index, "start");
|
|
|
+ } else {
|
|
|
+ this.$set(this.requestRecord, index, "start");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onSubmit() {
|
|
|
+ console.log("submit!");
|
|
|
+ },
|
|
|
+ // 合并后的函数,处理数据请求
|
|
|
+ async fetchData() {
|
|
|
+ try {
|
|
|
+ console.log(
|
|
|
+ this.initBatchCode,
|
|
|
+ this.analysisTypeCode,
|
|
|
+ "请求详情 分钟级"
|
|
|
+ );
|
|
|
+ // 获取分析详情
|
|
|
+ await this.getAnalysisDetail();
|
|
|
+
|
|
|
+ // 获取风机列表
|
|
|
+ await this.getWindEnfineList(this.initBatchCode, this.analysisTypeCode);
|
|
|
+ } catch (err) {
|
|
|
+ console.error("Failed to fetch data:", err);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取分析详情接口
|
|
|
+ async getAnalysisDetail() {
|
|
|
+ try {
|
|
|
+ const result = await analysisDetail({
|
|
|
+ batchCode: this.initBatchCode,
|
|
|
+ analysisTypeCode: this.analysisTypeCode,
|
|
|
+ fieldEngineCodes:
|
|
|
+ this.fieldEngineCodes.length === 0
|
|
|
+ ? undefined
|
|
|
+ : this.fieldEngineCodes.join(","),
|
|
|
+ });
|
|
|
+ if (
|
|
|
+ result.data &&
|
|
|
+ result.data[0] &&
|
|
|
+ result.data[0].commentTypeRelations
|
|
|
+ ) {
|
|
|
+ this.editableTabs = result.data[0].commentTypeRelations;
|
|
|
+ }
|
|
|
+ //当前评论展示获取
|
|
|
+ if (
|
|
|
+ result.data &&
|
|
|
+ result.data[0] &&
|
|
|
+ result.data[0].commentDescriptionVos
|
|
|
+ ) {
|
|
|
+ this.commentDescriptionVos = result.data[0].commentDescriptionVos;
|
|
|
+ }
|
|
|
+ this.generalFilesDatas =
|
|
|
+ result.data && result.data[0] && result.data[0].generalFiles; //总图数据
|
|
|
+ this.diagramRelationsDatas =
|
|
|
+ result.data && result.data[0] && result.data[0].diagramRelations;
|
|
|
+ } catch (err) {
|
|
|
+ console.error("Failed to fetch analysis details:", err);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 请求风机列表
|
|
|
+ async getWindEnfineList(batchCode, analysisTypeCode) {
|
|
|
+ // console.log("请求风机列表 分钟级");
|
|
|
+ const resEngineList = await queryAnalysisedEngine({
|
|
|
+ batchCode: batchCode,
|
|
|
+ analysisTypeCode,
|
|
|
+ });
|
|
|
+ this.windEngineGroupList = resEngineList.data;
|
|
|
+ },
|
|
|
+ handleEditorInput(index, newVal) {
|
|
|
+ // 更新对应的 comment 值
|
|
|
+ // 如果该功能没有实现,可以删除这个方法
|
|
|
+ },
|
|
|
+ //获取选中风机list
|
|
|
+ getEnfineList(data) {
|
|
|
+ this.fieldEngineCodes = data;
|
|
|
+ this.getAnalysisDetail();
|
|
|
+ console.log(this.fieldEngineCodes, "this.fieldEngineCodes");
|
|
|
+ },
|
|
|
+ //下一条
|
|
|
+ handleNext() {
|
|
|
+ const index = this.batchCodeList.findIndex(
|
|
|
+ (item) => item === this.initBatchCode
|
|
|
+ );
|
|
|
+ if (index === this.batchCodeList.length - 1) {
|
|
|
+ this.$message.warning("已经是最后一个分析结果了");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$emit("setInitBathCode", this.batchCodeList[index + 1]);
|
|
|
+ },
|
|
|
+ //上一条
|
|
|
+ handlePrevious() {
|
|
|
+ const index = this.batchCodeList.findIndex(
|
|
|
+ (item) => item === this.initBatchCode
|
|
|
+ );
|
|
|
+ if (index === 0) {
|
|
|
+ this.$message.warning("没有上一条了");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$emit("setInitBathCode", this.batchCodeList[index - 1]);
|
|
|
+ },
|
|
|
+ onClick() {},
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
-<style scoped lang="scss"></style>
|
|
|
+<style scoped lang="scss">
|
|
|
+.type-variable {
|
|
|
+ display: flex;
|
|
|
+ height: 90%;
|
|
|
+ overflow: hidden;
|
|
|
+
|
|
|
+ .left {
|
|
|
+ width: 30%;
|
|
|
+ height: 100%;
|
|
|
+ overflow: auto;
|
|
|
+ padding: 20px;
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ .right {
|
|
|
+ width: 250px;
|
|
|
+ height: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|