| | |
| | | this.actualTime.setFullYear(Number(year)); |
| | | } |
| | | dimensionsChange(text?: string) { |
| | | // switch (this.dimensionItem.value) { |
| | | // case DeviceDimension.MONITORPOINT: |
| | | // this.monitorPointsChange(text); break; |
| | | // case DeviceDimension.PROFESSION: |
| | | // this.professionsChange(text); break; |
| | | // } |
| | | |
| | | this.monitorPointsChange(text); |
| | | switch (this.dimensionItem.value) { |
| | | case DeviceDimension.MONITORPOINT: |
| | | this.monitorPointsChange(text); break; |
| | | case DeviceDimension.PROFESSION: |
| | | this.professionsChange(text); break; |
| | | } |
| | | } |
| | | professionsChange(text?: string) { |
| | | this.http.get<ResultBean<any[]>>('profession/getall').subscribe( |
| | |
| | | public onChartInit(e): void { |
| | | this.echartsIntance = e; |
| | | } |
| | | /** |
| | | * 放在 sensor 选项加载完后调用 |
| | | * @param sensorKeys |
| | | */ |
| | | private mockSelectSensors(sensorKeys: string[]) { |
| | | // 模拟选择 aqi 6个参数 |
| | | // Object.keys(this.aqiSort) |
| | | sensorKeys.forEach( key => { |
| | | const sensor = this.sensorOptions[0].children.find( |
| | | sen => sen.sensorKey === key |
| | | ) |
| | | if (!!sensor) { |
| | | sensor['halfChecked'] = false; |
| | | sensor['checked'] = true; |
| | | const event = {node: {data: sensor}}; |
| | | this.onSensorSelect(event); |
| | | } |
| | | }); |
| | | } |
| | | constructor( |
| | | private http: _HttpClient, |
| | | private sensorsService: SensorsService, |
| | |
| | | this.sensorsService.getPagingList(null, null).subscribe( |
| | | (res: PageBean) => { |
| | | this.sensorOptions.push({id: -1, name: '全部', isExpanded: true, children: res.data}); |
| | | this.mockSelectSensors(Object.keys(this.aqiSort)); |
| | | } |
| | | ); |
| | | this.actualYearOptions = this.newArray(this.actualYear - 9, 10).map(item => Number(item)).reverse(); |
| | |
| | | this.treeClickStream.next(event); |
| | | } |
| | | public onSensorSelect(event): void { |
| | | debugger; |
| | | const data = event.node.data; |
| | | if (data.id === -1 && data.halfChecked === false) { |
| | | if (!!data.checked) { |
| | |
| | | public loadGrid(): void { |
| | | // 数据检查 |
| | | const sensors = Object.values(this._sensors); |
| | | debugger; |
| | | if ( sensors.length === 0 ) { |
| | | this.msg.error(' 监测项目 不能为空'); |
| | | return ; |
| | |
| | | // if ( this.chartSelectedIndex < this.grid.data.length ) { |
| | | // series = [{type: 'line', data: this.grid.data[this.chartSelectedIndex]}]; |
| | | // } |
| | | |
| | | this.initOpton({ xAxis : [{data : timeList}]}); |
| | | this.chartLoading = true; |
| | | } |