ソースを参照

电焊数据修改

hfy 3 ヶ月 前
親
コミット
a1cc888c5e

+ 19 - 5
src/main/resources/views/modules/mes/mesProductArcWeldingInfo.html

@@ -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 = [];

+ 2 - 2
src/main/resources/views/modules/mes/mesProductArcWeldingList.html

@@ -52,9 +52,9 @@
 $('#dataGrid').dataGrid({
 	searchForm: $("#searchForm"),
 	columnModel: [
-		{header:'${text("产线编号")}', name:'lineSn', index:'a.line_sn', width:150, align:"left", frozen:true, formatter: function(val, obj, row, act){
+		{header:'${text("产线编号")}', name:'lineSn', index:'a.line_sn', width:150, align:"left"/*, frozen:false, formatter: function(val, obj, row, act){
 			return '<a href="${ctx}/mes/mesProductArcWelding/form?id='+row.id+'&createDate='+encodeURIComponent(row.createDate)+'" class="btnList" data-title="${text("编辑点焊参数")}">'+(val||row.id)+'</a>';
-		}},
+		}*/},
 		{header:'${text("工位号")}', name:'oprno', index:'a.oprno', width:150, align:"left"},
 		{header:'${text("二维码")}', name:'sn', index:'a.sn', width:150, align:"left"},
 		{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){