zhuliu преди 1 година
родител
ревизия
9041c77c8a
променени са 1 файла, в които са добавени 11 реда и са изтрити 2 реда
  1. 11 2
      src/views/analyse/custom/index.vue

+ 11 - 2
src/views/analyse/custom/index.vue

@@ -322,8 +322,17 @@ export default {
               data.sort = 1
             }
           }else{
-            data.parentId = null
-            data.sort = 1
+            if(this.treeList.length>0){
+              data.parentId = this.treeList[0].id
+              if(this.treeList[0].children){
+                data.sort = this.treeList[0].children.length +1
+              }else{
+                data.sort = 1
+              }
+            }else{
+              data.parentId = null
+              data.sort = 1
+            }
           }
         }else{
           if(this.treeList.length>0){