From 4f63645031bd8ee3f2340220029975a908d6c46b Mon Sep 17 00:00:00 2001 From: hzz Date: Fri, 2 Feb 2024 08:57:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=BA=E6=A2=B0=E5=88=86=E5=8E=82=E5=B7=A5?= =?UTF-8?q?=E4=BD=8D=E5=B1=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Mechanics/child/station/handle.ts | 14 +++--- src/views/Mechanics/child/station/index.vue | 48 ++++++++++++++++++--- 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/src/views/Mechanics/child/station/handle.ts b/src/views/Mechanics/child/station/handle.ts index 1f6fd4b..078cdaa 100644 --- a/src/views/Mechanics/child/station/handle.ts +++ b/src/views/Mechanics/child/station/handle.ts @@ -16,10 +16,10 @@ export default function getOriToData(ori_data: Object) { let dev_type = { "JJ412": { top: [ - { key: data['activation'] + "%", val: "稼动率" }, + { key: data['activation']||0 + "%", val: "稼动率" }, { key: data['in1'] == "0"?'停止':'启动', val: "设备状态" }, { key: data['in3'] == "0"?'上电':'断电', val: "上电状态" }, - { key: data['speed0'] + "转", val: "设备转速" } + { key: parseInt(data['speed0']) + "rpm", val: "设备转速" } ], bottom: { image: getImage(data['image']), @@ -34,16 +34,16 @@ export default function getOriToData(ori_data: Object) { }, "JJ508": { top: [ - { key: data['activation'] + "%", val: "稼动率" }, + { key: data['activation']||0 + "%", val: "稼动率" }, { key: getDevStatus(), val: "设备状态" }, - { key: data['speed0'] + '转', val: "钻头转速" }, + { key: parseInt(data['speed0']) + 'rpm', val: "钻头转速" }, { key: data['in8'] == "0"?'下降':'未下降', val: "钻头状态" } ], bottom: { image: getImage(data['image']), data: [ { key: getRotateGear(), val: "设备状态" }, - { key: [data['adc1'] + 'mm', data['speed0']+'cm/s'], val: "平台X轴距原点位置和速度" }, + { key: [data['adc1'] + 'mm', parseFloat(data['speed1']).toFixed(1)+'mm/s'], val: "平台X轴距原点位置和速度" }, { key: getSpeedGear(), val: "设备状态" }, { key: data['adc2'] + 'mm', val: "平台y轴距原点位置" }, { key: data['adc3'] + 'mm', val: "平台z轴距原点位置" } @@ -73,9 +73,7 @@ function getDevStatus() { /** * 获取正反转档位 */ -function getRotateGear() { - console.log(data['in2'],data['in3']); - +function getRotateGear() { if (data['in2'] == "1") { return '正转' } else if(data['in3'] == "1") { diff --git a/src/views/Mechanics/child/station/index.vue b/src/views/Mechanics/child/station/index.vue index 2e0d675..a7b4f3d 100644 --- a/src/views/Mechanics/child/station/index.vue +++ b/src/views/Mechanics/child/station/index.vue @@ -22,8 +22,8 @@