zhou zhou
3 天以前 df8467bc8891af847802cc6aee501c18d50f451a
rsf-design/src/views/system/role/rolePage.helpers.js
@@ -28,7 +28,9 @@
  }
  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
    )
  )
}
@@ -86,7 +88,8 @@
        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
      }
@@ -224,9 +227,7 @@
    return []
  }
  return treeData
    .map((node) => normalizeRoleScopeNode(scopeType, node))
    .filter(Boolean)
  return treeData.map((node) => normalizeRoleScopeNode(scopeType, node)).filter(Boolean)
}
function normalizeRoleScopeNode(scopeType, node) {
@@ -242,16 +243,17 @@
    ? 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)
@@ -291,11 +293,7 @@
  }
  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))
  )
}