| | |
| | | import {DateService} from "../../../business/services/util/date.service";
|
| | | import {HttpClient} from "@angular/common/http";
|
| | | import {DateService} from '../../../business/services/util/date.service';
|
| | | import {HttpClient} from '@angular/common/http';
|
| | | import {Component, OnInit} from '@angular/core';
|
| | | import {_HttpClient} from '@delon/theme';
|
| | | import {Subject} from "rxjs";
|
| | | // tslint:disable-next-line:import-blacklist
|
| | | import {Subject} from 'rxjs';
|
| | | import {CascaderOption} from 'ng-zorro-antd/src/cascader/nz-cascader.component';
|
| | | import {AreacodeService} from '@business/services/http/areacode.service';
|
| | | import {NzTreeComponent} from 'ng-tree-antd';
|
| | | import {NzMessageService} from "ng-zorro-antd";
|
| | | import {NzMessageService} from 'ng-zorro-antd';
|
| | | import {environment} from '../../../../environments/environment';
|
| | | import * as echarts from 'echarts';
|
| | | import * as $ from 'jquery';
|
| | |
| | | {value: 'sensor', label: '项目'},
|
| | | {value: 'monitorPoint', label: '监测点'}
|
| | | ];
|
| | | isDisable: boolean = false;
|
| | | isDisable = false;
|
| | | private treeClickStream: Subject<any> = new Subject<any>();
|
| | | private _sensors: {[key: string]: string} = {};
|
| | | private _sensorNames: string;
|
| | |
| | | },
|
| | | tooltip: {
|
| | | trigger: 'item',
|
| | | formatter: "{a} <br/>{b}: {c} ({d}%)"
|
| | | formatter: '{a} <br/>{b}: {c} ({d}%)'
|
| | | },
|
| | | // legend: {
|
| | | // //x : 'center',
|
| | |
| | | radius: ['20%', '40%'],
|
| | | label: {
|
| | | normal: {
|
| | | formatter: "{b}:{d}%"
|
| | | formatter: '{b}:{d}%'
|
| | | }
|
| | | },
|
| | | labelLine: {
|
| | |
| | | }
|
| | | },
|
| | | data: []
|
| | | }
|
| | | };
|
| | |
|
| | | ngOnInit() {
|
| | | this.http.get(environment.SERVER_BASH_URL + 'sensor/all').subscribe((res: any) => {
|
| | |
| | | }
|
| | |
|
| | | dimensionChange(value) {
|
| | | if (value == 'sensor') { |
| | | this.isDisable = false; |
| | | } else { |
| | | if (value === 'sensor') {
|
| | | this.isDisable = false;
|
| | | } else {
|
| | | this.isDisable = true;
|
| | | this.query.monitorPointId = null;
|
| | | this.query.mac = null;
|
| | |
| | | $('#mydiv').empty();
|
| | | for (let index = 0; index < 30; index++) {
|
| | | this.sensorArr.push(index);
|
| | | $('#mydiv').append("<div id='mydiv" + index + "' style='height: 485.35px; width: 1000px'></div>");
|
| | | $('#mydiv').append('<div id=\'mydiv' + index + '\' style=\'height: 485.35px; width: 1000px\'></div>');
|
| | | }
|
| | | this.loading = true;
|
| | | this.isShow = false;
|
| | |
| | | this.http.get(environment.SERVER_BASH_URL + 'report/pie', {params: query}).subscribe((res: any) => {
|
| | | const option = this.pieCharOption;
|
| | | let index = 0;
|
| | | if (query.dimension == 'monitorPoint') { |
| | | if (query.dimension === 'monitorPoint') {
|
| | | for (const key in res.data) {
|
| | | let name: string;
|
| | | this.sensorOptions[0].children.forEach(sensor => {
|
| | | if (key == sensor.sensorKey) {
|
| | | if (key === sensor.sensorKey) {
|
| | | name = sensor.name;
|
| | | }
|
| | | });
|
| | | option.title.text = name + '指标报警占比情况';
|
| | |
|
| | | if (index % 2 == 0) {
|
| | | if (index % 2 === 0) {
|
| | | option.backgroundColor = 'rgba(0,0,0,0)';
|
| | | } else {
|
| | | option.backgroundColor = 'rgba(23,133,23,0.06)';
|
| | |
| | | myChart.setOption(option, true);
|
| | | window.onresize = myChart.resize;
|
| | | index = index + 1;
|
| | | } |
| | | } else { |
| | | }
|
| | | } else {
|
| | | option.title.text = '指标报警占比情况';
|
| | | option.series = [];
|
| | | this.serie.data = res.data.list;
|
| | |
| | | window.onresize = myChart.resize;
|
| | | index = index + 1;
|
| | |
|
| | | //this.setOption(option,index); |
| | | // this.setOption(option,index);
|
| | | }
|
| | |
|
| | | this.sensorArr.forEach(i => {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | setOption(option,index) {
|
| | | setOption(option, index) {
|
| | | const myChart = echarts.init(document.getElementById('mydiv' + index));
|
| | | myChart.setOption(this.pieCharOption, true);
|
| | | window.onresize = myChart.resize;
|