|
@@ -1,24 +1,23 @@
|
|
<template>
|
|
<template>
|
|
<div class="global-variable">
|
|
<div class="global-variable">
|
|
- <div class="head">
|
|
|
|
- <ul>
|
|
|
|
- <li
|
|
|
|
- v-for="(item, index) in menuItems"
|
|
|
|
- :key="index"
|
|
|
|
- @click="activeTab = item.component"
|
|
|
|
- :class="{ active: activeTab === item.component }"
|
|
|
|
- >
|
|
|
|
- <span class="Simg"><img :src="item.icon" :alt="item.name" /></span>
|
|
|
|
- <span>{{ item.name }}</span>
|
|
|
|
- </li>
|
|
|
|
- </ul>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <!-- tab 切换 -->
|
|
|
|
+ <el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
|
+ <el-tab-pane
|
|
|
|
+ v-for="item in menuItems"
|
|
|
|
+ :key="item.component"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ :name="item.component"
|
|
|
|
+ >
|
|
|
|
+
|
|
|
|
+ </el-tab-pane>
|
|
|
|
+ </el-tabs>
|
|
|
|
|
|
|
|
+ <!-- 查询条件 -->
|
|
<div class="searchbox">
|
|
<div class="searchbox">
|
|
<p>
|
|
<p>
|
|
单位:
|
|
单位:
|
|
<selecttree
|
|
<selecttree
|
|
- size="small"
|
|
|
|
|
|
+ size="small"
|
|
style="width: 180px"
|
|
style="width: 180px"
|
|
placeholder="请选择所属公司"
|
|
placeholder="请选择所属公司"
|
|
:list="parentOpt"
|
|
:list="parentOpt"
|
|
@@ -30,13 +29,12 @@
|
|
label: 'companyName',
|
|
label: 'companyName',
|
|
value: 'codeNumber',
|
|
value: 'codeNumber',
|
|
}"
|
|
}"
|
|
- >
|
|
|
|
- </selecttree>
|
|
|
|
|
|
+ />
|
|
</p>
|
|
</p>
|
|
<p>
|
|
<p>
|
|
风机:
|
|
风机:
|
|
<el-select
|
|
<el-select
|
|
- size="small"
|
|
|
|
|
|
+ size="small"
|
|
style="width: 150px"
|
|
style="width: 150px"
|
|
v-model="unitvalue"
|
|
v-model="unitvalue"
|
|
@change="getchedian"
|
|
@change="getchedian"
|
|
@@ -47,52 +45,56 @@
|
|
:key="item.engineCode"
|
|
:key="item.engineCode"
|
|
:label="item.engineName"
|
|
:label="item.engineName"
|
|
:value="item.engineCode"
|
|
:value="item.engineCode"
|
|
- >
|
|
|
|
- </el-option>
|
|
|
|
|
|
+ />
|
|
</el-select>
|
|
</el-select>
|
|
</p>
|
|
</p>
|
|
<p>
|
|
<p>
|
|
测点:
|
|
测点:
|
|
- <el-select v-model="monitoringvalue" size="small" clearable placeholder="请选择">
|
|
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="monitoringvalue"
|
|
|
|
+ size="small"
|
|
|
|
+ clearable
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
<el-option
|
|
<el-option
|
|
v-for="item in monitoringoptions"
|
|
v-for="item in monitoringoptions"
|
|
:key="item.detectionPointEn"
|
|
:key="item.detectionPointEn"
|
|
:label="item.detectionPointCn"
|
|
:label="item.detectionPointCn"
|
|
:value="item.detectionPointEn"
|
|
:value="item.detectionPointEn"
|
|
- >
|
|
|
|
- </el-option>
|
|
|
|
|
|
+ />
|
|
</el-select>
|
|
</el-select>
|
|
</p>
|
|
</p>
|
|
<p>
|
|
<p>
|
|
- 频率:
|
|
|
|
- <el-select v-model="frequencyvalue" size="small" clearable placeholder="请选择">
|
|
|
|
|
|
+ 采样频率:
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="frequencyvalue"
|
|
|
|
+ size="small"
|
|
|
|
+ clearable
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
<el-option
|
|
<el-option
|
|
v-for="item in frequencyoptions"
|
|
v-for="item in frequencyoptions"
|
|
:key="item"
|
|
:key="item"
|
|
:label="item"
|
|
:label="item"
|
|
:value="item"
|
|
:value="item"
|
|
- >
|
|
|
|
- </el-option>
|
|
|
|
|
|
+ />
|
|
</el-select>
|
|
</el-select>
|
|
</p>
|
|
</p>
|
|
<p>
|
|
<p>
|
|
时间:
|
|
时间:
|
|
<el-date-picker
|
|
<el-date-picker
|
|
- size="small"
|
|
|
|
|
|
+ size="small"
|
|
v-model="timevalue"
|
|
v-model="timevalue"
|
|
type="datetimerange"
|
|
type="datetimerange"
|
|
range-separator="至"
|
|
range-separator="至"
|
|
start-placeholder="开始日期"
|
|
start-placeholder="开始日期"
|
|
end-placeholder="结束日期"
|
|
end-placeholder="结束日期"
|
|
- >
|
|
|
|
- </el-date-picker>
|
|
|
|
|
|
+ />
|
|
</p>
|
|
</p>
|
|
- <el-button type="primary" size="small" @click="conditions(1)"
|
|
|
|
- >查询</el-button
|
|
|
|
- >
|
|
|
|
- <!-- <el-button type="primary" size="small">自动诊断</el-button> -->
|
|
|
|
|
|
+ <el-button type="primary" size="small" @click="conditions(1)">查询</el-button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
+ <!-- 动态组件内容 -->
|
|
<div class="main-body">
|
|
<div class="main-body">
|
|
<keep-alive>
|
|
<keep-alive>
|
|
<component
|
|
<component
|
|
@@ -106,23 +108,24 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
-
|
|
|
|
- <script>
|
|
|
|
-import * as FileSaver from "file-saver";
|
|
|
|
-import * as XLSX from "xlsx";
|
|
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import * as FileSaver from 'file-saver'
|
|
|
|
+import * as XLSX from 'xlsx'
|
|
import {
|
|
import {
|
|
getSysOrganizationAuthTreeByRoleId,
|
|
getSysOrganizationAuthTreeByRoleId,
|
|
windEngineGrouPage,
|
|
windEngineGrouPage,
|
|
queryDetectionDic,
|
|
queryDetectionDic,
|
|
-} from "@/api/ledger.js";
|
|
|
|
-import selecttree from "../../components/selecttree.vue";
|
|
|
|
-import Bearing from "./components/malfunction/bearing.vue";
|
|
|
|
-import Dissymmetry from "./components/malfunction/dissymmetry.vue";
|
|
|
|
-import Gear from "./components/malfunction/gear.vue";
|
|
|
|
-import Loose from "./components/malfunction/loose.vue";
|
|
|
|
-import Misalignment from "./components/malfunction/misalignment.vue";
|
|
|
|
-import Temperature from "./components/malfunction/temperature.vue";
|
|
|
|
-import axios from "axios";
|
|
|
|
|
|
+} from '@/api/ledger.js'
|
|
|
|
+import selecttree from '../../components/selecttree.vue'
|
|
|
|
+import Bearing from './components/malfunction/bearing.vue'
|
|
|
|
+import Dissymmetry from './components/malfunction/dissymmetry.vue'
|
|
|
|
+import Gear from './components/malfunction/gear.vue'
|
|
|
|
+import Loose from './components/malfunction/loose.vue'
|
|
|
|
+import Misalignment from './components/malfunction/misalignment.vue'
|
|
|
|
+import Temperature from './components/malfunction/temperature.vue'
|
|
|
|
+import axios from 'axios'
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
selecttree,
|
|
selecttree,
|
|
@@ -135,172 +138,168 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- activeTab: "Bearing", // 默认显示轴承诊断
|
|
|
|
|
|
+ activeTab: 'Bearing',
|
|
|
|
+ activeName: 'Bearing', // el-tabs 控制当前 tab
|
|
|
|
+
|
|
menuItems: [
|
|
menuItems: [
|
|
{
|
|
{
|
|
- name: "轴承诊断",
|
|
|
|
- icon: require("@/assets/img/ZC.png"),
|
|
|
|
- component: "Bearing",
|
|
|
|
|
|
+ name: '轴承诊断',
|
|
|
|
+ icon: require('@/assets/img/ZC.png'),
|
|
|
|
+ component: 'Bearing',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- name: "齿轮诊断",
|
|
|
|
- icon: require("@/assets/img/SZ.png"),
|
|
|
|
- component: "Gear",
|
|
|
|
|
|
+ name: '齿轮诊断',
|
|
|
|
+ icon: require('@/assets/img/SZ.png'),
|
|
|
|
+ component: 'Gear',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- name: "不对中诊断",
|
|
|
|
- icon: require("@/assets/img/DZ.png"),
|
|
|
|
- component: "Dissymmetry",
|
|
|
|
|
|
+ name: '不对中诊断',
|
|
|
|
+ icon: require('@/assets/img/DZ.png'),
|
|
|
|
+ component: 'Dissymmetry',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- name: "不平衡诊断",
|
|
|
|
- icon: require("@/assets/img/DC.png"),
|
|
|
|
- component: "Misalignment",
|
|
|
|
|
|
+ name: '不平衡诊断',
|
|
|
|
+ icon: require('@/assets/img/DC.png'),
|
|
|
|
+ component: 'Misalignment',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- name: "松动诊断",
|
|
|
|
- icon: require("@/assets/img/SD.png"),
|
|
|
|
- component: "Loose",
|
|
|
|
|
|
+ name: '松动诊断',
|
|
|
|
+ icon: require('@/assets/img/SD.png'),
|
|
|
|
+ component: 'Loose',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- name: "温度诊断",
|
|
|
|
- icon: require("@/assets/img/WD.png"),
|
|
|
|
- component: "Temperature",
|
|
|
|
|
|
+ name: '温度诊断',
|
|
|
|
+ icon: require('@/assets/img/WD.png'),
|
|
|
|
+ component: 'Temperature',
|
|
},
|
|
},
|
|
],
|
|
],
|
|
- unitvalue: "",
|
|
|
|
|
|
+
|
|
|
|
+ unitvalue: '',
|
|
unitoptions: [],
|
|
unitoptions: [],
|
|
- companyCode: "",
|
|
|
|
|
|
+ companyCode: '',
|
|
parentOpt: [],
|
|
parentOpt: [],
|
|
timevalue: [],
|
|
timevalue: [],
|
|
- startTime: "",
|
|
|
|
- endTime: "",
|
|
|
|
- monitoringvalue: "",
|
|
|
|
|
|
+ startTime: '',
|
|
|
|
+ endTime: '',
|
|
|
|
+ monitoringvalue: '',
|
|
monitoringoptions: [],
|
|
monitoringoptions: [],
|
|
-
|
|
|
|
- frequencyvalue: "",
|
|
|
|
|
|
+ frequencyvalue: '',
|
|
frequencyoptions: [],
|
|
frequencyoptions: [],
|
|
-
|
|
|
|
codedata: [],
|
|
codedata: [],
|
|
totalCount: 0,
|
|
totalCount: 0,
|
|
totalPage: 0,
|
|
totalPage: 0,
|
|
- page: "",
|
|
|
|
- };
|
|
|
|
|
|
+ page: '',
|
|
|
|
+ }
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- this.GETtree();
|
|
|
|
|
|
+ this.GETtree()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ handleClick(tab) {
|
|
|
|
+ this.activeTab = tab.name
|
|
|
|
+ },
|
|
async GETtree() {
|
|
async GETtree() {
|
|
- const res = await getSysOrganizationAuthTreeByRoleId();
|
|
|
|
- const treedata = res.data;
|
|
|
|
- const processedData = this.processTreeData(treedata);
|
|
|
|
- this.parentOpt = processedData;
|
|
|
|
- this.defaultdata = res.data[0];
|
|
|
|
|
|
+ const res = await getSysOrganizationAuthTreeByRoleId()
|
|
|
|
+ const treedata = res.data
|
|
|
|
+ const processedData = this.processTreeData(treedata)
|
|
|
|
+ this.parentOpt = processedData
|
|
|
|
+ this.defaultdata = res.data[0]
|
|
},
|
|
},
|
|
- // 获取所属单位
|
|
|
|
parentChange(data) {
|
|
parentChange(data) {
|
|
- this.maplist = data;
|
|
|
|
- this.maplistArr = data;
|
|
|
|
|
|
+ this.maplist = data
|
|
|
|
+ this.maplistArr = data
|
|
|
|
|
|
- // 1. 检查关键数据
|
|
|
|
if (!this.maplist?.codeNumber) {
|
|
if (!this.maplist?.codeNumber) {
|
|
- console.error("codeNumber 不存在!");
|
|
|
|
- return;
|
|
|
|
|
|
+ console.error('codeNumber 不存在!')
|
|
|
|
+ return
|
|
}
|
|
}
|
|
|
|
|
|
- // 2. 发起第一个请求
|
|
|
|
- let paramsData = {
|
|
|
|
|
|
+ const paramsData = {
|
|
fieldCode: this.maplist.codeNumber,
|
|
fieldCode: this.maplist.codeNumber,
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 99,
|
|
pageSize: 99,
|
|
- };
|
|
|
|
- this.unitvalue = "";
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.unitvalue = ''
|
|
|
|
|
|
windEngineGrouPage(paramsData)
|
|
windEngineGrouPage(paramsData)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- this.unitoptions = res.data.list;
|
|
|
|
- this.windCode = this.companyCode;
|
|
|
|
|
|
+ this.unitoptions = res.data.list
|
|
|
|
+ this.windCode = this.companyCode
|
|
})
|
|
})
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
- console.error("windEngineGrouPage 失败:", err);
|
|
|
|
- });
|
|
|
|
|
|
+ console.error('windEngineGrouPage 失败:', err)
|
|
|
|
+ })
|
|
|
|
|
|
- // 3. 解析坐标逻辑(避免 return 终止函数)
|
|
|
|
- let shouldSkip = false;
|
|
|
|
|
|
+ let shouldSkip = false
|
|
try {
|
|
try {
|
|
- if (data.codeType === "field") {
|
|
|
|
|
|
+ if (data.codeType === 'field') {
|
|
if (
|
|
if (
|
|
this.parseCoordinates(data.longitudeAndLatitudeString).length > 0
|
|
this.parseCoordinates(data.longitudeAndLatitudeString).length > 0
|
|
) {
|
|
) {
|
|
- shouldSkip = true;
|
|
|
|
|
|
+ shouldSkip = true
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
data.children?.forEach((element) => {
|
|
data.children?.forEach((element) => {
|
|
if (
|
|
if (
|
|
- element.codeType === "field" &&
|
|
|
|
|
|
+ element.codeType === 'field' &&
|
|
this.parseCoordinates(element.longitudeAndLatitudeString).length >
|
|
this.parseCoordinates(element.longitudeAndLatitudeString).length >
|
|
0
|
|
0
|
|
) {
|
|
) {
|
|
- shouldSkip = true;
|
|
|
|
|
|
+ shouldSkip = true
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ })
|
|
}
|
|
}
|
|
} catch (err) {
|
|
} catch (err) {
|
|
- console.error("解析坐标出错:", err);
|
|
|
|
|
|
+ console.error('解析坐标出错:', err)
|
|
}
|
|
}
|
|
|
|
|
|
if (shouldSkip) {
|
|
if (shouldSkip) {
|
|
- console.log("坐标已存在,跳过部分逻辑");
|
|
|
|
|
|
+ console.log('坐标已存在,跳过部分逻辑')
|
|
}
|
|
}
|
|
|
|
|
|
- // 4. 确保第二个请求执行
|
|
|
|
axios
|
|
axios
|
|
.get(
|
|
.get(
|
|
`/ETLapi/waveData/getAllSamplingFrequency/${this.maplist.codeNumber}`
|
|
`/ETLapi/waveData/getAllSamplingFrequency/${this.maplist.codeNumber}`
|
|
)
|
|
)
|
|
-
|
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- this.frequencyoptions = res.data.datas;
|
|
|
|
|
|
+ this.frequencyoptions = res.data.datas
|
|
})
|
|
})
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
- console.error("第二个请求失败:", err);
|
|
|
|
- });
|
|
|
|
|
|
+ console.error('第二个请求失败:', err)
|
|
|
|
+ })
|
|
},
|
|
},
|
|
processTreeData(treeData) {
|
|
processTreeData(treeData) {
|
|
- const processedData = [];
|
|
|
|
|
|
+ const processedData = []
|
|
function processNode(node) {
|
|
function processNode(node) {
|
|
- if (node.codeType === "field") {
|
|
|
|
- node.companyName = node.fieldName;
|
|
|
|
|
|
+ if (node.codeType === 'field') {
|
|
|
|
+ node.companyName = node.fieldName
|
|
}
|
|
}
|
|
if (node.children && node.children.length > 0) {
|
|
if (node.children && node.children.length > 0) {
|
|
node.children.forEach((child) => {
|
|
node.children.forEach((child) => {
|
|
- processNode(child);
|
|
|
|
- });
|
|
|
|
|
|
+ processNode(child)
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
treeData.forEach((root) => {
|
|
treeData.forEach((root) => {
|
|
- processNode(root);
|
|
|
|
- processedData.push(root);
|
|
|
|
- });
|
|
|
|
- return processedData;
|
|
|
|
|
|
+ processNode(root)
|
|
|
|
+ processedData.push(root)
|
|
|
|
+ })
|
|
|
|
+ return processedData
|
|
},
|
|
},
|
|
parseCoordinates(input) {
|
|
parseCoordinates(input) {
|
|
- if (input && typeof input === "string") {
|
|
|
|
- return input.split(",").map(Number);
|
|
|
|
|
|
+ if (input && typeof input === 'string') {
|
|
|
|
+ return input.split(',').map(Number)
|
|
}
|
|
}
|
|
- return [];
|
|
|
|
|
|
+ return []
|
|
},
|
|
},
|
|
- // 风机
|
|
|
|
getchedian(value) {
|
|
getchedian(value) {
|
|
queryDetectionDic({ engineCodes: value }).then((res) => {
|
|
queryDetectionDic({ engineCodes: value }).then((res) => {
|
|
- this.monitoringoptions = res.data;
|
|
|
|
- });
|
|
|
|
|
|
+ this.monitoringoptions = res.data
|
|
|
|
+ })
|
|
},
|
|
},
|
|
handlePageChange(page) {
|
|
handlePageChange(page) {
|
|
- console.log(`接收到的当前页: ${page}`);
|
|
|
|
- // 更新当前页
|
|
|
|
- this.conditions(page); // 调用条件方法时传递页码
|
|
|
|
|
|
+ this.conditions(page)
|
|
},
|
|
},
|
|
conditions(page) {
|
|
conditions(page) {
|
|
const params = {
|
|
const params = {
|
|
@@ -311,17 +310,17 @@ export default {
|
|
startTime: this.$formatDateTWO(this.timevalue[0]),
|
|
startTime: this.$formatDateTWO(this.timevalue[0]),
|
|
endTime: this.$formatDateTWO(this.timevalue[1]),
|
|
endTime: this.$formatDateTWO(this.timevalue[1]),
|
|
pageNo: page,
|
|
pageNo: page,
|
|
- pageSize: 10,
|
|
|
|
- };
|
|
|
|
|
|
+ pageSize: 20,
|
|
|
|
+ }
|
|
|
|
|
|
axios.post(`/ETLapi/waveData/getMesureDataWithSF`, params).then((res) => {
|
|
axios.post(`/ETLapi/waveData/getMesureDataWithSF`, params).then((res) => {
|
|
- this.codedata = res.data.datas;
|
|
|
|
- this.totalCount = res.data.totalCount;
|
|
|
|
- this.totalPage = res.data.totalPage;
|
|
|
|
- });
|
|
|
|
|
|
+ this.codedata = res.data.datas
|
|
|
|
+ this.totalCount = res.data.totalCount
|
|
|
|
+ this.totalPage = res.data.totalPage
|
|
|
|
+ })
|
|
},
|
|
},
|
|
},
|
|
},
|
|
-};
|
|
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|