From 34dd2d10cf26c86ed170a59aa36718f7c27f24d0 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期三, 03 四月 2024 15:30:29 +0800
Subject: [PATCH] 图书详情bug修改,云学习无销售方法check禁用

---
 packageBookService/pages/bookServices/detail/components/tree/index.js |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.js b/packageBookService/pages/bookServices/detail/components/tree/index.js
index 7aba5ed..079d169 100644
--- a/packageBookService/pages/bookServices/detail/components/tree/index.js
+++ b/packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -67,14 +67,16 @@
     );
   },
   observers: {
-    openIds: function (newValue) {
-      // var myEventDetail = {
-      // }
-      // var myEventOption = {
-      //   bubbles: true,
-      //   composed: true
-      // }
-      // this.triggerEvent('handleTree', myEventDetail, myEventOption)
+    treeList: function (newValue) {
+      const list = [];
+      let checked = "";
+      console.log("鏂板��", this.properties.treeList);
+      this.properties.treeList.forEach((item) => {
+        if (item.children && item.children.length > 0) {
+          list.push(...this.flattenTree([item]));
+        }
+      });
+      const flag = list.findIndex((item) => item.checked == true);
     },
   },
 
@@ -307,14 +309,14 @@
       });
       const flag =
         list.findIndex((item) => item.checked == false) > -1 ? true : false;
-        var myEventDetail = {
-          value:flag,
-        }; // detail瀵硅薄锛屾彁渚涚粰浜嬩欢鐩戝惉鍑芥暟
-        var myEventOption = {
-          bubbles: true,
-          composed: true,
-        }; // 瑙﹀彂浜嬩欢鐨勯�夐」
-        this.triggerEvent('changeCheckAll',myEventDetail,myEventOption)
+      var myEventDetail = {
+        value: flag,
+      }; // detail瀵硅薄锛屾彁渚涚粰浜嬩欢鐩戝惉鍑芥暟
+      var myEventOption = {
+        bubbles: true,
+        composed: true,
+      }; // 瑙﹀彂浜嬩欢鐨勯�夐」
+      this.triggerEvent("changeCheckAll", myEventDetail, myEventOption);
       const updataList = this.findAndUpdateItemsByIds(
         this.properties.treeList,
         ids,
@@ -334,7 +336,6 @@
     // 绔犺妭鍕鹃��
     checkResourceTitle(e) {
       const flag = e.detail.checked;
-      debugger;
       // 杩欎釜鏃跺�檆hecked鐨勫�兼槸fals
       let checkResourceTitleList = [];
       const item = e.currentTarget.dataset.item;
@@ -344,7 +345,6 @@
       list.forEach((item) => {
         ids.push(item.id);
       });
-      // console.log(list, 'list789');
       const updatedTreeList = this.findAndUpdateItemsByIds(
         this.properties.treeList,
         ids,

--
Gitblit v1.9.1