liuqiao hai 1 ano
pai
achega
d7bede0288
Modificáronse 1 ficheiros con 66 adicións e 22 borrados
  1. 66 22
      src/views/index/index.vue

+ 66 - 22
src/views/index/index.vue

@@ -180,9 +180,14 @@
               <el-tree
                 :data="data"
                 class="my-tree"
-                  show-checkbox
+                show-checkbox
+                  node-key="id"
+                  :default-expanded-keys="[2, 3]"
+                  :default-checked-keys="[5]"
                 :props="defaultProps"
-                @node-click="handleNodeClick"
+              @check-change="handleNodeClick"
+              ref="tree"
+               @check="getCheckedNodes"
               ></el-tree>
             </el-tab-pane>
             <el-tab-pane
@@ -450,57 +455,68 @@ export default {
       ],
       data: [
         {
+           id: 1,
           label: "HCFDLab",
           children: [
             {
+              id: 4,
               label: "Geometry",
               children: [{
-              id: 9,
+              id: 12,
               label: 'points'
             }, {
-              id: 10,
+              id: 13,
               label: 'Curves'
             }, {
-              id: 10,
+              id: 14,
               label: 'Surfaces'
             }
               ],
             },
              {
+                id: 5,
               label: "Mesh",
              
             },
              {
+                id: 6,
               label: "Parts",
              
             },
             {
+               id: 7,
               label: "Custom Control",
               children: [
                 {
+                   id: 15,
                   label: "Surface Control",
                 },
                  {
+                    id: 16,
                   label: "Curves Control",
                 },
                  {
+                      id: 17,
                   label: "Volume Control",
                 },
               ],
             },
              {
+                id: 8,
               label: "Physics",
              
             },
              {
+                id: 9,
               label: "Solution",
              
             },
             {
+                id: 10,
               label: "Jobs",
              
             },
-            {
+            { id: 11,
               label: "Results",
              
             },
@@ -732,7 +748,6 @@ export default {
     this.elodingfalse =res;
     console.log(this.elodingfalse)
     },
-    handleNodeClick(data) {},
     hide() {
       this.showtrue = !this.showtrue;
     },
@@ -1233,6 +1248,18 @@ export default {
       //this.loadingend(this.loadingopen());
       //this.reconnect();
     },
+    handleNodeClick(data, checked, indeterminate){
+      
+      console.log(data)
+       console.log(111)
+       console.log(checked)
+       console.log(222)
+          // console.log(indeterminate)
+
+    },
+    getCheckedNodes(obj,a){
+        console.log(this.$refs.tree.getCheckedNodes())
+    }
   },
 };
 </script>
@@ -1279,7 +1306,7 @@ export default {
       flex-direction: column;
       padding: 15px;
       position: relative;
-      height: 88vh;
+      height: calc(100vh - 179px);
       z-index: 10;
     }
     .part-panel-collapse-handle {
@@ -1497,35 +1524,52 @@ export default {
   width: 20px;
   height: 20px;
 }
-/* .my-tree .el-tree-node__content label.el-checkbox ,.my-tree .el-tree-node__content label.el-checkbox {
+
+ /* .my-tree .el-tree-node__children  .el-tree-node__content .el-checkbox{
+ display: inline-block;
+ } */
+ .el-tree .el-tree-node .el-tree-node__children .el-tree-node .el-tree-node__children .el-tree-node .el-tree-node__content label.el-checkbox{
+ display: inline-block;
+ }
+/* .my-tree .el-tree-node__content label.el-checkbox,.my-tree .el-tree-node__children .el-checkbox .el-checkbox__inner,
+.my-tree .el-tree-node__content .el-checkbox .el-checkbox__inner
+{
   display: none;
 }
 .my-tree .el-tree-node__children label.el-checkbox{
   display: inline-block;
   margin-left: -17px;
-} */
-.my-tree .el-tree-node__content label.el-checkbox {
-    display: none;
-  }
-/* .my-tree  .el-tree-node__children label.el-checkbox {
+}
+.my-tree  .el-tree-node__children label.el-checkbox {
     display: inline-block;
     margin-left: -5px;
   }
  .my-tree .el-tree-node__children  .el-tree-node  .is-leaf + .el-checkbox .el-checkbox__inner {
       display: inline-block;
-    } */
-
-   .my-tree .el-tree-node__children  .el-checkbox .el-checkbox__inner {
-      display: none;
     }
-.my-tree .el-tree-node .is-leaf + .el-checkbox .el-checkbox__inner{
-display: none;
-}
+
 .my-tree .el-checkbox .el-checkbox__inner{
 display: inline-block;
-}
+} */
 </style>
 <style lang="scss" scoped>
+/deep/.my-tree {
+  .el-tree-node__content label.el-checkbox {
+    display: none;
+  }
+  .el-tree-node__children label.el-checkbox {
+    margin-left: -5px;
+  }
+  .el-tree-node {
+    .is-leaf + .el-checkbox .el-checkbox__inner {
+      display: inline-block;
+    }
+
+    .el-checkbox .el-checkbox__inner {
+      display: none;
+    }
+  }
+}
 /deep/.toolbar-part-detail {
   position: relative;
 }