Browse Source

Merge branch 'master' of http://192.168.50.233:3000/rui.jiang/performance-test

liujiejie 3 months ago
parent
commit
57e957a081

BIN
src/assets/analyse/11.png


+ 2 - 2
src/components/map/index.vue

@@ -240,8 +240,8 @@ export default {
         new TileLayer({
           source: new XYZ({
             // url: "http://127.0.0.1:8010/tiles/{z}/{x}/{y}.png", //本地
-            url: "http://192.168.50.235/tiles/{z}/{x}/{y}.png", //内网
-            // url: "http://106.120.102.238:18000/tiles/{z}/{x}/{y}.png", //外网
+            // url: "http://192.168.50.235/tiles/{z}/{x}/{y}.png", //内网
+            url: "http://106.120.102.238:18000/tiles/{z}/{x}/{y}.png", //外网
             // url: "http://10.96.137.5:9080/tiles/{z}/{x}/{y}.png", //大~#@唐
           }),
         }),

+ 5 - 5
src/views/admin/cockpitManage/Index.vue

@@ -18,17 +18,17 @@
         </selecttree>
 
         <p  >
-          <span class="SpText">可观察风场数:</span>
+          <span class="SpText">已接入风场数:</span>
           {{ totalList?.fieldSumNumber ? totalList.fieldSumNumber : 0 }}
         </p>
-        <p>
+        <!-- <p>
           <span class="SpText">已完成分析风场:</span>
           {{
             totalList?.analysisFinishNumber ? totalList.analysisFinishNumber : 0
           }}
-        </p>
+        </p> -->
         <!-- <p>
           <span class="SpText">未完成分析风场:</span>
           {{
@@ -39,9 +39,9 @@
         </p> -->
         <p>
-          <span class="SpText">风机数:</span>
+          <span class="SpText">已接入风机数:</span>
           {{ totalList?.engineGroupNumber ? totalList.engineGroupNumber : 0 }}
-          
+          
         </p>
         <!-- <p>
           <span class="SpText">风场状态:</span>

+ 10 - 8
src/views/admin/cockpitManage/component/leftdata.vue

@@ -32,11 +32,12 @@
             <el-table-column
               prop="analysisName"
               label="分析名称"
-              width="180"
+         
             ></el-table-column>
             <el-table-column
               prop="createTime"
               label="创建时间"
+                   width="180"
             ></el-table-column>
 
             <el-table-column fixed="right" label="操作" width="100">
@@ -58,9 +59,9 @@
           <el-table :data="FXData" style="width: 100%">
             <el-table-column prop="fieldName" label="风场名称" width="180">
             </el-table-column>
-            <el-table-column prop="analysisName" label="分析名称" width="180">
+            <el-table-column prop="analysisName" label="分析名称" >
             </el-table-column>
-            <el-table-column prop="createTime" label="创建时间">
+            <el-table-column prop="createTime" label="创建时间" width="180">
             </el-table-column>
             <el-table-column fixed="right" label="操作" width="100">
               <template slot-scope="scope">
@@ -81,9 +82,9 @@
           <el-table :data="PdData" style="width: 100%">
             <el-table-column prop="fieldName" label="风场名称" width="180">
             </el-table-column>
-            <el-table-column prop="analysisName" label="分析名称" width="180">
+            <el-table-column prop="analysisName" label="分析名称" >
             </el-table-column>
-            <el-table-column prop="createTime" label="创建时间">
+            <el-table-column prop="createTime" label="创建时间" width="180">
             </el-table-column>
             <el-table-column fixed="right" label="操作" width="100">
               <template slot-scope="scope">
@@ -259,7 +260,7 @@ export default {
       });
     },
     getpd() {
-      analysisResultList({ analysisState: 10 }).then((res) => {
+      analysisResultList({ analysisState: "10" }).then((res) => {
         this.PdData = res.data.list;
         this.PdShow = true;
       });
@@ -267,7 +268,7 @@ export default {
 
     PDClick(row) {
       const fieldName = row.fieldName; // 获取当前行的 fieldName 数据
-      const analysisState = 10;
+      const analysisState = "10";
       // 打开新窗口
       const newWindow = window.open(
         "/home/performance/assetssMag?id=195",
@@ -296,6 +297,7 @@ export default {
     YChandleClick(row) {
       const fieldName = row.fieldName; // 获取当前行的 fieldName 数据
       const errState = 1;
+      const analysisState = 30;
       // 打开新窗口
       const newWindow = window.open(
         "/home/performance/assetssMag?id=195",
@@ -303,7 +305,7 @@ export default {
       );
       // 等待窗口加载完成后发送消息
       newWindow.onload = () => {
-        newWindow.postMessage({ fieldName, errState }, "*");
+        newWindow.postMessage({ fieldName, errState ,analysisState}, "*");
       };
     },
 

+ 15 - 13
src/views/admin/cockpitManage/component/rightdata.vue

@@ -15,6 +15,20 @@
       </el-date-picker>
       <div id="main" style="width: 260px; height: 160px"></div>
     </div>
+
+    <div>
+      <h3 style="margin-bottom: 8px;">性能分析操作记录</h3>
+      <p class="titleJQ">
+        <span>名字</span><span>日期</span><span>操作记录</span>
+      </p>
+      <Tabroll
+        :table-data="tableData"
+        :shujuloading="shujuloading"
+        :columns="tableColumns"
+        :max-height="120"
+        :column-widths="columnWidths"
+      ></Tabroll>
+    </div>
     <div>
       <h3>异常设备概览</h3>
       <div class="BOX">
@@ -58,19 +72,7 @@
       </div>
     </div>
 
-    <div>
-      <h3 style="margin: 8px 0">性能分析操作记录</h3>
-      <p class="titleJQ">
-        <span>名字</span><span>日期</span><span>操作记录</span>
-      </p>
-      <Tabroll
-        :table-data="tableData"
-        :shujuloading="shujuloading"
-        :columns="tableColumns"
-        :max-height="120"
-        :column-widths="columnWidths"
-      ></Tabroll>
-    </div>
+  
     <div>
       <h3 style="margin: 8px 0">异常数据信息</h3>
       <p class="titleYC"><span>风场名称</span><span>风机信息</span></p>

+ 29 - 26
src/views/health/components/envelopecharts.vue

@@ -39,11 +39,11 @@
 <script>
 import * as echarts from "echarts"; // 导入 echarts 库
 import axios from "axios";
+import { log } from 'plotly.js-dist';
 export default {
   name: "TimedomainCharts", // 组件名称
   props: {
     // 可以通过 props 接收外部传入的数据
-
     currentIndex: {
       type: Number,
       default: 0,
@@ -64,7 +64,6 @@ export default {
       type: Object,
       default: () => ({}),
     },
-    
     windCode: {
       type: String,
       default: "",
@@ -81,24 +80,17 @@ export default {
     };
   },
   watch: {
-    // 监听 chartData 和 chartLabels 的变化,重新绘制图表
-    chartData(newData) {
-      this.updateChart(newData, this.chartLabels);
-    },
-    chartLabels(newLabels) {
-      this.updateChart(this.chartData, newLabels);
-    },
     envelopeListTwo: {
       handler(newValue) {
         this.updateChart(newValue.y, newValue.x); // 更新图表
       },
-      deep: true, // 确保监听对象的深层次变
+      deep: true, // 确保监听对象的深层次变化
     },
     envelopeList: {
       handler(newValue) {
         this.updateChart(newValue.y, newValue.x); // 更新图表
       },
-      deep: true, // 确保监听对象的深层次变
+      deep: true, // 确保监听对象的深层次变
     },
   },
   mounted() {
@@ -116,7 +108,6 @@ export default {
       this.$emit("handleLoading", null, true, this.activeIndex);
       const params = {
         ids: this.ids,
-        // windCode: "SKF001",
         windCode: this.windCode,
         analysisType: "envelope",
         fmin: this.xiaoval,
@@ -125,18 +116,24 @@ export default {
       axios
         .post("/WJapi/analysis/envelope", params)
         .then((res) => {
+        
+          
           this.envelopeList = JSON.parse(res.data);
-          const defaultData =
-            this.envelopeList.y || this.envelopeListTwo.y || [];
-          const defaultLabels =
-            this.envelopeList.x || this.envelopeListTwo.x || [];
-          this.updateChart(defaultData, defaultLabels);
+          const defaultData = this.envelopeList.y || this.envelopeListTwo.y || [];
+          const defaultLabels = this.envelopeList.x || this.envelopeListTwo.x || [];
+          // 这里是数据采样,减少数据量
+          const sampleData = defaultData.filter((_, index) => index % 50 === 0); // 每隔50个数据点采样一次
+          const sampleLabels = defaultLabels.filter((_, index) => index % 50 === 0); // 同样对 X 数据进行采样
+          this.updateChart(sampleData, sampleLabels); // 使用采样数据更新图表
+        })
+        .catch((error) => {
+          console.error(error);
         })
-        .catch((error) => {})
         .finally(() => {
           this.$emit("handleLoading", this.currentRow, false, this.activeIndex);
         });
     },
+
     initializeChart() {
       // 获取图表容器
       const chartDom = this.$refs.chart;
@@ -149,7 +146,7 @@ export default {
 
       this.updateChart(defaultData, defaultLabels);
     },
-    // 更新图表数据
+
     updateChart(data, labels) {
       // 获取 x 数组中的最大值
       const maxX = Math.max(...labels);
@@ -161,6 +158,7 @@ export default {
       for (let i = 0; i <= maxAxisValue; i += 5) {
         ticks.push(i);
       }
+
       const option = {
         title: {
           text: this.envelopeList.title || this.envelopeListTwo.title,
@@ -191,6 +189,16 @@ export default {
             },
           },
         },
+        dataZoom: [
+          {
+            type: "slider", // 使用滑动条
+            start: 0, // 起始比例
+            end: 10, // 结束比例
+          },
+          {
+            type: "inside", // 鼠标滚轮缩放
+          },
+        ],
         xAxis: {
           type: "value", // 使用数值型 x 轴,确保每个 x 值都有展示
           name: this.envelopeList.xaxis || this.envelopeListTwo.xaxis, // 设置 X 轴标题
@@ -200,9 +208,6 @@ export default {
             color: "#333", // 标题颜色
             padding: [10, 0, 0, 0], // 上、右、下、左的间距
           },
-          // min: 0, // X 轴最小值
-          // max: maxAxisValue, // X 轴最大值为计算的最大值
-          // interval: 5, // X 轴每 5 个单位显示一个刻度
           axisLabel: {
             formatter: (value) => {
               // 格式化显示刻度为 5 的倍数
@@ -241,15 +246,14 @@ export default {
             name: "数据系列",
             type: "line", // 折线图
             data: labels.map((item, index) => [item, data[index]]), // 修改为 [x, y] 数组
-            // smooth: true,
             symbol: "none", // 数据点的样式
             symbolSize: 8, // 数据点的大小
             lineStyle: {
-              color: "#162961", 
+              color: "#162961",
               width: 1, // 线条宽度
             },
             itemStyle: {
-              color: "#162961", 
+              color: "#162961",
               borderColor: "#fff",
               borderWidth: 1,
             },
@@ -260,7 +264,6 @@ export default {
       // 使用更新的配置更新图表
       this.chartInstance.setOption(option);
     },
-
     previousRow() {
       this.$emit("update-previous-row", 3, this.activeIndex);
     },

+ 0 - 209
src/views/health/components/spectrogramcharts copyy.vue

@@ -1,209 +0,0 @@
-<template>
-  <div>
-    <div class="FD">
-      <div v-if="TZshow" class="eigenvalue">
-        <h5>特征值</h5>
-        <p>有效值:{{ this.spectrumList.Xrms }}</p>
-        <p>平均值:{{ this.spectrumList.mean_value }}</p>
-        <p>最大值:{{ this.spectrumList.max_value }}</p>
-        <p>最小值:{{ this.spectrumList.min_value }}</p>
-        <p>峰值:{{ this.spectrumList.Xp }}</p>
-        <p>峰峰值:{{ this.spectrumList.Xpp }}</p>
-        <p>波形因子:{{ this.spectrumList.fs }}</p>
-        <p>脉冲指标:{{ this.spectrumList.If }}</p>
-        <p>裕度指标:{{ this.spectrumList.Ce }}</p>
-        <p>偏度指标:{{ this.spectrumList.Cw }}</p>
-        <p>峭度指标:{{ this.spectrumList.Cq }}</p>
-      </div>
-    </div>
-    <!-- ECharts 图表容器 -->
-
-    <div class="line-chart" ref="chart"></div>
-  </div>
-</template>
-
-<script>
-import * as echarts from "echarts"; // 导入 echarts 库
-
-export default {
-  name: "TimedomainCharts", // 组件名称
-  props: {
-    currentIndex: {
-      type: Number,
-      default: 0,
-    },
-    spectrumList: {
-      type: Object,
-      default: () => ({}),
-    },
-  },
-  data() {
-    return {
-      chartInstance: null,
-      option: null,
-      TZshow: false,
-      chartInitialized: false, 
-    };
-  },
-  watch: {
-    // 监听 chartData 和 chartLabels 的变化,重新绘制图表
-    chartData(newData) {
-      this.updateChart(newData, this.chartLabels);
-    },
-    chartLabels(newLabels) {
-      this.updateChart(this.chartData, newLabels);
-    },
-    spectrumList: {
-    handler(newValue) {
-      if (this.chartInstance) {
-        this.updateChart(newValue.y, newValue.x); // Update chart only if chartInstance is not null
-      }
-    },
-    deep: true, // Ensure deep watch for nested changes
-  },
-  },
-
-  mounted() {
-    this.$nextTick(() => {
-      setTimeout(() => {
-        this.initializeChart(); // 延迟2秒后调用
-      }, 2000); // 2000毫秒,即2秒
-    });
-  },
-  methods: {
-    initializeChart() {
-    // Ensure initialization only happens once
-    if (!this.chartInitialized) {
-      const chartDom = this.$refs.chart;
-      this.chartInstance = echarts.init(chartDom);
-      const defaultData = this.spectrumList.y;
-      const defaultLabels = this.spectrumList.x;
-      this.updateChart(defaultData, defaultLabels);
-      this.chartInitialized = true; // Set flag to true
-    }
-  },
-    // 更新图表数据
-    updateChart(data, labels) {
-      if (!Array.isArray(data) || !Array.isArray(labels)) {
-        console.error("Invalid data or labels passed to updateChart");
-        return;
-      }
-
-      const maxX = Math.max(...labels); // Safe as labels is now verified
-      // 将最大值取整为 2 的倍数
-      const maxAxisValue = Math.ceil(maxX / 200) * 200;
-
-      // 生成刻度,步长为 200
-      const ticks = [];
-      for (let i = 0; i <= maxAxisValue; i += 200) {
-        ticks.push(i);
-      }
-
-      // Chart option configuration
-      const option = {
-        title: {
-          text: this.spectrumList.title || "",
-          left: "center",
-        },
-        toolbox: {
-          feature: {
-            dataZoom: { yAxisIndex: "none" },
-            restore: {},
-            saveAsImage: {},
-            myCustomTool: {
-              show: true,
-              title: "上一条",
-              icon: `image://${require("@/assets/analyse/08.png")}`,
-              onclick: () => this.previousRow(),
-            },
-            myCustomTool2: {
-              show: true,
-              title: "下一条",
-              icon: `image://${require("@/assets/analyse/09.png")}`,
-              onclick: () => this.nextRow(),
-            },
-            myCustomTool3: {
-              show: true,
-              title: "特征值",
-              icon: `image://${require("@/assets/analyse/10.png")}`,
-              onclick: () => this.Show(),
-            },
-          },
-        },
-        tooltip: {
-      trigger: 'axis',  // Trigger tooltip when hovering over the axis
-      axisPointer: {
-        type: 'cross',  // Cross-line pointer style
-        label: {
-          backgroundColor: '#6a7985', // Tooltip label background color
-        },
-      },
-    },
-        xAxis: {
-          type: "value",
-          name: this.spectrumList.xaxis || "",
-          min: 0,
-          max: maxAxisValue,
-          interval: 200, // 每 200 显示一个刻度
-          data: ticks, // 设置刻度数据
-        },
-        yAxis: {
-          type: "value",
-          name: this.spectrumList.yaxis || "",
-        },
-        series: [
-          {
-            name: "数据系列",
-            type: "line",
-            symbol: "none", // 隐藏数据点
-            data: labels.map((item, index) => [item, data[index]]),
-          },
-        ],
-      };
-
-      this.chartInstance.setOption(option);
-    },
-
-    previousRow() {
-      this.$emit("update-previous-row", 2);
-    },
-
-    // 触发下一条
-    nextRow() {
-      this.$emit("update-next-row",2);
-    },
-
-    Show() {
-      this.TZshow = !this.TZshow;
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.line-chart {
-  width: 100%;
-  height: 250px;
-}
-.FD {
-  width: 100%;
-  height: 1px;
-  position: relative;
-}
-
-.eigenvalue {
-  position: absolute;
-  top: 30px;
-  right: 0;
-  font-size: 10px;
-  width: 100px;
-  border: 1px solid black;
-  padding: 5px;
-  background: #fff;
-  z-index: 99;
-  h5 {
-    line-height: 16px;
-    height: 16px;
-  }
-}
-</style>

+ 62 - 64
src/views/health/components/spectrogramcharts.vue

@@ -2,7 +2,13 @@
   <div>
     <div class="FD">
       <div v-if="TZshow" class="eigenvalue">
-        <h5>特征值</h5>
+        <el-checkbox
+          v-for="(item, index) in checkList"
+          :key="index"
+  v-model="checked[index]"
+          >{{ item.val }}</el-checkbox
+        >
+        <!-- <h5>特征值</h5>
         <p>有效值:{{ this.spectrumList.Xrms }}</p>
         <p>平均值:{{ this.spectrumList.mean_value }}</p>
         <p>最大值:{{ this.spectrumList.max_value }}</p>
@@ -13,7 +19,7 @@
         <p>脉冲指标:{{ this.spectrumList.If }}</p>
         <p>裕度指标:{{ this.spectrumList.Ce }}</p>
         <p>偏度指标:{{ this.spectrumList.Cw }}</p>
-        <p>峭度指标:{{ this.spectrumList.Cq }}</p>
+        <p>峭度指标:{{ this.spectrumList.Cq }}</p> -->
       </div>
     </div>
     <!-- ECharts 图表容器 -->
@@ -49,7 +55,6 @@ export default {
       type: Object,
       default: () => ({}),
     },
-    
     windCode: {
       type: String,
       default: "",
@@ -61,6 +66,8 @@ export default {
       option: null,
       TZshow: false,
       spectrumList: {},
+      checkList: [{ val: "BPFI" }, { val: "BPFO" }, { val: "BPO" }, { val: "FT" }],
+      checked:""
     };
   },
   watch: {
@@ -77,7 +84,6 @@ export default {
         this.updateChart(this.spectrumList.y, this.spectrumList.x); // 更新图表
       }
     },
-    // 监听 spectrumList 的变化
     spectrumList: {
       handler(newValue) {
         if (this.chartInstance) {
@@ -92,7 +98,7 @@ export default {
       setTimeout(() => {
         this.initializeChart(); // 延迟2秒后调用
         this.getTime();
-      }, 2000); // 2000毫秒,即2
+      }, 500); // 500毫秒,即0.5
     });
   },
 
@@ -100,12 +106,12 @@ export default {
     initializeChart() {
       const chartDom = this.$refs.chart;
       if (chartDom && !this.chartInstance) {
-        this.chartInstance = echarts.init(chartDom); // Initialize chart only once
+        this.chartInstance = echarts.init(chartDom); // 仅初始化一次
       }
 
-      // Update the chart with the initial data if available
+      // 使用 $nextTick 确保数据更新后再渲染图表
       this.$nextTick(() => {
-        if (this.chartInstance) {
+        if (this.chartInstance && this.spectrumList.y && this.spectrumList.x) {
           this.updateChart(this.spectrumList.y, this.spectrumList.x); // 更新图表
         }
       });
@@ -113,27 +119,20 @@ export default {
 
     // 更新图表数据
     updateChart(data, labels) {
-      if (!this.chartInstance || !labels || !data) return; // Check if chartInstance, labels, or data are not available
+      if (!this.chartInstance || !labels || !data) return; // 确保数据存在
 
-      // Ensure labels is an array
+      // 确保 labels 是数组
       if (!Array.isArray(labels)) {
         console.error("Labels are not an array");
         return;
       }
 
-      // Ensure data and labels have the same length
+      // 确保 data 和 labels 长度一致
       if (labels.length !== data.length) {
         console.error("Data and labels length mismatch");
         return;
       }
 
-      const maxX = Math.max(...labels);
-      const maxAxisValue = Math.ceil(maxX / 5) * 5;
-      const ticks = [];
-      for (let i = 0; i <= maxAxisValue; i += 5) {
-        ticks.push(i);
-      }
-
       const option = {
         title: {
           text: this.spectrumList.title,
@@ -159,109 +158,109 @@ export default {
             myCustomTool3: {
               show: true,
               title: "特征值",
-              icon: `image://${require("@/assets/analyse/10.png")}`,
+              icon: `image://${require("@/assets/analyse/11.png")}`,
               onclick: () => this.Show(),
             },
           },
         },
         xAxis: {
-          type: "value", // Use numeric x-axis
-          name: this.spectrumList.xaxis, // Set X-axis title
-          nameLocation: "center", // Title position
+          type: "value",
+          name: this.spectrumList.xaxis,
+          nameLocation: "center",
           nameTextStyle: {
             fontSize: 14,
-            color: "#333", // Title color
-            padding: [10, 0, 0, 0], // Padding for title
+            color: "#333",
+            padding: [10, 0, 0, 0],
           },
           axisLabel: {
-            formatter: (value) => {
-              return value; // Show values without formatting
-            },
+            formatter: (value) => value,
           },
           axisTick: {
-            show: true, // Show tick marks
+            show: true,
           },
           axisLine: {
-            show: true, // Show axis line
+            show: true,
           },
-          data: ticks, // Set tick values
         },
-
         yAxis: {
-          type: "value", // Y-axis type as numeric
-          name: this.spectrumList.yaxis, // Set Y-axis title
+          type: "value",
+          name: this.spectrumList.yaxis,
           nameTextStyle: {
             fontSize: 14,
-            color: "#333", // Title color
-            padding: [10, 0, 0, 0], // Padding for title
+            color: "#333",
+            padding: [10, 0, 0, 0],
           },
           axisLabel: {
-            formatter: (value) => {
-              return value; // Show values without formatting
-            },
+            formatter: (value) => value,
           },
           axisTick: {
-            show: true, // Show tick marks
+            show: true,
           },
           axisLine: {
-            show: true, // Show axis line
+            show: true,
           },
         },
-
         tooltip: {
           trigger: "axis",
           formatter: (params) => {
-            const xValue = params[0].value[0]; // Get x value
-            const yValue = params[0].value[1]; // Get y value
+            const xValue = params[0].value[0];
+            const yValue = params[0].value[1];
             return `X: ${xValue}<br/>Y: ${yValue}`;
           },
           axisPointer: {
-            type: "line", // Crosshair line
+            type: "line",
           },
         },
-
+        dataZoom: [
+          {
+            type: "inside", // 内置型数据区域缩放组件
+            start: 0,
+            end: 10, // 初始显示前 10% 的数据
+          },
+          {
+            type: "slider", // 滑动条型数据区域缩放组件
+            start: 0,
+            end: 10, // 初始显示前 10% 的数据
+            handleSize: "80%", // 控制手柄大小
+            showDataShadow: false, // 不显示数据阴影
+          },
+        ],
         series: [
           {
             name: "数据系列",
-            type: "line", // Line chart
-            data: labels.map((item, index) => [item, data[index]]), // Map x, y values
-            symbol: "none", // No symbols at data points
-            symbolSize: 8, // Set data point size
+            type: "line",
+            data: labels.map((item, index) => [item, data[index]]),
+            symbol: "none",
+            symbolSize: 8,
             lineStyle: {
-              color: "#162961", 
-              width: 1, // Line width
+              color: "#162961",
+              width: 1,
             },
             itemStyle: {
-              color: "#162961", 
+              color: "#162961",
               borderColor: "#fff",
               borderWidth: 1,
             },
+            large: true, // 开启大数据量优化
+            progressive: 2000, // 渐进式渲染,每 2000 个数据点渲染一次
           },
         ],
       };
 
-      this.chartInstance.setOption(option); // Update the chart with the new option
+      this.chartInstance.setOption(option);
     },
 
     getTime() {
       this.$emit("handleLoading", null, true, this.activeIndex);
       const params = {
         ids: this.ids,
-        // windCode: "SKF001",
         windCode: this.windCode,
         analysisType: "frequency",
       };
       axios
         .post("/WJapi/analysis/frequency", params)
         .then((res) => {
-          const parsedData = JSON.parse(res.data);
-          // 使用 $set 或者扩展运算符确保 Vue 检测到变化
-          this.spectrumList = { ...parsedData }; // 或者 this.$set(this, 'spectrumList', parsedData);
-          this.$nextTick(() => {
-            if (this.chartInstance) {
-              this.updateChart(this.spectrumList.y, this.spectrumList.x); // 更新图表
-            }
-          });
+          this.spectrumList = JSON.parse(res.data);
         })
         .catch((error) => {
           console.error(error);
@@ -275,17 +274,16 @@ export default {
       this.$emit("update-previous-row", 2, this.activeIndex);
     },
 
-    // 触发下一条
     nextRow() {
       this.$emit("update-next-row", 2, this.activeIndex);
     },
+
     Show() {
       this.TZshow = !this.TZshow;
     },
   },
 };
 </script>
-
 <style lang="scss" scoped>
 .line-chart {
   width: 100%;

+ 0 - 249
src/views/health/components/timedomaincharts copy.vue

@@ -1,249 +0,0 @@
-<template>
-  <div>
-    <div class="FD">
-      <div v-if="TZshow" class="eigenvalue">
-        <h5>特征值</h5>
-        <p>有效值:{{ this.timeList.Xrms }}</p>
-        <p>平均值:{{ this.timeList.mean_value }}</p>
-        <p>最大值:{{ this.timeList.max_value }}</p>
-        <p>最小值:{{ this.timeList.min_value }}</p>
-        <p>峰值:{{ this.timeList.Xp }}</p>
-        <p>峰峰值:{{ this.timeList.Xpp }}</p>
-        <p>波形因子:{{ this.timeList.Sf }}</p>
-        <p>脉冲指标:{{ this.timeList.If }}</p>
-        <p>裕度指标:{{ this.timeList.Ce }}</p>
-        <p>偏度指标:{{ this.timeList.Cw }}</p>
-        <p>峭度指标:{{ this.timeList.Cq }}</p>
-      </div>
-    </div>
-    <!-- ECharts 图表容器 -->
-
-    <div class="line-chart" ref="chart"></div>
-  </div>
-</template>
-
-<script>
-import * as echarts from "echarts"; // 导入 echarts 库
-
-export default {
-  name: "TimedomainCharts", // 组件名称
-  props: {
-    currentIndex: {
-      type: Number,
-      default: 0,
-    },
-    timeList: {
-      type: Object,
-      default: () => ({}),
-    },
-  },
-  data() {
-    return {
-      chartInstance: null,
-      option: null,
-      TZshow: false,
-    };
-  },
-  watch: {
-    // 监听 chartData 和 chartLabels 的变化,重新绘制图表
-    chartData(newData) {
-      this.updateChart(newData, this.chartLabels);
-    },
-    chartLabels(newLabels) {
-      this.updateChart(this.chartData, newLabels);
-    },
-    timeList: {
-      handler(newValue) {
-        if (this.chartInstance) {
-          this.updateChart(newValue.y, newValue.x); // Only update if chartInstance is initialized
-        }
-      },
-      deep: true, // Ensure we watch deep changes in the object
-    },
-  },
-  mounted() {
-    this.$nextTick(() => {
-      setTimeout(() => {
-        this.initializeChart(); // 延迟2秒后调用
-      }, 2000); // 2000毫秒,即2秒
-    });
-  },
-
-  methods: {
-    initializeChart() {
-    const chartDom = this.$refs.chart;
-    if (chartDom && !this.chartInstance) {
-      this.chartInstance = echarts.init(chartDom); // Initialize chart only once
-    }
-
-    // Update the chart with the initial data if available
-    if (this.timeList.y && this.timeList.x) {
-      this.updateChart(this.timeList.y, this.timeList.x);
-    }
-  },
-
-    // 更新图表数据
-    updateChart(data, labels) {
-  if (!this.chartInstance) return; // Check if chartInstance is available
-
-  const maxX = Math.max(...labels);
-  const maxAxisValue = Math.ceil(maxX / 5) * 5;
-  const ticks = [];
-  for (let i = 0; i <= maxAxisValue; i += 5) {
-    ticks.push(i);
-  }
-
-  const option = {
-    title: {
-      text: this.timeList.title,
-      left: "center",
-    },
-    toolbox: {
-      feature: {
-        dataZoom: { yAxisIndex: "none" },
-        restore: {},
-        saveAsImage: {},
-        myCustomTool: {
-          show: true,
-          title: "上一条",
-          icon: `image://${require("@/assets/analyse/08.png")}`,
-          onclick: () => this.previousRow(),
-        },
-        myCustomTool2: {
-          show: true,
-          title: "下一条",
-          icon: `image://${require("@/assets/analyse/09.png")}`,
-          onclick: () => this.nextRow(),
-        },
-        myCustomTool3: {
-          show: true,
-          title: "特征值",
-          icon: `image://${require("@/assets/analyse/10.png")}`,
-          onclick: () => this.Show(),
-        },
-      },
-    },
-    xAxis: {
-      type: "value", // Use numeric x-axis
-      name: this.timeList.xaxis, // Set X-axis title
-      nameLocation: "center", // Title position
-      nameTextStyle: {
-        fontSize: 14,
-        color: "#333", // Title color
-        padding: [10, 0, 0, 0], // Padding for title
-      },
-      axisLabel: {
-        formatter: (value) => {
-          return value; // Show values without formatting
-        },
-      },
-      axisTick: {
-        show: true, // Show tick marks
-      },
-      axisLine: {
-        show: true, // Show axis line
-      },
-      data: ticks, // Set tick values
-    },
-
-    yAxis: {
-      type: "value", // Y-axis type as numeric
-      name: this.timeList.yaxis, // Set Y-axis title
-      // nameLocation: "center",
-      nameTextStyle: {
-        fontSize: 14,
-        color: "#333", // Title color
-        padding: [10, 0, 0, 0], // Padding for title
-      },
-      axisLabel: {
-        formatter: (value) => {
-          return value; // Show values without formatting
-        },
-      },
-      axisTick: {
-        show: true, // Show tick marks
-      },
-      axisLine: {
-        show: true, // Show axis line
-      },
-    },
-
-    tooltip: {
-      trigger: "axis",
-      formatter: (params) => {
-        const xValue = params[0].value[0]; // Get x value
-        const yValue = params[0].value[1]; // Get y value
-        return `X: ${xValue}<br/>Y: ${yValue}`;
-      },
-      axisPointer: {
-        type: "line", // Crosshair line
-      },
-    },
-
-    series: [
-      {
-        name: "数据系列",
-        type: "line", // Line chart
-        data: labels.map((item, index) => [item, data[index]]), // Map x, y values
-        symbol: "none", // No symbols at data points
-        symbolSize: 8, // Set data point size
-        lineStyle: {
-          color: "rgb(75, 192, 192)", // Line color
-          width: 2, // Line width
-        },
-        itemStyle: {
-          color: "rgb(75, 192, 192)", // Data point color
-          borderColor: "#fff",
-          borderWidth: 2,
-        },
-      },
-    ],
-  };
-
-  this.chartInstance.setOption(option); // Update the chart with the new option
-},
-
-
-    previousRow() {
-      this.$emit("update-previous-row", 1);
-    },
-
-    // 触发下一条
-    nextRow() {
-      this.$emit("update-next-row", 1);
-    },
-
-    Show() {
-      this.TZshow = !this.TZshow;
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.line-chart {
-  width: 100%;
-  height: 250px;
-}
-.FD {
-  width: 100%;
-  height: 1px;
-  position: relative;
-}
-
-.eigenvalue {
-  position: absolute;
-  top: 30px;
-  right: 0;
-  font-size: 10px;
-  width: 100px;
-  border: 1px solid black;
-  padding: 5px;
-  background: #fff;
-  z-index: 99;
-  h5 {
-    line-height: 16px;
-    height: 16px;
-  }
-}
-</style>

+ 39 - 37
src/views/health/components/timedomaincharts.vue

@@ -17,7 +17,6 @@
       </div>
     </div>
     <!-- ECharts 图表容器 -->
-
     <div class="line-chart" ref="chart" v-loading="loadingTime"></div>
   </div>
 </template>
@@ -103,7 +102,7 @@ export default {
     initializeChart() {
       const chartDom = this.$refs.chart;
       if (chartDom && !this.chartInstance) {
-        this.chartInstance = echarts.init(chartDom); 
+        this.chartInstance = echarts.init(chartDom);
       }
       if (this.timeList.y && this.timeList.x) {
         this.updateChart(this.timeList.y, this.timeList.x);
@@ -114,13 +113,6 @@ export default {
     updateChart(data, labels) {
       if (!this.chartInstance) return; // Check if chartInstance is available
 
-      const maxX = Math.max(...labels);
-      const maxAxisValue = Math.ceil(maxX / 5) * 5;
-      const ticks = [];
-      for (let i = 0; i <= maxAxisValue; i += 5) {
-        ticks.push(i);
-      }
-
       const option = {
         title: {
           text: this.timeList.title,
@@ -152,9 +144,9 @@ export default {
           },
         },
         xAxis: {
-          type: "value", 
-          name: this.timeList.xaxis, 
-          nameLocation: "center", 
+          type: "value",
+          name: this.timeList.xaxis,
+          nameLocation: "center",
           nameTextStyle: {
             fontSize: 14,
             color: "#333",
@@ -166,76 +158,86 @@ export default {
             },
           },
           axisTick: {
-            show: true, 
+            show: true,
           },
           axisLine: {
-            show: true, 
+            show: true,
           },
-          data: ticks,
         },
-
         yAxis: {
-          type: "value", 
+          type: "value",
           name: this.timeList.yaxis,
-          // nameLocation: "center",
           nameTextStyle: {
             fontSize: 14,
-            color: "#333", 
-            padding: [10, 0, 0, 0], 
+            color: "#333",
+            padding: [10, 0, 0, 0],
           },
           axisLabel: {
             formatter: (value) => {
-              return value; 
+              return value;
             },
           },
           axisTick: {
-            show: true, 
+            show: true,
           },
           axisLine: {
-            show: true, 
+            show: true,
           },
         },
-
         tooltip: {
           trigger: "axis",
           formatter: (params) => {
-            const xValue = params[0].value[0]; 
-            const yValue = params[0].value[1]; 
+            const xValue = params[0].value[0];
+            const yValue = params[0].value[1];
             return `X: ${xValue}<br/>Y: ${yValue}`;
           },
           axisPointer: {
-            type: "line", 
+            type: "line",
           },
         },
-
+        dataZoom: [
+          {
+            type: "inside", // 内置型数据区域缩放组件
+            start: 0, // 初始缩放范围的起始百分比
+            end: 10, // 初始缩放范围的结束百分比
+          },
+          {
+            type: "slider", // 滑动条型数据区域缩放组件
+            start: 0,
+            end: 10,
+            handleSize: "80%", // 控制手柄大小
+            showDataShadow: false, // 是否显示数据阴影
+          },
+        ],
         series: [
           {
             name: "数据系列",
-            type: "line", 
-            data: labels.map((item, index) => [item, data[index]]), 
-            symbol: "none", 
-            symbolSize: 8, 
+            type: "line",
+            data: labels.map((item, index) => [item, data[index]]),
+            symbol: "none",
+            symbolSize: 8,
             lineStyle: {
-              color: "#162961", 
-              width: 1, 
+              color: "#162961",
+              width: 1,
             },
             itemStyle: {
-              color: "#162961", 
+              color: "#162961",
               borderColor: "#fff",
               borderWidth: 1,
             },
+            large: true, // 开启大数据量优化
+            progressive: 2000, // 渐进式渲染的数据块大小
           },
         ],
       };
 
-      this.chartInstance.setOption(option); 
+      this.chartInstance.setOption(option);
     },
 
     getTime() {
       this.$emit("handleLoading", null, true, this.activeIndex);
       const params = {
         ids: this.ids,
-        // windCode: "SKF001",
         analysisType: "time",
         windCode: this.windCode,
       };

+ 2 - 2
src/views/health/vibration.vue

@@ -81,9 +81,9 @@
       <p>
         时间:
         <el-date-picker
-          size="small"
           v-model="timevalue"
-          type="daterange"
+          size="small"
+          type="datetimerange"
           range-separator="至"
           start-placeholder="开始日期"
           end-placeholder="结束日期"

+ 1 - 1
src/views/overview/components/analysis_information/index.vue

@@ -20,7 +20,7 @@
             analysisInfo.analysisStartTime
           }}</el-descriptions-item>
           <el-descriptions-item label="分析完成时间">{{
-            analysisInfo.analysisEndTime
+            analysisInfo.analysisFinishTime
           }}</el-descriptions-item>
         </el-descriptions>
         <!-- <div v-if="analysisInfo.dataEndTime || analysisInfo.dataStartTime">

+ 2 - 2
src/views/overview/components/filterChart/index.vue

@@ -33,10 +33,10 @@
         >查询</el-button
       >
       <el-button type="primary" size="small" @click="onSubmit('handlePrevious')"
-        >上一分析结果</el-button
+        >上一分析结果</el-button
       >
       <el-button type="primary" size="small" @click="onSubmit('handleNext')"
-        >下一分析结果</el-button
+        >下一分析结果</el-button
       >
     </el-form-item>
   </el-form>