From aee3b7ea53df69cedae9e8210987000caf059c9f Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Wed, 14 Mar 2018 13:25:05 +0800 Subject: [PATCH] query.html修复 --- src/app/routes/devices/basic-info/adjust-config/adjust-config.component.html | 6 +- src/app/routes/dashboard/workplace/workplace.component.html | 2 src/app/routes/analysis/query/query.component.ts | 6 ++ src/app/business/entity/grid.ts | 2 src/app/routes/devices/basic-info/adjust-config/adjust-config.component.ts | 6 +- src/app/routes/analysis/query/query.component.html | 10 ++-- src/app/business/services/util/date.service.ts | 31 ++++++++------- 7 files changed, 34 insertions(+), 29 deletions(-) diff --git a/src/app/business/entity/grid.ts b/src/app/business/entity/grid.ts index 9b6440d..5992378 100644 --- a/src/app/business/entity/grid.ts +++ b/src/app/business/entity/grid.ts @@ -83,7 +83,7 @@ ); this.selectedIndexs = this.selectedIndexs == null ? [] : this.selectedIndexs; } - constructor(config: object) { + constructor(config?: object) { if (config != null) { const keys = Object.getOwnPropertyNames(config); for (const index in keys) { diff --git a/src/app/business/services/util/date.service.ts b/src/app/business/services/util/date.service.ts index 8dbcf7d..3454603 100644 --- a/src/app/business/services/util/date.service.ts +++ b/src/app/business/services/util/date.service.ts @@ -16,21 +16,22 @@ } /** * ������������������,������������ - */ countTimeRange(timePeriod: TimePeriod): number { - let timeUnit = 0; - switch (timePeriod.timeUnits) { - case TimeUnits.YEAR: - timeUnit = 1000 * 60 * 60 * 24 * 30 * 12; break; - case TimeUnits.MONTH: - timeUnit = 1000 * 60 * 60 * 24 * 30; break; - case TimeUnits.DAY: - timeUnit = 1000 * 60 * 60 * 24; break; - case TimeUnits.HOUR: - timeUnit = 1000 * 60 * 60; break; - case TimeUnits.MINUTE: - timeUnit = 1000 * 60; break; - } - return Math.floor((timePeriod.endTime.getTime() - timePeriod.startTime.getTime()) / timeUnit); + */ + countTimeRange(timePeriod: TimePeriod): number { + let timeUnit = 0; + switch (timePeriod.timeUnits) { + case TimeUnits.YEAR: + timeUnit = 1000 * 60 * 60 * 24 * 30 * 12; break; + case TimeUnits.MONTH: + timeUnit = 1000 * 60 * 60 * 24 * 30; break; + case TimeUnits.DAY: + timeUnit = 1000 * 60 * 60 * 24; break; + case TimeUnits.HOUR: + timeUnit = 1000 * 60 * 60; break; + case TimeUnits.MINUTE: + timeUnit = 1000 * 60; break; + } + return Math.floor((timePeriod.endTime.getTime() - timePeriod.startTime.getTime()) / timeUnit); } makeTimeList(timePeriod: TimePeriod): string [] { const start = moment(timePeriod.startTime); diff --git a/src/app/routes/analysis/query/query.component.html b/src/app/routes/analysis/query/query.component.html index 065739c..ba25972 100644 --- a/src/app/routes/analysis/query/query.component.html +++ b/src/app/routes/analysis/query/query.component.html @@ -62,7 +62,6 @@ </nz-card> <form nz-form [nzLayout]="'vertical'"> <nz-card [nzBordered]="true" title="������������"> - <div nz-row [nzGutter]="16"> <div nz-col nzMd="6" nzSm="12" nzXs="24"> <div nz-form-item nz-row> @@ -83,7 +82,7 @@ </div> <div nz-form-control nz-col> <nz-select name="_monitorPoint" style="width: 100%;" [ngModel]="_monitorPoint" (ngModelChange)="setMonitorPoint($event)" - nzAllowClear [nzPlaceHolder]="'������ ���������(������������������)'" nzShowSearch (nzSearchChange)="monitorPointChange($event)" + nzAllowClear [nzPlaceHolder]="'������ ���������(������������������)'" nzShowSearch (nzSearchChange)="monitorPointsChange($event)" [nzNotFoundContent]="'������������'"> <nz-option *ngFor="let option of monitorPoints" [nzLabel]="option.name" [nzValue]="option"> </nz-option> @@ -99,7 +98,7 @@ </div> <div nz-form-control nz-col> <nz-select name="_device" style="width: 100%;" [ngModel]="_device" (ngModelChange)="setDevice($event)" nzAllowClear [nzPlaceHolder]="'������ ���������(������������������)'" - nzShowSearch (nzSearchChange)="deviceChange($event)" [nzNotFoundContent]="'������������'"> + nzShowSearch (nzSearchChange)="devicesChange($event)" [nzNotFoundContent]="'������������'"> <nz-option *ngFor="let option of devices" [nzLabel]="option.name" [nzValue]="option"> </nz-option> </nz-select> @@ -119,7 +118,6 @@ </nz-option> </nz-select> </div> - </div> </div> <div nz-col [nzMd]="{span:6, offset:3}" nzSm="12" nzXs="24"> @@ -153,4 +151,6 @@ </div> </nz-card> </form> -<div echarts [options]="chartOption" [loading]="chartLoading" class="line-chart" (chartInit)="onChartInit($event)"></div> +<nz-card [nzBordered]="true"> +<div echarts [options]="chartOption" [loading]="chartLoading" class="line-chart" (chartInit)="onChartInit($event)"></div> +</nz-card> diff --git a/src/app/routes/analysis/query/query.component.ts b/src/app/routes/analysis/query/query.component.ts index 4b327f8..ee131b9 100644 --- a/src/app/routes/analysis/query/query.component.ts +++ b/src/app/routes/analysis/query/query.component.ts @@ -2,7 +2,7 @@ import { MonitorPointService } from '@business/services/http/monitor-point.service'; import { AreacodeService } from '@business/services/http/areacode.service'; import { LineChartCriteria, TimePeriod, Organization, MonitorPoint, DataCondition, Device, PairData } from '@business/entity/data'; -import { PageBean, ResultBean } from '@business/entity/grid'; +import { PageBean, ResultBean, Grid } from '@business/entity/grid'; import { Sensor } from '@business/entity/data'; import { SensorsService } from '@business/services/http/sensors.service'; import { Component, OnInit } from '@angular/core'; @@ -531,6 +531,9 @@ } ); } + private reloadGrid() { + const timePeriod = this.lineChartCriteria.timePeriod; + } private initOpton(opt: {data: string[]}) { this.chartOption = { @@ -579,6 +582,7 @@ chartLoading: boolean; chartOption; echartsIntance; + grid: Grid<any> = new Grid(); onChartInit(ec) { this.echartsIntance = ec; } diff --git a/src/app/routes/dashboard/workplace/workplace.component.html b/src/app/routes/dashboard/workplace/workplace.component.html index be53386..b9901ed 100644 --- a/src/app/routes/dashboard/workplace/workplace.component.html +++ b/src/app/routes/dashboard/workplace/workplace.component.html @@ -38,7 +38,7 @@ </ng-template> </pro-header> -<div nz-row [nzGutter]="24" class="pt-lg" style="margin-top: -24px"> +<div nz-row [nzGutter]="24" class="pt-lg" style="margin-top: -24px;"> <div nz-col nzXs="24" nzSm="12" nzMd="12" nzLg="6"> <chart-card [title]="'���������������'" total="{{totalDeviceCount | number: '1.0'}}" contentHeight="46px" [action]="action1" [footer]="footer1"> <ng-template #action1> diff --git a/src/app/routes/devices/basic-info/adjust-config/adjust-config.component.html b/src/app/routes/devices/basic-info/adjust-config/adjust-config.component.html index 0905782..f3ef7f7 100644 --- a/src/app/routes/devices/basic-info/adjust-config/adjust-config.component.html +++ b/src/app/routes/devices/basic-info/adjust-config/adjust-config.component.html @@ -1,4 +1,4 @@ -<div class="modal-header"> + <div class="modal-header"> <div class="modal-title">���������������</div> </div> <nz-table #nzTable [nzDataSource]="grid.data" [nzPageSize]="8" @@ -19,7 +19,7 @@ </thead> <tbody nz-tbody> <tr nz-tbody-tr *ngFor="let row of nzTable.data,index as i"> - <td nz-td [ngClass]="{'bg-grey-1':true}" style="text-align:center"> + <td nz-td [ngClass]="{'bg-grey-1':true}" style="text-align:center;"> {{ i }} </td> <td nz-td *ngFor="let col of grid.columns" [ngStyle]="{'width':col.width,'text-align':col['align'] === undefined?'left':col.align}"> @@ -42,4 +42,4 @@ ������<span *ngIf="isSaving" >���</span> </span> </button> - </div> \ No newline at end of file + </div> diff --git a/src/app/routes/devices/basic-info/adjust-config/adjust-config.component.ts b/src/app/routes/devices/basic-info/adjust-config/adjust-config.component.ts index a29198b..f0ea62c 100644 --- a/src/app/routes/devices/basic-info/adjust-config/adjust-config.component.ts +++ b/src/app/routes/devices/basic-info/adjust-config/adjust-config.component.ts @@ -19,8 +19,8 @@ data: DeviceAdjustValue; deviceVersionId: number; isSaving = false; - grid: Grid<Sensor> = new Grid(null); - private initPage() { + grid: Grid<Sensor> = new Grid(); + private initPage() { const sensor: Sensor = { name: { text: '������', @@ -81,7 +81,7 @@ value: {} }; if (adjustRes.data != null) { - // ��������������������� + // ��������������������� Object.assign(this._dataValue, adjustRes.data.value); this.data['id'] = adjustRes.data.id; } -- Gitblit v1.8.0