From 0f9b3d3417d1b9f9d1db6e818cd02b4de2867987 Mon Sep 17 00:00:00 2001
From: zhangxiaoxu <819527061@qq.com>
Date: 星期二, 25 十一月 2025 15:59:03 +0800
Subject: [PATCH] 批量通过和批量驳回bug修改

---
 store/index.js |   32 ++++++++++++++++++++------------
 1 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/store/index.js b/store/index.js
index 03ea9c7..8041058 100644
--- a/store/index.js
+++ b/store/index.js
@@ -4,7 +4,19 @@
 
 // 璇锋眰鐩稿叧
 import { reqAll, reqGet, reqPost } from '../utils/index.js';
-
+const findNodeByNme = (arr) => {
+	for (let i = 0; i < arr.length; i++) {
+		let node = arr[i];
+		if (node.name === '姹借溅鏃ュ彂杩愯鍒掔鐞�') return node;
+		if (node.children && node.children.length > 0) {
+			// 濡傛灉褰撳墠鑺傜偣鏈夊瓙鑺傜偣锛屽垯閫掑綊鏌ユ壘瀛愯妭鐐�
+			let foundNode = findNodeByNme(node.children);
+			if (foundNode) return foundNode;
+		}
+	}
+	// 娌℃湁鎵惧埌鐩爣鑺傜偣锛岃繑鍥� null
+	return null;
+}
 const store = new Vuex.Store({
 	state: {
 		shenqingMenu: uni.getStorageSync('shenqingMenu') || false, //鐢宠鑿滃崟
@@ -34,19 +46,15 @@
 			}
 
 		},
+
 		ISHAS_RIJIHUA: (state, data) => {
+			console.log(data,'data-----',state)
 			let labelArry = []
-			let newObj = data.filter(e => e.label == '鍦伴攢璁¢噺')
-			newObj && newObj.forEach(e => {
-				if(e.children.length > 0) {
-					e.children.forEach(item => {
-						labelArry.push(item.label)
-					})
-				}else{
-					state.rijihuaMenu = false
-					uni.setStorageSync('rijihuaMenu',state.rijihuaMenu)
-				}
-			})
+			// let newObj = data.filter(e => e.label == '姹借溅鏃ュ彂杩愯鍒掔鐞�')
+			let newObj = findNodeByNme(data)  //鎵� 姹借溅鏃ュ彂杩愯鍒掔鐞�
+			if(newObj && newObj.label) {
+				labelArry.push(newObj.label)
+			}
 			if(labelArry.indexOf('姹借溅鏃ュ彂杩愯鍒掔鐞�') > -1) {
 				state.rijihuaMenu = true
 				uni.setStorageSync('rijihuaMenu',state.rijihuaMenu)

--
Gitblit v1.9.1