| | |
| | | time: null, |
| | | formatTime: null, |
| | | monitorPointName: '', |
| | | deviceName: '' |
| | | deviceName: '', |
| | | monitorPointAddress: '', |
| | | deviceCount: '' |
| | | |
| | | }]; |
| | | |
| | | public sensorOptions = []; |
| | |
| | | addItem() { |
| | | const id = (this.items.length > 0) ? this.items[this.items.length - 1].id + 1 : 0; |
| | | const index = this.items.push({ |
| | | id, |
| | | id: id, |
| | | monitorPoint: null, |
| | | mac: '', |
| | | time: null, |
| | | formatTime: null, |
| | | monitorPointName: '', |
| | | deviceName: '' |
| | | deviceName: '', |
| | | monitorPointAddress: '', |
| | | deviceCount: '' |
| | | }); |
| | | } |
| | | |
| | |
| | | this.monitorPointOptions.forEach(monitorPoint => { |
| | | if (monitorPoint.id === value) { |
| | | this.items[i].monitorPointName = monitorPoint.name; |
| | | this.items[i].monitorPointAddress = monitorPoint.address; |
| | | } |
| | | }); |
| | | this.http.get(environment.SERVER_BASH_URL + 'device/monitorPointId', {params: {monitorPointId: value}}).subscribe((res: any) => { |
| | |
| | | this.msgSrv.error(res.message); |
| | | } else { |
| | | this.deviceOptions = res.data; |
| | | this.items[i].deviceCount = res.data.length; |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | {value: 'hour', label: '时', mode: 'day', xAxisName: '分', format: 'yyyy-MM-dd HH', typeFormat: '%Y-%m-%d %H:%i', timeLength: 60} |
| | | ]; |
| | | |
| | | |
| | | timeType = this.typeOptions[0]; |
| | | |
| | | typeChange(searchText) { |
| | | this.typeOptions.forEach(types => { |
| | | if (types.value === searchText) { |
| | |
| | | } |
| | | } |
| | | if (validate && query.type) { |
| | | query.format = this.timeType.format; |
| | | query.typeFormat = this.timeType.typeFormat; |
| | | query.xAxisName = this.timeType.xAxisName; |
| | | query.label = this.timeType.label; |
| | | query.timeLength = this.timeType.timeLength; |
| | | query.timeType = JSON.stringify(this.timeType); |
| | | query.items = JSON.stringify(this.items); |
| | | console.info(this.items); |
| | | this.router.navigate(['report'], {queryParams: query}); |
| | | } else { |
| | | this.msgSrv.error('请完善搜索项或删除查询条目'); |
| | |
| | | |
| | | } |
| | | |
| | | _disabledDate(current: Date): boolean { |
| | | return current && current.getTime() > Date.now() ; |
| | | } |
| | | } |