fengxiang
2018-06-05 d4fd81a5e4853e8e6c1f507d0765b478ceff8219
延长弹出 超时弹窗的晃动时间
2 files modified
73 ■■■■ changed files
src/app/core/net/default.interceptor.ts 2 ●●● patch | view | raw | blame | history
src/app/routes/reports/query/query.component.ts 71 ●●●● patch | view | raw | blame | history
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']);
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);