| | |
| | | thisMonthMaintenanceRealNum: 0, |
| | | nextMonthMaintenancePlanNum: 0, |
| | | nextNextMonthMaintenancePlanNum: 0, |
| | | twoMaintenanceChartData: [['-', '-', '-']], |
| | | twoMaintenanceChartData: [], |
| | | barChart: '', |
| | | barChartData: [], |
| | | doubleBarChart: '', |
| | | doubleBarChartData: {}, |
| | | workshopProblemChartData: [], |
| | | maintenanceConfig: {}, |
| | | problemConfig: {} |
| | | } |
| | |
| | | mounted() { |
| | | window.addEventListener('resize', this.handleWindowResize) |
| | | this.getChartDataByApi() |
| | | this.drawProblemChart() |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener('resize', this.handleWindowResize) |
| | |
| | | this.getTwoMaintenanceChartDataByApi() |
| | | this.getBarChartDataByApi() |
| | | this.getDoubleBarChartDataByApi() |
| | | this.getWorkshopProblemChartDataByApi() |
| | | }, |
| | | |
| | | /* 调用接口获取设备运行状态 */ |
| | |
| | | getTwoMaintenanceChartDataByApi() { |
| | | signageApi.getTwoMaintenancePlanListApi(this.productionCode) |
| | | .then(res => { |
| | | if (res.success && res.result) this.twoMaintenanceChartData = res.result.map(item => [item.centerName, item.maintenanceDate, item.content]) |
| | | if (res.success && res.result.length > 0) this.twoMaintenanceChartData = res.result.map(item => [item.centerName, item.maintenanceDate, item.content]) |
| | | this.drawMaintenanceChart() |
| | | }) |
| | | }, |
| | |
| | | this.drawDoubleBarChart() |
| | | }) |
| | | }, |
| | | |
| | | /* 调用接口获取车间问题列表*/ |
| | | getWorkshopProblemChartDataByApi() { |
| | | signageApi.getWorkshopProblemListApi(this.productionCode) |
| | | .then(res => { |
| | | if (res.success && res.result.length > 0) this.workshopProblemChartData = res.result.map(item => [item.content, item.createTime]) |
| | | this.drawWorkshopProblemChart() |
| | | }) |
| | | }, |
| | | |
| | | |
| | | /* 绘制设备运行状态玫瑰饼图 */ |
| | | drawRunningStateChart(productionId) { |
| | |
| | | }, |
| | | |
| | | /* 绘制问题滚动表 */ |
| | | drawProblemChart() { |
| | | drawWorkshopProblemChart() { |
| | | this.problemConfig = { |
| | | indexHeader: '序号', |
| | | header: ['时间', '问题内容'], |
| | | header: ['问题内容', '时间'], |
| | | headerBGC: '#86D186', |
| | | oddRowBGC: '#7CBF7C', |
| | | evenRowBGC: '#7CBF7C', |
| | | data: [ |
| | | // ['2024年3月23号', '大家注意安全问题'], |
| | | // ['2024年3月23号', '大家注意安全问题'], |
| | | // ['2024年3月23号', '大家注意安全问题'], |
| | | // ['2024年3月23号', '大家注意安全问题'], |
| | | // ['2024年3月23号', '大家注意安全问题'], |
| | | // ['2024年3月23号', '大家注意安全问题'], |
| | | // ['2024年3月23号', '大家注意安全问题'], |
| | | // ['2024年3月23号', '大家注意安全问题'], |
| | | // ['2024年3月23号', '大家注意安全问题'], |
| | | // ['2024年3月23号', '大家注意安全问题'] |
| | | ], |
| | | data: this.workshopProblemChartData, |
| | | index: true, |
| | | columnWidth: [100, 300, 300], |
| | | columnWidth: [100, 300, 150], |
| | | align: ['center'] |
| | | } |
| | | }, |