设备详情数据接口对接与样式更新

This commit is contained in:
zhangjunwen 2024-10-12 14:46:00 +08:00
parent 05af698650
commit d33a19bcc1
3 changed files with 374 additions and 186 deletions

View File

@ -112,3 +112,12 @@ export function getWorkData(params) {
params: params,
});
}
// 根据设备id获取最新数据
export function getAllNewestData(params) {
return request({
url: "/data/query/getAllNewestData",
method: "get",
params: params,
});
}

View File

@ -183,7 +183,10 @@
label="故障类型"
>
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.FAULT_TYPE" :value="scope.row.faultType"/>
<dict-tag
:type="DICT_TYPE.FAULT_TYPE"
:value="scope.row.faultType"
/>
</template>
</el-table-column>
<el-table-column
@ -191,7 +194,10 @@
label="进度"
>
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.MAINTENANCE_STATUS" :value="scope.row.status"/>
<dict-tag
:type="DICT_TYPE.MAINTENANCE_STATUS"
:value="scope.row.status"
/>
</template>
</el-table-column>
</el-table>
@ -238,14 +244,14 @@ import {
getMaintenanceOrderCount,
getAlarmList,
getCustomerDistribution,
getCustomerDistributionByProvinceCode
} from '@/api/system/largeScreen/largeScreen';
getCustomerDistributionByProvinceCode,
} from "@/api/system/largeScreen/largeScreen";
import { DICT_TYPE } from "@/utils/dict";
export default {
computed: {
DICT_TYPE() {
return DICT_TYPE
}
return DICT_TYPE;
},
},
data() {
return {
@ -255,7 +261,7 @@ export default {
dataCount: {
customerCount: 0,
equipCount: 0,
onlineEquipCount: 0
onlineEquipCount: 0,
},
loading1: false,
equipList: [],
@ -281,24 +287,24 @@ export default {
},
methods: {
initData() {
getEquipInfoList().then(res=>{
getEquipInfoList().then((res) => {
this.equipList = res.data;
})
getDataCount().then(res=>{
});
getDataCount().then((res) => {
this.dataCount = res.data;
})
getMaintenanceOrder().then(res => {
this.maintenanceList = res.data;
})
getMaintenanceOrderCount().then(res=>{
this.orderList = res.data
})
getAlarmList().then(res=>{
this.alarmList = res.data
})
getFaultDataList().then(res=>{
});
getMaintenanceOrder().then((res) => {
this.maintenanceList = _.take(res.data, 3);
});
getMaintenanceOrderCount().then((res) => {
this.orderList = res.data;
});
getAlarmList().then((res) => {
this.alarmList = res.data;
});
getFaultDataList().then((res) => {
this.faultList = res.data;
})
});
},
closePanel() {
this.showPanel = false;
@ -310,60 +316,60 @@ export default {
return "fault-mark" + (index + 1);
},
async getFaultChart() {
await getFaultDataList().then(res=>{
await getFaultDataList().then((res) => {
this.faultList = res.data;
})
});
this.initFaultChart(this.faultList);
},
initFaultChart(data) {
let p = new Promise((resolve) => {
resolve();
});
let chartData = []
data.forEach(item=>{
let chartData = [];
data.forEach((item) => {
const fault = {
name: item.faultLabel,
value: item.faultCount
value: item.faultCount,
};
chartData.push(fault)
})
chartData.push(fault);
});
p.then(() => {
this.faultChart = echarts.init(this.$refs.faultChart);
let option = {
tooltip: {
trigger: 'item'
trigger: "item",
},
legend: {
orient: 'vertical',
orient: "vertical",
right: 10,
top: 'center',
top: "center",
textStyle: {
color:'#fff'
}
color: "#fff",
},
},
series: [
{
name: 'Access From',
type: 'pie',
radius: ['40%', '70%'],
name: "Access From",
type: "pie",
radius: ["40%", "70%"],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
position: "center",
},
emphasis: {
label: {
show: false,
fontSize: 40,
fontWeight: 'bold'
}
fontWeight: "bold",
},
},
labelLine: {
show: false
show: false,
},
data: chartData
}
]
data: chartData,
},
],
};
this.faultChart.setOption(option);
});
@ -372,9 +378,9 @@ export default {
async getAlarmCharts() {
// let chart1 = echarts.init(this.$refs.chart1);
// chart1.showLoading();
await getAlarmDataList().then(res=>{
await getAlarmDataList().then((res) => {
this.alarmData = res.data;
})
});
this.initAlarmCharts(this.alarmData);
},
initAlarmCharts(data) {
@ -454,9 +460,9 @@ export default {
});
},
async getCompanyAndEquipGrowTrend() {
await getCompanyAndEquipCreate().then(res => {
await getCompanyAndEquipCreate().then((res) => {
this.companyAndEquipCreate = res.data;
})
});
this.initTrendChart(this.companyAndEquipCreate);
},
initTrendChart(data) {
@ -638,7 +644,7 @@ export default {
this.provinceName.push(e.provinceName);
});
}
})
});
// // console.log("selectData:", selectData);
// // console.log("showdata:", showdata);
// });
@ -792,9 +798,9 @@ export default {
var panel = document.getElementById("popPanel");
panel.style.left = dx + "px";
panel.style.top = dy + "px";
getCustomerDistributionByProvinceCode(e.data.code).then(res=>{
getCustomerDistributionByProvinceCode(e.data.code).then((res) => {
this.customerEquNumList = res.data;
})
});
}
});
});

