Repository: incubator-griffin
Updated Branches:
  refs/heads/master 60e23edc9 -> 19f68c320


fix small bugs about checkbox when create measure

Author: dodobel <[email protected]>

Closes #169 from dodobel/merge.


Project: http://git-wip-us.apache.org/repos/asf/incubator-griffin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-griffin/commit/19f68c32
Tree: http://git-wip-us.apache.org/repos/asf/incubator-griffin/tree/19f68c32
Diff: http://git-wip-us.apache.org/repos/asf/incubator-griffin/diff/19f68c32

Branch: refs/heads/master
Commit: 19f68c3204e87fffa9211759e0ed0133d0f6667e
Parents: 60e23ed
Author: dodobel <[email protected]>
Authored: Mon Nov 6 13:50:07 2017 +0800
Committer: Lionel Liu <[email protected]>
Committed: Mon Nov 6 13:50:07 2017 +0800

----------------------------------------------------------------------
 .../measure/create-measure/ac/ac.component.ts   | 29 +++++++++++++++-----
 1 file changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/19f68c32/ui/angular/src/app/measure/create-measure/ac/ac.component.ts
----------------------------------------------------------------------
diff --git a/ui/angular/src/app/measure/create-measure/ac/ac.component.ts 
b/ui/angular/src/app/measure/create-measure/ac/ac.component.ts
index cbc9676..1fdfac4 100644
--- a/ui/angular/src/app/measure/create-measure/ac/ac.component.ts
+++ b/ui/angular/src/app/measure/create-measure/ac/ac.component.ts
@@ -187,6 +187,11 @@ export class AcComponent implements OnInit {
       else {
           this.selection.push(row.name);
       }
+      if(this.selection.length == 3){
+          this.selectedAll = true;
+      }else{
+        this.selectedAll = false;
+      }
   };
 
   toggleSelectionTarget (row) {
@@ -201,6 +206,11 @@ export class AcComponent implements OnInit {
       else {
           this.selectionTarget.push(row.name);
       }
+      if(this.selectionTarget.length == 3){
+          this.selectedAllTarget = true;
+      }else{
+        this.selectedAllTarget = false;
+      }
       let l = this.selectionTarget.length;
       for(let i =0;i<l;i++)
         this.matches[i] = "=";
@@ -333,12 +343,8 @@ export class AcComponent implements OnInit {
           return rules;
       }
       var self = this;
-      console.log(this.selectionTarget);
-      // var rules = this.selectionTarget.map(function(item, i) {
-      //     return mappingRule(self.selection[i], item, self.matches[i]);
-      // });
       var rules = this.mappings.map(function(item, i) {
-          return mappingRule(self.selection[i], item, self.matches[i]);
+          return mappingRule(item,self.selectionTarget[i], self.matches[i]);
       });
       rule = rules.join(" AND ");
       this.rules = rule;
@@ -374,14 +380,13 @@ export class AcComponent implements OnInit {
     
   }
 
-  
   options: ITreeOptions = {
     displayField: 'name',
     isExpandedField: 'expanded',
     idField: 'id',
     actionMapping: {
       mouse: {
-        click: (tree, node, $event) => {
+        click: (tree, node, $event) => {         
           if (node.hasChildren) {
             this.currentDB = node.data.name;
             this.currentTable = '';
@@ -392,6 +397,11 @@ export class AcComponent implements OnInit {
             this.currentTable = node.data.name;
             this.currentDB = node.data.parent;
             this.schemaCollection = node.data.cols;
+            this.selectedAll = false;
+            this.selection = [];
+            for(let row of this.schemaCollection){
+              row.selected = false;
+            }
           }
         }
       }
@@ -418,6 +428,11 @@ export class AcComponent implements OnInit {
             this.currentTableTarget = node.data.name;
             this.currentDBTarget = node.data.parent;
             this.schemaCollectionTarget = node.data.cols;
+            this.selectedAllTarget = false;
+            this.selectionTarget = [];
+            for(let row of this.schemaCollectionTarget){
+              row.selected = false;
+            }
           }
         }
       }

Reply via email to