Browse Source

完善设备树

408249787 2 years ago
parent
commit
342259a82f
1 changed files with 15 additions and 10 deletions
  1. 15 10
      src/components/WorkTree/WorkTree.vue

+ 15 - 10
src/components/WorkTree/WorkTree.vue

@@ -3,7 +3,7 @@
     <div v-if="!list.length" >
       <div class="branch-one">
         <div class="condition-node-box">
-          <div class="line"></div>
+          <div class="newH" :class="{line:list.children && list.children.length>0}"></div>
           <div class="deal-node-box" @click="click(list)">
             <div class=" head-row" :class="list.type!==1?list.type !== 2 ? list.type !== 3 ? 'child-background':'sb-background': 'spare-background':'part-background' ">
               {{ list.name }}
@@ -18,7 +18,7 @@
             </div>
             <a class="del-node" @click.stop="close(list)">×</a>
           </div>
-          <div class="add-btn-box">
+          <div class="add-btn-box" v-if="list.children && list.children.length>0">
             <button type="button" class="add-bar" @click="add(list)">+</button>
           </div>
         </div>
@@ -28,7 +28,8 @@
     <div v-if="list.length == 1" >
       <div v-for="(item, index) in list" :key="index" class="branch-one" style="flex-grow:1;">
         <div class="condition-node-box">
-          <div class="line"></div>
+          <div class="newH" :class="{line:item.children && item.children.length>0}"></div>
+
           <div class="deal-node-box" @click="click(item)">
             <div class=" head-row" :class="item.type!==1?item.type !== 2 ? item.type !== 3 ? 'child-background':'sb-background': 'spare-background':'part-background' ">
               {{ item.name }}
@@ -43,7 +44,7 @@
             </div>
             <a class="del-node" @click.stop="close(item)">×</a>
           </div>
-          <div class="add-btn-box">
+          <div class="add-btn-box" v-if="item.children && item.children.length>0">
             <button type="button" class="add-bar" @click="add(item)">+</button>
           </div>
         </div>
@@ -61,7 +62,7 @@
             ></div>
             <div class="branch-one">
               <div class="condition-node-box">
-                <div class="line"></div>
+                <div class="newH" :class="{line:item.children && item.children.length>0}"></div>
                 <div class="deal-node-box" @click="click(item)">
                   <div class="head-row" :class="item.type!==1?item.type !== 2 ? item.type !== 3 ? 'child-background':'sb-background': 'spare-background':'part-background' ">
                     {{ item.name }}
@@ -76,7 +77,7 @@
                   </div>
                   <a class="del-node" @click.stop="close(item)">×</a>
                 </div>
-                <div class="add-btn-box" >
+                <div class="add-btn-box" v-if="item.children && item.children.length>0">
                   <button type="button" class="add-bar" @click="add(item)">+</button>
                 </div>
               </div>
@@ -137,7 +138,13 @@ export default {
 :before {
   box-sizing: border-box;
 }
-
+.newH{
+  position: absolute;
+  top: 0;
+  width: 1px;
+  height: 100px;
+  background-color: #dfdfe8;
+}
 .wrapper {
   width: 100%;
   position: relative;
@@ -274,7 +281,6 @@ export default {
   right: 50%;
   width: 1px;
   height: 100%;
-  max-height: 0px;
   background-color: #ccd4e0;
 }
 .add-btn-box {
@@ -397,7 +403,7 @@ export default {
 .condition-node-box {
   display: inline-flex;
   align-items: center;
-  justify-content: center;
+  // justify-content: center;
 }
 .condition-node-box .auto-judge .foot-row,
 .inline-flex-sc {
@@ -435,7 +441,6 @@ export default {
   top: 0;
   width: 1px;
   height: 100%;
-  max-height: 250px;
   background-color: #dfdfe8;
 }
 .condition-node-box .del-btn {