From cef5f19b9dbe6487942086c9e8896eac40b21e4f Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期三, 17 十二月 2025 17:32:28 +0800
Subject: [PATCH] 最新版本541200007

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

diff --git a/admin/src/components/common/Tree.vue b/admin/src/components/common/Tree.vue
index 795529d..0c68c47 100644
--- a/admin/src/components/common/Tree.vue
+++ b/admin/src/components/common/Tree.vue
@@ -2,9 +2,9 @@
     <div class="tree">
         <div v-for="(item, index) of list" :key="index" @click.stop="clickIten(item)">
             <div class="tree_item">
-                <i class="el-icon-caret-bottom" :class="{ 'activeColor': item.fsStatus === 1 }" v-show="item.fsStatus === 1 && item.childList.length > 0"></i>
-                <i class="el-icon-caret-right color" v-show="item.childList.length > 0 && (item.fsStatus === 0 || !item.fsStatus)"></i>
-                <div class="tree_item_label long-title-style" :title="item.name" :class="{ 'activeColor': item.fsDate === 1 && item.childList.length === 0 }">{{ item.name }}</div>
+                <i class="el-icon-caret-bottom" :class="{ 'activeColor': item.fsStatus === 1 }" v-show="item.fsStatus === 1 && item.childList && item.childList.length > 0"></i>
+                <i class="el-icon-caret-right color" v-show="item.childList && item.childList.length > 0 && (item.fsStatus === 0 || !item.fsStatus)"></i>
+                <div class="tree_item_label long-title-style" :title="item.name" :class="{ 'activeColor': item.fsDate === 1 &&(!item.childList || item.childList.length === 0) }">{{ item.name }}</div>
                 <!--                <i class="el-icon-caret-bottom" :class="{ 'activeColor': item[defaultProps.status] }" v-show="item[defaultProps.status] && item[defaultProps.children]"></i>-->
 <!--                <i class="el-icon-caret-right color" v-show="item[defaultProps.children] && !item[defaultProps.status]"></i>-->
 <!--                <div class="tree_item_label long-title-style" :title="item[defaultProps.name]" :class="{ 'activeColor': item[defaultProps.status] && !item[defaultProps.children] }">{{ item[defaultProps.name] }}</div>-->
@@ -77,8 +77,13 @@
       //   this.tempItem.name = item[this.defaultProps.name]
       //   this.tempItem.erpId = item['erpId']
       // }
-      item.fsDate === 0 || !item.fsDate ? item.fsDate = 1 : item.fsDate = 0
-      if (item.childList.length > 0) {
+      // item.fsDate === 0 || !item.fsDate ? item.fsDate = 1 : item.fsDate = 0
+      const fsDate = item.fsDate === 0 || !item.fsDate ? 1 : 0
+      this.list.forEach(i => {
+        i.fsDate = 0
+      })
+      item.fsDate = fsDate
+      if (item.childList &&item.childList.length > 0) {
         item.fsStatus === 0 || !item.fsStatus ? item.fsStatus = 1 : item.fsStatus = 0
       }
       this.$emit('callback', item, item)
@@ -87,7 +92,7 @@
     recursion (children) {
       children.forEach(item => {
         item.fsDate = 0
-        if (item.childList.length > 0) {
+        if (item.childList && item.childList.length > 0) {
           this.recursion(item.childList)
         }
         // item[this.defaultProps.status] = false

--
Gitblit v1.9.3