From d4fd81a5e4853e8e6c1f507d0765b478ceff8219 Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Tue, 05 Jun 2018 15:48:48 +0800
Subject: [PATCH] 延长弹出 超时弹窗的晃动时间
---
src/app/routes/reports/query/query.component.ts | 71 +++++++++++++++++------------------
src/app/core/net/default.interceptor.ts | 2
2 files changed, 36 insertions(+), 37 deletions(-)
diff --git a/src/app/core/net/default.interceptor.ts b/src/app/core/net/default.interceptor.ts
index ff67769..d7280ea 100644
--- a/src/app/core/net/default.interceptor.ts
+++ b/src/app/core/net/default.interceptor.ts
@@ -23,7 +23,7 @@
export class DefaultInterceptor implements HttpInterceptor {
private unLoginHandle: Subject<HttpErrorResponse> = new Subject<HttpErrorResponse>();
constructor(private injector: Injector) {
- this.unLoginHandle.debounceTime(100).subscribe(event => {
+ this.unLoginHandle.debounceTime(800).subscribe(event => {
if (!!event.error) {
let errorMsg = '';
const erroCode = Number.parseInt(event.error['errorCode']);
diff --git a/src/app/routes/reports/query/query.component.ts b/src/app/routes/reports/query/query.component.ts
index a01c9bd..6a3e980 100644
--- a/src/app/routes/reports/query/query.component.ts
+++ b/src/app/routes/reports/query/query.component.ts
@@ -8,7 +8,6 @@
import * as moment from 'moment';
import { ExampleService } from '@business/services/util/example.service';
import { DeviceService } from '@business/services/http/device.service';
-import { environment } from '@env/environment';
import { CascaderOption } from 'ng-zorro-antd/src/cascader/nz-cascader.component';
import { AreacodeService } from '@business/services/http/areacode.service';
import { MonitorPointService } from '@business/services/http/monitor-point.service';
@@ -90,7 +89,7 @@
this.isChartCollapse = !this.isChartCollapse;
}
public deviceOptions: Device[] = [];
- public dataCondition: DataCondition = {areaRangeId: 320583, areaRange: AreaRange.AREA, deviceDimension:DeviceDimension.NONE};
+ public dataCondition: DataCondition = {areaRangeId: 320583, areaRange: AreaRange.AREA, deviceDimension: DeviceDimension.NONE};
public dimensionOptions: MonitorPoint[] = [];
@@ -100,18 +99,18 @@
set actualYear(year) {
this.actualTime.setFullYear(Number(year));
}
- dimensionsChange(text?: string){
- switch(this.dimensionItem.value){
+ dimensionsChange(text?: string) {
+ switch (this.dimensionItem.value) {
case DeviceDimension.MONITORPOINT:
- this.monitorPointsChange(text);break;
+ this.monitorPointsChange(text); break;
case DeviceDimension.PROFESSION:
- this.professionsChange(text);break;
+ this.professionsChange(text); break;
}
}
- professionsChange(text?: string){
- this.http.get<ResultBean<any[]>>(environment.SERVER_BASH_URL+"profession/getall").subscribe(
+ professionsChange(text?: string) {
+ this.http.get<ResultBean<any[]>>('profession/getall').subscribe(
result => {
- if(!!result.code){
+ if (!!result.code) {
this.dimensionOptions = result.data;
}
}
@@ -148,7 +147,7 @@
if (!!this.deviceDimension) {
const example = new ExampleService();
const deviceDimensionProperty =
- this.dimensionItem.value === DeviceDimension.MONITORPOINT ?'monitorPointId':'professionId';
+ this.dimensionItem.value === DeviceDimension.MONITORPOINT ? 'monitorPointId' : 'professionId';
if (!!text) {
example.or().andEqualTo({ name: deviceDimensionProperty, value: this.deviceDimension.id })
.andLike({name: 'text', value: text});
@@ -237,7 +236,7 @@
);
this.actualYearOptions = this.newArray(this.actualYear - 9, 10).map(item => Number(item)).reverse();
// ��������� ���������
- this.http.get(environment.SERVER_BASH_URL + 'organization/get-my-org').subscribe(
+ this.http.get('organization/get-my-org').subscribe(
(res: ResultBean<Organization>) => {
if (res.code === ResultCode.SUCCESS) {
const org = res.data;
@@ -278,10 +277,10 @@
this.dimensionItem = this.dimensions[0];
// this.dimensionsChange();
}
- public get sensorsLength():number {
- return this.sensorOptions.length>0?this.sensorOptions[0].children.length:0;
+ public get sensorsLength(): number {
+ return this.sensorOptions.length > 0 ? this.sensorOptions[0].children.length : 0;
}
- public get sensorsSelect():number{
+ public get sensorsSelect(): number {
return Object.keys(this._sensors).length;
}
public areaLazyLoad(event: { option: CascaderOption, index: number, resolve: (children: CascaderOption[]) => void, reject: () => void }) {
@@ -320,26 +319,26 @@
if ( isChanged ) {
this._areas = areas;
this.deviceDimension = null;
- if(this.dimensionItem.value === DeviceDimension.MONITORPOINT){
+ if (this.dimensionItem.value === DeviceDimension.MONITORPOINT) {
this.dimensionsChange();
}
}
}
// ��������� ������ ������������, ������ ���������������������������null ������������������������������
- public dimensionItem:{label: string,value: DeviceDimension};
- public dimensions:{label: string,value: DeviceDimension}[] = [
- {label:"������������",value:DeviceDimension.MONITORPOINT},
- {label:"������������",value:DeviceDimension.PROFESSION}
+ public dimensionItem: {label: string, value: DeviceDimension};
+ public dimensions: {label: string, value: DeviceDimension}[] = [
+ {label: '������������', value: DeviceDimension.MONITORPOINT},
+ {label: '������������', value: DeviceDimension.PROFESSION}
];
- public get otherDimensions():{label: string,value: DeviceDimension}[] {
+ public get otherDimensions(): {label: string, value: DeviceDimension}[] {
return this.dimensions.filter(
item => {
- return item.value != this.dimensionItem.value;
+ return item.value !== this.dimensionItem.value;
}
);
}
- public selectDimension(option:{label: string,value: DeviceDimension}){
+ public selectDimension(option: {label: string, value: DeviceDimension}) {
this.dimensionItem = option;
this.dimensionsChange();
this._deviceDimension = null;
@@ -347,8 +346,8 @@
this.device = null;
this.deviceOptions = null;
}
- public _deviceDimension: {id: number,name: string};
- get deviceDimension(): {id: number,name: string} {
+ public _deviceDimension: {id: number, name: string};
+ get deviceDimension(): {id: number, name: string} {
return this._deviceDimension;
}
set deviceDimension(value) {
@@ -495,7 +494,7 @@
const dimValue: number = !!this._deviceDimension ? this._deviceDimension.id : null;
const devValue: number = !!this._device ? this._device.id : null;
const areasData = [ devValue, dimValue, Number(this._areas.slice(-1).pop().value)];
- if(!!this.deviceDimension){
+ if (!!this.deviceDimension) {
this.dataCondition.dimensionValue = this._deviceDimension.id;
this.dataCondition.deviceDimension = this.dimensionItem.value;
}
@@ -507,10 +506,10 @@
case 0: this.dataCondition.areaRange = AreaRange.DEVICE; break;
case 1:
// ������������������
- if(this.dimensionItem.value === DeviceDimension.MONITORPOINT){
+ if (this.dimensionItem.value === DeviceDimension.MONITORPOINT) {
this.dataCondition.areaRange = AreaRange.MONITORPOINT;
// ���������������
- }else{
+ } else {
// ������������������������
this.switchAreas();
// ���������������������
@@ -566,7 +565,7 @@
// ������������
this.grid.data = [];
console.log(lineChartCriteria);
- this.http.post(environment.SERVER_BASH_URL + '/report/line-chart', lineChartCriteria).subscribe(
+ this.http.post('/report/line-chart', lineChartCriteria).subscribe(
(res: ResultBean<{[key: string]: Array<Array<number>>}>) => {
if (res.code === 1) {
const data = res.data;
@@ -609,7 +608,7 @@
}
);
}
- private switchAreas(): void{
+ private switchAreas(): void {
switch (this._areas.length ) {
case 1: this.dataCondition.areaRange = AreaRange.PROVINCE; break;
case 2: this.dataCondition.areaRange = AreaRange.CITY; break;
@@ -682,7 +681,7 @@
public _chartTitleTemp = '';
public _tableTitleTemp = '';
public reloadChartTitle(): void {
- const names = ['������', '������', '������','������','������'];
+ const names = ['������', '������', '������', '������', '������'];
switch ( this.dataCondition.areaRange ) {
case AreaRange.MONITORPOINT :
names[0] = '������������';
@@ -696,17 +695,17 @@
break;
}
// ������������
- if(!!this._deviceDimension){
- switch(this.dataCondition.deviceDimension){
+ if (!!this._deviceDimension) {
+ switch (this.dataCondition.deviceDimension) {
case DeviceDimension.PROFESSION :
- names[2] ='['+this._deviceDimension.name+']';
+ names[2] = '[' + this._deviceDimension.name + ']';
break;
default :
- names[2] ='';
+ names[2] = '';
break;
}
- }else{
- names[2] ='';
+ } else {
+ names[2] = '';
}
names[3] = moment(this.actualTime).format(this._timeType.dateFormat);
--
Gitblit v1.8.0