View File

@ -60,7 +60,10 @@
<div>{{ item.value }}</div>
</div>
</div>
<div v-if="!techParamsList.length" style="text-align: center">
<div
v-if="!techParamsList.length"
style="text-align: center"
>
暂无数据
</div>
</div>
@ -76,28 +79,28 @@
<div class="status-info">
<div class="status-detail">
<span class="status-title">加工总件数</span>
<span><span class="status-num">118</span><span class="status-title"> </span></span>
<span><span class="status-num">{{ totalProcess }}</span><span class="status-title"> </span></span>
</div>
<span class="total-icon"></span>
</div>
<div class="status-info">
<div class="status-detail">
<span class="status-title">加工时长</span>
<span><span class="status-num">2.5</span><span class="status-title"> 小时</span></span>
<span><span class="status-num">{{workTime}}</span><span class="status-title"> 小时</span></span>
</div>
<span class="time-icon"></span>
</div>
<div class="status-info">
<div class="status-detail">
<span class="status-title">通电时间</span>
<span class="status-num">13:00:00</span>
<span><span class="status-num">{{powerTime}}</span><span class="status-title"> 小时</span></span>
</div>
<span class="power-icon"></span>
</div>
<div class="status-info">
<div class="status-detail">
<span class="status-title">加工件数</span>
<span><span class="status-num">36</span><span class="status-title"> </span></span>
<span><span class="status-num">{{processNum}}</span><span class="status-title"> </span></span>
</div>
<span class="work-icon"></span>
</div>
@ -173,59 +176,79 @@
<div>
<el-row>
<el-col
:span="6"
style="height: 100%"
:span="12"
style="height: 100%; text-align: -webkit-center;"
>
<div
id="xtxdl"
style="height: 90%"
></div>
<div style="height:10%;text-align: center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>X轴推屑电流</span></div>
<div style="height:10%;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>推屑1电流</span></div>
</el-col>
<el-col
:span="6"
style="height: 100%"
:span="12"
style="height: 100%;text-align: -webkit-center;"
>
<div
id="ytxdl"
style="height: 90%"
></div>
<div style="height:10%;text-align: center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>Y轴推屑电流</span></div>
<div style="height:10%;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>推屑2电流</span></div>
</el-col>
<el-col
:span="6"
style="height: 100%"
<!-- <el-col
:span="8"
style="height: 100%;text-align: -webkit-center;"
>
<div
id="yzdsz"
style="height: 90%"
></div>
<div style="height:10%;text-align: center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>Y轴振动熵值</span></div>
</el-col>
<el-col
:span="6"
<div style="height:10%;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>液压1</span></div>
</el-col> -->
<!-- <el-col
:span="8"
style="height: 100%"
>
<div
id="ymczs"
style="height: 90%"
></div>
<div style="height:10%;text-align: center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>Y轴脉冲振动指数</span></div>
</el-col>
<div style="height:10%;text-align: center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>液压2</span></div>
</el-col> -->
</el-row>
</div>
<div> <el-row>
<el-col
:span="8"
style="height: 100%"
style="height: 100%;text-align: -webkit-center;"
>
<div
id="yzdsz"
style="height: 90%"
></div>
<div style="height:10%;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>液压1</span></div>
</el-col>
<el-col
:span="8"
style="height: 100%;text-align: -webkit-center;"
>
<div
id="ymczs"
style="height: 90%"
></div>
<div style="height:10%;text-align: center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>液压2</span></div>
</el-col>
<el-col
:span="8"
style="height: 100%;text-align: -webkit-center;"
>
<div
id="xrhyy"
style="height: 90%"
></div>
<div style="height:10%;text-align: center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>Y轴脉冲振动指数</span></div>
<div style="height:10%;text-align: center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>液压3</span></div>
</el-col>
<el-col
<!-- <el-col
:span="8"
style="height: 100%"
>
@ -244,39 +267,123 @@
style="height: 90%"
></div>
<div style="height:10%;text-align: center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>Y轴脉冲振动指数</span></div>
</el-col>
</el-col> -->
</el-row></div>
<div class="equip_icon"></div>
<!-- <div class="equip_icon"></div> -->
<div>
<el-col
:span="6"
style="height: 100%"
>
<div
id="xptemp"
style="height: 90%"
></div>
<div style="text-align:center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>X+温度</span></div>
</el-col>
<el-col
:span="6"
style="height: 100%"
>
<div
id="xntemp"
style="height: 90%"
></div>
<div style="text-align:center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>X-温度</span></div>
</el-col>
<el-col
:span="6"
style="height: 100%"
>
<div
id="x0temp"
style="height: 90%"
></div>
<div style="text-align:center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>X0温度</span></div>
</el-col>
<el-col
:span="6"
style="height: 100%"
>
<div
id="yptemp"
style="height: 90%"
></div>
<div style="text-align:center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>Y+温度</span></div>
</el-col>
</div>
<div>
<el-col
:span="6"
style="height: 100%"
>
<div
id="yntemp"
style="height: 90%"
></div>
<div style="text-align:center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>Y-温度</span></div>
</el-col>
<el-col
:span="6"
style="height: 100%"
>
<div
id="y0temp"
style="height: 90%"
></div>
<div style="text-align:center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>Y0温度</span></div>
</el-col>
<el-col
:span="6"
style="height: 100%"
>
<div
id="zptemp"
style="height: 90%"
></div>
<div style="text-align:center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>Z+温度</span></div>
</el-col>
<el-col
:span="6"
style="height: 100%"
>
<div
id="zntemp"
style="height: 90%"
></div>
<div style="text-align:center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>Z-温度</span></div>
</el-col>
</div>
<div>
<el-col
:span="8"
style="height: 100%"
>
<div
id="xzzcwd"
id="z0temp"
style="height: 90%"
></div>
<div style="height:10%;text-align:center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>X轴轴承温度</span></div>
<div style="margin-right:15%;text-align:center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>Z0温度</span></div>
</el-col>
<el-col
:span="8"
style="height: 100%;"
>
<div
id="cr1temp"
style="height: 90%"
></div>
<div style="margin-right:13%;text-align:center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>排屑1温度</span></div>
</el-col>
<el-col
:span="8"
style="height: 100%"
>
<div
id="yzzcwd"
id="cr2temp"
style="height: 90%"
></div>
<div style="height:10%;text-align:center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>Y轴轴承温度</span></div>
</el-col>
<el-col
:span="8"
style="height: 100%"
>
<div
id="zzzcwd"
style="height: 90%"
></div>
<div style="height:10%;text-align:center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>Z轴轴承温度</span></div>
<div style="margin-right:13%;text-align:center;font-size: 16px;color:#26DE86"><span style='cursor:pointer;'>排屑2温度</span></div>
</el-col>
</div>
</div>
@ -342,9 +449,16 @@
import { merge } from "lodash";
import * as EquipAlarmDataApi from "@/api/system/alarm/equipalarmdata";
import * as echarts from "echarts";
import {getEquipCascader, getEquipInfoDetails} from "@/api/system/equip/equipInfo";
import {getAlarmCountByEquipId, getAlarmDataTimeLineByEquipId} from "@/api/system/alarm/alarmdata";
import {
getEquipCascader,
getEquipInfoDetails,
} from "@/api/system/equip/equipInfo";
import {
getAlarmCountByEquipId,
getAlarmDataTimeLineByEquipId,
} from "@/api/system/alarm/alarmdata";
import { getMaintenanceCountByEquipId } from "@/api/system/maintenance/maintenance";
import { getAllNewestData } from "@/api/data/query.js";
export default {
name: "EquipDetail2",
dicts: ["equip_tags", "equip_class", "equip_status"],
@ -366,6 +480,15 @@ export default {
echarts6: null,
echarts7: null,
timeLineList: [],
currentData: null,
hyData: null,
tempData: null,
aclrData: null,
fanucData: null,
totalProcess: 0,
workTime: 0.0,
powerTime: 0.0,
processNum: 0,
};
},
created() {
@ -373,21 +496,20 @@ export default {
this.initEquipDetails();
},
mounted() {
this.initCharts();
this.initTempCharts();
// this.initTempCharts();
},
computed: {},
watch: {},
methods: {
initEquipDetails() {
getEquipCascader().then(res=>{
res.forEach(item=>{
getEquipCascader().then((res) => {
res.forEach((item) => {
if (item.children == null) {
item.disabled = true;
} else {
item.disabled = false;
}
})
});
this.options = res;
if (this.$route.query.equipId != null) {
this.cascaderValue = this.$route.query.equipId;
@ -395,46 +517,64 @@ export default {
this.getAlarmCountByEquipId(this.$route.query.equipId);
this.getMaintenanceCountByEquipId(this.$route.query.equipId);
this.getAlarmDataTimeLineByEquipId(this.$route.query.equipId);
this.getAllData(this.$route.query.equipId);
this.cascaderDisabled = true;
} else {
this.options.every(item => {
this.options.every((item) => {
if (item.disabled === false) {
this.cascaderValue = item.children[0].id;
this.getEquipDetails(item.children[0].id);
this.getAlarmCountByEquipId(item.children[0].id);
this.getMaintenanceCountByEquipId(item.children[0].id);
this.getAlarmDataTimeLineByEquipId(item.children[0].id);
this.getAllData(item.children[0].id);
this.cascaderDisabled = false;
return false;
}
})
});
}
})
});
},
//
getMaintenanceCountByEquipId(equipId) {
getMaintenanceCountByEquipId(equipId).then(res=>{
getMaintenanceCountByEquipId(equipId).then((res) => {
this.faultTimes = res.data;
})
});
},
//
getAlarmCountByEquipId(equipId) {
getAlarmCountByEquipId(equipId).then(res=>{
getAlarmCountByEquipId(equipId).then((res) => {
this.alarmTimes = res.data;
})
});
},
//
getAlarmDataTimeLineByEquipId(equipId) {
getAlarmDataTimeLineByEquipId(equipId).then(res=>{
getAlarmDataTimeLineByEquipId(equipId).then((res) => {
this.timeLineList = res.data;
})
});
},
//
getAllData(equipId) {
getAllNewestData({ equipId: equipId }).then((res) => {
this.currentData = res.data.current;
this.hyData = res.data.hy;
this.tempData = res.data.temp;
this.aclrData = res.data.aclr;
this.fanucData = res.data.fanuc;
this.totalProcess = this.fanucData.total_process;
this.workTime = (this.fanucData.work_time / 60.0).toFixed(1);
this.powerTime = (this.fanucData.power_time / 60.0).toFixed(1);
this.processNum = this.fanucData.process_num;
this.initCharts();
this.initTempCharts();
});
},
getEquipDetails(id) {
getEquipInfoDetails(id).then(res => {
getEquipInfoDetails(id).then((res) => {
console.log("res.data", res.data);
this.equipInfo = res.data;
this.techParamsList = res.data.paramList;
})
});
},
async getEquipAlarmList() {
var equipAlarmQuery = {
@ -449,10 +589,11 @@ export default {
},
handleChange(value) {
if (value.length > 0) {
this.getEquipDetails(value[1])
this.getEquipDetails(value[1]);
this.getAlarmCountByEquipId(value[1]);
this.getMaintenanceCountByEquipId(value[1]);
this.getAlarmDataTimeLineByEquipId(value[1]);
this.getAllData(value[1]);
} else {
this.$message.error("请选择一个设备");
}
@ -482,8 +623,8 @@ export default {
this.generateGaugeOption({
color: ["26DE86", "93DDBA"],
bgColor: "023E44",
name: "X轴排屑电流",
value: 70,
name: "排屑1电流",
value: this.currentData.chip_removal_1,
limit: 250,
unit: "A",
}),
@ -500,8 +641,8 @@ export default {
this.generateGaugeOption({
color: ["26AE86", "45678E"],
bgColor: "AAAAA",
name: "y轴排屑电流",
value: 70,
name: "排屑2电流",
value: this.currentData.chip_removal_2,
limit: 250,
unit: "A",
}),
@ -518,8 +659,8 @@ export default {
this.generateGaugeOption({
color: ["B07709", "EDBA58"],
bgColor: "846528",
name: "y轴振动熵值",
value: 80,
name: "液压1",
value: this.hyData.hy_1,
limit: 250,
unit: "G/S",
}),
@ -536,8 +677,8 @@ export default {
this.generateGaugeOption({
color: ["707709", "7DBA58"],
bgColor: "A46528",
name: "Y轴脉冲指数",
value: 125,
name: "液压2",
value: this.hyData.hy_2,
limit: 250,
unit: "GS",
}),
@ -554,8 +695,8 @@ export default {
this.generateGaugeOption({
color: ["FA604C", "F63319"],
bgColor: "C51D07",
name: "x轴润滑液压",
value: 125,
name: "液压3",
value: this.hyData.hy_3,
limit: 250,
unit: "bar",
}),
@ -566,56 +707,88 @@ export default {
this.echarts5 && this.echarts5.resize();
});
const yrhyy = document.getElementById("yrhyy");
this.echarts6 = echarts.init(yrhyy);
this.echarts6.setOption(
this.generateGaugeOption({
color: ["E5F72E", "BFD109"],
bgColor: "A5B505",
name: "y轴润滑液压",
value: 103,
limit: 250,
unit: "bar",
}),
true,
true
);
window.addEventListener("resize", () => {
this.echarts6 && this.echarts6.resize();
});
// const yrhyy = document.getElementById("yrhyy");
// this.echarts6 = echarts.init(yrhyy);
// this.echarts6.setOption(
// this.generateGaugeOption({
// color: ["E5F72E", "BFD109"],
// bgColor: "A5B505",
// name: "y",
// value: 103,
// limit: 250,
// unit: "bar",
// }),
// true,
// true
// );
// window.addEventListener("resize", () => {
// this.echarts6 && this.echarts6.resize();
// });
const zrhyy = document.getElementById("zrhyy");
this.echarts7 = echarts.init(zrhyy);
this.echarts7.setOption(
this.generateGaugeOption({
color: ["E5F72E", "BFD109"],
bgColor: "A5B505",
name: "z轴润滑液压",
value: 99,
limit: 250,
unit: "bar",
}),
true,
true
);
window.addEventListener("resize", () => {
this.echarts7 && this.echarts7.resize();
});
// const zrhyy = document.getElementById("zrhyy");
// this.echarts7 = echarts.init(zrhyy);
// this.echarts7.setOption(
// this.generateGaugeOption({
// color: ["E5F72E", "BFD109"],
// bgColor: "A5B505",
// name: "z",
// value: 99,
// limit: 250,
// unit: "bar",
// }),
// true,
// true
// );
// window.addEventListener("resize", () => {
// this.echarts7 && this.echarts7.resize();
// });
},
initTempCharts() {
// domecharts
var myChart1 = echarts.init(document.getElementById("xzzcwd"));
var option1 = this.tempOption(20.3);
var myChart1 = echarts.init(document.getElementById("xptemp"));
var option1 = this.tempOption(this.tempData.xp_temp);
myChart1.setOption(option1);
var myChart2 = echarts.init(document.getElementById("yzzcwd"));
var option2 = this.tempOption(50.5);
var myChart2 = echarts.init(document.getElementById("xntemp"));
var option2 = this.tempOption(this.tempData.xn_temp);
myChart2.setOption(option2);
var myChart3 = echarts.init(document.getElementById("zzzcwd"));
var option3 = this.tempOption(65.5);
var myChart3 = echarts.init(document.getElementById("x0temp"));
var option3 = this.tempOption(this.tempData.x0_temp);
myChart3.setOption(option3);
var myChart4 = echarts.init(document.getElementById("yptemp"));
var option4 = this.tempOption(this.tempData.yp_temp);
myChart4.setOption(option4);
var myChart5 = echarts.init(document.getElementById("yntemp"));
var option5 = this.tempOption(this.tempData.yn_temp);
myChart5.setOption(option5);
var myChart6 = echarts.init(document.getElementById("y0temp"));
var option6 = this.tempOption(this.tempData.y0_temp);
myChart6.setOption(option6);
var myChart7 = echarts.init(document.getElementById("zptemp"));
var option7 = this.tempOption(this.tempData.zp_temp);
myChart7.setOption(option7);
var myChart8 = echarts.init(document.getElementById("zntemp"));
var option8 = this.tempOption(this.tempData.zn_temp);
myChart8.setOption(option8);
var myChart9 = echarts.init(document.getElementById("z0temp"));
var option9 = this.tempOption(this.tempData.z0_temp);
myChart9.setOption(option9);
var myChart10 = echarts.init(document.getElementById("cr1temp"));
var option10 = this.tempOption(this.tempData.cr1_temp);
myChart10.setOption(option10);
var myChart11 = echarts.init(document.getElementById("cr2temp"));
var option11 = this.tempOption(this.tempData.cr2_temp);
myChart11.setOption(option11);
},
tempOption(data) {
@ -688,7 +861,7 @@ export default {
// 06010
var option = {
grid: {
x: 90, //y
x: 65, //y
y: -150, //topx
x2: -120, //y
y2: 20, //bottomx
@ -902,7 +1075,7 @@ export default {
center: ["50%", "60%"],
startAngle: 220,
endAngle: -40,
min: 0,
min: -10,
max: option.limit,
splitNumber: 12,
progress: {
@ -1236,7 +1409,7 @@ $bordercolor: #ddd;
}
.main-content {
display: grid;
grid-template-rows: 20% 20% 40% 20%;
grid-template-rows: 20% 20% 20% 20% 20%;
background: url("../../../../assets/images/equipdetails/middle_back.png")
no-repeat center center;
background-size: cover;