|
@@ -1,7 +1,7 @@
|
|
/*
|
|
/*
|
|
* @Author: your name
|
|
* @Author: your name
|
|
* @Date: 2024-05-21 14:21:20
|
|
* @Date: 2024-05-21 14:21:20
|
|
- * @LastEditTime: 2024-06-11 14:20:54
|
|
|
|
|
|
+ * @LastEditTime: 2024-06-12 10:23:19
|
|
* @LastEditors: bogon
|
|
* @LastEditors: bogon
|
|
* @Description: In User Settings Edit
|
|
* @Description: In User Settings Edit
|
|
* @FilePath: /performance-test/src/utils/getMenu.js
|
|
* @FilePath: /performance-test/src/utils/getMenu.js
|
|
@@ -60,7 +60,7 @@ export const checkDataAuthTreeFn = (data) => {
|
|
recursiveFind(data);
|
|
recursiveFind(data);
|
|
function recursiveFind(data) {
|
|
function recursiveFind(data) {
|
|
data.forEach((item) => {
|
|
data.forEach((item) => {
|
|
- if (item.checked === 1) {
|
|
|
|
|
|
+ if (item.checked === 1 && item.children.length === 0) {
|
|
list.push(item.codeNumber);
|
|
list.push(item.codeNumber);
|
|
}
|
|
}
|
|
if (item.children && item.children.length > 0) {
|
|
if (item.children && item.children.length > 0) {
|
|
@@ -77,10 +77,10 @@ export const getCheckDataAuthTreeFn = (checkIdList, data) => {
|
|
if (checkIdList.includes(node.codeNumber)) {
|
|
if (checkIdList.includes(node.codeNumber)) {
|
|
// 将当前节点的 codeNumber 加入到列表中
|
|
// 将当前节点的 codeNumber 加入到列表中
|
|
list.push({ codeNumber: node.codeNumber, codeType: node.type });
|
|
list.push({ codeNumber: node.codeNumber, codeType: node.type });
|
|
- // 将当前节点的祖先节点的 codeNumber 加入到列表中
|
|
|
|
|
|
+ // 将当前节点的祖先节点的
|
|
ancestors.forEach((ancestor) => {
|
|
ancestors.forEach((ancestor) => {
|
|
- list.push({ codeNumber: ancestor.codeNumber, codeType: node.type });
|
|
|
|
- });
|
|
|
|
|
|
+ list.push({ codeNumber: ancestor.codeNumber, codeType: ancestor.type });
|
|
|
|
+ }); //codeNumber 加入到列表中
|
|
}
|
|
}
|
|
// 递归遍历子节点
|
|
// 递归遍历子节点
|
|
if (node.children && node.children.length > 0) {
|
|
if (node.children && node.children.length > 0) {
|