|
|
@@ -21,9 +21,6 @@
|
|
|
<div ref="iChart" style="width: 100%;height:500px;"></div>
|
|
|
<br>
|
|
|
<br>
|
|
|
- <div v-if="showThirdChart" ref="speedChart" style="width: 100%;height:500px;"></div>
|
|
|
- <br>
|
|
|
- <br>
|
|
|
<div class="col-sm-12">
|
|
|
<table class="table table-bordered" style="table-layout: fixed;white-space: normal;">
|
|
|
<thead>
|
|
|
@@ -31,7 +28,6 @@
|
|
|
<template v-for="n in welderCount">
|
|
|
<th>{{ firstMetricName }}{{n}}</th>
|
|
|
<th>{{ secondMetricName }}{{n}}</th>
|
|
|
- <th v-if="showThirdChart">{{ thirdMetricName }}{{n}}</th>
|
|
|
<th v-if="!isNewJson">错误码{{n}}</th>
|
|
|
<th v-if="!isNewJson">JOB号{{n}}</th>
|
|
|
</template>
|
|
|
@@ -43,7 +39,6 @@
|
|
|
<template v-for="n in welderCount">
|
|
|
<td>{{ item['V' + n] }}</td>
|
|
|
<td>{{ item['I' + n] }}</td>
|
|
|
- <td v-if="showThirdChart">{{ item['speed' + n] }}</td>
|
|
|
<td v-if="!isNewJson">{{ item['code' + n] }}</td>
|
|
|
<td v-if="!isNewJson">{{ item['JOB' + n] }}</td>
|
|
|
</template>
|
|
|
@@ -184,12 +179,10 @@
|
|
|
const obj = {};
|
|
|
obj.V1 = parseFloat(sample.robot1Voltage || 0) || 0;
|
|
|
obj.I1 = parseFloat(sample.robot1Current || 0) || 0;
|
|
|
- obj.speed1 = parseFloat(sample.robot1Pressure || sample.robot1WeldTime || 0) || 0;
|
|
|
- obj.code1 = 0;
|
|
|
- obj.JOB1 = '';
|
|
|
obj.V2 = parseFloat(sample.robot2Voltage || 0) || 0;
|
|
|
obj.I2 = parseFloat(sample.robot2Current || 0) || 0;
|
|
|
- obj.speed2 = parseFloat(sample.robot2Pressure || sample.robot2WeldTime || 0) || 0;
|
|
|
+ obj.code1 = 0;
|
|
|
+ obj.JOB1 = '';
|
|
|
obj.code2 = 0;
|
|
|
obj.JOB2 = '';
|
|
|
obj.createDate = sample.time || '';
|
|
|
@@ -227,8 +220,7 @@
|
|
|
content: ${toJson(mesProductArcWelding.content!'')},
|
|
|
welderCount: 2,
|
|
|
vChart: null,
|
|
|
- iChart: null,
|
|
|
- speedChart: null
|
|
|
+ iChart: null
|
|
|
},
|
|
|
computed: {
|
|
|
myData() {
|
|
|
@@ -249,16 +241,10 @@
|
|
|
return '焊接过程参数';
|
|
|
},
|
|
|
firstMetricName() {
|
|
|
- return this.weldingType === 'spot' ? '电流' : '电压';
|
|
|
+ return '电压';
|
|
|
},
|
|
|
secondMetricName() {
|
|
|
- return this.weldingType === 'spot' ? '压力' : '电流';
|
|
|
- },
|
|
|
- thirdMetricName() {
|
|
|
- return this.weldingType === 'spot' ? '焊接时间' : '送丝速度';
|
|
|
- },
|
|
|
- showThirdChart() {
|
|
|
- return this.weldingType === 'spot';
|
|
|
+ return '电流';
|
|
|
},
|
|
|
timeArr() {
|
|
|
if (!this.myData || this.myData.length === 0) return [];
|
|
|
@@ -328,35 +314,6 @@
|
|
|
yAxis: { name: this.secondMetricName, type: 'value' },
|
|
|
series: series
|
|
|
};
|
|
|
- },
|
|
|
- speedOption() {
|
|
|
- const series = [];
|
|
|
- const legendData = [];
|
|
|
- for (let i = 1; i <= this.welderCount; i++) {
|
|
|
- legendData.push(this.thirdMetricName + i);
|
|
|
- const arr = [];
|
|
|
- for (let j = 0; j < this.myData.length; j++) {
|
|
|
- arr.push(this.myData[j]['speed' + i]);
|
|
|
- }
|
|
|
- series.push({
|
|
|
- name: this.thirdMetricName + i,
|
|
|
- type: 'line',
|
|
|
- data: arr,
|
|
|
- smooth: true,
|
|
|
- showSymbol: true,
|
|
|
- symbolSize: 8
|
|
|
- });
|
|
|
- }
|
|
|
- return {
|
|
|
- title: { text: this.thirdMetricName + '变化折线图' },
|
|
|
- tooltip: { trigger: 'axis' },
|
|
|
- legend: { data: legendData },
|
|
|
- grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
|
|
|
- toolbox: { feature: { saveAsImage: {} } },
|
|
|
- xAxis: { type: 'category', name: '时间', boundaryGap: false, data: this.timeArr },
|
|
|
- yAxis: { name: this.thirdMetricName, type: 'value' },
|
|
|
- series: series
|
|
|
- };
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -366,7 +323,6 @@
|
|
|
this.welderCount = getWelderCount(this.content);
|
|
|
this.vChart.setOption(this.vOption, true);
|
|
|
this.iChart.setOption(this.iOption, true);
|
|
|
- if (this.speedChart) { this.speedChart.setOption(this.speedOption, true); }
|
|
|
}
|
|
|
},
|
|
|
deep: true
|
|
|
@@ -380,14 +336,8 @@
|
|
|
this.$nextTick(() => {
|
|
|
this.vChart = echarts.init(this.$refs.vChart)
|
|
|
this.iChart = echarts.init(this.$refs.iChart)
|
|
|
- if (this.$refs.speedChart) {
|
|
|
- this.speedChart = echarts.init(this.$refs.speedChart)
|
|
|
- }
|
|
|
this.vChart.setOption(this.vOption);
|
|
|
this.iChart.setOption(this.iOption);
|
|
|
- if (this.speedChart) {
|
|
|
- this.speedChart.setOption(this.speedOption);
|
|
|
- }
|
|
|
});
|
|
|
}
|
|
|
})
|