zhou zhou
1 天以前 6877c9caa25162e570a3e2a99a5b2ce3ef88368b
rsf-design/src/views/system/role/rolePage.helpers.js
@@ -5,13 +5,16 @@
  0: { type: 'danger', key: 'common.status.disabled', bool: false }
}
const DEFAULT_ROLE_ORDER_BY = 'create_time asc'
export function createRoleSearchState() {
  return {
    name: '',
    code: '',
    memo: '',
    status: void 0,
    condition: ''
    condition: '',
    orderBy: DEFAULT_ROLE_ORDER_BY
  }
}
@@ -46,7 +49,8 @@
    code: normalizeText(params.code),
    memo: normalizeText(params.memo),
    status: params.status,
    condition: normalizeText(params.condition)
    condition: normalizeText(params.condition),
    orderBy: normalizeText(params.orderBy) || DEFAULT_ROLE_ORDER_BY
  }
  return Object.fromEntries(Object.entries(searchParams).filter(([, value]) => hasValue(value)))
@@ -260,7 +264,7 @@
    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 || ''),
          label: resolveScopeNodeTitle(auth),
          type: 1,
          isAuthButton: true,
          authMark: auth.authMark || auth.authority || auth.code || '',
@@ -275,9 +279,7 @@
  return {
    id: normalizeScopeKey(node.id ?? node.value),
    label: normalizeScopeTitle(
      node.label || node.title || node.name || metaSource.title || node.code || ''
    ),
    label: resolveScopeNodeTitle(node, metaSource),
    type: node.type,
    path: node.path || '',
    component: node.component || '',
@@ -292,7 +294,7 @@
  const metaSource = node.meta && typeof node.meta === 'object' ? node.meta : node
  return {
    id: normalizeScopeKey(node.id ?? node.value),
    label: normalizeScopeTitle(node.label || node.title || node.name || metaSource.title || ''),
    label: resolveScopeNodeTitle(node, metaSource),
    type: 1,
    isAuthButton: true,
    authMark: node.authMark || metaSource.authMark || metaSource.authority || metaSource.code || '',
@@ -326,6 +328,23 @@
  return trimmedTitle
}
function resolveScopeNodeTitle(source = {}, metaSource = source) {
  return normalizeScopeTitle(
    source.name ||
      metaSource.name ||
      source.label ||
      source.title ||
      metaSource.title ||
      source.code ||
      metaSource.code ||
      source.authMark ||
      metaSource.authMark ||
      source.authority ||
      metaSource.authority ||
      ''
  )
}
function normalizeRoleId(value) {
  if (!hasValue(value)) {
    return void 0