xufenglei
2018-03-12 401a044107202a74dd87408dd43d38cc2ab80fe6
报表管理 优化
4 files modified
39 ■■■■ changed files
src/app/routes/report/report.component.html 27 ●●●● patch | view | raw | blame | history
src/app/routes/report/report.component.ts 4 ●●●● 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 6 ●●●● patch | view | raw | blame | history
src/app/routes/report/report.component.html
@@ -1,5 +1,26 @@
<html>
    <body>
        <nz-spin [nzTip]="'正在读取数据...'"[nzSize]="'large'" [nzSpinning]="spinning">
        </nz-spin>
        <div >
            <div id="head" style="height: 486px; width: 1000px" *ngIf="! spinning">
                <h1>
                七星博士检测报告
                </h1>
            </div>
<div *ngFor="let i of sensorArr">
    <div id ="mydiv{{i}}" style="height: 486px; width: 1000px"></div>
</div>
            <div id="content" style="display: none;">
                <div *ngFor="let i of sensorArr">
                    <div id ="mydiv{{i}}" style="height: 487px; width: 1000px"></div>
                </div>
            </div>
            <div id="foot" style="height: 486px; width: 1000px" *ngIf="! spinning">
                <h1>
                检测报告结论
                </h1>
            </div>
        </div>
    </body>
</html>
src/app/routes/report/report.component.ts
@@ -14,6 +14,7 @@
export class ReportComponent implements OnInit {
  [x: string]: any;
  spinning: boolean = true;
  constructor(
    public injector: Injector,
    public http: HttpClient,
@@ -82,6 +83,7 @@
  sensorArr: any = [];
  
  ngOnInit() {
    this.activeRoute.queryParams.subscribe(params => {
      const items = JSON.parse(params.items);
      const query = params;
@@ -123,7 +125,9 @@
              $('#mydiv' + i).remove();
            }
          });
          $('#content').attr({style:"display: inline;"});
        }
        this.spinning = false;
      });
    });
  }
src/app/routes/reports/demo/demo.component.html
@@ -68,7 +68,7 @@
                        <label nz-form-item-required>时间</label>
                    </div>
                    <div nz-form-control class="flex-1">
                        <nz-datepicker style="width: 100%;" value="" [(ngModel)]="item.time" name="time{{item.id}}" id="{{item.time}}" [nzPlaceHolder]="'请选择'" [nzFormat]="time.format" [nzMode]="time.mode" [nzSize]="'large'" nzShowTime></nz-datepicker>
                        <nz-datepicker style="width: 100%;" value="" [(ngModel)]="item.time" name="time{{item.id}}" id="{{item.time}}" [nzPlaceHolder]="'请选择'" [nzFormat]="time.format" [nzMode]="time.mode" [nzSize]="'large'" nzShowTime [nzDisabledDate]="_disabledDate"></nz-datepicker>
                    </div>
                </div>
            </div>
src/app/routes/reports/demo/demo.component.ts
@@ -121,7 +121,8 @@
    {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) {
@@ -158,4 +159,7 @@
  }
  _disabledDate(current: Date): boolean {
    return current && current.getTime() > Date.now() ;
  }
}