xufenglei
2018-03-22 a439eed077c3a157ed3b9096cf8e793671fe8cdf
报表 优化
3 files modified
27 ■■■■■ changed files
src/app/routes/report/report.component.html 9 ●●●● patch | view | raw | blame | history
src/app/routes/reports/demo/demo.component.html 2 ●●● patch | view | raw | blame | history
src/app/routes/reports/demo/demo.component.ts 16 ●●●●● patch | view | raw | blame | history
src/app/routes/report/report.component.html
@@ -12,13 +12,8 @@
                    <div class="title">
                        <div class="title_left"></div>
                        <div class="text">
                            <span *ngFor="let item of items;let i = index">
                                <span *ngIf="i > 0">与</span>
                                {{item.monitorPointName}}
                            </span>
                            <span >
                                实时监测分析
                            </span>
                            <span *ngFor="let item of items;let i = index"><span *ngIf="i > 0">与</span>{{item.monitorPointName}}</span>
                            <span>实时监测分析</span>
                        </div>
                        <div class="title_right"></div>
                        <div class="clear_fix"></div>
src/app/routes/reports/demo/demo.component.html
@@ -71,7 +71,7 @@
                    </div>
                    <div nz-form-control class="flex-1">
                        <nz-select [(ngModel)]="item.mac" name="mac{{item.id}}" [nzSize]="'large'" nzAllowClear [nzPlaceHolder]="'请选择'" (ngModelChange)="deviceChange($event,i)">
                            <nz-option *ngFor="let option of deviceOptions" [nzLabel]="option.name" [nzValue]="option.mac" ></nz-option>
                            <nz-option *ngFor="let option of item.deviceOptions" [nzLabel]="option.name" [nzValue]="option.mac" ></nz-option>
                        </nz-select>
                    </div>
                </div>
src/app/routes/reports/demo/demo.component.ts
@@ -37,7 +37,6 @@
    {value: 'line', label: '折线图'}
  ];
  public monitorPointOptions = [];
  public deviceOptions = [];
  public time: any = {};
  public timeType: any = {};
  public items = [{
@@ -49,7 +48,8 @@
    monitorPointName: '',
    deviceName: '',
    monitorPointAddress: '',
    deviceCount: ''
    deviceCount: '',
    deviceOptions: []
  }];
  ngOnInit() {
@@ -82,7 +82,8 @@
      monitorPointName: '',
      deviceName: '',
      monitorPointAddress: '',
      deviceCount: ''
      deviceCount: '',
      deviceOptions: []
    });
  }
@@ -102,7 +103,7 @@
  }
  monitorPointChange(value, i) {
    this.deviceOptions = [];
    this.items[i].deviceOptions = [];
    if (value) {
      this.monitorPointOptions.forEach(monitorPoint => {
        if (monitorPoint.id === value) {
@@ -114,20 +115,21 @@
        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;
        }