沈斌
2018-03-13 9634327c9094fb2d2b5bb2a3e630971cd65d3112
src/app/routes/dashboard/workplace/workplace.component.ts
@@ -12,6 +12,11 @@
    styleUrls: ['./workplace.component.less']
})
export class DashboardWorkplaceComponent implements OnInit, OnDestroy {
    totalDeviceCountList: any[] = [];
    totalDeviceCount = 0;
    avgDeviceCount: string;
    notice: any[] = [];
    activities: any[] = [];
    radarData: any[] = [];
@@ -102,6 +107,21 @@
                private http2: HttpClient) {}
    ngOnInit() {
        const today = new Date().getTime();
        const fakeDC = [60, 135, 70, 112, 80, 170, 200, 140, 52, 119, 164, 230];
        for (let i = 0; i < 12; i += 1) {
            this.totalDeviceCountList.push({
                x: moment(today).subtract(-1*i, 'months').format(
                    "YYYY-MM"
                ),
                y: fakeDC[i]
            });
            this.totalDeviceCount += fakeDC[i];
        }
        this.avgDeviceCount = (this.totalDeviceCount/12).toFixed(0);
        const visitData = [];
        const beginDay = new Date().getTime();
@@ -497,6 +517,9 @@
            });
            return item;
        });
    }
    setDate(type: any) {