From fb0d052122fdc9f0ad83e55778d0f988bd9d2b82 Mon Sep 17 00:00:00 2001
From: 沈斌 <bluelazysb@hotmail.com>
Date: Tue, 13 Mar 2018 15:18:27 +0800
Subject: [PATCH] 工作台数据统计页面

---
 src/app/routes/dashboard/workplace/workplace.component.ts |  184 ++++++++++++----------------------------------
 1 files changed, 48 insertions(+), 136 deletions(-)

diff --git a/src/app/routes/dashboard/workplace/workplace.component.ts b/src/app/routes/dashboard/workplace/workplace.component.ts
index 7698053..d7e7561 100644
--- a/src/app/routes/dashboard/workplace/workplace.component.ts
+++ b/src/app/routes/dashboard/workplace/workplace.component.ts
@@ -17,97 +17,61 @@
     totalDeviceCount = 0;
     avgDeviceCount: string;
 
-    notice: any[] = [];
     activities: any[] = [];
     radarData: any[] = [];
     loading = true;
 
-    // region: mock data
-    links = [
-        {
-          title: '���������',
-          href: '',
-        },
-        {
-          title: '���������',
-          href: '',
-        },
-        {
-          title: '���������',
-          href: '',
-        },
-        {
-          title: '���������',
-          href: '',
-        },
-        {
-          title: '���������',
-          href: '',
-        },
-        {
-          title: '���������',
-          href: '',
-        },
-    ];
     members = [
         {
           id: 'members-1',
-          title: '���������������',
+          title: '������������',
           logo: 'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png',
           link: '',
         },
         {
           id: 'members-2',
-          title: '���������������',
+          title: '������������',
           logo: 'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png',
           link: '',
         },
         {
           id: 'members-3',
-          title: '������������',
+          title: '���������',
           logo: 'https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png',
           link: '',
         },
         {
           id: 'members-4',
-          title: '���������������',
+          title: '���������',
           logo: 'https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png',
           link: '',
-        },
-        {
-          id: 'members-5',
-          title: '������������������',
-          logo: 'https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png',
-          link: '',
-        },
+        }
       ];
-    // endregion
 
-    ngOnDestroy(): void {
-    }
-
-
-    data: any = {
-        salesData: [],
-        offlineData: []
-    };
+    data: any = {};
 
     q: any = {
         start: null,
         end: null
     };
-    rankingListData: any[] = Array(7).fill({}).map((item, i) => {
-        return {
-            title: `��������� ${i} ������`,
-            total: 323234
-        };
-    });
 
-    constructor(private http: _HttpClient, public msg: NzMessageService,
-                private http2: HttpClient) {}
+    rankingListData: any[] = [
+        {title: `PM 2.5`, total: 230},
+        {title: `PM 10`, total: 175},
+        {title: `������������`, total: 123},
+        {title: `������������`, total: 92},
+        {title: `������`, total: 39},
+        {title: `������`, total: 24},
+        {title: `������������`, total: 8}
+    ];
+
+    constructor(
+        private http: _HttpClient,
+        public msg: NzMessageService,
+        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) {
@@ -120,6 +84,16 @@
             this.totalDeviceCount += fakeDC[i];
         }
         this.avgDeviceCount = (this.totalDeviceCount/12).toFixed(0);
+
+        const alarmData = [];
+        for (let i = 0; i < 12; i += 1) {
+            alarmData.push({
+                x: `${i + 1}���`,
+                y: Math.floor(Math.random() * 1000) + 200
+            });
+        }
+
+
 
 
         const visitData = [];
@@ -144,13 +118,7 @@
                 y: fakeY2[i]
             });
         }
-        const salesData = [];
-        for (let i = 0; i < 12; i += 1) {
-            salesData.push({
-                x: `${i + 1}���`,
-                y: Math.floor(Math.random() * 1000) + 200
-            });
-        }
+
 
         const salesTypeData = [
             {
@@ -302,8 +270,9 @@
             });
         }
         var res = {
+            alarmData: alarmData,
+
             visitData: visitData,
-            salesData: salesData,
             visitData2: visitData2,
             salesTypeData: salesTypeData,
             salesTypeDataOnline: salesTypeDataOnline,
@@ -345,70 +314,6 @@
             'https://gw.alipayobjects.com/zos/rmsportal/ComBAopevLwENQdKWiIn.png', // Vue
             'https://gw.alipayobjects.com/zos/rmsportal/nxkuOJlFJuAUhzlMTCEe.png'  // Webpack
         ];
-
-        var notice = [
-            {
-                id: 'xxx1',
-                title: titles[0],
-                logo: avatars[0],
-                description: '������������������������������ ���������������������������������������',
-                updatedAt: new Date(),
-                member: '���������������',
-                href: '',
-                memberLink: '',
-            },
-            {
-                id: 'xxx2',
-                title: titles[1],
-                logo: avatars[1],
-                description: '���������������������������������������������������������������������������',
-                updatedAt: new Date('2017-07-24'),
-                member: '���������������������',
-                href: '',
-                memberLink: '',
-            },
-            {
-                id: 'xxx3',
-                title: titles[2],
-                logo: avatars[2],
-                description: '������������������������������������������������������������������',
-                updatedAt: new Date(),
-                member: '���������������',
-                href: '',
-                memberLink: '',
-            },
-            {
-                id: 'xxx4',
-                title: titles[3],
-                logo: avatars[3],
-                description: '���������������������������������������������������������������������',
-                updatedAt: new Date('2017-07-23'),
-                member: '���������������',
-                href: '',
-                memberLink: '',
-            },
-            {
-                id: 'xxx5',
-                title: titles[4],
-                logo: avatars[4],
-                description: '������������',
-                updatedAt: new Date('2017-07-23'),
-                member: '���������������������',
-                href: '',
-                memberLink: '',
-            },
-            {
-                id: 'xxx6',
-                title: titles[5],
-                logo: avatars[5],
-                description: '������������������������������������������������������',
-                updatedAt: new Date('2017-07-23'),
-                member: '���������������������',
-                href: '',
-                memberLink: '',
-            },
-        ];
-        this.notice = notice;
 
         var activities = [
             {
@@ -509,6 +414,19 @@
                 },
                 template: '��� @{group} ������������ @{project}',
             },
+            {
+                id: 'trend-7',
+                updatedAt: new Date(),
+                user: {
+                    name: '���������',
+                    avatar: avatars[3],
+                },
+                project: {
+                    name: '���������������',
+                    link: 'http://github.com/',
+                },
+                template: '��� @{project} ���������������������',
+            }
         ];
         this.activities = activities.map((item: any) => {
             item.template = item.template.split(/@\{([^{}]*)\}/gi).map((key: string) => {
@@ -517,15 +435,9 @@
             });
             return item;
         });
-
-
-
     }
 
-    setDate(type: any) {
-        const rank = getTimeDistance(type);
-        this.q.start = rank[0];
-        this.q.end = rank[1];
+    ngOnDestroy(): void {
     }
 
     sort(sortName, sortValue) {

--
Gitblit v1.8.0