机械分厂工位屏更新
This commit is contained in:
parent
bfea059d3b
commit
4f63645031
@ -16,10 +16,10 @@ export default function getOriToData(ori_data: Object) {
|
|||||||
let dev_type = {
|
let dev_type = {
|
||||||
"JJ412": {
|
"JJ412": {
|
||||||
top: [
|
top: [
|
||||||
{ key: data['activation'] + "%", val: "稼动率" },
|
{ key: data['activation']||0 + "%", val: "稼动率" },
|
||||||
{ key: data['in1'] == "0"?'停止':'启动', val: "设备状态" },
|
{ key: data['in1'] == "0"?'停止':'启动', val: "设备状态" },
|
||||||
{ key: data['in3'] == "0"?'上电':'断电', val: "上电状态" },
|
{ key: data['in3'] == "0"?'上电':'断电', val: "上电状态" },
|
||||||
{ key: data['speed0'] + "转", val: "设备转速" }
|
{ key: parseInt(data['speed0']) + "rpm", val: "设备转速" }
|
||||||
],
|
],
|
||||||
bottom: {
|
bottom: {
|
||||||
image: getImage(data['image']),
|
image: getImage(data['image']),
|
||||||
@ -34,16 +34,16 @@ export default function getOriToData(ori_data: Object) {
|
|||||||
},
|
},
|
||||||
"JJ508": {
|
"JJ508": {
|
||||||
top: [
|
top: [
|
||||||
{ key: data['activation'] + "%", val: "稼动率" },
|
{ key: data['activation']||0 + "%", val: "稼动率" },
|
||||||
{ key: getDevStatus(), val: "设备状态" },
|
{ key: getDevStatus(), val: "设备状态" },
|
||||||
{ key: data['speed0'] + '转', val: "钻头转速" },
|
{ key: parseInt(data['speed0']) + 'rpm', val: "钻头转速" },
|
||||||
{ key: data['in8'] == "0"?'下降':'未下降', val: "钻头状态" }
|
{ key: data['in8'] == "0"?'下降':'未下降', val: "钻头状态" }
|
||||||
],
|
],
|
||||||
bottom: {
|
bottom: {
|
||||||
image: getImage(data['image']),
|
image: getImage(data['image']),
|
||||||
data: [
|
data: [
|
||||||
{ key: getRotateGear(), val: "设备状态" },
|
{ 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: getSpeedGear(), val: "设备状态" },
|
||||||
{ key: data['adc2'] + 'mm', val: "平台y轴距原点位置" },
|
{ key: data['adc2'] + 'mm', val: "平台y轴距原点位置" },
|
||||||
{ key: data['adc3'] + 'mm', val: "平台z轴距原点位置" }
|
{ key: data['adc3'] + 'mm', val: "平台z轴距原点位置" }
|
||||||
@ -74,8 +74,6 @@ function getDevStatus() {
|
|||||||
* 获取正反转档位
|
* 获取正反转档位
|
||||||
*/
|
*/
|
||||||
function getRotateGear() {
|
function getRotateGear() {
|
||||||
console.log(data['in2'],data['in3']);
|
|
||||||
|
|
||||||
if (data['in2'] == "1") {
|
if (data['in2'] == "1") {
|
||||||
return '正转'
|
return '正转'
|
||||||
} else if(data['in3'] == "1") {
|
} else if(data['in3'] == "1") {
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, getCurrentInstance, reactive, onMounted,watch } from "vue";
|
import { ref, getCurrentInstance, reactive, onMounted, watch } from "vue";
|
||||||
import { reqHologramDataMF} from "@/http/Mechanics"
|
import { reqHologramDataMF } from "@/http/Mechanics"
|
||||||
import { connectWebsocket, closeWebsocket } from "@/utils/websocket";
|
import { connectWebsocket, closeWebsocket } from "@/utils/websocket";
|
||||||
import handleData from "./handle"
|
import handleData from "./handle"
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
@ -34,16 +34,31 @@ let { timeHtml } = useNowTime();
|
|||||||
let route = useRoute();
|
let route = useRoute();
|
||||||
|
|
||||||
let ori_data = ref({
|
let ori_data = ref({
|
||||||
name: "机床1",
|
"id": "",
|
||||||
image: "/dev-api/profile/upload/2023/12/17/cc3940d1e85e4861845e797213802975.png",
|
"name": "卧式车床0412",
|
||||||
|
"image": "/profile/upload/2023/12/17/cba7a03d86a94775b6bdde70b0d069e6.png",
|
||||||
|
"speed0": "0",
|
||||||
|
"speed1": "0",
|
||||||
|
"activation": "70.0",
|
||||||
|
"signalGroup": "JJ412",
|
||||||
|
"ts": null,
|
||||||
|
"in1": "0",
|
||||||
|
"in2": "1",
|
||||||
|
"in3": "1",
|
||||||
|
"in4": "0",
|
||||||
|
"in7": "1",
|
||||||
|
"adc1": "187",
|
||||||
|
"adc2": "79",
|
||||||
|
"adc3": "25",
|
||||||
|
"in8": "0"
|
||||||
})
|
})
|
||||||
let topData = ref([]);
|
let topData = ref([]);
|
||||||
|
|
||||||
let bottomData = ref({})
|
let bottomData = ref({})
|
||||||
|
|
||||||
function getHologramDataMF() {
|
function getHologramDataMF() {
|
||||||
reqHologramDataMF({id:route.params.id}).then((res:any) => {
|
reqHologramDataMF({ id: route.params.id }).then((res: any) => {
|
||||||
if (res.code == 200&&res.data) {
|
if (res.code == 200 && res.data) {
|
||||||
ori_data.value = res.data;
|
ori_data.value = res.data;
|
||||||
let handle = handleData(ori_data.value)
|
let handle = handleData(ori_data.value)
|
||||||
topData.value = handle.top;
|
topData.value = handle.top;
|
||||||
@ -58,8 +73,27 @@ function getWebsocket(val) {
|
|||||||
let data = JSON.parse(val);
|
let data = JSON.parse(val);
|
||||||
//实时推送的数据
|
//实时推送的数据
|
||||||
if (data.type == "HologramDataMFInfo") {
|
if (data.type == "HologramDataMFInfo") {
|
||||||
|
let msg = data.msg;
|
||||||
|
if (ori_data.value.id == msg.id) {
|
||||||
|
console.log(msg);
|
||||||
|
|
||||||
|
ori_data.value.in1 = msg.IN1;
|
||||||
|
ori_data.value.in2 = msg.IN2;
|
||||||
|
ori_data.value.in3 = msg.IN3;
|
||||||
|
ori_data.value.in4 = msg.IN4;
|
||||||
|
ori_data.value.in7 = msg.IN7;
|
||||||
|
ori_data.value.in8 = msg.IN8;
|
||||||
|
ori_data.value.adc1 = msg.Adc_1;
|
||||||
|
ori_data.value.adc2 = msg.Adc_2;
|
||||||
|
ori_data.value.adc3 = msg.Adc_3;
|
||||||
|
ori_data.value.speed0 = msg.speed0;
|
||||||
|
ori_data.value.speed1 = msg.speed1;
|
||||||
|
let handle = handleData(ori_data.value)
|
||||||
|
topData.value = handle.top;
|
||||||
|
bottomData.value = handle.bottom;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {}
|
} catch (err) { }
|
||||||
}
|
}
|
||||||
function errWebsocket(val) {
|
function errWebsocket(val) {
|
||||||
// console.log(val);
|
// console.log(val);
|
||||||
|
Loading…
Reference in New Issue
Block a user