| | |
| | | this.items.forEach((item,index) => { |
| | | item.profession = null; |
| | | item.monitorPoint = null; |
| | | item.device = null; |
| | | this.getDevices(index); |
| | | }); |
| | | if (value === 'monitorPoint') { |
| | | this.professionShow = false; |
| | |
| | | let areaName = ''; |
| | | const option = event.option; |
| | | this.items[i].monitorPoint = null; |
| | | this.items[i].profession = null; |
| | | //this.items[i].profession = null; |
| | | this.items[i].areaCode = null; |
| | | this.items[i].device = null; |
| | | |
| | | switch (event.index) { |
| | | case 0: |
| | |
| | | this.items[i].monitorPointOptions = res.data; |
| | | } |
| | | }); |
| | | this.getDevices(i); |
| | | } |
| | | |
| | | monitorPointChange(value, i) { |
| | | this.items[i].deviceOptions = []; |
| | | getDevices(i) { |
| | | this.items[i].device = null; |
| | | if (value) { |
| | | this.http.get(environment.SERVER_BASH_URL + 'device/monitorPointId', {params: {monitorPointId: value.id}}).subscribe((res: any) => { |
| | | if (!!this.items[i].profession) { |
| | | this.items[i].professionId = this.items[i].profession.id; |
| | | } else { |
| | | this.items[i].professionId = null; |
| | | } |
| | | if (!!this.items[i].monitorPoint) { |
| | | this.items[i].monitorPointId = this.items[i].monitorPoint.id; |
| | | } else { |
| | | this.items[i].monitorPointId = null; |
| | | } |
| | | return this.http.get(environment.SERVER_BASH_URL + 'device/professionId', {params: this.items[i]}).subscribe((res: any) => { |
| | | if (res.code === 0) { |
| | | this.msgSrv.error(res.message); |
| | | } else { |
| | | this.items[i].deviceOptions = res.data; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | professionChange(value, i) { |
| | | this.items[i].deviceOptions = []; |
| | | this.items[i].device = null; |
| | | if (value) { |
| | | if (!!this.items[i].areaName) { |
| | | this.items[i].professionId = value.id; |
| | | this.http.get(environment.SERVER_BASH_URL + 'device/professionId', {params: this.items[i]}).subscribe((res: any) => { |
| | | if (res.code === 0) { |
| | | this.msgSrv.error(res.message); |
| | | } else { |
| | | this.items[i].deviceOptions = res.data; |
| | | } |
| | | }); |
| | | } else { |
| | | this.msgSrv.error('请先选择 省市区!'); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | _disabledDate(current: Date): boolean { |
| | |
| | | const areaName = ''; |
| | | const item = this.items[i]; |
| | | const queryItem: any = {}; |
| | | if (item.monitorPointOptions.length > 0) { |
| | | if (item.monitorPointOptions.length > 0 && item.deviceOptions.length > 0) { |
| | | for (const key in item) { |
| | | if (item[key]) { |
| | | queryItem[key] = item[key]; |
| | |
| | | break; |
| | | } |
| | | } |
| | | if (validate && this.timeType && query.reportType) { |
| | | if (validate) { |
| | | delete query.sensors; |
| | | if (this._sensors) { |
| | | const sensors = []; |
| | |
| | | query.type = this.timeType.value; |
| | | sessionStorage.setItem('queryParams', JSON.stringify(query)); |
| | | } else { |
| | | this.msgSrv.error('请完善搜索项或删除查询条目'); |
| | | this.msgSrv.error('所选条目无数据!请完善搜索项或删除查询条目'); |
| | | return false; |
| | | } |
| | | } |