From a6266ae4d5e642eaca0f28d107cf6ce72cd618d6 Mon Sep 17 00:00:00 2001
From: yangyin <18723093654@163.com>
Date: 星期五, 13 十二月 2024 17:15:38 +0800
Subject: [PATCH] 删除注释

---
 src/views/project/yw/dataManage/workFlowMgr/WorkFlowIndex.vue |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/views/project/yw/dataManage/workFlowMgr/WorkFlowIndex.vue b/src/views/project/yw/dataManage/workFlowMgr/WorkFlowIndex.vue
index 5fd21c1..302a572 100644
--- a/src/views/project/yw/dataManage/workFlowMgr/WorkFlowIndex.vue
+++ b/src/views/project/yw/dataManage/workFlowMgr/WorkFlowIndex.vue
@@ -194,14 +194,12 @@
 };
 // 鏇存柊鏍戝舰缁撴瀯鍜屽伐浣滄祦鍒楄〃
 const updateSampleListsAndGroupNames = (tree_Data, work_Data) => {
-	console.log('馃殌 ~ work_Data:', work_Data);
 	let new_tree_Data = [];
 	tree_Data.forEach((node, index) => {
 		if (node.group_type == OptClassificationMap[classificationEnum.Knowledge]) {
 			new_tree_Data.push(node);
 		}
 	});
-	console.log('馃殌 ~ new_tree_Data:', new_tree_Data);
 	// 涓烘瘡涓妭鐐瑰叧鑱斿伐浣滄祦鏁版嵁
 	new_tree_Data.forEach((node) => {
 		node.sampleList = work_Data
@@ -225,9 +223,8 @@
 		ParentID: 'p_group_id',
 		Children: 'children',
 	});
-
-	// 鍚堝苟瀛愯妭鐐圭殑宸ヤ綔娴佸垪琛紝骞舵洿鏂扮粍鍚�
-	byParentData.forEach((item) => {
+	const updatedByParentData = byParentData.reduce((accumulator, item) => {
+		// 澶勭悊瀛愯妭鐐癸紝绱姞sampleList
 		if (item.children && item.children.length > 0) {
 			item.children.forEach((child_node) => {
 				item.sampleList = item.sampleList.concat(child_node.sampleList);
@@ -235,9 +232,13 @@
 		}
 		// 绉婚櫎鏃х殑璁℃暟骞舵坊鍔犳柊鐨勮鏁�
 		item.group_name = item.group_name.replace(/ \([^)]*\)$/, '') + ` (${item.sampleList.length})`;
-	});
+		// 灏嗗綋鍓嶉」娣诲姞鍒扮疮鍔犲櫒涓�
+		accumulator.push(item);
+		// 杩斿洖绱姞鍣�
+		return accumulator;
+	}, []); // 鍒濆鍖栫疮鍔犲櫒涓虹┖鏁扮粍
 
-	return byParentData;
+	return updatedByParentData;
 };
 // 鎻掑叆涓�鏉℃暟鎹椂璋冪敤
 const addDataAndRecalculateGroupNames = (new_tree_Data, work_Data, newWorkData) => {

--
Gitblit v1.9.3