| | |
| | | {value: 'line', label: '折线图'} |
| | | ]; |
| | | public monitorPointOptions = []; |
| | | public deviceOptions = []; |
| | | public time: any = {}; |
| | | public timeType: any = {}; |
| | | public items = [{ |
| | |
| | | monitorPointName: '', |
| | | deviceName: '', |
| | | monitorPointAddress: '', |
| | | deviceCount: '' |
| | | deviceCount: '', |
| | | deviceOptions: [] |
| | | }]; |
| | | |
| | | ngOnInit() { |
| | |
| | | monitorPointName: '', |
| | | deviceName: '', |
| | | monitorPointAddress: '', |
| | | deviceCount: '' |
| | | deviceCount: '', |
| | | deviceOptions: [] |
| | | }); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | monitorPointChange(value, i) { |
| | | this.deviceOptions = []; |
| | | this.items[i].deviceOptions = []; |
| | | if (value) { |
| | | this.monitorPointOptions.forEach(monitorPoint => { |
| | | if (monitorPoint.id === value) { |
| | |
| | | if (res.code === 0) { |
| | | this.msgSrv.error(res.message); |
| | | } else { |
| | | this.deviceOptions = res.data; |
| | | this.items[i].deviceOptions = res.data; |
| | | this.items[i].deviceCount = res.data.length; |
| | | this.items[i].mac = null; |
| | | } |
| | | }); |
| | | } else { |
| | | this.items[i].monitorPoint = null; |
| | | this.items[i].mac = ''; |
| | | this.items[i].mac = null; |
| | | this.items[i].monitorPointName = ''; |
| | | } |
| | | } |
| | | |
| | | deviceChange(value, i) { |
| | | if (value) { |
| | | this.deviceOptions.forEach(device => { |
| | | this.items[i].deviceOptions.forEach(device => { |
| | | if (device.mac === value) { |
| | | this.items[i].deviceName = device.name; |
| | | } |
| | |
| | | } |
| | | } |
| | | if (validate && query.type && query.reportType) { |
| | | query.sensors = null; |
| | | if (query.sensorKey && query.sensorKey.length > 0) { |
| | | const sensors = []; |
| | | query.sensorKey.forEach(sensor => { |
| | | sensors.push(sensor.sensorKey + '-' + sensor.name + '-' + sensor.unit); |
| | | }); |
| | | query.sensors = JSON.stringify(sensors); |
| | | } |
| | | query.timeType = JSON.stringify(this.timeType); |
| | | query.items = JSON.stringify(this.items); |
| | | this.router.navigate(['report'], {queryParams: query}); |