|
@@ -28,24 +28,34 @@
|
|
|
<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>
|
|
@@ -55,9 +65,9 @@
|
|
|
<el-select v-model="monitoringvalue" size="small" 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 +84,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">
|
|
@@ -111,14 +123,12 @@
|
|
|
minimized: item.isMinimized,
|
|
|
}"
|
|
|
>
|
|
|
- <p>测点路径:</p>
|
|
|
+ <p>测点路径:{{}}</p>
|
|
|
<P><span>采样频率:</span><span>采样时间:</span></P>
|
|
|
<div v-if="item.name === '时域图'">
|
|
|
<timedomaincharts
|
|
|
- :chartData="chartData"
|
|
|
- :chartLabels="chartLabels"
|
|
|
+ :timeList="timeList"
|
|
|
:currentIndex="currentIndex"
|
|
|
- :tableData="tableData"
|
|
|
@update:currentIndex="handleCurrentIndexUpdate"
|
|
|
></timedomaincharts>
|
|
|
</div>
|
|
@@ -149,17 +159,21 @@
|
|
|
<div class="data-origin">
|
|
|
<el-table
|
|
|
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="测点名称">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="address" label="场站">
|
|
|
+ {{ this.companyCode }}
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="windTurbineNumber" label="风机" width="80px">
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -167,18 +181,27 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import {
|
|
|
+ getSysOrganizationAuthTreeByRoleId,
|
|
|
+ windEngineGrouPage,
|
|
|
+ queryDetectionDic,
|
|
|
+ getMesureData,
|
|
|
+} from "@/api/ledger.js";
|
|
|
+import selecttree from "../../components/selecttree.vue";
|
|
|
+
|
|
|
import * as echarts from "echarts";
|
|
|
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 {
|
|
@@ -187,7 +210,7 @@ export default {
|
|
|
tableData: [],
|
|
|
data: [10, 20, 30, 40], // 假设是图表的数据
|
|
|
labels: ["2024/1/1", "2024/1/2", "2024/1/3", "2024/1/4"], // 假设是时间轴数据
|
|
|
- currentIndex: 0,
|
|
|
+
|
|
|
tableData: [], // 假设是来自父组件的数据
|
|
|
|
|
|
company: "",
|
|
@@ -196,40 +219,121 @@ export default {
|
|
|
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" },
|
|
|
- ],
|
|
|
+
|
|
|
+ tableData: [],
|
|
|
|
|
|
fourList: [],
|
|
|
currentRow: null, // 用于存储当前选中的行
|
|
|
currentIndex: 0,
|
|
|
isChartVisible: false,
|
|
|
+ parentOpt: [],
|
|
|
+ defaultdata: {},
|
|
|
+ companyCode: "",
|
|
|
+ maplist: {},
|
|
|
+ timevalue: [], // 绑定 el-date-picker 的值
|
|
|
+ startTime: "", // 开始时间
|
|
|
+ endTime: "", // 结束时间
|
|
|
+ tableDataList: [],
|
|
|
+
|
|
|
+ timeList: {},
|
|
|
};
|
|
|
},
|
|
|
|
|
|
+ created() {
|
|
|
+ this.GETtree();
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ // 获取风场
|
|
|
+ async GETtree() {
|
|
|
+ const res = await getSysOrganizationAuthTreeByRoleId();
|
|
|
+ const treedata = res.data;
|
|
|
+ const processedData = this.processTreeData(treedata);
|
|
|
+ this.parentOpt = processedData;
|
|
|
+ this.defaultdata = res.data[0];
|
|
|
+ },
|
|
|
+
|
|
|
+ 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 {
|
|
|
+ const dataMapList = data.children;
|
|
|
+ dataMapList.forEach((element) => {
|
|
|
+ console.log(element);
|
|
|
+ if (
|
|
|
+ this.parseCoordinates(element.longitudeAndLatitudeString).length >
|
|
|
+ 0 &&
|
|
|
+ element.codeType === "field"
|
|
|
+ ) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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;
|
|
|
+ });
|
|
|
+ },
|
|
|
+// 更新父组件的 currentIndex
|
|
|
handleCurrentIndexUpdate(newIndex) {
|
|
|
this.currentIndex = newIndex;
|
|
|
+ this.setCurrentRowData(newIndex)
|
|
|
},
|
|
|
+
|
|
|
+ // 当前所在行高亮提示
|
|
|
setCurrent(row) {
|
|
|
- this.$nextTick(() => {
|
|
|
- if (this.$refs.singleTable) {
|
|
|
- this.$refs.singleTable.setCurrentRow(row); // 设置当前行
|
|
|
- } else {
|
|
|
- console.warn("Cannot access $refs.singleTable: it's undefined.");
|
|
|
- }
|
|
|
- });
|
|
|
+ this.$refs.singleTable.setCurrentRow(row);
|
|
|
},
|
|
|
+ // 当前单选
|
|
|
handleCurrentChange(val) {
|
|
|
- this.currentRow = val; // 处理当前选中行
|
|
|
- const index = this.tableData.indexOf(val); // 获取当前选中行的索引
|
|
|
+ this.currentRow = val;
|
|
|
+ const index = this.tableData.indexOf(val);
|
|
|
this.currentIndex = index; // 更新当前索引
|
|
|
- console.log("currentIndex updated to:", this.currentIndex);
|
|
|
},
|
|
|
|
|
|
+
|
|
|
generate(type) {
|
|
|
if (!this.currentRow) {
|
|
|
this.$message.warning("请先选择数据");
|
|
@@ -240,7 +344,6 @@ export default {
|
|
|
1: "时域图", // Time Domain Chart
|
|
|
2: "频谱图", // Spectrogram Chart
|
|
|
3: "包络谱图", // Envelope Spectrum Chart
|
|
|
-
|
|
|
};
|
|
|
|
|
|
const chartName = nameMap[type];
|
|
@@ -252,6 +355,19 @@ 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) => {});
|
|
|
},
|
|
|
|
|
|
tendency() {
|
|
@@ -267,9 +383,34 @@ export default {
|
|
|
this.fourList.push(newItem);
|
|
|
},
|
|
|
|
|
|
+ // // 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 = {
|
|
|
+ endTime: "2024-07-02 00:00:00",
|
|
|
+ mesureNameList: ["gearbox_input_end_radial_vibration"],
|
|
|
+ startTime: "2024-07-01 00:00:00",
|
|
|
+ windCode: "SKF001",
|
|
|
+ windTurbineNumberList: ["F004"],
|
|
|
+ };
|
|
|
|
|
|
+ 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
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
-
|
|
|
// 缩小
|
|
|
lessen(index) {
|
|
|
if (!this.fourList[index].isMinimized) {
|
|
@@ -391,13 +532,4 @@ export default {
|
|
|
height: 0px; /* Adjust height when minimized */
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
-
|
|
|
-#main {
|
|
|
- width: 100%;
|
|
|
- height: 280px;
|
|
|
-}
|
|
|
-
|
|
|
-// .line-chart {
|
|
|
-// position: relative;
|
|
|
-// }
|
|
|
</style>
|