fengxiang
2018-01-29 61873531cdd8a365645fc3cb1fb22f9031ea5f0e
mock调用注释
4 files modified
82 ■■■■ changed files
src/app/routes/dashboard/analysis/analysis.component.ts 16 ●●●● patch | view | raw | blame | history
src/app/routes/dashboard/monitor/monitor.component.ts 24 ●●●● patch | view | raw | blame | history
src/app/routes/dashboard/v1/v1.component.ts 10 ●●●● patch | view | raw | blame | history
src/app/routes/dashboard/workplace/workplace.component.ts 32 ●●●● patch | view | raw | blame | history
src/app/routes/dashboard/analysis/analysis.component.ts
@@ -31,14 +31,14 @@
    private http2: HttpClient) {}
    ngOnInit() {
        this.http.get('/chart').subscribe((res: any) => {
            res.offlineData.forEach((item: any) => {
                item.chart = Object.assign([], res.offlineChartData);
            });
            this.data = res;
            this.loading = false;
            this.changeSaleType();
        });
        // this.http.get('/chart').subscribe((res: any) => {
        //     res.offlineData.forEach((item: any) => {
        //         item.chart = Object.assign([], res.offlineChartData);
        //     });
        //     this.data = res;
        //     this.loading = false;
        //     this.changeSaleType();
        // });
    }
    setDate(type: any) {
src/app/routes/dashboard/monitor/monitor.component.ts
@@ -21,19 +21,19 @@
    constructor(private http: _HttpClient, public msg: NzMessageService) {}
    ngOnInit() {
        zip(
            this.http.get('/chart'),
            this.http.get('/chart/tags')
        ).subscribe(([ res, tags ]) => {
            this.data = res;
            tags['list'][Math.floor(Math.random() *  tags['list'].length) + 1].value = 1000;
            this.tags =  tags['list'];
            this.loading = false;
        });
        // zip(
        //     this.http.get('/chart'),
        //     this.http.get('/chart/tags')
        // ).subscribe(([ res, tags ]) => {
        //     this.data = res;
        //     tags['list'][Math.floor(Math.random() *  tags['list'].length) + 1].value = 1000;
        //     this.tags =  tags['list'];
        //     this.loading = false;
        // });
        // active chart
        this.genActiveData();
        this.activeTime$ = setInterval(() => this.genActiveData(), 1000);
        // // active chart
        // this.genActiveData();
        // this.activeTime$ = setInterval(() => this.genActiveData(), 1000);
    }
    // region: active chart
src/app/routes/dashboard/v1/v1.component.ts
@@ -26,10 +26,10 @@
    offlineChartData: any[] = [];
    ngOnInit() {
        this.http.get('/chart').subscribe((res: any) => {
            this.webSite = res.visitData.slice(0, 10);
            this.salesData = res.salesData;
            this.offlineChartData = res.offlineChartData;
        });
        // this.http.get('/chart').subscribe((res: any) => {
        //     this.webSite = res.visitData.slice(0, 10);
        //     this.salesData = res.salesData;
        //     this.offlineChartData = res.offlineChartData;
        // });
    }
}
src/app/routes/dashboard/workplace/workplace.component.ts
@@ -79,22 +79,22 @@
    constructor(private http: _HttpClient, public msg: NzMessageService) {}
    ngOnInit() {
        zip(
            this.http.get('/chart'),
            this.http.get('/api/notice'),
            this.http.get('/api/activities')
        ).subscribe(([ chart, notice, activities ]) => {
            this.radarData = chart['radarData'];
            this.notice = <any []>notice;
            this.activities = (<any []>activities).map((item: any) => {
                item.template = item.template.split(/@\{([^{}]*)\}/gi).map((key: string) => {
                    if (item[key]) return `<a>${item[key].name}</a>`;
                    return key;
                });
                return item;
            });
            this.loading = false;
        });
        // zip(
        //     this.http.get('/chart'),
        //     this.http.get('/api/notice'),
        //     this.http.get('/api/activities')
        // ).subscribe(([ chart, notice, activities ]) => {
        //     this.radarData = chart['radarData'];
        //     this.notice = <any []>notice;
        //     this.activities = (<any []>activities).map((item: any) => {
        //         item.template = item.template.split(/@\{([^{}]*)\}/gi).map((key: string) => {
        //             if (item[key]) return `<a>${item[key].name}</a>`;
        //             return key;
        //         });
        //         return item;
        //     });
        //     this.loading = false;
        // });
    }
    ngOnDestroy(): void {