|
@@ -62,7 +62,12 @@
|
|
|
</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.detectionPointEn"
|
|
@@ -94,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>
|
|
@@ -123,35 +128,43 @@
|
|
|
minimized: item.isMinimized,
|
|
|
}"
|
|
|
>
|
|
|
- <p>测点路径:{{}}</p>
|
|
|
- <P><span>采样频率:</span><span>采样时间:</span></P>
|
|
|
+ <p>测点路径:</p>
|
|
|
+ <P
|
|
|
+ ><span>采样频率:</span><span>采样时间:{{ samplingTime }}</span></P
|
|
|
+ >
|
|
|
<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
|
|
|
- :chartData="chartData"
|
|
|
- :chartLabels="chartLabels"
|
|
|
+ :spectrumList="spectrumList"
|
|
|
:currentIndex="currentIndex"
|
|
|
- :tableData="tableData"
|
|
|
+ :tableDataList="tableDataList"
|
|
|
@update:currentIndex="handleCurrentIndexUpdate"
|
|
|
+ @update-previous-row="goToPreviousRow"
|
|
|
+ @update-next-row="goToNextRow"
|
|
|
></spectrogramcharts>
|
|
|
</div>
|
|
|
<div v-if="item.name === '包络谱图'">
|
|
|
<envelopecharts
|
|
|
- :chartData="chartData"
|
|
|
- :chartLabels="chartLabels"
|
|
|
+ :envelopeListTwo="envelopeListTwo"
|
|
|
:currentIndex="currentIndex"
|
|
|
- :tableData="tableData"
|
|
|
+ :tableDataList="tableDataList"
|
|
|
@update:currentIndex="handleCurrentIndexUpdate"
|
|
|
+ @update-previous-row="goToPreviousRow"
|
|
|
+ @update-next-row="goToNextRow"
|
|
|
+ @update:modelValue="handleModelUpdate"
|
|
|
></envelopecharts>
|
|
|
</div>
|
|
|
<div v-if="item.name === '趋势图'">
|
|
|
- <tendencycharts></tendencycharts>
|
|
|
+ <tendencycharts :qsList="qsList"></tendencycharts>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -168,10 +181,11 @@
|
|
|
<el-table-column type="index" 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="address" label="场站">
|
|
|
- {{ this.companyCode }}
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column prop="address" label="场站"> </el-table-column>
|
|
|
<el-table-column prop="windTurbineNumber" label="风机" width="80px">
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -207,20 +221,18 @@ export default {
|
|
|
return {
|
|
|
chartData: [],
|
|
|
chartLabels: [],
|
|
|
- tableData: [],
|
|
|
- data: [10, 20, 30, 40], // 假设是图表的数据
|
|
|
- labels: ["2024/1/1", "2024/1/2", "2024/1/3", "2024/1/4"], // 假设是时间轴数据
|
|
|
-
|
|
|
- tableData: [], // 假设是来自父组件的数据
|
|
|
|
|
|
company: "",
|
|
|
companyoptions: [],
|
|
|
unitvalue: "",
|
|
|
unitoptions: [],
|
|
|
monitoringvalue: "",
|
|
|
- monitoringoptions: [],
|
|
|
-
|
|
|
- tableData: [],
|
|
|
+ monitoringoptions: [
|
|
|
+ {
|
|
|
+ detectionPointEn: "name",
|
|
|
+ detectionPointCn: "中文",
|
|
|
+ },
|
|
|
+ ],
|
|
|
|
|
|
fourList: [],
|
|
|
currentRow: null, // 用于存储当前选中的行
|
|
@@ -233,16 +245,47 @@ export default {
|
|
|
timevalue: [], // 绑定 el-date-picker 的值
|
|
|
startTime: "", // 开始时间
|
|
|
endTime: "", // 结束时间
|
|
|
- tableDataList: [],
|
|
|
+ tableDataList: [
|
|
|
+ { ids: 1, mesurePointName: "name" },
|
|
|
+ { ids: 2, mesurePointName: "22" },
|
|
|
+ { ids: 3, mesurePointName: "22" },
|
|
|
+ ],
|
|
|
+
|
|
|
+ samplingTime: "", // 采样时间
|
|
|
|
|
|
timeList: {},
|
|
|
+ spectrumList: {},
|
|
|
+ envelopeList: {},
|
|
|
+ qsList: {},
|
|
|
+ CdNamw: "",
|
|
|
+ chartsData: {},
|
|
|
+ shuju: {},
|
|
|
+ envelopeListTwo: {},
|
|
|
};
|
|
|
},
|
|
|
-
|
|
|
+ computed: {},
|
|
|
created() {
|
|
|
- this.GETtree();
|
|
|
+ // this.GETtree();
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ // 监听 timeList 的变化
|
|
|
+ timeList(newTimeList) {
|
|
|
+ if (newTimeList && newTimeList.length > 0) {
|
|
|
+ // 当 timeList 不为空时,触发 ECharts 图表生成
|
|
|
+ this.generateChart(1); // 或者根据具体逻辑来生成对应的图表
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
methods: {
|
|
|
+ getDetectionPointCn(detectionPointEn) {
|
|
|
+ console.log(detectionPointEn, this.monitoringoptions);
|
|
|
+ const point = this.monitoringoptions?.find(
|
|
|
+ (option) => option.detectionPointEn === detectionPointEn
|
|
|
+ );
|
|
|
+ console.log(point?.detectionPointCn);
|
|
|
+ return point ? point?.detectionPointCn : null; // 如果没有找到对应项,返回 null
|
|
|
+ },
|
|
|
// 获取风场
|
|
|
async GETtree() {
|
|
|
const res = await getSysOrganizationAuthTreeByRoleId();
|
|
@@ -313,15 +356,119 @@ export default {
|
|
|
// 获取测点
|
|
|
getchedian(value) {
|
|
|
queryDetectionDic({ engineCodes: value }).then((res) => {
|
|
|
- this.monitoringoptions = res.data;
|
|
|
+ // this.monitoringoptions = res.data;
|
|
|
});
|
|
|
},
|
|
|
-// 更新父组件的 currentIndex
|
|
|
+
|
|
|
+ handleModelUpdate(data) {
|
|
|
+ // 将子组件的值作为查询参数传递给查询接口
|
|
|
+ const { xiaoval, daval } = 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);
|
|
|
+
|
|
|
+ const params = {
|
|
|
+ ids: currentRow.id,
|
|
|
+ windCode: "SKF001_wave",
|
|
|
+ };
|
|
|
+
|
|
|
+ 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 {
|
|
|
+ console.warn("Unknown type provided:", type);
|
|
|
+ }
|
|
|
+},
|
|
|
+
|
|
|
+
|
|
|
+ // 下一条数据,向后循环
|
|
|
+ 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_wave",
|
|
|
+ };
|
|
|
+
|
|
|
+ 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) => {});
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 更新父组件的 currentIndex
|
|
|
handleCurrentIndexUpdate(newIndex) {
|
|
|
this.currentIndex = newIndex;
|
|
|
- this.setCurrentRowData(newIndex)
|
|
|
+ this.handleCurrentChange(newIndex);
|
|
|
},
|
|
|
-
|
|
|
// 当前所在行高亮提示
|
|
|
setCurrent(row) {
|
|
|
this.$refs.singleTable.setCurrentRow(row);
|
|
@@ -329,17 +476,17 @@ export default {
|
|
|
// 当前单选
|
|
|
handleCurrentChange(val) {
|
|
|
this.currentRow = val;
|
|
|
- const index = this.tableData.indexOf(val);
|
|
|
+
|
|
|
+ const index = this.tableDataList.indexOf(val);
|
|
|
this.currentIndex = index; // 更新当前索引
|
|
|
+ console.log(this.currentIndex);
|
|
|
},
|
|
|
|
|
|
-
|
|
|
generate(type) {
|
|
|
if (!this.currentRow) {
|
|
|
this.$message.warning("请先选择数据");
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
const nameMap = {
|
|
|
1: "时域图", // Time Domain Chart
|
|
|
2: "频谱图", // Spectrogram Chart
|
|
@@ -355,23 +502,58 @@ export default {
|
|
|
};
|
|
|
this.fourList.push(newItem);
|
|
|
}
|
|
|
- const params = {
|
|
|
- ids: [67803],
|
|
|
- windCode: "SKF001_wave",
|
|
|
- analysisType: "time",
|
|
|
- };
|
|
|
|
|
|
- axios
|
|
|
- .post("/WJapi/analysis/time", params)
|
|
|
- .then((res) => {
|
|
|
- this.timeList = JSON.parse(res.data);
|
|
|
- console.log(this.timeList);
|
|
|
- })
|
|
|
- .catch((error) => {});
|
|
|
+ // API call for specific types
|
|
|
+ if (type === "1") {
|
|
|
+ // Time Domain Chart
|
|
|
+ const params = {
|
|
|
+ ids: this.tableDataList.map((item) => item.id),
|
|
|
+ windCode: "SKF001_wave",
|
|
|
+ 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: [67803],
|
|
|
+ windCode: "SKF001_wave",
|
|
|
+ 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") {
|
|
|
+ // // Envelope Spectrum Chart
|
|
|
+ // const params = {
|
|
|
+ // ids: [67803],
|
|
|
+ // windCode: "SKF001_wave",
|
|
|
+ // analysisType: "envelope",
|
|
|
+ // fmin: "5",
|
|
|
+ // fmax: "20",
|
|
|
+ // };
|
|
|
+ // axios
|
|
|
+ // .post("/WJapi/analysis/envelope", params)
|
|
|
+ // .then((res) => {
|
|
|
+ // this.envelopeList = JSON.parse(res.data);
|
|
|
+ // console.log("Envelope Spectrum Data:", this.envelopeList);
|
|
|
+ // })
|
|
|
+ // .catch((error) => {});
|
|
|
+ // }
|
|
|
},
|
|
|
|
|
|
tendency() {
|
|
|
- if (this.tableData.length === 0) {
|
|
|
+ if (this.tableDataList.length === 0) {
|
|
|
this.$message.warning("数据为空,无法生成图表");
|
|
|
return;
|
|
|
}
|
|
@@ -380,17 +562,31 @@ export default {
|
|
|
isMinimized: false,
|
|
|
id: `chart-${Date.now()}`,
|
|
|
};
|
|
|
- this.fourList.push(newItem);
|
|
|
+ const params = {
|
|
|
+ ids: this.tableDataList.map((item) => item.id),
|
|
|
+ windCode: "SKF001_wave",
|
|
|
+ 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) => {});
|
|
|
},
|
|
|
|
|
|
- // // const params = {
|
|
|
- // // windCode: this.maplist.codeNumber,
|
|
|
- // // windTurbineNumberList: this.unitvalue,
|
|
|
- // // mesureNameList: this.monitoringvalue,
|
|
|
- // // startTime: this.$formatDateTWO(this.timevalue[0]),
|
|
|
- // // endTime: this.$formatDateTWO(this.timevalue[1]),
|
|
|
- // // };
|
|
|
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"],
|
|
@@ -497,7 +693,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
.subject {
|
|
|
- height: 280px;
|
|
|
+ height: 300px;
|
|
|
transition: all 0.3s ease;
|
|
|
padding: 0 10px;
|
|
|
p {
|
|
@@ -510,8 +706,8 @@ export default {
|
|
|
justify-content: space-between;
|
|
|
.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);
|