src/app/business/entity/grid.ts | ●●●●● patch | view | raw | blame | history | |
src/app/business/services/util/date.service.ts | ●●●●● patch | view | raw | blame | history | |
src/app/routes/analysis/query/query.component.html | ●●●●● patch | view | raw | blame | history | |
src/app/routes/analysis/query/query.component.ts | ●●●●● patch | view | raw | blame | history | |
src/app/routes/dashboard/workplace/workplace.component.html | ●●●●● patch | view | raw | blame | history | |
src/app/routes/devices/basic-info/adjust-config/adjust-config.component.html | ●●●●● patch | view | raw | blame | history | |
src/app/routes/devices/basic-info/adjust-config/adjust-config.component.ts | ●●●●● patch | view | raw | blame | history |
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) { 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); 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> 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; } 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> 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> </div> 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; }