fengxiang
2018-03-23 6a1dd6c9193efa942a4312785b4457397c23b61e
src/app/routes/analysis/query/query.component.ts
@@ -79,6 +79,7 @@
     public toggleChartCollapse() {
          // 打开的时候
         if (this.isChartCollapse && !!this.echartsIntance) {
            this.reloadChart();
            this.switchSensor(this.chartSelectedIndex);
            // this.chartLoading = false;
         }        
@@ -320,8 +321,7 @@
            }
        );
    }
    public setTimeUnit(val: {label: string, value: TimeUnits} ) {
        this.tableWidth = this.tableWidthOption[val.value];
    public setTimeUnit(val: {label: string, value: TimeUnits} ) {
        switch (val.value) {
            // YYYY-MM-DD HH:mm:ss
            case TimeUnits.MONTH:
@@ -387,6 +387,8 @@
       const end: Date = this.getPeriodDate(this.actualTime , 'end');
       this.dataCondition['actualTime'] = null;
       this.dataCondition['timeUnits'] = this.timeUnit.value;
       // 设置表格宽度,要在此处
       this.tableWidth = this.tableWidthOption[this.timeUnit.value];
       // 设置区域值
       const mptValue: number = !!this._monitorPoint ? this._monitorPoint.id : null;
       const devValue: number = !!this._device ? this._device.id : null;
@@ -548,6 +550,8 @@
    public get sensorUnit() {
        return this.grid.data[this.chartSelectedIndex].sensor.unit;
    }
    // 报表标题暂存 防止联动
    public _chartTitleTemp: string;
    public get chartTitle(): string {
        const names = ['辖区', '地区', '时间', '项目'];
        switch ( this.dataCondition.areaRange ) {
@@ -563,12 +567,15 @@
            break;
        }
        names[2] = moment(this.actualTime).format(this._timeType.dateFormat);
        names[3] = this.grid.data[this.chartSelectedIndex].sensor.name;
        if ( this.grid.data.length > this.chartSelectedIndex) {
            names[3] = this.grid.data[this.chartSelectedIndex].sensor.name;
        }
        return names.join('  ') + '  报表';
    }
    public switchSensor(index: number): void {
        this.chartSelectedIndex = index;
        this.chartLoading = true; 
        this._chartTitleTemp = this.chartTitle;
        setTimeout(() => {
            const series = [{type: 'line', data: this.grid.data[index].data}];
            this.echartsIntance.setOption({