| | |
| | | } |
| | | |
| | | return Object.fromEntries( |
| | | Object.entries(searchParams).filter(([, value]) => value !== '' && value !== void 0 && value !== null) |
| | | Object.entries(searchParams).filter( |
| | | ([, value]) => value !== '' && value !== void 0 && value !== null |
| | | ) |
| | | ) |
| | | } |
| | | |
| | |
| | | return null |
| | | } |
| | | |
| | | const source = ROLE_REPORT_SOURCE_ALIAS[column.source ?? column.prop] ?? column.source ?? column.prop |
| | | const source = |
| | | ROLE_REPORT_SOURCE_ALIAS[column.source ?? column.prop] ?? column.source ?? column.prop |
| | | if (!source || !allowedColumns.has(source) || seenSources.has(source)) { |
| | | return null |
| | | } |
| | |
| | | return [] |
| | | } |
| | | |
| | | return treeData |
| | | .map((node) => normalizeRoleScopeNode(scopeType, node)) |
| | | .filter(Boolean) |
| | | return treeData.map((node) => normalizeRoleScopeNode(scopeType, node)).filter(Boolean) |
| | | } |
| | | |
| | | function normalizeRoleScopeNode(scopeType, node) { |
| | |
| | | ? normalizeRoleScopeTreeData(scopeType, node.children) |
| | | : [] |
| | | const metaSource = node.meta && typeof node.meta === 'object' ? node.meta : node |
| | | const authNodes = scopeType === 'menu' && Array.isArray(metaSource.authList) && metaSource.authList.length |
| | | ? metaSource.authList.map((auth, index) => ({ |
| | | id: normalizeScopeKey(auth.id ?? auth.authMark ?? `${node.id || 'auth'}-${index}`), |
| | | label: normalizeScopeTitle(auth.title || auth.name || auth.authMark || ''), |
| | | type: 1, |
| | | isAuthButton: true, |
| | | authMark: auth.authMark || auth.authority || auth.code || '', |
| | | children: [] |
| | | })) |
| | | : [] |
| | | const authNodes = |
| | | scopeType === 'menu' && Array.isArray(metaSource.authList) && metaSource.authList.length |
| | | ? metaSource.authList.map((auth, index) => ({ |
| | | id: normalizeScopeKey(auth.id ?? auth.authMark ?? `${node.id || 'auth'}-${index}`), |
| | | label: normalizeScopeTitle(auth.title || auth.name || auth.authMark || ''), |
| | | type: 1, |
| | | isAuthButton: true, |
| | | authMark: auth.authMark || auth.authority || auth.code || '', |
| | | children: [] |
| | | })) |
| | | : [] |
| | | |
| | | const mergedChildren = |
| | | authNodes.length > 0 && !children.some((child) => child.isAuthButton) |
| | |
| | | } |
| | | |
| | | return Array.from( |
| | | new Set( |
| | | keys |
| | | .map((key) => normalizeRoleId(key)) |
| | | .filter((key) => key !== void 0) |
| | | ) |
| | | new Set(keys.map((key) => normalizeRoleId(key)).filter((key) => key !== void 0)) |
| | | ) |
| | | } |
| | | |