| | |
| | | export default { |
| | | name: 'DeviceAlarmInfo', |
| | | components: {}, |
| | | data() { |
| | | return { |
| | | config: {}, |
| | | dataSource: [] |
| | | props: { |
| | | currentProductionId: { |
| | | type: String |
| | | } |
| | | }, |
| | | mounted() { |
| | | data() { |
| | | return { |
| | | config: {} |
| | | } |
| | | }, |
| | | created() { |
| | | if (!this.currentProductionId) return |
| | | this.getDeviceAlarmInfoByApi() |
| | | }, |
| | | methods: { |
| | | getDeviceAlarmInfoByApi() { |
| | | const that = this |
| | | that.initChart() |
| | | // signageApi.getWorkshopAlarmInfoApi() |
| | | // .then(res => { |
| | | // if (res.success) { |
| | | // that.dataSource = res.result |
| | | // that.initChart() |
| | | // } |
| | | // }) |
| | | signageApi.getWorkshopAlarmInfoApi(that.currentProductionId) |
| | | .then(res => { |
| | | if (!res.success) return |
| | | that.initChart(res.result) |
| | | }) |
| | | }, |
| | | |
| | | initChart() { |
| | | initChart(dataSource = []) { |
| | | this.config = { |
| | | // indexHeader: '序号', |
| | | header: ['设备编号', '报警时间', '报警号'], |
| | | headerBGC: '#333', |
| | | oddRowBGC: 'transparent', |
| | | evenRowBGC: 'transparent', |
| | | // data: this.dataSource.map(item => { |
| | | // return [item.equipmentId, item.collectTime, item.alarm] |
| | | // }), |
| | | data: [['516313', 'AASDASD', 'ASDADA'], ['ASDSA', '213ASD', '1651ZS'], ['DSXC42', 'SD5846', '2316SD'], ['dasd13', '213asd', '21558xc'], ['dasads522', 'dsa4812', 'asd233'], ['123124', 'zxc32695', '42352s']], |
| | | data: dataSource.map(item => { |
| | | return [item.equipmentId, item.collectTime, item.alarmNo] |
| | | }), |
| | | // data: [['516313', 'AASDASD', 'ASDADA'], ['ASDSA', '213ASD', '1651ZS'], ['DSXC42', 'SD5846', '2316SD'], ['dasd13', '213asd', '21558xc'], ['dasads522', 'dsa4812', 'asd233'], ['123124', 'zxc32695', '42352s']], |
| | | rowNum: 2, |
| | | index: false, |
| | | // columnWidth: [300, 300], |