|  |  |  | 
|---|
|  |  |  | import DeviceStacker from "@/components/DeviceStacker.vue"; | 
|---|
|  |  |  | // 堆垛机 | 
|---|
|  |  |  | const Stackers = reactive([]); | 
|---|
|  |  |  | var  i=0; | 
|---|
|  |  |  | var i = 0; | 
|---|
|  |  |  | // 设备列表(修改重复设备名称) | 
|---|
|  |  |  | const devices = reactive([]); | 
|---|
|  |  |  | const num = reactive([]) | 
|---|
|  |  |  | onMounted(() => { | 
|---|
|  |  |  | eventBus.on('stackerData', eventData => { | 
|---|
|  |  |  | eventBus.on('locationData', eventData => { | 
|---|
|  |  |  | // console.log(eventData) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | console.log(eventData) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (eventData.deviceName === "老化入库输送线") { | 
|---|
|  |  |  | if (devices.length <= 0) { | 
|---|
|  |  |  | console.log(eventData) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (eventData.deviceName.indexOf("老化") != -1) { | 
|---|
|  |  |  | 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){ | 
|---|
|  |  |  | if (device) { | 
|---|
|  |  |  | device.data = eventData.data | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | devices.push({ deviceName: eventData.deviceName, data: eventData.data, childDeviceCode: eventData.data.childDeviceCode }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | eventBus.on('stackerData', eventData => { | 
|---|
|  |  |  | if (eventData.deviceName == "老化1号堆垛机") { | 
|---|
|  |  |  | if (eventData.deviceName.indexOf("老化") != -1) { | 
|---|
|  |  |  | if (Stackers.length == 0) { | 
|---|
|  |  |  | Stackers.push({ deviceName: eventData.deviceName, data: eventData.data }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <style scoped> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </style> | 
|---|
|  |  |  | <style scoped></style> | 
|---|