Compare commits
3 Commits
2594c3bc6b
...
9222ec24a9
Author | SHA1 | Date | |
---|---|---|---|
9222ec24a9 | |||
d33a19bcc1 | |||
05af698650 |
@ -117,6 +117,13 @@ public class DataQueryController {
|
||||
return success(resMap);
|
||||
}
|
||||
|
||||
@GetMapping("/getAllNewestData")
|
||||
@Operation(summary = "获取所有最新数据")
|
||||
public CommonResult<Map<String, Object>> getAllNewestData(String equipId){
|
||||
Map<String, Object> resMap = dataQueryService.getAllNewestData(equipId);
|
||||
return success(resMap);
|
||||
}
|
||||
|
||||
@GetMapping("/export-current-excel")
|
||||
@Operation(summary = "导出机床电流传感器参数 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('data:query:export')")
|
||||
|
@ -154,6 +154,7 @@ public class DataQueryService implements IDataQueryService {
|
||||
/**
|
||||
* 查询当日最新一条数据
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> getLatestData(String equipId, String tableName, String columns){
|
||||
|
||||
LocalDate now = LocalDate.now();
|
||||
@ -181,6 +182,100 @@ public class DataQueryService implements IDataQueryService {
|
||||
return dataList.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备id查询设备最新一条数据
|
||||
*/
|
||||
public Map<String, Object> getAllNewestData(String equipId){
|
||||
Map<String,Object> resultMap = new HashMap<>();
|
||||
resultMap.put("current", getNewestCurrentData(equipId));
|
||||
resultMap.put("hy", getNewestPressData(equipId));
|
||||
resultMap.put("temp", getNewestTempData(equipId));
|
||||
resultMap.put("aclr", getNewestVibrData(equipId));
|
||||
resultMap.put("fanuc", getNewestWorkData(equipId));
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 最新的一条电流数据
|
||||
* @param equipId 设备id
|
||||
* @return 电流数据
|
||||
*/
|
||||
private Map<String, Object> getNewestCurrentData(String equipId){
|
||||
String tableName = "gateway_current_data";
|
||||
String columns = "chip_removal_1,chip_removal_2";
|
||||
List<Map<String, Object>> dataList = selectOneDataByColumnsandDate(equipId, tableName, columns, null, null, "desc");
|
||||
if (CollUtil.isEmpty(dataList)) {
|
||||
String[] cols = columns.split(",");
|
||||
Map<String, Object> resMap = new HashMap<>();
|
||||
for (String col : cols) {
|
||||
resMap.put(col, 0.0);
|
||||
}
|
||||
return resMap;
|
||||
}
|
||||
return dataList.get(0);
|
||||
}
|
||||
|
||||
private Map<String, Object> getNewestPressData(String equipId){
|
||||
String tableName = "gateway_hy_data";
|
||||
String columns = "hy_1,hy_2,hy_3";
|
||||
List<Map<String, Object>> dataList = selectOneDataByColumnsandDate(equipId, tableName, columns, null, null, "desc");
|
||||
if (CollUtil.isEmpty(dataList)) {
|
||||
String[] cols = columns.split(",");
|
||||
Map<String, Object> resMap = new HashMap<>();
|
||||
for (String col : cols) {
|
||||
resMap.put(col, 0.0);
|
||||
}
|
||||
return resMap;
|
||||
}
|
||||
return dataList.get(0);
|
||||
}
|
||||
|
||||
private Map<String, Object> getNewestTempData(String equipId){
|
||||
String tableName = "gateway_temp_data";
|
||||
String columns = "cr1_temp,cr2_temp,x0_temp,xp_temp,xn_temp,y0_temp,yp_temp,yn_temp,z0_temp,zp_temp,zn_temp";
|
||||
List<Map<String, Object>> dataList = selectOneDataByColumnsandDate(equipId, tableName, columns, null, null, "desc");
|
||||
if (CollUtil.isEmpty(dataList)) {
|
||||
String[] cols = columns.split(",");
|
||||
Map<String, Object> resMap = new HashMap<>();
|
||||
for (String col : cols) {
|
||||
resMap.put(col, 0.0);
|
||||
}
|
||||
return resMap;
|
||||
}
|
||||
return dataList.get(0);
|
||||
}
|
||||
|
||||
private Map<String, Object> getNewestVibrData(String equipId){
|
||||
String tableName = "gateway_aclr_data";
|
||||
String columns = "x_aclr_rms,x_speed_rms,x_dis_rms,y_aclr_rms,y_speed_rms,y_dis_rms,z_aclr_rms,z_speed_rms,z_dis_rms," +
|
||||
"x_aclr_peak,x_speed_peak,x_dis_peak,y_aclr_peak,y_speed_peak,y_dis_peak,z_aclr_peak,z_speed_peak,z_dis_peak";
|
||||
List<Map<String, Object>> dataList = selectOneDataByColumnsandDate(equipId, tableName, columns, null, null, "desc");
|
||||
if (CollUtil.isEmpty(dataList)) {
|
||||
String[] cols = columns.split(",");
|
||||
Map<String, Object> resMap = new HashMap<>();
|
||||
for (String col : cols) {
|
||||
resMap.put(col, 0.0);
|
||||
}
|
||||
return resMap;
|
||||
}
|
||||
return dataList.get(0);
|
||||
}
|
||||
|
||||
private Map<String, Object> getNewestWorkData(String equipId){
|
||||
String tableName = "gateway_fanuc_data";
|
||||
String columns = "power_time,process_num,total_process,work_time";
|
||||
List<Map<String, Object>> dataList = selectOneDataByColumnsandDate(equipId, tableName, columns, null, null, "desc");
|
||||
if (CollUtil.isEmpty(dataList)) {
|
||||
String[] cols = columns.split(",");
|
||||
Map<String, Object> resMap = new HashMap<>();
|
||||
for (String col : cols) {
|
||||
resMap.put(col, 0.0);
|
||||
}
|
||||
return resMap;
|
||||
}
|
||||
return dataList.get(0);
|
||||
}
|
||||
|
||||
public Map<String, Object> getAllData2ChartData(String equipId, String tableName, String columns, String startTime, String endTime) {
|
||||
LocalDateTime stime = DateUtils.tranUTCtoLocalDateTime(startTime);
|
||||
LocalDateTime etime = DateUtils.tranUTCtoLocalDateTime(endTime);
|
||||
|
@ -56,4 +56,9 @@ public interface IDataQueryService {
|
||||
* 查询当日最旧一条数据
|
||||
*/
|
||||
public Map<String, Object> getOldestData(String equipId, String tableName, String columns);
|
||||
|
||||
/**
|
||||
* 根据设备id查询设备最新一条数据
|
||||
*/
|
||||
public Map<String, Object> getAllNewestData(String equipId);
|
||||
}
|
||||
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
@ -49,10 +49,10 @@
|
||||
<span class="title-font">故障数据分析</span>
|
||||
</div>
|
||||
<div class="item-content">
|
||||
<!-- <div-->
|
||||
<!-- ref="faultChart"-->
|
||||
<!-- style="height:100%;margin-left: -100px"-->
|
||||
<!-- ></div>-->
|
||||
<!-- <div-->
|
||||
<!-- ref="faultChart"-->
|
||||
<!-- style="height:100%;margin-left: -100px"-->
|
||||
<!-- ></div>-->
|
||||
<div class="item-content fault-data">
|
||||
<div class="fault-icon"></div>
|
||||
<div class="fault-content">
|
||||
@ -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,24 +244,24 @@ import {
|
||||
getMaintenanceOrderCount,
|
||||
getAlarmList,
|
||||
getCustomerDistribution,
|
||||
getCustomerDistributionByProvinceCode
|
||||
} from '@/api/system/largeScreen/largeScreen';
|
||||
import {DICT_TYPE} from "@/utils/dict";
|
||||
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 {
|
||||
alarmList:[],
|
||||
companyAndEquipCreate:[],
|
||||
alarmData:{},
|
||||
alarmList: [],
|
||||
companyAndEquipCreate: [],
|
||||
alarmData: {},
|
||||
dataCount: {
|
||||
customerCount: 0,
|
||||
equipCount: 0,
|
||||
onlineEquipCount: 0
|
||||
onlineEquipCount: 0,
|
||||
},
|
||||
loading1: false,
|
||||
equipList: [],
|
||||
@ -280,25 +286,25 @@ export default {
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
initData(){
|
||||
getEquipInfoList().then(res=>{
|
||||
initData() {
|
||||
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;
|
||||
@ -309,61 +315,61 @@ export default {
|
||||
changeMark(index) {
|
||||
return "fault-mark" + (index + 1);
|
||||
},
|
||||
async getFaultChart(){
|
||||
await getFaultDataList().then(res=>{
|
||||
async getFaultChart() {
|
||||
await getFaultDataList().then((res) => {
|
||||
this.faultList = res.data;
|
||||
})
|
||||
});
|
||||
this.initFaultChart(this.faultList);
|
||||
},
|
||||
initFaultChart(data){
|
||||
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) {
|
||||
@ -618,7 +624,7 @@ export default {
|
||||
});
|
||||
p.then(async () => {
|
||||
const _this = this;
|
||||
echarts.registerMap("china", {geoJSON: chinaMap});
|
||||
echarts.registerMap("china", { geoJSON: chinaMap });
|
||||
this.myChart = echarts.init(this.$refs.mapChart);
|
||||
let showdata = [];
|
||||
await getCustomerDistribution().then((res) => {
|
||||
@ -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;
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -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,16 +449,23 @@
|
||||
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 {getMaintenanceCountByEquipId} from "@/api/system/maintenance/maintenance";
|
||||
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"],
|
||||
data() {
|
||||
return {
|
||||
cascaderDisabled: false,
|
||||
cascaderValue:{},
|
||||
cascaderValue: {},
|
||||
equipInfo: {},
|
||||
alarmTimes: 0,
|
||||
faultTimes: 0,
|
||||
@ -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,68 +496,85 @@ export default {
|
||||
this.initEquipDetails();
|
||||
},
|
||||
mounted() {
|
||||
this.initCharts();
|
||||
this.initTempCharts();
|
||||
// this.initTempCharts();
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
methods: {
|
||||
initEquipDetails() {
|
||||
getEquipCascader().then(res=>{
|
||||
res.forEach(item=>{
|
||||
if (item.children == null){
|
||||
getEquipCascader().then((res) => {
|
||||
res.forEach((item) => {
|
||||
if (item.children == null) {
|
||||
item.disabled = true;
|
||||
}else {
|
||||
} else {
|
||||
item.disabled = false;
|
||||
}
|
||||
})
|
||||
});
|
||||
this.options = res;
|
||||
if (this.$route.query.equipId != null){
|
||||
if (this.$route.query.equipId != null) {
|
||||
this.cascaderValue = this.$route.query.equipId;
|
||||
this.getEquipDetails(this.$route.query.equipId);
|
||||
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 => {
|
||||
} else {
|
||||
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) {
|
||||
getMaintenanceCountByEquipId(equipId).then((res) => {
|
||||
this.faultTimes = res.data;
|
||||
})
|
||||
});
|
||||
},
|
||||
//获取设备报警次数
|
||||
getAlarmCountByEquipId(equipId){
|
||||
getAlarmCountByEquipId(equipId).then(res=>{
|
||||
getAlarmCountByEquipId(equipId) {
|
||||
getAlarmCountByEquipId(equipId).then((res) => {
|
||||
this.alarmTimes = res.data;
|
||||
})
|
||||
});
|
||||
},
|
||||
//获取设备报警时间轴
|
||||
getAlarmDataTimeLineByEquipId(equipId){
|
||||
getAlarmDataTimeLineByEquipId(equipId).then(res=>{
|
||||
getAlarmDataTimeLineByEquipId(equipId) {
|
||||
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 => {
|
||||
console.log("res.data",res.data);
|
||||
getEquipInfoDetails(id).then((res) => {
|
||||
console.log("res.data", res.data);
|
||||
this.equipInfo = res.data;
|
||||
this.techParamsList = res.data.paramList;
|
||||
})
|
||||
});
|
||||
},
|
||||
async getEquipAlarmList() {
|
||||
var equipAlarmQuery = {
|
||||
@ -448,12 +588,13 @@ export default {
|
||||
this.equipAlarmList = res.data.list;
|
||||
},
|
||||
handleChange(value) {
|
||||
if (value.length > 0){
|
||||
this.getEquipDetails(value[1])
|
||||
if (value.length > 0) {
|
||||
this.getEquipDetails(value[1]);
|
||||
this.getAlarmCountByEquipId(value[1]);
|
||||
this.getMaintenanceCountByEquipId(value[1]);
|
||||
this.getAlarmDataTimeLineByEquipId(value[1]);
|
||||
}else {
|
||||
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() {
|
||||
// 基于准备好的dom,初始化echarts实例
|
||||
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 {
|
||||
// 因为柱状初始化为0,温度存在负值,所以加上负值60和空出距离10
|
||||
var option = {
|
||||
grid: {
|
||||
x: 90, //左侧与y轴的距离
|
||||
x: 65, //左侧与y轴的距离
|
||||
y: -150, //top部与x轴的距离
|
||||
x2: -120, //右侧与y轴的距离
|
||||
y2: 20, //bottom部与x轴的距离
|
||||
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user