diff --git a/src/views/modules/monitoring/realtimeEquipment.vue b/src/views/modules/monitoring/realtimeEquipment.vue index 634a6da..38d3c91 100644 --- a/src/views/modules/monitoring/realtimeEquipment.vue +++ b/src/views/modules/monitoring/realtimeEquipment.vue @@ -10,23 +10,7 @@
设备生产实时数据 - - +
@@ -58,11 +42,11 @@ export default { }, created() { this.clearData() - // fetchList('equipment').then(res => { - // this.testData = res - // this.handleData() - // }) - this.loadTable = true + this.fetchList('equipment').then(({data: res}) => { + this.testData = res.data.filter(item => !!item.equDet) + this.handleData() + }) + // this.loadTable = true // this.intervalId = setInterval(() => { // this.$message({ // // message: this.$t('module.factory.realtime.equipment.refresh'), @@ -103,10 +87,13 @@ export default { fetchList() { // 获取设备实时数据 + return this.$http({ + url: this.$http.adornUrl('/monitoring/productionMonitoring/equipmentProductionRealTimeData'), + method: 'post' + }) }, testSpan({ row, column, rowIndex, columnIndex }) { - console.log('rowIndex', rowIndex) if (columnIndex === 1 && rowIndex % 2 === 0) { return [2, 1] } @@ -116,14 +103,17 @@ export default { }, expandDataStepOne() { - this.stepOneArray = this.testData.data.map(item => { - if (item.equDet) { - item.equDet.forEach((equipment, index) => { - equipment.lineName = item.lineName - }) - } - return item.equDet - }) + console.log('testdata: ', this.testData) + // this.stepOneArray = this.testData.data + // .filter(item => item.equDet) + // .map(item => { + // if (item.equDet) { + // item.equDet.forEach((equipment, index) => { + // equipment.lineName = item.lineName + // }) + // } + // return item.equDet + // }) }, expandDataStepTwo() {