|
@@ -28,36 +28,51 @@
|
|
|
<div class="searchbox">
|
|
|
<p>
|
|
|
单位:
|
|
|
- <el-select v-model="company" size="small" placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in companyoptions"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <selecttree
|
|
|
+ style="width: 220px"
|
|
|
+ placeholder="请选择上级单位"
|
|
|
+ :list="parentOpt"
|
|
|
+ type="1"
|
|
|
+ v-model="companyCode"
|
|
|
+ @change="parentChange"
|
|
|
+ :defaultParentProps="{
|
|
|
+ children: 'children',
|
|
|
+ label: 'companyName',
|
|
|
+ value: 'codeNumber',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ </selecttree>
|
|
|
</p>
|
|
|
<p>
|
|
|
风机:
|
|
|
- <el-select v-model="unitvalue" size="small" placeholder="请选择">
|
|
|
+ <el-select
|
|
|
+ v-model="unitvalue"
|
|
|
+ @change="getchedian"
|
|
|
+ size="small"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in unitoptions"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ :key="item.engineCode"
|
|
|
+ :label="item.engineName"
|
|
|
+ :value="item.engineCode"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</p>
|
|
|
<p>
|
|
|
测点:
|
|
|
- <el-select v-model="monitoringvalue" size="small" placeholder="请选择">
|
|
|
+ <el-select
|
|
|
+ v-model="monitoringvalue"
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in monitoringoptions"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ :key="item.detectionPointEn"
|
|
|
+ :label="item.detectionPointCn"
|
|
|
+ :value="item.detectionPointEn"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
@@ -74,7 +89,9 @@
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
</p>
|
|
|
- <el-button type="primary" size="small">查询</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="conditions"
|
|
|
+ >查询</el-button
|
|
|
+ >
|
|
|
<el-button size="small">导出</el-button>
|
|
|
</div>
|
|
|
<div class="main-body">
|
|
@@ -82,7 +99,7 @@
|
|
|
<div
|
|
|
class="chart-area"
|
|
|
v-for="(item, index) in fourList"
|
|
|
- :key="item.id"
|
|
|
+ :key="item.index"
|
|
|
>
|
|
|
<div class="dialog-actions">
|
|
|
<p>{{ item.name }}</p>
|
|
@@ -112,52 +129,67 @@
|
|
|
}"
|
|
|
>
|
|
|
<p>测点路径:</p>
|
|
|
- <P><span>采样频率:</span><span>采样时间:</span></P>
|
|
|
- <!-- <div
|
|
|
- :id="item.id"
|
|
|
- class="line-chart"
|
|
|
- style="width: 100%; height: 260px"
|
|
|
+ <P
|
|
|
+ ><span>采样频率:</span><span>采样时间:{{ samplingTime }}</span></P
|
|
|
>
|
|
|
- <div class="eigenvalue">
|
|
|
- <h5>特征值</h5>
|
|
|
- <p>有效值:</p>
|
|
|
- <p>平均值:</p>
|
|
|
- <p>最大值:</p>
|
|
|
- <p>最小值:</p>
|
|
|
- <p>峰值:</p>
|
|
|
- <p>峰峰值:</p>
|
|
|
- <p>波形因子:</p>
|
|
|
- <p>脉冲指标:</p>
|
|
|
- <p>裕度指标:</p>
|
|
|
- <p>偏度指标:</p>
|
|
|
- <p>峭度指标:</p>
|
|
|
- </div>
|
|
|
- </div> -->
|
|
|
-
|
|
|
- <!-- 时域图 -->
|
|
|
- <timedomaincharts></timedomaincharts>
|
|
|
- <!-- 频谱图 -->
|
|
|
- <!-- <spectrogramcharts></spectrogramcharts> -->
|
|
|
- <!-- 包络图 -->
|
|
|
- <!-- <envelopecharts></envelopecharts> -->
|
|
|
- <!-- 趋势图 -->
|
|
|
- <!-- <tendencycharts></tendencycharts> -->
|
|
|
+ <div v-if="item.name === '时域图'">
|
|
|
+ <timedomaincharts
|
|
|
+ :timeList="timeList"
|
|
|
+ :currentIndex="currentIndex"
|
|
|
+ :tableDataList="tableDataList"
|
|
|
+ @update:currentIndex="handleCurrentIndexUpdate"
|
|
|
+ @update-previous-row="goToPreviousRow"
|
|
|
+ @update-next-row="goToNextRow"
|
|
|
+ ></timedomaincharts>
|
|
|
+ </div>
|
|
|
+ <div v-if="item.name === '频谱图'">
|
|
|
+ <spectrogramcharts
|
|
|
+ :spectrumList="spectrumList"
|
|
|
+ :currentIndex="currentIndex"
|
|
|
+ :tableDataList="tableDataList"
|
|
|
+ @update:currentIndex="handleCurrentIndexUpdate"
|
|
|
+ @update-previous-row="goToPreviousRow"
|
|
|
+ @update-next-row="goToNextRow"
|
|
|
+ ></spectrogramcharts>
|
|
|
+ </div>
|
|
|
+ <div v-if="item.name === '包络谱图'">
|
|
|
+ <envelopecharts
|
|
|
+ :envelopeListTwo="envelopeListTwo"
|
|
|
+ :currentIndex="currentIndex"
|
|
|
+ :tableDataList="tableDataList"
|
|
|
+ @update:currentIndex="handleCurrentIndexUpdate"
|
|
|
+ @update-previous-row="goToPreviousRow"
|
|
|
+ @update-next-row="goToNextRow"
|
|
|
+ @update:modelValue="handleModelUpdate"
|
|
|
+ ></envelopecharts>
|
|
|
+ </div>
|
|
|
+ <div v-if="item.name === '趋势图'">
|
|
|
+ <tendencycharts :qsList="qsList"></tendencycharts>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="data-origin">
|
|
|
<el-table
|
|
|
- highlight-current-row
|
|
|
- @current-change="handleCurrentChange"
|
|
|
ref="singleTable"
|
|
|
- :data="tableData"
|
|
|
+ :data="tableDataList"
|
|
|
+ :current-row-key="currentIndex"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ highlight-current-row
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
<el-table-column type="index" label="排序"> </el-table-column>
|
|
|
- <el-table-column prop="name" label="时间"> </el-table-column>
|
|
|
- <el-table-column prop="address" label="测点名称"> </el-table-column>
|
|
|
- <el-table-column prop="address" label="场站"> </el-table-column>
|
|
|
- <el-table-column prop="address" label="风机"> </el-table-column>
|
|
|
+ <el-table-column prop="timeStamp" label="时间"> </el-table-column>
|
|
|
+ <el-table-column prop="mesurePointName" label="测点名称">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ getDetectionPointCn(scope.row.mesurePointName) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column prop="companyName" label="场站">
|
|
|
+ {{ getCompanyLabel(scope.row.companyCode) }}
|
|
|
+ </el-table-column> -->
|
|
|
+ <el-table-column prop="windTurbineNumber" label="风机" width="80px">
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -165,182 +197,289 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import * as echarts from "echarts";
|
|
|
+import {
|
|
|
+ getSysOrganizationAuthTreeByRoleId,
|
|
|
+ windEngineGrouPage,
|
|
|
+ queryDetectionDic,
|
|
|
+} from "@/api/ledger.js";
|
|
|
+import selecttree from "../../components/selecttree.vue";
|
|
|
+
|
|
|
import envelopecharts from "./components/envelopecharts.vue";
|
|
|
import spectrogramcharts from "./components/spectrogramcharts.vue";
|
|
|
import tendencycharts from "./components/tendencycharts.vue";
|
|
|
import timedomaincharts from "./components/timedomaincharts.vue";
|
|
|
-
|
|
|
+import axios from "axios";
|
|
|
export default {
|
|
|
components: {
|
|
|
envelopecharts,
|
|
|
spectrogramcharts,
|
|
|
tendencycharts,
|
|
|
timedomaincharts,
|
|
|
+ selecttree,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- company: "",
|
|
|
- companyoptions: [],
|
|
|
unitvalue: "",
|
|
|
unitoptions: [],
|
|
|
monitoringvalue: "",
|
|
|
- monitoringoptions: [],
|
|
|
- timevalue: "",
|
|
|
- tableData: [
|
|
|
- { name: "2024-11-01", address: "Location A" },
|
|
|
- { name: "2024-11-02", address: "Location B" },
|
|
|
- { name: "2024-11-03", address: "Location C" },
|
|
|
+ monitoringoptions: [
|
|
|
+ // {
|
|
|
+ // detectionPointEn: "name",
|
|
|
+ // detectionPointCn: "中文",
|
|
|
+ // },
|
|
|
],
|
|
|
-
|
|
|
fourList: [],
|
|
|
currentRow: null, // 用于存储当前选中的行
|
|
|
currentIndex: 0,
|
|
|
isChartVisible: false,
|
|
|
+ parentOpt: [],
|
|
|
+ defaultdata: {},
|
|
|
+ companyCode: "",
|
|
|
+ maplist: {},
|
|
|
+ timevalue: [], // 绑定 el-date-picker 的值
|
|
|
+ startTime: "", // 开始时间
|
|
|
+ endTime: "", // 结束时间
|
|
|
+ tableDataList: [
|
|
|
+ // { ids: 1, mesurePointName: "name" },
|
|
|
+ // { ids: 2, mesurePointName: "22" },
|
|
|
+ // { ids: 3, mesurePointName: "22" },
|
|
|
+ ],
|
|
|
+ samplingTime: "", // 采样时间
|
|
|
+ timeList: {},
|
|
|
+ spectrumList: {},
|
|
|
+ envelopeList: {},
|
|
|
+ qsList: {},
|
|
|
+ envelopeListTwo: {},
|
|
|
};
|
|
|
},
|
|
|
|
|
|
+ created() {
|
|
|
+ this.GETtree();
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ // 监听 timeList 的变化
|
|
|
+ timeList(newTimeList) {
|
|
|
+ if (newTimeList && newTimeList.length > 0) {
|
|
|
+ // 当 timeList 不为空时,触发 ECharts 图表生成
|
|
|
+ this.generateChart(1); // 或者根据具体逻辑来生成对应的图表
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
methods: {
|
|
|
- // 当前所在行高亮提示
|
|
|
- setCurrent(row) {
|
|
|
- this.$refs.singleTable.setCurrentRow(row);
|
|
|
+ getDetectionPointCn(detectionPointEn) {
|
|
|
+ const point = this.monitoringoptions?.find(
|
|
|
+ (option) => option.detectionPointEn === detectionPointEn
|
|
|
+ );
|
|
|
+ return point ? point?.detectionPointCn : null; // 如果没有找到对应项,返回 null
|
|
|
},
|
|
|
- // 当前单选
|
|
|
- handleCurrentChange(val) {
|
|
|
- this.currentRow = val;
|
|
|
- const index = this.tableData.indexOf(val);
|
|
|
- this.currentIndex = index; // 更新当前索引
|
|
|
+
|
|
|
+ // 获取风场
|
|
|
+ async GETtree() {
|
|
|
+ const res = await getSysOrganizationAuthTreeByRoleId();
|
|
|
+ const treedata = res.data;
|
|
|
+ const processedData = this.processTreeData(treedata);
|
|
|
+ this.parentOpt = processedData;
|
|
|
+ this.defaultdata = res.data[0];
|
|
|
},
|
|
|
|
|
|
- // renderChart(containerId, data = []) {
|
|
|
- // // 获取特定的图表容器
|
|
|
- // const chartDom = document.getElementById(containerId);
|
|
|
- // if (!chartDom) {
|
|
|
- // console.error(`Container with id ${containerId} not found`);
|
|
|
- // return;
|
|
|
- // }
|
|
|
-
|
|
|
- // // 检查是否已经存在 ECharts 实例,如果存在则销毁它
|
|
|
- // if (chartDom.__echarts_instance__) {
|
|
|
- // echarts.dispose(chartDom);
|
|
|
- // }
|
|
|
-
|
|
|
- // // 初始化 ECharts 实例
|
|
|
- // const myChart = echarts.init(chartDom);
|
|
|
-
|
|
|
- // // 定义默认的数据
|
|
|
- // let base = +new Date(1968, 9, 3);
|
|
|
- // let oneDay = 24 * 3600 * 1000;
|
|
|
- // let date = [];
|
|
|
- // let defaultData = [Math.random() * 300];
|
|
|
- // for (let i = 1; i < 200; i++) {
|
|
|
- // const now = new Date((base += oneDay));
|
|
|
- // date.push(
|
|
|
- // [now.getFullYear(), now.getMonth() + 1, now.getDate()].join("/")
|
|
|
- // );
|
|
|
- // defaultData.push(
|
|
|
- // Math.round((Math.random() - 0.5) * 20 + defaultData[i - 1])
|
|
|
- // );
|
|
|
- // }
|
|
|
-
|
|
|
- // // 使用传入的数据或默认数据
|
|
|
- // const chartData = data.length > 0 ? data : defaultData;
|
|
|
-
|
|
|
- // // 配置选项
|
|
|
- // const option = {
|
|
|
- // toolbox: {
|
|
|
- // feature: {
|
|
|
- // dataZoom: { yAxisIndex: "none" },
|
|
|
- // restore: {},
|
|
|
- // saveAsImage: {},
|
|
|
- // myCustomTool: {
|
|
|
- // show: true,
|
|
|
- // title: "上一条",
|
|
|
- // icon: `image://${require("@/assets/analyse/08.png")}`,
|
|
|
- // onclick: () => this.previousRow(containerId), // 传递当前图表的 ID
|
|
|
- // },
|
|
|
- // myCustomTool2: {
|
|
|
- // show: true,
|
|
|
- // title: "下一条",
|
|
|
- // icon: `image://${require("@/assets/analyse/09.png")}`,
|
|
|
- // onclick: () => this.nextRow(containerId), // 传递当前图表的 ID
|
|
|
- // },
|
|
|
- // myCustomTool3: {
|
|
|
- // show: true,
|
|
|
- // title: "特征值",
|
|
|
- // icon: `image://${require("@/assets/analyse/10.png")}`,
|
|
|
- // onclick: () => alert("自定义按钮被点击!"),
|
|
|
- // },
|
|
|
- // },
|
|
|
- // },
|
|
|
- // xAxis: {
|
|
|
- // type: "category",
|
|
|
- // boundaryGap: false,
|
|
|
- // data: date,
|
|
|
- // },
|
|
|
- // yAxis: {
|
|
|
- // type: "value",
|
|
|
- // boundaryGap: [0, "100%"],
|
|
|
- // },
|
|
|
- // tooltip: {
|
|
|
- // trigger: "axis",
|
|
|
- // position: function (pt) {
|
|
|
- // return [pt[0], "10%"];
|
|
|
- // },
|
|
|
- // },
|
|
|
- // series: [
|
|
|
- // {
|
|
|
- // name: "数据系列",
|
|
|
- // type: "line",
|
|
|
- // symbol: "none",
|
|
|
- // sampling: "lttb",
|
|
|
- // itemStyle: { color: "rgb(255, 70, 131)" },
|
|
|
- // areaStyle: {
|
|
|
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
- // { offset: 0, color: "rgb(255, 158, 68)" },
|
|
|
- // { offset: 1, color: "rgb(255, 70, 131)" },
|
|
|
- // ]),
|
|
|
- // },
|
|
|
- // data: chartData,
|
|
|
- // },
|
|
|
- // ],
|
|
|
- // };
|
|
|
-
|
|
|
- // // 设置图表选项
|
|
|
- // myChart.setOption(option);
|
|
|
-
|
|
|
- // // 监听窗口大小变化,调整图表大小
|
|
|
- // window.addEventListener("resize", () => {
|
|
|
- // myChart.resize();
|
|
|
- // });
|
|
|
- // },
|
|
|
-
|
|
|
- // 上一条
|
|
|
- previousRow(chartId) {
|
|
|
- if (this.currentIndex > 0) {
|
|
|
- this.currentIndex--;
|
|
|
+ parentChange(data) {
|
|
|
+ this.maplist = data;
|
|
|
+ this.maplistArr = data;
|
|
|
+ let paramsData = {
|
|
|
+ fieldCode: this.maplist.codeNumber,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 99,
|
|
|
+ };
|
|
|
+ this.unitvalue = "";
|
|
|
+ // 获取风机
|
|
|
+ windEngineGrouPage(paramsData).then((res) => {
|
|
|
+ this.unitoptions = res.data.list;
|
|
|
+ });
|
|
|
+
|
|
|
+ console.log(data, "parentChange");
|
|
|
+ if (data.codeType === "field") {
|
|
|
+ if (this.parseCoordinates(data.longitudeAndLatitudeString).length > 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
} else {
|
|
|
- this.currentIndex = this.tableData.length - 1;
|
|
|
+ const dataMapList = data.children;
|
|
|
+ dataMapList.forEach((element) => {
|
|
|
+ console.log(element);
|
|
|
+ if (
|
|
|
+ this.parseCoordinates(element.longitudeAndLatitudeString).length >
|
|
|
+ 0 &&
|
|
|
+ element.codeType === "field"
|
|
|
+ ) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
- this.selectRow(chartId);
|
|
|
},
|
|
|
+ processTreeData(treeData) {
|
|
|
+ const processedData = [];
|
|
|
+ function processNode(node) {
|
|
|
+ if (node.codeType === "field") {
|
|
|
+ node.companyName = node.fieldName;
|
|
|
+ }
|
|
|
+ if (node.children && node.children.length > 0) {
|
|
|
+ node.children.forEach((child) => {
|
|
|
+ processNode(child);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ treeData.forEach((root) => {
|
|
|
+ processNode(root);
|
|
|
+ processedData.push(root);
|
|
|
+ });
|
|
|
+ return processedData;
|
|
|
+ },
|
|
|
+ parseCoordinates(input) {
|
|
|
+ if (input && typeof input === "string") {
|
|
|
+ return input.split(",").map(Number);
|
|
|
+ }
|
|
|
+ // debugger;
|
|
|
+ return [];
|
|
|
+ },
|
|
|
+ // 获取测点
|
|
|
+ getchedian(value) {
|
|
|
+ queryDetectionDic({ engineCodes: value }).then((res) => {
|
|
|
+ this.monitoringoptions = res.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ handleModelUpdate(data) {
|
|
|
+ // 将子组件的值作为查询参数传递给查询接口
|
|
|
+ data;
|
|
|
+ this.xiaoval = data.xiaoval;
|
|
|
+ this.daval = data.daval;
|
|
|
+ },
|
|
|
+
|
|
|
+ // 上一条数据
|
|
|
+ goToPreviousRow(type) {
|
|
|
+ if (this.tableDataList.length === 0) return;
|
|
|
+ this.currentIndex =
|
|
|
+ this.currentIndex === 0
|
|
|
+ ? this.tableDataList.length - 1
|
|
|
+ : this.currentIndex - 1;
|
|
|
+
|
|
|
+ const currentRow = this.tableDataList[this.currentIndex];
|
|
|
+ this.setCurrent(currentRow);
|
|
|
|
|
|
- // 下一条
|
|
|
- nextRow(chartId) {
|
|
|
- if (this.currentIndex < this.tableData.length - 1) {
|
|
|
- this.currentIndex++;
|
|
|
+ const params = {
|
|
|
+ ids: currentRow.id,
|
|
|
+ windCode: "SKF001",
|
|
|
+ };
|
|
|
+
|
|
|
+ if (type === 1) {
|
|
|
+ // For type 1, fetch time domain data
|
|
|
+ params.analysisType = "time";
|
|
|
+ axios
|
|
|
+ .post("/WJapi/analysis/time", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.timeList = JSON.parse(res.data);
|
|
|
+ console.log("Time List Data:", this.timeList);
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.error("Error fetching time domain data:", error);
|
|
|
+ });
|
|
|
+ } else if (type === 2) {
|
|
|
+ // For type 2, fetch frequency domain data
|
|
|
+ params.analysisType = "frequency";
|
|
|
+ axios
|
|
|
+ .post("/WJapi/analysis/frequency", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.spectrumList = JSON.parse(res.data);
|
|
|
+ console.log("Spectrum Data:", this.spectrumList);
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.error("Error fetching frequency domain data:", error);
|
|
|
+ });
|
|
|
+ } else if (type === 3) {
|
|
|
+ // For type 3, fetch envelope analysis data
|
|
|
+ params.analysisType = "envelope";
|
|
|
+ params.fmin = this.xiaoval; // 最小频率参数
|
|
|
+ params.fmax = this.daval; // 最大频率参数
|
|
|
+ axios
|
|
|
+ .post("/WJapi/analysis/envelope", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.envelopeListTwo = JSON.parse(res.data);
|
|
|
+ console.log("Envelope Analysis Data:", this.envelopeListTwo);
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.error("Error fetching envelope analysis data:", error);
|
|
|
+ });
|
|
|
} else {
|
|
|
- this.currentIndex = 0;
|
|
|
+ console.warn("Unknown type provided:", type);
|
|
|
}
|
|
|
- this.selectRow(chartId);
|
|
|
},
|
|
|
- selectRow(chartId) {
|
|
|
- const row = this.tableData[this.currentIndex];
|
|
|
- this.handleCurrentChange(row);
|
|
|
- this.setCurrent(row);
|
|
|
- // this.$nextTick(() => {
|
|
|
- // this.renderChart(chartId);
|
|
|
- // });
|
|
|
+
|
|
|
+ // 下一条数据,向后循环
|
|
|
+ goToNextRow(type) {
|
|
|
+ if (this.tableDataList.length === 0) return;
|
|
|
+ this.currentIndex =
|
|
|
+ this.currentIndex === this.tableDataList.length - 1
|
|
|
+ ? 0
|
|
|
+ : this.currentIndex + 1;
|
|
|
+ const currentRow = this.tableDataList[this.currentIndex];
|
|
|
+ this.setCurrent(currentRow);
|
|
|
+ const params = {
|
|
|
+ ids: currentRow.id,
|
|
|
+ windCode: "SKF001",
|
|
|
+ };
|
|
|
+
|
|
|
+ if (type === 1) {
|
|
|
+ // For type 1, fetch time domain data
|
|
|
+ params.analysisType = "time";
|
|
|
+ axios
|
|
|
+ .post("/WJapi/analysis/time", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.timeList = JSON.parse(res.data);
|
|
|
+ console.log("Time List Data:", this.timeList);
|
|
|
+ })
|
|
|
+ .catch((error) => {});
|
|
|
+ } else if (type === 2) {
|
|
|
+ // For type 2, fetch frequency domain data
|
|
|
+ params.analysisType = "frequency";
|
|
|
+ axios
|
|
|
+ .post("/WJapi/analysis/frequency", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.spectrumList = JSON.parse(res.data);
|
|
|
+ console.log("Spectrum Data:", this.spectrumList);
|
|
|
+ })
|
|
|
+ .catch((error) => {});
|
|
|
+ } else if (type === 3) {
|
|
|
+ // Type 3: 获取包络分析数据
|
|
|
+ params.analysisType = "envelope";
|
|
|
+ params.fmin = this.xiaoval; // 最小频率参数
|
|
|
+ params.fmax = this.daval; // 最大频率参数
|
|
|
+ axios
|
|
|
+ .post("/WJapi/analysis/envelope", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.envelopeListTwo = JSON.parse(res.data);
|
|
|
+ console.log("Envelope Analysis Data:", this.envelopeListTwo);
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.error("Error fetching envelope analysis data:", error);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 更新父组件的 currentIndex
|
|
|
+ handleCurrentIndexUpdate(newIndex) {
|
|
|
+ this.currentIndex = newIndex;
|
|
|
+ this.handleCurrentChange(newIndex);
|
|
|
+ },
|
|
|
+ // 当前所在行高亮提示
|
|
|
+ setCurrent(row) {
|
|
|
+ this.$refs.singleTable.setCurrentRow(row);
|
|
|
+ },
|
|
|
+ // 当前单选
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.currentRow = val;
|
|
|
+ const index = this.tableDataList.indexOf(val);
|
|
|
+ this.currentIndex = index; // 更新当前索引
|
|
|
+ console.log(this.currentIndex);
|
|
|
},
|
|
|
|
|
|
generate(type) {
|
|
@@ -349,44 +488,124 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
const nameMap = {
|
|
|
- 1: "时域图",
|
|
|
- 2: "频谱图",
|
|
|
- 3: "包络谱图",
|
|
|
+ 1: "时域图", // Time Domain Chart
|
|
|
+ 2: "频谱图", // Spectrogram Chart
|
|
|
+ 3: "包络谱图", // Envelope Spectrum Chart
|
|
|
};
|
|
|
- if (nameMap[type]) {
|
|
|
+
|
|
|
+ const chartName = nameMap[type];
|
|
|
+ if (chartName) {
|
|
|
const newItem = {
|
|
|
- name: nameMap[type],
|
|
|
+ name: chartName,
|
|
|
isMinimized: false,
|
|
|
- id: `chart-${Date.now()}`, // 使用唯一 ID
|
|
|
+ id: `chart-${Date.now()}`,
|
|
|
};
|
|
|
this.fourList.push(newItem);
|
|
|
}
|
|
|
- // this.$nextTick(() => {
|
|
|
- // const newChart = this.fourList[this.fourList.length - 1];
|
|
|
- // this.renderChart(newChart.id); // 为新图表渲染数据
|
|
|
- // });
|
|
|
+
|
|
|
+ // API call for specific types
|
|
|
+ if (type === "1") {
|
|
|
+ // Time Domain Chart
|
|
|
+ const params = {
|
|
|
+ ids: [this.currentRow.id],
|
|
|
+ // ids: [ 67803],
|
|
|
+ windCode: "SKF001",
|
|
|
+ analysisType: "time",
|
|
|
+ };
|
|
|
+ axios
|
|
|
+ .post("/WJapi/analysis/time", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.timeList = JSON.parse(res.data);
|
|
|
+ console.log("Time List Data:", this.timeList);
|
|
|
+ })
|
|
|
+ .catch((error) => {});
|
|
|
+ } else if (type === "2") {
|
|
|
+ // Spectrogram Chart
|
|
|
+ const params = {
|
|
|
+ ids: [this.currentRow.id],
|
|
|
+
|
|
|
+ windCode: "SKF001",
|
|
|
+ analysisType: "frequency",
|
|
|
+ };
|
|
|
+ axios
|
|
|
+ .post("/WJapi/analysis/frequency", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.spectrumList = JSON.parse(res.data);
|
|
|
+ console.log("Spectrum Data:", this.spectrumList);
|
|
|
+ })
|
|
|
+ .catch((error) => {});
|
|
|
+ }
|
|
|
},
|
|
|
+
|
|
|
tendency() {
|
|
|
- // 判断 tableData 是否为空,若为空则不进行图表生成
|
|
|
- if (this.tableData.length === 0) {
|
|
|
+ if (this.tableDataList.length === 0) {
|
|
|
this.$message.warning("数据为空,无法生成图表");
|
|
|
- return; // 直接返回,不执行后续逻辑
|
|
|
+ return;
|
|
|
}
|
|
|
-
|
|
|
- // 设置 isChartVisible 为 true,显示 <charts> 组件
|
|
|
- this.isChartVisible = true;
|
|
|
-
|
|
|
const newItem = {
|
|
|
name: "趋势图",
|
|
|
isMinimized: false,
|
|
|
- id: `chart-${Date.now()}`, // 唯一 ID
|
|
|
+ id: `chart-${Date.now()}`,
|
|
|
+ };
|
|
|
+ const params = {
|
|
|
+ ids: this.tableDataList.map((item) => item.id),
|
|
|
+ windCode: "SKF001",
|
|
|
+ analysisType: "trend",
|
|
|
+ };
|
|
|
+
|
|
|
+ axios
|
|
|
+ .post("/WJapi/analysis/trend", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.qsList = JSON.parse(res.data);
|
|
|
+ this.fourList.push(newItem);
|
|
|
+ console.log(res, "-------------------");
|
|
|
+ })
|
|
|
+ .catch((error) => {});
|
|
|
+ },
|
|
|
+
|
|
|
+ conditions() {
|
|
|
+ // const params = {
|
|
|
+ // windCode: this.maplist.codeNumber,
|
|
|
+ // windTurbineNumberList: this.unitvalue,
|
|
|
+ // mesureNameList: this.monitoringvalue,
|
|
|
+ // startTime: this.$formatDateTWO(this.timevalue[0]),
|
|
|
+ // endTime: this.$formatDateTWO(this.timevalue[1]),
|
|
|
+ // };
|
|
|
+
|
|
|
+ const params = {
|
|
|
+ endTime: "2024-07-02 00:00:00",
|
|
|
+ mesureNameList: ["gearbox_input_end_radial_vibration"],
|
|
|
+ startTime: "2024-07-01 00:00:00",
|
|
|
+ windCode: "SKF001",
|
|
|
+ windTurbineNumberList: ["F004"],
|
|
|
+ };
|
|
|
+ const areParamsValid = (params) => {
|
|
|
+ return (
|
|
|
+ params.endTime &&
|
|
|
+ params.startTime &&
|
|
|
+ params.mesureNameList?.length > 0 &&
|
|
|
+ params.windCode &&
|
|
|
+ params.windTurbineNumberList?.length > 0
|
|
|
+ );
|
|
|
};
|
|
|
- this.fourList.push(newItem); // 将新图表添加到列表
|
|
|
|
|
|
- // this.$nextTick(() => {
|
|
|
- // const lastChart = this.fourList[this.fourList.length - 1];
|
|
|
- // this.renderChart(lastChart.id); // 渲染最新添加的图表
|
|
|
- // });
|
|
|
+ if (areParamsValid(params)) {
|
|
|
+ axios
|
|
|
+ .post("/WZLapi/waveData/getMesureData", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.tableDataList = res.data.datas;
|
|
|
+ console.log(this.tableDataList, "-----------------");
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.error("Error:", error);
|
|
|
+ // Handle the error here
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: "请填写全部条件",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
// 缩小
|
|
@@ -409,7 +628,6 @@ export default {
|
|
|
this.fourList.splice(index, 1);
|
|
|
console.log("3");
|
|
|
},
|
|
|
-
|
|
|
zhankai() {
|
|
|
this.fourList.forEach((item) => {
|
|
|
item.isMinimized = false;
|
|
@@ -476,7 +694,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
.subject {
|
|
|
- height: 280px;
|
|
|
+ height: 300px;
|
|
|
transition: all 0.3s ease;
|
|
|
padding: 0 10px;
|
|
|
p {
|
|
@@ -487,10 +705,11 @@ export default {
|
|
|
.main-body {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
+ align-items: flex-start;
|
|
|
.data-map {
|
|
|
width: 60%;
|
|
|
- height: 620px;
|
|
|
- overflow-y: auto;
|
|
|
+ // height: 620px;
|
|
|
+ // overflow-y: auto;
|
|
|
.chart-area {
|
|
|
margin-bottom: 10px;
|
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
|
|
@@ -511,27 +730,4 @@ export default {
|
|
|
height: 0px; /* Adjust height when minimized */
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
-
|
|
|
-#main {
|
|
|
- width: 100%;
|
|
|
- height: 280px;
|
|
|
-}
|
|
|
-
|
|
|
-.line-chart {
|
|
|
- position: relative;
|
|
|
-}
|
|
|
-.eigenvalue {
|
|
|
- position: absolute;
|
|
|
- top: 0;
|
|
|
- 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>
|