diff --git a/pages/device-operation/index.vue b/pages/device-operation/index.vue index 76293ad..a9cf6ba 100644 --- a/pages/device-operation/index.vue +++ b/pages/device-operation/index.vue @@ -68,6 +68,20 @@ + + + 所属车间 + + + + * @@ -170,6 +184,7 @@ export default { cloudBoxId: '', name: '', type: '', + belongWorkshop: '', technicsTypeList: [] }, deviceTypeList: [], diff --git a/pages/digital-workshops/DeviceItem.vue b/pages/digital-workshops/DeviceItem.vue index f841c8d..d34eaa9 100644 --- a/pages/digital-workshops/DeviceItem.vue +++ b/pages/digital-workshops/DeviceItem.vue @@ -148,6 +148,7 @@ export default { font-weight: 500; line-height: 42rpx; white-space: nowrap; + align-items: center; .name { max-width: 360rpx; } diff --git a/pages/digital-workshops/index.vue b/pages/digital-workshops/index.vue index c23bce4..4362f3e 100644 --- a/pages/digital-workshops/index.vue +++ b/pages/digital-workshops/index.vue @@ -7,7 +7,7 @@ - 推广 + 推广 @@ -178,29 +178,43 @@ export default { let data = { 所有设备: { name: '所有设备', type: {}, list: [] } } for (let i = 0; i < list.length; i++) { let belongWorkshop = list[i].belongWorkshop - if (!data[belongWorkshop]) { - data[belongWorkshop] = { - name: belongWorkshop, - list: [], - type: {} + if (belongWorkshop) { + if (!data[belongWorkshop]) { + data[belongWorkshop] = { + name: belongWorkshop, + list: [], + type: {} + } + } + data[belongWorkshop].list.push(list[i]) + data['所有设备'].list.push(list[i]) + // 0 工作中 1 空闲中 + if (!data[belongWorkshop].type[list[i].typeName]) { + data[belongWorkshop].type[list[i].typeName] = [0, 0] + } + if (!data['所有设备'].type[list[i].typeName]) { + data['所有设备'].type[list[i].typeName] = [0, 0] + } + if (list[i].workingStatus === deviceStatus.WORKING) { + data[belongWorkshop].type[list[i].typeName][0]++ + data['所有设备'].type[list[i].typeName][0]++ + } + if (list[i].workingStatus === deviceStatus.FREE) { + data[belongWorkshop].type[list[i].typeName][1]++ + data['所有设备'].type[list[i].typeName][1]++ + } + } else { + data['所有设备'].list.push(list[i]) + // 0 工作中 1 空闲中 + if (!data['所有设备'].type[list[i].typeName]) { + data['所有设备'].type[list[i].typeName] = [0, 0] + } + if (list[i].workingStatus === deviceStatus.WORKING) { + data['所有设备'].type[list[i].typeName][0]++ + } + if (list[i].workingStatus === deviceStatus.FREE) { + data['所有设备'].type[list[i].typeName][1]++ } - } - data[belongWorkshop].list.push(list[i]) - data['所有设备'].list.push(list[i]) - // 0 工作中 1 空闲中 - if (!data[belongWorkshop].type[list[i].typeName]) { - data[belongWorkshop].type[list[i].typeName] = [0, 0] - } - if (!data['所有设备'].type[list[i].typeName]) { - data['所有设备'].type[list[i].typeName] = [0, 0] - } - if (list[i].workingStatus === deviceStatus.WORKING) { - data[belongWorkshop].type[list[i].typeName][0]++ - data['所有设备'].type[list[i].typeName][0]++ - } - if (list[i].workingStatus === deviceStatus.FREE) { - data[belongWorkshop].type[list[i].typeName][1]++ - data['所有设备'].type[list[i].typeName][1]++ } } this.listObj = data @@ -343,8 +357,7 @@ export default { .group_3 { flex: 0 0 auto; align-items: flex-start; - width: 24%; - margin-right: 6rpx; + margin-right: 8rpx; margin-bottom: 16rpx; .group_4 { white-space: nowrap;