From cd9cbc46c0774c01674be435bcc86d4a03ada687 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 27 二月 2024 14:18:13 +0800
Subject: [PATCH] 整理

---
 admin/src/components/common/Tree.vue |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/admin/src/components/common/Tree.vue b/admin/src/components/common/Tree.vue
index 47b7e6a..d162b27 100644
--- a/admin/src/components/common/Tree.vue
+++ b/admin/src/components/common/Tree.vue
@@ -18,13 +18,13 @@
     <div class="tree">
         <div v-for="(item, index) in list" :key="index" @click.stop="clickIten(item)">
             <div class="tree_item">
-                <i class="el-icon-caret-bottom" :class="{ 'activeColor': item.status }" v-show="item.status === 1 && item.companyDTOList.length > 0"></i>
-                <i class="el-icon-caret-right color" v-show="item.companyDTOList.length > 0 && item.status === 0"></i>
-                <div class="tree_item_label long-title-style" :title="item.name" :class="{ 'activeColor': item.status === 1 && item.companyDTOList.length === 0 }">{{ item.name }}</div>
+                <i class="el-icon-caret-bottom" :class="{ 'activeColor': item.status }" v-show="item.status === 1 && item.childList.length > 0"></i>
+                <i class="el-icon-caret-right color" v-show="item.childList.length > 0 && item.status === 0"></i>
+                <div class="tree_item_label long-title-style" :title="item.name" :class="{ 'activeColor': item.status === 1 && item.childList.length === 0 }">{{ item.name }}</div>
             </div>
             <div class="tree_childern" v-show="item.status === 1">
                 <tree
-                    :list="item.companyDTOList"
+                    :list="item.childList"
                     :defaultProps="defaultProps"
                     @callback="callback"
                 />
@@ -51,7 +51,7 @@
           name: 'name',
           status: 'status',
           children: 'children',
-          id: 'id'
+          id: 'erpId'
         }
       }
     }
@@ -87,7 +87,6 @@
       //   this.tempItem.id = item[this.defaultProps.id]
       //   this.tempItem.name = item[this.defaultProps.name]
       // }
-
       this.$emit('callback', item)
     },
     // 閫掑綊鏂规硶
@@ -100,19 +99,21 @@
       // })
       children.forEach(item => {
         item.status = 0
-        if (item.companyDTOList.length > 0) {
-          this.recursion(item.companyDTOList)
+        if (item.childList.length > 0) {
+          this.recursion(item.childList)
         }
       })
     },
     callback (data, item) {
+      console.log('data', data)
+      console.log('item', item)
       if (this.tempItem.id === data.id) {
         this.tempItem = {}
       } else {
-        this.tempItem.id = data.id
+        this.tempItem.id = data.erpId
         this.tempItem.name = data.name
       }
-      this.$emit('callback', this.tempItem, item)
+      this.$emit('callback', data, item)
     }
   }
 }

--
Gitblit v1.9.3