From 47ec633340b7317bdaf1fee36a9ff0dfd9336144 Mon Sep 17 00:00:00 2001 From: hzz Date: Wed, 31 Jan 2024 15:47:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9C=BA=E6=A2=B0=E5=88=86?= =?UTF-8?q?=E5=8E=82=E5=B7=A5=E4=BD=8D=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/http/Mechanics/index.ts | 6 + .../child/station/components/sum.vue | 105 ++++++----------- src/views/Mechanics/child/station/handle.ts | 107 ++++++++++++++++++ src/views/Mechanics/child/station/index.vue | 40 ++++--- 4 files changed, 175 insertions(+), 83 deletions(-) create mode 100644 src/views/Mechanics/child/station/handle.ts diff --git a/src/http/Mechanics/index.ts b/src/http/Mechanics/index.ts index ecf386c..94a5f47 100644 --- a/src/http/Mechanics/index.ts +++ b/src/http/Mechanics/index.ts @@ -46,3 +46,9 @@ export function reqDeviceTotelStatusMF() { export function reqDeviceRemind() { return get('/screen/device/deviceRemind') } + + +/**工位屏 */ +export function reqHologramDataMF(data:any){ + return get('/screen/device/getHologramDataMF',data) +} \ No newline at end of file diff --git a/src/views/Mechanics/child/station/components/sum.vue b/src/views/Mechanics/child/station/components/sum.vue index 2d3c8ac..765fa44 100644 --- a/src/views/Mechanics/child/station/components/sum.vue +++ b/src/views/Mechanics/child/station/components/sum.vue @@ -10,84 +10,39 @@
- +
-
-
-

{{ allData.data1 }}

+
+
+

{{ item2 }}

- {{ allData.title1 }} -
-
-
-

{{ allData.data2 }}

-

{{ allData.data2s }}

+
+

{{ item.key }}

- {{ allData.title2 }} + {{ item.val }}
-
-
-

{{ allData.data5}}

-
- {{ allData.title5}} -
- -
-
-

- {{ allData.data3 }} -

-
- {{ allData.title3 }} -
-
-
-

{{ allData.data4 }}

-
- {{ allData.title4 }} -
@@ -103,6 +58,7 @@ const { proxy } = getCurrentInstance() as any; background: url(./../img/big.png) no-repeat center; background-size: 55%; } + .deviceimg { height: 480px; width: 450px; @@ -113,6 +69,7 @@ const { proxy } = getCurrentInstance() as any; align-items: center; position: relative; } + img { /* 确保图片不会超出div的宽高 */ max-width: 100%; @@ -132,15 +89,18 @@ img { transform: rotateX(70deg); animation: circle 5s linear infinite; } + @keyframes circle { 100% { transform: rotateX(70deg) rotateZ(360deg); } } + .data1 { left: 12%; top: 35%; } + .qiu1 { background: url(./../img/cicle1.png) no-repeat center; } @@ -149,15 +109,17 @@ img { left: 63%; top: 26%; } + .qiu2 { background: url(./../img/cicle03.png) no-repeat center; - + } .data3 { left: -3%; top: 57%; } + .qiu3 { background: url(./../img/cicle02.png) no-repeat center; } @@ -166,6 +128,7 @@ img { left: 80%; top: 48%; } + .qiu4 { background: url(./../img/cicle01.png) no-repeat center; } @@ -174,8 +137,9 @@ img { left: 65%; top: 59%; } + .qiu5 { - background: url(./../img/cicle1.png) no-repeat center; + background: url(./../img/cicle1.png) no-repeat center; } #data { @@ -185,12 +149,14 @@ img { background: url(./../img/j5.png) no-repeat center; text-align: center; } + p { display: table-cell; vertical-align: middle; font-size: 26px; font-weight: 700; } + #qiu { width: 105px; height: 120px; @@ -203,6 +169,7 @@ p { align-items: center; flex-direction: column; } + #qiu::before { content: ""; display: block; @@ -216,21 +183,23 @@ p { border: 3px solid rgba(255, 255, 255, 0.5); animation: scale 2s linear infinite; } + @keyframes scale { 0% { transform: translate(-50%, -50%) scale(0.9); opacity: 1; } + 100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; } } + span { font-size: 18px; top: 22%; font-weight: 700; color: #aeeefa; position: relative; -} - +} diff --git a/src/views/Mechanics/child/station/handle.ts b/src/views/Mechanics/child/station/handle.ts new file mode 100644 index 0000000..78755b8 --- /dev/null +++ b/src/views/Mechanics/child/station/handle.ts @@ -0,0 +1,107 @@ + + + + + + +/** + * + * @param ori_data + * @returns + */ +export default function getOriToData(ori_data: Object) { + + let data: object = ori_data; + + let dev_type = { + "JJ412": { + top: [ + { key: data['activation'] + "%", val: "稼动率" }, + { key: data['in1'] == "0"?'停止':'启动', val: "设备状态" }, + { key: data['in3'] == "0"?'上电':'断电', val: "上电状态" }, + { key: data['speed0'] + "转", val: "设备转速" } + ], + bottom: { + image: data['image'], + data: [ + { key: data['adc1'] + 'mm', val: "操作台距原点距离" }, + { key: data['in7'] == "0"?'工作':'空挡', val: "档杆状态" }, + { key: data['adc2'] + 'mm', val: "套筒台距原点距离" }, + { key: data['in4'] == "0"?'开启':'关闭', val: "切削液状态" }, + { key: data['in3'] == "0"?'开启':'关闭', val: "照明状态" } + ] + } + }, + "JJ508": { + top: [ + { key: data['activation'] + "%", val: "稼动率" }, + { key: getDevStatus(), val: "设备状态" }, + { key: data['speed0'] + '转', val: "钻头转速" }, + { key: data['in8'] == "0"?'下降':'未下降', val: "钻头状态" } + ], + bottom: { + image: data['image'], + data: [ + { key: getRotateGear(), val: "设备状态" }, + { key: [data['adc1'] + 'mm', data['speed0']+'cm/s'], val: "平台X轴距原点位置和速度" }, + { key: getSpeedGear(), val: "设备状态" }, + { key: data['adc2'] + 'mm', val: "平台y轴距原点位置" }, + { key: data['adc3'] + 'mm', val: "平台z轴距原点位置" } + ] + } + }, + } + +/** + * 获得设备状态 + */ +function getDevStatus() { + if (data['in1'] == "1" && (data['in2'] == "1" || data['in3'] == 1)&&(data['in4'] == "1" || data['in7'] == 1)) { + return '工作' + } else if(data['in1'] == 1) { + return '待机' + } else { + return '停机' + } +} + + +/** + * 获取正反转档位 + */ +function getRotateGear() { + console.log(data['in2'],data['in3']); + + if (data['in2'] == "1") { + return '正转' + } else if(data['in3'] == "1") { + return '反转' + } else { + return '停止' + } +} + +/** + * 获取速度档位 + */ +function getSpeedGear() { + if (data['in4'] == "1") { + return '高速' + } else if(data['in7'] == "1") { + return '低速' + } else { + return '停止' + } +} + + + + + + + + + + return dev_type[ori_data['signalGroup']] +} + diff --git a/src/views/Mechanics/child/station/index.vue b/src/views/Mechanics/child/station/index.vue index cbdd49c..a9b8535 100644 --- a/src/views/Mechanics/child/station/index.vue +++ b/src/views/Mechanics/child/station/index.vue @@ -10,38 +10,30 @@
- {{ allData.header }}数据监控平台 + {{ ori_data.name }}数据监控平台

{{ timeHtml }}

- +