From 55da782025f5728051fea9fff49f9e6b6f602a1e Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Thu, 28 Dec 2017 17:31:15 +0800
Subject: [PATCH] 设备信息模块

---
 src/app/core/entity/grid.ts |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/app/core/entity/grid.ts b/src/app/core/entity/grid.ts
index b96a8dd..a66711d 100644
--- a/src/app/core/entity/grid.ts
+++ b/src/app/core/entity/grid.ts
@@ -3,7 +3,6 @@
 export interface Column {
    text?: string;
    name?: string;
-   value?: any;
    width?: string;
    sort?: boolean;
    type?: DataType;
@@ -18,13 +17,13 @@
     pageSize?: number ; // ���������������
     total?: number;
     data?: any[];
-    queryParams?: string;    
+    queryParams?: string;
 }
-export class Grid implements PageBean {
+export class Grid<T> implements PageBean {
     title = '';
     pageIndex = 0; // ������
     pageSize = 10; // ������������������
-    data: any[] = [];
+    data: T[] = [];
     total = 0;
     queryParams = '';   
     pages = 0; // ���������
@@ -38,7 +37,7 @@
     
     checkAll(value: boolean) {
         this.data.forEach(
-            row => {row.checked = value; }
+            row => {row['checked'] = value; }
         ); 
         this.refreshStatus();
     }
@@ -57,11 +56,11 @@
     }
     refreshStatus() {
         const data = this.data;
-        const allChecked =   data.every(value => value.checked);
-        const allUnChecked = data.every(value => !value.checked);
+        const allChecked =   data.every(value => value['checked']);
+        const allUnChecked = data.every(value => !value['checked']);
         this.allChecked = allChecked;
         this.indeterminate = (!allChecked) && (!allUnChecked);
-        this.selectedIndexs = data.filter(value => value.checked).map(
+        this.selectedIndexs = data.filter(value => value['checked']).map(
             row => {
                return row['index'] != null ? row['index'] : 0;
             }

--
Gitblit v1.8.0