刘磊
2025-06-09 dabbcafc629ef87d11ba55ef8cc1cdc776c047d8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<template>
  <el-row>
    <el-col :span="21">
      <DeviceLineVo v-for="device in devices" :key="device.deviceName" :device="device" />
    </el-col>
  </el-row>
</template>
<script setup>
import { onMounted, ref, reactive, toRaw } from "vue";
import eventBus from "@/uitils/eventBus";
import DeviceLineVo from "@/components/DeviceLineVo.vue";
import DeviceStacker from "@/components/DeviceStacker.vue";
// 堆垛机
const Stackers = reactive([]);
var  i=0;
// 设备列表(修改重复设备名称)
const devices = reactive([]);
const num = reactive([])
onMounted(() => {
  eventBus.on('stackerData', eventData => {
    if (eventData.deviceName === "包装出库输送线") {
    if (devices.length <= 0) {
        devices.push({ deviceName: eventData.deviceName, data: eventData.data, childDeviceCode: eventData.data.childDeviceCode });
      }
      else {
        const device = devices.find(c => c.childDeviceCode == eventData.data.childDeviceCode)
        if(device){
          device.data = eventData.data
        }else{
          devices.push({ deviceName: eventData.deviceName, data: eventData.data, childDeviceCode: eventData.data.childDeviceCode });
        }
      }
    
    }
  })
 
})
 
</script>
<style scoped>
 
</style>