|
|
@@ -15,9 +15,11 @@
|
|
|
<div id="app">
|
|
|
<div class="alert alert-info" style="margin-bottom: 10px;">{{ weldingTypeText }},已解析 {{ myData.length }} 条参数记录</div>
|
|
|
|
|
|
- <div ref="vChart" style="width: 100%;height: 500px;"></div>
|
|
|
- <br>
|
|
|
- <br>
|
|
|
+ <div v-show="showVoltageChart" ref="vChart" style="width: 100%;height: 500px;"></div>
|
|
|
+ <template v-if="showVoltageChart">
|
|
|
+ <br>
|
|
|
+ <br>
|
|
|
+ </template>
|
|
|
<div ref="iChart" style="width: 100%;height:500px;"></div>
|
|
|
<br>
|
|
|
<br>
|
|
|
@@ -26,7 +28,7 @@
|
|
|
<thead>
|
|
|
<tr>
|
|
|
<template v-for="n in welderCount">
|
|
|
- <th>{{ firstMetricName }}{{n}}</th>
|
|
|
+ <th v-if="showVoltageChart">{{ firstMetricName }}{{n}}</th>
|
|
|
<th>{{ secondMetricName }}{{n}}</th>
|
|
|
<th v-if="!isNewJson">错误码{{n}}</th>
|
|
|
<th v-if="!isNewJson">JOB号{{n}}</th>
|
|
|
@@ -37,7 +39,7 @@
|
|
|
<tbody>
|
|
|
<tr v-for="(item,index) in myData" :key="index">
|
|
|
<template v-for="n in welderCount">
|
|
|
- <td>{{ item['V' + n] }}</td>
|
|
|
+ <td v-if="showVoltageChart">{{ item['V' + n] }}</td>
|
|
|
<td>{{ item['I' + n] }}</td>
|
|
|
<td v-if="!isNewJson">{{ item['code' + n] }}</td>
|
|
|
<td v-if="!isNewJson">{{ item['JOB' + n] }}</td>
|
|
|
@@ -246,6 +248,18 @@
|
|
|
secondMetricName() {
|
|
|
return '电流';
|
|
|
},
|
|
|
+ showVoltageChart() {
|
|
|
+ if (!this.myData || this.myData.length === 0) return false;
|
|
|
+ for (let i = 1; i <= this.welderCount; i++) {
|
|
|
+ for (let j = 0; j < this.myData.length; j++) {
|
|
|
+ const value = Number(this.myData[j]['V' + i]);
|
|
|
+ if (!isNaN(value) && Math.abs(value) > 0) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ },
|
|
|
timeArr() {
|
|
|
if (!this.myData || this.myData.length === 0) return [];
|
|
|
const arr = [];
|